diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 044b82b11..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: 2 -jobs: - build: - working_directory: ~/circleci-java - docker: - - image: circleci/openjdk:8-jdk-stretch - - steps: - - checkout - - restore_cache: # restore the saved cache after the first run or if `pom.xml` has changed - key: circleci-demo-java-spring-{{ checksum "pom.xml" }} - - run: mvn dependency:go-offline # gets the project dependencies - - save_cache: - paths: - - ~/.m2 - key: circleci-demo-java-spring-{{ checksum "pom.xml" }} - - - run: mvn package diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..8628b45bd --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +root = true + +[*] +max_line_length = 100 +indent_size = 2 + +[{version-rules.xml,maven-wrapper.properties,checkstyle.xml,docker-compose.yaml,docker-compose.yml,Dockerfile,example_target_info.json,mise.toml,mvnm,mvnw.cmd,generate-protobuf.sh,super-linter.env,.gitleaksignore,*.json5}] +max_line_length = 200 + +[{grafana-dashboard-*.json,.editorconfig}] +max_line_length = 300 + +[pom.xml] +max_line_length = 110 + +[*.py] +# checked by black +indent_size = 4 +max_line_length = 120 diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 000000000..fb9b4d9d4 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,17 @@ +# .github/release.yml + +changelog: + categories: + - title: 🏕 Features + labels: + - "*" + exclude: + labels: + - chore + - dependencies + - title: 🧹 Chore + labels: + - chore + - title: 👒 Dependencies + labels: + - dependencies diff --git a/.github/renovate.json5 b/.github/renovate.json5 new file mode 100644 index 000000000..67c8c137f --- /dev/null +++ b/.github/renovate.json5 @@ -0,0 +1,31 @@ +{ + $schema: "https://docs.renovatebot.com/renovate-schema.json", + extends: ["config:best-practices", "config:recommended"], + platformCommit: "enabled", + automerge: true, + ignorePaths: [ + "**/simpleclient-archive/**", + // old projects + // agent resources packages an OTel API that is the minimum required API version + "**/prometheus-metrics-exporter-opentelemetry-otel-agent-resources/pom.xml", + ], + labels: ["dependencies"], + packageRules: [ + { + matchPackageNames: ["jdx/mise"], + groupName: "mise", + schedule: ["before 4am on monday"], + }, + ], + customManagers: [ + { + customType: "regex", + description: "update mise", + managerFilePatterns: ["/(^|/)(workflow-templates|\\.(?:github|gitea|forgejo)/(?:workflows|actions))/.+\\.ya?ml$/", "/(^|/)action\\.ya?ml$/"], + datasourceTemplate: "github-release-attachments", + packageNameTemplate: "jdx/mise", + depNameTemplate: "mise", + matchStrings: ["jdx/mise-action.*\\n\\s*with:\\s*\\n\\s*version: [\"']?(?v[.\\d]+)[\"']?\\s*\\n\\s*sha256: [\"']?(?\\w+)[\"']?"], + }, + ], +} diff --git a/.github/super-linter.env b/.github/super-linter.env new file mode 100644 index 000000000..62850b064 --- /dev/null +++ b/.github/super-linter.env @@ -0,0 +1,41 @@ +FILTER_REGEX_EXCLUDE=mvnw|src/main/generated/.*|docs/themes/.*|keystore.pkcs12|.*.java|prometheus-metrics-exporter-opentelemetry-shaded/pom.xml|CODE_OF_CONDUCT.md +IGNORE_GITIGNORED_FILES=true +JAVA_FILE_NAME=google_checks.xml +# conflicts with prettier +VALIDATE_BIOME_FORMAT=false +# conflicts with prettier +VALIDATE_BIOME_LINT=false +# disable kubernetes linter - complains about resource limits, etc +VALIDATE_CHECKOV=false +VALIDATE_CSS=false +VALIDATE_CSS_PRETTIER=false +VALIDATE_DOCKERFILE_HADOLINT=false +VALIDATE_GIT_COMMITLINT=false +# done by maven +VALIDATE_GOOGLE_JAVA_FORMAT=false +# times out +VALIDATE_GO_MODULES=false +VALIDATE_HTML=false +# done by checkstyle +VALIDATE_JAVA=false +# we have many duplicate code in our codebase for demo purposes +VALIDATE_JSCPD=false +VALIDATE_PYTHON_PYLINT=false +# conflicts with black +VALIDATE_PYTHON_RUFF_FORMAT=false +# excluding simpleclient-archive doesn't seem to work +VALIDATE_TRIVY=false + +FIX_ENV=true +FIX_GITHUB_ACTIONS_ZIZMOR=true +FIX_GO=true +FIX_JAVASCRIPT_PRETTIER=true +FIX_JSON=true +FIX_JSONC=true +FIX_JSONC_PRETTIER=true +FIX_JSON_PRETTIER=true +FIX_MARKDOWN=true +FIX_MARKDOWN_PRETTIER=true +FIX_PYTHON_BLACK=true +FIX_SHELL_SHFMT=true +FIX_YAML_PRETTIER=true diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml new file mode 100644 index 000000000..8f22554bd --- /dev/null +++ b/.github/workflows/acceptance-tests.yml @@ -0,0 +1,21 @@ +--- +name: OpenTelemetry Acceptance Tests + +on: [pull_request] + +permissions: {} + +jobs: + acceptance-tests: + runs-on: ubuntu-24.04 + steps: + - name: Check out + with: + persist-credentials: false + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1 + with: + version: v2026.1.1 + sha256: 986e4630dfdfaae41d09c0317507e252c7403d72839fc66844b534c120a3dc57 + - name: Run acceptance tests + run: mise run acceptance-test diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..012e79248 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,27 @@ +--- +name: Build + +on: [pull_request] + +permissions: {} + +jobs: + build: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + with: + persist-credentials: false + - uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1 + with: + version: v2026.1.1 + sha256: 986e4630dfdfaae41d09c0317507e252c7403d72839fc66844b534c120a3dc57 + - name: Cache local Maven repository + uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Run the Maven verify phase + run: mise run ci diff --git a/.github/workflows/github-pages.yaml b/.github/workflows/github-pages.yaml new file mode 100644 index 000000000..814cfef61 --- /dev/null +++ b/.github/workflows/github-pages.yaml @@ -0,0 +1,73 @@ +name: Deploy Documentation to Github Pages + +on: + # Runs on pushes targeting the 1.0.x branch + push: + branches: + - main + tags: + - "v*.*.*" # updates the version in the docs + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +permissions: {} + +# Allow only one concurrent deployment, skipping runs queued between +# the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow +# these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +# Default to bash +defaults: + run: + shell: bash + +jobs: + # Build job + build: + if: github.repository == 'prometheus/client_java' + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + with: + persist-credentials: false + fetch-tags: "true" + fetch-depth: 0 + - uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1 + with: + version: v2026.1.1 + sha256: 986e4630dfdfaae41d09c0317507e252c7403d72839fc66844b534c120a3dc57 + cache: "false" + - name: Setup Pages + id: pages + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 + - name: Build GitHub Pages + run: mise run build-gh-pages + env: + BASE_URL: "${{ steps.pages.outputs.base_url }}/" + - name: Upload artifact + uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4 + with: + path: ./docs/public + # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages + + # Deployment job + deploy: + if: github.repository == 'prometheus/client_java' + permissions: + contents: read + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-24.04 + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 diff --git a/.github/workflows/lint-rest.yml b/.github/workflows/lint-rest.yml new file mode 100644 index 000000000..7180d9999 --- /dev/null +++ b/.github/workflows/lint-rest.yml @@ -0,0 +1,21 @@ +--- +name: Lint What Super Linter Can't + +on: [pull_request] + +permissions: {} + +jobs: + lint: + runs-on: ubuntu-24.04 + steps: + - name: Check out + with: + persist-credentials: false + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1 + with: + version: v2026.1.1 + sha256: 986e4630dfdfaae41d09c0317507e252c7403d72839fc66844b534c120a3dc57 + - name: Lint + run: mise run lint:rest diff --git a/.github/workflows/native-tests.yml b/.github/workflows/native-tests.yml new file mode 100644 index 000000000..bad40289e --- /dev/null +++ b/.github/workflows/native-tests.yml @@ -0,0 +1,23 @@ +--- +name: GraalVM Native Tests + +on: [pull_request] + +permissions: {} + +jobs: + native-tests: + runs-on: ubuntu-24.04 + steps: + - name: Check out + with: + persist-credentials: false + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1 + with: + version: v2026.1.1 + sha256: 986e4630dfdfaae41d09c0317507e252c7403d72839fc66844b534c120a3dc57 + working_directory: .mise/envs/native + - name: Run native tests + working-directory: .mise/envs/native + run: mise native-test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..a8d3d90c9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,54 @@ +--- +name: Deploy to Maven Central + +on: + push: + tags: + - "v*.*.*" + +jobs: + deploy: + if: ${{ github.repository == 'prometheus/client_java' }} + runs-on: ubuntu-24.04 + permissions: {} + + steps: + - name: Debug gpg key + env: + GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} + run: | + echo "${#GPG_SIGNING_KEY}" + echo "${GPG_SIGNING_KEY}" | gpg --batch --import-options import-show --import + - name: Checkout Plugin Repository + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + with: + persist-credentials: false + + - uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1 + with: + version: v2026.1.1 + sha256: 986e4630dfdfaae41d09c0317507e252c7403d72839fc66844b534c120a3dc57 + cache: false + + - name: Build release version + run: mise run build-release + env: + TAG: ${{ github.ref_name }} + + - name: Set up Apache Maven Central + uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5 + with: + distribution: "temurin" + java-version: "21" + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + + - name: Publish to Apache Maven Central + run: mvn deploy -P 'release,!default' -Dmaven.test.skip=true + env: + MAVEN_USERNAME: ${{ secrets.SONATYPE_MAVEN_REPOSITORY_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_REPOSITORY_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSPHRASE }} diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml new file mode 100644 index 000000000..eba4d3890 --- /dev/null +++ b/.github/workflows/super-linter.yml @@ -0,0 +1,30 @@ +--- +name: Lint + +on: [pull_request] + +jobs: + lint: + runs-on: ubuntu-24.04 + + permissions: + contents: read + packages: read + # To report GitHub Actions status checks + statuses: write + + steps: + - name: Checkout code + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + persist-credentials: false + fetch-depth: 0 + + - name: Load super-linter configuration + run: grep -v '^#' .github/super-linter.env | grep -v 'FIX_' >> "$GITHUB_ENV" + + - name: Super-linter + uses: super-linter/super-linter@d5b0a2ab116623730dd094f15ddc1b6b25bf7b99 # v8.3.2 + env: + # To report GitHub Actions status checks + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test-release-build.yml b/.github/workflows/test-release-build.yml new file mode 100644 index 000000000..468a39f22 --- /dev/null +++ b/.github/workflows/test-release-build.yml @@ -0,0 +1,34 @@ +--- +name: Test Build Release + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +permissions: {} + +jobs: + build: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + with: + persist-credentials: false + - uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1 + with: + version: v2026.1.1 + sha256: 986e4630dfdfaae41d09c0317507e252c7403d72839fc66844b534c120a3dc57 + - name: Cache local Maven repository + uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Build release version + run: mise run build-release + env: + # don't use the current snapshot version, to test a more realistic release + TAG: ${{ github.run_number }} diff --git a/.gitignore b/.gitignore index 66caafdaf..b727017a9 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,14 @@ *.iml target/ +build/ simpleclient_pushgateway/mockserver.log simpleclient_pushgateway/mockserver_request.log nb-configuration.xml +dependency-reduced-pom.xml +**/.classpath +**.project +**/.settings/ +docs/public +.lycheecache diff --git a/.gitleaksignore b/.gitleaksignore new file mode 100644 index 000000000..605fefa97 --- /dev/null +++ b/.gitleaksignore @@ -0,0 +1,2 @@ +/tmp/lint/integration-tests/it-pushgateway/src/test/resources/pushgateway-ssl.yaml:private-key:36 +/github/workspace/integration-tests/it-pushgateway/src/test/resources/pushgateway-ssl.yaml:private-key:36 diff --git a/.idea/icon.svg b/.idea/icon.svg new file mode 100644 index 000000000..5c51f66d9 --- /dev/null +++ b/.idea/icon.svg @@ -0,0 +1,50 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/.mise/envs/native/mise.toml b/.mise/envs/native/mise.toml new file mode 100644 index 000000000..de9c06a68 --- /dev/null +++ b/.mise/envs/native/mise.toml @@ -0,0 +1,8 @@ +[tools] +java = "oracle-graalvm-25.0.1" + +[tasks.native-test] +depends = "build" +run = "../../mvnw test -PnativeTest" +dir = "../../../integration-tests/it-spring-boot-smoke-test" + diff --git a/.mise/tasks/build-release.sh b/.mise/tasks/build-release.sh new file mode 100755 index 000000000..a29b0d22f --- /dev/null +++ b/.mise/tasks/build-release.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +#MISE description="Build release package" +#USAGE arg "" env="TAG" default="1.5.0-SNAPSHOT" + +set -euo pipefail + +# shellcheck disable=SC2154 # is set by mise +VERSION=${usage_tag#v} + +mise run set-version "$VERSION" +mvn -B package -P 'release,!default' -Dmaven.test.skip=true diff --git a/.mise/tasks/lint/bom.py b/.mise/tasks/lint/bom.py new file mode 100755 index 000000000..bada5bc9f --- /dev/null +++ b/.mise/tasks/lint/bom.py @@ -0,0 +1,120 @@ +#!/usr/bin/env python3 + +# [MISE] description="Make sure the BOM has all necessary modules" + +import difflib +import re +import sys +from fnmatch import fnmatch +from pathlib import Path +from typing import List + +ROOT = Path(__file__).resolve().parents[3] # repo root (.. from .mise/tasks/lint) +IGNORE_DIRS = {"prometheus-metrics-parent"} +MODULE_PREFIX = "prometheus-metrics" +BOM_POM = ROOT / "prometheus-metrics-bom" / "pom.xml" + + +def first_artifact_id(pom_file: Path) -> str: + """Return the second value from the given pom.xml (matches original script). + + The original shell function greps all lines and returns the second one + (head -n 2 | tail -n 1). We replicate that behavior exactly. + """ + if not pom_file.is_file(): + raise FileNotFoundError(f"File {pom_file} does not exist.") + + text = pom_file.read_text(encoding="utf-8") + matches = re.findall(r"\s*(.*?)\s*", text) + if len(matches) < 2: + return "" + return matches[1].strip() + + +def add_dir(dir_path: Path, want: List[str]): + if not dir_path.is_dir(): + raise FileNotFoundError(f"Directory {dir_path} does not exist.") + + if any(dir_path.name == ig for ig in IGNORE_DIRS): + print(f"Skipping {dir_path}") + return + + pom = dir_path / "pom.xml" + if not pom.is_file(): + raise FileNotFoundError(f"File {pom} does not exist.") + + artifact_id = first_artifact_id(pom) + if not artifact_id: + raise RuntimeError(f"No artifactId found in {pom}") + + print(f"Found artifactId '{artifact_id}' in {pom}") + want.append(artifact_id) + + +def collect_want(root: Path) -> List[str]: + want: List[str] = [] + # top-level prometheus-metrics* + for entry in sorted(root.iterdir()): + if entry.is_dir() and fnmatch(entry.name, f"{MODULE_PREFIX}*"): + add_dir(entry, want) + + # prometheus-metrics-tracer/prometheus-metrics* + tracer_dir = root / "prometheus-metrics-tracer" + if tracer_dir.is_dir(): + for entry in sorted(tracer_dir.iterdir()): + if entry.is_dir() and fnmatch(entry.name, f"{MODULE_PREFIX}*"): + add_dir(entry, want) + + # deduplicate and sort + want_unique = sorted(set(want)) + return want_unique + + +def collect_have(bom_pom: Path) -> List[str]: + if not bom_pom.is_file(): + raise FileNotFoundError(f"BOM file {bom_pom} does not exist.") + + text = bom_pom.read_text(encoding="utf-8") + # find artifactId values that start with MODULE_PREFIX + matches = re.findall( + r"\s*(%s[^<\s]*)\s*" % re.escape(MODULE_PREFIX), text + ) + return sorted(matches) + + +def main() -> int: + try: + want = collect_want(ROOT) + have = collect_have(BOM_POM) + + want_text = "\n".join(want) + have_text = "\n".join(have) + + if want_text != have_text: + print( + "The BOM file prometheus-metrics-bom/bom.xml does not match the current directory contents." + ) + print("Expected:") + print(want_text) + print("Found:") + print(have_text) + print() + diff = difflib.unified_diff( + have_text.splitlines(keepends=True), + want_text.splitlines(keepends=True), + fromfile="found", + tofile="expected", + ) + sys.stdout.writelines(diff) + return 1 + else: + print("BOM file is up to date.") + return 0 + + except Exception as e: + print(e, file=sys.stderr) + return 1 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/.mise/tasks/lint/super-linter.sh b/.mise/tasks/lint/super-linter.sh new file mode 100755 index 000000000..54c2b434e --- /dev/null +++ b/.mise/tasks/lint/super-linter.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +#MISE description="Run GitHub Super Linter on the repository" + +set -euo pipefail + +docker pull ghcr.io/super-linter/super-linter:latest + +docker run --rm \ + -e RUN_LOCAL=true \ + -e DEFAULT_BRANCH=main \ + --env-file ".github/super-linter.env" \ + -v "$(pwd)":/tmp/lint \ + ghcr.io/super-linter/super-linter:latest diff --git a/.mise/tasks/set-release-version-github-pages.sh b/.mise/tasks/set-release-version-github-pages.sh new file mode 100755 index 000000000..142d0eb82 --- /dev/null +++ b/.mise/tasks/set-release-version-github-pages.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +#MISE description="Set release version in GitHub Pages quickstart.md" + +set -euox pipefail + +version=$(git tag -l | grep 'v' | sort | tail -1 | sed 's/v//') +marker="\$version" +sed -i "s/$marker/$version/g" docs/content/getting-started/quickstart.md diff --git a/.mise/tasks/set-version.sh b/.mise/tasks/set-version.sh new file mode 100755 index 000000000..2309976ce --- /dev/null +++ b/.mise/tasks/set-version.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +#MISE description="Update version in all pom.xml files" +#USAGE arg "" help="new version" + +set -euo pipefail + +# replace all occurrences '1.5.0-SNAPSHOT' with +# '$usage_version' in all pom.xml files in the current directory and +# subdirectories + +# shellcheck disable=SC2154 # is set by mise +find . -name 'pom.xml' -exec \ + sed -i "s/1.5.0-SNAPSHOT<\/version>/$usage_version<\/version>/g" {} + diff --git a/.mise/tasks/test_update-benchmarks.py b/.mise/tasks/test_update-benchmarks.py new file mode 100644 index 000000000..3d80b4983 --- /dev/null +++ b/.mise/tasks/test_update-benchmarks.py @@ -0,0 +1,98 @@ +import os +import re +import sys +import tempfile +import unittest + +from update_benchmarks import update_pre_blocks_under_module + +# Ensure the tasks directory is importable when running the test directly +here = os.path.dirname(__file__) +if here not in sys.path: + sys.path.insert(0, here) + + +class TestRunBenchmarksFiltering(unittest.TestCase): + def setUp(self): + # sample JMH table with mixed-class lines + self.table = ( + "Benchmark Mode Cnt Score Error Units\n" + "CounterBenchmark.codahaleIncNoLabels thrpt 57881.585 ops/s\n" + "HistogramBenchmark.prometheusNative thrpt 2385.134 ops/s\n" + "TextFormatUtilBenchmark.prometheusWriteToNull thrpt 885331.328 ops/s\n" + "CounterBenchmark.prometheusInc thrpt 54090.469 ops/s\n" + ) + + # create temp dir to act as module path + self.tmpdir = tempfile.TemporaryDirectory() + self.module_path = self.tmpdir.name + + # Create three files with a javadoc
 block that contains mixed results
+        self.files = {}
+        javadoc_pre = (
+            "/**\n"
+            " * Example javadoc\n"
+            " * 
\n"
+            " * Benchmark                                             Mode  Cnt       Score   Error  Units\n"
+            " * CounterBenchmark.codahaleIncNoLabels                 thrpt        57881.585          ops/s\n"
+            " * HistogramBenchmark.prometheusNative                  thrpt         2385.134          ops/s\n"
+            " * TextFormatUtilBenchmark.prometheusWriteToNull        thrpt       885331.328          ops/s\n"
+            " * CounterBenchmark.prometheusInc                       thrpt        54090.469          ops/s\n"
+            " * 
\n" + " */\n" + ) + + for cls in ( + "CounterBenchmark", + "HistogramBenchmark", + "TextFormatUtilBenchmark", + ): + fname = os.path.join(self.module_path, f"{cls}.java") + with open(fname, "w", encoding="utf-8") as f: + f.write(javadoc_pre) + f.write(f"public class {cls} {{}}\n") + self.files[cls] = fname + + def tearDown(self): + self.tmpdir.cleanup() + + def _read_pre_contents(self, path): + with open(path, "r", encoding="utf-8") as f: + content = f.read() + m = re.search(r"
\n([\s\S]*?)
", content) + return m.group(1) if m else "" + + def test_update_only_inserts_matching_class_lines(self): + updated = update_pre_blocks_under_module(self.module_path, self.table) + # All three files should be updated + self.assertEqual( + set(os.path.basename(p) for p in updated), + { + os.path.basename(self.files["CounterBenchmark"]), + os.path.basename(self.files["HistogramBenchmark"]), + os.path.basename(self.files["TextFormatUtilBenchmark"]), + }, + ) + + # Verify CounterBenchmark file contains only CounterBenchmark lines + cb_pre = self._read_pre_contents(self.files["CounterBenchmark"]) + self.assertIn("CounterBenchmark.codahaleIncNoLabels", cb_pre) + self.assertIn("CounterBenchmark.prometheusInc", cb_pre) + self.assertNotIn("HistogramBenchmark.prometheusNative", cb_pre) + self.assertNotIn("TextFormatUtilBenchmark.prometheusWriteToNull", cb_pre) + + # Verify HistogramBenchmark contains only its line + hb_pre = self._read_pre_contents(self.files["HistogramBenchmark"]) + self.assertIn("HistogramBenchmark.prometheusNative", hb_pre) + self.assertNotIn("CounterBenchmark.codahaleIncNoLabels", hb_pre) + self.assertNotIn("TextFormatUtilBenchmark.prometheusWriteToNull", hb_pre) + + # Verify TextFormatUtilBenchmark contains only its line + tf_pre = self._read_pre_contents(self.files["TextFormatUtilBenchmark"]) + self.assertIn("TextFormatUtilBenchmark.prometheusWriteToNull", tf_pre) + self.assertNotIn("CounterBenchmark.prometheusInc", tf_pre) + self.assertNotIn("HistogramBenchmark.prometheusNative", tf_pre) + + +if __name__ == "__main__": + unittest.main() diff --git a/.mise/tasks/update_benchmarks.py b/.mise/tasks/update_benchmarks.py new file mode 100755 index 000000000..3cb550877 --- /dev/null +++ b/.mise/tasks/update_benchmarks.py @@ -0,0 +1,249 @@ +#!/usr/bin/env python3 + +# [MISE] description="Run and update JMH benchmark outputs in the benchmarks module" +# [MISE] alias="update-benchmarks" + +""" +Run benchmarks for the `benchmarks` module, capture JMH text output, and update +any
...
blocks containing "thrpt" under the `benchmarks/` module +(files such as Java sources with embedded example output in javadocs). + +Usage: ./.mise/tasks/update_benchmarks.py [--mvnw ./mvnw] [--module benchmarks] [--java java] + [--jmh-args "-f 1 -wi 0 -i 1"] + +By default this will: + - run the maven wrapper to package the benchmarks: `./mvnw -pl benchmarks -am -DskipTests package` + - locate the shaded jar under `benchmarks/target/` (named containing "benchmarks") + - run `java -jar -rf text` (add extra JMH args with --jmh-args) + - parse the first JMH table (the block starting with the "Benchmark Mode" header) + - update all files under the `benchmarks/` directory which contain a `
` block with the substring "thrpt"
+
+This script is careful to preserve Javadoc comment prefixes like " * " when replacing the
+contents of the 
 block.
+"""
+
+import argparse
+import glob
+import os
+import re
+import shlex
+import subprocess
+import sys
+from typing import List, Optional
+
+
+def run_cmd(cmd: List[str], cwd: Optional[str] = None) -> str:
+    """Run a command, stream stdout/stderr to the console for progress, and return the full output.
+
+    This replaces the previous blocking subprocess.run approach so users can see build / JMH
+    progress in real time while the command runs.
+    """
+    try:
+        proc = subprocess.Popen(
+            cmd, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True
+        )
+    except FileNotFoundError:
+        # Helpful message if the executable is not found
+        print(f"Command not found: {cmd[0]}")
+        raise
+
+    output_lines: List[str] = []
+    try:
+        assert proc.stdout is not None
+        # Stream lines as they appear and capture them for returning
+        for line in proc.stdout:
+            # Print immediately so callers (and CI) can observe progress
+            print(line, end="")
+            output_lines.append(line)
+        proc.wait()
+    except KeyboardInterrupt:
+        # If the user interrupts, ensure the child process is terminated
+        proc.kill()
+        proc.wait()
+        print("\nCommand interrupted by user.")
+        raise
+
+    output = "".join(output_lines)
+    if proc.returncode != 0:
+        print(
+            f"Command failed: {' '.join(cmd)}\nExit: {proc.returncode}\nOutput:\n{output}"
+        )
+        raise SystemExit(proc.returncode)
+    return output
+
+
+def build_benchmarks(mvnw: str, module: str) -> None:
+    print(f"Building Maven module '{module}' using {mvnw} (this may take a while)...")
+    cmd = [mvnw, "-pl", module, "-am", "-DskipTests", "clean", "package"]
+    run_cmd(cmd)
+    print("Build completed.")
+
+
+def find_benchmarks_jar(module: str) -> str:
+    pattern = os.path.join(module, "target", "*.jar")
+    jars = [p for p in glob.glob(pattern) if "original" not in p and p.endswith(".jar")]
+    # prefer jar whose basename contains module name
+    jars_pref = [j for j in jars if module in os.path.basename(j)]
+    chosen = (jars_pref or jars)[:1]
+    if not chosen:
+        raise FileNotFoundError(
+            f"No jar found in {os.path.join(module, 'target')} (tried: {pattern})"
+        )
+    jar = chosen[0]
+    print(f"Using jar: {jar}")
+    return jar
+
+
+def run_jmh(jar: str, java_cmd: str, extra_args: Optional[str]) -> str:
+    args = [java_cmd, "-jar", jar, "-rf", "text"]
+    if extra_args:
+        args += shlex.split(extra_args)
+    print(f"Running JMH: {' '.join(args)}")
+    output = run_cmd(args)
+    print("JMH run completed.")
+    return output
+
+
+def extract_first_table(jmh_output: str) -> str:
+    # Try to extract the first table that starts with "Benchmark" header and continues until a blank line
+    m = re.search(r"(\nBenchmark\s+Mode[\s\S]*?)(?:\n\s*\n|\Z)", jmh_output)
+    if not m:
+        # fallback: collect all lines that contain 'thrpt' plus a header if present
+        lines = [line for line in jmh_output.splitlines() if "thrpt" in line]
+        if not lines:
+            raise ValueError('Could not find any "thrpt" lines in JMH output')
+        # try to find header
+        header = next(
+            (
+                line
+                for line in jmh_output.splitlines()
+                if line.startswith("Benchmark") and "Mode" in line
+            ),
+            "Benchmark                                     Mode  Cnt      Score     Error  Units",
+        )
+        return header + "\n" + "\n".join(lines)
+    table = m.group(1).strip("\n")
+    # Ensure we return only the table lines (remove any leading iteration info lines that JMH sometimes prints)
+    # Normalize spaces: keep as-is
+    return table
+
+
+def filter_table_for_class(table: str, class_name: str) -> Optional[str]:
+    """
+    Return a table string that contains only the header and the lines belonging to `class_name`.
+    If no matching lines are found, return None.
+    """
+    lines = table.splitlines()
+    # find header line index (starts with 'Benchmark' and contains 'Mode')
+    header_idx = None
+    for i, ln in enumerate(lines):
+        if ln.strip().startswith("Benchmark") and "Mode" in ln:
+            header_idx = i
+            break
+    header = (
+        lines[header_idx]
+        if header_idx is not None
+        else "Benchmark                                     Mode  Cnt      Score     Error  Units"
+    )
+
+    matched = []
+    pattern = re.compile(r"^\s*" + re.escape(class_name) + r"\.")
+    for ln in lines[header_idx + 1 if header_idx is not None else 0 :]:
+        if "thrpt" in ln and pattern.search(ln):
+            matched.append(ln)
+
+    if not matched:
+        return None
+    return header + "\n" + "\n".join(matched)
+
+
+def update_pre_blocks_under_module(module: str, table: str) -> List[str]:
+    # Find files under module and update any 
...
block that contains 'thrpt' + updated_files = [] + for path in glob.glob(os.path.join(module, "**"), recursive=True): + if os.path.isdir(path): + continue + try: + with open(path, "r", encoding="utf-8") as f: + content = f.read() + except Exception: + continue + # quick filter + if "
" not in content or "thrpt" not in content:
+            continue
+
+        original = content
+
+        # Determine the class name from the filename (e.g. TextFormatUtilBenchmark.java -> TextFormatUtilBenchmark)
+        base = os.path.basename(path)
+        class_name = os.path.splitext(base)[0]
+
+        # Build a filtered table for this class; if no matching lines, skip updating this file
+        filtered_table = filter_table_for_class(table, class_name)
+        if filtered_table is None:
+            # nothing to update for this class
+            continue
+
+        # Regex to find any line-starting Javadoc prefix like " * " before 
+        # This will match patterns like: " * 
... 
" and capture the prefix (e.g. " * ") + pattern = re.compile(r"(?m)^(?P[ \t]*\*[ \t]*)
[\s\S]*?
") + + def repl(m: re.Match) -> str: + prefix = m.group("prefix") + # Build the new block with the same prefix on each line + lines = filtered_table.splitlines() + replaced = prefix + "
\n"
+            for ln in lines:
+                replaced += prefix + ln.rstrip() + "\n"
+            replaced += prefix + "
" + return replaced + + new_content, nsubs = pattern.subn(repl, content) + if nsubs > 0 and new_content != original: + with open(path, "w", encoding="utf-8") as f: + f.write(new_content) + updated_files.append(path) + print(f"Updated {path}: replaced {nsubs}
 block(s)")
+    return updated_files
+
+
+def main(argv: List[str]):
+    parser = argparse.ArgumentParser()
+    parser.add_argument("--mvnw", default="./mvnw", help="Path to maven wrapper")
+    parser.add_argument(
+        "--module", default="benchmarks", help="Module directory to build/run"
+    )
+    parser.add_argument("--java", default="java", help="Java command")
+    parser.add_argument(
+        "--jmh-args",
+        default="",
+        help='Extra arguments to pass to the JMH main (e.g. "-f 1 -wi 0 -i 1")',
+    )
+    args = parser.parse_args(argv)
+
+    build_benchmarks(args.mvnw, args.module)
+    jar = find_benchmarks_jar(args.module)
+    output = run_jmh(jar, args.java, args.jmh_args)
+
+    # Print a short preview of the JMH output
+    preview = "\n".join(output.splitlines()[:120])
+    print("\n--- JMH output preview ---")
+    print(preview)
+    print("--- end preview ---\n")
+
+    table = extract_first_table(output)
+
+    updated = update_pre_blocks_under_module(args.module, table)
+
+    if not updated:
+        print(
+            'No files were updated (no 
 blocks with "thrpt" found under the module).'
+        )
+    else:
+        print("\nUpdated files:")
+        for p in updated:
+            print(" -", p)
+
+
+if __name__ == "__main__":
+    main(sys.argv[1:])
diff --git a/.mvn/jvm.config b/.mvn/jvm.config
new file mode 100644
index 000000000..32599cefe
--- /dev/null
+++ b/.mvn/jvm.config
@@ -0,0 +1,10 @@
+--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
+--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
+--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar
deleted file mode 100644
index c6feb8bb6..000000000
Binary files a/.mvn/wrapper/maven-wrapper.jar and /dev/null differ
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
index 6637cedb2..5f1f57004 100644
--- a/.mvn/wrapper/maven-wrapper.properties
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -1 +1,2 @@
-distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip
\ No newline at end of file
+distributionType=only-script
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12/apache-maven-3.9.12-bin.zip
diff --git a/.yaml-lint.yml b/.yaml-lint.yml
new file mode 100644
index 000000000..a06ffeed5
--- /dev/null
+++ b/.yaml-lint.yml
@@ -0,0 +1,5 @@
+extends: relaxed
+
+rules:
+  line-length:
+    max: 120
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 000000000..d325872bd
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,3 @@
+# Prometheus Community Code of Conduct
+
+Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md).
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 3bbe74bc2..5be7b073d 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,11 +2,62 @@
 
 Prometheus uses GitHub to manage reviews of pull requests.
 
-* If you have a trivial fix or improvement, go ahead and create a pull request,
+- If you have a trivial fix or improvement, go ahead and create a pull request,
   addressing (with `@...`) the maintainer of this repository (see
-  [MAINTAINERS.md](MAINTAINERS.md)) in the description of the pull request.
+  [MAINTAINERS.md](MAINTAINERS.md)) in the
+  description of the pull request.
 
-* If you plan to do something more involved, first discuss your ideas
+- If you plan to do something more involved, first discuss your ideas
   on our [mailing list](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers).
   This will avoid unnecessary work and surely give you and us a good deal
   of inspiration.
+
+## Formatting
+
+This repository uses [Google Java Format](https://github.com/google/google-java-format) to format
+the code.
+
+Run `./mvnw spotless:apply` to format the code (only changed files) before committing.
+
+## Running Tests
+
+If you're getting errors when running tests:
+
+- Make sure that the IDE uses only the "Maven Shade" dependency of "
+  prometheus-metrics-exposition-formats" and the "prometheus-metrics-tracer\*" dependencies.
+
+### Running native tests
+
+```shell
+mise --cd .mise/envs/native run native-test
+```
+
+### Avoid failures while running tests
+
+- Use `-Dspotless.check.skip=true` to skip the formatting check during development.
+- Use `-Dcoverage.skip=true` to skip the coverage check during development.
+- Use `-Dcheckstyle.skip=true` to skip the checkstyle check during development.
+- Use `-Dwarnings=-nowarn` to skip the warnings during development.
+
+Combine all with
+
+```shell
+./mvnw install -DskipTests -Dspotless.check.skip=true -Dcoverage.skip=true \
+  -Dcheckstyle.skip=true -Dwarnings=-nowarn
+```
+
+or simply
+
+```shell
+mise run compile
+```
+
+## Updating the Protobuf Java Classes
+
+In the failing PR from renovate, run:
+
+```shell
+mise run generate
+```
+
+Add the new `Metrics.java` to Git and commit it.
diff --git a/MAINTAINERS.md b/MAINTAINERS.md
index d1cb20b89..cf0a885eb 100644
--- a/MAINTAINERS.md
+++ b/MAINTAINERS.md
@@ -1 +1,6 @@
-* Brian Brazil 
+# Maintainers
+
+- Fabian Stäber  @fstab
+- Doug Hoard  @dhoard
+- Tom Wilkie  @tomwilkie
+- Gregor Zeitlinger  @zeitlinger
diff --git a/README.md b/README.md
index 41037dddf..a6b611db2 100644
--- a/README.md
+++ b/README.md
@@ -1,715 +1,26 @@
-# Prometheus JVM Client
-It supports Java, Clojure, Scala, JRuby, and anything else that runs on the JVM.
+# Prometheus Java Metrics Library
 
-[![Build Status](https://travis-ci.org/prometheus/client_java.png?branch=master)](https://travis-ci.org/prometheus/client_java)
+[![Build](https://github.com/prometheus/client_java/actions/workflows/build.yml/badge.svg)](https://github.com/prometheus/client_java/actions/workflows/build.yml) java 8+ Apache 2.0 # editorconfig-checker-disable-line
 
-Table of Contents
-=================
+## Documentation
 
-  * [Using](#using)
-     * [Assets](#assets)
-     * [Javadocs](#javadocs)
-  * [Instrumenting](#instrumenting)
-     * [Counter](#counter)
-     * [Gauge](#gauge)
-     * [Summary](#summary)
-     * [Histogram](#histogram)
-     * [Labels](#labels)
-     * [Registering Metrics](#registering-metrics)
-  * [Included Collectors](#included-collectors)
-     * [Logging](#logging)
-     * [Caches](#caches)
-     * [Hibernate](#hibernate)
-     * [Jetty](#jetty)
-  * [Exporting](#exporting)
-     * [HTTP](#http)
-  * [Exporting to a Pushgateway](#exporting-to-a-pushgateway)
-  * [Bridges](#bridges)
-     * [Graphite](#graphite)
-  * [Custom Collectors](#custom-collectors)
-  * [Contact](#contact)
+[https://prometheus.github.io/client_java](https://prometheus.github.io/client_java)
 
-## Using
-### Assets
-If you use Maven, you can simply reference the assets below.  The latest
-version can be found on in the maven repository for
-[io.prometheus](http://mvnrepository.com/artifact/io.prometheus).
+## Contributing and community
 
-```xml
-
-
-  io.prometheus
-  simpleclient
-  0.6.0
-
-
-
-  io.prometheus
-  simpleclient_hotspot
-  0.6.0
-
-
-
-  io.prometheus
-  simpleclient_httpserver
-  0.6.0
-
-
-
-  io.prometheus
-  simpleclient_pushgateway
-  0.6.0
-
-```
+See [CONTRIBUTING.md](CONTRIBUTING.md) and
+the [community section](http://prometheus.io/community/)
+of the Prometheus homepage.
 
-### Javadocs
-There are canonical examples defined in the class definition Javadoc of the client packages.
+The Prometheus Java community is present on the [CNCF Slack](https://cloud-native.slack.com) on
+`#prometheus-java`, and we have a fortnightly community call in
+the [Prometheus public calendar](https://prometheus.io/community/).
 
-Documentation can be found at the [Java Client
-Github Project Page](http://prometheus.github.io/client_java).
+## Previous Releases
 
-## Instrumenting
+The source code for 0.16.0 and older is on
+the [simpleclient](https://github.com/prometheus/client_java/tree/simpleclient) branch.
 
-Four types of metrics are offered: Counter, Gauge, Summary and Histogram.
-See the documentation on [metric types](http://prometheus.io/docs/concepts/metric_types/)
-and [instrumentation best practices](http://prometheus.io/docs/practices/instrumentation/#counter-vs.-gauge,-summary-vs.-histogram)
-on how to use them.
+## License
 
-### Counter
-
-Counters go up, and reset when the process restarts.
-
-
-```java
-import io.prometheus.client.Counter;
-class YourClass {
-  static final Counter requests = Counter.build()
-     .name("requests_total").help("Total requests.").register();
-
-  void processRequest() {
-    requests.inc();
-    // Your code here.
-  }
-}
-```
-
-### Gauge
-
-Gauges can go up and down.
-
-```java
-class YourClass {
-  static final Gauge inprogressRequests = Gauge.build()
-     .name("inprogress_requests").help("Inprogress requests.").register();
-
-  void processRequest() {
-    inprogressRequests.inc();
-    // Your code here.
-    inprogressRequests.dec();
-  }
-}
-```
-
-There are utilities for common use cases:
-
-```java
-gauge.setToCurrentTime(); // Set to current unixtime.
-```
-
-As an advanced use case, a `Gauge` can also take its value from a callback by using the
-[setChild()](https://prometheus.io/client_java/io/prometheus/client/SimpleCollector.html#setChild-Child-java.lang.String...-)
-method. Keep in mind that the default `inc()`, `dec()` and `set()` methods on Gauge take care of thread safety, so
-when using this approach ensure the value you are reporting accounts for concurrency.
-
-
-### Summary
-
-Summaries track the size and number of events.
-
-```java
-class YourClass {
-  static final Summary receivedBytes = Summary.build()
-     .name("requests_size_bytes").help("Request size in bytes.").register();
-  static final Summary requestLatency = Summary.build()
-     .name("requests_latency_seconds").help("Request latency in seconds.").register();
-
-  void processRequest(Request req) {
-    Summary.Timer requestTimer = requestLatency.startTimer();
-    try {
-      // Your code here.
-    } finally {
-      receivedBytes.observe(req.size());
-      requestTimer.observeDuration();
-    }
-  }
-}
-```
-
-There are utilities for timing code and support for [quantiles](https://prometheus.io/docs/practices/histograms/#quantiles).
-Essentially quantiles aren't aggregatable and add some client overhead for the calculation.
-
-```java
-class YourClass {
-  static final Summary requestLatency = Summary.build()
-    .quantile(0.5, 0.05)   // Add 50th percentile (= median) with 5% tolerated error
-    .quantile(0.9, 0.01)   // Add 90th percentile with 1% tolerated error
-    .name("requests_latency_seconds").help("Request latency in seconds.").register();
-
-  void processRequest(Request req) {
-    requestLatency.time(new Runnable() {
-      public abstract void run() {
-        // Your code here.
-      }
-    });
-
-
-    // Or the Java 8 lambda equivalent
-    requestLatency.time(() -> {
-      // Your code here.
-    });
-  }
-}
-```
-
-### Histogram
-
-Histograms track the size and number of events in buckets.
-This allows for aggregatable calculation of quantiles.
-
-```java
-class YourClass {
-  static final Histogram requestLatency = Histogram.build()
-     .name("requests_latency_seconds").help("Request latency in seconds.").register();
-
-  void processRequest(Request req) {
-    Histogram.Timer requestTimer = requestLatency.startTimer();
-    try {
-      // Your code here.
-    } finally {
-      requestTimer.observeDuration();
-    }
-  }
-}
-```
-
-The default buckets are intended to cover a typical web/rpc request from milliseconds to seconds.
-They can be overridden with the `buckets()` method on the [Histogram.Builder](https://prometheus.github.io/client_java/io/prometheus/client/Histogram.Builder.html#buckets-double...-).
-
-There are utilities for timing code:
-
-```java
-class YourClass {
-  static final Histogram requestLatency = Histogram.build()
-     .name("requests_latency_seconds").help("Request latency in seconds.").register();
-
-  void processRequest(Request req) {
-    requestLatency.time(new Runnable() {
-      public abstract void run() {
-        // Your code here.
-      }
-    });
-
-
-    // Or the Java 8 lambda equivalent
-    requestLatency.time(() -> {
-      // Your code here.
-    });
-  }
-}
-```
-
-### Labels
-
-All metrics can have labels, allowing grouping of related time series.
-
-See the best practices on [naming](http://prometheus.io/docs/practices/naming/)
-and [labels](http://prometheus.io/docs/practices/instrumentation/#use-labels).
-
-Taking a counter as an example:
-
-```java
-class YourClass {
-  static final Counter requests = Counter.build()
-     .name("my_library_requests_total").help("Total requests.")
-     .labelNames("method").register();
-
-  void processGetRequest() {
-    requests.labels("get").inc();
-    // Your code here.
-  }
-}
-```
-
-### Registering Metrics
-
-The best way to register a metric is via a `static final` class variable as is common with loggers.
-
-```java
-static final Counter requests = Counter.build()
-   .name("my_library_requests_total").help("Total requests.").labelNames("path").register();
-```
-
-Using the default registry with variables that are `static` is ideal since registering a metric with the same name
-is not allowed and the default registry is also itself static. You can think of registering a metric, more like
-registering a definition (as in the `TYPE` and `HELP` sections). The metric 'definition' internally holds the samples
-that are reported and pulled out by Prometheus. Here is an example of registering a metric that has no labels.
-
-```java
-class YourClass {
-  static final Gauge activeTransactions = Gauge.build()
-     .name("my_library_transactions_active")
-     .help("Active transactions.")
-     .register();
-
-  void processThatCalculates(String key) {
-    activeTransactions.inc();
-    try {
-        // Perform work.
-    } finally{
-        activeTransactions.dec();
-    }
-  }
-}
-```
-
-To create timeseries with labels, include `labelNames()` with the builder. The `labels()` method looks up or creates
-the corresponding labelled timeseries. You might also consider storing the labelled timeseries as an instance variable if it is
-appropriate. It is thread safe and can be used multiple times, which can help performance.
-
-
-```java
-class YourClass {
-  static final Counter calculationsCounter = Counter.build()
-     .name("my_library_calculations_total").help("Total calls.")
-     .labelNames("key").register();
-
-  void processThatCalculates(String key) {
-    calculationsCounter.labels(key).inc();
-    // Run calculations.
-  }
-}
-```
-
-
-## Included Collectors
-
-The Java client includes collectors for garbage collection, memory pools, JMX, classloading, and thread counts.
-These can be added individually or just use the `DefaultExports` to conveniently register them.
-
-```java
-DefaultExports.initialize();
-```
-
-### Logging
-
-There are logging collectors for log4j, log4j2 and logback.
-
-To register the Logback collector can be added to the root level like so:
-
-```xml
-
-
-    
-
-    
-
-    
-        
-    
-
-
-```
-
-To register the log4j collector at root level:
-
-```xml
-
-
-
-    
-    
-        
-        
-    
-
-```
-
-To register the log4j2 collector at root level:
-
-```xml
-
-
-    
-        
-    
-    
-        
-            
-        
-    
-
-```
-
-### Caches
-
-To register the Guava cache collector, be certain to add `recordStats()` when building
-the cache and adding it to the registered collector.
-
-```java
-CacheMetricsCollector cacheMetrics = new CacheMetricsCollector().register();
-
-Cache cache = CacheBuilder.newBuilder().recordStats().build();
-cacheMetrics.addCache("myCacheLabel", cache);
-```
-
-The Caffeine equivalent is nearly identical. Again, be certain to call `recordStats()`
- when building the cache so that metrics are collected.
-
-```java
-CacheMetricsCollector cacheMetrics = new CacheMetricsCollector().register();
-
-Cache cache = Caffeine.newBuilder().recordStats().build();
-cacheMetrics.addCache("myCacheLabel", cache);
-```
-
-### Hibernate
-
-There is a collector for Hibernate which allows to collect metrics from one or more
-`SessionFactory` instances.
-
-If you want to collect metrics from a single `SessionFactory`, you can register
-the collector like this:
-
-```java
-new HibernateStatisticsCollector(sessionFactory, "myapp").register();
-```
-
-In some situations you may want to collect metrics from multiple factories. In this
-case just call `add()` on the collector for each of them.
-
-```java
-new HibernateStatisticsCollector()
-    .add(sessionFactory1, "myapp1")
-    .add(sessionFactory2, "myapp2")
-    .register();
-```
-
-If you are using Hibernate in a JPA environment and only have access to the `EntityManager`
-or `EntityManagerFactory`, you can use this code to access the underlying `SessionFactory`:
-
-```java
-SessionFactory sessionFactory = entityManagerFactory.unwrap(SessionFactory.class);
-```
-### Jetty
-
-There is a collector for recording various Jetty server metrics. You can do it by  registering the collector like this:
-
-```java
-// Configure StatisticsHandler.
-StatisticsHandler stats = new StatisticsHandler();
-stats.setHandler(server.getHandler());
-server.setHandler(stats);
-// Register collector.
-new JettyStatisticsCollector(stats).register();
-
-```
-
-Also, you can collect `QueuedThreadPool` metrics. If there is a single `QueuedThreadPool`
-to keep track of, use the following:
-
-```java
-new QueuedThreadPoolStatisticsCollector(queuedThreadPool, "myapp").register();
-```
-
-If you want to collect multiple `QueuedThreadPool` metrics, also you can achieve it like this:
-
-```java
-new QueuedThreadPoolStatisticsCollector()
-    .add(queuedThreadPool1, "myapp1")
-    .add(queuedThreadPool2, "myapp2")
-    .register();
-```
-
-#### Servlet Filter
-
-There is a servlet filter available for measuring the duration taken by servlet
-requests. The `metric-name` init parameter is required, and is the name of the
-metric prometheus will expose for the timing metrics. Help text via the `help`
-init parameter is not required, although it is highly recommended.  The number
-of buckets is overridable, and can be configured by passing a comma-separated
-string of doubles as the `buckets` init parameter. The granularity of path
-measuring is also configurable, via the `path-components` init parameter. By
-default, the servlet filter will record each path differently, but by setting an
-integer here, you can tell the filter to only record up to the Nth slashes. That
-is, all requests with greater than N "/" characters in the servlet URI path will
-be measured in the same bucket and you will lose that granularity.
-
-The code below is an example of the XML configuration for the filter. You will
-need to place this (replace your own values) code in your
-`webapp/WEB-INF/web.xml` file.
-
-```xml
-
-  prometheusFilter
-  io.prometheus.client.filter.MetricsFilter
-  
-    metric-name
-    webapp_metrics_filter
-  
-  
-    help
-    This is the help for your metrics filter
-  
-  
-    buckets
-    0.005,0.01,0.025,0.05,0.075,0.1,0.25,0.5,0.75,1,2.5,5,7.5,10
-  
-  
-  
-    path-components
-    1
-  
-
-
-
-
-  prometheusFilter
-  /*
-
-```
-
-Additionally, you can instantiate your servlet filter directly in Java code. To
-do this, you just need to call the non-empty constructor. The first parameter,
-the metric name, is required. The second, help, is optional but highly
-recommended. The last two (path-components, and buckets) are optional and will
-default sensibly if omitted.
-
-#### Spring AOP
-
-There is a Spring AOP collector that allows you to annotate methods that you
-would like to instrument with a [Summary](#Summary), but without going through
-the process of manually instantiating and registering your metrics classes. To
-use the metrics annotations, simply add `simpleclient_spring_web` as a
-dependency, annotate a configuration class with `@EnablePrometheusTiming`, then
-annotate your Spring components as such:
-
-```java
-@Controller
-public class MyController {
-  @RequestMapping("/")
-  @PrometheusTimeMethod(name = "my_controller_path_duration_seconds", help = "Some helpful info here")
-  public Object handleMain() {
-    // Do something
-  }
-}
-```
-
-## Exporting
-
-There are several options for exporting metrics.
-
-### HTTP
-
-Metrics are usually exposed over HTTP, to be read by the Prometheus server.
-
-There are HTTPServer, Servlet, SpringBoot, and Vert.x integrations included in the client library.
-The simplest of these is the HTTPServer:
-
-```java
-HTTPServer server = new HTTPServer(1234);
-```
-
-To add Prometheus exposition to an existing HTTP server using servlets, see the `MetricsServlet`.
-It also serves as a simple example of how to write a custom endpoint.
-
-To expose the metrics used in your code, you would add the Prometheus servlet to your Jetty server:
-
-```java
-Server server = new Server(1234);
-ServletContextHandler context = new ServletContextHandler();
-context.setContextPath("/");
-server.setHandler(context);
-
-context.addServlet(new ServletHolder(new MetricsServlet()), "/metrics");
-```
-
-All HTTP expostion integrations support restricting which time series to return
-using `?name[]=` URL parameters. Due to implementation limitations, this may
-have false negatives.
-
-
-## Exporting to a Pushgateway
-
-The [Pushgateway](https://github.com/prometheus/pushgateway)
-allows ephemeral and batch jobs to expose their metrics to Prometheus.
-
-```java
-void executeBatchJob() throws Exception {
-  CollectorRegistry registry = new CollectorRegistry();
-  Gauge duration = Gauge.build()
-     .name("my_batch_job_duration_seconds").help("Duration of my batch job in seconds.").register(registry);
-  Gauge.Timer durationTimer = duration.startTimer();
-  try {
-    // Your code here.
-
-    // This is only added to the registry after success,
-    // so that a previous success in the Pushgateway isn't overwritten on failure.
-    Gauge lastSuccess = Gauge.build()
-       .name("my_batch_job_last_success").help("Last time my batch job succeeded, in unixtime.").register(registry);
-    lastSuccess.setToCurrentTime();
-  } finally {
-    durationTimer.setDuration();
-    PushGateway pg = new PushGateway("127.0.0.1:9091");
-    pg.pushAdd(registry, "my_batch_job");
-  }
-}
- ```
-
-A separate registry is used, as the default registry may contain other metrics
-such as those from the Process Collector. See the
-[Pushgateway documentation](https://github.com/prometheus/pushgateway/blob/master/README.md)
-for more information.
-
-
-#### with Basic Auth
-```java
-PushGateway pushgateway = new PushGateway("127.0.0.1:9091");
-pushgateway.setConnectionFactory(new BasicAuthHttpConnectionFactory("my_user", "my_password"));
-```
-
-#### with Custom Connection Preparation Logic
-```java
-PushGateway pushgateway = new PushGateway("127.0.0.1:9091");
-pushgateway.setConnectionFactory(new MyHttpConnectionFactory());
-```
-where
-```java
-class MyHttpConnectionFactory implements HttpConnectionFactory {
-    @Override
-    public HttpURLConnection create(String url) throws IOException {
-        HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
-        // add any connection preparation logic you need
-        return connection;
-    }
-}
-```
-
-## Bridges
-
-It is also possible to expose metrics to systems other than Prometheus.
-This allows you to take advantage of Prometheus instrumentation even
-if you are not quite ready to fully transition to Prometheus yet.
-
-### Graphite
-
-Metrics are pushed over TCP in the Graphite plaintext format.
-
-```java
-Graphite g = new Graphite("localhost", 2003);
-// Push the default registry once.
-g.push(CollectorRegistry.defaultRegistry);
-
-// Push the default registry every 60 seconds.
-Thread thread = g.start(CollectorRegistry.defaultRegistry, 60);
-// Stop pushing.
-thread.interrupt();
-thread.join();
-```
-
-## Custom Collectors
-
-Sometimes it is not possible to directly instrument code, as it is not
-in your control. This requires you to proxy metrics from other systems.
-
-To do so you need to create a custom collector (which will need to be registered as a normal metric), for example:
-
-```java
-class YourCustomCollector extends Collector {
-  List collect() {
-    List mfs = new ArrayList();
-    // With no labels.
-    mfs.add(new GaugeMetricFamily("my_gauge", "help", 42));
-    // With labels
-    GaugeMetricFamily labeledGauge = new GaugeMetricFamily("my_other_gauge", "help", Arrays.asList("labelname"));
-    labeledGauge.addMetric(Arrays.asList("foo"), 4);
-    labeledGauge.addMetric(Arrays.asList("bar"), 5);
-    mfs.add(labeledGauge);
-    return mfs;
-  }
-}
-
-// Registration
-static final YourCustomCollector requests = new YourCustomCollector().register()
-```
-
-`SummaryMetricFamily` works similarly.
-
-A collector may implement a `describe` method which returns metrics in the same
-format as `collect` (though you don't have to include the samples). This is
-used to predetermine the names of time series a `CollectorRegistry` exposes and
-thus to detect collisions and duplicate registrations.
-
-Usually custom collectors do not have to implement `describe`. If `describe` is
-not implemented and the CollectorRegistry was created with `auto_describe=True`
-(which is the case for the default registry) then `collect` will be called at
-registration time instead of `describe`. If this could cause problems, either
-implement a proper `describe`, or if that's not practical have `describe`
-return an empty list.
-
-### DropwizardExports Collector
-
-DropwizardExports collector is available to proxy metrics from Dropwizard.
-
-```java
-// Dropwizard MetricRegistry
-MetricRegistry metricRegistry = new MetricRegistry();
-new DropwizardExports(metricRegistry).register();
-```
-
-By default Dropwizard metrics are translated to Prometheus sample sanitizing their names, i.e. replacing unsupported chars with `_`, for example:
-```
-Dropwizard metric name:
-org.company.controller.save.status.400
-Prometheus metric:
-org_company_controller_save_status_400
-```
-
-It is also possible add custom labels and name to newly created `Sample`s by using a `CustomMappingSampleBuilder` with custom `MapperConfig`s:
-
-```java
-// Dropwizard MetricRegistry
-MetricRegistry metricRegistry = new MetricRegistry();
-MapperConfig config = new MapperConfig();
-// The match field in MapperConfig is a simplified glob expression that only allows * wildcard.
-config.setMatch("org.company.controller.*.status.*");
-// The new Sample's template name.
-config.setName("org.company.controller");
-Map labels = new HashMap();
-// ... more configs
-// Labels to be extracted from the metric. Key=label name. Value=label template
-labels.put("name", "${0}");
-labels.put("status", "${1}");
-config.setLabels(labels);
-
-SampleBuilder sampleBuilder = new CustomMappingSampleBuilder(Arrays.asList(config));
-new DropwizardExports(metricRegistry, sampleBuilder).register();
-```
-
-When a new metric comes to the collector, `MapperConfig`s are scanned to find the first one that matches the incoming metric name. The name set in the configuration will
-be used and labels will be extracted. Using the `CustomMappingSampleBuilder` in the previous example leads to the following result:
-```
-Dropwizard metric name
-org.company.controller.save.status.400
-Prometheus metric
-org_company_controller{name="save",status="400"}
-```
-
-Template with placeholders can be used both as names and label values. Placeholders are in the `${n}` format where n is the zero based index of the Dropwizard metric name wildcard group we want to extract.
-
-## Contact
-The [Prometheus Users Mailinglist](https://groups.google.com/forum/?fromgroups#!forum/prometheus-users) is the best place to ask questions.
-
-Details for those wishing to develop the library can be found on the [wiki](https://github.com/prometheus/client_java/wiki/Development)
+Apache License 2.0, see [LICENSE](LICENSE).
diff --git a/RELEASING.md b/RELEASING.md
new file mode 100644
index 000000000..601034d01
--- /dev/null
+++ b/RELEASING.md
@@ -0,0 +1,39 @@
+# Releasing Instructions for Prometheus Java Client
+
+## Before the Release
+
+If there have been significant changes since the last release, update the
+benchmarks before creating a new release:
+
+```shell
+mise run update-benchmarks
+```
+
+## Create a Release
+
+1. Go to 
+2. Click on "Choose a tag", enter the tag name (e.g. `v0.1.0`), and click "Create a new tag".
+3. Click on "Generate release notes" to auto-generate the release notes based on the commits since
+   the last release.
+4. Click on "Publish release".
+
+## Major or minor release
+
+After the release is created, do a text replace everywhere in the repository to update the
+snapshot version in the `pom.xml` files (and some other files) to the next version.
+For example, if the last release was `1.4.0`, the next snapshot version should be `1.5.0-SNAPSHOT`.
+
+Replace `1.4.0-SNAPSHOT` with `1.5.0-SNAPSHOT` in all following files.
+
+## If the GPG key expired
+
+1. Generate a new key:
+   
+2. Distribute the
+   key: 
+3. use `gpg --armor --export-secret-keys YOUR_ID` to
+   export ([docs](https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#gpg))
+4. Update the
+   passphrase:  
+5. Update the GPG
+   key: 
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 000000000..fed02d85c
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,6 @@
+# Reporting a security issue
+
+The Prometheus security policy, including how to report vulnerabilities, can be
+found here:
+
+
diff --git a/benchmark/README.md b/benchmark/README.md
deleted file mode 100644
index 628a4d444..000000000
--- a/benchmark/README.md
+++ /dev/null
@@ -1,161 +0,0 @@
-# Client Benchmarks
-
-This module contains microbenchmarks for client instrumentation operations.
-
-## Result Overview
-
-The main outcomes of the benchmarks:
-* Simpleclient Counters/Gauges have similar performance to Codahale Counters.
-* The original client is much slower than the Simpleclient or Codahale, especially when used concurrently.
-* Codahale Meters are slower than Codahale/Simpleclient Counters
-* Codahale and original client Summaries are 10x slower than other metrics.
-* Simpleclient Histograms are 10-100X faster than Codahale and original client Summaries.
-* Simpleclient `Gauge.Child.set` is relatively slow, especially when done concurrently.
-* Label lookups in both Prometheus clients are relatively slow.
-
-Accordingly, in terms of client instrumentation performance I suggest the following:
-* It's cheap to extensively instrument your code with Simpleclient Counters/Gauges/Summaries without labels, or Codahale Counters.
-* Avoid Codahale Meters, in favour of Codahale/Simpleclient Counters and calculating the rate in your monitoring system (e.g. the `rate()` function in Prometheus).
-* Use Simpleclient Histograms rather than original client Summaries and Codahale Histograms/Timers.
-* Avoid the original client.
-* For high update rate (>1000 per second) prometheus metrics using labels, you should cache the Child. Java 8 may make this better due to an improved ConcurrentHashMap implementation.
-* If a use case appears for high update rate use of SimpleClient's `Gauge.Child.set`, we should alter `DoubleAdder` to more efficiently handle this use case.
-
-## Benchmark Results
-
-These benchmarks were run using JMH on a 2-core MacBook Pro with a 2.5GHz i5 processor, 
-with Oracle Java 64 1.7.0\_51.
-
-### Counters
-    java -jar target/benchmarks.jar CounterBenchmark -wi 5 -i 5 -f 1 -t 1
-    i.p.b.CounterBenchmark.codahaleCounterIncBenchmark                    avgt        5   11.554 ± 0.251  ns/op
-    i.p.b.CounterBenchmark.codahaleMeterMarkBenchmark                     avgt        5   75.305 ± 7.147  ns/op
-    i.p.b.CounterBenchmark.prometheusCounterChildIncBenchmark             avgt        5   13.249 ± 0.029  ns/op
-    i.p.b.CounterBenchmark.prometheusCounterIncBenchmark                  avgt        5  127.397 ± 4.072  ns/op
-    i.p.b.CounterBenchmark.prometheusSimpleCounterChildIncBenchmark       avgt        5   12.989 ± 0.285  ns/op
-    i.p.b.CounterBenchmark.prometheusSimpleCounterIncBenchmark            avgt        5   54.822 ± 7.994  ns/op
-    i.p.b.CounterBenchmark.prometheusSimpleCounterNoLabelsIncBenchmark    avgt        5   13.131 ± 1.661  ns/op
-
-    java -jar target/benchmarks.jar CounterBenchmark -wi 5 -i 5 -f 1 -t 2
-    i.p.b.CounterBenchmark.codahaleCounterIncBenchmark                    avgt        5   16.707 ±  2.116  ns/op
-    i.p.b.CounterBenchmark.codahaleMeterMarkBenchmark                     avgt        5  107.346 ± 23.127  ns/op
-    i.p.b.CounterBenchmark.prometheusCounterChildIncBenchmark             avgt        5   41.912 ± 18.167  ns/op
-    i.p.b.CounterBenchmark.prometheusCounterIncBenchmark                  avgt        5  170.860 ±  5.110  ns/op
-    i.p.b.CounterBenchmark.prometheusSimpleCounterChildIncBenchmark       avgt        5   17.782 ±  2.764  ns/op
-    i.p.b.CounterBenchmark.prometheusSimpleCounterIncBenchmark            avgt        5   89.656 ±  4.577  ns/op
-    i.p.b.CounterBenchmark.prometheusSimpleCounterNoLabelsIncBenchmark    avgt        5   16.109 ±  1.723  ns/op
-
-    java -jar target/benchmarks.jar CounterBenchmark -wi 5 -i 5 -f 1 -t 4
-    i.p.b.CounterBenchmark.codahaleCounterIncBenchmark                    avgt        5   17.628 ±  0.501  ns/op
-    i.p.b.CounterBenchmark.codahaleMeterMarkBenchmark                     avgt        5  121.836 ± 15.888  ns/op
-    i.p.b.CounterBenchmark.prometheusCounterChildIncBenchmark             avgt        5  377.916 ±  7.965  ns/op
-    i.p.b.CounterBenchmark.prometheusCounterIncBenchmark                  avgt        5  250.919 ±  2.728  ns/op
-    i.p.b.CounterBenchmark.prometheusSimpleCounterChildIncBenchmark       avgt        5   18.055 ±  1.391  ns/op
-    i.p.b.CounterBenchmark.prometheusSimpleCounterIncBenchmark            avgt        5  120.543 ±  1.770  ns/op
-    i.p.b.CounterBenchmark.prometheusSimpleCounterNoLabelsIncBenchmark    avgt        5   19.334 ±  1.471  ns/op
-
-### Gauges
-
-Codahale lacks a metric with a `set` method, so we'll compare to `Counter` which has `inc` and `dec`.
-
-    java -jar target/benchmarks.jar GaugeBenchmark -wi 5 -i 5 -f 1 -t 1
-    i.p.b.GaugeBenchmark.codahaleCounterDecBenchmark                  avgt        5   11.620 ± 0.288  ns/op
-    i.p.b.GaugeBenchmark.codahaleCounterIncBenchmark                  avgt        5   11.718 ± 0.333  ns/op
-    i.p.b.GaugeBenchmark.prometheusGaugeChildDecBenchmark             avgt        5   13.358 ± 0.554  ns/op
-    i.p.b.GaugeBenchmark.prometheusGaugeChildIncBenchmark             avgt        5   13.268 ± 0.276  ns/op
-    i.p.b.GaugeBenchmark.prometheusGaugeChildSetBenchmark             avgt        5   11.624 ± 0.210  ns/op
-    i.p.b.GaugeBenchmark.prometheusGaugeDecBenchmark                  avgt        5  125.058 ± 2.764  ns/op
-    i.p.b.GaugeBenchmark.prometheusGaugeIncBenchmark                  avgt        5  127.814 ± 7.741  ns/op
-    i.p.b.GaugeBenchmark.prometheusGaugeSetBenchmark                  avgt        5  127.899 ± 6.690  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeChildDecBenchmark       avgt        5   12.961 ± 0.393  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeChildIncBenchmark       avgt        5   12.932 ± 0.212  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeChildSetBenchmark       avgt        5   36.672 ± 1.112  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeDecBenchmark            avgt        5   54.677 ± 3.704  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeIncBenchmark            avgt        5   53.278 ± 1.104  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeSetBenchmark            avgt        5   79.724 ± 2.723  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeNoLabelsDecBenchmark    avgt        5   12.957 ± 0.437  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeNoLabelsIncBenchmark    avgt        5   12.932 ± 0.284  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeNoLabelsSetBenchmark    avgt        5   40.235 ± 1.735  ns/op
-
-    java -jar target/benchmarks.jar GaugeBenchmark -wi 5 -i 5 -f 1 -t 2
-    i.p.b.GaugeBenchmark.codahaleCounterDecBenchmark                  avgt        5   17.443 ±  4.819  ns/op
-    i.p.b.GaugeBenchmark.codahaleCounterIncBenchmark                  avgt        5   14.882 ±  2.875  ns/op
-    i.p.b.GaugeBenchmark.prometheusGaugeChildDecBenchmark             avgt        5   45.206 ± 29.575  ns/op
-    i.p.b.GaugeBenchmark.prometheusGaugeChildIncBenchmark             avgt        5   46.657 ± 33.518  ns/op
-    i.p.b.GaugeBenchmark.prometheusGaugeChildSetBenchmark             avgt        5   21.810 ±  9.370  ns/op
-    i.p.b.GaugeBenchmark.prometheusGaugeDecBenchmark                  avgt        5  177.370 ±  2.477  ns/op
-    i.p.b.GaugeBenchmark.prometheusGaugeIncBenchmark                  avgt        5  172.136 ±  3.056  ns/op
-    i.p.b.GaugeBenchmark.prometheusGaugeSetBenchmark                  avgt        5  186.791 ±  7.996  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeChildDecBenchmark       avgt        5   15.978 ±  2.762  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeChildIncBenchmark       avgt        5   15.457 ±  1.052  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeChildSetBenchmark       avgt        5  156.604 ± 10.953  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeDecBenchmark            avgt        5  107.134 ± 33.620  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeIncBenchmark            avgt        5   89.362 ± 16.608  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeSetBenchmark            avgt        5  163.823 ± 25.270  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeNoLabelsDecBenchmark    avgt        5   16.380 ±  1.915  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeNoLabelsIncBenchmark    avgt        5   17.042 ±  1.113  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeNoLabelsSetBenchmark    avgt        5  164.930 ±  2.565  ns/op
-
-    java -jar target/benchmarks.jar GaugeBenchmark -wi 5 -i 5 -f 1 -t 4
-    i.p.b.GaugeBenchmark.codahaleCounterDecBenchmark                  avgt        5   17.291 ±  1.769  ns/op
-    i.p.b.GaugeBenchmark.codahaleCounterIncBenchmark                  avgt        5   17.445 ±  0.709  ns/op
-    i.p.b.GaugeBenchmark.prometheusGaugeChildDecBenchmark             avgt        5  389.411 ± 13.078  ns/op
-    i.p.b.GaugeBenchmark.prometheusGaugeChildIncBenchmark             avgt        5  399.549 ± 29.274  ns/op
-    i.p.b.GaugeBenchmark.prometheusGaugeChildSetBenchmark             avgt        5  123.700 ±  3.894  ns/op
-    i.p.b.GaugeBenchmark.prometheusGaugeDecBenchmark                  avgt        5  244.741 ± 22.477  ns/op
-    i.p.b.GaugeBenchmark.prometheusGaugeIncBenchmark                  avgt        5  243.525 ±  6.332  ns/op
-    i.p.b.GaugeBenchmark.prometheusGaugeSetBenchmark                  avgt        5  252.363 ±  2.664  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeChildDecBenchmark       avgt        5   18.330 ±  2.673  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeChildIncBenchmark       avgt        5   20.633 ±  1.219  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeChildSetBenchmark       avgt        5  335.455 ±  4.562  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeDecBenchmark            avgt        5  116.432 ±  4.793  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeIncBenchmark            avgt        5  129.390 ±  2.360  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeSetBenchmark            avgt        5  613.186 ± 20.548  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeNoLabelsDecBenchmark    avgt        5   19.765 ±  3.189  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeNoLabelsIncBenchmark    avgt        5   19.589 ±  1.634  ns/op
-    i.p.b.GaugeBenchmark.prometheusSimpleGaugeNoLabelsSetBenchmark    avgt        5  307.238 ±  1.918  ns/op
-
-### Summaries
-
-The simpleclient `Summary` doesn't have percentiles, simpleclient's `Histogram`
-offers a way to calculate percentiles on the server side that works with aggregation.
-The closest to the original client's `Summary` is Codahale's
-`Timer`, but that includes timing calls so we compare with `Histogram` instead.
-
-    java -jar target/benchmarks.jar SummaryBenchmark -wi 5 -i 5 -f 1 -t 1
-    i.p.b.SummaryBenchmark.codahaleHistogramBenchmark                    avgt        5   186.306 ±   4.958  ns/op
-    i.p.b.SummaryBenchmark.prometheusSimpleHistogramBenchmark            avgt        5    81.595 ±   4.491  ns/op
-    i.p.b.SummaryBenchmark.prometheusSimpleHistogramChildBenchmark       avgt        5    22.143 ±   1.713  ns/op
-    i.p.b.SummaryBenchmark.prometheusSimpleHistogramNoLabelsBenchmark    avgt        5    22.066 ±   0.812  ns/op
-    i.p.b.SummaryBenchmark.prometheusSimpleSummaryBenchmark              avgt        5    59.588 ±   2.087  ns/op
-    i.p.b.SummaryBenchmark.prometheusSimpleSummaryChildBenchmark         avgt        5    15.300 ±   0.659  ns/op
-    i.p.b.SummaryBenchmark.prometheusSimpleSummaryNoLabelsBenchmark      avgt        5    15.608 ±   0.271  ns/op
-    i.p.b.SummaryBenchmark.prometheusSummaryBenchmark                    avgt        5   981.640 ± 315.146  ns/op
-    i.p.b.SummaryBenchmark.prometheusSummaryChildBenchmark               avgt        5  1155.179 ± 850.237  ns/op
-
-    java -jar target/benchmarks.jar SummaryBenchmark -wi 5 -i 5 -f 1 -t 2
-    i.p.b.SummaryBenchmark.codahaleHistogramBenchmark                    avgt        5   289.245 ±   39.721  ns/op
-    i.p.b.SummaryBenchmark.prometheusSimpleHistogramBenchmark            avgt        5   127.014 ±   19.285  ns/op
-    i.p.b.SummaryBenchmark.prometheusSimpleHistogramChildBenchmark       avgt        5    52.597 ±   10.781  ns/op
-    i.p.b.SummaryBenchmark.prometheusSimpleHistogramNoLabelsBenchmark    avgt        5    53.295 ±    9.891  ns/op
-    i.p.b.SummaryBenchmark.prometheusSimpleSummaryBenchmark              avgt        5   117.810 ±   11.694  ns/op
-    i.p.b.SummaryBenchmark.prometheusSimpleSummaryChildBenchmark         avgt        5    31.933 ±    3.439  ns/op
-    i.p.b.SummaryBenchmark.prometheusSimpleSummaryNoLabelsBenchmark      avgt        5    33.918 ±    5.571  ns/op
-    i.p.b.SummaryBenchmark.prometheusSummaryBenchmark                    avgt        5  2059.498 ±  616.954  ns/op
-    i.p.b.SummaryBenchmark.prometheusSummaryChildBenchmark               avgt        5  2346.163 ± 1503.034  ns/op
-
-    java -jar target/benchmarks.jar SummaryBenchmark -wi 5 -i 5 -f 1 -t 4
-    i.p.b.SummaryBenchmark.codahaleHistogramBenchmark                    avgt        5   587.956 ±    2.788  ns/op
-    i.p.b.SummaryBenchmark.prometheusSimpleHistogramBenchmark            avgt        5   163.313 ±    5.163  ns/op
-    i.p.b.SummaryBenchmark.prometheusSimpleHistogramChildBenchmark       avgt        5    66.957 ±    1.746  ns/op
-    i.p.b.SummaryBenchmark.prometheusSimpleHistogramNoLabelsBenchmark    avgt        5    67.064 ±    1.681  ns/op
-    i.p.b.SummaryBenchmark.prometheusSimpleSummaryBenchmark              avgt        5   140.166 ±    4.263  ns/op
-    i.p.b.SummaryBenchmark.prometheusSimpleSummaryChildBenchmark         avgt        5    40.065 ±    0.138  ns/op
-    i.p.b.SummaryBenchmark.prometheusSimpleSummaryNoLabelsBenchmark      avgt        5    41.331 ±    1.899  ns/op
-    i.p.b.SummaryBenchmark.prometheusSummaryBenchmark                    avgt        5  3950.152 ± 1214.866  ns/op
-    i.p.b.SummaryBenchmark.prometheusSummaryChildBenchmark               avgt        5  4676.946 ± 3625.977  ns/op
-
-Note the high error bars for the original client, it got slower with each iteration
-so I suspect a flaw in the test setup.
-
-
diff --git a/benchmark/pom.xml b/benchmark/pom.xml
deleted file mode 100644
index 5a8b768af..000000000
--- a/benchmark/pom.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-    4.0.0
-
-    
-        io.prometheus
-        parent
-        0.6.1-SNAPSHOT
-    
-
-    io.prometheus
-    benchmarks
-
-    Prometheus Java Client Benchmarks
-    
-        Benchmarks of client performance, and comparison to other systems.
-    
-
-    
-        
-            The Apache Software License, Version 2.0
-            http://www.apache.org/licenses/LICENSE-2.0.txt
-            repo
-        
-    
-
-    
-        
-            org.openjdk.jmh
-            jmh-core
-            1.3.2
-        
-        
-            org.openjdk.jmh
-            jmh-generator-annprocess
-            1.3.2
-        
-
-        
-            io.prometheus
-            client
-            0.0.10
-        
-        
-            io.prometheus
-            simpleclient
-            0.6.1-SNAPSHOT
-        
-        
-          com.codahale.metrics
-          metrics-core
-          3.0.2
-        
-    
-    
-        
-            
-                org.apache.maven.plugins
-                maven-shade-plugin
-                2.2
-                
-                    
-                        package
-                        
-                            shade
-                        
-                        
-                            benchmarks
-                            
-                                
-                                    org.openjdk.jmh.Main
-                                
-                            
-                            
-                                
-                                    
-                                    *:*
-                                    
-                                        META-INF/*.SF
-                                        META-INF/*.DSA
-                                        META-INF/*.RSA
-                                    
-                                
-                            
-                        
-                    
-                
-            
-        
-    
-
diff --git a/benchmarks/README.md b/benchmarks/README.md
new file mode 100644
index 000000000..3bba56422
--- /dev/null
+++ b/benchmarks/README.md
@@ -0,0 +1,56 @@
+# Benchmarks
+
+## How to Run
+
+### Running benchmarks
+
+Run benchmarks and update the results in the Javadoc of the benchmark classes:
+
+```shell
+mise run update-benchmarks
+```
+
+### Running benchmarks manually
+
+```shell
+java -jar ./benchmarks/target/benchmarks.jar
+```
+
+Run only one specific benchmark:
+
+```shell
+java -jar ./benchmarks/target/benchmarks.jar CounterBenchmark
+```
+
+## Results
+
+See Javadoc of the benchmark classes:
+
+- [CounterBenchmark](https://github.com/prometheus/client_java/blob/main/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/CounterBenchmark.java) 
+- [HistogramBenchmark](https://github.com/prometheus/client_java/blob/main/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/HistogramBenchmark.java) 
+- [TextFormatUtilBenchmark](https://github.com/prometheus/client_java/blob/main/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/TextFormatUtilBenchmark.java) 
+
+## What Prometheus Java client optimizes for
+
+concurrent updates of metrics in multi-threaded applications.
+If your application is single-threaded and uses only one processor core, your application isn't
+performance critical anyway.
+If your application is designed to use all available processor cores for maximum performance, then
+you want a metric library that doesn't slow your
+application down.
+Prometheus client Java metrics support concurrent updates and scrapes. This shows in benchmarks with
+multiple threads recording data in shared
+metrics.
+
+## Test the benchmark creation script
+
+To test the benchmark creation script, run:
+
+```shell
+python ./.mise/tasks/test_update-benchmarks.py
+```
+
+## Archive
+
+The `src/main/archive/` directory contains the old benchmarks from 0.16.0 and earlier. It will be
+removed as soon as all benchmarks are ported to the 1.0.0 release.
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
new file mode 100644
index 000000000..b2fad5766
--- /dev/null
+++ b/benchmarks/pom.xml
@@ -0,0 +1,125 @@
+
+
+  4.0.0
+
+  
+    io.prometheus
+    client_java
+    1.5.0-SNAPSHOT
+  
+
+  benchmarks
+
+  Prometheus Java Client Benchmarks
+  
+    Benchmarks of client performance, and comparison to other systems.
+  
+
+  
+    1.37
+    0.16.0
+    3.0.2
+    true
+  
+
+  
+    
+      
+        io.opentelemetry.instrumentation
+        opentelemetry-instrumentation-bom-alpha
+        ${otel.instrumentation.version}
+        pom
+        import
+      
+    
+  
+
+  
+    
+      org.openjdk.jmh
+      jmh-core
+      ${jmh.version}
+    
+    
+      io.prometheus
+      prometheus-metrics-core
+      ${project.version}
+    
+    
+      io.prometheus
+      prometheus-metrics-exposition-textformats
+      ${project.version}
+    
+    
+      io.prometheus
+      simpleclient
+      ${simpleclient.version}
+    
+    
+      com.codahale.metrics
+      metrics-core
+      ${codahale.version}
+    
+    
+      io.opentelemetry
+      opentelemetry-api
+    
+    
+      io.opentelemetry
+      opentelemetry-sdk
+    
+    
+      io.opentelemetry
+      opentelemetry-sdk-testing
+    
+  
+  
+    ${project.artifactId}
+    
+      
+        org.apache.maven.plugins
+        maven-compiler-plugin
+        
+          1.8
+          1.8
+          
+            
+            -parameters
+          
+          
+            
+              org.openjdk.jmh
+              jmh-generator-annprocess
+              ${jmh.version}
+            
+          
+        
+      
+      
+        org.apache.maven.plugins
+        maven-shade-plugin
+        
+          
+            package
+            
+              shade
+            
+            
+              benchmarks
+              
+                
+                  io.prometheus.metrics.benchmarks.BenchmarkRunner
+                  
+                
+              
+            
+          
+        
+      
+    
+  
+
diff --git a/benchmarks/src/archive/java/io/prometheus/client/CKMSQuantileBenchmark.java b/benchmarks/src/archive/java/io/prometheus/client/CKMSQuantileBenchmark.java
new file mode 100644
index 000000000..ab383d327
--- /dev/null
+++ b/benchmarks/src/archive/java/io/prometheus/client/CKMSQuantileBenchmark.java
@@ -0,0 +1,132 @@
+package io.prometheus.client;
+
+import io.prometheus.client.CKMSQuantiles.Quantile;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.TimeUnit;
+import org.openjdk.jmh.annotations.*;
+import org.openjdk.jmh.infra.Blackhole;
+import org.openjdk.jmh.runner.Runner;
+import org.openjdk.jmh.runner.RunnerException;
+import org.openjdk.jmh.runner.options.Options;
+import org.openjdk.jmh.runner.options.OptionsBuilder;
+
+public class CKMSQuantileBenchmark {
+
+  @State(Scope.Benchmark)
+  public static class EmptyBenchmarkState {
+    @Param({"10000", "100000", "1000000"})
+    public int value;
+
+    List quantiles;
+    Random rand = new Random(0);
+
+    List shuffle;
+
+    Quantile mean = new Quantile(0.50, 0.050);
+    Quantile q90 = new Quantile(0.90, 0.010);
+    Quantile q95 = new Quantile(0.95, 0.005);
+    Quantile q99 = new Quantile(0.99, 0.001);
+
+    @Setup(Level.Trial)
+    public void setup() {
+      quantiles = new ArrayList();
+      quantiles.add(mean);
+      quantiles.add(q90);
+      quantiles.add(q95);
+      quantiles.add(q99);
+
+      shuffle = new ArrayList(value);
+      for (int i = 0; i < value; i++) {
+        shuffle.add((double) i);
+      }
+      Collections.shuffle(shuffle, rand);
+    }
+  }
+
+  @Benchmark
+  @BenchmarkMode({Mode.AverageTime})
+  @OutputTimeUnit(TimeUnit.MILLISECONDS)
+  public void ckmsQuantileInsertBenchmark(EmptyBenchmarkState state) {
+    CKMSQuantiles q = new CKMSQuantiles(state.quantiles.toArray(new Quantile[] {}));
+    for (Double l : state.shuffle) {
+      q.insert(l);
+    }
+  }
+
+  /** prefilled benchmark, means that we already have a filled and compressed samples available */
+  @State(Scope.Benchmark)
+  public static class PrefilledBenchmarkState {
+    @Param({"10000", "100000", "1000000"})
+    public int value;
+
+    CKMSQuantiles ckmsQuantiles;
+
+    List quantiles;
+    Random rand = new Random(0);
+
+    Quantile mean = new Quantile(0.50, 0.050);
+    Quantile q90 = new Quantile(0.90, 0.010);
+    Quantile q95 = new Quantile(0.95, 0.005);
+    Quantile q99 = new Quantile(0.99, 0.001);
+    List shuffle;
+
+    int rank = (int) (value * q95.quantile);
+
+    @Setup(Level.Trial)
+    public void setup() {
+      quantiles = new ArrayList();
+      quantiles.add(mean);
+      quantiles.add(q90);
+      quantiles.add(q95);
+      quantiles.add(q99);
+
+      shuffle = new ArrayList(value);
+      for (int i = 0; i < value; i++) {
+        shuffle.add((double) i);
+      }
+      Collections.shuffle(shuffle, rand);
+
+      ckmsQuantiles = new CKMSQuantiles(quantiles.toArray(new Quantile[] {}));
+      for (Double l : shuffle) {
+        ckmsQuantiles.insert(l);
+      }
+      // make sure we inserted all 'hanging' samples (count % 128)
+      ckmsQuantiles.get(0);
+      // compress everything so we have a similar samples size regardless of n.
+      ckmsQuantiles.compress();
+      System.out.println("Sample size is: " + ckmsQuantiles.samples.size());
+    }
+  }
+
+  @Benchmark
+  @BenchmarkMode({Mode.AverageTime})
+  @OutputTimeUnit(TimeUnit.NANOSECONDS)
+  public void ckmsQuantileGetBenchmark(Blackhole blackhole, PrefilledBenchmarkState state) {
+    blackhole.consume(state.ckmsQuantiles.get(state.q90.quantile));
+  }
+
+  /** benchmark for the f method. */
+  @Benchmark
+  @BenchmarkMode({Mode.AverageTime})
+  @OutputTimeUnit(TimeUnit.NANOSECONDS)
+  public void ckmsQuantileF(Blackhole blackhole, PrefilledBenchmarkState state) {
+    blackhole.consume(state.ckmsQuantiles.f(state.rank));
+  }
+
+  public static void main(String[] args) throws RunnerException {
+
+    Options opt =
+        new OptionsBuilder()
+            .include(CKMSQuantileBenchmark.class.getSimpleName())
+            .warmupIterations(5)
+            .measurementIterations(4)
+            .threads(1)
+            .forks(1)
+            .build();
+
+    new Runner(opt).run();
+  }
+}
diff --git a/benchmark/src/main/java/io/prometheus/benchmark/CounterBenchmark.java b/benchmarks/src/archive/java/io/prometheus/client/benchmark/CounterBenchmark.java
similarity index 59%
rename from benchmark/src/main/java/io/prometheus/benchmark/CounterBenchmark.java
rename to benchmarks/src/archive/java/io/prometheus/client/benchmark/CounterBenchmark.java
index ca644070c..c37076156 100644
--- a/benchmark/src/main/java/io/prometheus/benchmark/CounterBenchmark.java
+++ b/benchmarks/src/archive/java/io/prometheus/client/benchmark/CounterBenchmark.java
@@ -1,11 +1,10 @@
-package io.prometheus.benchmark;
+package io.prometheus.client.benchmark;
 
 import com.codahale.metrics.MetricRegistry;
-
 import java.util.concurrent.TimeUnit;
+import org.openjdk.jmh.annotations.Benchmark;
 import org.openjdk.jmh.annotations.BenchmarkMode;
 import org.openjdk.jmh.annotations.Mode;
-import org.openjdk.jmh.annotations.Benchmark;
 import org.openjdk.jmh.annotations.OutputTimeUnit;
 import org.openjdk.jmh.annotations.Scope;
 import org.openjdk.jmh.annotations.Setup;
@@ -22,69 +21,47 @@ public class CounterBenchmark {
   com.codahale.metrics.Counter codahaleCounter;
   com.codahale.metrics.Meter codahaleMeter;
 
-  io.prometheus.client.metrics.Counter prometheusCounter;
-  io.prometheus.client.metrics.Counter.Child prometheusCounterChild;
   io.prometheus.client.Counter prometheusSimpleCounter;
   io.prometheus.client.Counter.Child prometheusSimpleCounterChild;
   io.prometheus.client.Counter prometheusSimpleCounterNoLabels;
 
   @Setup
   public void setup() {
-    prometheusCounter = io.prometheus.client.metrics.Counter.newBuilder()
-      .name("name")
-      .documentation("some description..")
-      .build();
-    prometheusCounterChild = prometheusCounter.newPartial().apply();
-
-    prometheusSimpleCounter = io.prometheus.client.Counter.build()
-      .name("name")
-      .help("some description..")
-      .labelNames("some", "group").create();
+    prometheusSimpleCounter =
+        io.prometheus.client.Counter.build()
+            .name("name")
+            .help("some description..")
+            .labelNames("some", "group")
+            .create();
     prometheusSimpleCounterChild = prometheusSimpleCounter.labels("test", "group");
 
-    prometheusSimpleCounterNoLabels = io.prometheus.client.Counter.build()
-      .name("name")
-      .help("some description..")
-      .create();
+    prometheusSimpleCounterNoLabels =
+        io.prometheus.client.Counter.build().name("name").help("some description..").create();
 
     registry = new MetricRegistry();
     codahaleCounter = registry.counter("counter");
     codahaleMeter = registry.meter("meter");
   }
 
-  @Benchmark
-  @BenchmarkMode({Mode.AverageTime})
-  @OutputTimeUnit(TimeUnit.NANOSECONDS)
-  public void prometheusCounterIncBenchmark() {
-    prometheusCounter.newPartial().apply().increment();
-  }
-
-  @Benchmark
-  @BenchmarkMode({Mode.AverageTime})
-  @OutputTimeUnit(TimeUnit.NANOSECONDS)
-  public void prometheusCounterChildIncBenchmark() {
-    prometheusCounterChild.increment();
-  }
-
   @Benchmark
   @BenchmarkMode({Mode.AverageTime})
   @OutputTimeUnit(TimeUnit.NANOSECONDS)
   public void prometheusSimpleCounterIncBenchmark() {
-    prometheusSimpleCounter.labels("test", "group").inc(); 
+    prometheusSimpleCounter.labels("test", "group").inc();
   }
-  
+
   @Benchmark
   @BenchmarkMode({Mode.AverageTime})
   @OutputTimeUnit(TimeUnit.NANOSECONDS)
   public void prometheusSimpleCounterChildIncBenchmark() {
-    prometheusSimpleCounterChild.inc(); 
+    prometheusSimpleCounterChild.inc();
   }
 
   @Benchmark
   @BenchmarkMode({Mode.AverageTime})
   @OutputTimeUnit(TimeUnit.NANOSECONDS)
   public void prometheusSimpleCounterNoLabelsIncBenchmark() {
-    prometheusSimpleCounterNoLabels.inc(); 
+    prometheusSimpleCounterNoLabels.inc();
   }
 
   @Benchmark
@@ -103,13 +80,14 @@ public void codahaleMeterMarkBenchmark() {
 
   public static void main(String[] args) throws RunnerException {
 
-    Options opt = new OptionsBuilder()
-      .include(CounterBenchmark.class.getSimpleName())
-      .warmupIterations(5)
-      .measurementIterations(4)
-      .threads(4)
-      .forks(1)
-      .build();
+    Options opt =
+        new OptionsBuilder()
+            .include(CounterBenchmark.class.getSimpleName())
+            .warmupIterations(5)
+            .measurementIterations(4)
+            .threads(4)
+            .forks(1)
+            .build();
 
     new Runner(opt).run();
   }
diff --git a/benchmarks/src/archive/java/io/prometheus/client/benchmark/ExemplarsBenchmark.java b/benchmarks/src/archive/java/io/prometheus/client/benchmark/ExemplarsBenchmark.java
new file mode 100644
index 000000000..a3fa45ae1
--- /dev/null
+++ b/benchmarks/src/archive/java/io/prometheus/client/benchmark/ExemplarsBenchmark.java
@@ -0,0 +1,87 @@
+package io.prometheus.client.benchmark;
+
+import io.prometheus.client.Counter;
+import io.prometheus.client.exemplars.DefaultExemplarSampler;
+import io.prometheus.client.exemplars.tracer.common.SpanContextSupplier;
+import java.util.concurrent.TimeUnit;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.OutputTimeUnit;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+
+@State(Scope.Benchmark)
+public class ExemplarsBenchmark {
+
+  private Counter counter;
+  private Counter counterWithExemplars;
+  private Counter counterWithoutExemplars;
+
+  @Setup
+  public void setup() {
+
+    counter =
+        Counter.build()
+            .name("counter_total")
+            .help("Total number of requests.")
+            .labelNames("path")
+            .create();
+
+    counterWithExemplars =
+        Counter.build()
+            .name("counter_with_exemplars_total")
+            .help("Total number of requests.")
+            .labelNames("path")
+            .withExemplarSampler(new DefaultExemplarSampler(new MockSpanContextSupplier()))
+            .create();
+
+    counterWithoutExemplars =
+        Counter.build()
+            .name("counter_without_exemplars_total")
+            .help("Total number of requests.")
+            .labelNames("path")
+            .withoutExemplars()
+            .create();
+  }
+
+  @Benchmark
+  @BenchmarkMode({Mode.AverageTime})
+  @OutputTimeUnit(TimeUnit.NANOSECONDS)
+  public void testCounter() {
+    counter.labels("test").inc();
+  }
+
+  @Benchmark
+  @BenchmarkMode({Mode.AverageTime})
+  @OutputTimeUnit(TimeUnit.NANOSECONDS)
+  public void testCounterWithExemplars() {
+    counterWithExemplars.labels("test").inc();
+  }
+
+  @Benchmark
+  @BenchmarkMode({Mode.AverageTime})
+  @OutputTimeUnit(TimeUnit.NANOSECONDS)
+  public void testCounterWithoutExemplars() {
+    counterWithoutExemplars.labels("test").inc();
+  }
+
+  private static class MockSpanContextSupplier implements SpanContextSupplier {
+
+    @Override
+    public String getTraceId() {
+      return "trace-id";
+    }
+
+    @Override
+    public String getSpanId() {
+      return "span-id";
+    }
+
+    @Override
+    public boolean isSampled() {
+      return true;
+    }
+  }
+}
diff --git a/benchmark/src/main/java/io/prometheus/benchmark/GaugeBenchmark.java b/benchmarks/src/archive/java/io/prometheus/client/benchmark/GaugeBenchmark.java
similarity index 55%
rename from benchmark/src/main/java/io/prometheus/benchmark/GaugeBenchmark.java
rename to benchmarks/src/archive/java/io/prometheus/client/benchmark/GaugeBenchmark.java
index d8037723f..a8eb03c83 100644
--- a/benchmark/src/main/java/io/prometheus/benchmark/GaugeBenchmark.java
+++ b/benchmarks/src/archive/java/io/prometheus/client/benchmark/GaugeBenchmark.java
@@ -1,11 +1,10 @@
-package io.prometheus.benchmark;
+package io.prometheus.client.benchmark;
 
 import com.codahale.metrics.MetricRegistry;
-
 import java.util.concurrent.TimeUnit;
+import org.openjdk.jmh.annotations.Benchmark;
 import org.openjdk.jmh.annotations.BenchmarkMode;
 import org.openjdk.jmh.annotations.Mode;
-import org.openjdk.jmh.annotations.Benchmark;
 import org.openjdk.jmh.annotations.OutputTimeUnit;
 import org.openjdk.jmh.annotations.Scope;
 import org.openjdk.jmh.annotations.Setup;
@@ -21,69 +20,47 @@ public class GaugeBenchmark {
   MetricRegistry registry;
   com.codahale.metrics.Counter codahaleCounter;
 
-  io.prometheus.client.metrics.Gauge prometheusGauge;
-  io.prometheus.client.metrics.Gauge.Child prometheusGaugeChild;
   io.prometheus.client.Gauge prometheusSimpleGauge;
   io.prometheus.client.Gauge.Child prometheusSimpleGaugeChild;
   io.prometheus.client.Gauge prometheusSimpleGaugeNoLabels;
 
   @Setup
   public void setup() {
-    prometheusGauge = io.prometheus.client.metrics.Gauge.newBuilder()
-      .name("name")
-      .documentation("some description..")
-      .build();
-    prometheusGaugeChild = prometheusGauge.newPartial().apply();
-
-    prometheusSimpleGauge = io.prometheus.client.Gauge.build()
-      .name("name")
-      .help("some description..")
-      .labelNames("some", "group").create();
+    prometheusSimpleGauge =
+        io.prometheus.client.Gauge.build()
+            .name("name")
+            .help("some description..")
+            .labelNames("some", "group")
+            .create();
     prometheusSimpleGaugeChild = prometheusSimpleGauge.labels("test", "group");
 
-    prometheusSimpleGaugeNoLabels = io.prometheus.client.Gauge.build()
-      .name("name")
-      .help("some description..")
-      .create();
+    prometheusSimpleGaugeNoLabels =
+        io.prometheus.client.Gauge.build().name("name").help("some description..").create();
 
     registry = new MetricRegistry();
     codahaleCounter = registry.counter("name");
   }
 
   // Increment.
-  @Benchmark
-  @BenchmarkMode({Mode.AverageTime})
-  @OutputTimeUnit(TimeUnit.NANOSECONDS)
-  public void prometheusGaugeIncBenchmark() {
-    prometheusGauge.newPartial().apply().increment();
-  }
-
-  @Benchmark
-  @BenchmarkMode({Mode.AverageTime})
-  @OutputTimeUnit(TimeUnit.NANOSECONDS)
-  public void prometheusGaugeChildIncBenchmark() {
-    prometheusGaugeChild.increment();
-  }
-
   @Benchmark
   @BenchmarkMode({Mode.AverageTime})
   @OutputTimeUnit(TimeUnit.NANOSECONDS)
   public void prometheusSimpleGaugeIncBenchmark() {
-    prometheusSimpleGauge.labels("test", "group").inc(); 
+    prometheusSimpleGauge.labels("test", "group").inc();
   }
-  
+
   @Benchmark
   @BenchmarkMode({Mode.AverageTime})
   @OutputTimeUnit(TimeUnit.NANOSECONDS)
   public void prometheusSimpleGaugeChildIncBenchmark() {
-    prometheusSimpleGaugeChild.inc(); 
+    prometheusSimpleGaugeChild.inc();
   }
 
   @Benchmark
   @BenchmarkMode({Mode.AverageTime})
   @OutputTimeUnit(TimeUnit.NANOSECONDS)
   public void prometheusSimpleGaugeNoLabelsIncBenchmark() {
-    prometheusSimpleGaugeNoLabels.inc(); 
+    prometheusSimpleGaugeNoLabels.inc();
   }
 
   @Benchmark
@@ -93,41 +70,26 @@ public void codahaleCounterIncBenchmark() {
     codahaleCounter.inc();
   }
 
-
   // Decrement.
-  @Benchmark
-  @BenchmarkMode({Mode.AverageTime})
-  @OutputTimeUnit(TimeUnit.NANOSECONDS)
-  public void prometheusGaugeDecBenchmark() {
-    prometheusGauge.newPartial().apply().decrement();
-  }
-
-  @Benchmark
-  @BenchmarkMode({Mode.AverageTime})
-  @OutputTimeUnit(TimeUnit.NANOSECONDS)
-  public void prometheusGaugeChildDecBenchmark() {
-    prometheusGaugeChild.decrement();
-  }
-
   @Benchmark
   @BenchmarkMode({Mode.AverageTime})
   @OutputTimeUnit(TimeUnit.NANOSECONDS)
   public void prometheusSimpleGaugeDecBenchmark() {
-    prometheusSimpleGauge.labels("test", "group").dec(); 
+    prometheusSimpleGauge.labels("test", "group").dec();
   }
-  
+
   @Benchmark
   @BenchmarkMode({Mode.AverageTime})
   @OutputTimeUnit(TimeUnit.NANOSECONDS)
   public void prometheusSimpleGaugeChildDecBenchmark() {
-    prometheusSimpleGaugeChild.dec(); 
+    prometheusSimpleGaugeChild.dec();
   }
 
   @Benchmark
   @BenchmarkMode({Mode.AverageTime})
   @OutputTimeUnit(TimeUnit.NANOSECONDS)
   public void prometheusSimpleGaugeNoLabelsDecBenchmark() {
-    prometheusSimpleGaugeNoLabels.dec(); 
+    prometheusSimpleGaugeNoLabels.dec();
   }
 
   @Benchmark
@@ -138,27 +100,13 @@ public void codahaleCounterDecBenchmark() {
   }
 
   // Set.
-  @Benchmark
-  @BenchmarkMode({Mode.AverageTime})
-  @OutputTimeUnit(TimeUnit.NANOSECONDS)
-  public void prometheusGaugeSetBenchmark() {
-    prometheusGauge.newPartial().apply().set(42);
-  }
-
-  @Benchmark
-  @BenchmarkMode({Mode.AverageTime})
-  @OutputTimeUnit(TimeUnit.NANOSECONDS)
-  public void prometheusGaugeChildSetBenchmark() {
-    prometheusGaugeChild.set(42);
-  }
-
   @Benchmark
   @BenchmarkMode({Mode.AverageTime})
   @OutputTimeUnit(TimeUnit.NANOSECONDS)
   public void prometheusSimpleGaugeSetBenchmark() {
-    prometheusSimpleGauge.labels("test", "group").set(42); 
+    prometheusSimpleGauge.labels("test", "group").set(42);
   }
-  
+
   @Benchmark
   @BenchmarkMode({Mode.AverageTime})
   @OutputTimeUnit(TimeUnit.NANOSECONDS)
@@ -170,18 +118,19 @@ public void prometheusSimpleGaugeChildSetBenchmark() {
   @BenchmarkMode({Mode.AverageTime})
   @OutputTimeUnit(TimeUnit.NANOSECONDS)
   public void prometheusSimpleGaugeNoLabelsSetBenchmark() {
-    prometheusSimpleGaugeNoLabels.set(42); 
+    prometheusSimpleGaugeNoLabels.set(42);
   }
 
   public static void main(String[] args) throws RunnerException {
 
-    Options opt = new OptionsBuilder()
-      .include(GaugeBenchmark.class.getSimpleName())
-      .warmupIterations(5)
-      .measurementIterations(4)
-      .threads(4)
-      .forks(1)
-      .build();
+    Options opt =
+        new OptionsBuilder()
+            .include(GaugeBenchmark.class.getSimpleName())
+            .warmupIterations(5)
+            .measurementIterations(4)
+            .threads(4)
+            .forks(1)
+            .build();
 
     new Runner(opt).run();
   }
diff --git a/benchmarks/src/archive/java/io/prometheus/client/benchmark/SanitizeMetricNameBenchmark.java b/benchmarks/src/archive/java/io/prometheus/client/benchmark/SanitizeMetricNameBenchmark.java
new file mode 100644
index 000000000..cb5f300ce
--- /dev/null
+++ b/benchmarks/src/archive/java/io/prometheus/client/benchmark/SanitizeMetricNameBenchmark.java
@@ -0,0 +1,49 @@
+package io.prometheus.client.benchmark;
+
+import io.prometheus.client.Collector;
+import java.util.concurrent.TimeUnit;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.OutputTimeUnit;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.runner.Runner;
+import org.openjdk.jmh.runner.RunnerException;
+import org.openjdk.jmh.runner.options.Options;
+import org.openjdk.jmh.runner.options.OptionsBuilder;
+import org.openjdk.jmh.runner.options.TimeValue;
+
+@State(Scope.Benchmark)
+public class SanitizeMetricNameBenchmark {
+
+  @Benchmark
+  @BenchmarkMode({Mode.AverageTime})
+  @OutputTimeUnit(TimeUnit.NANOSECONDS)
+  public void sanitizeSanitizedName() {
+    Collector.sanitizeMetricName("good_name");
+  }
+
+  @Benchmark
+  @BenchmarkMode({Mode.AverageTime})
+  @OutputTimeUnit(TimeUnit.NANOSECONDS)
+  public void sanitizeNonSanitizedName() {
+    Collector.sanitizeMetricName("9not_good_name!");
+  }
+
+  public static void main(String[] args) throws RunnerException {
+
+    Options opt =
+        new OptionsBuilder()
+            .include(SanitizeMetricNameBenchmark.class.getSimpleName())
+            .warmupIterations(5)
+            .measurementIterations(4)
+            .measurementTime(TimeValue.seconds(1))
+            .warmupTime(TimeValue.seconds(1))
+            .threads(4)
+            .forks(1)
+            .build();
+
+    new Runner(opt).run();
+  }
+}
diff --git a/benchmark/src/main/java/io/prometheus/benchmark/SummaryBenchmark.java b/benchmarks/src/archive/java/io/prometheus/client/benchmark/SummaryBenchmark.java
similarity index 60%
rename from benchmark/src/main/java/io/prometheus/benchmark/SummaryBenchmark.java
rename to benchmarks/src/archive/java/io/prometheus/client/benchmark/SummaryBenchmark.java
index 3a77dc5ec..2964b8ea8 100644
--- a/benchmark/src/main/java/io/prometheus/benchmark/SummaryBenchmark.java
+++ b/benchmarks/src/archive/java/io/prometheus/client/benchmark/SummaryBenchmark.java
@@ -1,11 +1,10 @@
-package io.prometheus.benchmark;
+package io.prometheus.client.benchmark;
 
 import com.codahale.metrics.MetricRegistry;
-
 import java.util.concurrent.TimeUnit;
+import org.openjdk.jmh.annotations.Benchmark;
 import org.openjdk.jmh.annotations.BenchmarkMode;
 import org.openjdk.jmh.annotations.Mode;
-import org.openjdk.jmh.annotations.Benchmark;
 import org.openjdk.jmh.annotations.OutputTimeUnit;
 import org.openjdk.jmh.annotations.Scope;
 import org.openjdk.jmh.annotations.Setup;
@@ -21,8 +20,6 @@ public class SummaryBenchmark {
   MetricRegistry registry;
   com.codahale.metrics.Histogram codahaleHistogram;
 
-  io.prometheus.client.metrics.Summary prometheusSummary;
-  io.prometheus.client.metrics.Summary.Child prometheusSummaryChild;
   io.prometheus.client.Summary prometheusSimpleSummary;
   io.prometheus.client.Summary.Child prometheusSimpleSummaryChild;
   io.prometheus.client.Summary prometheusSimpleSummaryNoLabels;
@@ -32,78 +29,58 @@ public class SummaryBenchmark {
 
   @Setup
   public void setup() {
-    prometheusSummary = io.prometheus.client.metrics.Summary.newBuilder()
-      .name("name")
-      .documentation("some description..")
-      .build();
-    prometheusSummaryChild = prometheusSummary.newPartial().apply();
-
-    prometheusSimpleSummary = io.prometheus.client.Summary.build()
-      .name("name")
-      .help("some description..")
-      .labelNames("some", "group").create();
+    prometheusSimpleSummary =
+        io.prometheus.client.Summary.build()
+            .name("name")
+            .help("some description..")
+            .labelNames("some", "group")
+            .create();
     prometheusSimpleSummaryChild = prometheusSimpleSummary.labels("test", "group");
 
-    prometheusSimpleSummaryNoLabels = io.prometheus.client.Summary.build()
-      .name("name")
-      .help("some description..")
-      .create();
+    prometheusSimpleSummaryNoLabels =
+        io.prometheus.client.Summary.build().name("name").help("some description..").create();
 
-    prometheusSimpleHistogram = io.prometheus.client.Histogram.build()
-      .name("name")
-      .help("some description..")
-      .labelNames("some", "group").create();
+    prometheusSimpleHistogram =
+        io.prometheus.client.Histogram.build()
+            .name("name")
+            .help("some description..")
+            .labelNames("some", "group")
+            .create();
     prometheusSimpleHistogramChild = prometheusSimpleHistogram.labels("test", "group");
 
-    prometheusSimpleHistogramNoLabels = io.prometheus.client.Histogram.build()
-      .name("name")
-      .help("some description..")
-      .create();
+    prometheusSimpleHistogramNoLabels =
+        io.prometheus.client.Histogram.build().name("name").help("some description..").create();
 
     registry = new MetricRegistry();
     codahaleHistogram = registry.histogram("name");
   }
 
-  @Benchmark
-  @BenchmarkMode({Mode.AverageTime})
-  @OutputTimeUnit(TimeUnit.NANOSECONDS)
-  public void prometheusSummaryBenchmark() {
-    prometheusSummary.newPartial().apply().observe(1.0);
-  }
-
-  @Benchmark
-  @BenchmarkMode({Mode.AverageTime})
-  @OutputTimeUnit(TimeUnit.NANOSECONDS)
-  public void prometheusSummaryChildBenchmark() {
-    prometheusSummaryChild.observe(1.0);
-  }
-
   @Benchmark
   @BenchmarkMode({Mode.AverageTime})
   @OutputTimeUnit(TimeUnit.NANOSECONDS)
   public void prometheusSimpleSummaryBenchmark() {
-    prometheusSimpleSummary.labels("test", "group").observe(1) ;
+    prometheusSimpleSummary.labels("test", "group").observe(1);
   }
 
   @Benchmark
   @BenchmarkMode({Mode.AverageTime})
   @OutputTimeUnit(TimeUnit.NANOSECONDS)
   public void prometheusSimpleSummaryChildBenchmark() {
-    prometheusSimpleSummaryChild.observe(1); 
+    prometheusSimpleSummaryChild.observe(1);
   }
 
   @Benchmark
   @BenchmarkMode({Mode.AverageTime})
   @OutputTimeUnit(TimeUnit.NANOSECONDS)
   public void prometheusSimpleSummaryNoLabelsBenchmark() {
-    prometheusSimpleSummaryNoLabels.observe(1); 
+    prometheusSimpleSummaryNoLabels.observe(1);
   }
 
   @Benchmark
   @BenchmarkMode({Mode.AverageTime})
   @OutputTimeUnit(TimeUnit.NANOSECONDS)
   public void prometheusSimpleHistogramBenchmark() {
-    prometheusSimpleHistogram.labels("test", "group").observe(1) ;
+    prometheusSimpleHistogram.labels("test", "group").observe(1);
   }
 
   @Benchmark
@@ -129,13 +106,14 @@ public void codahaleHistogramBenchmark() {
 
   public static void main(String[] args) throws RunnerException {
 
-    Options opt = new OptionsBuilder()
-      .include(SummaryBenchmark.class.getSimpleName())
-      .warmupIterations(5)
-      .measurementIterations(4)
-      .threads(4)
-      .forks(1)
-      .build();
+    Options opt =
+        new OptionsBuilder()
+            .include(SummaryBenchmark.class.getSimpleName())
+            .warmupIterations(5)
+            .measurementIterations(4)
+            .threads(4)
+            .forks(1)
+            .build();
 
     new Runner(opt).run();
   }
diff --git a/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/BenchmarkRunner.java b/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/BenchmarkRunner.java
new file mode 100644
index 000000000..9d5d242ae
--- /dev/null
+++ b/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/BenchmarkRunner.java
@@ -0,0 +1,7 @@
+package io.prometheus.metrics.benchmarks;
+
+public class BenchmarkRunner {
+  public static void main(String[] args) throws Exception {
+    org.openjdk.jmh.Main.main(args);
+  }
+}
diff --git a/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/CounterBenchmark.java b/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/CounterBenchmark.java
new file mode 100644
index 000000000..f5d0a1a0f
--- /dev/null
+++ b/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/CounterBenchmark.java
@@ -0,0 +1,206 @@
+package io.prometheus.metrics.benchmarks;
+
+import io.opentelemetry.api.OpenTelemetry;
+import io.opentelemetry.api.common.AttributeKey;
+import io.opentelemetry.api.common.Attributes;
+import io.opentelemetry.api.metrics.DoubleCounter;
+import io.opentelemetry.api.metrics.LongCounter;
+import io.opentelemetry.api.metrics.Meter;
+import io.opentelemetry.sdk.OpenTelemetrySdk;
+import io.opentelemetry.sdk.metrics.SdkMeterProvider;
+import io.opentelemetry.sdk.resources.Resource;
+import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader;
+import io.prometheus.metrics.core.datapoints.CounterDataPoint;
+import io.prometheus.metrics.core.metrics.Counter;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.Threads;
+
+/**
+ * Results on a machine with dedicated Ubuntu 24.04 LTS, AMD Ryzen™ 9 7900 × 24, 96.0 GiB RAM:
+ *
+ * 
+ * Benchmark                                             Mode  Cnt       Score       Error  Units
+ * CounterBenchmark.codahaleIncNoLabels                 thrpt   25  144632.191 ±  2778.333  ops/s
+ * CounterBenchmark.openTelemetryAdd                    thrpt   25    2165.775 ±   168.554  ops/s
+ * CounterBenchmark.openTelemetryInc                    thrpt   25    1940.143 ±    86.223  ops/s
+ * CounterBenchmark.openTelemetryIncNoLabels            thrpt   25    1880.089 ±   192.395  ops/s
+ * CounterBenchmark.prometheusAdd                       thrpt   25  122427.789 ±  1377.485  ops/s
+ * CounterBenchmark.prometheusInc                       thrpt   25  183603.131 ±  2812.874  ops/s
+ * CounterBenchmark.prometheusNoLabelsInc               thrpt   25  169733.499 ±   670.495  ops/s
+ * CounterBenchmark.simpleclientAdd                     thrpt   25   13771.151 ±    77.473  ops/s
+ * CounterBenchmark.simpleclientInc                     thrpt   25   14255.342 ±   117.339  ops/s
+ * CounterBenchmark.simpleclientNoLabelsInc             thrpt   25   14175.465 ±    56.575  ops/s
+ * 
+ * + * Prometheus counters are faster than counters of other libraries. For example, incrementing a + * single counter without labels is more than 2 times faster (34752 ops / second) than doing the + * same with an OpenTelemetry counter (16634 ops / sec). + */ +public class CounterBenchmark { + + @State(Scope.Benchmark) + public static class PrometheusCounter { + + final Counter noLabels; + final CounterDataPoint dataPoint; + + public PrometheusCounter() { + noLabels = Counter.builder().name("test").help("help").build(); + + Counter labels = + Counter.builder().name("test").help("help").labelNames("path", "status").build(); + this.dataPoint = labels.labelValues("/", "200"); + } + } + + @State(Scope.Benchmark) + public static class SimpleclientCounter { + + final io.prometheus.client.Counter noLabels; + final io.prometheus.client.Counter.Child dataPoint; + + public SimpleclientCounter() { + noLabels = io.prometheus.client.Counter.build().name("name").help("help").create(); + + io.prometheus.client.Counter counter = + io.prometheus.client.Counter.build() + .name("name") + .help("help") + .labelNames("path", "status") + .create(); + + this.dataPoint = counter.labels("/", "200"); + } + } + + @State(Scope.Benchmark) + public static class CodahaleCounterNoLabels { + final com.codahale.metrics.Counter counter = + new com.codahale.metrics.MetricRegistry().counter("test"); + } + + @State(Scope.Benchmark) + public static class OpenTelemetryCounter { + + final LongCounter longCounter; + final DoubleCounter doubleCounter; + final Attributes attributes; + + public OpenTelemetryCounter() { + + SdkMeterProvider sdkMeterProvider = + SdkMeterProvider.builder() + .registerMetricReader(InMemoryMetricReader.create()) + .setResource(Resource.getDefault()) + .build(); + OpenTelemetry openTelemetry = + OpenTelemetrySdk.builder().setMeterProvider(sdkMeterProvider).build(); + Meter meter = + openTelemetry + .meterBuilder("instrumentation-library-name") + .setInstrumentationVersion("1.0.0") + .build(); + this.longCounter = meter.counterBuilder("test1").setDescription("test").build(); + this.doubleCounter = meter.counterBuilder("test2").ofDoubles().setDescription("test").build(); + this.attributes = + Attributes.of( + AttributeKey.stringKey("path"), "/", + AttributeKey.stringKey("status"), "200"); + } + } + + @Benchmark + @Threads(4) + public CounterDataPoint prometheusAdd(RandomNumbers randomNumbers, PrometheusCounter counter) { + for (int i = 0; i < randomNumbers.randomNumbers.length; i++) { + counter.dataPoint.inc(randomNumbers.randomNumbers[i]); + } + return counter.dataPoint; + } + + @Benchmark + @Threads(4) + public CounterDataPoint prometheusInc(PrometheusCounter counter) { + for (int i = 0; i < 10 * 1024; i++) { + counter.dataPoint.inc(); + } + return counter.dataPoint; + } + + @Benchmark + @Threads(4) + public DoubleCounter openTelemetryAdd(RandomNumbers randomNumbers, OpenTelemetryCounter counter) { + for (int i = 0; i < randomNumbers.randomNumbers.length; i++) { + counter.doubleCounter.add(randomNumbers.randomNumbers[i], counter.attributes); + } + return counter.doubleCounter; + } + + @Benchmark + @Threads(4) + public LongCounter openTelemetryInc(OpenTelemetryCounter counter) { + for (int i = 0; i < 10 * 1024; i++) { + counter.longCounter.add(1, counter.attributes); + } + return counter.longCounter; + } + + @Benchmark + @Threads(4) + public LongCounter openTelemetryIncNoLabels(OpenTelemetryCounter counter) { + for (int i = 0; i < 10 * 1024; i++) { + counter.longCounter.add(1); + } + return counter.longCounter; + } + + @Benchmark + @Threads(4) + public io.prometheus.client.Counter.Child simpleclientAdd( + RandomNumbers randomNumbers, SimpleclientCounter counter) { + for (int i = 0; i < randomNumbers.randomNumbers.length; i++) { + counter.dataPoint.inc(randomNumbers.randomNumbers[i]); + } + return counter.dataPoint; + } + + @Benchmark + @Threads(4) + public io.prometheus.client.Counter.Child simpleclientInc(SimpleclientCounter counter) { + for (int i = 0; i < 10 * 1024; i++) { + counter.dataPoint.inc(); + } + return counter.dataPoint; + } + + @Benchmark + @Threads(4) + public com.codahale.metrics.Counter codahaleIncNoLabels( + RandomNumbers randomNumbers, CodahaleCounterNoLabels counter) { + for (int i = 0; i < 10 * 1024; i++) { + counter.counter.inc(); + } + return counter.counter; + } + + @Benchmark + @Threads(4) + public io.prometheus.metrics.core.metrics.Counter prometheusNoLabelsInc( + PrometheusCounter counter) { + for (int i = 0; i < 10 * 1024; i++) { + counter.noLabels.inc(); + } + return counter.noLabels; + } + + @Benchmark + @Threads(4) + public io.prometheus.client.Counter simpleclientNoLabelsInc(SimpleclientCounter counter) { + for (int i = 0; i < 10 * 1024; i++) { + counter.noLabels.inc(); + } + return counter.noLabels; + } +} diff --git a/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/HistogramBenchmark.java b/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/HistogramBenchmark.java new file mode 100644 index 000000000..9ada40f35 --- /dev/null +++ b/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/HistogramBenchmark.java @@ -0,0 +1,185 @@ +package io.prometheus.metrics.benchmarks; + +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.metrics.Meter; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.Aggregation; +import io.opentelemetry.sdk.metrics.InstrumentSelector; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.View; +import io.opentelemetry.sdk.resources.Resource; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import io.prometheus.metrics.core.metrics.Histogram; +import java.util.Arrays; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Threads; + +/** + * Results on a machine with dedicated Ubuntu 24.04 LTS, AMD Ryzen™ 9 7900 × 24, 96.0 GiB RAM: + * + *
+ * Benchmark                                             Mode  Cnt       Score       Error  Units
+ * HistogramBenchmark.openTelemetryClassic              thrpt   25     968.178 ±    28.582  ops/s
+ * HistogramBenchmark.openTelemetryExponential          thrpt   25     836.000 ±    17.709  ops/s
+ * HistogramBenchmark.prometheusClassic                 thrpt   25    7010.393 ±   683.782  ops/s
+ * HistogramBenchmark.prometheusNative                  thrpt   25    5040.572 ±   284.433  ops/s
+ * HistogramBenchmark.simpleclient                      thrpt   25   10485.462 ±    41.265  ops/s
+ * 
+ * + * The simpleclient (i.e. client_java version 0.16.0 and older) histograms perform about the same as + * the classic histogram of the current 1.0.0 version. + * + *

Compared to OpenTelemetry histograms the Prometheus Java client histograms perform more than 3 + * times better (OpenTelemetry has 1908 ops / sec for classic histograms, while Prometheus has 6451 + * ops / sec). + */ +public class HistogramBenchmark { + + @State(Scope.Benchmark) + public static class PrometheusClassicHistogram { + + final Histogram noLabels; + + public PrometheusClassicHistogram() { + noLabels = Histogram.builder().name("test").help("help").classicOnly().build(); + } + } + + @State(Scope.Benchmark) + public static class PrometheusNativeHistogram { + + final Histogram noLabels; + + public PrometheusNativeHistogram() { + noLabels = + Histogram.builder() + .name("test") + .help("help") + .nativeOnly() + .nativeInitialSchema(5) + .nativeMaxNumberOfBuckets(0) + .build(); + } + } + + @State(Scope.Benchmark) + public static class SimpleclientHistogram { + + final io.prometheus.client.Histogram noLabels; + + public SimpleclientHistogram() { + noLabels = io.prometheus.client.Histogram.build().name("name").help("help").create(); + } + } + + @State(Scope.Benchmark) + public static class OpenTelemetryClassicHistogram { + + final io.opentelemetry.api.metrics.DoubleHistogram histogram; + + public OpenTelemetryClassicHistogram() { + + SdkMeterProvider sdkMeterProvider = + SdkMeterProvider.builder() + .registerMetricReader(InMemoryMetricReader.create()) + .setResource(Resource.getDefault()) + .registerView( + InstrumentSelector.builder().setName("test").build(), + View.builder() + .setAggregation( + Aggregation.explicitBucketHistogram( + Arrays.asList( + .005, .01, .025, .05, .1, .25, .5, 1.0, 2.5, 5.0, 10.0))) + .build()) + .build(); + OpenTelemetry openTelemetry = + OpenTelemetrySdk.builder().setMeterProvider(sdkMeterProvider).build(); + Meter meter = + openTelemetry + .meterBuilder("instrumentation-library-name") + .setInstrumentationVersion("1.0.0") + .build(); + this.histogram = meter.histogramBuilder("test").setDescription("test").build(); + } + } + + @State(Scope.Benchmark) + public static class OpenTelemetryExponentialHistogram { + + final io.opentelemetry.api.metrics.DoubleHistogram histogram; + + public OpenTelemetryExponentialHistogram() { + + SdkMeterProvider sdkMeterProvider = + SdkMeterProvider.builder() + .registerMetricReader(InMemoryMetricReader.create()) + .setResource(Resource.getDefault()) + .registerView( + InstrumentSelector.builder().setName("test").build(), + View.builder() + .setAggregation(Aggregation.base2ExponentialBucketHistogram(10_000, 5)) + .build()) + .build(); + OpenTelemetry openTelemetry = + OpenTelemetrySdk.builder().setMeterProvider(sdkMeterProvider).build(); + Meter meter = + openTelemetry + .meterBuilder("instrumentation-library-name") + .setInstrumentationVersion("1.0.0") + .build(); + this.histogram = meter.histogramBuilder("test").setDescription("test").build(); + } + } + + @Benchmark + @Threads(4) + public Histogram prometheusClassic( + RandomNumbers randomNumbers, PrometheusClassicHistogram histogram) { + for (int i = 0; i < randomNumbers.randomNumbers.length; i++) { + histogram.noLabels.observe(randomNumbers.randomNumbers[i]); + } + return histogram.noLabels; + } + + @Benchmark + @Threads(4) + public Histogram prometheusNative( + RandomNumbers randomNumbers, PrometheusNativeHistogram histogram) { + for (int i = 0; i < randomNumbers.randomNumbers.length; i++) { + histogram.noLabels.observe(randomNumbers.randomNumbers[i]); + } + return histogram.noLabels; + } + + @Benchmark + @Threads(4) + public io.prometheus.client.Histogram simpleclient( + RandomNumbers randomNumbers, SimpleclientHistogram histogram) { + for (int i = 0; i < randomNumbers.randomNumbers.length; i++) { + histogram.noLabels.observe(randomNumbers.randomNumbers[i]); + } + return histogram.noLabels; + } + + @Benchmark + @Threads(4) + public io.opentelemetry.api.metrics.DoubleHistogram openTelemetryClassic( + RandomNumbers randomNumbers, OpenTelemetryClassicHistogram histogram) { + for (int i = 0; i < randomNumbers.randomNumbers.length; i++) { + histogram.histogram.record(randomNumbers.randomNumbers[i]); + } + return histogram.histogram; + } + + @Benchmark + @Threads(4) + public io.opentelemetry.api.metrics.DoubleHistogram openTelemetryExponential( + RandomNumbers randomNumbers, OpenTelemetryExponentialHistogram histogram) { + for (int i = 0; i < randomNumbers.randomNumbers.length; i++) { + histogram.histogram.record(randomNumbers.randomNumbers[i]); + } + return histogram.histogram; + } +} diff --git a/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/RandomNumbers.java b/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/RandomNumbers.java new file mode 100644 index 000000000..6778c4ea1 --- /dev/null +++ b/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/RandomNumbers.java @@ -0,0 +1,18 @@ +package io.prometheus.metrics.benchmarks; + +import java.util.Random; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; + +@State(Scope.Thread) +public class RandomNumbers { + + final double[] randomNumbers = new double[10 * 1024]; + + public RandomNumbers() { + Random rand = new Random(0); + for (int i = 0; i < randomNumbers.length; i++) { + randomNumbers[i] = Math.abs(rand.nextGaussian()); + } + } +} diff --git a/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/TextFormatUtilBenchmark.java b/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/TextFormatUtilBenchmark.java new file mode 100644 index 000000000..ed3ef4246 --- /dev/null +++ b/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/TextFormatUtilBenchmark.java @@ -0,0 +1,136 @@ +package io.prometheus.metrics.benchmarks; + +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.expositionformats.ExpositionFormatWriter; +import io.prometheus.metrics.expositionformats.OpenMetricsTextFormatWriter; +import io.prometheus.metrics.expositionformats.PrometheusTextFormatWriter; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot.GaugeDataPointSnapshot; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import io.prometheus.metrics.model.snapshots.SummarySnapshot.SummaryDataPointSnapshot; +import io.prometheus.metrics.model.snapshots.Unit; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; + +/** + * Results on a machine with dedicated Ubuntu 24.04 LTS, AMD Ryzen™ 9 7900 × 24, 96.0 GiB RAM: + * + *

+ * Benchmark                                             Mode  Cnt       Score       Error  Units
+ * TextFormatUtilBenchmark.openMetricsWriteToByteArray  thrpt   25  826847.708 ± 10941.611  ops/s
+ * TextFormatUtilBenchmark.openMetricsWriteToNull       thrpt   25  847756.101 ±  5299.128  ops/s
+ * TextFormatUtilBenchmark.prometheusWriteToByteArray   thrpt   25  874804.601 ±  9730.060  ops/s
+ * TextFormatUtilBenchmark.prometheusWriteToNull        thrpt   25  910782.719 ± 17617.167  ops/s
+ * 
+ */ +public class TextFormatUtilBenchmark { + + private static final MetricSnapshots SNAPSHOTS; + + static { + MetricSnapshot gaugeSnapshot = + GaugeSnapshot.builder() + .name("gauge_snapshot_name") + .dataPoint( + GaugeDataPointSnapshot.builder() + .labels(Labels.of("name", "value")) + .scrapeTimestampMillis(1000L) + .value(123.45d) + .build()) + .build(); + + MetricSnapshot summaryDataPointSnapshot = + SummarySnapshot.builder() + .name("summary_snapshot_name_bytes") + .dataPoint( + SummaryDataPointSnapshot.builder() + .count(5) + .labels(Labels.of("name", "value")) + .sum(123456d) + .build()) + .unit(Unit.BYTES) + .build(); + + SNAPSHOTS = MetricSnapshots.of(gaugeSnapshot, summaryDataPointSnapshot); + } + + private static final ExpositionFormatWriter OPEN_METRICS_TEXT_FORMAT_WRITER = + OpenMetricsTextFormatWriter.create(); + private static final ExpositionFormatWriter PROMETHEUS_TEXT_FORMAT_WRITER = + PrometheusTextFormatWriter.create(); + + @State(Scope.Benchmark) + public static class WriterState { + + final ByteArrayOutputStream byteArrayOutputStream; + + public WriterState() { + this.byteArrayOutputStream = new ByteArrayOutputStream(); + } + } + + @Benchmark + public OutputStream openMetricsWriteToByteArray(WriterState writerState) throws IOException { + // avoid growing the array + ByteArrayOutputStream byteArrayOutputStream = writerState.byteArrayOutputStream; + byteArrayOutputStream.reset(); + OPEN_METRICS_TEXT_FORMAT_WRITER.write( + byteArrayOutputStream, SNAPSHOTS, EscapingScheme.ALLOW_UTF8); + return byteArrayOutputStream; + } + + @Benchmark + public OutputStream openMetricsWriteToNull() throws IOException { + OutputStream nullOutputStream = NullOutputStream.INSTANCE; + OPEN_METRICS_TEXT_FORMAT_WRITER.write(nullOutputStream, SNAPSHOTS, EscapingScheme.ALLOW_UTF8); + return nullOutputStream; + } + + @Benchmark + public OutputStream prometheusWriteToByteArray(WriterState writerState) throws IOException { + // avoid growing the array + ByteArrayOutputStream byteArrayOutputStream = writerState.byteArrayOutputStream; + byteArrayOutputStream.reset(); + PROMETHEUS_TEXT_FORMAT_WRITER.write( + byteArrayOutputStream, SNAPSHOTS, EscapingScheme.ALLOW_UTF8); + return byteArrayOutputStream; + } + + @Benchmark + public OutputStream prometheusWriteToNull() throws IOException { + OutputStream nullOutputStream = NullOutputStream.INSTANCE; + PROMETHEUS_TEXT_FORMAT_WRITER.write(nullOutputStream, SNAPSHOTS, EscapingScheme.ALLOW_UTF8); + return nullOutputStream; + } + + static final class NullOutputStream extends OutputStream { + + static final OutputStream INSTANCE = new NullOutputStream(); + + private NullOutputStream() { + super(); + } + + @Override + public void write(int b) {} + + @Override + public void write(byte[] b) {} + + @Override + public void write(byte[] b, int off, int len) {} + + @Override + public void flush() {} + + @Override + public void close() {} + } +} diff --git a/benchmarks/version-rules.xml b/benchmarks/version-rules.xml new file mode 100644 index 000000000..76f8da4fd --- /dev/null +++ b/benchmarks/version-rules.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml new file mode 100644 index 000000000..5f632c578 --- /dev/null +++ b/checkstyle-suppressions.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/checkstyle.xml b/checkstyle.xml new file mode 100644 index 000000000..cac6be8d3 --- /dev/null +++ b/checkstyle.xml @@ -0,0 +1,374 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 000000000..2a8645fe5 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +.hugo_build.lock diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 000000000..8ca147236 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,60 @@ +# Docs + +This directory contains [hugo](https://gohugo.io) documentation to be published in GitHub pages. + +## Run Locally + +```shell +hugo server -D +``` + +This will serve the docs on [http://localhost:1313](http://localhost:1313). + +## Deploy to GitHub Pages + +Changes to the `main` branch will be deployed automatically with GitHub Actions. + +## Update Javadoc + +Javadoc are not checked-in to the GitHub repository. +They are generated on the fly by GitHub Actions when the docs are updated. +To view locally, run the following: + +```shell +# note that the 'compile' in the following command is necessary for +# Javadoc to detect the module structure +./mvnw clean compile javadoc:javadoc javadoc:aggregate +rm -r ./docs/static/api +mv ./target/site/apidocs ./docs/static/api +``` + +GitHub pages are in the `/client_java/` folder, so we link to `/client_java/api` rather than `/api`. +To make JavaDoc work locally, create a link: + +```shell +mkdir ./docs/static/client_java +ln -s ../api ./docs/static/client_java/api +``` + +## Update Geekdocs + +The docs use the [Geekdocs](https://geekdocs.de/) theme. The theme is checked in to GitHub in the +`./docs/themes/hugo-geekdoc/` folder. To update [Geekdocs](https://geekdocs.de/), remove the current +folder and create a new one with the +latest [release](https://github.com/thegeeklab/hugo-geekdoc/releases). There are no local +modifications in `./docs/themes/hugo-geekdoc/`. + +## Notes + +Here's how the initial `docs/` folder was set up: + +```shell +hugo new site docs +cd docs/ +mkdir -p themes/hugo-geekdoc/ +curl -L https://github.com/thegeeklab/hugo-geekdoc/releases/download/v0.41.1/hugo-geekdoc.tar.gz \ + | tar -xz -C themes/hugo-geekdoc/ --strip-components=1 +``` + +Create the initial `hugo.toml` file as described +in [https://geekdocs.de/usage/getting-started/](https://geekdocs.de/usage/getting-started/). diff --git a/docs/archetypes/default.md b/docs/archetypes/default.md new file mode 100644 index 000000000..c6f3fcef6 --- /dev/null +++ b/docs/archetypes/default.md @@ -0,0 +1,5 @@ ++++ +title = '{{ replace .File.ContentBaseName "-" " " | title }}' +date = {{ .Date }} +draft = true ++++ diff --git a/docs/content/_index.md b/docs/content/_index.md new file mode 100644 index 000000000..3b8966cf3 --- /dev/null +++ b/docs/content/_index.md @@ -0,0 +1,55 @@ +--- +title: "client_java" +--- + +This is the documentation for the +[Prometheus Java client library](https://github.com/prometheus/client_java) +version 1.0.0 and higher. + +The main new features of the 1.0.0 release are: + +- **Prometheus native histograms:** Support for the new Prometheus histogram type. +- **OpenTelemetry Exporter:** Push metrics in OTLP format to an OpenTelemetry endpoint. +- **Runtime configuration:** Configure metrics, exporters, and more at runtime using a properties + file or system properties. + +**Documentation and Examples** + +In addition to this documentation page we created an +[examples/](https://github.com/prometheus/client_java/tree/main/examples) directory with end-to-end +scenarios (Docker compose) illustrating new features. + +**Performance Benchmarks** + +Initial performance benchmarks are looking great: All core metric types (including native +histograms) allow concurrent updates, so if you instrument a performance critical Web service +that utilizes all processor cores in parallel the metrics library will not introduce additional +synchronization. See Javadoc comments in +[benchmarks/](https://github.com/prometheus/client_java/tree/main/benchmarks) for benchmark results. + +**More Info** + +The Grafana Labs Blog has a post +[Introducing the Prometheus Java Client 1.0.0](https://grafana.com/blog/2023/09/27/introducing-the-prometheus-java-client-1.0.0/) +with a good overview of the release. + +There will also be a presentation at the [PromCon](https://promcon.io) conference on 29 Sep 2023. +Tune in to the live stream on [https://promcon.io](https://promcon.io) +or watch the recording on YouTube. + +**For users of the 0.16.0 version and older** + +Updating to the 1.0.0 version is a breaking change. However, there's a +`prometheus-metrics-simpleclient-bridge` module available that allows you to use your existing +simpleclient 0.16.0 metrics with the new 1.0.0 `PrometheusRegistry`. +So you don't need to upgrade your instrumentation code, you can keep using your existing metrics. +See the +[compatibility > simpleclient](https://prometheus.github.io/client_java/migration/simpleclient/) +in the menu on the left. + +The pre 1.0.0 code is now maintained on the +[simpleclient](https://github.com/prometheus/client_java/tree/simpleclient) feature branch. + +Not all `simpleclient` modules from 0.16.0 are included in the initial 1.0.0 release. +Over the next couple of weeks we will work on porting the remaining modules, +starting with `pushgateway` and the Servlet filter. diff --git a/docs/content/config/_index.md b/docs/content/config/_index.md new file mode 100644 index 000000000..dc32223b0 --- /dev/null +++ b/docs/content/config/_index.md @@ -0,0 +1,4 @@ +--- +title: Config +weight: 5 +--- diff --git a/docs/content/config/config.md b/docs/content/config/config.md new file mode 100644 index 000000000..deceae000 --- /dev/null +++ b/docs/content/config/config.md @@ -0,0 +1,184 @@ +--- +title: Config +weight: 1 +--- + +{{< toc >}} + +The Prometheus metrics library provides multiple options how to override configuration at runtime: + +- Properties file +- System properties + +Future releases will add more options, like configuration via environment variables. + +Example: + +```properties +io.prometheus.exporter.httpServer.port=9401 +``` + +The property above changes the port for the +[HTTPServer exporter]({{< relref "/exporters/httpserver.md" >}}) to _9401_. + +- Properties file: Add the line above to the properties file. +- System properties: Use the command line parameter `-Dio.prometheus.exporter.httpServer.port=9401` +- when starting your application. + +## Location of the Properties File + +The properties file is searched in the following locations: + +- `/prometheus.properties` in the classpath. This is for bundling a properties file + with your application. +- System property `-Dprometheus.config=/path/to/prometheus.properties`. +- Environment variable `PROMETHEUS_CONFIG=/path/to/prometheus.properties`. + +## Metrics Properties + + + +| Name | Javadoc | Note | +| --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +| io.prometheus.metrics.exemplarsEnabled | [Counter.Builder.withExemplars()]() | (1) (2) | +| io.prometheus.metrics.histogramNativeOnly | [Histogram.Builder.nativeOnly()]() | (2) | +| io.prometheus.metrics.histogramClassicOnly | [Histogram.Builder.classicOnly()]() | (2) | +| io.prometheus.metrics.histogramClassicUpperBounds | [Histogram.Builder.classicUpperBounds()]() | (3) | +| io.prometheus.metrics.histogramNativeInitialSchema | [Histogram.Builder.nativeInitialSchema()]() | | +| io.prometheus.metrics.histogramNativeMinZeroThreshold | [Histogram.Builder.nativeMinZeroThreshold()]() | | +| io.prometheus.metrics.histogramNativeMaxZeroThreshold | [Histogram.Builder.nativeMaxZeroThreshold()]() | | +| io.prometheus.metrics.histogramNativeMaxNumberOfBuckets | [Histogram.Builder.nativeMaxNumberOfBuckets()]() | | +| io.prometheus.metrics.histogramNativeResetDurationSeconds | [Histogram.Builder.nativeResetDuration()]() | | +| io.prometheus.metrics.summaryQuantiles | [Summary.Builder.quantile(double)]() | (4) | +| io.prometheus.metrics.summaryQuantileErrors | [Summary.Builder.quantile(double, double)]() | (5) | +| io.prometheus.metrics.summaryMaxAgeSeconds | [Summary.Builder.maxAgeSeconds()]() | | +| io.prometheus.metrics.summaryNumberOfAgeBuckets | [Summary.Builder.numberOfAgeBuckets()]() | | + + + +**Notes** + +(1) _withExemplars()_ and _withoutExemplars()_ are available for all metric types, +not just for counters
+(2) Boolean value. Format: `property=true` or `property=false`.
+(3) Comma-separated list. Example: `.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10`.
+(4) Comma-separated list. Example: `0.5, 0.95, 0.99`.
+(5) Comma-separated list. If specified, the list must have the same length as +`io.prometheus.metrics.summaryQuantiles`. Example: `0.01, 0.005, 0.005`. + +There's one special feature about metric properties: You can set a property for one specific +metric only by specifying the metric name. Example: +Let's say you have a histogram named `latency_seconds`. + +```properties +io.prometheus.metrics.histogramClassicUpperBounds=0.2, 0.4, 0.8, 1.0 +``` + +The line above sets histogram buckets for all histograms. However: + +```properties +io.prometheus.metrics.latency_seconds.histogramClassicUpperBounds=0.2, 0.4, 0.8, 1.0 +``` + +The line above sets histogram buckets only for the histogram named `latency_seconds`. + +This works for all Metrics properties. + +## Exemplar Properties + + + +| Name | Javadoc | Note | +| -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- | +| io.prometheus.exemplars.minRetentionPeriodSeconds | [ExemplarsProperties.getMinRetentionPeriodSeconds()]() | | +| io.prometheus.exemplars.maxRetentionPeriodSeconds | [ExemplarsProperties.getMaxRetentionPeriodSeconds()]() | | +| io.prometheus.exemplars.sampleIntervalMilliseconds | [ExemplarsProperties.getSampleIntervalMilliseconds()]() | | + + + +## Exporter Properties + + + +| Name | Javadoc | Note | +| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- | +| io.prometheus.exporter.includeCreatedTimestamps | [ExporterProperties.getIncludeCreatedTimestamps()]() | (1) | +| io.prometheus.exporter.exemplarsOnAllMetricTypes | [ExporterProperties.getExemplarsOnAllMetricTypes()]() | (1) | + + + +(1) Boolean value, `true` or `false`. Default see Javadoc. + +## Exporter Filter Properties + + + +| Name | Javadoc | Note | +| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- | +| io.prometheus.exporter.filter.metricNameMustBeEqualTo | [ExporterFilterProperties.getAllowedMetricNames()]() | (1) | +| io.prometheus.exporter.filter.metricNameMustNotBeEqualTo | [ExporterFilterProperties.getExcludedMetricNames()]() | (2) | +| io.prometheus.exporter.filter.metricNameMustStartWith | [ExporterFilterProperties.getAllowedMetricNamePrefixes()]() | (3) | +| io.prometheus.exporter.filter.metricNameMustNotStartWith | [ExporterFilterProperties.getExcludedMetricNamePrefixes()]() | (4) | + + + +(1) Comma separated list of allowed metric names. Only these metrics will be exposed.
+(2) Comma separated list of excluded metric names. These metrics will not be exposed.
+(3) Comma separated list of prefixes. +Only metrics starting with these prefixes will be exposed.
+(4) Comma separated list of prefixes. Metrics starting with these prefixes will not be exposed.
+ +## Exporter HTTPServer Properties + + + +| Name | Javadoc | Note | +| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ---- | +| io.prometheus.exporter.httpServer.port | [HTTPServer.Builder.port()]() | | + + + +## Exporter OpenTelemetry Properties + + + +| Name | Javadoc | Note | +| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- | +| io.prometheus.exporter.opentelemetry.protocol | [OpenTelemetryExporter.Builder.protocol()]() | (1) | +| io.prometheus.exporter.opentelemetry.endpoint | [OpenTelemetryExporter.Builder.endpoint()]() | | +| io.prometheus.exporter.opentelemetry.headers | [OpenTelemetryExporter.Builder.headers()]() | (2) | +| io.prometheus.exporter.opentelemetry.intervalSeconds | [OpenTelemetryExporter.Builder.intervalSeconds()]() | | +| io.prometheus.exporter.opentelemetry.timeoutSeconds | [OpenTelemetryExporter.Builder.timeoutSeconds()]() | | +| io.prometheus.exporter.opentelemetry.serviceName | [OpenTelemetryExporter.Builder.serviceName()]() | | +| io.prometheus.exporter.opentelemetry.serviceNamespace | [OpenTelemetryExporter.Builder.serviceNamespace()]() | | +| io.prometheus.exporter.opentelemetry.serviceInstanceId | [OpenTelemetryExporter.Builder.serviceInstanceId()]() | | +| io.prometheus.exporter.opentelemetry.serviceVersion | [OpenTelemetryExporter.Builder.serviceVersion()]() | | +| io.prometheus.exporter.opentelemetry.resourceAttributes | [OpenTelemetryExporter.Builder.resourceAttributes()]() | (3) | + + + +(1) Protocol can be `grpc` or `http/protobuf`.
+(2) Format: `key1=value1,key2=value2`
+(3) Format: `key1=value1,key2=value2` + +Many of these attributes can alternatively be configured via OpenTelemetry environment variables, +like `OTEL_EXPORTER_OTLP_ENDPOINT`. +The Prometheus metrics library has support for OpenTelemetry environment variables. +See Javadoc for details. + +## Exporter PushGateway Properties + + + +| Name | Javadoc | Note | +| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---- | +| io.prometheus.exporter.pushgateway.address | [PushGateway.Builder.address()]() | | +| io.prometheus.exporter.pushgateway.scheme | [PushGateway.Builder.scheme()]() | | +| io.prometheus.exporter.pushgateway.job | [PushGateway.Builder.job()]() | | +| io.prometheus.exporter.pushgateway.escapingScheme | [PushGateway.Builder.escapingScheme()]() | (1) | + + + +(1) Escaping scheme can be `allow-utf-8`, `underscores`, `dots`, or `values` as described in +[escaping schemes](https://github.com/prometheus/docs/blob/main/docs/instrumenting/escaping_schemes.md#escaping-schemes) +and in the [Unicode documentation]({{< relref "../exporters/unicode.md" >}}). diff --git a/docs/content/exporters/_index.md b/docs/content/exporters/_index.md new file mode 100644 index 000000000..796db3ff3 --- /dev/null +++ b/docs/content/exporters/_index.md @@ -0,0 +1,4 @@ +--- +title: Exporters +weight: 2 +--- diff --git a/docs/content/exporters/filter.md b/docs/content/exporters/filter.md new file mode 100644 index 000000000..ae7ad9564 --- /dev/null +++ b/docs/content/exporters/filter.md @@ -0,0 +1,20 @@ +--- +title: Filter +weight: 3 +--- + +All exporters support a `name[]` URL parameter for querying only specific metric names. Examples: + +- `/metrics?name[]=jvm_threads_current` will query the metric named `jvm_threads_current`. +- `/metrics?name[]=jvm_threads_current&name[]=jvm_threads_daemon` will query two metrics, + `jvm_threads_current` and `jvm_threads_daemon`. + +Add the following to the scape job configuration in `prometheus.yml` +to make the Prometheus server send the `name[]` parameter: + +```yaml +params: + name[]: + - jvm_threads_current + - jvm_threads_daemon +``` diff --git a/docs/content/exporters/formats.md b/docs/content/exporters/formats.md new file mode 100644 index 000000000..a6485c84c --- /dev/null +++ b/docs/content/exporters/formats.md @@ -0,0 +1,110 @@ +--- +title: Formats +weight: 1 +--- + +All exporters the following exposition formats: + +- OpenMetrics text format +- Prometheus text format +- Prometheus protobuf format + +Moreover, gzip encoding is supported for each of these formats. + +## Scraping with a Prometheus server + +The Prometheus server sends an `Accept` header to specify which format is requested. By default, the +Prometheus server will scrape OpenMetrics text format with gzip encoding. If the Prometheus server +is started with `--enable-feature=native-histograms`, it will scrape Prometheus protobuf format +instead. + +## Viewing with a Web Browser + +If you view the `/metrics` endpoint with your Web browser you will see Prometheus text format. For +quick debugging of the other formats, exporters provide a `debug` URL parameter: + +- `/metrics?debug=openmetrics`: View OpenMetrics text format. +- `/metrics?debug=text`: View Prometheus text format. +- `/metrics?debug=prometheus-protobuf`: View a text representation of the Prometheus protobuf + format. + +## Exclude protobuf exposition format + +You can exclude the protobuf exposition format by including the +`prometheus-metrics-exposition-textformats` module and excluding the +`prometheus-metrics-exposition-formats` module in your build file. + +For example, in Maven: + +```xml + + + io.prometheus + prometheus-metrics-exporter-httpserver + + + io.prometheus + prometheus-metrics-exposition-formats + + + + + io.prometheus + prometheus-metrics-exposition-textformats + + +``` + +## Exclude the shaded protobuf classes + +You can exclude the shaded protobuf classes including the +`prometheus-metrics-exposition-formats-no-protobuf` module and excluding the +`prometheus-metrics-exposition-formats` module in your build file. + +For example, in Maven: + +```xml + + + io.prometheus + prometheus-metrics-exporter-httpserver + + + io.prometheus + prometheus-metrics-exposition-formats + + + + + io.prometheus + prometheus-metrics-exposition-formats-no-protobuf + + +``` + +## Exclude the shaded otel classes + +You can exclude the shaded otel classes including the +`prometheus-metrics-exporter-opentelemetry-no-otel` module and excluding the +`prometheus-metrics-exporter-opentelemetry` module in your build file. + +For example, in Maven: + +```xml + + + io.prometheus + prometheus-metrics-exporter-opentelemetry + + + io.prometheus + prometheus-metrics-exporter-opentelemetry + + + + + io.prometheus + prometheus-metrics-exporter-opentelemetry-no-otel + + +``` diff --git a/docs/content/exporters/httpserver.md b/docs/content/exporters/httpserver.md new file mode 100644 index 000000000..801ad60eb --- /dev/null +++ b/docs/content/exporters/httpserver.md @@ -0,0 +1,43 @@ +--- +title: HTTPServer +weight: 4 +--- + +The `HTTPServer` is a standalone server for exposing a metric endpoint. A minimal example +application for `HTTPServer` can be found in +the [examples](https://github.com/prometheus/client_java/tree/1.0.x/examples) directory. + +```java +HTTPServer server = HTTPServer.builder() + .port(9400) + .buildAndStart(); +``` + +By default, `HTTPServer` binds to any IP address, you can change this with +[hostname()]() +or [inetAddress()](). + +`HTTPServer` is configured with three endpoints: + +- `/metrics` for Prometheus scraping. +- `/-/healthy` for simple health checks. +- `/` the default handler is a static HTML page. + +The default handler can be changed +with [defaultHandler()](). + +## Authentication and HTTPS + +- [authenticator()]() + is for configuring authentication. +- [httpsConfigurator()]() + is for configuring HTTPS. + +You can find an example of authentication and SSL in the +[jmx_exporter](https://github.com/prometheus/jmx_exporter). + +## Properties + +See _config_ section (_todo_) on runtime configuration options. + +- `io.prometheus.exporter.httpServer.port`: The port to bind to. diff --git a/docs/content/exporters/pushgateway.md b/docs/content/exporters/pushgateway.md new file mode 100644 index 000000000..497aa9b57 --- /dev/null +++ b/docs/content/exporters/pushgateway.md @@ -0,0 +1,125 @@ +--- +title: Pushgateway +weight: 6 +--- + +The [Prometheus Pushgateway](https://github.com/prometheus/pushgateway) exists to allow ephemeral +and batch jobs to expose their metrics to Prometheus. +Since these kinds of jobs may not exist long enough to be scraped, they can instead push their +metrics to a Pushgateway. +The Pushgateway then exposes these metrics to Prometheus. + +The [PushGateway](/client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.html) Java +class allows you to push metrics to a Prometheus Pushgateway. + +## Example + +{{< tabs "uniqueid" >}} +{{< tab "Gradle" >}} + +```groovy +implementation 'io.prometheus:prometheus-metrics-core:1.3.0' +implementation 'io.prometheus:prometheus-metrics-exporter-pushgateway:1.3.0' +``` + +{{< /tab >}} +{{< tab "Maven" >}} + +```xml + + io.prometheus + prometheus-metrics-core + 1.3.0 + + + io.prometheus + prometheus-metrics-exporter-pushgateway + 1.3.0 + +``` + +{{< /tab >}} +{{< /tabs >}} + +```java +public class ExampleBatchJob { + + private static PushGateway pushGateway = PushGateway.builder() + .address("localhost:9091") // not needed as localhost:9091 is the default + .job("example") + .build(); + + private static Gauge dataProcessedInBytes = Gauge.builder() + .name("data_processed") + .help("data processed in the last batch job run") + .unit(Unit.BYTES) + .register(); + + public static void main(String[] args) throws Exception { + try { + long bytesProcessed = processData(); + dataProcessedInBytes.set(bytesProcessed); + } finally { + pushGateway.push(); + } + } + + public static long processData() { + // Imagine a batch job here that processes data + // and returns the number of Bytes processed. + return 42; + } +} +``` + +## Basic Auth + +The [PushGateway](/client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.html) +supports basic authentication. + +```java +PushGateway pushGateway = PushGateway.builder() + .job("example") + .basicAuth("my_user", "my_password") + .build(); +``` + +The `PushGatewayTestApp` in `integration-tests/it-pushgateway` has a complete example of this. + +## Bearer token + +The [PushGateway](/client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.html) +supports Bearer token authentication. + +```java +PushGateway pushGateway = PushGateway.builder() + .job("example") + .bearerToken("my_token") + .build(); +``` + +The `PushGatewayTestApp` in `integration-tests/it-pushgateway` has a complete example of this. + +## SSL + +The [PushGateway](/client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.html) +supports SSL. + +```java +PushGateway pushGateway = PushGateway.builder() + .job("example") + .scheme(Scheme.HTTPS) + .build(); +``` + +However, this requires that the JVM can validate the server certificate. + +If you want to skip certificate verification, you need to provide your own +[HttpConnectionFactory](/client_java/api/io/prometheus/metrics/exporter/pushgateway/HttpConnectionFactory.html). +The `PushGatewayTestApp` in `integration-tests/it-pushgateway` has a complete example of this. + +## Configuration Properties + +The [PushGateway](/client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.html) +supports a couple of properties that can be configured at runtime. +See [config]({{< relref "../config/config.md" >}}). diff --git a/docs/content/exporters/servlet.md b/docs/content/exporters/servlet.md new file mode 100644 index 000000000..2b0873b70 --- /dev/null +++ b/docs/content/exporters/servlet.md @@ -0,0 +1,51 @@ +--- +title: Servlet +weight: 5 +--- + +The +[PrometheusMetricsServlet](/client_java/api/io/prometheus/metrics/exporter/servlet/jakarta/PrometheusMetricsServlet.html) +is a [Jakarta Servlet](https://jakarta.ee/specifications/servlet/) for exposing a metric endpoint. + +## web.xml + +The old-school way of configuring a servlet is in a `web.xml` file: + + + +```xml + + + + prometheus-metrics + io.prometheus.metrics.exporter.servlet.jakarta.PrometheusMetricsServlet + + + prometheus-metrics + /metrics + + +``` + + + +## Programmatic + +Today, most Servlet applications use an embedded Servlet container and configure Servlets +programmatically rather than via `web.xml`. +The API for that depends on the Servlet container. +The [examples](https://github.com/prometheus/client_java/tree/1.0.x/examples) directory has an +example of an embedded +[Tomcat](https://tomcat.apache.org/) container with the +[PrometheusMetricsServlet](/client_java/api/io/prometheus/metrics/exporter/servlet/jakarta/PrometheusMetricsServlet.html) +configured. + +## Spring + +You can use +the [PrometheusMetricsServlet](/client_java/api/io/prometheus/metrics/exporter/servlet/jakarta/PrometheusMetricsServlet.html) +in Spring applications. +See [our Spring doc]({{< relref "spring.md" >}}). diff --git a/docs/content/exporters/spring.md b/docs/content/exporters/spring.md new file mode 100644 index 000000000..45df21431 --- /dev/null +++ b/docs/content/exporters/spring.md @@ -0,0 +1,92 @@ +--- +title: Spring +weight: 7 +--- + +## Alternative: Use Spring's Built-in Metrics Library + +[Spring Boot](https://spring.io/projects/spring-boot) has a built-in metric library named +[Micrometer](https://micrometer.io/), which supports Prometheus +exposition format and can be set up in three simple steps: + +1. Add the `org.springframework.boot:spring-boot-starter-actuator` dependency. +2. Add the `io.micrometer:micrometer-registry-prometheus` as a _runtime_ dependency. +3. Enable the Prometheus endpoint by adding the line + `management.endpoints.web.exposure.include=prometheus` to `application.properties`. + +Note that Spring's default Prometheus endpoint is `/actuator/prometheus`, not `/metrics`. + +In most cases the built-in Spring metrics library will work for you and you don't need the +Prometheus Java library in Spring applications. + +## Use the Prometheus Metrics Library in Spring + +However, you may have your reasons why you want to use the Prometheus metrics library in +Spring anyway. Maybe you want full support for all Prometheus metric types, +or you want to use the new Prometheus native histograms. + +The easiest way to use the Prometheus metrics library in Spring is to configure the +[PrometheusMetricsServlet](/client_java/api/io/prometheus/metrics/exporter/servlet/jakarta/PrometheusMetricsServlet.html) +to expose metrics. + +Dependencies: + +- `prometheus-metrics-core`: The core metrics library. +- `prometheus-metrics-exporter-servlet-jakarta`: For providing the `/metrics` endpoint. +- `prometheus-metrics-instrumentation-jvm`: Optional - JVM metrics + +The following is the complete source code of a Spring Boot REST service using +the Prometheus metrics library: + +```java +import io.prometheus.metrics.core.metrics.Counter; +import io.prometheus.metrics.exporter.servlet.jakarta.PrometheusMetricsServlet; +import io.prometheus.metrics.instrumentation.jvm.JvmMetrics; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@SpringBootApplication +@RestController +public class DemoApplication { + + private static final Counter requestCount = Counter.builder() + .name("requests_total") + .register(); + + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + JvmMetrics.builder().register(); + } + + @GetMapping("/") + public String sayHello() throws InterruptedException { + requestCount.inc(); + return "Hello, World!\n"; + } + + @Bean + public ServletRegistrationBean createPrometheusMetricsEndpoint() { + return new ServletRegistrationBean<>(new PrometheusMetricsServlet(), "/metrics/*"); + } +} +``` + +The important part are the last three lines: They configure the +[PrometheusMetricsServlet](/client_java/api/io/prometheus/metrics/exporter/servlet/jakarta/PrometheusMetricsServlet.html) +to expose metrics on `/metrics`: + +```java + +@Bean +public ServletRegistrationBean createPrometheusMetricsEndpoint() { + return new ServletRegistrationBean<>(new PrometheusMetricsServlet(), "/metrics/*"); +} +``` + +The example provides a _Hello, world!_ endpoint on +[http://localhost:8080](http://localhost:8080), and Prometheus metrics on +[http://localhost:8080/metrics](http://localhost:8080/metrics). diff --git a/docs/content/exporters/unicode.md b/docs/content/exporters/unicode.md new file mode 100644 index 000000000..2a34e0400 --- /dev/null +++ b/docs/content/exporters/unicode.md @@ -0,0 +1,34 @@ +--- +title: Unicode +weight: 2 +--- + +{{< hint type=warning >}} +Unicode support is experimental, because [OpenMetrics specification](https://openmetrics.io/) is not +updated yet to support Unicode characters in metric and label names. +{{< /hint >}} + +The Prometheus Java client library allows all Unicode characters, that can be encoded as UTF-8. + +At scrape time, some characters are replaced based on the `encoding` header according +to +the [Escaping scheme](https://github.com/prometheus/docs/blob/main/docs/instrumenting/escaping_schemes.md). + +For example, if you use the `underscores` escaping scheme, dots in metric and label names are +replaced with underscores, so that the metric name `http.server.duration` becomes +`http_server_duration`. + +Prometheus servers that do not support Unicode at all will not pass the `encoding` header, and the +Prometheus Java client library will replace dots, as well as any character that is not in the legacy +character set (`a-zA-Z0-9_:`), with underscores by default. + +When `escaping=allow-utf-8` is passed, add valid UTF-8 characters to the metric and label names +without replacing them. This allows you to use dots in metric and label names, as well as +other UTF-8 characters, without any replacements. + +## PushGateway + +When using the [Pushgateway]({{< relref "pushgateway.md" >}}), Unicode support has to be enabled +explicitly by setting `io.prometheus.exporter.pushgateway.escapingScheme` to `allow-utf-8` in the +Pushgateway configuration file - see +[Pushgateway configuration]({{< relref "/config/config.md#exporter-pushgateway-properties" >}}) diff --git a/docs/content/getting-started/_index.md b/docs/content/getting-started/_index.md new file mode 100644 index 000000000..427269117 --- /dev/null +++ b/docs/content/getting-started/_index.md @@ -0,0 +1,4 @@ +--- +title: Getting Started +weight: 1 +--- diff --git a/docs/content/getting-started/callbacks.md b/docs/content/getting-started/callbacks.md new file mode 100644 index 000000000..514d74c2a --- /dev/null +++ b/docs/content/getting-started/callbacks.md @@ -0,0 +1,62 @@ +--- +title: Callbacks +weight: 5 +--- + +The section on [metric types]({{< relref "metric-types.md" >}}) +showed how to use metrics that actively maintain their state. + +This section shows how to create callback-based metrics, i.e. metrics that invoke a callback +at scrape time to get the current values. + +For example, let's assume we have two instances of a `Cache`, a `coldCache` and a `hotCache`. +The following implements a callback-based `cache_size_bytes` metric: + +```java +Cache coldCache = new Cache(); +Cache hotCache = new Cache(); + +GaugeWithCallback.builder() + .name("cache_size_bytes") + .help("Size of the cache in Bytes.") + .unit(Unit.BYTES) + .labelNames("state") + .callback(callback -> { + callback.call(coldCache.sizeInBytes(), "cold"); + callback.call(hotCache.sizeInBytes(), "hot"); + }) + .register(); +``` + +The resulting text format looks like this: + +```text +# TYPE cache_size_bytes gauge +# UNIT cache_size_bytes bytes +# HELP cache_size_bytes Size of the cache in Bytes. +cache_size_bytes{state="cold"} 78.0 +cache_size_bytes{state="hot"} 83.0 +``` + +Better examples of callback metrics can be found in the `prometheus-metrics-instrumentation-jvm` +module. + +The available callback metric types are: + +- `GaugeWithCallback` for gauges. +- `CounterWithCallback` for counters. +- `SummaryWithCallback` for summaries. + +The API for gauges and counters is very similar. For summaries the callback has a few more +parameters, because it accepts a count, a sum, and quantiles: + +```java +SummaryWithCallback.builder() + .name("example_callback_summary") + .help("help message.") + .labelNames("status") + .callback(callback -> { + callback.call(cache.getCount(), cache.getSum(), Quantiles.EMPTY, "ok"); + }) + .register(); +``` diff --git a/docs/content/getting-started/labels.md b/docs/content/getting-started/labels.md new file mode 100644 index 000000000..d056a6ce6 --- /dev/null +++ b/docs/content/getting-started/labels.md @@ -0,0 +1,153 @@ +--- +title: Labels +weight: 3 +--- + +The following shows an example of a Prometheus metric in text format: + +```text +# HELP payments_total total number of payments +# TYPE payments_total counter +payments_total{status="error",type="paypal"} 1.0 +payments_total{status="success",type="credit card"} 3.0 +payments_total{status="success",type="paypal"} 2.0 +``` + +The example shows a counter metric named `payments_total` with two labels: `status` and `type`. +Each individual data point (each line in text format) is identified by the unique combination of +its metric name and its label name/value pairs. + +## Creating a Metric with Labels + +Labels are supported for all metric types. We are using counters in this example, however the +`labelNames()` and `labelValues()` methods are the same for other metric types. + +The following code creates the counter above. + +```java +Counter counter = Counter.builder() + .name("payments_total") + .help("total number of payments") + .labelNames("type", "status") + .register(); + +counter.labelValues("credit card", "success").inc(3.0); +counter.labelValues("paypal", "success").inc(2.0); +counter.labelValues("paypal", "error").inc(1.0); +``` + +The label names have to be specified when the metric is created and cannot change. The label values +are created on demand when values are observed. + +## Creating a Metric without Labels + +Labels are optional. The following example shows a metric without labels: + +```java +Counter counter = Counter.builder() + .name("payments_total") + .help("total number of payments") + .register(); + +counter.inc(3.0); +``` + +## Cardinality Explosion + +Each combination of label names and values will result in a new data point, i.e. a new line in text +format. +Therefore, a good label should have only a small number of possible values. +If you select labels with many possible values, like unique IDs or timestamps, +you may end up with an enormous number of data points. +This is called cardinality explosion. + +Here's a bad example, don't do this: + +```java +Counter loginCount = Counter.builder() + .name("logins_total") + .help("total number of logins") + .labelNames("user_id", "timestamp") // not a good idea, this will result in too many data points + .register(); + +String userId = UUID.randomUUID().toString(); +String timestamp = Long.toString(System.currentTimeMillis()); + +loginCount.labelValues(userId, timestamp).inc(); +``` + +## Initializing Label Values + +If you register a metric without labels, it will show up immediately with initial value of zero. + +However, metrics with labels only show up after the label values are first used. In the example +above + +```java +counter.labelValues("paypal", "error").inc(); +``` + +The data point + +```text +payments_total{status="error",type="paypal"} 1.0 +``` + +will jump from non-existent to value 1.0. You will never see it with value 0.0. + +This is usually not an issue. However, if you find this annoying and want to see all possible label +values from the start, you can initialize label values with `initLabelValues()` like this: + +```java +Counter counter = Counter.builder() + .name("payments_total") + .help("total number of payments") + .labelNames("type", "status") + .register(); + +counter.initLabelValues("credit card", "success"); +counter.initLabelValues("credit card", "error"); +counter.initLabelValues("paypal", "success"); +counter.initLabelValues("paypal", "error"); +``` + +Now the four combinations will be visible from the start with initial value zero. + +```text +# HELP payments_total total number of payments +# TYPE payments_total counter +payments_total{status="error",type="credit card"} 0.0 +payments_total{status="error",type="paypal"} 0.0 +payments_total{status="success",type="credit card"} 0.0 +payments_total{status="success",type="paypal"} 0.0 +``` + +## Expiring Unused Label Values + +There is no automatic expiry of unused label values (yet). Once a set of label values is used, it +will remain there forever. + +However, you can programmatically remove label values like this: + +```java +counter.remove("paypal", "error"); +counter.remove("paypal", "success"); +``` + +## Const Labels + +If you have labels values that never change, you can specify them in the builder as `constLabels()`: + +```java +Counter counter = Counter.builder() + .name("payments_total") + .help("total number of payments") + .constLabels(Labels.of("env", "dev")) + .labelNames("type", "status") + .register(); +``` + +However, most use cases for `constLabels()` are better covered by target labels set by the scraping +Prometheus server, +or by one specific metric (e.g. a `build_info` or a `machine_role` metric). See also +[target labels, not static scraped labels](https://prometheus.io/docs/instrumenting/writing_exporters/#target-labels-not-static-scraped-labels). diff --git a/docs/content/getting-started/metric-types.md b/docs/content/getting-started/metric-types.md new file mode 100644 index 000000000..46d53ece1 --- /dev/null +++ b/docs/content/getting-started/metric-types.md @@ -0,0 +1,278 @@ +--- +title: "Metric Types" +weight: 4 +--- + +The Prometheus Java metrics library implements the metric types defined in +the [OpenMetrics](https://openmetrics.io) standard: + +{{< toc >}} + +## Counter + +Counter is the most common and useful metric type. Counters can only increase, but never decrease. +In the Prometheus query language, +the [rate()](https://prometheus.io/docs/prometheus/latest/querying/functions/#rate) function is +often used for counters to calculate the average increase per second. + +{{< hint type=note >}} +Counter values do not need to be integers. In many cases counters represent a number of events (like +the number of requests), and in that case the counter value is an integer. However, counters can +also be used for something like "total time spent doing something" in which case the counter value +is a floating point number. +{{< /hint >}} + +Here's an example of a counter: + +```java +Counter serviceTimeSeconds = Counter.builder() + .name("service_time_seconds_total") + .help("total time spent serving requests") + .unit(Unit.SECONDS) + .register(); + +serviceTimeSeconds.inc(Unit.millisToSeconds(200)); +``` + +The resulting counter has the value `0.2`. As `SECONDS` is the standard time unit in Prometheus, the +`Unit` utility class has methods to convert other time units to seconds. + +As defined in [OpenMetrics](https://openmetrics.io/), counter metric names must have the `_total` +suffix. If you create a counter without the `_total` suffix the suffix will be appended +automatically. + +## Gauge + +Gauges are current measurements, such as the current temperature in Celsius. + +```java +Gauge temperature = Gauge.builder() + .name("temperature_celsius") + .help("current temperature") + .labelNames("location") + .unit(Unit.CELSIUS) + .register(); + +temperature.labelValues("Berlin").set(22.3); +``` + +## Histogram + +Histograms are for observing distributions, like latency distributions for HTTP services or the +distribution of request sizes. +Unlike with counters and gauges, each histogram data point has a complex data structure representing +different aspects of the distribution: + +- Count: The total number of observations. +- Sum: The sum of all observed values, e.g. the total time spent serving requests. +- Buckets: The histogram buckets representing the distribution. + +Prometheus supports two flavors of histograms: + +- Classic histograms: Bucket boundaries are explicitly defined when the histogram is created. +- Native histograms (exponential histograms): Infinitely many virtual buckets. + +By default, histograms maintain both flavors. Which one is used depends on the scrape request from +the Prometheus server. + +- By default, the Prometheus server will scrape metrics in OpenMetrics format and get the classic + histogram flavor. +- If the Prometheus server is started with `--enable-feature=native-histograms`, it will request + metrics in Prometheus protobuf format and ingest the native histogram. +- If the Prometheus server is started with `--enable-feature=native-histogram` and the scrape config + has the option `scrape_classic_histograms: true`, it will request metrics in Prometheus protobuf + format and ingest both, the classic and the native flavor. This is great for migrating from + classic histograms to native histograms. + +See [examples/example-native-histogram](https://github.com/prometheus/client_java/tree/1.0.x/examples/example-native-histogram) +for an example. + +```java +Histogram duration = Histogram.builder() + .name("http_request_duration_seconds") + .help("HTTP request service time in seconds") + .unit(Unit.SECONDS) + .labelNames("method", "path", "status_code") + .register(); + +long start = System.nanoTime(); +// do something +duration.labelValues("GET", "/", "200").observe(Unit.nanosToSeconds(System.nanoTime() - start)); +``` + +Histograms implement +the [TimerApi](/client_java/api/io/prometheus/metrics/core/datapoints/TimerApi.html) interface, +which provides convenience methods for measuring durations. + +The histogram builder provides a lot of configuration for fine-tuning the histogram behavior. In +most cases you don't need them, defaults are good. The following is an incomplete list showing the +most important options: + +- `nativeOnly()` / `classicOnly()`: Create a histogram with one representation only. +- `classicUpperBounds(...)`: Set the classic bucket upper boundaries. Default bucket upper + boundaries are `.005`, `.01`, `.025`, `.05`, `.1`, `.25`, `.5`, `1`, `2.5`, `5`, `and 10`. The + default bucket boundaries are designed for measuring request durations in seconds. +- `nativeMaxNumberOfBuckets()`: Upper limit for the number of native histogram buckets. + Default is 160. When the maximum is reached, the native histogram automatically + reduces resolution to stay below the limit. + +See Javadoc +for [Histogram.Builder](/client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html) +for a complete list of options. Some options can be configured at runtime, +see [config]({{< relref "../config/config.md" >}}). + +Histograms and summaries are both used for observing distributions. Therefore, the both implement +the `DistributionDataPoint` interface. Using the `DistributionDataPoint` interface directly gives +you the option to switch between histograms and summaries later with minimal code changes. + +Example of using the `DistributionDataPoint` interface for a histogram without labels: + +```java +DistributionDataPoint eventDuration = Histogram.builder() + .name("event_duration_seconds") + .help("event duration in seconds") + .unit(Unit.SECONDS) + .register(); + +// The following still works perfectly fine if eventDuration +// is backed by a summary rather than a histogram. +eventDuration.observe(0.2); +``` + +Example of using the `DistributionDataPoint` interface for a histogram with labels: + +```java +Histogram eventDuration = Histogram.builder() + .name("event_duration_seconds") + .help("event duration in seconds") + .labelNames("status") + .unit(Unit.SECONDS) + .register(); + +DistributionDataPoint successfulEvents = eventDuration.labelValues("ok"); +DistributionDataPoint erroneousEvents = eventDuration.labelValues("error"); + +// Like in the example above, the following still works perfectly fine +// if the successfulEvents and erroneousEvents are backed by a summary rather than a histogram. +successfulEvents.observe(0.7); +erroneousEvents.observe(0.2); +``` + +## Summary + +Like histograms, summaries are for observing distributions. Each summary data point has a count and +a sum like a histogram data point. +However, rather than histogram buckets summaries maintain quantiles. + +```java +Summary requestLatency = Summary.builder() + .name("request_latency_seconds") + .help("Request latency in seconds.") + .unit(Unit.SECONDS) + .quantile(0.5, 0.01) + .quantile(0.95, 0.005) + .quantile(0.99, 0.005) + .labelNames("status") + .register(); + +requestLatency.labelValues("ok").observe(2.7); +``` + +The example above creates a summary with the 50th percentile (median), the 95th percentile, and the +99th percentile. Quantiles are optional, you can create a summary without quantiles if all you need +is the count and the sum. + +{{< hint type=note >}} +The terms "percentile" and "quantile" mean the same thing. We use percentile when we express it as a +number in [0, 100], and we use quantile when we express it as a number in [0.0, 1.0]. +{{< /hint >}} + +The second parameter to `quantile()` is the maximum acceptable error. The call +`.quantile(0.5, 0.01)` means that the actual quantile is somewhere in [0.49, 0.51]. Higher precision +means higher memory usage. + +The 0.0 quantile (min value) and the 1.0 quantile (max value) are special cases because you can get +the precise values (error 0.0) with almost no memory overhead. + +Quantile values are calculated based on a 5 minutes moving time window. The default time window can +be changed with `maxAgeSeconds()` and `numberOfAgeBuckets()`. + +Some options can be configured at runtime, see [config]({{< relref "../config/config.md" >}}). + +In general you should prefer histograms over summaries. The Prometheus query language has a +function [histogram_quantile()](https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_quantile) +for calculating quantiles from histograms. The advantage of query-time quantile calculation is that +you can aggregate histograms before calculating the quantile. With summaries you must use the +quantile with all its labels as it is. + +## Info + +Info metrics are used to expose textual information which should not change during process lifetime. +The value of an Info metric is always `1`. + +```java +Info info = Info.builder() + .name("jvm_runtime_info") + .help("JVM runtime info") + .labelNames("version", "vendor", "runtime") + .register(); + +String version = System.getProperty("java.runtime.version", "unknown"); +String vendor = System.getProperty("java.vm.vendor", "unknown"); +String runtime = System.getProperty("java.runtime.name", "unknown"); + +info.setLabelValues(version, vendor, runtime); +``` + +The info above looks as follows in OpenMetrics text format: + + + +```text +# TYPE jvm_runtime info +# HELP jvm_runtime JVM runtime info +jvm_runtime_info{runtime="OpenJDK Runtime Environment",vendor="Oracle Corporation",version="1.8.0_382-b05"} 1 +``` + + + +The example is taken from the `prometheus-metrics-instrumentation-jvm` module, so if you have +`JvmMetrics` registered you should have a `jvm_runtime_info` metric out-of-the-box. + +As defined in [OpenMetrics](https://openmetrics.io/), info metric names must have the `_info` +suffix. If you create a counter without the `_info` suffix the suffix will be appended +automatically. + +## StateSet + +StateSet are a niche metric type in the OpenMetrics standard that is rarely used. The main use case +is to signal which feature flags are enabled. + +```java +StateSet stateSet = StateSet.builder() + .name("feature_flags") + .help("Feature flags") + .labelNames("env") + .states("feature1", "feature2") + .register(); + +stateSet.labelValues("dev").setFalse("feature1"); +stateSet.labelValues("dev").setTrue("feature2"); +``` + +The OpenMetrics text format looks like this: + +```text +# TYPE feature_flags stateset +# HELP feature_flags Feature flags +feature_flags{env="dev",feature_flags="feature1"} 0 +feature_flags{env="dev",feature_flags="feature2"} 1 +``` + +## GaugeHistogram and Unknown + +These types are defined in the [OpenMetrics](https://openmetrics.io/) standard but not implemented +in the `prometheus-metrics-core` API. +However, `prometheus-metrics-model` implements the underlying data model for these types. +To use these types, you need to implement your own `Collector` where the `collect()` method returns +an `UnknownSnapshot` or a `HistogramSnapshot` with `.gaugeHistogram(true)`. diff --git a/docs/content/getting-started/multi-target.md b/docs/content/getting-started/multi-target.md new file mode 100644 index 000000000..16f85ac40 --- /dev/null +++ b/docs/content/getting-started/multi-target.md @@ -0,0 +1,124 @@ +--- +title: Multi-Target Pattern +weight: 7 +--- + +{{< hint type=note >}} +This is for the upcoming release 1.1.0. +{{< /hint >}} + +To support multi-target pattern you can create a custom collector overriding the purposed internal +method in ExtendedMultiCollector +see SampleExtendedMultiCollector in io.prometheus.metrics.examples.httpserver + + + +```java +public class SampleExtendedMultiCollector extends ExtendedMultiCollector { + + public SampleExtendedMultiCollector() { + super(); + } + + @Override + protected MetricSnapshots collectMetricSnapshots(PrometheusScrapeRequest scrapeRequest) { + + GaugeSnapshot.Builder gaugeBuilder = GaugeSnapshot.builder(); + gaugeBuilder.name("x_load").help("process load"); + + CounterSnapshot.Builder counterBuilder = CounterSnapshot.builder(); + counterBuilder.name(PrometheusNaming.sanitizeMetricName("x_calls_total")).help("invocations"); + + String[] targetNames = scrapeRequest.getParameterValues("target"); + String targetName; + String[] procs = scrapeRequest.getParameterValues("proc"); + if (targetNames == null || targetNames.length == 0) { + targetName = "defaultTarget"; + procs = null; //ignore procs param + } else { + targetName = targetNames[0]; + } + Builder counterDataPointBuilder = CounterSnapshot.CounterDataPointSnapshot.builder(); + io.prometheus.metrics.model.snapshots.GaugeSnapshot.GaugeDataPointSnapshot.Builder gaugeDataPointBuilder = GaugeSnapshot.GaugeDataPointSnapshot.builder(); + Labels lbls = Labels.of("target", targetName); + + if (procs == null || procs.length == 0) { + counterDataPointBuilder.labels(lbls.merge(Labels.of("proc", "defaultProc"))); + gaugeDataPointBuilder.labels(lbls.merge(Labels.of("proc", "defaultProc"))); + counterDataPointBuilder.value(70); + gaugeDataPointBuilder.value(Math.random()); + + counterBuilder.dataPoint(counterDataPointBuilder.build()); + gaugeBuilder.dataPoint(gaugeDataPointBuilder.build()); + + } else { + for (int i = 0; i < procs.length; i++) { + counterDataPointBuilder.labels(lbls.merge(Labels.of("proc", procs[i]))); + gaugeDataPointBuilder.labels(lbls.merge(Labels.of("proc", procs[i]))); + counterDataPointBuilder.value(Math.random()); + gaugeDataPointBuilder.value(Math.random()); + + counterBuilder.dataPoint(counterDataPointBuilder.build()); + gaugeBuilder.dataPoint(gaugeDataPointBuilder.build()); + } + } + Collection snaps = new ArrayList(); + snaps.add(counterBuilder.build()); + snaps.add(gaugeBuilder.build()); + MetricSnapshots msnaps = new MetricSnapshots(snaps); + return msnaps; + } + + public List getPrometheusNames() { + List names = new ArrayList(); + names.add("x_calls_total"); + names.add("x_load"); + return names; + } + +} + +``` + + + +`PrometheusScrapeRequest` provides methods to access http-related infos from the request originally +received by the endpoint + +```java +public interface PrometheusScrapeRequest { + String getRequestURI(); + + String[] getParameterValues(String name); +} + +``` + +Sample Prometheus scrape_config + +```yaml +- job_name: "multi-target" + + # metrics_path defaults to '/metrics' + # scheme defaults to 'http'. + params: + proc: [proc1, proc2] + relabel_configs: + - source_labels: [__address__] + target_label: __param_target + - source_labels: [__param_target] + target_label: instance + - target_label: __address__ + replacement: localhost:9401 + static_configs: + - targets: ["target1", "target2"] +``` + +It's up to the specific MultiCollector implementation how to interpret the _target_ parameter. +It might be an explicit real target (i.e. via host name/ip address) or as an alias in some internal +configuration. +The latter is more suitable when the MultiCollector implementation is a proxy ( +see ) +In this case, invoking real target might require extra parameters (e.g. credentials) that might be +complex to manage in Prometheus configuration +(not considering the case where the proxy might become an "open relay") diff --git a/docs/content/getting-started/performance.md b/docs/content/getting-started/performance.md new file mode 100644 index 000000000..31b8de162 --- /dev/null +++ b/docs/content/getting-started/performance.md @@ -0,0 +1,88 @@ +--- +title: Performance +weight: 6 +--- + +This section has tips on how to use the Prometheus Java client in high performance applications. + +## Specify Label Values Only Once + +For high performance applications, we recommend to specify label values only once, and then use the +data point directly. + +This applies to all metric types. Let's use a counter as an example here: + +```java +Counter requestCount = Counter.builder() + .name("requests_total") + .help("total number of requests") + .labelNames("path", "status") + .register(); +``` + +You could increment the counter above like this: + +```java +requestCount.labelValue("/", "200").inc(); +``` + +However, the line above does not only increment the counter, it also looks up the label values to +find the right data point. + +In high performance applications you can optimize this by looking up the data point only once: + +```java +CounterDataPoint successfulCalls = requestCount.labelValues("/", "200"); +``` + +Now, you can increment the data point directly, which is a highly optimized operation: + +```java +successfulCalls.inc(); +``` + +## Enable Only One Histogram Representation + +By default, histograms maintain two representations under the hood: The classic histogram +representation with static buckets, and the native histogram representation with dynamic buckets. + +While this default provides the flexibility to scrape different representations at runtime, it comes +at a cost, because maintaining multiple representations causes performance overhead. + +In performance critical applications we recommend to use either the classic representation or the +native representation, but not both. + +You can either configure this in code for each histogram by +calling [classicOnly()]() +or [nativeOnly()](), +or you use the corresponding [config options]({{< relref "../config/config.md" >}}). + +One way to do this is with system properties in the command line when you start your application + +```sh +java -Dio.prometheus.metrics.histogramClassicOnly=true my-app.jar +``` + +or + +```sh +java -Dio.prometheus.metrics.histogramNativeOnly=true my-app.jar +``` + +If you don't want to add a command line parameter every time you start your application, you can add +a `prometheus.properties` file to your classpath (put it in the `src/main/resources/` directory so +that it gets packed into your JAR file). The `prometheus.properties` file should have the following +line: + +```properties +io.prometheus.metrics.histogramClassicOnly=true +``` + +or + +```properties +io.prometheus.metrics.histogramNativeOnly=true +``` + +Future releases will add more configuration options, like support for configuration via environment +variable`IO_PROMETHEUS_METRICS_HISTOGRAM_NATIVE_ONLY=true`. diff --git a/docs/content/getting-started/quickstart.md b/docs/content/getting-started/quickstart.md new file mode 100644 index 000000000..920d89b7f --- /dev/null +++ b/docs/content/getting-started/quickstart.md @@ -0,0 +1,213 @@ +--- +title: Quickstart +weight: 0 +--- + +This tutorial shows the quickest way to get started with the Prometheus Java metrics library. + +{{< toc >}} + +## Dependencies + +We use the following dependencies: + +- `prometheus-metrics-core` is the actual metrics library. +- `prometheus-metrics-instrumentation-jvm` provides out-of-the-box JVM metrics. +- `prometheus-metrics-exporter-httpserver` is a standalone HTTP server for exposing Prometheus + metrics. + {{< tabs "deps" >}} + {{< tab "Gradle" >}} + +```groovy +implementation 'io.prometheus:prometheus-metrics-core:$version' +implementation 'io.prometheus:prometheus-metrics-instrumentation-jvm:$version' +implementation 'io.prometheus:prometheus-metrics-exporter-httpserver:$version' +``` + +{{< /tab >}} +{{< tab "Maven" >}} + +```xml + + io.prometheus + prometheus-metrics-core + $version + + + io.prometheus + prometheus-metrics-instrumentation-jvm + $version + + + io.prometheus + prometheus-metrics-exporter-httpserver + $version + +``` + +{{< /tab >}} +{{< /tabs >}} + +There are alternative exporters as well, for example if you are using a Servlet container like +Tomcat or Undertow you might want to use `prometheus-exporter-servlet-jakarta` rather than a +standalone HTTP server. + +{{< hint type=note >}} + +If you do not use the protobuf exposition format, you can +[exclude]({{< relref "../exporters/formats.md#exclude-protobuf-exposition-format" >}}) +it from the dependencies. + +{{< /hint >}} + +## Dependency management + +A Bill of Material +([BOM](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#bill-of-materials-bom-poms)) +ensures that versions of dependencies (including transitive ones) are aligned. +This is especially important when using Spring Boot, which manages some of the dependencies of the +project. + +You should omit the version number of the dependencies in your build file if you are using a BOM. + +{{< tabs "bom" >}} +{{< tab "Gradle" >}} + +You have two ways to import a BOM. + +First, you can use the Gradle’s native BOM support by adding `dependencies`: + +```kotlin +import org.springframework.boot.gradle.plugin.SpringBootPlugin + +plugins { + id("java") + id("org.springframework.boot") version "3.2.O" // if you are using Spring Boot +} + +dependencies { + implementation(platform(SpringBootPlugin.BOM_COORDINATES)) // if you are using Spring Boot + implementation(platform("io.prometheus:prometheus-metrics-bom:$version")) +} +``` + +The other way with Gradle is to use `dependencyManagement`: + +```kotlin +plugins { + id("java") + id("org.springframework.boot") version "3.2.O" // if you are using Spring Boot + id("io.spring.dependency-management") version "1.1.0" // if you are using Spring Boot +} + +dependencyManagement { + imports { + mavenBom("io.prometheus:prometheus-metrics-bom:$version") + } +} +``` + +{{< hint type=note >}} + +Be careful not to mix up the different ways of configuring things with Gradle. +For example, don't use +`implementation(platform("io.prometheus:prometheus-metrics-bom:$version"))` +with the `io.spring.dependency-management` plugin. + +{{< /hint >}} + +{{< /tab >}} +{{< tab "Maven" >}} + +{{< hint type=note >}} + +Import the Prometheus Java metrics BOMs before any other BOMs in your +project. For example, if you import the `spring-boot-dependencies` BOM, you have +to declare it after the Prometheus Java metrics BOMs. + +{{< /hint >}} + +The following example shows how to import the Prometheus Java metrics BOMs using Maven: + +```xml + + + + io.prometheus + prometheus-metrics-bom + $version + pom + import + + + +``` + +{{< /tab >}} +{{< /tabs >}} + +## Example Application + +```java +import io.prometheus.metrics.core.metrics.Counter; +import io.prometheus.metrics.exporter.httpserver.HTTPServer; +import io.prometheus.metrics.instrumentation.jvm.JvmMetrics; + +import java.io.IOException; + +public class App { + + public static void main(String[] args) throws InterruptedException, IOException { + + JvmMetrics.builder().register(); // initialize the out-of-the-box JVM metrics + + Counter counter = Counter.builder() + .name("my_count_total") + .help("example counter") + .labelNames("status") + .register(); + + counter.labelValues("ok").inc(); + counter.labelValues("ok").inc(); + counter.labelValues("error").inc(); + + HTTPServer server = HTTPServer.builder() + .port(9400) + .buildAndStart(); + + System.out.println("HTTPServer listening on port http://localhost:" + + server.getPort() + "/metrics"); + + Thread.currentThread().join(); // sleep forever + } +} +``` + +## Result + +Run the application and view [http://localhost:9400/metrics](http://localhost:9400/metrics) with +your browser to see the raw metrics. You should see the `my_count_total` metric as shown below plus +the `jvm_` and `process_` metrics coming from `JvmMetrics`. + +```text +# HELP my_count_total example counter +# TYPE my_count_total counter +my_count_total{status="error"} 1.0 +my_count_total{status="ok"} 2.0 +``` + +## Prometheus Configuration + +To scrape the metrics with a Prometheus server, download the latest Prometheus +server [release](https://github.com/prometheus/prometheus/releases), and configure the +`prometheus.yml` file as follows: + +```yaml +global: + scrape_interval: 10s # short interval for manual testing + +scrape_configs: + - job_name: "java-example" + static_configs: + - targets: ["localhost:9400"] +``` diff --git a/docs/content/getting-started/registry.md b/docs/content/getting-started/registry.md new file mode 100644 index 000000000..afebbb304 --- /dev/null +++ b/docs/content/getting-started/registry.md @@ -0,0 +1,90 @@ +--- +title: Registry +weight: 2 +--- + +In order to expose metrics, you need to register them with a `PrometheusRegistry`. We are using a +counter as an example here, but the `register()` method is the same for all metric types. + +## Registering a Metrics with the Default Registry + +```java +Counter eventsTotal = Counter.builder() + .name("events_total") + .help("Total number of events") + .register(); // <-- implicitly uses PrometheusRegistry.defaultRegistry +``` + +The `register()` call above builds the counter and registers it with the global static +`PrometheusRegistry.defaultRegistry`. Using the default registry is recommended. + +## Registering a Metrics with a Custom Registry + +You can also register your metric with a custom registry: + +```java +PrometheusRegistry myRegistry = new PrometheusRegistry(); + +Counter eventsTotal = Counter.builder() + .name("events_total") + .help("Total number of events") + .register(myRegistry); +``` + +## Registering a Metric with Multiple Registries + +As an alternative to calling `register()` directly, you can `build()` metrics without registering +them, +and register them later: + +```java + +// create a counter that is not registered with any registry + +Counter eventsTotal = Counter.builder() + .name("events_total") + .help("Total number of events") + .build(); // <-- this will create the metric but not register it + +// register the counter with the default registry + +PrometheusRegistry.defaultRegistry.register(eventsTotal); + +// register the counter with a custom registry. +// This is OK, you can register a metric with multiple registries. + +PrometheusRegistry myRegistry = new PrometheusRegistry(); +myRegistry.register(eventsTotal); +``` + +Custom registries are useful if you want to maintain different scopes of metrics, like +a debug registry with a lot of metrics, and a default registry with only a few metrics. + +## IllegalArgumentException: Duplicate Metric Name in Registry + +While it is OK to register the same metric with multiple registries, it is illegal to register the +same metric name multiple times with the same registry. +The following code will throw an `IllegalArgumentException`: + +```java +Counter eventsTotal1 = Counter.builder() + .name("events_total") + .help("Total number of events") + .register(); + +Counter eventsTotal2 = Counter.builder() + .name("events_total") + .help("Total number of events") + .register(); // IllegalArgumentException, because a metric with that name is already registered +``` + +## Unregistering a Metric + +There is no automatic expiry of unused metrics (yet), once a metric is registered it will remain +registered forever. + +However, you can programmatically unregistered an obsolete metric like this: + +```java +PrometheusRegistry.defaultRegistry.unregister(eventsTotal); +``` diff --git a/docs/content/instrumentation/_index.md b/docs/content/instrumentation/_index.md new file mode 100644 index 000000000..3e255f9fe --- /dev/null +++ b/docs/content/instrumentation/_index.md @@ -0,0 +1,4 @@ +--- +title: Instrumentation +weight: 3 +--- diff --git a/docs/content/instrumentation/caffeine.md b/docs/content/instrumentation/caffeine.md new file mode 100644 index 000000000..104a9b9fa --- /dev/null +++ b/docs/content/instrumentation/caffeine.md @@ -0,0 +1,128 @@ +--- +title: Caffeine Cache +weight: 1 +--- + +The Caffeine instrumentation module, added in version 1.3.2, translates observability data +provided by caffeine `Cache` objects into prometheus metrics. + +{{< tabs "uniqueid" >}} +{{< tab "Gradle" >}} + +```groovy +implementation 'io.prometheus:prometheus-metrics-instrumentation-caffeine:1.3.2' +``` + +{{< /tab >}} +{{< tab "Maven" >}} + +```xml + + io.prometheus + prometheus-metrics-instrumentation-caffeine + 1.3.2 + +``` + +{{< /tab >}} +{{< /tabs >}} + +In order to collect metrics: + +- A single `CacheMetricsCollector` instance must be registered with the registry; + - Multiple `CacheMetricsCollector` instances cannot be registered with the same registry; +- The `Cache` object must be instantiated with the `recordStats()` option, and then added to the + `CacheMetricsCollector` instance with a unique name, which will be used as the value of the + `cache` label on the exported metrics; + - If the `recordStats` option is not set, most metrics will only return zero values; + +```java +var cache = Caffeine.newBuilder().recordStats().build(); +var cacheMetrics = CacheMetricsCollector.builder().build(); +PrometheusRegistry.defaultRegistry.register(cacheMetrics); +cacheMetrics.addCache("mycache", cache); +``` + +{{< hint type=note >}} + +In version 1.3.5 and older of the caffeine instrumentation library, `CacheMetricsCollector.builder` +does not exist, i.e. a constructor call `new CacheMetricsCollector()` is the only option. + +{{< /hint >}} + +All example metrics on this page will use the `mycache` label value. + +## Generic Cache Metrics + +For all cache instances, the following metrics will be available: + +```text +# TYPE caffeine_cache_hit counter +# HELP caffeine_cache_hit Cache hit totals +caffeine_cache_hit_total{cache="mycache"} 10.0 +# TYPE caffeine_cache_miss counter +# HELP caffeine_cache_miss Cache miss totals +caffeine_cache_miss_total{cache="mycache"} 3.0 +# TYPE caffeine_cache_requests counter +# HELP caffeine_cache_requests Cache request totals, hits + misses +caffeine_cache_requests_total{cache="mycache"} 13.0 +# TYPE caffeine_cache_eviction counter +# HELP caffeine_cache_eviction Cache eviction totals, doesn't include manually removed entries +caffeine_cache_eviction_total{cache="mycache"} 1.0 +# TYPE caffeine_cache_estimated_size +# HELP caffeine_cache_estimated_size Estimated cache size +caffeine_cache_estimated_size{cache="mycache"} 5.0 +``` + +## Loading Cache Metrics + +If the cache is an instance of `LoadingCache`, i.e. it is built with a `loader` function that is +managed by the cache library, then metrics for observing load time and load failures become +available: + +```text +# TYPE caffeine_cache_load_failure counter +# HELP caffeine_cache_load_failure Cache load failures +caffeine_cache_load_failure_total{cache="mycache"} 10.0 +# TYPE caffeine_cache_loads counter +# HELP caffeine_cache_loads Cache loads: both success and failures +caffeine_cache_loads_total{cache="mycache"} 3.0 +# TYPE caffeine_cache_load_duration_seconds summary +# HELP caffeine_cache_load_duration_seconds Cache load duration: both success and failures +caffeine_cache_load_duration_seconds_count{cache="mycache"} 7.0 +caffeine_cache_load_duration_seconds_sum{cache="mycache"} 0.0034 +``` + +## Weighted Cache Metrics + +Two metrics exist for observability specifically of caches that define a `weigher`: + +```text +# TYPE caffeine_cache_eviction_weight counter +# HELP caffeine_cache_eviction_weight Weight of evicted cache entries, doesn't include manually removed entries // editorconfig-checker-disable-line + +caffeine_cache_eviction_weight_total{cache="mycache"} 5.0 +# TYPE caffeine_cache_weighted_size gauge +# HELP caffeine_cache_weighted_size Approximate accumulated weight of cache entries +caffeine_cache_weighted_size{cache="mycache"} 30.0 +``` + +{{< hint type=note >}} + +`caffeine_cache_weighted_size` is available only if the cache instance defines a `maximumWeight`. + +{{< /hint >}} + +Up to version 1.3.5 and older, the weighted metrics had a different behavior: + +- `caffeine_cache_weighted_size` was not implemented; +- `caffeine_cache_eviction_weight` was exposed as a `gauge`; + +It is possible to restore the behavior of version 1.3.5 and older, by either: + +- Using the deprecated `new CacheMetricsCollector()` constructor; +- Using the flags provided on the `CacheMetricsCollector.Builder` object to opt-out of each of the + elements of the post-1.3.5 behavior: + - `builder.collectWeightedSize(false)` will disable collection of `caffeine_cache_weighted_size`; + - `builder.collectEvictionWeightAsCounter(false)` will expose `caffeine_cache_eviction_weight` as + a `gauge` metric; diff --git a/docs/content/instrumentation/guava.md b/docs/content/instrumentation/guava.md new file mode 100644 index 000000000..ffc8f0ab2 --- /dev/null +++ b/docs/content/instrumentation/guava.md @@ -0,0 +1,87 @@ +--- +title: Guava Cache +weight: 1 +--- + +The Guava instrumentation module, added in version 1.3.2, translates observability data +provided by Guava `Cache` objects into prometheus metrics. + +{{< tabs "uniqueid" >}} +{{< tab "Gradle" >}} + +```groovy +implementation 'io.prometheus:prometheus-metrics-instrumentation-guava:1.3.2' +``` + +{{< /tab >}} +{{< tab "Maven" >}} + +```xml + + io.prometheus + prometheus-metrics-instrumentation-guava + 1.3.2 + +``` + +{{< /tab >}} +{{< /tabs >}} + +In order to collect metrics: + +- A single `CacheMetricsCollector` instance must be registered with the registry; + - Multiple `CacheMetricsCollector` instances cannot be registered with the same registry; +- The `Cache` object must be instantiated with the `recordStats()` option, and then added to the + `CacheMetricsCollector` instance with a unique name, which will be used as the value of the + `cache` label on the exported metrics; + - If the `recordStats` option is not set, most metrics will only return zero values; + +```java +var cache = CacheBuilder.newBuilder().recordStats().build(); +var cacheMetrics = new CacheMetricsCollector(); +PrometheusRegistry.defaultRegistry.register(cacheMetrics); +cacheMetrics.addCache("mycache", cache); +``` + +All example metrics on this page will use the `mycache` label value. + +## Generic Cache Metrics + +For all cache instances, the following metrics will be available: + +```text +# TYPE guava_cache_hit counter +# HELP guava_cache_hit Cache hit totals +guava_cache_hit_total{cache="mycache"} 10.0 +# TYPE guava_cache_miss counter +# HELP guava_cache_miss Cache miss totals +guava_cache_miss_total{cache="mycache"} 3.0 +# TYPE guava_cache_requests counter +# HELP guava_cache_requests Cache request totals +guava_cache_requests_total{cache="mycache"} 13.0 +# TYPE guava_cache_eviction counter +# HELP guava_cache_eviction Cache eviction totals, doesn't include manually removed entries +guava_cache_eviction_total{cache="mycache"} 1.0 +# TYPE guava_cache_size +# HELP guava_cache_size Cache size +guava_cache_size{cache="mycache"} 5.0 +``` + +## Loading Cache Metrics + +If the cache is an instance of `LoadingCache`, i.e. it is built with a `loader` function that is +managed by the cache library, then metrics for observing load time and load failures become +available: + +```text +# TYPE guava_cache_load_failure counter +# HELP guava_cache_load_failure Cache load failures +guava_cache_load_failure_total{cache="mycache"} 10.0 +# TYPE guava_cache_loads counter +# HELP guava_cache_loads Cache loads: both success and failures +guava_cache_loads_total{cache="mycache"} 3.0 +# TYPE guava_cache_load_duration_seconds summary +# HELP guava_cache_load_duration_seconds Cache load duration: both success and failures +guava_cache_load_duration_seconds_count{cache="mycache"} 7.0 +guava_cache_load_duration_seconds_sum{cache="mycache"} 0.0034 +``` diff --git a/docs/content/instrumentation/jvm.md b/docs/content/instrumentation/jvm.md new file mode 100644 index 000000000..804c1b09b --- /dev/null +++ b/docs/content/instrumentation/jvm.md @@ -0,0 +1,329 @@ +--- +title: JVM +weight: 1 +--- + +The JVM instrumentation module provides a variety of out-of-the-box JVM and process metrics. To use +it, add the following dependency: + +{{< tabs "uniqueid" >}} +{{< tab "Gradle" >}} + +```groovy +implementation 'io.prometheus:prometheus-metrics-instrumentation-jvm:1.0.0' +``` + +{{< /tab >}} +{{< tab "Maven" >}} + +```xml + + io.prometheus + prometheus-metrics-instrumentation-jvm + 1.0.0 + +``` + +{{< /tab >}} +{{< /tabs >}} + +Now, you can register the JVM metrics as follows: + +```java +JvmMetrics.builder().register(); +``` + +The line above will initialize all JVM metrics and register them with the default registry. If you +want to register the metrics with a custom `PrometheusRegistry`, you can pass the registry as +parameter to the `register()` call. + +The sections below describe the individual classes providing JVM metrics. If you don't want to +register all JVM metrics, you can register each of these classes individually rather than using +`JvmMetrics`. + +## JVM Buffer Pool Metrics + +JVM buffer pool metrics are provided by +the [JvmBufferPoolMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmBufferPoolMetrics.html) +class. The data is coming from +the [BufferPoolMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/BufferPoolMXBean.html). +Example metrics: + +```text +# HELP jvm_buffer_pool_capacity_bytes Bytes capacity of a given JVM buffer pool. +# TYPE jvm_buffer_pool_capacity_bytes gauge +jvm_buffer_pool_capacity_bytes{pool="direct"} 8192.0 +jvm_buffer_pool_capacity_bytes{pool="mapped"} 0.0 +# HELP jvm_buffer_pool_used_buffers Used buffers of a given JVM buffer pool. +# TYPE jvm_buffer_pool_used_buffers gauge +jvm_buffer_pool_used_buffers{pool="direct"} 1.0 +jvm_buffer_pool_used_buffers{pool="mapped"} 0.0 +# HELP jvm_buffer_pool_used_bytes Used bytes of a given JVM buffer pool. +# TYPE jvm_buffer_pool_used_bytes gauge +jvm_buffer_pool_used_bytes{pool="direct"} 8192.0 +jvm_buffer_pool_used_bytes{pool="mapped"} 0.0 +``` + +## JVM Class Loading Metrics + +JVM class loading metrics are provided by +the [JvmClassLoadingMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmClassLoadingMetrics.html) +class. The data is coming from +the [ClassLoadingMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/ClassLoadingMXBean.html). +Example metrics: + + + +```text +# HELP jvm_classes_currently_loaded The number of classes that are currently loaded in the JVM +# TYPE jvm_classes_currently_loaded gauge +jvm_classes_currently_loaded 1109.0 +# HELP jvm_classes_loaded_total The total number of classes that have been loaded since the JVM has started execution +# TYPE jvm_classes_loaded_total counter +jvm_classes_loaded_total 1109.0 +# HELP jvm_classes_unloaded_total The total number of classes that have been unloaded since the JVM has started execution +# TYPE jvm_classes_unloaded_total counter +jvm_classes_unloaded_total 0.0 +``` + + + +## JVM Compilation Metrics + +JVM compilation metrics are provided by +the [JvmCompilationMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmCompilationMetrics.html) +class. The data is coming from +the [CompilationMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/CompilationMXBean.html). +Example metrics: + + + +```text +# HELP jvm_compilation_time_seconds_total The total time in seconds taken for HotSpot class compilation +# TYPE jvm_compilation_time_seconds_total counter +jvm_compilation_time_seconds_total 0.152 +``` + + + +## JVM Garbage Collector Metrics + +JVM garbage collector metrics are provided by +the [JvmGarbageCollectorMetric](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmGarbageCollectorMetrics.html) +class. The data is coming from +the [GarbageCollectorMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/GarbageCollectorMXBean.html). +Example metrics: + +```text +# HELP jvm_gc_collection_seconds Time spent in a given JVM garbage collector in seconds. +# TYPE jvm_gc_collection_seconds summary +jvm_gc_collection_seconds_count{gc="PS MarkSweep"} 0 +jvm_gc_collection_seconds_sum{gc="PS MarkSweep"} 0.0 +jvm_gc_collection_seconds_count{gc="PS Scavenge"} 0 +jvm_gc_collection_seconds_sum{gc="PS Scavenge"} 0.0 +``` + +## JVM Memory Metrics + +JVM memory metrics are provided by +the [JvmMemoryMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmMemoryMetrics.html) +class. The data is coming from +the [MemoryMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/MemoryMXBean.html) +and the [MemoryPoolMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html). +Example metrics: + + + +```text +# HELP jvm_memory_committed_bytes Committed (bytes) of a given JVM memory area. +# TYPE jvm_memory_committed_bytes gauge +jvm_memory_committed_bytes{area="heap"} 4.98597888E8 +jvm_memory_committed_bytes{area="nonheap"} 1.1993088E7 +# HELP jvm_memory_init_bytes Initial bytes of a given JVM memory area. +# TYPE jvm_memory_init_bytes gauge +jvm_memory_init_bytes{area="heap"} 5.20093696E8 +jvm_memory_init_bytes{area="nonheap"} 2555904.0 +# HELP jvm_memory_max_bytes Max (bytes) of a given JVM memory area. +# TYPE jvm_memory_max_bytes gauge +jvm_memory_max_bytes{area="heap"} 7.38983936E9 +jvm_memory_max_bytes{area="nonheap"} -1.0 +# HELP jvm_memory_objects_pending_finalization The number of objects waiting in the finalizer queue. +# TYPE jvm_memory_objects_pending_finalization gauge +jvm_memory_objects_pending_finalization 0.0 +# HELP jvm_memory_pool_collection_committed_bytes Committed after last collection bytes of a given JVM memory pool. +# TYPE jvm_memory_pool_collection_committed_bytes gauge +jvm_memory_pool_collection_committed_bytes{pool="PS Eden Space"} 1.30023424E8 +jvm_memory_pool_collection_committed_bytes{pool="PS Old Gen"} 3.47078656E8 +jvm_memory_pool_collection_committed_bytes{pool="PS Survivor Space"} 2.1495808E7 +# HELP jvm_memory_pool_collection_init_bytes Initial after last collection bytes of a given JVM memory pool. +# TYPE jvm_memory_pool_collection_init_bytes gauge +jvm_memory_pool_collection_init_bytes{pool="PS Eden Space"} 1.30023424E8 +jvm_memory_pool_collection_init_bytes{pool="PS Old Gen"} 3.47078656E8 +jvm_memory_pool_collection_init_bytes{pool="PS Survivor Space"} 2.1495808E7 +# HELP jvm_memory_pool_collection_max_bytes Max bytes after last collection of a given JVM memory pool. +# TYPE jvm_memory_pool_collection_max_bytes gauge +jvm_memory_pool_collection_max_bytes{pool="PS Eden Space"} 2.727870464E9 +jvm_memory_pool_collection_max_bytes{pool="PS Old Gen"} 5.542248448E9 +jvm_memory_pool_collection_max_bytes{pool="PS Survivor Space"} 2.1495808E7 +# HELP jvm_memory_pool_collection_used_bytes Used bytes after last collection of a given JVM memory pool. +# TYPE jvm_memory_pool_collection_used_bytes gauge +jvm_memory_pool_collection_used_bytes{pool="PS Eden Space"} 0.0 +jvm_memory_pool_collection_used_bytes{pool="PS Old Gen"} 1249696.0 +jvm_memory_pool_collection_used_bytes{pool="PS Survivor Space"} 0.0 +# HELP jvm_memory_pool_committed_bytes Committed bytes of a given JVM memory pool. +# TYPE jvm_memory_pool_committed_bytes gauge +jvm_memory_pool_committed_bytes{pool="Code Cache"} 4128768.0 +jvm_memory_pool_committed_bytes{pool="Compressed Class Space"} 917504.0 +jvm_memory_pool_committed_bytes{pool="Metaspace"} 6946816.0 +jvm_memory_pool_committed_bytes{pool="PS Eden Space"} 1.30023424E8 +jvm_memory_pool_committed_bytes{pool="PS Old Gen"} 3.47078656E8 +jvm_memory_pool_committed_bytes{pool="PS Survivor Space"} 2.1495808E7 +# HELP jvm_memory_pool_init_bytes Initial bytes of a given JVM memory pool. +# TYPE jvm_memory_pool_init_bytes gauge +jvm_memory_pool_init_bytes{pool="Code Cache"} 2555904.0 +jvm_memory_pool_init_bytes{pool="Compressed Class Space"} 0.0 +jvm_memory_pool_init_bytes{pool="Metaspace"} 0.0 +jvm_memory_pool_init_bytes{pool="PS Eden Space"} 1.30023424E8 +jvm_memory_pool_init_bytes{pool="PS Old Gen"} 3.47078656E8 +jvm_memory_pool_init_bytes{pool="PS Survivor Space"} 2.1495808E7 +# HELP jvm_memory_pool_max_bytes Max bytes of a given JVM memory pool. +# TYPE jvm_memory_pool_max_bytes gauge +jvm_memory_pool_max_bytes{pool="Code Cache"} 2.5165824E8 +jvm_memory_pool_max_bytes{pool="Compressed Class Space"} 1.073741824E9 +jvm_memory_pool_max_bytes{pool="Metaspace"} -1.0 +jvm_memory_pool_max_bytes{pool="PS Eden Space"} 2.727870464E9 +jvm_memory_pool_max_bytes{pool="PS Old Gen"} 5.542248448E9 +jvm_memory_pool_max_bytes{pool="PS Survivor Space"} 2.1495808E7 +# HELP jvm_memory_pool_used_bytes Used bytes of a given JVM memory pool. +# TYPE jvm_memory_pool_used_bytes gauge +jvm_memory_pool_used_bytes{pool="Code Cache"} 4065472.0 +jvm_memory_pool_used_bytes{pool="Compressed Class Space"} 766680.0 +jvm_memory_pool_used_bytes{pool="Metaspace"} 6659432.0 +jvm_memory_pool_used_bytes{pool="PS Eden Space"} 7801536.0 +jvm_memory_pool_used_bytes{pool="PS Old Gen"} 1249696.0 +jvm_memory_pool_used_bytes{pool="PS Survivor Space"} 0.0 +# HELP jvm_memory_used_bytes Used bytes of a given JVM memory area. +# TYPE jvm_memory_used_bytes gauge +jvm_memory_used_bytes{area="heap"} 9051232.0 +jvm_memory_used_bytes{area="nonheap"} 1.1490688E7 +``` + + + +## JVM Memory Pool Allocation Metrics + +JVM memory pool allocation metrics are provided by +the [JvmMemoryPoolAllocationMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmMemoryPoolAllocationMetrics.html) +class. The data is obtained by adding +a [NotificationListener](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/javax/management/NotificationListener.html) +to the [GarbageCollectorMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/GarbageCollectorMXBean.html). +Example metrics: + + + +```text +# HELP jvm_memory_pool_allocated_bytes_total Total bytes allocated in a given JVM memory pool. Only updated after GC, not continuously. +# TYPE jvm_memory_pool_allocated_bytes_total counter +jvm_memory_pool_allocated_bytes_total{pool="Code Cache"} 4336448.0 +jvm_memory_pool_allocated_bytes_total{pool="Compressed Class Space"} 875016.0 +jvm_memory_pool_allocated_bytes_total{pool="Metaspace"} 7480456.0 +jvm_memory_pool_allocated_bytes_total{pool="PS Eden Space"} 1.79232824E8 +jvm_memory_pool_allocated_bytes_total{pool="PS Old Gen"} 1428888.0 +jvm_memory_pool_allocated_bytes_total{pool="PS Survivor Space"} 4115280.0 +``` + + + +## JVM Runtime Info Metric + +The JVM runtime info metric is provided by +the [JvmRuntimeInfoMetric](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmRuntimeInfoMetric.html) +class. The data is obtained via system properties and will not change throughout the lifetime of the +application. Example metric: + + + +```text +# TYPE jvm_runtime info +# HELP jvm_runtime JVM runtime info +jvm_runtime_info{runtime="OpenJDK Runtime Environment",vendor="Oracle Corporation",version="1.8.0_382-b05"} 1 +``` + + + +## JVM Thread Metrics + +JVM thread metrics are provided by +the [JvmThreadsMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmThreadsMetrics.html) +class. The data is coming from +the [ThreadMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/ThreadMXBean.html). +Example metrics: + + + +```text +# HELP jvm_threads_current Current thread count of a JVM +# TYPE jvm_threads_current gauge +jvm_threads_current 10.0 +# HELP jvm_threads_daemon Daemon thread count of a JVM +# TYPE jvm_threads_daemon gauge +jvm_threads_daemon 8.0 +# HELP jvm_threads_deadlocked Cycles of JVM-threads that are in deadlock waiting to acquire object monitors or ownable synchronizers +# TYPE jvm_threads_deadlocked gauge +jvm_threads_deadlocked 0.0 +# HELP jvm_threads_deadlocked_monitor Cycles of JVM-threads that are in deadlock waiting to acquire object monitors +# TYPE jvm_threads_deadlocked_monitor gauge +jvm_threads_deadlocked_monitor 0.0 +# HELP jvm_threads_peak Peak thread count of a JVM +# TYPE jvm_threads_peak gauge +jvm_threads_peak 10.0 +# HELP jvm_threads_started_total Started thread count of a JVM +# TYPE jvm_threads_started_total counter +jvm_threads_started_total 10.0 +# HELP jvm_threads_state Current count of threads by state +# TYPE jvm_threads_state gauge +jvm_threads_state{state="BLOCKED"} 0.0 +jvm_threads_state{state="NEW"} 0.0 +jvm_threads_state{state="RUNNABLE"} 5.0 +jvm_threads_state{state="TERMINATED"} 0.0 +jvm_threads_state{state="TIMED_WAITING"} 2.0 +jvm_threads_state{state="UNKNOWN"} 0.0 +jvm_threads_state{state="WAITING"} 3.0 +``` + + + +## Process Metrics + +Process metrics are provided by +the [ProcessMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/ProcessMetrics.html) +class. The data is coming from +the [OperatingSystemMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/OperatingSystemMXBean.html), +the [RuntimeMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/RuntimeMXBean.html), +and from the `/proc/self/status` file on Linux. The metrics with prefix `process_` are not specific +to Java, but should be provided by every Prometheus client library, +see [Process Metrics](https://prometheus.io/docs/instrumenting/writing_clientlibs/#process-metrics) +in the +Prometheus [writing client libraries](https://prometheus.io/docs/instrumenting/writing_clientlibs/#process-metrics) +documentation. Example metrics: + +```text +# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds. +# TYPE process_cpu_seconds_total counter +process_cpu_seconds_total 1.63 +# HELP process_max_fds Maximum number of open file descriptors. +# TYPE process_max_fds gauge +process_max_fds 524288.0 +# HELP process_open_fds Number of open file descriptors. +# TYPE process_open_fds gauge +process_open_fds 28.0 +# HELP process_resident_memory_bytes Resident memory size in bytes. +# TYPE process_resident_memory_bytes gauge +process_resident_memory_bytes 7.8577664E7 +# HELP process_start_time_seconds Start time of the process since unix epoch in seconds. +# TYPE process_start_time_seconds gauge +process_start_time_seconds 1.693829439767E9 +# HELP process_virtual_memory_bytes Virtual memory size in bytes. +# TYPE process_virtual_memory_bytes gauge +process_virtual_memory_bytes 1.2683624448E10 +``` diff --git a/docs/content/internals/_index.md b/docs/content/internals/_index.md new file mode 100644 index 000000000..9cce8243e --- /dev/null +++ b/docs/content/internals/_index.md @@ -0,0 +1,4 @@ +--- +title: Internals +weight: 7 +--- diff --git a/docs/content/internals/model.md b/docs/content/internals/model.md new file mode 100644 index 000000000..c54e79ee3 --- /dev/null +++ b/docs/content/internals/model.md @@ -0,0 +1,44 @@ +--- +title: Model +weight: 1 +--- + +The illustration below shows the internal architecture of the Prometheus Java client library. + +![Internal architecture of the Prometheus Java client library](/client_java/images/model.png) + +## prometheus-metrics-core + +This is the user facing metrics library, implementing the core metric types, +like [Counter](/client_java/api/io/prometheus/metrics/core/metrics/Counter.html), +[Gauge](/client_java/api/io/prometheus/metrics/core/metrics/Gauge.html) +[Histogram](/client_java/api/io/prometheus/metrics/core/metrics/Histogram.html), +and so on. + +All metric types implement +the [Collector](/client_java/api/io/prometheus/metrics/model/registry/Collector.html) interface, +i.e. they provide +a [collect()]() +method to produce snapshots. + +## prometheus-metrics-model + +The model is an internal library, implementing read-only immutable snapshots. These snapshots are +returned by +the [Collector.collect()]() +method. + +There is no need for users to use `prometheus-metrics-model` directly. Users should use the API +provided by `prometheus-metrics-core`, which includes the core metrics as well as callback metrics. + +However, maintainers of third-party metrics libraries might want to use `prometheus-metrics-model` +if they want to add Prometheus exposition formats to their metrics library. + +## Exporters and exposition formats + +The `prometheus-metrics-exposition-formats` module converts snapshots to Prometheus exposition +formats, like text format, OpenMetrics text format, or Prometheus protobuf format. + +The exporters like `prometheus-metrics-exporter-httpserver` or +`prometheus-metrics-exporter-servlet-jakarta` use this to convert snapshots into the right format +depending on the `Accept` header in the scrape request. diff --git a/docs/content/migration/_index.md b/docs/content/migration/_index.md new file mode 100644 index 000000000..7055c0287 --- /dev/null +++ b/docs/content/migration/_index.md @@ -0,0 +1,4 @@ +--- +title: Compatibility +weight: 6 +--- diff --git a/docs/content/migration/simpleclient.md b/docs/content/migration/simpleclient.md new file mode 100644 index 000000000..6d0580571 --- /dev/null +++ b/docs/content/migration/simpleclient.md @@ -0,0 +1,173 @@ +--- +title: Simpleclient +weight: 1 +--- + +The Prometheus Java client library 1.0.0 is a complete rewrite of the underlying data model, and is +not backward +compatible with releases 0.16.0 and older for a variety of reasons: + +- The old data model was based on [OpenMetrics](https://openmetrics.io). Native histograms don't fit + with the + OpenMetrics model because they don't follow the "every sample has exactly one double value" + paradigm. It was a lot + cleaner to implement a dedicated `prometheus-metrics-model` than trying to fit native histograms + into the existing + OpenMetrics-based model. +- Version 0.16.0 and older has multiple Maven modules sharing the same Java package name. This is + not supported by the + Java module system. To support users of Java modules, we renamed all packages and made sure no + package is reused + across multiple Maven modules. + +## Migration using the Simpleclient Bridge + +Good news: Users of version 0.16.0 and older do not need to refactor all their instrumentation code +to get started with +1.0.0. + +We provide a migration module for bridging the old simpleclient `CollectorRegistry` to the new +`PrometheusRegistry`. + +To use the bridge, add the following dependency: + +{{< tabs "uniqueid" >}} +{{< tab "Gradle" >}} + +```groovy +implementation 'io.prometheus:prometheus-metrics-simpleclient-bridge:1.0.0' +``` + +{{< /tab >}} +{{< tab "Maven" >}} + +```xml + + + io.prometheus + prometheus-metrics-simpleclient-bridge + 1.0.0 + +``` + +{{< /tab >}} +{{< /tabs >}} + +Then add the following to your code: + +```java +SimpleclientCollector.builder().register(); +``` + +This will make all metrics registered with simpleclient's `CollectorRegistry.defaultRegistry` +available in the new +`PrometheusRegistry.defaultRegistry`. + +If you are using custom registries, you can specify them like this: + +```java +CollectorRegistry simpleclientRegistry = ...; +PrometheusRegistry prometheusRegistry = ...; + +SimpleclientCollector.builder() + .collectorRegistry(simpleclientRegistry) + .register(prometheusRegistry); +``` + +## Refactoring the Instrumentation Code + +If you decide to get rid of the old 0.16.0 dependencies and use 1.0.0 only, you need to refactor +your code: + +Dependencies: + +- `simpleclient` -> `prometheus-metrics-core` +- `simpleclient_hotspot` -> `prometheus-metrics-instrumentation-jvm` +- `simpleclient_httpserver` -> `prometheus-metrics-exporter-httpserver` +- `simpleclient_servlet_jakarta` -> `prometheus-metrics-exporter-servlet-jakarta` + +As long as you are using high-level metric API like `Counter`, `Gauge`, `Histogram`, and `Summary` +converting code to +the new API is relatively straightforward. You will need to adapt the package name and apply some +minor changes like +using `builder()` instead of `build()` or using `labelValues()` instead of `labels()`. + +Example of the old 0.16.0 API: + +```java +import io.prometheus.client.Counter; + +Counter counter = Counter.build() + .name("test") + .help("test counter") + .labelNames("path") + .register(); + +counter.labels("/hello-world").inc(); +``` + +Example of the new 1.0.0 API: + +```java +import io.prometheus.metrics.core.metrics.Counter; + +Counter counter = Counter.builder() + .name("test") + .help("test counter") + .labelNames("path") + .register(); + +counter.labelValues("/hello-world").inc(); +``` + +Reasons why we changed the API: Changing the package names was a necessity because the previous +package names were +incompatible with the Java module system. However, renaming packages requires changing code anyway, +so we decided to +clean up some things. For example, the name `builder()` for a builder method is very common in the +Java ecosystem, it's +used in Spring, Lombok, and so on. So naming the method `builder()` makes the Prometheus library +more aligned with the +broader Java ecosystem. + +If you are using the low level `Collector` API directly, you should have a look at the new callback +metric types, +see [/getting-started/callbacks/]({{< relref "../getting-started/callbacks.md" >}}). Chances are +good that the new callback metrics have +an easier way to achieve what you need than the old 0.16.0 code. + +## JVM Metrics + +Version 0.16.0 provided the `simpleclient_hotspot` module for exposing built-in JVM metrics: + +```java +DefaultExports.initialize(); +``` + +With version 1.0.0 these metrics moved to the `prometheus-metrics-instrumentation-jvm` module and +are initialized as follows: + +```java +JvmMetrics.builder().register(); +``` + +A full list of the available JVM metrics can be found +on [/instrumentation/jvm]({{< relref "../instrumentation/jvm.md" >}}). + +Most JVM metric names remained the same, except for a few cases where the old 0.16.0 metric names +were not compliant with the [OpenMetrics](https://openmetrics.io) specification. OpenMetrics +requires the unit to be a suffix, so we renamed metrics where the unit was in the middle of the +metric name and moved the unit to the end of the metric name. The following metric names changed: + +- `jvm_memory_bytes_committed` -> `jvm_memory_committed_bytes` +- `jvm_memory_bytes_init` -> `jvm_memory_init_bytes` +- `jvm_memory_bytes_max` -> `jvm_memory_max_bytes` +- `jvm_memory_pool_bytes_committed` -> `jvm_memory_pool_committed_bytes` +- `jvm_memory_pool_bytes_init` -> `jvm_memory_pool_init_bytes` +- `jvm_memory_pool_bytes_max` -> `jvm_memory_pool_max_bytes` +- `jvm_memory_pool_bytes_used` -> `jvm_memory_pool_used_bytes` +- `jvm_memory_pool_collection_bytes_committed` -> `jvm_memory_pool_collection_committed_bytes` +- `jvm_memory_pool_collection_bytes_init` -> `jvm_memory_pool_collection_init_bytes` +- `jvm_memory_pool_collection_bytes_max` -> `jvm_memory_pool_collection_max_bytes` +- `jvm_memory_pool_collection_bytes_used` -> `jvm_memory_pool_collection_used_bytes` +- `jvm_info` -> `jvm_runtime_info` diff --git a/docs/content/otel/_index.md b/docs/content/otel/_index.md new file mode 100644 index 000000000..79e89d3a5 --- /dev/null +++ b/docs/content/otel/_index.md @@ -0,0 +1,4 @@ +--- +title: OpenTelemetry +weight: 4 +--- diff --git a/docs/content/otel/names.md b/docs/content/otel/names.md new file mode 100644 index 000000000..a5425e07f --- /dev/null +++ b/docs/content/otel/names.md @@ -0,0 +1,36 @@ +--- +title: Names +weight: 3 +--- + +OpenTelemetry naming conventions are different from Prometheus naming conventions. The mapping from +OpenTelemetry metric names to Prometheus metric names is well defined in +OpenTelemetry's [Prometheus and OpenMetrics Compatibility](https://opentelemetry.io/docs/specs/otel/compatibility/prometheus_and_openmetrics/) +spec, and +the [OpenTelemetryExporter](/client_java/api/io/prometheus/metrics/exporter/opentelemetry/OpenTelemetryExporter.html) +implements that specification. + +The goal is, if you set up a pipeline as illustrated below, you will see the same metric names in +the Prometheus server as if you had exposed Prometheus metrics directly. + +![Image of a with the Prometheus client library pushing metrics to an OpenTelemetry collector](/client_java/images/otel-pipeline.png) + +The main steps when converting OpenTelemetry metric names to Prometheus metric names are: + +- Escape illegal characters as described in [Unicode support] +- If the metric has a unit, append the unit to the metric name, like `_seconds`. +- If the metric type has a suffix, append it, like `_total` for counters. + +## Dots in Metric and Label Names + +OpenTelemetry defines not only a line protocol, but also _semantic conventions_, i.e. standardized +metric and label names. For example, +OpenTelemetry's [Semantic Conventions for HTTP Metrics](https://opentelemetry.io/docs/specs/otel/metrics/semantic_conventions/http-metrics/) +say that if you instrument an HTTP server with OpenTelemetry, you must have a histogram named +`http.server.duration`. + +Most names defined in semantic conventions use dots. +Dots in metric and label names are now supported in the Prometheus Java client library as +described in [Unicode support]. + +[Unicode support]: {{< relref "../exporters/unicode.md" >}} diff --git a/docs/content/otel/otlp.md b/docs/content/otel/otlp.md new file mode 100644 index 000000000..568219dd0 --- /dev/null +++ b/docs/content/otel/otlp.md @@ -0,0 +1,61 @@ +--- +title: OTLP +weight: 1 +--- + +The Prometheus Java client library allows you to push metrics to an OpenTelemetry endpoint using the +OTLP protocol. + +![Image of a with the Prometheus client library pushing metrics to an OpenTelemetry collector](/client_java/images/otel-pipeline.png) + +To implement this, you need to include `prometheus-metrics-exporter` as a dependency + +{{< tabs "uniqueid" >}} +{{< tab "Gradle" >}} + +```groovy +implementation 'io.prometheus:prometheus-metrics-exporter-opentelemetry:1.0.0' +``` + +{{< /tab >}} +{{< tab "Maven" >}} + +```xml + + io.prometheus + prometheus-metrics-exporter-opentelemetry + 1.0.0 + +``` + +{{< /tab >}} +{{< /tabs >}} + +Initialize the `OpenTelemetryExporter` in your Java code: + +```java +OpenTelemetryExporter.builder() + // optional: call configuration methods here + .buildAndStart(); +``` + +By default, the `OpenTelemetryExporter` will push metrics every 60 seconds to `localhost:4317` using +`grpc` protocol. You can configure this in code using +the [OpenTelemetryExporter.Builder](/client_java/api/io/prometheus/metrics/exporter/opentelemetry/OpenTelemetryExporter.Builder.html), +or at runtime via [`io.prometheus.exporter.opentelemetry.*`]({{< relref "../config/config.md#exporter-opentelemetry-properties" >}}) +properties. + +In addition to the Prometheus Java client configuration, the exporter also recognizes standard +OpenTelemetry configuration. For example, you can set +the [OTEL_EXPORTER_OTLP_METRICS_ENDPOINT](https://opentelemetry.io/docs/concepts/sdk-configuration/otlp-exporter-configuration/#otel_exporter_otlp_metrics_endpoint) +environment variable to configure the endpoint. The Javadoc +for [OpenTelemetryExporter.Builder](/client_java/api/io/prometheus/metrics/exporter/opentelemetry/OpenTelemetryExporter.Builder.html) +shows which settings have corresponding OTel configuration. The intended use case is that if you +attach the +[OpenTelemetry Java agent](https://github.com/open-telemetry/opentelemetry-java-instrumentation/) +for tracing, and use the Prometheus Java client for metrics, it is sufficient to configure the OTel +agent because the Prometheus library will pick up the same configuration. + +The [examples/example-exporter-opentelemetry](https://github.com/prometheus/client_java/tree/main/examples/example-exporter-opentelemetry) +folder has a Docker compose with a complete end-to-end example, including a Java app, the OTel +collector, and a Prometheus server. diff --git a/docs/content/otel/tracing.md b/docs/content/otel/tracing.md new file mode 100644 index 000000000..0e3fb72fa --- /dev/null +++ b/docs/content/otel/tracing.md @@ -0,0 +1,77 @@ +--- +title: Tracing +weight: 2 +--- + +OpenTelemetry’s +[vision statement](https://github.com/open-telemetry/community/blob/main/mission-vision-values.md) +says that +[telemetry should be loosely coupled](https://github.com/open-telemetry/community/blob/main/mission-vision-values.md#telemetry-should-be-loosely-coupled), +allowing end users to pick and choose from the pieces they want without having to bring in the rest +of the project, too. In that spirit, you might choose to instrument your Java application with the +Prometheus Java client library for metrics, and attach the +[OpenTelemetry Java agent](https://github.com/open-telemetry/opentelemetry-java-instrumentation/) +to get distributed tracing. + +First, if you attach the +[OpenTelemetry Java agent](https://github.com/open-telemetry/opentelemetry-java-instrumentation/) +you might want to turn off OTel's built-in metrics, because otherwise you get metrics from both the +Prometheus Java client library and the OpenTelemetry agent (technically it's no problem to get both +metrics, it's just not a common use case). + +```bash +# This will tell the OpenTelemetry agent not to send metrics, just traces and logs. +export OTEL_METRICS_EXPORTER=none +``` + +Now, start your application with the OpenTelemetry Java agent attached for traces and logs. + +```bash +java -javaagent:path/to/opentelemetry-javaagent.jar -jar myapp.jar +``` + +With the OpenTelemetry Java agent attached, the Prometheus client library will do a lot of magic +under the hood. + +- `service.name` and `service.instance.id` are used in OpenTelemetry to uniquely identify a service + instance. The Prometheus client library will automatically use the same `service.name` and + `service.instance.id` as the agent when pushing metrics in OpenTelemetry format. That way the + monitoring backend will see that the metrics and the traces are coming from the same instance. +- Exemplars are added automatically if a Prometheus metric is updated in the context of a + distributed OpenTelemetry trace. +- If a Span is used as an Exemplar, the Span is marked with the Span attribute `exemplar="true"`. + This can be used in the OpenTelemetry's sampling policy to make sure Exemplars are always sampled. + +Here's more context on the `exemplar="true"` Span attribute: Many users of tracing libraries don't +keep 100% of their trace data, because traces are very repetitive. It is very common to sample only +10% of traces and discard 90%. However, this can be an issue with Exemplars: In 90% of the cases +Exemplars would point to a trace that has been thrown away. + +To solve this, the Prometheus Java client library annotates each Span that has been used as an +Exemplar with the `exemplar="true"` Span attribute. + +The sampling policy in the OpenTelemetry collector can be configured to keep traces with this +attribute. There's no risk that this results in a significant increase in trace data, because new +Exemplars are only selected every +[`minRetentionPeriodSeconds`]({{< relref "../config/config.md#exemplar-properties" >}}) seconds. + +Here's an example of how to configure OpenTelemetry's +[tail sampling processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/tailsamplingprocessor/) +to sample all Spans marked with `exemplar="true"`, and then discard 90% of the traces: + +```yaml +policies: + [ + { + name: keep-exemplars, + type: string_attribute, + string_attribute: { key: "exemplar", values: ["true"] }, + }, + { name: keep-10-percent, type: probabilistic, probabilistic: { sampling_percentage: 10 } }, + ] +``` + +The [examples/example-exemplar-tail-sampling/](https://github.com/prometheus/client_java/tree/main/examples/example-exemplars-tail-sampling) +directory has a complete end-to-end example, with a distributed Java application with two services, +an OpenTelemetry collector, Prometheus, Tempo as a trace database, and Grafana dashboards. Use +docker-compose as described in the example's readme to run the example and explore the results. diff --git a/docs/data/menu/extra.yaml b/docs/data/menu/extra.yaml new file mode 100644 index 000000000..ff5756bf8 --- /dev/null +++ b/docs/data/menu/extra.yaml @@ -0,0 +1,6 @@ +--- +header: + - name: GitHub + ref: https://github.com/prometheus/client_java + icon: gdoc_github + external: true diff --git a/docs/data/menu/more.yaml b/docs/data/menu/more.yaml new file mode 100644 index 000000000..ee55dc634 --- /dev/null +++ b/docs/data/menu/more.yaml @@ -0,0 +1,14 @@ +--- +more: + - name: JavaDoc + ref: "/client_java/api" + external: true + icon: "gdoc_bookmark" + - name: Releases + ref: "https://github.com/prometheus/client_java/releases" + external: true + icon: "gdoc_download" + - name: Github + ref: "https://github.com/prometheus/client_java" + external: true + icon: "gdoc_github" diff --git a/docs/hugo.toml b/docs/hugo.toml new file mode 100644 index 000000000..b558774ec --- /dev/null +++ b/docs/hugo.toml @@ -0,0 +1,34 @@ +baseURL = "http://localhost" +languageCode = 'en-us' +title = "client_java" +theme = "hugo-geekdoc" + +pluralizeListTitles = false + +# Geekdoc required configuration +#pygmentsUseClasses = true +pygmentsUseClasses = false +pygmentsCodeFences = true +disablePathToLower = true +# geekdocFileTreeSortBy = "linkTitle" + +# Required if you want to render robots.txt template +enableRobotsTXT = true + +# Needed for mermaid shortcodes +[markup] + [markup.goldmark.renderer] + # Needed for mermaid shortcode + unsafe = true + [markup.tableOfContents] + startLevel = 1 + endLevel = 9 + [markup.highlight] + style = 'solarized-dark' + +[taxonomies] + tag = "tags" + +[caches] + [caches.images] + dir = ':cacheDir/images' diff --git a/docs/static/.gitignore b/docs/static/.gitignore new file mode 100644 index 000000000..eedd89b45 --- /dev/null +++ b/docs/static/.gitignore @@ -0,0 +1 @@ +api diff --git a/docs/static/brand.svg b/docs/static/brand.svg new file mode 100644 index 000000000..5c51f66d9 --- /dev/null +++ b/docs/static/brand.svg @@ -0,0 +1,50 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/docs/static/custom.css b/docs/static/custom.css new file mode 100644 index 000000000..ed919a35d --- /dev/null +++ b/docs/static/custom.css @@ -0,0 +1,43 @@ +/* + * Didn't find much time to create a theme yet, + * so there are just a few non-default settings for now. + */ +:root, +:root[color-theme="light"] { + --header-background: #222222; + --footer-background: #e6522c; + --footer-link-color: #ffffff; + --footer-link-color-visited: #ffffff; +} + +@media (prefers-color-scheme: light) { + :root { + --header-background: #222222; + --footer-background: #e6522c; + --footer-link-color: #ffffff; + --footer-link-color-visited: #ffffff; + } +} + +:root[color-theme="dark"] +{ + --header-background: #111c24; + --body-background: #1f1f21; + --footer-background: #e6522c; + --footer-link-color: #ffffff; + --footer-link-color-visited: #ffffff; +} + +@media (prefers-color-scheme: dark) { + :root { + --header-background: #111c24; + --body-background: #1f1f21; + --footer-background: #e6522c; + --footer-link-color: #ffffff; + --footer-link-color-visited: #ffffff; + } +} + +.gdoc-markdown pre,.gdoc-markdown code { + overflow: auto; +} \ No newline at end of file diff --git a/docs/static/favicon/favicon-16x16.png b/docs/static/favicon/favicon-16x16.png new file mode 100644 index 000000000..7a8cc5816 Binary files /dev/null and b/docs/static/favicon/favicon-16x16.png differ diff --git a/docs/static/favicon/favicon-32x32.png b/docs/static/favicon/favicon-32x32.png new file mode 100644 index 000000000..7d5a3ae3c Binary files /dev/null and b/docs/static/favicon/favicon-32x32.png differ diff --git a/docs/static/favicon/favicon.ico b/docs/static/favicon/favicon.ico new file mode 100644 index 000000000..34bd1fbf0 Binary files /dev/null and b/docs/static/favicon/favicon.ico differ diff --git a/docs/static/favicon/favicon.svg b/docs/static/favicon/favicon.svg new file mode 100644 index 000000000..5c51f66d9 --- /dev/null +++ b/docs/static/favicon/favicon.svg @@ -0,0 +1,50 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/docs/static/images/model.png b/docs/static/images/model.png new file mode 100644 index 000000000..ee5094596 Binary files /dev/null and b/docs/static/images/model.png differ diff --git a/docs/static/images/otel-pipeline.png b/docs/static/images/otel-pipeline.png new file mode 100644 index 000000000..5cf8eda3d Binary files /dev/null and b/docs/static/images/otel-pipeline.png differ diff --git a/docs/themes/hugo-geekdoc/LICENSE b/docs/themes/hugo-geekdoc/LICENSE new file mode 100644 index 000000000..3812eb46b --- /dev/null +++ b/docs/themes/hugo-geekdoc/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Robert Kaussow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/docs/themes/hugo-geekdoc/README.md b/docs/themes/hugo-geekdoc/README.md new file mode 100644 index 000000000..99358d83c --- /dev/null +++ b/docs/themes/hugo-geekdoc/README.md @@ -0,0 +1,46 @@ +# Geekdoc + +[![Build Status](https://ci.thegeeklab.de/api/badges/thegeeklab/hugo-geekdoc/status.svg)](https://ci.thegeeklab.de/repos/thegeeklab/hugo-geekdoc) +[![Hugo Version](https://img.shields.io/badge/hugo-0.112-blue.svg)](https://gohugo.io) +[![GitHub release](https://img.shields.io/github/v/release/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/releases/latest) +[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/graphs/contributors) +[![License: MIT](https://img.shields.io/github/license/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/blob/main/LICENSE) + +Geekdoc is a simple Hugo theme for documentations. It is intentionally designed as a fast and lean theme and may not fit the requirements of complex projects. If a more feature-complete theme is required there are a lot of good alternatives out there. You can find a demo and the full documentation at [https://geekdocs.de](https://geekdocs.de). + +![Desktop and mobile preview](https://raw.githubusercontent.com/thegeeklab/hugo-geekdoc/main/images/readme.png) + +## Build and release process + +This theme is subject to a CI driven build and release process common for software development. During the release build, all necessary assets are automatically built by [webpack](https://webpack.js.org/) and bundled in a release tarball. You can download the latest release from the GitHub [release page](https://github.com/thegeeklab/hugo-geekdoc/releases). + +Due to the fact that `webpack` and `npm scripts` are used as pre-processors, the theme cannot be used from the main branch by default. If you want to use the theme from a cloned branch instead of a release tarball you'll need to install `webpack` locally and run the build script once to create all required assets. + +```shell +# install required packages from package.json +npm install + +# run the build script to build required assets +npm run build + +# build release tarball +npm run pack +``` + +See the [Getting Started Guide](https://geekdocs.de/usage/getting-started/) for details about the different setup options. + +## Contributors + +Special thanks to all [contributors](https://github.com/thegeeklab/hugo-geekdoc/graphs/contributors). If you would like to contribute, please see the [instructions](https://github.com/thegeeklab/hugo-geekdoc/blob/main/CONTRIBUTING.md). + +Geekdoc is inspired and partially based on the [hugo-book](https://github.com/alex-shpak/hugo-book) theme, thanks [Alex Shpak](https://github.com/alex-shpak/) for your work. + +## License + +This project is licensed under the MIT License - see the [LICENSE](https://github.com/thegeeklab/hugo-geekdoc/blob/main/LICENSE) file for details. + +The used SVG icons and generated icon fonts are licensed under the license of the respective icon pack: + +- Font Awesome: [CC BY 4.0 License](https://github.com/FortAwesome/Font-Awesome#license) +- IcoMoon Free Pack: [GPL/CC BY 4.0](https://icomoon.io/#icons-icomoon) +- Material Icons: [Apache License 2.0](https://github.com/google/material-design-icons/blob/main/LICENSE) diff --git a/docs/themes/hugo-geekdoc/VERSION b/docs/themes/hugo-geekdoc/VERSION new file mode 100644 index 000000000..d0cca40aa --- /dev/null +++ b/docs/themes/hugo-geekdoc/VERSION @@ -0,0 +1 @@ +v0.41.1 diff --git a/docs/themes/hugo-geekdoc/archetypes/docs.md b/docs/themes/hugo-geekdoc/archetypes/docs.md new file mode 100644 index 000000000..aa0d88f7b --- /dev/null +++ b/docs/themes/hugo-geekdoc/archetypes/docs.md @@ -0,0 +1,7 @@ +--- +title: "{{ .Name | humanize | title }}" +weight: 1 +# geekdocFlatSection: false +# geekdocToc: 6 +# geekdocHidden: false +--- diff --git a/docs/themes/hugo-geekdoc/archetypes/posts.md b/docs/themes/hugo-geekdoc/archetypes/posts.md new file mode 100644 index 000000000..fdccff8ae --- /dev/null +++ b/docs/themes/hugo-geekdoc/archetypes/posts.md @@ -0,0 +1,4 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +--- diff --git a/docs/themes/hugo-geekdoc/assets/search/config.json b/docs/themes/hugo-geekdoc/assets/search/config.json new file mode 100644 index 000000000..1a5582a2e --- /dev/null +++ b/docs/themes/hugo-geekdoc/assets/search/config.json @@ -0,0 +1,8 @@ +{{- $searchDataFile := printf "search/%s.data.json" .Language.Lang -}} +{{- $searchData := resources.Get "search/data.json" | resources.ExecuteAsTemplate $searchDataFile . | resources.Minify -}} +{ + "dataFile": {{ $searchData.RelPermalink | jsonify }}, + "indexConfig": {{ .Site.Params.geekdocSearchConfig | jsonify }}, + "showParent": {{ if .Site.Params.geekdocSearchShowParent }}true{{ else }}false{{ end }}, + "showDescription": {{ if .Site.Params.geekdocSearchshowDescription }}true{{ else }}false{{ end }} +} diff --git a/docs/themes/hugo-geekdoc/assets/search/data.json b/docs/themes/hugo-geekdoc/assets/search/data.json new file mode 100644 index 000000000..f1c0e804e --- /dev/null +++ b/docs/themes/hugo-geekdoc/assets/search/data.json @@ -0,0 +1,13 @@ +[ + {{ range $index, $page := (where .Site.Pages "Params.geekdocProtected" "ne" true) }} + {{ if ne $index 0 }},{{ end }} + { + "id": {{ $index }}, + "href": "{{ $page.RelPermalink }}", + "title": {{ (partial "utils/title" $page) | jsonify }}, + "parent": {{ with $page.Parent }}{{ (partial "utils/title" .) | jsonify }}{{ else }}""{{ end }}, + "content": {{ $page.Plain | jsonify }}, + "description": {{ $page.Summary | plainify | jsonify }} + } + {{ end }} +] diff --git a/docs/themes/hugo-geekdoc/assets/sprites/geekdoc.svg b/docs/themes/hugo-geekdoc/assets/sprites/geekdoc.svg new file mode 100644 index 000000000..4f3cfd291 --- /dev/null +++ b/docs/themes/hugo-geekdoc/assets/sprites/geekdoc.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/themes/hugo-geekdoc/data/assets.json b/docs/themes/hugo-geekdoc/data/assets.json new file mode 100644 index 000000000..81541fbbc --- /dev/null +++ b/docs/themes/hugo-geekdoc/data/assets.json @@ -0,0 +1,158 @@ +{ + "main.js": { + "src": "js/main-924a1933.bundle.min.js", + "integrity": "sha512-0QF6awwW0WbBo491yytmULiHrc9gx94bloJ9MSXIvdJh3YHWw7CWyeX2YXu0rzOQefJp4jW/I6ZjUDYpNVFhdA==" + }, + "colortheme.js": { + "src": "js/colortheme-d3e4d351.bundle.min.js", + "integrity": "sha512-HpQogL/VeKqG/v1qYOfJOgFUzBnQvW4yO4tAJO+54IiwbLbB9feROdeaYf7dpO6o5tSHsSZhaYLhtLMRlEgpJQ==" + }, + "mermaid.js": { + "src": "js/mermaid-d305d450.bundle.min.js", + "integrity": "sha512-TASG03QptoVv1mkfOL47vm5A5kvmyOrnsi8PXhc82j1+FuHZuMOHXc2x5/jGEkOxbKi7mum0h/W7qYhrV29raw==" + }, + "katex.js": { + "src": "js/katex-d4d5881d.bundle.min.js", + "integrity": "sha512-M8CLtMTu/HVXo11Et+lv3OqPanLf5Bl+GljNAn2yQuLclg/ZpZK1KUpHDRsZJhmkhCcCH90+bVj5CW3lLlmBgg==" + }, + "search.js": { + "src": "js/search-9719be99.bundle.min.js", + "integrity": "sha512-/7NZxFUEbalC/8RKDgfAsHFDI42/Ydp33uJmCLckZgnO+kuz9LrTfmPFfVJxPJ31StMxa3MTQ5Jq049CmNK4pw==" + }, + "js/637-86fbbecd.chunk.min.js": { + "src": "js/637-86fbbecd.chunk.min.js", + "integrity": "sha512-vD1y0C4MPPV/JhEKmNVAye9SQg7mB5v87nLf63keSALdnM7P+L0ybjEn2MzYzVTzs6JnOCryM7A6/t0TkYucDA==" + }, + "js/116-341f79d9.chunk.min.js": { + "src": "js/116-341f79d9.chunk.min.js", + "integrity": "sha512-F7tq1KsF5mnJl0AAA6x2jZcx8x69kEZrUIZJJM4RZ1KlEO79yrrFHf4CZRvhNrYOxmkBpkQ84U9J0vFtRPKjTw==" + }, + "js/545-8e970b03.chunk.min.js": { + "src": "js/545-8e970b03.chunk.min.js", + "integrity": "sha512-vDOXX1FstnT8UMkRIAMn6z4ucL8LVqI5kZw+T7LrD8pGC9xtKwwhWcmNeqnngc7FHc5Ogt7ppXBNp+uFPUgrJg==" + }, + "js/728-5df4a5e5.chunk.min.js": { + "src": "js/728-5df4a5e5.chunk.min.js", + "integrity": "sha512-vX2dPV1VjOgv8DP4XbZ9xk9ZzHS9hPAUwPfHM8UG42efxXxH/qCqTpyavqob98onxR2FuiF+j1Vn56d3wqsgaw==" + }, + "js/81-4e653aac.chunk.min.js": { + "src": "js/81-4e653aac.chunk.min.js", + "integrity": "sha512-a80h3DpDlMG6HhYXv9n9Q7r1M+rQX5kfJ7sFhfmPHlDRVimult9nn7vvTHFzTzmMFM+tLcfg4pZGd+AkxPcjEw==" + }, + "js/430-cc171d93.chunk.min.js": { + "src": "js/430-cc171d93.chunk.min.js", + "integrity": "sha512-cqQyiIE22ZPo2PIPR4eb0DPSu1TWjxgJUKrIIyfVF48gc2vdLKnbHzWBZg6MpiOWYmUvJb5Ki+n5U6qEvNp2KQ==" + }, + "js/729-32b017b3.chunk.min.js": { + "src": "js/729-32b017b3.chunk.min.js", + "integrity": "sha512-KAW7lnN0NHmIzfD6aIwVaU3TcpUkO8ladLrbOE83zq80NOJH/MGS4Ep+2rIfQZTvZP+a7nqZLHkmezfs27c2pw==" + }, + "js/773-8f0c4fb8.chunk.min.js": { + "src": "js/773-8f0c4fb8.chunk.min.js", + "integrity": "sha512-HxtbZvs0J28pB9fImN8n82aprG/GW0QenIBzC7BHWhEUX6IhmxTeBqG4IZFbbAURG17VegOr2UlJg6w0qaX9gw==" + }, + "js/433-f2655a46.chunk.min.js": { + "src": "js/433-f2655a46.chunk.min.js", + "integrity": "sha512-/yMUz6rxhVpvCPpQG+f28jFgdJK+X/5/3XWVsrAE2FHC57jxnHaL7SxZluZ4klUl0YsRCrhxAQj8maNspwwH1Q==" + }, + "js/546-560b35c2.chunk.min.js": { + "src": "js/546-560b35c2.chunk.min.js", + "integrity": "sha512-am1/hYno7/cFQ8reHZqnbsth2KcphvKqLfkueVIm8I/i/6f9u+bbc0Z6zpYTLysl3oWddYXqyeO58zXoJoDVIA==" + }, + "js/118-f1de6a20.chunk.min.js": { + "src": "js/118-f1de6a20.chunk.min.js", + "integrity": "sha512-tikydCOmBT1keN0AlCqvkpvbV1gB9U8lVXX8wmrS6fQ2faNc8DnH1QV9dzAlLtGeA1p8HAXnh+AevnVKxhXVbg==" + }, + "js/19-86f47ecd.chunk.min.js": { + "src": "js/19-86f47ecd.chunk.min.js", + "integrity": "sha512-qRG0UrV25Kr/36tJTPZ49QobR6a/zv2BRAMDzSZwjlPgqSwse1HtgP9EEZtn59b1Vq7ayB1LoWfB9MZ9Gcm7Gw==" + }, + "js/361-f7cd601a.chunk.min.js": { + "src": "js/361-f7cd601a.chunk.min.js", + "integrity": "sha512-7kwaFQhXUyiM/v2v0n6vI9wz6nSAu7sz2236r+MbwT0r4aBxYqeOxij+PkGnTUqR2n1UExnbWKjuruDi9V/H5g==" + }, + "js/519-8d0cec7f.chunk.min.js": { + "src": "js/519-8d0cec7f.chunk.min.js", + "integrity": "sha512-tFsZN3iyUMIMeB/b4E1PZNOFDKqMM4Fes63RGNkHNhtRTL/AIUpqPcTKZ+Fi2ZTdyYvPSTtjc5urnzLUi196Wg==" + }, + "js/747-b55f0f97.chunk.min.js": { + "src": "js/747-b55f0f97.chunk.min.js", + "integrity": "sha512-hoyvC5SSJcX9NGij9J9l4Ov1JAFNBX0UxlFXyiB5TC7TGW3lgIvm41zyfKhLyJudVGftY/qKxIO2EYtYD2pqOQ==" + }, + "js/642-12e7dea2.chunk.min.js": { + "src": "js/642-12e7dea2.chunk.min.js", + "integrity": "sha512-ZVUj7NYSa8mMHdWaztAf3DCg7qznXTbMWWwqJaS2nfaqh0lVDOf5kVExPy6SGkXCeNu/B9gGbWLtDUa7kHFF6A==" + }, + "js/626-1706197a.chunk.min.js": { + "src": "js/626-1706197a.chunk.min.js", + "integrity": "sha512-OlpbPXiGmQJR/ISfBSsHU2UGATggZDuHbopvAhhfVpw7ObMZgc/UvE6pK1FmGCjgI9iS+qmPhQyvf9SIbLFyxQ==" + }, + "js/438-760c9ed3.chunk.min.js": { + "src": "js/438-760c9ed3.chunk.min.js", + "integrity": "sha512-Wo2DxS59Y8DVBTWNWDUmg6V+UCyLoiDd4sPs2xc7TkflQy7reGWPt/oHZCANXeGjZPpqcR3qfKYidNofUyIWEA==" + }, + "js/639-88c6538a.chunk.min.js": { + "src": "js/639-88c6538a.chunk.min.js", + "integrity": "sha512-KbTKHxx+/Xwv+GH8jQsIJ9X1CFaGSsqgeSXnR8pW27YZpFz4ly8R6K7h+yq6P2b2AzQdW7krradZzyNo7Vz26w==" + }, + "js/940-25dfc794.chunk.min.js": { + "src": "js/940-25dfc794.chunk.min.js", + "integrity": "sha512-qst5aejItmhzMvZ3CsAXyJe2F3FtLkyZwBqj422/8ViyQptcQFgP3x8bPsLwJEfiWFJVrLJkk4VhwflQuIyDtw==" + }, + "js/662-17acb8f4.chunk.min.js": { + "src": "js/662-17acb8f4.chunk.min.js", + "integrity": "sha512-S/UlqDqwt++RzVZMVqjsdCNyhe1xNQ9/Qm38yIphmXfn9VBHzGqobIQTuhloYZVfTE4/GezrH+1T7mdrUqpAKQ==" + }, + "js/579-9222afff.chunk.min.js": { + "src": "js/579-9222afff.chunk.min.js", + "integrity": "sha512-rl3bxxl/uhUFYlIuoHfVQE+VkmxfJr7TAuC/fxOBJXBCCMpdxP0XCPzms1zjEjOVjIs4bi4SUwn8r4STSl09Lg==" + }, + "js/771-942a62df.chunk.min.js": { + "src": "js/771-942a62df.chunk.min.js", + "integrity": "sha512-8WfA8U1Udlfa6uWAYbdNKJzjlJ91qZ0ZhC+ldKdhghUgilxqA6UmZxHFKGRDQydjOFDk828O28XVmZU2IEvckA==" + }, + "js/506-6950d52c.chunk.min.js": { + "src": "js/506-6950d52c.chunk.min.js", + "integrity": "sha512-h2po0SsM4N3IXiBbNWlIbasxX7zSm5XVDpgYfmsEmcfQkMcFwJtTJGppek085Mxi1XZmrhjfxq2AUtnUs03LJg==" + }, + "js/76-732e78f1.chunk.min.js": { + "src": "js/76-732e78f1.chunk.min.js", + "integrity": "sha512-ZjF2oB76jiCtdQNJZ9v1MUJSPaBcZCXmTA2T3qDBuU260uVA99wGeprrNQ3WdHQeK+VYXCq26dOE9w+I3b6Q4w==" + }, + "js/476-86e5cf96.chunk.min.js": { + "src": "js/476-86e5cf96.chunk.min.js", + "integrity": "sha512-siq24cNKFc1tXGACAQlpbXOb2gRKDnncf39INGAPlnJSiAsYewhNusq1UxhMDFA836eucVq7NzE1TqEYskI0ug==" + }, + "js/813-0d3c16f5.chunk.min.js": { + "src": "js/813-0d3c16f5.chunk.min.js", + "integrity": "sha512-gDVyQtM781xlTfyZzuEJ1tnQWyasbFKLRPwgGUF5lpdS3QpW6KTIwCnMuVn2b5XF2qKSxpei9YNIushpBI4ILA==" + }, + "js/423-897d7f17.chunk.min.js": { + "src": "js/423-897d7f17.chunk.min.js", + "integrity": "sha512-ERAmXYsLT59PDGFPLTHNgaNw5CsaTOK88orlaXr+7SOxf+Yjf5fvDmpXCNJe1odvU6OF4cajtlVM1qO9hzOqWw==" + }, + "js/535-dcead599.chunk.min.js": { + "src": "js/535-dcead599.chunk.min.js", + "integrity": "sha512-3gB2l6iJbt94EMd1Xh6udlMXjdHlAbuRKkyl87X/LSuG1fGbfTe11O5ma+un13BBX1wZ1xnHtUv6Fyc3pgbgDg==" + }, + "main.scss": { + "src": "main-252d384c.min.css", + "integrity": "sha512-WiV7BVk76Yp0EACJrwdWDk7+WNa+Jyiupi9aCKFrzZyiKkXk7BH+PL2IJcuDQpCMtMBFJEgen2fpKu9ExjjrUQ==" + }, + "katex.css": { + "src": "katex-66092164.min.css", + "integrity": "sha512-ng+uY3bZP0IENn+fO0T+jdk1v1r7HQJjsVRJgzU+UiJJadAevmo0gVNrpVxrBFGpRQqSz42q20uTre1C1Qrnow==" + }, + "mobile.scss": { + "src": "mobile-79ddc617.min.css", + "integrity": "sha512-dzw2wMOouDwhSgstQKLbXD/vIqS48Ttc2IV6DeG7yam9yvKUuChJVaworzL8s2UoGMX4x2jEm50PjFJE4R4QWw==" + }, + "print.scss": { + "src": "print-735ccc12.min.css", + "integrity": "sha512-c28KLNtBnKDW1+/bNWFhwuGBLw9octTXA2wnuaS2qlvpNFL0DytCapui9VM4YYkZg6e9TVp5LyuRQc2lTougDw==" + }, + "custom.css": { + "src": "custom.css", + "integrity": "sha512-1kALo+zc1L2u1rvyxPIew+ZDPWhnIA1Ei2rib3eHHbskQW+EMxfI9Ayyva4aV+YRrHvH0zFxvPSFIuZ3mfsbRA==" + } +} diff --git a/docs/themes/hugo-geekdoc/i18n/cs.yaml b/docs/themes/hugo-geekdoc/i18n/cs.yaml new file mode 100644 index 000000000..71dd8ed30 --- /dev/null +++ b/docs/themes/hugo-geekdoc/i18n/cs.yaml @@ -0,0 +1,53 @@ +--- +edit_page: Upravit stránku + +nav_navigation: Navigace +nav_tags: Tagy +nav_more: Více +nav_top: Zpět nahoru + +form_placeholder_search: Vyhledat + +error_page_title: Ztracen? Nic se neděje +error_message_title: Ztracen? +error_message_code: Error 404 +error_message_text: > + Vypadá to že stránka, kterou hledáte, neexistuje. Nemějte obavy, můžete + se vrátit zpět na domovskou stránku. + +button_toggle_dark: Přepnout tmavý/světlý/automatický režim +button_nav_open: Otevřít navigaci +button_nav_close: Zavřít navigaci +button_menu_open: Otevřít lištu nabídky +button_menu_close: Zavřít lištu nabídky +button_homepage: Zpět na domovskou stránku + +title_anchor_prefix: "Odkaz na:" + +posts_read_more: Přečíst celý příspěvek +posts_read_time: + one: "Doba čtení: 1 minuta" + other: "Doba čtení: {{ . }} minut(y)" +posts_update_prefix: Naposledy upraveno +posts_count: + one: "Jeden příspěvek" + other: "Příspěvků: {{ . }}" +posts_tagged_with: Všechny příspěvky označeny '{{ . }}' + +footer_build_with: > + Vytvořeno za pomocí Hugo a + +footer_legal_notice: Právní upozornění +footer_privacy_policy: Zásady ochrany soukromí +footer_content_license_prefix: > + Obsah licencovaný pod + +language_switch_no_tranlation_prefix: "Stránka není přeložena:" + +propertylist_required: povinné +propertylist_optional: volitené +propertylist_default: výchozí + +pagination_page_prev: předchozí +pagination_page_next: další +pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" diff --git a/docs/themes/hugo-geekdoc/i18n/de.yaml b/docs/themes/hugo-geekdoc/i18n/de.yaml new file mode 100644 index 000000000..ae3dc99fc --- /dev/null +++ b/docs/themes/hugo-geekdoc/i18n/de.yaml @@ -0,0 +1,53 @@ +--- +edit_page: Seite bearbeiten + +nav_navigation: Navigation +nav_tags: Tags +nav_more: Weitere +nav_top: Nach oben + +form_placeholder_search: Suchen + +error_page_title: Verlaufen? Keine Sorge +error_message_title: Verlaufen? +error_message_code: Fehler 404 +error_message_text: > + Wir können die Seite nach der Du gesucht hast leider nicht finden. Keine Sorge, + wir bringen Dich zurück zur Startseite. + +button_toggle_dark: Wechsel zwischen Dunkel/Hell/Auto Modus +button_nav_open: Navigation öffnen +button_nav_close: Navigation schließen +button_menu_open: Menüband öffnen +button_menu_close: Menüband schließen +button_homepage: Zurück zur Startseite + +title_anchor_prefix: "Link zu:" + +posts_read_more: Ganzen Artikel lesen +posts_read_time: + one: "Eine Minute Lesedauer" + other: "{{ . }} Minuten Lesedauer" +posts_update_prefix: Aktualisiert am +posts_count: + one: "Ein Artikel" + other: "{{ . }} Artikel" +posts_tagged_with: Alle Artikel mit dem Tag '{{ . }}' + +footer_build_with: > + Entwickelt mit Hugo und + +footer_legal_notice: Impressum +footer_privacy_policy: Datenschutzerklärung +footer_content_license_prefix: > + Inhalt lizensiert unter + +language_switch_no_tranlation_prefix: "Seite nicht übersetzt:" + +propertylist_required: erforderlich +propertylist_optional: optional +propertylist_default: Standardwert + +pagination_page_prev: vorher +pagination_page_next: weiter +pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" diff --git a/docs/themes/hugo-geekdoc/i18n/en.yaml b/docs/themes/hugo-geekdoc/i18n/en.yaml new file mode 100644 index 000000000..ff19ea4e8 --- /dev/null +++ b/docs/themes/hugo-geekdoc/i18n/en.yaml @@ -0,0 +1,53 @@ +--- +edit_page: Edit page + +nav_navigation: Navigation +nav_tags: Tags +nav_more: More +nav_top: Back to top + +form_placeholder_search: Search + +error_page_title: Lost? Don't worry +error_message_title: Lost? +error_message_code: Error 404 +error_message_text: > + Seems like what you are looking for can't be found. Don't worry, we can + bring you back to the homepage. + +button_toggle_dark: Toggle Dark/Light/Auto mode +button_nav_open: Open Navigation +button_nav_close: Close Navigation +button_menu_open: Open Menu Bar +button_menu_close: Close Menu Bar +button_homepage: Back to homepage + +title_anchor_prefix: "Anchor to:" + +posts_read_more: Read full post +posts_read_time: + one: "One minute to read" + other: "{{ . }} minutes to read" +posts_update_prefix: Updated on +posts_count: + one: "One post" + other: "{{ . }} posts" +posts_tagged_with: All posts tagged with '{{ . }}' + +footer_build_with: > + Built with Hugo and + +footer_legal_notice: Legal Notice +footer_privacy_policy: Privacy Policy +footer_content_license_prefix: > + Content licensed under + +language_switch_no_tranlation_prefix: "Page not translated:" + +propertylist_required: required +propertylist_optional: optional +propertylist_default: default + +pagination_page_prev: prev +pagination_page_next: next +pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" diff --git a/docs/themes/hugo-geekdoc/i18n/es.yaml b/docs/themes/hugo-geekdoc/i18n/es.yaml new file mode 100644 index 000000000..8e65cec7b --- /dev/null +++ b/docs/themes/hugo-geekdoc/i18n/es.yaml @@ -0,0 +1,53 @@ +--- +edit_page: Editar página + +nav_navigation: Navegación +nav_tags: Etiquetas +nav_more: Más +nav_top: Inicio de la página + +form_placeholder_search: Buscar + +error_page_title: Perdido? No te preocupes +error_message_title: Perdido? +error_message_code: Error 404 +error_message_text: > + Al parecer, lo que estás buscando no pudo ser encontrado. No te preocupes, podemos + llevarte de vuelta al inicio. + +button_toggle_dark: Cambiar el modo Oscuro/Claro/Auto +button_nav_open: Abrir la Navegación +button_nav_close: Cerrar la Navegación +button_menu_open: Abrir el Menú Bar +button_menu_close: Cerrar el Menú Bar +button_homepage: Volver al Inicio + +title_anchor_prefix: "Anclado a:" + +posts_read_more: Lee la publicación completa +posts_read_time: + one: "Un minuto para leer" + other: "{{ . }} minutos para leer" +posts_update_prefix: Actualizado en +posts_count: + one: "Una publicación" + other: "{{ . }} publicaciones" +posts_tagged_with: Todas las publicaciones etiquetadas con '{{ . }}' + +footer_build_with: > + Creado con Hugo y + +footer_legal_notice: Aviso Legal +footer_privacy_policy: Política de Privacidad +footer_content_license_prefix: > + Contenido licenciado con + +language_switch_no_tranlation_prefix: "Página no traducida:" + +propertylist_required: requerido +propertylist_optional: opcional +propertylist_default: estándar + +pagination_page_prev: previo +pagination_page_next: siguiente +pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" diff --git a/docs/themes/hugo-geekdoc/i18n/it.yaml b/docs/themes/hugo-geekdoc/i18n/it.yaml new file mode 100644 index 000000000..ce7c40b4e --- /dev/null +++ b/docs/themes/hugo-geekdoc/i18n/it.yaml @@ -0,0 +1,53 @@ +--- +edit_page: Modifica la pagina + +nav_navigation: Navigazione +nav_tags: Etichette +nav_more: Altro +nav_top: Torna su + +form_placeholder_search: Cerca + +error_page_title: Perso? Non ti preoccupare +error_message_title: Perso? +error_message_code: Errore 404 +error_message_text: > + Sembra che non sia possibile trovare quello che stavi cercando. Non ti preoccupare, + possiamo riportarti alla pagina iniziale. + +button_toggle_dark: Seleziona il tema Chiaro/Scuro/Automatico +button_nav_open: Apri la Navigazione +button_nav_close: Chiudi la Navigazione +button_menu_open: Apri la Barra del Menu +button_menu_close: Chiudi la Barra del Menu +button_homepage: Torna alla pagina iniziale + +title_anchor_prefix: "Ancora a:" + +posts_read_more: Leggi tutto il post +posts_read_time: + one: "Tempo di lettura: un minuto" + other: "Tempo di lettura: {{ . }} minuti" +posts_update_prefix: Aggiornato il +posts_count: + one: "Un post" + other: "{{ . }} post" +posts_tagged_with: Tutti i post etichettati con '{{ . }}' + +footer_build_with: > + Realizzato con Hugo e + +footer_legal_notice: Avviso Legale +footer_privacy_policy: Politica sulla Privacy +footer_content_license_prefix: > + Contenuto sotto licenza + +language_switch_no_tranlation_prefix: "Pagina non tradotta:" + +propertylist_required: richiesto +propertylist_optional: opzionale +propertylist_default: valore predefinito + +pagination_page_prev: precedente +pagination_page_next: prossimo +pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" diff --git a/docs/themes/hugo-geekdoc/i18n/ja.yaml b/docs/themes/hugo-geekdoc/i18n/ja.yaml new file mode 100644 index 000000000..506e7b4e1 --- /dev/null +++ b/docs/themes/hugo-geekdoc/i18n/ja.yaml @@ -0,0 +1,53 @@ +--- +edit_page: ページの編集 + +nav_navigation: ナビゲーション +nav_tags: タグ +nav_more: さらに +nav_top: トップへ戻る + +form_placeholder_search: 検索 + +error_page_title: お困りですか?ご心配なく +error_message_title: お困りですか? +error_message_code: 404 エラー +error_message_text: > + お探しのものが見つからないようです。トップページ + へ戻ることができるので、ご安心ください。 + +button_toggle_dark: モードの切替 ダーク/ライト/自動 +button_nav_open: ナビゲーションを開く +button_nav_close: ナビゲーションを閉じる +button_menu_open: メニューバーを開く +button_menu_close: メニューバーを閉じる +button_homepage: トップページへ戻る + +title_anchor_prefix: "アンカー先:" + +posts_read_more: 全投稿を閲覧 +posts_read_time: + one: "読むのに 1 分かかります" + other: "読むのに要する時間 {{ . }} (分)" +posts_update_prefix: 更新時刻 +posts_count: + one: "一件の投稿" + other: "{{ . }} 件の投稿" +posts_tagged_with: "'{{ . }}'のタグが付いた記事全部" + +footer_build_with: > + Hugo でビルドしています。 + +footer_legal_notice: 法的な告知事項 +footer_privacy_policy: プライバシーポリシー +footer_content_license_prefix: > + 提供するコンテンツのライセンス + +language_switch_no_tranlation_prefix: "未翻訳のページ:" + +propertylist_required: 必須 +propertylist_optional: 任意 +propertylist_default: 既定値 + +pagination_page_prev: 前 +pagination_page_next: 次 +pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" diff --git a/docs/themes/hugo-geekdoc/i18n/nl.yaml b/docs/themes/hugo-geekdoc/i18n/nl.yaml new file mode 100644 index 000000000..240bcea5a --- /dev/null +++ b/docs/themes/hugo-geekdoc/i18n/nl.yaml @@ -0,0 +1,53 @@ +--- +edit_page: Wijzig pagina + +nav_navigation: Navigatie +nav_tags: Markering +nav_more: Meer +nav_top: Terug naar boven + +form_placeholder_search: Zoek + +error_page_title: Verdwaald? Geen probleem +error_message_title: Verdwaald? +error_message_code: Error 404 +error_message_text: > + Het lijkt er op dat wat je zoekt niet gevonden kan worden. Geen probleem, + we kunnen je terug naar de startpagina brengen. + +button_toggle_dark: Wijzig Donker/Licht/Auto weergave +button_nav_open: Open navigatie +button_nav_close: Sluit navigatie +button_menu_open: Open menubalk +button_menu_close: Sluit menubalk +button_homepage: Terug naar startpagina + +title_anchor_prefix: "Link naar:" + +posts_read_more: Lees volledige bericht +posts_read_time: + one: "Een minuut leestijd" + other: "{{ . }} minuten leestijd" +posts_update_prefix: Bijgewerkt op +posts_count: + one: "Een bericht" + other: "{{ . }} berichten" +posts_tagged_with: Alle berichten gemarkeerd met '{{ . }}' + +footer_build_with: > + Gebouwd met Hugo en + +footer_legal_notice: Juridische mededeling +footer_privacy_policy: Privacybeleid +footer_content_license_prefix: > + Inhoud gelicenseerd onder + +language_switch_no_tranlation_prefix: "Pagina niet vertaald:" + +propertylist_required: verplicht +propertylist_optional: optioneel +propertylist_default: standaard + +pagination_page_prev: vorige +pagination_page_next: volgende +pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" diff --git a/docs/themes/hugo-geekdoc/i18n/zh-cn.yaml b/docs/themes/hugo-geekdoc/i18n/zh-cn.yaml new file mode 100644 index 000000000..e6403acd1 --- /dev/null +++ b/docs/themes/hugo-geekdoc/i18n/zh-cn.yaml @@ -0,0 +1,53 @@ +--- +edit_page: 编辑页面 + +nav_navigation: 导航 +nav_tags: 标签 +nav_more: 更多 +nav_top: 回到顶部 + +form_placeholder_search: 搜索 + +error_page_title: 迷路了? 不用担心 +error_message_title: 迷路了? +error_message_code: 错误 404 +error_message_text: > + 好像找不到你要找的东西。 别担心,我们可以 + 带您回到主页。 + +button_toggle_dark: 切换暗/亮/自动模式 +button_nav_open: 打开导航 +button_nav_close: 关闭导航 +button_menu_open: 打开菜单栏 +button_menu_close: 关闭菜单栏 +button_homepage: 返回首页 + +title_anchor_prefix: "锚定到:" + +posts_read_more: 阅读全文 +posts_read_time: + one: "一分钟阅读时间" + other: "{{ . }} 分钟阅读时间" +posts_update_prefix: 更新时间 +posts_count: + one: 一篇文章 + other: "{{ . }} 个帖子" +posts_tagged_with: 所有带有“{{ . }}”标签的帖子。 + +footer_build_with: > + 基于 Hugo + 制作 +footer_legal_notice: "法律声明" +footer_privacy_policy: "隐私政策" +footer_content_license_prefix: > + 内容许可证 + +language_switch_no_tranlation_prefix: "页面未翻译:" + +propertylist_required: 需要 +propertylist_optional: 可选 +propertylist_default: 默认值 + +pagination_page_prev: 以前 +pagination_page_next: 下一个 +pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" diff --git a/docs/themes/hugo-geekdoc/images/readme.png b/docs/themes/hugo-geekdoc/images/readme.png new file mode 100644 index 000000000..10c8ff157 Binary files /dev/null and b/docs/themes/hugo-geekdoc/images/readme.png differ diff --git a/docs/themes/hugo-geekdoc/images/screenshot.png b/docs/themes/hugo-geekdoc/images/screenshot.png new file mode 100644 index 000000000..af243606d Binary files /dev/null and b/docs/themes/hugo-geekdoc/images/screenshot.png differ diff --git a/docs/themes/hugo-geekdoc/images/tn.png b/docs/themes/hugo-geekdoc/images/tn.png new file mode 100644 index 000000000..ee6e42ed0 Binary files /dev/null and b/docs/themes/hugo-geekdoc/images/tn.png differ diff --git a/docs/themes/hugo-geekdoc/layouts/404.html b/docs/themes/hugo-geekdoc/layouts/404.html new file mode 100644 index 000000000..f8a61bb53 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/404.html @@ -0,0 +1,40 @@ + + + + {{ partial "head/meta" . }} + {{ i18n "error_page_title" }} + + {{ partial "head/favicons" . }} + {{ partial "head/others" . }} + + + + {{ partial "svg-icon-symbols" . }} + + +
+ + + {{ partial "site-header" (dict "Root" . "MenuEnabled" false) }} + + +
+
+
+ +
+
+
{{ i18n "error_message_title" }}
+
{{ i18n "error_message_code" }}
+
+ {{ i18n "error_message_text" .Site.BaseURL | safeHTML }} +
+
+
+
+ + {{ partial "site-footer" . }} + +
+ + diff --git a/docs/themes/hugo-geekdoc/layouts/_default/_markup/render-codeblock-mermaid.html b/docs/themes/hugo-geekdoc/layouts/_default/_markup/render-codeblock-mermaid.html new file mode 100644 index 000000000..b5deb66b4 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/_default/_markup/render-codeblock-mermaid.html @@ -0,0 +1,11 @@ + +{{ if not (.Page.Scratch.Get "mermaid") }} + + + {{ .Page.Scratch.Set "mermaid" true }} +{{ end }} + + +
+  {{- .Inner -}}
+
diff --git a/docs/themes/hugo-geekdoc/layouts/_default/_markup/render-heading.html b/docs/themes/hugo-geekdoc/layouts/_default/_markup/render-heading.html new file mode 100644 index 000000000..3e7a270f3 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/_default/_markup/render-heading.html @@ -0,0 +1,27 @@ +{{- $showAnchor := (and (default true .Page.Params.geekdocAnchor) (default true .Page.Site.Params.geekdocAnchor)) -}} + + + +{{- if $showAnchor -}} +
+ + {{ .Text | safeHTML }} + + + + +
+{{- else -}} +
+ + {{ .Text | safeHTML }} + +
+{{- end -}} + diff --git a/docs/themes/hugo-geekdoc/layouts/_default/_markup/render-image.html b/docs/themes/hugo-geekdoc/layouts/_default/_markup/render-image.html new file mode 100644 index 000000000..99a311367 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/_default/_markup/render-image.html @@ -0,0 +1,6 @@ +{{ .Text }} +{{- /* Drop trailing newlines */ -}} diff --git a/docs/themes/hugo-geekdoc/layouts/_default/_markup/render-link.html b/docs/themes/hugo-geekdoc/layouts/_default/_markup/render-link.html new file mode 100644 index 000000000..cec8a9530 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/_default/_markup/render-link.html @@ -0,0 +1,14 @@ +{{- $raw := or (hasPrefix .Text " + {{- .Text | safeHTML -}} + +{{- /* Drop trailing newlines */ -}} diff --git a/docs/themes/hugo-geekdoc/layouts/_default/baseof.html b/docs/themes/hugo-geekdoc/layouts/_default/baseof.html new file mode 100644 index 000000000..ebc39cfcf --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/_default/baseof.html @@ -0,0 +1,60 @@ + + + + {{ partial "head/meta" . }} + + {{- if eq .Kind "home" -}} + {{ .Site.Title }} + {{- else -}} + {{ printf "%s | %s" (partial "utils/title" .) .Site.Title }} + {{- end -}} + + + {{ partial "head/favicons" . }} + {{ partial "head/rel-me" . }} + {{ partial "head/microformats" . }} + {{ partial "head/others" . }} + {{ partial "head/custom" . }} + + + + {{ partial "svg-icon-symbols" . }} + + +
+ + + {{ $navEnabled := default true .Page.Params.geekdocNav }} + {{ partial "site-header" (dict "Root" . "MenuEnabled" $navEnabled) }} + + +
+ {{ if $navEnabled }} + + {{ end }} + + +
+ {{ template "main" . }} + + + +
+
+ + {{ partial "site-footer" . }} +
+ + {{ partial "foot" . }} + + diff --git a/docs/themes/hugo-geekdoc/layouts/_default/list.html b/docs/themes/hugo-geekdoc/layouts/_default/list.html new file mode 100644 index 000000000..94172f65d --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/_default/list.html @@ -0,0 +1,11 @@ +{{ define "main" }} + {{ partial "page-header" . }} + + +
+

{{ partial "utils/title" . }}

+ {{ partial "utils/content" . }} +
+{{ end }} diff --git a/docs/themes/hugo-geekdoc/layouts/_default/single.html b/docs/themes/hugo-geekdoc/layouts/_default/single.html new file mode 100644 index 000000000..94172f65d --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/_default/single.html @@ -0,0 +1,11 @@ +{{ define "main" }} + {{ partial "page-header" . }} + + +
+

{{ partial "utils/title" . }}

+ {{ partial "utils/content" . }} +
+{{ end }} diff --git a/docs/themes/hugo-geekdoc/layouts/_default/taxonomy.html b/docs/themes/hugo-geekdoc/layouts/_default/taxonomy.html new file mode 100644 index 000000000..bb97e8ed4 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/_default/taxonomy.html @@ -0,0 +1,49 @@ +{{ define "main" }} + {{ range .Paginator.Pages }} + + {{ end }} + {{ partial "pagination.html" . }} +{{ end }} + +{{ define "post-tag" }} + +{{ end }} diff --git a/docs/themes/hugo-geekdoc/layouts/_default/terms.html b/docs/themes/hugo-geekdoc/layouts/_default/terms.html new file mode 100644 index 000000000..2316ef56d --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/_default/terms.html @@ -0,0 +1,32 @@ +{{ define "main" }} + {{ range .Paginator.Pages.ByTitle }} + + {{ end }} + {{ partial "pagination.html" . }} +{{ end }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/foot.html b/docs/themes/hugo-geekdoc/layouts/partials/foot.html new file mode 100644 index 000000000..2a115e562 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/foot.html @@ -0,0 +1,6 @@ +{{ if default true .Site.Params.geekdocSearch }} + + {{- $searchConfigFile := printf "search/%s.config.json" .Language.Lang -}} + {{- $searchConfig := resources.Get "search/config.json" | resources.ExecuteAsTemplate $searchConfigFile . | resources.Minify -}} + {{- $searchConfig.Publish -}} +{{ end }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/head/custom.html b/docs/themes/hugo-geekdoc/layouts/partials/head/custom.html new file mode 100644 index 000000000..44862c7b6 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/head/custom.html @@ -0,0 +1 @@ + diff --git a/docs/themes/hugo-geekdoc/layouts/partials/head/favicons.html b/docs/themes/hugo-geekdoc/layouts/partials/head/favicons.html new file mode 100644 index 000000000..40a8c91d2 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/head/favicons.html @@ -0,0 +1,13 @@ + + + diff --git a/docs/themes/hugo-geekdoc/layouts/partials/head/meta.html b/docs/themes/hugo-geekdoc/layouts/partials/head/meta.html new file mode 100644 index 000000000..4cc4ddb44 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/head/meta.html @@ -0,0 +1,14 @@ + + + + +{{ hugo.Generator }} + +{{ $keywords := default .Site.Params.Keywords .Keywords }} + +{{- with partial "utils/description" . }} + +{{- end }} +{{- with $keywords }} + +{{- end }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/head/microformats.html b/docs/themes/hugo-geekdoc/layouts/partials/head/microformats.html new file mode 100644 index 000000000..8b6038ac2 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/head/microformats.html @@ -0,0 +1,3 @@ +{{ partial "microformats/opengraph.html" . }} +{{ partial "microformats/twitter_cards.html" . }} +{{ partial "microformats/schema" . }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/head/others.html b/docs/themes/hugo-geekdoc/layouts/partials/head/others.html new file mode 100644 index 000000000..537c2ff85 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/head/others.html @@ -0,0 +1,73 @@ +{{- if default true .Site.Params.geekdocDarkModeToggle }} + +{{- end }} + + + + + + + + + + + + + + + + + +{{- with .OutputFormats.Get "html" }} + {{ printf `` .Permalink .Rel .MediaType.Type | safeHTML }} +{{- end }} + +{{- if (default false $.Site.Params.geekdocOverwriteHTMLBase) }} + +{{- end }} + +{{ printf "" "Made with Geekdoc theme https://github.com/thegeeklab/hugo-geekdoc" | safeHTML }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/head/rel-me.html b/docs/themes/hugo-geekdoc/layouts/partials/head/rel-me.html new file mode 100644 index 000000000..59a346168 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/head/rel-me.html @@ -0,0 +1 @@ + diff --git a/docs/themes/hugo-geekdoc/layouts/partials/language.html b/docs/themes/hugo-geekdoc/layouts/partials/language.html new file mode 100644 index 000000000..8ad972d07 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/language.html @@ -0,0 +1,51 @@ +{{ if .IsTranslated }} + +
    +
  • + {{ range .Site.Languages }} + {{ if eq . $.Site.Language }} + + + {{ .Lang | upper }} + + {{ end }} + {{ end }} + + + +
  • +
+
+{{ end }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/menu-bundle.html b/docs/themes/hugo-geekdoc/layouts/partials/menu-bundle.html new file mode 100644 index 000000000..bb323875b --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/menu-bundle.html @@ -0,0 +1,87 @@ +{{ $current := .current }} +{{ template "menu-file" dict "sect" .source "current" $current "site" $current.Site }} + + + +{{ define "menu-file" }} + {{ $current := .current }} + {{ $site := .site }} + + +
    + {{ range sort (default (seq 0) .sect) "weight" }} + {{ $name := .name }} + {{ if reflect.IsMap .name }} + {{ $name = (index .name $site.Language.Lang) }} + {{ end }} + + +
  • + {{ $ref := default false .ref }} + {{ if $ref }} + {{ $this := $site.GetPage .ref }} + {{ $icon := default false .icon }} + {{ $numberOfPages := (add (len $this.Pages) (len $this.Sections)) }} + {{ $isCurrent := eq $current $this }} + {{ $isAncestor := $this.IsAncestor $current }} + {{ $id := substr (sha1 $this.Permalink) 0 8 }} + {{ $doCollapse := and (isset . "sub") (or $this.Params.geekdocCollapseSection (default false .Site.Params.geekdocCollapseAllSections)) }} + + {{ $anchor := default "" .anchor }} + {{ if $anchor }} + {{ $anchor = printf "#%s" $anchor }} + {{ end }} + + {{ if or .external ($this.RelPermalink) }} + + + {{ end }} + {{ else }} + {{ $name }} + {{ end }} + + {{ with .sub }} + {{ template "menu-file" dict "sect" . "current" $current "site" $site }} + {{ end }} +
  • + {{ end }} +
+{{ end }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/menu-extra.html b/docs/themes/hugo-geekdoc/layouts/partials/menu-extra.html new file mode 100644 index 000000000..a1984f8b2 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/menu-extra.html @@ -0,0 +1,46 @@ +{{ $current := .current }} +{{ template "menu-extra" dict "sect" .source "current" $current "site" $current.Site "target" .target }} + + + +{{ define "menu-extra" }} + {{ $current := .current }} + {{ $site := .site }} + {{ $target := .target }} + {{ $sect := .sect }} + + {{ range sort (default (seq 0) $sect) "weight" }} + {{ if isset . "ref" }} + {{ $this := $site.GetPage .ref }} + {{ $isCurrent := eq $current $this }} + {{ $icon := default false .icon }} + + {{ $name := .name }} + {{ if reflect.IsMap .name }} + {{ $name = (index .name $site.Language.Lang) }} + {{ end }} + + {{ if not .icon }} + {{ errorf "Missing 'icon' attribute in data file for '%s' menu item '%s'" $target $name }} + {{ end }} + + {{ if eq $target "header" }} + + + + {{ $name }} + + + + + {{ end }} + {{ end }} + {{ end }} +{{ end }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/menu-filetree.html b/docs/themes/hugo-geekdoc/layouts/partials/menu-filetree.html new file mode 100644 index 000000000..e51a5de0c --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/menu-filetree.html @@ -0,0 +1,98 @@ +{{ $current := . }} +{{ template "tree-nav" dict "sect" .Site.Home.Sections "current" $current }} + + + +{{ define "tree-nav" }} + {{ $current := .current }} + + +
    + {{ $sortBy := (default "title" .current.Site.Params.geekdocFileTreeSortBy | lower) }} + {{ range .sect.GroupBy "Weight" }} + {{ $rangeBy := .ByTitle }} + + {{ if eq $sortBy "title" }} + {{ $rangeBy = .ByTitle }} + {{ else if eq $sortBy "linktitle" }} + {{ $rangeBy = .ByLinkTitle }} + {{ else if eq $sortBy "date" }} + {{ $rangeBy = .ByDate }} + {{ else if eq $sortBy "publishdate" }} + {{ $rangeBy = .ByPublishDate }} + {{ else if eq $sortBy "expirydate" }} + {{ $rangeBy = .ByExpiryDate }} + {{ else if eq $sortBy "lastmod" }} + {{ $rangeBy = .ByLastmod }} + {{ else if eq $sortBy "title_reverse" }} + {{ $rangeBy = .ByTitle.Reverse }} + {{ else if eq $sortBy "linktitle_reverse" }} + {{ $rangeBy = .ByLinkTitle.Reverse }} + {{ else if eq $sortBy "date_reverse" }} + {{ $rangeBy = .ByDate.Reverse }} + {{ else if eq $sortBy "publishdate_reverse" }} + {{ $rangeBy = .ByPublishDate.Reverse }} + {{ else if eq $sortBy "expirydate_reverse" }} + {{ $rangeBy = .ByExpiryDate.Reverse }} + {{ else if eq $sortBy "lastmod_reverse" }} + {{ $rangeBy = .ByLastmod.Reverse }} + {{ end }} + + {{ range $rangeBy }} + {{ if not .Params.geekdocHidden }} + {{ $numberOfPages := (add (len .Pages) (len .Sections)) }} + {{ $isParent := and (ne $numberOfPages 0) (not .Params.geekdocFlatSection) }} + {{ $isCurrent := eq $current . }} + {{ $isAncestor := .IsAncestor $current }} + {{ $id := substr (sha1 .Permalink) 0 8 }} + {{ $doCollapse := and $isParent (or .Params.geekdocCollapseSection (default false .Site.Params.geekdocCollapseAllSections)) }} + + +
  • + + + + {{ if $isParent }} + {{ template "tree-nav" dict "sect" .Pages "current" $current }} + {{ end }} +
  • + {{ end }} + {{ end }} + {{ end }} +
+{{ end }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/menu-nextprev.html b/docs/themes/hugo-geekdoc/layouts/partials/menu-nextprev.html new file mode 100644 index 000000000..6126f9517 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/menu-nextprev.html @@ -0,0 +1,78 @@ +{{ $current := . }} +{{ $site := .Site }} +{{ $current.Scratch.Set "prev" false }} +{{ $current.Scratch.Set "getNext" false }} + +{{ $current.Scratch.Set "nextPage" false }} +{{ $current.Scratch.Set "prevPage" false }} + +{{ template "menu_nextprev" dict "sect" $.Site.Data.menu.main.main "current" $current "site" $site }} + +{{ define "menu_nextprev" }} + {{ $current := .current }} + {{ $site := .site }} + + {{ range sort (default (seq 0) .sect) "weight" }} + {{ $current.Scratch.Set "current" $current }} + {{ $current.Scratch.Set "site" $site }} + + {{ $ref := default false .ref }} + {{ if $ref }} + {{ $site := $current.Scratch.Get "site" }} + {{ $this := $site.GetPage .ref }} + {{ $current := $current.Scratch.Get "current" }} + + {{ if reflect.IsMap .name }} + {{ $current.Scratch.Set "refName" (index .name $site.Language.Lang) }} + {{ else }} + {{ $current.Scratch.Set "refName" .name }} + {{ end }} + {{ $name := $current.Scratch.Get "refName" }} + + {{ if $current.Scratch.Get "getNext" }} + {{ $current.Scratch.Set "nextPage" (dict "name" $name "this" $this) }} + {{ $current.Scratch.Set "getNext" false }} + {{ end }} + + {{ if eq $current $this }} + {{ $current.Scratch.Set "prevPage" ($current.Scratch.Get "prev") }} + {{ $current.Scratch.Set "getNext" true }} + {{ end }} + + {{ $current.Scratch.Set "prev" (dict "name" $name "this" $this) }} + {{ end }} + + {{ $sub := default false .sub }} + {{ if $sub }} + {{ template "menu_nextprev" dict "sect" $sub "current" ($current.Scratch.Get "current") "site" ($current.Scratch.Get "site") }} + {{ end }} + {{ end }} +{{ end }} + +{{ $showPrevNext := (and (default true .Site.Params.geekdocNextPrev) .Site.Params.geekdocMenuBundle) }} +{{ if $showPrevNext }} + + {{ with ($current.Scratch.Get "prevPage") }} + + gdoc_arrow_left_alt + {{ .name }} + + {{ end }} + + + {{ with ($current.Scratch.Get "nextPage") }} + + {{ .name }} + gdoc_arrow_right_alt + + {{ end }} + +{{ end }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/menu.html b/docs/themes/hugo-geekdoc/layouts/partials/menu.html new file mode 100644 index 000000000..7963eacdc --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/menu.html @@ -0,0 +1,44 @@ + diff --git a/docs/themes/hugo-geekdoc/layouts/partials/microformats/opengraph.html b/docs/themes/hugo-geekdoc/layouts/partials/microformats/opengraph.html new file mode 100644 index 000000000..ea34ba5be --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/microformats/opengraph.html @@ -0,0 +1,68 @@ +{{ $isPage := or (and (ne .Type "posts") (in "section page" .Kind )) (and (eq .Type "posts") (eq .Kind "page")) }} + +{{- if ne .Kind "home" }} + +{{- end }} +{{- with .Site.Title }} + +{{- end }} +{{- with partial "utils/featured" . }} + +{{- end }} +{{- with partial "utils/description" . }} + +{{- end }} + + +{{- with .Params.audio }} + +{{- end }} +{{- with .Params.locale }} + +{{- end }} +{{- with .Params.videos }} + {{- range . }} + + {{- end }} +{{- end }} + +{{- /* If it is part of a series, link to related articles */}} +{{- if .Site.Taxonomies.series }} + {{- $permalink := .Permalink -}} + {{- $siteSeries := .Site.Taxonomies.series -}} + {{- with .Params.series }} + {{- range $name := . }} + {{- $series := index $siteSeries ($name | urlize) }} + {{- range $page := first 6 $series.Pages }} + {{- if ne $page.Permalink $permalink }} + + {{- end }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} + +{{ if $isPage -}} + {{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} + + {{- with .PublishDate }} + + {{- end }} + {{- with .Lastmod }} + + {{- end }} +{{- end }} + +{{- /* Facebook Page Admin ID for Domain Insights */}} +{{- with .Site.Params.Social.facebook_admin }} + +{{- end }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/microformats/schema.html b/docs/themes/hugo-geekdoc/layouts/partials/microformats/schema.html new file mode 100644 index 000000000..e4a71eb4e --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/microformats/schema.html @@ -0,0 +1,70 @@ +{{ $isPage := or (and (ne .Type "posts") (in "section page" .Kind )) (and (eq .Type "posts") (eq .Kind "page")) }} +{{- if eq .Kind "home" }} + +{{- else if $isPage }} + +{{- end }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/microformats/twitter_cards.html b/docs/themes/hugo-geekdoc/layouts/partials/microformats/twitter_cards.html new file mode 100644 index 000000000..603e3f53f --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/microformats/twitter_cards.html @@ -0,0 +1,15 @@ +{{- with partial "utils/featured" . }} + +{{- else }} + +{{- end }} + +{{- with partial "utils/featured" . }} + +{{- end }} +{{- with partial "utils/description" . }} + +{{- end }} +{{- with .Site.Params.Social.twitter -}} + +{{- end }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/page-header.html b/docs/themes/hugo-geekdoc/layouts/partials/page-header.html new file mode 100644 index 000000000..8f146d7e9 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/page-header.html @@ -0,0 +1,57 @@ +{{ $geekdocRepo := default (default false .Site.Params.geekdocRepo) .Page.Params.geekdocRepo }} +{{ $geekdocEditPath := default (default false .Site.Params.geekdocEditPath) .Page.Params.geekdocEditPath }} +{{ if .File }} + {{ $.Scratch.Set "geekdocFilePath" (default (strings.TrimPrefix hugo.WorkingDir .File.Filename) .Page.Params.geekdocFilePath) }} +{{ else }} + {{ $.Scratch.Set "geekdocFilePath" false }} +{{ end }} + +{{ define "breadcrumb" }} + {{ $parent := .page.Parent }} + {{ if $parent }} + {{ $name := (partial "utils/title" $parent) }} + {{ $position := (sub .position 1) }} + {{ $value := (printf "
  • %s
  • /
  • %s" $parent.RelPermalink $parent.RelPermalink $name $position .value) }} + {{ template "breadcrumb" dict "page" $parent "value" $value "position" $position }} + {{ else }} + {{ .value | safeHTML }} + {{ end }} +{{ end }} + +{{ $showBreadcrumb := (and (default true .Page.Params.geekdocBreadcrumb) (default true .Site.Params.geekdocBreadcrumb)) }} +{{ $showEdit := (and ($.Scratch.Get "geekdocFilePath") $geekdocRepo $geekdocEditPath) }} +
    + {{ if $showBreadcrumb }} +
    + + +
    + {{ end }} + {{ if $showEdit }} + + {{ end }} +
    diff --git a/docs/themes/hugo-geekdoc/layouts/partials/pagination.html b/docs/themes/hugo-geekdoc/layouts/partials/pagination.html new file mode 100644 index 000000000..aa615d8ad --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/pagination.html @@ -0,0 +1,22 @@ +{{ $pag := $.Paginator }} + + + diff --git a/docs/themes/hugo-geekdoc/layouts/partials/posts/metadata.html b/docs/themes/hugo-geekdoc/layouts/partials/posts/metadata.html new file mode 100644 index 000000000..bf9d84527 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/posts/metadata.html @@ -0,0 +1,48 @@ + + + + + + + + + + +{{ $tc := 0 }} +{{ with .Params.tags }} + {{ range sort . }} + {{ $name := . }} + {{ with $.Site.GetPage (printf "/tags/%s" $name | urlize) }} + {{ if eq $tc 0 }} + + + {{ template "post-tag" dict "name" $name "page" . }} + + {{ else }} + + {{ template "post-tag" dict "name" $name "page" . }} + + {{ end }} + {{ end }} + {{ $tc = (add $tc 1) }} + {{ end }} +{{ end }} + +{{ define "post-tag" }} + +{{ end }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/search.html b/docs/themes/hugo-geekdoc/layouts/partials/search.html new file mode 100644 index 000000000..62b2e6fb9 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/search.html @@ -0,0 +1,16 @@ +{{ if default true .Site.Params.geekdocSearch }} + +{{ end }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/site-footer.html b/docs/themes/hugo-geekdoc/layouts/partials/site-footer.html new file mode 100644 index 000000000..31ae8e1be --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/site-footer.html @@ -0,0 +1,45 @@ + diff --git a/docs/themes/hugo-geekdoc/layouts/partials/site-header.html b/docs/themes/hugo-geekdoc/layouts/partials/site-header.html new file mode 100644 index 000000000..022c10a0a --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/site-header.html @@ -0,0 +1,78 @@ +
    +
    + {{ if .MenuEnabled }} + + {{ end }} + +
    + + {{ if .Root.Site.Data.menu.extra.header }} + {{ partial "menu-extra" (dict "current" .Root "source" .Root.Site.Data.menu.extra.header "target" "header") }} + {{ end }} + + + + + {{ i18n "button_toggle_dark" }} + + + + {{ i18n "button_toggle_dark" }} + + + + {{ i18n "button_toggle_dark" }} + + + + + + + + {{ i18n "button_homepage" }} + + + + + + {{ partial "language" .Root }} + + + + + + + +
    +
    +
    diff --git a/docs/themes/hugo-geekdoc/layouts/partials/svg-icon-symbols.html b/docs/themes/hugo-geekdoc/layouts/partials/svg-icon-symbols.html new file mode 100644 index 000000000..801bee81a --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/svg-icon-symbols.html @@ -0,0 +1,4 @@ +{{ range resources.Match "sprites/*.svg" }} + {{ printf "" . | safeHTML }} + {{ .Content | safeHTML }} +{{ end }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/utils/content.html b/docs/themes/hugo-geekdoc/layouts/partials/utils/content.html new file mode 100644 index 000000000..c2085a903 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/utils/content.html @@ -0,0 +1,6 @@ +{{ $content := .Content }} + +{{ $content = $content | replaceRE `` `` | safeHTML }} +{{ $content = $content | replaceRE `((?:.|\n)+?
    )` `
    ${1}
    ` | safeHTML }} + +{{ return $content }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/utils/description.html b/docs/themes/hugo-geekdoc/layouts/partials/utils/description.html new file mode 100644 index 000000000..f5eafb2df --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/utils/description.html @@ -0,0 +1,14 @@ +{{ $isPage := or (and (ne .Type "posts") (in "section page" .Kind )) (and (eq .Type "posts") (eq .Kind "page")) }} +{{ $description := "" }} + +{{ if .Description }} + {{ $description = .Description }} +{{ else }} + {{ if $isPage }} + {{ $description = .Summary }} + {{ else if .Site.Params.description }} + {{ $description = .Site.Params.description }} + {{ end }} +{{ end }} + +{{ return $description }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/utils/featured.html b/docs/themes/hugo-geekdoc/layouts/partials/utils/featured.html new file mode 100644 index 000000000..33c4be812 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/utils/featured.html @@ -0,0 +1,12 @@ +{{ $img := "" }} + +{{ with $source := ($.Resources.ByType "image").GetMatch "{*feature*,*cover*,*thumbnail*}" }} + {{ $featured := .Fill (printf "1200x630 %s" (default "Smart" .Params.anchor)) }} + {{ $img = $featured.Permalink }} +{{ else }} + {{ with default $.Site.Params.images $.Params.images }} + {{ $img = index . 0 | absURL }} + {{ end }} +{{ end }} + +{{ return $img }} diff --git a/docs/themes/hugo-geekdoc/layouts/partials/utils/title.html b/docs/themes/hugo-geekdoc/layouts/partials/utils/title.html new file mode 100644 index 000000000..a792c0486 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/partials/utils/title.html @@ -0,0 +1,11 @@ +{{ $title := "" }} + +{{ if .Title }} + {{ $title = .Title }} +{{ else if and .IsSection .File }} + {{ $title = path.Base .File.Dir | humanize | title }} +{{ else if and .IsPage .File }} + {{ $title = .File.BaseFileName | humanize | title }} +{{ end }} + +{{ return $title }} diff --git a/docs/themes/hugo-geekdoc/layouts/posts/list.html b/docs/themes/hugo-geekdoc/layouts/posts/list.html new file mode 100644 index 000000000..ca0ea73a4 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/posts/list.html @@ -0,0 +1,47 @@ +{{ define "main" }} + {{ range .Paginator.Pages }} + + {{ end }} + {{ partial "pagination.html" . }} +{{ end }} + +{{ define "post-tag" }} + +{{ end }} diff --git a/docs/themes/hugo-geekdoc/layouts/posts/single.html b/docs/themes/hugo-geekdoc/layouts/posts/single.html new file mode 100644 index 000000000..dea2a8c13 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/posts/single.html @@ -0,0 +1,13 @@ +{{ define "main" }} +
    +
    +

    {{ partial "utils/title" . }}

    + +
    +
    + {{ partial "utils/content" . }} +
    +
    +{{ end }} diff --git a/docs/themes/hugo-geekdoc/layouts/robots.txt b/docs/themes/hugo-geekdoc/layouts/robots.txt new file mode 100644 index 000000000..fb3345bb6 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Disallow: /tags/* + +Sitemap: {{ "sitemap.xml" | absURL }} diff --git a/docs/themes/hugo-geekdoc/layouts/shortcodes/button.html b/docs/themes/hugo-geekdoc/layouts/shortcodes/button.html new file mode 100644 index 000000000..7c000a323 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/shortcodes/button.html @@ -0,0 +1,29 @@ +{{- $ref := "" }} +{{- $class := "" }} +{{- $size := default "regular" (.Get "size" | lower) }} + +{{- if not (in (slice "regular" "large") $size) }} + {{- $size = "regular" }} +{{- end }} + +{{- with .Get "href" }} + {{- $ref = . }} +{{- end }} + +{{- with .Get "relref" }} + {{- $ref = relref $ . }} +{{- end }} + +{{- with .Get "class" }} + {{- $class = . }} +{{- end }} + + + + + {{ $.Inner }} + + diff --git a/docs/themes/hugo-geekdoc/layouts/shortcodes/columns.html b/docs/themes/hugo-geekdoc/layouts/shortcodes/columns.html new file mode 100644 index 000000000..a359e4146 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/shortcodes/columns.html @@ -0,0 +1,14 @@ +{{- $size := default "regular" (.Get "size" | lower) }} + +{{- if not (in (slice "regular" "large" "small") $size) }} + {{- $size = "regular" }} +{{- end }} + + +
    + {{- range split .Inner "<--->" }} +
    + {{ . | $.Page.RenderString -}} +
    + {{- end }} +
    diff --git a/docs/themes/hugo-geekdoc/layouts/shortcodes/expand.html b/docs/themes/hugo-geekdoc/layouts/shortcodes/expand.html new file mode 100644 index 000000000..0ab3d2a3c --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/shortcodes/expand.html @@ -0,0 +1,11 @@ +{{ $id := substr (sha1 .Inner) 0 8 }} +
    + + +
    + {{ .Inner | $.Page.RenderString }} +
    +
    diff --git a/docs/themes/hugo-geekdoc/layouts/shortcodes/hint.html b/docs/themes/hugo-geekdoc/layouts/shortcodes/hint.html new file mode 100644 index 000000000..15149b6f0 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/shortcodes/hint.html @@ -0,0 +1,16 @@ +{{ $type := default "note" (.Get "type") }} +{{ $icon := .Get "icon" }} +{{ $title := default ($type | title) (.Get "title") }} + + +
    +
    + {{- with $icon -}} + + {{ $title }} + {{- else -}} + + {{- end -}} +
    +
    {{ .Inner | $.Page.RenderString }}
    +
    diff --git a/docs/themes/hugo-geekdoc/layouts/shortcodes/icon.html b/docs/themes/hugo-geekdoc/layouts/shortcodes/icon.html new file mode 100644 index 000000000..080b144a2 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/shortcodes/icon.html @@ -0,0 +1,5 @@ +{{ $id := .Get 0 }} + +{{- with $id -}} + +{{- end -}} diff --git a/docs/themes/hugo-geekdoc/layouts/shortcodes/img.html b/docs/themes/hugo-geekdoc/layouts/shortcodes/img.html new file mode 100644 index 000000000..70f38c3f6 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/shortcodes/img.html @@ -0,0 +1,71 @@ +{{- $source := ($.Page.Resources.ByType "image").GetMatch (printf "%s" (.Get "name")) }} +{{- $customAlt := .Get "alt" }} +{{- $customSize := .Get "size" | lower }} +{{- $lazyLoad := default (default true $.Site.Params.geekdocImageLazyLoading) (.Get "lazy") }} +{{- $data := newScratch }} + +{{- with $source }} + {{- $caption := default .Title $customAlt }} + {{- $isSVG := (eq .MediaType.SubType "svg") }} + + {{- $origin := .Permalink }} + {{- if $isSVG }} + {{- $data.SetInMap "size" "profile" "180" }} + {{- $data.SetInMap "size" "tiny" "320" }} + {{- $data.SetInMap "size" "small" "600" }} + {{- $data.SetInMap "size" "medium" "1200" }} + {{- $data.SetInMap "size" "large" "1800" }} + {{- else }} + {{- $data.SetInMap "size" "profile" (.Fill "180x180 Center").Permalink }} + {{- $data.SetInMap "size" "tiny" (.Resize "320x").Permalink }} + {{- $data.SetInMap "size" "small" (.Resize "600x").Permalink }} + {{- $data.SetInMap "size" "medium" (.Resize "1200x").Permalink }} + {{- $data.SetInMap "size" "large" (.Resize "1800x").Permalink }} + {{- end }} + + +
    +
    + + + {{- $size := $data.Get "size" }} + {{- if not $isSVG }} + + {{- end }} + {{ $caption }} + + + {{- if not (eq $customSize "profile") }} + {{- with $caption }} +
    + {{ . }} + {{- with $source.Params.credits }} + {{ printf " (%s)" . | $.Page.RenderString }} + {{- end }} +
    + {{- end }} + {{- end }} +
    +
    +{{- end }} diff --git a/docs/themes/hugo-geekdoc/layouts/shortcodes/include.html b/docs/themes/hugo-geekdoc/layouts/shortcodes/include.html new file mode 100644 index 000000000..4c395b3e9 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/shortcodes/include.html @@ -0,0 +1,18 @@ +{{ $file := .Get "file" }} +{{ $page := .Site.GetPage $file }} +{{ $type := .Get "type" }} +{{ $language := .Get "language" }} +{{ $options :=.Get "options" }} + + +
    + {{- if (.Get "language") -}} + {{- highlight ($file | readFile) $language (default "linenos=table" $options) -}} + {{- else if eq $type "html" -}} + {{- $file | readFile | safeHTML -}} + {{- else if eq $type "page" -}} + {{- with $page }}{{ .Content }}{{ end -}} + {{- else -}} + {{- $file | readFile | $.Page.RenderString -}} + {{- end -}} +
    diff --git a/docs/themes/hugo-geekdoc/layouts/shortcodes/katex.html b/docs/themes/hugo-geekdoc/layouts/shortcodes/katex.html new file mode 100644 index 000000000..559acb687 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/shortcodes/katex.html @@ -0,0 +1,18 @@ + +{{ if not (.Page.Scratch.Get "katex") }} + + + + {{ .Page.Scratch.Set "katex" true }} +{{ end }} + + + + {{ cond (in .Params "display") "\\[" "\\(" -}} + {{- trim .Inner "\n" -}} + {{- cond (in .Params "display") "\\]" "\\)" -}} + +{{- /* Drop trailing newlines */ -}} diff --git a/docs/themes/hugo-geekdoc/layouts/shortcodes/mermaid.html b/docs/themes/hugo-geekdoc/layouts/shortcodes/mermaid.html new file mode 100644 index 000000000..71330163c --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/shortcodes/mermaid.html @@ -0,0 +1,11 @@ + +{{ if not (.Page.Scratch.Get "mermaid") }} + + + {{ .Page.Scratch.Set "mermaid" true }} +{{ end }} + + +
    +  {{- .Inner -}}
    +
    diff --git a/docs/themes/hugo-geekdoc/layouts/shortcodes/progress.html b/docs/themes/hugo-geekdoc/layouts/shortcodes/progress.html new file mode 100644 index 000000000..244f92e91 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/shortcodes/progress.html @@ -0,0 +1,23 @@ +{{- $value := default 0 (.Get "value") -}} +{{- $title := .Get "title" -}} +{{- $icon := .Get "icon" -}} + + +
    +
    +
    + {{ with $icon -}} + + {{- end }} + {{ with $title }}{{ . }}{{ end }} +
    +
    {{ $value }}%
    +
    +
    +
    +
    +
    diff --git a/docs/themes/hugo-geekdoc/layouts/shortcodes/propertylist.html b/docs/themes/hugo-geekdoc/layouts/shortcodes/propertylist.html new file mode 100644 index 000000000..ec62a48e1 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/shortcodes/propertylist.html @@ -0,0 +1,60 @@ +{{- $name := .Get "name" -}} +{{- $sort := .Get "sort" -}} +{{- $order := default "asc" (.Get "order") -}} +{{- $showAnchor := (and (default true .Page.Params.geekdocAnchor) (default true .Page.Site.Params.geekdocAnchor)) -}} + +{{- if .Site.Data.properties }} +
    + {{- with (index .Site.Data.properties (split $name ".")) }} + {{- $properties := .properties }} + {{- with $sort }} + {{- $properties = (sort $properties . $order) }} + {{- end }} + {{- range $properties }} +
    + {{ .name }} + {{- if .required }} + {{ i18n "propertylist_required" | lower }} + {{- else }} + {{ i18n "propertylist_optional" | lower }} + {{- end }} + {{- with .type }} + {{ . }} + {{- end }} + + {{- with .tags }} + {{- $tags := . }} + {{- if reflect.IsMap $tags }} + {{- $tags = (index $tags $.Site.Language.Lang) }} + {{- end }} + {{- range $tags }} + {{ . }} + {{- end }} + {{- end }} + {{- if $showAnchor }} + + + + {{- end }} +
    +
    +
    + {{- with .description }} + {{- $desc := . }} + {{- if reflect.IsMap $desc }} + {{- $desc = (index $desc $.Site.Language.Lang) }} + {{- end }} + {{ $desc | $.Page.RenderString }} + {{- end }} +
    +
    + {{- with default "none" (.defaultValue | string) }} + {{ i18n "propertylist_default" | title }}: + {{ . }} + {{- end }} +
    +
    + {{- end }} + {{- end }} +
    +{{- end }} diff --git a/docs/themes/hugo-geekdoc/layouts/shortcodes/tab.html b/docs/themes/hugo-geekdoc/layouts/shortcodes/tab.html new file mode 100644 index 000000000..90b27274d --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/shortcodes/tab.html @@ -0,0 +1,12 @@ +{{- if .Parent }} + {{- $name := .Get 0 }} + {{- $group := printf "tabs-%s" (.Parent.Get 0) }} + + {{- if not (.Parent.Scratch.Get $group) }} + {{- .Parent.Scratch.Set $group slice }} + {{- end }} + + {{- .Parent.Scratch.Add $group (dict "Name" $name "Content" .Inner) }} +{{- else }} + {{ errorf "%q: 'tab' shortcode must be inside 'tabs' shortcode" .Page.Path }} +{{- end }} diff --git a/docs/themes/hugo-geekdoc/layouts/shortcodes/tabs.html b/docs/themes/hugo-geekdoc/layouts/shortcodes/tabs.html new file mode 100644 index 000000000..7d8671ec4 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/shortcodes/tabs.html @@ -0,0 +1,22 @@ +{{- if .Inner }}{{ end }} +{{- $id := .Get 0 }} +{{- $group := printf "tabs-%s" $id }} + + +
    + {{- range $index, $tab := .Scratch.Get $group }} + + +
    + {{ .Content | $.Page.RenderString }} +
    + {{- end }} +
    diff --git a/docs/themes/hugo-geekdoc/layouts/shortcodes/toc-tree.html b/docs/themes/hugo-geekdoc/layouts/shortcodes/toc-tree.html new file mode 100644 index 000000000..13148ba17 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/shortcodes/toc-tree.html @@ -0,0 +1,41 @@ +{{- $tocLevels := default (default 6 .Site.Params.geekdocToC) .Page.Params.geekdocToC }} + +{{- if $tocLevels }} +
    + {{ template "toc-tree" dict "sect" .Page.Pages }} +
    +{{- end }} + + + +{{- define "toc-tree" }} +
      + {{- range .sect.GroupBy "Weight" }} + {{- range .ByTitle }} + {{- if or (not .Params.geekdocHidden) (not (default true .Params.geekdocHiddenTocTree)) }} +
    • + {{- if or .Content .Params.geekdocFlatSection }} + + + {{- partial "utils/title" . }}{{ with .Params.geekdocDescription }}:{{ end }} + + {{- with .Params.geekdocDescription }}{{ . }}{{ end }} + + {{- else -}} + + {{- partial "utils/title" . }}{{ with .Params.geekdocDescription }} + : {{ . }} + {{ end }} + + {{- end -}} + + {{- $numberOfPages := (add (len .Pages) (len .Sections)) }} + {{- if and (ne $numberOfPages 0) (not .Params.geekdocFlatSection) }} + {{- template "toc-tree" dict "sect" .Pages }} + {{- end }} +
    • + {{- end }} + {{- end }} + {{- end }} +
    +{{- end }} diff --git a/docs/themes/hugo-geekdoc/layouts/shortcodes/toc.html b/docs/themes/hugo-geekdoc/layouts/shortcodes/toc.html new file mode 100644 index 000000000..5d875eee2 --- /dev/null +++ b/docs/themes/hugo-geekdoc/layouts/shortcodes/toc.html @@ -0,0 +1,13 @@ +{{- $format := default "html" (.Get "format") }} +{{- $tocLevels := default (default 6 .Site.Params.geekdocToC) .Page.Params.geekdocToC }} + +{{- if and $tocLevels .Page.TableOfContents -}} + {{- if not (eq ($format | lower) "raw") -}} +
    + {{ .Page.TableOfContents }} +
    +
    + {{- else -}} + {{ .Page.TableOfContents }} + {{- end -}} +{{- end -}} diff --git a/docs/themes/hugo-geekdoc/static/brand.svg b/docs/themes/hugo-geekdoc/static/brand.svg new file mode 100644 index 000000000..3a09f01db --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/brand.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/themes/hugo-geekdoc/static/custom.css b/docs/themes/hugo-geekdoc/static/custom.css new file mode 100644 index 000000000..e488c91ae --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/custom.css @@ -0,0 +1 @@ +/* You can add custom styles here. */ diff --git a/docs/themes/hugo-geekdoc/static/favicon/android-chrome-144x144.png b/docs/themes/hugo-geekdoc/static/favicon/android-chrome-144x144.png new file mode 100644 index 000000000..d5e648100 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/android-chrome-144x144.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/android-chrome-192x192.png b/docs/themes/hugo-geekdoc/static/favicon/android-chrome-192x192.png new file mode 100644 index 000000000..b96ba6eaf Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/android-chrome-192x192.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/android-chrome-256x256.png b/docs/themes/hugo-geekdoc/static/favicon/android-chrome-256x256.png new file mode 100644 index 000000000..8243b3752 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/android-chrome-256x256.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/android-chrome-36x36.png b/docs/themes/hugo-geekdoc/static/favicon/android-chrome-36x36.png new file mode 100644 index 000000000..5624fe0c5 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/android-chrome-36x36.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/android-chrome-384x384.png b/docs/themes/hugo-geekdoc/static/favicon/android-chrome-384x384.png new file mode 100644 index 000000000..e9c6a30f7 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/android-chrome-384x384.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/android-chrome-48x48.png b/docs/themes/hugo-geekdoc/static/favicon/android-chrome-48x48.png new file mode 100644 index 000000000..9b9baf2b7 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/android-chrome-48x48.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/android-chrome-512x512.png b/docs/themes/hugo-geekdoc/static/favicon/android-chrome-512x512.png new file mode 100644 index 000000000..847c31465 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/android-chrome-512x512.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/android-chrome-72x72.png b/docs/themes/hugo-geekdoc/static/favicon/android-chrome-72x72.png new file mode 100644 index 000000000..592f66fb1 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/android-chrome-72x72.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/android-chrome-96x96.png b/docs/themes/hugo-geekdoc/static/favicon/android-chrome-96x96.png new file mode 100644 index 000000000..12c9988c1 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/android-chrome-96x96.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-1024x1024.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-1024x1024.png new file mode 100644 index 000000000..ba47abecd Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-1024x1024.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-114x114.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-114x114.png new file mode 100644 index 000000000..bdab2978a Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-114x114.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-120x120.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-120x120.png new file mode 100644 index 000000000..3dd618d17 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-120x120.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-144x144.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-144x144.png new file mode 100644 index 000000000..feffad84d Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-144x144.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-152x152.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-152x152.png new file mode 100644 index 000000000..11645c34e Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-152x152.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-167x167.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-167x167.png new file mode 100644 index 000000000..c36a56c93 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-167x167.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-180x180.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-180x180.png new file mode 100644 index 000000000..d34586ff7 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-180x180.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-57x57.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-57x57.png new file mode 100644 index 000000000..eda66bd3d Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-57x57.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-60x60.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-60x60.png new file mode 100644 index 000000000..7de4a0106 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-60x60.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-72x72.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-72x72.png new file mode 100644 index 000000000..b4abb3777 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-72x72.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-76x76.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-76x76.png new file mode 100644 index 000000000..c93d59bb4 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-76x76.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-precomposed.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-precomposed.png new file mode 100644 index 000000000..d34586ff7 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-precomposed.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon.png new file mode 100644 index 000000000..d34586ff7 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1125x2436.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1125x2436.png new file mode 100644 index 000000000..642d0254e Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1125x2436.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1136x640.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1136x640.png new file mode 100644 index 000000000..103e015bf Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1136x640.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1170x2532.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1170x2532.png new file mode 100644 index 000000000..b01493ba7 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1170x2532.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1242x2208.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1242x2208.png new file mode 100644 index 000000000..8defb8724 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1242x2208.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1242x2688.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1242x2688.png new file mode 100644 index 000000000..4f750f5f5 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1242x2688.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1284x2778.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1284x2778.png new file mode 100644 index 000000000..10e452f54 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1284x2778.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1334x750.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1334x750.png new file mode 100644 index 000000000..c6eefd607 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1334x750.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1536x2048.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1536x2048.png new file mode 100644 index 000000000..5e9b9cb6b Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1536x2048.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1620x2160.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1620x2160.png new file mode 100644 index 000000000..c8647135f Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1620x2160.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1668x2224.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1668x2224.png new file mode 100644 index 000000000..a2780d7a9 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1668x2224.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1668x2388.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1668x2388.png new file mode 100644 index 000000000..bb39a1cfd Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1668x2388.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1792x828.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1792x828.png new file mode 100644 index 000000000..dd39a3ff2 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1792x828.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2048x1536.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2048x1536.png new file mode 100644 index 000000000..6210c8697 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2048x1536.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2048x2732.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2048x2732.png new file mode 100644 index 000000000..31e636c8e Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2048x2732.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2160x1620.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2160x1620.png new file mode 100644 index 000000000..df73af011 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2160x1620.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2208x1242.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2208x1242.png new file mode 100644 index 000000000..a0b001d40 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2208x1242.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2224x1668.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2224x1668.png new file mode 100644 index 000000000..a8cb52a7a Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2224x1668.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2388x1668.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2388x1668.png new file mode 100644 index 000000000..15fa83341 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2388x1668.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2436x1125.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2436x1125.png new file mode 100644 index 000000000..4e43260f1 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2436x1125.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2532x1170.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2532x1170.png new file mode 100644 index 000000000..21974e888 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2532x1170.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2688x1242.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2688x1242.png new file mode 100644 index 000000000..a4360a412 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2688x1242.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2732x2048.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2732x2048.png new file mode 100644 index 000000000..8f31a8595 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2732x2048.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2778x1284.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2778x1284.png new file mode 100644 index 000000000..5ec7c9438 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2778x1284.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-640x1136.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-640x1136.png new file mode 100644 index 000000000..0da1acff0 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-640x1136.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-750x1334.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-750x1334.png new file mode 100644 index 000000000..720a857ad Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-750x1334.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-828x1792.png b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-828x1792.png new file mode 100644 index 000000000..311af2229 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-828x1792.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/browserconfig.xml b/docs/themes/hugo-geekdoc/static/favicon/browserconfig.xml new file mode 100644 index 000000000..3bdb582ca --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/favicon/browserconfig.xml @@ -0,0 +1,12 @@ + + + + + + + + + #efefef + + + \ No newline at end of file diff --git a/docs/themes/hugo-geekdoc/static/favicon/favicon-16x16.png b/docs/themes/hugo-geekdoc/static/favicon/favicon-16x16.png new file mode 100644 index 000000000..fcd6f540d Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/favicon-16x16.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/favicon-32x32.png b/docs/themes/hugo-geekdoc/static/favicon/favicon-32x32.png new file mode 100644 index 000000000..afedef109 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/favicon-32x32.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/favicon-48x48.png b/docs/themes/hugo-geekdoc/static/favicon/favicon-48x48.png new file mode 100644 index 000000000..f3b0f45b9 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/favicon-48x48.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/favicon.ico b/docs/themes/hugo-geekdoc/static/favicon/favicon.ico new file mode 100644 index 000000000..e4cfde191 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/favicon.ico differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/favicon.svg b/docs/themes/hugo-geekdoc/static/favicon/favicon.svg new file mode 100644 index 000000000..8d899c57e --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/favicon/favicon.svg @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/themes/hugo-geekdoc/static/favicon/manifest.json b/docs/themes/hugo-geekdoc/static/favicon/manifest.json new file mode 100644 index 000000000..7f71aa2de --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/favicon/manifest.json @@ -0,0 +1,69 @@ +{ + "name": null, + "short_name": null, + "description": null, + "dir": "auto", + "lang": "en-US", + "display": "standalone", + "orientation": "any", + "scope": "", + "start_url": "/?homescreen=1", + "background_color": "#efefef", + "theme_color": "#efefef", + "icons": [ + { + "src": "/favicon/android-chrome-36x36.png", + "sizes": "36x36", + "type": "image/png", + "purpose": "any" + }, + { + "src": "/favicon/android-chrome-48x48.png", + "sizes": "48x48", + "type": "image/png", + "purpose": "any" + }, + { + "src": "/favicon/android-chrome-72x72.png", + "sizes": "72x72", + "type": "image/png", + "purpose": "any" + }, + { + "src": "/favicon/android-chrome-96x96.png", + "sizes": "96x96", + "type": "image/png", + "purpose": "any" + }, + { + "src": "/favicon/android-chrome-144x144.png", + "sizes": "144x144", + "type": "image/png", + "purpose": "any" + }, + { + "src": "/favicon/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "any" + }, + { + "src": "/favicon/android-chrome-256x256.png", + "sizes": "256x256", + "type": "image/png", + "purpose": "any" + }, + { + "src": "/favicon/android-chrome-384x384.png", + "sizes": "384x384", + "type": "image/png", + "purpose": "any" + }, + { + "src": "/favicon/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "any" + } + ] +} diff --git a/docs/themes/hugo-geekdoc/static/favicon/mstile-144x144.png b/docs/themes/hugo-geekdoc/static/favicon/mstile-144x144.png new file mode 100644 index 000000000..d5e648100 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/mstile-144x144.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/mstile-150x150.png b/docs/themes/hugo-geekdoc/static/favicon/mstile-150x150.png new file mode 100644 index 000000000..8a50201da Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/mstile-150x150.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/mstile-310x150.png b/docs/themes/hugo-geekdoc/static/favicon/mstile-310x150.png new file mode 100644 index 000000000..e0f80ff08 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/mstile-310x150.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/mstile-310x310.png b/docs/themes/hugo-geekdoc/static/favicon/mstile-310x310.png new file mode 100644 index 000000000..26074c154 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/mstile-310x310.png differ diff --git a/docs/themes/hugo-geekdoc/static/favicon/mstile-70x70.png b/docs/themes/hugo-geekdoc/static/favicon/mstile-70x70.png new file mode 100644 index 000000000..d5d47bda9 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/favicon/mstile-70x70.png differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/GeekdocIcons.woff b/docs/themes/hugo-geekdoc/static/fonts/GeekdocIcons.woff new file mode 100644 index 000000000..5e4a90b3b Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/GeekdocIcons.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/GeekdocIcons.woff2 b/docs/themes/hugo-geekdoc/static/fonts/GeekdocIcons.woff2 new file mode 100644 index 000000000..e8a885e10 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/GeekdocIcons.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_AMS-Regular.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_AMS-Regular.woff new file mode 100644 index 000000000..b804d7b33 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_AMS-Regular.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_AMS-Regular.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_AMS-Regular.woff2 new file mode 100644 index 000000000..0acaaff03 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_AMS-Regular.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Bold.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Bold.woff new file mode 100644 index 000000000..9759710d1 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Bold.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Bold.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Bold.woff2 new file mode 100644 index 000000000..f390922ec Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Bold.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Regular.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Regular.woff new file mode 100644 index 000000000..9bdd534fd Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Regular.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Regular.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Regular.woff2 new file mode 100644 index 000000000..75344a1f9 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Regular.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Bold.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Bold.woff new file mode 100644 index 000000000..e7730f662 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Bold.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Bold.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Bold.woff2 new file mode 100644 index 000000000..395f28bea Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Bold.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Regular.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Regular.woff new file mode 100644 index 000000000..acab069f9 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Regular.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Regular.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Regular.woff2 new file mode 100644 index 000000000..735f6948d Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Regular.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Bold.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Bold.woff new file mode 100644 index 000000000..f38136ac1 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Bold.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Bold.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Bold.woff2 new file mode 100644 index 000000000..ab2ad21da Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Bold.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-BoldItalic.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-BoldItalic.woff new file mode 100644 index 000000000..67807b0bd Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-BoldItalic.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-BoldItalic.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-BoldItalic.woff2 new file mode 100644 index 000000000..5931794de Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-BoldItalic.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Italic.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Italic.woff new file mode 100644 index 000000000..6f43b594b Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Italic.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Italic.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Italic.woff2 new file mode 100644 index 000000000..b50920e13 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Italic.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Regular.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Regular.woff new file mode 100644 index 000000000..21f581296 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Regular.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Regular.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Regular.woff2 new file mode 100644 index 000000000..eb24a7ba2 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Regular.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-BoldItalic.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-BoldItalic.woff new file mode 100644 index 000000000..0ae390d74 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-BoldItalic.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-BoldItalic.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-BoldItalic.woff2 new file mode 100644 index 000000000..29657023a Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-BoldItalic.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-Italic.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-Italic.woff new file mode 100644 index 000000000..eb5159d4c Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-Italic.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-Italic.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-Italic.woff2 new file mode 100644 index 000000000..215c143fd Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-Italic.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Bold.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Bold.woff new file mode 100644 index 000000000..8d47c02d9 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Bold.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Bold.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Bold.woff2 new file mode 100644 index 000000000..cfaa3bda5 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Bold.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Italic.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Italic.woff new file mode 100644 index 000000000..7e02df963 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Italic.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Italic.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Italic.woff2 new file mode 100644 index 000000000..349c06dc6 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Italic.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Regular.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Regular.woff new file mode 100644 index 000000000..31b84829b Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Regular.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Regular.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Regular.woff2 new file mode 100644 index 000000000..a90eea85f Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Regular.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Script-Regular.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Script-Regular.woff new file mode 100644 index 000000000..0e7da821e Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Script-Regular.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Script-Regular.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Script-Regular.woff2 new file mode 100644 index 000000000..b3048fc11 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Script-Regular.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size1-Regular.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size1-Regular.woff new file mode 100644 index 000000000..7f292d911 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size1-Regular.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size1-Regular.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size1-Regular.woff2 new file mode 100644 index 000000000..c5a8462fb Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size1-Regular.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size2-Regular.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size2-Regular.woff new file mode 100644 index 000000000..d241d9be2 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size2-Regular.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size2-Regular.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size2-Regular.woff2 new file mode 100644 index 000000000..e1bccfe24 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size2-Regular.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size3-Regular.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size3-Regular.woff new file mode 100644 index 000000000..e6e9b658d Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size3-Regular.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size3-Regular.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size3-Regular.woff2 new file mode 100644 index 000000000..249a28662 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size3-Regular.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size4-Regular.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size4-Regular.woff new file mode 100644 index 000000000..e1ec54576 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size4-Regular.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size4-Regular.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size4-Regular.woff2 new file mode 100644 index 000000000..680c13085 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size4-Regular.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Typewriter-Regular.woff b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Typewriter-Regular.woff new file mode 100644 index 000000000..2432419f2 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Typewriter-Regular.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Typewriter-Regular.woff2 b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Typewriter-Regular.woff2 new file mode 100644 index 000000000..771f1af70 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Typewriter-Regular.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/LiberationMono.woff b/docs/themes/hugo-geekdoc/static/fonts/LiberationMono.woff new file mode 100644 index 000000000..05f5bd236 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/LiberationMono.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/LiberationMono.woff2 b/docs/themes/hugo-geekdoc/static/fonts/LiberationMono.woff2 new file mode 100644 index 000000000..3f4bb0637 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/LiberationMono.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Bold.woff b/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Bold.woff new file mode 100644 index 000000000..145ed9f7b Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Bold.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Bold.woff2 b/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Bold.woff2 new file mode 100644 index 000000000..b16596740 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Bold.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-BoldItalic.woff b/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-BoldItalic.woff new file mode 100644 index 000000000..aa4c0c1f5 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-BoldItalic.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-BoldItalic.woff2 b/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-BoldItalic.woff2 new file mode 100644 index 000000000..081c4d61d Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-BoldItalic.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Italic.woff b/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Italic.woff new file mode 100644 index 000000000..ebe952e46 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Italic.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Italic.woff2 b/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Italic.woff2 new file mode 100644 index 000000000..86f6521c0 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Italic.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/LiberationSans.woff b/docs/themes/hugo-geekdoc/static/fonts/LiberationSans.woff new file mode 100644 index 000000000..bb582d51f Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/LiberationSans.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/LiberationSans.woff2 b/docs/themes/hugo-geekdoc/static/fonts/LiberationSans.woff2 new file mode 100644 index 000000000..796cb17b5 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/LiberationSans.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/Metropolis.woff b/docs/themes/hugo-geekdoc/static/fonts/Metropolis.woff new file mode 100644 index 000000000..6b1342c2f Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/Metropolis.woff differ diff --git a/docs/themes/hugo-geekdoc/static/fonts/Metropolis.woff2 b/docs/themes/hugo-geekdoc/static/fonts/Metropolis.woff2 new file mode 100644 index 000000000..d79d50a77 Binary files /dev/null and b/docs/themes/hugo-geekdoc/static/fonts/Metropolis.woff2 differ diff --git a/docs/themes/hugo-geekdoc/static/img/geekdoc-stack.svg b/docs/themes/hugo-geekdoc/static/img/geekdoc-stack.svg new file mode 100644 index 000000000..64aebb70c --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/img/geekdoc-stack.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/themes/hugo-geekdoc/static/js/116-341f79d9.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/116-341f79d9.chunk.min.js new file mode 100644 index 000000000..83829c8fa --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/116-341f79d9.chunk.min.js @@ -0,0 +1,10870 @@ +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [116], + { + 2116: function (e, t, r) { + var n; + "undefined" != typeof self && self, + (n = function (e) { + return (function () { + "use strict"; + var t = { + 771: function (t) { + t.exports = e; + }, + }, + r = {}; + function n(e) { + var a = r[e]; + if (void 0 !== a) return a.exports; + var i = (r[e] = { exports: {} }); + return t[e](i, i.exports, n), i.exports; + } + (n.n = function (e) { + var t = + e && e.__esModule + ? function () { + return e.default; + } + : function () { + return e; + }; + return n.d(t, { a: t }), t; + }), + (n.d = function (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.o = function (e, t) { + return Object.prototype.hasOwnProperty.call(e, t); + }); + var a = {}; + return ( + (function () { + n.d(a, { + default: function () { + return l; + }, + }); + var e = n(771), + t = n.n(e), + r = function (e, t, r) { + for (var n = r, a = 0, i = e.length; n < t.length; ) { + var o = t[n]; + if (a <= 0 && t.slice(n, n + i) === e) return n; + "\\" === o ? n++ : "{" === o ? a++ : "}" === o && a--, n++; + } + return -1; + }, + i = /^\\begin{/, + o = function (e, n) { + var a = (function (e, t) { + for ( + var n, + a = [], + o = new RegExp( + "(" + + t + .map(function (e) { + return e.left.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"); + }) + .join("|") + + ")", + ); + -1 !== (n = e.search(o)); + + ) { + n > 0 && (a.push({ type: "text", data: e.slice(0, n) }), (e = e.slice(n))); + var s = t.findIndex(function (t) { + return e.startsWith(t.left); + }); + if (-1 === (n = r(t[s].right, e, t[s].left.length))) break; + var l = e.slice(0, n + t[s].right.length), + h = i.test(l) ? l : e.slice(t[s].left.length, n); + a.push({ type: "math", data: h, rawData: l, display: t[s].display }), (e = e.slice(n + t[s].right.length)); + } + return "" !== e && a.push({ type: "text", data: e }), a; + })(e, n.delimiters); + if (1 === a.length && "text" === a[0].type) return null; + for (var o = document.createDocumentFragment(), s = 0; s < a.length; s++) + if ("text" === a[s].type) o.appendChild(document.createTextNode(a[s].data)); + else { + var l = document.createElement("span"), + h = a[s].data; + n.displayMode = a[s].display; + try { + n.preProcess && (h = n.preProcess(h)), t().render(h, l, n); + } catch (e) { + if (!(e instanceof t().ParseError)) throw e; + n.errorCallback("KaTeX auto-render: Failed to parse `" + a[s].data + "` with ", e), + o.appendChild(document.createTextNode(a[s].rawData)); + continue; + } + o.appendChild(l); + } + return o; + }, + s = function e(t, r) { + for (var n = 0; n < t.childNodes.length; n++) { + var a = t.childNodes[n]; + if (3 === a.nodeType) { + for (var i = a.textContent, s = a.nextSibling, l = 0; s && s.nodeType === Node.TEXT_NODE; ) + (i += s.textContent), (s = s.nextSibling), l++; + var h = o(i, r); + if (h) { + for (var c = 0; c < l; c++) a.nextSibling.remove(); + (n += h.childNodes.length - 1), t.replaceChild(h, a); + } else n += l; + } else + 1 === a.nodeType && + (function () { + var t = " " + a.className + " "; + -1 === r.ignoredTags.indexOf(a.nodeName.toLowerCase()) && + r.ignoredClasses.every(function (e) { + return -1 === t.indexOf(" " + e + " "); + }) && + e(a, r); + })(); + } + }, + l = function (e, t) { + if (!e) throw new Error("No element provided to render"); + var r = {}; + for (var n in t) t.hasOwnProperty(n) && (r[n] = t[n]); + (r.delimiters = r.delimiters || [ + { left: "$$", right: "$$", display: !0 }, + { left: "\\(", right: "\\)", display: !1 }, + { left: "\\begin{equation}", right: "\\end{equation}", display: !0 }, + { left: "\\begin{align}", right: "\\end{align}", display: !0 }, + { left: "\\begin{alignat}", right: "\\end{alignat}", display: !0 }, + { left: "\\begin{gather}", right: "\\end{gather}", display: !0 }, + { left: "\\begin{CD}", right: "\\end{CD}", display: !0 }, + { left: "\\[", right: "\\]", display: !0 }, + ]), + (r.ignoredTags = r.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code", "option"]), + (r.ignoredClasses = r.ignoredClasses || []), + (r.errorCallback = r.errorCallback || console.error), + (r.macros = r.macros || {}), + s(e, r); + }; + })(), + a.default + ); + })(); + }), + (e.exports = n(r(527))); + }, + 527: function (e) { + var t; + "undefined" != typeof self && self, + (t = function () { + return (function () { + "use strict"; + var e = { + d: function (t, r) { + for (var n in r) e.o(r, n) && !e.o(t, n) && Object.defineProperty(t, n, { enumerable: !0, get: r[n] }); + }, + o: function (e, t) { + return Object.prototype.hasOwnProperty.call(e, t); + }, + }, + t = {}; + e.d(t, { + default: function () { + return ra; + }, + }); + var r = function e(t, r) { + (this.name = void 0), (this.position = void 0), (this.length = void 0), (this.rawMessage = void 0); + var n, + a, + i = "KaTeX parse error: " + t, + o = r && r.loc; + if (o && o.start <= o.end) { + var s = o.lexer.input; + (n = o.start), (a = o.end), n === s.length ? (i += " at end of input: ") : (i += " at position " + (n + 1) + ": "); + var l = s.slice(n, a).replace(/[^]/g, "$&̲"); + i += (n > 15 ? "…" + s.slice(n - 15, n) : s.slice(0, n)) + l + (a + 15 < s.length ? s.slice(a, a + 15) + "…" : s.slice(a)); + } + var h = new Error(i); + return ( + (h.name = "ParseError"), + (h.__proto__ = e.prototype), + (h.position = n), + null != n && null != a && (h.length = a - n), + (h.rawMessage = t), + h + ); + }; + r.prototype.__proto__ = Error.prototype; + var n = r, + a = /([A-Z])/g, + i = { "&": "&", ">": ">", "<": "<", '"': """, "'": "'" }, + o = /[&><"']/g, + s = function e(t) { + return "ordgroup" === t.type || "color" === t.type ? (1 === t.body.length ? e(t.body[0]) : t) : "font" === t.type ? e(t.body) : t; + }, + l = function (e, t) { + return -1 !== e.indexOf(t); + }, + h = function (e, t) { + return void 0 === e ? t : e; + }, + c = function (e) { + return String(e).replace(o, function (e) { + return i[e]; + }); + }, + m = function (e) { + return e.replace(a, "-$1").toLowerCase(); + }, + u = s, + p = function (e) { + var t = s(e); + return "mathord" === t.type || "textord" === t.type || "atom" === t.type; + }, + d = function (e) { + var t = /^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(e); + return null != t ? t[1] : "_relative"; + }, + f = { + displayMode: { + type: "boolean", + description: + "Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.", + cli: "-d, --display-mode", + }, + output: { + type: { enum: ["htmlAndMathml", "html", "mathml"] }, + description: "Determines the markup language of the output.", + cli: "-F, --format ", + }, + leqno: { + type: "boolean", + description: "Render display math in leqno style (left-justified tags).", + }, + fleqn: { type: "boolean", description: "Render display math flush left." }, + throwOnError: { + type: "boolean", + default: !0, + cli: "-t, --no-throw-on-error", + cliDescription: + "Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.", + }, + errorColor: { + type: "string", + default: "#cc0000", + cli: "-c, --error-color ", + cliDescription: + "A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.", + cliProcessor: function (e) { + return "#" + e; + }, + }, + macros: { + type: "object", + cli: "-m, --macro ", + cliDescription: "Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).", + cliDefault: [], + cliProcessor: function (e, t) { + return t.push(e), t; + }, + }, + minRuleThickness: { + type: "number", + description: + "Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.", + processor: function (e) { + return Math.max(0, e); + }, + cli: "--min-rule-thickness ", + cliProcessor: parseFloat, + }, + colorIsTextColor: { + type: "boolean", + description: "Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.", + cli: "-b, --color-is-text-color", + }, + strict: { + type: [{ enum: ["warn", "ignore", "error"] }, "boolean", "function"], + description: + "Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.", + cli: "-S, --strict", + cliDefault: !1, + }, + trust: { + type: ["boolean", "function"], + description: "Trust the input, enabling all HTML features such as \\url.", + cli: "-T, --trust", + }, + maxSize: { + type: "number", + default: 1 / 0, + description: + "If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large", + processor: function (e) { + return Math.max(0, e); + }, + cli: "-s, --max-size ", + cliProcessor: parseInt, + }, + maxExpand: { + type: "number", + default: 1e3, + description: + "Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.", + processor: function (e) { + return Math.max(0, e); + }, + cli: "-e, --max-expand ", + cliProcessor: function (e) { + return "Infinity" === e ? 1 / 0 : parseInt(e); + }, + }, + globalGroup: { type: "boolean", cli: !1 }, + }; + function g(e) { + if (e.default) return e.default; + var t = e.type, + r = Array.isArray(t) ? t[0] : t; + if ("string" != typeof r) return r.enum[0]; + switch (r) { + case "boolean": + return !1; + case "string": + return ""; + case "number": + return 0; + case "object": + return {}; + } + } + var v = (function () { + function e(e) { + for (var t in ((this.displayMode = void 0), + (this.output = void 0), + (this.leqno = void 0), + (this.fleqn = void 0), + (this.throwOnError = void 0), + (this.errorColor = void 0), + (this.macros = void 0), + (this.minRuleThickness = void 0), + (this.colorIsTextColor = void 0), + (this.strict = void 0), + (this.trust = void 0), + (this.maxSize = void 0), + (this.maxExpand = void 0), + (this.globalGroup = void 0), + (e = e || {}), + f)) + if (f.hasOwnProperty(t)) { + var r = f[t]; + this[t] = void 0 !== e[t] ? (r.processor ? r.processor(e[t]) : e[t]) : g(r); + } + } + var t = e.prototype; + return ( + (t.reportNonstrict = function (e, t, r) { + var a = this.strict; + if (("function" == typeof a && (a = a(e, t, r)), a && "ignore" !== a)) { + if (!0 === a || "error" === a) + throw new n("LaTeX-incompatible input and strict mode is set to 'error': " + t + " [" + e + "]", r); + "warn" === a + ? "undefined" != typeof console && + console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + t + " [" + e + "]") + : "undefined" != typeof console && + console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '" + a + "': " + t + " [" + e + "]"); + } + }), + (t.useStrictBehavior = function (e, t, r) { + var n = this.strict; + if ("function" == typeof n) + try { + n = n(e, t, r); + } catch (e) { + n = "error"; + } + return !( + !n || + "ignore" === n || + (!0 !== n && + "error" !== n && + ("warn" === n + ? ("undefined" != typeof console && + console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + t + " [" + e + "]"), + 1) + : ("undefined" != typeof console && + console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '" + n + "': " + t + " [" + e + "]"), + 1))) + ); + }), + (t.isTrusted = function (e) { + e.url && !e.protocol && (e.protocol = d(e.url)); + var t = "function" == typeof this.trust ? this.trust(e) : this.trust; + return Boolean(t); + }), + e + ); + })(), + y = (function () { + function e(e, t, r) { + (this.id = void 0), (this.size = void 0), (this.cramped = void 0), (this.id = e), (this.size = t), (this.cramped = r); + } + var t = e.prototype; + return ( + (t.sup = function () { + return b[x[this.id]]; + }), + (t.sub = function () { + return b[w[this.id]]; + }), + (t.fracNum = function () { + return b[k[this.id]]; + }), + (t.fracDen = function () { + return b[S[this.id]]; + }), + (t.cramp = function () { + return b[M[this.id]]; + }), + (t.text = function () { + return b[z[this.id]]; + }), + (t.isTight = function () { + return this.size >= 2; + }), + e + ); + })(), + b = [ + new y(0, 0, !1), + new y(1, 0, !0), + new y(2, 1, !1), + new y(3, 1, !0), + new y(4, 2, !1), + new y(5, 2, !0), + new y(6, 3, !1), + new y(7, 3, !0), + ], + x = [4, 5, 4, 5, 6, 7, 6, 7], + w = [5, 5, 5, 5, 7, 7, 7, 7], + k = [2, 3, 4, 5, 6, 7, 6, 7], + S = [3, 3, 5, 5, 7, 7, 7, 7], + M = [1, 1, 3, 3, 5, 5, 7, 7], + z = [0, 1, 2, 3, 2, 3, 2, 3], + A = { DISPLAY: b[0], TEXT: b[2], SCRIPT: b[4], SCRIPTSCRIPT: b[6] }, + T = [ + { + name: "latin", + blocks: [ + [256, 591], + [768, 879], + ], + }, + { name: "cyrillic", blocks: [[1024, 1279]] }, + { name: "armenian", blocks: [[1328, 1423]] }, + { name: "brahmic", blocks: [[2304, 4255]] }, + { name: "georgian", blocks: [[4256, 4351]] }, + { + name: "cjk", + blocks: [ + [12288, 12543], + [19968, 40879], + [65280, 65376], + ], + }, + { name: "hangul", blocks: [[44032, 55215]] }, + ], + B = []; + function N(e) { + for (var t = 0; t < B.length; t += 2) if (e >= B[t] && e <= B[t + 1]) return !0; + return !1; + } + T.forEach(function (e) { + return e.blocks.forEach(function (e) { + return B.push.apply(B, e); + }); + }); + var C = { + doubleleftarrow: + "M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z", + doublerightarrow: + "M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z", + leftarrow: + "M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z", + leftbrace: + "M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z", + leftbraceunder: + "M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z", + leftgroup: "M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z", + leftgroupunder: "M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z", + leftharpoon: + "M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z", + leftharpoonplus: + "M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z", + leftharpoondown: + "M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z", + leftharpoondownplus: + "M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z", + lefthook: + "M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z", + leftlinesegment: "M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z", + leftmapsto: "M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z", + leftToFrom: + "M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z", + longequal: "M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z", + midbrace: + "M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z", + midbraceunder: + "M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z", + oiintSize1: + "M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z", + oiintSize2: + "M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z", + oiiintSize1: + "M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z", + oiiintSize2: + "M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z", + rightarrow: + "M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z", + rightbrace: + "M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z", + rightbraceunder: + "M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z", + rightgroup: "M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z", + rightgroupunder: "M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z", + rightharpoon: + "M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z", + rightharpoonplus: + "M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z", + rightharpoondown: + "M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z", + rightharpoondownplus: + "M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z", + righthook: + "M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z", + rightlinesegment: "M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z", + rightToFrom: + "M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z", + twoheadleftarrow: + "M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z", + twoheadrightarrow: + "M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z", + tilde1: + "M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z", + tilde2: + "M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z", + tilde3: + "M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z", + tilde4: + "M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z", + vec: "M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z", + widehat1: "M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z", + widehat2: "M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z", + widehat3: "M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z", + widehat4: "M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z", + widecheck1: + "M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z", + widecheck2: + "M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z", + widecheck3: + "M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z", + widecheck4: + "M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z", + baraboveleftarrow: + "M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z", + rightarrowabovebar: + "M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z", + baraboveshortleftharpoon: + "M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z", + rightharpoonaboveshortbar: + "M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z", + shortbaraboveleftharpoon: + "M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z", + shortrightharpoonabovebar: + "M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z", + }, + q = (function () { + function e(e) { + (this.children = void 0), + (this.classes = void 0), + (this.height = void 0), + (this.depth = void 0), + (this.maxFontSize = void 0), + (this.style = void 0), + (this.children = e), + (this.classes = []), + (this.height = 0), + (this.depth = 0), + (this.maxFontSize = 0), + (this.style = {}); + } + var t = e.prototype; + return ( + (t.hasClass = function (e) { + return l(this.classes, e); + }), + (t.toNode = function () { + for (var e = document.createDocumentFragment(), t = 0; t < this.children.length; t++) e.appendChild(this.children[t].toNode()); + return e; + }), + (t.toMarkup = function () { + for (var e = "", t = 0; t < this.children.length; t++) e += this.children[t].toMarkup(); + return e; + }), + (t.toText = function () { + return this.children + .map(function (e) { + return e.toText(); + }) + .join(""); + }), + e + ); + })(), + I = { + "AMS-Regular": { + 32: [0, 0, 0, 0, 0.25], + 65: [0, 0.68889, 0, 0, 0.72222], + 66: [0, 0.68889, 0, 0, 0.66667], + 67: [0, 0.68889, 0, 0, 0.72222], + 68: [0, 0.68889, 0, 0, 0.72222], + 69: [0, 0.68889, 0, 0, 0.66667], + 70: [0, 0.68889, 0, 0, 0.61111], + 71: [0, 0.68889, 0, 0, 0.77778], + 72: [0, 0.68889, 0, 0, 0.77778], + 73: [0, 0.68889, 0, 0, 0.38889], + 74: [0.16667, 0.68889, 0, 0, 0.5], + 75: [0, 0.68889, 0, 0, 0.77778], + 76: [0, 0.68889, 0, 0, 0.66667], + 77: [0, 0.68889, 0, 0, 0.94445], + 78: [0, 0.68889, 0, 0, 0.72222], + 79: [0.16667, 0.68889, 0, 0, 0.77778], + 80: [0, 0.68889, 0, 0, 0.61111], + 81: [0.16667, 0.68889, 0, 0, 0.77778], + 82: [0, 0.68889, 0, 0, 0.72222], + 83: [0, 0.68889, 0, 0, 0.55556], + 84: [0, 0.68889, 0, 0, 0.66667], + 85: [0, 0.68889, 0, 0, 0.72222], + 86: [0, 0.68889, 0, 0, 0.72222], + 87: [0, 0.68889, 0, 0, 1], + 88: [0, 0.68889, 0, 0, 0.72222], + 89: [0, 0.68889, 0, 0, 0.72222], + 90: [0, 0.68889, 0, 0, 0.66667], + 107: [0, 0.68889, 0, 0, 0.55556], + 160: [0, 0, 0, 0, 0.25], + 165: [0, 0.675, 0.025, 0, 0.75], + 174: [0.15559, 0.69224, 0, 0, 0.94666], + 240: [0, 0.68889, 0, 0, 0.55556], + 295: [0, 0.68889, 0, 0, 0.54028], + 710: [0, 0.825, 0, 0, 2.33334], + 732: [0, 0.9, 0, 0, 2.33334], + 770: [0, 0.825, 0, 0, 2.33334], + 771: [0, 0.9, 0, 0, 2.33334], + 989: [0.08167, 0.58167, 0, 0, 0.77778], + 1008: [0, 0.43056, 0.04028, 0, 0.66667], + 8245: [0, 0.54986, 0, 0, 0.275], + 8463: [0, 0.68889, 0, 0, 0.54028], + 8487: [0, 0.68889, 0, 0, 0.72222], + 8498: [0, 0.68889, 0, 0, 0.55556], + 8502: [0, 0.68889, 0, 0, 0.66667], + 8503: [0, 0.68889, 0, 0, 0.44445], + 8504: [0, 0.68889, 0, 0, 0.66667], + 8513: [0, 0.68889, 0, 0, 0.63889], + 8592: [-0.03598, 0.46402, 0, 0, 0.5], + 8594: [-0.03598, 0.46402, 0, 0, 0.5], + 8602: [-0.13313, 0.36687, 0, 0, 1], + 8603: [-0.13313, 0.36687, 0, 0, 1], + 8606: [0.01354, 0.52239, 0, 0, 1], + 8608: [0.01354, 0.52239, 0, 0, 1], + 8610: [0.01354, 0.52239, 0, 0, 1.11111], + 8611: [0.01354, 0.52239, 0, 0, 1.11111], + 8619: [0, 0.54986, 0, 0, 1], + 8620: [0, 0.54986, 0, 0, 1], + 8621: [-0.13313, 0.37788, 0, 0, 1.38889], + 8622: [-0.13313, 0.36687, 0, 0, 1], + 8624: [0, 0.69224, 0, 0, 0.5], + 8625: [0, 0.69224, 0, 0, 0.5], + 8630: [0, 0.43056, 0, 0, 1], + 8631: [0, 0.43056, 0, 0, 1], + 8634: [0.08198, 0.58198, 0, 0, 0.77778], + 8635: [0.08198, 0.58198, 0, 0, 0.77778], + 8638: [0.19444, 0.69224, 0, 0, 0.41667], + 8639: [0.19444, 0.69224, 0, 0, 0.41667], + 8642: [0.19444, 0.69224, 0, 0, 0.41667], + 8643: [0.19444, 0.69224, 0, 0, 0.41667], + 8644: [0.1808, 0.675, 0, 0, 1], + 8646: [0.1808, 0.675, 0, 0, 1], + 8647: [0.1808, 0.675, 0, 0, 1], + 8648: [0.19444, 0.69224, 0, 0, 0.83334], + 8649: [0.1808, 0.675, 0, 0, 1], + 8650: [0.19444, 0.69224, 0, 0, 0.83334], + 8651: [0.01354, 0.52239, 0, 0, 1], + 8652: [0.01354, 0.52239, 0, 0, 1], + 8653: [-0.13313, 0.36687, 0, 0, 1], + 8654: [-0.13313, 0.36687, 0, 0, 1], + 8655: [-0.13313, 0.36687, 0, 0, 1], + 8666: [0.13667, 0.63667, 0, 0, 1], + 8667: [0.13667, 0.63667, 0, 0, 1], + 8669: [-0.13313, 0.37788, 0, 0, 1], + 8672: [-0.064, 0.437, 0, 0, 1.334], + 8674: [-0.064, 0.437, 0, 0, 1.334], + 8705: [0, 0.825, 0, 0, 0.5], + 8708: [0, 0.68889, 0, 0, 0.55556], + 8709: [0.08167, 0.58167, 0, 0, 0.77778], + 8717: [0, 0.43056, 0, 0, 0.42917], + 8722: [-0.03598, 0.46402, 0, 0, 0.5], + 8724: [0.08198, 0.69224, 0, 0, 0.77778], + 8726: [0.08167, 0.58167, 0, 0, 0.77778], + 8733: [0, 0.69224, 0, 0, 0.77778], + 8736: [0, 0.69224, 0, 0, 0.72222], + 8737: [0, 0.69224, 0, 0, 0.72222], + 8738: [0.03517, 0.52239, 0, 0, 0.72222], + 8739: [0.08167, 0.58167, 0, 0, 0.22222], + 8740: [0.25142, 0.74111, 0, 0, 0.27778], + 8741: [0.08167, 0.58167, 0, 0, 0.38889], + 8742: [0.25142, 0.74111, 0, 0, 0.5], + 8756: [0, 0.69224, 0, 0, 0.66667], + 8757: [0, 0.69224, 0, 0, 0.66667], + 8764: [-0.13313, 0.36687, 0, 0, 0.77778], + 8765: [-0.13313, 0.37788, 0, 0, 0.77778], + 8769: [-0.13313, 0.36687, 0, 0, 0.77778], + 8770: [-0.03625, 0.46375, 0, 0, 0.77778], + 8774: [0.30274, 0.79383, 0, 0, 0.77778], + 8776: [-0.01688, 0.48312, 0, 0, 0.77778], + 8778: [0.08167, 0.58167, 0, 0, 0.77778], + 8782: [0.06062, 0.54986, 0, 0, 0.77778], + 8783: [0.06062, 0.54986, 0, 0, 0.77778], + 8785: [0.08198, 0.58198, 0, 0, 0.77778], + 8786: [0.08198, 0.58198, 0, 0, 0.77778], + 8787: [0.08198, 0.58198, 0, 0, 0.77778], + 8790: [0, 0.69224, 0, 0, 0.77778], + 8791: [0.22958, 0.72958, 0, 0, 0.77778], + 8796: [0.08198, 0.91667, 0, 0, 0.77778], + 8806: [0.25583, 0.75583, 0, 0, 0.77778], + 8807: [0.25583, 0.75583, 0, 0, 0.77778], + 8808: [0.25142, 0.75726, 0, 0, 0.77778], + 8809: [0.25142, 0.75726, 0, 0, 0.77778], + 8812: [0.25583, 0.75583, 0, 0, 0.5], + 8814: [0.20576, 0.70576, 0, 0, 0.77778], + 8815: [0.20576, 0.70576, 0, 0, 0.77778], + 8816: [0.30274, 0.79383, 0, 0, 0.77778], + 8817: [0.30274, 0.79383, 0, 0, 0.77778], + 8818: [0.22958, 0.72958, 0, 0, 0.77778], + 8819: [0.22958, 0.72958, 0, 0, 0.77778], + 8822: [0.1808, 0.675, 0, 0, 0.77778], + 8823: [0.1808, 0.675, 0, 0, 0.77778], + 8828: [0.13667, 0.63667, 0, 0, 0.77778], + 8829: [0.13667, 0.63667, 0, 0, 0.77778], + 8830: [0.22958, 0.72958, 0, 0, 0.77778], + 8831: [0.22958, 0.72958, 0, 0, 0.77778], + 8832: [0.20576, 0.70576, 0, 0, 0.77778], + 8833: [0.20576, 0.70576, 0, 0, 0.77778], + 8840: [0.30274, 0.79383, 0, 0, 0.77778], + 8841: [0.30274, 0.79383, 0, 0, 0.77778], + 8842: [0.13597, 0.63597, 0, 0, 0.77778], + 8843: [0.13597, 0.63597, 0, 0, 0.77778], + 8847: [0.03517, 0.54986, 0, 0, 0.77778], + 8848: [0.03517, 0.54986, 0, 0, 0.77778], + 8858: [0.08198, 0.58198, 0, 0, 0.77778], + 8859: [0.08198, 0.58198, 0, 0, 0.77778], + 8861: [0.08198, 0.58198, 0, 0, 0.77778], + 8862: [0, 0.675, 0, 0, 0.77778], + 8863: [0, 0.675, 0, 0, 0.77778], + 8864: [0, 0.675, 0, 0, 0.77778], + 8865: [0, 0.675, 0, 0, 0.77778], + 8872: [0, 0.69224, 0, 0, 0.61111], + 8873: [0, 0.69224, 0, 0, 0.72222], + 8874: [0, 0.69224, 0, 0, 0.88889], + 8876: [0, 0.68889, 0, 0, 0.61111], + 8877: [0, 0.68889, 0, 0, 0.61111], + 8878: [0, 0.68889, 0, 0, 0.72222], + 8879: [0, 0.68889, 0, 0, 0.72222], + 8882: [0.03517, 0.54986, 0, 0, 0.77778], + 8883: [0.03517, 0.54986, 0, 0, 0.77778], + 8884: [0.13667, 0.63667, 0, 0, 0.77778], + 8885: [0.13667, 0.63667, 0, 0, 0.77778], + 8888: [0, 0.54986, 0, 0, 1.11111], + 8890: [0.19444, 0.43056, 0, 0, 0.55556], + 8891: [0.19444, 0.69224, 0, 0, 0.61111], + 8892: [0.19444, 0.69224, 0, 0, 0.61111], + 8901: [0, 0.54986, 0, 0, 0.27778], + 8903: [0.08167, 0.58167, 0, 0, 0.77778], + 8905: [0.08167, 0.58167, 0, 0, 0.77778], + 8906: [0.08167, 0.58167, 0, 0, 0.77778], + 8907: [0, 0.69224, 0, 0, 0.77778], + 8908: [0, 0.69224, 0, 0, 0.77778], + 8909: [-0.03598, 0.46402, 0, 0, 0.77778], + 8910: [0, 0.54986, 0, 0, 0.76042], + 8911: [0, 0.54986, 0, 0, 0.76042], + 8912: [0.03517, 0.54986, 0, 0, 0.77778], + 8913: [0.03517, 0.54986, 0, 0, 0.77778], + 8914: [0, 0.54986, 0, 0, 0.66667], + 8915: [0, 0.54986, 0, 0, 0.66667], + 8916: [0, 0.69224, 0, 0, 0.66667], + 8918: [0.0391, 0.5391, 0, 0, 0.77778], + 8919: [0.0391, 0.5391, 0, 0, 0.77778], + 8920: [0.03517, 0.54986, 0, 0, 1.33334], + 8921: [0.03517, 0.54986, 0, 0, 1.33334], + 8922: [0.38569, 0.88569, 0, 0, 0.77778], + 8923: [0.38569, 0.88569, 0, 0, 0.77778], + 8926: [0.13667, 0.63667, 0, 0, 0.77778], + 8927: [0.13667, 0.63667, 0, 0, 0.77778], + 8928: [0.30274, 0.79383, 0, 0, 0.77778], + 8929: [0.30274, 0.79383, 0, 0, 0.77778], + 8934: [0.23222, 0.74111, 0, 0, 0.77778], + 8935: [0.23222, 0.74111, 0, 0, 0.77778], + 8936: [0.23222, 0.74111, 0, 0, 0.77778], + 8937: [0.23222, 0.74111, 0, 0, 0.77778], + 8938: [0.20576, 0.70576, 0, 0, 0.77778], + 8939: [0.20576, 0.70576, 0, 0, 0.77778], + 8940: [0.30274, 0.79383, 0, 0, 0.77778], + 8941: [0.30274, 0.79383, 0, 0, 0.77778], + 8994: [0.19444, 0.69224, 0, 0, 0.77778], + 8995: [0.19444, 0.69224, 0, 0, 0.77778], + 9416: [0.15559, 0.69224, 0, 0, 0.90222], + 9484: [0, 0.69224, 0, 0, 0.5], + 9488: [0, 0.69224, 0, 0, 0.5], + 9492: [0, 0.37788, 0, 0, 0.5], + 9496: [0, 0.37788, 0, 0, 0.5], + 9585: [0.19444, 0.68889, 0, 0, 0.88889], + 9586: [0.19444, 0.74111, 0, 0, 0.88889], + 9632: [0, 0.675, 0, 0, 0.77778], + 9633: [0, 0.675, 0, 0, 0.77778], + 9650: [0, 0.54986, 0, 0, 0.72222], + 9651: [0, 0.54986, 0, 0, 0.72222], + 9654: [0.03517, 0.54986, 0, 0, 0.77778], + 9660: [0, 0.54986, 0, 0, 0.72222], + 9661: [0, 0.54986, 0, 0, 0.72222], + 9664: [0.03517, 0.54986, 0, 0, 0.77778], + 9674: [0.11111, 0.69224, 0, 0, 0.66667], + 9733: [0.19444, 0.69224, 0, 0, 0.94445], + 10003: [0, 0.69224, 0, 0, 0.83334], + 10016: [0, 0.69224, 0, 0, 0.83334], + 10731: [0.11111, 0.69224, 0, 0, 0.66667], + 10846: [0.19444, 0.75583, 0, 0, 0.61111], + 10877: [0.13667, 0.63667, 0, 0, 0.77778], + 10878: [0.13667, 0.63667, 0, 0, 0.77778], + 10885: [0.25583, 0.75583, 0, 0, 0.77778], + 10886: [0.25583, 0.75583, 0, 0, 0.77778], + 10887: [0.13597, 0.63597, 0, 0, 0.77778], + 10888: [0.13597, 0.63597, 0, 0, 0.77778], + 10889: [0.26167, 0.75726, 0, 0, 0.77778], + 10890: [0.26167, 0.75726, 0, 0, 0.77778], + 10891: [0.48256, 0.98256, 0, 0, 0.77778], + 10892: [0.48256, 0.98256, 0, 0, 0.77778], + 10901: [0.13667, 0.63667, 0, 0, 0.77778], + 10902: [0.13667, 0.63667, 0, 0, 0.77778], + 10933: [0.25142, 0.75726, 0, 0, 0.77778], + 10934: [0.25142, 0.75726, 0, 0, 0.77778], + 10935: [0.26167, 0.75726, 0, 0, 0.77778], + 10936: [0.26167, 0.75726, 0, 0, 0.77778], + 10937: [0.26167, 0.75726, 0, 0, 0.77778], + 10938: [0.26167, 0.75726, 0, 0, 0.77778], + 10949: [0.25583, 0.75583, 0, 0, 0.77778], + 10950: [0.25583, 0.75583, 0, 0, 0.77778], + 10955: [0.28481, 0.79383, 0, 0, 0.77778], + 10956: [0.28481, 0.79383, 0, 0, 0.77778], + 57350: [0.08167, 0.58167, 0, 0, 0.22222], + 57351: [0.08167, 0.58167, 0, 0, 0.38889], + 57352: [0.08167, 0.58167, 0, 0, 0.77778], + 57353: [0, 0.43056, 0.04028, 0, 0.66667], + 57356: [0.25142, 0.75726, 0, 0, 0.77778], + 57357: [0.25142, 0.75726, 0, 0, 0.77778], + 57358: [0.41951, 0.91951, 0, 0, 0.77778], + 57359: [0.30274, 0.79383, 0, 0, 0.77778], + 57360: [0.30274, 0.79383, 0, 0, 0.77778], + 57361: [0.41951, 0.91951, 0, 0, 0.77778], + 57366: [0.25142, 0.75726, 0, 0, 0.77778], + 57367: [0.25142, 0.75726, 0, 0, 0.77778], + 57368: [0.25142, 0.75726, 0, 0, 0.77778], + 57369: [0.25142, 0.75726, 0, 0, 0.77778], + 57370: [0.13597, 0.63597, 0, 0, 0.77778], + 57371: [0.13597, 0.63597, 0, 0, 0.77778], + }, + "Caligraphic-Regular": { + 32: [0, 0, 0, 0, 0.25], + 65: [0, 0.68333, 0, 0.19445, 0.79847], + 66: [0, 0.68333, 0.03041, 0.13889, 0.65681], + 67: [0, 0.68333, 0.05834, 0.13889, 0.52653], + 68: [0, 0.68333, 0.02778, 0.08334, 0.77139], + 69: [0, 0.68333, 0.08944, 0.11111, 0.52778], + 70: [0, 0.68333, 0.09931, 0.11111, 0.71875], + 71: [0.09722, 0.68333, 0.0593, 0.11111, 0.59487], + 72: [0, 0.68333, 0.00965, 0.11111, 0.84452], + 73: [0, 0.68333, 0.07382, 0, 0.54452], + 74: [0.09722, 0.68333, 0.18472, 0.16667, 0.67778], + 75: [0, 0.68333, 0.01445, 0.05556, 0.76195], + 76: [0, 0.68333, 0, 0.13889, 0.68972], + 77: [0, 0.68333, 0, 0.13889, 1.2009], + 78: [0, 0.68333, 0.14736, 0.08334, 0.82049], + 79: [0, 0.68333, 0.02778, 0.11111, 0.79611], + 80: [0, 0.68333, 0.08222, 0.08334, 0.69556], + 81: [0.09722, 0.68333, 0, 0.11111, 0.81667], + 82: [0, 0.68333, 0, 0.08334, 0.8475], + 83: [0, 0.68333, 0.075, 0.13889, 0.60556], + 84: [0, 0.68333, 0.25417, 0, 0.54464], + 85: [0, 0.68333, 0.09931, 0.08334, 0.62583], + 86: [0, 0.68333, 0.08222, 0, 0.61278], + 87: [0, 0.68333, 0.08222, 0.08334, 0.98778], + 88: [0, 0.68333, 0.14643, 0.13889, 0.7133], + 89: [0.09722, 0.68333, 0.08222, 0.08334, 0.66834], + 90: [0, 0.68333, 0.07944, 0.13889, 0.72473], + 160: [0, 0, 0, 0, 0.25], + }, + "Fraktur-Regular": { + 32: [0, 0, 0, 0, 0.25], + 33: [0, 0.69141, 0, 0, 0.29574], + 34: [0, 0.69141, 0, 0, 0.21471], + 38: [0, 0.69141, 0, 0, 0.73786], + 39: [0, 0.69141, 0, 0, 0.21201], + 40: [0.24982, 0.74947, 0, 0, 0.38865], + 41: [0.24982, 0.74947, 0, 0, 0.38865], + 42: [0, 0.62119, 0, 0, 0.27764], + 43: [0.08319, 0.58283, 0, 0, 0.75623], + 44: [0, 0.10803, 0, 0, 0.27764], + 45: [0.08319, 0.58283, 0, 0, 0.75623], + 46: [0, 0.10803, 0, 0, 0.27764], + 47: [0.24982, 0.74947, 0, 0, 0.50181], + 48: [0, 0.47534, 0, 0, 0.50181], + 49: [0, 0.47534, 0, 0, 0.50181], + 50: [0, 0.47534, 0, 0, 0.50181], + 51: [0.18906, 0.47534, 0, 0, 0.50181], + 52: [0.18906, 0.47534, 0, 0, 0.50181], + 53: [0.18906, 0.47534, 0, 0, 0.50181], + 54: [0, 0.69141, 0, 0, 0.50181], + 55: [0.18906, 0.47534, 0, 0, 0.50181], + 56: [0, 0.69141, 0, 0, 0.50181], + 57: [0.18906, 0.47534, 0, 0, 0.50181], + 58: [0, 0.47534, 0, 0, 0.21606], + 59: [0.12604, 0.47534, 0, 0, 0.21606], + 61: [-0.13099, 0.36866, 0, 0, 0.75623], + 63: [0, 0.69141, 0, 0, 0.36245], + 65: [0, 0.69141, 0, 0, 0.7176], + 66: [0, 0.69141, 0, 0, 0.88397], + 67: [0, 0.69141, 0, 0, 0.61254], + 68: [0, 0.69141, 0, 0, 0.83158], + 69: [0, 0.69141, 0, 0, 0.66278], + 70: [0.12604, 0.69141, 0, 0, 0.61119], + 71: [0, 0.69141, 0, 0, 0.78539], + 72: [0.06302, 0.69141, 0, 0, 0.7203], + 73: [0, 0.69141, 0, 0, 0.55448], + 74: [0.12604, 0.69141, 0, 0, 0.55231], + 75: [0, 0.69141, 0, 0, 0.66845], + 76: [0, 0.69141, 0, 0, 0.66602], + 77: [0, 0.69141, 0, 0, 1.04953], + 78: [0, 0.69141, 0, 0, 0.83212], + 79: [0, 0.69141, 0, 0, 0.82699], + 80: [0.18906, 0.69141, 0, 0, 0.82753], + 81: [0.03781, 0.69141, 0, 0, 0.82699], + 82: [0, 0.69141, 0, 0, 0.82807], + 83: [0, 0.69141, 0, 0, 0.82861], + 84: [0, 0.69141, 0, 0, 0.66899], + 85: [0, 0.69141, 0, 0, 0.64576], + 86: [0, 0.69141, 0, 0, 0.83131], + 87: [0, 0.69141, 0, 0, 1.04602], + 88: [0, 0.69141, 0, 0, 0.71922], + 89: [0.18906, 0.69141, 0, 0, 0.83293], + 90: [0.12604, 0.69141, 0, 0, 0.60201], + 91: [0.24982, 0.74947, 0, 0, 0.27764], + 93: [0.24982, 0.74947, 0, 0, 0.27764], + 94: [0, 0.69141, 0, 0, 0.49965], + 97: [0, 0.47534, 0, 0, 0.50046], + 98: [0, 0.69141, 0, 0, 0.51315], + 99: [0, 0.47534, 0, 0, 0.38946], + 100: [0, 0.62119, 0, 0, 0.49857], + 101: [0, 0.47534, 0, 0, 0.40053], + 102: [0.18906, 0.69141, 0, 0, 0.32626], + 103: [0.18906, 0.47534, 0, 0, 0.5037], + 104: [0.18906, 0.69141, 0, 0, 0.52126], + 105: [0, 0.69141, 0, 0, 0.27899], + 106: [0, 0.69141, 0, 0, 0.28088], + 107: [0, 0.69141, 0, 0, 0.38946], + 108: [0, 0.69141, 0, 0, 0.27953], + 109: [0, 0.47534, 0, 0, 0.76676], + 110: [0, 0.47534, 0, 0, 0.52666], + 111: [0, 0.47534, 0, 0, 0.48885], + 112: [0.18906, 0.52396, 0, 0, 0.50046], + 113: [0.18906, 0.47534, 0, 0, 0.48912], + 114: [0, 0.47534, 0, 0, 0.38919], + 115: [0, 0.47534, 0, 0, 0.44266], + 116: [0, 0.62119, 0, 0, 0.33301], + 117: [0, 0.47534, 0, 0, 0.5172], + 118: [0, 0.52396, 0, 0, 0.5118], + 119: [0, 0.52396, 0, 0, 0.77351], + 120: [0.18906, 0.47534, 0, 0, 0.38865], + 121: [0.18906, 0.47534, 0, 0, 0.49884], + 122: [0.18906, 0.47534, 0, 0, 0.39054], + 160: [0, 0, 0, 0, 0.25], + 8216: [0, 0.69141, 0, 0, 0.21471], + 8217: [0, 0.69141, 0, 0, 0.21471], + 58112: [0, 0.62119, 0, 0, 0.49749], + 58113: [0, 0.62119, 0, 0, 0.4983], + 58114: [0.18906, 0.69141, 0, 0, 0.33328], + 58115: [0.18906, 0.69141, 0, 0, 0.32923], + 58116: [0.18906, 0.47534, 0, 0, 0.50343], + 58117: [0, 0.69141, 0, 0, 0.33301], + 58118: [0, 0.62119, 0, 0, 0.33409], + 58119: [0, 0.47534, 0, 0, 0.50073], + }, + "Main-Bold": { + 32: [0, 0, 0, 0, 0.25], + 33: [0, 0.69444, 0, 0, 0.35], + 34: [0, 0.69444, 0, 0, 0.60278], + 35: [0.19444, 0.69444, 0, 0, 0.95833], + 36: [0.05556, 0.75, 0, 0, 0.575], + 37: [0.05556, 0.75, 0, 0, 0.95833], + 38: [0, 0.69444, 0, 0, 0.89444], + 39: [0, 0.69444, 0, 0, 0.31944], + 40: [0.25, 0.75, 0, 0, 0.44722], + 41: [0.25, 0.75, 0, 0, 0.44722], + 42: [0, 0.75, 0, 0, 0.575], + 43: [0.13333, 0.63333, 0, 0, 0.89444], + 44: [0.19444, 0.15556, 0, 0, 0.31944], + 45: [0, 0.44444, 0, 0, 0.38333], + 46: [0, 0.15556, 0, 0, 0.31944], + 47: [0.25, 0.75, 0, 0, 0.575], + 48: [0, 0.64444, 0, 0, 0.575], + 49: [0, 0.64444, 0, 0, 0.575], + 50: [0, 0.64444, 0, 0, 0.575], + 51: [0, 0.64444, 0, 0, 0.575], + 52: [0, 0.64444, 0, 0, 0.575], + 53: [0, 0.64444, 0, 0, 0.575], + 54: [0, 0.64444, 0, 0, 0.575], + 55: [0, 0.64444, 0, 0, 0.575], + 56: [0, 0.64444, 0, 0, 0.575], + 57: [0, 0.64444, 0, 0, 0.575], + 58: [0, 0.44444, 0, 0, 0.31944], + 59: [0.19444, 0.44444, 0, 0, 0.31944], + 60: [0.08556, 0.58556, 0, 0, 0.89444], + 61: [-0.10889, 0.39111, 0, 0, 0.89444], + 62: [0.08556, 0.58556, 0, 0, 0.89444], + 63: [0, 0.69444, 0, 0, 0.54305], + 64: [0, 0.69444, 0, 0, 0.89444], + 65: [0, 0.68611, 0, 0, 0.86944], + 66: [0, 0.68611, 0, 0, 0.81805], + 67: [0, 0.68611, 0, 0, 0.83055], + 68: [0, 0.68611, 0, 0, 0.88194], + 69: [0, 0.68611, 0, 0, 0.75555], + 70: [0, 0.68611, 0, 0, 0.72361], + 71: [0, 0.68611, 0, 0, 0.90416], + 72: [0, 0.68611, 0, 0, 0.9], + 73: [0, 0.68611, 0, 0, 0.43611], + 74: [0, 0.68611, 0, 0, 0.59444], + 75: [0, 0.68611, 0, 0, 0.90138], + 76: [0, 0.68611, 0, 0, 0.69166], + 77: [0, 0.68611, 0, 0, 1.09166], + 78: [0, 0.68611, 0, 0, 0.9], + 79: [0, 0.68611, 0, 0, 0.86388], + 80: [0, 0.68611, 0, 0, 0.78611], + 81: [0.19444, 0.68611, 0, 0, 0.86388], + 82: [0, 0.68611, 0, 0, 0.8625], + 83: [0, 0.68611, 0, 0, 0.63889], + 84: [0, 0.68611, 0, 0, 0.8], + 85: [0, 0.68611, 0, 0, 0.88472], + 86: [0, 0.68611, 0.01597, 0, 0.86944], + 87: [0, 0.68611, 0.01597, 0, 1.18888], + 88: [0, 0.68611, 0, 0, 0.86944], + 89: [0, 0.68611, 0.02875, 0, 0.86944], + 90: [0, 0.68611, 0, 0, 0.70277], + 91: [0.25, 0.75, 0, 0, 0.31944], + 92: [0.25, 0.75, 0, 0, 0.575], + 93: [0.25, 0.75, 0, 0, 0.31944], + 94: [0, 0.69444, 0, 0, 0.575], + 95: [0.31, 0.13444, 0.03194, 0, 0.575], + 97: [0, 0.44444, 0, 0, 0.55902], + 98: [0, 0.69444, 0, 0, 0.63889], + 99: [0, 0.44444, 0, 0, 0.51111], + 100: [0, 0.69444, 0, 0, 0.63889], + 101: [0, 0.44444, 0, 0, 0.52708], + 102: [0, 0.69444, 0.10903, 0, 0.35139], + 103: [0.19444, 0.44444, 0.01597, 0, 0.575], + 104: [0, 0.69444, 0, 0, 0.63889], + 105: [0, 0.69444, 0, 0, 0.31944], + 106: [0.19444, 0.69444, 0, 0, 0.35139], + 107: [0, 0.69444, 0, 0, 0.60694], + 108: [0, 0.69444, 0, 0, 0.31944], + 109: [0, 0.44444, 0, 0, 0.95833], + 110: [0, 0.44444, 0, 0, 0.63889], + 111: [0, 0.44444, 0, 0, 0.575], + 112: [0.19444, 0.44444, 0, 0, 0.63889], + 113: [0.19444, 0.44444, 0, 0, 0.60694], + 114: [0, 0.44444, 0, 0, 0.47361], + 115: [0, 0.44444, 0, 0, 0.45361], + 116: [0, 0.63492, 0, 0, 0.44722], + 117: [0, 0.44444, 0, 0, 0.63889], + 118: [0, 0.44444, 0.01597, 0, 0.60694], + 119: [0, 0.44444, 0.01597, 0, 0.83055], + 120: [0, 0.44444, 0, 0, 0.60694], + 121: [0.19444, 0.44444, 0.01597, 0, 0.60694], + 122: [0, 0.44444, 0, 0, 0.51111], + 123: [0.25, 0.75, 0, 0, 0.575], + 124: [0.25, 0.75, 0, 0, 0.31944], + 125: [0.25, 0.75, 0, 0, 0.575], + 126: [0.35, 0.34444, 0, 0, 0.575], + 160: [0, 0, 0, 0, 0.25], + 163: [0, 0.69444, 0, 0, 0.86853], + 168: [0, 0.69444, 0, 0, 0.575], + 172: [0, 0.44444, 0, 0, 0.76666], + 176: [0, 0.69444, 0, 0, 0.86944], + 177: [0.13333, 0.63333, 0, 0, 0.89444], + 184: [0.17014, 0, 0, 0, 0.51111], + 198: [0, 0.68611, 0, 0, 1.04166], + 215: [0.13333, 0.63333, 0, 0, 0.89444], + 216: [0.04861, 0.73472, 0, 0, 0.89444], + 223: [0, 0.69444, 0, 0, 0.59722], + 230: [0, 0.44444, 0, 0, 0.83055], + 247: [0.13333, 0.63333, 0, 0, 0.89444], + 248: [0.09722, 0.54167, 0, 0, 0.575], + 305: [0, 0.44444, 0, 0, 0.31944], + 338: [0, 0.68611, 0, 0, 1.16944], + 339: [0, 0.44444, 0, 0, 0.89444], + 567: [0.19444, 0.44444, 0, 0, 0.35139], + 710: [0, 0.69444, 0, 0, 0.575], + 711: [0, 0.63194, 0, 0, 0.575], + 713: [0, 0.59611, 0, 0, 0.575], + 714: [0, 0.69444, 0, 0, 0.575], + 715: [0, 0.69444, 0, 0, 0.575], + 728: [0, 0.69444, 0, 0, 0.575], + 729: [0, 0.69444, 0, 0, 0.31944], + 730: [0, 0.69444, 0, 0, 0.86944], + 732: [0, 0.69444, 0, 0, 0.575], + 733: [0, 0.69444, 0, 0, 0.575], + 915: [0, 0.68611, 0, 0, 0.69166], + 916: [0, 0.68611, 0, 0, 0.95833], + 920: [0, 0.68611, 0, 0, 0.89444], + 923: [0, 0.68611, 0, 0, 0.80555], + 926: [0, 0.68611, 0, 0, 0.76666], + 928: [0, 0.68611, 0, 0, 0.9], + 931: [0, 0.68611, 0, 0, 0.83055], + 933: [0, 0.68611, 0, 0, 0.89444], + 934: [0, 0.68611, 0, 0, 0.83055], + 936: [0, 0.68611, 0, 0, 0.89444], + 937: [0, 0.68611, 0, 0, 0.83055], + 8211: [0, 0.44444, 0.03194, 0, 0.575], + 8212: [0, 0.44444, 0.03194, 0, 1.14999], + 8216: [0, 0.69444, 0, 0, 0.31944], + 8217: [0, 0.69444, 0, 0, 0.31944], + 8220: [0, 0.69444, 0, 0, 0.60278], + 8221: [0, 0.69444, 0, 0, 0.60278], + 8224: [0.19444, 0.69444, 0, 0, 0.51111], + 8225: [0.19444, 0.69444, 0, 0, 0.51111], + 8242: [0, 0.55556, 0, 0, 0.34444], + 8407: [0, 0.72444, 0.15486, 0, 0.575], + 8463: [0, 0.69444, 0, 0, 0.66759], + 8465: [0, 0.69444, 0, 0, 0.83055], + 8467: [0, 0.69444, 0, 0, 0.47361], + 8472: [0.19444, 0.44444, 0, 0, 0.74027], + 8476: [0, 0.69444, 0, 0, 0.83055], + 8501: [0, 0.69444, 0, 0, 0.70277], + 8592: [-0.10889, 0.39111, 0, 0, 1.14999], + 8593: [0.19444, 0.69444, 0, 0, 0.575], + 8594: [-0.10889, 0.39111, 0, 0, 1.14999], + 8595: [0.19444, 0.69444, 0, 0, 0.575], + 8596: [-0.10889, 0.39111, 0, 0, 1.14999], + 8597: [0.25, 0.75, 0, 0, 0.575], + 8598: [0.19444, 0.69444, 0, 0, 1.14999], + 8599: [0.19444, 0.69444, 0, 0, 1.14999], + 8600: [0.19444, 0.69444, 0, 0, 1.14999], + 8601: [0.19444, 0.69444, 0, 0, 1.14999], + 8636: [-0.10889, 0.39111, 0, 0, 1.14999], + 8637: [-0.10889, 0.39111, 0, 0, 1.14999], + 8640: [-0.10889, 0.39111, 0, 0, 1.14999], + 8641: [-0.10889, 0.39111, 0, 0, 1.14999], + 8656: [-0.10889, 0.39111, 0, 0, 1.14999], + 8657: [0.19444, 0.69444, 0, 0, 0.70277], + 8658: [-0.10889, 0.39111, 0, 0, 1.14999], + 8659: [0.19444, 0.69444, 0, 0, 0.70277], + 8660: [-0.10889, 0.39111, 0, 0, 1.14999], + 8661: [0.25, 0.75, 0, 0, 0.70277], + 8704: [0, 0.69444, 0, 0, 0.63889], + 8706: [0, 0.69444, 0.06389, 0, 0.62847], + 8707: [0, 0.69444, 0, 0, 0.63889], + 8709: [0.05556, 0.75, 0, 0, 0.575], + 8711: [0, 0.68611, 0, 0, 0.95833], + 8712: [0.08556, 0.58556, 0, 0, 0.76666], + 8715: [0.08556, 0.58556, 0, 0, 0.76666], + 8722: [0.13333, 0.63333, 0, 0, 0.89444], + 8723: [0.13333, 0.63333, 0, 0, 0.89444], + 8725: [0.25, 0.75, 0, 0, 0.575], + 8726: [0.25, 0.75, 0, 0, 0.575], + 8727: [-0.02778, 0.47222, 0, 0, 0.575], + 8728: [-0.02639, 0.47361, 0, 0, 0.575], + 8729: [-0.02639, 0.47361, 0, 0, 0.575], + 8730: [0.18, 0.82, 0, 0, 0.95833], + 8733: [0, 0.44444, 0, 0, 0.89444], + 8734: [0, 0.44444, 0, 0, 1.14999], + 8736: [0, 0.69224, 0, 0, 0.72222], + 8739: [0.25, 0.75, 0, 0, 0.31944], + 8741: [0.25, 0.75, 0, 0, 0.575], + 8743: [0, 0.55556, 0, 0, 0.76666], + 8744: [0, 0.55556, 0, 0, 0.76666], + 8745: [0, 0.55556, 0, 0, 0.76666], + 8746: [0, 0.55556, 0, 0, 0.76666], + 8747: [0.19444, 0.69444, 0.12778, 0, 0.56875], + 8764: [-0.10889, 0.39111, 0, 0, 0.89444], + 8768: [0.19444, 0.69444, 0, 0, 0.31944], + 8771: [0.00222, 0.50222, 0, 0, 0.89444], + 8773: [0.027, 0.638, 0, 0, 0.894], + 8776: [0.02444, 0.52444, 0, 0, 0.89444], + 8781: [0.00222, 0.50222, 0, 0, 0.89444], + 8801: [0.00222, 0.50222, 0, 0, 0.89444], + 8804: [0.19667, 0.69667, 0, 0, 0.89444], + 8805: [0.19667, 0.69667, 0, 0, 0.89444], + 8810: [0.08556, 0.58556, 0, 0, 1.14999], + 8811: [0.08556, 0.58556, 0, 0, 1.14999], + 8826: [0.08556, 0.58556, 0, 0, 0.89444], + 8827: [0.08556, 0.58556, 0, 0, 0.89444], + 8834: [0.08556, 0.58556, 0, 0, 0.89444], + 8835: [0.08556, 0.58556, 0, 0, 0.89444], + 8838: [0.19667, 0.69667, 0, 0, 0.89444], + 8839: [0.19667, 0.69667, 0, 0, 0.89444], + 8846: [0, 0.55556, 0, 0, 0.76666], + 8849: [0.19667, 0.69667, 0, 0, 0.89444], + 8850: [0.19667, 0.69667, 0, 0, 0.89444], + 8851: [0, 0.55556, 0, 0, 0.76666], + 8852: [0, 0.55556, 0, 0, 0.76666], + 8853: [0.13333, 0.63333, 0, 0, 0.89444], + 8854: [0.13333, 0.63333, 0, 0, 0.89444], + 8855: [0.13333, 0.63333, 0, 0, 0.89444], + 8856: [0.13333, 0.63333, 0, 0, 0.89444], + 8857: [0.13333, 0.63333, 0, 0, 0.89444], + 8866: [0, 0.69444, 0, 0, 0.70277], + 8867: [0, 0.69444, 0, 0, 0.70277], + 8868: [0, 0.69444, 0, 0, 0.89444], + 8869: [0, 0.69444, 0, 0, 0.89444], + 8900: [-0.02639, 0.47361, 0, 0, 0.575], + 8901: [-0.02639, 0.47361, 0, 0, 0.31944], + 8902: [-0.02778, 0.47222, 0, 0, 0.575], + 8968: [0.25, 0.75, 0, 0, 0.51111], + 8969: [0.25, 0.75, 0, 0, 0.51111], + 8970: [0.25, 0.75, 0, 0, 0.51111], + 8971: [0.25, 0.75, 0, 0, 0.51111], + 8994: [-0.13889, 0.36111, 0, 0, 1.14999], + 8995: [-0.13889, 0.36111, 0, 0, 1.14999], + 9651: [0.19444, 0.69444, 0, 0, 1.02222], + 9657: [-0.02778, 0.47222, 0, 0, 0.575], + 9661: [0.19444, 0.69444, 0, 0, 1.02222], + 9667: [-0.02778, 0.47222, 0, 0, 0.575], + 9711: [0.19444, 0.69444, 0, 0, 1.14999], + 9824: [0.12963, 0.69444, 0, 0, 0.89444], + 9825: [0.12963, 0.69444, 0, 0, 0.89444], + 9826: [0.12963, 0.69444, 0, 0, 0.89444], + 9827: [0.12963, 0.69444, 0, 0, 0.89444], + 9837: [0, 0.75, 0, 0, 0.44722], + 9838: [0.19444, 0.69444, 0, 0, 0.44722], + 9839: [0.19444, 0.69444, 0, 0, 0.44722], + 10216: [0.25, 0.75, 0, 0, 0.44722], + 10217: [0.25, 0.75, 0, 0, 0.44722], + 10815: [0, 0.68611, 0, 0, 0.9], + 10927: [0.19667, 0.69667, 0, 0, 0.89444], + 10928: [0.19667, 0.69667, 0, 0, 0.89444], + 57376: [0.19444, 0.69444, 0, 0, 0], + }, + "Main-BoldItalic": { + 32: [0, 0, 0, 0, 0.25], + 33: [0, 0.69444, 0.11417, 0, 0.38611], + 34: [0, 0.69444, 0.07939, 0, 0.62055], + 35: [0.19444, 0.69444, 0.06833, 0, 0.94444], + 37: [0.05556, 0.75, 0.12861, 0, 0.94444], + 38: [0, 0.69444, 0.08528, 0, 0.88555], + 39: [0, 0.69444, 0.12945, 0, 0.35555], + 40: [0.25, 0.75, 0.15806, 0, 0.47333], + 41: [0.25, 0.75, 0.03306, 0, 0.47333], + 42: [0, 0.75, 0.14333, 0, 0.59111], + 43: [0.10333, 0.60333, 0.03306, 0, 0.88555], + 44: [0.19444, 0.14722, 0, 0, 0.35555], + 45: [0, 0.44444, 0.02611, 0, 0.41444], + 46: [0, 0.14722, 0, 0, 0.35555], + 47: [0.25, 0.75, 0.15806, 0, 0.59111], + 48: [0, 0.64444, 0.13167, 0, 0.59111], + 49: [0, 0.64444, 0.13167, 0, 0.59111], + 50: [0, 0.64444, 0.13167, 0, 0.59111], + 51: [0, 0.64444, 0.13167, 0, 0.59111], + 52: [0.19444, 0.64444, 0.13167, 0, 0.59111], + 53: [0, 0.64444, 0.13167, 0, 0.59111], + 54: [0, 0.64444, 0.13167, 0, 0.59111], + 55: [0.19444, 0.64444, 0.13167, 0, 0.59111], + 56: [0, 0.64444, 0.13167, 0, 0.59111], + 57: [0, 0.64444, 0.13167, 0, 0.59111], + 58: [0, 0.44444, 0.06695, 0, 0.35555], + 59: [0.19444, 0.44444, 0.06695, 0, 0.35555], + 61: [-0.10889, 0.39111, 0.06833, 0, 0.88555], + 63: [0, 0.69444, 0.11472, 0, 0.59111], + 64: [0, 0.69444, 0.09208, 0, 0.88555], + 65: [0, 0.68611, 0, 0, 0.86555], + 66: [0, 0.68611, 0.0992, 0, 0.81666], + 67: [0, 0.68611, 0.14208, 0, 0.82666], + 68: [0, 0.68611, 0.09062, 0, 0.87555], + 69: [0, 0.68611, 0.11431, 0, 0.75666], + 70: [0, 0.68611, 0.12903, 0, 0.72722], + 71: [0, 0.68611, 0.07347, 0, 0.89527], + 72: [0, 0.68611, 0.17208, 0, 0.8961], + 73: [0, 0.68611, 0.15681, 0, 0.47166], + 74: [0, 0.68611, 0.145, 0, 0.61055], + 75: [0, 0.68611, 0.14208, 0, 0.89499], + 76: [0, 0.68611, 0, 0, 0.69777], + 77: [0, 0.68611, 0.17208, 0, 1.07277], + 78: [0, 0.68611, 0.17208, 0, 0.8961], + 79: [0, 0.68611, 0.09062, 0, 0.85499], + 80: [0, 0.68611, 0.0992, 0, 0.78721], + 81: [0.19444, 0.68611, 0.09062, 0, 0.85499], + 82: [0, 0.68611, 0.02559, 0, 0.85944], + 83: [0, 0.68611, 0.11264, 0, 0.64999], + 84: [0, 0.68611, 0.12903, 0, 0.7961], + 85: [0, 0.68611, 0.17208, 0, 0.88083], + 86: [0, 0.68611, 0.18625, 0, 0.86555], + 87: [0, 0.68611, 0.18625, 0, 1.15999], + 88: [0, 0.68611, 0.15681, 0, 0.86555], + 89: [0, 0.68611, 0.19803, 0, 0.86555], + 90: [0, 0.68611, 0.14208, 0, 0.70888], + 91: [0.25, 0.75, 0.1875, 0, 0.35611], + 93: [0.25, 0.75, 0.09972, 0, 0.35611], + 94: [0, 0.69444, 0.06709, 0, 0.59111], + 95: [0.31, 0.13444, 0.09811, 0, 0.59111], + 97: [0, 0.44444, 0.09426, 0, 0.59111], + 98: [0, 0.69444, 0.07861, 0, 0.53222], + 99: [0, 0.44444, 0.05222, 0, 0.53222], + 100: [0, 0.69444, 0.10861, 0, 0.59111], + 101: [0, 0.44444, 0.085, 0, 0.53222], + 102: [0.19444, 0.69444, 0.21778, 0, 0.4], + 103: [0.19444, 0.44444, 0.105, 0, 0.53222], + 104: [0, 0.69444, 0.09426, 0, 0.59111], + 105: [0, 0.69326, 0.11387, 0, 0.35555], + 106: [0.19444, 0.69326, 0.1672, 0, 0.35555], + 107: [0, 0.69444, 0.11111, 0, 0.53222], + 108: [0, 0.69444, 0.10861, 0, 0.29666], + 109: [0, 0.44444, 0.09426, 0, 0.94444], + 110: [0, 0.44444, 0.09426, 0, 0.64999], + 111: [0, 0.44444, 0.07861, 0, 0.59111], + 112: [0.19444, 0.44444, 0.07861, 0, 0.59111], + 113: [0.19444, 0.44444, 0.105, 0, 0.53222], + 114: [0, 0.44444, 0.11111, 0, 0.50167], + 115: [0, 0.44444, 0.08167, 0, 0.48694], + 116: [0, 0.63492, 0.09639, 0, 0.385], + 117: [0, 0.44444, 0.09426, 0, 0.62055], + 118: [0, 0.44444, 0.11111, 0, 0.53222], + 119: [0, 0.44444, 0.11111, 0, 0.76777], + 120: [0, 0.44444, 0.12583, 0, 0.56055], + 121: [0.19444, 0.44444, 0.105, 0, 0.56166], + 122: [0, 0.44444, 0.13889, 0, 0.49055], + 126: [0.35, 0.34444, 0.11472, 0, 0.59111], + 160: [0, 0, 0, 0, 0.25], + 168: [0, 0.69444, 0.11473, 0, 0.59111], + 176: [0, 0.69444, 0, 0, 0.94888], + 184: [0.17014, 0, 0, 0, 0.53222], + 198: [0, 0.68611, 0.11431, 0, 1.02277], + 216: [0.04861, 0.73472, 0.09062, 0, 0.88555], + 223: [0.19444, 0.69444, 0.09736, 0, 0.665], + 230: [0, 0.44444, 0.085, 0, 0.82666], + 248: [0.09722, 0.54167, 0.09458, 0, 0.59111], + 305: [0, 0.44444, 0.09426, 0, 0.35555], + 338: [0, 0.68611, 0.11431, 0, 1.14054], + 339: [0, 0.44444, 0.085, 0, 0.82666], + 567: [0.19444, 0.44444, 0.04611, 0, 0.385], + 710: [0, 0.69444, 0.06709, 0, 0.59111], + 711: [0, 0.63194, 0.08271, 0, 0.59111], + 713: [0, 0.59444, 0.10444, 0, 0.59111], + 714: [0, 0.69444, 0.08528, 0, 0.59111], + 715: [0, 0.69444, 0, 0, 0.59111], + 728: [0, 0.69444, 0.10333, 0, 0.59111], + 729: [0, 0.69444, 0.12945, 0, 0.35555], + 730: [0, 0.69444, 0, 0, 0.94888], + 732: [0, 0.69444, 0.11472, 0, 0.59111], + 733: [0, 0.69444, 0.11472, 0, 0.59111], + 915: [0, 0.68611, 0.12903, 0, 0.69777], + 916: [0, 0.68611, 0, 0, 0.94444], + 920: [0, 0.68611, 0.09062, 0, 0.88555], + 923: [0, 0.68611, 0, 0, 0.80666], + 926: [0, 0.68611, 0.15092, 0, 0.76777], + 928: [0, 0.68611, 0.17208, 0, 0.8961], + 931: [0, 0.68611, 0.11431, 0, 0.82666], + 933: [0, 0.68611, 0.10778, 0, 0.88555], + 934: [0, 0.68611, 0.05632, 0, 0.82666], + 936: [0, 0.68611, 0.10778, 0, 0.88555], + 937: [0, 0.68611, 0.0992, 0, 0.82666], + 8211: [0, 0.44444, 0.09811, 0, 0.59111], + 8212: [0, 0.44444, 0.09811, 0, 1.18221], + 8216: [0, 0.69444, 0.12945, 0, 0.35555], + 8217: [0, 0.69444, 0.12945, 0, 0.35555], + 8220: [0, 0.69444, 0.16772, 0, 0.62055], + 8221: [0, 0.69444, 0.07939, 0, 0.62055], + }, + "Main-Italic": { + 32: [0, 0, 0, 0, 0.25], + 33: [0, 0.69444, 0.12417, 0, 0.30667], + 34: [0, 0.69444, 0.06961, 0, 0.51444], + 35: [0.19444, 0.69444, 0.06616, 0, 0.81777], + 37: [0.05556, 0.75, 0.13639, 0, 0.81777], + 38: [0, 0.69444, 0.09694, 0, 0.76666], + 39: [0, 0.69444, 0.12417, 0, 0.30667], + 40: [0.25, 0.75, 0.16194, 0, 0.40889], + 41: [0.25, 0.75, 0.03694, 0, 0.40889], + 42: [0, 0.75, 0.14917, 0, 0.51111], + 43: [0.05667, 0.56167, 0.03694, 0, 0.76666], + 44: [0.19444, 0.10556, 0, 0, 0.30667], + 45: [0, 0.43056, 0.02826, 0, 0.35778], + 46: [0, 0.10556, 0, 0, 0.30667], + 47: [0.25, 0.75, 0.16194, 0, 0.51111], + 48: [0, 0.64444, 0.13556, 0, 0.51111], + 49: [0, 0.64444, 0.13556, 0, 0.51111], + 50: [0, 0.64444, 0.13556, 0, 0.51111], + 51: [0, 0.64444, 0.13556, 0, 0.51111], + 52: [0.19444, 0.64444, 0.13556, 0, 0.51111], + 53: [0, 0.64444, 0.13556, 0, 0.51111], + 54: [0, 0.64444, 0.13556, 0, 0.51111], + 55: [0.19444, 0.64444, 0.13556, 0, 0.51111], + 56: [0, 0.64444, 0.13556, 0, 0.51111], + 57: [0, 0.64444, 0.13556, 0, 0.51111], + 58: [0, 0.43056, 0.0582, 0, 0.30667], + 59: [0.19444, 0.43056, 0.0582, 0, 0.30667], + 61: [-0.13313, 0.36687, 0.06616, 0, 0.76666], + 63: [0, 0.69444, 0.1225, 0, 0.51111], + 64: [0, 0.69444, 0.09597, 0, 0.76666], + 65: [0, 0.68333, 0, 0, 0.74333], + 66: [0, 0.68333, 0.10257, 0, 0.70389], + 67: [0, 0.68333, 0.14528, 0, 0.71555], + 68: [0, 0.68333, 0.09403, 0, 0.755], + 69: [0, 0.68333, 0.12028, 0, 0.67833], + 70: [0, 0.68333, 0.13305, 0, 0.65277], + 71: [0, 0.68333, 0.08722, 0, 0.77361], + 72: [0, 0.68333, 0.16389, 0, 0.74333], + 73: [0, 0.68333, 0.15806, 0, 0.38555], + 74: [0, 0.68333, 0.14028, 0, 0.525], + 75: [0, 0.68333, 0.14528, 0, 0.76888], + 76: [0, 0.68333, 0, 0, 0.62722], + 77: [0, 0.68333, 0.16389, 0, 0.89666], + 78: [0, 0.68333, 0.16389, 0, 0.74333], + 79: [0, 0.68333, 0.09403, 0, 0.76666], + 80: [0, 0.68333, 0.10257, 0, 0.67833], + 81: [0.19444, 0.68333, 0.09403, 0, 0.76666], + 82: [0, 0.68333, 0.03868, 0, 0.72944], + 83: [0, 0.68333, 0.11972, 0, 0.56222], + 84: [0, 0.68333, 0.13305, 0, 0.71555], + 85: [0, 0.68333, 0.16389, 0, 0.74333], + 86: [0, 0.68333, 0.18361, 0, 0.74333], + 87: [0, 0.68333, 0.18361, 0, 0.99888], + 88: [0, 0.68333, 0.15806, 0, 0.74333], + 89: [0, 0.68333, 0.19383, 0, 0.74333], + 90: [0, 0.68333, 0.14528, 0, 0.61333], + 91: [0.25, 0.75, 0.1875, 0, 0.30667], + 93: [0.25, 0.75, 0.10528, 0, 0.30667], + 94: [0, 0.69444, 0.06646, 0, 0.51111], + 95: [0.31, 0.12056, 0.09208, 0, 0.51111], + 97: [0, 0.43056, 0.07671, 0, 0.51111], + 98: [0, 0.69444, 0.06312, 0, 0.46], + 99: [0, 0.43056, 0.05653, 0, 0.46], + 100: [0, 0.69444, 0.10333, 0, 0.51111], + 101: [0, 0.43056, 0.07514, 0, 0.46], + 102: [0.19444, 0.69444, 0.21194, 0, 0.30667], + 103: [0.19444, 0.43056, 0.08847, 0, 0.46], + 104: [0, 0.69444, 0.07671, 0, 0.51111], + 105: [0, 0.65536, 0.1019, 0, 0.30667], + 106: [0.19444, 0.65536, 0.14467, 0, 0.30667], + 107: [0, 0.69444, 0.10764, 0, 0.46], + 108: [0, 0.69444, 0.10333, 0, 0.25555], + 109: [0, 0.43056, 0.07671, 0, 0.81777], + 110: [0, 0.43056, 0.07671, 0, 0.56222], + 111: [0, 0.43056, 0.06312, 0, 0.51111], + 112: [0.19444, 0.43056, 0.06312, 0, 0.51111], + 113: [0.19444, 0.43056, 0.08847, 0, 0.46], + 114: [0, 0.43056, 0.10764, 0, 0.42166], + 115: [0, 0.43056, 0.08208, 0, 0.40889], + 116: [0, 0.61508, 0.09486, 0, 0.33222], + 117: [0, 0.43056, 0.07671, 0, 0.53666], + 118: [0, 0.43056, 0.10764, 0, 0.46], + 119: [0, 0.43056, 0.10764, 0, 0.66444], + 120: [0, 0.43056, 0.12042, 0, 0.46389], + 121: [0.19444, 0.43056, 0.08847, 0, 0.48555], + 122: [0, 0.43056, 0.12292, 0, 0.40889], + 126: [0.35, 0.31786, 0.11585, 0, 0.51111], + 160: [0, 0, 0, 0, 0.25], + 168: [0, 0.66786, 0.10474, 0, 0.51111], + 176: [0, 0.69444, 0, 0, 0.83129], + 184: [0.17014, 0, 0, 0, 0.46], + 198: [0, 0.68333, 0.12028, 0, 0.88277], + 216: [0.04861, 0.73194, 0.09403, 0, 0.76666], + 223: [0.19444, 0.69444, 0.10514, 0, 0.53666], + 230: [0, 0.43056, 0.07514, 0, 0.71555], + 248: [0.09722, 0.52778, 0.09194, 0, 0.51111], + 338: [0, 0.68333, 0.12028, 0, 0.98499], + 339: [0, 0.43056, 0.07514, 0, 0.71555], + 710: [0, 0.69444, 0.06646, 0, 0.51111], + 711: [0, 0.62847, 0.08295, 0, 0.51111], + 713: [0, 0.56167, 0.10333, 0, 0.51111], + 714: [0, 0.69444, 0.09694, 0, 0.51111], + 715: [0, 0.69444, 0, 0, 0.51111], + 728: [0, 0.69444, 0.10806, 0, 0.51111], + 729: [0, 0.66786, 0.11752, 0, 0.30667], + 730: [0, 0.69444, 0, 0, 0.83129], + 732: [0, 0.66786, 0.11585, 0, 0.51111], + 733: [0, 0.69444, 0.1225, 0, 0.51111], + 915: [0, 0.68333, 0.13305, 0, 0.62722], + 916: [0, 0.68333, 0, 0, 0.81777], + 920: [0, 0.68333, 0.09403, 0, 0.76666], + 923: [0, 0.68333, 0, 0, 0.69222], + 926: [0, 0.68333, 0.15294, 0, 0.66444], + 928: [0, 0.68333, 0.16389, 0, 0.74333], + 931: [0, 0.68333, 0.12028, 0, 0.71555], + 933: [0, 0.68333, 0.11111, 0, 0.76666], + 934: [0, 0.68333, 0.05986, 0, 0.71555], + 936: [0, 0.68333, 0.11111, 0, 0.76666], + 937: [0, 0.68333, 0.10257, 0, 0.71555], + 8211: [0, 0.43056, 0.09208, 0, 0.51111], + 8212: [0, 0.43056, 0.09208, 0, 1.02222], + 8216: [0, 0.69444, 0.12417, 0, 0.30667], + 8217: [0, 0.69444, 0.12417, 0, 0.30667], + 8220: [0, 0.69444, 0.1685, 0, 0.51444], + 8221: [0, 0.69444, 0.06961, 0, 0.51444], + 8463: [0, 0.68889, 0, 0, 0.54028], + }, + "Main-Regular": { + 32: [0, 0, 0, 0, 0.25], + 33: [0, 0.69444, 0, 0, 0.27778], + 34: [0, 0.69444, 0, 0, 0.5], + 35: [0.19444, 0.69444, 0, 0, 0.83334], + 36: [0.05556, 0.75, 0, 0, 0.5], + 37: [0.05556, 0.75, 0, 0, 0.83334], + 38: [0, 0.69444, 0, 0, 0.77778], + 39: [0, 0.69444, 0, 0, 0.27778], + 40: [0.25, 0.75, 0, 0, 0.38889], + 41: [0.25, 0.75, 0, 0, 0.38889], + 42: [0, 0.75, 0, 0, 0.5], + 43: [0.08333, 0.58333, 0, 0, 0.77778], + 44: [0.19444, 0.10556, 0, 0, 0.27778], + 45: [0, 0.43056, 0, 0, 0.33333], + 46: [0, 0.10556, 0, 0, 0.27778], + 47: [0.25, 0.75, 0, 0, 0.5], + 48: [0, 0.64444, 0, 0, 0.5], + 49: [0, 0.64444, 0, 0, 0.5], + 50: [0, 0.64444, 0, 0, 0.5], + 51: [0, 0.64444, 0, 0, 0.5], + 52: [0, 0.64444, 0, 0, 0.5], + 53: [0, 0.64444, 0, 0, 0.5], + 54: [0, 0.64444, 0, 0, 0.5], + 55: [0, 0.64444, 0, 0, 0.5], + 56: [0, 0.64444, 0, 0, 0.5], + 57: [0, 0.64444, 0, 0, 0.5], + 58: [0, 0.43056, 0, 0, 0.27778], + 59: [0.19444, 0.43056, 0, 0, 0.27778], + 60: [0.0391, 0.5391, 0, 0, 0.77778], + 61: [-0.13313, 0.36687, 0, 0, 0.77778], + 62: [0.0391, 0.5391, 0, 0, 0.77778], + 63: [0, 0.69444, 0, 0, 0.47222], + 64: [0, 0.69444, 0, 0, 0.77778], + 65: [0, 0.68333, 0, 0, 0.75], + 66: [0, 0.68333, 0, 0, 0.70834], + 67: [0, 0.68333, 0, 0, 0.72222], + 68: [0, 0.68333, 0, 0, 0.76389], + 69: [0, 0.68333, 0, 0, 0.68056], + 70: [0, 0.68333, 0, 0, 0.65278], + 71: [0, 0.68333, 0, 0, 0.78472], + 72: [0, 0.68333, 0, 0, 0.75], + 73: [0, 0.68333, 0, 0, 0.36111], + 74: [0, 0.68333, 0, 0, 0.51389], + 75: [0, 0.68333, 0, 0, 0.77778], + 76: [0, 0.68333, 0, 0, 0.625], + 77: [0, 0.68333, 0, 0, 0.91667], + 78: [0, 0.68333, 0, 0, 0.75], + 79: [0, 0.68333, 0, 0, 0.77778], + 80: [0, 0.68333, 0, 0, 0.68056], + 81: [0.19444, 0.68333, 0, 0, 0.77778], + 82: [0, 0.68333, 0, 0, 0.73611], + 83: [0, 0.68333, 0, 0, 0.55556], + 84: [0, 0.68333, 0, 0, 0.72222], + 85: [0, 0.68333, 0, 0, 0.75], + 86: [0, 0.68333, 0.01389, 0, 0.75], + 87: [0, 0.68333, 0.01389, 0, 1.02778], + 88: [0, 0.68333, 0, 0, 0.75], + 89: [0, 0.68333, 0.025, 0, 0.75], + 90: [0, 0.68333, 0, 0, 0.61111], + 91: [0.25, 0.75, 0, 0, 0.27778], + 92: [0.25, 0.75, 0, 0, 0.5], + 93: [0.25, 0.75, 0, 0, 0.27778], + 94: [0, 0.69444, 0, 0, 0.5], + 95: [0.31, 0.12056, 0.02778, 0, 0.5], + 97: [0, 0.43056, 0, 0, 0.5], + 98: [0, 0.69444, 0, 0, 0.55556], + 99: [0, 0.43056, 0, 0, 0.44445], + 100: [0, 0.69444, 0, 0, 0.55556], + 101: [0, 0.43056, 0, 0, 0.44445], + 102: [0, 0.69444, 0.07778, 0, 0.30556], + 103: [0.19444, 0.43056, 0.01389, 0, 0.5], + 104: [0, 0.69444, 0, 0, 0.55556], + 105: [0, 0.66786, 0, 0, 0.27778], + 106: [0.19444, 0.66786, 0, 0, 0.30556], + 107: [0, 0.69444, 0, 0, 0.52778], + 108: [0, 0.69444, 0, 0, 0.27778], + 109: [0, 0.43056, 0, 0, 0.83334], + 110: [0, 0.43056, 0, 0, 0.55556], + 111: [0, 0.43056, 0, 0, 0.5], + 112: [0.19444, 0.43056, 0, 0, 0.55556], + 113: [0.19444, 0.43056, 0, 0, 0.52778], + 114: [0, 0.43056, 0, 0, 0.39167], + 115: [0, 0.43056, 0, 0, 0.39445], + 116: [0, 0.61508, 0, 0, 0.38889], + 117: [0, 0.43056, 0, 0, 0.55556], + 118: [0, 0.43056, 0.01389, 0, 0.52778], + 119: [0, 0.43056, 0.01389, 0, 0.72222], + 120: [0, 0.43056, 0, 0, 0.52778], + 121: [0.19444, 0.43056, 0.01389, 0, 0.52778], + 122: [0, 0.43056, 0, 0, 0.44445], + 123: [0.25, 0.75, 0, 0, 0.5], + 124: [0.25, 0.75, 0, 0, 0.27778], + 125: [0.25, 0.75, 0, 0, 0.5], + 126: [0.35, 0.31786, 0, 0, 0.5], + 160: [0, 0, 0, 0, 0.25], + 163: [0, 0.69444, 0, 0, 0.76909], + 167: [0.19444, 0.69444, 0, 0, 0.44445], + 168: [0, 0.66786, 0, 0, 0.5], + 172: [0, 0.43056, 0, 0, 0.66667], + 176: [0, 0.69444, 0, 0, 0.75], + 177: [0.08333, 0.58333, 0, 0, 0.77778], + 182: [0.19444, 0.69444, 0, 0, 0.61111], + 184: [0.17014, 0, 0, 0, 0.44445], + 198: [0, 0.68333, 0, 0, 0.90278], + 215: [0.08333, 0.58333, 0, 0, 0.77778], + 216: [0.04861, 0.73194, 0, 0, 0.77778], + 223: [0, 0.69444, 0, 0, 0.5], + 230: [0, 0.43056, 0, 0, 0.72222], + 247: [0.08333, 0.58333, 0, 0, 0.77778], + 248: [0.09722, 0.52778, 0, 0, 0.5], + 305: [0, 0.43056, 0, 0, 0.27778], + 338: [0, 0.68333, 0, 0, 1.01389], + 339: [0, 0.43056, 0, 0, 0.77778], + 567: [0.19444, 0.43056, 0, 0, 0.30556], + 710: [0, 0.69444, 0, 0, 0.5], + 711: [0, 0.62847, 0, 0, 0.5], + 713: [0, 0.56778, 0, 0, 0.5], + 714: [0, 0.69444, 0, 0, 0.5], + 715: [0, 0.69444, 0, 0, 0.5], + 728: [0, 0.69444, 0, 0, 0.5], + 729: [0, 0.66786, 0, 0, 0.27778], + 730: [0, 0.69444, 0, 0, 0.75], + 732: [0, 0.66786, 0, 0, 0.5], + 733: [0, 0.69444, 0, 0, 0.5], + 915: [0, 0.68333, 0, 0, 0.625], + 916: [0, 0.68333, 0, 0, 0.83334], + 920: [0, 0.68333, 0, 0, 0.77778], + 923: [0, 0.68333, 0, 0, 0.69445], + 926: [0, 0.68333, 0, 0, 0.66667], + 928: [0, 0.68333, 0, 0, 0.75], + 931: [0, 0.68333, 0, 0, 0.72222], + 933: [0, 0.68333, 0, 0, 0.77778], + 934: [0, 0.68333, 0, 0, 0.72222], + 936: [0, 0.68333, 0, 0, 0.77778], + 937: [0, 0.68333, 0, 0, 0.72222], + 8211: [0, 0.43056, 0.02778, 0, 0.5], + 8212: [0, 0.43056, 0.02778, 0, 1], + 8216: [0, 0.69444, 0, 0, 0.27778], + 8217: [0, 0.69444, 0, 0, 0.27778], + 8220: [0, 0.69444, 0, 0, 0.5], + 8221: [0, 0.69444, 0, 0, 0.5], + 8224: [0.19444, 0.69444, 0, 0, 0.44445], + 8225: [0.19444, 0.69444, 0, 0, 0.44445], + 8230: [0, 0.123, 0, 0, 1.172], + 8242: [0, 0.55556, 0, 0, 0.275], + 8407: [0, 0.71444, 0.15382, 0, 0.5], + 8463: [0, 0.68889, 0, 0, 0.54028], + 8465: [0, 0.69444, 0, 0, 0.72222], + 8467: [0, 0.69444, 0, 0.11111, 0.41667], + 8472: [0.19444, 0.43056, 0, 0.11111, 0.63646], + 8476: [0, 0.69444, 0, 0, 0.72222], + 8501: [0, 0.69444, 0, 0, 0.61111], + 8592: [-0.13313, 0.36687, 0, 0, 1], + 8593: [0.19444, 0.69444, 0, 0, 0.5], + 8594: [-0.13313, 0.36687, 0, 0, 1], + 8595: [0.19444, 0.69444, 0, 0, 0.5], + 8596: [-0.13313, 0.36687, 0, 0, 1], + 8597: [0.25, 0.75, 0, 0, 0.5], + 8598: [0.19444, 0.69444, 0, 0, 1], + 8599: [0.19444, 0.69444, 0, 0, 1], + 8600: [0.19444, 0.69444, 0, 0, 1], + 8601: [0.19444, 0.69444, 0, 0, 1], + 8614: [0.011, 0.511, 0, 0, 1], + 8617: [0.011, 0.511, 0, 0, 1.126], + 8618: [0.011, 0.511, 0, 0, 1.126], + 8636: [-0.13313, 0.36687, 0, 0, 1], + 8637: [-0.13313, 0.36687, 0, 0, 1], + 8640: [-0.13313, 0.36687, 0, 0, 1], + 8641: [-0.13313, 0.36687, 0, 0, 1], + 8652: [0.011, 0.671, 0, 0, 1], + 8656: [-0.13313, 0.36687, 0, 0, 1], + 8657: [0.19444, 0.69444, 0, 0, 0.61111], + 8658: [-0.13313, 0.36687, 0, 0, 1], + 8659: [0.19444, 0.69444, 0, 0, 0.61111], + 8660: [-0.13313, 0.36687, 0, 0, 1], + 8661: [0.25, 0.75, 0, 0, 0.61111], + 8704: [0, 0.69444, 0, 0, 0.55556], + 8706: [0, 0.69444, 0.05556, 0.08334, 0.5309], + 8707: [0, 0.69444, 0, 0, 0.55556], + 8709: [0.05556, 0.75, 0, 0, 0.5], + 8711: [0, 0.68333, 0, 0, 0.83334], + 8712: [0.0391, 0.5391, 0, 0, 0.66667], + 8715: [0.0391, 0.5391, 0, 0, 0.66667], + 8722: [0.08333, 0.58333, 0, 0, 0.77778], + 8723: [0.08333, 0.58333, 0, 0, 0.77778], + 8725: [0.25, 0.75, 0, 0, 0.5], + 8726: [0.25, 0.75, 0, 0, 0.5], + 8727: [-0.03472, 0.46528, 0, 0, 0.5], + 8728: [-0.05555, 0.44445, 0, 0, 0.5], + 8729: [-0.05555, 0.44445, 0, 0, 0.5], + 8730: [0.2, 0.8, 0, 0, 0.83334], + 8733: [0, 0.43056, 0, 0, 0.77778], + 8734: [0, 0.43056, 0, 0, 1], + 8736: [0, 0.69224, 0, 0, 0.72222], + 8739: [0.25, 0.75, 0, 0, 0.27778], + 8741: [0.25, 0.75, 0, 0, 0.5], + 8743: [0, 0.55556, 0, 0, 0.66667], + 8744: [0, 0.55556, 0, 0, 0.66667], + 8745: [0, 0.55556, 0, 0, 0.66667], + 8746: [0, 0.55556, 0, 0, 0.66667], + 8747: [0.19444, 0.69444, 0.11111, 0, 0.41667], + 8764: [-0.13313, 0.36687, 0, 0, 0.77778], + 8768: [0.19444, 0.69444, 0, 0, 0.27778], + 8771: [-0.03625, 0.46375, 0, 0, 0.77778], + 8773: [-0.022, 0.589, 0, 0, 0.778], + 8776: [-0.01688, 0.48312, 0, 0, 0.77778], + 8781: [-0.03625, 0.46375, 0, 0, 0.77778], + 8784: [-0.133, 0.673, 0, 0, 0.778], + 8801: [-0.03625, 0.46375, 0, 0, 0.77778], + 8804: [0.13597, 0.63597, 0, 0, 0.77778], + 8805: [0.13597, 0.63597, 0, 0, 0.77778], + 8810: [0.0391, 0.5391, 0, 0, 1], + 8811: [0.0391, 0.5391, 0, 0, 1], + 8826: [0.0391, 0.5391, 0, 0, 0.77778], + 8827: [0.0391, 0.5391, 0, 0, 0.77778], + 8834: [0.0391, 0.5391, 0, 0, 0.77778], + 8835: [0.0391, 0.5391, 0, 0, 0.77778], + 8838: [0.13597, 0.63597, 0, 0, 0.77778], + 8839: [0.13597, 0.63597, 0, 0, 0.77778], + 8846: [0, 0.55556, 0, 0, 0.66667], + 8849: [0.13597, 0.63597, 0, 0, 0.77778], + 8850: [0.13597, 0.63597, 0, 0, 0.77778], + 8851: [0, 0.55556, 0, 0, 0.66667], + 8852: [0, 0.55556, 0, 0, 0.66667], + 8853: [0.08333, 0.58333, 0, 0, 0.77778], + 8854: [0.08333, 0.58333, 0, 0, 0.77778], + 8855: [0.08333, 0.58333, 0, 0, 0.77778], + 8856: [0.08333, 0.58333, 0, 0, 0.77778], + 8857: [0.08333, 0.58333, 0, 0, 0.77778], + 8866: [0, 0.69444, 0, 0, 0.61111], + 8867: [0, 0.69444, 0, 0, 0.61111], + 8868: [0, 0.69444, 0, 0, 0.77778], + 8869: [0, 0.69444, 0, 0, 0.77778], + 8872: [0.249, 0.75, 0, 0, 0.867], + 8900: [-0.05555, 0.44445, 0, 0, 0.5], + 8901: [-0.05555, 0.44445, 0, 0, 0.27778], + 8902: [-0.03472, 0.46528, 0, 0, 0.5], + 8904: [0.005, 0.505, 0, 0, 0.9], + 8942: [0.03, 0.903, 0, 0, 0.278], + 8943: [-0.19, 0.313, 0, 0, 1.172], + 8945: [-0.1, 0.823, 0, 0, 1.282], + 8968: [0.25, 0.75, 0, 0, 0.44445], + 8969: [0.25, 0.75, 0, 0, 0.44445], + 8970: [0.25, 0.75, 0, 0, 0.44445], + 8971: [0.25, 0.75, 0, 0, 0.44445], + 8994: [-0.14236, 0.35764, 0, 0, 1], + 8995: [-0.14236, 0.35764, 0, 0, 1], + 9136: [0.244, 0.744, 0, 0, 0.412], + 9137: [0.244, 0.745, 0, 0, 0.412], + 9651: [0.19444, 0.69444, 0, 0, 0.88889], + 9657: [-0.03472, 0.46528, 0, 0, 0.5], + 9661: [0.19444, 0.69444, 0, 0, 0.88889], + 9667: [-0.03472, 0.46528, 0, 0, 0.5], + 9711: [0.19444, 0.69444, 0, 0, 1], + 9824: [0.12963, 0.69444, 0, 0, 0.77778], + 9825: [0.12963, 0.69444, 0, 0, 0.77778], + 9826: [0.12963, 0.69444, 0, 0, 0.77778], + 9827: [0.12963, 0.69444, 0, 0, 0.77778], + 9837: [0, 0.75, 0, 0, 0.38889], + 9838: [0.19444, 0.69444, 0, 0, 0.38889], + 9839: [0.19444, 0.69444, 0, 0, 0.38889], + 10216: [0.25, 0.75, 0, 0, 0.38889], + 10217: [0.25, 0.75, 0, 0, 0.38889], + 10222: [0.244, 0.744, 0, 0, 0.412], + 10223: [0.244, 0.745, 0, 0, 0.412], + 10229: [0.011, 0.511, 0, 0, 1.609], + 10230: [0.011, 0.511, 0, 0, 1.638], + 10231: [0.011, 0.511, 0, 0, 1.859], + 10232: [0.024, 0.525, 0, 0, 1.609], + 10233: [0.024, 0.525, 0, 0, 1.638], + 10234: [0.024, 0.525, 0, 0, 1.858], + 10236: [0.011, 0.511, 0, 0, 1.638], + 10815: [0, 0.68333, 0, 0, 0.75], + 10927: [0.13597, 0.63597, 0, 0, 0.77778], + 10928: [0.13597, 0.63597, 0, 0, 0.77778], + 57376: [0.19444, 0.69444, 0, 0, 0], + }, + "Math-BoldItalic": { + 32: [0, 0, 0, 0, 0.25], + 48: [0, 0.44444, 0, 0, 0.575], + 49: [0, 0.44444, 0, 0, 0.575], + 50: [0, 0.44444, 0, 0, 0.575], + 51: [0.19444, 0.44444, 0, 0, 0.575], + 52: [0.19444, 0.44444, 0, 0, 0.575], + 53: [0.19444, 0.44444, 0, 0, 0.575], + 54: [0, 0.64444, 0, 0, 0.575], + 55: [0.19444, 0.44444, 0, 0, 0.575], + 56: [0, 0.64444, 0, 0, 0.575], + 57: [0.19444, 0.44444, 0, 0, 0.575], + 65: [0, 0.68611, 0, 0, 0.86944], + 66: [0, 0.68611, 0.04835, 0, 0.8664], + 67: [0, 0.68611, 0.06979, 0, 0.81694], + 68: [0, 0.68611, 0.03194, 0, 0.93812], + 69: [0, 0.68611, 0.05451, 0, 0.81007], + 70: [0, 0.68611, 0.15972, 0, 0.68889], + 71: [0, 0.68611, 0, 0, 0.88673], + 72: [0, 0.68611, 0.08229, 0, 0.98229], + 73: [0, 0.68611, 0.07778, 0, 0.51111], + 74: [0, 0.68611, 0.10069, 0, 0.63125], + 75: [0, 0.68611, 0.06979, 0, 0.97118], + 76: [0, 0.68611, 0, 0, 0.75555], + 77: [0, 0.68611, 0.11424, 0, 1.14201], + 78: [0, 0.68611, 0.11424, 0, 0.95034], + 79: [0, 0.68611, 0.03194, 0, 0.83666], + 80: [0, 0.68611, 0.15972, 0, 0.72309], + 81: [0.19444, 0.68611, 0, 0, 0.86861], + 82: [0, 0.68611, 0.00421, 0, 0.87235], + 83: [0, 0.68611, 0.05382, 0, 0.69271], + 84: [0, 0.68611, 0.15972, 0, 0.63663], + 85: [0, 0.68611, 0.11424, 0, 0.80027], + 86: [0, 0.68611, 0.25555, 0, 0.67778], + 87: [0, 0.68611, 0.15972, 0, 1.09305], + 88: [0, 0.68611, 0.07778, 0, 0.94722], + 89: [0, 0.68611, 0.25555, 0, 0.67458], + 90: [0, 0.68611, 0.06979, 0, 0.77257], + 97: [0, 0.44444, 0, 0, 0.63287], + 98: [0, 0.69444, 0, 0, 0.52083], + 99: [0, 0.44444, 0, 0, 0.51342], + 100: [0, 0.69444, 0, 0, 0.60972], + 101: [0, 0.44444, 0, 0, 0.55361], + 102: [0.19444, 0.69444, 0.11042, 0, 0.56806], + 103: [0.19444, 0.44444, 0.03704, 0, 0.5449], + 104: [0, 0.69444, 0, 0, 0.66759], + 105: [0, 0.69326, 0, 0, 0.4048], + 106: [0.19444, 0.69326, 0.0622, 0, 0.47083], + 107: [0, 0.69444, 0.01852, 0, 0.6037], + 108: [0, 0.69444, 0.0088, 0, 0.34815], + 109: [0, 0.44444, 0, 0, 1.0324], + 110: [0, 0.44444, 0, 0, 0.71296], + 111: [0, 0.44444, 0, 0, 0.58472], + 112: [0.19444, 0.44444, 0, 0, 0.60092], + 113: [0.19444, 0.44444, 0.03704, 0, 0.54213], + 114: [0, 0.44444, 0.03194, 0, 0.5287], + 115: [0, 0.44444, 0, 0, 0.53125], + 116: [0, 0.63492, 0, 0, 0.41528], + 117: [0, 0.44444, 0, 0, 0.68102], + 118: [0, 0.44444, 0.03704, 0, 0.56666], + 119: [0, 0.44444, 0.02778, 0, 0.83148], + 120: [0, 0.44444, 0, 0, 0.65903], + 121: [0.19444, 0.44444, 0.03704, 0, 0.59028], + 122: [0, 0.44444, 0.04213, 0, 0.55509], + 160: [0, 0, 0, 0, 0.25], + 915: [0, 0.68611, 0.15972, 0, 0.65694], + 916: [0, 0.68611, 0, 0, 0.95833], + 920: [0, 0.68611, 0.03194, 0, 0.86722], + 923: [0, 0.68611, 0, 0, 0.80555], + 926: [0, 0.68611, 0.07458, 0, 0.84125], + 928: [0, 0.68611, 0.08229, 0, 0.98229], + 931: [0, 0.68611, 0.05451, 0, 0.88507], + 933: [0, 0.68611, 0.15972, 0, 0.67083], + 934: [0, 0.68611, 0, 0, 0.76666], + 936: [0, 0.68611, 0.11653, 0, 0.71402], + 937: [0, 0.68611, 0.04835, 0, 0.8789], + 945: [0, 0.44444, 0, 0, 0.76064], + 946: [0.19444, 0.69444, 0.03403, 0, 0.65972], + 947: [0.19444, 0.44444, 0.06389, 0, 0.59003], + 948: [0, 0.69444, 0.03819, 0, 0.52222], + 949: [0, 0.44444, 0, 0, 0.52882], + 950: [0.19444, 0.69444, 0.06215, 0, 0.50833], + 951: [0.19444, 0.44444, 0.03704, 0, 0.6], + 952: [0, 0.69444, 0.03194, 0, 0.5618], + 953: [0, 0.44444, 0, 0, 0.41204], + 954: [0, 0.44444, 0, 0, 0.66759], + 955: [0, 0.69444, 0, 0, 0.67083], + 956: [0.19444, 0.44444, 0, 0, 0.70787], + 957: [0, 0.44444, 0.06898, 0, 0.57685], + 958: [0.19444, 0.69444, 0.03021, 0, 0.50833], + 959: [0, 0.44444, 0, 0, 0.58472], + 960: [0, 0.44444, 0.03704, 0, 0.68241], + 961: [0.19444, 0.44444, 0, 0, 0.6118], + 962: [0.09722, 0.44444, 0.07917, 0, 0.42361], + 963: [0, 0.44444, 0.03704, 0, 0.68588], + 964: [0, 0.44444, 0.13472, 0, 0.52083], + 965: [0, 0.44444, 0.03704, 0, 0.63055], + 966: [0.19444, 0.44444, 0, 0, 0.74722], + 967: [0.19444, 0.44444, 0, 0, 0.71805], + 968: [0.19444, 0.69444, 0.03704, 0, 0.75833], + 969: [0, 0.44444, 0.03704, 0, 0.71782], + 977: [0, 0.69444, 0, 0, 0.69155], + 981: [0.19444, 0.69444, 0, 0, 0.7125], + 982: [0, 0.44444, 0.03194, 0, 0.975], + 1009: [0.19444, 0.44444, 0, 0, 0.6118], + 1013: [0, 0.44444, 0, 0, 0.48333], + 57649: [0, 0.44444, 0, 0, 0.39352], + 57911: [0.19444, 0.44444, 0, 0, 0.43889], + }, + "Math-Italic": { + 32: [0, 0, 0, 0, 0.25], + 48: [0, 0.43056, 0, 0, 0.5], + 49: [0, 0.43056, 0, 0, 0.5], + 50: [0, 0.43056, 0, 0, 0.5], + 51: [0.19444, 0.43056, 0, 0, 0.5], + 52: [0.19444, 0.43056, 0, 0, 0.5], + 53: [0.19444, 0.43056, 0, 0, 0.5], + 54: [0, 0.64444, 0, 0, 0.5], + 55: [0.19444, 0.43056, 0, 0, 0.5], + 56: [0, 0.64444, 0, 0, 0.5], + 57: [0.19444, 0.43056, 0, 0, 0.5], + 65: [0, 0.68333, 0, 0.13889, 0.75], + 66: [0, 0.68333, 0.05017, 0.08334, 0.75851], + 67: [0, 0.68333, 0.07153, 0.08334, 0.71472], + 68: [0, 0.68333, 0.02778, 0.05556, 0.82792], + 69: [0, 0.68333, 0.05764, 0.08334, 0.7382], + 70: [0, 0.68333, 0.13889, 0.08334, 0.64306], + 71: [0, 0.68333, 0, 0.08334, 0.78625], + 72: [0, 0.68333, 0.08125, 0.05556, 0.83125], + 73: [0, 0.68333, 0.07847, 0.11111, 0.43958], + 74: [0, 0.68333, 0.09618, 0.16667, 0.55451], + 75: [0, 0.68333, 0.07153, 0.05556, 0.84931], + 76: [0, 0.68333, 0, 0.02778, 0.68056], + 77: [0, 0.68333, 0.10903, 0.08334, 0.97014], + 78: [0, 0.68333, 0.10903, 0.08334, 0.80347], + 79: [0, 0.68333, 0.02778, 0.08334, 0.76278], + 80: [0, 0.68333, 0.13889, 0.08334, 0.64201], + 81: [0.19444, 0.68333, 0, 0.08334, 0.79056], + 82: [0, 0.68333, 0.00773, 0.08334, 0.75929], + 83: [0, 0.68333, 0.05764, 0.08334, 0.6132], + 84: [0, 0.68333, 0.13889, 0.08334, 0.58438], + 85: [0, 0.68333, 0.10903, 0.02778, 0.68278], + 86: [0, 0.68333, 0.22222, 0, 0.58333], + 87: [0, 0.68333, 0.13889, 0, 0.94445], + 88: [0, 0.68333, 0.07847, 0.08334, 0.82847], + 89: [0, 0.68333, 0.22222, 0, 0.58056], + 90: [0, 0.68333, 0.07153, 0.08334, 0.68264], + 97: [0, 0.43056, 0, 0, 0.52859], + 98: [0, 0.69444, 0, 0, 0.42917], + 99: [0, 0.43056, 0, 0.05556, 0.43276], + 100: [0, 0.69444, 0, 0.16667, 0.52049], + 101: [0, 0.43056, 0, 0.05556, 0.46563], + 102: [0.19444, 0.69444, 0.10764, 0.16667, 0.48959], + 103: [0.19444, 0.43056, 0.03588, 0.02778, 0.47697], + 104: [0, 0.69444, 0, 0, 0.57616], + 105: [0, 0.65952, 0, 0, 0.34451], + 106: [0.19444, 0.65952, 0.05724, 0, 0.41181], + 107: [0, 0.69444, 0.03148, 0, 0.5206], + 108: [0, 0.69444, 0.01968, 0.08334, 0.29838], + 109: [0, 0.43056, 0, 0, 0.87801], + 110: [0, 0.43056, 0, 0, 0.60023], + 111: [0, 0.43056, 0, 0.05556, 0.48472], + 112: [0.19444, 0.43056, 0, 0.08334, 0.50313], + 113: [0.19444, 0.43056, 0.03588, 0.08334, 0.44641], + 114: [0, 0.43056, 0.02778, 0.05556, 0.45116], + 115: [0, 0.43056, 0, 0.05556, 0.46875], + 116: [0, 0.61508, 0, 0.08334, 0.36111], + 117: [0, 0.43056, 0, 0.02778, 0.57246], + 118: [0, 0.43056, 0.03588, 0.02778, 0.48472], + 119: [0, 0.43056, 0.02691, 0.08334, 0.71592], + 120: [0, 0.43056, 0, 0.02778, 0.57153], + 121: [0.19444, 0.43056, 0.03588, 0.05556, 0.49028], + 122: [0, 0.43056, 0.04398, 0.05556, 0.46505], + 160: [0, 0, 0, 0, 0.25], + 915: [0, 0.68333, 0.13889, 0.08334, 0.61528], + 916: [0, 0.68333, 0, 0.16667, 0.83334], + 920: [0, 0.68333, 0.02778, 0.08334, 0.76278], + 923: [0, 0.68333, 0, 0.16667, 0.69445], + 926: [0, 0.68333, 0.07569, 0.08334, 0.74236], + 928: [0, 0.68333, 0.08125, 0.05556, 0.83125], + 931: [0, 0.68333, 0.05764, 0.08334, 0.77986], + 933: [0, 0.68333, 0.13889, 0.05556, 0.58333], + 934: [0, 0.68333, 0, 0.08334, 0.66667], + 936: [0, 0.68333, 0.11, 0.05556, 0.61222], + 937: [0, 0.68333, 0.05017, 0.08334, 0.7724], + 945: [0, 0.43056, 0.0037, 0.02778, 0.6397], + 946: [0.19444, 0.69444, 0.05278, 0.08334, 0.56563], + 947: [0.19444, 0.43056, 0.05556, 0, 0.51773], + 948: [0, 0.69444, 0.03785, 0.05556, 0.44444], + 949: [0, 0.43056, 0, 0.08334, 0.46632], + 950: [0.19444, 0.69444, 0.07378, 0.08334, 0.4375], + 951: [0.19444, 0.43056, 0.03588, 0.05556, 0.49653], + 952: [0, 0.69444, 0.02778, 0.08334, 0.46944], + 953: [0, 0.43056, 0, 0.05556, 0.35394], + 954: [0, 0.43056, 0, 0, 0.57616], + 955: [0, 0.69444, 0, 0, 0.58334], + 956: [0.19444, 0.43056, 0, 0.02778, 0.60255], + 957: [0, 0.43056, 0.06366, 0.02778, 0.49398], + 958: [0.19444, 0.69444, 0.04601, 0.11111, 0.4375], + 959: [0, 0.43056, 0, 0.05556, 0.48472], + 960: [0, 0.43056, 0.03588, 0, 0.57003], + 961: [0.19444, 0.43056, 0, 0.08334, 0.51702], + 962: [0.09722, 0.43056, 0.07986, 0.08334, 0.36285], + 963: [0, 0.43056, 0.03588, 0, 0.57141], + 964: [0, 0.43056, 0.1132, 0.02778, 0.43715], + 965: [0, 0.43056, 0.03588, 0.02778, 0.54028], + 966: [0.19444, 0.43056, 0, 0.08334, 0.65417], + 967: [0.19444, 0.43056, 0, 0.05556, 0.62569], + 968: [0.19444, 0.69444, 0.03588, 0.11111, 0.65139], + 969: [0, 0.43056, 0.03588, 0, 0.62245], + 977: [0, 0.69444, 0, 0.08334, 0.59144], + 981: [0.19444, 0.69444, 0, 0.08334, 0.59583], + 982: [0, 0.43056, 0.02778, 0, 0.82813], + 1009: [0.19444, 0.43056, 0, 0.08334, 0.51702], + 1013: [0, 0.43056, 0, 0.05556, 0.4059], + 57649: [0, 0.43056, 0, 0.02778, 0.32246], + 57911: [0.19444, 0.43056, 0, 0.08334, 0.38403], + }, + "SansSerif-Bold": { + 32: [0, 0, 0, 0, 0.25], + 33: [0, 0.69444, 0, 0, 0.36667], + 34: [0, 0.69444, 0, 0, 0.55834], + 35: [0.19444, 0.69444, 0, 0, 0.91667], + 36: [0.05556, 0.75, 0, 0, 0.55], + 37: [0.05556, 0.75, 0, 0, 1.02912], + 38: [0, 0.69444, 0, 0, 0.83056], + 39: [0, 0.69444, 0, 0, 0.30556], + 40: [0.25, 0.75, 0, 0, 0.42778], + 41: [0.25, 0.75, 0, 0, 0.42778], + 42: [0, 0.75, 0, 0, 0.55], + 43: [0.11667, 0.61667, 0, 0, 0.85556], + 44: [0.10556, 0.13056, 0, 0, 0.30556], + 45: [0, 0.45833, 0, 0, 0.36667], + 46: [0, 0.13056, 0, 0, 0.30556], + 47: [0.25, 0.75, 0, 0, 0.55], + 48: [0, 0.69444, 0, 0, 0.55], + 49: [0, 0.69444, 0, 0, 0.55], + 50: [0, 0.69444, 0, 0, 0.55], + 51: [0, 0.69444, 0, 0, 0.55], + 52: [0, 0.69444, 0, 0, 0.55], + 53: [0, 0.69444, 0, 0, 0.55], + 54: [0, 0.69444, 0, 0, 0.55], + 55: [0, 0.69444, 0, 0, 0.55], + 56: [0, 0.69444, 0, 0, 0.55], + 57: [0, 0.69444, 0, 0, 0.55], + 58: [0, 0.45833, 0, 0, 0.30556], + 59: [0.10556, 0.45833, 0, 0, 0.30556], + 61: [-0.09375, 0.40625, 0, 0, 0.85556], + 63: [0, 0.69444, 0, 0, 0.51945], + 64: [0, 0.69444, 0, 0, 0.73334], + 65: [0, 0.69444, 0, 0, 0.73334], + 66: [0, 0.69444, 0, 0, 0.73334], + 67: [0, 0.69444, 0, 0, 0.70278], + 68: [0, 0.69444, 0, 0, 0.79445], + 69: [0, 0.69444, 0, 0, 0.64167], + 70: [0, 0.69444, 0, 0, 0.61111], + 71: [0, 0.69444, 0, 0, 0.73334], + 72: [0, 0.69444, 0, 0, 0.79445], + 73: [0, 0.69444, 0, 0, 0.33056], + 74: [0, 0.69444, 0, 0, 0.51945], + 75: [0, 0.69444, 0, 0, 0.76389], + 76: [0, 0.69444, 0, 0, 0.58056], + 77: [0, 0.69444, 0, 0, 0.97778], + 78: [0, 0.69444, 0, 0, 0.79445], + 79: [0, 0.69444, 0, 0, 0.79445], + 80: [0, 0.69444, 0, 0, 0.70278], + 81: [0.10556, 0.69444, 0, 0, 0.79445], + 82: [0, 0.69444, 0, 0, 0.70278], + 83: [0, 0.69444, 0, 0, 0.61111], + 84: [0, 0.69444, 0, 0, 0.73334], + 85: [0, 0.69444, 0, 0, 0.76389], + 86: [0, 0.69444, 0.01528, 0, 0.73334], + 87: [0, 0.69444, 0.01528, 0, 1.03889], + 88: [0, 0.69444, 0, 0, 0.73334], + 89: [0, 0.69444, 0.0275, 0, 0.73334], + 90: [0, 0.69444, 0, 0, 0.67223], + 91: [0.25, 0.75, 0, 0, 0.34306], + 93: [0.25, 0.75, 0, 0, 0.34306], + 94: [0, 0.69444, 0, 0, 0.55], + 95: [0.35, 0.10833, 0.03056, 0, 0.55], + 97: [0, 0.45833, 0, 0, 0.525], + 98: [0, 0.69444, 0, 0, 0.56111], + 99: [0, 0.45833, 0, 0, 0.48889], + 100: [0, 0.69444, 0, 0, 0.56111], + 101: [0, 0.45833, 0, 0, 0.51111], + 102: [0, 0.69444, 0.07639, 0, 0.33611], + 103: [0.19444, 0.45833, 0.01528, 0, 0.55], + 104: [0, 0.69444, 0, 0, 0.56111], + 105: [0, 0.69444, 0, 0, 0.25556], + 106: [0.19444, 0.69444, 0, 0, 0.28611], + 107: [0, 0.69444, 0, 0, 0.53056], + 108: [0, 0.69444, 0, 0, 0.25556], + 109: [0, 0.45833, 0, 0, 0.86667], + 110: [0, 0.45833, 0, 0, 0.56111], + 111: [0, 0.45833, 0, 0, 0.55], + 112: [0.19444, 0.45833, 0, 0, 0.56111], + 113: [0.19444, 0.45833, 0, 0, 0.56111], + 114: [0, 0.45833, 0.01528, 0, 0.37222], + 115: [0, 0.45833, 0, 0, 0.42167], + 116: [0, 0.58929, 0, 0, 0.40417], + 117: [0, 0.45833, 0, 0, 0.56111], + 118: [0, 0.45833, 0.01528, 0, 0.5], + 119: [0, 0.45833, 0.01528, 0, 0.74445], + 120: [0, 0.45833, 0, 0, 0.5], + 121: [0.19444, 0.45833, 0.01528, 0, 0.5], + 122: [0, 0.45833, 0, 0, 0.47639], + 126: [0.35, 0.34444, 0, 0, 0.55], + 160: [0, 0, 0, 0, 0.25], + 168: [0, 0.69444, 0, 0, 0.55], + 176: [0, 0.69444, 0, 0, 0.73334], + 180: [0, 0.69444, 0, 0, 0.55], + 184: [0.17014, 0, 0, 0, 0.48889], + 305: [0, 0.45833, 0, 0, 0.25556], + 567: [0.19444, 0.45833, 0, 0, 0.28611], + 710: [0, 0.69444, 0, 0, 0.55], + 711: [0, 0.63542, 0, 0, 0.55], + 713: [0, 0.63778, 0, 0, 0.55], + 728: [0, 0.69444, 0, 0, 0.55], + 729: [0, 0.69444, 0, 0, 0.30556], + 730: [0, 0.69444, 0, 0, 0.73334], + 732: [0, 0.69444, 0, 0, 0.55], + 733: [0, 0.69444, 0, 0, 0.55], + 915: [0, 0.69444, 0, 0, 0.58056], + 916: [0, 0.69444, 0, 0, 0.91667], + 920: [0, 0.69444, 0, 0, 0.85556], + 923: [0, 0.69444, 0, 0, 0.67223], + 926: [0, 0.69444, 0, 0, 0.73334], + 928: [0, 0.69444, 0, 0, 0.79445], + 931: [0, 0.69444, 0, 0, 0.79445], + 933: [0, 0.69444, 0, 0, 0.85556], + 934: [0, 0.69444, 0, 0, 0.79445], + 936: [0, 0.69444, 0, 0, 0.85556], + 937: [0, 0.69444, 0, 0, 0.79445], + 8211: [0, 0.45833, 0.03056, 0, 0.55], + 8212: [0, 0.45833, 0.03056, 0, 1.10001], + 8216: [0, 0.69444, 0, 0, 0.30556], + 8217: [0, 0.69444, 0, 0, 0.30556], + 8220: [0, 0.69444, 0, 0, 0.55834], + 8221: [0, 0.69444, 0, 0, 0.55834], + }, + "SansSerif-Italic": { + 32: [0, 0, 0, 0, 0.25], + 33: [0, 0.69444, 0.05733, 0, 0.31945], + 34: [0, 0.69444, 0.00316, 0, 0.5], + 35: [0.19444, 0.69444, 0.05087, 0, 0.83334], + 36: [0.05556, 0.75, 0.11156, 0, 0.5], + 37: [0.05556, 0.75, 0.03126, 0, 0.83334], + 38: [0, 0.69444, 0.03058, 0, 0.75834], + 39: [0, 0.69444, 0.07816, 0, 0.27778], + 40: [0.25, 0.75, 0.13164, 0, 0.38889], + 41: [0.25, 0.75, 0.02536, 0, 0.38889], + 42: [0, 0.75, 0.11775, 0, 0.5], + 43: [0.08333, 0.58333, 0.02536, 0, 0.77778], + 44: [0.125, 0.08333, 0, 0, 0.27778], + 45: [0, 0.44444, 0.01946, 0, 0.33333], + 46: [0, 0.08333, 0, 0, 0.27778], + 47: [0.25, 0.75, 0.13164, 0, 0.5], + 48: [0, 0.65556, 0.11156, 0, 0.5], + 49: [0, 0.65556, 0.11156, 0, 0.5], + 50: [0, 0.65556, 0.11156, 0, 0.5], + 51: [0, 0.65556, 0.11156, 0, 0.5], + 52: [0, 0.65556, 0.11156, 0, 0.5], + 53: [0, 0.65556, 0.11156, 0, 0.5], + 54: [0, 0.65556, 0.11156, 0, 0.5], + 55: [0, 0.65556, 0.11156, 0, 0.5], + 56: [0, 0.65556, 0.11156, 0, 0.5], + 57: [0, 0.65556, 0.11156, 0, 0.5], + 58: [0, 0.44444, 0.02502, 0, 0.27778], + 59: [0.125, 0.44444, 0.02502, 0, 0.27778], + 61: [-0.13, 0.37, 0.05087, 0, 0.77778], + 63: [0, 0.69444, 0.11809, 0, 0.47222], + 64: [0, 0.69444, 0.07555, 0, 0.66667], + 65: [0, 0.69444, 0, 0, 0.66667], + 66: [0, 0.69444, 0.08293, 0, 0.66667], + 67: [0, 0.69444, 0.11983, 0, 0.63889], + 68: [0, 0.69444, 0.07555, 0, 0.72223], + 69: [0, 0.69444, 0.11983, 0, 0.59722], + 70: [0, 0.69444, 0.13372, 0, 0.56945], + 71: [0, 0.69444, 0.11983, 0, 0.66667], + 72: [0, 0.69444, 0.08094, 0, 0.70834], + 73: [0, 0.69444, 0.13372, 0, 0.27778], + 74: [0, 0.69444, 0.08094, 0, 0.47222], + 75: [0, 0.69444, 0.11983, 0, 0.69445], + 76: [0, 0.69444, 0, 0, 0.54167], + 77: [0, 0.69444, 0.08094, 0, 0.875], + 78: [0, 0.69444, 0.08094, 0, 0.70834], + 79: [0, 0.69444, 0.07555, 0, 0.73611], + 80: [0, 0.69444, 0.08293, 0, 0.63889], + 81: [0.125, 0.69444, 0.07555, 0, 0.73611], + 82: [0, 0.69444, 0.08293, 0, 0.64584], + 83: [0, 0.69444, 0.09205, 0, 0.55556], + 84: [0, 0.69444, 0.13372, 0, 0.68056], + 85: [0, 0.69444, 0.08094, 0, 0.6875], + 86: [0, 0.69444, 0.1615, 0, 0.66667], + 87: [0, 0.69444, 0.1615, 0, 0.94445], + 88: [0, 0.69444, 0.13372, 0, 0.66667], + 89: [0, 0.69444, 0.17261, 0, 0.66667], + 90: [0, 0.69444, 0.11983, 0, 0.61111], + 91: [0.25, 0.75, 0.15942, 0, 0.28889], + 93: [0.25, 0.75, 0.08719, 0, 0.28889], + 94: [0, 0.69444, 0.0799, 0, 0.5], + 95: [0.35, 0.09444, 0.08616, 0, 0.5], + 97: [0, 0.44444, 0.00981, 0, 0.48056], + 98: [0, 0.69444, 0.03057, 0, 0.51667], + 99: [0, 0.44444, 0.08336, 0, 0.44445], + 100: [0, 0.69444, 0.09483, 0, 0.51667], + 101: [0, 0.44444, 0.06778, 0, 0.44445], + 102: [0, 0.69444, 0.21705, 0, 0.30556], + 103: [0.19444, 0.44444, 0.10836, 0, 0.5], + 104: [0, 0.69444, 0.01778, 0, 0.51667], + 105: [0, 0.67937, 0.09718, 0, 0.23889], + 106: [0.19444, 0.67937, 0.09162, 0, 0.26667], + 107: [0, 0.69444, 0.08336, 0, 0.48889], + 108: [0, 0.69444, 0.09483, 0, 0.23889], + 109: [0, 0.44444, 0.01778, 0, 0.79445], + 110: [0, 0.44444, 0.01778, 0, 0.51667], + 111: [0, 0.44444, 0.06613, 0, 0.5], + 112: [0.19444, 0.44444, 0.0389, 0, 0.51667], + 113: [0.19444, 0.44444, 0.04169, 0, 0.51667], + 114: [0, 0.44444, 0.10836, 0, 0.34167], + 115: [0, 0.44444, 0.0778, 0, 0.38333], + 116: [0, 0.57143, 0.07225, 0, 0.36111], + 117: [0, 0.44444, 0.04169, 0, 0.51667], + 118: [0, 0.44444, 0.10836, 0, 0.46111], + 119: [0, 0.44444, 0.10836, 0, 0.68334], + 120: [0, 0.44444, 0.09169, 0, 0.46111], + 121: [0.19444, 0.44444, 0.10836, 0, 0.46111], + 122: [0, 0.44444, 0.08752, 0, 0.43472], + 126: [0.35, 0.32659, 0.08826, 0, 0.5], + 160: [0, 0, 0, 0, 0.25], + 168: [0, 0.67937, 0.06385, 0, 0.5], + 176: [0, 0.69444, 0, 0, 0.73752], + 184: [0.17014, 0, 0, 0, 0.44445], + 305: [0, 0.44444, 0.04169, 0, 0.23889], + 567: [0.19444, 0.44444, 0.04169, 0, 0.26667], + 710: [0, 0.69444, 0.0799, 0, 0.5], + 711: [0, 0.63194, 0.08432, 0, 0.5], + 713: [0, 0.60889, 0.08776, 0, 0.5], + 714: [0, 0.69444, 0.09205, 0, 0.5], + 715: [0, 0.69444, 0, 0, 0.5], + 728: [0, 0.69444, 0.09483, 0, 0.5], + 729: [0, 0.67937, 0.07774, 0, 0.27778], + 730: [0, 0.69444, 0, 0, 0.73752], + 732: [0, 0.67659, 0.08826, 0, 0.5], + 733: [0, 0.69444, 0.09205, 0, 0.5], + 915: [0, 0.69444, 0.13372, 0, 0.54167], + 916: [0, 0.69444, 0, 0, 0.83334], + 920: [0, 0.69444, 0.07555, 0, 0.77778], + 923: [0, 0.69444, 0, 0, 0.61111], + 926: [0, 0.69444, 0.12816, 0, 0.66667], + 928: [0, 0.69444, 0.08094, 0, 0.70834], + 931: [0, 0.69444, 0.11983, 0, 0.72222], + 933: [0, 0.69444, 0.09031, 0, 0.77778], + 934: [0, 0.69444, 0.04603, 0, 0.72222], + 936: [0, 0.69444, 0.09031, 0, 0.77778], + 937: [0, 0.69444, 0.08293, 0, 0.72222], + 8211: [0, 0.44444, 0.08616, 0, 0.5], + 8212: [0, 0.44444, 0.08616, 0, 1], + 8216: [0, 0.69444, 0.07816, 0, 0.27778], + 8217: [0, 0.69444, 0.07816, 0, 0.27778], + 8220: [0, 0.69444, 0.14205, 0, 0.5], + 8221: [0, 0.69444, 0.00316, 0, 0.5], + }, + "SansSerif-Regular": { + 32: [0, 0, 0, 0, 0.25], + 33: [0, 0.69444, 0, 0, 0.31945], + 34: [0, 0.69444, 0, 0, 0.5], + 35: [0.19444, 0.69444, 0, 0, 0.83334], + 36: [0.05556, 0.75, 0, 0, 0.5], + 37: [0.05556, 0.75, 0, 0, 0.83334], + 38: [0, 0.69444, 0, 0, 0.75834], + 39: [0, 0.69444, 0, 0, 0.27778], + 40: [0.25, 0.75, 0, 0, 0.38889], + 41: [0.25, 0.75, 0, 0, 0.38889], + 42: [0, 0.75, 0, 0, 0.5], + 43: [0.08333, 0.58333, 0, 0, 0.77778], + 44: [0.125, 0.08333, 0, 0, 0.27778], + 45: [0, 0.44444, 0, 0, 0.33333], + 46: [0, 0.08333, 0, 0, 0.27778], + 47: [0.25, 0.75, 0, 0, 0.5], + 48: [0, 0.65556, 0, 0, 0.5], + 49: [0, 0.65556, 0, 0, 0.5], + 50: [0, 0.65556, 0, 0, 0.5], + 51: [0, 0.65556, 0, 0, 0.5], + 52: [0, 0.65556, 0, 0, 0.5], + 53: [0, 0.65556, 0, 0, 0.5], + 54: [0, 0.65556, 0, 0, 0.5], + 55: [0, 0.65556, 0, 0, 0.5], + 56: [0, 0.65556, 0, 0, 0.5], + 57: [0, 0.65556, 0, 0, 0.5], + 58: [0, 0.44444, 0, 0, 0.27778], + 59: [0.125, 0.44444, 0, 0, 0.27778], + 61: [-0.13, 0.37, 0, 0, 0.77778], + 63: [0, 0.69444, 0, 0, 0.47222], + 64: [0, 0.69444, 0, 0, 0.66667], + 65: [0, 0.69444, 0, 0, 0.66667], + 66: [0, 0.69444, 0, 0, 0.66667], + 67: [0, 0.69444, 0, 0, 0.63889], + 68: [0, 0.69444, 0, 0, 0.72223], + 69: [0, 0.69444, 0, 0, 0.59722], + 70: [0, 0.69444, 0, 0, 0.56945], + 71: [0, 0.69444, 0, 0, 0.66667], + 72: [0, 0.69444, 0, 0, 0.70834], + 73: [0, 0.69444, 0, 0, 0.27778], + 74: [0, 0.69444, 0, 0, 0.47222], + 75: [0, 0.69444, 0, 0, 0.69445], + 76: [0, 0.69444, 0, 0, 0.54167], + 77: [0, 0.69444, 0, 0, 0.875], + 78: [0, 0.69444, 0, 0, 0.70834], + 79: [0, 0.69444, 0, 0, 0.73611], + 80: [0, 0.69444, 0, 0, 0.63889], + 81: [0.125, 0.69444, 0, 0, 0.73611], + 82: [0, 0.69444, 0, 0, 0.64584], + 83: [0, 0.69444, 0, 0, 0.55556], + 84: [0, 0.69444, 0, 0, 0.68056], + 85: [0, 0.69444, 0, 0, 0.6875], + 86: [0, 0.69444, 0.01389, 0, 0.66667], + 87: [0, 0.69444, 0.01389, 0, 0.94445], + 88: [0, 0.69444, 0, 0, 0.66667], + 89: [0, 0.69444, 0.025, 0, 0.66667], + 90: [0, 0.69444, 0, 0, 0.61111], + 91: [0.25, 0.75, 0, 0, 0.28889], + 93: [0.25, 0.75, 0, 0, 0.28889], + 94: [0, 0.69444, 0, 0, 0.5], + 95: [0.35, 0.09444, 0.02778, 0, 0.5], + 97: [0, 0.44444, 0, 0, 0.48056], + 98: [0, 0.69444, 0, 0, 0.51667], + 99: [0, 0.44444, 0, 0, 0.44445], + 100: [0, 0.69444, 0, 0, 0.51667], + 101: [0, 0.44444, 0, 0, 0.44445], + 102: [0, 0.69444, 0.06944, 0, 0.30556], + 103: [0.19444, 0.44444, 0.01389, 0, 0.5], + 104: [0, 0.69444, 0, 0, 0.51667], + 105: [0, 0.67937, 0, 0, 0.23889], + 106: [0.19444, 0.67937, 0, 0, 0.26667], + 107: [0, 0.69444, 0, 0, 0.48889], + 108: [0, 0.69444, 0, 0, 0.23889], + 109: [0, 0.44444, 0, 0, 0.79445], + 110: [0, 0.44444, 0, 0, 0.51667], + 111: [0, 0.44444, 0, 0, 0.5], + 112: [0.19444, 0.44444, 0, 0, 0.51667], + 113: [0.19444, 0.44444, 0, 0, 0.51667], + 114: [0, 0.44444, 0.01389, 0, 0.34167], + 115: [0, 0.44444, 0, 0, 0.38333], + 116: [0, 0.57143, 0, 0, 0.36111], + 117: [0, 0.44444, 0, 0, 0.51667], + 118: [0, 0.44444, 0.01389, 0, 0.46111], + 119: [0, 0.44444, 0.01389, 0, 0.68334], + 120: [0, 0.44444, 0, 0, 0.46111], + 121: [0.19444, 0.44444, 0.01389, 0, 0.46111], + 122: [0, 0.44444, 0, 0, 0.43472], + 126: [0.35, 0.32659, 0, 0, 0.5], + 160: [0, 0, 0, 0, 0.25], + 168: [0, 0.67937, 0, 0, 0.5], + 176: [0, 0.69444, 0, 0, 0.66667], + 184: [0.17014, 0, 0, 0, 0.44445], + 305: [0, 0.44444, 0, 0, 0.23889], + 567: [0.19444, 0.44444, 0, 0, 0.26667], + 710: [0, 0.69444, 0, 0, 0.5], + 711: [0, 0.63194, 0, 0, 0.5], + 713: [0, 0.60889, 0, 0, 0.5], + 714: [0, 0.69444, 0, 0, 0.5], + 715: [0, 0.69444, 0, 0, 0.5], + 728: [0, 0.69444, 0, 0, 0.5], + 729: [0, 0.67937, 0, 0, 0.27778], + 730: [0, 0.69444, 0, 0, 0.66667], + 732: [0, 0.67659, 0, 0, 0.5], + 733: [0, 0.69444, 0, 0, 0.5], + 915: [0, 0.69444, 0, 0, 0.54167], + 916: [0, 0.69444, 0, 0, 0.83334], + 920: [0, 0.69444, 0, 0, 0.77778], + 923: [0, 0.69444, 0, 0, 0.61111], + 926: [0, 0.69444, 0, 0, 0.66667], + 928: [0, 0.69444, 0, 0, 0.70834], + 931: [0, 0.69444, 0, 0, 0.72222], + 933: [0, 0.69444, 0, 0, 0.77778], + 934: [0, 0.69444, 0, 0, 0.72222], + 936: [0, 0.69444, 0, 0, 0.77778], + 937: [0, 0.69444, 0, 0, 0.72222], + 8211: [0, 0.44444, 0.02778, 0, 0.5], + 8212: [0, 0.44444, 0.02778, 0, 1], + 8216: [0, 0.69444, 0, 0, 0.27778], + 8217: [0, 0.69444, 0, 0, 0.27778], + 8220: [0, 0.69444, 0, 0, 0.5], + 8221: [0, 0.69444, 0, 0, 0.5], + }, + "Script-Regular": { + 32: [0, 0, 0, 0, 0.25], + 65: [0, 0.7, 0.22925, 0, 0.80253], + 66: [0, 0.7, 0.04087, 0, 0.90757], + 67: [0, 0.7, 0.1689, 0, 0.66619], + 68: [0, 0.7, 0.09371, 0, 0.77443], + 69: [0, 0.7, 0.18583, 0, 0.56162], + 70: [0, 0.7, 0.13634, 0, 0.89544], + 71: [0, 0.7, 0.17322, 0, 0.60961], + 72: [0, 0.7, 0.29694, 0, 0.96919], + 73: [0, 0.7, 0.19189, 0, 0.80907], + 74: [0.27778, 0.7, 0.19189, 0, 1.05159], + 75: [0, 0.7, 0.31259, 0, 0.91364], + 76: [0, 0.7, 0.19189, 0, 0.87373], + 77: [0, 0.7, 0.15981, 0, 1.08031], + 78: [0, 0.7, 0.3525, 0, 0.9015], + 79: [0, 0.7, 0.08078, 0, 0.73787], + 80: [0, 0.7, 0.08078, 0, 1.01262], + 81: [0, 0.7, 0.03305, 0, 0.88282], + 82: [0, 0.7, 0.06259, 0, 0.85], + 83: [0, 0.7, 0.19189, 0, 0.86767], + 84: [0, 0.7, 0.29087, 0, 0.74697], + 85: [0, 0.7, 0.25815, 0, 0.79996], + 86: [0, 0.7, 0.27523, 0, 0.62204], + 87: [0, 0.7, 0.27523, 0, 0.80532], + 88: [0, 0.7, 0.26006, 0, 0.94445], + 89: [0, 0.7, 0.2939, 0, 0.70961], + 90: [0, 0.7, 0.24037, 0, 0.8212], + 160: [0, 0, 0, 0, 0.25], + }, + "Size1-Regular": { + 32: [0, 0, 0, 0, 0.25], + 40: [0.35001, 0.85, 0, 0, 0.45834], + 41: [0.35001, 0.85, 0, 0, 0.45834], + 47: [0.35001, 0.85, 0, 0, 0.57778], + 91: [0.35001, 0.85, 0, 0, 0.41667], + 92: [0.35001, 0.85, 0, 0, 0.57778], + 93: [0.35001, 0.85, 0, 0, 0.41667], + 123: [0.35001, 0.85, 0, 0, 0.58334], + 125: [0.35001, 0.85, 0, 0, 0.58334], + 160: [0, 0, 0, 0, 0.25], + 710: [0, 0.72222, 0, 0, 0.55556], + 732: [0, 0.72222, 0, 0, 0.55556], + 770: [0, 0.72222, 0, 0, 0.55556], + 771: [0, 0.72222, 0, 0, 0.55556], + 8214: [-99e-5, 0.601, 0, 0, 0.77778], + 8593: [1e-5, 0.6, 0, 0, 0.66667], + 8595: [1e-5, 0.6, 0, 0, 0.66667], + 8657: [1e-5, 0.6, 0, 0, 0.77778], + 8659: [1e-5, 0.6, 0, 0, 0.77778], + 8719: [0.25001, 0.75, 0, 0, 0.94445], + 8720: [0.25001, 0.75, 0, 0, 0.94445], + 8721: [0.25001, 0.75, 0, 0, 1.05556], + 8730: [0.35001, 0.85, 0, 0, 1], + 8739: [-0.00599, 0.606, 0, 0, 0.33333], + 8741: [-0.00599, 0.606, 0, 0, 0.55556], + 8747: [0.30612, 0.805, 0.19445, 0, 0.47222], + 8748: [0.306, 0.805, 0.19445, 0, 0.47222], + 8749: [0.306, 0.805, 0.19445, 0, 0.47222], + 8750: [0.30612, 0.805, 0.19445, 0, 0.47222], + 8896: [0.25001, 0.75, 0, 0, 0.83334], + 8897: [0.25001, 0.75, 0, 0, 0.83334], + 8898: [0.25001, 0.75, 0, 0, 0.83334], + 8899: [0.25001, 0.75, 0, 0, 0.83334], + 8968: [0.35001, 0.85, 0, 0, 0.47222], + 8969: [0.35001, 0.85, 0, 0, 0.47222], + 8970: [0.35001, 0.85, 0, 0, 0.47222], + 8971: [0.35001, 0.85, 0, 0, 0.47222], + 9168: [-99e-5, 0.601, 0, 0, 0.66667], + 10216: [0.35001, 0.85, 0, 0, 0.47222], + 10217: [0.35001, 0.85, 0, 0, 0.47222], + 10752: [0.25001, 0.75, 0, 0, 1.11111], + 10753: [0.25001, 0.75, 0, 0, 1.11111], + 10754: [0.25001, 0.75, 0, 0, 1.11111], + 10756: [0.25001, 0.75, 0, 0, 0.83334], + 10758: [0.25001, 0.75, 0, 0, 0.83334], + }, + "Size2-Regular": { + 32: [0, 0, 0, 0, 0.25], + 40: [0.65002, 1.15, 0, 0, 0.59722], + 41: [0.65002, 1.15, 0, 0, 0.59722], + 47: [0.65002, 1.15, 0, 0, 0.81111], + 91: [0.65002, 1.15, 0, 0, 0.47222], + 92: [0.65002, 1.15, 0, 0, 0.81111], + 93: [0.65002, 1.15, 0, 0, 0.47222], + 123: [0.65002, 1.15, 0, 0, 0.66667], + 125: [0.65002, 1.15, 0, 0, 0.66667], + 160: [0, 0, 0, 0, 0.25], + 710: [0, 0.75, 0, 0, 1], + 732: [0, 0.75, 0, 0, 1], + 770: [0, 0.75, 0, 0, 1], + 771: [0, 0.75, 0, 0, 1], + 8719: [0.55001, 1.05, 0, 0, 1.27778], + 8720: [0.55001, 1.05, 0, 0, 1.27778], + 8721: [0.55001, 1.05, 0, 0, 1.44445], + 8730: [0.65002, 1.15, 0, 0, 1], + 8747: [0.86225, 1.36, 0.44445, 0, 0.55556], + 8748: [0.862, 1.36, 0.44445, 0, 0.55556], + 8749: [0.862, 1.36, 0.44445, 0, 0.55556], + 8750: [0.86225, 1.36, 0.44445, 0, 0.55556], + 8896: [0.55001, 1.05, 0, 0, 1.11111], + 8897: [0.55001, 1.05, 0, 0, 1.11111], + 8898: [0.55001, 1.05, 0, 0, 1.11111], + 8899: [0.55001, 1.05, 0, 0, 1.11111], + 8968: [0.65002, 1.15, 0, 0, 0.52778], + 8969: [0.65002, 1.15, 0, 0, 0.52778], + 8970: [0.65002, 1.15, 0, 0, 0.52778], + 8971: [0.65002, 1.15, 0, 0, 0.52778], + 10216: [0.65002, 1.15, 0, 0, 0.61111], + 10217: [0.65002, 1.15, 0, 0, 0.61111], + 10752: [0.55001, 1.05, 0, 0, 1.51112], + 10753: [0.55001, 1.05, 0, 0, 1.51112], + 10754: [0.55001, 1.05, 0, 0, 1.51112], + 10756: [0.55001, 1.05, 0, 0, 1.11111], + 10758: [0.55001, 1.05, 0, 0, 1.11111], + }, + "Size3-Regular": { + 32: [0, 0, 0, 0, 0.25], + 40: [0.95003, 1.45, 0, 0, 0.73611], + 41: [0.95003, 1.45, 0, 0, 0.73611], + 47: [0.95003, 1.45, 0, 0, 1.04445], + 91: [0.95003, 1.45, 0, 0, 0.52778], + 92: [0.95003, 1.45, 0, 0, 1.04445], + 93: [0.95003, 1.45, 0, 0, 0.52778], + 123: [0.95003, 1.45, 0, 0, 0.75], + 125: [0.95003, 1.45, 0, 0, 0.75], + 160: [0, 0, 0, 0, 0.25], + 710: [0, 0.75, 0, 0, 1.44445], + 732: [0, 0.75, 0, 0, 1.44445], + 770: [0, 0.75, 0, 0, 1.44445], + 771: [0, 0.75, 0, 0, 1.44445], + 8730: [0.95003, 1.45, 0, 0, 1], + 8968: [0.95003, 1.45, 0, 0, 0.58334], + 8969: [0.95003, 1.45, 0, 0, 0.58334], + 8970: [0.95003, 1.45, 0, 0, 0.58334], + 8971: [0.95003, 1.45, 0, 0, 0.58334], + 10216: [0.95003, 1.45, 0, 0, 0.75], + 10217: [0.95003, 1.45, 0, 0, 0.75], + }, + "Size4-Regular": { + 32: [0, 0, 0, 0, 0.25], + 40: [1.25003, 1.75, 0, 0, 0.79167], + 41: [1.25003, 1.75, 0, 0, 0.79167], + 47: [1.25003, 1.75, 0, 0, 1.27778], + 91: [1.25003, 1.75, 0, 0, 0.58334], + 92: [1.25003, 1.75, 0, 0, 1.27778], + 93: [1.25003, 1.75, 0, 0, 0.58334], + 123: [1.25003, 1.75, 0, 0, 0.80556], + 125: [1.25003, 1.75, 0, 0, 0.80556], + 160: [0, 0, 0, 0, 0.25], + 710: [0, 0.825, 0, 0, 1.8889], + 732: [0, 0.825, 0, 0, 1.8889], + 770: [0, 0.825, 0, 0, 1.8889], + 771: [0, 0.825, 0, 0, 1.8889], + 8730: [1.25003, 1.75, 0, 0, 1], + 8968: [1.25003, 1.75, 0, 0, 0.63889], + 8969: [1.25003, 1.75, 0, 0, 0.63889], + 8970: [1.25003, 1.75, 0, 0, 0.63889], + 8971: [1.25003, 1.75, 0, 0, 0.63889], + 9115: [0.64502, 1.155, 0, 0, 0.875], + 9116: [1e-5, 0.6, 0, 0, 0.875], + 9117: [0.64502, 1.155, 0, 0, 0.875], + 9118: [0.64502, 1.155, 0, 0, 0.875], + 9119: [1e-5, 0.6, 0, 0, 0.875], + 9120: [0.64502, 1.155, 0, 0, 0.875], + 9121: [0.64502, 1.155, 0, 0, 0.66667], + 9122: [-99e-5, 0.601, 0, 0, 0.66667], + 9123: [0.64502, 1.155, 0, 0, 0.66667], + 9124: [0.64502, 1.155, 0, 0, 0.66667], + 9125: [-99e-5, 0.601, 0, 0, 0.66667], + 9126: [0.64502, 1.155, 0, 0, 0.66667], + 9127: [1e-5, 0.9, 0, 0, 0.88889], + 9128: [0.65002, 1.15, 0, 0, 0.88889], + 9129: [0.90001, 0, 0, 0, 0.88889], + 9130: [0, 0.3, 0, 0, 0.88889], + 9131: [1e-5, 0.9, 0, 0, 0.88889], + 9132: [0.65002, 1.15, 0, 0, 0.88889], + 9133: [0.90001, 0, 0, 0, 0.88889], + 9143: [0.88502, 0.915, 0, 0, 1.05556], + 10216: [1.25003, 1.75, 0, 0, 0.80556], + 10217: [1.25003, 1.75, 0, 0, 0.80556], + 57344: [-0.00499, 0.605, 0, 0, 1.05556], + 57345: [-0.00499, 0.605, 0, 0, 1.05556], + 57680: [0, 0.12, 0, 0, 0.45], + 57681: [0, 0.12, 0, 0, 0.45], + 57682: [0, 0.12, 0, 0, 0.45], + 57683: [0, 0.12, 0, 0, 0.45], + }, + "Typewriter-Regular": { + 32: [0, 0, 0, 0, 0.525], + 33: [0, 0.61111, 0, 0, 0.525], + 34: [0, 0.61111, 0, 0, 0.525], + 35: [0, 0.61111, 0, 0, 0.525], + 36: [0.08333, 0.69444, 0, 0, 0.525], + 37: [0.08333, 0.69444, 0, 0, 0.525], + 38: [0, 0.61111, 0, 0, 0.525], + 39: [0, 0.61111, 0, 0, 0.525], + 40: [0.08333, 0.69444, 0, 0, 0.525], + 41: [0.08333, 0.69444, 0, 0, 0.525], + 42: [0, 0.52083, 0, 0, 0.525], + 43: [-0.08056, 0.53055, 0, 0, 0.525], + 44: [0.13889, 0.125, 0, 0, 0.525], + 45: [-0.08056, 0.53055, 0, 0, 0.525], + 46: [0, 0.125, 0, 0, 0.525], + 47: [0.08333, 0.69444, 0, 0, 0.525], + 48: [0, 0.61111, 0, 0, 0.525], + 49: [0, 0.61111, 0, 0, 0.525], + 50: [0, 0.61111, 0, 0, 0.525], + 51: [0, 0.61111, 0, 0, 0.525], + 52: [0, 0.61111, 0, 0, 0.525], + 53: [0, 0.61111, 0, 0, 0.525], + 54: [0, 0.61111, 0, 0, 0.525], + 55: [0, 0.61111, 0, 0, 0.525], + 56: [0, 0.61111, 0, 0, 0.525], + 57: [0, 0.61111, 0, 0, 0.525], + 58: [0, 0.43056, 0, 0, 0.525], + 59: [0.13889, 0.43056, 0, 0, 0.525], + 60: [-0.05556, 0.55556, 0, 0, 0.525], + 61: [-0.19549, 0.41562, 0, 0, 0.525], + 62: [-0.05556, 0.55556, 0, 0, 0.525], + 63: [0, 0.61111, 0, 0, 0.525], + 64: [0, 0.61111, 0, 0, 0.525], + 65: [0, 0.61111, 0, 0, 0.525], + 66: [0, 0.61111, 0, 0, 0.525], + 67: [0, 0.61111, 0, 0, 0.525], + 68: [0, 0.61111, 0, 0, 0.525], + 69: [0, 0.61111, 0, 0, 0.525], + 70: [0, 0.61111, 0, 0, 0.525], + 71: [0, 0.61111, 0, 0, 0.525], + 72: [0, 0.61111, 0, 0, 0.525], + 73: [0, 0.61111, 0, 0, 0.525], + 74: [0, 0.61111, 0, 0, 0.525], + 75: [0, 0.61111, 0, 0, 0.525], + 76: [0, 0.61111, 0, 0, 0.525], + 77: [0, 0.61111, 0, 0, 0.525], + 78: [0, 0.61111, 0, 0, 0.525], + 79: [0, 0.61111, 0, 0, 0.525], + 80: [0, 0.61111, 0, 0, 0.525], + 81: [0.13889, 0.61111, 0, 0, 0.525], + 82: [0, 0.61111, 0, 0, 0.525], + 83: [0, 0.61111, 0, 0, 0.525], + 84: [0, 0.61111, 0, 0, 0.525], + 85: [0, 0.61111, 0, 0, 0.525], + 86: [0, 0.61111, 0, 0, 0.525], + 87: [0, 0.61111, 0, 0, 0.525], + 88: [0, 0.61111, 0, 0, 0.525], + 89: [0, 0.61111, 0, 0, 0.525], + 90: [0, 0.61111, 0, 0, 0.525], + 91: [0.08333, 0.69444, 0, 0, 0.525], + 92: [0.08333, 0.69444, 0, 0, 0.525], + 93: [0.08333, 0.69444, 0, 0, 0.525], + 94: [0, 0.61111, 0, 0, 0.525], + 95: [0.09514, 0, 0, 0, 0.525], + 96: [0, 0.61111, 0, 0, 0.525], + 97: [0, 0.43056, 0, 0, 0.525], + 98: [0, 0.61111, 0, 0, 0.525], + 99: [0, 0.43056, 0, 0, 0.525], + 100: [0, 0.61111, 0, 0, 0.525], + 101: [0, 0.43056, 0, 0, 0.525], + 102: [0, 0.61111, 0, 0, 0.525], + 103: [0.22222, 0.43056, 0, 0, 0.525], + 104: [0, 0.61111, 0, 0, 0.525], + 105: [0, 0.61111, 0, 0, 0.525], + 106: [0.22222, 0.61111, 0, 0, 0.525], + 107: [0, 0.61111, 0, 0, 0.525], + 108: [0, 0.61111, 0, 0, 0.525], + 109: [0, 0.43056, 0, 0, 0.525], + 110: [0, 0.43056, 0, 0, 0.525], + 111: [0, 0.43056, 0, 0, 0.525], + 112: [0.22222, 0.43056, 0, 0, 0.525], + 113: [0.22222, 0.43056, 0, 0, 0.525], + 114: [0, 0.43056, 0, 0, 0.525], + 115: [0, 0.43056, 0, 0, 0.525], + 116: [0, 0.55358, 0, 0, 0.525], + 117: [0, 0.43056, 0, 0, 0.525], + 118: [0, 0.43056, 0, 0, 0.525], + 119: [0, 0.43056, 0, 0, 0.525], + 120: [0, 0.43056, 0, 0, 0.525], + 121: [0.22222, 0.43056, 0, 0, 0.525], + 122: [0, 0.43056, 0, 0, 0.525], + 123: [0.08333, 0.69444, 0, 0, 0.525], + 124: [0.08333, 0.69444, 0, 0, 0.525], + 125: [0.08333, 0.69444, 0, 0, 0.525], + 126: [0, 0.61111, 0, 0, 0.525], + 127: [0, 0.61111, 0, 0, 0.525], + 160: [0, 0, 0, 0, 0.525], + 176: [0, 0.61111, 0, 0, 0.525], + 184: [0.19445, 0, 0, 0, 0.525], + 305: [0, 0.43056, 0, 0, 0.525], + 567: [0.22222, 0.43056, 0, 0, 0.525], + 711: [0, 0.56597, 0, 0, 0.525], + 713: [0, 0.56555, 0, 0, 0.525], + 714: [0, 0.61111, 0, 0, 0.525], + 715: [0, 0.61111, 0, 0, 0.525], + 728: [0, 0.61111, 0, 0, 0.525], + 730: [0, 0.61111, 0, 0, 0.525], + 770: [0, 0.61111, 0, 0, 0.525], + 771: [0, 0.61111, 0, 0, 0.525], + 776: [0, 0.61111, 0, 0, 0.525], + 915: [0, 0.61111, 0, 0, 0.525], + 916: [0, 0.61111, 0, 0, 0.525], + 920: [0, 0.61111, 0, 0, 0.525], + 923: [0, 0.61111, 0, 0, 0.525], + 926: [0, 0.61111, 0, 0, 0.525], + 928: [0, 0.61111, 0, 0, 0.525], + 931: [0, 0.61111, 0, 0, 0.525], + 933: [0, 0.61111, 0, 0, 0.525], + 934: [0, 0.61111, 0, 0, 0.525], + 936: [0, 0.61111, 0, 0, 0.525], + 937: [0, 0.61111, 0, 0, 0.525], + 8216: [0, 0.61111, 0, 0, 0.525], + 8217: [0, 0.61111, 0, 0, 0.525], + 8242: [0, 0.61111, 0, 0, 0.525], + 9251: [0.11111, 0.21944, 0, 0, 0.525], + }, + }, + R = { + slant: [0.25, 0.25, 0.25], + space: [0, 0, 0], + stretch: [0, 0, 0], + shrink: [0, 0, 0], + xHeight: [0.431, 0.431, 0.431], + quad: [1, 1.171, 1.472], + extraSpace: [0, 0, 0], + num1: [0.677, 0.732, 0.925], + num2: [0.394, 0.384, 0.387], + num3: [0.444, 0.471, 0.504], + denom1: [0.686, 0.752, 1.025], + denom2: [0.345, 0.344, 0.532], + sup1: [0.413, 0.503, 0.504], + sup2: [0.363, 0.431, 0.404], + sup3: [0.289, 0.286, 0.294], + sub1: [0.15, 0.143, 0.2], + sub2: [0.247, 0.286, 0.4], + supDrop: [0.386, 0.353, 0.494], + subDrop: [0.05, 0.071, 0.1], + delim1: [2.39, 1.7, 1.98], + delim2: [1.01, 1.157, 1.42], + axisHeight: [0.25, 0.25, 0.25], + defaultRuleThickness: [0.04, 0.049, 0.049], + bigOpSpacing1: [0.111, 0.111, 0.111], + bigOpSpacing2: [0.166, 0.166, 0.166], + bigOpSpacing3: [0.2, 0.2, 0.2], + bigOpSpacing4: [0.6, 0.611, 0.611], + bigOpSpacing5: [0.1, 0.143, 0.143], + sqrtRuleThickness: [0.04, 0.04, 0.04], + ptPerEm: [10, 10, 10], + doubleRuleSep: [0.2, 0.2, 0.2], + arrayRuleWidth: [0.04, 0.04, 0.04], + fboxsep: [0.3, 0.3, 0.3], + fboxrule: [0.04, 0.04, 0.04], + }, + H = { + Å: "A", + Ð: "D", + Þ: "o", + å: "a", + ð: "d", + þ: "o", + А: "A", + Б: "B", + В: "B", + Г: "F", + Д: "A", + Е: "E", + Ж: "K", + З: "3", + И: "N", + Й: "N", + К: "K", + Л: "N", + М: "M", + Н: "H", + О: "O", + П: "N", + Р: "P", + С: "C", + Т: "T", + У: "y", + Ф: "O", + Х: "X", + Ц: "U", + Ч: "h", + Ш: "W", + Щ: "W", + Ъ: "B", + Ы: "X", + Ь: "B", + Э: "3", + Ю: "X", + Я: "R", + а: "a", + б: "b", + в: "a", + г: "r", + д: "y", + е: "e", + ж: "m", + з: "e", + и: "n", + й: "n", + к: "n", + л: "n", + м: "m", + н: "n", + о: "o", + п: "n", + р: "p", + с: "c", + т: "o", + у: "y", + ф: "b", + х: "x", + ц: "n", + ч: "n", + ш: "w", + щ: "w", + ъ: "a", + ы: "m", + ь: "a", + э: "e", + ю: "m", + я: "r", + }; + function O(e, t, r) { + if (!I[t]) throw new Error("Font metrics not found for font: " + t + "."); + var n = e.charCodeAt(0), + a = I[t][n]; + if ((!a && e[0] in H && ((n = H[e[0]].charCodeAt(0)), (a = I[t][n])), a || "text" !== r || (N(n) && (a = I[t][77])), a)) + return { depth: a[0], height: a[1], italic: a[2], skew: a[3], width: a[4] }; + } + var E = {}, + L = [ + [1, 1, 1], + [2, 1, 1], + [3, 1, 1], + [4, 2, 1], + [5, 2, 1], + [6, 3, 1], + [7, 4, 2], + [8, 6, 3], + [9, 7, 6], + [10, 8, 7], + [11, 10, 9], + ], + D = [0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.2, 1.44, 1.728, 2.074, 2.488], + P = function (e, t) { + return t.size < 2 ? e : L[e - 1][t.size - 1]; + }, + V = (function () { + function e(t) { + (this.style = void 0), + (this.color = void 0), + (this.size = void 0), + (this.textSize = void 0), + (this.phantom = void 0), + (this.font = void 0), + (this.fontFamily = void 0), + (this.fontWeight = void 0), + (this.fontShape = void 0), + (this.sizeMultiplier = void 0), + (this.maxSize = void 0), + (this.minRuleThickness = void 0), + (this._fontMetrics = void 0), + (this.style = t.style), + (this.color = t.color), + (this.size = t.size || e.BASESIZE), + (this.textSize = t.textSize || this.size), + (this.phantom = !!t.phantom), + (this.font = t.font || ""), + (this.fontFamily = t.fontFamily || ""), + (this.fontWeight = t.fontWeight || ""), + (this.fontShape = t.fontShape || ""), + (this.sizeMultiplier = D[this.size - 1]), + (this.maxSize = t.maxSize), + (this.minRuleThickness = t.minRuleThickness), + (this._fontMetrics = void 0); + } + var t = e.prototype; + return ( + (t.extend = function (t) { + var r = { + style: this.style, + size: this.size, + textSize: this.textSize, + color: this.color, + phantom: this.phantom, + font: this.font, + fontFamily: this.fontFamily, + fontWeight: this.fontWeight, + fontShape: this.fontShape, + maxSize: this.maxSize, + minRuleThickness: this.minRuleThickness, + }; + for (var n in t) t.hasOwnProperty(n) && (r[n] = t[n]); + return new e(r); + }), + (t.havingStyle = function (e) { + return this.style === e ? this : this.extend({ style: e, size: P(this.textSize, e) }); + }), + (t.havingCrampedStyle = function () { + return this.havingStyle(this.style.cramp()); + }), + (t.havingSize = function (e) { + return this.size === e && this.textSize === e + ? this + : this.extend({ + style: this.style.text(), + size: e, + textSize: e, + sizeMultiplier: D[e - 1], + }); + }), + (t.havingBaseStyle = function (t) { + t = t || this.style.text(); + var r = P(e.BASESIZE, t); + return this.size === r && this.textSize === e.BASESIZE && this.style === t ? this : this.extend({ style: t, size: r }); + }), + (t.havingBaseSizing = function () { + var e; + switch (this.style.id) { + case 4: + case 5: + e = 3; + break; + case 6: + case 7: + e = 1; + break; + default: + e = 6; + } + return this.extend({ style: this.style.text(), size: e }); + }), + (t.withColor = function (e) { + return this.extend({ color: e }); + }), + (t.withPhantom = function () { + return this.extend({ phantom: !0 }); + }), + (t.withFont = function (e) { + return this.extend({ font: e }); + }), + (t.withTextFontFamily = function (e) { + return this.extend({ fontFamily: e, font: "" }); + }), + (t.withTextFontWeight = function (e) { + return this.extend({ fontWeight: e, font: "" }); + }), + (t.withTextFontShape = function (e) { + return this.extend({ fontShape: e, font: "" }); + }), + (t.sizingClasses = function (e) { + return e.size !== this.size ? ["sizing", "reset-size" + e.size, "size" + this.size] : []; + }), + (t.baseSizingClasses = function () { + return this.size !== e.BASESIZE ? ["sizing", "reset-size" + this.size, "size" + e.BASESIZE] : []; + }), + (t.fontMetrics = function () { + return ( + this._fontMetrics || + (this._fontMetrics = (function (e) { + var t; + if (!E[(t = e >= 5 ? 0 : e >= 3 ? 1 : 2)]) { + var r = (E[t] = { cssEmPerMu: R.quad[t] / 18 }); + for (var n in R) R.hasOwnProperty(n) && (r[n] = R[n][t]); + } + return E[t]; + })(this.size)), + this._fontMetrics + ); + }), + (t.getColor = function () { + return this.phantom ? "transparent" : this.color; + }), + e + ); + })(); + V.BASESIZE = 6; + var F = V, + G = { + pt: 1, + mm: 7227 / 2540, + cm: 7227 / 254, + in: 72.27, + bp: 1.00375, + pc: 12, + dd: 1238 / 1157, + cc: 14856 / 1157, + nd: 685 / 642, + nc: 1370 / 107, + sp: 1 / 65536, + px: 1.00375, + }, + U = { ex: !0, em: !0, mu: !0 }, + Y = function (e) { + return "string" != typeof e && (e = e.unit), e in G || e in U || "ex" === e; + }, + X = function (e, t) { + var r; + if (e.unit in G) r = G[e.unit] / t.fontMetrics().ptPerEm / t.sizeMultiplier; + else if ("mu" === e.unit) r = t.fontMetrics().cssEmPerMu; + else { + var a; + if (((a = t.style.isTight() ? t.havingStyle(t.style.text()) : t), "ex" === e.unit)) r = a.fontMetrics().xHeight; + else { + if ("em" !== e.unit) throw new n("Invalid unit: '" + e.unit + "'"); + r = a.fontMetrics().quad; + } + a !== t && (r *= a.sizeMultiplier / t.sizeMultiplier); + } + return Math.min(e.number * r, t.maxSize); + }, + W = function (e) { + return +e.toFixed(4) + "em"; + }, + _ = function (e) { + return e + .filter(function (e) { + return e; + }) + .join(" "); + }, + j = function (e, t, r) { + if ( + ((this.classes = e || []), + (this.attributes = {}), + (this.height = 0), + (this.depth = 0), + (this.maxFontSize = 0), + (this.style = r || {}), + t) + ) { + t.style.isTight() && this.classes.push("mtight"); + var n = t.getColor(); + n && (this.style.color = n); + } + }, + $ = function (e) { + var t = document.createElement(e); + for (var r in ((t.className = _(this.classes)), this.style)) this.style.hasOwnProperty(r) && (t.style[r] = this.style[r]); + for (var n in this.attributes) this.attributes.hasOwnProperty(n) && t.setAttribute(n, this.attributes[n]); + for (var a = 0; a < this.children.length; a++) t.appendChild(this.children[a].toNode()); + return t; + }, + Z = function (e) { + var t = "<" + e; + this.classes.length && (t += ' class="' + c(_(this.classes)) + '"'); + var r = ""; + for (var n in this.style) this.style.hasOwnProperty(n) && (r += m(n) + ":" + this.style[n] + ";"); + for (var a in (r && (t += ' style="' + c(r) + '"'), this.attributes)) + this.attributes.hasOwnProperty(a) && (t += " " + a + '="' + c(this.attributes[a]) + '"'); + t += ">"; + for (var i = 0; i < this.children.length; i++) t += this.children[i].toMarkup(); + return t + ""; + }, + K = (function () { + function e(e, t, r, n) { + (this.children = void 0), + (this.attributes = void 0), + (this.classes = void 0), + (this.height = void 0), + (this.depth = void 0), + (this.width = void 0), + (this.maxFontSize = void 0), + (this.style = void 0), + j.call(this, e, r, n), + (this.children = t || []); + } + var t = e.prototype; + return ( + (t.setAttribute = function (e, t) { + this.attributes[e] = t; + }), + (t.hasClass = function (e) { + return l(this.classes, e); + }), + (t.toNode = function () { + return $.call(this, "span"); + }), + (t.toMarkup = function () { + return Z.call(this, "span"); + }), + e + ); + })(), + J = (function () { + function e(e, t, r, n) { + (this.children = void 0), + (this.attributes = void 0), + (this.classes = void 0), + (this.height = void 0), + (this.depth = void 0), + (this.maxFontSize = void 0), + (this.style = void 0), + j.call(this, t, n), + (this.children = r || []), + this.setAttribute("href", e); + } + var t = e.prototype; + return ( + (t.setAttribute = function (e, t) { + this.attributes[e] = t; + }), + (t.hasClass = function (e) { + return l(this.classes, e); + }), + (t.toNode = function () { + return $.call(this, "a"); + }), + (t.toMarkup = function () { + return Z.call(this, "a"); + }), + e + ); + })(), + Q = (function () { + function e(e, t, r) { + (this.src = void 0), + (this.alt = void 0), + (this.classes = void 0), + (this.height = void 0), + (this.depth = void 0), + (this.maxFontSize = void 0), + (this.style = void 0), + (this.alt = t), + (this.src = e), + (this.classes = ["mord"]), + (this.style = r); + } + var t = e.prototype; + return ( + (t.hasClass = function (e) { + return l(this.classes, e); + }), + (t.toNode = function () { + var e = document.createElement("img"); + for (var t in ((e.src = this.src), (e.alt = this.alt), (e.className = "mord"), this.style)) + this.style.hasOwnProperty(t) && (e.style[t] = this.style[t]); + return e; + }), + (t.toMarkup = function () { + var e = "" + this.alt + ""; + }), + e + ); + })(), + ee = { î: "ı̂", ï: "ı̈", í: "ı́", ì: "ı̀" }, + te = (function () { + function e(e, t, r, n, a, i, o, s) { + (this.text = void 0), + (this.height = void 0), + (this.depth = void 0), + (this.italic = void 0), + (this.skew = void 0), + (this.width = void 0), + (this.maxFontSize = void 0), + (this.classes = void 0), + (this.style = void 0), + (this.text = e), + (this.height = t || 0), + (this.depth = r || 0), + (this.italic = n || 0), + (this.skew = a || 0), + (this.width = i || 0), + (this.classes = o || []), + (this.style = s || {}), + (this.maxFontSize = 0); + var l = (function (e) { + for (var t = 0; t < T.length; t++) + for (var r = T[t], n = 0; n < r.blocks.length; n++) { + var a = r.blocks[n]; + if (e >= a[0] && e <= a[1]) return r.name; + } + return null; + })(this.text.charCodeAt(0)); + l && this.classes.push(l + "_fallback"), /[îïíì]/.test(this.text) && (this.text = ee[this.text]); + } + var t = e.prototype; + return ( + (t.hasClass = function (e) { + return l(this.classes, e); + }), + (t.toNode = function () { + var e = document.createTextNode(this.text), + t = null; + for (var r in (this.italic > 0 && ((t = document.createElement("span")).style.marginRight = W(this.italic)), + this.classes.length > 0 && ((t = t || document.createElement("span")).className = _(this.classes)), + this.style)) + this.style.hasOwnProperty(r) && ((t = t || document.createElement("span")).style[r] = this.style[r]); + return t ? (t.appendChild(e), t) : e; + }), + (t.toMarkup = function () { + var e = !1, + t = " 0 && (r += "margin-right:" + this.italic + "em;"), this.style)) + this.style.hasOwnProperty(n) && (r += m(n) + ":" + this.style[n] + ";"); + r && ((e = !0), (t += ' style="' + c(r) + '"')); + var a = c(this.text); + return e ? ((t += ">"), (t += a), (t += "")) : a; + }), + e + ); + })(), + re = (function () { + function e(e, t) { + (this.children = void 0), (this.attributes = void 0), (this.children = e || []), (this.attributes = t || {}); + } + var t = e.prototype; + return ( + (t.toNode = function () { + var e = document.createElementNS("http://www.w3.org/2000/svg", "svg"); + for (var t in this.attributes) Object.prototype.hasOwnProperty.call(this.attributes, t) && e.setAttribute(t, this.attributes[t]); + for (var r = 0; r < this.children.length; r++) e.appendChild(this.children[r].toNode()); + return e; + }), + (t.toMarkup = function () { + var e = '"; + }), + e + ); + })(), + ne = (function () { + function e(e, t) { + (this.pathName = void 0), (this.alternate = void 0), (this.pathName = e), (this.alternate = t); + } + var t = e.prototype; + return ( + (t.toNode = function () { + var e = document.createElementNS("http://www.w3.org/2000/svg", "path"); + return this.alternate ? e.setAttribute("d", this.alternate) : e.setAttribute("d", C[this.pathName]), e; + }), + (t.toMarkup = function () { + return this.alternate ? "" : ""; + }), + e + ); + })(), + ae = (function () { + function e(e) { + (this.attributes = void 0), (this.attributes = e || {}); + } + var t = e.prototype; + return ( + (t.toNode = function () { + var e = document.createElementNS("http://www.w3.org/2000/svg", "line"); + for (var t in this.attributes) Object.prototype.hasOwnProperty.call(this.attributes, t) && e.setAttribute(t, this.attributes[t]); + return e; + }), + (t.toMarkup = function () { + var e = ""; + }), + e + ); + })(); + function ie(e) { + if (e instanceof te) return e; + throw new Error("Expected symbolNode but got " + String(e) + "."); + } + var oe = { bin: 1, close: 1, inner: 1, open: 1, punct: 1, rel: 1 }, + se = { "accent-token": 1, mathord: 1, "op-token": 1, spacing: 1, textord: 1 }, + le = { math: {}, text: {} }, + he = le; + function ce(e, t, r, n, a, i) { + (le[e][a] = { font: t, group: r, replace: n }), i && n && (le[e][n] = le[e][a]); + } + var me = "math", + ue = "text", + pe = "main", + de = "ams", + fe = "accent-token", + ge = "bin", + ve = "close", + ye = "inner", + be = "mathord", + xe = "op-token", + we = "open", + ke = "punct", + Se = "rel", + Me = "spacing", + ze = "textord"; + ce(me, pe, Se, "≡", "\\equiv", !0), + ce(me, pe, Se, "≺", "\\prec", !0), + ce(me, pe, Se, "≻", "\\succ", !0), + ce(me, pe, Se, "∼", "\\sim", !0), + ce(me, pe, Se, "⊥", "\\perp"), + ce(me, pe, Se, "⪯", "\\preceq", !0), + ce(me, pe, Se, "⪰", "\\succeq", !0), + ce(me, pe, Se, "≃", "\\simeq", !0), + ce(me, pe, Se, "∣", "\\mid", !0), + ce(me, pe, Se, "≪", "\\ll", !0), + ce(me, pe, Se, "≫", "\\gg", !0), + ce(me, pe, Se, "≍", "\\asymp", !0), + ce(me, pe, Se, "∥", "\\parallel"), + ce(me, pe, Se, "⋈", "\\bowtie", !0), + ce(me, pe, Se, "⌣", "\\smile", !0), + ce(me, pe, Se, "⊑", "\\sqsubseteq", !0), + ce(me, pe, Se, "⊒", "\\sqsupseteq", !0), + ce(me, pe, Se, "≐", "\\doteq", !0), + ce(me, pe, Se, "⌢", "\\frown", !0), + ce(me, pe, Se, "∋", "\\ni", !0), + ce(me, pe, Se, "∝", "\\propto", !0), + ce(me, pe, Se, "⊢", "\\vdash", !0), + ce(me, pe, Se, "⊣", "\\dashv", !0), + ce(me, pe, Se, "∋", "\\owns"), + ce(me, pe, ke, ".", "\\ldotp"), + ce(me, pe, ke, "⋅", "\\cdotp"), + ce(me, pe, ze, "#", "\\#"), + ce(ue, pe, ze, "#", "\\#"), + ce(me, pe, ze, "&", "\\&"), + ce(ue, pe, ze, "&", "\\&"), + ce(me, pe, ze, "ℵ", "\\aleph", !0), + ce(me, pe, ze, "∀", "\\forall", !0), + ce(me, pe, ze, "ℏ", "\\hbar", !0), + ce(me, pe, ze, "∃", "\\exists", !0), + ce(me, pe, ze, "∇", "\\nabla", !0), + ce(me, pe, ze, "♭", "\\flat", !0), + ce(me, pe, ze, "ℓ", "\\ell", !0), + ce(me, pe, ze, "♮", "\\natural", !0), + ce(me, pe, ze, "♣", "\\clubsuit", !0), + ce(me, pe, ze, "℘", "\\wp", !0), + ce(me, pe, ze, "♯", "\\sharp", !0), + ce(me, pe, ze, "♢", "\\diamondsuit", !0), + ce(me, pe, ze, "ℜ", "\\Re", !0), + ce(me, pe, ze, "♡", "\\heartsuit", !0), + ce(me, pe, ze, "ℑ", "\\Im", !0), + ce(me, pe, ze, "♠", "\\spadesuit", !0), + ce(me, pe, ze, "§", "\\S", !0), + ce(ue, pe, ze, "§", "\\S"), + ce(me, pe, ze, "¶", "\\P", !0), + ce(ue, pe, ze, "¶", "\\P"), + ce(me, pe, ze, "†", "\\dag"), + ce(ue, pe, ze, "†", "\\dag"), + ce(ue, pe, ze, "†", "\\textdagger"), + ce(me, pe, ze, "‡", "\\ddag"), + ce(ue, pe, ze, "‡", "\\ddag"), + ce(ue, pe, ze, "‡", "\\textdaggerdbl"), + ce(me, pe, ve, "⎱", "\\rmoustache", !0), + ce(me, pe, we, "⎰", "\\lmoustache", !0), + ce(me, pe, ve, "⟯", "\\rgroup", !0), + ce(me, pe, we, "⟮", "\\lgroup", !0), + ce(me, pe, ge, "∓", "\\mp", !0), + ce(me, pe, ge, "⊖", "\\ominus", !0), + ce(me, pe, ge, "⊎", "\\uplus", !0), + ce(me, pe, ge, "⊓", "\\sqcap", !0), + ce(me, pe, ge, "∗", "\\ast"), + ce(me, pe, ge, "⊔", "\\sqcup", !0), + ce(me, pe, ge, "◯", "\\bigcirc", !0), + ce(me, pe, ge, "∙", "\\bullet", !0), + ce(me, pe, ge, "‡", "\\ddagger"), + ce(me, pe, ge, "≀", "\\wr", !0), + ce(me, pe, ge, "⨿", "\\amalg"), + ce(me, pe, ge, "&", "\\And"), + ce(me, pe, Se, "⟵", "\\longleftarrow", !0), + ce(me, pe, Se, "⇐", "\\Leftarrow", !0), + ce(me, pe, Se, "⟸", "\\Longleftarrow", !0), + ce(me, pe, Se, "⟶", "\\longrightarrow", !0), + ce(me, pe, Se, "⇒", "\\Rightarrow", !0), + ce(me, pe, Se, "⟹", "\\Longrightarrow", !0), + ce(me, pe, Se, "↔", "\\leftrightarrow", !0), + ce(me, pe, Se, "⟷", "\\longleftrightarrow", !0), + ce(me, pe, Se, "⇔", "\\Leftrightarrow", !0), + ce(me, pe, Se, "⟺", "\\Longleftrightarrow", !0), + ce(me, pe, Se, "↦", "\\mapsto", !0), + ce(me, pe, Se, "⟼", "\\longmapsto", !0), + ce(me, pe, Se, "↗", "\\nearrow", !0), + ce(me, pe, Se, "↩", "\\hookleftarrow", !0), + ce(me, pe, Se, "↪", "\\hookrightarrow", !0), + ce(me, pe, Se, "↘", "\\searrow", !0), + ce(me, pe, Se, "↼", "\\leftharpoonup", !0), + ce(me, pe, Se, "⇀", "\\rightharpoonup", !0), + ce(me, pe, Se, "↙", "\\swarrow", !0), + ce(me, pe, Se, "↽", "\\leftharpoondown", !0), + ce(me, pe, Se, "⇁", "\\rightharpoondown", !0), + ce(me, pe, Se, "↖", "\\nwarrow", !0), + ce(me, pe, Se, "⇌", "\\rightleftharpoons", !0), + ce(me, de, Se, "≮", "\\nless", !0), + ce(me, de, Se, "", "\\@nleqslant"), + ce(me, de, Se, "", "\\@nleqq"), + ce(me, de, Se, "⪇", "\\lneq", !0), + ce(me, de, Se, "≨", "\\lneqq", !0), + ce(me, de, Se, "", "\\@lvertneqq"), + ce(me, de, Se, "⋦", "\\lnsim", !0), + ce(me, de, Se, "⪉", "\\lnapprox", !0), + ce(me, de, Se, "⊀", "\\nprec", !0), + ce(me, de, Se, "⋠", "\\npreceq", !0), + ce(me, de, Se, "⋨", "\\precnsim", !0), + ce(me, de, Se, "⪹", "\\precnapprox", !0), + ce(me, de, Se, "≁", "\\nsim", !0), + ce(me, de, Se, "", "\\@nshortmid"), + ce(me, de, Se, "∤", "\\nmid", !0), + ce(me, de, Se, "⊬", "\\nvdash", !0), + ce(me, de, Se, "⊭", "\\nvDash", !0), + ce(me, de, Se, "⋪", "\\ntriangleleft"), + ce(me, de, Se, "⋬", "\\ntrianglelefteq", !0), + ce(me, de, Se, "⊊", "\\subsetneq", !0), + ce(me, de, Se, "", "\\@varsubsetneq"), + ce(me, de, Se, "⫋", "\\subsetneqq", !0), + ce(me, de, Se, "", "\\@varsubsetneqq"), + ce(me, de, Se, "≯", "\\ngtr", !0), + ce(me, de, Se, "", "\\@ngeqslant"), + ce(me, de, Se, "", "\\@ngeqq"), + ce(me, de, Se, "⪈", "\\gneq", !0), + ce(me, de, Se, "≩", "\\gneqq", !0), + ce(me, de, Se, "", "\\@gvertneqq"), + ce(me, de, Se, "⋧", "\\gnsim", !0), + ce(me, de, Se, "⪊", "\\gnapprox", !0), + ce(me, de, Se, "⊁", "\\nsucc", !0), + ce(me, de, Se, "⋡", "\\nsucceq", !0), + ce(me, de, Se, "⋩", "\\succnsim", !0), + ce(me, de, Se, "⪺", "\\succnapprox", !0), + ce(me, de, Se, "≆", "\\ncong", !0), + ce(me, de, Se, "", "\\@nshortparallel"), + ce(me, de, Se, "∦", "\\nparallel", !0), + ce(me, de, Se, "⊯", "\\nVDash", !0), + ce(me, de, Se, "⋫", "\\ntriangleright"), + ce(me, de, Se, "⋭", "\\ntrianglerighteq", !0), + ce(me, de, Se, "", "\\@nsupseteqq"), + ce(me, de, Se, "⊋", "\\supsetneq", !0), + ce(me, de, Se, "", "\\@varsupsetneq"), + ce(me, de, Se, "⫌", "\\supsetneqq", !0), + ce(me, de, Se, "", "\\@varsupsetneqq"), + ce(me, de, Se, "⊮", "\\nVdash", !0), + ce(me, de, Se, "⪵", "\\precneqq", !0), + ce(me, de, Se, "⪶", "\\succneqq", !0), + ce(me, de, Se, "", "\\@nsubseteqq"), + ce(me, de, ge, "⊴", "\\unlhd"), + ce(me, de, ge, "⊵", "\\unrhd"), + ce(me, de, Se, "↚", "\\nleftarrow", !0), + ce(me, de, Se, "↛", "\\nrightarrow", !0), + ce(me, de, Se, "⇍", "\\nLeftarrow", !0), + ce(me, de, Se, "⇏", "\\nRightarrow", !0), + ce(me, de, Se, "↮", "\\nleftrightarrow", !0), + ce(me, de, Se, "⇎", "\\nLeftrightarrow", !0), + ce(me, de, Se, "△", "\\vartriangle"), + ce(me, de, ze, "ℏ", "\\hslash"), + ce(me, de, ze, "▽", "\\triangledown"), + ce(me, de, ze, "◊", "\\lozenge"), + ce(me, de, ze, "Ⓢ", "\\circledS"), + ce(me, de, ze, "®", "\\circledR"), + ce(ue, de, ze, "®", "\\circledR"), + ce(me, de, ze, "∡", "\\measuredangle", !0), + ce(me, de, ze, "∄", "\\nexists"), + ce(me, de, ze, "℧", "\\mho"), + ce(me, de, ze, "Ⅎ", "\\Finv", !0), + ce(me, de, ze, "⅁", "\\Game", !0), + ce(me, de, ze, "‵", "\\backprime"), + ce(me, de, ze, "▲", "\\blacktriangle"), + ce(me, de, ze, "▼", "\\blacktriangledown"), + ce(me, de, ze, "■", "\\blacksquare"), + ce(me, de, ze, "⧫", "\\blacklozenge"), + ce(me, de, ze, "★", "\\bigstar"), + ce(me, de, ze, "∢", "\\sphericalangle", !0), + ce(me, de, ze, "∁", "\\complement", !0), + ce(me, de, ze, "ð", "\\eth", !0), + ce(ue, pe, ze, "ð", "ð"), + ce(me, de, ze, "╱", "\\diagup"), + ce(me, de, ze, "╲", "\\diagdown"), + ce(me, de, ze, "□", "\\square"), + ce(me, de, ze, "□", "\\Box"), + ce(me, de, ze, "◊", "\\Diamond"), + ce(me, de, ze, "¥", "\\yen", !0), + ce(ue, de, ze, "¥", "\\yen", !0), + ce(me, de, ze, "✓", "\\checkmark", !0), + ce(ue, de, ze, "✓", "\\checkmark"), + ce(me, de, ze, "ℶ", "\\beth", !0), + ce(me, de, ze, "ℸ", "\\daleth", !0), + ce(me, de, ze, "ℷ", "\\gimel", !0), + ce(me, de, ze, "ϝ", "\\digamma", !0), + ce(me, de, ze, "ϰ", "\\varkappa"), + ce(me, de, we, "┌", "\\@ulcorner", !0), + ce(me, de, ve, "┐", "\\@urcorner", !0), + ce(me, de, we, "└", "\\@llcorner", !0), + ce(me, de, ve, "┘", "\\@lrcorner", !0), + ce(me, de, Se, "≦", "\\leqq", !0), + ce(me, de, Se, "⩽", "\\leqslant", !0), + ce(me, de, Se, "⪕", "\\eqslantless", !0), + ce(me, de, Se, "≲", "\\lesssim", !0), + ce(me, de, Se, "⪅", "\\lessapprox", !0), + ce(me, de, Se, "≊", "\\approxeq", !0), + ce(me, de, ge, "⋖", "\\lessdot"), + ce(me, de, Se, "⋘", "\\lll", !0), + ce(me, de, Se, "≶", "\\lessgtr", !0), + ce(me, de, Se, "⋚", "\\lesseqgtr", !0), + ce(me, de, Se, "⪋", "\\lesseqqgtr", !0), + ce(me, de, Se, "≑", "\\doteqdot"), + ce(me, de, Se, "≓", "\\risingdotseq", !0), + ce(me, de, Se, "≒", "\\fallingdotseq", !0), + ce(me, de, Se, "∽", "\\backsim", !0), + ce(me, de, Se, "⋍", "\\backsimeq", !0), + ce(me, de, Se, "⫅", "\\subseteqq", !0), + ce(me, de, Se, "⋐", "\\Subset", !0), + ce(me, de, Se, "⊏", "\\sqsubset", !0), + ce(me, de, Se, "≼", "\\preccurlyeq", !0), + ce(me, de, Se, "⋞", "\\curlyeqprec", !0), + ce(me, de, Se, "≾", "\\precsim", !0), + ce(me, de, Se, "⪷", "\\precapprox", !0), + ce(me, de, Se, "⊲", "\\vartriangleleft"), + ce(me, de, Se, "⊴", "\\trianglelefteq"), + ce(me, de, Se, "⊨", "\\vDash", !0), + ce(me, de, Se, "⊪", "\\Vvdash", !0), + ce(me, de, Se, "⌣", "\\smallsmile"), + ce(me, de, Se, "⌢", "\\smallfrown"), + ce(me, de, Se, "≏", "\\bumpeq", !0), + ce(me, de, Se, "≎", "\\Bumpeq", !0), + ce(me, de, Se, "≧", "\\geqq", !0), + ce(me, de, Se, "⩾", "\\geqslant", !0), + ce(me, de, Se, "⪖", "\\eqslantgtr", !0), + ce(me, de, Se, "≳", "\\gtrsim", !0), + ce(me, de, Se, "⪆", "\\gtrapprox", !0), + ce(me, de, ge, "⋗", "\\gtrdot"), + ce(me, de, Se, "⋙", "\\ggg", !0), + ce(me, de, Se, "≷", "\\gtrless", !0), + ce(me, de, Se, "⋛", "\\gtreqless", !0), + ce(me, de, Se, "⪌", "\\gtreqqless", !0), + ce(me, de, Se, "≖", "\\eqcirc", !0), + ce(me, de, Se, "≗", "\\circeq", !0), + ce(me, de, Se, "≜", "\\triangleq", !0), + ce(me, de, Se, "∼", "\\thicksim"), + ce(me, de, Se, "≈", "\\thickapprox"), + ce(me, de, Se, "⫆", "\\supseteqq", !0), + ce(me, de, Se, "⋑", "\\Supset", !0), + ce(me, de, Se, "⊐", "\\sqsupset", !0), + ce(me, de, Se, "≽", "\\succcurlyeq", !0), + ce(me, de, Se, "⋟", "\\curlyeqsucc", !0), + ce(me, de, Se, "≿", "\\succsim", !0), + ce(me, de, Se, "⪸", "\\succapprox", !0), + ce(me, de, Se, "⊳", "\\vartriangleright"), + ce(me, de, Se, "⊵", "\\trianglerighteq"), + ce(me, de, Se, "⊩", "\\Vdash", !0), + ce(me, de, Se, "∣", "\\shortmid"), + ce(me, de, Se, "∥", "\\shortparallel"), + ce(me, de, Se, "≬", "\\between", !0), + ce(me, de, Se, "⋔", "\\pitchfork", !0), + ce(me, de, Se, "∝", "\\varpropto"), + ce(me, de, Se, "◀", "\\blacktriangleleft"), + ce(me, de, Se, "∴", "\\therefore", !0), + ce(me, de, Se, "∍", "\\backepsilon"), + ce(me, de, Se, "▶", "\\blacktriangleright"), + ce(me, de, Se, "∵", "\\because", !0), + ce(me, de, Se, "⋘", "\\llless"), + ce(me, de, Se, "⋙", "\\gggtr"), + ce(me, de, ge, "⊲", "\\lhd"), + ce(me, de, ge, "⊳", "\\rhd"), + ce(me, de, Se, "≂", "\\eqsim", !0), + ce(me, pe, Se, "⋈", "\\Join"), + ce(me, de, Se, "≑", "\\Doteq", !0), + ce(me, de, ge, "∔", "\\dotplus", !0), + ce(me, de, ge, "∖", "\\smallsetminus"), + ce(me, de, ge, "⋒", "\\Cap", !0), + ce(me, de, ge, "⋓", "\\Cup", !0), + ce(me, de, ge, "⩞", "\\doublebarwedge", !0), + ce(me, de, ge, "⊟", "\\boxminus", !0), + ce(me, de, ge, "⊞", "\\boxplus", !0), + ce(me, de, ge, "⋇", "\\divideontimes", !0), + ce(me, de, ge, "⋉", "\\ltimes", !0), + ce(me, de, ge, "⋊", "\\rtimes", !0), + ce(me, de, ge, "⋋", "\\leftthreetimes", !0), + ce(me, de, ge, "⋌", "\\rightthreetimes", !0), + ce(me, de, ge, "⋏", "\\curlywedge", !0), + ce(me, de, ge, "⋎", "\\curlyvee", !0), + ce(me, de, ge, "⊝", "\\circleddash", !0), + ce(me, de, ge, "⊛", "\\circledast", !0), + ce(me, de, ge, "⋅", "\\centerdot"), + ce(me, de, ge, "⊺", "\\intercal", !0), + ce(me, de, ge, "⋒", "\\doublecap"), + ce(me, de, ge, "⋓", "\\doublecup"), + ce(me, de, ge, "⊠", "\\boxtimes", !0), + ce(me, de, Se, "⇢", "\\dashrightarrow", !0), + ce(me, de, Se, "⇠", "\\dashleftarrow", !0), + ce(me, de, Se, "⇇", "\\leftleftarrows", !0), + ce(me, de, Se, "⇆", "\\leftrightarrows", !0), + ce(me, de, Se, "⇚", "\\Lleftarrow", !0), + ce(me, de, Se, "↞", "\\twoheadleftarrow", !0), + ce(me, de, Se, "↢", "\\leftarrowtail", !0), + ce(me, de, Se, "↫", "\\looparrowleft", !0), + ce(me, de, Se, "⇋", "\\leftrightharpoons", !0), + ce(me, de, Se, "↶", "\\curvearrowleft", !0), + ce(me, de, Se, "↺", "\\circlearrowleft", !0), + ce(me, de, Se, "↰", "\\Lsh", !0), + ce(me, de, Se, "⇈", "\\upuparrows", !0), + ce(me, de, Se, "↿", "\\upharpoonleft", !0), + ce(me, de, Se, "⇃", "\\downharpoonleft", !0), + ce(me, pe, Se, "⊶", "\\origof", !0), + ce(me, pe, Se, "⊷", "\\imageof", !0), + ce(me, de, Se, "⊸", "\\multimap", !0), + ce(me, de, Se, "↭", "\\leftrightsquigarrow", !0), + ce(me, de, Se, "⇉", "\\rightrightarrows", !0), + ce(me, de, Se, "⇄", "\\rightleftarrows", !0), + ce(me, de, Se, "↠", "\\twoheadrightarrow", !0), + ce(me, de, Se, "↣", "\\rightarrowtail", !0), + ce(me, de, Se, "↬", "\\looparrowright", !0), + ce(me, de, Se, "↷", "\\curvearrowright", !0), + ce(me, de, Se, "↻", "\\circlearrowright", !0), + ce(me, de, Se, "↱", "\\Rsh", !0), + ce(me, de, Se, "⇊", "\\downdownarrows", !0), + ce(me, de, Se, "↾", "\\upharpoonright", !0), + ce(me, de, Se, "⇂", "\\downharpoonright", !0), + ce(me, de, Se, "⇝", "\\rightsquigarrow", !0), + ce(me, de, Se, "⇝", "\\leadsto"), + ce(me, de, Se, "⇛", "\\Rrightarrow", !0), + ce(me, de, Se, "↾", "\\restriction"), + ce(me, pe, ze, "‘", "`"), + ce(me, pe, ze, "$", "\\$"), + ce(ue, pe, ze, "$", "\\$"), + ce(ue, pe, ze, "$", "\\textdollar"), + ce(me, pe, ze, "%", "\\%"), + ce(ue, pe, ze, "%", "\\%"), + ce(me, pe, ze, "_", "\\_"), + ce(ue, pe, ze, "_", "\\_"), + ce(ue, pe, ze, "_", "\\textunderscore"), + ce(me, pe, ze, "∠", "\\angle", !0), + ce(me, pe, ze, "∞", "\\infty", !0), + ce(me, pe, ze, "′", "\\prime"), + ce(me, pe, ze, "△", "\\triangle"), + ce(me, pe, ze, "Γ", "\\Gamma", !0), + ce(me, pe, ze, "Δ", "\\Delta", !0), + ce(me, pe, ze, "Θ", "\\Theta", !0), + ce(me, pe, ze, "Λ", "\\Lambda", !0), + ce(me, pe, ze, "Ξ", "\\Xi", !0), + ce(me, pe, ze, "Π", "\\Pi", !0), + ce(me, pe, ze, "Σ", "\\Sigma", !0), + ce(me, pe, ze, "Υ", "\\Upsilon", !0), + ce(me, pe, ze, "Φ", "\\Phi", !0), + ce(me, pe, ze, "Ψ", "\\Psi", !0), + ce(me, pe, ze, "Ω", "\\Omega", !0), + ce(me, pe, ze, "A", "Α"), + ce(me, pe, ze, "B", "Β"), + ce(me, pe, ze, "E", "Ε"), + ce(me, pe, ze, "Z", "Ζ"), + ce(me, pe, ze, "H", "Η"), + ce(me, pe, ze, "I", "Ι"), + ce(me, pe, ze, "K", "Κ"), + ce(me, pe, ze, "M", "Μ"), + ce(me, pe, ze, "N", "Ν"), + ce(me, pe, ze, "O", "Ο"), + ce(me, pe, ze, "P", "Ρ"), + ce(me, pe, ze, "T", "Τ"), + ce(me, pe, ze, "X", "Χ"), + ce(me, pe, ze, "¬", "\\neg", !0), + ce(me, pe, ze, "¬", "\\lnot"), + ce(me, pe, ze, "⊤", "\\top"), + ce(me, pe, ze, "⊥", "\\bot"), + ce(me, pe, ze, "∅", "\\emptyset"), + ce(me, de, ze, "∅", "\\varnothing"), + ce(me, pe, be, "α", "\\alpha", !0), + ce(me, pe, be, "β", "\\beta", !0), + ce(me, pe, be, "γ", "\\gamma", !0), + ce(me, pe, be, "δ", "\\delta", !0), + ce(me, pe, be, "ϵ", "\\epsilon", !0), + ce(me, pe, be, "ζ", "\\zeta", !0), + ce(me, pe, be, "η", "\\eta", !0), + ce(me, pe, be, "θ", "\\theta", !0), + ce(me, pe, be, "ι", "\\iota", !0), + ce(me, pe, be, "κ", "\\kappa", !0), + ce(me, pe, be, "λ", "\\lambda", !0), + ce(me, pe, be, "μ", "\\mu", !0), + ce(me, pe, be, "ν", "\\nu", !0), + ce(me, pe, be, "ξ", "\\xi", !0), + ce(me, pe, be, "ο", "\\omicron", !0), + ce(me, pe, be, "π", "\\pi", !0), + ce(me, pe, be, "ρ", "\\rho", !0), + ce(me, pe, be, "σ", "\\sigma", !0), + ce(me, pe, be, "τ", "\\tau", !0), + ce(me, pe, be, "υ", "\\upsilon", !0), + ce(me, pe, be, "ϕ", "\\phi", !0), + ce(me, pe, be, "χ", "\\chi", !0), + ce(me, pe, be, "ψ", "\\psi", !0), + ce(me, pe, be, "ω", "\\omega", !0), + ce(me, pe, be, "ε", "\\varepsilon", !0), + ce(me, pe, be, "ϑ", "\\vartheta", !0), + ce(me, pe, be, "ϖ", "\\varpi", !0), + ce(me, pe, be, "ϱ", "\\varrho", !0), + ce(me, pe, be, "ς", "\\varsigma", !0), + ce(me, pe, be, "φ", "\\varphi", !0), + ce(me, pe, ge, "∗", "*", !0), + ce(me, pe, ge, "+", "+"), + ce(me, pe, ge, "−", "-", !0), + ce(me, pe, ge, "⋅", "\\cdot", !0), + ce(me, pe, ge, "∘", "\\circ", !0), + ce(me, pe, ge, "÷", "\\div", !0), + ce(me, pe, ge, "±", "\\pm", !0), + ce(me, pe, ge, "×", "\\times", !0), + ce(me, pe, ge, "∩", "\\cap", !0), + ce(me, pe, ge, "∪", "\\cup", !0), + ce(me, pe, ge, "∖", "\\setminus", !0), + ce(me, pe, ge, "∧", "\\land"), + ce(me, pe, ge, "∨", "\\lor"), + ce(me, pe, ge, "∧", "\\wedge", !0), + ce(me, pe, ge, "∨", "\\vee", !0), + ce(me, pe, ze, "√", "\\surd"), + ce(me, pe, we, "⟨", "\\langle", !0), + ce(me, pe, we, "∣", "\\lvert"), + ce(me, pe, we, "∥", "\\lVert"), + ce(me, pe, ve, "?", "?"), + ce(me, pe, ve, "!", "!"), + ce(me, pe, ve, "⟩", "\\rangle", !0), + ce(me, pe, ve, "∣", "\\rvert"), + ce(me, pe, ve, "∥", "\\rVert"), + ce(me, pe, Se, "=", "="), + ce(me, pe, Se, ":", ":"), + ce(me, pe, Se, "≈", "\\approx", !0), + ce(me, pe, Se, "≅", "\\cong", !0), + ce(me, pe, Se, "≥", "\\ge"), + ce(me, pe, Se, "≥", "\\geq", !0), + ce(me, pe, Se, "←", "\\gets"), + ce(me, pe, Se, ">", "\\gt", !0), + ce(me, pe, Se, "∈", "\\in", !0), + ce(me, pe, Se, "", "\\@not"), + ce(me, pe, Se, "⊂", "\\subset", !0), + ce(me, pe, Se, "⊃", "\\supset", !0), + ce(me, pe, Se, "⊆", "\\subseteq", !0), + ce(me, pe, Se, "⊇", "\\supseteq", !0), + ce(me, de, Se, "⊈", "\\nsubseteq", !0), + ce(me, de, Se, "⊉", "\\nsupseteq", !0), + ce(me, pe, Se, "⊨", "\\models"), + ce(me, pe, Se, "←", "\\leftarrow", !0), + ce(me, pe, Se, "≤", "\\le"), + ce(me, pe, Se, "≤", "\\leq", !0), + ce(me, pe, Se, "<", "\\lt", !0), + ce(me, pe, Se, "→", "\\rightarrow", !0), + ce(me, pe, Se, "→", "\\to"), + ce(me, de, Se, "≱", "\\ngeq", !0), + ce(me, de, Se, "≰", "\\nleq", !0), + ce(me, pe, Me, " ", "\\ "), + ce(me, pe, Me, " ", "\\space"), + ce(me, pe, Me, " ", "\\nobreakspace"), + ce(ue, pe, Me, " ", "\\ "), + ce(ue, pe, Me, " ", " "), + ce(ue, pe, Me, " ", "\\space"), + ce(ue, pe, Me, " ", "\\nobreakspace"), + ce(me, pe, Me, null, "\\nobreak"), + ce(me, pe, Me, null, "\\allowbreak"), + ce(me, pe, ke, ",", ","), + ce(me, pe, ke, ";", ";"), + ce(me, de, ge, "⊼", "\\barwedge", !0), + ce(me, de, ge, "⊻", "\\veebar", !0), + ce(me, pe, ge, "⊙", "\\odot", !0), + ce(me, pe, ge, "⊕", "\\oplus", !0), + ce(me, pe, ge, "⊗", "\\otimes", !0), + ce(me, pe, ze, "∂", "\\partial", !0), + ce(me, pe, ge, "⊘", "\\oslash", !0), + ce(me, de, ge, "⊚", "\\circledcirc", !0), + ce(me, de, ge, "⊡", "\\boxdot", !0), + ce(me, pe, ge, "△", "\\bigtriangleup"), + ce(me, pe, ge, "▽", "\\bigtriangledown"), + ce(me, pe, ge, "†", "\\dagger"), + ce(me, pe, ge, "⋄", "\\diamond"), + ce(me, pe, ge, "⋆", "\\star"), + ce(me, pe, ge, "◃", "\\triangleleft"), + ce(me, pe, ge, "▹", "\\triangleright"), + ce(me, pe, we, "{", "\\{"), + ce(ue, pe, ze, "{", "\\{"), + ce(ue, pe, ze, "{", "\\textbraceleft"), + ce(me, pe, ve, "}", "\\}"), + ce(ue, pe, ze, "}", "\\}"), + ce(ue, pe, ze, "}", "\\textbraceright"), + ce(me, pe, we, "{", "\\lbrace"), + ce(me, pe, ve, "}", "\\rbrace"), + ce(me, pe, we, "[", "\\lbrack", !0), + ce(ue, pe, ze, "[", "\\lbrack", !0), + ce(me, pe, ve, "]", "\\rbrack", !0), + ce(ue, pe, ze, "]", "\\rbrack", !0), + ce(me, pe, we, "(", "\\lparen", !0), + ce(me, pe, ve, ")", "\\rparen", !0), + ce(ue, pe, ze, "<", "\\textless", !0), + ce(ue, pe, ze, ">", "\\textgreater", !0), + ce(me, pe, we, "⌊", "\\lfloor", !0), + ce(me, pe, ve, "⌋", "\\rfloor", !0), + ce(me, pe, we, "⌈", "\\lceil", !0), + ce(me, pe, ve, "⌉", "\\rceil", !0), + ce(me, pe, ze, "\\", "\\backslash"), + ce(me, pe, ze, "∣", "|"), + ce(me, pe, ze, "∣", "\\vert"), + ce(ue, pe, ze, "|", "\\textbar", !0), + ce(me, pe, ze, "∥", "\\|"), + ce(me, pe, ze, "∥", "\\Vert"), + ce(ue, pe, ze, "∥", "\\textbardbl"), + ce(ue, pe, ze, "~", "\\textasciitilde"), + ce(ue, pe, ze, "\\", "\\textbackslash"), + ce(ue, pe, ze, "^", "\\textasciicircum"), + ce(me, pe, Se, "↑", "\\uparrow", !0), + ce(me, pe, Se, "⇑", "\\Uparrow", !0), + ce(me, pe, Se, "↓", "\\downarrow", !0), + ce(me, pe, Se, "⇓", "\\Downarrow", !0), + ce(me, pe, Se, "↕", "\\updownarrow", !0), + ce(me, pe, Se, "⇕", "\\Updownarrow", !0), + ce(me, pe, xe, "∐", "\\coprod"), + ce(me, pe, xe, "⋁", "\\bigvee"), + ce(me, pe, xe, "⋀", "\\bigwedge"), + ce(me, pe, xe, "⨄", "\\biguplus"), + ce(me, pe, xe, "⋂", "\\bigcap"), + ce(me, pe, xe, "⋃", "\\bigcup"), + ce(me, pe, xe, "∫", "\\int"), + ce(me, pe, xe, "∫", "\\intop"), + ce(me, pe, xe, "∬", "\\iint"), + ce(me, pe, xe, "∭", "\\iiint"), + ce(me, pe, xe, "∏", "\\prod"), + ce(me, pe, xe, "∑", "\\sum"), + ce(me, pe, xe, "⨂", "\\bigotimes"), + ce(me, pe, xe, "⨁", "\\bigoplus"), + ce(me, pe, xe, "⨀", "\\bigodot"), + ce(me, pe, xe, "∮", "\\oint"), + ce(me, pe, xe, "∯", "\\oiint"), + ce(me, pe, xe, "∰", "\\oiiint"), + ce(me, pe, xe, "⨆", "\\bigsqcup"), + ce(me, pe, xe, "∫", "\\smallint"), + ce(ue, pe, ye, "…", "\\textellipsis"), + ce(me, pe, ye, "…", "\\mathellipsis"), + ce(ue, pe, ye, "…", "\\ldots", !0), + ce(me, pe, ye, "…", "\\ldots", !0), + ce(me, pe, ye, "⋯", "\\@cdots", !0), + ce(me, pe, ye, "⋱", "\\ddots", !0), + ce(me, pe, ze, "⋮", "\\varvdots"), + ce(me, pe, fe, "ˊ", "\\acute"), + ce(me, pe, fe, "ˋ", "\\grave"), + ce(me, pe, fe, "¨", "\\ddot"), + ce(me, pe, fe, "~", "\\tilde"), + ce(me, pe, fe, "ˉ", "\\bar"), + ce(me, pe, fe, "˘", "\\breve"), + ce(me, pe, fe, "ˇ", "\\check"), + ce(me, pe, fe, "^", "\\hat"), + ce(me, pe, fe, "⃗", "\\vec"), + ce(me, pe, fe, "˙", "\\dot"), + ce(me, pe, fe, "˚", "\\mathring"), + ce(me, pe, be, "", "\\@imath"), + ce(me, pe, be, "", "\\@jmath"), + ce(me, pe, ze, "ı", "ı"), + ce(me, pe, ze, "ȷ", "ȷ"), + ce(ue, pe, ze, "ı", "\\i", !0), + ce(ue, pe, ze, "ȷ", "\\j", !0), + ce(ue, pe, ze, "ß", "\\ss", !0), + ce(ue, pe, ze, "æ", "\\ae", !0), + ce(ue, pe, ze, "œ", "\\oe", !0), + ce(ue, pe, ze, "ø", "\\o", !0), + ce(ue, pe, ze, "Æ", "\\AE", !0), + ce(ue, pe, ze, "Œ", "\\OE", !0), + ce(ue, pe, ze, "Ø", "\\O", !0), + ce(ue, pe, fe, "ˊ", "\\'"), + ce(ue, pe, fe, "ˋ", "\\`"), + ce(ue, pe, fe, "ˆ", "\\^"), + ce(ue, pe, fe, "˜", "\\~"), + ce(ue, pe, fe, "ˉ", "\\="), + ce(ue, pe, fe, "˘", "\\u"), + ce(ue, pe, fe, "˙", "\\."), + ce(ue, pe, fe, "¸", "\\c"), + ce(ue, pe, fe, "˚", "\\r"), + ce(ue, pe, fe, "ˇ", "\\v"), + ce(ue, pe, fe, "¨", '\\"'), + ce(ue, pe, fe, "˝", "\\H"), + ce(ue, pe, fe, "◯", "\\textcircled"); + var Ae = { "--": !0, "---": !0, "``": !0, "''": !0 }; + ce(ue, pe, ze, "–", "--", !0), + ce(ue, pe, ze, "–", "\\textendash"), + ce(ue, pe, ze, "—", "---", !0), + ce(ue, pe, ze, "—", "\\textemdash"), + ce(ue, pe, ze, "‘", "`", !0), + ce(ue, pe, ze, "‘", "\\textquoteleft"), + ce(ue, pe, ze, "’", "'", !0), + ce(ue, pe, ze, "’", "\\textquoteright"), + ce(ue, pe, ze, "“", "``", !0), + ce(ue, pe, ze, "“", "\\textquotedblleft"), + ce(ue, pe, ze, "”", "''", !0), + ce(ue, pe, ze, "”", "\\textquotedblright"), + ce(me, pe, ze, "°", "\\degree", !0), + ce(ue, pe, ze, "°", "\\degree"), + ce(ue, pe, ze, "°", "\\textdegree", !0), + ce(me, pe, ze, "£", "\\pounds"), + ce(me, pe, ze, "£", "\\mathsterling", !0), + ce(ue, pe, ze, "£", "\\pounds"), + ce(ue, pe, ze, "£", "\\textsterling", !0), + ce(me, de, ze, "✠", "\\maltese"), + ce(ue, de, ze, "✠", "\\maltese"); + for (var Te = 0; Te < 14; Te++) { + var Be = '0123456789/@."'.charAt(Te); + ce(me, pe, ze, Be, Be); + } + for (var Ne = 0; Ne < 25; Ne++) { + var Ce = '0123456789!@*()-=+";:?/.,'.charAt(Ne); + ce(ue, pe, ze, Ce, Ce); + } + for (var qe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Ie = 0; Ie < 52; Ie++) { + var Re = qe.charAt(Ie); + ce(me, pe, be, Re, Re), ce(ue, pe, ze, Re, Re); + } + ce(me, de, ze, "C", "ℂ"), + ce(ue, de, ze, "C", "ℂ"), + ce(me, de, ze, "H", "ℍ"), + ce(ue, de, ze, "H", "ℍ"), + ce(me, de, ze, "N", "ℕ"), + ce(ue, de, ze, "N", "ℕ"), + ce(me, de, ze, "P", "ℙ"), + ce(ue, de, ze, "P", "ℙ"), + ce(me, de, ze, "Q", "ℚ"), + ce(ue, de, ze, "Q", "ℚ"), + ce(me, de, ze, "R", "ℝ"), + ce(ue, de, ze, "R", "ℝ"), + ce(me, de, ze, "Z", "ℤ"), + ce(ue, de, ze, "Z", "ℤ"), + ce(me, pe, be, "h", "ℎ"), + ce(ue, pe, be, "h", "ℎ"); + for (var He = "", Oe = 0; Oe < 52; Oe++) { + var Ee = qe.charAt(Oe); + ce(me, pe, be, Ee, (He = String.fromCharCode(55349, 56320 + Oe))), + ce(ue, pe, ze, Ee, He), + ce(me, pe, be, Ee, (He = String.fromCharCode(55349, 56372 + Oe))), + ce(ue, pe, ze, Ee, He), + ce(me, pe, be, Ee, (He = String.fromCharCode(55349, 56424 + Oe))), + ce(ue, pe, ze, Ee, He), + ce(me, pe, be, Ee, (He = String.fromCharCode(55349, 56580 + Oe))), + ce(ue, pe, ze, Ee, He), + ce(me, pe, be, Ee, (He = String.fromCharCode(55349, 56736 + Oe))), + ce(ue, pe, ze, Ee, He), + ce(me, pe, be, Ee, (He = String.fromCharCode(55349, 56788 + Oe))), + ce(ue, pe, ze, Ee, He), + ce(me, pe, be, Ee, (He = String.fromCharCode(55349, 56840 + Oe))), + ce(ue, pe, ze, Ee, He), + ce(me, pe, be, Ee, (He = String.fromCharCode(55349, 56944 + Oe))), + ce(ue, pe, ze, Ee, He), + Oe < 26 && + (ce(me, pe, be, Ee, (He = String.fromCharCode(55349, 56632 + Oe))), + ce(ue, pe, ze, Ee, He), + ce(me, pe, be, Ee, (He = String.fromCharCode(55349, 56476 + Oe))), + ce(ue, pe, ze, Ee, He)); + } + ce(me, pe, be, "k", (He = String.fromCharCode(55349, 56668))), ce(ue, pe, ze, "k", He); + for (var Le = 0; Le < 10; Le++) { + var De = Le.toString(); + ce(me, pe, be, De, (He = String.fromCharCode(55349, 57294 + Le))), + ce(ue, pe, ze, De, He), + ce(me, pe, be, De, (He = String.fromCharCode(55349, 57314 + Le))), + ce(ue, pe, ze, De, He), + ce(me, pe, be, De, (He = String.fromCharCode(55349, 57324 + Le))), + ce(ue, pe, ze, De, He), + ce(me, pe, be, De, (He = String.fromCharCode(55349, 57334 + Le))), + ce(ue, pe, ze, De, He); + } + for (var Pe = 0; Pe < 3; Pe++) { + var Ve = "ÐÞþ".charAt(Pe); + ce(me, pe, be, Ve, Ve), ce(ue, pe, ze, Ve, Ve); + } + var Fe = [ + ["mathbf", "textbf", "Main-Bold"], + ["mathbf", "textbf", "Main-Bold"], + ["mathnormal", "textit", "Math-Italic"], + ["mathnormal", "textit", "Math-Italic"], + ["boldsymbol", "boldsymbol", "Main-BoldItalic"], + ["boldsymbol", "boldsymbol", "Main-BoldItalic"], + ["mathscr", "textscr", "Script-Regular"], + ["", "", ""], + ["", "", ""], + ["", "", ""], + ["mathfrak", "textfrak", "Fraktur-Regular"], + ["mathfrak", "textfrak", "Fraktur-Regular"], + ["mathbb", "textbb", "AMS-Regular"], + ["mathbb", "textbb", "AMS-Regular"], + ["", "", ""], + ["", "", ""], + ["mathsf", "textsf", "SansSerif-Regular"], + ["mathsf", "textsf", "SansSerif-Regular"], + ["mathboldsf", "textboldsf", "SansSerif-Bold"], + ["mathboldsf", "textboldsf", "SansSerif-Bold"], + ["mathitsf", "textitsf", "SansSerif-Italic"], + ["mathitsf", "textitsf", "SansSerif-Italic"], + ["", "", ""], + ["", "", ""], + ["mathtt", "texttt", "Typewriter-Regular"], + ["mathtt", "texttt", "Typewriter-Regular"], + ], + Ge = [ + ["mathbf", "textbf", "Main-Bold"], + ["", "", ""], + ["mathsf", "textsf", "SansSerif-Regular"], + ["mathboldsf", "textboldsf", "SansSerif-Bold"], + ["mathtt", "texttt", "Typewriter-Regular"], + ], + Ue = function (e, t, r) { + return he[r][e] && he[r][e].replace && (e = he[r][e].replace), { value: e, metrics: O(e, t, r) }; + }, + Ye = function (e, t, r, n, a) { + var i, + o = Ue(e, t, r), + s = o.metrics; + if (((e = o.value), s)) { + var l = s.italic; + ("text" === r || (n && "mathit" === n.font)) && (l = 0), (i = new te(e, s.height, s.depth, l, s.skew, s.width, a)); + } else + "undefined" != typeof console && console.warn("No character metrics for '" + e + "' in style '" + t + "' and mode '" + r + "'"), + (i = new te(e, 0, 0, 0, 0, 0, a)); + if (n) { + (i.maxFontSize = n.sizeMultiplier), n.style.isTight() && i.classes.push("mtight"); + var h = n.getColor(); + h && (i.style.color = h); + } + return i; + }, + Xe = function (e, t) { + if (_(e.classes) !== _(t.classes) || e.skew !== t.skew || e.maxFontSize !== t.maxFontSize) return !1; + if (1 === e.classes.length) { + var r = e.classes[0]; + if ("mbin" === r || "mord" === r) return !1; + } + for (var n in e.style) if (e.style.hasOwnProperty(n) && e.style[n] !== t.style[n]) return !1; + for (var a in t.style) if (t.style.hasOwnProperty(a) && e.style[a] !== t.style[a]) return !1; + return !0; + }, + We = function (e) { + for (var t = 0, r = 0, n = 0, a = 0; a < e.children.length; a++) { + var i = e.children[a]; + i.height > t && (t = i.height), i.depth > r && (r = i.depth), i.maxFontSize > n && (n = i.maxFontSize); + } + (e.height = t), (e.depth = r), (e.maxFontSize = n); + }, + _e = function (e, t, r, n) { + var a = new K(e, t, r, n); + return We(a), a; + }, + je = function (e, t, r, n) { + return new K(e, t, r, n); + }, + $e = function (e) { + var t = new q(e); + return We(t), t; + }, + Ze = function (e, t, r) { + var n = ""; + switch (e) { + case "amsrm": + n = "AMS"; + break; + case "textrm": + n = "Main"; + break; + case "textsf": + n = "SansSerif"; + break; + case "texttt": + n = "Typewriter"; + break; + default: + n = e; + } + return n + "-" + ("textbf" === t && "textit" === r ? "BoldItalic" : "textbf" === t ? "Bold" : "textit" === t ? "Italic" : "Regular"); + }, + Ke = { + mathbf: { variant: "bold", fontName: "Main-Bold" }, + mathrm: { variant: "normal", fontName: "Main-Regular" }, + textit: { variant: "italic", fontName: "Main-Italic" }, + mathit: { variant: "italic", fontName: "Main-Italic" }, + mathnormal: { variant: "italic", fontName: "Math-Italic" }, + mathbb: { variant: "double-struck", fontName: "AMS-Regular" }, + mathcal: { variant: "script", fontName: "Caligraphic-Regular" }, + mathfrak: { variant: "fraktur", fontName: "Fraktur-Regular" }, + mathscr: { variant: "script", fontName: "Script-Regular" }, + mathsf: { variant: "sans-serif", fontName: "SansSerif-Regular" }, + mathtt: { variant: "monospace", fontName: "Typewriter-Regular" }, + }, + Je = { + vec: ["vec", 0.471, 0.714], + oiintSize1: ["oiintSize1", 0.957, 0.499], + oiintSize2: ["oiintSize2", 1.472, 0.659], + oiiintSize1: ["oiiintSize1", 1.304, 0.499], + oiiintSize2: ["oiiintSize2", 1.98, 0.659], + }, + Qe = { + fontMap: Ke, + makeSymbol: Ye, + mathsym: function (e, t, r, n) { + return ( + void 0 === n && (n = []), + "boldsymbol" === r.font && Ue(e, "Main-Bold", t).metrics + ? Ye(e, "Main-Bold", t, r, n.concat(["mathbf"])) + : "\\" === e || "main" === he[t][e].font + ? Ye(e, "Main-Regular", t, r, n) + : Ye(e, "AMS-Regular", t, r, n.concat(["amsrm"])) + ); + }, + makeSpan: _e, + makeSvgSpan: je, + makeLineSpan: function (e, t, r) { + var n = _e([e], [], t); + return ( + (n.height = Math.max(r || t.fontMetrics().defaultRuleThickness, t.minRuleThickness)), + (n.style.borderBottomWidth = W(n.height)), + (n.maxFontSize = 1), + n + ); + }, + makeAnchor: function (e, t, r, n) { + var a = new J(e, t, r, n); + return We(a), a; + }, + makeFragment: $e, + wrapFragment: function (e, t) { + return e instanceof q ? _e([], [e], t) : e; + }, + makeVList: function (e, t) { + for ( + var r = (function (e) { + if ("individualShift" === e.positionType) { + for (var t = e.children, r = [t[0]], n = -t[0].shift - t[0].elem.depth, a = n, i = 1; i < t.length; i++) { + var o = -t[i].shift - a - t[i].elem.depth, + s = o - (t[i - 1].elem.height + t[i - 1].elem.depth); + (a += o), r.push({ type: "kern", size: s }), r.push(t[i]); + } + return { children: r, depth: n }; + } + var l; + if ("top" === e.positionType) { + for (var h = e.positionData, c = 0; c < e.children.length; c++) { + var m = e.children[c]; + h -= "kern" === m.type ? m.size : m.elem.height + m.elem.depth; + } + l = h; + } else if ("bottom" === e.positionType) l = -e.positionData; + else { + var u = e.children[0]; + if ("elem" !== u.type) throw new Error('First child must have type "elem".'); + if ("shift" === e.positionType) l = -u.elem.depth - e.positionData; + else { + if ("firstBaseline" !== e.positionType) throw new Error("Invalid positionType " + e.positionType + "."); + l = -u.elem.depth; + } + } + return { children: e.children, depth: l }; + })(e), + n = r.children, + a = r.depth, + i = 0, + o = 0; + o < n.length; + o++ + ) { + var s = n[o]; + if ("elem" === s.type) { + var l = s.elem; + i = Math.max(i, l.maxFontSize, l.height); + } + } + i += 2; + var h = _e(["pstrut"], []); + h.style.height = W(i); + for (var c = [], m = a, u = a, p = a, d = 0; d < n.length; d++) { + var f = n[d]; + if ("kern" === f.type) p += f.size; + else { + var g = f.elem, + v = f.wrapperClasses || [], + y = f.wrapperStyle || {}, + b = _e(v, [h, g], void 0, y); + (b.style.top = W(-i - p - g.depth)), + f.marginLeft && (b.style.marginLeft = f.marginLeft), + f.marginRight && (b.style.marginRight = f.marginRight), + c.push(b), + (p += g.height + g.depth); + } + (m = Math.min(m, p)), (u = Math.max(u, p)); + } + var x, + w = _e(["vlist"], c); + if (((w.style.height = W(u)), m < 0)) { + var k = _e([], []), + S = _e(["vlist"], [k]); + S.style.height = W(-m); + var M = _e(["vlist-s"], [new te("​")]); + x = [_e(["vlist-r"], [w, M]), _e(["vlist-r"], [S])]; + } else x = [_e(["vlist-r"], [w])]; + var z = _e(["vlist-t"], x); + return 2 === x.length && z.classes.push("vlist-t2"), (z.height = u), (z.depth = -m), z; + }, + makeOrd: function (e, t, r) { + var a = e.mode, + i = e.text, + o = ["mord"], + s = "math" === a || ("text" === a && t.font), + l = s ? t.font : t.fontFamily; + if (55349 === i.charCodeAt(0)) { + var h = (function (e, t) { + var r = 1024 * (e.charCodeAt(0) - 55296) + (e.charCodeAt(1) - 56320) + 65536, + a = "math" === t ? 0 : 1; + if (119808 <= r && r < 120484) { + var i = Math.floor((r - 119808) / 26); + return [Fe[i][2], Fe[i][a]]; + } + if (120782 <= r && r <= 120831) { + var o = Math.floor((r - 120782) / 10); + return [Ge[o][2], Ge[o][a]]; + } + if (120485 === r || 120486 === r) return [Fe[0][2], Fe[0][a]]; + if (120486 < r && r < 120782) return ["", ""]; + throw new n("Unsupported character: " + e); + })(i, a), + c = h[0], + m = h[1]; + return Ye(i, c, a, t, o.concat(m)); + } + if (l) { + var u, p; + if ("boldsymbol" === l) { + var d = (function (e, t, r, n, a) { + return "textord" !== a && Ue(e, "Math-BoldItalic", t).metrics + ? { fontName: "Math-BoldItalic", fontClass: "boldsymbol" } + : { fontName: "Main-Bold", fontClass: "mathbf" }; + })(i, a, 0, 0, r); + (u = d.fontName), (p = [d.fontClass]); + } else s ? ((u = Ke[l].fontName), (p = [l])) : ((u = Ze(l, t.fontWeight, t.fontShape)), (p = [l, t.fontWeight, t.fontShape])); + if (Ue(i, u, a).metrics) return Ye(i, u, a, t, o.concat(p)); + if (Ae.hasOwnProperty(i) && "Typewriter" === u.slice(0, 10)) { + for (var f = [], g = 0; g < i.length; g++) f.push(Ye(i[g], u, a, t, o.concat(p))); + return $e(f); + } + } + if ("mathord" === r) return Ye(i, "Math-Italic", a, t, o.concat(["mathnormal"])); + if ("textord" === r) { + var v = he[a][i] && he[a][i].font; + if ("ams" === v) { + var y = Ze("amsrm", t.fontWeight, t.fontShape); + return Ye(i, y, a, t, o.concat("amsrm", t.fontWeight, t.fontShape)); + } + if ("main" !== v && v) { + var b = Ze(v, t.fontWeight, t.fontShape); + return Ye(i, b, a, t, o.concat(b, t.fontWeight, t.fontShape)); + } + var x = Ze("textrm", t.fontWeight, t.fontShape); + return Ye(i, x, a, t, o.concat(t.fontWeight, t.fontShape)); + } + throw new Error("unexpected type: " + r + " in makeOrd"); + }, + makeGlue: function (e, t) { + var r = _e(["mspace"], [], t), + n = X(e, t); + return (r.style.marginRight = W(n)), r; + }, + staticSvg: function (e, t) { + var r = Je[e], + n = r[0], + a = r[1], + i = r[2], + o = new ne(n), + s = new re([o], { + width: W(a), + height: W(i), + style: "width:" + W(a), + viewBox: "0 0 " + 1e3 * a + " " + 1e3 * i, + preserveAspectRatio: "xMinYMin", + }), + l = je(["overlay"], [s], t); + return (l.height = i), (l.style.height = W(i)), (l.style.width = W(a)), l; + }, + svgData: Je, + tryCombineChars: function (e) { + for (var t = 0; t < e.length - 1; t++) { + var r = e[t], + n = e[t + 1]; + r instanceof te && + n instanceof te && + Xe(r, n) && + ((r.text += n.text), + (r.height = Math.max(r.height, n.height)), + (r.depth = Math.max(r.depth, n.depth)), + (r.italic = n.italic), + e.splice(t + 1, 1), + t--); + } + return e; + }, + }, + et = { number: 3, unit: "mu" }, + tt = { number: 4, unit: "mu" }, + rt = { number: 5, unit: "mu" }, + nt = { + mord: { mop: et, mbin: tt, mrel: rt, minner: et }, + mop: { mord: et, mop: et, mrel: rt, minner: et }, + mbin: { mord: tt, mop: tt, mopen: tt, minner: tt }, + mrel: { mord: rt, mop: rt, mopen: rt, minner: rt }, + mopen: {}, + mclose: { mop: et, mbin: tt, mrel: rt, minner: et }, + mpunct: { + mord: et, + mop: et, + mrel: rt, + mopen: et, + mclose: et, + mpunct: et, + minner: et, + }, + minner: { + mord: et, + mop: et, + mbin: tt, + mrel: rt, + mopen: et, + mpunct: et, + minner: et, + }, + }, + at = { + mord: { mop: et }, + mop: { mord: et, mop: et }, + mbin: {}, + mrel: {}, + mopen: {}, + mclose: { mop: et }, + mpunct: {}, + minner: { mop: et }, + }, + it = {}, + ot = {}, + st = {}; + function lt(e) { + for ( + var t = e.type, + r = e.names, + n = e.props, + a = e.handler, + i = e.htmlBuilder, + o = e.mathmlBuilder, + s = { + type: t, + numArgs: n.numArgs, + argTypes: n.argTypes, + allowedInArgument: !!n.allowedInArgument, + allowedInText: !!n.allowedInText, + allowedInMath: void 0 === n.allowedInMath || n.allowedInMath, + numOptionalArgs: n.numOptionalArgs || 0, + infix: !!n.infix, + primitive: !!n.primitive, + handler: a, + }, + l = 0; + l < r.length; + ++l + ) + it[r[l]] = s; + t && (i && (ot[t] = i), o && (st[t] = o)); + } + function ht(e) { + lt({ + type: e.type, + names: [], + props: { numArgs: 0 }, + handler: function () { + throw new Error("Should never be called."); + }, + htmlBuilder: e.htmlBuilder, + mathmlBuilder: e.mathmlBuilder, + }); + } + var ct = function (e) { + return "ordgroup" === e.type && 1 === e.body.length ? e.body[0] : e; + }, + mt = function (e) { + return "ordgroup" === e.type ? e.body : [e]; + }, + ut = Qe.makeSpan, + pt = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"], + dt = ["rightmost", "mrel", "mclose", "mpunct"], + ft = { + display: A.DISPLAY, + text: A.TEXT, + script: A.SCRIPT, + scriptscript: A.SCRIPTSCRIPT, + }, + gt = { + mord: "mord", + mop: "mop", + mbin: "mbin", + mrel: "mrel", + mopen: "mopen", + mclose: "mclose", + mpunct: "mpunct", + minner: "minner", + }, + vt = function (e, t, r, n) { + void 0 === n && (n = [null, null]); + for (var a = [], i = 0; i < e.length; i++) { + var o = St(e[i], t); + if (o instanceof q) { + var s = o.children; + a.push.apply(a, s); + } else a.push(o); + } + if ((Qe.tryCombineChars(a), !r)) return a; + var h = t; + if (1 === e.length) { + var c = e[0]; + "sizing" === c.type ? (h = t.havingSize(c.size)) : "styling" === c.type && (h = t.havingStyle(ft[c.style])); + } + var m = ut([n[0] || "leftmost"], [], t), + u = ut([n[1] || "rightmost"], [], t), + p = "root" === r; + return ( + yt( + a, + function (e, t) { + var r = t.classes[0], + n = e.classes[0]; + "mbin" === r && l(dt, n) ? (t.classes[0] = "mord") : "mbin" === n && l(pt, r) && (e.classes[0] = "mord"); + }, + { node: m }, + u, + p, + ), + yt( + a, + function (e, t) { + var r = wt(t), + n = wt(e), + a = r && n ? (e.hasClass("mtight") ? at[r][n] : nt[r][n]) : null; + if (a) return Qe.makeGlue(a, h); + }, + { node: m }, + u, + p, + ), + a + ); + }, + yt = function e(t, r, n, a, i) { + a && t.push(a); + for (var o = 0; o < t.length; o++) { + var s = t[o], + l = bt(s); + if (l) e(l.children, r, n, null, i); + else { + var h = !s.hasClass("mspace"); + if (h) { + var c = r(s, n.node); + c && (n.insertAfter ? n.insertAfter(c) : (t.unshift(c), o++)); + } + h ? (n.node = s) : i && s.hasClass("newline") && (n.node = ut(["leftmost"])), + (n.insertAfter = (function (e) { + return function (r) { + t.splice(e + 1, 0, r), o++; + }; + })(o)); + } + } + a && t.pop(); + }, + bt = function (e) { + return e instanceof q || e instanceof J || (e instanceof K && e.hasClass("enclosing")) ? e : null; + }, + xt = function e(t, r) { + var n = bt(t); + if (n) { + var a = n.children; + if (a.length) { + if ("right" === r) return e(a[a.length - 1], "right"); + if ("left" === r) return e(a[0], "left"); + } + } + return t; + }, + wt = function (e, t) { + return e ? (t && (e = xt(e, t)), gt[e.classes[0]] || null) : null; + }, + kt = function (e, t) { + var r = ["nulldelimiter"].concat(e.baseSizingClasses()); + return ut(t.concat(r)); + }, + St = function (e, t, r) { + if (!e) return ut(); + if (ot[e.type]) { + var a = ot[e.type](e, t); + if (r && t.size !== r.size) { + a = ut(t.sizingClasses(r), [a], t); + var i = t.sizeMultiplier / r.sizeMultiplier; + (a.height *= i), (a.depth *= i); + } + return a; + } + throw new n("Got group of unknown type: '" + e.type + "'"); + }; + function Mt(e, t) { + var r = ut(["base"], e, t), + n = ut(["strut"]); + return (n.style.height = W(r.height + r.depth)), r.depth && (n.style.verticalAlign = W(-r.depth)), r.children.unshift(n), r; + } + function zt(e, t) { + var r = null; + 1 === e.length && "tag" === e[0].type && ((r = e[0].tag), (e = e[0].body)); + var n, + a = vt(e, t, "root"); + 2 === a.length && a[1].hasClass("tag") && (n = a.pop()); + for (var i, o = [], s = [], l = 0; l < a.length; l++) + if ((s.push(a[l]), a[l].hasClass("mbin") || a[l].hasClass("mrel") || a[l].hasClass("allowbreak"))) { + for (var h = !1; l < a.length - 1 && a[l + 1].hasClass("mspace") && !a[l + 1].hasClass("newline"); ) + l++, s.push(a[l]), a[l].hasClass("nobreak") && (h = !0); + h || (o.push(Mt(s, t)), (s = [])); + } else a[l].hasClass("newline") && (s.pop(), s.length > 0 && (o.push(Mt(s, t)), (s = [])), o.push(a[l])); + s.length > 0 && o.push(Mt(s, t)), r ? (((i = Mt(vt(r, t, !0))).classes = ["tag"]), o.push(i)) : n && o.push(n); + var c = ut(["katex-html"], o); + if ((c.setAttribute("aria-hidden", "true"), i)) { + var m = i.children[0]; + (m.style.height = W(c.height + c.depth)), c.depth && (m.style.verticalAlign = W(-c.depth)); + } + return c; + } + function At(e) { + return new q(e); + } + var Tt = (function () { + function e(e, t, r) { + (this.type = void 0), + (this.attributes = void 0), + (this.children = void 0), + (this.classes = void 0), + (this.type = e), + (this.attributes = {}), + (this.children = t || []), + (this.classes = r || []); + } + var t = e.prototype; + return ( + (t.setAttribute = function (e, t) { + this.attributes[e] = t; + }), + (t.getAttribute = function (e) { + return this.attributes[e]; + }), + (t.toNode = function () { + var e = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type); + for (var t in this.attributes) Object.prototype.hasOwnProperty.call(this.attributes, t) && e.setAttribute(t, this.attributes[t]); + this.classes.length > 0 && (e.className = _(this.classes)); + for (var r = 0; r < this.children.length; r++) e.appendChild(this.children[r].toNode()); + return e; + }), + (t.toMarkup = function () { + var e = "<" + this.type; + for (var t in this.attributes) + Object.prototype.hasOwnProperty.call(this.attributes, t) && ((e += " " + t + '="'), (e += c(this.attributes[t])), (e += '"')); + this.classes.length > 0 && (e += ' class ="' + c(_(this.classes)) + '"'), (e += ">"); + for (var r = 0; r < this.children.length; r++) e += this.children[r].toMarkup(); + return e + ""; + }), + (t.toText = function () { + return this.children + .map(function (e) { + return e.toText(); + }) + .join(""); + }), + e + ); + })(), + Bt = (function () { + function e(e) { + (this.text = void 0), (this.text = e); + } + var t = e.prototype; + return ( + (t.toNode = function () { + return document.createTextNode(this.text); + }), + (t.toMarkup = function () { + return c(this.toText()); + }), + (t.toText = function () { + return this.text; + }), + e + ); + })(), + Nt = { + MathNode: Tt, + TextNode: Bt, + SpaceNode: (function () { + function e(e) { + (this.width = void 0), + (this.character = void 0), + (this.width = e), + (this.character = + e >= 0.05555 && e <= 0.05556 + ? " " + : e >= 0.1666 && e <= 0.1667 + ? " " + : e >= 0.2222 && e <= 0.2223 + ? " " + : e >= 0.2777 && e <= 0.2778 + ? "  " + : e >= -0.05556 && e <= -0.05555 + ? " ⁣" + : e >= -0.1667 && e <= -0.1666 + ? " ⁣" + : e >= -0.2223 && e <= -0.2222 + ? " ⁣" + : e >= -0.2778 && e <= -0.2777 + ? " ⁣" + : null); + } + var t = e.prototype; + return ( + (t.toNode = function () { + if (this.character) return document.createTextNode(this.character); + var e = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mspace"); + return e.setAttribute("width", W(this.width)), e; + }), + (t.toMarkup = function () { + return this.character ? "" + this.character + "" : ''; + }), + (t.toText = function () { + return this.character ? this.character : " "; + }), + e + ); + })(), + newDocumentFragment: At, + }, + Ct = function (e, t, r) { + return ( + !he[t][e] || + !he[t][e].replace || + 55349 === e.charCodeAt(0) || + (Ae.hasOwnProperty(e) && r && ((r.fontFamily && "tt" === r.fontFamily.slice(4, 6)) || (r.font && "tt" === r.font.slice(4, 6)))) || + (e = he[t][e].replace), + new Nt.TextNode(e) + ); + }, + qt = function (e) { + return 1 === e.length ? e[0] : new Nt.MathNode("mrow", e); + }, + It = function (e, t) { + if ("texttt" === t.fontFamily) return "monospace"; + if ("textsf" === t.fontFamily) + return "textit" === t.fontShape && "textbf" === t.fontWeight + ? "sans-serif-bold-italic" + : "textit" === t.fontShape + ? "sans-serif-italic" + : "textbf" === t.fontWeight + ? "bold-sans-serif" + : "sans-serif"; + if ("textit" === t.fontShape && "textbf" === t.fontWeight) return "bold-italic"; + if ("textit" === t.fontShape) return "italic"; + if ("textbf" === t.fontWeight) return "bold"; + var r = t.font; + if (!r || "mathnormal" === r) return null; + var n = e.mode; + if ("mathit" === r) return "italic"; + if ("boldsymbol" === r) return "textord" === e.type ? "bold" : "bold-italic"; + if ("mathbf" === r) return "bold"; + if ("mathbb" === r) return "double-struck"; + if ("mathfrak" === r) return "fraktur"; + if ("mathscr" === r || "mathcal" === r) return "script"; + if ("mathsf" === r) return "sans-serif"; + if ("mathtt" === r) return "monospace"; + var a = e.text; + return l(["\\imath", "\\jmath"], a) + ? null + : (he[n][a] && he[n][a].replace && (a = he[n][a].replace), O(a, Qe.fontMap[r].fontName, n) ? Qe.fontMap[r].variant : null); + }, + Rt = function (e, t, r) { + if (1 === e.length) { + var n = Ot(e[0], t); + return r && n instanceof Tt && "mo" === n.type && (n.setAttribute("lspace", "0em"), n.setAttribute("rspace", "0em")), [n]; + } + for (var a, i = [], o = 0; o < e.length; o++) { + var s = Ot(e[o], t); + if (s instanceof Tt && a instanceof Tt) { + if ("mtext" === s.type && "mtext" === a.type && s.getAttribute("mathvariant") === a.getAttribute("mathvariant")) { + var l; + (l = a.children).push.apply(l, s.children); + continue; + } + if ("mn" === s.type && "mn" === a.type) { + var h; + (h = a.children).push.apply(h, s.children); + continue; + } + if ("mi" === s.type && 1 === s.children.length && "mn" === a.type) { + var c = s.children[0]; + if (c instanceof Bt && "." === c.text) { + var m; + (m = a.children).push.apply(m, s.children); + continue; + } + } else if ("mi" === a.type && 1 === a.children.length) { + var u = a.children[0]; + if (u instanceof Bt && "̸" === u.text && ("mo" === s.type || "mi" === s.type || "mn" === s.type)) { + var p = s.children[0]; + p instanceof Bt && p.text.length > 0 && ((p.text = p.text.slice(0, 1) + "̸" + p.text.slice(1)), i.pop()); + } + } + } + i.push(s), (a = s); + } + return i; + }, + Ht = function (e, t, r) { + return qt(Rt(e, t, r)); + }, + Ot = function (e, t) { + if (!e) return new Nt.MathNode("mrow"); + if (st[e.type]) return st[e.type](e, t); + throw new n("Got group of unknown type: '" + e.type + "'"); + }; + function Et(e, t, r, n, a) { + var i, + o = Rt(e, r); + i = 1 === o.length && o[0] instanceof Tt && l(["mrow", "mtable"], o[0].type) ? o[0] : new Nt.MathNode("mrow", o); + var s = new Nt.MathNode("annotation", [new Nt.TextNode(t)]); + s.setAttribute("encoding", "application/x-tex"); + var h = new Nt.MathNode("semantics", [i, s]), + c = new Nt.MathNode("math", [h]); + return ( + c.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML"), + n && c.setAttribute("display", "block"), + Qe.makeSpan([a ? "katex" : "katex-mathml"], [c]) + ); + } + var Lt = function (e) { + return new F({ + style: e.displayMode ? A.DISPLAY : A.TEXT, + maxSize: e.maxSize, + minRuleThickness: e.minRuleThickness, + }); + }, + Dt = function (e, t) { + if (t.displayMode) { + var r = ["katex-display"]; + t.leqno && r.push("leqno"), t.fleqn && r.push("fleqn"), (e = Qe.makeSpan(r, [e])); + } + return e; + }, + Pt = { + widehat: "^", + widecheck: "ˇ", + widetilde: "~", + utilde: "~", + overleftarrow: "←", + underleftarrow: "←", + xleftarrow: "←", + overrightarrow: "→", + underrightarrow: "→", + xrightarrow: "→", + underbrace: "⏟", + overbrace: "⏞", + overgroup: "⏠", + undergroup: "⏡", + overleftrightarrow: "↔", + underleftrightarrow: "↔", + xleftrightarrow: "↔", + Overrightarrow: "⇒", + xRightarrow: "⇒", + overleftharpoon: "↼", + xleftharpoonup: "↼", + overrightharpoon: "⇀", + xrightharpoonup: "⇀", + xLeftarrow: "⇐", + xLeftrightarrow: "⇔", + xhookleftarrow: "↩", + xhookrightarrow: "↪", + xmapsto: "↦", + xrightharpoondown: "⇁", + xleftharpoondown: "↽", + xrightleftharpoons: "⇌", + xleftrightharpoons: "⇋", + xtwoheadleftarrow: "↞", + xtwoheadrightarrow: "↠", + xlongequal: "=", + xtofrom: "⇄", + xrightleftarrows: "⇄", + xrightequilibrium: "⇌", + xleftequilibrium: "⇋", + "\\cdrightarrow": "→", + "\\cdleftarrow": "←", + "\\cdlongequal": "=", + }, + Vt = { + overrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"], + overleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"], + underrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"], + underleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"], + xrightarrow: [["rightarrow"], 1.469, 522, "xMaxYMin"], + "\\cdrightarrow": [["rightarrow"], 3, 522, "xMaxYMin"], + xleftarrow: [["leftarrow"], 1.469, 522, "xMinYMin"], + "\\cdleftarrow": [["leftarrow"], 3, 522, "xMinYMin"], + Overrightarrow: [["doublerightarrow"], 0.888, 560, "xMaxYMin"], + xRightarrow: [["doublerightarrow"], 1.526, 560, "xMaxYMin"], + xLeftarrow: [["doubleleftarrow"], 1.526, 560, "xMinYMin"], + overleftharpoon: [["leftharpoon"], 0.888, 522, "xMinYMin"], + xleftharpoonup: [["leftharpoon"], 0.888, 522, "xMinYMin"], + xleftharpoondown: [["leftharpoondown"], 0.888, 522, "xMinYMin"], + overrightharpoon: [["rightharpoon"], 0.888, 522, "xMaxYMin"], + xrightharpoonup: [["rightharpoon"], 0.888, 522, "xMaxYMin"], + xrightharpoondown: [["rightharpoondown"], 0.888, 522, "xMaxYMin"], + xlongequal: [["longequal"], 0.888, 334, "xMinYMin"], + "\\cdlongequal": [["longequal"], 3, 334, "xMinYMin"], + xtwoheadleftarrow: [["twoheadleftarrow"], 0.888, 334, "xMinYMin"], + xtwoheadrightarrow: [["twoheadrightarrow"], 0.888, 334, "xMaxYMin"], + overleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522], + overbrace: [["leftbrace", "midbrace", "rightbrace"], 1.6, 548], + underbrace: [["leftbraceunder", "midbraceunder", "rightbraceunder"], 1.6, 548], + underleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522], + xleftrightarrow: [["leftarrow", "rightarrow"], 1.75, 522], + xLeftrightarrow: [["doubleleftarrow", "doublerightarrow"], 1.75, 560], + xrightleftharpoons: [["leftharpoondownplus", "rightharpoonplus"], 1.75, 716], + xleftrightharpoons: [["leftharpoonplus", "rightharpoondownplus"], 1.75, 716], + xhookleftarrow: [["leftarrow", "righthook"], 1.08, 522], + xhookrightarrow: [["lefthook", "rightarrow"], 1.08, 522], + overlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522], + underlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522], + overgroup: [["leftgroup", "rightgroup"], 0.888, 342], + undergroup: [["leftgroupunder", "rightgroupunder"], 0.888, 342], + xmapsto: [["leftmapsto", "rightarrow"], 1.5, 522], + xtofrom: [["leftToFrom", "rightToFrom"], 1.75, 528], + xrightleftarrows: [["baraboveleftarrow", "rightarrowabovebar"], 1.75, 901], + xrightequilibrium: [["baraboveshortleftharpoon", "rightharpoonaboveshortbar"], 1.75, 716], + xleftequilibrium: [["shortbaraboveleftharpoon", "shortrightharpoonabovebar"], 1.75, 716], + }, + Ft = function (e) { + var t = new Nt.MathNode("mo", [new Nt.TextNode(Pt[e.replace(/^\\/, "")])]); + return t.setAttribute("stretchy", "true"), t; + }, + Gt = function (e, t) { + var r = (function () { + var r = 4e5, + n = e.label.slice(1); + if (l(["widehat", "widecheck", "widetilde", "utilde"], n)) { + var a, + i, + o, + s = "ordgroup" === (d = e.base).type ? d.body.length : 1; + if (s > 5) + "widehat" === n || "widecheck" === n + ? ((a = 420), (r = 2364), (o = 0.42), (i = n + "4")) + : ((a = 312), (r = 2340), (o = 0.34), (i = "tilde4")); + else { + var h = [1, 1, 2, 2, 3, 3][s]; + "widehat" === n || "widecheck" === n + ? ((r = [0, 1062, 2364, 2364, 2364][h]), + (a = [0, 239, 300, 360, 420][h]), + (o = [0, 0.24, 0.3, 0.3, 0.36, 0.42][h]), + (i = n + h)) + : ((r = [0, 600, 1033, 2339, 2340][h]), + (a = [0, 260, 286, 306, 312][h]), + (o = [0, 0.26, 0.286, 0.3, 0.306, 0.34][h]), + (i = "tilde" + h)); + } + var c = new ne(i), + m = new re([c], { + width: "100%", + height: W(o), + viewBox: "0 0 " + r + " " + a, + preserveAspectRatio: "none", + }); + return { span: Qe.makeSvgSpan([], [m], t), minWidth: 0, height: o }; + } + var u, + p, + d, + f = [], + g = Vt[n], + v = g[0], + y = g[1], + b = g[2], + x = b / 1e3, + w = v.length; + if (1 === w) (u = ["hide-tail"]), (p = [g[3]]); + else if (2 === w) (u = ["halfarrow-left", "halfarrow-right"]), (p = ["xMinYMin", "xMaxYMin"]); + else { + if (3 !== w) throw new Error("Correct katexImagesData or update code here to support\n " + w + " children."); + (u = ["brace-left", "brace-center", "brace-right"]), (p = ["xMinYMin", "xMidYMin", "xMaxYMin"]); + } + for (var k = 0; k < w; k++) { + var S = new ne(v[k]), + M = new re([S], { + width: "400em", + height: W(x), + viewBox: "0 0 " + r + " " + b, + preserveAspectRatio: p[k] + " slice", + }), + z = Qe.makeSvgSpan([u[k]], [M], t); + if (1 === w) return { span: z, minWidth: y, height: x }; + (z.style.height = W(x)), f.push(z); + } + return { span: Qe.makeSpan(["stretchy"], f, t), minWidth: y, height: x }; + })(), + n = r.span, + a = r.minWidth, + i = r.height; + return (n.height = i), (n.style.height = W(i)), a > 0 && (n.style.minWidth = W(a)), n; + }; + function Ut(e, t) { + if (!e || e.type !== t) throw new Error("Expected node of type " + t + ", but got " + (e ? "node of type " + e.type : String(e))); + return e; + } + function Yt(e) { + var t = Xt(e); + if (!t) throw new Error("Expected node of symbol group type, but got " + (e ? "node of type " + e.type : String(e))); + return t; + } + function Xt(e) { + return e && ("atom" === e.type || se.hasOwnProperty(e.type)) ? e : null; + } + var Wt = function (e, t) { + var r, n, a; + e && "supsub" === e.type + ? ((r = (n = Ut(e.base, "accent")).base), + (e.base = r), + (a = (function (e) { + if (e instanceof K) return e; + throw new Error("Expected span but got " + String(e) + "."); + })(St(e, t))), + (e.base = n)) + : (r = (n = Ut(e, "accent")).base); + var i = St(r, t.havingCrampedStyle()), + o = 0; + if (n.isShifty && p(r)) { + var s = u(r); + o = ie(St(s, t.havingCrampedStyle())).skew; + } + var l, + h = "\\c" === n.label, + c = h ? i.height + i.depth : Math.min(i.height, t.fontMetrics().xHeight); + if (n.isStretchy) + (l = Gt(n, t)), + (l = Qe.makeVList( + { + positionType: "firstBaseline", + children: [ + { type: "elem", elem: i }, + { + type: "elem", + elem: l, + wrapperClasses: ["svg-align"], + wrapperStyle: o > 0 ? { width: "calc(100% - " + W(2 * o) + ")", marginLeft: W(2 * o) } : void 0, + }, + ], + }, + t, + )); + else { + var m, d; + "\\vec" === n.label + ? ((m = Qe.staticSvg("vec", t)), (d = Qe.svgData.vec[1])) + : (((m = ie((m = Qe.makeOrd({ mode: n.mode, text: n.label }, t, "textord")))).italic = 0), (d = m.width), h && (c += m.depth)), + (l = Qe.makeSpan(["accent-body"], [m])); + var f = "\\textcircled" === n.label; + f && (l.classes.push("accent-full"), (c = i.height)); + var g = o; + f || (g -= d / 2), + (l.style.left = W(g)), + "\\textcircled" === n.label && (l.style.top = ".2em"), + (l = Qe.makeVList( + { + positionType: "firstBaseline", + children: [ + { type: "elem", elem: i }, + { type: "kern", size: -c }, + { type: "elem", elem: l }, + ], + }, + t, + )); + } + var v = Qe.makeSpan(["mord", "accent"], [l], t); + return a ? ((a.children[0] = v), (a.height = Math.max(v.height, a.height)), (a.classes[0] = "mord"), a) : v; + }, + _t = function (e, t) { + var r = e.isStretchy ? Ft(e.label) : new Nt.MathNode("mo", [Ct(e.label, e.mode)]), + n = new Nt.MathNode("mover", [Ot(e.base, t), r]); + return n.setAttribute("accent", "true"), n; + }, + jt = new RegExp( + ["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring"] + .map(function (e) { + return "\\" + e; + }) + .join("|"), + ); + lt({ + type: "accent", + names: [ + "\\acute", + "\\grave", + "\\ddot", + "\\tilde", + "\\bar", + "\\breve", + "\\check", + "\\hat", + "\\vec", + "\\dot", + "\\mathring", + "\\widecheck", + "\\widehat", + "\\widetilde", + "\\overrightarrow", + "\\overleftarrow", + "\\Overrightarrow", + "\\overleftrightarrow", + "\\overgroup", + "\\overlinesegment", + "\\overleftharpoon", + "\\overrightharpoon", + ], + props: { numArgs: 1 }, + handler: function (e, t) { + var r = ct(t[0]), + n = !jt.test(e.funcName), + a = !n || "\\widehat" === e.funcName || "\\widetilde" === e.funcName || "\\widecheck" === e.funcName; + return { + type: "accent", + mode: e.parser.mode, + label: e.funcName, + isStretchy: n, + isShifty: a, + base: r, + }; + }, + htmlBuilder: Wt, + mathmlBuilder: _t, + }), + lt({ + type: "accent", + names: ["\\'", "\\`", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"', "\\c", "\\r", "\\H", "\\v", "\\textcircled"], + props: { + numArgs: 1, + allowedInText: !0, + allowedInMath: !0, + argTypes: ["primitive"], + }, + handler: function (e, t) { + var r = t[0], + n = e.parser.mode; + return ( + "math" === n && + (e.parser.settings.reportNonstrict("mathVsTextAccents", "LaTeX's accent " + e.funcName + " works only in text mode"), + (n = "text")), + { + type: "accent", + mode: n, + label: e.funcName, + isStretchy: !1, + isShifty: !0, + base: r, + } + ); + }, + htmlBuilder: Wt, + mathmlBuilder: _t, + }), + lt({ + type: "accentUnder", + names: ["\\underleftarrow", "\\underrightarrow", "\\underleftrightarrow", "\\undergroup", "\\underlinesegment", "\\utilde"], + props: { numArgs: 1 }, + handler: function (e, t) { + var r = e.parser, + n = e.funcName, + a = t[0]; + return { type: "accentUnder", mode: r.mode, label: n, base: a }; + }, + htmlBuilder: function (e, t) { + var r = St(e.base, t), + n = Gt(e, t), + a = "\\utilde" === e.label ? 0.12 : 0, + i = Qe.makeVList( + { + positionType: "top", + positionData: r.height, + children: [ + { type: "elem", elem: n, wrapperClasses: ["svg-align"] }, + { type: "kern", size: a }, + { type: "elem", elem: r }, + ], + }, + t, + ); + return Qe.makeSpan(["mord", "accentunder"], [i], t); + }, + mathmlBuilder: function (e, t) { + var r = Ft(e.label), + n = new Nt.MathNode("munder", [Ot(e.base, t), r]); + return n.setAttribute("accentunder", "true"), n; + }, + }); + var $t = function (e) { + var t = new Nt.MathNode("mpadded", e ? [e] : []); + return t.setAttribute("width", "+0.6em"), t.setAttribute("lspace", "0.3em"), t; + }; + lt({ + type: "xArrow", + names: [ + "\\xleftarrow", + "\\xrightarrow", + "\\xLeftarrow", + "\\xRightarrow", + "\\xleftrightarrow", + "\\xLeftrightarrow", + "\\xhookleftarrow", + "\\xhookrightarrow", + "\\xmapsto", + "\\xrightharpoondown", + "\\xrightharpoonup", + "\\xleftharpoondown", + "\\xleftharpoonup", + "\\xrightleftharpoons", + "\\xleftrightharpoons", + "\\xlongequal", + "\\xtwoheadrightarrow", + "\\xtwoheadleftarrow", + "\\xtofrom", + "\\xrightleftarrows", + "\\xrightequilibrium", + "\\xleftequilibrium", + "\\\\cdrightarrow", + "\\\\cdleftarrow", + "\\\\cdlongequal", + ], + props: { numArgs: 1, numOptionalArgs: 1 }, + handler: function (e, t, r) { + var n = e.parser, + a = e.funcName; + return { type: "xArrow", mode: n.mode, label: a, body: t[0], below: r[0] }; + }, + htmlBuilder: function (e, t) { + var r, + n = t.style, + a = t.havingStyle(n.sup()), + i = Qe.wrapFragment(St(e.body, a, t), t), + o = "\\x" === e.label.slice(0, 2) ? "x" : "cd"; + i.classes.push(o + "-arrow-pad"), + e.below && ((a = t.havingStyle(n.sub())), (r = Qe.wrapFragment(St(e.below, a, t), t)).classes.push(o + "-arrow-pad")); + var s, + l = Gt(e, t), + h = -t.fontMetrics().axisHeight + 0.5 * l.height, + c = -t.fontMetrics().axisHeight - 0.5 * l.height - 0.111; + if (((i.depth > 0.25 || "\\xleftequilibrium" === e.label) && (c -= i.depth), r)) { + var m = -t.fontMetrics().axisHeight + r.height + 0.5 * l.height + 0.111; + s = Qe.makeVList( + { + positionType: "individualShift", + children: [ + { type: "elem", elem: i, shift: c }, + { type: "elem", elem: l, shift: h }, + { type: "elem", elem: r, shift: m }, + ], + }, + t, + ); + } else + s = Qe.makeVList( + { + positionType: "individualShift", + children: [ + { type: "elem", elem: i, shift: c }, + { type: "elem", elem: l, shift: h }, + ], + }, + t, + ); + return s.children[0].children[0].children[1].classes.push("svg-align"), Qe.makeSpan(["mrel", "x-arrow"], [s], t); + }, + mathmlBuilder: function (e, t) { + var r, + n = Ft(e.label); + if ((n.setAttribute("minsize", "x" === e.label.charAt(0) ? "1.75em" : "3.0em"), e.body)) { + var a = $t(Ot(e.body, t)); + if (e.below) { + var i = $t(Ot(e.below, t)); + r = new Nt.MathNode("munderover", [n, i, a]); + } else r = new Nt.MathNode("mover", [n, a]); + } else if (e.below) { + var o = $t(Ot(e.below, t)); + r = new Nt.MathNode("munder", [n, o]); + } else (r = $t()), (r = new Nt.MathNode("mover", [n, r])); + return r; + }, + }); + var Zt = Qe.makeSpan; + function Kt(e, t) { + var r = vt(e.body, t, !0); + return Zt([e.mclass], r, t); + } + function Jt(e, t) { + var r, + n = Rt(e.body, t); + return ( + "minner" === e.mclass + ? (r = new Nt.MathNode("mpadded", n)) + : "mord" === e.mclass + ? e.isCharacterBox + ? ((r = n[0]).type = "mi") + : (r = new Nt.MathNode("mi", n)) + : (e.isCharacterBox ? ((r = n[0]).type = "mo") : (r = new Nt.MathNode("mo", n)), + "mbin" === e.mclass + ? ((r.attributes.lspace = "0.22em"), (r.attributes.rspace = "0.22em")) + : "mpunct" === e.mclass + ? ((r.attributes.lspace = "0em"), (r.attributes.rspace = "0.17em")) + : "mopen" === e.mclass || "mclose" === e.mclass + ? ((r.attributes.lspace = "0em"), (r.attributes.rspace = "0em")) + : "minner" === e.mclass && ((r.attributes.lspace = "0.0556em"), (r.attributes.width = "+0.1111em"))), + r + ); + } + lt({ + type: "mclass", + names: ["\\mathord", "\\mathbin", "\\mathrel", "\\mathopen", "\\mathclose", "\\mathpunct", "\\mathinner"], + props: { numArgs: 1, primitive: !0 }, + handler: function (e, t) { + var r = e.parser, + n = e.funcName, + a = t[0]; + return { + type: "mclass", + mode: r.mode, + mclass: "m" + n.slice(5), + body: mt(a), + isCharacterBox: p(a), + }; + }, + htmlBuilder: Kt, + mathmlBuilder: Jt, + }); + var Qt = function (e) { + var t = "ordgroup" === e.type && e.body.length ? e.body[0] : e; + return "atom" !== t.type || ("bin" !== t.family && "rel" !== t.family) ? "mord" : "m" + t.family; + }; + lt({ + type: "mclass", + names: ["\\@binrel"], + props: { numArgs: 2 }, + handler: function (e, t) { + return { + type: "mclass", + mode: e.parser.mode, + mclass: Qt(t[0]), + body: mt(t[1]), + isCharacterBox: p(t[1]), + }; + }, + }), + lt({ + type: "mclass", + names: ["\\stackrel", "\\overset", "\\underset"], + props: { numArgs: 2 }, + handler: function (e, t) { + var r, + n = e.parser, + a = e.funcName, + i = t[1], + o = t[0]; + r = "\\stackrel" !== a ? Qt(i) : "mrel"; + var s = { + type: "op", + mode: i.mode, + limits: !0, + alwaysHandleSupSub: !0, + parentIsSupSub: !1, + symbol: !1, + suppressBaseShift: "\\stackrel" !== a, + body: mt(i), + }, + l = { + type: "supsub", + mode: o.mode, + base: s, + sup: "\\underset" === a ? null : o, + sub: "\\underset" === a ? o : null, + }; + return { + type: "mclass", + mode: n.mode, + mclass: r, + body: [l], + isCharacterBox: p(l), + }; + }, + htmlBuilder: Kt, + mathmlBuilder: Jt, + }), + lt({ + type: "pmb", + names: ["\\pmb"], + props: { numArgs: 1, allowedInText: !0 }, + handler: function (e, t) { + return { type: "pmb", mode: e.parser.mode, mclass: Qt(t[0]), body: mt(t[0]) }; + }, + htmlBuilder: function (e, t) { + var r = vt(e.body, t, !0), + n = Qe.makeSpan([e.mclass], r, t); + return (n.style.textShadow = "0.02em 0.01em 0.04px"), n; + }, + mathmlBuilder: function (e, t) { + var r = Rt(e.body, t), + n = new Nt.MathNode("mstyle", r); + return n.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px"), n; + }, + }); + var er = { + ">": "\\\\cdrightarrow", + "<": "\\\\cdleftarrow", + "=": "\\\\cdlongequal", + A: "\\uparrow", + V: "\\downarrow", + "|": "\\Vert", + ".": "no arrow", + }, + tr = function (e) { + return "textord" === e.type && "@" === e.text; + }; + function rr(e, t, r) { + var n = er[e]; + switch (n) { + case "\\\\cdrightarrow": + case "\\\\cdleftarrow": + return r.callFunction(n, [t[0]], [t[1]]); + case "\\uparrow": + case "\\downarrow": + var a = { type: "atom", text: n, mode: "math", family: "rel" }, + i = { + type: "ordgroup", + mode: "math", + body: [r.callFunction("\\\\cdleft", [t[0]], []), r.callFunction("\\Big", [a], []), r.callFunction("\\\\cdright", [t[1]], [])], + }; + return r.callFunction("\\\\cdparent", [i], []); + case "\\\\cdlongequal": + return r.callFunction("\\\\cdlongequal", [], []); + case "\\Vert": + return r.callFunction("\\Big", [{ type: "textord", text: "\\Vert", mode: "math" }], []); + default: + return { type: "textord", text: " ", mode: "math" }; + } + } + lt({ + type: "cdlabel", + names: ["\\\\cdleft", "\\\\cdright"], + props: { numArgs: 1 }, + handler: function (e, t) { + var r = e.parser, + n = e.funcName; + return { type: "cdlabel", mode: r.mode, side: n.slice(4), label: t[0] }; + }, + htmlBuilder: function (e, t) { + var r = t.havingStyle(t.style.sup()), + n = Qe.wrapFragment(St(e.label, r, t), t); + return n.classes.push("cd-label-" + e.side), (n.style.bottom = W(0.8 - n.depth)), (n.height = 0), (n.depth = 0), n; + }, + mathmlBuilder: function (e, t) { + var r = new Nt.MathNode("mrow", [Ot(e.label, t)]); + return ( + (r = new Nt.MathNode("mpadded", [r])).setAttribute("width", "0"), + "left" === e.side && r.setAttribute("lspace", "-1width"), + r.setAttribute("voffset", "0.7em"), + (r = new Nt.MathNode("mstyle", [r])).setAttribute("displaystyle", "false"), + r.setAttribute("scriptlevel", "1"), + r + ); + }, + }), + lt({ + type: "cdlabelparent", + names: ["\\\\cdparent"], + props: { numArgs: 1 }, + handler: function (e, t) { + return { type: "cdlabelparent", mode: e.parser.mode, fragment: t[0] }; + }, + htmlBuilder: function (e, t) { + var r = Qe.wrapFragment(St(e.fragment, t), t); + return r.classes.push("cd-vert-arrow"), r; + }, + mathmlBuilder: function (e, t) { + return new Nt.MathNode("mrow", [Ot(e.fragment, t)]); + }, + }), + lt({ + type: "textord", + names: ["\\@char"], + props: { numArgs: 1, allowedInText: !0 }, + handler: function (e, t) { + for (var r = e.parser, a = Ut(t[0], "ordgroup").body, i = "", o = 0; o < a.length; o++) i += Ut(a[o], "textord").text; + var s, + l = parseInt(i); + if (isNaN(l)) throw new n("\\@char has non-numeric argument " + i); + if (l < 0 || l >= 1114111) throw new n("\\@char with invalid code point " + i); + return ( + l <= 65535 ? (s = String.fromCharCode(l)) : ((l -= 65536), (s = String.fromCharCode(55296 + (l >> 10), 56320 + (1023 & l)))), + { type: "textord", mode: r.mode, text: s } + ); + }, + }); + var nr = function (e, t) { + var r = vt(e.body, t.withColor(e.color), !1); + return Qe.makeFragment(r); + }, + ar = function (e, t) { + var r = Rt(e.body, t.withColor(e.color)), + n = new Nt.MathNode("mstyle", r); + return n.setAttribute("mathcolor", e.color), n; + }; + lt({ + type: "color", + names: ["\\textcolor"], + props: { numArgs: 2, allowedInText: !0, argTypes: ["color", "original"] }, + handler: function (e, t) { + var r = e.parser, + n = Ut(t[0], "color-token").color, + a = t[1]; + return { type: "color", mode: r.mode, color: n, body: mt(a) }; + }, + htmlBuilder: nr, + mathmlBuilder: ar, + }), + lt({ + type: "color", + names: ["\\color"], + props: { numArgs: 1, allowedInText: !0, argTypes: ["color"] }, + handler: function (e, t) { + var r = e.parser, + n = e.breakOnTokenText, + a = Ut(t[0], "color-token").color; + r.gullet.macros.set("\\current@color", a); + var i = r.parseExpression(!0, n); + return { type: "color", mode: r.mode, color: a, body: i }; + }, + htmlBuilder: nr, + mathmlBuilder: ar, + }), + lt({ + type: "cr", + names: ["\\\\"], + props: { numArgs: 0, numOptionalArgs: 0, allowedInText: !0 }, + handler: function (e, t, r) { + var n = e.parser, + a = "[" === n.gullet.future().text ? n.parseSizeGroup(!0) : null, + i = + !n.settings.displayMode || + !n.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline does nothing in display mode"); + return { type: "cr", mode: n.mode, newLine: i, size: a && Ut(a, "size").value }; + }, + htmlBuilder: function (e, t) { + var r = Qe.makeSpan(["mspace"], [], t); + return e.newLine && (r.classes.push("newline"), e.size && (r.style.marginTop = W(X(e.size, t)))), r; + }, + mathmlBuilder: function (e, t) { + var r = new Nt.MathNode("mspace"); + return e.newLine && (r.setAttribute("linebreak", "newline"), e.size && r.setAttribute("height", W(X(e.size, t)))), r; + }, + }); + var ir = { + "\\global": "\\global", + "\\long": "\\\\globallong", + "\\\\globallong": "\\\\globallong", + "\\def": "\\gdef", + "\\gdef": "\\gdef", + "\\edef": "\\xdef", + "\\xdef": "\\xdef", + "\\let": "\\\\globallet", + "\\futurelet": "\\\\globalfuture", + }, + or = function (e) { + var t = e.text; + if (/^(?:[\\{}$&#^_]|EOF)$/.test(t)) throw new n("Expected a control sequence", e); + return t; + }, + sr = function (e, t, r, n) { + var a = e.gullet.macros.get(r.text); + null == a && ((r.noexpand = !0), (a = { tokens: [r], numArgs: 0, unexpandable: !e.gullet.isExpandable(r.text) })), + e.gullet.macros.set(t, a, n); + }; + lt({ + type: "internal", + names: ["\\global", "\\long", "\\\\globallong"], + props: { numArgs: 0, allowedInText: !0 }, + handler: function (e) { + var t = e.parser, + r = e.funcName; + t.consumeSpaces(); + var a = t.fetch(); + if (ir[a.text]) return ("\\global" !== r && "\\\\globallong" !== r) || (a.text = ir[a.text]), Ut(t.parseFunction(), "internal"); + throw new n("Invalid token after macro prefix", a); + }, + }), + lt({ + type: "internal", + names: ["\\def", "\\gdef", "\\edef", "\\xdef"], + props: { numArgs: 0, allowedInText: !0, primitive: !0 }, + handler: function (e) { + var t = e.parser, + r = e.funcName, + a = t.gullet.popToken(), + i = a.text; + if (/^(?:[\\{}$&#^_]|EOF)$/.test(i)) throw new n("Expected a control sequence", a); + for (var o, s = 0, l = [[]]; "{" !== t.gullet.future().text; ) + if ("#" === (a = t.gullet.popToken()).text) { + if ("{" === t.gullet.future().text) { + (o = t.gullet.future()), l[s].push("{"); + break; + } + if (((a = t.gullet.popToken()), !/^[1-9]$/.test(a.text))) throw new n('Invalid argument number "' + a.text + '"'); + if (parseInt(a.text) !== s + 1) throw new n('Argument number "' + a.text + '" out of order'); + s++, l.push([]); + } else { + if ("EOF" === a.text) throw new n("Expected a macro definition"); + l[s].push(a.text); + } + var h = t.gullet.consumeArg().tokens; + return ( + o && h.unshift(o), + ("\\edef" !== r && "\\xdef" !== r) || (h = t.gullet.expandTokens(h)).reverse(), + t.gullet.macros.set(i, { tokens: h, numArgs: s, delimiters: l }, r === ir[r]), + { type: "internal", mode: t.mode } + ); + }, + }), + lt({ + type: "internal", + names: ["\\let", "\\\\globallet"], + props: { numArgs: 0, allowedInText: !0, primitive: !0 }, + handler: function (e) { + var t = e.parser, + r = e.funcName, + n = or(t.gullet.popToken()); + t.gullet.consumeSpaces(); + var a = (function (e) { + var t = e.gullet.popToken(); + return "=" === t.text && " " === (t = e.gullet.popToken()).text && (t = e.gullet.popToken()), t; + })(t); + return sr(t, n, a, "\\\\globallet" === r), { type: "internal", mode: t.mode }; + }, + }), + lt({ + type: "internal", + names: ["\\futurelet", "\\\\globalfuture"], + props: { numArgs: 0, allowedInText: !0, primitive: !0 }, + handler: function (e) { + var t = e.parser, + r = e.funcName, + n = or(t.gullet.popToken()), + a = t.gullet.popToken(), + i = t.gullet.popToken(); + return sr(t, n, i, "\\\\globalfuture" === r), t.gullet.pushToken(i), t.gullet.pushToken(a), { type: "internal", mode: t.mode }; + }, + }); + var lr = function (e, t, r) { + var n = O((he.math[e] && he.math[e].replace) || e, t, r); + if (!n) throw new Error("Unsupported symbol " + e + " and font size " + t + "."); + return n; + }, + hr = function (e, t, r, n) { + var a = r.havingBaseStyle(t), + i = Qe.makeSpan(n.concat(a.sizingClasses(r)), [e], r), + o = a.sizeMultiplier / r.sizeMultiplier; + return (i.height *= o), (i.depth *= o), (i.maxFontSize = a.sizeMultiplier), i; + }, + cr = function (e, t, r) { + var n = t.havingBaseStyle(r), + a = (1 - t.sizeMultiplier / n.sizeMultiplier) * t.fontMetrics().axisHeight; + e.classes.push("delimcenter"), (e.style.top = W(a)), (e.height -= a), (e.depth += a); + }, + mr = function (e, t, r, n, a, i) { + var o = (function (e, t, r, n) { + return Qe.makeSymbol(e, "Size" + t + "-Regular", r, n); + })(e, t, a, n), + s = hr(Qe.makeSpan(["delimsizing", "size" + t], [o], n), A.TEXT, n, i); + return r && cr(s, n, A.TEXT), s; + }, + ur = function (e, t, r) { + return { + type: "elem", + elem: Qe.makeSpan( + ["delimsizinginner", "Size1-Regular" === t ? "delim-size1" : "delim-size4"], + [Qe.makeSpan([], [Qe.makeSymbol(e, t, r)])], + ), + }; + }, + pr = function (e, t, r) { + var n = I["Size4-Regular"][e.charCodeAt(0)] ? I["Size4-Regular"][e.charCodeAt(0)][4] : I["Size1-Regular"][e.charCodeAt(0)][4], + a = new ne( + "inner", + (function (e, t) { + switch (e) { + case "⎜": + return "M291 0 H417 V" + t + " H291z M291 0 H417 V" + t + " H291z"; + case "∣": + return "M145 0 H188 V" + t + " H145z M145 0 H188 V" + t + " H145z"; + case "∥": + return "M145 0 H188 V" + t + " H145z M145 0 H188 V" + t + " H145zM367 0 H410 V" + t + " H367z M367 0 H410 V" + t + " H367z"; + case "⎟": + return "M457 0 H583 V" + t + " H457z M457 0 H583 V" + t + " H457z"; + case "⎢": + return "M319 0 H403 V" + t + " H319z M319 0 H403 V" + t + " H319z"; + case "⎥": + return "M263 0 H347 V" + t + " H263z M263 0 H347 V" + t + " H263z"; + case "⎪": + return "M384 0 H504 V" + t + " H384z M384 0 H504 V" + t + " H384z"; + case "⏐": + return "M312 0 H355 V" + t + " H312z M312 0 H355 V" + t + " H312z"; + case "‖": + return "M257 0 H300 V" + t + " H257z M257 0 H300 V" + t + " H257zM478 0 H521 V" + t + " H478z M478 0 H521 V" + t + " H478z"; + default: + return ""; + } + })(e, Math.round(1e3 * t)), + ), + i = new re([a], { + width: W(n), + height: W(t), + style: "width:" + W(n), + viewBox: "0 0 " + 1e3 * n + " " + Math.round(1e3 * t), + preserveAspectRatio: "xMinYMin", + }), + o = Qe.makeSvgSpan([], [i], r); + return (o.height = t), (o.style.height = W(t)), (o.style.width = W(n)), { type: "elem", elem: o }; + }, + dr = { type: "kern", size: -0.008 }, + fr = ["|", "\\lvert", "\\rvert", "\\vert"], + gr = ["\\|", "\\lVert", "\\rVert", "\\Vert"], + vr = function (e, t, r, n, a, i) { + var o, + s, + h, + c, + m = "", + u = 0; + (o = h = c = e), (s = null); + var p = "Size1-Regular"; + "\\uparrow" === e + ? (h = c = "⏐") + : "\\Uparrow" === e + ? (h = c = "‖") + : "\\downarrow" === e + ? (o = h = "⏐") + : "\\Downarrow" === e + ? (o = h = "‖") + : "\\updownarrow" === e + ? ((o = "\\uparrow"), (h = "⏐"), (c = "\\downarrow")) + : "\\Updownarrow" === e + ? ((o = "\\Uparrow"), (h = "‖"), (c = "\\Downarrow")) + : l(fr, e) + ? ((h = "∣"), (m = "vert"), (u = 333)) + : l(gr, e) + ? ((h = "∥"), (m = "doublevert"), (u = 556)) + : "[" === e || "\\lbrack" === e + ? ((o = "⎡"), (h = "⎢"), (c = "⎣"), (p = "Size4-Regular"), (m = "lbrack"), (u = 667)) + : "]" === e || "\\rbrack" === e + ? ((o = "⎤"), (h = "⎥"), (c = "⎦"), (p = "Size4-Regular"), (m = "rbrack"), (u = 667)) + : "\\lfloor" === e || "⌊" === e + ? ((h = o = "⎢"), (c = "⎣"), (p = "Size4-Regular"), (m = "lfloor"), (u = 667)) + : "\\lceil" === e || "⌈" === e + ? ((o = "⎡"), (h = c = "⎢"), (p = "Size4-Regular"), (m = "lceil"), (u = 667)) + : "\\rfloor" === e || "⌋" === e + ? ((h = o = "⎥"), (c = "⎦"), (p = "Size4-Regular"), (m = "rfloor"), (u = 667)) + : "\\rceil" === e || "⌉" === e + ? ((o = "⎤"), (h = c = "⎥"), (p = "Size4-Regular"), (m = "rceil"), (u = 667)) + : "(" === e || "\\lparen" === e + ? ((o = "⎛"), (h = "⎜"), (c = "⎝"), (p = "Size4-Regular"), (m = "lparen"), (u = 875)) + : ")" === e || "\\rparen" === e + ? ((o = "⎞"), (h = "⎟"), (c = "⎠"), (p = "Size4-Regular"), (m = "rparen"), (u = 875)) + : "\\{" === e || "\\lbrace" === e + ? ((o = "⎧"), (s = "⎨"), (c = "⎩"), (h = "⎪"), (p = "Size4-Regular")) + : "\\}" === e || "\\rbrace" === e + ? ((o = "⎫"), (s = "⎬"), (c = "⎭"), (h = "⎪"), (p = "Size4-Regular")) + : "\\lgroup" === e || "⟮" === e + ? ((o = "⎧"), (c = "⎩"), (h = "⎪"), (p = "Size4-Regular")) + : "\\rgroup" === e || "⟯" === e + ? ((o = "⎫"), (c = "⎭"), (h = "⎪"), (p = "Size4-Regular")) + : "\\lmoustache" === e || "⎰" === e + ? ((o = "⎧"), (c = "⎭"), (h = "⎪"), (p = "Size4-Regular")) + : ("\\rmoustache" !== e && "⎱" !== e) || + ((o = "⎫"), (c = "⎩"), (h = "⎪"), (p = "Size4-Regular")); + var d = lr(o, p, a), + f = d.height + d.depth, + g = lr(h, p, a), + v = g.height + g.depth, + y = lr(c, p, a), + b = y.height + y.depth, + x = 0, + w = 1; + if (null !== s) { + var k = lr(s, p, a); + (x = k.height + k.depth), (w = 2); + } + var S = f + b + x, + M = S + Math.max(0, Math.ceil((t - S) / (w * v))) * w * v, + z = n.fontMetrics().axisHeight; + r && (z *= n.sizeMultiplier); + var T = M / 2 - z, + B = []; + if (m.length > 0) { + var N = M - f - b, + C = Math.round(1e3 * M), + q = (function (e, t) { + switch (e) { + case "lbrack": + return "M403 1759 V84 H666 V0 H319 V1759 v" + t + " v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v" + t + " v1759 h84z"; + case "rbrack": + return "M347 1759 V0 H0 V84 H263 V1759 v" + t + " v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v" + t + " v1759 h84z"; + case "vert": + return ( + "M145 15 v585 v" + + t + + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + + -t + + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v" + + t + + " v585 h43z" + ); + case "doublevert": + return ( + "M145 15 v585 v" + + t + + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + + -t + + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v" + + t + + " v585 h43z\nM367 15 v585 v" + + t + + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + + -t + + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v" + + t + + " v585 h43z" + ); + case "lfloor": + return "M319 602 V0 H403 V602 v" + t + " v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v" + t + " v1715 H319z"; + case "rfloor": + return "M319 602 V0 H403 V602 v" + t + " v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v" + t + " v1715 H319z"; + case "lceil": + return "M403 1759 V84 H666 V0 H319 V1759 v" + t + " v602 h84z\nM403 1759 V0 H319 V1759 v" + t + " v602 h84z"; + case "rceil": + return "M347 1759 V0 H0 V84 H263 V1759 v" + t + " v602 h84z\nM347 1759 V0 h-84 V1759 v" + t + " v602 h84z"; + case "lparen": + return ( + "M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0," + + (t + 84) + + "c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-" + + (t + 92) + + "c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z" + ); + case "rparen": + return ( + "M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0," + + (t + 9) + + "\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-" + + (t + 144) + + "c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z" + ); + default: + throw new Error("Unknown stretchy delimiter."); + } + })(m, Math.round(1e3 * N)), + I = new ne(m, q), + R = (u / 1e3).toFixed(3) + "em", + H = (C / 1e3).toFixed(3) + "em", + O = new re([I], { width: R, height: H, viewBox: "0 0 " + u + " " + C }), + E = Qe.makeSvgSpan([], [O], n); + (E.height = C / 1e3), (E.style.width = R), (E.style.height = H), B.push({ type: "elem", elem: E }); + } else { + if ((B.push(ur(c, p, a)), B.push(dr), null === s)) { + var L = M - f - b + 0.016; + B.push(pr(h, L, n)); + } else { + var D = (M - f - b - x) / 2 + 0.016; + B.push(pr(h, D, n)), B.push(dr), B.push(ur(s, p, a)), B.push(dr), B.push(pr(h, D, n)); + } + B.push(dr), B.push(ur(o, p, a)); + } + var P = n.havingBaseStyle(A.TEXT), + V = Qe.makeVList({ positionType: "bottom", positionData: T, children: B }, P); + return hr(Qe.makeSpan(["delimsizing", "mult"], [V], P), A.TEXT, n, i); + }, + yr = 0.08, + br = function (e, t, r, n, a) { + var i = (function (e, t, r) { + t *= 1e3; + var n = ""; + switch (e) { + case "sqrtMain": + n = (function (e, t) { + return ( + "M95," + + (622 + e + 80) + + "\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl" + + e / 2.075 + + " -" + + e + + "\nc5.3,-9.3,12,-14,20,-14\nH400000v" + + (40 + e) + + "H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM" + + (834 + e) + + " 80h400000v" + + (40 + e) + + "h-400000z" + ); + })(t); + break; + case "sqrtSize1": + n = (function (e, t) { + return ( + "M263," + + (601 + e + 80) + + "c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl" + + e / 2.084 + + " -" + + e + + "\nc4.7,-7.3,11,-11,19,-11\nH40000v" + + (40 + e) + + "H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM" + + (1001 + e) + + " 80h400000v" + + (40 + e) + + "h-400000z" + ); + })(t); + break; + case "sqrtSize2": + n = (function (e, t) { + return ( + "M983 " + + (10 + e + 80) + + "\nl" + + e / 3.13 + + " -" + + e + + "\nc4,-6.7,10,-10,18,-10 H400000v" + + (40 + e) + + "\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM" + + (1001 + e) + + " 80h400000v" + + (40 + e) + + "h-400000z" + ); + })(t); + break; + case "sqrtSize3": + n = (function (e, t) { + return ( + "M424," + + (2398 + e + 80) + + "\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl" + + e / 4.223 + + " -" + + e + + "c4,-6.7,10,-10,18,-10 H400000\nv" + + (40 + e) + + "H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M" + + (1001 + e) + + " 80\nh400000v" + + (40 + e) + + "h-400000z" + ); + })(t); + break; + case "sqrtSize4": + n = (function (e, t) { + return ( + "M473," + + (2713 + e + 80) + + "\nc339.3,-1799.3,509.3,-2700,510,-2702 l" + + e / 5.298 + + " -" + + e + + "\nc3.3,-7.3,9.3,-11,18,-11 H400000v" + + (40 + e) + + "H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM" + + (1001 + e) + + " 80h400000v" + + (40 + e) + + "H1017.7z" + ); + })(t); + break; + case "sqrtTall": + n = (function (e, t, r) { + return ( + "M702 " + + (e + 80) + + "H400000" + + (40 + e) + + "\nH742v" + + (r - 54 - 80 - e) + + "l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 80H400000v" + + (40 + e) + + "H742z" + ); + })(t, 0, r); + } + return n; + })(e, n, r), + o = new ne(e, i), + s = new re([o], { + width: "400em", + height: W(t), + viewBox: "0 0 400000 " + r, + preserveAspectRatio: "xMinYMin slice", + }); + return Qe.makeSvgSpan(["hide-tail"], [s], a); + }, + xr = [ + "(", + "\\lparen", + ")", + "\\rparen", + "[", + "\\lbrack", + "]", + "\\rbrack", + "\\{", + "\\lbrace", + "\\}", + "\\rbrace", + "\\lfloor", + "\\rfloor", + "⌊", + "⌋", + "\\lceil", + "\\rceil", + "⌈", + "⌉", + "\\surd", + ], + wr = [ + "\\uparrow", + "\\downarrow", + "\\updownarrow", + "\\Uparrow", + "\\Downarrow", + "\\Updownarrow", + "|", + "\\|", + "\\vert", + "\\Vert", + "\\lvert", + "\\rvert", + "\\lVert", + "\\rVert", + "\\lgroup", + "\\rgroup", + "⟮", + "⟯", + "\\lmoustache", + "\\rmoustache", + "⎰", + "⎱", + ], + kr = ["<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt"], + Sr = [0, 1.2, 1.8, 2.4, 3], + Mr = [ + { type: "small", style: A.SCRIPTSCRIPT }, + { type: "small", style: A.SCRIPT }, + { type: "small", style: A.TEXT }, + { type: "large", size: 1 }, + { type: "large", size: 2 }, + { type: "large", size: 3 }, + { type: "large", size: 4 }, + ], + zr = [ + { type: "small", style: A.SCRIPTSCRIPT }, + { type: "small", style: A.SCRIPT }, + { type: "small", style: A.TEXT }, + { type: "stack" }, + ], + Ar = [ + { type: "small", style: A.SCRIPTSCRIPT }, + { type: "small", style: A.SCRIPT }, + { type: "small", style: A.TEXT }, + { type: "large", size: 1 }, + { type: "large", size: 2 }, + { type: "large", size: 3 }, + { type: "large", size: 4 }, + { type: "stack" }, + ], + Tr = function (e) { + if ("small" === e.type) return "Main-Regular"; + if ("large" === e.type) return "Size" + e.size + "-Regular"; + if ("stack" === e.type) return "Size4-Regular"; + throw new Error("Add support for delim type '" + e.type + "' here."); + }, + Br = function (e, t, r, n) { + for (var a = Math.min(2, 3 - n.style.size); a < r.length && "stack" !== r[a].type; a++) { + var i = lr(e, Tr(r[a]), "math"), + o = i.height + i.depth; + if (("small" === r[a].type && (o *= n.havingBaseStyle(r[a].style).sizeMultiplier), o > t)) return r[a]; + } + return r[r.length - 1]; + }, + Nr = function (e, t, r, n, a, i) { + var o; + "<" === e || "\\lt" === e || "⟨" === e ? (e = "\\langle") : (">" !== e && "\\gt" !== e && "⟩" !== e) || (e = "\\rangle"), + (o = l(kr, e) ? Mr : l(xr, e) ? Ar : zr); + var s = Br(e, t, o, n); + return "small" === s.type + ? (function (e, t, r, n, a, i) { + var o = Qe.makeSymbol(e, "Main-Regular", a, n), + s = hr(o, t, n, i); + return r && cr(s, n, t), s; + })(e, s.style, r, n, a, i) + : "large" === s.type + ? mr(e, s.size, r, n, a, i) + : vr(e, t, r, n, a, i); + }, + Cr = { + sqrtImage: function (e, t) { + var r, + n, + a = t.havingBaseSizing(), + i = Br("\\surd", e * a.sizeMultiplier, Ar, a), + o = a.sizeMultiplier, + s = Math.max(0, t.minRuleThickness - t.fontMetrics().sqrtRuleThickness), + l = 0, + h = 0, + c = 0; + return ( + "small" === i.type + ? (e < 1 ? (o = 1) : e < 1.4 && (o = 0.7), + (h = (1 + s) / o), + ((r = br("sqrtMain", (l = (1 + s + yr) / o), (c = 1e3 + 1e3 * s + 80), s, t)).style.minWidth = "0.853em"), + (n = 0.833 / o)) + : "large" === i.type + ? ((c = 1080 * Sr[i.size]), + (h = (Sr[i.size] + s) / o), + (l = (Sr[i.size] + s + yr) / o), + ((r = br("sqrtSize" + i.size, l, c, s, t)).style.minWidth = "1.02em"), + (n = 1 / o)) + : ((l = e + s + yr), + (h = e + s), + (c = Math.floor(1e3 * e + s) + 80), + ((r = br("sqrtTall", l, c, s, t)).style.minWidth = "0.742em"), + (n = 1.056)), + (r.height = h), + (r.style.height = W(l)), + { + span: r, + advanceWidth: n, + ruleWidth: (t.fontMetrics().sqrtRuleThickness + s) * o, + } + ); + }, + sizedDelim: function (e, t, r, a, i) { + if ( + ("<" === e || "\\lt" === e || "⟨" === e ? (e = "\\langle") : (">" !== e && "\\gt" !== e && "⟩" !== e) || (e = "\\rangle"), + l(xr, e) || l(kr, e)) + ) + return mr(e, t, !1, r, a, i); + if (l(wr, e)) return vr(e, Sr[t], !1, r, a, i); + throw new n("Illegal delimiter: '" + e + "'"); + }, + sizeToMaxHeight: Sr, + customSizedDelim: Nr, + leftRightDelim: function (e, t, r, n, a, i) { + var o = n.fontMetrics().axisHeight * n.sizeMultiplier, + s = 5 / n.fontMetrics().ptPerEm, + l = Math.max(t - o, r + o), + h = Math.max((l / 500) * 901, 2 * l - s); + return Nr(e, h, !0, n, a, i); + }, + }, + qr = { + "\\bigl": { mclass: "mopen", size: 1 }, + "\\Bigl": { mclass: "mopen", size: 2 }, + "\\biggl": { mclass: "mopen", size: 3 }, + "\\Biggl": { mclass: "mopen", size: 4 }, + "\\bigr": { mclass: "mclose", size: 1 }, + "\\Bigr": { mclass: "mclose", size: 2 }, + "\\biggr": { mclass: "mclose", size: 3 }, + "\\Biggr": { mclass: "mclose", size: 4 }, + "\\bigm": { mclass: "mrel", size: 1 }, + "\\Bigm": { mclass: "mrel", size: 2 }, + "\\biggm": { mclass: "mrel", size: 3 }, + "\\Biggm": { mclass: "mrel", size: 4 }, + "\\big": { mclass: "mord", size: 1 }, + "\\Big": { mclass: "mord", size: 2 }, + "\\bigg": { mclass: "mord", size: 3 }, + "\\Bigg": { mclass: "mord", size: 4 }, + }, + Ir = [ + "(", + "\\lparen", + ")", + "\\rparen", + "[", + "\\lbrack", + "]", + "\\rbrack", + "\\{", + "\\lbrace", + "\\}", + "\\rbrace", + "\\lfloor", + "\\rfloor", + "⌊", + "⌋", + "\\lceil", + "\\rceil", + "⌈", + "⌉", + "<", + ">", + "\\langle", + "⟨", + "\\rangle", + "⟩", + "\\lt", + "\\gt", + "\\lvert", + "\\rvert", + "\\lVert", + "\\rVert", + "\\lgroup", + "\\rgroup", + "⟮", + "⟯", + "\\lmoustache", + "\\rmoustache", + "⎰", + "⎱", + "/", + "\\backslash", + "|", + "\\vert", + "\\|", + "\\Vert", + "\\uparrow", + "\\Uparrow", + "\\downarrow", + "\\Downarrow", + "\\updownarrow", + "\\Updownarrow", + ".", + ]; + function Rr(e, t) { + var r = Xt(e); + if (r && l(Ir, r.text)) return r; + throw new n(r ? "Invalid delimiter '" + r.text + "' after '" + t.funcName + "'" : "Invalid delimiter type '" + e.type + "'", e); + } + function Hr(e) { + if (!e.body) throw new Error("Bug: The leftright ParseNode wasn't fully parsed."); + } + lt({ + type: "delimsizing", + names: [ + "\\bigl", + "\\Bigl", + "\\biggl", + "\\Biggl", + "\\bigr", + "\\Bigr", + "\\biggr", + "\\Biggr", + "\\bigm", + "\\Bigm", + "\\biggm", + "\\Biggm", + "\\big", + "\\Big", + "\\bigg", + "\\Bigg", + ], + props: { numArgs: 1, argTypes: ["primitive"] }, + handler: function (e, t) { + var r = Rr(t[0], e); + return { + type: "delimsizing", + mode: e.parser.mode, + size: qr[e.funcName].size, + mclass: qr[e.funcName].mclass, + delim: r.text, + }; + }, + htmlBuilder: function (e, t) { + return "." === e.delim ? Qe.makeSpan([e.mclass]) : Cr.sizedDelim(e.delim, e.size, t, e.mode, [e.mclass]); + }, + mathmlBuilder: function (e) { + var t = []; + "." !== e.delim && t.push(Ct(e.delim, e.mode)); + var r = new Nt.MathNode("mo", t); + "mopen" === e.mclass || "mclose" === e.mclass ? r.setAttribute("fence", "true") : r.setAttribute("fence", "false"), + r.setAttribute("stretchy", "true"); + var n = W(Cr.sizeToMaxHeight[e.size]); + return r.setAttribute("minsize", n), r.setAttribute("maxsize", n), r; + }, + }), + lt({ + type: "leftright-right", + names: ["\\right"], + props: { numArgs: 1, primitive: !0 }, + handler: function (e, t) { + var r = e.parser.gullet.macros.get("\\current@color"); + if (r && "string" != typeof r) throw new n("\\current@color set to non-string in \\right"); + return { + type: "leftright-right", + mode: e.parser.mode, + delim: Rr(t[0], e).text, + color: r, + }; + }, + }), + lt({ + type: "leftright", + names: ["\\left"], + props: { numArgs: 1, primitive: !0 }, + handler: function (e, t) { + var r = Rr(t[0], e), + n = e.parser; + ++n.leftrightDepth; + var a = n.parseExpression(!1); + --n.leftrightDepth, n.expect("\\right", !1); + var i = Ut(n.parseFunction(), "leftright-right"); + return { + type: "leftright", + mode: n.mode, + body: a, + left: r.text, + right: i.delim, + rightColor: i.color, + }; + }, + htmlBuilder: function (e, t) { + Hr(e); + for (var r, n, a = vt(e.body, t, !0, ["mopen", "mclose"]), i = 0, o = 0, s = !1, l = 0; l < a.length; l++) + a[l].isMiddle ? (s = !0) : ((i = Math.max(a[l].height, i)), (o = Math.max(a[l].depth, o))); + if ( + ((i *= t.sizeMultiplier), + (o *= t.sizeMultiplier), + (r = "." === e.left ? kt(t, ["mopen"]) : Cr.leftRightDelim(e.left, i, o, t, e.mode, ["mopen"])), + a.unshift(r), + s) + ) + for (var h = 1; h < a.length; h++) { + var c = a[h].isMiddle; + c && (a[h] = Cr.leftRightDelim(c.delim, i, o, c.options, e.mode, [])); + } + if ("." === e.right) n = kt(t, ["mclose"]); + else { + var m = e.rightColor ? t.withColor(e.rightColor) : t; + n = Cr.leftRightDelim(e.right, i, o, m, e.mode, ["mclose"]); + } + return a.push(n), Qe.makeSpan(["minner"], a, t); + }, + mathmlBuilder: function (e, t) { + Hr(e); + var r = Rt(e.body, t); + if ("." !== e.left) { + var n = new Nt.MathNode("mo", [Ct(e.left, e.mode)]); + n.setAttribute("fence", "true"), r.unshift(n); + } + if ("." !== e.right) { + var a = new Nt.MathNode("mo", [Ct(e.right, e.mode)]); + a.setAttribute("fence", "true"), e.rightColor && a.setAttribute("mathcolor", e.rightColor), r.push(a); + } + return qt(r); + }, + }), + lt({ + type: "middle", + names: ["\\middle"], + props: { numArgs: 1, primitive: !0 }, + handler: function (e, t) { + var r = Rr(t[0], e); + if (!e.parser.leftrightDepth) throw new n("\\middle without preceding \\left", r); + return { type: "middle", mode: e.parser.mode, delim: r.text }; + }, + htmlBuilder: function (e, t) { + var r; + if ("." === e.delim) r = kt(t, []); + else { + r = Cr.sizedDelim(e.delim, 1, t, e.mode, []); + var n = { delim: e.delim, options: t }; + r.isMiddle = n; + } + return r; + }, + mathmlBuilder: function (e, t) { + var r = "\\vert" === e.delim || "|" === e.delim ? Ct("|", "text") : Ct(e.delim, e.mode), + n = new Nt.MathNode("mo", [r]); + return n.setAttribute("fence", "true"), n.setAttribute("lspace", "0.05em"), n.setAttribute("rspace", "0.05em"), n; + }, + }); + var Or = function (e, t) { + var r, + n, + a, + i = Qe.wrapFragment(St(e.body, t), t), + o = e.label.slice(1), + s = t.sizeMultiplier, + l = 0, + h = p(e.body); + if ("sout" === o) + ((r = Qe.makeSpan(["stretchy", "sout"])).height = t.fontMetrics().defaultRuleThickness / s), (l = -0.5 * t.fontMetrics().xHeight); + else if ("phase" === o) { + var c = X({ number: 0.6, unit: "pt" }, t), + m = X({ number: 0.35, unit: "ex" }, t); + s /= t.havingBaseSizing().sizeMultiplier; + var u = i.height + i.depth + c + m; + i.style.paddingLeft = W(u / 2 + c); + var d = Math.floor(1e3 * u * s), + f = "M400000 " + (n = d) + " H0 L" + n / 2 + " 0 l65 45 L145 " + (n - 80) + " H400000z", + g = new re([new ne("phase", f)], { + width: "400em", + height: W(d / 1e3), + viewBox: "0 0 400000 " + d, + preserveAspectRatio: "xMinYMin slice", + }); + ((r = Qe.makeSvgSpan(["hide-tail"], [g], t)).style.height = W(u)), (l = i.depth + c + m); + } else { + /cancel/.test(o) ? h || i.classes.push("cancel-pad") : "angl" === o ? i.classes.push("anglpad") : i.classes.push("boxpad"); + var v = 0, + y = 0, + b = 0; + /box/.test(o) + ? ((b = Math.max(t.fontMetrics().fboxrule, t.minRuleThickness)), (y = v = t.fontMetrics().fboxsep + ("colorbox" === o ? 0 : b))) + : "angl" === o + ? ((v = 4 * (b = Math.max(t.fontMetrics().defaultRuleThickness, t.minRuleThickness))), (y = Math.max(0, 0.25 - i.depth))) + : (y = v = h ? 0.2 : 0), + (r = (function (e, t, r, n, a) { + var i, + o = e.height + e.depth + r + n; + if (/fbox|color|angl/.test(t)) { + if (((i = Qe.makeSpan(["stretchy", t], [], a)), "fbox" === t)) { + var s = a.color && a.getColor(); + s && (i.style.borderColor = s); + } + } else { + var l = []; + /^[bx]cancel$/.test(t) && + l.push( + new ae({ + x1: "0", + y1: "0", + x2: "100%", + y2: "100%", + "stroke-width": "0.046em", + }), + ), + /^x?cancel$/.test(t) && + l.push( + new ae({ + x1: "0", + y1: "100%", + x2: "100%", + y2: "0", + "stroke-width": "0.046em", + }), + ); + var h = new re(l, { width: "100%", height: W(o) }); + i = Qe.makeSvgSpan([], [h], a); + } + return (i.height = o), (i.style.height = W(o)), i; + })(i, o, v, y, t)), + /fbox|boxed|fcolorbox/.test(o) + ? ((r.style.borderStyle = "solid"), (r.style.borderWidth = W(b))) + : "angl" === o && 0.049 !== b && ((r.style.borderTopWidth = W(b)), (r.style.borderRightWidth = W(b))), + (l = i.depth + y), + e.backgroundColor && ((r.style.backgroundColor = e.backgroundColor), e.borderColor && (r.style.borderColor = e.borderColor)); + } + if (e.backgroundColor) + a = Qe.makeVList( + { + positionType: "individualShift", + children: [ + { type: "elem", elem: r, shift: l }, + { type: "elem", elem: i, shift: 0 }, + ], + }, + t, + ); + else { + var x = /cancel|phase/.test(o) ? ["svg-align"] : []; + a = Qe.makeVList( + { + positionType: "individualShift", + children: [ + { type: "elem", elem: i, shift: 0 }, + { type: "elem", elem: r, shift: l, wrapperClasses: x }, + ], + }, + t, + ); + } + return ( + /cancel/.test(o) && ((a.height = i.height), (a.depth = i.depth)), + /cancel/.test(o) && !h ? Qe.makeSpan(["mord", "cancel-lap"], [a], t) : Qe.makeSpan(["mord"], [a], t) + ); + }, + Er = function (e, t) { + var r = 0, + n = new Nt.MathNode(e.label.indexOf("colorbox") > -1 ? "mpadded" : "menclose", [Ot(e.body, t)]); + switch (e.label) { + case "\\cancel": + n.setAttribute("notation", "updiagonalstrike"); + break; + case "\\bcancel": + n.setAttribute("notation", "downdiagonalstrike"); + break; + case "\\phase": + n.setAttribute("notation", "phasorangle"); + break; + case "\\sout": + n.setAttribute("notation", "horizontalstrike"); + break; + case "\\fbox": + n.setAttribute("notation", "box"); + break; + case "\\angl": + n.setAttribute("notation", "actuarial"); + break; + case "\\fcolorbox": + case "\\colorbox": + if ( + ((r = t.fontMetrics().fboxsep * t.fontMetrics().ptPerEm), + n.setAttribute("width", "+" + 2 * r + "pt"), + n.setAttribute("height", "+" + 2 * r + "pt"), + n.setAttribute("lspace", r + "pt"), + n.setAttribute("voffset", r + "pt"), + "\\fcolorbox" === e.label) + ) { + var a = Math.max(t.fontMetrics().fboxrule, t.minRuleThickness); + n.setAttribute("style", "border: " + a + "em solid " + String(e.borderColor)); + } + break; + case "\\xcancel": + n.setAttribute("notation", "updiagonalstrike downdiagonalstrike"); + } + return e.backgroundColor && n.setAttribute("mathbackground", e.backgroundColor), n; + }; + lt({ + type: "enclose", + names: ["\\colorbox"], + props: { numArgs: 2, allowedInText: !0, argTypes: ["color", "text"] }, + handler: function (e, t, r) { + var n = e.parser, + a = e.funcName, + i = Ut(t[0], "color-token").color, + o = t[1]; + return { type: "enclose", mode: n.mode, label: a, backgroundColor: i, body: o }; + }, + htmlBuilder: Or, + mathmlBuilder: Er, + }), + lt({ + type: "enclose", + names: ["\\fcolorbox"], + props: { numArgs: 3, allowedInText: !0, argTypes: ["color", "color", "text"] }, + handler: function (e, t, r) { + var n = e.parser, + a = e.funcName, + i = Ut(t[0], "color-token").color, + o = Ut(t[1], "color-token").color, + s = t[2]; + return { + type: "enclose", + mode: n.mode, + label: a, + backgroundColor: o, + borderColor: i, + body: s, + }; + }, + htmlBuilder: Or, + mathmlBuilder: Er, + }), + lt({ + type: "enclose", + names: ["\\fbox"], + props: { numArgs: 1, argTypes: ["hbox"], allowedInText: !0 }, + handler: function (e, t) { + return { type: "enclose", mode: e.parser.mode, label: "\\fbox", body: t[0] }; + }, + }), + lt({ + type: "enclose", + names: ["\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\phase"], + props: { numArgs: 1 }, + handler: function (e, t) { + var r = e.parser, + n = e.funcName, + a = t[0]; + return { type: "enclose", mode: r.mode, label: n, body: a }; + }, + htmlBuilder: Or, + mathmlBuilder: Er, + }), + lt({ + type: "enclose", + names: ["\\angl"], + props: { numArgs: 1, argTypes: ["hbox"], allowedInText: !1 }, + handler: function (e, t) { + return { type: "enclose", mode: e.parser.mode, label: "\\angl", body: t[0] }; + }, + }); + var Lr = {}; + function Dr(e) { + for ( + var t = e.type, + r = e.names, + n = e.props, + a = e.handler, + i = e.htmlBuilder, + o = e.mathmlBuilder, + s = { + type: t, + numArgs: n.numArgs || 0, + allowedInText: !1, + numOptionalArgs: 0, + handler: a, + }, + l = 0; + l < r.length; + ++l + ) + Lr[r[l]] = s; + i && (ot[t] = i), o && (st[t] = o); + } + var Pr = {}; + function Vr(e, t) { + Pr[e] = t; + } + var Fr = (function () { + function e(e, t, r) { + (this.lexer = void 0), (this.start = void 0), (this.end = void 0), (this.lexer = e), (this.start = t), (this.end = r); + } + return ( + (e.range = function (t, r) { + return r ? (t && t.loc && r.loc && t.loc.lexer === r.loc.lexer ? new e(t.loc.lexer, t.loc.start, r.loc.end) : null) : t && t.loc; + }), + e + ); + })(), + Gr = (function () { + function e(e, t) { + (this.text = void 0), (this.loc = void 0), (this.noexpand = void 0), (this.treatAsRelax = void 0), (this.text = e), (this.loc = t); + } + return ( + (e.prototype.range = function (t, r) { + return new e(r, Fr.range(this, t)); + }), + e + ); + })(); + function Ur(e) { + var t = []; + e.consumeSpaces(); + var r = e.fetch().text; + for ("\\relax" === r && (e.consume(), e.consumeSpaces(), (r = e.fetch().text)); "\\hline" === r || "\\hdashline" === r; ) + e.consume(), t.push("\\hdashline" === r), e.consumeSpaces(), (r = e.fetch().text); + return t; + } + var Yr = function (e) { + if (!e.parser.settings.displayMode) throw new n("{" + e.envName + "} can be used only in display mode."); + }; + function Xr(e) { + if (-1 === e.indexOf("ed")) return -1 === e.indexOf("*"); + } + function Wr(e, t, r) { + var a = t.hskipBeforeAndAfter, + i = t.addJot, + o = t.cols, + s = t.arraystretch, + l = t.colSeparationType, + h = t.autoTag, + c = t.singleRow, + m = t.emptySingleRow, + u = t.maxNumCols, + p = t.leqno; + if ((e.gullet.beginGroup(), c || e.gullet.macros.set("\\cr", "\\\\\\relax"), !s)) { + var d = e.gullet.expandMacroAsText("\\arraystretch"); + if (null == d) s = 1; + else if (!(s = parseFloat(d)) || s < 0) throw new n("Invalid \\arraystretch: " + d); + } + e.gullet.beginGroup(); + var f = [], + g = [f], + v = [], + y = [], + b = null != h ? [] : void 0; + function x() { + h && e.gullet.macros.set("\\@eqnsw", "1", !0); + } + function w() { + b && + (e.gullet.macros.get("\\df@tag") + ? (b.push(e.subparse([new Gr("\\df@tag")])), e.gullet.macros.set("\\df@tag", void 0, !0)) + : b.push(Boolean(h) && "1" === e.gullet.macros.get("\\@eqnsw"))); + } + for (x(), y.push(Ur(e)); ; ) { + var k = e.parseExpression(!1, c ? "\\end" : "\\\\"); + e.gullet.endGroup(), + e.gullet.beginGroup(), + (k = { type: "ordgroup", mode: e.mode, body: k }), + r && (k = { type: "styling", mode: e.mode, style: r, body: [k] }), + f.push(k); + var S = e.fetch().text; + if ("&" === S) { + if (u && f.length === u) { + if (c || l) throw new n("Too many tab characters: &", e.nextToken); + e.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument."); + } + e.consume(); + } else { + if ("\\end" === S) { + w(), + 1 === f.length && "styling" === k.type && 0 === k.body[0].body.length && (g.length > 1 || !m) && g.pop(), + y.length < g.length + 1 && y.push([]); + break; + } + if ("\\\\" !== S) throw new n("Expected & or \\\\ or \\cr or \\end", e.nextToken); + e.consume(); + var M = void 0; + " " !== e.gullet.future().text && (M = e.parseSizeGroup(!0)), + v.push(M ? M.value : null), + w(), + y.push(Ur(e)), + (f = []), + g.push(f), + x(); + } + } + return ( + e.gullet.endGroup(), + e.gullet.endGroup(), + { + type: "array", + mode: e.mode, + addJot: i, + arraystretch: s, + body: g, + cols: o, + rowGaps: v, + hskipBeforeAndAfter: a, + hLinesBeforeRow: y, + colSeparationType: l, + tags: b, + leqno: p, + } + ); + } + function _r(e) { + return "d" === e.slice(0, 1) ? "display" : "text"; + } + var jr = function (e, t) { + var r, + a, + i = e.body.length, + o = e.hLinesBeforeRow, + s = 0, + l = new Array(i), + c = [], + m = Math.max(t.fontMetrics().arrayRuleWidth, t.minRuleThickness), + u = 1 / t.fontMetrics().ptPerEm, + p = 5 * u; + e.colSeparationType && "small" === e.colSeparationType && (p = (t.havingStyle(A.SCRIPT).sizeMultiplier / t.sizeMultiplier) * 0.2778); + var d = "CD" === e.colSeparationType ? X({ number: 3, unit: "ex" }, t) : 12 * u, + f = 3 * u, + g = e.arraystretch * d, + v = 0.7 * g, + y = 0.3 * g, + b = 0; + function x(e) { + for (var t = 0; t < e.length; ++t) t > 0 && (b += 0.25), c.push({ pos: b, isDashed: e[t] }); + } + for (x(o[0]), r = 0; r < e.body.length; ++r) { + var w = e.body[r], + k = v, + S = y; + s < w.length && (s = w.length); + var M = new Array(w.length); + for (a = 0; a < w.length; ++a) { + var z = St(w[a], t); + S < z.depth && (S = z.depth), k < z.height && (k = z.height), (M[a] = z); + } + var T = e.rowGaps[r], + B = 0; + T && (B = X(T, t)) > 0 && (S < (B += y) && (S = B), (B = 0)), + e.addJot && (S += f), + (M.height = k), + (M.depth = S), + (b += k), + (M.pos = b), + (b += S + B), + (l[r] = M), + x(o[r + 1]); + } + var N, + C, + q = b / 2 + t.fontMetrics().axisHeight, + I = e.cols || [], + R = [], + H = []; + if ( + e.tags && + e.tags.some(function (e) { + return e; + }) + ) + for (r = 0; r < i; ++r) { + var O = l[r], + E = O.pos - q, + L = e.tags[r], + D = void 0; + ((D = !0 === L ? Qe.makeSpan(["eqn-num"], [], t) : Qe.makeSpan([], !1 === L ? [] : vt(L, t, !0), t)).depth = O.depth), + (D.height = O.height), + H.push({ type: "elem", elem: D, shift: E }); + } + for (a = 0, C = 0; a < s || C < I.length; ++a, ++C) { + for (var P = I[C] || {}, V = !0; "separator" === P.type; ) { + if ( + (V || (((N = Qe.makeSpan(["arraycolsep"], [])).style.width = W(t.fontMetrics().doubleRuleSep)), R.push(N)), + "|" !== P.separator && ":" !== P.separator) + ) + throw new n("Invalid separator type: " + P.separator); + var F = "|" === P.separator ? "solid" : "dashed", + G = Qe.makeSpan(["vertical-separator"], [], t); + (G.style.height = W(b)), (G.style.borderRightWidth = W(m)), (G.style.borderRightStyle = F), (G.style.margin = "0 " + W(-m / 2)); + var U = b - q; + U && (G.style.verticalAlign = W(-U)), R.push(G), (P = I[++C] || {}), (V = !1); + } + if (!(a >= s)) { + var Y = void 0; + (a > 0 || e.hskipBeforeAndAfter) && + 0 !== (Y = h(P.pregap, p)) && + (((N = Qe.makeSpan(["arraycolsep"], [])).style.width = W(Y)), R.push(N)); + var _ = []; + for (r = 0; r < i; ++r) { + var j = l[r], + $ = j[a]; + if ($) { + var Z = j.pos - q; + ($.depth = j.depth), ($.height = j.height), _.push({ type: "elem", elem: $, shift: Z }); + } + } + (_ = Qe.makeVList({ positionType: "individualShift", children: _ }, t)), + (_ = Qe.makeSpan(["col-align-" + (P.align || "c")], [_])), + R.push(_), + (a < s - 1 || e.hskipBeforeAndAfter) && + 0 !== (Y = h(P.postgap, p)) && + (((N = Qe.makeSpan(["arraycolsep"], [])).style.width = W(Y)), R.push(N)); + } + } + if (((l = Qe.makeSpan(["mtable"], R)), c.length > 0)) { + for ( + var K = Qe.makeLineSpan("hline", t, m), J = Qe.makeLineSpan("hdashline", t, m), Q = [{ type: "elem", elem: l, shift: 0 }]; + c.length > 0; + + ) { + var ee = c.pop(), + te = ee.pos - q; + ee.isDashed ? Q.push({ type: "elem", elem: J, shift: te }) : Q.push({ type: "elem", elem: K, shift: te }); + } + l = Qe.makeVList({ positionType: "individualShift", children: Q }, t); + } + if (0 === H.length) return Qe.makeSpan(["mord"], [l], t); + var re = Qe.makeVList({ positionType: "individualShift", children: H }, t); + return (re = Qe.makeSpan(["tag"], [re], t)), Qe.makeFragment([l, re]); + }, + $r = { c: "center ", l: "left ", r: "right " }, + Zr = function (e, t) { + for ( + var r = [], n = new Nt.MathNode("mtd", [], ["mtr-glue"]), a = new Nt.MathNode("mtd", [], ["mml-eqn-num"]), i = 0; + i < e.body.length; + i++ + ) { + for (var o = e.body[i], s = [], l = 0; l < o.length; l++) s.push(new Nt.MathNode("mtd", [Ot(o[l], t)])); + e.tags && e.tags[i] && (s.unshift(n), s.push(n), e.leqno ? s.unshift(a) : s.push(a)), r.push(new Nt.MathNode("mtr", s)); + } + var h = new Nt.MathNode("mtable", r), + c = 0.5 === e.arraystretch ? 0.1 : 0.16 + e.arraystretch - 1 + (e.addJot ? 0.09 : 0); + h.setAttribute("rowspacing", W(c)); + var m = "", + u = ""; + if (e.cols && e.cols.length > 0) { + var p = e.cols, + d = "", + f = !1, + g = 0, + v = p.length; + "separator" === p[0].type && ((m += "top "), (g = 1)), "separator" === p[p.length - 1].type && ((m += "bottom "), (v -= 1)); + for (var y = g; y < v; y++) + "align" === p[y].type + ? ((u += $r[p[y].align]), f && (d += "none "), (f = !0)) + : "separator" === p[y].type && f && ((d += "|" === p[y].separator ? "solid " : "dashed "), (f = !1)); + h.setAttribute("columnalign", u.trim()), /[sd]/.test(d) && h.setAttribute("columnlines", d.trim()); + } + if ("align" === e.colSeparationType) { + for (var b = e.cols || [], x = "", w = 1; w < b.length; w++) x += w % 2 ? "0em " : "1em "; + h.setAttribute("columnspacing", x.trim()); + } else + "alignat" === e.colSeparationType || "gather" === e.colSeparationType + ? h.setAttribute("columnspacing", "0em") + : "small" === e.colSeparationType + ? h.setAttribute("columnspacing", "0.2778em") + : "CD" === e.colSeparationType + ? h.setAttribute("columnspacing", "0.5em") + : h.setAttribute("columnspacing", "1em"); + var k = "", + S = e.hLinesBeforeRow; + (m += S[0].length > 0 ? "left " : ""), (m += S[S.length - 1].length > 0 ? "right " : ""); + for (var M = 1; M < S.length - 1; M++) k += 0 === S[M].length ? "none " : S[M][0] ? "dashed " : "solid "; + return ( + /[sd]/.test(k) && h.setAttribute("rowlines", k.trim()), + "" !== m && (h = new Nt.MathNode("menclose", [h])).setAttribute("notation", m.trim()), + e.arraystretch && e.arraystretch < 1 && (h = new Nt.MathNode("mstyle", [h])).setAttribute("scriptlevel", "1"), + h + ); + }, + Kr = function (e, t) { + -1 === e.envName.indexOf("ed") && Yr(e); + var r, + a = [], + i = e.envName.indexOf("at") > -1 ? "alignat" : "align", + o = "split" === e.envName, + s = Wr( + e.parser, + { + cols: a, + addJot: !0, + autoTag: o ? void 0 : Xr(e.envName), + emptySingleRow: !0, + colSeparationType: i, + maxNumCols: o ? 2 : void 0, + leqno: e.parser.settings.leqno, + }, + "display", + ), + l = 0, + h = { type: "ordgroup", mode: e.mode, body: [] }; + if (t[0] && "ordgroup" === t[0].type) { + for (var c = "", m = 0; m < t[0].body.length; m++) c += Ut(t[0].body[m], "textord").text; + (r = Number(c)), (l = 2 * r); + } + var u = !l; + s.body.forEach(function (e) { + for (var t = 1; t < e.length; t += 2) { + var a = Ut(e[t], "styling"); + Ut(a.body[0], "ordgroup").body.unshift(h); + } + if (u) l < e.length && (l = e.length); + else { + var i = e.length / 2; + if (r < i) throw new n("Too many math in a row: expected " + r + ", but got " + i, e[0]); + } + }); + for (var p = 0; p < l; ++p) { + var d = "r", + f = 0; + p % 2 == 1 ? (d = "l") : p > 0 && u && (f = 1), (a[p] = { type: "align", align: d, pregap: f, postgap: 0 }); + } + return (s.colSeparationType = u ? "align" : "alignat"), s; + }; + Dr({ + type: "array", + names: ["array", "darray"], + props: { numArgs: 1 }, + handler: function (e, t) { + var r = (Xt(t[0]) ? [t[0]] : Ut(t[0], "ordgroup").body).map(function (e) { + var t = Yt(e).text; + if (-1 !== "lcr".indexOf(t)) return { type: "align", align: t }; + if ("|" === t) return { type: "separator", separator: "|" }; + if (":" === t) return { type: "separator", separator: ":" }; + throw new n("Unknown column alignment: " + t, e); + }), + a = { cols: r, hskipBeforeAndAfter: !0, maxNumCols: r.length }; + return Wr(e.parser, a, _r(e.envName)); + }, + htmlBuilder: jr, + mathmlBuilder: Zr, + }), + Dr({ + type: "array", + names: [ + "matrix", + "pmatrix", + "bmatrix", + "Bmatrix", + "vmatrix", + "Vmatrix", + "matrix*", + "pmatrix*", + "bmatrix*", + "Bmatrix*", + "vmatrix*", + "Vmatrix*", + ], + props: { numArgs: 0 }, + handler: function (e) { + var t = { + matrix: null, + pmatrix: ["(", ")"], + bmatrix: ["[", "]"], + Bmatrix: ["\\{", "\\}"], + vmatrix: ["|", "|"], + Vmatrix: ["\\Vert", "\\Vert"], + }[e.envName.replace("*", "")], + r = "c", + a = { hskipBeforeAndAfter: !1, cols: [{ type: "align", align: r }] }; + if ("*" === e.envName.charAt(e.envName.length - 1)) { + var i = e.parser; + if ((i.consumeSpaces(), "[" === i.fetch().text)) { + if ((i.consume(), i.consumeSpaces(), (r = i.fetch().text), -1 === "lcr".indexOf(r))) + throw new n("Expected l or c or r", i.nextToken); + i.consume(), i.consumeSpaces(), i.expect("]"), i.consume(), (a.cols = [{ type: "align", align: r }]); + } + } + var o = Wr(e.parser, a, _r(e.envName)), + s = Math.max.apply( + Math, + [0].concat( + o.body.map(function (e) { + return e.length; + }), + ), + ); + return ( + (o.cols = new Array(s).fill({ type: "align", align: r })), + t + ? { + type: "leftright", + mode: e.mode, + body: [o], + left: t[0], + right: t[1], + rightColor: void 0, + } + : o + ); + }, + htmlBuilder: jr, + mathmlBuilder: Zr, + }), + Dr({ + type: "array", + names: ["smallmatrix"], + props: { numArgs: 0 }, + handler: function (e) { + var t = Wr(e.parser, { arraystretch: 0.5 }, "script"); + return (t.colSeparationType = "small"), t; + }, + htmlBuilder: jr, + mathmlBuilder: Zr, + }), + Dr({ + type: "array", + names: ["subarray"], + props: { numArgs: 1 }, + handler: function (e, t) { + var r = (Xt(t[0]) ? [t[0]] : Ut(t[0], "ordgroup").body).map(function (e) { + var t = Yt(e).text; + if (-1 !== "lc".indexOf(t)) return { type: "align", align: t }; + throw new n("Unknown column alignment: " + t, e); + }); + if (r.length > 1) throw new n("{subarray} can contain only one column"); + var a = { cols: r, hskipBeforeAndAfter: !1, arraystretch: 0.5 }; + if ((a = Wr(e.parser, a, "script")).body.length > 0 && a.body[0].length > 1) throw new n("{subarray} can contain only one column"); + return a; + }, + htmlBuilder: jr, + mathmlBuilder: Zr, + }), + Dr({ + type: "array", + names: ["cases", "dcases", "rcases", "drcases"], + props: { numArgs: 0 }, + handler: function (e) { + var t = Wr( + e.parser, + { + arraystretch: 1.2, + cols: [ + { type: "align", align: "l", pregap: 0, postgap: 1 }, + { type: "align", align: "l", pregap: 0, postgap: 0 }, + ], + }, + _r(e.envName), + ); + return { + type: "leftright", + mode: e.mode, + body: [t], + left: e.envName.indexOf("r") > -1 ? "." : "\\{", + right: e.envName.indexOf("r") > -1 ? "\\}" : ".", + rightColor: void 0, + }; + }, + htmlBuilder: jr, + mathmlBuilder: Zr, + }), + Dr({ + type: "array", + names: ["align", "align*", "aligned", "split"], + props: { numArgs: 0 }, + handler: Kr, + htmlBuilder: jr, + mathmlBuilder: Zr, + }), + Dr({ + type: "array", + names: ["gathered", "gather", "gather*"], + props: { numArgs: 0 }, + handler: function (e) { + l(["gather", "gather*"], e.envName) && Yr(e); + var t = { + cols: [{ type: "align", align: "c" }], + addJot: !0, + colSeparationType: "gather", + autoTag: Xr(e.envName), + emptySingleRow: !0, + leqno: e.parser.settings.leqno, + }; + return Wr(e.parser, t, "display"); + }, + htmlBuilder: jr, + mathmlBuilder: Zr, + }), + Dr({ + type: "array", + names: ["alignat", "alignat*", "alignedat"], + props: { numArgs: 1 }, + handler: Kr, + htmlBuilder: jr, + mathmlBuilder: Zr, + }), + Dr({ + type: "array", + names: ["equation", "equation*"], + props: { numArgs: 0 }, + handler: function (e) { + Yr(e); + var t = { + autoTag: Xr(e.envName), + emptySingleRow: !0, + singleRow: !0, + maxNumCols: 1, + leqno: e.parser.settings.leqno, + }; + return Wr(e.parser, t, "display"); + }, + htmlBuilder: jr, + mathmlBuilder: Zr, + }), + Dr({ + type: "array", + names: ["CD"], + props: { numArgs: 0 }, + handler: function (e) { + return ( + Yr(e), + (function (e) { + var t = []; + for (e.gullet.beginGroup(), e.gullet.macros.set("\\cr", "\\\\\\relax"), e.gullet.beginGroup(); ; ) { + t.push(e.parseExpression(!1, "\\\\")), e.gullet.endGroup(), e.gullet.beginGroup(); + var r = e.fetch().text; + if ("&" !== r && "\\\\" !== r) { + if ("\\end" === r) { + 0 === t[t.length - 1].length && t.pop(); + break; + } + throw new n("Expected \\\\ or \\cr or \\end", e.nextToken); + } + e.consume(); + } + for (var a, i, o = [], s = [o], l = 0; l < t.length; l++) { + for (var h = t[l], c = { type: "styling", body: [], mode: "math", style: "display" }, m = 0; m < h.length; m++) + if (tr(h[m])) { + o.push(c); + var u = Yt(h[(m += 1)]).text, + p = new Array(2); + if ( + ((p[0] = { type: "ordgroup", mode: "math", body: [] }), + (p[1] = { type: "ordgroup", mode: "math", body: [] }), + "=|.".indexOf(u) > -1) + ); + else { + if (!("<>AV".indexOf(u) > -1)) throw new n('Expected one of "<>AV=|." after @', h[m]); + for (var d = 0; d < 2; d++) { + for (var f = !0, g = m + 1; g < h.length; g++) { + if (((i = u), ("mathord" === (a = h[g]).type || "atom" === a.type) && a.text === i)) { + (f = !1), (m = g); + break; + } + if (tr(h[g])) throw new n("Missing a " + u + " character to complete a CD arrow.", h[g]); + p[d].body.push(h[g]); + } + if (f) throw new n("Missing a " + u + " character to complete a CD arrow.", h[m]); + } + } + var v = { + type: "styling", + body: [rr(u, p, e)], + mode: "math", + style: "display", + }; + o.push(v), (c = { type: "styling", body: [], mode: "math", style: "display" }); + } else c.body.push(h[m]); + l % 2 == 0 ? o.push(c) : o.shift(), (o = []), s.push(o); + } + return ( + e.gullet.endGroup(), + e.gullet.endGroup(), + { + type: "array", + mode: "math", + body: s, + arraystretch: 1, + addJot: !0, + rowGaps: [null], + cols: new Array(s[0].length).fill({ + type: "align", + align: "c", + pregap: 0.25, + postgap: 0.25, + }), + colSeparationType: "CD", + hLinesBeforeRow: new Array(s.length + 1).fill([]), + } + ); + })(e.parser) + ); + }, + htmlBuilder: jr, + mathmlBuilder: Zr, + }), + Vr("\\nonumber", "\\gdef\\@eqnsw{0}"), + Vr("\\notag", "\\nonumber"), + lt({ + type: "text", + names: ["\\hline", "\\hdashline"], + props: { numArgs: 0, allowedInText: !0, allowedInMath: !0 }, + handler: function (e, t) { + throw new n(e.funcName + " valid only within array environment"); + }, + }); + var Jr = Lr; + lt({ + type: "environment", + names: ["\\begin", "\\end"], + props: { numArgs: 1, argTypes: ["text"] }, + handler: function (e, t) { + var r = e.parser, + a = e.funcName, + i = t[0]; + if ("ordgroup" !== i.type) throw new n("Invalid environment name", i); + for (var o = "", s = 0; s < i.body.length; ++s) o += Ut(i.body[s], "textord").text; + if ("\\begin" === a) { + if (!Jr.hasOwnProperty(o)) throw new n("No such environment: " + o, i); + var l = Jr[o], + h = r.parseArguments("\\begin{" + o + "}", l), + c = h.args, + m = h.optArgs, + u = { mode: r.mode, envName: o, parser: r }, + p = l.handler(u, c, m); + r.expect("\\end", !1); + var d = r.nextToken, + f = Ut(r.parseFunction(), "environment"); + if (f.name !== o) throw new n("Mismatch: \\begin{" + o + "} matched by \\end{" + f.name + "}", d); + return p; + } + return { type: "environment", mode: r.mode, name: o, nameGroup: i }; + }, + }); + var Qr = function (e, t) { + var r = e.font, + n = t.withFont(r); + return St(e.body, n); + }, + en = function (e, t) { + var r = e.font, + n = t.withFont(r); + return Ot(e.body, n); + }, + tn = { + "\\Bbb": "\\mathbb", + "\\bold": "\\mathbf", + "\\frak": "\\mathfrak", + "\\bm": "\\boldsymbol", + }; + lt({ + type: "font", + names: [ + "\\mathrm", + "\\mathit", + "\\mathbf", + "\\mathnormal", + "\\mathbb", + "\\mathcal", + "\\mathfrak", + "\\mathscr", + "\\mathsf", + "\\mathtt", + "\\Bbb", + "\\bold", + "\\frak", + ], + props: { numArgs: 1, allowedInArgument: !0 }, + handler: function (e, t) { + var r = e.parser, + n = e.funcName, + a = ct(t[0]), + i = n; + return i in tn && (i = tn[i]), { type: "font", mode: r.mode, font: i.slice(1), body: a }; + }, + htmlBuilder: Qr, + mathmlBuilder: en, + }), + lt({ + type: "mclass", + names: ["\\boldsymbol", "\\bm"], + props: { numArgs: 1 }, + handler: function (e, t) { + var r = e.parser, + n = t[0], + a = p(n); + return { + type: "mclass", + mode: r.mode, + mclass: Qt(n), + body: [{ type: "font", mode: r.mode, font: "boldsymbol", body: n }], + isCharacterBox: a, + }; + }, + }), + lt({ + type: "font", + names: ["\\rm", "\\sf", "\\tt", "\\bf", "\\it", "\\cal"], + props: { numArgs: 0, allowedInText: !0 }, + handler: function (e, t) { + var r = e.parser, + n = e.funcName, + a = e.breakOnTokenText, + i = r.mode, + o = r.parseExpression(!0, a); + return { + type: "font", + mode: i, + font: "math" + n.slice(1), + body: { type: "ordgroup", mode: r.mode, body: o }, + }; + }, + htmlBuilder: Qr, + mathmlBuilder: en, + }); + var rn = function (e, t) { + var r = t; + return ( + "display" === e + ? (r = r.id >= A.SCRIPT.id ? r.text() : A.DISPLAY) + : "text" === e && r.size === A.DISPLAY.size + ? (r = A.TEXT) + : "script" === e + ? (r = A.SCRIPT) + : "scriptscript" === e && (r = A.SCRIPTSCRIPT), + r + ); + }, + nn = function (e, t) { + var r, + n = rn(e.size, t.style), + a = n.fracNum(), + i = n.fracDen(); + r = t.havingStyle(a); + var o = St(e.numer, r, t); + if (e.continued) { + var s = 8.5 / t.fontMetrics().ptPerEm, + l = 3.5 / t.fontMetrics().ptPerEm; + (o.height = o.height < s ? s : o.height), (o.depth = o.depth < l ? l : o.depth); + } + r = t.havingStyle(i); + var h, + c, + m, + u, + p, + d, + f, + g, + v, + y, + b = St(e.denom, r, t); + if ( + (e.hasBarLine + ? (e.barSize ? ((c = X(e.barSize, t)), (h = Qe.makeLineSpan("frac-line", t, c))) : (h = Qe.makeLineSpan("frac-line", t)), + (c = h.height), + (m = h.height)) + : ((h = null), (c = 0), (m = t.fontMetrics().defaultRuleThickness)), + n.size === A.DISPLAY.size || "display" === e.size + ? ((u = t.fontMetrics().num1), (p = c > 0 ? 3 * m : 7 * m), (d = t.fontMetrics().denom1)) + : (c > 0 ? ((u = t.fontMetrics().num2), (p = m)) : ((u = t.fontMetrics().num3), (p = 3 * m)), (d = t.fontMetrics().denom2)), + h) + ) { + var x = t.fontMetrics().axisHeight; + u - o.depth - (x + 0.5 * c) < p && (u += p - (u - o.depth - (x + 0.5 * c))), + x - 0.5 * c - (b.height - d) < p && (d += p - (x - 0.5 * c - (b.height - d))), + (f = Qe.makeVList( + { + positionType: "individualShift", + children: [ + { type: "elem", elem: b, shift: d }, + { type: "elem", elem: h, shift: -(x - 0.5 * c) }, + { type: "elem", elem: o, shift: -u }, + ], + }, + t, + )); + } else { + var w = u - o.depth - (b.height - d); + w < p && ((u += 0.5 * (p - w)), (d += 0.5 * (p - w))), + (f = Qe.makeVList( + { + positionType: "individualShift", + children: [ + { type: "elem", elem: b, shift: d }, + { type: "elem", elem: o, shift: -u }, + ], + }, + t, + )); + } + return ( + (r = t.havingStyle(n)), + (f.height *= r.sizeMultiplier / t.sizeMultiplier), + (f.depth *= r.sizeMultiplier / t.sizeMultiplier), + (g = + n.size === A.DISPLAY.size + ? t.fontMetrics().delim1 + : n.size === A.SCRIPTSCRIPT.size + ? t.havingStyle(A.SCRIPT).fontMetrics().delim2 + : t.fontMetrics().delim2), + (v = null == e.leftDelim ? kt(t, ["mopen"]) : Cr.customSizedDelim(e.leftDelim, g, !0, t.havingStyle(n), e.mode, ["mopen"])), + (y = e.continued + ? Qe.makeSpan([]) + : null == e.rightDelim + ? kt(t, ["mclose"]) + : Cr.customSizedDelim(e.rightDelim, g, !0, t.havingStyle(n), e.mode, ["mclose"])), + Qe.makeSpan(["mord"].concat(r.sizingClasses(t)), [v, Qe.makeSpan(["mfrac"], [f]), y], t) + ); + }, + an = function (e, t) { + var r = new Nt.MathNode("mfrac", [Ot(e.numer, t), Ot(e.denom, t)]); + if (e.hasBarLine) { + if (e.barSize) { + var n = X(e.barSize, t); + r.setAttribute("linethickness", W(n)); + } + } else r.setAttribute("linethickness", "0px"); + var a = rn(e.size, t.style); + if (a.size !== t.style.size) { + r = new Nt.MathNode("mstyle", [r]); + var i = a.size === A.DISPLAY.size ? "true" : "false"; + r.setAttribute("displaystyle", i), r.setAttribute("scriptlevel", "0"); + } + if (null != e.leftDelim || null != e.rightDelim) { + var o = []; + if (null != e.leftDelim) { + var s = new Nt.MathNode("mo", [new Nt.TextNode(e.leftDelim.replace("\\", ""))]); + s.setAttribute("fence", "true"), o.push(s); + } + if ((o.push(r), null != e.rightDelim)) { + var l = new Nt.MathNode("mo", [new Nt.TextNode(e.rightDelim.replace("\\", ""))]); + l.setAttribute("fence", "true"), o.push(l); + } + return qt(o); + } + return r; + }; + lt({ + type: "genfrac", + names: ["\\dfrac", "\\frac", "\\tfrac", "\\dbinom", "\\binom", "\\tbinom", "\\\\atopfrac", "\\\\bracefrac", "\\\\brackfrac"], + props: { numArgs: 2, allowedInArgument: !0 }, + handler: function (e, t) { + var r, + n = e.parser, + a = e.funcName, + i = t[0], + o = t[1], + s = null, + l = null, + h = "auto"; + switch (a) { + case "\\dfrac": + case "\\frac": + case "\\tfrac": + r = !0; + break; + case "\\\\atopfrac": + r = !1; + break; + case "\\dbinom": + case "\\binom": + case "\\tbinom": + (r = !1), (s = "("), (l = ")"); + break; + case "\\\\bracefrac": + (r = !1), (s = "\\{"), (l = "\\}"); + break; + case "\\\\brackfrac": + (r = !1), (s = "["), (l = "]"); + break; + default: + throw new Error("Unrecognized genfrac command"); + } + switch (a) { + case "\\dfrac": + case "\\dbinom": + h = "display"; + break; + case "\\tfrac": + case "\\tbinom": + h = "text"; + } + return { + type: "genfrac", + mode: n.mode, + continued: !1, + numer: i, + denom: o, + hasBarLine: r, + leftDelim: s, + rightDelim: l, + size: h, + barSize: null, + }; + }, + htmlBuilder: nn, + mathmlBuilder: an, + }), + lt({ + type: "genfrac", + names: ["\\cfrac"], + props: { numArgs: 2 }, + handler: function (e, t) { + var r = e.parser, + n = (e.funcName, t[0]), + a = t[1]; + return { + type: "genfrac", + mode: r.mode, + continued: !0, + numer: n, + denom: a, + hasBarLine: !0, + leftDelim: null, + rightDelim: null, + size: "display", + barSize: null, + }; + }, + }), + lt({ + type: "infix", + names: ["\\over", "\\choose", "\\atop", "\\brace", "\\brack"], + props: { numArgs: 0, infix: !0 }, + handler: function (e) { + var t, + r = e.parser, + n = e.funcName, + a = e.token; + switch (n) { + case "\\over": + t = "\\frac"; + break; + case "\\choose": + t = "\\binom"; + break; + case "\\atop": + t = "\\\\atopfrac"; + break; + case "\\brace": + t = "\\\\bracefrac"; + break; + case "\\brack": + t = "\\\\brackfrac"; + break; + default: + throw new Error("Unrecognized infix genfrac command"); + } + return { type: "infix", mode: r.mode, replaceWith: t, token: a }; + }, + }); + var on = ["display", "text", "script", "scriptscript"], + sn = function (e) { + var t = null; + return e.length > 0 && (t = "." === (t = e) ? null : t), t; + }; + lt({ + type: "genfrac", + names: ["\\genfrac"], + props: { + numArgs: 6, + allowedInArgument: !0, + argTypes: ["math", "math", "size", "text", "math", "math"], + }, + handler: function (e, t) { + var r, + n = e.parser, + a = t[4], + i = t[5], + o = ct(t[0]), + s = "atom" === o.type && "open" === o.family ? sn(o.text) : null, + l = ct(t[1]), + h = "atom" === l.type && "close" === l.family ? sn(l.text) : null, + c = Ut(t[2], "size"), + m = null; + r = !!c.isBlank || (m = c.value).number > 0; + var u = "auto", + p = t[3]; + if ("ordgroup" === p.type) { + if (p.body.length > 0) { + var d = Ut(p.body[0], "textord"); + u = on[Number(d.text)]; + } + } else (p = Ut(p, "textord")), (u = on[Number(p.text)]); + return { + type: "genfrac", + mode: n.mode, + numer: a, + denom: i, + continued: !1, + hasBarLine: r, + barSize: m, + leftDelim: s, + rightDelim: h, + size: u, + }; + }, + htmlBuilder: nn, + mathmlBuilder: an, + }), + lt({ + type: "infix", + names: ["\\above"], + props: { numArgs: 1, argTypes: ["size"], infix: !0 }, + handler: function (e, t) { + var r = e.parser, + n = (e.funcName, e.token); + return { + type: "infix", + mode: r.mode, + replaceWith: "\\\\abovefrac", + size: Ut(t[0], "size").value, + token: n, + }; + }, + }), + lt({ + type: "genfrac", + names: ["\\\\abovefrac"], + props: { numArgs: 3, argTypes: ["math", "size", "math"] }, + handler: function (e, t) { + var r = e.parser, + n = (e.funcName, t[0]), + a = (function (e) { + if (!e) throw new Error("Expected non-null, but got " + String(e)); + return e; + })(Ut(t[1], "infix").size), + i = t[2], + o = a.number > 0; + return { + type: "genfrac", + mode: r.mode, + numer: n, + denom: i, + continued: !1, + hasBarLine: o, + barSize: a, + leftDelim: null, + rightDelim: null, + size: "auto", + }; + }, + htmlBuilder: nn, + mathmlBuilder: an, + }); + var ln = function (e, t) { + var r, + n, + a = t.style; + "supsub" === e.type + ? ((r = e.sup ? St(e.sup, t.havingStyle(a.sup()), t) : St(e.sub, t.havingStyle(a.sub()), t)), (n = Ut(e.base, "horizBrace"))) + : (n = Ut(e, "horizBrace")); + var i, + o = St(n.base, t.havingBaseStyle(A.DISPLAY)), + s = Gt(n, t); + if ( + (n.isOver + ? (i = Qe.makeVList( + { + positionType: "firstBaseline", + children: [ + { type: "elem", elem: o }, + { type: "kern", size: 0.1 }, + { type: "elem", elem: s }, + ], + }, + t, + )).children[0].children[0].children[1].classes.push("svg-align") + : (i = Qe.makeVList( + { + positionType: "bottom", + positionData: o.depth + 0.1 + s.height, + children: [ + { type: "elem", elem: s }, + { type: "kern", size: 0.1 }, + { type: "elem", elem: o }, + ], + }, + t, + )).children[0].children[0].children[0].classes.push("svg-align"), + r) + ) { + var l = Qe.makeSpan(["mord", n.isOver ? "mover" : "munder"], [i], t); + i = n.isOver + ? Qe.makeVList( + { + positionType: "firstBaseline", + children: [ + { type: "elem", elem: l }, + { type: "kern", size: 0.2 }, + { type: "elem", elem: r }, + ], + }, + t, + ) + : Qe.makeVList( + { + positionType: "bottom", + positionData: l.depth + 0.2 + r.height + r.depth, + children: [ + { type: "elem", elem: r }, + { type: "kern", size: 0.2 }, + { type: "elem", elem: l }, + ], + }, + t, + ); + } + return Qe.makeSpan(["mord", n.isOver ? "mover" : "munder"], [i], t); + }; + lt({ + type: "horizBrace", + names: ["\\overbrace", "\\underbrace"], + props: { numArgs: 1 }, + handler: function (e, t) { + var r = e.parser, + n = e.funcName; + return { + type: "horizBrace", + mode: r.mode, + label: n, + isOver: /^\\over/.test(n), + base: t[0], + }; + }, + htmlBuilder: ln, + mathmlBuilder: function (e, t) { + var r = Ft(e.label); + return new Nt.MathNode(e.isOver ? "mover" : "munder", [Ot(e.base, t), r]); + }, + }), + lt({ + type: "href", + names: ["\\href"], + props: { numArgs: 2, argTypes: ["url", "original"], allowedInText: !0 }, + handler: function (e, t) { + var r = e.parser, + n = t[1], + a = Ut(t[0], "url").url; + return r.settings.isTrusted({ command: "\\href", url: a }) + ? { type: "href", mode: r.mode, href: a, body: mt(n) } + : r.formatUnsupportedCmd("\\href"); + }, + htmlBuilder: function (e, t) { + var r = vt(e.body, t, !1); + return Qe.makeAnchor(e.href, [], r, t); + }, + mathmlBuilder: function (e, t) { + var r = Ht(e.body, t); + return r instanceof Tt || (r = new Tt("mrow", [r])), r.setAttribute("href", e.href), r; + }, + }), + lt({ + type: "href", + names: ["\\url"], + props: { numArgs: 1, argTypes: ["url"], allowedInText: !0 }, + handler: function (e, t) { + var r = e.parser, + n = Ut(t[0], "url").url; + if (!r.settings.isTrusted({ command: "\\url", url: n })) return r.formatUnsupportedCmd("\\url"); + for (var a = [], i = 0; i < n.length; i++) { + var o = n[i]; + "~" === o && (o = "\\textasciitilde"), a.push({ type: "textord", mode: "text", text: o }); + } + var s = { type: "text", mode: r.mode, font: "\\texttt", body: a }; + return { type: "href", mode: r.mode, href: n, body: mt(s) }; + }, + }), + lt({ + type: "hbox", + names: ["\\hbox"], + props: { numArgs: 1, argTypes: ["text"], allowedInText: !0, primitive: !0 }, + handler: function (e, t) { + return { type: "hbox", mode: e.parser.mode, body: mt(t[0]) }; + }, + htmlBuilder: function (e, t) { + var r = vt(e.body, t, !1); + return Qe.makeFragment(r); + }, + mathmlBuilder: function (e, t) { + return new Nt.MathNode("mrow", Rt(e.body, t)); + }, + }), + lt({ + type: "html", + names: ["\\htmlClass", "\\htmlId", "\\htmlStyle", "\\htmlData"], + props: { numArgs: 2, argTypes: ["raw", "original"], allowedInText: !0 }, + handler: function (e, t) { + var r, + a = e.parser, + i = e.funcName, + o = (e.token, Ut(t[0], "raw").string), + s = t[1]; + a.settings.strict && a.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode"); + var l = {}; + switch (i) { + case "\\htmlClass": + (l.class = o), (r = { command: "\\htmlClass", class: o }); + break; + case "\\htmlId": + (l.id = o), (r = { command: "\\htmlId", id: o }); + break; + case "\\htmlStyle": + (l.style = o), (r = { command: "\\htmlStyle", style: o }); + break; + case "\\htmlData": + for (var h = o.split(","), c = 0; c < h.length; c++) { + var m = h[c].split("="); + if (2 !== m.length) throw new n("Error parsing key-value for \\htmlData"); + l["data-" + m[0].trim()] = m[1].trim(); + } + r = { command: "\\htmlData", attributes: l }; + break; + default: + throw new Error("Unrecognized html command"); + } + return a.settings.isTrusted(r) ? { type: "html", mode: a.mode, attributes: l, body: mt(s) } : a.formatUnsupportedCmd(i); + }, + htmlBuilder: function (e, t) { + var r = vt(e.body, t, !1), + n = ["enclosing"]; + e.attributes.class && n.push.apply(n, e.attributes.class.trim().split(/\s+/)); + var a = Qe.makeSpan(n, r, t); + for (var i in e.attributes) "class" !== i && e.attributes.hasOwnProperty(i) && a.setAttribute(i, e.attributes[i]); + return a; + }, + mathmlBuilder: function (e, t) { + return Ht(e.body, t); + }, + }), + lt({ + type: "htmlmathml", + names: ["\\html@mathml"], + props: { numArgs: 2, allowedInText: !0 }, + handler: function (e, t) { + return { + type: "htmlmathml", + mode: e.parser.mode, + html: mt(t[0]), + mathml: mt(t[1]), + }; + }, + htmlBuilder: function (e, t) { + var r = vt(e.html, t, !1); + return Qe.makeFragment(r); + }, + mathmlBuilder: function (e, t) { + return Ht(e.mathml, t); + }, + }); + var hn = function (e) { + if (/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e)) return { number: +e, unit: "bp" }; + var t = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e); + if (!t) throw new n("Invalid size: '" + e + "' in \\includegraphics"); + var r = { number: +(t[1] + t[2]), unit: t[3] }; + if (!Y(r)) throw new n("Invalid unit: '" + r.unit + "' in \\includegraphics."); + return r; + }; + lt({ + type: "includegraphics", + names: ["\\includegraphics"], + props: { + numArgs: 1, + numOptionalArgs: 1, + argTypes: ["raw", "url"], + allowedInText: !1, + }, + handler: function (e, t, r) { + var a = e.parser, + i = { number: 0, unit: "em" }, + o = { number: 0.9, unit: "em" }, + s = { number: 0, unit: "em" }, + l = ""; + if (r[0]) + for (var h = Ut(r[0], "raw").string.split(","), c = 0; c < h.length; c++) { + var m = h[c].split("="); + if (2 === m.length) { + var u = m[1].trim(); + switch (m[0].trim()) { + case "alt": + l = u; + break; + case "width": + i = hn(u); + break; + case "height": + o = hn(u); + break; + case "totalheight": + s = hn(u); + break; + default: + throw new n("Invalid key: '" + m[0] + "' in \\includegraphics."); + } + } + } + var p = Ut(t[0], "url").url; + return ( + "" === l && (l = (l = (l = p).replace(/^.*[\\/]/, "")).substring(0, l.lastIndexOf("."))), + a.settings.isTrusted({ command: "\\includegraphics", url: p }) + ? { + type: "includegraphics", + mode: a.mode, + alt: l, + width: i, + height: o, + totalheight: s, + src: p, + } + : a.formatUnsupportedCmd("\\includegraphics") + ); + }, + htmlBuilder: function (e, t) { + var r = X(e.height, t), + n = 0; + e.totalheight.number > 0 && (n = X(e.totalheight, t) - r); + var a = 0; + e.width.number > 0 && (a = X(e.width, t)); + var i = { height: W(r + n) }; + a > 0 && (i.width = W(a)), n > 0 && (i.verticalAlign = W(-n)); + var o = new Q(e.src, e.alt, i); + return (o.height = r), (o.depth = n), o; + }, + mathmlBuilder: function (e, t) { + var r = new Nt.MathNode("mglyph", []); + r.setAttribute("alt", e.alt); + var n = X(e.height, t), + a = 0; + if ( + (e.totalheight.number > 0 && ((a = X(e.totalheight, t) - n), r.setAttribute("valign", W(-a))), + r.setAttribute("height", W(n + a)), + e.width.number > 0) + ) { + var i = X(e.width, t); + r.setAttribute("width", W(i)); + } + return r.setAttribute("src", e.src), r; + }, + }), + lt({ + type: "kern", + names: ["\\kern", "\\mkern", "\\hskip", "\\mskip"], + props: { numArgs: 1, argTypes: ["size"], primitive: !0, allowedInText: !0 }, + handler: function (e, t) { + var r = e.parser, + n = e.funcName, + a = Ut(t[0], "size"); + if (r.settings.strict) { + var i = "m" === n[1], + o = "mu" === a.value.unit; + i + ? (o || + r.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + n + " supports only mu units, not " + a.value.unit + " units"), + "math" !== r.mode && r.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + n + " works only in math mode")) + : o && r.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + n + " doesn't support mu units"); + } + return { type: "kern", mode: r.mode, dimension: a.value }; + }, + htmlBuilder: function (e, t) { + return Qe.makeGlue(e.dimension, t); + }, + mathmlBuilder: function (e, t) { + var r = X(e.dimension, t); + return new Nt.SpaceNode(r); + }, + }), + lt({ + type: "lap", + names: ["\\mathllap", "\\mathrlap", "\\mathclap"], + props: { numArgs: 1, allowedInText: !0 }, + handler: function (e, t) { + var r = e.parser, + n = e.funcName, + a = t[0]; + return { type: "lap", mode: r.mode, alignment: n.slice(5), body: a }; + }, + htmlBuilder: function (e, t) { + var r; + "clap" === e.alignment + ? ((r = Qe.makeSpan([], [St(e.body, t)])), (r = Qe.makeSpan(["inner"], [r], t))) + : (r = Qe.makeSpan(["inner"], [St(e.body, t)])); + var n = Qe.makeSpan(["fix"], []), + a = Qe.makeSpan([e.alignment], [r, n], t), + i = Qe.makeSpan(["strut"]); + return ( + (i.style.height = W(a.height + a.depth)), + a.depth && (i.style.verticalAlign = W(-a.depth)), + a.children.unshift(i), + (a = Qe.makeSpan(["thinbox"], [a], t)), + Qe.makeSpan(["mord", "vbox"], [a], t) + ); + }, + mathmlBuilder: function (e, t) { + var r = new Nt.MathNode("mpadded", [Ot(e.body, t)]); + if ("rlap" !== e.alignment) { + var n = "llap" === e.alignment ? "-1" : "-0.5"; + r.setAttribute("lspace", n + "width"); + } + return r.setAttribute("width", "0px"), r; + }, + }), + lt({ + type: "styling", + names: ["\\(", "$"], + props: { numArgs: 0, allowedInText: !0, allowedInMath: !1 }, + handler: function (e, t) { + var r = e.funcName, + n = e.parser, + a = n.mode; + n.switchMode("math"); + var i = "\\(" === r ? "\\)" : "$", + o = n.parseExpression(!1, i); + return n.expect(i), n.switchMode(a), { type: "styling", mode: n.mode, style: "text", body: o }; + }, + }), + lt({ + type: "text", + names: ["\\)", "\\]"], + props: { numArgs: 0, allowedInText: !0, allowedInMath: !1 }, + handler: function (e, t) { + throw new n("Mismatched " + e.funcName); + }, + }); + var cn = function (e, t) { + switch (t.style.size) { + case A.DISPLAY.size: + return e.display; + case A.TEXT.size: + return e.text; + case A.SCRIPT.size: + return e.script; + case A.SCRIPTSCRIPT.size: + return e.scriptscript; + default: + return e.text; + } + }; + lt({ + type: "mathchoice", + names: ["\\mathchoice"], + props: { numArgs: 4, primitive: !0 }, + handler: function (e, t) { + return { + type: "mathchoice", + mode: e.parser.mode, + display: mt(t[0]), + text: mt(t[1]), + script: mt(t[2]), + scriptscript: mt(t[3]), + }; + }, + htmlBuilder: function (e, t) { + var r = cn(e, t), + n = vt(r, t, !1); + return Qe.makeFragment(n); + }, + mathmlBuilder: function (e, t) { + var r = cn(e, t); + return Ht(r, t); + }, + }); + var mn = function (e, t, r, n, a, i, o) { + e = Qe.makeSpan([], [e]); + var s, + l, + h, + c = r && p(r); + if (t) { + var m = St(t, n.havingStyle(a.sup()), n); + l = { + elem: m, + kern: Math.max(n.fontMetrics().bigOpSpacing1, n.fontMetrics().bigOpSpacing3 - m.depth), + }; + } + if (r) { + var u = St(r, n.havingStyle(a.sub()), n); + s = { + elem: u, + kern: Math.max(n.fontMetrics().bigOpSpacing2, n.fontMetrics().bigOpSpacing4 - u.height), + }; + } + if (l && s) { + var d = n.fontMetrics().bigOpSpacing5 + s.elem.height + s.elem.depth + s.kern + e.depth + o; + h = Qe.makeVList( + { + positionType: "bottom", + positionData: d, + children: [ + { type: "kern", size: n.fontMetrics().bigOpSpacing5 }, + { type: "elem", elem: s.elem, marginLeft: W(-i) }, + { type: "kern", size: s.kern }, + { type: "elem", elem: e }, + { type: "kern", size: l.kern }, + { type: "elem", elem: l.elem, marginLeft: W(i) }, + { type: "kern", size: n.fontMetrics().bigOpSpacing5 }, + ], + }, + n, + ); + } else if (s) { + var f = e.height - o; + h = Qe.makeVList( + { + positionType: "top", + positionData: f, + children: [ + { type: "kern", size: n.fontMetrics().bigOpSpacing5 }, + { type: "elem", elem: s.elem, marginLeft: W(-i) }, + { type: "kern", size: s.kern }, + { type: "elem", elem: e }, + ], + }, + n, + ); + } else { + if (!l) return e; + var g = e.depth + o; + h = Qe.makeVList( + { + positionType: "bottom", + positionData: g, + children: [ + { type: "elem", elem: e }, + { type: "kern", size: l.kern }, + { type: "elem", elem: l.elem, marginLeft: W(i) }, + { type: "kern", size: n.fontMetrics().bigOpSpacing5 }, + ], + }, + n, + ); + } + var v = [h]; + if (s && 0 !== i && !c) { + var y = Qe.makeSpan(["mspace"], [], n); + (y.style.marginRight = W(i)), v.unshift(y); + } + return Qe.makeSpan(["mop", "op-limits"], v, n); + }, + un = ["\\smallint"], + pn = function (e, t) { + var r, + n, + a, + i = !1; + "supsub" === e.type ? ((r = e.sup), (n = e.sub), (a = Ut(e.base, "op")), (i = !0)) : (a = Ut(e, "op")); + var o, + s = t.style, + h = !1; + if ((s.size === A.DISPLAY.size && a.symbol && !l(un, a.name) && (h = !0), a.symbol)) { + var c = h ? "Size2-Regular" : "Size1-Regular", + m = ""; + if ( + (("\\oiint" !== a.name && "\\oiiint" !== a.name) || ((m = a.name.slice(1)), (a.name = "oiint" === m ? "\\iint" : "\\iiint")), + (o = Qe.makeSymbol(a.name, c, "math", t, ["mop", "op-symbol", h ? "large-op" : "small-op"])), + m.length > 0) + ) { + var u = o.italic, + p = Qe.staticSvg(m + "Size" + (h ? "2" : "1"), t); + (o = Qe.makeVList( + { + positionType: "individualShift", + children: [ + { type: "elem", elem: o, shift: 0 }, + { type: "elem", elem: p, shift: h ? 0.08 : 0 }, + ], + }, + t, + )), + (a.name = "\\" + m), + o.classes.unshift("mop"), + (o.italic = u); + } + } else if (a.body) { + var d = vt(a.body, t, !0); + 1 === d.length && d[0] instanceof te ? ((o = d[0]).classes[0] = "mop") : (o = Qe.makeSpan(["mop"], d, t)); + } else { + for (var f = [], g = 1; g < a.name.length; g++) f.push(Qe.mathsym(a.name[g], a.mode, t)); + o = Qe.makeSpan(["mop"], f, t); + } + var v = 0, + y = 0; + return ( + (o instanceof te || "\\oiint" === a.name || "\\oiiint" === a.name) && + !a.suppressBaseShift && + ((v = (o.height - o.depth) / 2 - t.fontMetrics().axisHeight), (y = o.italic)), + i ? mn(o, r, n, t, s, y, v) : (v && ((o.style.position = "relative"), (o.style.top = W(v))), o) + ); + }, + dn = function (e, t) { + var r; + if (e.symbol) (r = new Tt("mo", [Ct(e.name, e.mode)])), l(un, e.name) && r.setAttribute("largeop", "false"); + else if (e.body) r = new Tt("mo", Rt(e.body, t)); + else { + r = new Tt("mi", [new Bt(e.name.slice(1))]); + var n = new Tt("mo", [Ct("⁡", "text")]); + r = e.parentIsSupSub ? new Tt("mrow", [r, n]) : At([r, n]); + } + return r; + }, + fn = { + "∏": "\\prod", + "∐": "\\coprod", + "∑": "\\sum", + "⋀": "\\bigwedge", + "⋁": "\\bigvee", + "⋂": "\\bigcap", + "⋃": "\\bigcup", + "⨀": "\\bigodot", + "⨁": "\\bigoplus", + "⨂": "\\bigotimes", + "⨄": "\\biguplus", + "⨆": "\\bigsqcup", + }; + lt({ + type: "op", + names: [ + "\\coprod", + "\\bigvee", + "\\bigwedge", + "\\biguplus", + "\\bigcap", + "\\bigcup", + "\\intop", + "\\prod", + "\\sum", + "\\bigotimes", + "\\bigoplus", + "\\bigodot", + "\\bigsqcup", + "\\smallint", + "∏", + "∐", + "∑", + "⋀", + "⋁", + "⋂", + "⋃", + "⨀", + "⨁", + "⨂", + "⨄", + "⨆", + ], + props: { numArgs: 0 }, + handler: function (e, t) { + var r = e.parser, + n = e.funcName; + return 1 === n.length && (n = fn[n]), { type: "op", mode: r.mode, limits: !0, parentIsSupSub: !1, symbol: !0, name: n }; + }, + htmlBuilder: pn, + mathmlBuilder: dn, + }), + lt({ + type: "op", + names: ["\\mathop"], + props: { numArgs: 1, primitive: !0 }, + handler: function (e, t) { + var r = e.parser, + n = t[0]; + return { + type: "op", + mode: r.mode, + limits: !1, + parentIsSupSub: !1, + symbol: !1, + body: mt(n), + }; + }, + htmlBuilder: pn, + mathmlBuilder: dn, + }); + var gn = { + "∫": "\\int", + "∬": "\\iint", + "∭": "\\iiint", + "∮": "\\oint", + "∯": "\\oiint", + "∰": "\\oiiint", + }; + lt({ + type: "op", + names: [ + "\\arcsin", + "\\arccos", + "\\arctan", + "\\arctg", + "\\arcctg", + "\\arg", + "\\ch", + "\\cos", + "\\cosec", + "\\cosh", + "\\cot", + "\\cotg", + "\\coth", + "\\csc", + "\\ctg", + "\\cth", + "\\deg", + "\\dim", + "\\exp", + "\\hom", + "\\ker", + "\\lg", + "\\ln", + "\\log", + "\\sec", + "\\sin", + "\\sinh", + "\\sh", + "\\tan", + "\\tanh", + "\\tg", + "\\th", + ], + props: { numArgs: 0 }, + handler: function (e) { + var t = e.parser, + r = e.funcName; + return { + type: "op", + mode: t.mode, + limits: !1, + parentIsSupSub: !1, + symbol: !1, + name: r, + }; + }, + htmlBuilder: pn, + mathmlBuilder: dn, + }), + lt({ + type: "op", + names: ["\\det", "\\gcd", "\\inf", "\\lim", "\\max", "\\min", "\\Pr", "\\sup"], + props: { numArgs: 0 }, + handler: function (e) { + var t = e.parser, + r = e.funcName; + return { + type: "op", + mode: t.mode, + limits: !0, + parentIsSupSub: !1, + symbol: !1, + name: r, + }; + }, + htmlBuilder: pn, + mathmlBuilder: dn, + }), + lt({ + type: "op", + names: ["\\int", "\\iint", "\\iiint", "\\oint", "\\oiint", "\\oiiint", "∫", "∬", "∭", "∮", "∯", "∰"], + props: { numArgs: 0 }, + handler: function (e) { + var t = e.parser, + r = e.funcName; + return ( + 1 === r.length && (r = gn[r]), + { + type: "op", + mode: t.mode, + limits: !1, + parentIsSupSub: !1, + symbol: !0, + name: r, + } + ); + }, + htmlBuilder: pn, + mathmlBuilder: dn, + }); + var vn = function (e, t) { + var r, + n, + a, + i, + o = !1; + if ( + ("supsub" === e.type ? ((r = e.sup), (n = e.sub), (a = Ut(e.base, "operatorname")), (o = !0)) : (a = Ut(e, "operatorname")), + a.body.length > 0) + ) { + for ( + var s = a.body.map(function (e) { + var t = e.text; + return "string" == typeof t ? { type: "textord", mode: e.mode, text: t } : e; + }), + l = vt(s, t.withFont("mathrm"), !0), + h = 0; + h < l.length; + h++ + ) { + var c = l[h]; + c instanceof te && (c.text = c.text.replace(/\u2212/, "-").replace(/\u2217/, "*")); + } + i = Qe.makeSpan(["mop"], l, t); + } else i = Qe.makeSpan(["mop"], [], t); + return o ? mn(i, r, n, t, t.style, 0, 0) : i; + }; + function yn(e, t, r) { + for (var n = vt(e, t, !1), a = t.sizeMultiplier / r.sizeMultiplier, i = 0; i < n.length; i++) { + var o = n[i].classes.indexOf("sizing"); + o < 0 + ? Array.prototype.push.apply(n[i].classes, t.sizingClasses(r)) + : n[i].classes[o + 1] === "reset-size" + t.size && (n[i].classes[o + 1] = "reset-size" + r.size), + (n[i].height *= a), + (n[i].depth *= a); + } + return Qe.makeFragment(n); + } + lt({ + type: "operatorname", + names: ["\\operatorname@", "\\operatornamewithlimits"], + props: { numArgs: 1 }, + handler: function (e, t) { + var r = e.parser, + n = e.funcName, + a = t[0]; + return { + type: "operatorname", + mode: r.mode, + body: mt(a), + alwaysHandleSupSub: "\\operatornamewithlimits" === n, + limits: !1, + parentIsSupSub: !1, + }; + }, + htmlBuilder: vn, + mathmlBuilder: function (e, t) { + for (var r = Rt(e.body, t.withFont("mathrm")), n = !0, a = 0; a < r.length; a++) { + var i = r[a]; + if (i instanceof Nt.SpaceNode); + else if (i instanceof Nt.MathNode) + switch (i.type) { + case "mi": + case "mn": + case "ms": + case "mspace": + case "mtext": + break; + case "mo": + var o = i.children[0]; + 1 === i.children.length && o instanceof Nt.TextNode + ? (o.text = o.text.replace(/\u2212/, "-").replace(/\u2217/, "*")) + : (n = !1); + break; + default: + n = !1; + } + else n = !1; + } + if (n) { + var s = r + .map(function (e) { + return e.toText(); + }) + .join(""); + r = [new Nt.TextNode(s)]; + } + var l = new Nt.MathNode("mi", r); + l.setAttribute("mathvariant", "normal"); + var h = new Nt.MathNode("mo", [Ct("⁡", "text")]); + return e.parentIsSupSub ? new Nt.MathNode("mrow", [l, h]) : Nt.newDocumentFragment([l, h]); + }, + }), + Vr("\\operatorname", "\\@ifstar\\operatornamewithlimits\\operatorname@"), + ht({ + type: "ordgroup", + htmlBuilder: function (e, t) { + return e.semisimple ? Qe.makeFragment(vt(e.body, t, !1)) : Qe.makeSpan(["mord"], vt(e.body, t, !0), t); + }, + mathmlBuilder: function (e, t) { + return Ht(e.body, t, !0); + }, + }), + lt({ + type: "overline", + names: ["\\overline"], + props: { numArgs: 1 }, + handler: function (e, t) { + var r = e.parser, + n = t[0]; + return { type: "overline", mode: r.mode, body: n }; + }, + htmlBuilder: function (e, t) { + var r = St(e.body, t.havingCrampedStyle()), + n = Qe.makeLineSpan("overline-line", t), + a = t.fontMetrics().defaultRuleThickness, + i = Qe.makeVList( + { + positionType: "firstBaseline", + children: [ + { type: "elem", elem: r }, + { type: "kern", size: 3 * a }, + { type: "elem", elem: n }, + { type: "kern", size: a }, + ], + }, + t, + ); + return Qe.makeSpan(["mord", "overline"], [i], t); + }, + mathmlBuilder: function (e, t) { + var r = new Nt.MathNode("mo", [new Nt.TextNode("‾")]); + r.setAttribute("stretchy", "true"); + var n = new Nt.MathNode("mover", [Ot(e.body, t), r]); + return n.setAttribute("accent", "true"), n; + }, + }), + lt({ + type: "phantom", + names: ["\\phantom"], + props: { numArgs: 1, allowedInText: !0 }, + handler: function (e, t) { + var r = e.parser, + n = t[0]; + return { type: "phantom", mode: r.mode, body: mt(n) }; + }, + htmlBuilder: function (e, t) { + var r = vt(e.body, t.withPhantom(), !1); + return Qe.makeFragment(r); + }, + mathmlBuilder: function (e, t) { + var r = Rt(e.body, t); + return new Nt.MathNode("mphantom", r); + }, + }), + lt({ + type: "hphantom", + names: ["\\hphantom"], + props: { numArgs: 1, allowedInText: !0 }, + handler: function (e, t) { + var r = e.parser, + n = t[0]; + return { type: "hphantom", mode: r.mode, body: n }; + }, + htmlBuilder: function (e, t) { + var r = Qe.makeSpan([], [St(e.body, t.withPhantom())]); + if (((r.height = 0), (r.depth = 0), r.children)) + for (var n = 0; n < r.children.length; n++) (r.children[n].height = 0), (r.children[n].depth = 0); + return ( + (r = Qe.makeVList({ positionType: "firstBaseline", children: [{ type: "elem", elem: r }] }, t)), Qe.makeSpan(["mord"], [r], t) + ); + }, + mathmlBuilder: function (e, t) { + var r = Rt(mt(e.body), t), + n = new Nt.MathNode("mphantom", r), + a = new Nt.MathNode("mpadded", [n]); + return a.setAttribute("height", "0px"), a.setAttribute("depth", "0px"), a; + }, + }), + lt({ + type: "vphantom", + names: ["\\vphantom"], + props: { numArgs: 1, allowedInText: !0 }, + handler: function (e, t) { + var r = e.parser, + n = t[0]; + return { type: "vphantom", mode: r.mode, body: n }; + }, + htmlBuilder: function (e, t) { + var r = Qe.makeSpan(["inner"], [St(e.body, t.withPhantom())]), + n = Qe.makeSpan(["fix"], []); + return Qe.makeSpan(["mord", "rlap"], [r, n], t); + }, + mathmlBuilder: function (e, t) { + var r = Rt(mt(e.body), t), + n = new Nt.MathNode("mphantom", r), + a = new Nt.MathNode("mpadded", [n]); + return a.setAttribute("width", "0px"), a; + }, + }), + lt({ + type: "raisebox", + names: ["\\raisebox"], + props: { numArgs: 2, argTypes: ["size", "hbox"], allowedInText: !0 }, + handler: function (e, t) { + var r = e.parser, + n = Ut(t[0], "size").value, + a = t[1]; + return { type: "raisebox", mode: r.mode, dy: n, body: a }; + }, + htmlBuilder: function (e, t) { + var r = St(e.body, t), + n = X(e.dy, t); + return Qe.makeVList( + { + positionType: "shift", + positionData: -n, + children: [{ type: "elem", elem: r }], + }, + t, + ); + }, + mathmlBuilder: function (e, t) { + var r = new Nt.MathNode("mpadded", [Ot(e.body, t)]), + n = e.dy.number + e.dy.unit; + return r.setAttribute("voffset", n), r; + }, + }), + lt({ + type: "internal", + names: ["\\relax"], + props: { numArgs: 0, allowedInText: !0 }, + handler: function (e) { + return { type: "internal", mode: e.parser.mode }; + }, + }), + lt({ + type: "rule", + names: ["\\rule"], + props: { numArgs: 2, numOptionalArgs: 1, argTypes: ["size", "size", "size"] }, + handler: function (e, t, r) { + var n = e.parser, + a = r[0], + i = Ut(t[0], "size"), + o = Ut(t[1], "size"); + return { + type: "rule", + mode: n.mode, + shift: a && Ut(a, "size").value, + width: i.value, + height: o.value, + }; + }, + htmlBuilder: function (e, t) { + var r = Qe.makeSpan(["mord", "rule"], [], t), + n = X(e.width, t), + a = X(e.height, t), + i = e.shift ? X(e.shift, t) : 0; + return ( + (r.style.borderRightWidth = W(n)), + (r.style.borderTopWidth = W(a)), + (r.style.bottom = W(i)), + (r.width = n), + (r.height = a + i), + (r.depth = -i), + (r.maxFontSize = 1.125 * a * t.sizeMultiplier), + r + ); + }, + mathmlBuilder: function (e, t) { + var r = X(e.width, t), + n = X(e.height, t), + a = e.shift ? X(e.shift, t) : 0, + i = (t.color && t.getColor()) || "black", + o = new Nt.MathNode("mspace"); + o.setAttribute("mathbackground", i), o.setAttribute("width", W(r)), o.setAttribute("height", W(n)); + var s = new Nt.MathNode("mpadded", [o]); + return ( + a >= 0 ? s.setAttribute("height", W(a)) : (s.setAttribute("height", W(a)), s.setAttribute("depth", W(-a))), + s.setAttribute("voffset", W(a)), + s + ); + }, + }); + var bn = [ + "\\tiny", + "\\sixptsize", + "\\scriptsize", + "\\footnotesize", + "\\small", + "\\normalsize", + "\\large", + "\\Large", + "\\LARGE", + "\\huge", + "\\Huge", + ]; + lt({ + type: "sizing", + names: bn, + props: { numArgs: 0, allowedInText: !0 }, + handler: function (e, t) { + var r = e.breakOnTokenText, + n = e.funcName, + a = e.parser, + i = a.parseExpression(!1, r); + return { type: "sizing", mode: a.mode, size: bn.indexOf(n) + 1, body: i }; + }, + htmlBuilder: function (e, t) { + var r = t.havingSize(e.size); + return yn(e.body, r, t); + }, + mathmlBuilder: function (e, t) { + var r = t.havingSize(e.size), + n = Rt(e.body, r), + a = new Nt.MathNode("mstyle", n); + return a.setAttribute("mathsize", W(r.sizeMultiplier)), a; + }, + }), + lt({ + type: "smash", + names: ["\\smash"], + props: { numArgs: 1, numOptionalArgs: 1, allowedInText: !0 }, + handler: function (e, t, r) { + var n = e.parser, + a = !1, + i = !1, + o = r[0] && Ut(r[0], "ordgroup"); + if (o) + for (var s = "", l = 0; l < o.body.length; ++l) + if ("t" === (s = o.body[l].text)) a = !0; + else { + if ("b" !== s) { + (a = !1), (i = !1); + break; + } + i = !0; + } + else (a = !0), (i = !0); + var h = t[0]; + return { type: "smash", mode: n.mode, body: h, smashHeight: a, smashDepth: i }; + }, + htmlBuilder: function (e, t) { + var r = Qe.makeSpan([], [St(e.body, t)]); + if (!e.smashHeight && !e.smashDepth) return r; + if (e.smashHeight && ((r.height = 0), r.children)) for (var n = 0; n < r.children.length; n++) r.children[n].height = 0; + if (e.smashDepth && ((r.depth = 0), r.children)) for (var a = 0; a < r.children.length; a++) r.children[a].depth = 0; + var i = Qe.makeVList({ positionType: "firstBaseline", children: [{ type: "elem", elem: r }] }, t); + return Qe.makeSpan(["mord"], [i], t); + }, + mathmlBuilder: function (e, t) { + var r = new Nt.MathNode("mpadded", [Ot(e.body, t)]); + return e.smashHeight && r.setAttribute("height", "0px"), e.smashDepth && r.setAttribute("depth", "0px"), r; + }, + }), + lt({ + type: "sqrt", + names: ["\\sqrt"], + props: { numArgs: 1, numOptionalArgs: 1 }, + handler: function (e, t, r) { + var n = e.parser, + a = r[0], + i = t[0]; + return { type: "sqrt", mode: n.mode, body: i, index: a }; + }, + htmlBuilder: function (e, t) { + var r = St(e.body, t.havingCrampedStyle()); + 0 === r.height && (r.height = t.fontMetrics().xHeight), (r = Qe.wrapFragment(r, t)); + var n = t.fontMetrics().defaultRuleThickness, + a = n; + t.style.id < A.TEXT.id && (a = t.fontMetrics().xHeight); + var i = n + a / 4, + o = r.height + r.depth + i + n, + s = Cr.sqrtImage(o, t), + l = s.span, + h = s.ruleWidth, + c = s.advanceWidth, + m = l.height - h; + m > r.height + r.depth + i && (i = (i + m - r.height - r.depth) / 2); + var u = l.height - r.height - i - h; + r.style.paddingLeft = W(c); + var p = Qe.makeVList( + { + positionType: "firstBaseline", + children: [ + { type: "elem", elem: r, wrapperClasses: ["svg-align"] }, + { type: "kern", size: -(r.height + u) }, + { type: "elem", elem: l }, + { type: "kern", size: h }, + ], + }, + t, + ); + if (e.index) { + var d = t.havingStyle(A.SCRIPTSCRIPT), + f = St(e.index, d, t), + g = 0.6 * (p.height - p.depth), + v = Qe.makeVList( + { + positionType: "shift", + positionData: -g, + children: [{ type: "elem", elem: f }], + }, + t, + ), + y = Qe.makeSpan(["root"], [v]); + return Qe.makeSpan(["mord", "sqrt"], [y, p], t); + } + return Qe.makeSpan(["mord", "sqrt"], [p], t); + }, + mathmlBuilder: function (e, t) { + var r = e.body, + n = e.index; + return n ? new Nt.MathNode("mroot", [Ot(r, t), Ot(n, t)]) : new Nt.MathNode("msqrt", [Ot(r, t)]); + }, + }); + var xn = { + display: A.DISPLAY, + text: A.TEXT, + script: A.SCRIPT, + scriptscript: A.SCRIPTSCRIPT, + }; + lt({ + type: "styling", + names: ["\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"], + props: { numArgs: 0, allowedInText: !0, primitive: !0 }, + handler: function (e, t) { + var r = e.breakOnTokenText, + n = e.funcName, + a = e.parser, + i = a.parseExpression(!0, r), + o = n.slice(1, n.length - 5); + return { type: "styling", mode: a.mode, style: o, body: i }; + }, + htmlBuilder: function (e, t) { + var r = xn[e.style], + n = t.havingStyle(r).withFont(""); + return yn(e.body, n, t); + }, + mathmlBuilder: function (e, t) { + var r = xn[e.style], + n = t.havingStyle(r), + a = Rt(e.body, n), + i = new Nt.MathNode("mstyle", a), + o = { + display: ["0", "true"], + text: ["0", "false"], + script: ["1", "false"], + scriptscript: ["2", "false"], + }[e.style]; + return i.setAttribute("scriptlevel", o[0]), i.setAttribute("displaystyle", o[1]), i; + }, + }); + ht({ + type: "supsub", + htmlBuilder: function (e, t) { + var r = (function (e, t) { + var r = e.base; + return r + ? "op" === r.type + ? r.limits && (t.style.size === A.DISPLAY.size || r.alwaysHandleSupSub) + ? pn + : null + : "operatorname" === r.type + ? r.alwaysHandleSupSub && (t.style.size === A.DISPLAY.size || r.limits) + ? vn + : null + : "accent" === r.type + ? p(r.base) + ? Wt + : null + : "horizBrace" === r.type && !e.sub === r.isOver + ? ln + : null + : null; + })(e, t); + if (r) return r(e, t); + var n, + a, + i, + o = e.base, + s = e.sup, + l = e.sub, + h = St(o, t), + c = t.fontMetrics(), + m = 0, + u = 0, + d = o && p(o); + if (s) { + var f = t.havingStyle(t.style.sup()); + (n = St(s, f, t)), d || (m = h.height - (f.fontMetrics().supDrop * f.sizeMultiplier) / t.sizeMultiplier); + } + if (l) { + var g = t.havingStyle(t.style.sub()); + (a = St(l, g, t)), d || (u = h.depth + (g.fontMetrics().subDrop * g.sizeMultiplier) / t.sizeMultiplier); + } + i = t.style === A.DISPLAY ? c.sup1 : t.style.cramped ? c.sup3 : c.sup2; + var v, + y = t.sizeMultiplier, + b = W(0.5 / c.ptPerEm / y), + x = null; + if (a) { + var w = e.base && "op" === e.base.type && e.base.name && ("\\oiint" === e.base.name || "\\oiiint" === e.base.name); + (h instanceof te || w) && (x = W(-h.italic)); + } + if (n && a) { + (m = Math.max(m, i, n.depth + 0.25 * c.xHeight)), (u = Math.max(u, c.sub2)); + var k = 4 * c.defaultRuleThickness; + if (m - n.depth - (a.height - u) < k) { + u = k - (m - n.depth) + a.height; + var S = 0.8 * c.xHeight - (m - n.depth); + S > 0 && ((m += S), (u -= S)); + } + v = Qe.makeVList( + { + positionType: "individualShift", + children: [ + { type: "elem", elem: a, shift: u, marginRight: b, marginLeft: x }, + { type: "elem", elem: n, shift: -m, marginRight: b }, + ], + }, + t, + ); + } else if (a) { + (u = Math.max(u, c.sub1, a.height - 0.8 * c.xHeight)), + (v = Qe.makeVList( + { + positionType: "shift", + positionData: u, + children: [{ type: "elem", elem: a, marginLeft: x, marginRight: b }], + }, + t, + )); + } else { + if (!n) throw new Error("supsub must have either sup or sub."); + (m = Math.max(m, i, n.depth + 0.25 * c.xHeight)), + (v = Qe.makeVList( + { + positionType: "shift", + positionData: -m, + children: [{ type: "elem", elem: n, marginRight: b }], + }, + t, + )); + } + var M = wt(h, "right") || "mord"; + return Qe.makeSpan([M], [h, Qe.makeSpan(["msupsub"], [v])], t); + }, + mathmlBuilder: function (e, t) { + var r, + n = !1; + e.base && "horizBrace" === e.base.type && !!e.sup === e.base.isOver && ((n = !0), (r = e.base.isOver)), + !e.base || ("op" !== e.base.type && "operatorname" !== e.base.type) || (e.base.parentIsSupSub = !0); + var a, + i = [Ot(e.base, t)]; + if ((e.sub && i.push(Ot(e.sub, t)), e.sup && i.push(Ot(e.sup, t)), n)) a = r ? "mover" : "munder"; + else if (e.sub) + if (e.sup) { + var o = e.base; + a = + (o && "op" === o.type && o.limits && t.style === A.DISPLAY) || + (o && "operatorname" === o.type && o.alwaysHandleSupSub && (t.style === A.DISPLAY || o.limits)) + ? "munderover" + : "msubsup"; + } else { + var s = e.base; + a = + (s && "op" === s.type && s.limits && (t.style === A.DISPLAY || s.alwaysHandleSupSub)) || + (s && "operatorname" === s.type && s.alwaysHandleSupSub && (s.limits || t.style === A.DISPLAY)) + ? "munder" + : "msub"; + } + else { + var l = e.base; + a = + (l && "op" === l.type && l.limits && (t.style === A.DISPLAY || l.alwaysHandleSupSub)) || + (l && "operatorname" === l.type && l.alwaysHandleSupSub && (l.limits || t.style === A.DISPLAY)) + ? "mover" + : "msup"; + } + return new Nt.MathNode(a, i); + }, + }), + ht({ + type: "atom", + htmlBuilder: function (e, t) { + return Qe.mathsym(e.text, e.mode, t, ["m" + e.family]); + }, + mathmlBuilder: function (e, t) { + var r = new Nt.MathNode("mo", [Ct(e.text, e.mode)]); + if ("bin" === e.family) { + var n = It(e, t); + "bold-italic" === n && r.setAttribute("mathvariant", n); + } else + "punct" === e.family + ? r.setAttribute("separator", "true") + : ("open" !== e.family && "close" !== e.family) || r.setAttribute("stretchy", "false"); + return r; + }, + }); + var wn = { mi: "italic", mn: "normal", mtext: "normal" }; + ht({ + type: "mathord", + htmlBuilder: function (e, t) { + return Qe.makeOrd(e, t, "mathord"); + }, + mathmlBuilder: function (e, t) { + var r = new Nt.MathNode("mi", [Ct(e.text, e.mode, t)]), + n = It(e, t) || "italic"; + return n !== wn[r.type] && r.setAttribute("mathvariant", n), r; + }, + }), + ht({ + type: "textord", + htmlBuilder: function (e, t) { + return Qe.makeOrd(e, t, "textord"); + }, + mathmlBuilder: function (e, t) { + var r, + n = Ct(e.text, e.mode, t), + a = It(e, t) || "normal"; + return ( + (r = + "text" === e.mode + ? new Nt.MathNode("mtext", [n]) + : /[0-9]/.test(e.text) + ? new Nt.MathNode("mn", [n]) + : "\\prime" === e.text + ? new Nt.MathNode("mo", [n]) + : new Nt.MathNode("mi", [n])), + a !== wn[r.type] && r.setAttribute("mathvariant", a), + r + ); + }, + }); + var kn = { "\\nobreak": "nobreak", "\\allowbreak": "allowbreak" }, + Sn = { + " ": {}, + "\\ ": {}, + "~": { className: "nobreak" }, + "\\space": {}, + "\\nobreakspace": { className: "nobreak" }, + }; + ht({ + type: "spacing", + htmlBuilder: function (e, t) { + if (Sn.hasOwnProperty(e.text)) { + var r = Sn[e.text].className || ""; + if ("text" === e.mode) { + var a = Qe.makeOrd(e, t, "textord"); + return a.classes.push(r), a; + } + return Qe.makeSpan(["mspace", r], [Qe.mathsym(e.text, e.mode, t)], t); + } + if (kn.hasOwnProperty(e.text)) return Qe.makeSpan(["mspace", kn[e.text]], [], t); + throw new n('Unknown type of space "' + e.text + '"'); + }, + mathmlBuilder: function (e, t) { + if (!Sn.hasOwnProperty(e.text)) { + if (kn.hasOwnProperty(e.text)) return new Nt.MathNode("mspace"); + throw new n('Unknown type of space "' + e.text + '"'); + } + return new Nt.MathNode("mtext", [new Nt.TextNode(" ")]); + }, + }); + var Mn = function () { + var e = new Nt.MathNode("mtd", []); + return e.setAttribute("width", "50%"), e; + }; + ht({ + type: "tag", + mathmlBuilder: function (e, t) { + var r = new Nt.MathNode("mtable", [ + new Nt.MathNode("mtr", [Mn(), new Nt.MathNode("mtd", [Ht(e.body, t)]), Mn(), new Nt.MathNode("mtd", [Ht(e.tag, t)])]), + ]); + return r.setAttribute("width", "100%"), r; + }, + }); + var zn = { + "\\text": void 0, + "\\textrm": "textrm", + "\\textsf": "textsf", + "\\texttt": "texttt", + "\\textnormal": "textrm", + }, + An = { "\\textbf": "textbf", "\\textmd": "textmd" }, + Tn = { "\\textit": "textit", "\\textup": "textup" }, + Bn = function (e, t) { + var r = e.font; + return r ? (zn[r] ? t.withTextFontFamily(zn[r]) : An[r] ? t.withTextFontWeight(An[r]) : t.withTextFontShape(Tn[r])) : t; + }; + lt({ + type: "text", + names: ["\\text", "\\textrm", "\\textsf", "\\texttt", "\\textnormal", "\\textbf", "\\textmd", "\\textit", "\\textup"], + props: { numArgs: 1, argTypes: ["text"], allowedInArgument: !0, allowedInText: !0 }, + handler: function (e, t) { + var r = e.parser, + n = e.funcName, + a = t[0]; + return { type: "text", mode: r.mode, body: mt(a), font: n }; + }, + htmlBuilder: function (e, t) { + var r = Bn(e, t), + n = vt(e.body, r, !0); + return Qe.makeSpan(["mord", "text"], n, r); + }, + mathmlBuilder: function (e, t) { + var r = Bn(e, t); + return Ht(e.body, r); + }, + }), + lt({ + type: "underline", + names: ["\\underline"], + props: { numArgs: 1, allowedInText: !0 }, + handler: function (e, t) { + return { type: "underline", mode: e.parser.mode, body: t[0] }; + }, + htmlBuilder: function (e, t) { + var r = St(e.body, t), + n = Qe.makeLineSpan("underline-line", t), + a = t.fontMetrics().defaultRuleThickness, + i = Qe.makeVList( + { + positionType: "top", + positionData: r.height, + children: [ + { type: "kern", size: a }, + { type: "elem", elem: n }, + { type: "kern", size: 3 * a }, + { type: "elem", elem: r }, + ], + }, + t, + ); + return Qe.makeSpan(["mord", "underline"], [i], t); + }, + mathmlBuilder: function (e, t) { + var r = new Nt.MathNode("mo", [new Nt.TextNode("‾")]); + r.setAttribute("stretchy", "true"); + var n = new Nt.MathNode("munder", [Ot(e.body, t), r]); + return n.setAttribute("accentunder", "true"), n; + }, + }), + lt({ + type: "vcenter", + names: ["\\vcenter"], + props: { numArgs: 1, argTypes: ["original"], allowedInText: !1 }, + handler: function (e, t) { + return { type: "vcenter", mode: e.parser.mode, body: t[0] }; + }, + htmlBuilder: function (e, t) { + var r = St(e.body, t), + n = t.fontMetrics().axisHeight, + a = 0.5 * (r.height - n - (r.depth + n)); + return Qe.makeVList( + { + positionType: "shift", + positionData: a, + children: [{ type: "elem", elem: r }], + }, + t, + ); + }, + mathmlBuilder: function (e, t) { + return new Nt.MathNode("mpadded", [Ot(e.body, t)], ["vcenter"]); + }, + }), + lt({ + type: "verb", + names: ["\\verb"], + props: { numArgs: 0, allowedInText: !0 }, + handler: function (e, t, r) { + throw new n("\\verb ended by end of line instead of matching delimiter"); + }, + htmlBuilder: function (e, t) { + for (var r = Nn(e), n = [], a = t.havingStyle(t.style.text()), i = 0; i < r.length; i++) { + var o = r[i]; + "~" === o && (o = "\\textasciitilde"), n.push(Qe.makeSymbol(o, "Typewriter-Regular", e.mode, a, ["mord", "texttt"])); + } + return Qe.makeSpan(["mord", "text"].concat(a.sizingClasses(t)), Qe.tryCombineChars(n), a); + }, + mathmlBuilder: function (e, t) { + var r = new Nt.TextNode(Nn(e)), + n = new Nt.MathNode("mtext", [r]); + return n.setAttribute("mathvariant", "monospace"), n; + }, + }); + var Nn = function (e) { + return e.body.replace(/ /g, e.star ? "␣" : " "); + }, + Cn = it, + qn = "[ \r\n\t]", + In = "(\\\\[a-zA-Z@]+)" + qn + "*", + Rn = "[̀-ͯ]", + Hn = new RegExp(Rn + "+$"), + On = + "(" + + qn + + "+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧‪-퟿豈-￿]" + + Rn + + "*|[\ud800-\udbff][\udc00-\udfff]" + + Rn + + "*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|" + + In + + "|\\\\[^\ud800-\udfff])", + En = (function () { + function e(e, t) { + (this.input = void 0), + (this.settings = void 0), + (this.tokenRegex = void 0), + (this.catcodes = void 0), + (this.input = e), + (this.settings = t), + (this.tokenRegex = new RegExp(On, "g")), + (this.catcodes = { "%": 14, "~": 13 }); + } + var t = e.prototype; + return ( + (t.setCatcode = function (e, t) { + this.catcodes[e] = t; + }), + (t.lex = function () { + var e = this.input, + t = this.tokenRegex.lastIndex; + if (t === e.length) return new Gr("EOF", new Fr(this, t, t)); + var r = this.tokenRegex.exec(e); + if (null === r || r.index !== t) throw new n("Unexpected character: '" + e[t] + "'", new Gr(e[t], new Fr(this, t, t + 1))); + var a = r[6] || r[3] || (r[2] ? "\\ " : " "); + if (14 === this.catcodes[a]) { + var i = e.indexOf("\n", this.tokenRegex.lastIndex); + return ( + -1 === i + ? ((this.tokenRegex.lastIndex = e.length), + this.settings.reportNonstrict( + "commentAtEnd", + "% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)", + )) + : (this.tokenRegex.lastIndex = i + 1), + this.lex() + ); + } + return new Gr(a, new Fr(this, t, this.tokenRegex.lastIndex)); + }), + e + ); + })(), + Ln = (function () { + function e(e, t) { + void 0 === e && (e = {}), + void 0 === t && (t = {}), + (this.current = void 0), + (this.builtins = void 0), + (this.undefStack = void 0), + (this.current = t), + (this.builtins = e), + (this.undefStack = []); + } + var t = e.prototype; + return ( + (t.beginGroup = function () { + this.undefStack.push({}); + }), + (t.endGroup = function () { + if (0 === this.undefStack.length) + throw new n("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug"); + var e = this.undefStack.pop(); + for (var t in e) e.hasOwnProperty(t) && (null == e[t] ? delete this.current[t] : (this.current[t] = e[t])); + }), + (t.endGroups = function () { + for (; this.undefStack.length > 0; ) this.endGroup(); + }), + (t.has = function (e) { + return this.current.hasOwnProperty(e) || this.builtins.hasOwnProperty(e); + }), + (t.get = function (e) { + return this.current.hasOwnProperty(e) ? this.current[e] : this.builtins[e]; + }), + (t.set = function (e, t, r) { + if ((void 0 === r && (r = !1), r)) { + for (var n = 0; n < this.undefStack.length; n++) delete this.undefStack[n][e]; + this.undefStack.length > 0 && (this.undefStack[this.undefStack.length - 1][e] = t); + } else { + var a = this.undefStack[this.undefStack.length - 1]; + a && !a.hasOwnProperty(e) && (a[e] = this.current[e]); + } + null == t ? delete this.current[e] : (this.current[e] = t); + }), + e + ); + })(), + Dn = Pr; + Vr("\\noexpand", function (e) { + var t = e.popToken(); + return e.isExpandable(t.text) && ((t.noexpand = !0), (t.treatAsRelax = !0)), { tokens: [t], numArgs: 0 }; + }), + Vr("\\expandafter", function (e) { + var t = e.popToken(); + return e.expandOnce(!0), { tokens: [t], numArgs: 0 }; + }), + Vr("\\@firstoftwo", function (e) { + return { tokens: e.consumeArgs(2)[0], numArgs: 0 }; + }), + Vr("\\@secondoftwo", function (e) { + return { tokens: e.consumeArgs(2)[1], numArgs: 0 }; + }), + Vr("\\@ifnextchar", function (e) { + var t = e.consumeArgs(3); + e.consumeSpaces(); + var r = e.future(); + return 1 === t[0].length && t[0][0].text === r.text ? { tokens: t[1], numArgs: 0 } : { tokens: t[2], numArgs: 0 }; + }), + Vr("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}"), + Vr("\\TextOrMath", function (e) { + var t = e.consumeArgs(2); + return "text" === e.mode ? { tokens: t[0], numArgs: 0 } : { tokens: t[1], numArgs: 0 }; + }); + var Pn = { + 0: 0, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + 7: 7, + 8: 8, + 9: 9, + a: 10, + A: 10, + b: 11, + B: 11, + c: 12, + C: 12, + d: 13, + D: 13, + e: 14, + E: 14, + f: 15, + F: 15, + }; + Vr("\\char", function (e) { + var t, + r = e.popToken(), + a = ""; + if ("'" === r.text) (t = 8), (r = e.popToken()); + else if ('"' === r.text) (t = 16), (r = e.popToken()); + else if ("`" === r.text) + if ("\\" === (r = e.popToken()).text[0]) a = r.text.charCodeAt(1); + else { + if ("EOF" === r.text) throw new n("\\char` missing argument"); + a = r.text.charCodeAt(0); + } + else t = 10; + if (t) { + if (null == (a = Pn[r.text]) || a >= t) throw new n("Invalid base-" + t + " digit " + r.text); + for (var i; null != (i = Pn[e.future().text]) && i < t; ) (a *= t), (a += i), e.popToken(); + } + return "\\@char{" + a + "}"; + }); + var Vn = function (e, t, r) { + var a = e.consumeArg().tokens; + if (1 !== a.length) throw new n("\\newcommand's first argument must be a macro name"); + var i = a[0].text, + o = e.isDefined(i); + if (o && !t) throw new n("\\newcommand{" + i + "} attempting to redefine " + i + "; use \\renewcommand"); + if (!o && !r) throw new n("\\renewcommand{" + i + "} when command " + i + " does not yet exist; use \\newcommand"); + var s = 0; + if (1 === (a = e.consumeArg().tokens).length && "[" === a[0].text) { + for (var l = "", h = e.expandNextToken(); "]" !== h.text && "EOF" !== h.text; ) (l += h.text), (h = e.expandNextToken()); + if (!l.match(/^\s*[0-9]+\s*$/)) throw new n("Invalid number of arguments: " + l); + (s = parseInt(l)), (a = e.consumeArg().tokens); + } + return e.macros.set(i, { tokens: a, numArgs: s }), ""; + }; + Vr("\\newcommand", function (e) { + return Vn(e, !1, !0); + }), + Vr("\\renewcommand", function (e) { + return Vn(e, !0, !1); + }), + Vr("\\providecommand", function (e) { + return Vn(e, !0, !0); + }), + Vr("\\message", function (e) { + var t = e.consumeArgs(1)[0]; + return ( + console.log( + t + .reverse() + .map(function (e) { + return e.text; + }) + .join(""), + ), + "" + ); + }), + Vr("\\errmessage", function (e) { + var t = e.consumeArgs(1)[0]; + return ( + console.error( + t + .reverse() + .map(function (e) { + return e.text; + }) + .join(""), + ), + "" + ); + }), + Vr("\\show", function (e) { + var t = e.popToken(), + r = t.text; + return console.log(t, e.macros.get(r), Cn[r], he.math[r], he.text[r]), ""; + }), + Vr("\\bgroup", "{"), + Vr("\\egroup", "}"), + Vr("~", "\\nobreakspace"), + Vr("\\lq", "`"), + Vr("\\rq", "'"), + Vr("\\aa", "\\r a"), + Vr("\\AA", "\\r A"), + Vr("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`©}"), + Vr("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"), + Vr("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"), + Vr("ℬ", "\\mathscr{B}"), + Vr("ℰ", "\\mathscr{E}"), + Vr("ℱ", "\\mathscr{F}"), + Vr("ℋ", "\\mathscr{H}"), + Vr("ℐ", "\\mathscr{I}"), + Vr("ℒ", "\\mathscr{L}"), + Vr("ℳ", "\\mathscr{M}"), + Vr("ℛ", "\\mathscr{R}"), + Vr("ℭ", "\\mathfrak{C}"), + Vr("ℌ", "\\mathfrak{H}"), + Vr("ℨ", "\\mathfrak{Z}"), + Vr("\\Bbbk", "\\Bbb{k}"), + Vr("·", "\\cdotp"), + Vr("\\llap", "\\mathllap{\\textrm{#1}}"), + Vr("\\rlap", "\\mathrlap{\\textrm{#1}}"), + Vr("\\clap", "\\mathclap{\\textrm{#1}}"), + Vr("\\mathstrut", "\\vphantom{(}"), + Vr("\\underbar", "\\underline{\\text{#1}}"), + Vr("\\not", '\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'), + Vr("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"), + Vr("\\ne", "\\neq"), + Vr("≠", "\\neq"), + Vr("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"), + Vr("∉", "\\notin"), + Vr("≘", "\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"), + Vr("≙", "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"), + Vr("≚", "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"), + Vr("≛", "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"), + Vr("≝", "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"), + Vr("≞", "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"), + Vr("≟", "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"), + Vr("⟂", "\\perp"), + Vr("‼", "\\mathclose{!\\mkern-0.8mu!}"), + Vr("∌", "\\notni"), + Vr("⌜", "\\ulcorner"), + Vr("⌝", "\\urcorner"), + Vr("⌞", "\\llcorner"), + Vr("⌟", "\\lrcorner"), + Vr("©", "\\copyright"), + Vr("®", "\\textregistered"), + Vr("️", "\\textregistered"), + Vr("\\ulcorner", '\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'), + Vr("\\urcorner", '\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'), + Vr("\\llcorner", '\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'), + Vr("\\lrcorner", '\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'), + Vr("\\vdots", "\\mathord{\\varvdots\\rule{0pt}{15pt}}"), + Vr("⋮", "\\vdots"), + Vr("\\varGamma", "\\mathit{\\Gamma}"), + Vr("\\varDelta", "\\mathit{\\Delta}"), + Vr("\\varTheta", "\\mathit{\\Theta}"), + Vr("\\varLambda", "\\mathit{\\Lambda}"), + Vr("\\varXi", "\\mathit{\\Xi}"), + Vr("\\varPi", "\\mathit{\\Pi}"), + Vr("\\varSigma", "\\mathit{\\Sigma}"), + Vr("\\varUpsilon", "\\mathit{\\Upsilon}"), + Vr("\\varPhi", "\\mathit{\\Phi}"), + Vr("\\varPsi", "\\mathit{\\Psi}"), + Vr("\\varOmega", "\\mathit{\\Omega}"), + Vr("\\substack", "\\begin{subarray}{c}#1\\end{subarray}"), + Vr("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"), + Vr("\\boxed", "\\fbox{$\\displaystyle{#1}$}"), + Vr("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;"), + Vr("\\implies", "\\DOTSB\\;\\Longrightarrow\\;"), + Vr("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;"); + var Fn = { + ",": "\\dotsc", + "\\not": "\\dotsb", + "+": "\\dotsb", + "=": "\\dotsb", + "<": "\\dotsb", + ">": "\\dotsb", + "-": "\\dotsb", + "*": "\\dotsb", + ":": "\\dotsb", + "\\DOTSB": "\\dotsb", + "\\coprod": "\\dotsb", + "\\bigvee": "\\dotsb", + "\\bigwedge": "\\dotsb", + "\\biguplus": "\\dotsb", + "\\bigcap": "\\dotsb", + "\\bigcup": "\\dotsb", + "\\prod": "\\dotsb", + "\\sum": "\\dotsb", + "\\bigotimes": "\\dotsb", + "\\bigoplus": "\\dotsb", + "\\bigodot": "\\dotsb", + "\\bigsqcup": "\\dotsb", + "\\And": "\\dotsb", + "\\longrightarrow": "\\dotsb", + "\\Longrightarrow": "\\dotsb", + "\\longleftarrow": "\\dotsb", + "\\Longleftarrow": "\\dotsb", + "\\longleftrightarrow": "\\dotsb", + "\\Longleftrightarrow": "\\dotsb", + "\\mapsto": "\\dotsb", + "\\longmapsto": "\\dotsb", + "\\hookrightarrow": "\\dotsb", + "\\doteq": "\\dotsb", + "\\mathbin": "\\dotsb", + "\\mathrel": "\\dotsb", + "\\relbar": "\\dotsb", + "\\Relbar": "\\dotsb", + "\\xrightarrow": "\\dotsb", + "\\xleftarrow": "\\dotsb", + "\\DOTSI": "\\dotsi", + "\\int": "\\dotsi", + "\\oint": "\\dotsi", + "\\iint": "\\dotsi", + "\\iiint": "\\dotsi", + "\\iiiint": "\\dotsi", + "\\idotsint": "\\dotsi", + "\\DOTSX": "\\dotsx", + }; + Vr("\\dots", function (e) { + var t = "\\dotso", + r = e.expandAfterFuture().text; + return ( + r in Fn ? (t = Fn[r]) : ("\\not" === r.slice(0, 4) || (r in he.math && l(["bin", "rel"], he.math[r].group))) && (t = "\\dotsb"), t + ); + }); + var Gn = { + ")": !0, + "]": !0, + "\\rbrack": !0, + "\\}": !0, + "\\rbrace": !0, + "\\rangle": !0, + "\\rceil": !0, + "\\rfloor": !0, + "\\rgroup": !0, + "\\rmoustache": !0, + "\\right": !0, + "\\bigr": !0, + "\\biggr": !0, + "\\Bigr": !0, + "\\Biggr": !0, + $: !0, + ";": !0, + ".": !0, + ",": !0, + }; + Vr("\\dotso", function (e) { + return e.future().text in Gn ? "\\ldots\\," : "\\ldots"; + }), + Vr("\\dotsc", function (e) { + var t = e.future().text; + return t in Gn && "," !== t ? "\\ldots\\," : "\\ldots"; + }), + Vr("\\cdots", function (e) { + return e.future().text in Gn ? "\\@cdots\\," : "\\@cdots"; + }), + Vr("\\dotsb", "\\cdots"), + Vr("\\dotsm", "\\cdots"), + Vr("\\dotsi", "\\!\\cdots"), + Vr("\\dotsx", "\\ldots\\,"), + Vr("\\DOTSI", "\\relax"), + Vr("\\DOTSB", "\\relax"), + Vr("\\DOTSX", "\\relax"), + Vr("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"), + Vr("\\,", "\\tmspace+{3mu}{.1667em}"), + Vr("\\thinspace", "\\,"), + Vr("\\>", "\\mskip{4mu}"), + Vr("\\:", "\\tmspace+{4mu}{.2222em}"), + Vr("\\medspace", "\\:"), + Vr("\\;", "\\tmspace+{5mu}{.2777em}"), + Vr("\\thickspace", "\\;"), + Vr("\\!", "\\tmspace-{3mu}{.1667em}"), + Vr("\\negthinspace", "\\!"), + Vr("\\negmedspace", "\\tmspace-{4mu}{.2222em}"), + Vr("\\negthickspace", "\\tmspace-{5mu}{.277em}"), + Vr("\\enspace", "\\kern.5em "), + Vr("\\enskip", "\\hskip.5em\\relax"), + Vr("\\quad", "\\hskip1em\\relax"), + Vr("\\qquad", "\\hskip2em\\relax"), + Vr("\\tag", "\\@ifstar\\tag@literal\\tag@paren"), + Vr("\\tag@paren", "\\tag@literal{({#1})}"), + Vr("\\tag@literal", function (e) { + if (e.macros.get("\\df@tag")) throw new n("Multiple \\tag"); + return "\\gdef\\df@tag{\\text{#1}}"; + }), + Vr( + "\\bmod", + "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}", + ), + Vr("\\pod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"), + Vr("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}"), + Vr("\\mod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"), + Vr("\\newline", "\\\\\\relax"), + Vr("\\TeX", "\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}"); + var Un = W(I["Main-Regular"]["T".charCodeAt(0)][1] - 0.7 * I["Main-Regular"]["A".charCodeAt(0)][1]); + Vr("\\LaTeX", "\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{" + Un + "}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"), + Vr("\\KaTeX", "\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{" + Un + "}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"), + Vr("\\hspace", "\\@ifstar\\@hspacer\\@hspace"), + Vr("\\@hspace", "\\hskip #1\\relax"), + Vr("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax"), + Vr("\\ordinarycolon", ":"), + Vr("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}"), + Vr("\\dblcolon", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'), + Vr("\\coloneqq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'), + Vr("\\Coloneqq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'), + Vr("\\coloneq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'), + Vr("\\Coloneq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'), + Vr("\\eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'), + Vr("\\Eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'), + Vr("\\eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'), + Vr("\\Eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'), + Vr("\\colonapprox", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'), + Vr("\\Colonapprox", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'), + Vr("\\colonsim", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'), + Vr("\\Colonsim", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'), + Vr("∷", "\\dblcolon"), + Vr("∹", "\\eqcolon"), + Vr("≔", "\\coloneqq"), + Vr("≕", "\\eqqcolon"), + Vr("⩴", "\\Coloneqq"), + Vr("\\ratio", "\\vcentcolon"), + Vr("\\coloncolon", "\\dblcolon"), + Vr("\\colonequals", "\\coloneqq"), + Vr("\\coloncolonequals", "\\Coloneqq"), + Vr("\\equalscolon", "\\eqqcolon"), + Vr("\\equalscoloncolon", "\\Eqqcolon"), + Vr("\\colonminus", "\\coloneq"), + Vr("\\coloncolonminus", "\\Coloneq"), + Vr("\\minuscolon", "\\eqcolon"), + Vr("\\minuscoloncolon", "\\Eqcolon"), + Vr("\\coloncolonapprox", "\\Colonapprox"), + Vr("\\coloncolonsim", "\\Colonsim"), + Vr("\\simcolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"), + Vr("\\simcoloncolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"), + Vr("\\approxcolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"), + Vr("\\approxcoloncolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"), + Vr("\\notni", "\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"), + Vr("\\limsup", "\\DOTSB\\operatorname*{lim\\,sup}"), + Vr("\\liminf", "\\DOTSB\\operatorname*{lim\\,inf}"), + Vr("\\injlim", "\\DOTSB\\operatorname*{inj\\,lim}"), + Vr("\\projlim", "\\DOTSB\\operatorname*{proj\\,lim}"), + Vr("\\varlimsup", "\\DOTSB\\operatorname*{\\overline{lim}}"), + Vr("\\varliminf", "\\DOTSB\\operatorname*{\\underline{lim}}"), + Vr("\\varinjlim", "\\DOTSB\\operatorname*{\\underrightarrow{lim}}"), + Vr("\\varprojlim", "\\DOTSB\\operatorname*{\\underleftarrow{lim}}"), + Vr("\\gvertneqq", "\\html@mathml{\\@gvertneqq}{≩}"), + Vr("\\lvertneqq", "\\html@mathml{\\@lvertneqq}{≨}"), + Vr("\\ngeqq", "\\html@mathml{\\@ngeqq}{≱}"), + Vr("\\ngeqslant", "\\html@mathml{\\@ngeqslant}{≱}"), + Vr("\\nleqq", "\\html@mathml{\\@nleqq}{≰}"), + Vr("\\nleqslant", "\\html@mathml{\\@nleqslant}{≰}"), + Vr("\\nshortmid", "\\html@mathml{\\@nshortmid}{∤}"), + Vr("\\nshortparallel", "\\html@mathml{\\@nshortparallel}{∦}"), + Vr("\\nsubseteqq", "\\html@mathml{\\@nsubseteqq}{⊈}"), + Vr("\\nsupseteqq", "\\html@mathml{\\@nsupseteqq}{⊉}"), + Vr("\\varsubsetneq", "\\html@mathml{\\@varsubsetneq}{⊊}"), + Vr("\\varsubsetneqq", "\\html@mathml{\\@varsubsetneqq}{⫋}"), + Vr("\\varsupsetneq", "\\html@mathml{\\@varsupsetneq}{⊋}"), + Vr("\\varsupsetneqq", "\\html@mathml{\\@varsupsetneqq}{⫌}"), + Vr("\\imath", "\\html@mathml{\\@imath}{ı}"), + Vr("\\jmath", "\\html@mathml{\\@jmath}{ȷ}"), + Vr("\\llbracket", "\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"), + Vr("\\rrbracket", "\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"), + Vr("⟦", "\\llbracket"), + Vr("⟧", "\\rrbracket"), + Vr("\\lBrace", "\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"), + Vr("\\rBrace", "\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"), + Vr("⦃", "\\lBrace"), + Vr("⦄", "\\rBrace"), + Vr( + "\\minuso", + "\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}", + ), + Vr("⦵", "\\minuso"), + Vr("\\darr", "\\downarrow"), + Vr("\\dArr", "\\Downarrow"), + Vr("\\Darr", "\\Downarrow"), + Vr("\\lang", "\\langle"), + Vr("\\rang", "\\rangle"), + Vr("\\uarr", "\\uparrow"), + Vr("\\uArr", "\\Uparrow"), + Vr("\\Uarr", "\\Uparrow"), + Vr("\\N", "\\mathbb{N}"), + Vr("\\R", "\\mathbb{R}"), + Vr("\\Z", "\\mathbb{Z}"), + Vr("\\alef", "\\aleph"), + Vr("\\alefsym", "\\aleph"), + Vr("\\Alpha", "\\mathrm{A}"), + Vr("\\Beta", "\\mathrm{B}"), + Vr("\\bull", "\\bullet"), + Vr("\\Chi", "\\mathrm{X}"), + Vr("\\clubs", "\\clubsuit"), + Vr("\\cnums", "\\mathbb{C}"), + Vr("\\Complex", "\\mathbb{C}"), + Vr("\\Dagger", "\\ddagger"), + Vr("\\diamonds", "\\diamondsuit"), + Vr("\\empty", "\\emptyset"), + Vr("\\Epsilon", "\\mathrm{E}"), + Vr("\\Eta", "\\mathrm{H}"), + Vr("\\exist", "\\exists"), + Vr("\\harr", "\\leftrightarrow"), + Vr("\\hArr", "\\Leftrightarrow"), + Vr("\\Harr", "\\Leftrightarrow"), + Vr("\\hearts", "\\heartsuit"), + Vr("\\image", "\\Im"), + Vr("\\infin", "\\infty"), + Vr("\\Iota", "\\mathrm{I}"), + Vr("\\isin", "\\in"), + Vr("\\Kappa", "\\mathrm{K}"), + Vr("\\larr", "\\leftarrow"), + Vr("\\lArr", "\\Leftarrow"), + Vr("\\Larr", "\\Leftarrow"), + Vr("\\lrarr", "\\leftrightarrow"), + Vr("\\lrArr", "\\Leftrightarrow"), + Vr("\\Lrarr", "\\Leftrightarrow"), + Vr("\\Mu", "\\mathrm{M}"), + Vr("\\natnums", "\\mathbb{N}"), + Vr("\\Nu", "\\mathrm{N}"), + Vr("\\Omicron", "\\mathrm{O}"), + Vr("\\plusmn", "\\pm"), + Vr("\\rarr", "\\rightarrow"), + Vr("\\rArr", "\\Rightarrow"), + Vr("\\Rarr", "\\Rightarrow"), + Vr("\\real", "\\Re"), + Vr("\\reals", "\\mathbb{R}"), + Vr("\\Reals", "\\mathbb{R}"), + Vr("\\Rho", "\\mathrm{P}"), + Vr("\\sdot", "\\cdot"), + Vr("\\sect", "\\S"), + Vr("\\spades", "\\spadesuit"), + Vr("\\sub", "\\subset"), + Vr("\\sube", "\\subseteq"), + Vr("\\supe", "\\supseteq"), + Vr("\\Tau", "\\mathrm{T}"), + Vr("\\thetasym", "\\vartheta"), + Vr("\\weierp", "\\wp"), + Vr("\\Zeta", "\\mathrm{Z}"), + Vr("\\argmin", "\\DOTSB\\operatorname*{arg\\,min}"), + Vr("\\argmax", "\\DOTSB\\operatorname*{arg\\,max}"), + Vr("\\plim", "\\DOTSB\\mathop{\\operatorname{plim}}\\limits"), + Vr("\\bra", "\\mathinner{\\langle{#1}|}"), + Vr("\\ket", "\\mathinner{|{#1}\\rangle}"), + Vr("\\braket", "\\mathinner{\\langle{#1}\\rangle}"), + Vr("\\Bra", "\\left\\langle#1\\right|"), + Vr("\\Ket", "\\left|#1\\right\\rangle"); + var Yn = function (e) { + return function (t) { + var r = t.consumeArg().tokens, + n = t.consumeArg().tokens, + a = t.consumeArg().tokens, + i = t.consumeArg().tokens, + o = t.macros.get("|"), + s = t.macros.get("\\|"); + t.macros.beginGroup(); + var l = function (t) { + return function (r) { + e && (r.macros.set("|", o), a.length && r.macros.set("\\|", s)); + var i = t; + return !t && a.length && "|" === r.future().text && (r.popToken(), (i = !0)), { tokens: i ? a : n, numArgs: 0 }; + }; + }; + t.macros.set("|", l(!1)), a.length && t.macros.set("\\|", l(!0)); + var h = t.consumeArg().tokens, + c = t.expandTokens([].concat(i, h, r)); + return t.macros.endGroup(), { tokens: c.reverse(), numArgs: 0 }; + }; + }; + Vr("\\bra@ket", Yn(!1)), + Vr("\\bra@set", Yn(!0)), + Vr("\\Braket", "\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"), + Vr("\\Set", "\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"), + Vr("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"), + Vr("\\angln", "{\\angl n}"), + Vr("\\blue", "\\textcolor{##6495ed}{#1}"), + Vr("\\orange", "\\textcolor{##ffa500}{#1}"), + Vr("\\pink", "\\textcolor{##ff00af}{#1}"), + Vr("\\red", "\\textcolor{##df0030}{#1}"), + Vr("\\green", "\\textcolor{##28ae7b}{#1}"), + Vr("\\gray", "\\textcolor{gray}{#1}"), + Vr("\\purple", "\\textcolor{##9d38bd}{#1}"), + Vr("\\blueA", "\\textcolor{##ccfaff}{#1}"), + Vr("\\blueB", "\\textcolor{##80f6ff}{#1}"), + Vr("\\blueC", "\\textcolor{##63d9ea}{#1}"), + Vr("\\blueD", "\\textcolor{##11accd}{#1}"), + Vr("\\blueE", "\\textcolor{##0c7f99}{#1}"), + Vr("\\tealA", "\\textcolor{##94fff5}{#1}"), + Vr("\\tealB", "\\textcolor{##26edd5}{#1}"), + Vr("\\tealC", "\\textcolor{##01d1c1}{#1}"), + Vr("\\tealD", "\\textcolor{##01a995}{#1}"), + Vr("\\tealE", "\\textcolor{##208170}{#1}"), + Vr("\\greenA", "\\textcolor{##b6ffb0}{#1}"), + Vr("\\greenB", "\\textcolor{##8af281}{#1}"), + Vr("\\greenC", "\\textcolor{##74cf70}{#1}"), + Vr("\\greenD", "\\textcolor{##1fab54}{#1}"), + Vr("\\greenE", "\\textcolor{##0d923f}{#1}"), + Vr("\\goldA", "\\textcolor{##ffd0a9}{#1}"), + Vr("\\goldB", "\\textcolor{##ffbb71}{#1}"), + Vr("\\goldC", "\\textcolor{##ff9c39}{#1}"), + Vr("\\goldD", "\\textcolor{##e07d10}{#1}"), + Vr("\\goldE", "\\textcolor{##a75a05}{#1}"), + Vr("\\redA", "\\textcolor{##fca9a9}{#1}"), + Vr("\\redB", "\\textcolor{##ff8482}{#1}"), + Vr("\\redC", "\\textcolor{##f9685d}{#1}"), + Vr("\\redD", "\\textcolor{##e84d39}{#1}"), + Vr("\\redE", "\\textcolor{##bc2612}{#1}"), + Vr("\\maroonA", "\\textcolor{##ffbde0}{#1}"), + Vr("\\maroonB", "\\textcolor{##ff92c6}{#1}"), + Vr("\\maroonC", "\\textcolor{##ed5fa6}{#1}"), + Vr("\\maroonD", "\\textcolor{##ca337c}{#1}"), + Vr("\\maroonE", "\\textcolor{##9e034e}{#1}"), + Vr("\\purpleA", "\\textcolor{##ddd7ff}{#1}"), + Vr("\\purpleB", "\\textcolor{##c6b9fc}{#1}"), + Vr("\\purpleC", "\\textcolor{##aa87ff}{#1}"), + Vr("\\purpleD", "\\textcolor{##7854ab}{#1}"), + Vr("\\purpleE", "\\textcolor{##543b78}{#1}"), + Vr("\\mintA", "\\textcolor{##f5f9e8}{#1}"), + Vr("\\mintB", "\\textcolor{##edf2df}{#1}"), + Vr("\\mintC", "\\textcolor{##e0e5cc}{#1}"), + Vr("\\grayA", "\\textcolor{##f6f7f7}{#1}"), + Vr("\\grayB", "\\textcolor{##f0f1f2}{#1}"), + Vr("\\grayC", "\\textcolor{##e3e5e6}{#1}"), + Vr("\\grayD", "\\textcolor{##d6d8da}{#1}"), + Vr("\\grayE", "\\textcolor{##babec2}{#1}"), + Vr("\\grayF", "\\textcolor{##888d93}{#1}"), + Vr("\\grayG", "\\textcolor{##626569}{#1}"), + Vr("\\grayH", "\\textcolor{##3b3e40}{#1}"), + Vr("\\grayI", "\\textcolor{##21242c}{#1}"), + Vr("\\kaBlue", "\\textcolor{##314453}{#1}"), + Vr("\\kaGreen", "\\textcolor{##71B307}{#1}"); + var Xn = { "^": !0, _: !0, "\\limits": !0, "\\nolimits": !0 }, + Wn = (function () { + function e(e, t, r) { + (this.settings = void 0), + (this.expansionCount = void 0), + (this.lexer = void 0), + (this.macros = void 0), + (this.stack = void 0), + (this.mode = void 0), + (this.settings = t), + (this.expansionCount = 0), + this.feed(e), + (this.macros = new Ln(Dn, t.macros)), + (this.mode = r), + (this.stack = []); + } + var t = e.prototype; + return ( + (t.feed = function (e) { + this.lexer = new En(e, this.settings); + }), + (t.switchMode = function (e) { + this.mode = e; + }), + (t.beginGroup = function () { + this.macros.beginGroup(); + }), + (t.endGroup = function () { + this.macros.endGroup(); + }), + (t.endGroups = function () { + this.macros.endGroups(); + }), + (t.future = function () { + return 0 === this.stack.length && this.pushToken(this.lexer.lex()), this.stack[this.stack.length - 1]; + }), + (t.popToken = function () { + return this.future(), this.stack.pop(); + }), + (t.pushToken = function (e) { + this.stack.push(e); + }), + (t.pushTokens = function (e) { + var t; + (t = this.stack).push.apply(t, e); + }), + (t.scanArgument = function (e) { + var t, r, n; + if (e) { + if ((this.consumeSpaces(), "[" !== this.future().text)) return null; + t = this.popToken(); + var a = this.consumeArg(["]"]); + (n = a.tokens), (r = a.end); + } else { + var i = this.consumeArg(); + (n = i.tokens), (t = i.start), (r = i.end); + } + return this.pushToken(new Gr("EOF", r.loc)), this.pushTokens(n), t.range(r, ""); + }), + (t.consumeSpaces = function () { + for (; " " === this.future().text; ) this.stack.pop(); + }), + (t.consumeArg = function (e) { + var t = [], + r = e && e.length > 0; + r || this.consumeSpaces(); + var a, + i = this.future(), + o = 0, + s = 0; + do { + if (((a = this.popToken()), t.push(a), "{" === a.text)) ++o; + else if ("}" === a.text) { + if (-1 == --o) throw new n("Extra }", a); + } else if ("EOF" === a.text) + throw new n("Unexpected end of input in a macro argument, expected '" + (e && r ? e[s] : "}") + "'", a); + if (e && r) + if ((0 === o || (1 === o && "{" === e[s])) && a.text === e[s]) { + if (++s === e.length) { + t.splice(-s, s); + break; + } + } else s = 0; + } while (0 !== o || r); + return "{" === i.text && "}" === t[t.length - 1].text && (t.pop(), t.shift()), t.reverse(), { tokens: t, start: i, end: a }; + }), + (t.consumeArgs = function (e, t) { + if (t) { + if (t.length !== e + 1) throw new n("The length of delimiters doesn't match the number of args!"); + for (var r = t[0], a = 0; a < r.length; a++) { + var i = this.popToken(); + if (r[a] !== i.text) throw new n("Use of the macro doesn't match its definition", i); + } + } + for (var o = [], s = 0; s < e; s++) o.push(this.consumeArg(t && t[s + 1]).tokens); + return o; + }), + (t.expandOnce = function (e) { + var t = this.popToken(), + r = t.text, + a = t.noexpand ? null : this._getExpansion(r); + if (null == a || (e && a.unexpandable)) { + if (e && null == a && "\\" === r[0] && !this.isDefined(r)) throw new n("Undefined control sequence: " + r); + return this.pushToken(t), !1; + } + if ((this.expansionCount++, this.expansionCount > this.settings.maxExpand)) + throw new n("Too many expansions: infinite loop or need to increase maxExpand setting"); + var i = a.tokens, + o = this.consumeArgs(a.numArgs, a.delimiters); + if (a.numArgs) + for (var s = (i = i.slice()).length - 1; s >= 0; --s) { + var l = i[s]; + if ("#" === l.text) { + if (0 === s) throw new n("Incomplete placeholder at end of macro body", l); + if ("#" === (l = i[--s]).text) i.splice(s + 1, 1); + else { + if (!/^[1-9]$/.test(l.text)) throw new n("Not a valid argument number", l); + var h; + (h = i).splice.apply(h, [s, 2].concat(o[+l.text - 1])); + } + } + } + return this.pushTokens(i), i.length; + }), + (t.expandAfterFuture = function () { + return this.expandOnce(), this.future(); + }), + (t.expandNextToken = function () { + for (;;) + if (!1 === this.expandOnce()) { + var e = this.stack.pop(); + return e.treatAsRelax && (e.text = "\\relax"), e; + } + throw new Error(); + }), + (t.expandMacro = function (e) { + return this.macros.has(e) ? this.expandTokens([new Gr(e)]) : void 0; + }), + (t.expandTokens = function (e) { + var t = [], + r = this.stack.length; + for (this.pushTokens(e); this.stack.length > r; ) + if (!1 === this.expandOnce(!0)) { + var n = this.stack.pop(); + n.treatAsRelax && ((n.noexpand = !1), (n.treatAsRelax = !1)), t.push(n); + } + return t; + }), + (t.expandMacroAsText = function (e) { + var t = this.expandMacro(e); + return t + ? t + .map(function (e) { + return e.text; + }) + .join("") + : t; + }), + (t._getExpansion = function (e) { + var t = this.macros.get(e); + if (null == t) return t; + if (1 === e.length) { + var r = this.lexer.catcodes[e]; + if (null != r && 13 !== r) return; + } + var n = "function" == typeof t ? t(this) : t; + if ("string" == typeof n) { + var a = 0; + if (-1 !== n.indexOf("#")) for (var i = n.replace(/##/g, ""); -1 !== i.indexOf("#" + (a + 1)); ) ++a; + for (var o = new En(n, this.settings), s = [], l = o.lex(); "EOF" !== l.text; ) s.push(l), (l = o.lex()); + return s.reverse(), { tokens: s, numArgs: a }; + } + return n; + }), + (t.isDefined = function (e) { + return ( + this.macros.has(e) || Cn.hasOwnProperty(e) || he.math.hasOwnProperty(e) || he.text.hasOwnProperty(e) || Xn.hasOwnProperty(e) + ); + }), + (t.isExpandable = function (e) { + var t = this.macros.get(e); + return null != t ? "string" == typeof t || "function" == typeof t || !t.unexpandable : Cn.hasOwnProperty(e) && !Cn[e].primitive; + }), + e + ); + })(), + _n = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/, + jn = Object.freeze({ + "₊": "+", + "₋": "-", + "₌": "=", + "₍": "(", + "₎": ")", + "₀": "0", + "₁": "1", + "₂": "2", + "₃": "3", + "₄": "4", + "₅": "5", + "₆": "6", + "₇": "7", + "₈": "8", + "₉": "9", + ₐ: "a", + ₑ: "e", + ₕ: "h", + ᵢ: "i", + ⱼ: "j", + ₖ: "k", + ₗ: "l", + ₘ: "m", + ₙ: "n", + ₒ: "o", + ₚ: "p", + ᵣ: "r", + ₛ: "s", + ₜ: "t", + ᵤ: "u", + ᵥ: "v", + ₓ: "x", + ᵦ: "β", + ᵧ: "γ", + ᵨ: "ρ", + ᵩ: "ϕ", + ᵪ: "χ", + "⁺": "+", + "⁻": "-", + "⁼": "=", + "⁽": "(", + "⁾": ")", + "⁰": "0", + "¹": "1", + "²": "2", + "³": "3", + "⁴": "4", + "⁵": "5", + "⁶": "6", + "⁷": "7", + "⁸": "8", + "⁹": "9", + ᴬ: "A", + ᴮ: "B", + ᴰ: "D", + ᴱ: "E", + ᴳ: "G", + ᴴ: "H", + ᴵ: "I", + ᴶ: "J", + ᴷ: "K", + ᴸ: "L", + ᴹ: "M", + ᴺ: "N", + ᴼ: "O", + ᴾ: "P", + ᴿ: "R", + ᵀ: "T", + ᵁ: "U", + ⱽ: "V", + ᵂ: "W", + ᵃ: "a", + ᵇ: "b", + ᶜ: "c", + ᵈ: "d", + ᵉ: "e", + ᶠ: "f", + ᵍ: "g", + ʰ: "h", + ⁱ: "i", + ʲ: "j", + ᵏ: "k", + ˡ: "l", + ᵐ: "m", + ⁿ: "n", + ᵒ: "o", + ᵖ: "p", + ʳ: "r", + ˢ: "s", + ᵗ: "t", + ᵘ: "u", + ᵛ: "v", + ʷ: "w", + ˣ: "x", + ʸ: "y", + ᶻ: "z", + ᵝ: "β", + ᵞ: "γ", + ᵟ: "δ", + ᵠ: "ϕ", + ᵡ: "χ", + ᶿ: "θ", + }), + $n = { + "́": { text: "\\'", math: "\\acute" }, + "̀": { text: "\\`", math: "\\grave" }, + "̈": { text: '\\"', math: "\\ddot" }, + "̃": { text: "\\~", math: "\\tilde" }, + "̄": { text: "\\=", math: "\\bar" }, + "̆": { text: "\\u", math: "\\breve" }, + "̌": { text: "\\v", math: "\\check" }, + "̂": { text: "\\^", math: "\\hat" }, + "̇": { text: "\\.", math: "\\dot" }, + "̊": { text: "\\r", math: "\\mathring" }, + "̋": { text: "\\H" }, + "̧": { text: "\\c" }, + }, + Zn = { + á: "á", + à: "à", + ä: "ä", + ǟ: "ǟ", + ã: "ã", + ā: "ā", + ă: "ă", + ắ: "ắ", + ằ: "ằ", + ẵ: "ẵ", + ǎ: "ǎ", + â: "â", + ấ: "ấ", + ầ: "ầ", + ẫ: "ẫ", + ȧ: "ȧ", + ǡ: "ǡ", + å: "å", + ǻ: "ǻ", + ḃ: "ḃ", + ć: "ć", + ḉ: "ḉ", + č: "č", + ĉ: "ĉ", + ċ: "ċ", + ç: "ç", + ď: "ď", + ḋ: "ḋ", + ḑ: "ḑ", + é: "é", + è: "è", + ë: "ë", + ẽ: "ẽ", + ē: "ē", + ḗ: "ḗ", + ḕ: "ḕ", + ĕ: "ĕ", + ḝ: "ḝ", + ě: "ě", + ê: "ê", + ế: "ế", + ề: "ề", + ễ: "ễ", + ė: "ė", + ȩ: "ȩ", + ḟ: "ḟ", + ǵ: "ǵ", + ḡ: "ḡ", + ğ: "ğ", + ǧ: "ǧ", + ĝ: "ĝ", + ġ: "ġ", + ģ: "ģ", + ḧ: "ḧ", + ȟ: "ȟ", + ĥ: "ĥ", + ḣ: "ḣ", + ḩ: "ḩ", + í: "í", + ì: "ì", + ï: "ï", + ḯ: "ḯ", + ĩ: "ĩ", + ī: "ī", + ĭ: "ĭ", + ǐ: "ǐ", + î: "î", + ǰ: "ǰ", + ĵ: "ĵ", + ḱ: "ḱ", + ǩ: "ǩ", + ķ: "ķ", + ĺ: "ĺ", + ľ: "ľ", + ļ: "ļ", + ḿ: "ḿ", + ṁ: "ṁ", + ń: "ń", + ǹ: "ǹ", + ñ: "ñ", + ň: "ň", + ṅ: "ṅ", + ņ: "ņ", + ó: "ó", + ò: "ò", + ö: "ö", + ȫ: "ȫ", + õ: "õ", + ṍ: "ṍ", + ṏ: "ṏ", + ȭ: "ȭ", + ō: "ō", + ṓ: "ṓ", + ṑ: "ṑ", + ŏ: "ŏ", + ǒ: "ǒ", + ô: "ô", + ố: "ố", + ồ: "ồ", + ỗ: "ỗ", + ȯ: "ȯ", + ȱ: "ȱ", + ő: "ő", + ṕ: "ṕ", + ṗ: "ṗ", + ŕ: "ŕ", + ř: "ř", + ṙ: "ṙ", + ŗ: "ŗ", + ś: "ś", + ṥ: "ṥ", + š: "š", + ṧ: "ṧ", + ŝ: "ŝ", + ṡ: "ṡ", + ş: "ş", + ẗ: "ẗ", + ť: "ť", + ṫ: "ṫ", + ţ: "ţ", + ú: "ú", + ù: "ù", + ü: "ü", + ǘ: "ǘ", + ǜ: "ǜ", + ǖ: "ǖ", + ǚ: "ǚ", + ũ: "ũ", + ṹ: "ṹ", + ū: "ū", + ṻ: "ṻ", + ŭ: "ŭ", + ǔ: "ǔ", + û: "û", + ů: "ů", + ű: "ű", + ṽ: "ṽ", + ẃ: "ẃ", + ẁ: "ẁ", + ẅ: "ẅ", + ŵ: "ŵ", + ẇ: "ẇ", + ẘ: "ẘ", + ẍ: "ẍ", + ẋ: "ẋ", + ý: "ý", + ỳ: "ỳ", + ÿ: "ÿ", + ỹ: "ỹ", + ȳ: "ȳ", + ŷ: "ŷ", + ẏ: "ẏ", + ẙ: "ẙ", + ź: "ź", + ž: "ž", + ẑ: "ẑ", + ż: "ż", + Á: "Á", + À: "À", + Ä: "Ä", + Ǟ: "Ǟ", + Ã: "Ã", + Ā: "Ā", + Ă: "Ă", + Ắ: "Ắ", + Ằ: "Ằ", + Ẵ: "Ẵ", + Ǎ: "Ǎ", + Â: "Â", + Ấ: "Ấ", + Ầ: "Ầ", + Ẫ: "Ẫ", + Ȧ: "Ȧ", + Ǡ: "Ǡ", + Å: "Å", + Ǻ: "Ǻ", + Ḃ: "Ḃ", + Ć: "Ć", + Ḉ: "Ḉ", + Č: "Č", + Ĉ: "Ĉ", + Ċ: "Ċ", + Ç: "Ç", + Ď: "Ď", + Ḋ: "Ḋ", + Ḑ: "Ḑ", + É: "É", + È: "È", + Ë: "Ë", + Ẽ: "Ẽ", + Ē: "Ē", + Ḗ: "Ḗ", + Ḕ: "Ḕ", + Ĕ: "Ĕ", + Ḝ: "Ḝ", + Ě: "Ě", + Ê: "Ê", + Ế: "Ế", + Ề: "Ề", + Ễ: "Ễ", + Ė: "Ė", + Ȩ: "Ȩ", + Ḟ: "Ḟ", + Ǵ: "Ǵ", + Ḡ: "Ḡ", + Ğ: "Ğ", + Ǧ: "Ǧ", + Ĝ: "Ĝ", + Ġ: "Ġ", + Ģ: "Ģ", + Ḧ: "Ḧ", + Ȟ: "Ȟ", + Ĥ: "Ĥ", + Ḣ: "Ḣ", + Ḩ: "Ḩ", + Í: "Í", + Ì: "Ì", + Ï: "Ï", + Ḯ: "Ḯ", + Ĩ: "Ĩ", + Ī: "Ī", + Ĭ: "Ĭ", + Ǐ: "Ǐ", + Î: "Î", + İ: "İ", + Ĵ: "Ĵ", + Ḱ: "Ḱ", + Ǩ: "Ǩ", + Ķ: "Ķ", + Ĺ: "Ĺ", + Ľ: "Ľ", + Ļ: "Ļ", + Ḿ: "Ḿ", + Ṁ: "Ṁ", + Ń: "Ń", + Ǹ: "Ǹ", + Ñ: "Ñ", + Ň: "Ň", + Ṅ: "Ṅ", + Ņ: "Ņ", + Ó: "Ó", + Ò: "Ò", + Ö: "Ö", + Ȫ: "Ȫ", + Õ: "Õ", + Ṍ: "Ṍ", + Ṏ: "Ṏ", + Ȭ: "Ȭ", + Ō: "Ō", + Ṓ: "Ṓ", + Ṑ: "Ṑ", + Ŏ: "Ŏ", + Ǒ: "Ǒ", + Ô: "Ô", + Ố: "Ố", + Ồ: "Ồ", + Ỗ: "Ỗ", + Ȯ: "Ȯ", + Ȱ: "Ȱ", + Ő: "Ő", + Ṕ: "Ṕ", + Ṗ: "Ṗ", + Ŕ: "Ŕ", + Ř: "Ř", + Ṙ: "Ṙ", + Ŗ: "Ŗ", + Ś: "Ś", + Ṥ: "Ṥ", + Š: "Š", + Ṧ: "Ṧ", + Ŝ: "Ŝ", + Ṡ: "Ṡ", + Ş: "Ş", + Ť: "Ť", + Ṫ: "Ṫ", + Ţ: "Ţ", + Ú: "Ú", + Ù: "Ù", + Ü: "Ü", + Ǘ: "Ǘ", + Ǜ: "Ǜ", + Ǖ: "Ǖ", + Ǚ: "Ǚ", + Ũ: "Ũ", + Ṹ: "Ṹ", + Ū: "Ū", + Ṻ: "Ṻ", + Ŭ: "Ŭ", + Ǔ: "Ǔ", + Û: "Û", + Ů: "Ů", + Ű: "Ű", + Ṽ: "Ṽ", + Ẃ: "Ẃ", + Ẁ: "Ẁ", + Ẅ: "Ẅ", + Ŵ: "Ŵ", + Ẇ: "Ẇ", + Ẍ: "Ẍ", + Ẋ: "Ẋ", + Ý: "Ý", + Ỳ: "Ỳ", + Ÿ: "Ÿ", + Ỹ: "Ỹ", + Ȳ: "Ȳ", + Ŷ: "Ŷ", + Ẏ: "Ẏ", + Ź: "Ź", + Ž: "Ž", + Ẑ: "Ẑ", + Ż: "Ż", + ά: "ά", + ὰ: "ὰ", + ᾱ: "ᾱ", + ᾰ: "ᾰ", + έ: "έ", + ὲ: "ὲ", + ή: "ή", + ὴ: "ὴ", + ί: "ί", + ὶ: "ὶ", + ϊ: "ϊ", + ΐ: "ΐ", + ῒ: "ῒ", + ῑ: "ῑ", + ῐ: "ῐ", + ό: "ό", + ὸ: "ὸ", + ύ: "ύ", + ὺ: "ὺ", + ϋ: "ϋ", + ΰ: "ΰ", + ῢ: "ῢ", + ῡ: "ῡ", + ῠ: "ῠ", + ώ: "ώ", + ὼ: "ὼ", + Ύ: "Ύ", + Ὺ: "Ὺ", + Ϋ: "Ϋ", + Ῡ: "Ῡ", + Ῠ: "Ῠ", + Ώ: "Ώ", + Ὼ: "Ὼ", + }, + Kn = (function () { + function e(e, t) { + (this.mode = void 0), + (this.gullet = void 0), + (this.settings = void 0), + (this.leftrightDepth = void 0), + (this.nextToken = void 0), + (this.mode = "math"), + (this.gullet = new Wn(e, t, this.mode)), + (this.settings = t), + (this.leftrightDepth = 0); + } + var t = e.prototype; + return ( + (t.expect = function (e, t) { + if ((void 0 === t && (t = !0), this.fetch().text !== e)) + throw new n("Expected '" + e + "', got '" + this.fetch().text + "'", this.fetch()); + t && this.consume(); + }), + (t.consume = function () { + this.nextToken = null; + }), + (t.fetch = function () { + return null == this.nextToken && (this.nextToken = this.gullet.expandNextToken()), this.nextToken; + }), + (t.switchMode = function (e) { + (this.mode = e), this.gullet.switchMode(e); + }), + (t.parse = function () { + this.settings.globalGroup || this.gullet.beginGroup(), + this.settings.colorIsTextColor && this.gullet.macros.set("\\color", "\\textcolor"); + try { + var e = this.parseExpression(!1); + return this.expect("EOF"), this.settings.globalGroup || this.gullet.endGroup(), e; + } finally { + this.gullet.endGroups(); + } + }), + (t.subparse = function (e) { + var t = this.nextToken; + this.consume(), this.gullet.pushToken(new Gr("}")), this.gullet.pushTokens(e); + var r = this.parseExpression(!1); + return this.expect("}"), (this.nextToken = t), r; + }), + (t.parseExpression = function (t, r) { + for (var n = []; ; ) { + "math" === this.mode && this.consumeSpaces(); + var a = this.fetch(); + if (-1 !== e.endOfExpression.indexOf(a.text)) break; + if (r && a.text === r) break; + if (t && Cn[a.text] && Cn[a.text].infix) break; + var i = this.parseAtom(r); + if (!i) break; + "internal" !== i.type && n.push(i); + } + return "text" === this.mode && this.formLigatures(n), this.handleInfixNodes(n); + }), + (t.handleInfixNodes = function (e) { + for (var t, r = -1, a = 0; a < e.length; a++) + if ("infix" === e[a].type) { + if (-1 !== r) throw new n("only one infix operator per group", e[a].token); + (r = a), (t = e[a].replaceWith); + } + if (-1 !== r && t) { + var i, + o, + s = e.slice(0, r), + l = e.slice(r + 1); + return ( + (i = 1 === s.length && "ordgroup" === s[0].type ? s[0] : { type: "ordgroup", mode: this.mode, body: s }), + (o = 1 === l.length && "ordgroup" === l[0].type ? l[0] : { type: "ordgroup", mode: this.mode, body: l }), + ["\\\\abovefrac" === t ? this.callFunction(t, [i, e[r], o], []) : this.callFunction(t, [i, o], [])] + ); + } + return e; + }), + (t.handleSupSubscript = function (e) { + var t = this.fetch(), + r = t.text; + this.consume(), this.consumeSpaces(); + var a = this.parseGroup(e); + if (!a) throw new n("Expected group after '" + r + "'", t); + return a; + }), + (t.formatUnsupportedCmd = function (e) { + for (var t = [], r = 0; r < e.length; r++) t.push({ type: "textord", mode: "text", text: e[r] }); + var n = { type: "text", mode: this.mode, body: t }; + return { + type: "color", + mode: this.mode, + color: this.settings.errorColor, + body: [n], + }; + }), + (t.parseAtom = function (t) { + var r, + a, + i = this.parseGroup("atom", t); + if ("text" === this.mode) return i; + for (;;) { + this.consumeSpaces(); + var o = this.fetch(); + if ("\\limits" === o.text || "\\nolimits" === o.text) { + if (i && "op" === i.type) { + var s = "\\limits" === o.text; + (i.limits = s), (i.alwaysHandleSupSub = !0); + } else { + if (!i || "operatorname" !== i.type) throw new n("Limit controls must follow a math operator", o); + i.alwaysHandleSupSub && (i.limits = "\\limits" === o.text); + } + this.consume(); + } else if ("^" === o.text) { + if (r) throw new n("Double superscript", o); + r = this.handleSupSubscript("superscript"); + } else if ("_" === o.text) { + if (a) throw new n("Double subscript", o); + a = this.handleSupSubscript("subscript"); + } else if ("'" === o.text) { + if (r) throw new n("Double superscript", o); + var l = { type: "textord", mode: this.mode, text: "\\prime" }, + h = [l]; + for (this.consume(); "'" === this.fetch().text; ) h.push(l), this.consume(); + "^" === this.fetch().text && h.push(this.handleSupSubscript("superscript")), + (r = { type: "ordgroup", mode: this.mode, body: h }); + } else { + if (!jn[o.text]) break; + var c = jn[o.text], + m = _n.test(o.text); + for (this.consume(); ; ) { + var u = this.fetch().text; + if (!jn[u]) break; + if (_n.test(u) !== m) break; + this.consume(), (c += jn[u]); + } + var p = new e(c, this.settings).parse(); + m ? (a = { type: "ordgroup", mode: "math", body: p }) : (r = { type: "ordgroup", mode: "math", body: p }); + } + } + return r || a ? { type: "supsub", mode: this.mode, base: i, sup: r, sub: a } : i; + }), + (t.parseFunction = function (e, t) { + var r = this.fetch(), + a = r.text, + i = Cn[a]; + if (!i) return null; + if ((this.consume(), t && "atom" !== t && !i.allowedInArgument)) + throw new n("Got function '" + a + "' with no arguments" + (t ? " as " + t : ""), r); + if ("text" === this.mode && !i.allowedInText) throw new n("Can't use function '" + a + "' in text mode", r); + if ("math" === this.mode && !1 === i.allowedInMath) throw new n("Can't use function '" + a + "' in math mode", r); + var o = this.parseArguments(a, i), + s = o.args, + l = o.optArgs; + return this.callFunction(a, s, l, r, e); + }), + (t.callFunction = function (e, t, r, a, i) { + var o = { funcName: e, parser: this, token: a, breakOnTokenText: i }, + s = Cn[e]; + if (s && s.handler) return s.handler(o, t, r); + throw new n("No function handler for " + e); + }), + (t.parseArguments = function (e, t) { + var r = t.numArgs + t.numOptionalArgs; + if (0 === r) return { args: [], optArgs: [] }; + for (var a = [], i = [], o = 0; o < r; o++) { + var s = t.argTypes && t.argTypes[o], + l = o < t.numOptionalArgs; + ((t.primitive && null == s) || ("sqrt" === t.type && 1 === o && null == i[0])) && (s = "primitive"); + var h = this.parseGroupOfType("argument to '" + e + "'", s, l); + if (l) i.push(h); + else { + if (null == h) throw new n("Null argument, please report this as a bug"); + a.push(h); + } + } + return { args: a, optArgs: i }; + }), + (t.parseGroupOfType = function (e, t, r) { + switch (t) { + case "color": + return this.parseColorGroup(r); + case "size": + return this.parseSizeGroup(r); + case "url": + return this.parseUrlGroup(r); + case "math": + case "text": + return this.parseArgumentGroup(r, t); + case "hbox": + var a = this.parseArgumentGroup(r, "text"); + return null != a ? { type: "styling", mode: a.mode, body: [a], style: "text" } : null; + case "raw": + var i = this.parseStringGroup("raw", r); + return null != i ? { type: "raw", mode: "text", string: i.text } : null; + case "primitive": + if (r) throw new n("A primitive argument cannot be optional"); + var o = this.parseGroup(e); + if (null == o) throw new n("Expected group as " + e, this.fetch()); + return o; + case "original": + case null: + case void 0: + return this.parseArgumentGroup(r); + default: + throw new n("Unknown group type as " + e, this.fetch()); + } + }), + (t.consumeSpaces = function () { + for (; " " === this.fetch().text; ) this.consume(); + }), + (t.parseStringGroup = function (e, t) { + var r = this.gullet.scanArgument(t); + if (null == r) return null; + for (var n, a = ""; "EOF" !== (n = this.fetch()).text; ) (a += n.text), this.consume(); + return this.consume(), (r.text = a), r; + }), + (t.parseRegexGroup = function (e, t) { + for (var r, a = this.fetch(), i = a, o = ""; "EOF" !== (r = this.fetch()).text && e.test(o + r.text); ) + (o += (i = r).text), this.consume(); + if ("" === o) throw new n("Invalid " + t + ": '" + a.text + "'", a); + return a.range(i, o); + }), + (t.parseColorGroup = function (e) { + var t = this.parseStringGroup("color", e); + if (null == t) return null; + var r = /^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text); + if (!r) throw new n("Invalid color: '" + t.text + "'", t); + var a = r[0]; + return /^[0-9a-f]{6}$/i.test(a) && (a = "#" + a), { type: "color-token", mode: this.mode, color: a }; + }), + (t.parseSizeGroup = function (e) { + var t, + r = !1; + if ( + (this.gullet.consumeSpaces(), + !(t = + e || "{" === this.gullet.future().text + ? this.parseStringGroup("size", e) + : this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/, "size"))) + ) + return null; + e || 0 !== t.text.length || ((t.text = "0pt"), (r = !0)); + var a = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text); + if (!a) throw new n("Invalid size: '" + t.text + "'", t); + var i = { number: +(a[1] + a[2]), unit: a[3] }; + if (!Y(i)) throw new n("Invalid unit: '" + i.unit + "'", t); + return { type: "size", mode: this.mode, value: i, isBlank: r }; + }), + (t.parseUrlGroup = function (e) { + this.gullet.lexer.setCatcode("%", 13), this.gullet.lexer.setCatcode("~", 12); + var t = this.parseStringGroup("url", e); + if ((this.gullet.lexer.setCatcode("%", 14), this.gullet.lexer.setCatcode("~", 13), null == t)) return null; + var r = t.text.replace(/\\([#$%&~_^{}])/g, "$1"); + return { type: "url", mode: this.mode, url: r }; + }), + (t.parseArgumentGroup = function (e, t) { + var r = this.gullet.scanArgument(e); + if (null == r) return null; + var n = this.mode; + t && this.switchMode(t), this.gullet.beginGroup(); + var a = this.parseExpression(!1, "EOF"); + this.expect("EOF"), this.gullet.endGroup(); + var i = { type: "ordgroup", mode: this.mode, loc: r.loc, body: a }; + return t && this.switchMode(n), i; + }), + (t.parseGroup = function (e, t) { + var r, + a = this.fetch(), + i = a.text; + if ("{" === i || "\\begingroup" === i) { + this.consume(); + var o = "{" === i ? "}" : "\\endgroup"; + this.gullet.beginGroup(); + var s = this.parseExpression(!1, o), + l = this.fetch(); + this.expect(o), + this.gullet.endGroup(), + (r = { + type: "ordgroup", + mode: this.mode, + loc: Fr.range(a, l), + body: s, + semisimple: "\\begingroup" === i || void 0, + }); + } else if (null == (r = this.parseFunction(t, e) || this.parseSymbol()) && "\\" === i[0] && !Xn.hasOwnProperty(i)) { + if (this.settings.throwOnError) throw new n("Undefined control sequence: " + i, a); + (r = this.formatUnsupportedCmd(i)), this.consume(); + } + return r; + }), + (t.formLigatures = function (e) { + for (var t = e.length - 1, r = 0; r < t; ++r) { + var n = e[r], + a = n.text; + "-" === a && + "-" === e[r + 1].text && + (r + 1 < t && "-" === e[r + 2].text + ? (e.splice(r, 3, { + type: "textord", + mode: "text", + loc: Fr.range(n, e[r + 2]), + text: "---", + }), + (t -= 2)) + : (e.splice(r, 2, { + type: "textord", + mode: "text", + loc: Fr.range(n, e[r + 1]), + text: "--", + }), + (t -= 1))), + ("'" !== a && "`" !== a) || + e[r + 1].text !== a || + (e.splice(r, 2, { + type: "textord", + mode: "text", + loc: Fr.range(n, e[r + 1]), + text: a + a, + }), + (t -= 1)); + } + }), + (t.parseSymbol = function () { + var e = this.fetch(), + t = e.text; + if (/^\\verb[^a-zA-Z]/.test(t)) { + this.consume(); + var r = t.slice(5), + a = "*" === r.charAt(0); + if ((a && (r = r.slice(1)), r.length < 2 || r.charAt(0) !== r.slice(-1))) + throw new n("\\verb assertion failed --\n please report what input caused this bug"); + return { type: "verb", mode: "text", body: (r = r.slice(1, -1)), star: a }; + } + Zn.hasOwnProperty(t[0]) && + !he[this.mode][t[0]] && + (this.settings.strict && + "math" === this.mode && + this.settings.reportNonstrict("unicodeTextInMathMode", 'Accented Unicode text character "' + t[0] + '" used in math mode', e), + (t = Zn[t[0]] + t.slice(1))); + var i, + o = Hn.exec(t); + if ((o && ("i" === (t = t.substring(0, o.index)) ? (t = "ı") : "j" === t && (t = "ȷ")), he[this.mode][t])) { + this.settings.strict && + "math" === this.mode && + "ÐÞþ".indexOf(t) >= 0 && + this.settings.reportNonstrict("unicodeTextInMathMode", 'Latin-1/Unicode text character "' + t[0] + '" used in math mode', e); + var s, + l = he[this.mode][t].group, + h = Fr.range(e); + if (oe.hasOwnProperty(l)) { + var c = l; + s = { type: "atom", mode: this.mode, family: c, loc: h, text: t }; + } else s = { type: l, mode: this.mode, loc: h, text: t }; + i = s; + } else { + if (!(t.charCodeAt(0) >= 128)) return null; + this.settings.strict && + (N(t.charCodeAt(0)) + ? "math" === this.mode && + this.settings.reportNonstrict("unicodeTextInMathMode", 'Unicode text character "' + t[0] + '" used in math mode', e) + : this.settings.reportNonstrict( + "unknownSymbol", + 'Unrecognized Unicode character "' + t[0] + '" (' + t.charCodeAt(0) + ")", + e, + )), + (i = { type: "textord", mode: "text", loc: Fr.range(e), text: t }); + } + if ((this.consume(), o)) + for (var m = 0; m < o[0].length; m++) { + var u = o[0][m]; + if (!$n[u]) throw new n("Unknown accent ' " + u + "'", e); + var p = $n[u][this.mode] || $n[u].text; + if (!p) throw new n("Accent " + u + " unsupported in " + this.mode + " mode", e); + i = { + type: "accent", + mode: this.mode, + loc: Fr.range(e), + label: p, + isStretchy: !1, + isShifty: !0, + base: i, + }; + } + return i; + }), + e + ); + })(); + Kn.endOfExpression = ["}", "\\endgroup", "\\end", "\\right", "&"]; + var Jn = function (e, t) { + if (!("string" == typeof e || e instanceof String)) throw new TypeError("KaTeX can only parse string typed expression"); + var r = new Kn(e, t); + delete r.gullet.macros.current["\\df@tag"]; + var a = r.parse(); + if ((delete r.gullet.macros.current["\\current@color"], delete r.gullet.macros.current["\\color"], r.gullet.macros.get("\\df@tag"))) { + if (!t.displayMode) throw new n("\\tag works only in display equations"); + a = [{ type: "tag", mode: "text", body: a, tag: r.subparse([new Gr("\\df@tag")]) }]; + } + return a; + }, + Qn = function (e, t, r) { + t.textContent = ""; + var n = ta(e, r).toNode(); + t.appendChild(n); + }; + "undefined" != typeof document && + "CSS1Compat" !== document.compatMode && + ("undefined" != typeof console && + console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."), + (Qn = function () { + throw new n("KaTeX doesn't work in quirks mode."); + })); + var ea = function (e, t, r) { + if (r.throwOnError || !(e instanceof n)) throw e; + var a = Qe.makeSpan(["katex-error"], [new te(t)]); + return a.setAttribute("title", e.toString()), a.setAttribute("style", "color:" + r.errorColor), a; + }, + ta = function (e, t) { + var r = new v(t); + try { + return (function (e, t, r) { + var n, + a = Lt(r); + if ("mathml" === r.output) return Et(e, t, a, r.displayMode, !0); + if ("html" === r.output) { + var i = zt(e, a); + n = Qe.makeSpan(["katex"], [i]); + } else { + var o = Et(e, t, a, r.displayMode, !1), + s = zt(e, a); + n = Qe.makeSpan(["katex"], [o, s]); + } + return Dt(n, r); + })(Jn(e, r), e, r); + } catch (t) { + return ea(t, e, r); + } + }, + ra = { + version: "0.16.8", + render: Qn, + renderToString: function (e, t) { + return ta(e, t).toMarkup(); + }, + ParseError: n, + SETTINGS_SCHEMA: f, + __parse: function (e, t) { + var r = new v(t); + return Jn(e, r); + }, + __renderToDomTree: ta, + __renderToHTMLTree: function (e, t) { + var r = new v(t); + try { + return (function (e, t, r) { + var n = zt(e, Lt(r)), + a = Qe.makeSpan(["katex"], [n]); + return Dt(a, r); + })(Jn(e, r), 0, r); + } catch (t) { + return ea(t, e, r); + } + }, + __setFontMetrics: function (e, t) { + I[e] = t; + }, + __defineSymbol: ce, + __defineFunction: lt, + __defineMacro: Vr, + __domTree: { + Span: K, + Anchor: J, + SymbolNode: te, + SvgNode: re, + PathNode: ne, + LineNode: ae, + }, + }; + return t.default; + })(); + }), + (e.exports = t()); + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/118-f1de6a20.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/118-f1de6a20.chunk.min.js new file mode 100644 index 000000000..09ac8e69f --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/118-f1de6a20.chunk.min.js @@ -0,0 +1,1787 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [118], + { + 7118: function (t, i, e) { + e.d(i, { + diagram: function () { + return d; + }, + }); + var a = e(9339), + n = e(7274), + r = + (e(7484), + e(7967), + e(7856), + (function () { + var t = function (t, i, e, a) { + for (e = e || {}, a = t.length; a--; e[t[a]] = i); + return e; + }, + i = [1, 3], + e = [1, 5], + a = [1, 6], + n = [1, 7], + r = [1, 8], + s = [1, 10], + l = [1, 5, 14, 16, 18, 20, 21, 26, 28, 29, 30, 31, 32, 38, 39, 40, 41, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60], + o = [1, 5, 7, 14, 16, 18, 20, 21, 26, 28, 29, 30, 31, 32, 38, 39, 40, 41, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60], + h = [38, 39, 40], + c = [2, 8], + d = [1, 19], + u = [1, 23], + x = [1, 24], + g = [1, 25], + f = [1, 26], + y = [1, 27], + p = [1, 29], + q = [1, 30], + T = [1, 31], + _ = [1, 32], + m = [1, 33], + A = [1, 34], + b = [1, 37], + S = [1, 38], + k = [1, 39], + v = [1, 40], + F = [1, 41], + P = [1, 42], + C = [1, 43], + L = [1, 44], + D = [1, 45], + z = [1, 46], + E = [1, 47], + I = [1, 48], + B = [1, 49], + w = [1, 52], + R = [1, 67], + W = [1, 68], + N = [5, 23, 27, 38, 39, 40, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61], + U = [5, 7, 38, 39, 40, 41], + Q = { + trace: function () {}, + yy: {}, + symbols_: { + error: 2, + start: 3, + eol: 4, + SPACE: 5, + directive: 6, + QUADRANT: 7, + document: 8, + line: 9, + statement: 10, + axisDetails: 11, + quadrantDetails: 12, + points: 13, + title: 14, + title_value: 15, + acc_title: 16, + acc_title_value: 17, + acc_descr: 18, + acc_descr_value: 19, + acc_descr_multiline_value: 20, + section: 21, + text: 22, + point_start: 23, + point_x: 24, + point_y: 25, + "X-AXIS": 26, + "AXIS-TEXT-DELIMITER": 27, + "Y-AXIS": 28, + QUADRANT_1: 29, + QUADRANT_2: 30, + QUADRANT_3: 31, + QUADRANT_4: 32, + openDirective: 33, + typeDirective: 34, + closeDirective: 35, + ":": 36, + argDirective: 37, + NEWLINE: 38, + SEMI: 39, + EOF: 40, + open_directive: 41, + type_directive: 42, + arg_directive: 43, + close_directive: 44, + alphaNumToken: 45, + textNoTagsToken: 46, + STR: 47, + MD_STR: 48, + alphaNum: 49, + PUNCTUATION: 50, + AMP: 51, + NUM: 52, + ALPHA: 53, + COMMA: 54, + PLUS: 55, + EQUALS: 56, + MULT: 57, + DOT: 58, + BRKT: 59, + UNDERSCORE: 60, + MINUS: 61, + $accept: 0, + $end: 1, + }, + terminals_: { + 2: "error", + 5: "SPACE", + 7: "QUADRANT", + 14: "title", + 15: "title_value", + 16: "acc_title", + 17: "acc_title_value", + 18: "acc_descr", + 19: "acc_descr_value", + 20: "acc_descr_multiline_value", + 21: "section", + 23: "point_start", + 24: "point_x", + 25: "point_y", + 26: "X-AXIS", + 27: "AXIS-TEXT-DELIMITER", + 28: "Y-AXIS", + 29: "QUADRANT_1", + 30: "QUADRANT_2", + 31: "QUADRANT_3", + 32: "QUADRANT_4", + 36: ":", + 38: "NEWLINE", + 39: "SEMI", + 40: "EOF", + 41: "open_directive", + 42: "type_directive", + 43: "arg_directive", + 44: "close_directive", + 47: "STR", + 48: "MD_STR", + 50: "PUNCTUATION", + 51: "AMP", + 52: "NUM", + 53: "ALPHA", + 54: "COMMA", + 55: "PLUS", + 56: "EQUALS", + 57: "MULT", + 58: "DOT", + 59: "BRKT", + 60: "UNDERSCORE", + 61: "MINUS", + }, + productions_: [ + 0, + [3, 2], + [3, 2], + [3, 2], + [3, 2], + [8, 0], + [8, 2], + [9, 2], + [10, 0], + [10, 2], + [10, 1], + [10, 1], + [10, 1], + [10, 2], + [10, 2], + [10, 2], + [10, 1], + [10, 1], + [10, 1], + [13, 4], + [11, 4], + [11, 3], + [11, 2], + [11, 4], + [11, 3], + [11, 2], + [12, 2], + [12, 2], + [12, 2], + [12, 2], + [6, 3], + [6, 5], + [4, 1], + [4, 1], + [4, 1], + [33, 1], + [34, 1], + [37, 1], + [35, 1], + [22, 1], + [22, 2], + [22, 1], + [22, 1], + [49, 1], + [49, 2], + [45, 1], + [45, 1], + [45, 1], + [45, 1], + [45, 1], + [45, 1], + [45, 1], + [45, 1], + [45, 1], + [45, 1], + [45, 1], + [46, 1], + [46, 1], + [46, 1], + ], + performAction: function (t, i, e, a, n, r, s) { + var l = r.length - 1; + switch (n) { + case 13: + (this.$ = r[l].trim()), a.setDiagramTitle(this.$); + break; + case 14: + (this.$ = r[l].trim()), a.setAccTitle(this.$); + break; + case 15: + case 16: + (this.$ = r[l].trim()), a.setAccDescription(this.$); + break; + case 17: + a.addSection(r[l].substr(8)), (this.$ = r[l].substr(8)); + break; + case 19: + a.addPoint(r[l - 3], r[l - 1], r[l]); + break; + case 20: + a.setXAxisLeftText(r[l - 2]), a.setXAxisRightText(r[l]); + break; + case 21: + (r[l - 1].text += " ⟶ "), a.setXAxisLeftText(r[l - 1]); + break; + case 22: + a.setXAxisLeftText(r[l]); + break; + case 23: + a.setYAxisBottomText(r[l - 2]), a.setYAxisTopText(r[l]); + break; + case 24: + (r[l - 1].text += " ⟶ "), a.setYAxisBottomText(r[l - 1]); + break; + case 25: + a.setYAxisBottomText(r[l]); + break; + case 26: + a.setQuadrant1Text(r[l]); + break; + case 27: + a.setQuadrant2Text(r[l]); + break; + case 28: + a.setQuadrant3Text(r[l]); + break; + case 29: + a.setQuadrant4Text(r[l]); + break; + case 35: + a.parseDirective("%%{", "open_directive"); + break; + case 36: + a.parseDirective(r[l], "type_directive"); + break; + case 37: + (r[l] = r[l].trim().replace(/'/g, '"')), a.parseDirective(r[l], "arg_directive"); + break; + case 38: + a.parseDirective("}%%", "close_directive", "quadrantChart"); + break; + case 39: + case 41: + this.$ = { text: r[l], type: "text" }; + break; + case 40: + this.$ = { text: r[l - 1].text + "" + r[l], type: r[l - 1].type }; + break; + case 42: + this.$ = { text: r[l], type: "markdown" }; + break; + case 43: + this.$ = r[l]; + break; + case 44: + this.$ = r[l - 1] + "" + r[l]; + } + }, + table: [ + { 3: 1, 4: 2, 5: i, 6: 4, 7: e, 33: 9, 38: a, 39: n, 40: r, 41: s }, + { 1: [3] }, + { 3: 11, 4: 2, 5: i, 6: 4, 7: e, 33: 9, 38: a, 39: n, 40: r, 41: s }, + { 3: 12, 4: 2, 5: i, 6: 4, 7: e, 33: 9, 38: a, 39: n, 40: r, 41: s }, + { 3: 13, 4: 2, 5: i, 6: 4, 7: e, 33: 9, 38: a, 39: n, 40: r, 41: s }, + t(l, [2, 5], { 8: 14 }), + t(o, [2, 32]), + t(o, [2, 33]), + t(o, [2, 34]), + { 34: 15, 42: [1, 16] }, + { 42: [2, 35] }, + { 1: [2, 1] }, + { 1: [2, 2] }, + { 1: [2, 3] }, + t(h, c, { + 33: 9, + 9: 17, + 10: 18, + 11: 20, + 12: 21, + 13: 22, + 6: 28, + 22: 35, + 45: 36, + 1: [2, 4], + 5: d, + 14: u, + 16: x, + 18: g, + 20: f, + 21: y, + 26: p, + 28: q, + 29: T, + 30: _, + 31: m, + 32: A, + 41: s, + 47: b, + 48: S, + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + }), + { 35: 50, 36: [1, 51], 44: w }, + t([36, 44], [2, 36]), + t(l, [2, 6]), + { 4: 53, 38: a, 39: n, 40: r }, + t(h, c, { + 33: 9, + 11: 20, + 12: 21, + 13: 22, + 6: 28, + 22: 35, + 45: 36, + 10: 54, + 5: d, + 14: u, + 16: x, + 18: g, + 20: f, + 21: y, + 26: p, + 28: q, + 29: T, + 30: _, + 31: m, + 32: A, + 41: s, + 47: b, + 48: S, + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + }), + t(h, [2, 10]), + t(h, [2, 11]), + t(h, [2, 12]), + { 15: [1, 55] }, + { 17: [1, 56] }, + { 19: [1, 57] }, + t(h, [2, 16]), + t(h, [2, 17]), + t(h, [2, 18]), + { + 22: 58, + 45: 36, + 47: b, + 48: S, + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + }, + { + 22: 59, + 45: 36, + 47: b, + 48: S, + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + }, + { + 22: 60, + 45: 36, + 47: b, + 48: S, + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + }, + { + 22: 61, + 45: 36, + 47: b, + 48: S, + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + }, + { + 22: 62, + 45: 36, + 47: b, + 48: S, + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + }, + { + 22: 63, + 45: 36, + 47: b, + 48: S, + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + }, + { + 5: R, + 23: [1, 64], + 45: 66, + 46: 65, + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + 61: W, + }, + t(N, [2, 39]), + t(N, [2, 41]), + t(N, [2, 42]), + t(N, [2, 45]), + t(N, [2, 46]), + t(N, [2, 47]), + t(N, [2, 48]), + t(N, [2, 49]), + t(N, [2, 50]), + t(N, [2, 51]), + t(N, [2, 52]), + t(N, [2, 53]), + t(N, [2, 54]), + t(N, [2, 55]), + t(U, [2, 30]), + { 37: 69, 43: [1, 70] }, + t(U, [2, 38]), + t(l, [2, 7]), + t(h, [2, 9]), + t(h, [2, 13]), + t(h, [2, 14]), + t(h, [2, 15]), + t(h, [2, 22], { + 46: 65, + 45: 66, + 5: R, + 27: [1, 71], + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + 61: W, + }), + t(h, [2, 25], { + 46: 65, + 45: 66, + 5: R, + 27: [1, 72], + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + 61: W, + }), + t(h, [2, 26], { + 46: 65, + 45: 66, + 5: R, + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + 61: W, + }), + t(h, [2, 27], { + 46: 65, + 45: 66, + 5: R, + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + 61: W, + }), + t(h, [2, 28], { + 46: 65, + 45: 66, + 5: R, + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + 61: W, + }), + t(h, [2, 29], { + 46: 65, + 45: 66, + 5: R, + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + 61: W, + }), + { 24: [1, 73] }, + t(N, [2, 40]), + t(N, [2, 56]), + t(N, [2, 57]), + t(N, [2, 58]), + { 35: 74, 44: w }, + { 44: [2, 37] }, + t(h, [2, 21], { + 45: 36, + 22: 75, + 47: b, + 48: S, + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + }), + t(h, [2, 24], { + 45: 36, + 22: 76, + 47: b, + 48: S, + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + }), + { 25: [1, 77] }, + t(U, [2, 31]), + t(h, [2, 20], { + 46: 65, + 45: 66, + 5: R, + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + 61: W, + }), + t(h, [2, 23], { + 46: 65, + 45: 66, + 5: R, + 50: k, + 51: v, + 52: F, + 53: P, + 54: C, + 55: L, + 56: D, + 57: z, + 58: E, + 59: I, + 60: B, + 61: W, + }), + t(h, [2, 19]), + ], + defaultActions: { 10: [2, 35], 11: [2, 1], 12: [2, 2], 13: [2, 3], 70: [2, 37] }, + parseError: function (t, i) { + if (!i.recoverable) { + var e = new Error(t); + throw ((e.hash = i), e); + } + this.trace(t); + }, + parse: function (t) { + var i = [0], + e = [], + a = [null], + n = [], + r = this.table, + s = "", + l = 0, + o = 0, + h = n.slice.call(arguments, 1), + c = Object.create(this.lexer), + d = { yy: {} }; + for (var u in this.yy) Object.prototype.hasOwnProperty.call(this.yy, u) && (d.yy[u] = this.yy[u]); + c.setInput(t, d.yy), (d.yy.lexer = c), (d.yy.parser = this), void 0 === c.yylloc && (c.yylloc = {}); + var x = c.yylloc; + n.push(x); + var g = c.options && c.options.ranges; + "function" == typeof d.yy.parseError + ? (this.parseError = d.yy.parseError) + : (this.parseError = Object.getPrototypeOf(this).parseError); + for (var f, y, p, q, T, _, m, A, b, S = {}; ; ) { + if ( + ((y = i[i.length - 1]), + this.defaultActions[y] + ? (p = this.defaultActions[y]) + : (null == f && + ((b = void 0), + "number" != typeof (b = e.pop() || c.lex() || 1) && + (b instanceof Array && (b = (e = b).pop()), (b = this.symbols_[b] || b)), + (f = b)), + (p = r[y] && r[y][f])), + void 0 === p || !p.length || !p[0]) + ) { + var k; + for (T in ((A = []), r[y])) this.terminals_[T] && T > 2 && A.push("'" + this.terminals_[T] + "'"); + (k = c.showPosition + ? "Parse error on line " + + (l + 1) + + ":\n" + + c.showPosition() + + "\nExpecting " + + A.join(", ") + + ", got '" + + (this.terminals_[f] || f) + + "'" + : "Parse error on line " + (l + 1) + ": Unexpected " + (1 == f ? "end of input" : "'" + (this.terminals_[f] || f) + "'")), + this.parseError(k, { + text: c.match, + token: this.terminals_[f] || f, + line: c.yylineno, + loc: x, + expected: A, + }); + } + if (p[0] instanceof Array && p.length > 1) + throw new Error("Parse Error: multiple actions possible at state: " + y + ", token: " + f); + switch (p[0]) { + case 1: + i.push(f), + a.push(c.yytext), + n.push(c.yylloc), + i.push(p[1]), + (f = null), + (o = c.yyleng), + (s = c.yytext), + (l = c.yylineno), + (x = c.yylloc); + break; + case 2: + if ( + ((_ = this.productions_[p[1]][1]), + (S.$ = a[a.length - _]), + (S._$ = { + first_line: n[n.length - (_ || 1)].first_line, + last_line: n[n.length - 1].last_line, + first_column: n[n.length - (_ || 1)].first_column, + last_column: n[n.length - 1].last_column, + }), + g && (S._$.range = [n[n.length - (_ || 1)].range[0], n[n.length - 1].range[1]]), + void 0 !== (q = this.performAction.apply(S, [s, o, l, d.yy, p[1], a, n].concat(h)))) + ) + return q; + _ && ((i = i.slice(0, -1 * _ * 2)), (a = a.slice(0, -1 * _)), (n = n.slice(0, -1 * _))), + i.push(this.productions_[p[1]][0]), + a.push(S.$), + n.push(S._$), + (m = r[i[i.length - 2]][i[i.length - 1]]), + i.push(m); + break; + case 3: + return !0; + } + } + return !0; + }, + }, + H = { + EOF: 1, + parseError: function (t, i) { + if (!this.yy.parser) throw new Error(t); + this.yy.parser.parseError(t, i); + }, + setInput: function (t, i) { + return ( + (this.yy = i || this.yy || {}), + (this._input = t), + (this._more = this._backtrack = this.done = !1), + (this.yylineno = this.yyleng = 0), + (this.yytext = this.matched = this.match = ""), + (this.conditionStack = ["INITIAL"]), + (this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0, + }), + this.options.ranges && (this.yylloc.range = [0, 0]), + (this.offset = 0), + this + ); + }, + input: function () { + var t = this._input[0]; + return ( + (this.yytext += t), + this.yyleng++, + this.offset++, + (this.match += t), + (this.matched += t), + t.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, + this.options.ranges && this.yylloc.range[1]++, + (this._input = this._input.slice(1)), + t + ); + }, + unput: function (t) { + var i = t.length, + e = t.split(/(?:\r\n?|\n)/g); + (this._input = t + this._input), (this.yytext = this.yytext.substr(0, this.yytext.length - i)), (this.offset -= i); + var a = this.match.split(/(?:\r\n?|\n)/g); + (this.match = this.match.substr(0, this.match.length - 1)), + (this.matched = this.matched.substr(0, this.matched.length - 1)), + e.length - 1 && (this.yylineno -= e.length - 1); + var n = this.yylloc.range; + return ( + (this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: e + ? (e.length === a.length ? this.yylloc.first_column : 0) + a[a.length - e.length].length - e[0].length + : this.yylloc.first_column - i, + }), + this.options.ranges && (this.yylloc.range = [n[0], n[0] + this.yyleng - i]), + (this.yyleng = this.yytext.length), + this + ); + }, + more: function () { + return (this._more = !0), this; + }, + reject: function () { + return this.options.backtrack_lexer + ? ((this._backtrack = !0), this) + : this.parseError( + "Lexical error on line " + + (this.yylineno + 1) + + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + + this.showPosition(), + { text: "", token: null, line: this.yylineno }, + ); + }, + less: function (t) { + this.unput(this.match.slice(t)); + }, + pastInput: function () { + var t = this.matched.substr(0, this.matched.length - this.match.length); + return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, ""); + }, + upcomingInput: function () { + var t = this.match; + return ( + t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "") + ); + }, + showPosition: function () { + var t = this.pastInput(), + i = new Array(t.length + 1).join("-"); + return t + this.upcomingInput() + "\n" + i + "^"; + }, + test_match: function (t, i) { + var e, a, n; + if ( + (this.options.backtrack_lexer && + ((n = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column, + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done, + }), + this.options.ranges && (n.yylloc.range = this.yylloc.range.slice(0))), + (a = t[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += a.length), + (this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: a ? a[a.length - 1].length - a[a.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length, + }), + (this.yytext += t[0]), + (this.match += t[0]), + (this.matches = t), + (this.yyleng = this.yytext.length), + this.options.ranges && (this.yylloc.range = [this.offset, (this.offset += this.yyleng)]), + (this._more = !1), + (this._backtrack = !1), + (this._input = this._input.slice(t[0].length)), + (this.matched += t[0]), + (e = this.performAction.call(this, this.yy, this, i, this.conditionStack[this.conditionStack.length - 1])), + this.done && this._input && (this.done = !1), + e) + ) + return e; + if (this._backtrack) { + for (var r in n) this[r] = n[r]; + return !1; + } + return !1; + }, + next: function () { + if (this.done) return this.EOF; + var t, i, e, a; + this._input || (this.done = !0), this._more || ((this.yytext = ""), (this.match = "")); + for (var n = this._currentRules(), r = 0; r < n.length; r++) + if ((e = this._input.match(this.rules[n[r]])) && (!i || e[0].length > i[0].length)) { + if (((i = e), (a = r), this.options.backtrack_lexer)) { + if (!1 !== (t = this.test_match(e, n[r]))) return t; + if (this._backtrack) { + i = !1; + continue; + } + return !1; + } + if (!this.options.flex) break; + } + return i + ? !1 !== (t = this.test_match(i, n[a])) && t + : "" === this._input + ? this.EOF + : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno, + }); + }, + lex: function () { + return this.next() || this.lex(); + }, + begin: function (t) { + this.conditionStack.push(t); + }, + popState: function () { + return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]; + }, + _currentRules: function () { + return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] + ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules + : this.conditions.INITIAL.rules; + }, + topState: function (t) { + return (t = this.conditionStack.length - 1 - Math.abs(t || 0)) >= 0 ? this.conditionStack[t] : "INITIAL"; + }, + pushState: function (t) { + this.begin(t); + }, + stateStackSize: function () { + return this.conditionStack.length; + }, + options: { "case-insensitive": !0 }, + performAction: function (t, i, e, a) { + switch (e) { + case 0: + return this.begin("open_directive"), 41; + case 1: + return this.begin("type_directive"), 42; + case 2: + return this.popState(), this.begin("arg_directive"), 36; + case 3: + return this.popState(), this.popState(), 44; + case 4: + return 43; + case 5: + case 6: + case 8: + break; + case 7: + return 38; + case 9: + return this.begin("title"), 14; + case 10: + return this.popState(), "title_value"; + case 11: + return this.begin("acc_title"), 16; + case 12: + return this.popState(), "acc_title_value"; + case 13: + return this.begin("acc_descr"), 18; + case 14: + return this.popState(), "acc_descr_value"; + case 15: + this.begin("acc_descr_multiline"); + break; + case 16: + case 27: + case 29: + case 33: + this.popState(); + break; + case 17: + return "acc_descr_multiline_value"; + case 18: + return 26; + case 19: + return 28; + case 20: + return 27; + case 21: + return 29; + case 22: + return 30; + case 23: + return 31; + case 24: + return 32; + case 25: + this.begin("md_string"); + break; + case 26: + return "MD_STR"; + case 28: + this.begin("string"); + break; + case 30: + return "STR"; + case 31: + return this.begin("point_start"), 23; + case 32: + return this.begin("point_x"), 24; + case 34: + this.popState(), this.begin("point_y"); + break; + case 35: + return this.popState(), 25; + case 36: + return 7; + case 37: + return 53; + case 38: + return "COLON"; + case 39: + return 55; + case 40: + return 54; + case 41: + case 42: + return 56; + case 43: + return 57; + case 44: + return 59; + case 45: + return 60; + case 46: + return 58; + case 47: + return 51; + case 48: + return 61; + case 49: + return 52; + case 50: + return 5; + case 51: + return 39; + case 52: + return 50; + case 53: + return 40; + } + }, + rules: [ + /^(?:%%\{)/i, + /^(?:((?:(?!\}%%)[^:.])*))/i, + /^(?::)/i, + /^(?:\}%%)/i, + /^(?:((?:(?!\}%%).|\n)*))/i, + /^(?:%%(?!\{)[^\n]*)/i, + /^(?:[^\}]%%[^\n]*)/i, + /^(?:[\n\r]+)/i, + /^(?:%%[^\n]*)/i, + /^(?:title\b)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accTitle\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*\{\s*)/i, + /^(?:[\}])/i, + /^(?:[^\}]*)/i, + /^(?: *x-axis *)/i, + /^(?: *y-axis *)/i, + /^(?: *--+> *)/i, + /^(?: *quadrant-1 *)/i, + /^(?: *quadrant-2 *)/i, + /^(?: *quadrant-3 *)/i, + /^(?: *quadrant-4 *)/i, + /^(?:["][`])/i, + /^(?:[^`"]+)/i, + /^(?:[`]["])/i, + /^(?:["])/i, + /^(?:["])/i, + /^(?:[^"]*)/i, + /^(?:\s*:\s*\[\s*)/i, + /^(?:(1)|(0(.\d+)?))/i, + /^(?:\s*\] *)/i, + /^(?:\s*,\s*)/i, + /^(?:(1)|(0(.\d+)?))/i, + /^(?: *quadrantChart *)/i, + /^(?:[A-Za-z]+)/i, + /^(?::)/i, + /^(?:\+)/i, + /^(?:,)/i, + /^(?:=)/i, + /^(?:=)/i, + /^(?:\*)/i, + /^(?:#)/i, + /^(?:[\_])/i, + /^(?:\.)/i, + /^(?:&)/i, + /^(?:-)/i, + /^(?:[0-9]+)/i, + /^(?:\s)/i, + /^(?:;)/i, + /^(?:[!"#$%&'*+,-.`?\\_/])/i, + /^(?:$)/i, + ], + conditions: { + point_y: { rules: [35], inclusive: !1 }, + point_x: { rules: [34], inclusive: !1 }, + point_start: { rules: [32, 33], inclusive: !1 }, + acc_descr_multiline: { rules: [16, 17], inclusive: !1 }, + acc_descr: { rules: [14], inclusive: !1 }, + acc_title: { rules: [12], inclusive: !1 }, + close_directive: { rules: [], inclusive: !1 }, + arg_directive: { rules: [3, 4], inclusive: !1 }, + type_directive: { rules: [2, 3], inclusive: !1 }, + open_directive: { rules: [1], inclusive: !1 }, + title: { rules: [10], inclusive: !1 }, + md_string: { rules: [26, 27], inclusive: !1 }, + string: { rules: [29, 30], inclusive: !1 }, + INITIAL: { + rules: [ + 0, 5, 6, 7, 8, 9, 11, 13, 15, 18, 19, 20, 21, 22, 23, 24, 25, 28, 31, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, + ], + inclusive: !0, + }, + }, + }; + function $() { + this.yy = {}; + } + return (Q.lexer = H), ($.prototype = Q), (Q.Parser = $), new $(); + })()); + r.parser = r; + const s = r, + l = (0, a.G)(), + o = (0, a.c)(); + function h(t) { + return (0, a.d)(t.trim(), o); + } + const c = new (class { + constructor() { + (this.config = this.getDefaultConfig()), (this.themeConfig = this.getDefaultThemeConfig()), (this.data = this.getDefaultData()); + } + getDefaultData() { + return { + titleText: "", + quadrant1Text: "", + quadrant2Text: "", + quadrant3Text: "", + quadrant4Text: "", + xAxisLeftText: "", + xAxisRightText: "", + yAxisBottomText: "", + yAxisTopText: "", + points: [], + }; + } + getDefaultConfig() { + var t, i, e, n, r, s, l, o, h, c, d, u, x, g, f, y, p, q; + return { + showXAxis: !0, + showYAxis: !0, + showTitle: !0, + chartHeight: (null == (t = a.C.quadrantChart) ? void 0 : t.chartWidth) || 500, + chartWidth: (null == (i = a.C.quadrantChart) ? void 0 : i.chartHeight) || 500, + titlePadding: (null == (e = a.C.quadrantChart) ? void 0 : e.titlePadding) || 10, + titleFontSize: (null == (n = a.C.quadrantChart) ? void 0 : n.titleFontSize) || 20, + quadrantPadding: (null == (r = a.C.quadrantChart) ? void 0 : r.quadrantPadding) || 5, + xAxisLabelPadding: (null == (s = a.C.quadrantChart) ? void 0 : s.xAxisLabelPadding) || 5, + yAxisLabelPadding: (null == (l = a.C.quadrantChart) ? void 0 : l.yAxisLabelPadding) || 5, + xAxisLabelFontSize: (null == (o = a.C.quadrantChart) ? void 0 : o.xAxisLabelFontSize) || 16, + yAxisLabelFontSize: (null == (h = a.C.quadrantChart) ? void 0 : h.yAxisLabelFontSize) || 16, + quadrantLabelFontSize: (null == (c = a.C.quadrantChart) ? void 0 : c.quadrantLabelFontSize) || 16, + quadrantTextTopPadding: (null == (d = a.C.quadrantChart) ? void 0 : d.quadrantTextTopPadding) || 5, + pointTextPadding: (null == (u = a.C.quadrantChart) ? void 0 : u.pointTextPadding) || 5, + pointLabelFontSize: (null == (x = a.C.quadrantChart) ? void 0 : x.pointLabelFontSize) || 12, + pointRadius: (null == (g = a.C.quadrantChart) ? void 0 : g.pointRadius) || 5, + xAxisPosition: (null == (f = a.C.quadrantChart) ? void 0 : f.xAxisPosition) || "top", + yAxisPosition: (null == (y = a.C.quadrantChart) ? void 0 : y.yAxisPosition) || "left", + quadrantInternalBorderStrokeWidth: (null == (p = a.C.quadrantChart) ? void 0 : p.quadrantInternalBorderStrokeWidth) || 1, + quadrantExternalBorderStrokeWidth: (null == (q = a.C.quadrantChart) ? void 0 : q.quadrantExternalBorderStrokeWidth) || 2, + }; + } + getDefaultThemeConfig() { + return { + quadrant1Fill: l.quadrant1Fill, + quadrant2Fill: l.quadrant2Fill, + quadrant3Fill: l.quadrant3Fill, + quadrant4Fill: l.quadrant4Fill, + quadrant1TextFill: l.quadrant1TextFill, + quadrant2TextFill: l.quadrant2TextFill, + quadrant3TextFill: l.quadrant3TextFill, + quadrant4TextFill: l.quadrant4TextFill, + quadrantPointFill: l.quadrantPointFill, + quadrantPointTextFill: l.quadrantPointTextFill, + quadrantXAxisTextFill: l.quadrantXAxisTextFill, + quadrantYAxisTextFill: l.quadrantYAxisTextFill, + quadrantTitleFill: l.quadrantTitleFill, + quadrantInternalBorderStrokeFill: l.quadrantInternalBorderStrokeFill, + quadrantExternalBorderStrokeFill: l.quadrantExternalBorderStrokeFill, + }; + } + clear() { + (this.config = this.getDefaultConfig()), + (this.themeConfig = this.getDefaultThemeConfig()), + (this.data = this.getDefaultData()), + a.l.info("clear called"); + } + setData(t) { + this.data = { ...this.data, ...t }; + } + addPoints(t) { + this.data.points = [...t, ...this.data.points]; + } + setConfig(t) { + a.l.trace("setConfig called with: ", t), (this.config = { ...this.config, ...t }); + } + setThemeConfig(t) { + a.l.trace("setThemeConfig called with: ", t), (this.themeConfig = { ...this.themeConfig, ...t }); + } + calculateSpace(t, i, e, a) { + const n = 2 * this.config.xAxisLabelPadding + this.config.xAxisLabelFontSize, + r = { top: "top" === t && i ? n : 0, bottom: "bottom" === t && i ? n : 0 }, + s = 2 * this.config.yAxisLabelPadding + this.config.yAxisLabelFontSize, + l = { + left: "left" === this.config.yAxisPosition && e ? s : 0, + right: "right" === this.config.yAxisPosition && e ? s : 0, + }, + o = this.config.titleFontSize + 2 * this.config.titlePadding, + h = { top: a ? o : 0 }, + c = this.config.quadrantPadding + l.left, + d = this.config.quadrantPadding + r.top + h.top, + u = this.config.chartWidth - 2 * this.config.quadrantPadding - l.left - l.right, + x = this.config.chartHeight - 2 * this.config.quadrantPadding - r.top - r.bottom - h.top; + return { + xAxisSpace: r, + yAxisSpace: l, + titleSpace: h, + quadrantSpace: { + quadrantLeft: c, + quadrantTop: d, + quadrantWidth: u, + quadrantHalfWidth: u / 2, + quadrantHeight: x, + quadrantHalfHeight: x / 2, + }, + }; + } + getAxisLabels(t, i, e, a) { + const { quadrantSpace: n, titleSpace: r } = a, + { quadrantHalfHeight: s, quadrantHeight: l, quadrantLeft: o, quadrantHalfWidth: h, quadrantTop: c, quadrantWidth: d } = n, + u = 0 === this.data.points.length, + x = []; + return ( + this.data.xAxisLeftText && + i && + x.push({ + text: this.data.xAxisLeftText, + fill: this.themeConfig.quadrantXAxisTextFill, + x: o + (u ? h / 2 : 0), + y: "top" === t ? this.config.xAxisLabelPadding + r.top : this.config.xAxisLabelPadding + c + l + this.config.quadrantPadding, + fontSize: this.config.xAxisLabelFontSize, + verticalPos: u ? "center" : "left", + horizontalPos: "top", + rotation: 0, + }), + this.data.xAxisRightText && + i && + x.push({ + text: this.data.xAxisRightText, + fill: this.themeConfig.quadrantXAxisTextFill, + x: o + h + (u ? h / 2 : 0), + y: "top" === t ? this.config.xAxisLabelPadding + r.top : this.config.xAxisLabelPadding + c + l + this.config.quadrantPadding, + fontSize: this.config.xAxisLabelFontSize, + verticalPos: u ? "center" : "left", + horizontalPos: "top", + rotation: 0, + }), + this.data.yAxisBottomText && + e && + x.push({ + text: this.data.yAxisBottomText, + fill: this.themeConfig.quadrantYAxisTextFill, + x: + "left" === this.config.yAxisPosition + ? this.config.yAxisLabelPadding + : this.config.yAxisLabelPadding + o + d + this.config.quadrantPadding, + y: c + l - (u ? s / 2 : 0), + fontSize: this.config.yAxisLabelFontSize, + verticalPos: u ? "center" : "left", + horizontalPos: "top", + rotation: -90, + }), + this.data.yAxisTopText && + e && + x.push({ + text: this.data.yAxisTopText, + fill: this.themeConfig.quadrantYAxisTextFill, + x: + "left" === this.config.yAxisPosition + ? this.config.yAxisLabelPadding + : this.config.yAxisLabelPadding + o + d + this.config.quadrantPadding, + y: c + s - (u ? s / 2 : 0), + fontSize: this.config.yAxisLabelFontSize, + verticalPos: u ? "center" : "left", + horizontalPos: "top", + rotation: -90, + }), + x + ); + } + getQuadrants(t) { + const { quadrantSpace: i } = t, + { quadrantHalfHeight: e, quadrantLeft: a, quadrantHalfWidth: n, quadrantTop: r } = i, + s = [ + { + text: { + text: this.data.quadrant1Text, + fill: this.themeConfig.quadrant1TextFill, + x: 0, + y: 0, + fontSize: this.config.quadrantLabelFontSize, + verticalPos: "center", + horizontalPos: "middle", + rotation: 0, + }, + x: a + n, + y: r, + width: n, + height: e, + fill: this.themeConfig.quadrant1Fill, + }, + { + text: { + text: this.data.quadrant2Text, + fill: this.themeConfig.quadrant2TextFill, + x: 0, + y: 0, + fontSize: this.config.quadrantLabelFontSize, + verticalPos: "center", + horizontalPos: "middle", + rotation: 0, + }, + x: a, + y: r, + width: n, + height: e, + fill: this.themeConfig.quadrant2Fill, + }, + { + text: { + text: this.data.quadrant3Text, + fill: this.themeConfig.quadrant3TextFill, + x: 0, + y: 0, + fontSize: this.config.quadrantLabelFontSize, + verticalPos: "center", + horizontalPos: "middle", + rotation: 0, + }, + x: a, + y: r + e, + width: n, + height: e, + fill: this.themeConfig.quadrant3Fill, + }, + { + text: { + text: this.data.quadrant4Text, + fill: this.themeConfig.quadrant4TextFill, + x: 0, + y: 0, + fontSize: this.config.quadrantLabelFontSize, + verticalPos: "center", + horizontalPos: "middle", + rotation: 0, + }, + x: a + n, + y: r + e, + width: n, + height: e, + fill: this.themeConfig.quadrant4Fill, + }, + ]; + for (const t of s) + (t.text.x = t.x + t.width / 2), + 0 === this.data.points.length + ? ((t.text.y = t.y + t.height / 2), (t.text.horizontalPos = "middle")) + : ((t.text.y = t.y + this.config.quadrantTextTopPadding), (t.text.horizontalPos = "top")); + return s; + } + getQuadrantPoints(t) { + const { quadrantSpace: i } = t, + { quadrantHeight: e, quadrantLeft: a, quadrantTop: r, quadrantWidth: s } = i, + l = (0, n.BYU)() + .domain([0, 1]) + .range([a, s + a]), + o = (0, n.BYU)() + .domain([0, 1]) + .range([e + r, r]); + return this.data.points.map((t) => ({ + x: l(t.x), + y: o(t.y), + fill: this.themeConfig.quadrantPointFill, + radius: this.config.pointRadius, + text: { + text: t.text, + fill: this.themeConfig.quadrantPointTextFill, + x: l(t.x), + y: o(t.y) + this.config.pointTextPadding, + verticalPos: "center", + horizontalPos: "top", + fontSize: this.config.pointLabelFontSize, + rotation: 0, + }, + })); + } + getBorders(t) { + const i = this.config.quadrantExternalBorderStrokeWidth / 2, + { quadrantSpace: e } = t, + { quadrantHalfHeight: a, quadrantHeight: n, quadrantLeft: r, quadrantHalfWidth: s, quadrantTop: l, quadrantWidth: o } = e; + return [ + { + strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill, + strokeWidth: this.config.quadrantExternalBorderStrokeWidth, + x1: r - i, + y1: l, + x2: r + o + i, + y2: l, + }, + { + strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill, + strokeWidth: this.config.quadrantExternalBorderStrokeWidth, + x1: r + o, + y1: l + i, + x2: r + o, + y2: l + n - i, + }, + { + strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill, + strokeWidth: this.config.quadrantExternalBorderStrokeWidth, + x1: r - i, + y1: l + n, + x2: r + o + i, + y2: l + n, + }, + { + strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill, + strokeWidth: this.config.quadrantExternalBorderStrokeWidth, + x1: r, + y1: l + i, + x2: r, + y2: l + n - i, + }, + { + strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill, + strokeWidth: this.config.quadrantInternalBorderStrokeWidth, + x1: r + s, + y1: l + i, + x2: r + s, + y2: l + n - i, + }, + { + strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill, + strokeWidth: this.config.quadrantInternalBorderStrokeWidth, + x1: r + i, + y1: l + a, + x2: r + o - i, + y2: l + a, + }, + ]; + } + getTitle(t) { + if (t) + return { + text: this.data.titleText, + fill: this.themeConfig.quadrantTitleFill, + fontSize: this.config.titleFontSize, + horizontalPos: "top", + verticalPos: "center", + rotation: 0, + y: this.config.titlePadding, + x: this.config.chartWidth / 2, + }; + } + build() { + const t = this.config.showXAxis && !(!this.data.xAxisLeftText && !this.data.xAxisRightText), + i = this.config.showYAxis && !(!this.data.yAxisTopText && !this.data.yAxisBottomText), + e = this.config.showTitle && !!this.data.titleText, + a = this.data.points.length > 0 ? "bottom" : this.config.xAxisPosition, + n = this.calculateSpace(a, t, i, e); + return { + points: this.getQuadrantPoints(n), + quadrants: this.getQuadrants(n), + axisLabels: this.getAxisLabels(a, t, i, n), + borderLines: this.getBorders(n), + title: this.getTitle(e), + }; + } + })(), + d = { + parser: s, + db: { + setWidth: function (t) { + c.setConfig({ chartWidth: t }); + }, + setHeight: function (t) { + c.setConfig({ chartHeight: t }); + }, + setQuadrant1Text: function (t) { + c.setData({ quadrant1Text: h(t.text) }); + }, + setQuadrant2Text: function (t) { + c.setData({ quadrant2Text: h(t.text) }); + }, + setQuadrant3Text: function (t) { + c.setData({ quadrant3Text: h(t.text) }); + }, + setQuadrant4Text: function (t) { + c.setData({ quadrant4Text: h(t.text) }); + }, + setXAxisLeftText: function (t) { + c.setData({ xAxisLeftText: h(t.text) }); + }, + setXAxisRightText: function (t) { + c.setData({ xAxisRightText: h(t.text) }); + }, + setYAxisTopText: function (t) { + c.setData({ yAxisTopText: h(t.text) }); + }, + setYAxisBottomText: function (t) { + c.setData({ yAxisBottomText: h(t.text) }); + }, + addPoint: function (t, i, e) { + c.addPoints([{ x: i, y: e, text: h(t.text) }]); + }, + getQuadrantData: function () { + const t = (0, a.c)(), + { themeVariables: i, quadrantChart: e } = t; + return ( + e && c.setConfig(e), + c.setThemeConfig({ + quadrant1Fill: i.quadrant1Fill, + quadrant2Fill: i.quadrant2Fill, + quadrant3Fill: i.quadrant3Fill, + quadrant4Fill: i.quadrant4Fill, + quadrant1TextFill: i.quadrant1TextFill, + quadrant2TextFill: i.quadrant2TextFill, + quadrant3TextFill: i.quadrant3TextFill, + quadrant4TextFill: i.quadrant4TextFill, + quadrantPointFill: i.quadrantPointFill, + quadrantPointTextFill: i.quadrantPointTextFill, + quadrantXAxisTextFill: i.quadrantXAxisTextFill, + quadrantYAxisTextFill: i.quadrantYAxisTextFill, + quadrantExternalBorderStrokeFill: i.quadrantExternalBorderStrokeFill, + quadrantInternalBorderStrokeFill: i.quadrantInternalBorderStrokeFill, + quadrantTitleFill: i.quadrantTitleFill, + }), + c.setData({ titleText: (0, a.t)() }), + c.build() + ); + }, + parseDirective: function (t, i, e) { + a.m.parseDirective(this, t, i, e); + }, + clear: function () { + c.clear(), (0, a.v)(); + }, + setAccTitle: a.s, + getAccTitle: a.g, + setDiagramTitle: a.r, + getDiagramTitle: a.t, + getAccDescription: a.a, + setAccDescription: a.b, + }, + renderer: { + draw: (t, i, e, r) => { + var s, l, o; + function h(t) { + return "top" === t ? "hanging" : "middle"; + } + function c(t) { + return "left" === t ? "start" : "middle"; + } + function d(t) { + return `translate(${t.x}, ${t.y}) rotate(${t.rotation || 0})`; + } + const u = (0, a.c)(); + a.l.debug("Rendering quadrant chart\n" + t); + const x = u.securityLevel; + let g; + "sandbox" === x && (g = (0, n.Ys)("#i" + i)); + const f = ("sandbox" === x ? (0, n.Ys)(g.nodes()[0].contentDocument.body) : (0, n.Ys)("body")).select(`[id="${i}"]`), + y = f.append("g").attr("class", "main"), + p = (null == (s = u.quadrantChart) ? void 0 : s.chartWidth) || 500, + q = (null == (l = u.quadrantChart) ? void 0 : l.chartHeight) || 500; + (0, a.i)(f, q, p, (null == (o = u.quadrantChart) ? void 0 : o.useMaxWidth) || !0), + f.attr("viewBox", "0 0 " + p + " " + q), + r.db.setHeight(q), + r.db.setWidth(p); + const T = r.db.getQuadrantData(), + _ = y.append("g").attr("class", "quadrants"), + m = y.append("g").attr("class", "border"), + A = y.append("g").attr("class", "data-points"), + b = y.append("g").attr("class", "labels"), + S = y.append("g").attr("class", "title"); + T.title && + S.append("text") + .attr("x", 0) + .attr("y", 0) + .attr("fill", T.title.fill) + .attr("font-size", T.title.fontSize) + .attr("dominant-baseline", h(T.title.horizontalPos)) + .attr("text-anchor", c(T.title.verticalPos)) + .attr("transform", d(T.title)) + .text(T.title.text), + T.borderLines && + m + .selectAll("line") + .data(T.borderLines) + .enter() + .append("line") + .attr("x1", (t) => t.x1) + .attr("y1", (t) => t.y1) + .attr("x2", (t) => t.x2) + .attr("y2", (t) => t.y2) + .style("stroke", (t) => t.strokeFill) + .style("stroke-width", (t) => t.strokeWidth); + const k = _.selectAll("g.quadrant").data(T.quadrants).enter().append("g").attr("class", "quadrant"); + k + .append("rect") + .attr("x", (t) => t.x) + .attr("y", (t) => t.y) + .attr("width", (t) => t.width) + .attr("height", (t) => t.height) + .attr("fill", (t) => t.fill), + k + .append("text") + .attr("x", 0) + .attr("y", 0) + .attr("fill", (t) => t.text.fill) + .attr("font-size", (t) => t.text.fontSize) + .attr("dominant-baseline", (t) => h(t.text.horizontalPos)) + .attr("text-anchor", (t) => c(t.text.verticalPos)) + .attr("transform", (t) => d(t.text)) + .text((t) => t.text.text), + b + .selectAll("g.label") + .data(T.axisLabels) + .enter() + .append("g") + .attr("class", "label") + .append("text") + .attr("x", 0) + .attr("y", 0) + .text((t) => t.text) + .attr("fill", (t) => t.fill) + .attr("font-size", (t) => t.fontSize) + .attr("dominant-baseline", (t) => h(t.horizontalPos)) + .attr("text-anchor", (t) => c(t.verticalPos)) + .attr("transform", (t) => d(t)); + const v = A.selectAll("g.data-point").data(T.points).enter().append("g").attr("class", "data-point"); + v + .append("circle") + .attr("cx", (t) => t.x) + .attr("cy", (t) => t.y) + .attr("r", (t) => t.radius) + .attr("fill", (t) => t.fill), + v + .append("text") + .attr("x", 0) + .attr("y", 0) + .text((t) => t.text.text) + .attr("fill", (t) => t.text.fill) + .attr("font-size", (t) => t.text.fontSize) + .attr("dominant-baseline", (t) => h(t.text.horizontalPos)) + .attr("text-anchor", (t) => c(t.text.verticalPos)) + .attr("transform", (t) => d(t.text)); + }, + }, + styles: () => "", + }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/19-86f47ecd.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/19-86f47ecd.chunk.min.js new file mode 100644 index 000000000..b90763ffa --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/19-86f47ecd.chunk.min.js @@ -0,0 +1,1503 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [19], + { + 4019: function (e, t, i) { + i.d(t, { + diagram: function () { + return k; + }, + }); + var n = i(9339), + r = i(7274), + s = i(3771), + a = i(5625), + c = + (i(7484), + i(7967), + i(7856), + (function () { + var e = function (e, t, i, n) { + for (i = i || {}, n = e.length; n--; i[e[n]] = t); + return i; + }, + t = [1, 3], + i = [1, 5], + n = [1, 6], + r = [1, 7], + s = [1, 8], + a = [5, 6, 8, 14, 16, 18, 19, 40, 41, 42, 43, 44, 45, 53, 71, 72], + c = [1, 22], + l = [2, 13], + o = [1, 26], + h = [1, 27], + u = [1, 28], + d = [1, 29], + y = [1, 30], + p = [1, 31], + _ = [1, 24], + g = [1, 32], + E = [1, 33], + R = [1, 36], + f = [71, 72], + m = [5, 8, 14, 16, 18, 19, 40, 41, 42, 43, 44, 45, 53, 60, 62, 71, 72], + I = [1, 56], + b = [1, 57], + k = [1, 58], + S = [1, 59], + T = [1, 60], + N = [1, 61], + v = [1, 62], + x = [62, 63], + A = [1, 74], + q = [1, 70], + $ = [1, 71], + O = [1, 72], + w = [1, 73], + C = [1, 75], + D = [1, 79], + L = [1, 80], + F = [1, 77], + M = [1, 78], + P = [5, 8, 14, 16, 18, 19, 40, 41, 42, 43, 44, 45, 53, 71, 72], + V = { + trace: function () {}, + yy: {}, + symbols_: { + error: 2, + start: 3, + directive: 4, + NEWLINE: 5, + RD: 6, + diagram: 7, + EOF: 8, + openDirective: 9, + typeDirective: 10, + closeDirective: 11, + ":": 12, + argDirective: 13, + acc_title: 14, + acc_title_value: 15, + acc_descr: 16, + acc_descr_value: 17, + acc_descr_multiline_value: 18, + open_directive: 19, + type_directive: 20, + arg_directive: 21, + close_directive: 22, + requirementDef: 23, + elementDef: 24, + relationshipDef: 25, + requirementType: 26, + requirementName: 27, + STRUCT_START: 28, + requirementBody: 29, + ID: 30, + COLONSEP: 31, + id: 32, + TEXT: 33, + text: 34, + RISK: 35, + riskLevel: 36, + VERIFYMTHD: 37, + verifyType: 38, + STRUCT_STOP: 39, + REQUIREMENT: 40, + FUNCTIONAL_REQUIREMENT: 41, + INTERFACE_REQUIREMENT: 42, + PERFORMANCE_REQUIREMENT: 43, + PHYSICAL_REQUIREMENT: 44, + DESIGN_CONSTRAINT: 45, + LOW_RISK: 46, + MED_RISK: 47, + HIGH_RISK: 48, + VERIFY_ANALYSIS: 49, + VERIFY_DEMONSTRATION: 50, + VERIFY_INSPECTION: 51, + VERIFY_TEST: 52, + ELEMENT: 53, + elementName: 54, + elementBody: 55, + TYPE: 56, + type: 57, + DOCREF: 58, + ref: 59, + END_ARROW_L: 60, + relationship: 61, + LINE: 62, + END_ARROW_R: 63, + CONTAINS: 64, + COPIES: 65, + DERIVES: 66, + SATISFIES: 67, + VERIFIES: 68, + REFINES: 69, + TRACES: 70, + unqString: 71, + qString: 72, + $accept: 0, + $end: 1, + }, + terminals_: { + 2: "error", + 5: "NEWLINE", + 6: "RD", + 8: "EOF", + 12: ":", + 14: "acc_title", + 15: "acc_title_value", + 16: "acc_descr", + 17: "acc_descr_value", + 18: "acc_descr_multiline_value", + 19: "open_directive", + 20: "type_directive", + 21: "arg_directive", + 22: "close_directive", + 28: "STRUCT_START", + 30: "ID", + 31: "COLONSEP", + 33: "TEXT", + 35: "RISK", + 37: "VERIFYMTHD", + 39: "STRUCT_STOP", + 40: "REQUIREMENT", + 41: "FUNCTIONAL_REQUIREMENT", + 42: "INTERFACE_REQUIREMENT", + 43: "PERFORMANCE_REQUIREMENT", + 44: "PHYSICAL_REQUIREMENT", + 45: "DESIGN_CONSTRAINT", + 46: "LOW_RISK", + 47: "MED_RISK", + 48: "HIGH_RISK", + 49: "VERIFY_ANALYSIS", + 50: "VERIFY_DEMONSTRATION", + 51: "VERIFY_INSPECTION", + 52: "VERIFY_TEST", + 53: "ELEMENT", + 56: "TYPE", + 58: "DOCREF", + 60: "END_ARROW_L", + 62: "LINE", + 63: "END_ARROW_R", + 64: "CONTAINS", + 65: "COPIES", + 66: "DERIVES", + 67: "SATISFIES", + 68: "VERIFIES", + 69: "REFINES", + 70: "TRACES", + 71: "unqString", + 72: "qString", + }, + productions_: [ + 0, + [3, 3], + [3, 2], + [3, 4], + [4, 3], + [4, 5], + [4, 2], + [4, 2], + [4, 1], + [9, 1], + [10, 1], + [13, 1], + [11, 1], + [7, 0], + [7, 2], + [7, 2], + [7, 2], + [7, 2], + [7, 2], + [23, 5], + [29, 5], + [29, 5], + [29, 5], + [29, 5], + [29, 2], + [29, 1], + [26, 1], + [26, 1], + [26, 1], + [26, 1], + [26, 1], + [26, 1], + [36, 1], + [36, 1], + [36, 1], + [38, 1], + [38, 1], + [38, 1], + [38, 1], + [24, 5], + [55, 5], + [55, 5], + [55, 2], + [55, 1], + [25, 5], + [25, 5], + [61, 1], + [61, 1], + [61, 1], + [61, 1], + [61, 1], + [61, 1], + [61, 1], + [27, 1], + [27, 1], + [32, 1], + [32, 1], + [34, 1], + [34, 1], + [54, 1], + [54, 1], + [57, 1], + [57, 1], + [59, 1], + [59, 1], + ], + performAction: function (e, t, i, n, r, s, a) { + var c = s.length - 1; + switch (r) { + case 6: + (this.$ = s[c].trim()), n.setAccTitle(this.$); + break; + case 7: + case 8: + (this.$ = s[c].trim()), n.setAccDescription(this.$); + break; + case 9: + n.parseDirective("%%{", "open_directive"); + break; + case 10: + n.parseDirective(s[c], "type_directive"); + break; + case 11: + (s[c] = s[c].trim().replace(/'/g, '"')), n.parseDirective(s[c], "arg_directive"); + break; + case 12: + n.parseDirective("}%%", "close_directive", "pie"); + break; + case 13: + this.$ = []; + break; + case 19: + n.addRequirement(s[c - 3], s[c - 4]); + break; + case 20: + n.setNewReqId(s[c - 2]); + break; + case 21: + n.setNewReqText(s[c - 2]); + break; + case 22: + n.setNewReqRisk(s[c - 2]); + break; + case 23: + n.setNewReqVerifyMethod(s[c - 2]); + break; + case 26: + this.$ = n.RequirementType.REQUIREMENT; + break; + case 27: + this.$ = n.RequirementType.FUNCTIONAL_REQUIREMENT; + break; + case 28: + this.$ = n.RequirementType.INTERFACE_REQUIREMENT; + break; + case 29: + this.$ = n.RequirementType.PERFORMANCE_REQUIREMENT; + break; + case 30: + this.$ = n.RequirementType.PHYSICAL_REQUIREMENT; + break; + case 31: + this.$ = n.RequirementType.DESIGN_CONSTRAINT; + break; + case 32: + this.$ = n.RiskLevel.LOW_RISK; + break; + case 33: + this.$ = n.RiskLevel.MED_RISK; + break; + case 34: + this.$ = n.RiskLevel.HIGH_RISK; + break; + case 35: + this.$ = n.VerifyType.VERIFY_ANALYSIS; + break; + case 36: + this.$ = n.VerifyType.VERIFY_DEMONSTRATION; + break; + case 37: + this.$ = n.VerifyType.VERIFY_INSPECTION; + break; + case 38: + this.$ = n.VerifyType.VERIFY_TEST; + break; + case 39: + n.addElement(s[c - 3]); + break; + case 40: + n.setNewElementType(s[c - 2]); + break; + case 41: + n.setNewElementDocRef(s[c - 2]); + break; + case 44: + n.addRelationship(s[c - 2], s[c], s[c - 4]); + break; + case 45: + n.addRelationship(s[c - 2], s[c - 4], s[c]); + break; + case 46: + this.$ = n.Relationships.CONTAINS; + break; + case 47: + this.$ = n.Relationships.COPIES; + break; + case 48: + this.$ = n.Relationships.DERIVES; + break; + case 49: + this.$ = n.Relationships.SATISFIES; + break; + case 50: + this.$ = n.Relationships.VERIFIES; + break; + case 51: + this.$ = n.Relationships.REFINES; + break; + case 52: + this.$ = n.Relationships.TRACES; + } + }, + table: [ + { 3: 1, 4: 2, 6: t, 9: 4, 14: i, 16: n, 18: r, 19: s }, + { 1: [3] }, + { 3: 10, 4: 2, 5: [1, 9], 6: t, 9: 4, 14: i, 16: n, 18: r, 19: s }, + { 5: [1, 11] }, + { 10: 12, 20: [1, 13] }, + { 15: [1, 14] }, + { 17: [1, 15] }, + e(a, [2, 8]), + { 20: [2, 9] }, + { 3: 16, 4: 2, 6: t, 9: 4, 14: i, 16: n, 18: r, 19: s }, + { 1: [2, 2] }, + { + 4: 21, + 5: c, + 7: 17, + 8: l, + 9: 4, + 14: i, + 16: n, + 18: r, + 19: s, + 23: 18, + 24: 19, + 25: 20, + 26: 23, + 32: 25, + 40: o, + 41: h, + 42: u, + 43: d, + 44: y, + 45: p, + 53: _, + 71: g, + 72: E, + }, + { 11: 34, 12: [1, 35], 22: R }, + e([12, 22], [2, 10]), + e(a, [2, 6]), + e(a, [2, 7]), + { 1: [2, 1] }, + { 8: [1, 37] }, + { + 4: 21, + 5: c, + 7: 38, + 8: l, + 9: 4, + 14: i, + 16: n, + 18: r, + 19: s, + 23: 18, + 24: 19, + 25: 20, + 26: 23, + 32: 25, + 40: o, + 41: h, + 42: u, + 43: d, + 44: y, + 45: p, + 53: _, + 71: g, + 72: E, + }, + { + 4: 21, + 5: c, + 7: 39, + 8: l, + 9: 4, + 14: i, + 16: n, + 18: r, + 19: s, + 23: 18, + 24: 19, + 25: 20, + 26: 23, + 32: 25, + 40: o, + 41: h, + 42: u, + 43: d, + 44: y, + 45: p, + 53: _, + 71: g, + 72: E, + }, + { + 4: 21, + 5: c, + 7: 40, + 8: l, + 9: 4, + 14: i, + 16: n, + 18: r, + 19: s, + 23: 18, + 24: 19, + 25: 20, + 26: 23, + 32: 25, + 40: o, + 41: h, + 42: u, + 43: d, + 44: y, + 45: p, + 53: _, + 71: g, + 72: E, + }, + { + 4: 21, + 5: c, + 7: 41, + 8: l, + 9: 4, + 14: i, + 16: n, + 18: r, + 19: s, + 23: 18, + 24: 19, + 25: 20, + 26: 23, + 32: 25, + 40: o, + 41: h, + 42: u, + 43: d, + 44: y, + 45: p, + 53: _, + 71: g, + 72: E, + }, + { + 4: 21, + 5: c, + 7: 42, + 8: l, + 9: 4, + 14: i, + 16: n, + 18: r, + 19: s, + 23: 18, + 24: 19, + 25: 20, + 26: 23, + 32: 25, + 40: o, + 41: h, + 42: u, + 43: d, + 44: y, + 45: p, + 53: _, + 71: g, + 72: E, + }, + { 27: 43, 71: [1, 44], 72: [1, 45] }, + { 54: 46, 71: [1, 47], 72: [1, 48] }, + { 60: [1, 49], 62: [1, 50] }, + e(f, [2, 26]), + e(f, [2, 27]), + e(f, [2, 28]), + e(f, [2, 29]), + e(f, [2, 30]), + e(f, [2, 31]), + e(m, [2, 55]), + e(m, [2, 56]), + e(a, [2, 4]), + { 13: 51, 21: [1, 52] }, + e(a, [2, 12]), + { 1: [2, 3] }, + { 8: [2, 14] }, + { 8: [2, 15] }, + { 8: [2, 16] }, + { 8: [2, 17] }, + { 8: [2, 18] }, + { 28: [1, 53] }, + { 28: [2, 53] }, + { 28: [2, 54] }, + { 28: [1, 54] }, + { 28: [2, 59] }, + { 28: [2, 60] }, + { 61: 55, 64: I, 65: b, 66: k, 67: S, 68: T, 69: N, 70: v }, + { 61: 63, 64: I, 65: b, 66: k, 67: S, 68: T, 69: N, 70: v }, + { 11: 64, 22: R }, + { 22: [2, 11] }, + { 5: [1, 65] }, + { 5: [1, 66] }, + { 62: [1, 67] }, + e(x, [2, 46]), + e(x, [2, 47]), + e(x, [2, 48]), + e(x, [2, 49]), + e(x, [2, 50]), + e(x, [2, 51]), + e(x, [2, 52]), + { 63: [1, 68] }, + e(a, [2, 5]), + { 5: A, 29: 69, 30: q, 33: $, 35: O, 37: w, 39: C }, + { 5: D, 39: L, 55: 76, 56: F, 58: M }, + { 32: 81, 71: g, 72: E }, + { 32: 82, 71: g, 72: E }, + e(P, [2, 19]), + { 31: [1, 83] }, + { 31: [1, 84] }, + { 31: [1, 85] }, + { 31: [1, 86] }, + { 5: A, 29: 87, 30: q, 33: $, 35: O, 37: w, 39: C }, + e(P, [2, 25]), + e(P, [2, 39]), + { 31: [1, 88] }, + { 31: [1, 89] }, + { 5: D, 39: L, 55: 90, 56: F, 58: M }, + e(P, [2, 43]), + e(P, [2, 44]), + e(P, [2, 45]), + { 32: 91, 71: g, 72: E }, + { 34: 92, 71: [1, 93], 72: [1, 94] }, + { 36: 95, 46: [1, 96], 47: [1, 97], 48: [1, 98] }, + { 38: 99, 49: [1, 100], 50: [1, 101], 51: [1, 102], 52: [1, 103] }, + e(P, [2, 24]), + { 57: 104, 71: [1, 105], 72: [1, 106] }, + { 59: 107, 71: [1, 108], 72: [1, 109] }, + e(P, [2, 42]), + { 5: [1, 110] }, + { 5: [1, 111] }, + { 5: [2, 57] }, + { 5: [2, 58] }, + { 5: [1, 112] }, + { 5: [2, 32] }, + { 5: [2, 33] }, + { 5: [2, 34] }, + { 5: [1, 113] }, + { 5: [2, 35] }, + { 5: [2, 36] }, + { 5: [2, 37] }, + { 5: [2, 38] }, + { 5: [1, 114] }, + { 5: [2, 61] }, + { 5: [2, 62] }, + { 5: [1, 115] }, + { 5: [2, 63] }, + { 5: [2, 64] }, + { 5: A, 29: 116, 30: q, 33: $, 35: O, 37: w, 39: C }, + { 5: A, 29: 117, 30: q, 33: $, 35: O, 37: w, 39: C }, + { 5: A, 29: 118, 30: q, 33: $, 35: O, 37: w, 39: C }, + { 5: A, 29: 119, 30: q, 33: $, 35: O, 37: w, 39: C }, + { 5: D, 39: L, 55: 120, 56: F, 58: M }, + { 5: D, 39: L, 55: 121, 56: F, 58: M }, + e(P, [2, 20]), + e(P, [2, 21]), + e(P, [2, 22]), + e(P, [2, 23]), + e(P, [2, 40]), + e(P, [2, 41]), + ], + defaultActions: { + 8: [2, 9], + 10: [2, 2], + 16: [2, 1], + 37: [2, 3], + 38: [2, 14], + 39: [2, 15], + 40: [2, 16], + 41: [2, 17], + 42: [2, 18], + 44: [2, 53], + 45: [2, 54], + 47: [2, 59], + 48: [2, 60], + 52: [2, 11], + 93: [2, 57], + 94: [2, 58], + 96: [2, 32], + 97: [2, 33], + 98: [2, 34], + 100: [2, 35], + 101: [2, 36], + 102: [2, 37], + 103: [2, 38], + 105: [2, 61], + 106: [2, 62], + 108: [2, 63], + 109: [2, 64], + }, + parseError: function (e, t) { + if (!t.recoverable) { + var i = new Error(e); + throw ((i.hash = t), i); + } + this.trace(e); + }, + parse: function (e) { + var t = [0], + i = [], + n = [null], + r = [], + s = this.table, + a = "", + c = 0, + l = 0, + o = r.slice.call(arguments, 1), + h = Object.create(this.lexer), + u = { yy: {} }; + for (var d in this.yy) Object.prototype.hasOwnProperty.call(this.yy, d) && (u.yy[d] = this.yy[d]); + h.setInput(e, u.yy), (u.yy.lexer = h), (u.yy.parser = this), void 0 === h.yylloc && (h.yylloc = {}); + var y = h.yylloc; + r.push(y); + var p = h.options && h.options.ranges; + "function" == typeof u.yy.parseError + ? (this.parseError = u.yy.parseError) + : (this.parseError = Object.getPrototypeOf(this).parseError); + for (var _, g, E, R, f, m, I, b, k, S = {}; ; ) { + if ( + ((g = t[t.length - 1]), + this.defaultActions[g] + ? (E = this.defaultActions[g]) + : (null == _ && + ((k = void 0), + "number" != typeof (k = i.pop() || h.lex() || 1) && + (k instanceof Array && (k = (i = k).pop()), (k = this.symbols_[k] || k)), + (_ = k)), + (E = s[g] && s[g][_])), + void 0 === E || !E.length || !E[0]) + ) { + var T; + for (f in ((b = []), s[g])) this.terminals_[f] && f > 2 && b.push("'" + this.terminals_[f] + "'"); + (T = h.showPosition + ? "Parse error on line " + + (c + 1) + + ":\n" + + h.showPosition() + + "\nExpecting " + + b.join(", ") + + ", got '" + + (this.terminals_[_] || _) + + "'" + : "Parse error on line " + (c + 1) + ": Unexpected " + (1 == _ ? "end of input" : "'" + (this.terminals_[_] || _) + "'")), + this.parseError(T, { + text: h.match, + token: this.terminals_[_] || _, + line: h.yylineno, + loc: y, + expected: b, + }); + } + if (E[0] instanceof Array && E.length > 1) + throw new Error("Parse Error: multiple actions possible at state: " + g + ", token: " + _); + switch (E[0]) { + case 1: + t.push(_), + n.push(h.yytext), + r.push(h.yylloc), + t.push(E[1]), + (_ = null), + (l = h.yyleng), + (a = h.yytext), + (c = h.yylineno), + (y = h.yylloc); + break; + case 2: + if ( + ((m = this.productions_[E[1]][1]), + (S.$ = n[n.length - m]), + (S._$ = { + first_line: r[r.length - (m || 1)].first_line, + last_line: r[r.length - 1].last_line, + first_column: r[r.length - (m || 1)].first_column, + last_column: r[r.length - 1].last_column, + }), + p && (S._$.range = [r[r.length - (m || 1)].range[0], r[r.length - 1].range[1]]), + void 0 !== (R = this.performAction.apply(S, [a, l, c, u.yy, E[1], n, r].concat(o)))) + ) + return R; + m && ((t = t.slice(0, -1 * m * 2)), (n = n.slice(0, -1 * m)), (r = r.slice(0, -1 * m))), + t.push(this.productions_[E[1]][0]), + n.push(S.$), + r.push(S._$), + (I = s[t[t.length - 2]][t[t.length - 1]]), + t.push(I); + break; + case 3: + return !0; + } + } + return !0; + }, + }, + Y = { + EOF: 1, + parseError: function (e, t) { + if (!this.yy.parser) throw new Error(e); + this.yy.parser.parseError(e, t); + }, + setInput: function (e, t) { + return ( + (this.yy = t || this.yy || {}), + (this._input = e), + (this._more = this._backtrack = this.done = !1), + (this.yylineno = this.yyleng = 0), + (this.yytext = this.matched = this.match = ""), + (this.conditionStack = ["INITIAL"]), + (this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0, + }), + this.options.ranges && (this.yylloc.range = [0, 0]), + (this.offset = 0), + this + ); + }, + input: function () { + var e = this._input[0]; + return ( + (this.yytext += e), + this.yyleng++, + this.offset++, + (this.match += e), + (this.matched += e), + e.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, + this.options.ranges && this.yylloc.range[1]++, + (this._input = this._input.slice(1)), + e + ); + }, + unput: function (e) { + var t = e.length, + i = e.split(/(?:\r\n?|\n)/g); + (this._input = e + this._input), (this.yytext = this.yytext.substr(0, this.yytext.length - t)), (this.offset -= t); + var n = this.match.split(/(?:\r\n?|\n)/g); + (this.match = this.match.substr(0, this.match.length - 1)), + (this.matched = this.matched.substr(0, this.matched.length - 1)), + i.length - 1 && (this.yylineno -= i.length - 1); + var r = this.yylloc.range; + return ( + (this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: i + ? (i.length === n.length ? this.yylloc.first_column : 0) + n[n.length - i.length].length - i[0].length + : this.yylloc.first_column - t, + }), + this.options.ranges && (this.yylloc.range = [r[0], r[0] + this.yyleng - t]), + (this.yyleng = this.yytext.length), + this + ); + }, + more: function () { + return (this._more = !0), this; + }, + reject: function () { + return this.options.backtrack_lexer + ? ((this._backtrack = !0), this) + : this.parseError( + "Lexical error on line " + + (this.yylineno + 1) + + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + + this.showPosition(), + { text: "", token: null, line: this.yylineno }, + ); + }, + less: function (e) { + this.unput(this.match.slice(e)); + }, + pastInput: function () { + var e = this.matched.substr(0, this.matched.length - this.match.length); + return (e.length > 20 ? "..." : "") + e.substr(-20).replace(/\n/g, ""); + }, + upcomingInput: function () { + var e = this.match; + return ( + e.length < 20 && (e += this._input.substr(0, 20 - e.length)), (e.substr(0, 20) + (e.length > 20 ? "..." : "")).replace(/\n/g, "") + ); + }, + showPosition: function () { + var e = this.pastInput(), + t = new Array(e.length + 1).join("-"); + return e + this.upcomingInput() + "\n" + t + "^"; + }, + test_match: function (e, t) { + var i, n, r; + if ( + (this.options.backtrack_lexer && + ((r = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column, + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done, + }), + this.options.ranges && (r.yylloc.range = this.yylloc.range.slice(0))), + (n = e[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += n.length), + (this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: n ? n[n.length - 1].length - n[n.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length, + }), + (this.yytext += e[0]), + (this.match += e[0]), + (this.matches = e), + (this.yyleng = this.yytext.length), + this.options.ranges && (this.yylloc.range = [this.offset, (this.offset += this.yyleng)]), + (this._more = !1), + (this._backtrack = !1), + (this._input = this._input.slice(e[0].length)), + (this.matched += e[0]), + (i = this.performAction.call(this, this.yy, this, t, this.conditionStack[this.conditionStack.length - 1])), + this.done && this._input && (this.done = !1), + i) + ) + return i; + if (this._backtrack) { + for (var s in r) this[s] = r[s]; + return !1; + } + return !1; + }, + next: function () { + if (this.done) return this.EOF; + var e, t, i, n; + this._input || (this.done = !0), this._more || ((this.yytext = ""), (this.match = "")); + for (var r = this._currentRules(), s = 0; s < r.length; s++) + if ((i = this._input.match(this.rules[r[s]])) && (!t || i[0].length > t[0].length)) { + if (((t = i), (n = s), this.options.backtrack_lexer)) { + if (!1 !== (e = this.test_match(i, r[s]))) return e; + if (this._backtrack) { + t = !1; + continue; + } + return !1; + } + if (!this.options.flex) break; + } + return t + ? !1 !== (e = this.test_match(t, r[n])) && e + : "" === this._input + ? this.EOF + : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno, + }); + }, + lex: function () { + return this.next() || this.lex(); + }, + begin: function (e) { + this.conditionStack.push(e); + }, + popState: function () { + return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]; + }, + _currentRules: function () { + return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] + ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules + : this.conditions.INITIAL.rules; + }, + topState: function (e) { + return (e = this.conditionStack.length - 1 - Math.abs(e || 0)) >= 0 ? this.conditionStack[e] : "INITIAL"; + }, + pushState: function (e) { + this.begin(e); + }, + stateStackSize: function () { + return this.conditionStack.length; + }, + options: { "case-insensitive": !0 }, + performAction: function (e, t, i, n) { + switch (i) { + case 0: + return this.begin("open_directive"), 19; + case 1: + return this.begin("type_directive"), 20; + case 2: + return this.popState(), this.begin("arg_directive"), 12; + case 3: + return this.popState(), this.popState(), 22; + case 4: + return 21; + case 5: + return "title"; + case 6: + return this.begin("acc_title"), 14; + case 7: + return this.popState(), "acc_title_value"; + case 8: + return this.begin("acc_descr"), 16; + case 9: + return this.popState(), "acc_descr_value"; + case 10: + this.begin("acc_descr_multiline"); + break; + case 11: + case 53: + this.popState(); + break; + case 12: + return "acc_descr_multiline_value"; + case 13: + return 5; + case 14: + case 15: + case 16: + break; + case 17: + return 8; + case 18: + return 6; + case 19: + return 28; + case 20: + return 39; + case 21: + return 31; + case 22: + return 30; + case 23: + return 33; + case 24: + return 35; + case 25: + return 37; + case 26: + return 40; + case 27: + return 41; + case 28: + return 42; + case 29: + return 43; + case 30: + return 44; + case 31: + return 45; + case 32: + return 46; + case 33: + return 47; + case 34: + return 48; + case 35: + return 49; + case 36: + return 50; + case 37: + return 51; + case 38: + return 52; + case 39: + return 53; + case 40: + return 64; + case 41: + return 65; + case 42: + return 66; + case 43: + return 67; + case 44: + return 68; + case 45: + return 69; + case 46: + return 70; + case 47: + return 56; + case 48: + return 58; + case 49: + return 60; + case 50: + return 63; + case 51: + return 62; + case 52: + this.begin("string"); + break; + case 54: + return "qString"; + case 55: + return (t.yytext = t.yytext.trim()), 71; + } + }, + rules: [ + /^(?:%%\{)/i, + /^(?:((?:(?!\}%%)[^:.])*))/i, + /^(?::)/i, + /^(?:\}%%)/i, + /^(?:((?:(?!\}%%).|\n)*))/i, + /^(?:title\s[^#\n;]+)/i, + /^(?:accTitle\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*\{\s*)/i, + /^(?:[\}])/i, + /^(?:[^\}]*)/i, + /^(?:(\r?\n)+)/i, + /^(?:\s+)/i, + /^(?:#[^\n]*)/i, + /^(?:%[^\n]*)/i, + /^(?:$)/i, + /^(?:requirementDiagram\b)/i, + /^(?:\{)/i, + /^(?:\})/i, + /^(?::)/i, + /^(?:id\b)/i, + /^(?:text\b)/i, + /^(?:risk\b)/i, + /^(?:verifyMethod\b)/i, + /^(?:requirement\b)/i, + /^(?:functionalRequirement\b)/i, + /^(?:interfaceRequirement\b)/i, + /^(?:performanceRequirement\b)/i, + /^(?:physicalRequirement\b)/i, + /^(?:designConstraint\b)/i, + /^(?:low\b)/i, + /^(?:medium\b)/i, + /^(?:high\b)/i, + /^(?:analysis\b)/i, + /^(?:demonstration\b)/i, + /^(?:inspection\b)/i, + /^(?:test\b)/i, + /^(?:element\b)/i, + /^(?:contains\b)/i, + /^(?:copies\b)/i, + /^(?:derives\b)/i, + /^(?:satisfies\b)/i, + /^(?:verifies\b)/i, + /^(?:refines\b)/i, + /^(?:traces\b)/i, + /^(?:type\b)/i, + /^(?:docref\b)/i, + /^(?:<-)/i, + /^(?:->)/i, + /^(?:-)/i, + /^(?:["])/i, + /^(?:["])/i, + /^(?:[^"]*)/i, + /^(?:[\w][^\r\n\{\<\>\-\=]*)/i, + ], + conditions: { + acc_descr_multiline: { rules: [11, 12], inclusive: !1 }, + acc_descr: { rules: [9], inclusive: !1 }, + acc_title: { rules: [7], inclusive: !1 }, + close_directive: { rules: [], inclusive: !1 }, + arg_directive: { rules: [3, 4], inclusive: !1 }, + type_directive: { rules: [2, 3], inclusive: !1 }, + open_directive: { rules: [1], inclusive: !1 }, + unqString: { rules: [], inclusive: !1 }, + token: { rules: [], inclusive: !1 }, + string: { rules: [53, 54], inclusive: !1 }, + INITIAL: { + rules: [ + 0, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 55, + ], + inclusive: !0, + }, + }, + }; + function U() { + this.yy = {}; + } + return (V.lexer = Y), (U.prototype = V), (V.Parser = U), new U(); + })()); + c.parser = c; + const l = c; + let o = [], + h = {}, + u = {}, + d = {}, + y = {}; + const p = { + RequirementType: { + REQUIREMENT: "Requirement", + FUNCTIONAL_REQUIREMENT: "Functional Requirement", + INTERFACE_REQUIREMENT: "Interface Requirement", + PERFORMANCE_REQUIREMENT: "Performance Requirement", + PHYSICAL_REQUIREMENT: "Physical Requirement", + DESIGN_CONSTRAINT: "Design Constraint", + }, + RiskLevel: { LOW_RISK: "Low", MED_RISK: "Medium", HIGH_RISK: "High" }, + VerifyType: { + VERIFY_ANALYSIS: "Analysis", + VERIFY_DEMONSTRATION: "Demonstration", + VERIFY_INSPECTION: "Inspection", + VERIFY_TEST: "Test", + }, + Relationships: { + CONTAINS: "contains", + COPIES: "copies", + DERIVES: "derives", + SATISFIES: "satisfies", + VERIFIES: "verifies", + REFINES: "refines", + TRACES: "traces", + }, + parseDirective: function (e, t, i) { + n.m.parseDirective(this, e, t, i); + }, + getConfig: () => (0, n.c)().req, + addRequirement: (e, t) => ( + void 0 === u[e] && + (u[e] = { + name: e, + type: t, + id: h.id, + text: h.text, + risk: h.risk, + verifyMethod: h.verifyMethod, + }), + (h = {}), + u[e] + ), + getRequirements: () => u, + setNewReqId: (e) => { + void 0 !== h && (h.id = e); + }, + setNewReqText: (e) => { + void 0 !== h && (h.text = e); + }, + setNewReqRisk: (e) => { + void 0 !== h && (h.risk = e); + }, + setNewReqVerifyMethod: (e) => { + void 0 !== h && (h.verifyMethod = e); + }, + setAccTitle: n.s, + getAccTitle: n.g, + setAccDescription: n.b, + getAccDescription: n.a, + addElement: (e) => ( + void 0 === y[e] && ((y[e] = { name: e, type: d.type, docRef: d.docRef }), n.l.info("Added new requirement: ", e)), (d = {}), y[e] + ), + getElements: () => y, + setNewElementType: (e) => { + void 0 !== d && (d.type = e); + }, + setNewElementDocRef: (e) => { + void 0 !== d && (d.docRef = e); + }, + addRelationship: (e, t, i) => { + o.push({ type: e, src: t, dst: i }); + }, + getRelationships: () => o, + clear: () => { + (o = []), (h = {}), (u = {}), (d = {}), (y = {}), (0, n.v)(); + }, + }, + _ = { CONTAINS: "contains", ARROW: "arrow" }, + g = _; + let E = {}, + R = 0; + const f = (e, t) => + e + .insert("rect", "#" + t) + .attr("class", "req reqBox") + .attr("x", 0) + .attr("y", 0) + .attr("width", E.rect_min_width + "px") + .attr("height", E.rect_min_height + "px"), + m = (e, t, i) => { + let n = E.rect_min_width / 2, + r = e + .append("text") + .attr("class", "req reqLabel reqTitle") + .attr("id", t) + .attr("x", n) + .attr("y", E.rect_padding) + .attr("dominant-baseline", "hanging"), + s = 0; + i.forEach((e) => { + 0 == s + ? r + .append("tspan") + .attr("text-anchor", "middle") + .attr("x", E.rect_min_width / 2) + .attr("dy", 0) + .text(e) + : r + .append("tspan") + .attr("text-anchor", "middle") + .attr("x", E.rect_min_width / 2) + .attr("dy", 0.75 * E.line_height) + .text(e), + s++; + }); + let a = 1.5 * E.rect_padding + s * E.line_height * 0.75; + return ( + e.append("line").attr("class", "req-title-line").attr("x1", "0").attr("x2", E.rect_min_width).attr("y1", a).attr("y2", a), + { titleNode: r, y: a } + ); + }, + I = (e, t, i, n) => { + let r = e + .append("text") + .attr("class", "req reqLabel") + .attr("id", t) + .attr("x", E.rect_padding) + .attr("y", n) + .attr("dominant-baseline", "hanging"), + s = 0, + a = []; + return ( + i.forEach((e) => { + let t = e.length; + for (; t > 30 && s < 3; ) { + let i = e.substring(0, 30); + (t = (e = e.substring(30, e.length)).length), (a[a.length] = i), s++; + } + if (3 == s) { + let e = a[a.length - 1]; + a[a.length - 1] = e.substring(0, e.length - 4) + "..."; + } else a[a.length] = e; + s = 0; + }), + a.forEach((e) => { + r.append("tspan").attr("x", E.rect_padding).attr("dy", E.line_height).text(e); + }), + r + ); + }, + b = (e) => e.replace(/\s/g, "").replace(/\./g, "_"), + k = { + parser: l, + db: p, + renderer: { + draw: (e, t, i, c) => { + E = (0, n.c)().requirement; + const l = E.securityLevel; + let o; + "sandbox" === l && (o = (0, r.Ys)("#i" + t)); + const h = ("sandbox" === l ? (0, r.Ys)(o.nodes()[0].contentDocument.body) : (0, r.Ys)("body")).select(`[id='${t}']`); + ((e, t) => { + let i = e + .append("defs") + .append("marker") + .attr("id", _.CONTAINS + "_line_ending") + .attr("refX", 0) + .attr("refY", t.line_height / 2) + .attr("markerWidth", t.line_height) + .attr("markerHeight", t.line_height) + .attr("orient", "auto") + .append("g"); + i + .append("circle") + .attr("cx", t.line_height / 2) + .attr("cy", t.line_height / 2) + .attr("r", t.line_height / 2) + .attr("fill", "none"), + i + .append("line") + .attr("x1", 0) + .attr("x2", t.line_height) + .attr("y1", t.line_height / 2) + .attr("y2", t.line_height / 2) + .attr("stroke-width", 1), + i + .append("line") + .attr("y1", 0) + .attr("y2", t.line_height) + .attr("x1", t.line_height / 2) + .attr("x2", t.line_height / 2) + .attr("stroke-width", 1), + e + .append("defs") + .append("marker") + .attr("id", _.ARROW + "_line_ending") + .attr("refX", t.line_height) + .attr("refY", 0.5 * t.line_height) + .attr("markerWidth", t.line_height) + .attr("markerHeight", t.line_height) + .attr("orient", "auto") + .append("path") + .attr( + "d", + `M0,0\n L${t.line_height},${t.line_height / 2}\n M${t.line_height},${t.line_height / 2}\n L0,${t.line_height}`, + ) + .attr("stroke-width", 1); + })(h, E); + const u = new a.k({ multigraph: !1, compound: !1, directed: !0 }) + .setGraph({ + rankdir: E.layoutDirection, + marginx: 20, + marginy: 20, + nodesep: 100, + edgesep: 100, + ranksep: 100, + }) + .setDefaultEdgeLabel(function () { + return {}; + }); + let d = c.db.getRequirements(), + y = c.db.getElements(), + p = c.db.getRelationships(); + var k, S, T; + (k = d), + (S = u), + (T = h), + Object.keys(k).forEach((e) => { + let t = k[e]; + (e = b(e)), n.l.info("Added new requirement: ", e); + const i = T.append("g").attr("id", e), + r = f(i, "req-" + e); + let s = m(i, e + "_title", [`<<${t.type}>>`, `${t.name}`]); + I(i, e + "_body", [`Id: ${t.id}`, `Text: ${t.text}`, `Risk: ${t.risk}`, `Verification: ${t.verifyMethod}`], s.y); + const a = r.node().getBBox(); + S.setNode(e, { width: a.width, height: a.height, shape: "rect", id: e }); + }), + ((e, t, i) => { + Object.keys(e).forEach((n) => { + let r = e[n]; + const s = b(n), + a = i.append("g").attr("id", s), + c = "element-" + s, + l = f(a, c); + let o = m(a, c + "_title", ["<>", `${n}`]); + I(a, c + "_body", [`Type: ${r.type || "Not Specified"}`, `Doc Ref: ${r.docRef || "None"}`], o.y); + const h = l.node().getBBox(); + t.setNode(s, { width: h.width, height: h.height, shape: "rect", id: s }); + }); + })(y, u, h), + ((e, t) => { + e.forEach(function (e) { + let i = b(e.src), + n = b(e.dst); + t.setEdge(i, n, { relationship: e }); + }); + })(p, u), + (0, s.bK)(u), + (function (e, t) { + t.nodes().forEach(function (i) { + void 0 !== i && + void 0 !== t.node(i) && + (e.select("#" + i), + e + .select("#" + i) + .attr("transform", "translate(" + (t.node(i).x - t.node(i).width / 2) + "," + (t.node(i).y - t.node(i).height / 2) + " )")); + }); + })(h, u), + p.forEach(function (e) { + !(function (e, t, i, s, a) { + const c = i.edge(b(t.src), b(t.dst)), + l = (0, r.jvg)() + .x(function (e) { + return e.x; + }) + .y(function (e) { + return e.y; + }), + o = e + .insert("path", "#" + s) + .attr("class", "er relationshipLine") + .attr("d", l(c.points)) + .attr("fill", "none"); + t.type == a.db.Relationships.CONTAINS + ? o.attr("marker-start", "url(" + n.e.getUrl(E.arrowMarkerAbsolute) + "#" + t.type + "_line_ending)") + : (o.attr("stroke-dasharray", "10,7"), + o.attr("marker-end", "url(" + n.e.getUrl(E.arrowMarkerAbsolute) + "#" + g.ARROW + "_line_ending)")), + ((e, t, i, n) => { + const r = t.node().getTotalLength(), + s = t.node().getPointAtLength(0.5 * r), + a = "rel" + R; + R++; + const c = e + .append("text") + .attr("class", "req relationshipLabel") + .attr("id", a) + .attr("x", s.x) + .attr("y", s.y) + .attr("text-anchor", "middle") + .attr("dominant-baseline", "middle") + .text(n) + .node() + .getBBox(); + e.insert("rect", "#" + a) + .attr("class", "req reqLabelBox") + .attr("x", s.x - c.width / 2) + .attr("y", s.y - c.height / 2) + .attr("width", c.width) + .attr("height", c.height) + .attr("fill", "white") + .attr("fill-opacity", "85%"); + })(e, o, 0, `<<${t.type}>>`); + })(h, e, u, t, c); + }); + const N = E.rect_padding, + v = h.node().getBBox(), + x = v.width + 2 * N, + A = v.height + 2 * N; + (0, n.i)(h, A, x, E.useMaxWidth), h.attr("viewBox", `${v.x - N} ${v.y - N} ${x} ${A}`); + }, + }, + styles: (e) => + `\n\n marker {\n fill: ${e.relationColor};\n stroke: ${e.relationColor};\n }\n\n marker.cross {\n stroke: ${e.lineColor};\n }\n\n svg {\n font-family: ${e.fontFamily};\n font-size: ${e.fontSize};\n }\n\n .reqBox {\n fill: ${e.requirementBackground};\n fill-opacity: 1.0;\n stroke: ${e.requirementBorderColor};\n stroke-width: ${e.requirementBorderSize};\n }\n \n .reqTitle, .reqLabel{\n fill: ${e.requirementTextColor};\n }\n .reqLabelBox {\n fill: ${e.relationLabelBackground};\n fill-opacity: 1.0;\n }\n\n .req-title-line {\n stroke: ${e.requirementBorderColor};\n stroke-width: ${e.requirementBorderSize};\n }\n .relationshipLine {\n stroke: ${e.relationColor};\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ${e.relationLabelColor};\n }\n\n`, + }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/361-f7cd601a.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/361-f7cd601a.chunk.min.js new file mode 100644 index 000000000..a623bb503 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/361-f7cd601a.chunk.min.js @@ -0,0 +1,3736 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [361], + { + 5510: function (t, e, a) { + a.d(e, { + diagram: function () { + return mt; + }, + }); + var i = a(9339), + r = a(7274), + s = a(8252), + n = a(7967), + o = + (a(7484), + a(7856), + (function () { + var t = function (t, e, a, i) { + for (a = a || {}, i = t.length; i--; a[t[i]] = e); + return a; + }, + e = [1, 2], + a = [1, 3], + i = [1, 5], + r = [1, 7], + s = [2, 5], + n = [1, 15], + o = [1, 17], + c = [1, 19], + l = [1, 20], + h = [1, 22], + d = [1, 23], + p = [1, 24], + g = [1, 30], + u = [1, 31], + x = [1, 32], + y = [1, 33], + m = [1, 34], + f = [1, 35], + b = [1, 36], + T = [1, 37], + E = [1, 38], + w = [1, 39], + _ = [1, 40], + v = [1, 41], + P = [1, 42], + k = [1, 44], + L = [1, 45], + I = [1, 46], + M = [1, 48], + N = [1, 49], + A = [1, 50], + S = [1, 51], + O = [1, 52], + D = [1, 53], + R = [1, 56], + Y = [ + 1, 4, 5, 19, 20, 22, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 53, 54, 55, 56, 58, 59, 60, 65, 66, 67, 68, 76, + 86, + ], + $ = [4, 5, 22, 56, 58, 59], + C = [4, 5, 19, 20, 22, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86], + V = [4, 5, 19, 20, 22, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 55, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86], + B = [4, 5, 19, 20, 22, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 54, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86], + F = [4, 5, 19, 20, 22, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 53, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86], + W = [74, 75, 76], + q = [1, 133], + z = [ + 1, 4, 5, 7, 19, 20, 22, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 53, 54, 55, 56, 58, 59, 60, 65, 66, 67, 68, + 76, 86, + ], + H = { + trace: function () {}, + yy: {}, + symbols_: { + error: 2, + start: 3, + SPACE: 4, + NEWLINE: 5, + directive: 6, + SD: 7, + document: 8, + line: 9, + statement: 10, + box_section: 11, + box_line: 12, + participant_statement: 13, + openDirective: 14, + typeDirective: 15, + closeDirective: 16, + ":": 17, + argDirective: 18, + create: 19, + box: 20, + restOfLine: 21, + end: 22, + signal: 23, + autonumber: 24, + NUM: 25, + off: 26, + activate: 27, + actor: 28, + deactivate: 29, + note_statement: 30, + links_statement: 31, + link_statement: 32, + properties_statement: 33, + details_statement: 34, + title: 35, + legacy_title: 36, + acc_title: 37, + acc_title_value: 38, + acc_descr: 39, + acc_descr_value: 40, + acc_descr_multiline_value: 41, + loop: 42, + rect: 43, + opt: 44, + alt: 45, + else_sections: 46, + par: 47, + par_sections: 48, + par_over: 49, + critical: 50, + option_sections: 51, + break: 52, + option: 53, + and: 54, + else: 55, + participant: 56, + AS: 57, + participant_actor: 58, + destroy: 59, + note: 60, + placement: 61, + text2: 62, + over: 63, + actor_pair: 64, + links: 65, + link: 66, + properties: 67, + details: 68, + spaceList: 69, + ",": 70, + left_of: 71, + right_of: 72, + signaltype: 73, + "+": 74, + "-": 75, + ACTOR: 76, + SOLID_OPEN_ARROW: 77, + DOTTED_OPEN_ARROW: 78, + SOLID_ARROW: 79, + DOTTED_ARROW: 80, + SOLID_CROSS: 81, + DOTTED_CROSS: 82, + SOLID_POINT: 83, + DOTTED_POINT: 84, + TXT: 85, + open_directive: 86, + type_directive: 87, + arg_directive: 88, + close_directive: 89, + $accept: 0, + $end: 1, + }, + terminals_: { + 2: "error", + 4: "SPACE", + 5: "NEWLINE", + 7: "SD", + 17: ":", + 19: "create", + 20: "box", + 21: "restOfLine", + 22: "end", + 24: "autonumber", + 25: "NUM", + 26: "off", + 27: "activate", + 29: "deactivate", + 35: "title", + 36: "legacy_title", + 37: "acc_title", + 38: "acc_title_value", + 39: "acc_descr", + 40: "acc_descr_value", + 41: "acc_descr_multiline_value", + 42: "loop", + 43: "rect", + 44: "opt", + 45: "alt", + 47: "par", + 49: "par_over", + 50: "critical", + 52: "break", + 53: "option", + 54: "and", + 55: "else", + 56: "participant", + 57: "AS", + 58: "participant_actor", + 59: "destroy", + 60: "note", + 63: "over", + 65: "links", + 66: "link", + 67: "properties", + 68: "details", + 70: ",", + 71: "left_of", + 72: "right_of", + 74: "+", + 75: "-", + 76: "ACTOR", + 77: "SOLID_OPEN_ARROW", + 78: "DOTTED_OPEN_ARROW", + 79: "SOLID_ARROW", + 80: "DOTTED_ARROW", + 81: "SOLID_CROSS", + 82: "DOTTED_CROSS", + 83: "SOLID_POINT", + 84: "DOTTED_POINT", + 85: "TXT", + 86: "open_directive", + 87: "type_directive", + 88: "arg_directive", + 89: "close_directive", + }, + productions_: [ + 0, + [3, 2], + [3, 2], + [3, 2], + [3, 2], + [8, 0], + [8, 2], + [9, 2], + [9, 1], + [9, 1], + [11, 0], + [11, 2], + [12, 2], + [12, 1], + [12, 1], + [6, 4], + [6, 6], + [10, 1], + [10, 2], + [10, 4], + [10, 2], + [10, 4], + [10, 3], + [10, 3], + [10, 2], + [10, 3], + [10, 3], + [10, 2], + [10, 2], + [10, 2], + [10, 2], + [10, 2], + [10, 1], + [10, 1], + [10, 2], + [10, 2], + [10, 1], + [10, 4], + [10, 4], + [10, 4], + [10, 4], + [10, 4], + [10, 4], + [10, 4], + [10, 4], + [10, 1], + [51, 1], + [51, 4], + [48, 1], + [48, 4], + [46, 1], + [46, 4], + [13, 5], + [13, 3], + [13, 5], + [13, 3], + [13, 3], + [30, 4], + [30, 4], + [31, 3], + [32, 3], + [33, 3], + [34, 3], + [69, 2], + [69, 1], + [64, 3], + [64, 1], + [61, 1], + [61, 1], + [23, 5], + [23, 5], + [23, 4], + [28, 1], + [73, 1], + [73, 1], + [73, 1], + [73, 1], + [73, 1], + [73, 1], + [73, 1], + [73, 1], + [62, 1], + [14, 1], + [15, 1], + [18, 1], + [16, 1], + ], + performAction: function (t, e, a, i, r, s, n) { + var o = s.length - 1; + switch (r) { + case 4: + return i.apply(s[o]), s[o]; + case 5: + case 10: + case 9: + case 14: + this.$ = []; + break; + case 6: + case 11: + s[o - 1].push(s[o]), (this.$ = s[o - 1]); + break; + case 7: + case 8: + case 12: + case 13: + case 66: + this.$ = s[o]; + break; + case 18: + (s[o].type = "createParticipant"), (this.$ = s[o]); + break; + case 19: + s[o - 1].unshift({ type: "boxStart", boxData: i.parseBoxData(s[o - 2]) }), + s[o - 1].push({ type: "boxEnd", boxText: s[o - 2] }), + (this.$ = s[o - 1]); + break; + case 21: + this.$ = { + type: "sequenceIndex", + sequenceIndex: Number(s[o - 2]), + sequenceIndexStep: Number(s[o - 1]), + sequenceVisible: !0, + signalType: i.LINETYPE.AUTONUMBER, + }; + break; + case 22: + this.$ = { + type: "sequenceIndex", + sequenceIndex: Number(s[o - 1]), + sequenceIndexStep: 1, + sequenceVisible: !0, + signalType: i.LINETYPE.AUTONUMBER, + }; + break; + case 23: + this.$ = { + type: "sequenceIndex", + sequenceVisible: !1, + signalType: i.LINETYPE.AUTONUMBER, + }; + break; + case 24: + this.$ = { + type: "sequenceIndex", + sequenceVisible: !0, + signalType: i.LINETYPE.AUTONUMBER, + }; + break; + case 25: + this.$ = { + type: "activeStart", + signalType: i.LINETYPE.ACTIVE_START, + actor: s[o - 1], + }; + break; + case 26: + this.$ = { + type: "activeEnd", + signalType: i.LINETYPE.ACTIVE_END, + actor: s[o - 1], + }; + break; + case 32: + i.setDiagramTitle(s[o].substring(6)), (this.$ = s[o].substring(6)); + break; + case 33: + i.setDiagramTitle(s[o].substring(7)), (this.$ = s[o].substring(7)); + break; + case 34: + (this.$ = s[o].trim()), i.setAccTitle(this.$); + break; + case 35: + case 36: + (this.$ = s[o].trim()), i.setAccDescription(this.$); + break; + case 37: + s[o - 1].unshift({ + type: "loopStart", + loopText: i.parseMessage(s[o - 2]), + signalType: i.LINETYPE.LOOP_START, + }), + s[o - 1].push({ + type: "loopEnd", + loopText: s[o - 2], + signalType: i.LINETYPE.LOOP_END, + }), + (this.$ = s[o - 1]); + break; + case 38: + s[o - 1].unshift({ + type: "rectStart", + color: i.parseMessage(s[o - 2]), + signalType: i.LINETYPE.RECT_START, + }), + s[o - 1].push({ + type: "rectEnd", + color: i.parseMessage(s[o - 2]), + signalType: i.LINETYPE.RECT_END, + }), + (this.$ = s[o - 1]); + break; + case 39: + s[o - 1].unshift({ + type: "optStart", + optText: i.parseMessage(s[o - 2]), + signalType: i.LINETYPE.OPT_START, + }), + s[o - 1].push({ + type: "optEnd", + optText: i.parseMessage(s[o - 2]), + signalType: i.LINETYPE.OPT_END, + }), + (this.$ = s[o - 1]); + break; + case 40: + s[o - 1].unshift({ + type: "altStart", + altText: i.parseMessage(s[o - 2]), + signalType: i.LINETYPE.ALT_START, + }), + s[o - 1].push({ type: "altEnd", signalType: i.LINETYPE.ALT_END }), + (this.$ = s[o - 1]); + break; + case 41: + s[o - 1].unshift({ + type: "parStart", + parText: i.parseMessage(s[o - 2]), + signalType: i.LINETYPE.PAR_START, + }), + s[o - 1].push({ type: "parEnd", signalType: i.LINETYPE.PAR_END }), + (this.$ = s[o - 1]); + break; + case 42: + s[o - 1].unshift({ + type: "parStart", + parText: i.parseMessage(s[o - 2]), + signalType: i.LINETYPE.PAR_OVER_START, + }), + s[o - 1].push({ type: "parEnd", signalType: i.LINETYPE.PAR_END }), + (this.$ = s[o - 1]); + break; + case 43: + s[o - 1].unshift({ + type: "criticalStart", + criticalText: i.parseMessage(s[o - 2]), + signalType: i.LINETYPE.CRITICAL_START, + }), + s[o - 1].push({ type: "criticalEnd", signalType: i.LINETYPE.CRITICAL_END }), + (this.$ = s[o - 1]); + break; + case 44: + s[o - 1].unshift({ + type: "breakStart", + breakText: i.parseMessage(s[o - 2]), + signalType: i.LINETYPE.BREAK_START, + }), + s[o - 1].push({ + type: "breakEnd", + optText: i.parseMessage(s[o - 2]), + signalType: i.LINETYPE.BREAK_END, + }), + (this.$ = s[o - 1]); + break; + case 47: + this.$ = s[o - 3].concat([ + { + type: "option", + optionText: i.parseMessage(s[o - 1]), + signalType: i.LINETYPE.CRITICAL_OPTION, + }, + s[o], + ]); + break; + case 49: + this.$ = s[o - 3].concat([ + { + type: "and", + parText: i.parseMessage(s[o - 1]), + signalType: i.LINETYPE.PAR_AND, + }, + s[o], + ]); + break; + case 51: + this.$ = s[o - 3].concat([ + { + type: "else", + altText: i.parseMessage(s[o - 1]), + signalType: i.LINETYPE.ALT_ELSE, + }, + s[o], + ]); + break; + case 52: + (s[o - 3].draw = "participant"), + (s[o - 3].type = "addParticipant"), + (s[o - 3].description = i.parseMessage(s[o - 1])), + (this.$ = s[o - 3]); + break; + case 53: + (s[o - 1].draw = "participant"), (s[o - 1].type = "addParticipant"), (this.$ = s[o - 1]); + break; + case 54: + (s[o - 3].draw = "actor"), + (s[o - 3].type = "addParticipant"), + (s[o - 3].description = i.parseMessage(s[o - 1])), + (this.$ = s[o - 3]); + break; + case 55: + (s[o - 1].draw = "actor"), (s[o - 1].type = "addParticipant"), (this.$ = s[o - 1]); + break; + case 56: + (s[o - 1].type = "destroyParticipant"), (this.$ = s[o - 1]); + break; + case 57: + this.$ = [s[o - 1], { type: "addNote", placement: s[o - 2], actor: s[o - 1].actor, text: s[o] }]; + break; + case 58: + (s[o - 2] = [].concat(s[o - 1], s[o - 1]).slice(0, 2)), + (s[o - 2][0] = s[o - 2][0].actor), + (s[o - 2][1] = s[o - 2][1].actor), + (this.$ = [ + s[o - 1], + { + type: "addNote", + placement: i.PLACEMENT.OVER, + actor: s[o - 2].slice(0, 2), + text: s[o], + }, + ]); + break; + case 59: + this.$ = [s[o - 1], { type: "addLinks", actor: s[o - 1].actor, text: s[o] }]; + break; + case 60: + this.$ = [s[o - 1], { type: "addALink", actor: s[o - 1].actor, text: s[o] }]; + break; + case 61: + this.$ = [s[o - 1], { type: "addProperties", actor: s[o - 1].actor, text: s[o] }]; + break; + case 62: + this.$ = [s[o - 1], { type: "addDetails", actor: s[o - 1].actor, text: s[o] }]; + break; + case 65: + this.$ = [s[o - 2], s[o]]; + break; + case 67: + this.$ = i.PLACEMENT.LEFTOF; + break; + case 68: + this.$ = i.PLACEMENT.RIGHTOF; + break; + case 69: + this.$ = [ + s[o - 4], + s[o - 1], + { + type: "addMessage", + from: s[o - 4].actor, + to: s[o - 1].actor, + signalType: s[o - 3], + msg: s[o], + }, + { + type: "activeStart", + signalType: i.LINETYPE.ACTIVE_START, + actor: s[o - 1], + }, + ]; + break; + case 70: + this.$ = [ + s[o - 4], + s[o - 1], + { + type: "addMessage", + from: s[o - 4].actor, + to: s[o - 1].actor, + signalType: s[o - 3], + msg: s[o], + }, + { type: "activeEnd", signalType: i.LINETYPE.ACTIVE_END, actor: s[o - 4] }, + ]; + break; + case 71: + this.$ = [ + s[o - 3], + s[o - 1], + { + type: "addMessage", + from: s[o - 3].actor, + to: s[o - 1].actor, + signalType: s[o - 2], + msg: s[o], + }, + ]; + break; + case 72: + this.$ = { type: "addParticipant", actor: s[o] }; + break; + case 73: + this.$ = i.LINETYPE.SOLID_OPEN; + break; + case 74: + this.$ = i.LINETYPE.DOTTED_OPEN; + break; + case 75: + this.$ = i.LINETYPE.SOLID; + break; + case 76: + this.$ = i.LINETYPE.DOTTED; + break; + case 77: + this.$ = i.LINETYPE.SOLID_CROSS; + break; + case 78: + this.$ = i.LINETYPE.DOTTED_CROSS; + break; + case 79: + this.$ = i.LINETYPE.SOLID_POINT; + break; + case 80: + this.$ = i.LINETYPE.DOTTED_POINT; + break; + case 81: + this.$ = i.parseMessage(s[o].trim().substring(1)); + break; + case 82: + i.parseDirective("%%{", "open_directive"); + break; + case 83: + i.parseDirective(s[o], "type_directive"); + break; + case 84: + (s[o] = s[o].trim().replace(/'/g, '"')), i.parseDirective(s[o], "arg_directive"); + break; + case 85: + i.parseDirective("}%%", "close_directive", "sequence"); + } + }, + table: [ + { 3: 1, 4: e, 5: a, 6: 4, 7: i, 14: 6, 86: r }, + { 1: [3] }, + { 3: 8, 4: e, 5: a, 6: 4, 7: i, 14: 6, 86: r }, + { 3: 9, 4: e, 5: a, 6: 4, 7: i, 14: 6, 86: r }, + { 3: 10, 4: e, 5: a, 6: 4, 7: i, 14: 6, 86: r }, + t([1, 4, 5, 19, 20, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86], s, { + 8: 11, + }), + { 15: 12, 87: [1, 13] }, + { 87: [2, 82] }, + { 1: [2, 1] }, + { 1: [2, 2] }, + { 1: [2, 3] }, + { + 1: [2, 4], + 4: n, + 5: o, + 6: 43, + 9: 14, + 10: 16, + 13: 18, + 14: 6, + 19: c, + 20: l, + 23: 21, + 24: h, + 27: d, + 28: 47, + 29: p, + 30: 25, + 31: 26, + 32: 27, + 33: 28, + 34: 29, + 35: g, + 36: u, + 37: x, + 39: y, + 41: m, + 42: f, + 43: b, + 44: T, + 45: E, + 47: w, + 49: _, + 50: v, + 52: P, + 56: k, + 58: L, + 59: I, + 60: M, + 65: N, + 66: A, + 67: S, + 68: O, + 76: D, + 86: r, + }, + { 16: 54, 17: [1, 55], 89: R }, + t([17, 89], [2, 83]), + t(Y, [2, 6]), + { + 6: 43, + 10: 57, + 13: 18, + 14: 6, + 19: c, + 20: l, + 23: 21, + 24: h, + 27: d, + 28: 47, + 29: p, + 30: 25, + 31: 26, + 32: 27, + 33: 28, + 34: 29, + 35: g, + 36: u, + 37: x, + 39: y, + 41: m, + 42: f, + 43: b, + 44: T, + 45: E, + 47: w, + 49: _, + 50: v, + 52: P, + 56: k, + 58: L, + 59: I, + 60: M, + 65: N, + 66: A, + 67: S, + 68: O, + 76: D, + 86: r, + }, + t(Y, [2, 8]), + t(Y, [2, 9]), + t(Y, [2, 17]), + { 13: 58, 56: k, 58: L, 59: I }, + { 21: [1, 59] }, + { 5: [1, 60] }, + { 5: [1, 63], 25: [1, 61], 26: [1, 62] }, + { 28: 64, 76: D }, + { 28: 65, 76: D }, + { 5: [1, 66] }, + { 5: [1, 67] }, + { 5: [1, 68] }, + { 5: [1, 69] }, + { 5: [1, 70] }, + t(Y, [2, 32]), + t(Y, [2, 33]), + { 38: [1, 71] }, + { 40: [1, 72] }, + t(Y, [2, 36]), + { 21: [1, 73] }, + { 21: [1, 74] }, + { 21: [1, 75] }, + { 21: [1, 76] }, + { 21: [1, 77] }, + { 21: [1, 78] }, + { 21: [1, 79] }, + { 21: [1, 80] }, + t(Y, [2, 45]), + { 28: 81, 76: D }, + { 28: 82, 76: D }, + { 28: 83, 76: D }, + { + 73: 84, + 77: [1, 85], + 78: [1, 86], + 79: [1, 87], + 80: [1, 88], + 81: [1, 89], + 82: [1, 90], + 83: [1, 91], + 84: [1, 92], + }, + { 61: 93, 63: [1, 94], 71: [1, 95], 72: [1, 96] }, + { 28: 97, 76: D }, + { 28: 98, 76: D }, + { 28: 99, 76: D }, + { 28: 100, 76: D }, + t([5, 57, 70, 77, 78, 79, 80, 81, 82, 83, 84, 85], [2, 72]), + { 5: [1, 101] }, + { 18: 102, 88: [1, 103] }, + { 5: [2, 85] }, + t(Y, [2, 7]), + t(Y, [2, 18]), + t($, [2, 10], { 11: 104 }), + t(Y, [2, 20]), + { 5: [1, 106], 25: [1, 105] }, + { 5: [1, 107] }, + t(Y, [2, 24]), + { 5: [1, 108] }, + { 5: [1, 109] }, + t(Y, [2, 27]), + t(Y, [2, 28]), + t(Y, [2, 29]), + t(Y, [2, 30]), + t(Y, [2, 31]), + t(Y, [2, 34]), + t(Y, [2, 35]), + t(C, s, { 8: 110 }), + t(C, s, { 8: 111 }), + t(C, s, { 8: 112 }), + t(V, s, { 46: 113, 8: 114 }), + t(B, s, { 48: 115, 8: 116 }), + t(B, s, { 8: 116, 48: 117 }), + t(F, s, { 51: 118, 8: 119 }), + t(C, s, { 8: 120 }), + { 5: [1, 122], 57: [1, 121] }, + { 5: [1, 124], 57: [1, 123] }, + { 5: [1, 125] }, + { 28: 128, 74: [1, 126], 75: [1, 127], 76: D }, + t(W, [2, 73]), + t(W, [2, 74]), + t(W, [2, 75]), + t(W, [2, 76]), + t(W, [2, 77]), + t(W, [2, 78]), + t(W, [2, 79]), + t(W, [2, 80]), + { 28: 129, 76: D }, + { 28: 131, 64: 130, 76: D }, + { 76: [2, 67] }, + { 76: [2, 68] }, + { 62: 132, 85: q }, + { 62: 134, 85: q }, + { 62: 135, 85: q }, + { 62: 136, 85: q }, + t(z, [2, 15]), + { 16: 137, 89: R }, + { 89: [2, 84] }, + { 4: [1, 140], 5: [1, 142], 12: 139, 13: 141, 22: [1, 138], 56: k, 58: L, 59: I }, + { 5: [1, 143] }, + t(Y, [2, 22]), + t(Y, [2, 23]), + t(Y, [2, 25]), + t(Y, [2, 26]), + { + 4: n, + 5: o, + 6: 43, + 9: 14, + 10: 16, + 13: 18, + 14: 6, + 19: c, + 20: l, + 22: [1, 144], + 23: 21, + 24: h, + 27: d, + 28: 47, + 29: p, + 30: 25, + 31: 26, + 32: 27, + 33: 28, + 34: 29, + 35: g, + 36: u, + 37: x, + 39: y, + 41: m, + 42: f, + 43: b, + 44: T, + 45: E, + 47: w, + 49: _, + 50: v, + 52: P, + 56: k, + 58: L, + 59: I, + 60: M, + 65: N, + 66: A, + 67: S, + 68: O, + 76: D, + 86: r, + }, + { + 4: n, + 5: o, + 6: 43, + 9: 14, + 10: 16, + 13: 18, + 14: 6, + 19: c, + 20: l, + 22: [1, 145], + 23: 21, + 24: h, + 27: d, + 28: 47, + 29: p, + 30: 25, + 31: 26, + 32: 27, + 33: 28, + 34: 29, + 35: g, + 36: u, + 37: x, + 39: y, + 41: m, + 42: f, + 43: b, + 44: T, + 45: E, + 47: w, + 49: _, + 50: v, + 52: P, + 56: k, + 58: L, + 59: I, + 60: M, + 65: N, + 66: A, + 67: S, + 68: O, + 76: D, + 86: r, + }, + { + 4: n, + 5: o, + 6: 43, + 9: 14, + 10: 16, + 13: 18, + 14: 6, + 19: c, + 20: l, + 22: [1, 146], + 23: 21, + 24: h, + 27: d, + 28: 47, + 29: p, + 30: 25, + 31: 26, + 32: 27, + 33: 28, + 34: 29, + 35: g, + 36: u, + 37: x, + 39: y, + 41: m, + 42: f, + 43: b, + 44: T, + 45: E, + 47: w, + 49: _, + 50: v, + 52: P, + 56: k, + 58: L, + 59: I, + 60: M, + 65: N, + 66: A, + 67: S, + 68: O, + 76: D, + 86: r, + }, + { 22: [1, 147] }, + { + 4: n, + 5: o, + 6: 43, + 9: 14, + 10: 16, + 13: 18, + 14: 6, + 19: c, + 20: l, + 22: [2, 50], + 23: 21, + 24: h, + 27: d, + 28: 47, + 29: p, + 30: 25, + 31: 26, + 32: 27, + 33: 28, + 34: 29, + 35: g, + 36: u, + 37: x, + 39: y, + 41: m, + 42: f, + 43: b, + 44: T, + 45: E, + 47: w, + 49: _, + 50: v, + 52: P, + 55: [1, 148], + 56: k, + 58: L, + 59: I, + 60: M, + 65: N, + 66: A, + 67: S, + 68: O, + 76: D, + 86: r, + }, + { 22: [1, 149] }, + { + 4: n, + 5: o, + 6: 43, + 9: 14, + 10: 16, + 13: 18, + 14: 6, + 19: c, + 20: l, + 22: [2, 48], + 23: 21, + 24: h, + 27: d, + 28: 47, + 29: p, + 30: 25, + 31: 26, + 32: 27, + 33: 28, + 34: 29, + 35: g, + 36: u, + 37: x, + 39: y, + 41: m, + 42: f, + 43: b, + 44: T, + 45: E, + 47: w, + 49: _, + 50: v, + 52: P, + 54: [1, 150], + 56: k, + 58: L, + 59: I, + 60: M, + 65: N, + 66: A, + 67: S, + 68: O, + 76: D, + 86: r, + }, + { 22: [1, 151] }, + { 22: [1, 152] }, + { + 4: n, + 5: o, + 6: 43, + 9: 14, + 10: 16, + 13: 18, + 14: 6, + 19: c, + 20: l, + 22: [2, 46], + 23: 21, + 24: h, + 27: d, + 28: 47, + 29: p, + 30: 25, + 31: 26, + 32: 27, + 33: 28, + 34: 29, + 35: g, + 36: u, + 37: x, + 39: y, + 41: m, + 42: f, + 43: b, + 44: T, + 45: E, + 47: w, + 49: _, + 50: v, + 52: P, + 53: [1, 153], + 56: k, + 58: L, + 59: I, + 60: M, + 65: N, + 66: A, + 67: S, + 68: O, + 76: D, + 86: r, + }, + { + 4: n, + 5: o, + 6: 43, + 9: 14, + 10: 16, + 13: 18, + 14: 6, + 19: c, + 20: l, + 22: [1, 154], + 23: 21, + 24: h, + 27: d, + 28: 47, + 29: p, + 30: 25, + 31: 26, + 32: 27, + 33: 28, + 34: 29, + 35: g, + 36: u, + 37: x, + 39: y, + 41: m, + 42: f, + 43: b, + 44: T, + 45: E, + 47: w, + 49: _, + 50: v, + 52: P, + 56: k, + 58: L, + 59: I, + 60: M, + 65: N, + 66: A, + 67: S, + 68: O, + 76: D, + 86: r, + }, + { 21: [1, 155] }, + t(Y, [2, 53]), + { 21: [1, 156] }, + t(Y, [2, 55]), + t(Y, [2, 56]), + { 28: 157, 76: D }, + { 28: 158, 76: D }, + { 62: 159, 85: q }, + { 62: 160, 85: q }, + { 62: 161, 85: q }, + { 70: [1, 162], 85: [2, 66] }, + { 5: [2, 59] }, + { 5: [2, 81] }, + { 5: [2, 60] }, + { 5: [2, 61] }, + { 5: [2, 62] }, + { 5: [1, 163] }, + t(Y, [2, 19]), + t($, [2, 11]), + { 13: 164, 56: k, 58: L, 59: I }, + t($, [2, 13]), + t($, [2, 14]), + t(Y, [2, 21]), + t(Y, [2, 37]), + t(Y, [2, 38]), + t(Y, [2, 39]), + t(Y, [2, 40]), + { 21: [1, 165] }, + t(Y, [2, 41]), + { 21: [1, 166] }, + t(Y, [2, 42]), + t(Y, [2, 43]), + { 21: [1, 167] }, + t(Y, [2, 44]), + { 5: [1, 168] }, + { 5: [1, 169] }, + { 62: 170, 85: q }, + { 62: 171, 85: q }, + { 5: [2, 71] }, + { 5: [2, 57] }, + { 5: [2, 58] }, + { 28: 172, 76: D }, + t(z, [2, 16]), + t($, [2, 12]), + t(V, s, { 8: 114, 46: 173 }), + t(B, s, { 8: 116, 48: 174 }), + t(F, s, { 8: 119, 51: 175 }), + t(Y, [2, 52]), + t(Y, [2, 54]), + { 5: [2, 69] }, + { 5: [2, 70] }, + { 85: [2, 65] }, + { 22: [2, 51] }, + { 22: [2, 49] }, + { 22: [2, 47] }, + ], + defaultActions: { + 7: [2, 82], + 8: [2, 1], + 9: [2, 2], + 10: [2, 3], + 56: [2, 85], + 95: [2, 67], + 96: [2, 68], + 103: [2, 84], + 132: [2, 59], + 133: [2, 81], + 134: [2, 60], + 135: [2, 61], + 136: [2, 62], + 159: [2, 71], + 160: [2, 57], + 161: [2, 58], + 170: [2, 69], + 171: [2, 70], + 172: [2, 65], + 173: [2, 51], + 174: [2, 49], + 175: [2, 47], + }, + parseError: function (t, e) { + if (!e.recoverable) { + var a = new Error(t); + throw ((a.hash = e), a); + } + this.trace(t); + }, + parse: function (t) { + var e = [0], + a = [], + i = [null], + r = [], + s = this.table, + n = "", + o = 0, + c = 0, + l = r.slice.call(arguments, 1), + h = Object.create(this.lexer), + d = { yy: {} }; + for (var p in this.yy) Object.prototype.hasOwnProperty.call(this.yy, p) && (d.yy[p] = this.yy[p]); + h.setInput(t, d.yy), (d.yy.lexer = h), (d.yy.parser = this), void 0 === h.yylloc && (h.yylloc = {}); + var g = h.yylloc; + r.push(g); + var u = h.options && h.options.ranges; + "function" == typeof d.yy.parseError + ? (this.parseError = d.yy.parseError) + : (this.parseError = Object.getPrototypeOf(this).parseError); + for (var x, y, m, f, b, T, E, w, _, v = {}; ; ) { + if ( + ((y = e[e.length - 1]), + this.defaultActions[y] + ? (m = this.defaultActions[y]) + : (null == x && + ((_ = void 0), + "number" != typeof (_ = a.pop() || h.lex() || 1) && + (_ instanceof Array && (_ = (a = _).pop()), (_ = this.symbols_[_] || _)), + (x = _)), + (m = s[y] && s[y][x])), + void 0 === m || !m.length || !m[0]) + ) { + var P; + for (b in ((w = []), s[y])) this.terminals_[b] && b > 2 && w.push("'" + this.terminals_[b] + "'"); + (P = h.showPosition + ? "Parse error on line " + + (o + 1) + + ":\n" + + h.showPosition() + + "\nExpecting " + + w.join(", ") + + ", got '" + + (this.terminals_[x] || x) + + "'" + : "Parse error on line " + (o + 1) + ": Unexpected " + (1 == x ? "end of input" : "'" + (this.terminals_[x] || x) + "'")), + this.parseError(P, { + text: h.match, + token: this.terminals_[x] || x, + line: h.yylineno, + loc: g, + expected: w, + }); + } + if (m[0] instanceof Array && m.length > 1) + throw new Error("Parse Error: multiple actions possible at state: " + y + ", token: " + x); + switch (m[0]) { + case 1: + e.push(x), + i.push(h.yytext), + r.push(h.yylloc), + e.push(m[1]), + (x = null), + (c = h.yyleng), + (n = h.yytext), + (o = h.yylineno), + (g = h.yylloc); + break; + case 2: + if ( + ((T = this.productions_[m[1]][1]), + (v.$ = i[i.length - T]), + (v._$ = { + first_line: r[r.length - (T || 1)].first_line, + last_line: r[r.length - 1].last_line, + first_column: r[r.length - (T || 1)].first_column, + last_column: r[r.length - 1].last_column, + }), + u && (v._$.range = [r[r.length - (T || 1)].range[0], r[r.length - 1].range[1]]), + void 0 !== (f = this.performAction.apply(v, [n, c, o, d.yy, m[1], i, r].concat(l)))) + ) + return f; + T && ((e = e.slice(0, -1 * T * 2)), (i = i.slice(0, -1 * T)), (r = r.slice(0, -1 * T))), + e.push(this.productions_[m[1]][0]), + i.push(v.$), + r.push(v._$), + (E = s[e[e.length - 2]][e[e.length - 1]]), + e.push(E); + break; + case 3: + return !0; + } + } + return !0; + }, + }, + U = { + EOF: 1, + parseError: function (t, e) { + if (!this.yy.parser) throw new Error(t); + this.yy.parser.parseError(t, e); + }, + setInput: function (t, e) { + return ( + (this.yy = e || this.yy || {}), + (this._input = t), + (this._more = this._backtrack = this.done = !1), + (this.yylineno = this.yyleng = 0), + (this.yytext = this.matched = this.match = ""), + (this.conditionStack = ["INITIAL"]), + (this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0, + }), + this.options.ranges && (this.yylloc.range = [0, 0]), + (this.offset = 0), + this + ); + }, + input: function () { + var t = this._input[0]; + return ( + (this.yytext += t), + this.yyleng++, + this.offset++, + (this.match += t), + (this.matched += t), + t.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, + this.options.ranges && this.yylloc.range[1]++, + (this._input = this._input.slice(1)), + t + ); + }, + unput: function (t) { + var e = t.length, + a = t.split(/(?:\r\n?|\n)/g); + (this._input = t + this._input), (this.yytext = this.yytext.substr(0, this.yytext.length - e)), (this.offset -= e); + var i = this.match.split(/(?:\r\n?|\n)/g); + (this.match = this.match.substr(0, this.match.length - 1)), + (this.matched = this.matched.substr(0, this.matched.length - 1)), + a.length - 1 && (this.yylineno -= a.length - 1); + var r = this.yylloc.range; + return ( + (this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: a + ? (a.length === i.length ? this.yylloc.first_column : 0) + i[i.length - a.length].length - a[0].length + : this.yylloc.first_column - e, + }), + this.options.ranges && (this.yylloc.range = [r[0], r[0] + this.yyleng - e]), + (this.yyleng = this.yytext.length), + this + ); + }, + more: function () { + return (this._more = !0), this; + }, + reject: function () { + return this.options.backtrack_lexer + ? ((this._backtrack = !0), this) + : this.parseError( + "Lexical error on line " + + (this.yylineno + 1) + + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + + this.showPosition(), + { text: "", token: null, line: this.yylineno }, + ); + }, + less: function (t) { + this.unput(this.match.slice(t)); + }, + pastInput: function () { + var t = this.matched.substr(0, this.matched.length - this.match.length); + return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, ""); + }, + upcomingInput: function () { + var t = this.match; + return ( + t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "") + ); + }, + showPosition: function () { + var t = this.pastInput(), + e = new Array(t.length + 1).join("-"); + return t + this.upcomingInput() + "\n" + e + "^"; + }, + test_match: function (t, e) { + var a, i, r; + if ( + (this.options.backtrack_lexer && + ((r = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column, + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done, + }), + this.options.ranges && (r.yylloc.range = this.yylloc.range.slice(0))), + (i = t[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += i.length), + (this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: i ? i[i.length - 1].length - i[i.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length, + }), + (this.yytext += t[0]), + (this.match += t[0]), + (this.matches = t), + (this.yyleng = this.yytext.length), + this.options.ranges && (this.yylloc.range = [this.offset, (this.offset += this.yyleng)]), + (this._more = !1), + (this._backtrack = !1), + (this._input = this._input.slice(t[0].length)), + (this.matched += t[0]), + (a = this.performAction.call(this, this.yy, this, e, this.conditionStack[this.conditionStack.length - 1])), + this.done && this._input && (this.done = !1), + a) + ) + return a; + if (this._backtrack) { + for (var s in r) this[s] = r[s]; + return !1; + } + return !1; + }, + next: function () { + if (this.done) return this.EOF; + var t, e, a, i; + this._input || (this.done = !0), this._more || ((this.yytext = ""), (this.match = "")); + for (var r = this._currentRules(), s = 0; s < r.length; s++) + if ((a = this._input.match(this.rules[r[s]])) && (!e || a[0].length > e[0].length)) { + if (((e = a), (i = s), this.options.backtrack_lexer)) { + if (!1 !== (t = this.test_match(a, r[s]))) return t; + if (this._backtrack) { + e = !1; + continue; + } + return !1; + } + if (!this.options.flex) break; + } + return e + ? !1 !== (t = this.test_match(e, r[i])) && t + : "" === this._input + ? this.EOF + : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno, + }); + }, + lex: function () { + return this.next() || this.lex(); + }, + begin: function (t) { + this.conditionStack.push(t); + }, + popState: function () { + return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]; + }, + _currentRules: function () { + return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] + ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules + : this.conditions.INITIAL.rules; + }, + topState: function (t) { + return (t = this.conditionStack.length - 1 - Math.abs(t || 0)) >= 0 ? this.conditionStack[t] : "INITIAL"; + }, + pushState: function (t) { + this.begin(t); + }, + stateStackSize: function () { + return this.conditionStack.length; + }, + options: { "case-insensitive": !0 }, + performAction: function (t, e, a, i) { + switch (a) { + case 0: + return this.begin("open_directive"), 86; + case 1: + return this.begin("type_directive"), 87; + case 2: + return this.popState(), this.begin("arg_directive"), 17; + case 3: + return this.popState(), this.popState(), 89; + case 4: + return 88; + case 5: + case 56: + case 69: + return 5; + case 6: + case 7: + case 8: + case 9: + case 10: + break; + case 11: + return 25; + case 12: + return this.begin("LINE"), 20; + case 13: + return this.begin("ID"), 56; + case 14: + return this.begin("ID"), 58; + case 15: + return 19; + case 16: + return this.begin("ID"), 59; + case 17: + return (e.yytext = e.yytext.trim()), this.begin("ALIAS"), 76; + case 18: + return this.popState(), this.popState(), this.begin("LINE"), 57; + case 19: + return this.popState(), this.popState(), 5; + case 20: + return this.begin("LINE"), 42; + case 21: + return this.begin("LINE"), 43; + case 22: + return this.begin("LINE"), 44; + case 23: + return this.begin("LINE"), 45; + case 24: + return this.begin("LINE"), 55; + case 25: + return this.begin("LINE"), 47; + case 26: + return this.begin("LINE"), 49; + case 27: + return this.begin("LINE"), 54; + case 28: + return this.begin("LINE"), 50; + case 29: + return this.begin("LINE"), 53; + case 30: + return this.begin("LINE"), 52; + case 31: + return this.popState(), 21; + case 32: + return 22; + case 33: + return 71; + case 34: + return 72; + case 35: + return 65; + case 36: + return 66; + case 37: + return 67; + case 38: + return 68; + case 39: + return 63; + case 40: + return 60; + case 41: + return this.begin("ID"), 27; + case 42: + return this.begin("ID"), 29; + case 43: + return 35; + case 44: + return 36; + case 45: + return this.begin("acc_title"), 37; + case 46: + return this.popState(), "acc_title_value"; + case 47: + return this.begin("acc_descr"), 39; + case 48: + return this.popState(), "acc_descr_value"; + case 49: + this.begin("acc_descr_multiline"); + break; + case 50: + this.popState(); + break; + case 51: + return "acc_descr_multiline_value"; + case 52: + return 7; + case 53: + return 24; + case 54: + return 26; + case 55: + return 70; + case 57: + return (e.yytext = e.yytext.trim()), 76; + case 58: + return 79; + case 59: + return 80; + case 60: + return 77; + case 61: + return 78; + case 62: + return 81; + case 63: + return 82; + case 64: + return 83; + case 65: + return 84; + case 66: + return 85; + case 67: + return 74; + case 68: + return 75; + case 70: + return "INVALID"; + } + }, + rules: [ + /^(?:%%\{)/i, + /^(?:((?:(?!\}%%)[^:.])*))/i, + /^(?::)/i, + /^(?:\}%%)/i, + /^(?:((?:(?!\}%%).|\n)*))/i, + /^(?:[\n]+)/i, + /^(?:\s+)/i, + /^(?:((?!\n)\s)+)/i, + /^(?:#[^\n]*)/i, + /^(?:%(?!\{)[^\n]*)/i, + /^(?:[^\}]%%[^\n]*)/i, + /^(?:[0-9]+(?=[ \n]+))/i, + /^(?:box\b)/i, + /^(?:participant\b)/i, + /^(?:actor\b)/i, + /^(?:create\b)/i, + /^(?:destroy\b)/i, + /^(?:[^\->:\n,;]+?([\-]*[^\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, + /^(?:as\b)/i, + /^(?:(?:))/i, + /^(?:loop\b)/i, + /^(?:rect\b)/i, + /^(?:opt\b)/i, + /^(?:alt\b)/i, + /^(?:else\b)/i, + /^(?:par\b)/i, + /^(?:par_over\b)/i, + /^(?:and\b)/i, + /^(?:critical\b)/i, + /^(?:option\b)/i, + /^(?:break\b)/i, + /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i, + /^(?:end\b)/i, + /^(?:left of\b)/i, + /^(?:right of\b)/i, + /^(?:links\b)/i, + /^(?:link\b)/i, + /^(?:properties\b)/i, + /^(?:details\b)/i, + /^(?:over\b)/i, + /^(?:note\b)/i, + /^(?:activate\b)/i, + /^(?:deactivate\b)/i, + /^(?:title\s[^#\n;]+)/i, + /^(?:title:\s[^#\n;]+)/i, + /^(?:accTitle\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*\{\s*)/i, + /^(?:[\}])/i, + /^(?:[^\}]*)/i, + /^(?:sequenceDiagram\b)/i, + /^(?:autonumber\b)/i, + /^(?:off\b)/i, + /^(?:,)/i, + /^(?:;)/i, + /^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i, + /^(?:->>)/i, + /^(?:-->>)/i, + /^(?:->)/i, + /^(?:-->)/i, + /^(?:-[x])/i, + /^(?:--[x])/i, + /^(?:-[\)])/i, + /^(?:--[\)])/i, + /^(?::(?:(?:no)?wrap)?[^#\n;]+)/i, + /^(?:\+)/i, + /^(?:-)/i, + /^(?:$)/i, + /^(?:.)/i, + ], + conditions: { + acc_descr_multiline: { rules: [50, 51], inclusive: !1 }, + acc_descr: { rules: [48], inclusive: !1 }, + acc_title: { rules: [46], inclusive: !1 }, + open_directive: { rules: [1, 8], inclusive: !1 }, + type_directive: { rules: [2, 3, 8], inclusive: !1 }, + arg_directive: { rules: [3, 4, 8], inclusive: !1 }, + ID: { rules: [7, 8, 17], inclusive: !1 }, + ALIAS: { rules: [7, 8, 18, 19], inclusive: !1 }, + LINE: { rules: [7, 8, 31], inclusive: !1 }, + INITIAL: { + rules: [ + 0, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 47, 49, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + ], + inclusive: !0, + }, + }, + }; + function j() { + this.yy = {}; + } + return (H.lexer = U), (j.prototype = H), (H.Parser = j), new j(); + })()); + o.parser = o; + const c = o; + let l, + h, + d, + p, + g, + u = {}, + x = {}, + y = {}, + m = [], + f = [], + b = !1; + const T = function (t, e, a, i) { + let r = d; + const s = u[t]; + if (s) { + if (d && s.box && d !== s.box) + throw new Error( + "A same participant should only be defined in one Box: " + + s.name + + " can't be in '" + + s.box.name + + "' and in '" + + d.name + + "' at the same time.", + ); + if (((r = s.box ? s.box : d), (s.box = r), s && e === s.name && null == a)) return; + } + (null != a && null != a.text) || (a = { text: e, wrap: null, type: i }), + (null != i && null != a.text) || (a = { text: e, wrap: null, type: i }), + (u[t] = { + box: r, + name: e, + description: a.text, + wrap: (void 0 === a.wrap && _()) || !!a.wrap, + prevActor: l, + links: {}, + properties: {}, + actorCnt: null, + rectData: null, + type: i || "participant", + }), + l && u[l] && (u[l].nextActor = t), + d && d.actorKeys.push(t), + (l = t); + }, + E = function (t, e, a = { text: void 0, wrap: void 0 }, i) { + if ( + i === v.ACTIVE_END && + ((t) => { + let e, + a = 0; + for (e = 0; e < f.length; e++) + f[e].type === v.ACTIVE_START && f[e].from.actor === t && a++, f[e].type === v.ACTIVE_END && f[e].from.actor === t && a--; + return a; + })(t.actor) < 1 + ) { + let e = new Error("Trying to inactivate an inactive participant (" + t.actor + ")"); + throw ( + ((e.hash = { + text: "->>-", + token: "->>-", + line: "1", + loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, + expected: ["'ACTIVE_PARTICIPANT'"], + }), + e) + ); + } + return ( + f.push({ + from: t, + to: e, + message: a.text, + wrap: (void 0 === a.wrap && _()) || !!a.wrap, + type: i, + }), + !0 + ); + }, + w = function (t) { + return u[t]; + }, + _ = () => (void 0 !== h ? h : (0, i.c)().sequence.wrap), + v = { + SOLID: 0, + DOTTED: 1, + NOTE: 2, + SOLID_CROSS: 3, + DOTTED_CROSS: 4, + SOLID_OPEN: 5, + DOTTED_OPEN: 6, + LOOP_START: 10, + LOOP_END: 11, + ALT_START: 12, + ALT_ELSE: 13, + ALT_END: 14, + OPT_START: 15, + OPT_END: 16, + ACTIVE_START: 17, + ACTIVE_END: 18, + PAR_START: 19, + PAR_AND: 20, + PAR_END: 21, + RECT_START: 22, + RECT_END: 23, + SOLID_POINT: 24, + DOTTED_POINT: 25, + AUTONUMBER: 26, + CRITICAL_START: 27, + CRITICAL_OPTION: 28, + CRITICAL_END: 29, + BREAK_START: 30, + BREAK_END: 31, + PAR_OVER_START: 32, + }, + P = function (t, e, a) { + a.text, (void 0 === a.wrap && _()) || a.wrap; + const i = [].concat(t, t); + f.push({ + from: i[0], + to: i[1], + message: a.text, + wrap: (void 0 === a.wrap && _()) || !!a.wrap, + type: v.NOTE, + placement: e, + }); + }, + k = function (t, e) { + const a = w(t); + try { + let t = (0, i.d)(e.text, (0, i.c)()); + (t = t.replace(/&/g, "&")), (t = t.replace(/=/g, "=")), L(a, JSON.parse(t)); + } catch (t) { + i.l.error("error while parsing actor link text", t); + } + }; + function L(t, e) { + if (null == t.links) t.links = e; + else for (let a in e) t.links[a] = e[a]; + } + const I = function (t, e) { + const a = w(t); + try { + let t = (0, i.d)(e.text, (0, i.c)()); + M(a, JSON.parse(t)); + } catch (t) { + i.l.error("error while parsing actor properties text", t); + } + }; + function M(t, e) { + if (null == t.properties) t.properties = e; + else for (let a in e) t.properties[a] = e[a]; + } + const N = function (t, e) { + const a = w(t), + r = document.getElementById(e.text); + try { + const t = r.innerHTML, + e = JSON.parse(t); + e.properties && M(a, e.properties), e.links && L(a, e.links); + } catch (t) { + i.l.error("error while parsing actor details text", t); + } + }, + A = function (t) { + if (Array.isArray(t)) + t.forEach(function (t) { + A(t); + }); + else + switch (t.type) { + case "sequenceIndex": + f.push({ + from: void 0, + to: void 0, + message: { + start: t.sequenceIndex, + step: t.sequenceIndexStep, + visible: t.sequenceVisible, + }, + wrap: !1, + type: t.signalType, + }); + break; + case "addParticipant": + T(t.actor, t.actor, t.description, t.draw); + break; + case "createParticipant": + if (u[t.actor]) + throw new Error( + "It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior", + ); + (p = t.actor), T(t.actor, t.actor, t.description, t.draw), (x[t.actor] = f.length); + break; + case "destroyParticipant": + (g = t.actor), (y[t.actor] = f.length); + break; + case "activeStart": + case "activeEnd": + E(t.actor, void 0, void 0, t.signalType); + break; + case "addNote": + P(t.actor, t.placement, t.text); + break; + case "addLinks": + k(t.actor, t.text); + break; + case "addALink": + !(function (t, e) { + const a = w(t); + try { + const t = {}; + let o = (0, i.d)(e.text, (0, i.c)()); + var r = o.indexOf("@"); + (o = o.replace(/&/g, "&")), (o = o.replace(/=/g, "=")); + var s = o.slice(0, r - 1).trim(), + n = o.slice(r + 1).trim(); + (t[s] = n), L(a, t); + } catch (t) { + i.l.error("error while parsing actor link text", t); + } + })(t.actor, t.text); + break; + case "addProperties": + I(t.actor, t.text); + break; + case "addDetails": + N(t.actor, t.text); + break; + case "addMessage": + if (p) { + if (t.to !== p) + throw new Error( + "The created participant " + + p + + " does not have an associated creating message after its declaration. Please check the sequence diagram.", + ); + p = void 0; + } else if (g) { + if (t.to !== g && t.from !== g) + throw new Error( + "The destroyed participant " + + g + + " does not have an associated destroying message after its declaration. Please check the sequence diagram.", + ); + g = void 0; + } + E(t.from, t.to, t.msg, t.signalType); + break; + case "boxStart": + (e = t.boxData), + m.push({ + name: e.text, + wrap: (void 0 === e.wrap && _()) || !!e.wrap, + fill: e.color, + actorKeys: [], + }), + (d = m.slice(-1)[0]); + break; + case "boxEnd": + d = void 0; + break; + case "loopStart": + E(void 0, void 0, t.loopText, t.signalType); + break; + case "loopEnd": + case "rectEnd": + case "optEnd": + case "altEnd": + case "parEnd": + case "criticalEnd": + case "breakEnd": + E(void 0, void 0, void 0, t.signalType); + break; + case "rectStart": + E(void 0, void 0, t.color, t.signalType); + break; + case "optStart": + E(void 0, void 0, t.optText, t.signalType); + break; + case "altStart": + case "else": + E(void 0, void 0, t.altText, t.signalType); + break; + case "setAccTitle": + (0, i.s)(t.text); + break; + case "parStart": + case "and": + E(void 0, void 0, t.parText, t.signalType); + break; + case "criticalStart": + E(void 0, void 0, t.criticalText, t.signalType); + break; + case "option": + E(void 0, void 0, t.optionText, t.signalType); + break; + case "breakStart": + E(void 0, void 0, t.breakText, t.signalType); + } + var e; + }, + S = { + addActor: T, + addMessage: function (t, e, a, i) { + f.push({ + from: t, + to: e, + message: a.text, + wrap: (void 0 === a.wrap && _()) || !!a.wrap, + answer: i, + }); + }, + addSignal: E, + addLinks: k, + addDetails: N, + addProperties: I, + autoWrap: _, + setWrap: function (t) { + h = t; + }, + enableSequenceNumbers: function () { + b = !0; + }, + disableSequenceNumbers: function () { + b = !1; + }, + showSequenceNumbers: () => b, + getMessages: function () { + return f; + }, + getActors: function () { + return u; + }, + getCreatedActors: function () { + return x; + }, + getDestroyedActors: function () { + return y; + }, + getActor: w, + getActorKeys: function () { + return Object.keys(u); + }, + getActorProperty: function (t, e) { + if (void 0 !== t && void 0 !== t.properties) return t.properties[e]; + }, + getAccTitle: i.g, + getBoxes: function () { + return m; + }, + getDiagramTitle: i.t, + setDiagramTitle: i.r, + parseDirective: function (t, e, a) { + i.m.parseDirective(this, t, e, a); + }, + getConfig: () => (0, i.c)().sequence, + clear: function () { + (u = {}), (x = {}), (y = {}), (m = []), (f = []), (b = !1), (0, i.v)(); + }, + parseMessage: function (t) { + const e = t.trim(), + a = { + text: e.replace(/^:?(?:no)?wrap:/, "").trim(), + wrap: null !== e.match(/^:?wrap:/) || (null === e.match(/^:?nowrap:/) && void 0), + }; + return i.l.debug("parseMessage:", a), a; + }, + parseBoxData: function (t) { + const e = t.match(/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/); + let a = null != e && e[1] ? e[1].trim() : "transparent", + r = null != e && e[2] ? e[2].trim() : void 0; + if (window && window.CSS) window.CSS.supports("color", a) || ((a = "transparent"), (r = t.trim())); + else { + const e = new Option().style; + (e.color = a), e.color !== a && ((a = "transparent"), (r = t.trim())); + } + return { + color: a, + text: void 0 !== r ? (0, i.d)(r.replace(/^:?(?:no)?wrap:/, ""), (0, i.c)()) : void 0, + wrap: void 0 !== r ? null !== r.match(/^:?wrap:/) || (null === r.match(/^:?nowrap:/) && void 0) : void 0, + }; + }, + LINETYPE: v, + ARROWTYPE: { FILLED: 0, OPEN: 1 }, + PLACEMENT: { LEFTOF: 0, RIGHTOF: 1, OVER: 2 }, + addNote: P, + setAccTitle: i.s, + apply: A, + setAccDescription: i.b, + getAccDescription: i.a, + hasAtLeastOneBox: function () { + return m.length > 0; + }, + hasAtLeastOneBoxWithTitle: function () { + return m.some((t) => t.name); + }, + }, + O = function (t, e) { + return (0, s.d)(t, e); + }, + D = (t, e) => { + (0, i.H)(() => { + const a = document.querySelectorAll(t); + 0 !== a.length && + (a[0].addEventListener("mouseover", function () { + R("actor" + e + "_popup"); + }), + a[0].addEventListener("mouseout", function () { + Y("actor" + e + "_popup"); + })); + }); + }, + R = function (t) { + var e = document.getElementById(t); + null != e && (e.style.display = "block"); + }, + Y = function (t) { + var e = document.getElementById(t); + null != e && (e.style.display = "none"); + }, + $ = function (t, e) { + let a = 0, + r = 0; + const s = e.text.split(i.e.lineBreakRegex), + [n, o] = (0, i.F)(e.fontSize); + let c = [], + l = 0, + h = () => e.y; + if (void 0 !== e.valign && void 0 !== e.textMargin && e.textMargin > 0) + switch (e.valign) { + case "top": + case "start": + h = () => Math.round(e.y + e.textMargin); + break; + case "middle": + case "center": + h = () => Math.round(e.y + (a + r + e.textMargin) / 2); + break; + case "bottom": + case "end": + h = () => Math.round(e.y + (a + r + 2 * e.textMargin) - e.textMargin); + } + if (void 0 !== e.anchor && void 0 !== e.textMargin && void 0 !== e.width) + switch (e.anchor) { + case "left": + case "start": + (e.x = Math.round(e.x + e.textMargin)), (e.anchor = "start"), (e.dominantBaseline = "middle"), (e.alignmentBaseline = "middle"); + break; + case "middle": + case "center": + (e.x = Math.round(e.x + e.width / 2)), (e.anchor = "middle"), (e.dominantBaseline = "middle"), (e.alignmentBaseline = "middle"); + break; + case "right": + case "end": + (e.x = Math.round(e.x + e.width - e.textMargin)), + (e.anchor = "end"), + (e.dominantBaseline = "middle"), + (e.alignmentBaseline = "middle"); + } + for (let [d, p] of s.entries()) { + void 0 !== e.textMargin && 0 === e.textMargin && void 0 !== n && (l = d * n); + const s = t.append("text"); + s.attr("x", e.x), + s.attr("y", h()), + void 0 !== e.anchor && + s.attr("text-anchor", e.anchor).attr("dominant-baseline", e.dominantBaseline).attr("alignment-baseline", e.alignmentBaseline), + void 0 !== e.fontFamily && s.style("font-family", e.fontFamily), + void 0 !== o && s.style("font-size", o), + void 0 !== e.fontWeight && s.style("font-weight", e.fontWeight), + void 0 !== e.fill && s.attr("fill", e.fill), + void 0 !== e.class && s.attr("class", e.class), + void 0 !== e.dy ? s.attr("dy", e.dy) : 0 !== l && s.attr("dy", l); + const g = p || i.Z; + if (e.tspan) { + const t = s.append("tspan"); + t.attr("x", e.x), void 0 !== e.fill && t.attr("fill", e.fill), t.text(g); + } else s.text(g); + void 0 !== e.valign && void 0 !== e.textMargin && e.textMargin > 0 && ((r += (s._groups || s)[0][0].getBBox().height), (a = r)), + c.push(s); + } + return c; + }, + C = function (t, e) { + const a = t.append("polygon"); + var i, r, s, n; + return ( + a.attr( + "points", + (i = e.x) + + "," + + (r = e.y) + + " " + + (i + (s = e.width)) + + "," + + r + + " " + + (i + s) + + "," + + (r + (n = e.height) - 7) + + " " + + (i + s - 8.4) + + "," + + (r + n) + + " " + + i + + "," + + (r + n), + ), + a.attr("class", "labelBox"), + (e.y = e.y + e.height / 2), + $(t, e), + a + ); + }; + let V = -1; + const B = (t, e, a, i) => { + t.select && + a.forEach((a) => { + const r = e[a], + s = t.select("#actor" + r.actorCnt); + !i.mirrorActors && r.stopy ? s.attr("y2", r.stopy + r.height / 2) : i.mirrorActors && s.attr("y2", r.stopy); + }); + }, + F = function (t, e) { + (0, s.a)(t, e); + }, + W = (function () { + function t(t, e, a, i, s, n, o) { + r( + e + .append("text") + .attr("x", a + s / 2) + .attr("y", i + n / 2 + 5) + .style("text-anchor", "middle") + .text(t), + o, + ); + } + function e(t, e, a, s, n, o, c, l) { + const { actorFontSize: h, actorFontFamily: d, actorFontWeight: p } = l, + [g, u] = (0, i.F)(h), + x = t.split(i.e.lineBreakRegex); + for (let t = 0; t < x.length; t++) { + const i = t * g - (g * (x.length - 1)) / 2, + l = e + .append("text") + .attr("x", a + n / 2) + .attr("y", s) + .style("text-anchor", "middle") + .style("font-size", u) + .style("font-weight", p) + .style("font-family", d); + l + .append("tspan") + .attr("x", a + n / 2) + .attr("dy", i) + .text(x[t]), + l + .attr("y", s + o / 2) + .attr("dominant-baseline", "central") + .attr("alignment-baseline", "central"), + r(l, c); + } + } + function a(t, a, i, s, n, o, c, l) { + const h = a.append("switch"), + d = h + .append("foreignObject") + .attr("x", i) + .attr("y", s) + .attr("width", n) + .attr("height", o) + .append("xhtml:div") + .style("display", "table") + .style("height", "100%") + .style("width", "100%"); + d.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(t), + e(t, h, i, s, n, o, c, l), + r(d, c); + } + function r(t, e) { + for (const a in e) e.hasOwnProperty(a) && t.attr(a, e[a]); + } + return function (i) { + return "fo" === i.textPlacement ? a : "old" === i.textPlacement ? t : e; + }; + })(), + q = (function () { + function t(t, e, a, i, s, n, o) { + r(e.append("text").attr("x", a).attr("y", i).style("text-anchor", "start").text(t), o); + } + function e(t, e, a, s, n, o, c, l) { + const { actorFontSize: h, actorFontFamily: d, actorFontWeight: p } = l, + g = t.split(i.e.lineBreakRegex); + for (let t = 0; t < g.length; t++) { + const i = t * h - (h * (g.length - 1)) / 2, + n = e + .append("text") + .attr("x", a) + .attr("y", s) + .style("text-anchor", "start") + .style("font-size", h) + .style("font-weight", p) + .style("font-family", d); + n.append("tspan").attr("x", a).attr("dy", i).text(g[t]), + n + .attr("y", s + o / 2) + .attr("dominant-baseline", "central") + .attr("alignment-baseline", "central"), + r(n, c); + } + } + function a(t, a, i, s, n, o, c, l) { + const h = a.append("switch"), + d = h + .append("foreignObject") + .attr("x", i) + .attr("y", s) + .attr("width", n) + .attr("height", o) + .append("xhtml:div") + .style("display", "table") + .style("height", "100%") + .style("width", "100%"); + d.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(t), + e(t, h, i, s, 0, o, c, l), + r(d, c); + } + function r(t, e) { + for (const a in e) e.hasOwnProperty(a) && t.attr(a, e[a]); + } + return function (i) { + return "fo" === i.textPlacement ? a : "old" === i.textPlacement ? t : e; + }; + })(), + z = O, + H = function (t, e, a, i) { + switch (e.type) { + case "actor": + return (function (t, e, a, i) { + const r = i ? e.stopy : e.starty, + n = e.x + e.width / 2, + o = r + 80; + t.lower(), + i || + (V++, + t + .append("line") + .attr("id", "actor" + V) + .attr("x1", n) + .attr("y1", o) + .attr("x2", n) + .attr("y2", 2e3) + .attr("class", "actor-line") + .attr("class", "200") + .attr("stroke-width", "0.5px") + .attr("stroke", "#999"), + (e.actorCnt = V)); + const c = t.append("g"); + c.attr("class", "actor-man"); + const l = (0, s.g)(); + (l.x = e.x), + (l.y = r), + (l.fill = "#eaeaea"), + (l.width = e.width), + (l.height = e.height), + (l.class = "actor"), + (l.rx = 3), + (l.ry = 3), + c + .append("line") + .attr("id", "actor-man-torso" + V) + .attr("x1", n) + .attr("y1", r + 25) + .attr("x2", n) + .attr("y2", r + 45), + c + .append("line") + .attr("id", "actor-man-arms" + V) + .attr("x1", n - 18) + .attr("y1", r + 33) + .attr("x2", n + 18) + .attr("y2", r + 33), + c + .append("line") + .attr("x1", n - 18) + .attr("y1", r + 60) + .attr("x2", n) + .attr("y2", r + 45), + c + .append("line") + .attr("x1", n) + .attr("y1", r + 45) + .attr("x2", n + 18 - 2) + .attr("y2", r + 60); + const h = c.append("circle"); + h.attr("cx", e.x + e.width / 2), h.attr("cy", r + 10), h.attr("r", 15), h.attr("width", e.width), h.attr("height", e.height); + const d = c.node().getBBox(); + return (e.height = d.height), W(a)(e.description, c, l.x, l.y + 35, l.width, l.height, { class: "actor" }, a), e.height; + })(t, e, a, i); + case "participant": + return (function (t, e, a, i) { + const r = i ? e.stopy : e.starty, + n = e.x + e.width / 2, + o = r + 5, + c = t.append("g").lower(); + var l = c; + i || + (V++, + l + .append("line") + .attr("id", "actor" + V) + .attr("x1", n) + .attr("y1", o) + .attr("x2", n) + .attr("y2", 2e3) + .attr("class", "actor-line") + .attr("class", "200") + .attr("stroke-width", "0.5px") + .attr("stroke", "#999"), + (l = c.append("g")), + (e.actorCnt = V), + null != e.links && (l.attr("id", "root-" + V), D("#root-" + V, V))); + const h = (0, s.g)(); + var d = "actor"; + null != e.properties && e.properties.class ? (d = e.properties.class) : (h.fill = "#eaeaea"), + (h.x = e.x), + (h.y = r), + (h.width = e.width), + (h.height = e.height), + (h.class = d), + (h.rx = 3), + (h.ry = 3); + const p = O(l, h); + if (((e.rectData = h), null != e.properties && e.properties.icon)) { + const t = e.properties.icon.trim(); + "@" === t.charAt(0) ? (0, s.b)(l, h.x + h.width - 20, h.y + 10, t.substr(1)) : (0, s.c)(l, h.x + h.width - 20, h.y + 10, t); + } + W(a)(e.description, l, h.x, h.y, h.width, h.height, { class: "actor" }, a); + let g = e.height; + if (p.node) { + const t = p.node().getBBox(); + (e.height = t.height), (g = t.height); + } + return g; + })(t, e, a, i); + } + }, + U = function (t, e, a) { + const i = t.append("g"); + F(i, e), e.name && W(a)(e.name, i, e.x, e.y + (e.textMaxHeight || 0) / 2, e.width, 0, { class: "text" }, a), i.lower(); + }, + j = function (t, e, a, i, r) { + if (void 0 === e.links || null === e.links || 0 === Object.keys(e.links).length) return { height: 0, width: 0 }; + const s = e.links, + o = e.actorCnt, + c = e.rectData; + var l = "none"; + r && (l = "block !important"); + const h = t.append("g"); + h.attr("id", "actor" + o + "_popup"), h.attr("class", "actorPopupMenu"), h.attr("display", l), D("#actor" + o + "_popup", o); + var d = ""; + void 0 !== c.class && (d = " " + c.class); + let p = c.width > a ? c.width : a; + const g = h.append("rect"); + if ( + (g.attr("class", "actorPopupMenuPanel" + d), + g.attr("x", c.x), + g.attr("y", c.height), + g.attr("fill", c.fill), + g.attr("stroke", c.stroke), + g.attr("width", p), + g.attr("height", c.height), + g.attr("rx", c.rx), + g.attr("ry", c.ry), + null != s) + ) { + var u = 20; + for (let t in s) { + var x = h.append("a"), + y = (0, n.Nm)(s[t]); + x.attr("xlink:href", y), x.attr("target", "_blank"), q(i)(t, x, c.x + 10, c.height + u, p, 20, { class: "actor" }, i), (u += 30); + } + } + return g.attr("height", u), { height: c.height + u, width: p }; + }, + K = function (t) { + return t.append("g"); + }, + X = function (t, e, a, i, r) { + const n = (0, s.g)(), + o = e.anchored; + (n.x = e.startx), (n.y = e.starty), (n.class = "activation" + (r % 3)), (n.width = e.stopx - e.startx), (n.height = a - e.starty), O(o, n); + }, + G = function (t, e, a, i) { + const { + boxMargin: r, + boxTextMargin: n, + labelBoxHeight: o, + labelBoxWidth: c, + messageFontFamily: l, + messageFontSize: h, + messageFontWeight: d, + } = i, + p = t.append("g"), + g = function (t, e, a, i) { + return p.append("line").attr("x1", t).attr("y1", e).attr("x2", a).attr("y2", i).attr("class", "loopLine"); + }; + g(e.startx, e.starty, e.stopx, e.starty), + g(e.stopx, e.starty, e.stopx, e.stopy), + g(e.startx, e.stopy, e.stopx, e.stopy), + g(e.startx, e.starty, e.startx, e.stopy), + void 0 !== e.sections && + e.sections.forEach(function (t) { + g(e.startx, t.y, e.stopx, t.y).style("stroke-dasharray", "3, 3"); + }); + let u = (0, s.e)(); + (u.text = a), + (u.x = e.startx), + (u.y = e.starty), + (u.fontFamily = l), + (u.fontSize = h), + (u.fontWeight = d), + (u.anchor = "middle"), + (u.valign = "middle"), + (u.tspan = !1), + (u.width = c || 50), + (u.height = o || 20), + (u.textMargin = n), + (u.class = "labelText"), + C(p, u), + (u = { + x: 0, + y: 0, + fill: void 0, + anchor: void 0, + style: "#666", + width: void 0, + height: void 0, + textMargin: 0, + rx: 0, + ry: 0, + tspan: !0, + valign: void 0, + }), + (u.text = e.title), + (u.x = e.startx + c / 2 + (e.stopx - e.startx) / 2), + (u.y = e.starty + r + n), + (u.anchor = "middle"), + (u.valign = "middle"), + (u.textMargin = n), + (u.class = "loopText"), + (u.fontFamily = l), + (u.fontSize = h), + (u.fontWeight = d), + (u.wrap = !0); + let x = $(p, u); + return ( + void 0 !== e.sectionTitles && + e.sectionTitles.forEach(function (t, a) { + if (t.message) { + (u.text = t.message), + (u.x = e.startx + (e.stopx - e.startx) / 2), + (u.y = e.sections[a].y + r + n), + (u.class = "loopText"), + (u.anchor = "middle"), + (u.valign = "middle"), + (u.tspan = !1), + (u.fontFamily = l), + (u.fontSize = h), + (u.fontWeight = d), + (u.wrap = e.wrap), + (x = $(p, u)); + let i = Math.round(x.map((t) => (t._groups || t)[0][0].getBBox().height).reduce((t, e) => t + e)); + e.sections[a].height += i - (r + n); + } + }), + (e.height = Math.round(e.stopy - e.starty)), + p + ); + }, + J = F, + Z = function (t) { + t.append("defs") + .append("marker") + .attr("id", "arrowhead") + .attr("refX", 9) + .attr("refY", 5) + .attr("markerUnits", "userSpaceOnUse") + .attr("markerWidth", 12) + .attr("markerHeight", 12) + .attr("orient", "auto") + .append("path") + .attr("d", "M 0 0 L 10 5 L 0 10 z"); + }, + Q = function (t) { + t.append("defs") + .append("marker") + .attr("id", "filled-head") + .attr("refX", 18) + .attr("refY", 7) + .attr("markerWidth", 20) + .attr("markerHeight", 28) + .attr("orient", "auto") + .append("path") + .attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); + }, + tt = function (t) { + t.append("defs") + .append("marker") + .attr("id", "sequencenumber") + .attr("refX", 15) + .attr("refY", 15) + .attr("markerWidth", 60) + .attr("markerHeight", 40) + .attr("orient", "auto") + .append("circle") + .attr("cx", 15) + .attr("cy", 15) + .attr("r", 6); + }, + et = function (t) { + t.append("defs") + .append("marker") + .attr("id", "crosshead") + .attr("markerWidth", 15) + .attr("markerHeight", 8) + .attr("orient", "auto") + .attr("refX", 4) + .attr("refY", 5) + .append("path") + .attr("fill", "none") + .attr("stroke", "#000000") + .style("stroke-dasharray", "0, 0") + .attr("stroke-width", "1pt") + .attr("d", "M 1,2 L 6,7 M 6,2 L 1,7"); + }, + at = function (t) { + t.append("defs") + .append("symbol") + .attr("id", "database") + .attr("fill-rule", "evenodd") + .attr("clip-rule", "evenodd") + .append("path") + .attr("transform", "scale(.5)") + .attr( + "d", + "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z", + ); + }, + it = function (t) { + t.append("defs") + .append("symbol") + .attr("id", "computer") + .attr("width", "24") + .attr("height", "24") + .append("path") + .attr("transform", "scale(.5)") + .attr( + "d", + "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z", + ); + }, + rt = function (t) { + t.append("defs") + .append("symbol") + .attr("id", "clock") + .attr("width", "24") + .attr("height", "24") + .append("path") + .attr("transform", "scale(.5)") + .attr( + "d", + "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z", + ); + }; + n.Nm; + let st = {}; + const nt = { + data: { startx: void 0, stopx: void 0, starty: void 0, stopy: void 0 }, + verticalPos: 0, + sequenceItems: [], + activations: [], + models: { + getHeight: function () { + return ( + Math.max.apply(null, 0 === this.actors.length ? [0] : this.actors.map((t) => t.height || 0)) + + (0 === this.loops.length ? 0 : this.loops.map((t) => t.height || 0).reduce((t, e) => t + e)) + + (0 === this.messages.length ? 0 : this.messages.map((t) => t.height || 0).reduce((t, e) => t + e)) + + (0 === this.notes.length ? 0 : this.notes.map((t) => t.height || 0).reduce((t, e) => t + e)) + ); + }, + clear: function () { + (this.actors = []), (this.boxes = []), (this.loops = []), (this.messages = []), (this.notes = []); + }, + addBox: function (t) { + this.boxes.push(t); + }, + addActor: function (t) { + this.actors.push(t); + }, + addLoop: function (t) { + this.loops.push(t); + }, + addMessage: function (t) { + this.messages.push(t); + }, + addNote: function (t) { + this.notes.push(t); + }, + lastActor: function () { + return this.actors[this.actors.length - 1]; + }, + lastLoop: function () { + return this.loops[this.loops.length - 1]; + }, + lastMessage: function () { + return this.messages[this.messages.length - 1]; + }, + lastNote: function () { + return this.notes[this.notes.length - 1]; + }, + actors: [], + boxes: [], + loops: [], + messages: [], + notes: [], + }, + init: function () { + (this.sequenceItems = []), + (this.activations = []), + this.models.clear(), + (this.data = { startx: void 0, stopx: void 0, starty: void 0, stopy: void 0 }), + (this.verticalPos = 0), + pt((0, i.c)()); + }, + updateVal: function (t, e, a, i) { + void 0 === t[e] ? (t[e] = a) : (t[e] = i(a, t[e])); + }, + updateBounds: function (t, e, a, i) { + const r = this; + let s = 0; + function n(n) { + return function (o) { + s++; + const c = r.sequenceItems.length - s + 1; + r.updateVal(o, "starty", e - c * st.boxMargin, Math.min), + r.updateVal(o, "stopy", i + c * st.boxMargin, Math.max), + r.updateVal(nt.data, "startx", t - c * st.boxMargin, Math.min), + r.updateVal(nt.data, "stopx", a + c * st.boxMargin, Math.max), + "activation" !== n && + (r.updateVal(o, "startx", t - c * st.boxMargin, Math.min), + r.updateVal(o, "stopx", a + c * st.boxMargin, Math.max), + r.updateVal(nt.data, "starty", e - c * st.boxMargin, Math.min), + r.updateVal(nt.data, "stopy", i + c * st.boxMargin, Math.max)); + }; + } + this.sequenceItems.forEach(n()), this.activations.forEach(n("activation")); + }, + insert: function (t, e, a, r) { + const s = i.e.getMin(t, a), + n = i.e.getMax(t, a), + o = i.e.getMin(e, r), + c = i.e.getMax(e, r); + this.updateVal(nt.data, "startx", s, Math.min), + this.updateVal(nt.data, "starty", o, Math.min), + this.updateVal(nt.data, "stopx", n, Math.max), + this.updateVal(nt.data, "stopy", c, Math.max), + this.updateBounds(s, o, n, c); + }, + newActivation: function (t, e, a) { + const i = a[t.from.actor], + r = gt(t.from.actor).length || 0, + s = i.x + i.width / 2 + ((r - 1) * st.activationWidth) / 2; + this.activations.push({ + startx: s, + starty: this.verticalPos + 2, + stopx: s + st.activationWidth, + stopy: void 0, + actor: t.from.actor, + anchored: K(e), + }); + }, + endActivation: function (t) { + const e = this.activations + .map(function (t) { + return t.actor; + }) + .lastIndexOf(t.from.actor); + return this.activations.splice(e, 1)[0]; + }, + createLoop: function (t = { message: void 0, wrap: !1, width: void 0 }, e) { + return { + startx: void 0, + starty: this.verticalPos, + stopx: void 0, + stopy: void 0, + title: t.message, + wrap: t.wrap, + width: t.width, + height: 0, + fill: e, + }; + }, + newLoop: function (t = { message: void 0, wrap: !1, width: void 0 }, e) { + this.sequenceItems.push(this.createLoop(t, e)); + }, + endLoop: function () { + return this.sequenceItems.pop(); + }, + isLoopOverlap: function () { + return !!this.sequenceItems.length && this.sequenceItems[this.sequenceItems.length - 1].overlap; + }, + addSectionToLoop: function (t) { + const e = this.sequenceItems.pop(); + (e.sections = e.sections || []), + (e.sectionTitles = e.sectionTitles || []), + e.sections.push({ y: nt.getVerticalPos(), height: 0 }), + e.sectionTitles.push(t), + this.sequenceItems.push(e); + }, + saveVerticalPos: function () { + this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos); + }, + resetVerticalPos: function () { + this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos); + }, + bumpVerticalPos: function (t) { + (this.verticalPos = this.verticalPos + t), (this.data.stopy = i.e.getMax(this.data.stopy, this.verticalPos)); + }, + getVerticalPos: function () { + return this.verticalPos; + }, + getBounds: function () { + return { bounds: this.data, models: this.models }; + }, + }, + ot = (t) => ({ + fontFamily: t.messageFontFamily, + fontSize: t.messageFontSize, + fontWeight: t.messageFontWeight, + }), + ct = (t) => ({ + fontFamily: t.noteFontFamily, + fontSize: t.noteFontSize, + fontWeight: t.noteFontWeight, + }), + lt = (t) => ({ + fontFamily: t.actorFontFamily, + fontSize: t.actorFontSize, + fontWeight: t.actorFontWeight, + }), + ht = function (t, e, a, r) { + if (r) { + let r = 0; + nt.bumpVerticalPos(2 * st.boxMargin); + for (const s of a) { + const a = e[s]; + a.stopy || (a.stopy = nt.getVerticalPos()); + const n = H(t, a, st, !0); + r = i.e.getMax(r, n); + } + nt.bumpVerticalPos(r + st.boxMargin); + } else + for (const i of a) { + const a = e[i]; + H(t, a, st, !1); + } + }, + dt = function (t, e, a, i) { + let r = 0, + s = 0; + for (const n of a) { + const a = e[n], + o = yt(a), + c = j(t, a, o, st, st.forceMenus, i); + c.height > r && (r = c.height), c.width + a.x > s && (s = c.width + a.x); + } + return { maxHeight: r, maxWidth: s }; + }, + pt = function (t) { + (0, i.f)(st, t), + t.fontFamily && (st.actorFontFamily = st.noteFontFamily = st.messageFontFamily = t.fontFamily), + t.fontSize && (st.actorFontSize = st.noteFontSize = st.messageFontSize = t.fontSize), + t.fontWeight && (st.actorFontWeight = st.noteFontWeight = st.messageFontWeight = t.fontWeight); + }, + gt = function (t) { + return nt.activations.filter(function (e) { + return e.actor === t; + }); + }, + ut = function (t, e) { + const a = e[t], + r = gt(t); + return [ + r.reduce( + function (t, e) { + return i.e.getMin(t, e.startx); + }, + a.x + a.width / 2, + ), + r.reduce( + function (t, e) { + return i.e.getMax(t, e.stopx); + }, + a.x + a.width / 2, + ), + ]; + }; + function xt(t, e, a, r, s) { + nt.bumpVerticalPos(a); + let n = r; + if (e.id && e.message && t[e.id]) { + const a = t[e.id].width, + s = ot(st); + (e.message = i.u.wrapLabel(`[${e.message}]`, a - 2 * st.wrapPadding, s)), (e.width = a), (e.wrap = !0); + const o = i.u.calculateTextDimensions(e.message, s), + c = i.e.getMax(o.height, st.labelBoxHeight); + (n = r + c), i.l.debug(`${c} - ${e.message}`); + } + s(e), nt.bumpVerticalPos(n); + } + const yt = function (t) { + let e = 0; + const a = lt(st); + for (const r in t.links) { + const t = i.u.calculateTextDimensions(r, a).width + 2 * st.wrapPadding + 2 * st.boxMargin; + e < t && (e = t); + } + return e; + }, + mt = { + parser: c, + db: S, + renderer: { + bounds: nt, + drawActors: ht, + drawActorsPopup: dt, + setConf: pt, + draw: function (t, e, a, n) { + const { securityLevel: o, sequence: c } = (0, i.c)(); + let l; + (st = c), "sandbox" === o && (l = (0, r.Ys)("#i" + e)); + const h = "sandbox" === o ? (0, r.Ys)(l.nodes()[0].contentDocument.body) : (0, r.Ys)("body"), + d = "sandbox" === o ? l.nodes()[0].contentDocument : document; + nt.init(), i.l.debug(n.db); + const p = "sandbox" === o ? h.select(`[id="${e}"]`) : (0, r.Ys)(`[id="${e}"]`), + g = n.db.getActors(), + u = n.db.getCreatedActors(), + x = n.db.getDestroyedActors(), + y = n.db.getBoxes(); + let m = n.db.getActorKeys(); + const f = n.db.getMessages(), + b = n.db.getDiagramTitle(), + T = n.db.hasAtLeastOneBox(), + E = n.db.hasAtLeastOneBoxWithTitle(), + w = (function (t, e, a) { + const r = {}; + return ( + e.forEach(function (e) { + if (t[e.to] && t[e.from]) { + const s = t[e.to]; + if (e.placement === a.db.PLACEMENT.LEFTOF && !s.prevActor) return; + if (e.placement === a.db.PLACEMENT.RIGHTOF && !s.nextActor) return; + const n = void 0 !== e.placement, + o = !n, + c = n ? ct(st) : ot(st), + l = e.wrap ? i.u.wrapLabel(e.message, st.width - 2 * st.wrapPadding, c) : e.message, + h = i.u.calculateTextDimensions(l, c).width + 2 * st.wrapPadding; + o && e.from === s.nextActor + ? (r[e.to] = i.e.getMax(r[e.to] || 0, h)) + : o && e.from === s.prevActor + ? (r[e.from] = i.e.getMax(r[e.from] || 0, h)) + : o && e.from === e.to + ? ((r[e.from] = i.e.getMax(r[e.from] || 0, h / 2)), (r[e.to] = i.e.getMax(r[e.to] || 0, h / 2))) + : e.placement === a.db.PLACEMENT.RIGHTOF + ? (r[e.from] = i.e.getMax(r[e.from] || 0, h)) + : e.placement === a.db.PLACEMENT.LEFTOF + ? (r[s.prevActor] = i.e.getMax(r[s.prevActor] || 0, h)) + : e.placement === a.db.PLACEMENT.OVER && + (s.prevActor && (r[s.prevActor] = i.e.getMax(r[s.prevActor] || 0, h / 2)), + s.nextActor && (r[e.from] = i.e.getMax(r[e.from] || 0, h / 2))); + } + }), + i.l.debug("maxMessageWidthPerActor:", r), + r + ); + })(g, f, n); + if ( + ((st.height = (function (t, e, a) { + let r = 0; + Object.keys(t).forEach((e) => { + const a = t[e]; + a.wrap && (a.description = i.u.wrapLabel(a.description, st.width - 2 * st.wrapPadding, lt(st))); + const s = i.u.calculateTextDimensions(a.description, lt(st)); + (a.width = a.wrap ? st.width : i.e.getMax(st.width, s.width + 2 * st.wrapPadding)), + (a.height = a.wrap ? i.e.getMax(s.height, st.height) : st.height), + (r = i.e.getMax(r, a.height)); + }); + for (const a in e) { + const r = t[a]; + if (!r) continue; + const s = t[r.nextActor]; + if (!s) { + const t = e[a] + st.actorMargin - r.width / 2; + r.margin = i.e.getMax(t, st.actorMargin); + continue; + } + const n = e[a] + st.actorMargin - r.width / 2 - s.width / 2; + r.margin = i.e.getMax(n, st.actorMargin); + } + let s = 0; + return ( + a.forEach((e) => { + const a = ot(st); + let r = e.actorKeys.reduce((e, a) => e + (t[a].width + (t[a].margin || 0)), 0); + (r -= 2 * st.boxTextMargin), e.wrap && (e.name = i.u.wrapLabel(e.name, r - 2 * st.wrapPadding, a)); + const n = i.u.calculateTextDimensions(e.name, a); + s = i.e.getMax(n.height, s); + const o = i.e.getMax(r, n.width + 2 * st.wrapPadding); + if (((e.margin = st.boxTextMargin), r < o)) { + const t = (o - r) / 2; + e.margin += t; + } + }), + a.forEach((t) => (t.textMaxHeight = s)), + i.e.getMax(r, st.height) + ); + })(g, w, y)), + it(p), + at(p), + rt(p), + T && (nt.bumpVerticalPos(st.boxMargin), E && nt.bumpVerticalPos(y[0].textMaxHeight)), + !0 === st.hideUnusedParticipants) + ) { + const t = new Set(); + f.forEach((e) => { + t.add(e.from), t.add(e.to); + }), + (m = m.filter((e) => t.has(e))); + } + !(function (t, e, a, r, s, n, o) { + let c, + l = 0, + h = 0, + d = 0; + for (const t of r) { + const r = e[t], + s = r.box; + c && c != s && (nt.models.addBox(c), (h += st.boxMargin + c.margin)), + s && s != c && ((s.x = l + h), (s.y = 0), (h += s.margin)), + (r.width = r.width || st.width), + (r.height = i.e.getMax(r.height || st.height, st.height)), + (r.margin = r.margin || st.actorMargin), + (d = i.e.getMax(d, r.height)), + a[r.name] && (h += r.width / 2), + (r.x = l + h), + (r.starty = nt.getVerticalPos()), + nt.insert(r.x, 0, r.x + r.width, r.height), + (l += r.width + h), + r.box && (r.box.width = l + s.margin - r.box.x), + (h = r.margin), + (c = r.box), + nt.models.addActor(r); + } + c && nt.models.addBox(c), nt.bumpVerticalPos(d); + })(0, g, u, m); + const _ = (function (t, e, a, r) { + const s = {}, + n = []; + let o, c, l; + return ( + t.forEach(function (t) { + switch (((t.id = i.u.random({ length: 10 })), t.type)) { + case r.db.LINETYPE.LOOP_START: + case r.db.LINETYPE.ALT_START: + case r.db.LINETYPE.OPT_START: + case r.db.LINETYPE.PAR_START: + case r.db.LINETYPE.PAR_OVER_START: + case r.db.LINETYPE.CRITICAL_START: + case r.db.LINETYPE.BREAK_START: + n.push({ + id: t.id, + msg: t.message, + from: Number.MAX_SAFE_INTEGER, + to: Number.MIN_SAFE_INTEGER, + width: 0, + }); + break; + case r.db.LINETYPE.ALT_ELSE: + case r.db.LINETYPE.PAR_AND: + case r.db.LINETYPE.CRITICAL_OPTION: + t.message && ((o = n.pop()), (s[o.id] = o), (s[t.id] = o), n.push(o)); + break; + case r.db.LINETYPE.LOOP_END: + case r.db.LINETYPE.ALT_END: + case r.db.LINETYPE.OPT_END: + case r.db.LINETYPE.PAR_END: + case r.db.LINETYPE.CRITICAL_END: + case r.db.LINETYPE.BREAK_END: + (o = n.pop()), (s[o.id] = o); + break; + case r.db.LINETYPE.ACTIVE_START: + { + const a = e[t.from ? t.from.actor : t.to.actor], + i = gt(t.from ? t.from.actor : t.to.actor).length, + r = a.x + a.width / 2 + ((i - 1) * st.activationWidth) / 2, + s = { + startx: r, + stopx: r + st.activationWidth, + actor: t.from.actor, + enabled: !0, + }; + nt.activations.push(s); + } + break; + case r.db.LINETYPE.ACTIVE_END: { + const e = nt.activations.map((t) => t.actor).lastIndexOf(t.from.actor); + delete nt.activations.splice(e, 1)[0]; + } + } + void 0 !== t.placement + ? ((c = (function (t, e, a) { + const r = e[t.from].x, + s = e[t.to].x, + n = t.wrap && t.message; + let o = i.u.calculateTextDimensions(n ? i.u.wrapLabel(t.message, st.width, ct(st)) : t.message, ct(st)); + const c = { + width: n ? st.width : i.e.getMax(st.width, o.width + 2 * st.noteMargin), + height: 0, + startx: e[t.from].x, + stopx: 0, + starty: 0, + stopy: 0, + message: t.message, + }; + return ( + t.placement === a.db.PLACEMENT.RIGHTOF + ? ((c.width = n + ? i.e.getMax(st.width, o.width) + : i.e.getMax(e[t.from].width / 2 + e[t.to].width / 2, o.width + 2 * st.noteMargin)), + (c.startx = r + (e[t.from].width + st.actorMargin) / 2)) + : t.placement === a.db.PLACEMENT.LEFTOF + ? ((c.width = n + ? i.e.getMax(st.width, o.width + 2 * st.noteMargin) + : i.e.getMax(e[t.from].width / 2 + e[t.to].width / 2, o.width + 2 * st.noteMargin)), + (c.startx = r - c.width + (e[t.from].width - st.actorMargin) / 2)) + : t.to === t.from + ? ((o = i.u.calculateTextDimensions( + n ? i.u.wrapLabel(t.message, i.e.getMax(st.width, e[t.from].width), ct(st)) : t.message, + ct(st), + )), + (c.width = n + ? i.e.getMax(st.width, e[t.from].width) + : i.e.getMax(e[t.from].width, st.width, o.width + 2 * st.noteMargin)), + (c.startx = r + (e[t.from].width - c.width) / 2)) + : ((c.width = Math.abs(r + e[t.from].width / 2 - (s + e[t.to].width / 2)) + st.actorMargin), + (c.startx = r < s ? r + e[t.from].width / 2 - st.actorMargin / 2 : s + e[t.to].width / 2 - st.actorMargin / 2)), + n && (c.message = i.u.wrapLabel(t.message, c.width - 2 * st.wrapPadding, ct(st))), + i.l.debug(`NM:[${c.startx},${c.stopx},${c.starty},${c.stopy}:${c.width},${c.height}=${t.message}]`), + c + ); + })(t, e, r)), + (t.noteModel = c), + n.forEach((t) => { + (o = t), + (o.from = i.e.getMin(o.from, c.startx)), + (o.to = i.e.getMax(o.to, c.startx + c.width)), + (o.width = i.e.getMax(o.width, Math.abs(o.from - o.to)) - st.labelBoxWidth); + })) + : ((l = (function (t, e, a) { + let r = !1; + if ( + ([ + a.db.LINETYPE.SOLID_OPEN, + a.db.LINETYPE.DOTTED_OPEN, + a.db.LINETYPE.SOLID, + a.db.LINETYPE.DOTTED, + a.db.LINETYPE.SOLID_CROSS, + a.db.LINETYPE.DOTTED_CROSS, + a.db.LINETYPE.SOLID_POINT, + a.db.LINETYPE.DOTTED_POINT, + ].includes(t.type) && (r = !0), + !r) + ) + return {}; + const s = ut(t.from, e), + n = ut(t.to, e), + o = s[0] <= n[0] ? 1 : 0, + c = s[0] < n[0] ? 0 : 1, + l = [...s, ...n], + h = Math.abs(n[c] - s[o]); + t.wrap && t.message && (t.message = i.u.wrapLabel(t.message, i.e.getMax(h + 2 * st.wrapPadding, st.width), ot(st))); + const d = i.u.calculateTextDimensions(t.message, ot(st)); + return { + width: i.e.getMax(t.wrap ? 0 : d.width + 2 * st.wrapPadding, h + 2 * st.wrapPadding, st.width), + height: 0, + startx: s[o], + stopx: n[c], + starty: 0, + stopy: 0, + message: t.message, + type: t.type, + wrap: t.wrap, + fromBounds: Math.min.apply(null, l), + toBounds: Math.max.apply(null, l), + }; + })(t, e, r)), + (t.msgModel = l), + l.startx && + l.stopx && + n.length > 0 && + n.forEach((a) => { + if (((o = a), l.startx === l.stopx)) { + const a = e[t.from], + r = e[t.to]; + (o.from = i.e.getMin(a.x - l.width / 2, a.x - a.width / 2, o.from)), + (o.to = i.e.getMax(r.x + l.width / 2, r.x + a.width / 2, o.to)), + (o.width = i.e.getMax(o.width, Math.abs(o.to - o.from)) - st.labelBoxWidth); + } else + (o.from = i.e.getMin(l.startx, o.from)), + (o.to = i.e.getMax(l.stopx, o.to)), + (o.width = i.e.getMax(o.width, l.width) - st.labelBoxWidth); + })); + }), + (nt.activations = []), + i.l.debug("Loop type widths:", s), + s + ); + })(f, g, 0, n); + Z(p), et(p), Q(p), tt(p); + let v = 1, + P = 1; + const k = [], + L = []; + f.forEach(function (t, e) { + let a, r, o; + switch (t.type) { + case n.db.LINETYPE.NOTE: + nt.resetVerticalPos(), + (r = t.noteModel), + (function (t, e) { + nt.bumpVerticalPos(st.boxMargin), (e.height = st.boxMargin), (e.starty = nt.getVerticalPos()); + const a = (0, s.g)(); + (a.x = e.startx), (a.y = e.starty), (a.width = e.width || st.width), (a.class = "note"); + const i = t.append("g"), + r = z(i, a), + n = (0, s.e)(); + (n.x = e.startx), + (n.y = e.starty), + (n.width = a.width), + (n.dy = "1em"), + (n.text = e.message), + (n.class = "noteText"), + (n.fontFamily = st.noteFontFamily), + (n.fontSize = st.noteFontSize), + (n.fontWeight = st.noteFontWeight), + (n.anchor = st.noteAlign), + (n.textMargin = st.noteMargin), + (n.valign = "center"); + const o = $(i, n), + c = Math.round(o.map((t) => (t._groups || t)[0][0].getBBox().height).reduce((t, e) => t + e)); + r.attr("height", c + 2 * st.noteMargin), + (e.height += c + 2 * st.noteMargin), + nt.bumpVerticalPos(c + 2 * st.noteMargin), + (e.stopy = e.starty + c + 2 * st.noteMargin), + (e.stopx = e.startx + a.width), + nt.insert(e.startx, e.starty, e.stopx, e.stopy), + nt.models.addNote(e); + })(p, r); + break; + case n.db.LINETYPE.ACTIVE_START: + nt.newActivation(t, p, g); + break; + case n.db.LINETYPE.ACTIVE_END: + !(function (t, e) { + const a = nt.endActivation(t); + a.starty + 18 > e && ((a.starty = e - 6), (e += 12)), + X(p, a, e, st, gt(t.from.actor).length), + nt.insert(a.startx, e - 10, a.stopx, e); + })(t, nt.getVerticalPos()); + break; + case n.db.LINETYPE.LOOP_START: + xt(_, t, st.boxMargin, st.boxMargin + st.boxTextMargin, (t) => nt.newLoop(t)); + break; + case n.db.LINETYPE.LOOP_END: + (a = nt.endLoop()), G(p, a, "loop", st), nt.bumpVerticalPos(a.stopy - nt.getVerticalPos()), nt.models.addLoop(a); + break; + case n.db.LINETYPE.RECT_START: + xt(_, t, st.boxMargin, st.boxMargin, (t) => nt.newLoop(void 0, t.message)); + break; + case n.db.LINETYPE.RECT_END: + (a = nt.endLoop()), L.push(a), nt.models.addLoop(a), nt.bumpVerticalPos(a.stopy - nt.getVerticalPos()); + break; + case n.db.LINETYPE.OPT_START: + xt(_, t, st.boxMargin, st.boxMargin + st.boxTextMargin, (t) => nt.newLoop(t)); + break; + case n.db.LINETYPE.OPT_END: + (a = nt.endLoop()), G(p, a, "opt", st), nt.bumpVerticalPos(a.stopy - nt.getVerticalPos()), nt.models.addLoop(a); + break; + case n.db.LINETYPE.ALT_START: + xt(_, t, st.boxMargin, st.boxMargin + st.boxTextMargin, (t) => nt.newLoop(t)); + break; + case n.db.LINETYPE.ALT_ELSE: + xt(_, t, st.boxMargin + st.boxTextMargin, st.boxMargin, (t) => nt.addSectionToLoop(t)); + break; + case n.db.LINETYPE.ALT_END: + (a = nt.endLoop()), G(p, a, "alt", st), nt.bumpVerticalPos(a.stopy - nt.getVerticalPos()), nt.models.addLoop(a); + break; + case n.db.LINETYPE.PAR_START: + case n.db.LINETYPE.PAR_OVER_START: + xt(_, t, st.boxMargin, st.boxMargin + st.boxTextMargin, (t) => nt.newLoop(t)), nt.saveVerticalPos(); + break; + case n.db.LINETYPE.PAR_AND: + xt(_, t, st.boxMargin + st.boxTextMargin, st.boxMargin, (t) => nt.addSectionToLoop(t)); + break; + case n.db.LINETYPE.PAR_END: + (a = nt.endLoop()), G(p, a, "par", st), nt.bumpVerticalPos(a.stopy - nt.getVerticalPos()), nt.models.addLoop(a); + break; + case n.db.LINETYPE.AUTONUMBER: + (v = t.message.start || v), + (P = t.message.step || P), + t.message.visible ? n.db.enableSequenceNumbers() : n.db.disableSequenceNumbers(); + break; + case n.db.LINETYPE.CRITICAL_START: + xt(_, t, st.boxMargin, st.boxMargin + st.boxTextMargin, (t) => nt.newLoop(t)); + break; + case n.db.LINETYPE.CRITICAL_OPTION: + xt(_, t, st.boxMargin + st.boxTextMargin, st.boxMargin, (t) => nt.addSectionToLoop(t)); + break; + case n.db.LINETYPE.CRITICAL_END: + (a = nt.endLoop()), G(p, a, "critical", st), nt.bumpVerticalPos(a.stopy - nt.getVerticalPos()), nt.models.addLoop(a); + break; + case n.db.LINETYPE.BREAK_START: + xt(_, t, st.boxMargin, st.boxMargin + st.boxTextMargin, (t) => nt.newLoop(t)); + break; + case n.db.LINETYPE.BREAK_END: + (a = nt.endLoop()), G(p, a, "break", st), nt.bumpVerticalPos(a.stopy - nt.getVerticalPos()), nt.models.addLoop(a); + break; + default: + try { + (o = t.msgModel), (o.starty = nt.getVerticalPos()), (o.sequenceIndex = v), (o.sequenceVisible = n.db.showSequenceNumbers()); + const a = (function (t, e) { + nt.bumpVerticalPos(10); + const { startx: a, stopx: r, message: s } = e, + n = i.e.splitBreaks(s).length, + o = i.u.calculateTextDimensions(s, ot(st)), + c = o.height / n; + let l; + (e.height += c), nt.bumpVerticalPos(c); + let h = o.height - 10; + const d = o.width; + if (a === r) { + (l = nt.getVerticalPos() + h), st.rightAngles || ((h += st.boxMargin), (l = nt.getVerticalPos() + h)), (h += 30); + const t = i.e.getMax(d / 2, st.width / 2); + nt.insert(a - t, nt.getVerticalPos() - 10 + h, r + t, nt.getVerticalPos() + 30 + h); + } else (h += st.boxMargin), (l = nt.getVerticalPos() + h), nt.insert(a, l - 10, r, l); + return ( + nt.bumpVerticalPos(h), + (e.height += h), + (e.stopy = e.starty + e.height), + nt.insert(e.fromBounds, e.starty, e.toBounds, e.stopy), + l + ); + })(0, o); + !(function (t, e, a, i, r, s, n) { + function o(a, i) { + a.x < r[t.from].x + ? (nt.insert(e.stopx - i, e.starty, e.startx, e.stopy + a.height / 2 + st.noteMargin), (e.stopx = e.stopx + i)) + : (nt.insert(e.startx, e.starty, e.stopx + i, e.stopy + a.height / 2 + st.noteMargin), (e.stopx = e.stopx - i)); + } + if (s[t.to] == i) { + const e = r[t.to]; + o(e, "actor" == e.type ? 21 : e.width / 2 + 3), (e.starty = a - e.height / 2), nt.bumpVerticalPos(e.height / 2); + } else if (n[t.from] == i) { + const i = r[t.from]; + st.mirrorActors && + (function (a, i) { + a.x < r[t.to].x + ? (nt.insert(e.startx - i, e.starty, e.stopx, e.stopy + a.height / 2 + st.noteMargin), (e.startx = e.startx + i)) + : (nt.insert(e.stopx, e.starty, e.startx + i, e.stopy + a.height / 2 + st.noteMargin), (e.startx = e.startx - i)); + })(i, "actor" == i.type ? 18 : i.width / 2), + (i.stopy = a - i.height / 2), + nt.bumpVerticalPos(i.height / 2); + } else if (n[t.to] == i) { + const e = r[t.to]; + st.mirrorActors && o(e, "actor" == e.type ? 21 : e.width / 2 + 3), + (e.stopy = a - e.height / 2), + nt.bumpVerticalPos(e.height / 2); + } + })(t, o, a, e, g, u, x), + k.push({ messageModel: o, lineStartY: a }), + nt.models.addMessage(o); + } catch (t) { + i.l.error("error while drawing message", t); + } + } + [ + n.db.LINETYPE.SOLID_OPEN, + n.db.LINETYPE.DOTTED_OPEN, + n.db.LINETYPE.SOLID, + n.db.LINETYPE.DOTTED, + n.db.LINETYPE.SOLID_CROSS, + n.db.LINETYPE.DOTTED_CROSS, + n.db.LINETYPE.SOLID_POINT, + n.db.LINETYPE.DOTTED_POINT, + ].includes(t.type) && (v += P); + }), + i.l.debug("createdActors", u), + i.l.debug("destroyedActors", x), + ht(p, g, m, !1), + k.forEach((t) => + (function (t, e, a, r) { + const { startx: n, stopx: o, starty: c, message: l, type: h, sequenceIndex: d, sequenceVisible: p } = e, + g = i.u.calculateTextDimensions(l, ot(st)), + u = (0, s.e)(); + (u.x = n), + (u.y = c + 10), + (u.width = o - n), + (u.class = "messageText"), + (u.dy = "1em"), + (u.text = l), + (u.fontFamily = st.messageFontFamily), + (u.fontSize = st.messageFontSize), + (u.fontWeight = st.messageFontWeight), + (u.anchor = st.messageAlign), + (u.valign = "center"), + (u.textMargin = st.wrapPadding), + (u.tspan = !1), + $(t, u); + const x = g.width; + let y; + n === o + ? (y = st.rightAngles + ? t.append("path").attr("d", `M ${n},${a} H ${n + i.e.getMax(st.width / 2, x / 2)} V ${a + 25} H ${n}`) + : t + .append("path") + .attr( + "d", + "M " + n + "," + a + " C " + (n + 60) + "," + (a - 10) + " " + (n + 60) + "," + (a + 30) + " " + n + "," + (a + 20), + )) + : ((y = t.append("line")), y.attr("x1", n), y.attr("y1", a), y.attr("x2", o), y.attr("y2", a)), + h === r.db.LINETYPE.DOTTED || + h === r.db.LINETYPE.DOTTED_CROSS || + h === r.db.LINETYPE.DOTTED_POINT || + h === r.db.LINETYPE.DOTTED_OPEN + ? (y.style("stroke-dasharray", "3, 3"), y.attr("class", "messageLine1")) + : y.attr("class", "messageLine0"); + let m = ""; + st.arrowMarkerAbsolute && + ((m = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search), + (m = m.replace(/\(/g, "\\(")), + (m = m.replace(/\)/g, "\\)"))), + y.attr("stroke-width", 2), + y.attr("stroke", "none"), + y.style("fill", "none"), + (h !== r.db.LINETYPE.SOLID && h !== r.db.LINETYPE.DOTTED) || y.attr("marker-end", "url(" + m + "#arrowhead)"), + (h !== r.db.LINETYPE.SOLID_POINT && h !== r.db.LINETYPE.DOTTED_POINT) || y.attr("marker-end", "url(" + m + "#filled-head)"), + (h !== r.db.LINETYPE.SOLID_CROSS && h !== r.db.LINETYPE.DOTTED_CROSS) || y.attr("marker-end", "url(" + m + "#crosshead)"), + (p || st.showSequenceNumbers) && + (y.attr("marker-start", "url(" + m + "#sequencenumber)"), + t + .append("text") + .attr("x", n) + .attr("y", a + 4) + .attr("font-family", "sans-serif") + .attr("font-size", "12px") + .attr("text-anchor", "middle") + .attr("class", "sequenceNumber") + .text(d)); + })(p, t.messageModel, t.lineStartY, n), + ), + st.mirrorActors && ht(p, g, m, !0), + L.forEach((t) => J(p, t)), + B(p, g, m, st), + nt.models.boxes.forEach(function (t) { + (t.height = nt.getVerticalPos() - t.y), + nt.insert(t.x, t.y, t.x + t.width, t.height), + (t.startx = t.x), + (t.starty = t.y), + (t.stopx = t.startx + t.width), + (t.stopy = t.starty + t.height), + (t.stroke = "rgb(0,0,0, 0.5)"), + U(p, t, st); + }), + T && nt.bumpVerticalPos(st.boxMargin); + const I = dt(p, g, m, d), + { bounds: M } = nt.getBounds(); + let N = M.stopy - M.starty; + N < I.maxHeight && (N = I.maxHeight); + let A = N + 2 * st.diagramMarginY; + st.mirrorActors && (A = A - st.boxMargin + st.bottomMarginAdj); + let S = M.stopx - M.startx; + S < I.maxWidth && (S = I.maxWidth); + const O = S + 2 * st.diagramMarginX; + b && + p + .append("text") + .text(b) + .attr("x", (M.stopx - M.startx) / 2 - 2 * st.diagramMarginX) + .attr("y", -25), + (0, i.i)(p, A, O, st.useMaxWidth); + const D = b ? 40 : 0; + p.attr("viewBox", M.startx - st.diagramMarginX + " -" + (st.diagramMarginY + D) + " " + O + " " + (A + D)), + i.l.debug("models:", nt.models); + }, + }, + styles: (t) => + `.actor {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${t.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${t.actorLineColor};\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${t.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${t.signalColor};\n }\n\n #arrowhead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .sequenceNumber {\n fill: ${t.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${t.signalColor};\n }\n\n #crosshead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .messageText {\n fill: ${t.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${t.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${t.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${t.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation1 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation2 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${t.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n stroke-width: 2px;\n }\n`, + }; + }, + 8252: function (t, e, a) { + a.d(e, { + a: function () { + return n; + }, + b: function () { + return l; + }, + c: function () { + return c; + }, + d: function () { + return s; + }, + e: function () { + return d; + }, + f: function () { + return o; + }, + g: function () { + return h; + }, + }); + var i = a(7967), + r = a(9339); + const s = (t, e) => { + const a = t.append("rect"); + if ( + (a.attr("x", e.x), + a.attr("y", e.y), + a.attr("fill", e.fill), + a.attr("stroke", e.stroke), + a.attr("width", e.width), + a.attr("height", e.height), + void 0 !== e.rx && a.attr("rx", e.rx), + void 0 !== e.ry && a.attr("ry", e.ry), + void 0 !== e.attrs) + ) + for (const t in e.attrs) a.attr(t, e.attrs[t]); + return void 0 !== e.class && a.attr("class", e.class), a; + }, + n = (t, e) => { + const a = { + x: e.startx, + y: e.starty, + width: e.stopx - e.startx, + height: e.stopy - e.starty, + fill: e.fill, + stroke: e.stroke, + class: "rect", + }; + s(t, a).lower(); + }, + o = (t, e) => { + const a = e.text.replace(r.J, " "), + i = t.append("text"); + i.attr("x", e.x), + i.attr("y", e.y), + i.attr("class", "legend"), + i.style("text-anchor", e.anchor), + void 0 !== e.class && i.attr("class", e.class); + const s = i.append("tspan"); + return s.attr("x", e.x + 2 * e.textMargin), s.text(a), i; + }, + c = (t, e, a, r) => { + const s = t.append("image"); + s.attr("x", e), s.attr("y", a); + const n = (0, i.Nm)(r); + s.attr("xlink:href", n); + }, + l = (t, e, a, r) => { + const s = t.append("use"); + s.attr("x", e), s.attr("y", a); + const n = (0, i.Nm)(r); + s.attr("xlink:href", `#${n}`); + }, + h = () => ({ + x: 0, + y: 0, + width: 100, + height: 100, + fill: "#EDF2AE", + stroke: "#666", + anchor: "start", + rx: 0, + ry: 0, + }), + d = () => ({ + x: 0, + y: 0, + width: 100, + height: 100, + "text-anchor": "start", + style: "#666", + textMargin: 0, + rx: 0, + ry: 0, + tspan: !0, + }); + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/423-897d7f17.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/423-897d7f17.chunk.min.js new file mode 100644 index 000000000..bb145817c --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/423-897d7f17.chunk.min.js @@ -0,0 +1,1865 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [423], + { + 1423: function (e, t, n) { + n.d(t, { + d: function () { + return b; + }, + p: function () { + return r; + }, + s: function () { + return D; + }, + }); + var s = n(7274), + i = n(9339), + u = (function () { + var e = function (e, t, n, s) { + for (n = n || {}, s = e.length; s--; n[e[s]] = t); + return n; + }, + t = [1, 34], + n = [1, 35], + s = [1, 36], + i = [1, 37], + u = [1, 9], + r = [1, 8], + a = [1, 19], + c = [1, 20], + o = [1, 21], + l = [1, 40], + h = [1, 41], + A = [1, 27], + p = [1, 25], + d = [1, 26], + y = [1, 32], + E = [1, 33], + C = [1, 28], + m = [1, 29], + k = [1, 30], + g = [1, 31], + F = [1, 45], + f = [1, 42], + b = [1, 43], + D = [1, 44], + _ = [1, 46], + B = [1, 24], + T = [1, 16, 24], + S = [1, 60], + N = [1, 61], + v = [1, 62], + L = [1, 63], + $ = [1, 64], + I = [1, 65], + O = [1, 66], + x = [1, 16, 24, 52], + R = [1, 77], + P = [1, 16, 24, 27, 28, 36, 50, 52, 55, 68, 69, 70, 71, 72, 73, 74, 79, 81], + w = [1, 16, 24, 27, 28, 34, 36, 50, 52, 55, 59, 68, 69, 70, 71, 72, 73, 74, 79, 81, 94, 96, 97, 98, 99], + G = [1, 86], + M = [28, 94, 96, 97, 98, 99], + U = [28, 73, 74, 94, 96, 97, 98, 99], + Y = [28, 68, 69, 70, 71, 72, 94, 96, 97, 98, 99], + K = [1, 99], + z = [1, 16, 24, 50, 52, 55], + Q = [1, 16, 24, 36], + j = [8, 9, 10, 11, 19, 23, 44, 46, 48, 53, 57, 58, 60, 61, 63, 65, 75, 76, 78, 82, 94, 96, 97, 98, 99], + X = { + trace: function () {}, + yy: {}, + symbols_: { + error: 2, + start: 3, + mermaidDoc: 4, + directive: 5, + statements: 6, + direction: 7, + direction_tb: 8, + direction_bt: 9, + direction_rl: 10, + direction_lr: 11, + graphConfig: 12, + openDirective: 13, + typeDirective: 14, + closeDirective: 15, + NEWLINE: 16, + ":": 17, + argDirective: 18, + open_directive: 19, + type_directive: 20, + arg_directive: 21, + close_directive: 22, + CLASS_DIAGRAM: 23, + EOF: 24, + statement: 25, + classLabel: 26, + SQS: 27, + STR: 28, + SQE: 29, + namespaceName: 30, + alphaNumToken: 31, + className: 32, + classLiteralName: 33, + GENERICTYPE: 34, + relationStatement: 35, + LABEL: 36, + namespaceStatement: 37, + classStatement: 38, + methodStatement: 39, + annotationStatement: 40, + clickStatement: 41, + cssClassStatement: 42, + noteStatement: 43, + acc_title: 44, + acc_title_value: 45, + acc_descr: 46, + acc_descr_value: 47, + acc_descr_multiline_value: 48, + namespaceIdentifier: 49, + STRUCT_START: 50, + classStatements: 51, + STRUCT_STOP: 52, + NAMESPACE: 53, + classIdentifier: 54, + STYLE_SEPARATOR: 55, + members: 56, + CLASS: 57, + ANNOTATION_START: 58, + ANNOTATION_END: 59, + MEMBER: 60, + SEPARATOR: 61, + relation: 62, + NOTE_FOR: 63, + noteText: 64, + NOTE: 65, + relationType: 66, + lineType: 67, + AGGREGATION: 68, + EXTENSION: 69, + COMPOSITION: 70, + DEPENDENCY: 71, + LOLLIPOP: 72, + LINE: 73, + DOTTED_LINE: 74, + CALLBACK: 75, + LINK: 76, + LINK_TARGET: 77, + CLICK: 78, + CALLBACK_NAME: 79, + CALLBACK_ARGS: 80, + HREF: 81, + CSSCLASS: 82, + commentToken: 83, + textToken: 84, + graphCodeTokens: 85, + textNoTagsToken: 86, + TAGSTART: 87, + TAGEND: 88, + "==": 89, + "--": 90, + PCT: 91, + DEFAULT: 92, + SPACE: 93, + MINUS: 94, + keywords: 95, + UNICODE_TEXT: 96, + NUM: 97, + ALPHA: 98, + BQUOTE_STR: 99, + $accept: 0, + $end: 1, + }, + terminals_: { + 2: "error", + 8: "direction_tb", + 9: "direction_bt", + 10: "direction_rl", + 11: "direction_lr", + 16: "NEWLINE", + 17: ":", + 19: "open_directive", + 20: "type_directive", + 21: "arg_directive", + 22: "close_directive", + 23: "CLASS_DIAGRAM", + 24: "EOF", + 27: "SQS", + 28: "STR", + 29: "SQE", + 34: "GENERICTYPE", + 36: "LABEL", + 44: "acc_title", + 45: "acc_title_value", + 46: "acc_descr", + 47: "acc_descr_value", + 48: "acc_descr_multiline_value", + 50: "STRUCT_START", + 52: "STRUCT_STOP", + 53: "NAMESPACE", + 55: "STYLE_SEPARATOR", + 57: "CLASS", + 58: "ANNOTATION_START", + 59: "ANNOTATION_END", + 60: "MEMBER", + 61: "SEPARATOR", + 63: "NOTE_FOR", + 65: "NOTE", + 68: "AGGREGATION", + 69: "EXTENSION", + 70: "COMPOSITION", + 71: "DEPENDENCY", + 72: "LOLLIPOP", + 73: "LINE", + 74: "DOTTED_LINE", + 75: "CALLBACK", + 76: "LINK", + 77: "LINK_TARGET", + 78: "CLICK", + 79: "CALLBACK_NAME", + 80: "CALLBACK_ARGS", + 81: "HREF", + 82: "CSSCLASS", + 85: "graphCodeTokens", + 87: "TAGSTART", + 88: "TAGEND", + 89: "==", + 90: "--", + 91: "PCT", + 92: "DEFAULT", + 93: "SPACE", + 94: "MINUS", + 95: "keywords", + 96: "UNICODE_TEXT", + 97: "NUM", + 98: "ALPHA", + 99: "BQUOTE_STR", + }, + productions_: [ + 0, + [3, 1], + [3, 2], + [3, 1], + [7, 1], + [7, 1], + [7, 1], + [7, 1], + [4, 1], + [5, 4], + [5, 6], + [13, 1], + [14, 1], + [18, 1], + [15, 1], + [12, 4], + [6, 1], + [6, 2], + [6, 3], + [26, 3], + [30, 1], + [30, 2], + [32, 1], + [32, 1], + [32, 2], + [32, 2], + [32, 2], + [25, 1], + [25, 2], + [25, 1], + [25, 1], + [25, 1], + [25, 1], + [25, 1], + [25, 1], + [25, 1], + [25, 1], + [25, 2], + [25, 2], + [25, 1], + [37, 4], + [37, 5], + [49, 2], + [51, 1], + [51, 2], + [51, 3], + [38, 1], + [38, 3], + [38, 4], + [38, 6], + [54, 2], + [54, 3], + [40, 4], + [56, 1], + [56, 2], + [39, 1], + [39, 2], + [39, 1], + [39, 1], + [35, 3], + [35, 4], + [35, 4], + [35, 5], + [43, 3], + [43, 2], + [62, 3], + [62, 2], + [62, 2], + [62, 1], + [66, 1], + [66, 1], + [66, 1], + [66, 1], + [66, 1], + [67, 1], + [67, 1], + [41, 3], + [41, 4], + [41, 3], + [41, 4], + [41, 4], + [41, 5], + [41, 3], + [41, 4], + [41, 4], + [41, 5], + [41, 4], + [41, 5], + [41, 5], + [41, 6], + [42, 3], + [83, 1], + [83, 1], + [84, 1], + [84, 1], + [84, 1], + [84, 1], + [84, 1], + [84, 1], + [84, 1], + [86, 1], + [86, 1], + [86, 1], + [86, 1], + [31, 1], + [31, 1], + [31, 1], + [31, 1], + [33, 1], + [64, 1], + ], + performAction: function (e, t, n, s, i, u, r) { + var a = u.length - 1; + switch (i) { + case 4: + s.setDirection("TB"); + break; + case 5: + s.setDirection("BT"); + break; + case 6: + s.setDirection("RL"); + break; + case 7: + s.setDirection("LR"); + break; + case 11: + s.parseDirective("%%{", "open_directive"); + break; + case 12: + s.parseDirective(u[a], "type_directive"); + break; + case 13: + (u[a] = u[a].trim().replace(/'/g, '"')), s.parseDirective(u[a], "arg_directive"); + break; + case 14: + s.parseDirective("}%%", "close_directive", "class"); + break; + case 19: + this.$ = u[a - 1]; + break; + case 20: + case 22: + case 23: + this.$ = u[a]; + break; + case 21: + case 24: + this.$ = u[a - 1] + u[a]; + break; + case 25: + case 26: + this.$ = u[a - 1] + "~" + u[a] + "~"; + break; + case 27: + s.addRelation(u[a]); + break; + case 28: + (u[a - 1].title = s.cleanupLabel(u[a])), s.addRelation(u[a - 1]); + break; + case 37: + (this.$ = u[a].trim()), s.setAccTitle(this.$); + break; + case 38: + case 39: + (this.$ = u[a].trim()), s.setAccDescription(this.$); + break; + case 40: + s.addClassesToNamespace(u[a - 3], u[a - 1]); + break; + case 41: + s.addClassesToNamespace(u[a - 4], u[a - 1]); + break; + case 42: + (this.$ = u[a]), s.addNamespace(u[a]); + break; + case 43: + case 53: + this.$ = [u[a]]; + break; + case 44: + this.$ = [u[a - 1]]; + break; + case 45: + u[a].unshift(u[a - 2]), (this.$ = u[a]); + break; + case 47: + s.setCssClass(u[a - 2], u[a]); + break; + case 48: + s.addMembers(u[a - 3], u[a - 1]); + break; + case 49: + s.setCssClass(u[a - 5], u[a - 3]), s.addMembers(u[a - 5], u[a - 1]); + break; + case 50: + (this.$ = u[a]), s.addClass(u[a]); + break; + case 51: + (this.$ = u[a - 1]), s.addClass(u[a - 1]), s.setClassLabel(u[a - 1], u[a]); + break; + case 52: + s.addAnnotation(u[a], u[a - 2]); + break; + case 54: + u[a].push(u[a - 1]), (this.$ = u[a]); + break; + case 55: + case 57: + case 58: + break; + case 56: + s.addMember(u[a - 1], s.cleanupLabel(u[a])); + break; + case 59: + this.$ = { + id1: u[a - 2], + id2: u[a], + relation: u[a - 1], + relationTitle1: "none", + relationTitle2: "none", + }; + break; + case 60: + this.$ = { + id1: u[a - 3], + id2: u[a], + relation: u[a - 1], + relationTitle1: u[a - 2], + relationTitle2: "none", + }; + break; + case 61: + this.$ = { + id1: u[a - 3], + id2: u[a], + relation: u[a - 2], + relationTitle1: "none", + relationTitle2: u[a - 1], + }; + break; + case 62: + this.$ = { + id1: u[a - 4], + id2: u[a], + relation: u[a - 2], + relationTitle1: u[a - 3], + relationTitle2: u[a - 1], + }; + break; + case 63: + s.addNote(u[a], u[a - 1]); + break; + case 64: + s.addNote(u[a]); + break; + case 65: + this.$ = { type1: u[a - 2], type2: u[a], lineType: u[a - 1] }; + break; + case 66: + this.$ = { type1: "none", type2: u[a], lineType: u[a - 1] }; + break; + case 67: + this.$ = { type1: u[a - 1], type2: "none", lineType: u[a] }; + break; + case 68: + this.$ = { type1: "none", type2: "none", lineType: u[a] }; + break; + case 69: + this.$ = s.relationType.AGGREGATION; + break; + case 70: + this.$ = s.relationType.EXTENSION; + break; + case 71: + this.$ = s.relationType.COMPOSITION; + break; + case 72: + this.$ = s.relationType.DEPENDENCY; + break; + case 73: + this.$ = s.relationType.LOLLIPOP; + break; + case 74: + this.$ = s.lineType.LINE; + break; + case 75: + this.$ = s.lineType.DOTTED_LINE; + break; + case 76: + case 82: + (this.$ = u[a - 2]), s.setClickEvent(u[a - 1], u[a]); + break; + case 77: + case 83: + (this.$ = u[a - 3]), s.setClickEvent(u[a - 2], u[a - 1]), s.setTooltip(u[a - 2], u[a]); + break; + case 78: + (this.$ = u[a - 2]), s.setLink(u[a - 1], u[a]); + break; + case 79: + (this.$ = u[a - 3]), s.setLink(u[a - 2], u[a - 1], u[a]); + break; + case 80: + (this.$ = u[a - 3]), s.setLink(u[a - 2], u[a - 1]), s.setTooltip(u[a - 2], u[a]); + break; + case 81: + (this.$ = u[a - 4]), s.setLink(u[a - 3], u[a - 2], u[a]), s.setTooltip(u[a - 3], u[a - 1]); + break; + case 84: + (this.$ = u[a - 3]), s.setClickEvent(u[a - 2], u[a - 1], u[a]); + break; + case 85: + (this.$ = u[a - 4]), s.setClickEvent(u[a - 3], u[a - 2], u[a - 1]), s.setTooltip(u[a - 3], u[a]); + break; + case 86: + (this.$ = u[a - 3]), s.setLink(u[a - 2], u[a]); + break; + case 87: + (this.$ = u[a - 4]), s.setLink(u[a - 3], u[a - 1], u[a]); + break; + case 88: + (this.$ = u[a - 4]), s.setLink(u[a - 3], u[a - 1]), s.setTooltip(u[a - 3], u[a]); + break; + case 89: + (this.$ = u[a - 5]), s.setLink(u[a - 4], u[a - 2], u[a]), s.setTooltip(u[a - 4], u[a - 1]); + break; + case 90: + s.setCssClass(u[a - 1], u[a]); + } + }, + table: [ + { + 3: 1, + 4: 2, + 5: 3, + 6: 4, + 7: 18, + 8: t, + 9: n, + 10: s, + 11: i, + 12: 5, + 13: 6, + 19: u, + 23: r, + 25: 7, + 31: 38, + 32: 22, + 33: 39, + 35: 10, + 37: 11, + 38: 12, + 39: 13, + 40: 14, + 41: 15, + 42: 16, + 43: 17, + 44: a, + 46: c, + 48: o, + 49: 23, + 53: l, + 54: 24, + 57: h, + 58: A, + 60: p, + 61: d, + 63: y, + 65: E, + 75: C, + 76: m, + 78: k, + 82: g, + 94: F, + 96: f, + 97: b, + 98: D, + 99: _, + }, + { 1: [3] }, + { 1: [2, 1] }, + { + 3: 47, + 4: 2, + 5: 3, + 6: 4, + 7: 18, + 8: t, + 9: n, + 10: s, + 11: i, + 12: 5, + 13: 6, + 19: u, + 23: r, + 25: 7, + 31: 38, + 32: 22, + 33: 39, + 35: 10, + 37: 11, + 38: 12, + 39: 13, + 40: 14, + 41: 15, + 42: 16, + 43: 17, + 44: a, + 46: c, + 48: o, + 49: 23, + 53: l, + 54: 24, + 57: h, + 58: A, + 60: p, + 61: d, + 63: y, + 65: E, + 75: C, + 76: m, + 78: k, + 82: g, + 94: F, + 96: f, + 97: b, + 98: D, + 99: _, + }, + { 1: [2, 3] }, + { 1: [2, 8] }, + { 14: 48, 20: [1, 49] }, + e(B, [2, 16], { 16: [1, 50] }), + { 16: [1, 51] }, + { 20: [2, 11] }, + e(T, [2, 27], { 36: [1, 52] }), + e(T, [2, 29]), + e(T, [2, 30]), + e(T, [2, 31]), + e(T, [2, 32]), + e(T, [2, 33]), + e(T, [2, 34]), + e(T, [2, 35]), + e(T, [2, 36]), + { 45: [1, 53] }, + { 47: [1, 54] }, + e(T, [2, 39]), + e(T, [2, 55], { + 62: 55, + 66: 58, + 67: 59, + 28: [1, 56], + 36: [1, 57], + 68: S, + 69: N, + 70: v, + 71: L, + 72: $, + 73: I, + 74: O, + }), + { 50: [1, 67] }, + e(x, [2, 46], { 50: [1, 69], 55: [1, 68] }), + e(T, [2, 57]), + e(T, [2, 58]), + { 31: 70, 94: F, 96: f, 97: b, 98: D }, + { 31: 38, 32: 71, 33: 39, 94: F, 96: f, 97: b, 98: D, 99: _ }, + { 31: 38, 32: 72, 33: 39, 94: F, 96: f, 97: b, 98: D, 99: _ }, + { 31: 38, 32: 73, 33: 39, 94: F, 96: f, 97: b, 98: D, 99: _ }, + { 28: [1, 74] }, + { 31: 38, 32: 75, 33: 39, 94: F, 96: f, 97: b, 98: D, 99: _ }, + { 28: R, 64: 76 }, + e(T, [2, 4]), + e(T, [2, 5]), + e(T, [2, 6]), + e(T, [2, 7]), + e(P, [2, 22], { + 31: 38, + 33: 39, + 32: 78, + 34: [1, 79], + 94: F, + 96: f, + 97: b, + 98: D, + 99: _, + }), + e(P, [2, 23], { 34: [1, 80] }), + { 30: 81, 31: 82, 94: F, 96: f, 97: b, 98: D }, + { 31: 38, 32: 83, 33: 39, 94: F, 96: f, 97: b, 98: D, 99: _ }, + e(w, [2, 104]), + e(w, [2, 105]), + e(w, [2, 106]), + e(w, [2, 107]), + e([1, 16, 24, 27, 28, 34, 36, 50, 52, 55, 68, 69, 70, 71, 72, 73, 74, 79, 81], [2, 108]), + { 1: [2, 2] }, + { 15: 84, 17: [1, 85], 22: G }, + e([17, 22], [2, 12]), + e(B, [2, 17], { + 25: 7, + 35: 10, + 37: 11, + 38: 12, + 39: 13, + 40: 14, + 41: 15, + 42: 16, + 43: 17, + 7: 18, + 32: 22, + 49: 23, + 54: 24, + 31: 38, + 33: 39, + 6: 87, + 8: t, + 9: n, + 10: s, + 11: i, + 44: a, + 46: c, + 48: o, + 53: l, + 57: h, + 58: A, + 60: p, + 61: d, + 63: y, + 65: E, + 75: C, + 76: m, + 78: k, + 82: g, + 94: F, + 96: f, + 97: b, + 98: D, + 99: _, + }), + { + 6: 88, + 7: 18, + 8: t, + 9: n, + 10: s, + 11: i, + 25: 7, + 31: 38, + 32: 22, + 33: 39, + 35: 10, + 37: 11, + 38: 12, + 39: 13, + 40: 14, + 41: 15, + 42: 16, + 43: 17, + 44: a, + 46: c, + 48: o, + 49: 23, + 53: l, + 54: 24, + 57: h, + 58: A, + 60: p, + 61: d, + 63: y, + 65: E, + 75: C, + 76: m, + 78: k, + 82: g, + 94: F, + 96: f, + 97: b, + 98: D, + 99: _, + }, + e(T, [2, 28]), + e(T, [2, 37]), + e(T, [2, 38]), + { 28: [1, 90], 31: 38, 32: 89, 33: 39, 94: F, 96: f, 97: b, 98: D, 99: _ }, + { 62: 91, 66: 58, 67: 59, 68: S, 69: N, 70: v, 71: L, 72: $, 73: I, 74: O }, + e(T, [2, 56]), + { 67: 92, 73: I, 74: O }, + e(M, [2, 68], { 66: 93, 68: S, 69: N, 70: v, 71: L, 72: $ }), + e(U, [2, 69]), + e(U, [2, 70]), + e(U, [2, 71]), + e(U, [2, 72]), + e(U, [2, 73]), + e(Y, [2, 74]), + e(Y, [2, 75]), + { 16: [1, 95], 38: 96, 51: 94, 54: 24, 57: h }, + { 31: 97, 94: F, 96: f, 97: b, 98: D }, + { 56: 98, 60: K }, + { 59: [1, 100] }, + { 28: [1, 101] }, + { 28: [1, 102] }, + { 79: [1, 103], 81: [1, 104] }, + { 31: 105, 94: F, 96: f, 97: b, 98: D }, + { 28: R, 64: 106 }, + e(T, [2, 64]), + e(T, [2, 109]), + e(P, [2, 24]), + e(P, [2, 25]), + e(P, [2, 26]), + { 50: [2, 42] }, + { 30: 107, 31: 82, 50: [2, 20], 94: F, 96: f, 97: b, 98: D }, + e(z, [2, 50], { 26: 108, 27: [1, 109] }), + { 16: [1, 110] }, + { 18: 111, 21: [1, 112] }, + { 16: [2, 14] }, + e(B, [2, 18]), + { 24: [1, 113] }, + e(Q, [2, 59]), + { 31: 38, 32: 114, 33: 39, 94: F, 96: f, 97: b, 98: D, 99: _ }, + { 28: [1, 116], 31: 38, 32: 115, 33: 39, 94: F, 96: f, 97: b, 98: D, 99: _ }, + e(M, [2, 67], { 66: 117, 68: S, 69: N, 70: v, 71: L, 72: $ }), + e(M, [2, 66]), + { 52: [1, 118] }, + { 38: 96, 51: 119, 54: 24, 57: h }, + { 16: [1, 120], 52: [2, 43] }, + e(x, [2, 47], { 50: [1, 121] }), + { 52: [1, 122] }, + { 52: [2, 53], 56: 123, 60: K }, + { 31: 38, 32: 124, 33: 39, 94: F, 96: f, 97: b, 98: D, 99: _ }, + e(T, [2, 76], { 28: [1, 125] }), + e(T, [2, 78], { 28: [1, 127], 77: [1, 126] }), + e(T, [2, 82], { 28: [1, 128], 80: [1, 129] }), + { 28: [1, 130] }, + e(T, [2, 90]), + e(T, [2, 63]), + { 50: [2, 21] }, + e(z, [2, 51]), + { 28: [1, 131] }, + e(j, [2, 9]), + { 15: 132, 22: G }, + { 22: [2, 13] }, + { 1: [2, 15] }, + e(Q, [2, 61]), + e(Q, [2, 60]), + { 31: 38, 32: 133, 33: 39, 94: F, 96: f, 97: b, 98: D, 99: _ }, + e(M, [2, 65]), + e(T, [2, 40]), + { 52: [1, 134] }, + { 38: 96, 51: 135, 52: [2, 44], 54: 24, 57: h }, + { 56: 136, 60: K }, + e(x, [2, 48]), + { 52: [2, 54] }, + e(T, [2, 52]), + e(T, [2, 77]), + e(T, [2, 79]), + e(T, [2, 80], { 77: [1, 137] }), + e(T, [2, 83]), + e(T, [2, 84], { 28: [1, 138] }), + e(T, [2, 86], { 28: [1, 140], 77: [1, 139] }), + { 29: [1, 141] }, + { 16: [1, 142] }, + e(Q, [2, 62]), + e(T, [2, 41]), + { 52: [2, 45] }, + { 52: [1, 143] }, + e(T, [2, 81]), + e(T, [2, 85]), + e(T, [2, 87]), + e(T, [2, 88], { 77: [1, 144] }), + e(z, [2, 19]), + e(j, [2, 10]), + e(x, [2, 49]), + e(T, [2, 89]), + ], + defaultActions: { + 2: [2, 1], + 4: [2, 3], + 5: [2, 8], + 9: [2, 11], + 47: [2, 2], + 81: [2, 42], + 86: [2, 14], + 107: [2, 21], + 112: [2, 13], + 113: [2, 15], + 123: [2, 54], + 135: [2, 45], + }, + parseError: function (e, t) { + if (!t.recoverable) { + var n = new Error(e); + throw ((n.hash = t), n); + } + this.trace(e); + }, + parse: function (e) { + var t = [0], + n = [], + s = [null], + i = [], + u = this.table, + r = "", + a = 0, + c = 0, + o = i.slice.call(arguments, 1), + l = Object.create(this.lexer), + h = { yy: {} }; + for (var A in this.yy) Object.prototype.hasOwnProperty.call(this.yy, A) && (h.yy[A] = this.yy[A]); + l.setInput(e, h.yy), (h.yy.lexer = l), (h.yy.parser = this), void 0 === l.yylloc && (l.yylloc = {}); + var p = l.yylloc; + i.push(p); + var d = l.options && l.options.ranges; + "function" == typeof h.yy.parseError + ? (this.parseError = h.yy.parseError) + : (this.parseError = Object.getPrototypeOf(this).parseError); + for (var y, E, C, m, k, g, F, f, b, D = {}; ; ) { + if ( + ((E = t[t.length - 1]), + this.defaultActions[E] + ? (C = this.defaultActions[E]) + : (null == y && + ((b = void 0), + "number" != typeof (b = n.pop() || l.lex() || 1) && + (b instanceof Array && (b = (n = b).pop()), (b = this.symbols_[b] || b)), + (y = b)), + (C = u[E] && u[E][y])), + void 0 === C || !C.length || !C[0]) + ) { + var _; + for (k in ((f = []), u[E])) this.terminals_[k] && k > 2 && f.push("'" + this.terminals_[k] + "'"); + (_ = l.showPosition + ? "Parse error on line " + + (a + 1) + + ":\n" + + l.showPosition() + + "\nExpecting " + + f.join(", ") + + ", got '" + + (this.terminals_[y] || y) + + "'" + : "Parse error on line " + (a + 1) + ": Unexpected " + (1 == y ? "end of input" : "'" + (this.terminals_[y] || y) + "'")), + this.parseError(_, { + text: l.match, + token: this.terminals_[y] || y, + line: l.yylineno, + loc: p, + expected: f, + }); + } + if (C[0] instanceof Array && C.length > 1) + throw new Error("Parse Error: multiple actions possible at state: " + E + ", token: " + y); + switch (C[0]) { + case 1: + t.push(y), + s.push(l.yytext), + i.push(l.yylloc), + t.push(C[1]), + (y = null), + (c = l.yyleng), + (r = l.yytext), + (a = l.yylineno), + (p = l.yylloc); + break; + case 2: + if ( + ((g = this.productions_[C[1]][1]), + (D.$ = s[s.length - g]), + (D._$ = { + first_line: i[i.length - (g || 1)].first_line, + last_line: i[i.length - 1].last_line, + first_column: i[i.length - (g || 1)].first_column, + last_column: i[i.length - 1].last_column, + }), + d && (D._$.range = [i[i.length - (g || 1)].range[0], i[i.length - 1].range[1]]), + void 0 !== (m = this.performAction.apply(D, [r, c, a, h.yy, C[1], s, i].concat(o)))) + ) + return m; + g && ((t = t.slice(0, -1 * g * 2)), (s = s.slice(0, -1 * g)), (i = i.slice(0, -1 * g))), + t.push(this.productions_[C[1]][0]), + s.push(D.$), + i.push(D._$), + (F = u[t[t.length - 2]][t[t.length - 1]]), + t.push(F); + break; + case 3: + return !0; + } + } + return !0; + }, + }, + W = { + EOF: 1, + parseError: function (e, t) { + if (!this.yy.parser) throw new Error(e); + this.yy.parser.parseError(e, t); + }, + setInput: function (e, t) { + return ( + (this.yy = t || this.yy || {}), + (this._input = e), + (this._more = this._backtrack = this.done = !1), + (this.yylineno = this.yyleng = 0), + (this.yytext = this.matched = this.match = ""), + (this.conditionStack = ["INITIAL"]), + (this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }), + this.options.ranges && (this.yylloc.range = [0, 0]), + (this.offset = 0), + this + ); + }, + input: function () { + var e = this._input[0]; + return ( + (this.yytext += e), + this.yyleng++, + this.offset++, + (this.match += e), + (this.matched += e), + e.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, + this.options.ranges && this.yylloc.range[1]++, + (this._input = this._input.slice(1)), + e + ); + }, + unput: function (e) { + var t = e.length, + n = e.split(/(?:\r\n?|\n)/g); + (this._input = e + this._input), (this.yytext = this.yytext.substr(0, this.yytext.length - t)), (this.offset -= t); + var s = this.match.split(/(?:\r\n?|\n)/g); + (this.match = this.match.substr(0, this.match.length - 1)), + (this.matched = this.matched.substr(0, this.matched.length - 1)), + n.length - 1 && (this.yylineno -= n.length - 1); + var i = this.yylloc.range; + return ( + (this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: n + ? (n.length === s.length ? this.yylloc.first_column : 0) + s[s.length - n.length].length - n[0].length + : this.yylloc.first_column - t, + }), + this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - t]), + (this.yyleng = this.yytext.length), + this + ); + }, + more: function () { + return (this._more = !0), this; + }, + reject: function () { + return this.options.backtrack_lexer + ? ((this._backtrack = !0), this) + : this.parseError( + "Lexical error on line " + + (this.yylineno + 1) + + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + + this.showPosition(), + { text: "", token: null, line: this.yylineno }, + ); + }, + less: function (e) { + this.unput(this.match.slice(e)); + }, + pastInput: function () { + var e = this.matched.substr(0, this.matched.length - this.match.length); + return (e.length > 20 ? "..." : "") + e.substr(-20).replace(/\n/g, ""); + }, + upcomingInput: function () { + var e = this.match; + return ( + e.length < 20 && (e += this._input.substr(0, 20 - e.length)), (e.substr(0, 20) + (e.length > 20 ? "..." : "")).replace(/\n/g, "") + ); + }, + showPosition: function () { + var e = this.pastInput(), + t = new Array(e.length + 1).join("-"); + return e + this.upcomingInput() + "\n" + t + "^"; + }, + test_match: function (e, t) { + var n, s, i; + if ( + (this.options.backtrack_lexer && + ((i = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column, + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done, + }), + this.options.ranges && (i.yylloc.range = this.yylloc.range.slice(0))), + (s = e[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += s.length), + (this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: s ? s[s.length - 1].length - s[s.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length, + }), + (this.yytext += e[0]), + (this.match += e[0]), + (this.matches = e), + (this.yyleng = this.yytext.length), + this.options.ranges && (this.yylloc.range = [this.offset, (this.offset += this.yyleng)]), + (this._more = !1), + (this._backtrack = !1), + (this._input = this._input.slice(e[0].length)), + (this.matched += e[0]), + (n = this.performAction.call(this, this.yy, this, t, this.conditionStack[this.conditionStack.length - 1])), + this.done && this._input && (this.done = !1), + n) + ) + return n; + if (this._backtrack) { + for (var u in i) this[u] = i[u]; + return !1; + } + return !1; + }, + next: function () { + if (this.done) return this.EOF; + var e, t, n, s; + this._input || (this.done = !0), this._more || ((this.yytext = ""), (this.match = "")); + for (var i = this._currentRules(), u = 0; u < i.length; u++) + if ((n = this._input.match(this.rules[i[u]])) && (!t || n[0].length > t[0].length)) { + if (((t = n), (s = u), this.options.backtrack_lexer)) { + if (!1 !== (e = this.test_match(n, i[u]))) return e; + if (this._backtrack) { + t = !1; + continue; + } + return !1; + } + if (!this.options.flex) break; + } + return t + ? !1 !== (e = this.test_match(t, i[s])) && e + : "" === this._input + ? this.EOF + : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno, + }); + }, + lex: function () { + return this.next() || this.lex(); + }, + begin: function (e) { + this.conditionStack.push(e); + }, + popState: function () { + return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]; + }, + _currentRules: function () { + return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] + ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules + : this.conditions.INITIAL.rules; + }, + topState: function (e) { + return (e = this.conditionStack.length - 1 - Math.abs(e || 0)) >= 0 ? this.conditionStack[e] : "INITIAL"; + }, + pushState: function (e) { + this.begin(e); + }, + stateStackSize: function () { + return this.conditionStack.length; + }, + options: {}, + performAction: function (e, t, n, s) { + switch (n) { + case 0: + return this.begin("open_directive"), 19; + case 1: + return 8; + case 2: + return 9; + case 3: + return 10; + case 4: + return 11; + case 5: + return this.begin("type_directive"), 20; + case 6: + return this.popState(), this.begin("arg_directive"), 17; + case 7: + return this.popState(), this.popState(), 22; + case 8: + return 21; + case 9: + case 10: + case 19: + case 34: + case 39: + case 43: + case 50: + break; + case 11: + return this.begin("acc_title"), 44; + case 12: + return this.popState(), "acc_title_value"; + case 13: + return this.begin("acc_descr"), 46; + case 14: + return this.popState(), "acc_descr_value"; + case 15: + this.begin("acc_descr_multiline"); + break; + case 16: + case 24: + case 27: + case 29: + case 61: + case 64: + this.popState(); + break; + case 17: + return "acc_descr_multiline_value"; + case 18: + case 38: + return 16; + case 20: + case 21: + return 23; + case 22: + case 40: + case 48: + return "EDGE_STATE"; + case 23: + this.begin("callback_name"); + break; + case 25: + this.popState(), this.begin("callback_args"); + break; + case 26: + return 79; + case 28: + return 80; + case 30: + return "STR"; + case 31: + this.begin("string"); + break; + case 32: + return this.begin("namespace"), 53; + case 33: + case 42: + return this.popState(), 16; + case 35: + return this.begin("namespace-body"), 50; + case 36: + case 46: + return this.popState(), 52; + case 37: + case 47: + return "EOF_IN_STRUCT"; + case 41: + return this.begin("class"), 57; + case 44: + return this.popState(), this.popState(), 52; + case 45: + return this.begin("class-body"), 50; + case 49: + return "OPEN_IN_STRUCT"; + case 51: + return "MEMBER"; + case 52: + return 82; + case 53: + return 75; + case 54: + return 76; + case 55: + return 78; + case 56: + return 63; + case 57: + return 65; + case 58: + return 58; + case 59: + return 59; + case 60: + return 81; + case 62: + return "GENERICTYPE"; + case 63: + this.begin("generic"); + break; + case 65: + return "BQUOTE_STR"; + case 66: + this.begin("bqstring"); + break; + case 67: + case 68: + case 69: + case 70: + return 77; + case 71: + case 72: + return 69; + case 73: + case 74: + return 71; + case 75: + return 70; + case 76: + return 68; + case 77: + return 72; + case 78: + return 73; + case 79: + return 74; + case 80: + return 36; + case 81: + return 55; + case 82: + return 94; + case 83: + return "DOT"; + case 84: + return "PLUS"; + case 85: + return 91; + case 86: + case 87: + return "EQUALS"; + case 88: + return 98; + case 89: + return 27; + case 90: + return 29; + case 91: + return "PUNCTUATION"; + case 92: + return 97; + case 93: + return 96; + case 94: + return 93; + case 95: + return 24; + } + }, + rules: [ + /^(?:%%\{)/, + /^(?:.*direction\s+TB[^\n]*)/, + /^(?:.*direction\s+BT[^\n]*)/, + /^(?:.*direction\s+RL[^\n]*)/, + /^(?:.*direction\s+LR[^\n]*)/, + /^(?:((?:(?!\}%%)[^:.])*))/, + /^(?::)/, + /^(?:\}%%)/, + /^(?:((?:(?!\}%%).|\n)*))/, + /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, + /^(?:%%[^\n]*(\r?\n)*)/, + /^(?:accTitle\s*:\s*)/, + /^(?:(?!\n||)*[^\n]*)/, + /^(?:accDescr\s*:\s*)/, + /^(?:(?!\n||)*[^\n]*)/, + /^(?:accDescr\s*\{\s*)/, + /^(?:[\}])/, + /^(?:[^\}]*)/, + /^(?:\s*(\r?\n)+)/, + /^(?:\s+)/, + /^(?:classDiagram-v2\b)/, + /^(?:classDiagram\b)/, + /^(?:\[\*\])/, + /^(?:call[\s]+)/, + /^(?:\([\s]*\))/, + /^(?:\()/, + /^(?:[^(]*)/, + /^(?:\))/, + /^(?:[^)]*)/, + /^(?:["])/, + /^(?:[^"]*)/, + /^(?:["])/, + /^(?:namespace\b)/, + /^(?:\s*(\r?\n)+)/, + /^(?:\s+)/, + /^(?:[{])/, + /^(?:[}])/, + /^(?:$)/, + /^(?:\s*(\r?\n)+)/, + /^(?:\s+)/, + /^(?:\[\*\])/, + /^(?:class\b)/, + /^(?:\s*(\r?\n)+)/, + /^(?:\s+)/, + /^(?:[}])/, + /^(?:[{])/, + /^(?:[}])/, + /^(?:$)/, + /^(?:\[\*\])/, + /^(?:[{])/, + /^(?:[\n])/, + /^(?:[^{}\n]*)/, + /^(?:cssClass\b)/, + /^(?:callback\b)/, + /^(?:link\b)/, + /^(?:click\b)/, + /^(?:note for\b)/, + /^(?:note\b)/, + /^(?:<<)/, + /^(?:>>)/, + /^(?:href\b)/, + /^(?:[~])/, + /^(?:[^~]*)/, + /^(?:~)/, + /^(?:[`])/, + /^(?:[^`]+)/, + /^(?:[`])/, + /^(?:_self\b)/, + /^(?:_blank\b)/, + /^(?:_parent\b)/, + /^(?:_top\b)/, + /^(?:\s*<\|)/, + /^(?:\s*\|>)/, + /^(?:\s*>)/, + /^(?:\s*<)/, + /^(?:\s*\*)/, + /^(?:\s*o\b)/, + /^(?:\s*\(\))/, + /^(?:--)/, + /^(?:\.\.)/, + /^(?::{1}[^:\n;]+)/, + /^(?::{3})/, + /^(?:-)/, + /^(?:\.)/, + /^(?:\+)/, + /^(?:%)/, + /^(?:=)/, + /^(?:=)/, + /^(?:\w+)/, + /^(?:\[)/, + /^(?:\])/, + /^(?:[!"#$%&'*+,-.`?\\/])/, + /^(?:[0-9]+)/, + /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, + /^(?:\s)/, + /^(?:$)/, + ], + conditions: { + "namespace-body": { + rules: [ + 31, 36, 37, 38, 39, 40, 41, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + ], + inclusive: !1, + }, + namespace: { + rules: [ + 31, 32, 33, 34, 35, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + ], + inclusive: !1, + }, + "class-body": { + rules: [ + 31, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + ], + inclusive: !1, + }, + class: { + rules: [ + 31, 42, 43, 44, 45, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + ], + inclusive: !1, + }, + acc_descr_multiline: { + rules: [ + 16, 17, 31, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + ], + inclusive: !1, + }, + acc_descr: { + rules: [ + 14, 31, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + ], + inclusive: !1, + }, + acc_title: { + rules: [ + 12, 31, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + ], + inclusive: !1, + }, + arg_directive: { + rules: [ + 7, 8, 31, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + ], + inclusive: !1, + }, + type_directive: { + rules: [ + 6, 7, 31, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + ], + inclusive: !1, + }, + open_directive: { + rules: [ + 5, 31, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, + ], + inclusive: !1, + }, + callback_args: { + rules: [ + 27, 28, 31, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + ], + inclusive: !1, + }, + callback_name: { + rules: [ + 24, 25, 26, 31, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + ], + inclusive: !1, + }, + href: { + rules: [ + 31, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, + ], + inclusive: !1, + }, + struct: { + rules: [ + 31, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, + ], + inclusive: !1, + }, + generic: { + rules: [ + 31, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + ], + inclusive: !1, + }, + bqstring: { + rules: [ + 31, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + ], + inclusive: !1, + }, + string: { + rules: [ + 29, 30, 31, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + ], + inclusive: !1, + }, + INITIAL: { + rules: [ + 0, 1, 2, 3, 4, 9, 10, 11, 13, 15, 18, 19, 20, 21, 22, 23, 31, 32, 41, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + ], + inclusive: !0, + }, + }, + }; + function H() { + this.yy = {}; + } + return (X.lexer = W), (H.prototype = X), (X.Parser = H), new H(); + })(); + u.parser = u; + const r = u, + a = "classId-"; + let c = [], + o = {}, + l = [], + h = 0, + A = {}, + p = 0, + d = []; + const y = (e) => i.e.sanitizeText(e, (0, i.c)()), + E = function (e) { + let t = "", + n = e; + if (e.indexOf("~") > 0) { + const s = e.split("~"); + (n = y(s[0])), (t = y(s[1])); + } + return { className: n, type: t }; + }, + C = function (e) { + const t = E(e); + void 0 === o[t.className] && + ((o[t.className] = { + id: t.className, + type: t.type, + label: t.className, + cssClasses: [], + methods: [], + members: [], + annotations: [], + domId: a + t.className + "-" + h, + }), + h++); + }, + m = function (e) { + if (e in o) return o[e].domId; + throw new Error("Class not found: " + e); + }, + k = function (e, t) { + const n = E(e).className, + s = o[n]; + if ("string" == typeof t) { + const e = t.trim(); + e.startsWith("<<") && e.endsWith(">>") + ? s.annotations.push(y(e.substring(2, e.length - 2))) + : e.indexOf(")") > 0 + ? s.methods.push(y(e)) + : e && s.members.push(y(e)); + } + }, + g = function (e, t) { + e.split(",").forEach(function (e) { + let n = e; + e[0].match(/\d/) && (n = a + n), void 0 !== o[n] && o[n].cssClasses.push(t); + }); + }, + F = function (e) { + let t = (0, s.Ys)(".mermaidTooltip"); + null === (t._groups || t)[0][0] && (t = (0, s.Ys)("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0)), + (0, s.Ys)(e) + .select("svg") + .selectAll("g.node") + .on("mouseover", function () { + const e = (0, s.Ys)(this); + if (null === e.attr("title")) return; + const n = this.getBoundingClientRect(); + t.transition().duration(200).style("opacity", ".9"), + t + .text(e.attr("title")) + .style("left", window.scrollX + n.left + (n.right - n.left) / 2 + "px") + .style("top", window.scrollY + n.top - 14 + document.body.scrollTop + "px"), + t.html(t.html().replace(/<br\/>/g, "
    ")), + e.classed("hover", !0); + }) + .on("mouseout", function () { + t.transition().duration(500).style("opacity", 0), (0, s.Ys)(this).classed("hover", !1); + }); + }; + d.push(F); + let f = "TB"; + const b = { + parseDirective: function (e, t, n) { + i.m.parseDirective(this, e, t, n); + }, + setAccTitle: i.s, + getAccTitle: i.g, + getAccDescription: i.a, + setAccDescription: i.b, + getConfig: () => (0, i.c)().class, + addClass: C, + bindFunctions: function (e) { + d.forEach(function (t) { + t(e); + }); + }, + clear: function () { + (c = []), (o = {}), (l = []), (d = []), d.push(F), (A = {}), (p = 0), (0, i.v)(); + }, + getClass: function (e) { + return o[e]; + }, + getClasses: function () { + return o; + }, + getNotes: function () { + return l; + }, + addAnnotation: function (e, t) { + const n = E(e).className; + o[n].annotations.push(t); + }, + addNote: function (e, t) { + const n = { id: `note${l.length}`, class: t, text: e }; + l.push(n); + }, + getRelations: function () { + return c; + }, + addRelation: function (e) { + i.l.debug("Adding relation: " + JSON.stringify(e)), + C(e.id1), + C(e.id2), + (e.id1 = E(e.id1).className), + (e.id2 = E(e.id2).className), + (e.relationTitle1 = i.e.sanitizeText(e.relationTitle1.trim(), (0, i.c)())), + (e.relationTitle2 = i.e.sanitizeText(e.relationTitle2.trim(), (0, i.c)())), + c.push(e); + }, + getDirection: () => f, + setDirection: (e) => { + f = e; + }, + addMember: k, + addMembers: function (e, t) { + Array.isArray(t) && (t.reverse(), t.forEach((t) => k(e, t))); + }, + cleanupLabel: function (e) { + return e.startsWith(":") && (e = e.substring(1)), y(e.trim()); + }, + lineType: { LINE: 0, DOTTED_LINE: 1 }, + relationType: { + AGGREGATION: 0, + EXTENSION: 1, + COMPOSITION: 2, + DEPENDENCY: 3, + LOLLIPOP: 4, + }, + setClickEvent: function (e, t, n) { + e.split(",").forEach(function (e) { + (function (e, t, n) { + if ("loose" !== (0, i.c)().securityLevel) return; + if (void 0 === t) return; + const s = e; + if (void 0 !== o[s]) { + const e = m(s); + let u = []; + if ("string" == typeof n) { + u = n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); + for (let e = 0; e < u.length; e++) { + let t = u[e].trim(); + '"' === t.charAt(0) && '"' === t.charAt(t.length - 1) && (t = t.substr(1, t.length - 2)), (u[e] = t); + } + } + 0 === u.length && u.push(e), + d.push(function () { + const n = document.querySelector(`[id="${e}"]`); + null !== n && + n.addEventListener( + "click", + function () { + i.u.runFunc(t, ...u); + }, + !1, + ); + }); + } + })(e, t, n), + (o[e].haveCallback = !0); + }), + g(e, "clickable"); + }, + setCssClass: g, + setLink: function (e, t, n) { + const s = (0, i.c)(); + e.split(",").forEach(function (e) { + let u = e; + e[0].match(/\d/) && (u = a + u), + void 0 !== o[u] && + ((o[u].link = i.u.formatUrl(t, s)), + "sandbox" === s.securityLevel ? (o[u].linkTarget = "_top") : (o[u].linkTarget = "string" == typeof n ? y(n) : "_blank")); + }), + g(e, "clickable"); + }, + getTooltip: function (e, t) { + return t ? A[t].classes[e].tooltip : o[e].tooltip; + }, + setTooltip: function (e, t) { + e.split(",").forEach(function (e) { + void 0 !== t && (o[e].tooltip = y(t)); + }); + }, + lookUpDomId: m, + setDiagramTitle: i.r, + getDiagramTitle: i.t, + setClassLabel: function (e, t) { + t && (t = y(t)); + const { className: n } = E(e); + o[n].label = t; + }, + addNamespace: function (e) { + void 0 === A[e] && ((A[e] = { id: e, classes: {}, children: {}, domId: a + e + "-" + p }), p++); + }, + addClassesToNamespace: function (e, t) { + void 0 !== A[e] && + t.map((t) => { + (o[t].parent = e), (A[e].classes[t] = o[t]); + }); + }, + getNamespace: function (e) { + return A[e]; + }, + getNamespaces: function () { + return A; + }, + }, + D = (e) => + `g.classGroup text {\n fill: ${e.nodeBorder};\n fill: ${e.classText};\n stroke: none;\n font-family: ${e.fontFamily};\n font-size: 10px;\n\n .title {\n font-weight: bolder;\n }\n\n}\n\n.nodeLabel, .edgeLabel {\n color: ${e.classText};\n}\n.edgeLabel .label rect {\n fill: ${e.mainBkg};\n}\n.label text {\n fill: ${e.classText};\n}\n.edgeLabel .label span {\n background: ${e.mainBkg};\n}\n\n.classTitle {\n font-weight: bolder;\n}\n.node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n\n\n.divider {\n stroke: ${e.nodeBorder};\n stroke-width: 1;\n}\n\ng.clickable {\n cursor: pointer;\n}\n\ng.classGroup rect {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n}\n\ng.classGroup line {\n stroke: ${e.nodeBorder};\n stroke-width: 1;\n}\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${e.mainBkg};\n opacity: 0.5;\n}\n\n.classLabel .label {\n fill: ${e.nodeBorder};\n font-size: 10px;\n}\n\n.relation {\n stroke: ${e.lineColor};\n stroke-width: 1;\n fill: none;\n}\n\n.dashed-line{\n stroke-dasharray: 3;\n}\n\n.dotted-line{\n stroke-dasharray: 1 2;\n}\n\n#compositionStart, .composition {\n fill: ${e.lineColor} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#compositionEnd, .composition {\n fill: ${e.lineColor} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${e.lineColor} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${e.lineColor} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionStart, .extension {\n fill: ${e.mainBkg} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionEnd, .extension {\n fill: ${e.mainBkg} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationStart, .aggregation {\n fill: ${e.mainBkg} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationEnd, .aggregation {\n fill: ${e.mainBkg} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#lollipopStart, .lollipop {\n fill: ${e.mainBkg} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n#lollipopEnd, .lollipop {\n fill: ${e.mainBkg} !important;\n stroke: ${e.lineColor} !important;\n stroke-width: 1;\n}\n\n.edgeTerminals {\n font-size: 11px;\n}\n\n.classTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n}\n`; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/430-cc171d93.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/430-cc171d93.chunk.min.js new file mode 100644 index 000000000..d6ac88548 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/430-cc171d93.chunk.min.js @@ -0,0 +1,1566 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [430], + { + 4430: function (t, e, r) { + r.d(e, { + diagram: function () { + return v; + }, + }); + var i = r(9339), + a = r(5625), + n = r(7274), + s = r(3771); + const o = []; + for (let t = 0; t < 256; ++t) o.push((t + 256).toString(16).slice(1)); + var c = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i, + l = function (t) { + if ( + !(function (t) { + return "string" == typeof t && c.test(t); + })(t) + ) + throw TypeError("Invalid UUID"); + let e; + const r = new Uint8Array(16); + return ( + (r[0] = (e = parseInt(t.slice(0, 8), 16)) >>> 24), + (r[1] = (e >>> 16) & 255), + (r[2] = (e >>> 8) & 255), + (r[3] = 255 & e), + (r[4] = (e = parseInt(t.slice(9, 13), 16)) >>> 8), + (r[5] = 255 & e), + (r[6] = (e = parseInt(t.slice(14, 18), 16)) >>> 8), + (r[7] = 255 & e), + (r[8] = (e = parseInt(t.slice(19, 23), 16)) >>> 8), + (r[9] = 255 & e), + (r[10] = ((e = parseInt(t.slice(24, 36), 16)) / 1099511627776) & 255), + (r[11] = (e / 4294967296) & 255), + (r[12] = (e >>> 24) & 255), + (r[13] = (e >>> 16) & 255), + (r[14] = (e >>> 8) & 255), + (r[15] = 255 & e), + r + ); + }; + function h(t, e, r, i) { + switch (t) { + case 0: + return (e & r) ^ (~e & i); + case 1: + case 3: + return e ^ r ^ i; + case 2: + return (e & r) ^ (e & i) ^ (r & i); + } + } + function d(t, e) { + return (t << e) | (t >>> (32 - e)); + } + var u = (function (t, e, r) { + function i(t, e, r, i) { + var a; + if ( + ("string" == typeof t && + (t = (function (t) { + t = unescape(encodeURIComponent(t)); + const e = []; + for (let r = 0; r < t.length; ++r) e.push(t.charCodeAt(r)); + return e; + })(t)), + "string" == typeof e && (e = l(e)), + 16 !== (null === (a = e) || void 0 === a ? void 0 : a.length)) + ) + throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)"); + let n = new Uint8Array(16 + t.length); + if ( + (n.set(e), + n.set(t, e.length), + (n = (function (t) { + const e = [1518500249, 1859775393, 2400959708, 3395469782], + r = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]; + if ("string" == typeof t) { + const e = unescape(encodeURIComponent(t)); + t = []; + for (let r = 0; r < e.length; ++r) t.push(e.charCodeAt(r)); + } else Array.isArray(t) || (t = Array.prototype.slice.call(t)); + t.push(128); + const i = t.length / 4 + 2, + a = Math.ceil(i / 16), + n = new Array(a); + for (let e = 0; e < a; ++e) { + const r = new Uint32Array(16); + for (let i = 0; i < 16; ++i) + r[i] = (t[64 * e + 4 * i] << 24) | (t[64 * e + 4 * i + 1] << 16) | (t[64 * e + 4 * i + 2] << 8) | t[64 * e + 4 * i + 3]; + n[e] = r; + } + (n[a - 1][14] = (8 * (t.length - 1)) / Math.pow(2, 32)), + (n[a - 1][14] = Math.floor(n[a - 1][14])), + (n[a - 1][15] = (8 * (t.length - 1)) & 4294967295); + for (let t = 0; t < a; ++t) { + const i = new Uint32Array(80); + for (let e = 0; e < 16; ++e) i[e] = n[t][e]; + for (let t = 16; t < 80; ++t) i[t] = d(i[t - 3] ^ i[t - 8] ^ i[t - 14] ^ i[t - 16], 1); + let a = r[0], + s = r[1], + o = r[2], + c = r[3], + l = r[4]; + for (let t = 0; t < 80; ++t) { + const r = Math.floor(t / 20), + n = (d(a, 5) + h(r, s, o, c) + l + e[r] + i[t]) >>> 0; + (l = c), (c = o), (o = d(s, 30) >>> 0), (s = a), (a = n); + } + (r[0] = (r[0] + a) >>> 0), + (r[1] = (r[1] + s) >>> 0), + (r[2] = (r[2] + o) >>> 0), + (r[3] = (r[3] + c) >>> 0), + (r[4] = (r[4] + l) >>> 0); + } + return [ + (r[0] >> 24) & 255, + (r[0] >> 16) & 255, + (r[0] >> 8) & 255, + 255 & r[0], + (r[1] >> 24) & 255, + (r[1] >> 16) & 255, + (r[1] >> 8) & 255, + 255 & r[1], + (r[2] >> 24) & 255, + (r[2] >> 16) & 255, + (r[2] >> 8) & 255, + 255 & r[2], + (r[3] >> 24) & 255, + (r[3] >> 16) & 255, + (r[3] >> 8) & 255, + 255 & r[3], + (r[4] >> 24) & 255, + (r[4] >> 16) & 255, + (r[4] >> 8) & 255, + 255 & r[4], + ]; + })(n)), + (n[6] = (15 & n[6]) | 80), + (n[8] = (63 & n[8]) | 128), + r) + ) { + i = i || 0; + for (let t = 0; t < 16; ++t) r[i + t] = n[t]; + return r; + } + return (function (t, e = 0) { + return ( + o[t[e + 0]] + + o[t[e + 1]] + + o[t[e + 2]] + + o[t[e + 3]] + + "-" + + o[t[e + 4]] + + o[t[e + 5]] + + "-" + + o[t[e + 6]] + + o[t[e + 7]] + + "-" + + o[t[e + 8]] + + o[t[e + 9]] + + "-" + + o[t[e + 10]] + + o[t[e + 11]] + + o[t[e + 12]] + + o[t[e + 13]] + + o[t[e + 14]] + + o[t[e + 15]] + ).toLowerCase(); + })(n); + } + try { + i.name = "v5"; + } catch (t) {} + return (i.DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"), (i.URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"), i; + })(), + y = + (r(7484), + r(7967), + r(7856), + (function () { + var t = function (t, e, r, i) { + for (r = r || {}, i = t.length; i--; r[t[i]] = e); + return r; + }, + e = [1, 2], + r = [1, 5], + i = [6, 9, 11, 23, 25, 27, 29, 30, 31, 52], + a = [1, 17], + n = [1, 18], + s = [1, 19], + o = [1, 20], + c = [1, 21], + l = [1, 22], + h = [1, 25], + d = [1, 30], + u = [1, 31], + y = [1, 32], + p = [1, 33], + _ = [1, 34], + f = [6, 9, 11, 15, 20, 23, 25, 27, 29, 30, 31, 44, 45, 46, 47, 48, 52], + g = [1, 46], + m = [30, 31, 49, 50], + E = [4, 6, 9, 11, 23, 25, 27, 29, 30, 31, 52], + O = [44, 45, 46, 47, 48], + b = [22, 37], + k = [1, 66], + R = [1, 65], + N = [22, 37, 39, 41], + T = { + trace: function () {}, + yy: {}, + symbols_: { + error: 2, + start: 3, + ER_DIAGRAM: 4, + document: 5, + EOF: 6, + directive: 7, + line: 8, + SPACE: 9, + statement: 10, + NEWLINE: 11, + openDirective: 12, + typeDirective: 13, + closeDirective: 14, + ":": 15, + argDirective: 16, + entityName: 17, + relSpec: 18, + role: 19, + BLOCK_START: 20, + attributes: 21, + BLOCK_STOP: 22, + title: 23, + title_value: 24, + acc_title: 25, + acc_title_value: 26, + acc_descr: 27, + acc_descr_value: 28, + acc_descr_multiline_value: 29, + ALPHANUM: 30, + ENTITY_NAME: 31, + attribute: 32, + attributeType: 33, + attributeName: 34, + attributeKeyTypeList: 35, + attributeComment: 36, + ATTRIBUTE_WORD: 37, + attributeKeyType: 38, + COMMA: 39, + ATTRIBUTE_KEY: 40, + COMMENT: 41, + cardinality: 42, + relType: 43, + ZERO_OR_ONE: 44, + ZERO_OR_MORE: 45, + ONE_OR_MORE: 46, + ONLY_ONE: 47, + MD_PARENT: 48, + NON_IDENTIFYING: 49, + IDENTIFYING: 50, + WORD: 51, + open_directive: 52, + type_directive: 53, + arg_directive: 54, + close_directive: 55, + $accept: 0, + $end: 1, + }, + terminals_: { + 2: "error", + 4: "ER_DIAGRAM", + 6: "EOF", + 9: "SPACE", + 11: "NEWLINE", + 15: ":", + 20: "BLOCK_START", + 22: "BLOCK_STOP", + 23: "title", + 24: "title_value", + 25: "acc_title", + 26: "acc_title_value", + 27: "acc_descr", + 28: "acc_descr_value", + 29: "acc_descr_multiline_value", + 30: "ALPHANUM", + 31: "ENTITY_NAME", + 37: "ATTRIBUTE_WORD", + 39: "COMMA", + 40: "ATTRIBUTE_KEY", + 41: "COMMENT", + 44: "ZERO_OR_ONE", + 45: "ZERO_OR_MORE", + 46: "ONE_OR_MORE", + 47: "ONLY_ONE", + 48: "MD_PARENT", + 49: "NON_IDENTIFYING", + 50: "IDENTIFYING", + 51: "WORD", + 52: "open_directive", + 53: "type_directive", + 54: "arg_directive", + 55: "close_directive", + }, + productions_: [ + 0, + [3, 3], + [3, 2], + [5, 0], + [5, 2], + [8, 2], + [8, 1], + [8, 1], + [8, 1], + [7, 4], + [7, 6], + [10, 1], + [10, 5], + [10, 4], + [10, 3], + [10, 1], + [10, 2], + [10, 2], + [10, 2], + [10, 1], + [17, 1], + [17, 1], + [21, 1], + [21, 2], + [32, 2], + [32, 3], + [32, 3], + [32, 4], + [33, 1], + [34, 1], + [35, 1], + [35, 3], + [38, 1], + [36, 1], + [18, 3], + [42, 1], + [42, 1], + [42, 1], + [42, 1], + [42, 1], + [43, 1], + [43, 1], + [19, 1], + [19, 1], + [19, 1], + [12, 1], + [13, 1], + [16, 1], + [14, 1], + ], + performAction: function (t, e, r, i, a, n, s) { + var o = n.length - 1; + switch (a) { + case 1: + break; + case 3: + case 7: + case 8: + this.$ = []; + break; + case 4: + n[o - 1].push(n[o]), (this.$ = n[o - 1]); + break; + case 5: + case 6: + case 20: + case 44: + case 28: + case 29: + case 32: + this.$ = n[o]; + break; + case 12: + i.addEntity(n[o - 4]), i.addEntity(n[o - 2]), i.addRelationship(n[o - 4], n[o], n[o - 2], n[o - 3]); + break; + case 13: + i.addEntity(n[o - 3]), i.addAttributes(n[o - 3], n[o - 1]); + break; + case 14: + i.addEntity(n[o - 2]); + break; + case 15: + i.addEntity(n[o]); + break; + case 16: + case 17: + (this.$ = n[o].trim()), i.setAccTitle(this.$); + break; + case 18: + case 19: + (this.$ = n[o].trim()), i.setAccDescription(this.$); + break; + case 21: + case 42: + case 43: + case 33: + this.$ = n[o].replace(/"/g, ""); + break; + case 22: + case 30: + this.$ = [n[o]]; + break; + case 23: + n[o].push(n[o - 1]), (this.$ = n[o]); + break; + case 24: + this.$ = { attributeType: n[o - 1], attributeName: n[o] }; + break; + case 25: + this.$ = { + attributeType: n[o - 2], + attributeName: n[o - 1], + attributeKeyTypeList: n[o], + }; + break; + case 26: + this.$ = { + attributeType: n[o - 2], + attributeName: n[o - 1], + attributeComment: n[o], + }; + break; + case 27: + this.$ = { + attributeType: n[o - 3], + attributeName: n[o - 2], + attributeKeyTypeList: n[o - 1], + attributeComment: n[o], + }; + break; + case 31: + n[o - 2].push(n[o]), (this.$ = n[o - 2]); + break; + case 34: + this.$ = { cardA: n[o], relType: n[o - 1], cardB: n[o - 2] }; + break; + case 35: + this.$ = i.Cardinality.ZERO_OR_ONE; + break; + case 36: + this.$ = i.Cardinality.ZERO_OR_MORE; + break; + case 37: + this.$ = i.Cardinality.ONE_OR_MORE; + break; + case 38: + this.$ = i.Cardinality.ONLY_ONE; + break; + case 39: + this.$ = i.Cardinality.MD_PARENT; + break; + case 40: + this.$ = i.Identification.NON_IDENTIFYING; + break; + case 41: + this.$ = i.Identification.IDENTIFYING; + break; + case 45: + i.parseDirective("%%{", "open_directive"); + break; + case 46: + i.parseDirective(n[o], "type_directive"); + break; + case 47: + (n[o] = n[o].trim().replace(/'/g, '"')), i.parseDirective(n[o], "arg_directive"); + break; + case 48: + i.parseDirective("}%%", "close_directive", "er"); + } + }, + table: [ + { 3: 1, 4: e, 7: 3, 12: 4, 52: r }, + { 1: [3] }, + t(i, [2, 3], { 5: 6 }), + { 3: 7, 4: e, 7: 3, 12: 4, 52: r }, + { 13: 8, 53: [1, 9] }, + { 53: [2, 45] }, + { + 6: [1, 10], + 7: 15, + 8: 11, + 9: [1, 12], + 10: 13, + 11: [1, 14], + 12: 4, + 17: 16, + 23: a, + 25: n, + 27: s, + 29: o, + 30: c, + 31: l, + 52: r, + }, + { 1: [2, 2] }, + { 14: 23, 15: [1, 24], 55: h }, + t([15, 55], [2, 46]), + t(i, [2, 8], { 1: [2, 1] }), + t(i, [2, 4]), + { 7: 15, 10: 26, 12: 4, 17: 16, 23: a, 25: n, 27: s, 29: o, 30: c, 31: l, 52: r }, + t(i, [2, 6]), + t(i, [2, 7]), + t(i, [2, 11]), + t(i, [2, 15], { 18: 27, 42: 29, 20: [1, 28], 44: d, 45: u, 46: y, 47: p, 48: _ }), + { 24: [1, 35] }, + { 26: [1, 36] }, + { 28: [1, 37] }, + t(i, [2, 19]), + t(f, [2, 20]), + t(f, [2, 21]), + { 11: [1, 38] }, + { 16: 39, 54: [1, 40] }, + { 11: [2, 48] }, + t(i, [2, 5]), + { 17: 41, 30: c, 31: l }, + { 21: 42, 22: [1, 43], 32: 44, 33: 45, 37: g }, + { 43: 47, 49: [1, 48], 50: [1, 49] }, + t(m, [2, 35]), + t(m, [2, 36]), + t(m, [2, 37]), + t(m, [2, 38]), + t(m, [2, 39]), + t(i, [2, 16]), + t(i, [2, 17]), + t(i, [2, 18]), + t(E, [2, 9]), + { 14: 50, 55: h }, + { 55: [2, 47] }, + { 15: [1, 51] }, + { 22: [1, 52] }, + t(i, [2, 14]), + { 21: 53, 22: [2, 22], 32: 44, 33: 45, 37: g }, + { 34: 54, 37: [1, 55] }, + { 37: [2, 28] }, + { 42: 56, 44: d, 45: u, 46: y, 47: p, 48: _ }, + t(O, [2, 40]), + t(O, [2, 41]), + { 11: [1, 57] }, + { 19: 58, 30: [1, 61], 31: [1, 60], 51: [1, 59] }, + t(i, [2, 13]), + { 22: [2, 23] }, + t(b, [2, 24], { 35: 62, 36: 63, 38: 64, 40: k, 41: R }), + t([22, 37, 40, 41], [2, 29]), + t([30, 31], [2, 34]), + t(E, [2, 10]), + t(i, [2, 12]), + t(i, [2, 42]), + t(i, [2, 43]), + t(i, [2, 44]), + t(b, [2, 25], { 36: 67, 39: [1, 68], 41: R }), + t(b, [2, 26]), + t(N, [2, 30]), + t(b, [2, 33]), + t(N, [2, 32]), + t(b, [2, 27]), + { 38: 69, 40: k }, + t(N, [2, 31]), + ], + defaultActions: { + 5: [2, 45], + 7: [2, 2], + 25: [2, 48], + 40: [2, 47], + 46: [2, 28], + 53: [2, 23], + }, + parseError: function (t, e) { + if (!e.recoverable) { + var r = new Error(t); + throw ((r.hash = e), r); + } + this.trace(t); + }, + parse: function (t) { + var e = [0], + r = [], + i = [null], + a = [], + n = this.table, + s = "", + o = 0, + c = 0, + l = a.slice.call(arguments, 1), + h = Object.create(this.lexer), + d = { yy: {} }; + for (var u in this.yy) Object.prototype.hasOwnProperty.call(this.yy, u) && (d.yy[u] = this.yy[u]); + h.setInput(t, d.yy), (d.yy.lexer = h), (d.yy.parser = this), void 0 === h.yylloc && (h.yylloc = {}); + var y = h.yylloc; + a.push(y); + var p = h.options && h.options.ranges; + "function" == typeof d.yy.parseError + ? (this.parseError = d.yy.parseError) + : (this.parseError = Object.getPrototypeOf(this).parseError); + for (var _, f, g, m, E, O, b, k, R, N = {}; ; ) { + if ( + ((f = e[e.length - 1]), + this.defaultActions[f] + ? (g = this.defaultActions[f]) + : (null == _ && + ((R = void 0), + "number" != typeof (R = r.pop() || h.lex() || 1) && + (R instanceof Array && (R = (r = R).pop()), (R = this.symbols_[R] || R)), + (_ = R)), + (g = n[f] && n[f][_])), + void 0 === g || !g.length || !g[0]) + ) { + var T; + for (E in ((k = []), n[f])) this.terminals_[E] && E > 2 && k.push("'" + this.terminals_[E] + "'"); + (T = h.showPosition + ? "Parse error on line " + + (o + 1) + + ":\n" + + h.showPosition() + + "\nExpecting " + + k.join(", ") + + ", got '" + + (this.terminals_[_] || _) + + "'" + : "Parse error on line " + (o + 1) + ": Unexpected " + (1 == _ ? "end of input" : "'" + (this.terminals_[_] || _) + "'")), + this.parseError(T, { + text: h.match, + token: this.terminals_[_] || _, + line: h.yylineno, + loc: y, + expected: k, + }); + } + if (g[0] instanceof Array && g.length > 1) + throw new Error("Parse Error: multiple actions possible at state: " + f + ", token: " + _); + switch (g[0]) { + case 1: + e.push(_), + i.push(h.yytext), + a.push(h.yylloc), + e.push(g[1]), + (_ = null), + (c = h.yyleng), + (s = h.yytext), + (o = h.yylineno), + (y = h.yylloc); + break; + case 2: + if ( + ((O = this.productions_[g[1]][1]), + (N.$ = i[i.length - O]), + (N._$ = { + first_line: a[a.length - (O || 1)].first_line, + last_line: a[a.length - 1].last_line, + first_column: a[a.length - (O || 1)].first_column, + last_column: a[a.length - 1].last_column, + }), + p && (N._$.range = [a[a.length - (O || 1)].range[0], a[a.length - 1].range[1]]), + void 0 !== (m = this.performAction.apply(N, [s, c, o, d.yy, g[1], i, a].concat(l)))) + ) + return m; + O && ((e = e.slice(0, -1 * O * 2)), (i = i.slice(0, -1 * O)), (a = a.slice(0, -1 * O))), + e.push(this.productions_[g[1]][0]), + i.push(N.$), + a.push(N._$), + (b = n[e[e.length - 2]][e[e.length - 1]]), + e.push(b); + break; + case 3: + return !0; + } + } + return !0; + }, + }, + x = { + EOF: 1, + parseError: function (t, e) { + if (!this.yy.parser) throw new Error(t); + this.yy.parser.parseError(t, e); + }, + setInput: function (t, e) { + return ( + (this.yy = e || this.yy || {}), + (this._input = t), + (this._more = this._backtrack = this.done = !1), + (this.yylineno = this.yyleng = 0), + (this.yytext = this.matched = this.match = ""), + (this.conditionStack = ["INITIAL"]), + (this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0, + }), + this.options.ranges && (this.yylloc.range = [0, 0]), + (this.offset = 0), + this + ); + }, + input: function () { + var t = this._input[0]; + return ( + (this.yytext += t), + this.yyleng++, + this.offset++, + (this.match += t), + (this.matched += t), + t.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, + this.options.ranges && this.yylloc.range[1]++, + (this._input = this._input.slice(1)), + t + ); + }, + unput: function (t) { + var e = t.length, + r = t.split(/(?:\r\n?|\n)/g); + (this._input = t + this._input), (this.yytext = this.yytext.substr(0, this.yytext.length - e)), (this.offset -= e); + var i = this.match.split(/(?:\r\n?|\n)/g); + (this.match = this.match.substr(0, this.match.length - 1)), + (this.matched = this.matched.substr(0, this.matched.length - 1)), + r.length - 1 && (this.yylineno -= r.length - 1); + var a = this.yylloc.range; + return ( + (this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: r + ? (r.length === i.length ? this.yylloc.first_column : 0) + i[i.length - r.length].length - r[0].length + : this.yylloc.first_column - e, + }), + this.options.ranges && (this.yylloc.range = [a[0], a[0] + this.yyleng - e]), + (this.yyleng = this.yytext.length), + this + ); + }, + more: function () { + return (this._more = !0), this; + }, + reject: function () { + return this.options.backtrack_lexer + ? ((this._backtrack = !0), this) + : this.parseError( + "Lexical error on line " + + (this.yylineno + 1) + + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + + this.showPosition(), + { text: "", token: null, line: this.yylineno }, + ); + }, + less: function (t) { + this.unput(this.match.slice(t)); + }, + pastInput: function () { + var t = this.matched.substr(0, this.matched.length - this.match.length); + return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, ""); + }, + upcomingInput: function () { + var t = this.match; + return ( + t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "") + ); + }, + showPosition: function () { + var t = this.pastInput(), + e = new Array(t.length + 1).join("-"); + return t + this.upcomingInput() + "\n" + e + "^"; + }, + test_match: function (t, e) { + var r, i, a; + if ( + (this.options.backtrack_lexer && + ((a = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column, + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done, + }), + this.options.ranges && (a.yylloc.range = this.yylloc.range.slice(0))), + (i = t[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += i.length), + (this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: i ? i[i.length - 1].length - i[i.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length, + }), + (this.yytext += t[0]), + (this.match += t[0]), + (this.matches = t), + (this.yyleng = this.yytext.length), + this.options.ranges && (this.yylloc.range = [this.offset, (this.offset += this.yyleng)]), + (this._more = !1), + (this._backtrack = !1), + (this._input = this._input.slice(t[0].length)), + (this.matched += t[0]), + (r = this.performAction.call(this, this.yy, this, e, this.conditionStack[this.conditionStack.length - 1])), + this.done && this._input && (this.done = !1), + r) + ) + return r; + if (this._backtrack) { + for (var n in a) this[n] = a[n]; + return !1; + } + return !1; + }, + next: function () { + if (this.done) return this.EOF; + var t, e, r, i; + this._input || (this.done = !0), this._more || ((this.yytext = ""), (this.match = "")); + for (var a = this._currentRules(), n = 0; n < a.length; n++) + if ((r = this._input.match(this.rules[a[n]])) && (!e || r[0].length > e[0].length)) { + if (((e = r), (i = n), this.options.backtrack_lexer)) { + if (!1 !== (t = this.test_match(r, a[n]))) return t; + if (this._backtrack) { + e = !1; + continue; + } + return !1; + } + if (!this.options.flex) break; + } + return e + ? !1 !== (t = this.test_match(e, a[i])) && t + : "" === this._input + ? this.EOF + : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno, + }); + }, + lex: function () { + return this.next() || this.lex(); + }, + begin: function (t) { + this.conditionStack.push(t); + }, + popState: function () { + return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]; + }, + _currentRules: function () { + return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] + ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules + : this.conditions.INITIAL.rules; + }, + topState: function (t) { + return (t = this.conditionStack.length - 1 - Math.abs(t || 0)) >= 0 ? this.conditionStack[t] : "INITIAL"; + }, + pushState: function (t) { + this.begin(t); + }, + stateStackSize: function () { + return this.conditionStack.length; + }, + options: { "case-insensitive": !0 }, + performAction: function (t, e, r, i) { + switch (r) { + case 0: + return this.begin("acc_title"), 25; + case 1: + return this.popState(), "acc_title_value"; + case 2: + return this.begin("acc_descr"), 27; + case 3: + return this.popState(), "acc_descr_value"; + case 4: + this.begin("acc_descr_multiline"); + break; + case 5: + this.popState(); + break; + case 6: + return "acc_descr_multiline_value"; + case 7: + return this.begin("open_directive"), 52; + case 8: + return this.begin("type_directive"), 53; + case 9: + return this.popState(), this.begin("arg_directive"), 15; + case 10: + return this.popState(), this.popState(), 55; + case 11: + return 54; + case 12: + return 11; + case 13: + case 20: + case 25: + break; + case 14: + return 9; + case 15: + return 31; + case 16: + return 51; + case 17: + return 4; + case 18: + return this.begin("block"), 20; + case 19: + return 39; + case 21: + return 40; + case 22: + case 23: + return 37; + case 24: + return 41; + case 26: + return this.popState(), 22; + case 27: + case 57: + return e.yytext[0]; + case 28: + case 32: + case 33: + case 46: + return 44; + case 29: + case 30: + case 31: + case 39: + case 41: + case 48: + return 46; + case 34: + case 35: + case 36: + case 37: + case 38: + case 40: + case 47: + return 45; + case 42: + case 43: + case 44: + case 45: + return 47; + case 49: + return 48; + case 50: + case 53: + case 54: + case 55: + return 49; + case 51: + case 52: + return 50; + case 56: + return 30; + case 58: + return 6; + } + }, + rules: [ + /^(?:accTitle\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*\{\s*)/i, + /^(?:[\}])/i, + /^(?:[^\}]*)/i, + /^(?:%%\{)/i, + /^(?:((?:(?!\}%%)[^:.])*))/i, + /^(?::)/i, + /^(?:\}%%)/i, + /^(?:((?:(?!\}%%).|\n)*))/i, + /^(?:[\n]+)/i, + /^(?:\s+)/i, + /^(?:[\s]+)/i, + /^(?:"[^"%\r\n\v\b\\]+")/i, + /^(?:"[^"]*")/i, + /^(?:erDiagram\b)/i, + /^(?:\{)/i, + /^(?:,)/i, + /^(?:\s+)/i, + /^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i, + /^(?:(.*?)[~](.*?)*[~])/i, + /^(?:[\*A-Za-z_][A-Za-z0-9\-_\[\]\(\)]*)/i, + /^(?:"[^"]*")/i, + /^(?:[\n]+)/i, + /^(?:\})/i, + /^(?:.)/i, + /^(?:one or zero\b)/i, + /^(?:one or more\b)/i, + /^(?:one or many\b)/i, + /^(?:1\+)/i, + /^(?:\|o\b)/i, + /^(?:zero or one\b)/i, + /^(?:zero or more\b)/i, + /^(?:zero or many\b)/i, + /^(?:0\+)/i, + /^(?:\}o\b)/i, + /^(?:many\(0\))/i, + /^(?:many\(1\))/i, + /^(?:many\b)/i, + /^(?:\}\|)/i, + /^(?:one\b)/i, + /^(?:only one\b)/i, + /^(?:1\b)/i, + /^(?:\|\|)/i, + /^(?:o\|)/i, + /^(?:o\{)/i, + /^(?:\|\{)/i, + /^(?:\s*u\b)/i, + /^(?:\.\.)/i, + /^(?:--)/i, + /^(?:to\b)/i, + /^(?:optionally to\b)/i, + /^(?:\.-)/i, + /^(?:-\.)/i, + /^(?:[A-Za-z][A-Za-z0-9\-_]*)/i, + /^(?:.)/i, + /^(?:$)/i, + ], + conditions: { + acc_descr_multiline: { rules: [5, 6], inclusive: !1 }, + acc_descr: { rules: [3], inclusive: !1 }, + acc_title: { rules: [1], inclusive: !1 }, + open_directive: { rules: [8], inclusive: !1 }, + type_directive: { rules: [9, 10], inclusive: !1 }, + arg_directive: { rules: [10, 11], inclusive: !1 }, + block: { rules: [19, 20, 21, 22, 23, 24, 25, 26, 27], inclusive: !1 }, + INITIAL: { + rules: [ + 0, 2, 4, 7, 12, 13, 14, 15, 16, 17, 18, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, + ], + inclusive: !0, + }, + }, + }; + function A() { + this.yy = {}; + } + return (T.lexer = x), (A.prototype = T), (T.Parser = A), new A(); + })()); + y.parser = y; + const p = y; + let _ = {}, + f = []; + const g = function (t) { + return void 0 === _[t] && ((_[t] = { attributes: [] }), i.l.info("Added new entity :", t)), _[t]; + }, + m = { + Cardinality: { + ZERO_OR_ONE: "ZERO_OR_ONE", + ZERO_OR_MORE: "ZERO_OR_MORE", + ONE_OR_MORE: "ONE_OR_MORE", + ONLY_ONE: "ONLY_ONE", + MD_PARENT: "MD_PARENT", + }, + Identification: { NON_IDENTIFYING: "NON_IDENTIFYING", IDENTIFYING: "IDENTIFYING" }, + parseDirective: function (t, e, r) { + i.m.parseDirective(this, t, e, r); + }, + getConfig: () => (0, i.c)().er, + addEntity: g, + addAttributes: function (t, e) { + let r, + a = g(t); + for (r = e.length - 1; r >= 0; r--) a.attributes.push(e[r]), i.l.debug("Added attribute ", e[r].attributeName); + }, + getEntities: () => _, + addRelationship: function (t, e, r, a) { + let n = { entityA: t, roleA: e, entityB: r, relSpec: a }; + f.push(n), i.l.debug("Added new relationship :", n); + }, + getRelationships: () => f, + clear: function () { + (_ = {}), (f = []), (0, i.v)(); + }, + setAccTitle: i.s, + getAccTitle: i.g, + setAccDescription: i.b, + getAccDescription: i.a, + setDiagramTitle: i.r, + getDiagramTitle: i.t, + }, + E = { + ONLY_ONE_START: "ONLY_ONE_START", + ONLY_ONE_END: "ONLY_ONE_END", + ZERO_OR_ONE_START: "ZERO_OR_ONE_START", + ZERO_OR_ONE_END: "ZERO_OR_ONE_END", + ONE_OR_MORE_START: "ONE_OR_MORE_START", + ONE_OR_MORE_END: "ONE_OR_MORE_END", + ZERO_OR_MORE_START: "ZERO_OR_MORE_START", + ZERO_OR_MORE_END: "ZERO_OR_MORE_END", + MD_PARENT_END: "MD_PARENT_END", + MD_PARENT_START: "MD_PARENT_START", + }, + O = E, + b = /[^\dA-Za-z](\W)*/g; + let k = {}, + R = new Map(); + const N = function (t) { + return (t.entityA + t.roleA + t.entityB).replace(/\s/g, ""); + }; + let T = 0; + const x = "28e9f9db-3c8d-5aa5-9faf-44286ae5937c"; + function A(t = "") { + return t.length > 0 ? `${t}-` : ""; + } + const v = { + parser: p, + db: m, + renderer: { + setConf: function (t) { + const e = Object.keys(t); + for (const r of e) k[r] = t[r]; + }, + draw: function (t, e, r, o) { + (k = (0, i.c)().er), i.l.info("Drawing ER diagram"); + const c = (0, i.c)().securityLevel; + let l; + "sandbox" === c && (l = (0, n.Ys)("#i" + e)); + const h = ("sandbox" === c ? (0, n.Ys)(l.nodes()[0].contentDocument.body) : (0, n.Ys)("body")).select(`[id='${e}']`); + let d; + (function (t, e) { + let r; + t + .append("defs") + .append("marker") + .attr("id", E.MD_PARENT_START) + .attr("refX", 0) + .attr("refY", 7) + .attr("markerWidth", 190) + .attr("markerHeight", 240) + .attr("orient", "auto") + .append("path") + .attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), + t + .append("defs") + .append("marker") + .attr("id", E.MD_PARENT_END) + .attr("refX", 19) + .attr("refY", 7) + .attr("markerWidth", 20) + .attr("markerHeight", 28) + .attr("orient", "auto") + .append("path") + .attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), + t + .append("defs") + .append("marker") + .attr("id", E.ONLY_ONE_START) + .attr("refX", 0) + .attr("refY", 9) + .attr("markerWidth", 18) + .attr("markerHeight", 18) + .attr("orient", "auto") + .append("path") + .attr("stroke", e.stroke) + .attr("fill", "none") + .attr("d", "M9,0 L9,18 M15,0 L15,18"), + t + .append("defs") + .append("marker") + .attr("id", E.ONLY_ONE_END) + .attr("refX", 18) + .attr("refY", 9) + .attr("markerWidth", 18) + .attr("markerHeight", 18) + .attr("orient", "auto") + .append("path") + .attr("stroke", e.stroke) + .attr("fill", "none") + .attr("d", "M3,0 L3,18 M9,0 L9,18"), + (r = t + .append("defs") + .append("marker") + .attr("id", E.ZERO_OR_ONE_START) + .attr("refX", 0) + .attr("refY", 9) + .attr("markerWidth", 30) + .attr("markerHeight", 18) + .attr("orient", "auto")), + r.append("circle").attr("stroke", e.stroke).attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6), + r.append("path").attr("stroke", e.stroke).attr("fill", "none").attr("d", "M9,0 L9,18"), + (r = t + .append("defs") + .append("marker") + .attr("id", E.ZERO_OR_ONE_END) + .attr("refX", 30) + .attr("refY", 9) + .attr("markerWidth", 30) + .attr("markerHeight", 18) + .attr("orient", "auto")), + r.append("circle").attr("stroke", e.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6), + r.append("path").attr("stroke", e.stroke).attr("fill", "none").attr("d", "M21,0 L21,18"), + t + .append("defs") + .append("marker") + .attr("id", E.ONE_OR_MORE_START) + .attr("refX", 18) + .attr("refY", 18) + .attr("markerWidth", 45) + .attr("markerHeight", 36) + .attr("orient", "auto") + .append("path") + .attr("stroke", e.stroke) + .attr("fill", "none") + .attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"), + t + .append("defs") + .append("marker") + .attr("id", E.ONE_OR_MORE_END) + .attr("refX", 27) + .attr("refY", 18) + .attr("markerWidth", 45) + .attr("markerHeight", 36) + .attr("orient", "auto") + .append("path") + .attr("stroke", e.stroke) + .attr("fill", "none") + .attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18"), + (r = t + .append("defs") + .append("marker") + .attr("id", E.ZERO_OR_MORE_START) + .attr("refX", 18) + .attr("refY", 18) + .attr("markerWidth", 57) + .attr("markerHeight", 36) + .attr("orient", "auto")), + r.append("circle").attr("stroke", e.stroke).attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6), + r.append("path").attr("stroke", e.stroke).attr("fill", "none").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18"), + (r = t + .append("defs") + .append("marker") + .attr("id", E.ZERO_OR_MORE_END) + .attr("refX", 39) + .attr("refY", 18) + .attr("markerWidth", 57) + .attr("markerHeight", 36) + .attr("orient", "auto")), + r.append("circle").attr("stroke", e.stroke).attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6), + r.append("path").attr("stroke", e.stroke).attr("fill", "none").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18"); + })(h, k), + (d = new a.k({ multigraph: !0, directed: !0, compound: !1 }) + .setGraph({ + rankdir: k.layoutDirection, + marginx: 20, + marginy: 20, + nodesep: 100, + edgesep: 100, + ranksep: 100, + }) + .setDefaultEdgeLabel(function () { + return {}; + })); + const y = (function (t, e, r) { + let a; + return ( + Object.keys(e).forEach(function (n) { + const s = (function (t = "", e = "") { + const r = t.replace(b, ""); + return `${A(e)}${A(r)}${u(t, x)}`; + })(n, "entity"); + R.set(n, s); + const o = t.append("g").attr("id", s); + a = void 0 === a ? s : a; + const c = "text-" + s, + l = o + .append("text") + .classed("er entityLabel", !0) + .attr("id", c) + .attr("x", 0) + .attr("y", 0) + .style("dominant-baseline", "middle") + .style("text-anchor", "middle") + .style("font-family", (0, i.c)().fontFamily) + .style("font-size", k.fontSize + "px") + .text(n), + { width: h, height: d } = ((t, e, r) => { + const a = k.entityPadding / 3, + n = k.entityPadding / 3, + s = 0.85 * k.fontSize, + o = e.node().getBBox(), + c = []; + let l = !1, + h = !1, + d = 0, + u = 0, + y = 0, + p = 0, + _ = o.height + 2 * a, + f = 1; + r.forEach((t) => { + void 0 !== t.attributeKeyTypeList && t.attributeKeyTypeList.length > 0 && (l = !0), + void 0 !== t.attributeComment && (h = !0); + }), + r.forEach((r) => { + const n = `${e.node().id}-attr-${f}`; + let o = 0; + const g = (0, i.x)(r.attributeType), + m = t + .append("text") + .classed("er entityLabel", !0) + .attr("id", `${n}-type`) + .attr("x", 0) + .attr("y", 0) + .style("dominant-baseline", "middle") + .style("text-anchor", "left") + .style("font-family", (0, i.c)().fontFamily) + .style("font-size", s + "px") + .text(g), + E = t + .append("text") + .classed("er entityLabel", !0) + .attr("id", `${n}-name`) + .attr("x", 0) + .attr("y", 0) + .style("dominant-baseline", "middle") + .style("text-anchor", "left") + .style("font-family", (0, i.c)().fontFamily) + .style("font-size", s + "px") + .text(r.attributeName), + O = {}; + (O.tn = m), (O.nn = E); + const b = m.node().getBBox(), + k = E.node().getBBox(); + if (((d = Math.max(d, b.width)), (u = Math.max(u, k.width)), (o = Math.max(b.height, k.height)), l)) { + const e = void 0 !== r.attributeKeyTypeList ? r.attributeKeyTypeList.join(",") : "", + a = t + .append("text") + .classed("er entityLabel", !0) + .attr("id", `${n}-key`) + .attr("x", 0) + .attr("y", 0) + .style("dominant-baseline", "middle") + .style("text-anchor", "left") + .style("font-family", (0, i.c)().fontFamily) + .style("font-size", s + "px") + .text(e); + O.kn = a; + const c = a.node().getBBox(); + (y = Math.max(y, c.width)), (o = Math.max(o, c.height)); + } + if (h) { + const e = t + .append("text") + .classed("er entityLabel", !0) + .attr("id", `${n}-comment`) + .attr("x", 0) + .attr("y", 0) + .style("dominant-baseline", "middle") + .style("text-anchor", "left") + .style("font-family", (0, i.c)().fontFamily) + .style("font-size", s + "px") + .text(r.attributeComment || ""); + O.cn = e; + const a = e.node().getBBox(); + (p = Math.max(p, a.width)), (o = Math.max(o, a.height)); + } + (O.height = o), c.push(O), (_ += o + 2 * a), (f += 1); + }); + let g = 4; + l && (g += 2), h && (g += 2); + const m = d + u + y + p, + E = { + width: Math.max(k.minEntityWidth, Math.max(o.width + 2 * k.entityPadding, m + n * g)), + height: r.length > 0 ? _ : Math.max(k.minEntityHeight, o.height + 2 * k.entityPadding), + }; + if (r.length > 0) { + const r = Math.max(0, (E.width - m - n * g) / (g / 2)); + e.attr("transform", "translate(" + E.width / 2 + "," + (a + o.height / 2) + ")"); + let i = o.height + 2 * a, + s = "attributeBoxOdd"; + c.forEach((e) => { + const o = i + a + e.height / 2; + e.tn.attr("transform", "translate(" + n + "," + o + ")"); + const c = t + .insert("rect", "#" + e.tn.node().id) + .classed(`er ${s}`, !0) + .attr("x", 0) + .attr("y", i) + .attr("width", d + 2 * n + r) + .attr("height", e.height + 2 * a), + _ = parseFloat(c.attr("x")) + parseFloat(c.attr("width")); + e.nn.attr("transform", "translate(" + (_ + n) + "," + o + ")"); + const f = t + .insert("rect", "#" + e.nn.node().id) + .classed(`er ${s}`, !0) + .attr("x", _) + .attr("y", i) + .attr("width", u + 2 * n + r) + .attr("height", e.height + 2 * a); + let g = parseFloat(f.attr("x")) + parseFloat(f.attr("width")); + if (l) { + e.kn.attr("transform", "translate(" + (g + n) + "," + o + ")"); + const c = t + .insert("rect", "#" + e.kn.node().id) + .classed(`er ${s}`, !0) + .attr("x", g) + .attr("y", i) + .attr("width", y + 2 * n + r) + .attr("height", e.height + 2 * a); + g = parseFloat(c.attr("x")) + parseFloat(c.attr("width")); + } + h && + (e.cn.attr("transform", "translate(" + (g + n) + "," + o + ")"), + t + .insert("rect", "#" + e.cn.node().id) + .classed(`er ${s}`, "true") + .attr("x", g) + .attr("y", i) + .attr("width", p + 2 * n + r) + .attr("height", e.height + 2 * a)), + (i += e.height + 2 * a), + (s = "attributeBoxOdd" === s ? "attributeBoxEven" : "attributeBoxOdd"); + }); + } else + (E.height = Math.max(k.minEntityHeight, _)), e.attr("transform", "translate(" + E.width / 2 + "," + E.height / 2 + ")"); + return E; + })(o, l, e[n].attributes), + y = o + .insert("rect", "#" + c) + .classed("er entityBox", !0) + .attr("x", 0) + .attr("y", 0) + .attr("width", h) + .attr("height", d) + .node() + .getBBox(); + r.setNode(s, { width: y.width, height: y.height, shape: "rect", id: s }); + }), + a + ); + })(h, o.db.getEntities(), d), + p = (function (t, e) { + return ( + t.forEach(function (t) { + e.setEdge(R.get(t.entityA), R.get(t.entityB), { relationship: t }, N(t)); + }), + t + ); + })(o.db.getRelationships(), d); + var _, f; + (0, s.bK)(d), + (_ = h), + (f = d).nodes().forEach(function (t) { + void 0 !== t && + void 0 !== f.node(t) && + _.select("#" + t).attr( + "transform", + "translate(" + (f.node(t).x - f.node(t).width / 2) + "," + (f.node(t).y - f.node(t).height / 2) + " )", + ); + }), + p.forEach(function (t) { + !(function (t, e, r, a, s) { + T++; + const o = r.edge(R.get(e.entityA), R.get(e.entityB), N(e)), + c = (0, n.jvg)() + .x(function (t) { + return t.x; + }) + .y(function (t) { + return t.y; + }) + .curve(n.$0Z), + l = t + .insert("path", "#" + a) + .classed("er relationshipLine", !0) + .attr("d", c(o.points)) + .style("stroke", k.stroke) + .style("fill", "none"); + e.relSpec.relType === s.db.Identification.NON_IDENTIFYING && l.attr("stroke-dasharray", "8,8"); + let h = ""; + switch ( + (k.arrowMarkerAbsolute && + ((h = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search), + (h = h.replace(/\(/g, "\\(")), + (h = h.replace(/\)/g, "\\)"))), + e.relSpec.cardA) + ) { + case s.db.Cardinality.ZERO_OR_ONE: + l.attr("marker-end", "url(" + h + "#" + O.ZERO_OR_ONE_END + ")"); + break; + case s.db.Cardinality.ZERO_OR_MORE: + l.attr("marker-end", "url(" + h + "#" + O.ZERO_OR_MORE_END + ")"); + break; + case s.db.Cardinality.ONE_OR_MORE: + l.attr("marker-end", "url(" + h + "#" + O.ONE_OR_MORE_END + ")"); + break; + case s.db.Cardinality.ONLY_ONE: + l.attr("marker-end", "url(" + h + "#" + O.ONLY_ONE_END + ")"); + break; + case s.db.Cardinality.MD_PARENT: + l.attr("marker-end", "url(" + h + "#" + O.MD_PARENT_END + ")"); + } + switch (e.relSpec.cardB) { + case s.db.Cardinality.ZERO_OR_ONE: + l.attr("marker-start", "url(" + h + "#" + O.ZERO_OR_ONE_START + ")"); + break; + case s.db.Cardinality.ZERO_OR_MORE: + l.attr("marker-start", "url(" + h + "#" + O.ZERO_OR_MORE_START + ")"); + break; + case s.db.Cardinality.ONE_OR_MORE: + l.attr("marker-start", "url(" + h + "#" + O.ONE_OR_MORE_START + ")"); + break; + case s.db.Cardinality.ONLY_ONE: + l.attr("marker-start", "url(" + h + "#" + O.ONLY_ONE_START + ")"); + break; + case s.db.Cardinality.MD_PARENT: + l.attr("marker-start", "url(" + h + "#" + O.MD_PARENT_START + ")"); + } + const d = l.node().getTotalLength(), + u = l.node().getPointAtLength(0.5 * d), + y = "rel" + T, + p = t + .append("text") + .classed("er relationshipLabel", !0) + .attr("id", y) + .attr("x", u.x) + .attr("y", u.y) + .style("text-anchor", "middle") + .style("dominant-baseline", "middle") + .style("font-family", (0, i.c)().fontFamily) + .style("font-size", k.fontSize + "px") + .text(e.roleA) + .node() + .getBBox(); + t.insert("rect", "#" + y) + .classed("er relationshipLabelBox", !0) + .attr("x", u.x - p.width / 2) + .attr("y", u.y - p.height / 2) + .attr("width", p.width) + .attr("height", p.height); + })(h, t, d, y, o); + }); + const g = k.diagramPadding; + i.u.insertTitle(h, "entityTitleText", k.titleTopMargin, o.db.getDiagramTitle()); + const m = h.node().getBBox(), + v = m.width + 2 * g, + M = m.height + 2 * g; + (0, i.i)(h, M, v, k.useMaxWidth), h.attr("viewBox", `${m.x - g} ${m.y - g} ${v} ${M}`); + }, + }, + styles: (t) => + `\n .entityBox {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n }\n\n .attributeBoxOdd {\n fill: ${t.attributeBackgroundColorOdd};\n stroke: ${t.nodeBorder};\n }\n\n .attributeBoxEven {\n fill: ${t.attributeBackgroundColorEven};\n stroke: ${t.nodeBorder};\n }\n\n .relationshipLabelBox {\n fill: ${t.tertiaryColor};\n opacity: 0.7;\n background-color: ${t.tertiaryColor};\n rect {\n opacity: 0.5;\n }\n }\n\n .relationshipLine {\n stroke: ${t.lineColor};\n }\n\n .entityTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n } \n #MD_PARENT_START {\n fill: #f5f5f5 !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n }\n #MD_PARENT_END {\n fill: #f5f5f5 !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n }\n \n`, + }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/433-f2655a46.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/433-f2655a46.chunk.min.js new file mode 100644 index 000000000..3ad7d7928 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/433-f2655a46.chunk.min.js @@ -0,0 +1,418 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [433], + { + 6433: function (t, i, n) { + n.d(i, { + diagram: function () { + return h; + }, + }); + var e = n(9339), + s = + (n(7484), + n(7967), + n(7274), + n(7856), + (function () { + var t = function (t, i, n, e) { + for (n = n || {}, e = t.length; e--; n[t[e]] = i); + return n; + }, + i = [6, 9, 10], + n = { + trace: function () {}, + yy: {}, + symbols_: { + error: 2, + start: 3, + info: 4, + document: 5, + EOF: 6, + line: 7, + statement: 8, + NL: 9, + showInfo: 10, + $accept: 0, + $end: 1, + }, + terminals_: { 2: "error", 4: "info", 6: "EOF", 9: "NL", 10: "showInfo" }, + productions_: [0, [3, 3], [5, 0], [5, 2], [7, 1], [7, 1], [8, 1]], + performAction: function (t, i, n, e, s, r, h) { + switch ((r.length, s)) { + case 1: + return e; + case 4: + break; + case 6: + e.setInfo(!0); + } + }, + table: [ + { 3: 1, 4: [1, 2] }, + { 1: [3] }, + t(i, [2, 2], { 5: 3 }), + { 6: [1, 4], 7: 5, 8: 6, 9: [1, 7], 10: [1, 8] }, + { 1: [2, 1] }, + t(i, [2, 3]), + t(i, [2, 4]), + t(i, [2, 5]), + t(i, [2, 6]), + ], + defaultActions: { 4: [2, 1] }, + parseError: function (t, i) { + if (!i.recoverable) { + var n = new Error(t); + throw ((n.hash = i), n); + } + this.trace(t); + }, + parse: function (t) { + var i = [0], + n = [], + e = [null], + s = [], + r = this.table, + h = "", + o = 0, + l = 0, + c = s.slice.call(arguments, 1), + a = Object.create(this.lexer), + y = { yy: {} }; + for (var u in this.yy) Object.prototype.hasOwnProperty.call(this.yy, u) && (y.yy[u] = this.yy[u]); + a.setInput(t, y.yy), (y.yy.lexer = a), (y.yy.parser = this), void 0 === a.yylloc && (a.yylloc = {}); + var p = a.yylloc; + s.push(p); + var f = a.options && a.options.ranges; + "function" == typeof y.yy.parseError + ? (this.parseError = y.yy.parseError) + : (this.parseError = Object.getPrototypeOf(this).parseError); + for (var g, _, m, d, k, x, b, v, w, I = {}; ; ) { + if ( + ((_ = i[i.length - 1]), + this.defaultActions[_] + ? (m = this.defaultActions[_]) + : (null == g && + ((w = void 0), + "number" != typeof (w = n.pop() || a.lex() || 1) && + (w instanceof Array && (w = (n = w).pop()), (w = this.symbols_[w] || w)), + (g = w)), + (m = r[_] && r[_][g])), + void 0 === m || !m.length || !m[0]) + ) { + var S; + for (k in ((v = []), r[_])) this.terminals_[k] && k > 2 && v.push("'" + this.terminals_[k] + "'"); + (S = a.showPosition + ? "Parse error on line " + + (o + 1) + + ":\n" + + a.showPosition() + + "\nExpecting " + + v.join(", ") + + ", got '" + + (this.terminals_[g] || g) + + "'" + : "Parse error on line " + (o + 1) + ": Unexpected " + (1 == g ? "end of input" : "'" + (this.terminals_[g] || g) + "'")), + this.parseError(S, { + text: a.match, + token: this.terminals_[g] || g, + line: a.yylineno, + loc: p, + expected: v, + }); + } + if (m[0] instanceof Array && m.length > 1) + throw new Error("Parse Error: multiple actions possible at state: " + _ + ", token: " + g); + switch (m[0]) { + case 1: + i.push(g), + e.push(a.yytext), + s.push(a.yylloc), + i.push(m[1]), + (g = null), + (l = a.yyleng), + (h = a.yytext), + (o = a.yylineno), + (p = a.yylloc); + break; + case 2: + if ( + ((x = this.productions_[m[1]][1]), + (I.$ = e[e.length - x]), + (I._$ = { + first_line: s[s.length - (x || 1)].first_line, + last_line: s[s.length - 1].last_line, + first_column: s[s.length - (x || 1)].first_column, + last_column: s[s.length - 1].last_column, + }), + f && (I._$.range = [s[s.length - (x || 1)].range[0], s[s.length - 1].range[1]]), + void 0 !== (d = this.performAction.apply(I, [h, l, o, y.yy, m[1], e, s].concat(c)))) + ) + return d; + x && ((i = i.slice(0, -1 * x * 2)), (e = e.slice(0, -1 * x)), (s = s.slice(0, -1 * x))), + i.push(this.productions_[m[1]][0]), + e.push(I.$), + s.push(I._$), + (b = r[i[i.length - 2]][i[i.length - 1]]), + i.push(b); + break; + case 3: + return !0; + } + } + return !0; + }, + }, + e = { + EOF: 1, + parseError: function (t, i) { + if (!this.yy.parser) throw new Error(t); + this.yy.parser.parseError(t, i); + }, + setInput: function (t, i) { + return ( + (this.yy = i || this.yy || {}), + (this._input = t), + (this._more = this._backtrack = this.done = !1), + (this.yylineno = this.yyleng = 0), + (this.yytext = this.matched = this.match = ""), + (this.conditionStack = ["INITIAL"]), + (this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0, + }), + this.options.ranges && (this.yylloc.range = [0, 0]), + (this.offset = 0), + this + ); + }, + input: function () { + var t = this._input[0]; + return ( + (this.yytext += t), + this.yyleng++, + this.offset++, + (this.match += t), + (this.matched += t), + t.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, + this.options.ranges && this.yylloc.range[1]++, + (this._input = this._input.slice(1)), + t + ); + }, + unput: function (t) { + var i = t.length, + n = t.split(/(?:\r\n?|\n)/g); + (this._input = t + this._input), (this.yytext = this.yytext.substr(0, this.yytext.length - i)), (this.offset -= i); + var e = this.match.split(/(?:\r\n?|\n)/g); + (this.match = this.match.substr(0, this.match.length - 1)), + (this.matched = this.matched.substr(0, this.matched.length - 1)), + n.length - 1 && (this.yylineno -= n.length - 1); + var s = this.yylloc.range; + return ( + (this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: n + ? (n.length === e.length ? this.yylloc.first_column : 0) + e[e.length - n.length].length - n[0].length + : this.yylloc.first_column - i, + }), + this.options.ranges && (this.yylloc.range = [s[0], s[0] + this.yyleng - i]), + (this.yyleng = this.yytext.length), + this + ); + }, + more: function () { + return (this._more = !0), this; + }, + reject: function () { + return this.options.backtrack_lexer + ? ((this._backtrack = !0), this) + : this.parseError( + "Lexical error on line " + + (this.yylineno + 1) + + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + + this.showPosition(), + { text: "", token: null, line: this.yylineno }, + ); + }, + less: function (t) { + this.unput(this.match.slice(t)); + }, + pastInput: function () { + var t = this.matched.substr(0, this.matched.length - this.match.length); + return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, ""); + }, + upcomingInput: function () { + var t = this.match; + return ( + t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "") + ); + }, + showPosition: function () { + var t = this.pastInput(), + i = new Array(t.length + 1).join("-"); + return t + this.upcomingInput() + "\n" + i + "^"; + }, + test_match: function (t, i) { + var n, e, s; + if ( + (this.options.backtrack_lexer && + ((s = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column, + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done, + }), + this.options.ranges && (s.yylloc.range = this.yylloc.range.slice(0))), + (e = t[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += e.length), + (this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: e ? e[e.length - 1].length - e[e.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length, + }), + (this.yytext += t[0]), + (this.match += t[0]), + (this.matches = t), + (this.yyleng = this.yytext.length), + this.options.ranges && (this.yylloc.range = [this.offset, (this.offset += this.yyleng)]), + (this._more = !1), + (this._backtrack = !1), + (this._input = this._input.slice(t[0].length)), + (this.matched += t[0]), + (n = this.performAction.call(this, this.yy, this, i, this.conditionStack[this.conditionStack.length - 1])), + this.done && this._input && (this.done = !1), + n) + ) + return n; + if (this._backtrack) { + for (var r in s) this[r] = s[r]; + return !1; + } + return !1; + }, + next: function () { + if (this.done) return this.EOF; + var t, i, n, e; + this._input || (this.done = !0), this._more || ((this.yytext = ""), (this.match = "")); + for (var s = this._currentRules(), r = 0; r < s.length; r++) + if ((n = this._input.match(this.rules[s[r]])) && (!i || n[0].length > i[0].length)) { + if (((i = n), (e = r), this.options.backtrack_lexer)) { + if (!1 !== (t = this.test_match(n, s[r]))) return t; + if (this._backtrack) { + i = !1; + continue; + } + return !1; + } + if (!this.options.flex) break; + } + return i + ? !1 !== (t = this.test_match(i, s[e])) && t + : "" === this._input + ? this.EOF + : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno, + }); + }, + lex: function () { + return this.next() || this.lex(); + }, + begin: function (t) { + this.conditionStack.push(t); + }, + popState: function () { + return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]; + }, + _currentRules: function () { + return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] + ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules + : this.conditions.INITIAL.rules; + }, + topState: function (t) { + return (t = this.conditionStack.length - 1 - Math.abs(t || 0)) >= 0 ? this.conditionStack[t] : "INITIAL"; + }, + pushState: function (t) { + this.begin(t); + }, + stateStackSize: function () { + return this.conditionStack.length; + }, + options: { "case-insensitive": !0 }, + performAction: function (t, i, n, e) { + switch (n) { + case 0: + return 4; + case 1: + return 9; + case 2: + return "space"; + case 3: + return 10; + case 4: + return 6; + case 5: + return "TXT"; + } + }, + rules: [/^(?:info\b)/i, /^(?:[\s\n\r]+)/i, /^(?:[\s]+)/i, /^(?:showInfo\b)/i, /^(?:$)/i, /^(?:.)/i], + conditions: { INITIAL: { rules: [0, 1, 2, 3, 4, 5], inclusive: !0 } }, + }; + function s() { + this.yy = {}; + } + return (n.lexer = e), (s.prototype = n), (n.Parser = s), new s(); + })()); + s.parser = s; + let r = false; + const h = { + parser: s, + db: { + clear: () => { + r = false; + }, + setInfo: (t) => { + r = t; + }, + getInfo: () => r, + }, + renderer: { + draw: (t, i, n) => { + e.l.debug("rendering info diagram\n" + t); + const s = (0, e.B)(i); + (0, e.i)(s, 100, 400, !0), + s + .append("g") + .append("text") + .attr("x", 100) + .attr("y", 40) + .attr("class", "version") + .attr("font-size", 32) + .style("text-anchor", "middle") + .text(`v${n}`); + }, + }, + }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/438-760c9ed3.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/438-760c9ed3.chunk.min.js new file mode 100644 index 000000000..a48cfa3f1 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/438-760c9ed3.chunk.min.js @@ -0,0 +1,1149 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [438], + { + 2438: function (t, e, n) { + n.d(e, { + diagram: function () { + return A; + }, + }); + var i = n(9339), + r = n(7274), + s = n(8252), + a = + (n(7484), + n(7967), + n(7856), + (function () { + var t = function (t, e, n, i) { + for (n = n || {}, i = t.length; i--; n[t[i]] = e); + return n; + }, + e = [1, 2], + n = [1, 5], + i = [6, 9, 11, 17, 18, 20, 22, 23, 24, 26], + r = [1, 15], + s = [1, 16], + a = [1, 17], + o = [1, 18], + c = [1, 19], + l = [1, 20], + h = [1, 24], + u = [4, 6, 9, 11, 17, 18, 20, 22, 23, 24, 26], + y = { + trace: function () {}, + yy: {}, + symbols_: { + error: 2, + start: 3, + journey: 4, + document: 5, + EOF: 6, + directive: 7, + line: 8, + SPACE: 9, + statement: 10, + NEWLINE: 11, + openDirective: 12, + typeDirective: 13, + closeDirective: 14, + ":": 15, + argDirective: 16, + title: 17, + acc_title: 18, + acc_title_value: 19, + acc_descr: 20, + acc_descr_value: 21, + acc_descr_multiline_value: 22, + section: 23, + taskName: 24, + taskData: 25, + open_directive: 26, + type_directive: 27, + arg_directive: 28, + close_directive: 29, + $accept: 0, + $end: 1, + }, + terminals_: { + 2: "error", + 4: "journey", + 6: "EOF", + 9: "SPACE", + 11: "NEWLINE", + 15: ":", + 17: "title", + 18: "acc_title", + 19: "acc_title_value", + 20: "acc_descr", + 21: "acc_descr_value", + 22: "acc_descr_multiline_value", + 23: "section", + 24: "taskName", + 25: "taskData", + 26: "open_directive", + 27: "type_directive", + 28: "arg_directive", + 29: "close_directive", + }, + productions_: [ + 0, + [3, 3], + [3, 2], + [5, 0], + [5, 2], + [8, 2], + [8, 1], + [8, 1], + [8, 1], + [7, 4], + [7, 6], + [10, 1], + [10, 2], + [10, 2], + [10, 1], + [10, 1], + [10, 2], + [10, 1], + [12, 1], + [13, 1], + [16, 1], + [14, 1], + ], + performAction: function (t, e, n, i, r, s, a) { + var o = s.length - 1; + switch (r) { + case 1: + return s[o - 1]; + case 3: + case 7: + case 8: + this.$ = []; + break; + case 4: + s[o - 1].push(s[o]), (this.$ = s[o - 1]); + break; + case 5: + case 6: + this.$ = s[o]; + break; + case 11: + i.setDiagramTitle(s[o].substr(6)), (this.$ = s[o].substr(6)); + break; + case 12: + (this.$ = s[o].trim()), i.setAccTitle(this.$); + break; + case 13: + case 14: + (this.$ = s[o].trim()), i.setAccDescription(this.$); + break; + case 15: + i.addSection(s[o].substr(8)), (this.$ = s[o].substr(8)); + break; + case 16: + i.addTask(s[o - 1], s[o]), (this.$ = "task"); + break; + case 18: + i.parseDirective("%%{", "open_directive"); + break; + case 19: + i.parseDirective(s[o], "type_directive"); + break; + case 20: + (s[o] = s[o].trim().replace(/'/g, '"')), i.parseDirective(s[o], "arg_directive"); + break; + case 21: + i.parseDirective("}%%", "close_directive", "journey"); + } + }, + table: [ + { 3: 1, 4: e, 7: 3, 12: 4, 26: n }, + { 1: [3] }, + t(i, [2, 3], { 5: 6 }), + { 3: 7, 4: e, 7: 3, 12: 4, 26: n }, + { 13: 8, 27: [1, 9] }, + { 27: [2, 18] }, + { + 6: [1, 10], + 7: 21, + 8: 11, + 9: [1, 12], + 10: 13, + 11: [1, 14], + 12: 4, + 17: r, + 18: s, + 20: a, + 22: o, + 23: c, + 24: l, + 26: n, + }, + { 1: [2, 2] }, + { 14: 22, 15: [1, 23], 29: h }, + t([15, 29], [2, 19]), + t(i, [2, 8], { 1: [2, 1] }), + t(i, [2, 4]), + { 7: 21, 10: 25, 12: 4, 17: r, 18: s, 20: a, 22: o, 23: c, 24: l, 26: n }, + t(i, [2, 6]), + t(i, [2, 7]), + t(i, [2, 11]), + { 19: [1, 26] }, + { 21: [1, 27] }, + t(i, [2, 14]), + t(i, [2, 15]), + { 25: [1, 28] }, + t(i, [2, 17]), + { 11: [1, 29] }, + { 16: 30, 28: [1, 31] }, + { 11: [2, 21] }, + t(i, [2, 5]), + t(i, [2, 12]), + t(i, [2, 13]), + t(i, [2, 16]), + t(u, [2, 9]), + { 14: 32, 29: h }, + { 29: [2, 20] }, + { 11: [1, 33] }, + t(u, [2, 10]), + ], + defaultActions: { 5: [2, 18], 7: [2, 2], 24: [2, 21], 31: [2, 20] }, + parseError: function (t, e) { + if (!e.recoverable) { + var n = new Error(t); + throw ((n.hash = e), n); + } + this.trace(t); + }, + parse: function (t) { + var e = [0], + n = [], + i = [null], + r = [], + s = this.table, + a = "", + o = 0, + c = 0, + l = r.slice.call(arguments, 1), + h = Object.create(this.lexer), + u = { yy: {} }; + for (var y in this.yy) Object.prototype.hasOwnProperty.call(this.yy, y) && (u.yy[y] = this.yy[y]); + h.setInput(t, u.yy), (u.yy.lexer = h), (u.yy.parser = this), void 0 === h.yylloc && (h.yylloc = {}); + var p = h.yylloc; + r.push(p); + var d = h.options && h.options.ranges; + "function" == typeof u.yy.parseError + ? (this.parseError = u.yy.parseError) + : (this.parseError = Object.getPrototypeOf(this).parseError); + for (var f, g, x, m, k, _, b, v, $, w = {}; ; ) { + if ( + ((g = e[e.length - 1]), + this.defaultActions[g] + ? (x = this.defaultActions[g]) + : (null == f && + (($ = void 0), + "number" != typeof ($ = n.pop() || h.lex() || 1) && + ($ instanceof Array && ($ = (n = $).pop()), ($ = this.symbols_[$] || $)), + (f = $)), + (x = s[g] && s[g][f])), + void 0 === x || !x.length || !x[0]) + ) { + var M; + for (k in ((v = []), s[g])) this.terminals_[k] && k > 2 && v.push("'" + this.terminals_[k] + "'"); + (M = h.showPosition + ? "Parse error on line " + + (o + 1) + + ":\n" + + h.showPosition() + + "\nExpecting " + + v.join(", ") + + ", got '" + + (this.terminals_[f] || f) + + "'" + : "Parse error on line " + (o + 1) + ": Unexpected " + (1 == f ? "end of input" : "'" + (this.terminals_[f] || f) + "'")), + this.parseError(M, { + text: h.match, + token: this.terminals_[f] || f, + line: h.yylineno, + loc: p, + expected: v, + }); + } + if (x[0] instanceof Array && x.length > 1) + throw new Error("Parse Error: multiple actions possible at state: " + g + ", token: " + f); + switch (x[0]) { + case 1: + e.push(f), + i.push(h.yytext), + r.push(h.yylloc), + e.push(x[1]), + (f = null), + (c = h.yyleng), + (a = h.yytext), + (o = h.yylineno), + (p = h.yylloc); + break; + case 2: + if ( + ((_ = this.productions_[x[1]][1]), + (w.$ = i[i.length - _]), + (w._$ = { + first_line: r[r.length - (_ || 1)].first_line, + last_line: r[r.length - 1].last_line, + first_column: r[r.length - (_ || 1)].first_column, + last_column: r[r.length - 1].last_column, + }), + d && (w._$.range = [r[r.length - (_ || 1)].range[0], r[r.length - 1].range[1]]), + void 0 !== (m = this.performAction.apply(w, [a, c, o, u.yy, x[1], i, r].concat(l)))) + ) + return m; + _ && ((e = e.slice(0, -1 * _ * 2)), (i = i.slice(0, -1 * _)), (r = r.slice(0, -1 * _))), + e.push(this.productions_[x[1]][0]), + i.push(w.$), + r.push(w._$), + (b = s[e[e.length - 2]][e[e.length - 1]]), + e.push(b); + break; + case 3: + return !0; + } + } + return !0; + }, + }, + p = { + EOF: 1, + parseError: function (t, e) { + if (!this.yy.parser) throw new Error(t); + this.yy.parser.parseError(t, e); + }, + setInput: function (t, e) { + return ( + (this.yy = e || this.yy || {}), + (this._input = t), + (this._more = this._backtrack = this.done = !1), + (this.yylineno = this.yyleng = 0), + (this.yytext = this.matched = this.match = ""), + (this.conditionStack = ["INITIAL"]), + (this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0, + }), + this.options.ranges && (this.yylloc.range = [0, 0]), + (this.offset = 0), + this + ); + }, + input: function () { + var t = this._input[0]; + return ( + (this.yytext += t), + this.yyleng++, + this.offset++, + (this.match += t), + (this.matched += t), + t.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, + this.options.ranges && this.yylloc.range[1]++, + (this._input = this._input.slice(1)), + t + ); + }, + unput: function (t) { + var e = t.length, + n = t.split(/(?:\r\n?|\n)/g); + (this._input = t + this._input), (this.yytext = this.yytext.substr(0, this.yytext.length - e)), (this.offset -= e); + var i = this.match.split(/(?:\r\n?|\n)/g); + (this.match = this.match.substr(0, this.match.length - 1)), + (this.matched = this.matched.substr(0, this.matched.length - 1)), + n.length - 1 && (this.yylineno -= n.length - 1); + var r = this.yylloc.range; + return ( + (this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: n + ? (n.length === i.length ? this.yylloc.first_column : 0) + i[i.length - n.length].length - n[0].length + : this.yylloc.first_column - e, + }), + this.options.ranges && (this.yylloc.range = [r[0], r[0] + this.yyleng - e]), + (this.yyleng = this.yytext.length), + this + ); + }, + more: function () { + return (this._more = !0), this; + }, + reject: function () { + return this.options.backtrack_lexer + ? ((this._backtrack = !0), this) + : this.parseError( + "Lexical error on line " + + (this.yylineno + 1) + + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + + this.showPosition(), + { text: "", token: null, line: this.yylineno }, + ); + }, + less: function (t) { + this.unput(this.match.slice(t)); + }, + pastInput: function () { + var t = this.matched.substr(0, this.matched.length - this.match.length); + return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, ""); + }, + upcomingInput: function () { + var t = this.match; + return ( + t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "") + ); + }, + showPosition: function () { + var t = this.pastInput(), + e = new Array(t.length + 1).join("-"); + return t + this.upcomingInput() + "\n" + e + "^"; + }, + test_match: function (t, e) { + var n, i, r; + if ( + (this.options.backtrack_lexer && + ((r = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column, + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done, + }), + this.options.ranges && (r.yylloc.range = this.yylloc.range.slice(0))), + (i = t[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += i.length), + (this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: i ? i[i.length - 1].length - i[i.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length, + }), + (this.yytext += t[0]), + (this.match += t[0]), + (this.matches = t), + (this.yyleng = this.yytext.length), + this.options.ranges && (this.yylloc.range = [this.offset, (this.offset += this.yyleng)]), + (this._more = !1), + (this._backtrack = !1), + (this._input = this._input.slice(t[0].length)), + (this.matched += t[0]), + (n = this.performAction.call(this, this.yy, this, e, this.conditionStack[this.conditionStack.length - 1])), + this.done && this._input && (this.done = !1), + n) + ) + return n; + if (this._backtrack) { + for (var s in r) this[s] = r[s]; + return !1; + } + return !1; + }, + next: function () { + if (this.done) return this.EOF; + var t, e, n, i; + this._input || (this.done = !0), this._more || ((this.yytext = ""), (this.match = "")); + for (var r = this._currentRules(), s = 0; s < r.length; s++) + if ((n = this._input.match(this.rules[r[s]])) && (!e || n[0].length > e[0].length)) { + if (((e = n), (i = s), this.options.backtrack_lexer)) { + if (!1 !== (t = this.test_match(n, r[s]))) return t; + if (this._backtrack) { + e = !1; + continue; + } + return !1; + } + if (!this.options.flex) break; + } + return e + ? !1 !== (t = this.test_match(e, r[i])) && t + : "" === this._input + ? this.EOF + : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno, + }); + }, + lex: function () { + return this.next() || this.lex(); + }, + begin: function (t) { + this.conditionStack.push(t); + }, + popState: function () { + return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]; + }, + _currentRules: function () { + return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] + ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules + : this.conditions.INITIAL.rules; + }, + topState: function (t) { + return (t = this.conditionStack.length - 1 - Math.abs(t || 0)) >= 0 ? this.conditionStack[t] : "INITIAL"; + }, + pushState: function (t) { + this.begin(t); + }, + stateStackSize: function () { + return this.conditionStack.length; + }, + options: { "case-insensitive": !0 }, + performAction: function (t, e, n, i) { + switch (n) { + case 0: + return this.begin("open_directive"), 26; + case 1: + return this.begin("type_directive"), 27; + case 2: + return this.popState(), this.begin("arg_directive"), 15; + case 3: + return this.popState(), this.popState(), 29; + case 4: + return 28; + case 5: + case 6: + case 8: + case 9: + break; + case 7: + return 11; + case 10: + return 4; + case 11: + return 17; + case 12: + return this.begin("acc_title"), 18; + case 13: + return this.popState(), "acc_title_value"; + case 14: + return this.begin("acc_descr"), 20; + case 15: + return this.popState(), "acc_descr_value"; + case 16: + this.begin("acc_descr_multiline"); + break; + case 17: + this.popState(); + break; + case 18: + return "acc_descr_multiline_value"; + case 19: + return 23; + case 20: + return 24; + case 21: + return 25; + case 22: + return 15; + case 23: + return 6; + case 24: + return "INVALID"; + } + }, + rules: [ + /^(?:%%\{)/i, + /^(?:((?:(?!\}%%)[^:.])*))/i, + /^(?::)/i, + /^(?:\}%%)/i, + /^(?:((?:(?!\}%%).|\n)*))/i, + /^(?:%(?!\{)[^\n]*)/i, + /^(?:[^\}]%%[^\n]*)/i, + /^(?:[\n]+)/i, + /^(?:\s+)/i, + /^(?:#[^\n]*)/i, + /^(?:journey\b)/i, + /^(?:title\s[^#\n;]+)/i, + /^(?:accTitle\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*\{\s*)/i, + /^(?:[\}])/i, + /^(?:[^\}]*)/i, + /^(?:section\s[^#:\n;]+)/i, + /^(?:[^#:\n;]+)/i, + /^(?::[^#\n;]+)/i, + /^(?::)/i, + /^(?:$)/i, + /^(?:.)/i, + ], + conditions: { + open_directive: { rules: [1], inclusive: !1 }, + type_directive: { rules: [2, 3], inclusive: !1 }, + arg_directive: { rules: [3, 4], inclusive: !1 }, + acc_descr_multiline: { rules: [17, 18], inclusive: !1 }, + acc_descr: { rules: [15], inclusive: !1 }, + acc_title: { rules: [13], inclusive: !1 }, + INITIAL: { + rules: [0, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 19, 20, 21, 22, 23, 24], + inclusive: !0, + }, + }, + }; + function d() { + this.yy = {}; + } + return (y.lexer = p), (d.prototype = y), (y.Parser = d), new d(); + })()); + a.parser = a; + const o = a; + let c = ""; + const l = [], + h = [], + u = [], + y = function () { + let t = !0; + for (const [e, n] of u.entries()) u[e].processed, (t = t && n.processed); + return t; + }, + p = { + parseDirective: function (t, e, n) { + i.m.parseDirective(this, t, e, n); + }, + getConfig: () => (0, i.c)().journey, + clear: function () { + (l.length = 0), (h.length = 0), (c = ""), (u.length = 0), (0, i.v)(); + }, + setDiagramTitle: i.r, + getDiagramTitle: i.t, + setAccTitle: i.s, + getAccTitle: i.g, + setAccDescription: i.b, + getAccDescription: i.a, + addSection: function (t) { + (c = t), l.push(t); + }, + getSections: function () { + return l; + }, + getTasks: function () { + let t = y(), + e = 0; + for (; !t && e < 100; ) (t = y()), e++; + return h.push(...u), h; + }, + addTask: function (t, e) { + const n = e.substr(1).split(":"); + let i = 0, + r = []; + 1 === n.length ? ((i = Number(n[0])), (r = [])) : ((i = Number(n[0])), (r = n[1].split(","))); + const s = r.map((t) => t.trim()), + a = { section: c, type: c, people: s, task: t, score: i }; + u.push(a); + }, + addTaskOrg: function (t) { + const e = { section: c, type: c, description: t, task: t, classes: [] }; + h.push(e); + }, + getActors: function () { + return (function () { + const t = []; + return ( + h.forEach((e) => { + e.people && t.push(...e.people); + }), + [...new Set(t)].sort() + ); + })(); + }, + }, + d = function (t, e) { + return (0, s.d)(t, e); + }, + f = function (t, e) { + const n = t.append("circle"); + return ( + n.attr("cx", e.cx), + n.attr("cy", e.cy), + n.attr("class", "actor-" + e.pos), + n.attr("fill", e.fill), + n.attr("stroke", e.stroke), + n.attr("r", e.r), + void 0 !== n.class && n.attr("class", n.class), + void 0 !== e.title && n.append("title").text(e.title), + n + ); + }; + let g = -1; + const x = (function () { + function t(t, e, n, r, s, a, o, c) { + i( + e + .append("text") + .attr("x", n + s / 2) + .attr("y", r + a / 2 + 5) + .style("font-color", c) + .style("text-anchor", "middle") + .text(t), + o, + ); + } + function e(t, e, n, r, s, a, o, c, l) { + const { taskFontSize: h, taskFontFamily: u } = c, + y = t.split(//gi); + for (let t = 0; t < y.length; t++) { + const c = t * h - (h * (y.length - 1)) / 2, + p = e + .append("text") + .attr("x", n + s / 2) + .attr("y", r) + .attr("fill", l) + .style("text-anchor", "middle") + .style("font-size", h) + .style("font-family", u); + p + .append("tspan") + .attr("x", n + s / 2) + .attr("dy", c) + .text(y[t]), + p + .attr("y", r + a / 2) + .attr("dominant-baseline", "central") + .attr("alignment-baseline", "central"), + i(p, o); + } + } + function n(t, n, r, s, a, o, c, l) { + const h = n.append("switch"), + u = h + .append("foreignObject") + .attr("x", r) + .attr("y", s) + .attr("width", a) + .attr("height", o) + .attr("position", "fixed") + .append("xhtml:div") + .style("display", "table") + .style("height", "100%") + .style("width", "100%"); + u + .append("div") + .attr("class", "label") + .style("display", "table-cell") + .style("text-align", "center") + .style("vertical-align", "middle") + .text(t), + e(t, h, r, s, a, o, c, l), + i(u, c); + } + function i(t, e) { + for (const n in e) n in e && t.attr(n, e[n]); + } + return function (i) { + return "fo" === i.textPlacement ? n : "old" === i.textPlacement ? t : e; + }; + })(), + m = f, + k = function (t, e, n) { + const i = t.append("g"), + r = (0, s.g)(); + (r.x = e.x), + (r.y = e.y), + (r.fill = e.fill), + (r.width = n.width * e.taskCount + n.diagramMarginX * (e.taskCount - 1)), + (r.height = n.height), + (r.class = "journey-section section-type-" + e.num), + (r.rx = 3), + (r.ry = 3), + d(i, r), + x(n)(e.text, i, r.x, r.y, r.width, r.height, { class: "journey-section section-type-" + e.num }, n, e.colour); + }, + _ = function (t, e) { + return (0, s.f)(t, e); + }, + b = function (t, e, n) { + const i = e.x + n.width / 2, + a = t.append("g"); + g++, + a + .append("line") + .attr("id", "task" + g) + .attr("x1", i) + .attr("y1", e.y) + .attr("x2", i) + .attr("y2", 450) + .attr("class", "task-line") + .attr("stroke-width", "1px") + .attr("stroke-dasharray", "4 2") + .attr("stroke", "#666"), + (function (t, e) { + t.append("circle") + .attr("cx", e.cx) + .attr("cy", e.cy) + .attr("class", "face") + .attr("r", 15) + .attr("stroke-width", 2) + .attr("overflow", "visible"); + const n = t.append("g"); + n + .append("circle") + .attr("cx", e.cx - 5) + .attr("cy", e.cy - 5) + .attr("r", 1.5) + .attr("stroke-width", 2) + .attr("fill", "#666") + .attr("stroke", "#666"), + n + .append("circle") + .attr("cx", e.cx + 5) + .attr("cy", e.cy - 5) + .attr("r", 1.5) + .attr("stroke-width", 2) + .attr("fill", "#666") + .attr("stroke", "#666"), + e.score > 3 + ? (function (t) { + const n = (0, r.Nb1)() + .startAngle(Math.PI / 2) + .endAngle((Math.PI / 2) * 3) + .innerRadius(7.5) + .outerRadius(15 / 2.2); + t.append("path") + .attr("class", "mouth") + .attr("d", n) + .attr("transform", "translate(" + e.cx + "," + (e.cy + 2) + ")"); + })(n) + : e.score < 3 + ? (function (t) { + const n = (0, r.Nb1)() + .startAngle((3 * Math.PI) / 2) + .endAngle((Math.PI / 2) * 5) + .innerRadius(7.5) + .outerRadius(15 / 2.2); + t.append("path") + .attr("class", "mouth") + .attr("d", n) + .attr("transform", "translate(" + e.cx + "," + (e.cy + 7) + ")"); + })(n) + : n + .append("line") + .attr("class", "mouth") + .attr("stroke", 2) + .attr("x1", e.cx - 5) + .attr("y1", e.cy + 7) + .attr("x2", e.cx + 5) + .attr("y2", e.cy + 7) + .attr("class", "mouth") + .attr("stroke-width", "1px") + .attr("stroke", "#666"); + })(a, { cx: i, cy: 300 + 30 * (5 - e.score), score: e.score }); + const o = (0, s.g)(); + (o.x = e.x), + (o.y = e.y), + (o.fill = e.fill), + (o.width = n.width), + (o.height = n.height), + (o.class = "task task-type-" + e.num), + (o.rx = 3), + (o.ry = 3), + d(a, o); + let c = e.x + 14; + e.people.forEach((t) => { + const n = e.actors[t].color, + i = { + cx: c, + cy: e.y, + r: 7, + fill: n, + stroke: "#000", + title: t, + pos: e.actors[t].position, + }; + f(a, i), (c += 10); + }), + x(n)(e.task, a, o.x, o.y, o.width, o.height, { class: "task" }, n, e.colour); + }, + v = {}, + $ = (0, i.c)().journey, + w = $.leftMargin, + M = { + data: { startx: void 0, stopx: void 0, starty: void 0, stopy: void 0 }, + verticalPos: 0, + sequenceItems: [], + init: function () { + (this.sequenceItems = []), (this.data = { startx: void 0, stopx: void 0, starty: void 0, stopy: void 0 }), (this.verticalPos = 0); + }, + updateVal: function (t, e, n, i) { + void 0 === t[e] ? (t[e] = n) : (t[e] = i(n, t[e])); + }, + updateBounds: function (t, e, n, r) { + const s = (0, i.c)().journey, + a = this; + let o = 0; + this.sequenceItems.forEach(function (i) { + o++; + const c = a.sequenceItems.length - o + 1; + a.updateVal(i, "starty", e - c * s.boxMargin, Math.min), + a.updateVal(i, "stopy", r + c * s.boxMargin, Math.max), + a.updateVal(M.data, "startx", t - c * s.boxMargin, Math.min), + a.updateVal(M.data, "stopx", n + c * s.boxMargin, Math.max), + a.updateVal(i, "startx", t - c * s.boxMargin, Math.min), + a.updateVal(i, "stopx", n + c * s.boxMargin, Math.max), + a.updateVal(M.data, "starty", e - c * s.boxMargin, Math.min), + a.updateVal(M.data, "stopy", r + c * s.boxMargin, Math.max); + }); + }, + insert: function (t, e, n, i) { + const r = Math.min(t, n), + s = Math.max(t, n), + a = Math.min(e, i), + o = Math.max(e, i); + this.updateVal(M.data, "startx", r, Math.min), + this.updateVal(M.data, "starty", a, Math.min), + this.updateVal(M.data, "stopx", s, Math.max), + this.updateVal(M.data, "stopy", o, Math.max), + this.updateBounds(r, a, s, o); + }, + bumpVerticalPos: function (t) { + (this.verticalPos = this.verticalPos + t), (this.data.stopy = this.verticalPos); + }, + getVerticalPos: function () { + return this.verticalPos; + }, + getBounds: function () { + return this.data; + }, + }, + E = $.sectionFills, + S = $.sectionColours, + T = { + setConf: function (t) { + Object.keys(t).forEach(function (e) { + $[e] = t[e]; + }); + }, + draw: function (t, e, n, s) { + const a = (0, i.c)().journey, + o = (0, i.c)().securityLevel; + let c; + "sandbox" === o && (c = (0, r.Ys)("#i" + e)); + const l = "sandbox" === o ? (0, r.Ys)(c.nodes()[0].contentDocument.body) : (0, r.Ys)("body"); + M.init(); + const h = l.select("#" + e); + h.append("defs") + .append("marker") + .attr("id", "arrowhead") + .attr("refX", 5) + .attr("refY", 2) + .attr("markerWidth", 6) + .attr("markerHeight", 4) + .attr("orient", "auto") + .append("path") + .attr("d", "M 0,0 V 4 L6,2 Z"); + const u = s.db.getTasks(), + y = s.db.getDiagramTitle(), + p = s.db.getActors(); + for (const t in v) delete v[t]; + let d = 0; + p.forEach((t) => { + (v[t] = { color: a.actorColours[d % a.actorColours.length], position: d }), d++; + }), + (function (t) { + const e = (0, i.c)().journey; + let n = 60; + Object.keys(v).forEach((i) => { + const r = v[i].color, + s = { cx: 20, cy: n, r: 7, fill: r, stroke: "#000", pos: v[i].position }; + m(t, s); + const a = { + x: 40, + y: n + 7, + fill: "#666", + text: i, + textMargin: 5 | e.boxTextMargin, + }; + _(t, a), (n += 20); + }); + })(h), + M.insert(0, 0, w, 50 * Object.keys(v).length), + (function (t, e, n) { + const r = (0, i.c)().journey; + let s = ""; + const a = n + (2 * r.height + r.diagramMarginY); + let o = 0, + c = "#CCC", + l = "black", + h = 0; + for (const [n, i] of e.entries()) { + if (s !== i.section) { + (c = E[o % E.length]), (h = o % E.length), (l = S[o % S.length]); + let a = 0; + const u = i.section; + for (let t = n; t < e.length && e[t].section == u; t++) a += 1; + const y = { + x: n * r.taskMargin + n * r.width + w, + y: 50, + text: i.section, + fill: c, + num: h, + colour: l, + taskCount: a, + }; + k(t, y, r), (s = i.section), o++; + } + const u = i.people.reduce((t, e) => (v[e] && (t[e] = v[e]), t), {}); + (i.x = n * r.taskMargin + n * r.width + w), + (i.y = a), + (i.width = r.diagramMarginX), + (i.height = r.diagramMarginY), + (i.colour = l), + (i.fill = c), + (i.num = h), + (i.actors = u), + b(t, i, r), + M.insert(i.x, i.y, i.x + i.width + r.taskMargin, 450); + } + })(h, u, 0); + const f = M.getBounds(); + y && h.append("text").text(y).attr("x", w).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 25); + const g = f.stopy - f.starty + 2 * a.diagramMarginY, + x = w + f.stopx + 2 * a.diagramMarginX; + (0, i.i)(h, g, x, a.useMaxWidth), + h + .append("line") + .attr("x1", w) + .attr("y1", 4 * a.height) + .attr("x2", x - w - 4) + .attr("y2", 4 * a.height) + .attr("stroke-width", 4) + .attr("stroke", "black") + .attr("marker-end", "url(#arrowhead)"); + const $ = y ? 70 : 0; + h.attr("viewBox", `${f.startx} -25 ${x} ${g + $}`), h.attr("preserveAspectRatio", "xMinYMin meet"), h.attr("height", g + $ + 25); + }, + }, + A = { + parser: o, + db: p, + renderer: T, + styles: (t) => + `.label {\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n color: ${t.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${t.textColor}\n }\n\n .legend {\n fill: ${t.textColor};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${t.textColor}\n }\n\n .face {\n ${t.faceColor ? `fill: ${t.faceColor}` : "fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${t.fillType0 ? `fill: ${t.fillType0}` : ""};\n }\n .task-type-1, .section-type-1 {\n ${t.fillType0 ? `fill: ${t.fillType1}` : ""};\n }\n .task-type-2, .section-type-2 {\n ${t.fillType0 ? `fill: ${t.fillType2}` : ""};\n }\n .task-type-3, .section-type-3 {\n ${t.fillType0 ? `fill: ${t.fillType3}` : ""};\n }\n .task-type-4, .section-type-4 {\n ${t.fillType0 ? `fill: ${t.fillType4}` : ""};\n }\n .task-type-5, .section-type-5 {\n ${t.fillType0 ? `fill: ${t.fillType5}` : ""};\n }\n .task-type-6, .section-type-6 {\n ${t.fillType0 ? `fill: ${t.fillType6}` : ""};\n }\n .task-type-7, .section-type-7 {\n ${t.fillType0 ? `fill: ${t.fillType7}` : ""};\n }\n\n .actor-0 {\n ${t.actor0 ? `fill: ${t.actor0}` : ""};\n }\n .actor-1 {\n ${t.actor1 ? `fill: ${t.actor1}` : ""};\n }\n .actor-2 {\n ${t.actor2 ? `fill: ${t.actor2}` : ""};\n }\n .actor-3 {\n ${t.actor3 ? `fill: ${t.actor3}` : ""};\n }\n .actor-4 {\n ${t.actor4 ? `fill: ${t.actor4}` : ""};\n }\n .actor-5 {\n ${t.actor5 ? `fill: ${t.actor5}` : ""};\n }\n`, + init: (t) => { + T.setConf(t.journey), p.clear(); + }, + }; + }, + 8252: function (t, e, n) { + n.d(e, { + a: function () { + return a; + }, + b: function () { + return l; + }, + c: function () { + return c; + }, + d: function () { + return s; + }, + e: function () { + return u; + }, + f: function () { + return o; + }, + g: function () { + return h; + }, + }); + var i = n(7967), + r = n(9339); + const s = (t, e) => { + const n = t.append("rect"); + if ( + (n.attr("x", e.x), + n.attr("y", e.y), + n.attr("fill", e.fill), + n.attr("stroke", e.stroke), + n.attr("width", e.width), + n.attr("height", e.height), + void 0 !== e.rx && n.attr("rx", e.rx), + void 0 !== e.ry && n.attr("ry", e.ry), + void 0 !== e.attrs) + ) + for (const t in e.attrs) n.attr(t, e.attrs[t]); + return void 0 !== e.class && n.attr("class", e.class), n; + }, + a = (t, e) => { + const n = { + x: e.startx, + y: e.starty, + width: e.stopx - e.startx, + height: e.stopy - e.starty, + fill: e.fill, + stroke: e.stroke, + class: "rect", + }; + s(t, n).lower(); + }, + o = (t, e) => { + const n = e.text.replace(r.J, " "), + i = t.append("text"); + i.attr("x", e.x), + i.attr("y", e.y), + i.attr("class", "legend"), + i.style("text-anchor", e.anchor), + void 0 !== e.class && i.attr("class", e.class); + const s = i.append("tspan"); + return s.attr("x", e.x + 2 * e.textMargin), s.text(n), i; + }, + c = (t, e, n, r) => { + const s = t.append("image"); + s.attr("x", e), s.attr("y", n); + const a = (0, i.Nm)(r); + s.attr("xlink:href", a); + }, + l = (t, e, n, r) => { + const s = t.append("use"); + s.attr("x", e), s.attr("y", n); + const a = (0, i.Nm)(r); + s.attr("xlink:href", `#${a}`); + }, + h = () => ({ + x: 0, + y: 0, + width: 100, + height: 100, + fill: "#EDF2AE", + stroke: "#666", + anchor: "start", + rx: 0, + ry: 0, + }), + u = () => ({ + x: 0, + y: 0, + width: 100, + height: 100, + "text-anchor": "start", + style: "#666", + textMargin: 0, + rx: 0, + ry: 0, + tspan: !0, + }); + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/476-86e5cf96.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/476-86e5cf96.chunk.min.js new file mode 100644 index 000000000..133025f0f --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/476-86e5cf96.chunk.min.js @@ -0,0 +1,494 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [476], + { + 9368: function (e, t, n) { + n.d(t, { + c: function () { + return o; + }, + }); + var r = n(9360), + i = n(9103), + a = function (e) { + return (0, i.Z)(e, 4); + }, + d = n(3836); + function o(e) { + var t = { + options: { + directed: e.isDirected(), + multigraph: e.isMultigraph(), + compound: e.isCompound(), + }, + nodes: l(e), + edges: s(e), + }; + return r.Z(e.graph()) || (t.value = a(e.graph())), t; + } + function l(e) { + return d.Z(e.nodes(), function (t) { + var n = e.node(t), + i = e.parent(t), + a = { v: t }; + return r.Z(n) || (a.value = n), r.Z(i) || (a.parent = i), a; + }); + } + function s(e) { + return d.Z(e.edges(), function (t) { + var n = e.edge(t), + i = { v: t.v, w: t.w }; + return r.Z(t.name) || (i.name = t.name), r.Z(n) || (i.value = n), i; + }); + } + n(5351); + }, + 6476: function (e, t, n) { + n.d(t, { + r: function () { + return X; + }, + }); + var r = n(3771), + i = n(9368), + a = n(6076), + d = n(9339), + o = n(5625), + l = n(3506), + s = n(7274); + let c = {}, + h = {}, + g = {}; + const f = (e, t) => (d.l.trace("In isDecendant", t, " ", e, " = ", h[t].includes(e)), !!h[t].includes(e)), + u = (e, t, n, r) => { + d.l.warn("Copying children of ", e, "root", r, "data", t.node(e), r); + const i = t.children(e) || []; + e !== r && i.push(e), + d.l.warn("Copying (nodes) clusterId", e, "nodes", i), + i.forEach((i) => { + if (t.children(i).length > 0) u(i, t, n, r); + else { + const a = t.node(i); + d.l.info("cp ", i, " to ", r, " with parent ", e), + n.setNode(i, a), + r !== t.parent(i) && (d.l.warn("Setting parent", i, t.parent(i)), n.setParent(i, t.parent(i))), + e !== r && i !== e + ? (d.l.debug("Setting parent", i, e), n.setParent(i, e)) + : (d.l.info("In copy ", e, "root", r, "data", t.node(e), r), + d.l.debug("Not Setting parent for node=", i, "cluster!==rootId", e !== r, "node!==clusterId", i !== e)); + const o = t.edges(i); + d.l.debug("Copying Edges", o), + o.forEach((i) => { + d.l.info("Edge", i); + const a = t.edge(i.v, i.w, i.name); + d.l.info("Edge data", a, r); + try { + ((e, t) => ( + d.l.info("Decendants of ", t, " is ", h[t]), + d.l.info("Edge is ", e), + e.v !== t && + e.w !== t && + (h[t] + ? h[t].includes(e.v) || f(e.v, t) || f(e.w, t) || h[t].includes(e.w) + : (d.l.debug("Tilt, ", t, ",not in decendants"), !1)) + ))(i, r) + ? (d.l.info("Copying as ", i.v, i.w, a, i.name), + n.setEdge(i.v, i.w, a, i.name), + d.l.info("newGraph edges ", n.edges(), n.edge(n.edges()[0]))) + : d.l.info("Skipping copy of edge ", i.v, "--\x3e", i.w, " rootId: ", r, " clusterId:", e); + } catch (e) { + d.l.error(e); + } + }); + } + d.l.debug("Removing node", i), t.removeNode(i); + }); + }, + w = (e, t) => { + const n = t.children(e); + let r = [...n]; + for (const i of n) (g[i] = e), (r = [...r, ...w(i, t)]); + return r; + }, + p = (e, t) => { + d.l.trace("Searching", e); + const n = t.children(e); + if ((d.l.trace("Searching children of id ", e, n), n.length < 1)) return d.l.trace("This is a valid node", e), e; + for (const r of n) { + const n = p(r, t); + if (n) return d.l.trace("Found replacement for", e, " => ", n), n; + } + }, + v = (e) => (c[e] && c[e].externalConnections && c[e] ? c[e].id : e), + y = (e, t) => { + if ((d.l.warn("extractor - ", t, i.c(e), e.children("D")), t > 10)) return void d.l.error("Bailing out"); + let n = e.nodes(), + r = !1; + for (const t of n) { + const n = e.children(t); + r = r || n.length > 0; + } + if (r) { + d.l.debug("Nodes = ", n, t); + for (const r of n) + if ( + (d.l.debug("Extracting node", r, c, c[r] && !c[r].externalConnections, !e.parent(r), e.node(r), e.children("D"), " Depth ", t), c[r]) + ) + if (!c[r].externalConnections && e.children(r) && e.children(r).length > 0) { + d.l.warn("Cluster without external connections, without a parent and with children", r, t); + let n = "TB" === e.graph().rankdir ? "LR" : "TB"; + c[r] && c[r].clusterData && c[r].clusterData.dir && ((n = c[r].clusterData.dir), d.l.warn("Fixing dir", c[r].clusterData.dir, n)); + const a = new o.k({ multigraph: !0, compound: !0 }) + .setGraph({ rankdir: n, nodesep: 50, ranksep: 50, marginx: 8, marginy: 8 }) + .setDefaultEdgeLabel(function () { + return {}; + }); + d.l.warn("Old graph before copy", i.c(e)), + u(r, e, a, r), + e.setNode(r, { + clusterNode: !0, + id: r, + clusterData: c[r].clusterData, + labelText: c[r].labelText, + graph: a, + }), + d.l.warn("New graph after copy node: (", r, ")", i.c(a)), + d.l.debug("Old graph after copy", i.c(e)); + } else + d.l.warn( + "Cluster ** ", + r, + " **not meeting the criteria !externalConnections:", + !c[r].externalConnections, + " no parent: ", + !e.parent(r), + " children ", + e.children(r) && e.children(r).length > 0, + e.children("D"), + t, + ), + d.l.debug(c); + else d.l.debug("Not a cluster", r, t); + (n = e.nodes()), d.l.warn("New list of nodes", n); + for (const r of n) { + const n = e.node(r); + d.l.warn(" Now next level", r, n), n.clusterNode && y(n.graph, t + 1); + } + } else d.l.debug("Done, no node has children", e.nodes()); + }, + x = (e, t) => { + if (0 === t.length) return []; + let n = Object.assign(t); + return ( + t.forEach((t) => { + const r = e.children(t), + i = x(e, r); + n = [...n, ...i]; + }), + n + ); + }, + m = { + rect: (e, t) => { + d.l.info("Creating subgraph rect for ", t.id, t); + const n = e + .insert("g") + .attr("class", "cluster" + (t.class ? " " + t.class : "")) + .attr("id", t.id), + r = n.insert("rect", ":first-child"), + i = (0, d.n)((0, d.c)().flowchart.htmlLabels), + o = n.insert("g").attr("class", "cluster-label"), + c = + "markdown" === t.labelType + ? (0, l.c)(o, t.labelText, { style: t.labelStyle, useHtmlLabels: i }) + : o.node().appendChild((0, a.c)(t.labelText, t.labelStyle, void 0, !0)); + let h = c.getBBox(); + if ((0, d.n)((0, d.c)().flowchart.htmlLabels)) { + const e = c.children[0], + t = (0, s.Ys)(c); + (h = e.getBoundingClientRect()), t.attr("width", h.width), t.attr("height", h.height); + } + const g = 0 * t.padding, + f = g / 2, + u = t.width <= h.width + g ? h.width + g : t.width; + t.width <= h.width + g ? (t.diff = (h.width - t.width) / 2 - t.padding / 2) : (t.diff = -t.padding / 2), + d.l.trace("Data ", t, JSON.stringify(t)), + r + .attr("style", t.style) + .attr("rx", t.rx) + .attr("ry", t.ry) + .attr("x", t.x - u / 2) + .attr("y", t.y - t.height / 2 - f) + .attr("width", u) + .attr("height", t.height + g), + i + ? o.attr("transform", "translate(" + (t.x - h.width / 2) + ", " + (t.y - t.height / 2) + ")") + : o.attr("transform", "translate(" + t.x + ", " + (t.y - t.height / 2) + ")"); + const w = r.node().getBBox(); + return ( + (t.width = w.width), + (t.height = w.height), + (t.intersect = function (e) { + return (0, a.i)(t, e); + }), + n + ); + }, + roundedWithTitle: (e, t) => { + const n = e.insert("g").attr("class", t.classes).attr("id", t.id), + r = n.insert("rect", ":first-child"), + i = n.insert("g").attr("class", "cluster-label"), + o = n.append("rect"), + l = i.node().appendChild((0, a.c)(t.labelText, t.labelStyle, void 0, !0)); + let c = l.getBBox(); + if ((0, d.n)((0, d.c)().flowchart.htmlLabels)) { + const e = l.children[0], + t = (0, s.Ys)(l); + (c = e.getBoundingClientRect()), t.attr("width", c.width), t.attr("height", c.height); + } + c = l.getBBox(); + const h = 0 * t.padding, + g = h / 2, + f = t.width <= c.width + t.padding ? c.width + t.padding : t.width; + t.width <= c.width + t.padding ? (t.diff = (c.width + 0 * t.padding - t.width) / 2) : (t.diff = -t.padding / 2), + r + .attr("class", "outer") + .attr("x", t.x - f / 2 - g) + .attr("y", t.y - t.height / 2 - g) + .attr("width", f + h) + .attr("height", t.height + h), + o + .attr("class", "inner") + .attr("x", t.x - f / 2 - g) + .attr("y", t.y - t.height / 2 - g + c.height - 1) + .attr("width", f + h) + .attr("height", t.height + h - c.height - 3), + i.attr( + "transform", + "translate(" + + (t.x - c.width / 2) + + ", " + + (t.y - t.height / 2 - t.padding / 3 + ((0, d.n)((0, d.c)().flowchart.htmlLabels) ? 5 : 3)) + + ")", + ); + const u = r.node().getBBox(); + return ( + (t.height = u.height), + (t.intersect = function (e) { + return (0, a.i)(t, e); + }), + n + ); + }, + noteGroup: (e, t) => { + const n = e.insert("g").attr("class", "note-cluster").attr("id", t.id), + r = n.insert("rect", ":first-child"), + i = 0 * t.padding, + d = i / 2; + r.attr("rx", t.rx) + .attr("ry", t.ry) + .attr("x", t.x - t.width / 2 - d) + .attr("y", t.y - t.height / 2 - d) + .attr("width", t.width + i) + .attr("height", t.height + i) + .attr("fill", "none"); + const o = r.node().getBBox(); + return ( + (t.width = o.width), + (t.height = o.height), + (t.intersect = function (e) { + return (0, a.i)(t, e); + }), + n + ); + }, + divider: (e, t) => { + const n = e.insert("g").attr("class", t.classes).attr("id", t.id), + r = n.insert("rect", ":first-child"), + i = 0 * t.padding, + d = i / 2; + r.attr("class", "divider") + .attr("x", t.x - t.width / 2 - d) + .attr("y", t.y - t.height / 2) + .attr("width", t.width + i) + .attr("height", t.height + i); + const o = r.node().getBBox(); + return ( + (t.width = o.width), + (t.height = o.height), + (t.diff = -t.padding / 2), + (t.intersect = function (e) { + return (0, a.i)(t, e); + }), + n + ); + }, + }; + let b = {}; + const N = async (e, t, n, o) => { + d.l.info("Graph in recursive render: XXX", i.c(t), o); + const l = t.graph().rankdir; + d.l.trace("Dir in recursive render - dir:", l); + const s = e.insert("g").attr("class", "root"); + t.nodes() ? d.l.info("Recursive render XXX", t.nodes()) : d.l.info("No nodes found for", t), + t.edges().length > 0 && d.l.trace("Recursive edges", t.edge(t.edges()[0])); + const h = s.insert("g").attr("class", "clusters"), + g = s.insert("g").attr("class", "edgePaths"), + f = s.insert("g").attr("class", "edgeLabels"), + u = s.insert("g").attr("class", "nodes"); + await Promise.all( + t.nodes().map(async function (e) { + const r = t.node(e); + if (void 0 !== o) { + const n = JSON.parse(JSON.stringify(o.clusterData)); + d.l.info("Setting data for cluster XXX (", e, ") ", n, o), + t.setNode(o.id, n), + t.parent(e) || (d.l.trace("Setting parent", e, o.id), t.setParent(e, o.id, n)); + } + if ((d.l.info("(Insert) Node XXX" + e + ": " + JSON.stringify(t.node(e))), r && r.clusterNode)) { + d.l.info("Cluster identified", e, r.width, t.node(e)); + const i = await N(u, r.graph, n, t.node(e)), + o = i.elem; + (0, a.u)(r, o), + (r.diff = i.diff || 0), + d.l.info("Node bounds (abc123)", e, r, r.width, r.x, r.y), + (0, a.s)(o, r), + d.l.warn("Recursive render complete ", o, r); + } else + t.children(e).length > 0 + ? (d.l.info("Cluster - the non recursive path XXX", e, r.id, r, t), d.l.info(p(r.id, t)), (c[r.id] = { id: p(r.id, t), node: r })) + : (d.l.info("Node - the non recursive path", e, r.id, r), await (0, a.e)(u, t.node(e), l)); + }), + ), + t.edges().forEach(function (e) { + const n = t.edge(e.v, e.w, e.name); + d.l.info("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(e)), + d.l.info("Edge " + e.v + " -> " + e.w + ": ", e, " ", JSON.stringify(t.edge(e))), + d.l.info("Fix", c, "ids:", e.v, e.w, "Translateing: ", c[e.v], c[e.w]), + (0, a.f)(f, n); + }), + t.edges().forEach(function (e) { + d.l.info("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(e)); + }), + d.l.info("#############################################"), + d.l.info("### Layout ###"), + d.l.info("#############################################"), + d.l.info(t), + (0, r.bK)(t), + d.l.info("Graph after layout:", i.c(t)); + let w = 0; + return ( + ((e) => x(e, e.children()))(t).forEach(function (e) { + const n = t.node(e); + d.l.info("Position " + e + ": " + JSON.stringify(t.node(e))), + d.l.info("Position " + e + ": (" + n.x, "," + n.y, ") width: ", n.width, " height: ", n.height), + n && n.clusterNode + ? (0, a.p)(n) + : t.children(e).length > 0 + ? (((e, t) => { + d.l.trace("Inserting cluster"); + const n = t.shape || "rect"; + b[t.id] = m[n](e, t); + })(h, n), + (c[n.id].node = n)) + : (0, a.p)(n); + }), + t.edges().forEach(function (e) { + const r = t.edge(e); + d.l.info("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(r), r); + const i = (0, a.g)(g, e, r, c, n, t); + (0, a.h)(r, i); + }), + t.nodes().forEach(function (e) { + const n = t.node(e); + d.l.info(e, n.type, n.diff), "group" === n.type && (w = n.diff); + }), + { elem: s, diff: w } + ); + }, + X = async (e, t, n, r, o) => { + (0, a.a)(e, n, r, o), + (0, a.b)(), + (0, a.d)(), + (b = {}), + (h = {}), + (g = {}), + (c = {}), + d.l.warn("Graph at first:", i.c(t)), + ((e, t) => { + e + ? (d.l.debug("Opting in, graph "), + e.nodes().forEach(function (t) { + e.children(t).length > 0 && + (d.l.warn("Cluster identified", t, " Replacement id in edges: ", p(t, e)), + (h[t] = w(t, e)), + (c[t] = { id: p(t, e), clusterData: e.node(t) })); + }), + e.nodes().forEach(function (t) { + const n = e.children(t), + r = e.edges(); + n.length > 0 + ? (d.l.debug("Cluster identified", t, h), + r.forEach((e) => { + e.v !== t && + e.w !== t && + f(e.v, t) ^ f(e.w, t) && + (d.l.warn("Edge: ", e, " leaves cluster ", t), + d.l.warn("Decendants of XXX ", t, ": ", h[t]), + (c[t].externalConnections = !0)); + })) + : d.l.debug("Not a cluster ", t, h); + }), + e.edges().forEach(function (t) { + const n = e.edge(t); + d.l.warn("Edge " + t.v + " -> " + t.w + ": " + JSON.stringify(t)), + d.l.warn("Edge " + t.v + " -> " + t.w + ": " + JSON.stringify(e.edge(t))); + let r = t.v, + i = t.w; + if ((d.l.warn("Fix XXX", c, "ids:", t.v, t.w, "Translating: ", c[t.v], " --- ", c[t.w]), c[t.v] && c[t.w] && c[t.v] === c[t.w])) { + d.l.warn("Fixing and trixing link to self - removing XXX", t.v, t.w, t.name), + d.l.warn("Fixing and trixing - removing XXX", t.v, t.w, t.name), + (r = v(t.v)), + (i = v(t.w)), + e.removeEdge(t.v, t.w, t.name); + const a = t.w + "---" + t.v; + e.setNode(a, { + domId: a, + id: a, + labelStyle: "", + labelText: n.label, + padding: 0, + shape: "labelRect", + style: "", + }); + const o = JSON.parse(JSON.stringify(n)), + l = JSON.parse(JSON.stringify(n)); + (o.label = ""), + (o.arrowTypeEnd = "none"), + (l.label = ""), + (o.fromCluster = t.v), + (l.toCluster = t.v), + e.setEdge(r, a, o, t.name + "-cyclic-special"), + e.setEdge(a, i, l, t.name + "-cyclic-special"); + } else + (c[t.v] || c[t.w]) && + (d.l.warn("Fixing and trixing - removing XXX", t.v, t.w, t.name), + (r = v(t.v)), + (i = v(t.w)), + e.removeEdge(t.v, t.w, t.name), + r !== t.v && (n.fromCluster = t.v), + i !== t.w && (n.toCluster = t.w), + d.l.warn("Fix Replacing with XXX", r, i, t.name), + e.setEdge(r, i, n, t.name)); + }), + d.l.warn("Adjusted Graph", i.c(e)), + y(e, 0), + d.l.trace(c)) + : d.l.debug("Opting out, no graph "); + })(t), + d.l.warn("Graph after:", i.c(t)), + await N(e, t, r); + }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/506-6950d52c.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/506-6950d52c.chunk.min.js new file mode 100644 index 000000000..d0d6edf25 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/506-6950d52c.chunk.min.js @@ -0,0 +1,2919 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [506], + { + 3506: function (e, n, t) { + t.d(n, { + c: function () { + return on; + }, + }); + var r = {}; + t.r(r), + t.d(r, { + attentionMarkers: function () { + return Le; + }, + contentInitial: function () { + return Ce; + }, + disable: function () { + return Me; + }, + document: function () { + return we; + }, + flow: function () { + return ze; + }, + flowInitial: function () { + return Te; + }, + insideSpan: function () { + return _e; + }, + string: function () { + return De; + }, + text: function () { + return Be; + }, + }); + var i = t(9339); + const u = {}; + function o(e, n, t) { + if ( + (function (e) { + return Boolean(e && "object" == typeof e); + })(e) + ) { + if ("value" in e) return "html" !== e.type || t ? e.value : ""; + if (n && "alt" in e && e.alt) return e.alt; + if ("children" in e) return c(e.children, n, t); + } + return Array.isArray(e) ? c(e, n, t) : ""; + } + function c(e, n, t) { + const r = []; + let i = -1; + for (; ++i < e.length; ) r[i] = o(e[i], n, t); + return r.join(""); + } + function s(e, n, t, r) { + const i = e.length; + let u, + o = 0; + if (((n = n < 0 ? (-n > i ? 0 : i + n) : n > i ? i : n), (t = t > 0 ? t : 0), r.length < 1e4)) + (u = Array.from(r)), u.unshift(n, t), e.splice(...u); + else for (t && e.splice(n, t); o < r.length; ) (u = r.slice(o, o + 1e4)), u.unshift(n, 0), e.splice(...u), (o += 1e4), (n += 1e4); + } + function l(e, n) { + return e.length > 0 ? (s(e, e.length, 0, n), e) : n; + } + const a = {}.hasOwnProperty; + function f(e, n) { + let t; + for (t in n) { + const r = (a.call(e, t) ? e[t] : void 0) || (e[t] = {}), + i = n[t]; + let u; + if (i) + for (u in i) { + a.call(r, u) || (r[u] = []); + const e = i[u]; + d(r[u], Array.isArray(e) ? e : e ? [e] : []); + } + } + } + function d(e, n) { + let t = -1; + const r = []; + for (; ++t < n.length; ) ("after" === n[t].add ? e : r).push(n[t]); + s(e, 0, 0, r); + } + const h = A(/[A-Za-z]/), + p = A(/[\dA-Za-z]/), + m = A(/[#-'*+\--9=?A-Z^-~]/); + function g(e) { + return null !== e && (e < 32 || 127 === e); + } + const x = A(/\d/), + k = A(/[\dA-Fa-f]/), + y = A(/[!-/:-@[-`{-~]/); + function F(e) { + return null !== e && e < -2; + } + function b(e) { + return null !== e && (e < 0 || 32 === e); + } + function v(e) { + return -2 === e || -1 === e || 32 === e; + } + const S = A( + /[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/, + ), + E = A(/\s/); + function A(e) { + return function (n) { + return null !== n && e.test(String.fromCharCode(n)); + }; + } + function I(e, n, t, r) { + const i = r ? r - 1 : Number.POSITIVE_INFINITY; + let u = 0; + return function (r) { + return v(r) ? (e.enter(t), o(r)) : n(r); + }; + function o(r) { + return v(r) && u++ < i ? (e.consume(r), o) : (e.exit(t), n(r)); + } + } + const w = { + tokenize: function (e) { + const n = e.attempt( + this.parser.constructs.contentInitial, + function (t) { + if (null !== t) return e.enter("lineEnding"), e.consume(t), e.exit("lineEnding"), I(e, n, "linePrefix"); + e.consume(t); + }, + function (n) { + return e.enter("paragraph"), r(n); + }, + ); + let t; + return n; + function r(n) { + const r = e.enter("chunkText", { contentType: "text", previous: t }); + return t && (t.next = r), (t = r), i(n); + } + function i(n) { + return null === n + ? (e.exit("chunkText"), e.exit("paragraph"), void e.consume(n)) + : F(n) + ? (e.consume(n), e.exit("chunkText"), r) + : (e.consume(n), i); + } + }, + }, + C = { + tokenize: function (e) { + const n = this, + t = []; + let r, + i, + u, + o = 0; + return c; + function c(r) { + if (o < t.length) { + const i = t[o]; + return (n.containerState = i[1]), e.attempt(i[0].continuation, l, a)(r); + } + return a(r); + } + function l(e) { + if ((o++, n.containerState._closeFlow)) { + (n.containerState._closeFlow = void 0), r && y(); + const t = n.events.length; + let i, + u = t; + for (; u--; ) + if ("exit" === n.events[u][0] && "chunkFlow" === n.events[u][1].type) { + i = n.events[u][1].end; + break; + } + k(o); + let c = t; + for (; c < n.events.length; ) (n.events[c][1].end = Object.assign({}, i)), c++; + return s(n.events, u + 1, 0, n.events.slice(t)), (n.events.length = c), a(e); + } + return c(e); + } + function a(i) { + if (o === t.length) { + if (!r) return h(i); + if (r.currentConstruct && r.currentConstruct.concrete) return m(i); + n.interrupt = Boolean(r.currentConstruct && !r._gfmTableDynamicInterruptHack); + } + return (n.containerState = {}), e.check(T, f, d)(i); + } + function f(e) { + return r && y(), k(o), h(e); + } + function d(e) { + return (n.parser.lazy[n.now().line] = o !== t.length), (u = n.now().offset), m(e); + } + function h(t) { + return (n.containerState = {}), e.attempt(T, p, m)(t); + } + function p(e) { + return o++, t.push([n.currentConstruct, n.containerState]), h(e); + } + function m(t) { + return null === t + ? (r && y(), k(0), void e.consume(t)) + : ((r = r || n.parser.flow(n.now())), e.enter("chunkFlow", { contentType: "flow", previous: i, _tokenizer: r }), g(t)); + } + function g(t) { + return null === t + ? (x(e.exit("chunkFlow"), !0), k(0), void e.consume(t)) + : F(t) + ? (e.consume(t), x(e.exit("chunkFlow")), (o = 0), (n.interrupt = void 0), c) + : (e.consume(t), g); + } + function x(e, t) { + const c = n.sliceStream(e); + if ((t && c.push(null), (e.previous = i), i && (i.next = e), (i = e), r.defineSkip(e.start), r.write(c), n.parser.lazy[e.start.line])) { + let e = r.events.length; + for (; e--; ) if (r.events[e][1].start.offset < u && (!r.events[e][1].end || r.events[e][1].end.offset > u)) return; + const t = n.events.length; + let i, + c, + l = t; + for (; l--; ) + if ("exit" === n.events[l][0] && "chunkFlow" === n.events[l][1].type) { + if (i) { + c = n.events[l][1].end; + break; + } + i = !0; + } + for (k(o), e = t; e < n.events.length; ) (n.events[e][1].end = Object.assign({}, c)), e++; + s(n.events, l + 1, 0, n.events.slice(t)), (n.events.length = e); + } + } + function k(r) { + let i = t.length; + for (; i-- > r; ) { + const r = t[i]; + (n.containerState = r[1]), r[0].exit.call(n, e); + } + t.length = r; + } + function y() { + r.write([null]), (i = void 0), (r = void 0), (n.containerState._closeFlow = void 0); + } + }, + }, + T = { + tokenize: function (e, n, t) { + return I( + e, + e.attempt(this.parser.constructs.document, n, t), + "linePrefix", + this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4, + ); + }, + }, + z = { + tokenize: function (e, n, t) { + return function (n) { + return v(n) ? I(e, r, "linePrefix")(n) : r(n); + }; + function r(e) { + return null === e || F(e) ? n(e) : t(e); + } + }, + partial: !0, + }; + function D(e) { + const n = {}; + let t, + r, + i, + u, + o, + c, + l, + a = -1; + for (; ++a < e.length; ) { + for (; a in n; ) a = n[a]; + if ( + ((t = e[a]), + a && + "chunkFlow" === t[1].type && + "listItemPrefix" === e[a - 1][1].type && + ((c = t[1]._tokenizer.events), + (i = 0), + i < c.length && "lineEndingBlank" === c[i][1].type && (i += 2), + i < c.length && "content" === c[i][1].type)) + ) + for (; ++i < c.length && "content" !== c[i][1].type; ) "chunkText" === c[i][1].type && ((c[i][1]._isInFirstContentOfListItem = !0), i++); + if ("enter" === t[0]) t[1].contentType && (Object.assign(n, B(e, a)), (a = n[a]), (l = !0)); + else if (t[1]._container) { + for (i = a, r = void 0; i-- && ((u = e[i]), "lineEnding" === u[1].type || "lineEndingBlank" === u[1].type); ) + "enter" === u[0] && (r && (e[r][1].type = "lineEndingBlank"), (u[1].type = "lineEnding"), (r = i)); + r && ((t[1].end = Object.assign({}, e[r][1].start)), (o = e.slice(r, a)), o.unshift(t), s(e, r, a - r + 1, o)); + } + } + return !l; + } + function B(e, n) { + const t = e[n][1], + r = e[n][2]; + let i = n - 1; + const u = [], + o = t._tokenizer || r.parser[t.contentType](t.start), + c = o.events, + l = [], + a = {}; + let f, + d, + h = -1, + p = t, + m = 0, + g = 0; + const x = [g]; + for (; p; ) { + for (; e[++i][1] !== p; ); + u.push(i), + p._tokenizer || + ((f = r.sliceStream(p)), + p.next || f.push(null), + d && o.defineSkip(p.start), + p._isInFirstContentOfListItem && (o._gfmTasklistFirstContentOfListItem = !0), + o.write(f), + p._isInFirstContentOfListItem && (o._gfmTasklistFirstContentOfListItem = void 0)), + (d = p), + (p = p.next); + } + for (p = t; ++h < c.length; ) + "exit" === c[h][0] && + "enter" === c[h - 1][0] && + c[h][1].type === c[h - 1][1].type && + c[h][1].start.line !== c[h][1].end.line && + ((g = h + 1), x.push(g), (p._tokenizer = void 0), (p.previous = void 0), (p = p.next)); + for (o.events = [], p ? ((p._tokenizer = void 0), (p.previous = void 0)) : x.pop(), h = x.length; h--; ) { + const n = c.slice(x[h], x[h + 1]), + t = u.pop(); + l.unshift([t, t + n.length - 1]), s(e, t, 2, n); + } + for (h = -1; ++h < l.length; ) (a[m + l[h][0]] = m + l[h][1]), (m += l[h][1] - l[h][0] - 1); + return a; + } + const _ = { + tokenize: function (e, n) { + let t; + return function (n) { + return e.enter("content"), (t = e.enter("chunkContent", { contentType: "content" })), r(n); + }; + function r(n) { + return null === n ? i(n) : F(n) ? e.check(L, u, i)(n) : (e.consume(n), r); + } + function i(t) { + return e.exit("chunkContent"), e.exit("content"), n(t); + } + function u(n) { + return ( + e.consume(n), e.exit("chunkContent"), (t.next = e.enter("chunkContent", { contentType: "content", previous: t })), (t = t.next), r + ); + } + }, + resolve: function (e) { + return D(e), e; + }, + }, + L = { + tokenize: function (e, n, t) { + const r = this; + return function (n) { + return e.exit("chunkContent"), e.enter("lineEnding"), e.consume(n), e.exit("lineEnding"), I(e, i, "linePrefix"); + }; + function i(i) { + if (null === i || F(i)) return t(i); + const u = r.events[r.events.length - 1]; + return !r.parser.constructs.disable.null.includes("codeIndented") && + u && + "linePrefix" === u[1].type && + u[2].sliceSerialize(u[1], !0).length >= 4 + ? n(i) + : e.interrupt(r.parser.constructs.flow, t, n)(i); + } + }, + partial: !0, + }, + M = { + tokenize: function (e) { + const n = this, + t = e.attempt( + z, + function (r) { + if (null !== r) return e.enter("lineEndingBlank"), e.consume(r), e.exit("lineEndingBlank"), (n.currentConstruct = void 0), t; + e.consume(r); + }, + e.attempt(this.parser.constructs.flowInitial, r, I(e, e.attempt(this.parser.constructs.flow, r, e.attempt(_, r)), "linePrefix")), + ); + return t; + function r(r) { + if (null !== r) return e.enter("lineEnding"), e.consume(r), e.exit("lineEnding"), (n.currentConstruct = void 0), t; + e.consume(r); + } + }, + }, + P = { resolveAll: R() }, + O = H("string"), + j = H("text"); + function H(e) { + return { + tokenize: function (n) { + const t = this, + r = this.parser.constructs[e], + i = n.attempt(r, u, o); + return u; + function u(e) { + return s(e) ? i(e) : o(e); + } + function o(e) { + if (null !== e) return n.enter("data"), n.consume(e), c; + n.consume(e); + } + function c(e) { + return s(e) ? (n.exit("data"), i(e)) : (n.consume(e), c); + } + function s(e) { + if (null === e) return !0; + const n = r[e]; + let i = -1; + if (n) + for (; ++i < n.length; ) { + const e = n[i]; + if (!e.previous || e.previous.call(t, t.previous)) return !0; + } + return !1; + } + }, + resolveAll: R("text" === e ? q : void 0), + }; + } + function R(e) { + return function (n, t) { + let r, + i = -1; + for (; ++i <= n.length; ) + void 0 === r + ? n[i] && "data" === n[i][1].type && ((r = i), i++) + : (n[i] && "data" === n[i][1].type) || + (i !== r + 2 && ((n[r][1].end = n[i - 1][1].end), n.splice(r + 2, i - r - 2), (i = r + 2)), (r = void 0)); + return e ? e(n, t) : n; + }; + } + function q(e, n) { + let t = 0; + for (; ++t <= e.length; ) + if ((t === e.length || "lineEnding" === e[t][1].type) && "data" === e[t - 1][1].type) { + const r = e[t - 1][1], + i = n.sliceStream(r); + let u, + o = i.length, + c = -1, + s = 0; + for (; o--; ) { + const e = i[o]; + if ("string" == typeof e) { + for (c = e.length; 32 === e.charCodeAt(c - 1); ) s++, c--; + if (c) break; + c = -1; + } else if (-2 === e) (u = !0), s++; + else if (-1 !== e) { + o++; + break; + } + } + if (s) { + const i = { + type: t === e.length || u || s < 2 ? "lineSuffix" : "hardBreakTrailing", + start: { + line: r.end.line, + column: r.end.column - s, + offset: r.end.offset - s, + _index: r.start._index + o, + _bufferIndex: o ? c : r.start._bufferIndex + c, + }, + end: Object.assign({}, r.end), + }; + (r.end = Object.assign({}, i.start)), + r.start.offset === r.end.offset ? Object.assign(r, i) : (e.splice(t, 0, ["enter", i, n], ["exit", i, n]), (t += 2)); + } + t++; + } + return e; + } + function V(e, n, t) { + const r = []; + let i = -1; + for (; ++i < e.length; ) { + const u = e[i].resolveAll; + u && !r.includes(u) && ((n = u(n, t)), r.push(u)); + } + return n; + } + function Q(e, n, t) { + let r = Object.assign(t ? Object.assign({}, t) : { line: 1, column: 1, offset: 0 }, { + _index: 0, + _bufferIndex: -1, + }); + const i = {}, + u = []; + let o = [], + c = [], + a = !0; + const f = { + consume: function (e) { + F(e) ? (r.line++, (r.column = 1), (r.offset += -3 === e ? 2 : 1), v()) : -1 !== e && (r.column++, r.offset++), + r._bufferIndex < 0 ? r._index++ : (r._bufferIndex++, r._bufferIndex === o[r._index].length && ((r._bufferIndex = -1), r._index++)), + (d.previous = e), + (a = !0); + }, + enter: function (e, n) { + const t = n || {}; + return (t.type = e), (t.start = g()), d.events.push(["enter", t, d]), c.push(t), t; + }, + exit: function (e) { + const n = c.pop(); + return (n.end = g()), d.events.push(["exit", n, d]), n; + }, + attempt: y(function (e, n) { + b(e, n.from); + }), + check: y(k), + interrupt: y(k, { interrupt: !0 }), + }, + d = { + previous: null, + code: null, + containerState: {}, + events: [], + parser: e, + sliceStream: m, + sliceSerialize: function (e, n) { + return (function (e, n) { + let t = -1; + const r = []; + let i; + for (; ++t < e.length; ) { + const u = e[t]; + let o; + if ("string" == typeof u) o = u; + else + switch (u) { + case -5: + o = "\r"; + break; + case -4: + o = "\n"; + break; + case -3: + o = "\r\n"; + break; + case -2: + o = n ? " " : "\t"; + break; + case -1: + if (!n && i) continue; + o = " "; + break; + default: + o = String.fromCharCode(u); + } + (i = -2 === u), r.push(o); + } + return r.join(""); + })(m(e), n); + }, + now: g, + defineSkip: function (e) { + (i[e.line] = e.column), v(); + }, + write: function (e) { + return ( + (o = l(o, e)), + (function () { + let e; + for (; r._index < o.length; ) { + const n = o[r._index]; + if ("string" == typeof n) + for (e = r._index, r._bufferIndex < 0 && (r._bufferIndex = 0); r._index === e && r._bufferIndex < n.length; ) + x(n.charCodeAt(r._bufferIndex)); + else x(n); + } + })(), + null !== o[o.length - 1] ? [] : (b(n, 0), (d.events = V(u, d.events, d)), d.events) + ); + }, + }; + let h, + p = n.tokenize.call(d, f); + return n.resolveAll && u.push(n), d; + function m(e) { + return (function (e, n) { + const t = n.start._index, + r = n.start._bufferIndex, + i = n.end._index, + u = n.end._bufferIndex; + let o; + if (t === i) o = [e[t].slice(r, u)]; + else { + if (((o = e.slice(t, i)), r > -1)) { + const e = o[0]; + "string" == typeof e ? (o[0] = e.slice(r)) : o.shift(); + } + u > 0 && o.push(e[i].slice(0, u)); + } + return o; + })(o, e); + } + function g() { + const { line: e, column: n, offset: t, _index: i, _bufferIndex: u } = r; + return { line: e, column: n, offset: t, _index: i, _bufferIndex: u }; + } + function x(e) { + (a = void 0), (h = e), (p = p(e)); + } + function k(e, n) { + n.restore(); + } + function y(e, n) { + return function (t, i, u) { + let o, s, l, h; + return Array.isArray(t) + ? m(t) + : "tokenize" in t + ? m([t]) + : ((p = t), + function (e) { + const n = null !== e && p[e], + t = null !== e && p.null; + return m([...(Array.isArray(n) ? n : n ? [n] : []), ...(Array.isArray(t) ? t : t ? [t] : [])])(e); + }); + var p; + function m(e) { + return (o = e), (s = 0), 0 === e.length ? u : x(e[s]); + } + function x(e) { + return function (t) { + return ( + (h = (function () { + const e = g(), + n = d.previous, + t = d.currentConstruct, + i = d.events.length, + u = Array.from(c); + return { + restore: function () { + (r = e), (d.previous = n), (d.currentConstruct = t), (d.events.length = i), (c = u), v(); + }, + from: i, + }; + })()), + (l = e), + e.partial || (d.currentConstruct = e), + e.name && d.parser.constructs.disable.null.includes(e.name) + ? y() + : e.tokenize.call(n ? Object.assign(Object.create(d), n) : d, f, k, y)(t) + ); + }; + } + function k(n) { + return (a = !0), e(l, h), i; + } + function y(e) { + return (a = !0), h.restore(), ++s < o.length ? x(o[s]) : u; + } + }; + } + function b(e, n) { + e.resolveAll && !u.includes(e) && u.push(e), + e.resolve && s(d.events, n, d.events.length - n, e.resolve(d.events.slice(n), d)), + e.resolveTo && (d.events = e.resolveTo(d.events, d)); + } + function v() { + r.line in i && r.column < 2 && ((r.column = i[r.line]), (r.offset += i[r.line] - 1)); + } + } + const N = { + name: "thematicBreak", + tokenize: function (e, n, t) { + let r, + i = 0; + return function (n) { + return ( + e.enter("thematicBreak"), + (function (e) { + return (r = e), u(e); + })(n) + ); + }; + function u(u) { + return u === r ? (e.enter("thematicBreakSequence"), o(u)) : i >= 3 && (null === u || F(u)) ? (e.exit("thematicBreak"), n(u)) : t(u); + } + function o(n) { + return n === r ? (e.consume(n), i++, o) : (e.exit("thematicBreakSequence"), v(n) ? I(e, u, "whitespace")(n) : u(n)); + } + }, + }, + U = { + name: "list", + tokenize: function (e, n, t) { + const r = this, + i = r.events[r.events.length - 1]; + let u = i && "linePrefix" === i[1].type ? i[2].sliceSerialize(i[1], !0).length : 0, + o = 0; + return function (n) { + const i = r.containerState.type || (42 === n || 43 === n || 45 === n ? "listUnordered" : "listOrdered"); + if ("listUnordered" === i ? !r.containerState.marker || n === r.containerState.marker : x(n)) { + if ((r.containerState.type || ((r.containerState.type = i), e.enter(i, { _container: !0 })), "listUnordered" === i)) + return e.enter("listItemPrefix"), 42 === n || 45 === n ? e.check(N, t, s)(n) : s(n); + if (!r.interrupt || 49 === n) return e.enter("listItemPrefix"), e.enter("listItemValue"), c(n); + } + return t(n); + }; + function c(n) { + return x(n) && ++o < 10 + ? (e.consume(n), c) + : (!r.interrupt || o < 2) && (r.containerState.marker ? n === r.containerState.marker : 41 === n || 46 === n) + ? (e.exit("listItemValue"), s(n)) + : t(n); + } + function s(n) { + return ( + e.enter("listItemMarker"), + e.consume(n), + e.exit("listItemMarker"), + (r.containerState.marker = r.containerState.marker || n), + e.check(z, r.interrupt ? t : l, e.attempt($, f, a)) + ); + } + function l(e) { + return (r.containerState.initialBlankLine = !0), u++, f(e); + } + function a(n) { + return v(n) ? (e.enter("listItemPrefixWhitespace"), e.consume(n), e.exit("listItemPrefixWhitespace"), f) : t(n); + } + function f(t) { + return (r.containerState.size = u + r.sliceSerialize(e.exit("listItemPrefix"), !0).length), n(t); + } + }, + continuation: { + tokenize: function (e, n, t) { + const r = this; + return ( + (r.containerState._closeFlow = void 0), + e.check( + z, + function (t) { + return ( + (r.containerState.furtherBlankLines = r.containerState.furtherBlankLines || r.containerState.initialBlankLine), + I(e, n, "listItemIndent", r.containerState.size + 1)(t) + ); + }, + function (t) { + return r.containerState.furtherBlankLines || !v(t) + ? ((r.containerState.furtherBlankLines = void 0), (r.containerState.initialBlankLine = void 0), i(t)) + : ((r.containerState.furtherBlankLines = void 0), (r.containerState.initialBlankLine = void 0), e.attempt(W, n, i)(t)); + }, + ) + ); + function i(i) { + return ( + (r.containerState._closeFlow = !0), + (r.interrupt = void 0), + I(e, e.attempt(U, n, t), "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(i) + ); + } + }, + }, + exit: function (e) { + e.exit(this.containerState.type); + }, + }, + $ = { + tokenize: function (e, n, t) { + const r = this; + return I( + e, + function (e) { + const i = r.events[r.events.length - 1]; + return !v(e) && i && "listItemPrefixWhitespace" === i[1].type ? n(e) : t(e); + }, + "listItemPrefixWhitespace", + r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 5, + ); + }, + partial: !0, + }, + W = { + tokenize: function (e, n, t) { + const r = this; + return I( + e, + function (e) { + const i = r.events[r.events.length - 1]; + return i && "listItemIndent" === i[1].type && i[2].sliceSerialize(i[1], !0).length === r.containerState.size ? n(e) : t(e); + }, + "listItemIndent", + r.containerState.size + 1, + ); + }, + partial: !0, + }, + Z = { + name: "blockQuote", + tokenize: function (e, n, t) { + const r = this; + return function (n) { + if (62 === n) { + const t = r.containerState; + return ( + t.open || (e.enter("blockQuote", { _container: !0 }), (t.open = !0)), + e.enter("blockQuotePrefix"), + e.enter("blockQuoteMarker"), + e.consume(n), + e.exit("blockQuoteMarker"), + i + ); + } + return t(n); + }; + function i(t) { + return v(t) + ? (e.enter("blockQuotePrefixWhitespace"), e.consume(t), e.exit("blockQuotePrefixWhitespace"), e.exit("blockQuotePrefix"), n) + : (e.exit("blockQuotePrefix"), n(t)); + } + }, + continuation: { + tokenize: function (e, n, t) { + const r = this; + return function (n) { + return v(n) ? I(e, i, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(n) : i(n); + }; + function i(r) { + return e.attempt(Z, n, t)(r); + } + }, + }, + exit: function (e) { + e.exit("blockQuote"); + }, + }; + function Y(e, n, t, r, i, u, o, c, s) { + const l = s || Number.POSITIVE_INFINITY; + let a = 0; + return function (n) { + return 60 === n + ? (e.enter(r), e.enter(i), e.enter(u), e.consume(n), e.exit(u), f) + : null === n || 32 === n || 41 === n || g(n) + ? t(n) + : (e.enter(r), e.enter(o), e.enter(c), e.enter("chunkString", { contentType: "string" }), p(n)); + }; + function f(t) { + return 62 === t + ? (e.enter(u), e.consume(t), e.exit(u), e.exit(i), e.exit(r), n) + : (e.enter(c), e.enter("chunkString", { contentType: "string" }), d(t)); + } + function d(n) { + return 62 === n ? (e.exit("chunkString"), e.exit(c), f(n)) : null === n || 60 === n || F(n) ? t(n) : (e.consume(n), 92 === n ? h : d); + } + function h(n) { + return 60 === n || 62 === n || 92 === n ? (e.consume(n), d) : d(n); + } + function p(i) { + return a || (null !== i && 41 !== i && !b(i)) + ? a < l && 40 === i + ? (e.consume(i), a++, p) + : 41 === i + ? (e.consume(i), a--, p) + : null === i || 32 === i || 40 === i || g(i) + ? t(i) + : (e.consume(i), 92 === i ? m : p) + : (e.exit("chunkString"), e.exit(c), e.exit(o), e.exit(r), n(i)); + } + function m(n) { + return 40 === n || 41 === n || 92 === n ? (e.consume(n), p) : p(n); + } + } + function G(e, n, t, r, i, u) { + const o = this; + let c, + s = 0; + return function (n) { + return e.enter(r), e.enter(i), e.consume(n), e.exit(i), e.enter(u), l; + }; + function l(f) { + return s > 999 || null === f || 91 === f || (93 === f && !c) || (94 === f && !s && "_hiddenFootnoteSupport" in o.parser.constructs) + ? t(f) + : 93 === f + ? (e.exit(u), e.enter(i), e.consume(f), e.exit(i), e.exit(r), n) + : F(f) + ? (e.enter("lineEnding"), e.consume(f), e.exit("lineEnding"), l) + : (e.enter("chunkString", { contentType: "string" }), a(f)); + } + function a(n) { + return null === n || 91 === n || 93 === n || F(n) || s++ > 999 + ? (e.exit("chunkString"), l(n)) + : (e.consume(n), c || (c = !v(n)), 92 === n ? f : a); + } + function f(n) { + return 91 === n || 92 === n || 93 === n ? (e.consume(n), s++, a) : a(n); + } + } + function J(e, n, t, r, i, u) { + let o; + return function (n) { + return 34 === n || 39 === n || 40 === n ? (e.enter(r), e.enter(i), e.consume(n), e.exit(i), (o = 40 === n ? 41 : n), c) : t(n); + }; + function c(t) { + return t === o ? (e.enter(i), e.consume(t), e.exit(i), e.exit(r), n) : (e.enter(u), s(t)); + } + function s(n) { + return n === o + ? (e.exit(u), c(o)) + : null === n + ? t(n) + : F(n) + ? (e.enter("lineEnding"), e.consume(n), e.exit("lineEnding"), I(e, s, "linePrefix")) + : (e.enter("chunkString", { contentType: "string" }), l(n)); + } + function l(n) { + return n === o || null === n || F(n) ? (e.exit("chunkString"), s(n)) : (e.consume(n), 92 === n ? a : l); + } + function a(n) { + return n === o || 92 === n ? (e.consume(n), l) : l(n); + } + } + function K(e, n) { + let t; + return function r(i) { + return F(i) + ? (e.enter("lineEnding"), e.consume(i), e.exit("lineEnding"), (t = !0), r) + : v(i) + ? I(e, r, t ? "linePrefix" : "lineSuffix")(i) + : n(i); + }; + } + function X(e) { + return e + .replace(/[\t\n\r ]+/g, " ") + .replace(/^ | $/g, "") + .toLowerCase() + .toUpperCase(); + } + const ee = { + name: "definition", + tokenize: function (e, n, t) { + const r = this; + let i; + return function (n) { + return ( + e.enter("definition"), + (function (n) { + return G.call(r, e, u, t, "definitionLabel", "definitionLabelMarker", "definitionLabelString")(n); + })(n) + ); + }; + function u(n) { + return ( + (i = X(r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1))), + 58 === n ? (e.enter("definitionMarker"), e.consume(n), e.exit("definitionMarker"), o) : t(n) + ); + } + function o(n) { + return b(n) ? K(e, c)(n) : c(n); + } + function c(n) { + return Y( + e, + s, + t, + "definitionDestination", + "definitionDestinationLiteral", + "definitionDestinationLiteralMarker", + "definitionDestinationRaw", + "definitionDestinationString", + )(n); + } + function s(n) { + return e.attempt(ne, l, l)(n); + } + function l(n) { + return v(n) ? I(e, a, "whitespace")(n) : a(n); + } + function a(u) { + return null === u || F(u) ? (e.exit("definition"), r.parser.defined.push(i), n(u)) : t(u); + } + }, + }, + ne = { + tokenize: function (e, n, t) { + return function (n) { + return b(n) ? K(e, r)(n) : t(n); + }; + function r(n) { + return J(e, i, t, "definitionTitle", "definitionTitleMarker", "definitionTitleString")(n); + } + function i(n) { + return v(n) ? I(e, u, "whitespace")(n) : u(n); + } + function u(e) { + return null === e || F(e) ? n(e) : t(e); + } + }, + partial: !0, + }, + te = { + name: "codeIndented", + tokenize: function (e, n, t) { + const r = this; + return function (n) { + return e.enter("codeIndented"), I(e, i, "linePrefix", 5)(n); + }; + function i(e) { + const n = r.events[r.events.length - 1]; + return n && "linePrefix" === n[1].type && n[2].sliceSerialize(n[1], !0).length >= 4 ? u(e) : t(e); + } + function u(n) { + return null === n ? c(n) : F(n) ? e.attempt(re, u, c)(n) : (e.enter("codeFlowValue"), o(n)); + } + function o(n) { + return null === n || F(n) ? (e.exit("codeFlowValue"), u(n)) : (e.consume(n), o); + } + function c(t) { + return e.exit("codeIndented"), n(t); + } + }, + }, + re = { + tokenize: function (e, n, t) { + const r = this; + return i; + function i(n) { + return r.parser.lazy[r.now().line] + ? t(n) + : F(n) + ? (e.enter("lineEnding"), e.consume(n), e.exit("lineEnding"), i) + : I(e, u, "linePrefix", 5)(n); + } + function u(e) { + const u = r.events[r.events.length - 1]; + return u && "linePrefix" === u[1].type && u[2].sliceSerialize(u[1], !0).length >= 4 ? n(e) : F(e) ? i(e) : t(e); + } + }, + partial: !0, + }, + ie = { + name: "headingAtx", + tokenize: function (e, n, t) { + let r = 0; + return function (n) { + return ( + e.enter("atxHeading"), + (function (n) { + return e.enter("atxHeadingSequence"), i(n); + })(n) + ); + }; + function i(n) { + return 35 === n && r++ < 6 ? (e.consume(n), i) : null === n || b(n) ? (e.exit("atxHeadingSequence"), u(n)) : t(n); + } + function u(t) { + return 35 === t + ? (e.enter("atxHeadingSequence"), o(t)) + : null === t || F(t) + ? (e.exit("atxHeading"), n(t)) + : v(t) + ? I(e, u, "whitespace")(t) + : (e.enter("atxHeadingText"), c(t)); + } + function o(n) { + return 35 === n ? (e.consume(n), o) : (e.exit("atxHeadingSequence"), u(n)); + } + function c(n) { + return null === n || 35 === n || b(n) ? (e.exit("atxHeadingText"), u(n)) : (e.consume(n), c); + } + }, + resolve: function (e, n) { + let t, + r, + i = e.length - 2, + u = 3; + return ( + "whitespace" === e[u][1].type && (u += 2), + i - 2 > u && "whitespace" === e[i][1].type && (i -= 2), + "atxHeadingSequence" === e[i][1].type && + (u === i - 1 || (i - 4 > u && "whitespace" === e[i - 2][1].type)) && + (i -= u + 1 === i ? 2 : 4), + i > u && + ((t = { type: "atxHeadingText", start: e[u][1].start, end: e[i][1].end }), + (r = { + type: "chunkText", + start: e[u][1].start, + end: e[i][1].end, + contentType: "text", + }), + s(e, u, i - u + 1, [ + ["enter", t, n], + ["enter", r, n], + ["exit", r, n], + ["exit", t, n], + ])), + e + ); + }, + }, + ue = { + name: "setextUnderline", + tokenize: function (e, n, t) { + const r = this; + let i; + return function (n) { + let o, + c = r.events.length; + for (; c--; ) + if ("lineEnding" !== r.events[c][1].type && "linePrefix" !== r.events[c][1].type && "content" !== r.events[c][1].type) { + o = "paragraph" === r.events[c][1].type; + break; + } + return r.parser.lazy[r.now().line] || (!r.interrupt && !o) + ? t(n) + : (e.enter("setextHeadingLine"), + (i = n), + (function (n) { + return e.enter("setextHeadingLineSequence"), u(n); + })(n)); + }; + function u(n) { + return n === i ? (e.consume(n), u) : (e.exit("setextHeadingLineSequence"), v(n) ? I(e, o, "lineSuffix")(n) : o(n)); + } + function o(r) { + return null === r || F(r) ? (e.exit("setextHeadingLine"), n(r)) : t(r); + } + }, + resolveTo: function (e, n) { + let t, + r, + i, + u = e.length; + for (; u--; ) + if ("enter" === e[u][0]) { + if ("content" === e[u][1].type) { + t = u; + break; + } + "paragraph" === e[u][1].type && (r = u); + } else "content" === e[u][1].type && e.splice(u, 1), i || "definition" !== e[u][1].type || (i = u); + const o = { + type: "setextHeading", + start: Object.assign({}, e[r][1].start), + end: Object.assign({}, e[e.length - 1][1].end), + }; + return ( + (e[r][1].type = "setextHeadingText"), + i + ? (e.splice(r, 0, ["enter", o, n]), e.splice(i + 1, 0, ["exit", e[t][1], n]), (e[t][1].end = Object.assign({}, e[i][1].end))) + : (e[t][1] = o), + e.push(["exit", o, n]), + e + ); + }, + }, + oe = [ + "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", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "head", + "header", + "hr", + "html", + "iframe", + "legend", + "li", + "link", + "main", + "menu", + "menuitem", + "nav", + "noframes", + "ol", + "optgroup", + "option", + "p", + "param", + "search", + "section", + "summary", + "table", + "tbody", + "td", + "tfoot", + "th", + "thead", + "title", + "tr", + "track", + "ul", + ], + ce = ["pre", "script", "style", "textarea"], + se = { + name: "htmlFlow", + tokenize: function (e, n, t) { + const r = this; + let i, u, o, c, s; + return function (n) { + return (function (n) { + return e.enter("htmlFlow"), e.enter("htmlFlowData"), e.consume(n), l; + })(n); + }; + function l(c) { + return 33 === c + ? (e.consume(c), a) + : 47 === c + ? (e.consume(c), (u = !0), m) + : 63 === c + ? (e.consume(c), (i = 3), r.interrupt ? n : H) + : h(c) + ? (e.consume(c), (o = String.fromCharCode(c)), g) + : t(c); + } + function a(u) { + return 45 === u + ? (e.consume(u), (i = 2), f) + : 91 === u + ? (e.consume(u), (i = 5), (c = 0), d) + : h(u) + ? (e.consume(u), (i = 4), r.interrupt ? n : H) + : t(u); + } + function f(i) { + return 45 === i ? (e.consume(i), r.interrupt ? n : H) : t(i); + } + function d(i) { + return i === "CDATA[".charCodeAt(c++) ? (e.consume(i), 6 === c ? (r.interrupt ? n : D) : d) : t(i); + } + function m(n) { + return h(n) ? (e.consume(n), (o = String.fromCharCode(n)), g) : t(n); + } + function g(c) { + if (null === c || 47 === c || 62 === c || b(c)) { + const s = 47 === c, + l = o.toLowerCase(); + return s || u || !ce.includes(l) + ? oe.includes(o.toLowerCase()) + ? ((i = 6), s ? (e.consume(c), x) : r.interrupt ? n(c) : D(c)) + : ((i = 7), r.interrupt && !r.parser.lazy[r.now().line] ? t(c) : u ? k(c) : y(c)) + : ((i = 1), r.interrupt ? n(c) : D(c)); + } + return 45 === c || p(c) ? (e.consume(c), (o += String.fromCharCode(c)), g) : t(c); + } + function x(i) { + return 62 === i ? (e.consume(i), r.interrupt ? n : D) : t(i); + } + function k(n) { + return v(n) ? (e.consume(n), k) : T(n); + } + function y(n) { + return 47 === n ? (e.consume(n), T) : 58 === n || 95 === n || h(n) ? (e.consume(n), S) : v(n) ? (e.consume(n), y) : T(n); + } + function S(n) { + return 45 === n || 46 === n || 58 === n || 95 === n || p(n) ? (e.consume(n), S) : E(n); + } + function E(n) { + return 61 === n ? (e.consume(n), A) : v(n) ? (e.consume(n), E) : y(n); + } + function A(n) { + return null === n || 60 === n || 61 === n || 62 === n || 96 === n + ? t(n) + : 34 === n || 39 === n + ? (e.consume(n), (s = n), I) + : v(n) + ? (e.consume(n), A) + : w(n); + } + function I(n) { + return n === s ? (e.consume(n), (s = null), C) : null === n || F(n) ? t(n) : (e.consume(n), I); + } + function w(n) { + return null === n || 34 === n || 39 === n || 47 === n || 60 === n || 61 === n || 62 === n || 96 === n || b(n) + ? E(n) + : (e.consume(n), w); + } + function C(e) { + return 47 === e || 62 === e || v(e) ? y(e) : t(e); + } + function T(n) { + return 62 === n ? (e.consume(n), z) : t(n); + } + function z(n) { + return null === n || F(n) ? D(n) : v(n) ? (e.consume(n), z) : t(n); + } + function D(n) { + return 45 === n && 2 === i + ? (e.consume(n), M) + : 60 === n && 1 === i + ? (e.consume(n), P) + : 62 === n && 4 === i + ? (e.consume(n), R) + : 63 === n && 3 === i + ? (e.consume(n), H) + : 93 === n && 5 === i + ? (e.consume(n), j) + : !F(n) || (6 !== i && 7 !== i) + ? null === n || F(n) + ? (e.exit("htmlFlowData"), B(n)) + : (e.consume(n), D) + : (e.exit("htmlFlowData"), e.check(le, q, B)(n)); + } + function B(n) { + return e.check(ae, _, q)(n); + } + function _(n) { + return e.enter("lineEnding"), e.consume(n), e.exit("lineEnding"), L; + } + function L(n) { + return null === n || F(n) ? B(n) : (e.enter("htmlFlowData"), D(n)); + } + function M(n) { + return 45 === n ? (e.consume(n), H) : D(n); + } + function P(n) { + return 47 === n ? (e.consume(n), (o = ""), O) : D(n); + } + function O(n) { + if (62 === n) { + const t = o.toLowerCase(); + return ce.includes(t) ? (e.consume(n), R) : D(n); + } + return h(n) && o.length < 8 ? (e.consume(n), (o += String.fromCharCode(n)), O) : D(n); + } + function j(n) { + return 93 === n ? (e.consume(n), H) : D(n); + } + function H(n) { + return 62 === n ? (e.consume(n), R) : 45 === n && 2 === i ? (e.consume(n), H) : D(n); + } + function R(n) { + return null === n || F(n) ? (e.exit("htmlFlowData"), q(n)) : (e.consume(n), R); + } + function q(t) { + return e.exit("htmlFlow"), n(t); + } + }, + resolveTo: function (e) { + let n = e.length; + for (; n-- && ("enter" !== e[n][0] || "htmlFlow" !== e[n][1].type); ); + return ( + n > 1 && + "linePrefix" === e[n - 2][1].type && + ((e[n][1].start = e[n - 2][1].start), (e[n + 1][1].start = e[n - 2][1].start), e.splice(n - 2, 2)), + e + ); + }, + concrete: !0, + }, + le = { + tokenize: function (e, n, t) { + return function (r) { + return e.enter("lineEnding"), e.consume(r), e.exit("lineEnding"), e.attempt(z, n, t); + }; + }, + partial: !0, + }, + ae = { + tokenize: function (e, n, t) { + const r = this; + return function (n) { + return F(n) ? (e.enter("lineEnding"), e.consume(n), e.exit("lineEnding"), i) : t(n); + }; + function i(e) { + return r.parser.lazy[r.now().line] ? t(e) : n(e); + } + }, + partial: !0, + }, + fe = { + tokenize: function (e, n, t) { + const r = this; + return function (n) { + return null === n ? t(n) : (e.enter("lineEnding"), e.consume(n), e.exit("lineEnding"), i); + }; + function i(e) { + return r.parser.lazy[r.now().line] ? t(e) : n(e); + } + }, + partial: !0, + }, + de = { + name: "codeFenced", + tokenize: function (e, n, t) { + const r = this, + i = { + tokenize: function (e, n, t) { + let i = 0; + return function (n) { + return e.enter("lineEnding"), e.consume(n), e.exit("lineEnding"), o; + }; + function o(n) { + return ( + e.enter("codeFencedFence"), + v(n) ? I(e, s, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(n) : s(n) + ); + } + function s(n) { + return n === u ? (e.enter("codeFencedFenceSequence"), l(n)) : t(n); + } + function l(n) { + return n === u + ? (i++, e.consume(n), l) + : i >= c + ? (e.exit("codeFencedFenceSequence"), v(n) ? I(e, a, "whitespace")(n) : a(n)) + : t(n); + } + function a(r) { + return null === r || F(r) ? (e.exit("codeFencedFence"), n(r)) : t(r); + } + }, + partial: !0, + }; + let u, + o = 0, + c = 0; + return function (n) { + return (function (n) { + const t = r.events[r.events.length - 1]; + return ( + (o = t && "linePrefix" === t[1].type ? t[2].sliceSerialize(t[1], !0).length : 0), + (u = n), + e.enter("codeFenced"), + e.enter("codeFencedFence"), + e.enter("codeFencedFenceSequence"), + s(n) + ); + })(n); + }; + function s(n) { + return n === u ? (c++, e.consume(n), s) : c < 3 ? t(n) : (e.exit("codeFencedFenceSequence"), v(n) ? I(e, l, "whitespace")(n) : l(n)); + } + function l(t) { + return null === t || F(t) + ? (e.exit("codeFencedFence"), r.interrupt ? n(t) : e.check(fe, h, k)(t)) + : (e.enter("codeFencedFenceInfo"), e.enter("chunkString", { contentType: "string" }), a(t)); + } + function a(n) { + return null === n || F(n) + ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), l(n)) + : v(n) + ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), I(e, f, "whitespace")(n)) + : 96 === n && n === u + ? t(n) + : (e.consume(n), a); + } + function f(n) { + return null === n || F(n) ? l(n) : (e.enter("codeFencedFenceMeta"), e.enter("chunkString", { contentType: "string" }), d(n)); + } + function d(n) { + return null === n || F(n) + ? (e.exit("chunkString"), e.exit("codeFencedFenceMeta"), l(n)) + : 96 === n && n === u + ? t(n) + : (e.consume(n), d); + } + function h(n) { + return e.attempt(i, k, p)(n); + } + function p(n) { + return e.enter("lineEnding"), e.consume(n), e.exit("lineEnding"), m; + } + function m(n) { + return o > 0 && v(n) ? I(e, g, "linePrefix", o + 1)(n) : g(n); + } + function g(n) { + return null === n || F(n) ? e.check(fe, h, k)(n) : (e.enter("codeFlowValue"), x(n)); + } + function x(n) { + return null === n || F(n) ? (e.exit("codeFlowValue"), g(n)) : (e.consume(n), x); + } + function k(t) { + return e.exit("codeFenced"), n(t); + } + }, + concrete: !0, + }, + he = document.createElement("i"); + function pe(e) { + const n = "&" + e + ";"; + he.innerHTML = n; + const t = he.textContent; + return (59 !== t.charCodeAt(t.length - 1) || "semi" === e) && t !== n && t; + } + const me = { + name: "characterReference", + tokenize: function (e, n, t) { + const r = this; + let i, + u, + o = 0; + return function (n) { + return e.enter("characterReference"), e.enter("characterReferenceMarker"), e.consume(n), e.exit("characterReferenceMarker"), c; + }; + function c(n) { + return 35 === n + ? (e.enter("characterReferenceMarkerNumeric"), e.consume(n), e.exit("characterReferenceMarkerNumeric"), s) + : (e.enter("characterReferenceValue"), (i = 31), (u = p), l(n)); + } + function s(n) { + return 88 === n || 120 === n + ? (e.enter("characterReferenceMarkerHexadecimal"), + e.consume(n), + e.exit("characterReferenceMarkerHexadecimal"), + e.enter("characterReferenceValue"), + (i = 6), + (u = k), + l) + : (e.enter("characterReferenceValue"), (i = 7), (u = x), l(n)); + } + function l(c) { + if (59 === c && o) { + const i = e.exit("characterReferenceValue"); + return u !== p || pe(r.sliceSerialize(i)) + ? (e.enter("characterReferenceMarker"), e.consume(c), e.exit("characterReferenceMarker"), e.exit("characterReference"), n) + : t(c); + } + return u(c) && o++ < i ? (e.consume(c), l) : t(c); + } + }, + }, + ge = { + name: "characterEscape", + tokenize: function (e, n, t) { + return function (n) { + return e.enter("characterEscape"), e.enter("escapeMarker"), e.consume(n), e.exit("escapeMarker"), r; + }; + function r(r) { + return y(r) ? (e.enter("characterEscapeValue"), e.consume(r), e.exit("characterEscapeValue"), e.exit("characterEscape"), n) : t(r); + } + }, + }, + xe = { + name: "lineEnding", + tokenize: function (e, n) { + return function (t) { + return e.enter("lineEnding"), e.consume(t), e.exit("lineEnding"), I(e, n, "linePrefix"); + }; + }, + }, + ke = { + name: "labelEnd", + tokenize: function (e, n, t) { + const r = this; + let i, + u, + o = r.events.length; + for (; o--; ) + if (("labelImage" === r.events[o][1].type || "labelLink" === r.events[o][1].type) && !r.events[o][1]._balanced) { + i = r.events[o][1]; + break; + } + return function (n) { + return i + ? i._inactive + ? a(n) + : ((u = r.parser.defined.includes(X(r.sliceSerialize({ start: i.end, end: r.now() })))), + e.enter("labelEnd"), + e.enter("labelMarker"), + e.consume(n), + e.exit("labelMarker"), + e.exit("labelEnd"), + c) + : t(n); + }; + function c(n) { + return 40 === n ? e.attempt(ye, l, u ? l : a)(n) : 91 === n ? e.attempt(Fe, l, u ? s : a)(n) : u ? l(n) : a(n); + } + function s(n) { + return e.attempt(be, l, a)(n); + } + function l(e) { + return n(e); + } + function a(e) { + return (i._balanced = !0), t(e); + } + }, + resolveTo: function (e, n) { + let t, + r, + i, + u, + o = e.length, + c = 0; + for (; o--; ) + if (((t = e[o][1]), r)) { + if ("link" === t.type || ("labelLink" === t.type && t._inactive)) break; + "enter" === e[o][0] && "labelLink" === t.type && (t._inactive = !0); + } else if (i) { + if ("enter" === e[o][0] && ("labelImage" === t.type || "labelLink" === t.type) && !t._balanced && ((r = o), "labelLink" !== t.type)) { + c = 2; + break; + } + } else "labelEnd" === t.type && (i = o); + const a = { + type: "labelLink" === e[r][1].type ? "link" : "image", + start: Object.assign({}, e[r][1].start), + end: Object.assign({}, e[e.length - 1][1].end), + }, + f = { + type: "label", + start: Object.assign({}, e[r][1].start), + end: Object.assign({}, e[i][1].end), + }, + d = { + type: "labelText", + start: Object.assign({}, e[r + c + 2][1].end), + end: Object.assign({}, e[i - 2][1].start), + }; + return ( + (u = [ + ["enter", a, n], + ["enter", f, n], + ]), + (u = l(u, e.slice(r + 1, r + c + 3))), + (u = l(u, [["enter", d, n]])), + (u = l(u, V(n.parser.constructs.insideSpan.null, e.slice(r + c + 4, i - 3), n))), + (u = l(u, [["exit", d, n], e[i - 2], e[i - 1], ["exit", f, n]])), + (u = l(u, e.slice(i + 1))), + (u = l(u, [["exit", a, n]])), + s(e, r, e.length, u), + e + ); + }, + resolveAll: function (e) { + let n = -1; + for (; ++n < e.length; ) { + const t = e[n][1]; + ("labelImage" !== t.type && "labelLink" !== t.type && "labelEnd" !== t.type) || + (e.splice(n + 1, "labelImage" === t.type ? 4 : 2), (t.type = "data"), n++); + } + return e; + }, + }, + ye = { + tokenize: function (e, n, t) { + return function (n) { + return e.enter("resource"), e.enter("resourceMarker"), e.consume(n), e.exit("resourceMarker"), r; + }; + function r(n) { + return b(n) ? K(e, i)(n) : i(n); + } + function i(n) { + return 41 === n + ? l(n) + : Y( + e, + u, + o, + "resourceDestination", + "resourceDestinationLiteral", + "resourceDestinationLiteralMarker", + "resourceDestinationRaw", + "resourceDestinationString", + 32, + )(n); + } + function u(n) { + return b(n) ? K(e, c)(n) : l(n); + } + function o(e) { + return t(e); + } + function c(n) { + return 34 === n || 39 === n || 40 === n ? J(e, s, t, "resourceTitle", "resourceTitleMarker", "resourceTitleString")(n) : l(n); + } + function s(n) { + return b(n) ? K(e, l)(n) : l(n); + } + function l(r) { + return 41 === r ? (e.enter("resourceMarker"), e.consume(r), e.exit("resourceMarker"), e.exit("resource"), n) : t(r); + } + }, + }, + Fe = { + tokenize: function (e, n, t) { + const r = this; + return function (n) { + return G.call(r, e, i, u, "reference", "referenceMarker", "referenceString")(n); + }; + function i(e) { + return r.parser.defined.includes(X(r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1))) ? n(e) : t(e); + } + function u(e) { + return t(e); + } + }, + }, + be = { + tokenize: function (e, n, t) { + return function (n) { + return e.enter("reference"), e.enter("referenceMarker"), e.consume(n), e.exit("referenceMarker"), r; + }; + function r(r) { + return 93 === r ? (e.enter("referenceMarker"), e.consume(r), e.exit("referenceMarker"), e.exit("reference"), n) : t(r); + } + }, + }; + function ve(e) { + return null === e || b(e) || E(e) ? 1 : S(e) ? 2 : void 0; + } + const Se = { + name: "attention", + tokenize: function (e, n) { + const t = this.parser.constructs.attentionMarkers.null, + r = this.previous, + i = ve(r); + let u; + return function (n) { + return (u = n), e.enter("attentionSequence"), o(n); + }; + function o(c) { + if (c === u) return e.consume(c), o; + const s = e.exit("attentionSequence"), + l = ve(c), + a = !l || (2 === l && i) || t.includes(c), + f = !i || (2 === i && l) || t.includes(r); + return (s._open = Boolean(42 === u ? a : a && (i || !f))), (s._close = Boolean(42 === u ? f : f && (l || !a))), n(c); + } + }, + resolveAll: function (e, n) { + let t, + r, + i, + u, + o, + c, + a, + f, + d = -1; + for (; ++d < e.length; ) + if ("enter" === e[d][0] && "attentionSequence" === e[d][1].type && e[d][1]._close) + for (t = d; t--; ) + if ( + "exit" === e[t][0] && + "attentionSequence" === e[t][1].type && + e[t][1]._open && + n.sliceSerialize(e[t][1]).charCodeAt(0) === n.sliceSerialize(e[d][1]).charCodeAt(0) + ) { + if ( + (e[t][1]._close || e[d][1]._open) && + (e[d][1].end.offset - e[d][1].start.offset) % 3 && + !((e[t][1].end.offset - e[t][1].start.offset + e[d][1].end.offset - e[d][1].start.offset) % 3) + ) + continue; + c = e[t][1].end.offset - e[t][1].start.offset > 1 && e[d][1].end.offset - e[d][1].start.offset > 1 ? 2 : 1; + const h = Object.assign({}, e[t][1].end), + p = Object.assign({}, e[d][1].start); + Ee(h, -c), + Ee(p, c), + (u = { + type: c > 1 ? "strongSequence" : "emphasisSequence", + start: h, + end: Object.assign({}, e[t][1].end), + }), + (o = { + type: c > 1 ? "strongSequence" : "emphasisSequence", + start: Object.assign({}, e[d][1].start), + end: p, + }), + (i = { + type: c > 1 ? "strongText" : "emphasisText", + start: Object.assign({}, e[t][1].end), + end: Object.assign({}, e[d][1].start), + }), + (r = { + type: c > 1 ? "strong" : "emphasis", + start: Object.assign({}, u.start), + end: Object.assign({}, o.end), + }), + (e[t][1].end = Object.assign({}, u.start)), + (e[d][1].start = Object.assign({}, o.end)), + (a = []), + e[t][1].end.offset - e[t][1].start.offset && + (a = l(a, [ + ["enter", e[t][1], n], + ["exit", e[t][1], n], + ])), + (a = l(a, [ + ["enter", r, n], + ["enter", u, n], + ["exit", u, n], + ["enter", i, n], + ])), + (a = l(a, V(n.parser.constructs.insideSpan.null, e.slice(t + 1, d), n))), + (a = l(a, [ + ["exit", i, n], + ["enter", o, n], + ["exit", o, n], + ["exit", r, n], + ])), + e[d][1].end.offset - e[d][1].start.offset + ? ((f = 2), + (a = l(a, [ + ["enter", e[d][1], n], + ["exit", e[d][1], n], + ]))) + : (f = 0), + s(e, t - 1, d - t + 3, a), + (d = t + a.length - f - 2); + break; + } + for (d = -1; ++d < e.length; ) "attentionSequence" === e[d][1].type && (e[d][1].type = "data"); + return e; + }, + }; + function Ee(e, n) { + (e.column += n), (e.offset += n), (e._bufferIndex += n); + } + const Ae = { + name: "htmlText", + tokenize: function (e, n, t) { + const r = this; + let i, u, o; + return function (n) { + return e.enter("htmlText"), e.enter("htmlTextData"), e.consume(n), c; + }; + function c(n) { + return 33 === n ? (e.consume(n), s) : 47 === n ? (e.consume(n), A) : 63 === n ? (e.consume(n), S) : h(n) ? (e.consume(n), T) : t(n); + } + function s(n) { + return 45 === n ? (e.consume(n), l) : 91 === n ? (e.consume(n), (u = 0), m) : h(n) ? (e.consume(n), y) : t(n); + } + function l(n) { + return 45 === n ? (e.consume(n), d) : t(n); + } + function a(n) { + return null === n ? t(n) : 45 === n ? (e.consume(n), f) : F(n) ? ((o = a), j(n)) : (e.consume(n), a); + } + function f(n) { + return 45 === n ? (e.consume(n), d) : a(n); + } + function d(e) { + return 62 === e ? O(e) : 45 === e ? f(e) : a(e); + } + function m(n) { + return n === "CDATA[".charCodeAt(u++) ? (e.consume(n), 6 === u ? g : m) : t(n); + } + function g(n) { + return null === n ? t(n) : 93 === n ? (e.consume(n), x) : F(n) ? ((o = g), j(n)) : (e.consume(n), g); + } + function x(n) { + return 93 === n ? (e.consume(n), k) : g(n); + } + function k(n) { + return 62 === n ? O(n) : 93 === n ? (e.consume(n), k) : g(n); + } + function y(n) { + return null === n || 62 === n ? O(n) : F(n) ? ((o = y), j(n)) : (e.consume(n), y); + } + function S(n) { + return null === n ? t(n) : 63 === n ? (e.consume(n), E) : F(n) ? ((o = S), j(n)) : (e.consume(n), S); + } + function E(e) { + return 62 === e ? O(e) : S(e); + } + function A(n) { + return h(n) ? (e.consume(n), w) : t(n); + } + function w(n) { + return 45 === n || p(n) ? (e.consume(n), w) : C(n); + } + function C(n) { + return F(n) ? ((o = C), j(n)) : v(n) ? (e.consume(n), C) : O(n); + } + function T(n) { + return 45 === n || p(n) ? (e.consume(n), T) : 47 === n || 62 === n || b(n) ? z(n) : t(n); + } + function z(n) { + return 47 === n + ? (e.consume(n), O) + : 58 === n || 95 === n || h(n) + ? (e.consume(n), D) + : F(n) + ? ((o = z), j(n)) + : v(n) + ? (e.consume(n), z) + : O(n); + } + function D(n) { + return 45 === n || 46 === n || 58 === n || 95 === n || p(n) ? (e.consume(n), D) : B(n); + } + function B(n) { + return 61 === n ? (e.consume(n), _) : F(n) ? ((o = B), j(n)) : v(n) ? (e.consume(n), B) : z(n); + } + function _(n) { + return null === n || 60 === n || 61 === n || 62 === n || 96 === n + ? t(n) + : 34 === n || 39 === n + ? (e.consume(n), (i = n), L) + : F(n) + ? ((o = _), j(n)) + : v(n) + ? (e.consume(n), _) + : (e.consume(n), M); + } + function L(n) { + return n === i ? (e.consume(n), (i = void 0), P) : null === n ? t(n) : F(n) ? ((o = L), j(n)) : (e.consume(n), L); + } + function M(n) { + return null === n || 34 === n || 39 === n || 60 === n || 61 === n || 96 === n + ? t(n) + : 47 === n || 62 === n || b(n) + ? z(n) + : (e.consume(n), M); + } + function P(e) { + return 47 === e || 62 === e || b(e) ? z(e) : t(e); + } + function O(r) { + return 62 === r ? (e.consume(r), e.exit("htmlTextData"), e.exit("htmlText"), n) : t(r); + } + function j(n) { + return e.exit("htmlTextData"), e.enter("lineEnding"), e.consume(n), e.exit("lineEnding"), H; + } + function H(n) { + return v(n) ? I(e, R, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(n) : R(n); + } + function R(n) { + return e.enter("htmlTextData"), o(n); + } + }, + }, + Ie = { + name: "codeText", + tokenize: function (e, n, t) { + let r, + i, + u = 0; + return function (n) { + return e.enter("codeText"), e.enter("codeTextSequence"), o(n); + }; + function o(n) { + return 96 === n ? (e.consume(n), u++, o) : (e.exit("codeTextSequence"), c(n)); + } + function c(n) { + return null === n + ? t(n) + : 32 === n + ? (e.enter("space"), e.consume(n), e.exit("space"), c) + : 96 === n + ? ((i = e.enter("codeTextSequence")), (r = 0), l(n)) + : F(n) + ? (e.enter("lineEnding"), e.consume(n), e.exit("lineEnding"), c) + : (e.enter("codeTextData"), s(n)); + } + function s(n) { + return null === n || 32 === n || 96 === n || F(n) ? (e.exit("codeTextData"), c(n)) : (e.consume(n), s); + } + function l(t) { + return 96 === t + ? (e.consume(t), r++, l) + : r === u + ? (e.exit("codeTextSequence"), e.exit("codeText"), n(t)) + : ((i.type = "codeTextData"), s(t)); + } + }, + resolve: function (e) { + let n, + t, + r = e.length - 4, + i = 3; + if (!(("lineEnding" !== e[i][1].type && "space" !== e[i][1].type) || ("lineEnding" !== e[r][1].type && "space" !== e[r][1].type))) + for (n = i; ++n < r; ) + if ("codeTextData" === e[n][1].type) { + (e[i][1].type = "codeTextPadding"), (e[r][1].type = "codeTextPadding"), (i += 2), (r -= 2); + break; + } + for (n = i - 1, r++; ++n <= r; ) + void 0 === t + ? n !== r && "lineEnding" !== e[n][1].type && (t = n) + : (n !== r && "lineEnding" !== e[n][1].type) || + ((e[t][1].type = "codeTextData"), + n !== t + 2 && ((e[t][1].end = e[n - 1][1].end), e.splice(t + 2, n - t - 2), (r -= n - t - 2), (n = t + 2)), + (t = void 0)); + return e; + }, + previous: function (e) { + return 96 !== e || "characterEscape" === this.events[this.events.length - 1][1].type; + }, + }, + we = { + 42: U, + 43: U, + 45: U, + 48: U, + 49: U, + 50: U, + 51: U, + 52: U, + 53: U, + 54: U, + 55: U, + 56: U, + 57: U, + 62: Z, + }, + Ce = { 91: ee }, + Te = { [-2]: te, [-1]: te, 32: te }, + ze = { 35: ie, 42: N, 45: [ue, N], 60: se, 61: ue, 95: N, 96: de, 126: de }, + De = { 38: me, 92: ge }, + Be = { + [-5]: xe, + [-4]: xe, + [-3]: xe, + 33: { + name: "labelStartImage", + tokenize: function (e, n, t) { + const r = this; + return function (n) { + return e.enter("labelImage"), e.enter("labelImageMarker"), e.consume(n), e.exit("labelImageMarker"), i; + }; + function i(n) { + return 91 === n ? (e.enter("labelMarker"), e.consume(n), e.exit("labelMarker"), e.exit("labelImage"), u) : t(n); + } + function u(e) { + return 94 === e && "_hiddenFootnoteSupport" in r.parser.constructs ? t(e) : n(e); + } + }, + resolveAll: ke.resolveAll, + }, + 38: me, + 42: Se, + 60: [ + { + name: "autolink", + tokenize: function (e, n, t) { + let r = 0; + return function (n) { + return e.enter("autolink"), e.enter("autolinkMarker"), e.consume(n), e.exit("autolinkMarker"), e.enter("autolinkProtocol"), i; + }; + function i(n) { + return h(n) ? (e.consume(n), u) : s(n); + } + function u(e) { + return 43 === e || 45 === e || 46 === e || p(e) ? ((r = 1), o(e)) : s(e); + } + function o(n) { + return 58 === n + ? (e.consume(n), (r = 0), c) + : (43 === n || 45 === n || 46 === n || p(n)) && r++ < 32 + ? (e.consume(n), o) + : ((r = 0), s(n)); + } + function c(r) { + return 62 === r + ? (e.exit("autolinkProtocol"), e.enter("autolinkMarker"), e.consume(r), e.exit("autolinkMarker"), e.exit("autolink"), n) + : null === r || 32 === r || 60 === r || g(r) + ? t(r) + : (e.consume(r), c); + } + function s(n) { + return 64 === n ? (e.consume(n), l) : m(n) ? (e.consume(n), s) : t(n); + } + function l(e) { + return p(e) ? a(e) : t(e); + } + function a(t) { + return 46 === t + ? (e.consume(t), (r = 0), l) + : 62 === t + ? ((e.exit("autolinkProtocol").type = "autolinkEmail"), + e.enter("autolinkMarker"), + e.consume(t), + e.exit("autolinkMarker"), + e.exit("autolink"), + n) + : f(t); + } + function f(n) { + if ((45 === n || p(n)) && r++ < 63) { + const t = 45 === n ? f : a; + return e.consume(n), t; + } + return t(n); + } + }, + }, + Ae, + ], + 91: { + name: "labelStartLink", + tokenize: function (e, n, t) { + const r = this; + return function (n) { + return e.enter("labelLink"), e.enter("labelMarker"), e.consume(n), e.exit("labelMarker"), e.exit("labelLink"), i; + }; + function i(e) { + return 94 === e && "_hiddenFootnoteSupport" in r.parser.constructs ? t(e) : n(e); + } + }, + resolveAll: ke.resolveAll, + }, + 92: [ + { + name: "hardBreakEscape", + tokenize: function (e, n, t) { + return function (n) { + return e.enter("hardBreakEscape"), e.consume(n), r; + }; + function r(r) { + return F(r) ? (e.exit("hardBreakEscape"), n(r)) : t(r); + } + }, + }, + ge, + ], + 93: ke, + 95: Se, + 96: Ie, + }, + _e = { null: [Se, P] }, + Le = { null: [42, 95] }, + Me = { null: [] }; + const Pe = /[\0\t\n\r]/g; + function Oe(e, n) { + const t = Number.parseInt(e, n); + return t < 9 || + 11 === t || + (t > 13 && t < 32) || + (t > 126 && t < 160) || + (t > 55295 && t < 57344) || + (t > 64975 && t < 65008) || + 65535 == (65535 & t) || + 65534 == (65535 & t) || + t > 1114111 + ? "�" + : String.fromCharCode(t); + } + const je = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi; + function He(e, n, t) { + if (n) return n; + if (35 === t.charCodeAt(0)) { + const e = t.charCodeAt(1), + n = 120 === e || 88 === e; + return Oe(t.slice(n ? 2 : 1), n ? 16 : 10); + } + return pe(t) || e; + } + function Re(e) { + return e && "object" == typeof e + ? "position" in e || "type" in e + ? Ve(e.position) + : "start" in e || "end" in e + ? Ve(e) + : "line" in e || "column" in e + ? qe(e) + : "" + : ""; + } + function qe(e) { + return Qe(e && e.line) + ":" + Qe(e && e.column); + } + function Ve(e) { + return qe(e && e.start) + "-" + qe(e && e.end); + } + function Qe(e) { + return e && "number" == typeof e ? e : 1; + } + const Ne = {}.hasOwnProperty, + Ue = function (e, n, t) { + return ( + "string" != typeof n && ((t = n), (n = void 0)), + (function (e) { + const n = { + transforms: [], + canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"], + enter: { + autolink: s(v), + autolinkProtocol: p, + autolinkEmail: p, + atxHeading: s(y), + blockQuote: s(function () { + return { type: "blockquote", children: [] }; + }), + characterEscape: p, + characterReference: p, + codeFenced: s(k), + codeFencedFenceInfo: l, + codeFencedFenceMeta: l, + codeIndented: s(k, l), + codeText: s(function () { + return { type: "inlineCode", value: "" }; + }, l), + codeTextData: p, + data: p, + codeFlowValue: p, + definition: s(function () { + return { + type: "definition", + identifier: "", + label: null, + title: null, + url: "", + }; + }), + definitionDestinationString: l, + definitionLabelString: l, + definitionTitleString: l, + emphasis: s(function () { + return { type: "emphasis", children: [] }; + }), + hardBreakEscape: s(F), + hardBreakTrailing: s(F), + htmlFlow: s(b, l), + htmlFlowData: p, + htmlText: s(b, l), + htmlTextData: p, + image: s(function () { + return { type: "image", title: null, url: "", alt: null }; + }), + label: l, + link: s(v), + listItem: s(function (e) { + return { type: "listItem", spread: e._spread, checked: null, children: [] }; + }), + listItemValue: function (e) { + c("expectingFirstListItemValue") && + ((this.stack[this.stack.length - 2].start = Number.parseInt(this.sliceSerialize(e), 10)), i("expectingFirstListItemValue")); + }, + listOrdered: s(S, function () { + i("expectingFirstListItemValue", !0); + }), + listUnordered: s(S), + paragraph: s(function () { + return { type: "paragraph", children: [] }; + }), + reference: function () { + i("referenceType", "collapsed"); + }, + referenceString: l, + resourceDestinationString: l, + resourceTitleString: l, + setextHeading: s(y), + strong: s(function () { + return { type: "strong", children: [] }; + }), + thematicBreak: s(function () { + return { type: "thematicBreak" }; + }), + }, + exit: { + atxHeading: f(), + atxHeadingSequence: function (e) { + const n = this.stack[this.stack.length - 1]; + if (!n.depth) { + const t = this.sliceSerialize(e).length; + n.depth = t; + } + }, + autolink: f(), + autolinkEmail: function (e) { + m.call(this, e), (this.stack[this.stack.length - 1].url = "mailto:" + this.sliceSerialize(e)); + }, + autolinkProtocol: function (e) { + m.call(this, e), (this.stack[this.stack.length - 1].url = this.sliceSerialize(e)); + }, + blockQuote: f(), + characterEscapeValue: m, + characterReferenceMarkerHexadecimal: x, + characterReferenceMarkerNumeric: x, + characterReferenceValue: function (e) { + const n = this.sliceSerialize(e), + t = c("characterReferenceType"); + let r; + t ? ((r = Oe(n, "characterReferenceMarkerNumeric" === t ? 10 : 16)), i("characterReferenceType")) : (r = pe(n)); + const u = this.stack.pop(); + (u.value += r), (u.position.end = $e(e.end)); + }, + codeFenced: f(function () { + const e = this.resume(); + (this.stack[this.stack.length - 1].value = e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, "")), i("flowCodeInside"); + }), + codeFencedFence: function () { + c("flowCodeInside") || (this.buffer(), i("flowCodeInside", !0)); + }, + codeFencedFenceInfo: function () { + const e = this.resume(); + this.stack[this.stack.length - 1].lang = e; + }, + codeFencedFenceMeta: function () { + const e = this.resume(); + this.stack[this.stack.length - 1].meta = e; + }, + codeFlowValue: m, + codeIndented: f(function () { + const e = this.resume(); + this.stack[this.stack.length - 1].value = e.replace(/(\r?\n|\r)$/g, ""); + }), + codeText: f(function () { + const e = this.resume(); + this.stack[this.stack.length - 1].value = e; + }), + codeTextData: m, + data: m, + definition: f(), + definitionDestinationString: function () { + const e = this.resume(); + this.stack[this.stack.length - 1].url = e; + }, + definitionLabelString: function (e) { + const n = this.resume(), + t = this.stack[this.stack.length - 1]; + (t.label = n), (t.identifier = X(this.sliceSerialize(e)).toLowerCase()); + }, + definitionTitleString: function () { + const e = this.resume(); + this.stack[this.stack.length - 1].title = e; + }, + emphasis: f(), + hardBreakEscape: f(g), + hardBreakTrailing: f(g), + htmlFlow: f(function () { + const e = this.resume(); + this.stack[this.stack.length - 1].value = e; + }), + htmlFlowData: m, + htmlText: f(function () { + const e = this.resume(); + this.stack[this.stack.length - 1].value = e; + }), + htmlTextData: m, + image: f(function () { + const e = this.stack[this.stack.length - 1]; + if (c("inReference")) { + const n = c("referenceType") || "shortcut"; + (e.type += "Reference"), (e.referenceType = n), delete e.url, delete e.title; + } else delete e.identifier, delete e.label; + i("referenceType"); + }), + label: function () { + const e = this.stack[this.stack.length - 1], + n = this.resume(), + t = this.stack[this.stack.length - 1]; + if ((i("inReference", !0), "link" === t.type)) { + const n = e.children; + t.children = n; + } else t.alt = n; + }, + labelText: function (e) { + const n = this.sliceSerialize(e), + t = this.stack[this.stack.length - 2]; + (t.label = (function (e) { + return e.replace(je, He); + })(n)), + (t.identifier = X(n).toLowerCase()); + }, + lineEnding: function (e) { + const t = this.stack[this.stack.length - 1]; + if (c("atHardBreak")) return (t.children[t.children.length - 1].position.end = $e(e.end)), void i("atHardBreak"); + !c("setextHeadingSlurpLineEnding") && n.canContainEols.includes(t.type) && (p.call(this, e), m.call(this, e)); + }, + link: f(function () { + const e = this.stack[this.stack.length - 1]; + if (c("inReference")) { + const n = c("referenceType") || "shortcut"; + (e.type += "Reference"), (e.referenceType = n), delete e.url, delete e.title; + } else delete e.identifier, delete e.label; + i("referenceType"); + }), + listItem: f(), + listOrdered: f(), + listUnordered: f(), + paragraph: f(), + referenceString: function (e) { + const n = this.resume(), + t = this.stack[this.stack.length - 1]; + (t.label = n), (t.identifier = X(this.sliceSerialize(e)).toLowerCase()), i("referenceType", "full"); + }, + resourceDestinationString: function () { + const e = this.resume(); + this.stack[this.stack.length - 1].url = e; + }, + resourceTitleString: function () { + const e = this.resume(); + this.stack[this.stack.length - 1].title = e; + }, + resource: function () { + i("inReference"); + }, + setextHeading: f(function () { + i("setextHeadingSlurpLineEnding"); + }), + setextHeadingLineSequence: function (e) { + this.stack[this.stack.length - 1].depth = 61 === this.sliceSerialize(e).charCodeAt(0) ? 1 : 2; + }, + setextHeadingText: function () { + i("setextHeadingSlurpLineEnding", !0); + }, + strong: f(), + thematicBreak: f(), + }, + }; + We(n, (e || {}).mdastExtensions || []); + const t = {}; + return function (e) { + let t = { type: "root", children: [] }; + const u = { + stack: [t], + tokenStack: [], + config: n, + enter: a, + exit: d, + buffer: l, + resume: h, + setData: i, + getData: c, + }, + o = []; + let s = -1; + for (; ++s < e.length; ) + ("listOrdered" !== e[s][1].type && "listUnordered" !== e[s][1].type) || ("enter" === e[s][0] ? o.push(s) : (s = r(e, o.pop(), s))); + for (s = -1; ++s < e.length; ) { + const t = n[e[s][0]]; + Ne.call(t, e[s][1].type) && t[e[s][1].type].call(Object.assign({ sliceSerialize: e[s][2].sliceSerialize }, u), e[s][1]); + } + if (u.tokenStack.length > 0) { + const e = u.tokenStack[u.tokenStack.length - 1]; + (e[1] || Ye).call(u, void 0, e[0]); + } + for ( + t.position = { + start: $e(e.length > 0 ? e[0][1].start : { line: 1, column: 1, offset: 0 }), + end: $e(e.length > 0 ? e[e.length - 2][1].end : { line: 1, column: 1, offset: 0 }), + }, + s = -1; + ++s < n.transforms.length; + + ) + t = n.transforms[s](t) || t; + return t; + }; + function r(e, n, t) { + let r, + i, + u, + o, + c = n - 1, + s = -1, + l = !1; + for (; ++c <= t; ) { + const n = e[c]; + if ( + ("listUnordered" === n[1].type || "listOrdered" === n[1].type || "blockQuote" === n[1].type + ? ("enter" === n[0] ? s++ : s--, (o = void 0)) + : "lineEndingBlank" === n[1].type + ? "enter" === n[0] && (!r || o || s || u || (u = c), (o = void 0)) + : "linePrefix" === n[1].type || + "listItemValue" === n[1].type || + "listItemMarker" === n[1].type || + "listItemPrefix" === n[1].type || + "listItemPrefixWhitespace" === n[1].type || + (o = void 0), + (!s && "enter" === n[0] && "listItemPrefix" === n[1].type) || + (-1 === s && "exit" === n[0] && ("listUnordered" === n[1].type || "listOrdered" === n[1].type))) + ) { + if (r) { + let o = c; + for (i = void 0; o--; ) { + const n = e[o]; + if ("lineEnding" === n[1].type || "lineEndingBlank" === n[1].type) { + if ("exit" === n[0]) continue; + i && ((e[i][1].type = "lineEndingBlank"), (l = !0)), (n[1].type = "lineEnding"), (i = o); + } else if ( + "linePrefix" !== n[1].type && + "blockQuotePrefix" !== n[1].type && + "blockQuotePrefixWhitespace" !== n[1].type && + "blockQuoteMarker" !== n[1].type && + "listItemIndent" !== n[1].type + ) + break; + } + u && (!i || u < i) && (r._spread = !0), + (r.end = Object.assign({}, i ? e[i][1].start : n[1].end)), + e.splice(i || c, 0, ["exit", r, n[2]]), + c++, + t++; + } + "listItemPrefix" === n[1].type && + ((r = { + type: "listItem", + _spread: !1, + start: Object.assign({}, n[1].start), + end: void 0, + }), + e.splice(c, 0, ["enter", r, n[2]]), + c++, + t++, + (u = void 0), + (o = !0)); + } + } + return (e[n][1]._spread = l), t; + } + function i(e, n) { + t[e] = n; + } + function c(e) { + return t[e]; + } + function s(e, n) { + return function (t) { + a.call(this, e(t), t), n && n.call(this, t); + }; + } + function l() { + this.stack.push({ type: "fragment", children: [] }); + } + function a(e, n, t) { + return ( + this.stack[this.stack.length - 1].children.push(e), + this.stack.push(e), + this.tokenStack.push([n, t]), + (e.position = { start: $e(n.start) }), + e + ); + } + function f(e) { + return function (n) { + e && e.call(this, n), d.call(this, n); + }; + } + function d(e, n) { + const t = this.stack.pop(), + r = this.tokenStack.pop(); + if (!r) throw new Error("Cannot close `" + e.type + "` (" + Re({ start: e.start, end: e.end }) + "): it’s not open"); + return r[0].type !== e.type && (n ? n.call(this, e, r[0]) : (r[1] || Ye).call(this, e, r[0])), (t.position.end = $e(e.end)), t; + } + function h() { + return (function (e, n) { + return o(e, "boolean" != typeof u.includeImageAlt || u.includeImageAlt, "boolean" != typeof u.includeHtml || u.includeHtml); + })(this.stack.pop()); + } + function p(e) { + const n = this.stack[this.stack.length - 1]; + let t = n.children[n.children.length - 1]; + (t && "text" === t.type) || ((t = { type: "text", value: "" }), (t.position = { start: $e(e.start) }), n.children.push(t)), + this.stack.push(t); + } + function m(e) { + const n = this.stack.pop(); + (n.value += this.sliceSerialize(e)), (n.position.end = $e(e.end)); + } + function g() { + i("atHardBreak", !0); + } + function x(e) { + i("characterReferenceType", e.type); + } + function k() { + return { type: "code", lang: null, meta: null, value: "" }; + } + function y() { + return { type: "heading", depth: void 0, children: [] }; + } + function F() { + return { type: "break" }; + } + function b() { + return { type: "html", value: "" }; + } + function v() { + return { type: "link", title: null, url: "", children: [] }; + } + function S(e) { + return { + type: "list", + ordered: "listOrdered" === e.type, + start: null, + spread: e._spread, + children: [], + }; + } + })(t)( + (function (e) { + for (; !D(e); ); + return e; + })( + (function (e) { + const n = (function (e) { + const n = {}; + let t = -1; + for (; ++t < e.length; ) f(n, e[t]); + return n; + })([r, ...((e || {}).extensions || [])]), + t = { + defined: [], + lazy: {}, + constructs: n, + content: i(w), + document: i(C), + flow: i(M), + string: i(O), + text: i(j), + }; + return t; + function i(e) { + return function (n) { + return Q(t, e, n); + }; + } + })(t) + .document() + .write( + (function () { + let e, + n = 1, + t = "", + r = !0; + return function (i, u, o) { + const c = []; + let s, l, a, f, d; + for (i = t + i.toString(u), a = 0, t = "", r && (65279 === i.charCodeAt(0) && a++, (r = void 0)); a < i.length; ) { + if (((Pe.lastIndex = a), (s = Pe.exec(i)), (f = s && void 0 !== s.index ? s.index : i.length), (d = i.charCodeAt(f)), !s)) { + t = i.slice(a); + break; + } + if (10 === d && a === f && e) c.push(-3), (e = void 0); + else + switch ((e && (c.push(-5), (e = void 0)), a < f && (c.push(i.slice(a, f)), (n += f - a)), d)) { + case 0: + c.push(65533), n++; + break; + case 9: + for (l = 4 * Math.ceil(n / 4), c.push(-2); n++ < l; ) c.push(-1); + break; + case 10: + c.push(-4), (n = 1); + break; + default: + (e = !0), (n = 1); + } + a = f + 1; + } + return o && (e && c.push(-5), t && c.push(t), c.push(null)), c; + }; + })()(e, n, !0), + ), + ), + ) + ); + }; + function $e(e) { + return { line: e.line, column: e.column, offset: e.offset }; + } + function We(e, n) { + let t = -1; + for (; ++t < n.length; ) { + const r = n[t]; + Array.isArray(r) ? We(e, r) : Ze(e, r); + } + } + function Ze(e, n) { + let t; + for (t in n) + if (Ne.call(n, t)) + if ("canContainEols" === t) { + const r = n[t]; + r && e[t].push(...r); + } else if ("transforms" === t) { + const r = n[t]; + r && e[t].push(...r); + } else if ("enter" === t || "exit" === t) { + const r = n[t]; + r && Object.assign(e[t], r); + } + } + function Ye(e, n) { + throw e + ? new Error( + "Cannot close `" + + e.type + + "` (" + + Re({ start: e.start, end: e.end }) + + "): a different token (`" + + n.type + + "`, " + + Re({ start: n.start, end: n.end }) + + ") is open", + ) + : new Error("Cannot close document, a token (`" + n.type + "`, " + Re({ start: n.start, end: n.end }) + ") is still open"); + } + var Ge = t(8464); + function Je(e) { + const n = (function (e) { + const n = e.replace(/\n{2,}/g, "\n"); + return (0, Ge.Z)(n); + })(e), + { children: t } = Ue(n), + r = [[]]; + let i = 0; + function u(e, n = "normal") { + "text" === e.type + ? e.value.split("\n").forEach((e, t) => { + 0 !== t && (i++, r.push([])), + e.split(" ").forEach((e) => { + e && r[i].push({ content: e, type: n }); + }); + }) + : ("strong" !== e.type && "emphasis" !== e.type) || + e.children.forEach((n) => { + u(n, e.type); + }); + } + return ( + t.forEach((e) => { + "paragraph" === e.type && + e.children.forEach((e) => { + u(e); + }); + }), + r + ); + } + function Ke(e, n) { + var t; + return Xe(e, [], ((t = n.content), Intl.Segmenter ? [...new Intl.Segmenter().segment(t)].map((e) => e.segment) : [...t]), n.type); + } + function Xe(e, n, t, r) { + if (0 === t.length) + return [ + { content: n.join(""), type: r }, + { content: "", type: r }, + ]; + const [i, ...u] = t, + o = [...n, i]; + return e([{ content: o.join(""), type: r }]) + ? Xe(e, o, u, r) + : (0 === n.length && i && (n.push(i), t.shift()), + [ + { content: n.join(""), type: r }, + { content: t.join(""), type: r }, + ]); + } + function en(e, n) { + if (e.some(({ content: e }) => e.includes("\n"))) throw new Error("splitLineToFitWidth does not support newlines in the line"); + return nn(e, n); + } + function nn(e, n, t = [], r = []) { + if (0 === e.length) return r.length > 0 && t.push(r), t.length > 0 ? t : []; + let i = ""; + " " === e[0].content && ((i = " "), e.shift()); + const u = e.shift() ?? { content: " ", type: "normal" }, + o = [...r]; + if (("" !== i && o.push({ content: i, type: "normal" }), o.push(u), n(o))) return nn(e, n, t, o); + if (r.length > 0) t.push(r), e.unshift(u); + else if (u.content) { + const [r, i] = Ke(n, u); + t.push([r]), i.content && e.unshift(i); + } + return nn(e, n, t); + } + function tn(e, n, t) { + return e + .append("tspan") + .attr("class", "text-outer-tspan") + .attr("x", 0) + .attr("y", n * t - 0.1 + "em") + .attr("dy", t + "em"); + } + function rn(e, n, t) { + const r = e.append("text"), + i = tn(r, 1, n); + un(i, t); + const u = i.node().getComputedTextLength(); + return r.remove(), u; + } + function un(e, n) { + e.text(""), + n.forEach((n, t) => { + const r = e + .append("tspan") + .attr("font-style", "emphasis" === n.type ? "italic" : "normal") + .attr("class", "text-inner-tspan") + .attr("font-weight", "strong" === n.type ? "bold" : "normal"); + 0 === t ? r.text(n.content) : r.text(" " + n.content); + }); + } + const on = ( + e, + n = "", + { style: t = "", isTitle: r = !1, classes: u = "", useHtmlLabels: o = !0, isNode: c = !0, width: s = 200, addSvgBackground: l = !1 } = {}, + ) => { + if ((i.l.info("createText", n, t, r, u, o, c, l), o)) { + const r = (function (e) { + const { children: n } = Ue(e); + return n + .map(function e(n) { + return "text" === n.type + ? n.value.replace(/\n/g, "
    ") + : "strong" === n.type + ? `${n.children.map(e).join("")}` + : "emphasis" === n.type + ? `${n.children.map(e).join("")}` + : "paragraph" === n.type + ? `

    ${n.children.map(e).join("")}

    ` + : `Unsupported markdown: ${n.type}`; + }) + .join(""); + })(n), + o = (function (e, n, t, r, i = !1) { + const u = e.append("foreignObject"), + o = u.append("xhtml:div"), + c = n.label, + s = n.isNode ? "nodeLabel" : "edgeLabel"; + var l, a; + o.html(`\n " + c + ""), + (l = o), + (a = n.labelStyle) && l.attr("style", a), + o.style("display", "table-cell"), + o.style("white-space", "nowrap"), + o.style("max-width", t + "px"), + o.attr("xmlns", "http://www.w3.org/1999/xhtml"), + i && o.attr("class", "labelBkg"); + let f = o.node().getBoundingClientRect(); + return ( + f.width === t && + (o.style("display", "table"), + o.style("white-space", "break-spaces"), + o.style("width", t + "px"), + (f = o.node().getBoundingClientRect())), + u.style("width", f.width), + u.style("height", f.height), + u.node() + ); + })( + e, + { + isNode: c, + label: (0, i.L)(r).replace(/fa[blrs]?:fa-[\w-]+/g, (e) => ``), + labelStyle: t.replace("fill:", "color:"), + }, + s, + u, + l, + ); + return o; + } + { + const t = (function (e, n, t, r = !1) { + const i = n.append("g"), + u = i.insert("rect").attr("class", "background"), + o = i.append("text").attr("y", "-10.1"); + let c = 0; + for (const n of t) { + const t = (n) => rn(i, 1.1, n) <= e, + r = t(n) ? [n] : en(n, t); + for (const e of r) un(tn(o, c, 1.1), e), c++; + } + if (r) { + const e = o.node().getBBox(), + n = 2; + return ( + u + .attr("x", -n) + .attr("y", -n) + .attr("width", e.width + 2 * n) + .attr("height", e.height + 2 * n), + i.node() + ); + } + return o.node(); + })(s, e, Je(n), l); + return t; + } + }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/519-8d0cec7f.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/519-8d0cec7f.chunk.min.js new file mode 100644 index 000000000..bee8e3e85 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/519-8d0cec7f.chunk.min.js @@ -0,0 +1,463 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [519], + { + 9519: function (t, e, a) { + a.d(e, { + diagram: function () { + return g; + }, + }); + var r = a(1423), + n = a(7274), + i = a(3771), + d = a(5625), + o = a(9339), + s = a(7863); + a(7484), a(7967), a(7856); + let l = {}; + const p = function (t) { + const e = Object.entries(l).find((e) => e[1].label === t); + if (e) return e[0]; + }, + c = { + draw: function (t, e, a, r) { + const c = (0, o.c)().class; + (l = {}), o.l.info("Rendering diagram " + t); + const g = (0, o.c)().securityLevel; + let h; + "sandbox" === g && (h = (0, n.Ys)("#i" + e)); + const f = "sandbox" === g ? (0, n.Ys)(h.nodes()[0].contentDocument.body) : (0, n.Ys)("body"), + u = f.select(`[id='${e}']`); + var x; + (x = u) + .append("defs") + .append("marker") + .attr("id", "extensionStart") + .attr("class", "extension") + .attr("refX", 0) + .attr("refY", 7) + .attr("markerWidth", 190) + .attr("markerHeight", 240) + .attr("orient", "auto") + .append("path") + .attr("d", "M 1,7 L18,13 V 1 Z"), + x + .append("defs") + .append("marker") + .attr("id", "extensionEnd") + .attr("refX", 19) + .attr("refY", 7) + .attr("markerWidth", 20) + .attr("markerHeight", 28) + .attr("orient", "auto") + .append("path") + .attr("d", "M 1,1 V 13 L18,7 Z"), + x + .append("defs") + .append("marker") + .attr("id", "compositionStart") + .attr("class", "extension") + .attr("refX", 0) + .attr("refY", 7) + .attr("markerWidth", 190) + .attr("markerHeight", 240) + .attr("orient", "auto") + .append("path") + .attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), + x + .append("defs") + .append("marker") + .attr("id", "compositionEnd") + .attr("refX", 19) + .attr("refY", 7) + .attr("markerWidth", 20) + .attr("markerHeight", 28) + .attr("orient", "auto") + .append("path") + .attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), + x + .append("defs") + .append("marker") + .attr("id", "aggregationStart") + .attr("class", "extension") + .attr("refX", 0) + .attr("refY", 7) + .attr("markerWidth", 190) + .attr("markerHeight", 240) + .attr("orient", "auto") + .append("path") + .attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), + x + .append("defs") + .append("marker") + .attr("id", "aggregationEnd") + .attr("refX", 19) + .attr("refY", 7) + .attr("markerWidth", 20) + .attr("markerHeight", 28) + .attr("orient", "auto") + .append("path") + .attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), + x + .append("defs") + .append("marker") + .attr("id", "dependencyStart") + .attr("class", "extension") + .attr("refX", 0) + .attr("refY", 7) + .attr("markerWidth", 190) + .attr("markerHeight", 240) + .attr("orient", "auto") + .append("path") + .attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), + x + .append("defs") + .append("marker") + .attr("id", "dependencyEnd") + .attr("refX", 19) + .attr("refY", 7) + .attr("markerWidth", 20) + .attr("markerHeight", 28) + .attr("orient", "auto") + .append("path") + .attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); + const y = new d.k({ multigraph: !0 }); + y.setGraph({ isMultiGraph: !0 }), + y.setDefaultEdgeLabel(function () { + return {}; + }); + const b = r.db.getClasses(), + m = Object.keys(b); + for (const t of m) { + const e = b[t], + a = s.s.drawClass(u, e, c, r); + (l[a.id] = a), y.setNode(a.id, a), o.l.info("Org height: " + a.height); + } + r.db.getRelations().forEach(function (t) { + o.l.info("tjoho" + p(t.id1) + p(t.id2) + JSON.stringify(t)), y.setEdge(p(t.id1), p(t.id2), { relation: t }, t.title || "DEFAULT"); + }), + r.db.getNotes().forEach(function (t) { + o.l.debug(`Adding note: ${JSON.stringify(t)}`); + const e = s.s.drawNote(u, t, c, r); + (l[e.id] = e), + y.setNode(e.id, e), + t.class && + t.class in b && + y.setEdge( + t.id, + p(t.class), + { + relation: { + id1: t.id, + id2: t.class, + relation: { type1: "none", type2: "none", lineType: 10 }, + }, + }, + "DEFAULT", + ); + }), + (0, i.bK)(y), + y.nodes().forEach(function (t) { + void 0 !== t && + void 0 !== y.node(t) && + (o.l.debug("Node " + t + ": " + JSON.stringify(y.node(t))), + f + .select("#" + (r.db.lookUpDomId(t) || t)) + .attr("transform", "translate(" + (y.node(t).x - y.node(t).width / 2) + "," + (y.node(t).y - y.node(t).height / 2) + " )")); + }), + y.edges().forEach(function (t) { + void 0 !== t && + void 0 !== y.edge(t) && + (o.l.debug("Edge " + t.v + " -> " + t.w + ": " + JSON.stringify(y.edge(t))), s.s.drawEdge(u, y.edge(t), y.edge(t).relation, c, r)); + }); + const w = u.node().getBBox(), + k = w.width + 40, + E = w.height + 40; + (0, o.i)(u, E, k, c.useMaxWidth); + const L = `${w.x - 20} ${w.y - 20} ${k} ${E}`; + o.l.debug(`viewBox ${L}`), u.attr("viewBox", L); + }, + }, + g = { + parser: r.p, + db: r.d, + renderer: c, + styles: r.s, + init: (t) => { + t.class || (t.class = {}), (t.class.arrowMarkerAbsolute = t.arrowMarkerAbsolute), r.d.clear(); + }, + }; + }, + 7863: function (t, e, a) { + a.d(e, { + p: function () { + return o; + }, + s: function () { + return p; + }, + }); + var r = a(7274), + n = a(9339); + let i = 0; + const d = function (t) { + let e = t.id; + return t.type && (e += "<" + t.type + ">"), e; + }, + o = function (t) { + let e = "", + a = "", + r = "", + i = "", + d = t.substring(0, 1), + o = t.substring(t.length - 1, t.length); + d.match(/[#+~-]/) && (i = d); + let s = /[\s\w)~]/; + o.match(s) || (a = l(o)); + const p = "" === i ? 0 : 1; + let c = "" === a ? t.length : t.length - 1; + const g = (t = t.substring(p, c)).indexOf("("), + h = t.indexOf(")"); + if (g > 1 && h > g && h <= t.length) { + let d = t.substring(0, g).trim(); + const o = t.substring(g + 1, h); + if (((e = i + d + "(" + (0, n.x)(o.trim()) + ")"), h < t.length)) { + let i = t.substring(h + 1, h + 2); + "" !== a || i.match(s) ? (r = t.substring(h + 1).trim()) : ((a = l(i)), (r = t.substring(h + 2).trim())), + "" !== r && (":" === r.charAt(0) && (r = r.substring(1).trim()), (r = " : " + (0, n.x)(r)), (e += r)); + } + } else e = i + (0, n.x)(t); + return { displayText: e, cssStyle: a }; + }, + s = function (t, e, a, r) { + let n = o(e); + const i = t.append("tspan").attr("x", r.padding).text(n.displayText); + "" !== n.cssStyle && i.attr("style", n.cssStyle), a || i.attr("dy", r.textHeight); + }, + l = function (t) { + switch (t) { + case "*": + return "font-style:italic;"; + case "$": + return "text-decoration:underline;"; + default: + return ""; + } + }, + p = { + getClassTitleString: d, + drawClass: function (t, e, a, r) { + n.l.debug("Rendering class ", e, a); + const i = e.id, + o = { id: i, label: e.id, width: 0, height: 0 }, + l = t.append("g").attr("id", r.db.lookUpDomId(i)).attr("class", "classGroup"); + let p; + p = e.link + ? l + .append("svg:a") + .attr("xlink:href", e.link) + .attr("target", e.linkTarget) + .append("text") + .attr("y", a.textHeight + a.padding) + .attr("x", 0) + : l + .append("text") + .attr("y", a.textHeight + a.padding) + .attr("x", 0); + let c = !0; + e.annotations.forEach(function (t) { + const e = p.append("tspan").text("«" + t + "»"); + c || e.attr("dy", a.textHeight), (c = !1); + }); + let g = d(e); + const h = p.append("tspan").text(g).attr("class", "title"); + c || h.attr("dy", a.textHeight); + const f = p.node().getBBox().height, + u = l + .append("line") + .attr("x1", 0) + .attr("y1", a.padding + f + a.dividerMargin / 2) + .attr("y2", a.padding + f + a.dividerMargin / 2), + x = l + .append("text") + .attr("x", a.padding) + .attr("y", f + a.dividerMargin + a.textHeight) + .attr("fill", "white") + .attr("class", "classText"); + (c = !0), + e.members.forEach(function (t) { + s(x, t, c, a), (c = !1); + }); + const y = x.node().getBBox(), + b = l + .append("line") + .attr("x1", 0) + .attr("y1", a.padding + f + a.dividerMargin + y.height) + .attr("y2", a.padding + f + a.dividerMargin + y.height), + m = l + .append("text") + .attr("x", a.padding) + .attr("y", f + 2 * a.dividerMargin + y.height + a.textHeight) + .attr("fill", "white") + .attr("class", "classText"); + (c = !0), + e.methods.forEach(function (t) { + s(m, t, c, a), (c = !1); + }); + const w = l.node().getBBox(); + var k = " "; + e.cssClasses.length > 0 && (k += e.cssClasses.join(" ")); + const E = l + .insert("rect", ":first-child") + .attr("x", 0) + .attr("y", 0) + .attr("width", w.width + 2 * a.padding) + .attr("height", w.height + a.padding + 0.5 * a.dividerMargin) + .attr("class", k) + .node() + .getBBox().width; + return ( + p.node().childNodes.forEach(function (t) { + t.setAttribute("x", (E - t.getBBox().width) / 2); + }), + e.tooltip && p.insert("title").text(e.tooltip), + u.attr("x2", E), + b.attr("x2", E), + (o.width = E), + (o.height = w.height + a.padding + 0.5 * a.dividerMargin), + o + ); + }, + drawEdge: function (t, e, a, d, o) { + const s = function (t) { + switch (t) { + case o.db.relationType.AGGREGATION: + return "aggregation"; + case o.db.relationType.EXTENSION: + return "extension"; + case o.db.relationType.COMPOSITION: + return "composition"; + case o.db.relationType.DEPENDENCY: + return "dependency"; + case o.db.relationType.LOLLIPOP: + return "lollipop"; + } + }; + e.points = e.points.filter((t) => !Number.isNaN(t.y)); + const l = e.points, + p = (0, r.jvg)() + .x(function (t) { + return t.x; + }) + .y(function (t) { + return t.y; + }) + .curve(r.$0Z), + c = t + .append("path") + .attr("d", p(l)) + .attr("id", "edge" + i) + .attr("class", "relation"); + let g, + h, + f = ""; + d.arrowMarkerAbsolute && + ((f = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search), + (f = f.replace(/\(/g, "\\(")), + (f = f.replace(/\)/g, "\\)"))), + 1 == a.relation.lineType && c.attr("class", "relation dashed-line"), + 10 == a.relation.lineType && c.attr("class", "relation dotted-line"), + "none" !== a.relation.type1 && c.attr("marker-start", "url(" + f + "#" + s(a.relation.type1) + "Start)"), + "none" !== a.relation.type2 && c.attr("marker-end", "url(" + f + "#" + s(a.relation.type2) + "End)"); + const u = e.points.length; + let x, + y, + b, + m, + w = n.u.calcLabelPosition(e.points); + if (((g = w.x), (h = w.y), u % 2 != 0 && u > 1)) { + let t = n.u.calcCardinalityPosition("none" !== a.relation.type1, e.points, e.points[0]), + r = n.u.calcCardinalityPosition("none" !== a.relation.type2, e.points, e.points[u - 1]); + n.l.debug("cardinality_1_point " + JSON.stringify(t)), + n.l.debug("cardinality_2_point " + JSON.stringify(r)), + (x = t.x), + (y = t.y), + (b = r.x), + (m = r.y); + } + if (void 0 !== a.title) { + const e = t.append("g").attr("class", "classLabel"), + r = e.append("text").attr("class", "label").attr("x", g).attr("y", h).attr("fill", "red").attr("text-anchor", "middle").text(a.title); + window.label = r; + const n = r.node().getBBox(); + e.insert("rect", ":first-child") + .attr("class", "box") + .attr("x", n.x - d.padding / 2) + .attr("y", n.y - d.padding / 2) + .attr("width", n.width + d.padding) + .attr("height", n.height + d.padding); + } + n.l.info("Rendering relation " + JSON.stringify(a)), + void 0 !== a.relationTitle1 && + "none" !== a.relationTitle1 && + t + .append("g") + .attr("class", "cardinality") + .append("text") + .attr("class", "type1") + .attr("x", x) + .attr("y", y) + .attr("fill", "black") + .attr("font-size", "6") + .text(a.relationTitle1), + void 0 !== a.relationTitle2 && + "none" !== a.relationTitle2 && + t + .append("g") + .attr("class", "cardinality") + .append("text") + .attr("class", "type2") + .attr("x", b) + .attr("y", m) + .attr("fill", "black") + .attr("font-size", "6") + .text(a.relationTitle2), + i++; + }, + drawNote: function (t, e, a, r) { + n.l.debug("Rendering note ", e, a); + const i = e.id, + d = { id: i, text: e.text, width: 0, height: 0 }, + o = t.append("g").attr("id", i).attr("class", "classGroup"); + let s = o + .append("text") + .attr("y", a.textHeight + a.padding) + .attr("x", 0); + const l = JSON.parse(`"${e.text}"`).split("\n"); + l.forEach(function (t) { + n.l.debug(`Adding line: ${t}`), s.append("tspan").text(t).attr("class", "title").attr("dy", a.textHeight); + }); + const p = o.node().getBBox(), + c = o + .insert("rect", ":first-child") + .attr("x", 0) + .attr("y", 0) + .attr("width", p.width + 2 * a.padding) + .attr("height", p.height + l.length * a.textHeight + a.padding + 0.5 * a.dividerMargin) + .node() + .getBBox().width; + return ( + s.node().childNodes.forEach(function (t) { + t.setAttribute("x", (c - t.getBBox().width) / 2); + }), + (d.width = c), + (d.height = p.height + l.length * a.textHeight + a.padding + 0.5 * a.dividerMargin), + d + ); + }, + parseMember: o, + }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/535-dcead599.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/535-dcead599.chunk.min.js new file mode 100644 index 000000000..64fce02f0 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/535-dcead599.chunk.min.js @@ -0,0 +1,1379 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [535], + { + 1535: function (t, e, i) { + i.d(e, { + D: function () { + return l; + }, + S: function () { + return c; + }, + a: function () { + return h; + }, + b: function () { + return a; + }, + c: function () { + return o; + }, + d: function () { + return B; + }, + p: function () { + return r; + }, + s: function () { + return P; + }, + }); + var s = i(9339), + n = (function () { + var t = function (t, e, i, s) { + for (i = i || {}, s = t.length; s--; i[t[s]] = e); + return i; + }, + e = [1, 2], + i = [1, 3], + s = [1, 5], + n = [1, 7], + r = [2, 5], + o = [1, 15], + a = [1, 17], + c = [1, 21], + l = [1, 22], + h = [1, 23], + u = [1, 24], + d = [1, 37], + p = [1, 25], + y = [1, 26], + f = [1, 27], + g = [1, 28], + m = [1, 29], + _ = [1, 32], + S = [1, 33], + k = [1, 34], + T = [1, 35], + b = [1, 36], + E = [1, 39], + v = [1, 40], + x = [1, 41], + D = [1, 42], + C = [1, 38], + $ = [1, 45], + A = [1, 4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], + L = [1, 4, 5, 14, 15, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], + I = [1, 4, 5, 7, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], + O = [4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], + N = { + trace: function () {}, + yy: {}, + symbols_: { + error: 2, + start: 3, + SPACE: 4, + NL: 5, + directive: 6, + SD: 7, + document: 8, + line: 9, + statement: 10, + classDefStatement: 11, + cssClassStatement: 12, + idStatement: 13, + DESCR: 14, + "--\x3e": 15, + HIDE_EMPTY: 16, + scale: 17, + WIDTH: 18, + COMPOSIT_STATE: 19, + STRUCT_START: 20, + STRUCT_STOP: 21, + STATE_DESCR: 22, + AS: 23, + ID: 24, + FORK: 25, + JOIN: 26, + CHOICE: 27, + CONCURRENT: 28, + note: 29, + notePosition: 30, + NOTE_TEXT: 31, + direction: 32, + acc_title: 33, + acc_title_value: 34, + acc_descr: 35, + acc_descr_value: 36, + acc_descr_multiline_value: 37, + classDef: 38, + CLASSDEF_ID: 39, + CLASSDEF_STYLEOPTS: 40, + DEFAULT: 41, + class: 42, + CLASSENTITY_IDS: 43, + STYLECLASS: 44, + openDirective: 45, + typeDirective: 46, + closeDirective: 47, + ":": 48, + argDirective: 49, + direction_tb: 50, + direction_bt: 51, + direction_rl: 52, + direction_lr: 53, + eol: 54, + ";": 55, + EDGE_STATE: 56, + STYLE_SEPARATOR: 57, + left_of: 58, + right_of: 59, + open_directive: 60, + type_directive: 61, + arg_directive: 62, + close_directive: 63, + $accept: 0, + $end: 1, + }, + terminals_: { + 2: "error", + 4: "SPACE", + 5: "NL", + 7: "SD", + 14: "DESCR", + 15: "--\x3e", + 16: "HIDE_EMPTY", + 17: "scale", + 18: "WIDTH", + 19: "COMPOSIT_STATE", + 20: "STRUCT_START", + 21: "STRUCT_STOP", + 22: "STATE_DESCR", + 23: "AS", + 24: "ID", + 25: "FORK", + 26: "JOIN", + 27: "CHOICE", + 28: "CONCURRENT", + 29: "note", + 31: "NOTE_TEXT", + 33: "acc_title", + 34: "acc_title_value", + 35: "acc_descr", + 36: "acc_descr_value", + 37: "acc_descr_multiline_value", + 38: "classDef", + 39: "CLASSDEF_ID", + 40: "CLASSDEF_STYLEOPTS", + 41: "DEFAULT", + 42: "class", + 43: "CLASSENTITY_IDS", + 44: "STYLECLASS", + 48: ":", + 50: "direction_tb", + 51: "direction_bt", + 52: "direction_rl", + 53: "direction_lr", + 55: ";", + 56: "EDGE_STATE", + 57: "STYLE_SEPARATOR", + 58: "left_of", + 59: "right_of", + 60: "open_directive", + 61: "type_directive", + 62: "arg_directive", + 63: "close_directive", + }, + productions_: [ + 0, + [3, 2], + [3, 2], + [3, 2], + [3, 2], + [8, 0], + [8, 2], + [9, 2], + [9, 1], + [9, 1], + [10, 1], + [10, 1], + [10, 1], + [10, 2], + [10, 3], + [10, 4], + [10, 1], + [10, 2], + [10, 1], + [10, 4], + [10, 3], + [10, 6], + [10, 1], + [10, 1], + [10, 1], + [10, 1], + [10, 4], + [10, 4], + [10, 1], + [10, 1], + [10, 2], + [10, 2], + [10, 1], + [11, 3], + [11, 3], + [12, 3], + [6, 3], + [6, 5], + [32, 1], + [32, 1], + [32, 1], + [32, 1], + [54, 1], + [54, 1], + [13, 1], + [13, 1], + [13, 3], + [13, 3], + [30, 1], + [30, 1], + [45, 1], + [46, 1], + [49, 1], + [47, 1], + ], + performAction: function (t, e, i, s, n, r, o) { + var a = r.length - 1; + switch (n) { + case 4: + return s.setRootDoc(r[a]), r[a]; + case 5: + this.$ = []; + break; + case 6: + "nl" != r[a] && (r[a - 1].push(r[a]), (this.$ = r[a - 1])); + break; + case 7: + case 8: + case 12: + this.$ = r[a]; + break; + case 9: + this.$ = "nl"; + break; + case 13: + const t = r[a - 1]; + (t.description = s.trimColon(r[a])), (this.$ = t); + break; + case 14: + this.$ = { stmt: "relation", state1: r[a - 2], state2: r[a] }; + break; + case 15: + const e = s.trimColon(r[a]); + this.$ = { + stmt: "relation", + state1: r[a - 3], + state2: r[a - 1], + description: e, + }; + break; + case 19: + this.$ = { + stmt: "state", + id: r[a - 3], + type: "default", + description: "", + doc: r[a - 1], + }; + break; + case 20: + var c = r[a], + l = r[a - 2].trim(); + if (r[a].match(":")) { + var h = r[a].split(":"); + (c = h[0]), (l = [l, h[1]]); + } + this.$ = { stmt: "state", id: c, type: "default", description: l }; + break; + case 21: + this.$ = { + stmt: "state", + id: r[a - 3], + type: "default", + description: r[a - 5], + doc: r[a - 1], + }; + break; + case 22: + this.$ = { stmt: "state", id: r[a], type: "fork" }; + break; + case 23: + this.$ = { stmt: "state", id: r[a], type: "join" }; + break; + case 24: + this.$ = { stmt: "state", id: r[a], type: "choice" }; + break; + case 25: + this.$ = { stmt: "state", id: s.getDividerId(), type: "divider" }; + break; + case 26: + this.$ = { + stmt: "state", + id: r[a - 1].trim(), + note: { position: r[a - 2].trim(), text: r[a].trim() }, + }; + break; + case 30: + (this.$ = r[a].trim()), s.setAccTitle(this.$); + break; + case 31: + case 32: + (this.$ = r[a].trim()), s.setAccDescription(this.$); + break; + case 33: + case 34: + this.$ = { stmt: "classDef", id: r[a - 1].trim(), classes: r[a].trim() }; + break; + case 35: + this.$ = { stmt: "applyClass", id: r[a - 1].trim(), styleClass: r[a].trim() }; + break; + case 38: + s.setDirection("TB"), (this.$ = { stmt: "dir", value: "TB" }); + break; + case 39: + s.setDirection("BT"), (this.$ = { stmt: "dir", value: "BT" }); + break; + case 40: + s.setDirection("RL"), (this.$ = { stmt: "dir", value: "RL" }); + break; + case 41: + s.setDirection("LR"), (this.$ = { stmt: "dir", value: "LR" }); + break; + case 44: + case 45: + this.$ = { stmt: "state", id: r[a].trim(), type: "default", description: "" }; + break; + case 46: + case 47: + this.$ = { + stmt: "state", + id: r[a - 2].trim(), + classes: [r[a].trim()], + type: "default", + description: "", + }; + break; + case 50: + s.parseDirective("%%{", "open_directive"); + break; + case 51: + s.parseDirective(r[a], "type_directive"); + break; + case 52: + (r[a] = r[a].trim().replace(/'/g, '"')), s.parseDirective(r[a], "arg_directive"); + break; + case 53: + s.parseDirective("}%%", "close_directive", "state"); + } + }, + table: [ + { 3: 1, 4: e, 5: i, 6: 4, 7: s, 45: 6, 60: n }, + { 1: [3] }, + { 3: 8, 4: e, 5: i, 6: 4, 7: s, 45: 6, 60: n }, + { 3: 9, 4: e, 5: i, 6: 4, 7: s, 45: 6, 60: n }, + { 3: 10, 4: e, 5: i, 6: 4, 7: s, 45: 6, 60: n }, + t([1, 4, 5, 16, 17, 19, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], r, { 8: 11 }), + { 46: 12, 61: [1, 13] }, + { 61: [2, 50] }, + { 1: [2, 1] }, + { 1: [2, 2] }, + { 1: [2, 3] }, + { + 1: [2, 4], + 4: o, + 5: a, + 6: 30, + 9: 14, + 10: 16, + 11: 18, + 12: 19, + 13: 20, + 16: c, + 17: l, + 19: h, + 22: u, + 24: d, + 25: p, + 26: y, + 27: f, + 28: g, + 29: m, + 32: 31, + 33: _, + 35: S, + 37: k, + 38: T, + 42: b, + 45: 6, + 50: E, + 51: v, + 52: x, + 53: D, + 56: C, + 60: n, + }, + { 47: 43, 48: [1, 44], 63: $ }, + t([48, 63], [2, 51]), + t(A, [2, 6]), + { + 6: 30, + 10: 46, + 11: 18, + 12: 19, + 13: 20, + 16: c, + 17: l, + 19: h, + 22: u, + 24: d, + 25: p, + 26: y, + 27: f, + 28: g, + 29: m, + 32: 31, + 33: _, + 35: S, + 37: k, + 38: T, + 42: b, + 45: 6, + 50: E, + 51: v, + 52: x, + 53: D, + 56: C, + 60: n, + }, + t(A, [2, 8]), + t(A, [2, 9]), + t(A, [2, 10]), + t(A, [2, 11]), + t(A, [2, 12], { 14: [1, 47], 15: [1, 48] }), + t(A, [2, 16]), + { 18: [1, 49] }, + t(A, [2, 18], { 20: [1, 50] }), + { 23: [1, 51] }, + t(A, [2, 22]), + t(A, [2, 23]), + t(A, [2, 24]), + t(A, [2, 25]), + { 30: 52, 31: [1, 53], 58: [1, 54], 59: [1, 55] }, + t(A, [2, 28]), + t(A, [2, 29]), + { 34: [1, 56] }, + { 36: [1, 57] }, + t(A, [2, 32]), + { 39: [1, 58], 41: [1, 59] }, + { 43: [1, 60] }, + t(L, [2, 44], { 57: [1, 61] }), + t(L, [2, 45], { 57: [1, 62] }), + t(A, [2, 38]), + t(A, [2, 39]), + t(A, [2, 40]), + t(A, [2, 41]), + t(I, [2, 36]), + { 49: 63, 62: [1, 64] }, + t(I, [2, 53]), + t(A, [2, 7]), + t(A, [2, 13]), + { 13: 65, 24: d, 56: C }, + t(A, [2, 17]), + t(O, r, { 8: 66 }), + { 24: [1, 67] }, + { 24: [1, 68] }, + { 23: [1, 69] }, + { 24: [2, 48] }, + { 24: [2, 49] }, + t(A, [2, 30]), + t(A, [2, 31]), + { 40: [1, 70] }, + { 40: [1, 71] }, + { 44: [1, 72] }, + { 24: [1, 73] }, + { 24: [1, 74] }, + { 47: 75, 63: $ }, + { 63: [2, 52] }, + t(A, [2, 14], { 14: [1, 76] }), + { + 4: o, + 5: a, + 6: 30, + 9: 14, + 10: 16, + 11: 18, + 12: 19, + 13: 20, + 16: c, + 17: l, + 19: h, + 21: [1, 77], + 22: u, + 24: d, + 25: p, + 26: y, + 27: f, + 28: g, + 29: m, + 32: 31, + 33: _, + 35: S, + 37: k, + 38: T, + 42: b, + 45: 6, + 50: E, + 51: v, + 52: x, + 53: D, + 56: C, + 60: n, + }, + t(A, [2, 20], { 20: [1, 78] }), + { 31: [1, 79] }, + { 24: [1, 80] }, + t(A, [2, 33]), + t(A, [2, 34]), + t(A, [2, 35]), + t(L, [2, 46]), + t(L, [2, 47]), + t(I, [2, 37]), + t(A, [2, 15]), + t(A, [2, 19]), + t(O, r, { 8: 81 }), + t(A, [2, 26]), + t(A, [2, 27]), + { + 4: o, + 5: a, + 6: 30, + 9: 14, + 10: 16, + 11: 18, + 12: 19, + 13: 20, + 16: c, + 17: l, + 19: h, + 21: [1, 82], + 22: u, + 24: d, + 25: p, + 26: y, + 27: f, + 28: g, + 29: m, + 32: 31, + 33: _, + 35: S, + 37: k, + 38: T, + 42: b, + 45: 6, + 50: E, + 51: v, + 52: x, + 53: D, + 56: C, + 60: n, + }, + t(A, [2, 21]), + ], + defaultActions: { + 7: [2, 50], + 8: [2, 1], + 9: [2, 2], + 10: [2, 3], + 54: [2, 48], + 55: [2, 49], + 64: [2, 52], + }, + parseError: function (t, e) { + if (!e.recoverable) { + var i = new Error(t); + throw ((i.hash = e), i); + } + this.trace(t); + }, + parse: function (t) { + var e = [0], + i = [], + s = [null], + n = [], + r = this.table, + o = "", + a = 0, + c = 0, + l = n.slice.call(arguments, 1), + h = Object.create(this.lexer), + u = { yy: {} }; + for (var d in this.yy) Object.prototype.hasOwnProperty.call(this.yy, d) && (u.yy[d] = this.yy[d]); + h.setInput(t, u.yy), (u.yy.lexer = h), (u.yy.parser = this), void 0 === h.yylloc && (h.yylloc = {}); + var p = h.yylloc; + n.push(p); + var y = h.options && h.options.ranges; + "function" == typeof u.yy.parseError + ? (this.parseError = u.yy.parseError) + : (this.parseError = Object.getPrototypeOf(this).parseError); + for (var f, g, m, _, S, k, T, b, E, v = {}; ; ) { + if ( + ((g = e[e.length - 1]), + this.defaultActions[g] + ? (m = this.defaultActions[g]) + : (null == f && + ((E = void 0), + "number" != typeof (E = i.pop() || h.lex() || 1) && + (E instanceof Array && (E = (i = E).pop()), (E = this.symbols_[E] || E)), + (f = E)), + (m = r[g] && r[g][f])), + void 0 === m || !m.length || !m[0]) + ) { + var x; + for (S in ((b = []), r[g])) this.terminals_[S] && S > 2 && b.push("'" + this.terminals_[S] + "'"); + (x = h.showPosition + ? "Parse error on line " + + (a + 1) + + ":\n" + + h.showPosition() + + "\nExpecting " + + b.join(", ") + + ", got '" + + (this.terminals_[f] || f) + + "'" + : "Parse error on line " + (a + 1) + ": Unexpected " + (1 == f ? "end of input" : "'" + (this.terminals_[f] || f) + "'")), + this.parseError(x, { + text: h.match, + token: this.terminals_[f] || f, + line: h.yylineno, + loc: p, + expected: b, + }); + } + if (m[0] instanceof Array && m.length > 1) + throw new Error("Parse Error: multiple actions possible at state: " + g + ", token: " + f); + switch (m[0]) { + case 1: + e.push(f), + s.push(h.yytext), + n.push(h.yylloc), + e.push(m[1]), + (f = null), + (c = h.yyleng), + (o = h.yytext), + (a = h.yylineno), + (p = h.yylloc); + break; + case 2: + if ( + ((k = this.productions_[m[1]][1]), + (v.$ = s[s.length - k]), + (v._$ = { + first_line: n[n.length - (k || 1)].first_line, + last_line: n[n.length - 1].last_line, + first_column: n[n.length - (k || 1)].first_column, + last_column: n[n.length - 1].last_column, + }), + y && (v._$.range = [n[n.length - (k || 1)].range[0], n[n.length - 1].range[1]]), + void 0 !== (_ = this.performAction.apply(v, [o, c, a, u.yy, m[1], s, n].concat(l)))) + ) + return _; + k && ((e = e.slice(0, -1 * k * 2)), (s = s.slice(0, -1 * k)), (n = n.slice(0, -1 * k))), + e.push(this.productions_[m[1]][0]), + s.push(v.$), + n.push(v._$), + (T = r[e[e.length - 2]][e[e.length - 1]]), + e.push(T); + break; + case 3: + return !0; + } + } + return !0; + }, + }, + R = { + EOF: 1, + parseError: function (t, e) { + if (!this.yy.parser) throw new Error(t); + this.yy.parser.parseError(t, e); + }, + setInput: function (t, e) { + return ( + (this.yy = e || this.yy || {}), + (this._input = t), + (this._more = this._backtrack = this.done = !1), + (this.yylineno = this.yyleng = 0), + (this.yytext = this.matched = this.match = ""), + (this.conditionStack = ["INITIAL"]), + (this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }), + this.options.ranges && (this.yylloc.range = [0, 0]), + (this.offset = 0), + this + ); + }, + input: function () { + var t = this._input[0]; + return ( + (this.yytext += t), + this.yyleng++, + this.offset++, + (this.match += t), + (this.matched += t), + t.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, + this.options.ranges && this.yylloc.range[1]++, + (this._input = this._input.slice(1)), + t + ); + }, + unput: function (t) { + var e = t.length, + i = t.split(/(?:\r\n?|\n)/g); + (this._input = t + this._input), (this.yytext = this.yytext.substr(0, this.yytext.length - e)), (this.offset -= e); + var s = this.match.split(/(?:\r\n?|\n)/g); + (this.match = this.match.substr(0, this.match.length - 1)), + (this.matched = this.matched.substr(0, this.matched.length - 1)), + i.length - 1 && (this.yylineno -= i.length - 1); + var n = this.yylloc.range; + return ( + (this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: i + ? (i.length === s.length ? this.yylloc.first_column : 0) + s[s.length - i.length].length - i[0].length + : this.yylloc.first_column - e, + }), + this.options.ranges && (this.yylloc.range = [n[0], n[0] + this.yyleng - e]), + (this.yyleng = this.yytext.length), + this + ); + }, + more: function () { + return (this._more = !0), this; + }, + reject: function () { + return this.options.backtrack_lexer + ? ((this._backtrack = !0), this) + : this.parseError( + "Lexical error on line " + + (this.yylineno + 1) + + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + + this.showPosition(), + { text: "", token: null, line: this.yylineno }, + ); + }, + less: function (t) { + this.unput(this.match.slice(t)); + }, + pastInput: function () { + var t = this.matched.substr(0, this.matched.length - this.match.length); + return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, ""); + }, + upcomingInput: function () { + var t = this.match; + return ( + t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "") + ); + }, + showPosition: function () { + var t = this.pastInput(), + e = new Array(t.length + 1).join("-"); + return t + this.upcomingInput() + "\n" + e + "^"; + }, + test_match: function (t, e) { + var i, s, n; + if ( + (this.options.backtrack_lexer && + ((n = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column, + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done, + }), + this.options.ranges && (n.yylloc.range = this.yylloc.range.slice(0))), + (s = t[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += s.length), + (this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: s ? s[s.length - 1].length - s[s.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length, + }), + (this.yytext += t[0]), + (this.match += t[0]), + (this.matches = t), + (this.yyleng = this.yytext.length), + this.options.ranges && (this.yylloc.range = [this.offset, (this.offset += this.yyleng)]), + (this._more = !1), + (this._backtrack = !1), + (this._input = this._input.slice(t[0].length)), + (this.matched += t[0]), + (i = this.performAction.call(this, this.yy, this, e, this.conditionStack[this.conditionStack.length - 1])), + this.done && this._input && (this.done = !1), + i) + ) + return i; + if (this._backtrack) { + for (var r in n) this[r] = n[r]; + return !1; + } + return !1; + }, + next: function () { + if (this.done) return this.EOF; + var t, e, i, s; + this._input || (this.done = !0), this._more || ((this.yytext = ""), (this.match = "")); + for (var n = this._currentRules(), r = 0; r < n.length; r++) + if ((i = this._input.match(this.rules[n[r]])) && (!e || i[0].length > e[0].length)) { + if (((e = i), (s = r), this.options.backtrack_lexer)) { + if (!1 !== (t = this.test_match(i, n[r]))) return t; + if (this._backtrack) { + e = !1; + continue; + } + return !1; + } + if (!this.options.flex) break; + } + return e + ? !1 !== (t = this.test_match(e, n[s])) && t + : "" === this._input + ? this.EOF + : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno, + }); + }, + lex: function () { + return this.next() || this.lex(); + }, + begin: function (t) { + this.conditionStack.push(t); + }, + popState: function () { + return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]; + }, + _currentRules: function () { + return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] + ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules + : this.conditions.INITIAL.rules; + }, + topState: function (t) { + return (t = this.conditionStack.length - 1 - Math.abs(t || 0)) >= 0 ? this.conditionStack[t] : "INITIAL"; + }, + pushState: function (t) { + this.begin(t); + }, + stateStackSize: function () { + return this.conditionStack.length; + }, + options: { "case-insensitive": !0 }, + performAction: function (t, e, i, s) { + switch (i) { + case 0: + return 41; + case 1: + case 44: + return 50; + case 2: + case 45: + return 51; + case 3: + case 46: + return 52; + case 4: + case 47: + return 53; + case 5: + return this.begin("open_directive"), 60; + case 6: + return this.begin("type_directive"), 61; + case 7: + return this.popState(), this.begin("arg_directive"), 48; + case 8: + return this.popState(), this.popState(), 63; + case 9: + return 62; + case 10: + case 11: + case 13: + case 14: + case 15: + case 16: + case 56: + case 58: + case 64: + break; + case 12: + case 79: + return 5; + case 17: + case 34: + return this.pushState("SCALE"), 17; + case 18: + case 35: + return 18; + case 19: + case 25: + case 36: + case 51: + case 54: + this.popState(); + break; + case 20: + return this.begin("acc_title"), 33; + case 21: + return this.popState(), "acc_title_value"; + case 22: + return this.begin("acc_descr"), 35; + case 23: + return this.popState(), "acc_descr_value"; + case 24: + this.begin("acc_descr_multiline"); + break; + case 26: + return "acc_descr_multiline_value"; + case 27: + return this.pushState("CLASSDEF"), 38; + case 28: + return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID"; + case 29: + return this.popState(), this.pushState("CLASSDEFID"), 39; + case 30: + return this.popState(), 40; + case 31: + return this.pushState("CLASS"), 42; + case 32: + return this.popState(), this.pushState("CLASS_STYLE"), 43; + case 33: + return this.popState(), 44; + case 37: + this.pushState("STATE"); + break; + case 38: + case 41: + return this.popState(), (e.yytext = e.yytext.slice(0, -8).trim()), 25; + case 39: + case 42: + return this.popState(), (e.yytext = e.yytext.slice(0, -8).trim()), 26; + case 40: + case 43: + return this.popState(), (e.yytext = e.yytext.slice(0, -10).trim()), 27; + case 48: + this.pushState("STATE_STRING"); + break; + case 49: + return this.pushState("STATE_ID"), "AS"; + case 50: + case 66: + return this.popState(), "ID"; + case 52: + return "STATE_DESCR"; + case 53: + return 19; + case 55: + return this.popState(), this.pushState("struct"), 20; + case 57: + return this.popState(), 21; + case 59: + return this.begin("NOTE"), 29; + case 60: + return this.popState(), this.pushState("NOTE_ID"), 58; + case 61: + return this.popState(), this.pushState("NOTE_ID"), 59; + case 62: + this.popState(), this.pushState("FLOATING_NOTE"); + break; + case 63: + return this.popState(), this.pushState("FLOATING_NOTE_ID"), "AS"; + case 65: + return "NOTE_TEXT"; + case 67: + return this.popState(), this.pushState("NOTE_TEXT"), 24; + case 68: + return this.popState(), (e.yytext = e.yytext.substr(2).trim()), 31; + case 69: + return this.popState(), (e.yytext = e.yytext.slice(0, -8).trim()), 31; + case 70: + case 71: + return 7; + case 72: + return 16; + case 73: + return 56; + case 74: + return 24; + case 75: + return (e.yytext = e.yytext.trim()), 14; + case 76: + return 15; + case 77: + return 28; + case 78: + return 57; + case 80: + return "INVALID"; + } + }, + rules: [ + /^(?:default\b)/i, + /^(?:.*direction\s+TB[^\n]*)/i, + /^(?:.*direction\s+BT[^\n]*)/i, + /^(?:.*direction\s+RL[^\n]*)/i, + /^(?:.*direction\s+LR[^\n]*)/i, + /^(?:%%\{)/i, + /^(?:((?:(?!\}%%)[^:.])*))/i, + /^(?::)/i, + /^(?:\}%%)/i, + /^(?:((?:(?!\}%%).|\n)*))/i, + /^(?:%%(?!\{)[^\n]*)/i, + /^(?:[^\}]%%[^\n]*)/i, + /^(?:[\n]+)/i, + /^(?:[\s]+)/i, + /^(?:((?!\n)\s)+)/i, + /^(?:#[^\n]*)/i, + /^(?:%[^\n]*)/i, + /^(?:scale\s+)/i, + /^(?:\d+)/i, + /^(?:\s+width\b)/i, + /^(?:accTitle\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*\{\s*)/i, + /^(?:[\}])/i, + /^(?:[^\}]*)/i, + /^(?:classDef\s+)/i, + /^(?:DEFAULT\s+)/i, + /^(?:\w+\s+)/i, + /^(?:[^\n]*)/i, + /^(?:class\s+)/i, + /^(?:(\w+)+((,\s*\w+)*))/i, + /^(?:[^\n]*)/i, + /^(?:scale\s+)/i, + /^(?:\d+)/i, + /^(?:\s+width\b)/i, + /^(?:state\s+)/i, + /^(?:.*<>)/i, + /^(?:.*<>)/i, + /^(?:.*<>)/i, + /^(?:.*\[\[fork\]\])/i, + /^(?:.*\[\[join\]\])/i, + /^(?:.*\[\[choice\]\])/i, + /^(?:.*direction\s+TB[^\n]*)/i, + /^(?:.*direction\s+BT[^\n]*)/i, + /^(?:.*direction\s+RL[^\n]*)/i, + /^(?:.*direction\s+LR[^\n]*)/i, + /^(?:["])/i, + /^(?:\s*as\s+)/i, + /^(?:[^\n\{]*)/i, + /^(?:["])/i, + /^(?:[^"]*)/i, + /^(?:[^\n\s\{]+)/i, + /^(?:\n)/i, + /^(?:\{)/i, + /^(?:%%(?!\{)[^\n]*)/i, + /^(?:\})/i, + /^(?:[\n])/i, + /^(?:note\s+)/i, + /^(?:left of\b)/i, + /^(?:right of\b)/i, + /^(?:")/i, + /^(?:\s*as\s*)/i, + /^(?:["])/i, + /^(?:[^"]*)/i, + /^(?:[^\n]*)/i, + /^(?:\s*[^:\n\s\-]+)/i, + /^(?:\s*:[^:\n;]+)/i, + /^(?:[\s\S]*?end note\b)/i, + /^(?:stateDiagram\s+)/i, + /^(?:stateDiagram-v2\s+)/i, + /^(?:hide empty description\b)/i, + /^(?:\[\*\])/i, + /^(?:[^:\n\s\-\{]+)/i, + /^(?:\s*:[^:\n;]+)/i, + /^(?:-->)/i, + /^(?:--)/i, + /^(?::::)/i, + /^(?:$)/i, + /^(?:.)/i, + ], + conditions: { + LINE: { rules: [14, 15], inclusive: !1 }, + close_directive: { rules: [14, 15], inclusive: !1 }, + arg_directive: { rules: [8, 9, 14, 15], inclusive: !1 }, + type_directive: { rules: [7, 8, 14, 15], inclusive: !1 }, + open_directive: { rules: [6, 14, 15], inclusive: !1 }, + struct: { + rules: [14, 15, 27, 31, 37, 44, 45, 46, 47, 56, 57, 58, 59, 73, 74, 75, 76, 77], + inclusive: !1, + }, + FLOATING_NOTE_ID: { rules: [66], inclusive: !1 }, + FLOATING_NOTE: { rules: [63, 64, 65], inclusive: !1 }, + NOTE_TEXT: { rules: [68, 69], inclusive: !1 }, + NOTE_ID: { rules: [67], inclusive: !1 }, + NOTE: { rules: [60, 61, 62], inclusive: !1 }, + CLASS_STYLE: { rules: [33], inclusive: !1 }, + CLASS: { rules: [32], inclusive: !1 }, + CLASSDEFID: { rules: [30], inclusive: !1 }, + CLASSDEF: { rules: [28, 29], inclusive: !1 }, + acc_descr_multiline: { rules: [25, 26], inclusive: !1 }, + acc_descr: { rules: [23], inclusive: !1 }, + acc_title: { rules: [21], inclusive: !1 }, + SCALE: { rules: [18, 19, 35, 36], inclusive: !1 }, + ALIAS: { rules: [], inclusive: !1 }, + STATE_ID: { rules: [50], inclusive: !1 }, + STATE_STRING: { rules: [51, 52], inclusive: !1 }, + FORK_STATE: { rules: [], inclusive: !1 }, + STATE: { + rules: [14, 15, 38, 39, 40, 41, 42, 43, 48, 49, 53, 54, 55], + inclusive: !1, + }, + ID: { rules: [14, 15], inclusive: !1 }, + INITIAL: { + rules: [0, 1, 2, 3, 4, 5, 10, 11, 12, 13, 15, 16, 17, 20, 22, 24, 27, 31, 34, 37, 55, 59, 70, 71, 72, 73, 74, 75, 76, 78, 79, 80], + inclusive: !0, + }, + }, + }; + function w() { + this.yy = {}; + } + return (N.lexer = R), (w.prototype = N), (N.Parser = w), new w(); + })(); + n.parser = n; + const r = n, + o = "TB", + a = "state", + c = "relation", + l = "default", + h = "divider", + u = "[*]", + d = "start", + p = u, + y = "color", + f = "fill"; + let g = "LR", + m = [], + _ = {}, + S = { root: { relations: [], states: {}, documents: {} } }, + k = S.root, + T = 0, + b = 0; + const E = (t) => JSON.parse(JSON.stringify(t)), + v = (t, e, i) => { + if (e.stmt === c) v(t, e.state1, !0), v(t, e.state2, !1); + else if ((e.stmt === a && ("[*]" === e.id ? ((e.id = i ? t.id + "_start" : t.id + "_end"), (e.start = i)) : (e.id = e.id.trim())), e.doc)) { + const t = []; + let i, + n = []; + for (i = 0; i < e.doc.length; i++) + if (e.doc[i].type === h) { + const s = E(e.doc[i]); + (s.doc = E(n)), t.push(s), (n = []); + } else n.push(e.doc[i]); + if (t.length > 0 && n.length > 0) { + const i = { stmt: a, id: (0, s.I)(), type: "divider", doc: E(n) }; + t.push(E(i)), (e.doc = t); + } + e.doc.forEach((t) => v(e, t, !0)); + } + }, + x = function (t, e = l, i = null, n = null, r = null, o = null, a = null, c = null) { + const h = null == t ? void 0 : t.trim(); + void 0 === k.states[h] + ? (s.l.info("Adding state ", h, n), + (k.states[h] = { + id: h, + descriptions: [], + type: e, + doc: i, + note: r, + classes: [], + styles: [], + textStyles: [], + })) + : (k.states[h].doc || (k.states[h].doc = i), k.states[h].type || (k.states[h].type = e)), + n && + (s.l.info("Setting state description", h, n), + "string" == typeof n && I(h, n.trim()), + "object" == typeof n && n.forEach((t) => I(h, t.trim()))), + r && ((k.states[h].note = r), (k.states[h].note.text = s.e.sanitizeText(k.states[h].note.text, (0, s.c)()))), + o && (s.l.info("Setting state classes", h, o), ("string" == typeof o ? [o] : o).forEach((t) => N(h, t.trim()))), + a && (s.l.info("Setting state styles", h, a), ("string" == typeof a ? [a] : a).forEach((t) => R(h, t.trim()))), + c && (s.l.info("Setting state styles", h, a), ("string" == typeof c ? [c] : c).forEach((t) => w(h, t.trim()))); + }, + D = function (t) { + (S = { root: { relations: [], states: {}, documents: {} } }), (k = S.root), (T = 0), (_ = {}), t || (0, s.v)(); + }, + C = function (t) { + return k.states[t]; + }; + function $(t = "") { + let e = t; + return t === u && (T++, (e = `${d}${T}`)), e; + } + function A(t = "", e = l) { + return t === u ? d : e; + } + const L = function (t, e, i) { + if ("object" == typeof t) + !(function (t, e, i) { + let n = $(t.id.trim()), + r = A(t.id.trim(), t.type), + o = $(e.id.trim()), + a = A(e.id.trim(), e.type); + x(n, r, t.doc, t.description, t.note, t.classes, t.styles, t.textStyles), + x(o, a, e.doc, e.description, e.note, e.classes, e.styles, e.textStyles), + k.relations.push({ + id1: n, + id2: o, + relationTitle: s.e.sanitizeText(i, (0, s.c)()), + }); + })(t, e, i); + else { + const n = $(t.trim()), + r = A(t), + o = (function (t = "") { + let e = t; + return t === p && (T++, (e = `end${T}`)), e; + })(e.trim()), + a = (function (t = "", e = l) { + return t === p ? "end" : e; + })(e); + x(n, r), x(o, a), k.relations.push({ id1: n, id2: o, title: s.e.sanitizeText(i, (0, s.c)()) }); + } + }, + I = function (t, e) { + const i = k.states[t], + n = e.startsWith(":") ? e.replace(":", "").trim() : e; + i.descriptions.push(s.e.sanitizeText(n, (0, s.c)())); + }, + O = function (t, e = "") { + void 0 === _[t] && (_[t] = { id: t, styles: [], textStyles: [] }); + const i = _[t]; + null != e && + e.split(",").forEach((t) => { + const e = t.replace(/([^;]*);/, "$1").trim(); + if (t.match(y)) { + const t = e.replace(f, "bgFill").replace(y, f); + i.textStyles.push(t); + } + i.styles.push(e); + }); + }, + N = function (t, e) { + t.split(",").forEach(function (t) { + let i = C(t); + if (void 0 === i) { + const e = t.trim(); + x(e), (i = C(e)); + } + i.classes.push(e); + }); + }, + R = function (t, e) { + const i = C(t); + void 0 !== i && i.textStyles.push(e); + }, + w = function (t, e) { + const i = C(t); + void 0 !== i && i.textStyles.push(e); + }, + B = { + parseDirective: function (t, e, i) { + s.m.parseDirective(this, t, e, i); + }, + getConfig: () => (0, s.c)().state, + addState: x, + clear: D, + getState: C, + getStates: function () { + return k.states; + }, + getRelations: function () { + return k.relations; + }, + getClasses: function () { + return _; + }, + getDirection: () => g, + addRelation: L, + getDividerId: () => (b++, "divider-id-" + b), + setDirection: (t) => { + g = t; + }, + cleanupLabel: function (t) { + return ":" === t.substring(0, 1) ? t.substr(2).trim() : t.trim(); + }, + lineType: { LINE: 0, DOTTED_LINE: 1 }, + relationType: { AGGREGATION: 0, EXTENSION: 1, COMPOSITION: 2, DEPENDENCY: 3 }, + logDocuments: function () { + s.l.info("Documents = ", S); + }, + getRootDoc: () => m, + setRootDoc: (t) => { + s.l.info("Setting root doc", t), (m = t); + }, + getRootDocV2: () => (v({ id: "root" }, { id: "root", doc: m }, !0), { id: "root", doc: m }), + extract: (t) => { + let e; + (e = t.doc ? t.doc : t), + s.l.info(e), + D(!0), + s.l.info("Extract", e), + e.forEach((t) => { + switch (t.stmt) { + case a: + x(t.id.trim(), t.type, t.doc, t.description, t.note, t.classes, t.styles, t.textStyles); + break; + case c: + L(t.state1, t.state2, t.description); + break; + case "classDef": + O(t.id.trim(), t.classes); + break; + case "applyClass": + N(t.id.trim(), t.styleClass); + } + }); + }, + trimColon: (t) => (t && ":" === t[0] ? t.substr(1).trim() : t.trim()), + getAccTitle: s.g, + setAccTitle: s.s, + getAccDescription: s.a, + setAccDescription: s.b, + addStyleClass: O, + setCssClass: N, + addDescription: I, + setDiagramTitle: s.r, + getDiagramTitle: s.t, + }, + P = (t) => + `\ndefs #statediagram-barbEnd {\n fill: ${t.transitionColor};\n stroke: ${t.transitionColor};\n }\ng.stateGroup text {\n fill: ${t.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${t.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${t.lineColor};\n stroke-width: 1;\n}\n\n.transition {\n stroke: ${t.transitionColor};\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${t.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n\n text {\n fill: ${t.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${t.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel .label text {\n fill: ${t.transitionLabelColor || t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${t.transitionLabelColor || t.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${t.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${t.innerEndBackground};\n stroke: ${t.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${t.compositeBackground || t.background};\n // stroke: ${t.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${t.stateBkg || t.mainBkg};\n stroke: ${t.stateBorder || t.nodeBorder};\n stroke-width: 1px;\n}\n.node polygon {\n fill: ${t.mainBkg};\n stroke: ${t.stateBorder || t.nodeBorder};;\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${t.compositeTitleBackground};\n stroke: ${t.stateBorder || t.nodeBorder};\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${t.stateLabelColor};\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${t.stateBorder || t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${t.compositeBackground || t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${t.altBackground ? t.altBackground : "#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${t.altBackground ? t.altBackground : "#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${t.noteTextColor};\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ${t.lineColor};\n stroke: ${t.lineColor};\n stroke-width: 1;\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n`; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/545-8e970b03.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/545-8e970b03.chunk.min.js new file mode 100644 index 000000000..aff23f83f --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/545-8e970b03.chunk.min.js @@ -0,0 +1,3019 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [545], + { + 4545: function (t, e, n) { + n.d(e, { + diagram: function () { + return Q; + }, + }); + var i = n(9339), + a = n(7274), + s = n(8252), + r = n(7967), + l = + (n(7484), + n(7856), + (function () { + var t = function (t, e, n, i) { + for (n = n || {}, i = t.length; i--; n[t[i]] = e); + return n; + }, + e = [1, 6], + n = [1, 7], + i = [1, 8], + a = [1, 9], + s = [1, 16], + r = [1, 11], + l = [1, 12], + o = [1, 13], + h = [1, 14], + d = [1, 15], + u = [1, 27], + p = [1, 33], + y = [1, 34], + f = [1, 35], + b = [1, 36], + g = [1, 37], + _ = [1, 72], + x = [1, 73], + m = [1, 74], + E = [1, 75], + A = [1, 76], + S = [1, 77], + v = [1, 78], + C = [1, 38], + k = [1, 39], + O = [1, 40], + T = [1, 41], + w = [1, 42], + D = [1, 43], + R = [1, 44], + N = [1, 45], + P = [1, 46], + M = [1, 47], + j = [1, 48], + B = [1, 49], + Y = [1, 50], + L = [1, 51], + I = [1, 52], + U = [1, 53], + F = [1, 54], + X = [1, 55], + z = [1, 56], + Q = [1, 57], + W = [1, 59], + $ = [1, 60], + q = [1, 61], + V = [1, 62], + G = [1, 63], + H = [1, 64], + K = [1, 65], + J = [1, 66], + Z = [1, 67], + tt = [1, 68], + et = [1, 69], + nt = [24, 52], + it = [ + 24, 44, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, + ], + at = [ + 15, 24, 44, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, + ], + st = [1, 94], + rt = [1, 95], + lt = [1, 96], + ot = [1, 97], + ct = [15, 24, 52], + ht = [7, 8, 9, 10, 18, 22, 25, 26, 27, 28], + dt = [15, 24, 43, 52], + ut = [15, 24, 43, 52, 86, 87, 89, 90], + pt = [15, 43], + yt = [ + 44, 46, 47, 48, 49, 50, 51, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, + ], + ft = { + trace: function () {}, + yy: {}, + symbols_: { + error: 2, + start: 3, + mermaidDoc: 4, + direction: 5, + directive: 6, + direction_tb: 7, + direction_bt: 8, + direction_rl: 9, + direction_lr: 10, + graphConfig: 11, + openDirective: 12, + typeDirective: 13, + closeDirective: 14, + NEWLINE: 15, + ":": 16, + argDirective: 17, + open_directive: 18, + type_directive: 19, + arg_directive: 20, + close_directive: 21, + C4_CONTEXT: 22, + statements: 23, + EOF: 24, + C4_CONTAINER: 25, + C4_COMPONENT: 26, + C4_DYNAMIC: 27, + C4_DEPLOYMENT: 28, + otherStatements: 29, + diagramStatements: 30, + otherStatement: 31, + title: 32, + accDescription: 33, + acc_title: 34, + acc_title_value: 35, + acc_descr: 36, + acc_descr_value: 37, + acc_descr_multiline_value: 38, + boundaryStatement: 39, + boundaryStartStatement: 40, + boundaryStopStatement: 41, + boundaryStart: 42, + LBRACE: 43, + ENTERPRISE_BOUNDARY: 44, + attributes: 45, + SYSTEM_BOUNDARY: 46, + BOUNDARY: 47, + CONTAINER_BOUNDARY: 48, + NODE: 49, + NODE_L: 50, + NODE_R: 51, + RBRACE: 52, + diagramStatement: 53, + PERSON: 54, + PERSON_EXT: 55, + SYSTEM: 56, + SYSTEM_DB: 57, + SYSTEM_QUEUE: 58, + SYSTEM_EXT: 59, + SYSTEM_EXT_DB: 60, + SYSTEM_EXT_QUEUE: 61, + CONTAINER: 62, + CONTAINER_DB: 63, + CONTAINER_QUEUE: 64, + CONTAINER_EXT: 65, + CONTAINER_EXT_DB: 66, + CONTAINER_EXT_QUEUE: 67, + COMPONENT: 68, + COMPONENT_DB: 69, + COMPONENT_QUEUE: 70, + COMPONENT_EXT: 71, + COMPONENT_EXT_DB: 72, + COMPONENT_EXT_QUEUE: 73, + REL: 74, + BIREL: 75, + REL_U: 76, + REL_D: 77, + REL_L: 78, + REL_R: 79, + REL_B: 80, + REL_INDEX: 81, + UPDATE_EL_STYLE: 82, + UPDATE_REL_STYLE: 83, + UPDATE_LAYOUT_CONFIG: 84, + attribute: 85, + STR: 86, + STR_KEY: 87, + STR_VALUE: 88, + ATTRIBUTE: 89, + ATTRIBUTE_EMPTY: 90, + $accept: 0, + $end: 1, + }, + terminals_: { + 2: "error", + 7: "direction_tb", + 8: "direction_bt", + 9: "direction_rl", + 10: "direction_lr", + 15: "NEWLINE", + 16: ":", + 18: "open_directive", + 19: "type_directive", + 20: "arg_directive", + 21: "close_directive", + 22: "C4_CONTEXT", + 24: "EOF", + 25: "C4_CONTAINER", + 26: "C4_COMPONENT", + 27: "C4_DYNAMIC", + 28: "C4_DEPLOYMENT", + 32: "title", + 33: "accDescription", + 34: "acc_title", + 35: "acc_title_value", + 36: "acc_descr", + 37: "acc_descr_value", + 38: "acc_descr_multiline_value", + 43: "LBRACE", + 44: "ENTERPRISE_BOUNDARY", + 46: "SYSTEM_BOUNDARY", + 47: "BOUNDARY", + 48: "CONTAINER_BOUNDARY", + 49: "NODE", + 50: "NODE_L", + 51: "NODE_R", + 52: "RBRACE", + 54: "PERSON", + 55: "PERSON_EXT", + 56: "SYSTEM", + 57: "SYSTEM_DB", + 58: "SYSTEM_QUEUE", + 59: "SYSTEM_EXT", + 60: "SYSTEM_EXT_DB", + 61: "SYSTEM_EXT_QUEUE", + 62: "CONTAINER", + 63: "CONTAINER_DB", + 64: "CONTAINER_QUEUE", + 65: "CONTAINER_EXT", + 66: "CONTAINER_EXT_DB", + 67: "CONTAINER_EXT_QUEUE", + 68: "COMPONENT", + 69: "COMPONENT_DB", + 70: "COMPONENT_QUEUE", + 71: "COMPONENT_EXT", + 72: "COMPONENT_EXT_DB", + 73: "COMPONENT_EXT_QUEUE", + 74: "REL", + 75: "BIREL", + 76: "REL_U", + 77: "REL_D", + 78: "REL_L", + 79: "REL_R", + 80: "REL_B", + 81: "REL_INDEX", + 82: "UPDATE_EL_STYLE", + 83: "UPDATE_REL_STYLE", + 84: "UPDATE_LAYOUT_CONFIG", + 86: "STR", + 87: "STR_KEY", + 88: "STR_VALUE", + 89: "ATTRIBUTE", + 90: "ATTRIBUTE_EMPTY", + }, + productions_: [ + 0, + [3, 1], + [3, 1], + [3, 2], + [5, 1], + [5, 1], + [5, 1], + [5, 1], + [4, 1], + [6, 4], + [6, 6], + [12, 1], + [13, 1], + [17, 1], + [14, 1], + [11, 4], + [11, 4], + [11, 4], + [11, 4], + [11, 4], + [23, 1], + [23, 1], + [23, 2], + [29, 1], + [29, 2], + [29, 3], + [31, 1], + [31, 1], + [31, 2], + [31, 2], + [31, 1], + [39, 3], + [40, 3], + [40, 3], + [40, 4], + [42, 2], + [42, 2], + [42, 2], + [42, 2], + [42, 2], + [42, 2], + [42, 2], + [41, 1], + [30, 1], + [30, 2], + [30, 3], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 1], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [53, 2], + [45, 1], + [45, 2], + [85, 1], + [85, 2], + [85, 1], + [85, 1], + ], + performAction: function (t, e, n, i, a, s, r) { + var l = s.length - 1; + switch (a) { + case 4: + i.setDirection("TB"); + break; + case 5: + i.setDirection("BT"); + break; + case 6: + i.setDirection("RL"); + break; + case 7: + i.setDirection("LR"); + break; + case 11: + i.parseDirective("%%{", "open_directive"); + break; + case 12: + break; + case 13: + (s[l] = s[l].trim().replace(/'/g, '"')), i.parseDirective(s[l], "arg_directive"); + break; + case 14: + i.parseDirective("}%%", "close_directive", "c4Context"); + break; + case 15: + case 16: + case 17: + case 18: + case 19: + i.setC4Type(s[l - 3]); + break; + case 26: + i.setTitle(s[l].substring(6)), (this.$ = s[l].substring(6)); + break; + case 27: + i.setAccDescription(s[l].substring(15)), (this.$ = s[l].substring(15)); + break; + case 28: + (this.$ = s[l].trim()), i.setTitle(this.$); + break; + case 29: + case 30: + (this.$ = s[l].trim()), i.setAccDescription(this.$); + break; + case 35: + case 36: + s[l].splice(2, 0, "ENTERPRISE"), i.addPersonOrSystemBoundary(...s[l]), (this.$ = s[l]); + break; + case 37: + i.addPersonOrSystemBoundary(...s[l]), (this.$ = s[l]); + break; + case 38: + s[l].splice(2, 0, "CONTAINER"), i.addContainerBoundary(...s[l]), (this.$ = s[l]); + break; + case 39: + i.addDeploymentNode("node", ...s[l]), (this.$ = s[l]); + break; + case 40: + i.addDeploymentNode("nodeL", ...s[l]), (this.$ = s[l]); + break; + case 41: + i.addDeploymentNode("nodeR", ...s[l]), (this.$ = s[l]); + break; + case 42: + i.popBoundaryParseStack(); + break; + case 46: + i.addPersonOrSystem("person", ...s[l]), (this.$ = s[l]); + break; + case 47: + i.addPersonOrSystem("external_person", ...s[l]), (this.$ = s[l]); + break; + case 48: + i.addPersonOrSystem("system", ...s[l]), (this.$ = s[l]); + break; + case 49: + i.addPersonOrSystem("system_db", ...s[l]), (this.$ = s[l]); + break; + case 50: + i.addPersonOrSystem("system_queue", ...s[l]), (this.$ = s[l]); + break; + case 51: + i.addPersonOrSystem("external_system", ...s[l]), (this.$ = s[l]); + break; + case 52: + i.addPersonOrSystem("external_system_db", ...s[l]), (this.$ = s[l]); + break; + case 53: + i.addPersonOrSystem("external_system_queue", ...s[l]), (this.$ = s[l]); + break; + case 54: + i.addContainer("container", ...s[l]), (this.$ = s[l]); + break; + case 55: + i.addContainer("container_db", ...s[l]), (this.$ = s[l]); + break; + case 56: + i.addContainer("container_queue", ...s[l]), (this.$ = s[l]); + break; + case 57: + i.addContainer("external_container", ...s[l]), (this.$ = s[l]); + break; + case 58: + i.addContainer("external_container_db", ...s[l]), (this.$ = s[l]); + break; + case 59: + i.addContainer("external_container_queue", ...s[l]), (this.$ = s[l]); + break; + case 60: + i.addComponent("component", ...s[l]), (this.$ = s[l]); + break; + case 61: + i.addComponent("component_db", ...s[l]), (this.$ = s[l]); + break; + case 62: + i.addComponent("component_queue", ...s[l]), (this.$ = s[l]); + break; + case 63: + i.addComponent("external_component", ...s[l]), (this.$ = s[l]); + break; + case 64: + i.addComponent("external_component_db", ...s[l]), (this.$ = s[l]); + break; + case 65: + i.addComponent("external_component_queue", ...s[l]), (this.$ = s[l]); + break; + case 67: + i.addRel("rel", ...s[l]), (this.$ = s[l]); + break; + case 68: + i.addRel("birel", ...s[l]), (this.$ = s[l]); + break; + case 69: + i.addRel("rel_u", ...s[l]), (this.$ = s[l]); + break; + case 70: + i.addRel("rel_d", ...s[l]), (this.$ = s[l]); + break; + case 71: + i.addRel("rel_l", ...s[l]), (this.$ = s[l]); + break; + case 72: + i.addRel("rel_r", ...s[l]), (this.$ = s[l]); + break; + case 73: + i.addRel("rel_b", ...s[l]), (this.$ = s[l]); + break; + case 74: + s[l].splice(0, 1), i.addRel("rel", ...s[l]), (this.$ = s[l]); + break; + case 75: + i.updateElStyle("update_el_style", ...s[l]), (this.$ = s[l]); + break; + case 76: + i.updateRelStyle("update_rel_style", ...s[l]), (this.$ = s[l]); + break; + case 77: + i.updateLayoutConfig("update_layout_config", ...s[l]), (this.$ = s[l]); + break; + case 78: + this.$ = [s[l]]; + break; + case 79: + s[l].unshift(s[l - 1]), (this.$ = s[l]); + break; + case 80: + case 82: + this.$ = s[l].trim(); + break; + case 81: + let t = {}; + (t[s[l - 1].trim()] = s[l].trim()), (this.$ = t); + break; + case 83: + this.$ = ""; + } + }, + table: [ + { + 3: 1, + 4: 2, + 5: 3, + 6: 4, + 7: e, + 8: n, + 9: i, + 10: a, + 11: 5, + 12: 10, + 18: s, + 22: r, + 25: l, + 26: o, + 27: h, + 28: d, + }, + { 1: [3] }, + { 1: [2, 1] }, + { 1: [2, 2] }, + { + 3: 17, + 4: 2, + 5: 3, + 6: 4, + 7: e, + 8: n, + 9: i, + 10: a, + 11: 5, + 12: 10, + 18: s, + 22: r, + 25: l, + 26: o, + 27: h, + 28: d, + }, + { 1: [2, 8] }, + { 1: [2, 4] }, + { 1: [2, 5] }, + { 1: [2, 6] }, + { 1: [2, 7] }, + { 13: 18, 19: [1, 19] }, + { 15: [1, 20] }, + { 15: [1, 21] }, + { 15: [1, 22] }, + { 15: [1, 23] }, + { 15: [1, 24] }, + { 19: [2, 11] }, + { 1: [2, 3] }, + { 14: 25, 16: [1, 26], 21: u }, + t([16, 21], [2, 12]), + { + 23: 28, + 29: 29, + 30: 30, + 31: 31, + 32: p, + 33: y, + 34: f, + 36: b, + 38: g, + 39: 58, + 40: 70, + 42: 71, + 44: _, + 46: x, + 47: m, + 48: E, + 49: A, + 50: S, + 51: v, + 53: 32, + 54: C, + 55: k, + 56: O, + 57: T, + 58: w, + 59: D, + 60: R, + 61: N, + 62: P, + 63: M, + 64: j, + 65: B, + 66: Y, + 67: L, + 68: I, + 69: U, + 70: F, + 71: X, + 72: z, + 73: Q, + 74: W, + 75: $, + 76: q, + 77: V, + 78: G, + 79: H, + 80: K, + 81: J, + 82: Z, + 83: tt, + 84: et, + }, + { + 23: 79, + 29: 29, + 30: 30, + 31: 31, + 32: p, + 33: y, + 34: f, + 36: b, + 38: g, + 39: 58, + 40: 70, + 42: 71, + 44: _, + 46: x, + 47: m, + 48: E, + 49: A, + 50: S, + 51: v, + 53: 32, + 54: C, + 55: k, + 56: O, + 57: T, + 58: w, + 59: D, + 60: R, + 61: N, + 62: P, + 63: M, + 64: j, + 65: B, + 66: Y, + 67: L, + 68: I, + 69: U, + 70: F, + 71: X, + 72: z, + 73: Q, + 74: W, + 75: $, + 76: q, + 77: V, + 78: G, + 79: H, + 80: K, + 81: J, + 82: Z, + 83: tt, + 84: et, + }, + { + 23: 80, + 29: 29, + 30: 30, + 31: 31, + 32: p, + 33: y, + 34: f, + 36: b, + 38: g, + 39: 58, + 40: 70, + 42: 71, + 44: _, + 46: x, + 47: m, + 48: E, + 49: A, + 50: S, + 51: v, + 53: 32, + 54: C, + 55: k, + 56: O, + 57: T, + 58: w, + 59: D, + 60: R, + 61: N, + 62: P, + 63: M, + 64: j, + 65: B, + 66: Y, + 67: L, + 68: I, + 69: U, + 70: F, + 71: X, + 72: z, + 73: Q, + 74: W, + 75: $, + 76: q, + 77: V, + 78: G, + 79: H, + 80: K, + 81: J, + 82: Z, + 83: tt, + 84: et, + }, + { + 23: 81, + 29: 29, + 30: 30, + 31: 31, + 32: p, + 33: y, + 34: f, + 36: b, + 38: g, + 39: 58, + 40: 70, + 42: 71, + 44: _, + 46: x, + 47: m, + 48: E, + 49: A, + 50: S, + 51: v, + 53: 32, + 54: C, + 55: k, + 56: O, + 57: T, + 58: w, + 59: D, + 60: R, + 61: N, + 62: P, + 63: M, + 64: j, + 65: B, + 66: Y, + 67: L, + 68: I, + 69: U, + 70: F, + 71: X, + 72: z, + 73: Q, + 74: W, + 75: $, + 76: q, + 77: V, + 78: G, + 79: H, + 80: K, + 81: J, + 82: Z, + 83: tt, + 84: et, + }, + { + 23: 82, + 29: 29, + 30: 30, + 31: 31, + 32: p, + 33: y, + 34: f, + 36: b, + 38: g, + 39: 58, + 40: 70, + 42: 71, + 44: _, + 46: x, + 47: m, + 48: E, + 49: A, + 50: S, + 51: v, + 53: 32, + 54: C, + 55: k, + 56: O, + 57: T, + 58: w, + 59: D, + 60: R, + 61: N, + 62: P, + 63: M, + 64: j, + 65: B, + 66: Y, + 67: L, + 68: I, + 69: U, + 70: F, + 71: X, + 72: z, + 73: Q, + 74: W, + 75: $, + 76: q, + 77: V, + 78: G, + 79: H, + 80: K, + 81: J, + 82: Z, + 83: tt, + 84: et, + }, + { 15: [1, 83] }, + { 17: 84, 20: [1, 85] }, + { 15: [2, 14] }, + { 24: [1, 86] }, + t(nt, [2, 20], { + 53: 32, + 39: 58, + 40: 70, + 42: 71, + 30: 87, + 44: _, + 46: x, + 47: m, + 48: E, + 49: A, + 50: S, + 51: v, + 54: C, + 55: k, + 56: O, + 57: T, + 58: w, + 59: D, + 60: R, + 61: N, + 62: P, + 63: M, + 64: j, + 65: B, + 66: Y, + 67: L, + 68: I, + 69: U, + 70: F, + 71: X, + 72: z, + 73: Q, + 74: W, + 75: $, + 76: q, + 77: V, + 78: G, + 79: H, + 80: K, + 81: J, + 82: Z, + 83: tt, + 84: et, + }), + t(nt, [2, 21]), + t(it, [2, 23], { 15: [1, 88] }), + t(nt, [2, 43], { 15: [1, 89] }), + t(at, [2, 26]), + t(at, [2, 27]), + { 35: [1, 90] }, + { 37: [1, 91] }, + t(at, [2, 30]), + { 45: 92, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 98, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 99, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 100, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 101, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 102, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 103, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 104, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 105, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 106, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 107, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 108, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 109, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 110, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 111, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 112, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 113, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 114, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 115, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 116, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + t(ct, [2, 66]), + { 45: 117, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 118, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 119, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 120, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 121, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 122, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 123, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 124, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 125, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 126, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 127, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { + 30: 128, + 39: 58, + 40: 70, + 42: 71, + 44: _, + 46: x, + 47: m, + 48: E, + 49: A, + 50: S, + 51: v, + 53: 32, + 54: C, + 55: k, + 56: O, + 57: T, + 58: w, + 59: D, + 60: R, + 61: N, + 62: P, + 63: M, + 64: j, + 65: B, + 66: Y, + 67: L, + 68: I, + 69: U, + 70: F, + 71: X, + 72: z, + 73: Q, + 74: W, + 75: $, + 76: q, + 77: V, + 78: G, + 79: H, + 80: K, + 81: J, + 82: Z, + 83: tt, + 84: et, + }, + { 15: [1, 130], 43: [1, 129] }, + { 45: 131, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 132, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 133, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 134, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 135, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 136, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 45: 137, 85: 93, 86: st, 87: rt, 89: lt, 90: ot }, + { 24: [1, 138] }, + { 24: [1, 139] }, + { 24: [1, 140] }, + { 24: [1, 141] }, + t(ht, [2, 9]), + { 14: 142, 21: u }, + { 21: [2, 13] }, + { 1: [2, 15] }, + t(nt, [2, 22]), + t(it, [2, 24], { 31: 31, 29: 143, 32: p, 33: y, 34: f, 36: b, 38: g }), + t(nt, [2, 44], { + 29: 29, + 30: 30, + 31: 31, + 53: 32, + 39: 58, + 40: 70, + 42: 71, + 23: 144, + 32: p, + 33: y, + 34: f, + 36: b, + 38: g, + 44: _, + 46: x, + 47: m, + 48: E, + 49: A, + 50: S, + 51: v, + 54: C, + 55: k, + 56: O, + 57: T, + 58: w, + 59: D, + 60: R, + 61: N, + 62: P, + 63: M, + 64: j, + 65: B, + 66: Y, + 67: L, + 68: I, + 69: U, + 70: F, + 71: X, + 72: z, + 73: Q, + 74: W, + 75: $, + 76: q, + 77: V, + 78: G, + 79: H, + 80: K, + 81: J, + 82: Z, + 83: tt, + 84: et, + }), + t(at, [2, 28]), + t(at, [2, 29]), + t(ct, [2, 46]), + t(dt, [2, 78], { 85: 93, 45: 145, 86: st, 87: rt, 89: lt, 90: ot }), + t(ut, [2, 80]), + { 88: [1, 146] }, + t(ut, [2, 82]), + t(ut, [2, 83]), + t(ct, [2, 47]), + t(ct, [2, 48]), + t(ct, [2, 49]), + t(ct, [2, 50]), + t(ct, [2, 51]), + t(ct, [2, 52]), + t(ct, [2, 53]), + t(ct, [2, 54]), + t(ct, [2, 55]), + t(ct, [2, 56]), + t(ct, [2, 57]), + t(ct, [2, 58]), + t(ct, [2, 59]), + t(ct, [2, 60]), + t(ct, [2, 61]), + t(ct, [2, 62]), + t(ct, [2, 63]), + t(ct, [2, 64]), + t(ct, [2, 65]), + t(ct, [2, 67]), + t(ct, [2, 68]), + t(ct, [2, 69]), + t(ct, [2, 70]), + t(ct, [2, 71]), + t(ct, [2, 72]), + t(ct, [2, 73]), + t(ct, [2, 74]), + t(ct, [2, 75]), + t(ct, [2, 76]), + t(ct, [2, 77]), + { 41: 147, 52: [1, 148] }, + { 15: [1, 149] }, + { 43: [1, 150] }, + t(pt, [2, 35]), + t(pt, [2, 36]), + t(pt, [2, 37]), + t(pt, [2, 38]), + t(pt, [2, 39]), + t(pt, [2, 40]), + t(pt, [2, 41]), + { 1: [2, 16] }, + { 1: [2, 17] }, + { 1: [2, 18] }, + { 1: [2, 19] }, + { 15: [1, 151] }, + t(it, [2, 25]), + t(nt, [2, 45]), + t(dt, [2, 79]), + t(ut, [2, 81]), + t(ct, [2, 31]), + t(ct, [2, 42]), + t(yt, [2, 32]), + t(yt, [2, 33], { 15: [1, 152] }), + t(ht, [2, 10]), + t(yt, [2, 34]), + ], + defaultActions: { + 2: [2, 1], + 3: [2, 2], + 5: [2, 8], + 6: [2, 4], + 7: [2, 5], + 8: [2, 6], + 9: [2, 7], + 16: [2, 11], + 17: [2, 3], + 27: [2, 14], + 85: [2, 13], + 86: [2, 15], + 138: [2, 16], + 139: [2, 17], + 140: [2, 18], + 141: [2, 19], + }, + parseError: function (t, e) { + if (!e.recoverable) { + var n = new Error(t); + throw ((n.hash = e), n); + } + this.trace(t); + }, + parse: function (t) { + var e = [0], + n = [], + i = [null], + a = [], + s = this.table, + r = "", + l = 0, + o = 0, + c = a.slice.call(arguments, 1), + h = Object.create(this.lexer), + d = { yy: {} }; + for (var u in this.yy) Object.prototype.hasOwnProperty.call(this.yy, u) && (d.yy[u] = this.yy[u]); + h.setInput(t, d.yy), (d.yy.lexer = h), (d.yy.parser = this), void 0 === h.yylloc && (h.yylloc = {}); + var p = h.yylloc; + a.push(p); + var y = h.options && h.options.ranges; + "function" == typeof d.yy.parseError + ? (this.parseError = d.yy.parseError) + : (this.parseError = Object.getPrototypeOf(this).parseError); + for (var f, b, g, _, x, m, E, A, S, v = {}; ; ) { + if ( + ((b = e[e.length - 1]), + this.defaultActions[b] + ? (g = this.defaultActions[b]) + : (null == f && + ((S = void 0), + "number" != typeof (S = n.pop() || h.lex() || 1) && + (S instanceof Array && (S = (n = S).pop()), (S = this.symbols_[S] || S)), + (f = S)), + (g = s[b] && s[b][f])), + void 0 === g || !g.length || !g[0]) + ) { + var C; + for (x in ((A = []), s[b])) this.terminals_[x] && x > 2 && A.push("'" + this.terminals_[x] + "'"); + (C = h.showPosition + ? "Parse error on line " + + (l + 1) + + ":\n" + + h.showPosition() + + "\nExpecting " + + A.join(", ") + + ", got '" + + (this.terminals_[f] || f) + + "'" + : "Parse error on line " + (l + 1) + ": Unexpected " + (1 == f ? "end of input" : "'" + (this.terminals_[f] || f) + "'")), + this.parseError(C, { + text: h.match, + token: this.terminals_[f] || f, + line: h.yylineno, + loc: p, + expected: A, + }); + } + if (g[0] instanceof Array && g.length > 1) + throw new Error("Parse Error: multiple actions possible at state: " + b + ", token: " + f); + switch (g[0]) { + case 1: + e.push(f), + i.push(h.yytext), + a.push(h.yylloc), + e.push(g[1]), + (f = null), + (o = h.yyleng), + (r = h.yytext), + (l = h.yylineno), + (p = h.yylloc); + break; + case 2: + if ( + ((m = this.productions_[g[1]][1]), + (v.$ = i[i.length - m]), + (v._$ = { + first_line: a[a.length - (m || 1)].first_line, + last_line: a[a.length - 1].last_line, + first_column: a[a.length - (m || 1)].first_column, + last_column: a[a.length - 1].last_column, + }), + y && (v._$.range = [a[a.length - (m || 1)].range[0], a[a.length - 1].range[1]]), + void 0 !== (_ = this.performAction.apply(v, [r, o, l, d.yy, g[1], i, a].concat(c)))) + ) + return _; + m && ((e = e.slice(0, -1 * m * 2)), (i = i.slice(0, -1 * m)), (a = a.slice(0, -1 * m))), + e.push(this.productions_[g[1]][0]), + i.push(v.$), + a.push(v._$), + (E = s[e[e.length - 2]][e[e.length - 1]]), + e.push(E); + break; + case 3: + return !0; + } + } + return !0; + }, + }, + bt = { + EOF: 1, + parseError: function (t, e) { + if (!this.yy.parser) throw new Error(t); + this.yy.parser.parseError(t, e); + }, + setInput: function (t, e) { + return ( + (this.yy = e || this.yy || {}), + (this._input = t), + (this._more = this._backtrack = this.done = !1), + (this.yylineno = this.yyleng = 0), + (this.yytext = this.matched = this.match = ""), + (this.conditionStack = ["INITIAL"]), + (this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0, + }), + this.options.ranges && (this.yylloc.range = [0, 0]), + (this.offset = 0), + this + ); + }, + input: function () { + var t = this._input[0]; + return ( + (this.yytext += t), + this.yyleng++, + this.offset++, + (this.match += t), + (this.matched += t), + t.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, + this.options.ranges && this.yylloc.range[1]++, + (this._input = this._input.slice(1)), + t + ); + }, + unput: function (t) { + var e = t.length, + n = t.split(/(?:\r\n?|\n)/g); + (this._input = t + this._input), (this.yytext = this.yytext.substr(0, this.yytext.length - e)), (this.offset -= e); + var i = this.match.split(/(?:\r\n?|\n)/g); + (this.match = this.match.substr(0, this.match.length - 1)), + (this.matched = this.matched.substr(0, this.matched.length - 1)), + n.length - 1 && (this.yylineno -= n.length - 1); + var a = this.yylloc.range; + return ( + (this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: n + ? (n.length === i.length ? this.yylloc.first_column : 0) + i[i.length - n.length].length - n[0].length + : this.yylloc.first_column - e, + }), + this.options.ranges && (this.yylloc.range = [a[0], a[0] + this.yyleng - e]), + (this.yyleng = this.yytext.length), + this + ); + }, + more: function () { + return (this._more = !0), this; + }, + reject: function () { + return this.options.backtrack_lexer + ? ((this._backtrack = !0), this) + : this.parseError( + "Lexical error on line " + + (this.yylineno + 1) + + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + + this.showPosition(), + { text: "", token: null, line: this.yylineno }, + ); + }, + less: function (t) { + this.unput(this.match.slice(t)); + }, + pastInput: function () { + var t = this.matched.substr(0, this.matched.length - this.match.length); + return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, ""); + }, + upcomingInput: function () { + var t = this.match; + return ( + t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "") + ); + }, + showPosition: function () { + var t = this.pastInput(), + e = new Array(t.length + 1).join("-"); + return t + this.upcomingInput() + "\n" + e + "^"; + }, + test_match: function (t, e) { + var n, i, a; + if ( + (this.options.backtrack_lexer && + ((a = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column, + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done, + }), + this.options.ranges && (a.yylloc.range = this.yylloc.range.slice(0))), + (i = t[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += i.length), + (this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: i ? i[i.length - 1].length - i[i.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length, + }), + (this.yytext += t[0]), + (this.match += t[0]), + (this.matches = t), + (this.yyleng = this.yytext.length), + this.options.ranges && (this.yylloc.range = [this.offset, (this.offset += this.yyleng)]), + (this._more = !1), + (this._backtrack = !1), + (this._input = this._input.slice(t[0].length)), + (this.matched += t[0]), + (n = this.performAction.call(this, this.yy, this, e, this.conditionStack[this.conditionStack.length - 1])), + this.done && this._input && (this.done = !1), + n) + ) + return n; + if (this._backtrack) { + for (var s in a) this[s] = a[s]; + return !1; + } + return !1; + }, + next: function () { + if (this.done) return this.EOF; + var t, e, n, i; + this._input || (this.done = !0), this._more || ((this.yytext = ""), (this.match = "")); + for (var a = this._currentRules(), s = 0; s < a.length; s++) + if ((n = this._input.match(this.rules[a[s]])) && (!e || n[0].length > e[0].length)) { + if (((e = n), (i = s), this.options.backtrack_lexer)) { + if (!1 !== (t = this.test_match(n, a[s]))) return t; + if (this._backtrack) { + e = !1; + continue; + } + return !1; + } + if (!this.options.flex) break; + } + return e + ? !1 !== (t = this.test_match(e, a[i])) && t + : "" === this._input + ? this.EOF + : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno, + }); + }, + lex: function () { + return this.next() || this.lex(); + }, + begin: function (t) { + this.conditionStack.push(t); + }, + popState: function () { + return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]; + }, + _currentRules: function () { + return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] + ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules + : this.conditions.INITIAL.rules; + }, + topState: function (t) { + return (t = this.conditionStack.length - 1 - Math.abs(t || 0)) >= 0 ? this.conditionStack[t] : "INITIAL"; + }, + pushState: function (t) { + this.begin(t); + }, + stateStackSize: function () { + return this.conditionStack.length; + }, + options: {}, + performAction: function (t, e, n, i) { + switch (n) { + case 0: + return this.begin("open_directive"), 18; + case 1: + return 7; + case 2: + return 8; + case 3: + return 9; + case 4: + return 10; + case 5: + return this.begin("type_directive"), 19; + case 6: + return this.popState(), this.begin("arg_directive"), 16; + case 7: + return this.popState(), this.popState(), 21; + case 8: + return 20; + case 9: + return 32; + case 10: + return 33; + case 11: + return this.begin("acc_title"), 34; + case 12: + return this.popState(), "acc_title_value"; + case 13: + return this.begin("acc_descr"), 36; + case 14: + return this.popState(), "acc_descr_value"; + case 15: + this.begin("acc_descr_multiline"); + break; + case 16: + case 78: + this.popState(); + break; + case 17: + return "acc_descr_multiline_value"; + case 18: + case 21: + case 75: + break; + case 19: + c; + break; + case 20: + return 15; + case 22: + return 22; + case 23: + return 25; + case 24: + return 26; + case 25: + return 27; + case 26: + return 28; + case 27: + return this.begin("person_ext"), 55; + case 28: + return this.begin("person"), 54; + case 29: + return this.begin("system_ext_queue"), 61; + case 30: + return this.begin("system_ext_db"), 60; + case 31: + return this.begin("system_ext"), 59; + case 32: + return this.begin("system_queue"), 58; + case 33: + return this.begin("system_db"), 57; + case 34: + return this.begin("system"), 56; + case 35: + return this.begin("boundary"), 47; + case 36: + return this.begin("enterprise_boundary"), 44; + case 37: + return this.begin("system_boundary"), 46; + case 38: + return this.begin("container_ext_queue"), 67; + case 39: + return this.begin("container_ext_db"), 66; + case 40: + return this.begin("container_ext"), 65; + case 41: + return this.begin("container_queue"), 64; + case 42: + return this.begin("container_db"), 63; + case 43: + return this.begin("container"), 62; + case 44: + return this.begin("container_boundary"), 48; + case 45: + return this.begin("component_ext_queue"), 73; + case 46: + return this.begin("component_ext_db"), 72; + case 47: + return this.begin("component_ext"), 71; + case 48: + return this.begin("component_queue"), 70; + case 49: + return this.begin("component_db"), 69; + case 50: + return this.begin("component"), 68; + case 51: + case 52: + return this.begin("node"), 49; + case 53: + return this.begin("node_l"), 50; + case 54: + return this.begin("node_r"), 51; + case 55: + return this.begin("rel"), 74; + case 56: + return this.begin("birel"), 75; + case 57: + case 58: + return this.begin("rel_u"), 76; + case 59: + case 60: + return this.begin("rel_d"), 77; + case 61: + case 62: + return this.begin("rel_l"), 78; + case 63: + case 64: + return this.begin("rel_r"), 79; + case 65: + return this.begin("rel_b"), 80; + case 66: + return this.begin("rel_index"), 81; + case 67: + return this.begin("update_el_style"), 82; + case 68: + return this.begin("update_rel_style"), 83; + case 69: + return this.begin("update_layout_config"), 84; + case 70: + return "EOF_IN_STRUCT"; + case 71: + return this.begin("attribute"), "ATTRIBUTE_EMPTY"; + case 72: + this.begin("attribute"); + break; + case 73: + case 84: + this.popState(), this.popState(); + break; + case 74: + case 76: + return 90; + case 77: + this.begin("string"); + break; + case 79: + case 85: + return "STR"; + case 80: + this.begin("string_kv"); + break; + case 81: + return this.begin("string_kv_key"), "STR_KEY"; + case 82: + this.popState(), this.begin("string_kv_value"); + break; + case 83: + return "STR_VALUE"; + case 86: + return "LBRACE"; + case 87: + return "RBRACE"; + case 88: + return "SPACE"; + case 89: + return "EOL"; + case 90: + return 24; + } + }, + rules: [ + /^(?:%%\{)/, + /^(?:.*direction\s+TB[^\n]*)/, + /^(?:.*direction\s+BT[^\n]*)/, + /^(?:.*direction\s+RL[^\n]*)/, + /^(?:.*direction\s+LR[^\n]*)/, + /^(?:((?:(?!\}%%)[^:.])*))/, + /^(?::)/, + /^(?:\}%%)/, + /^(?:((?:(?!\}%%).|\n)*))/, + /^(?:title\s[^#\n;]+)/, + /^(?:accDescription\s[^#\n;]+)/, + /^(?:accTitle\s*:\s*)/, + /^(?:(?!\n||)*[^\n]*)/, + /^(?:accDescr\s*:\s*)/, + /^(?:(?!\n||)*[^\n]*)/, + /^(?:accDescr\s*\{\s*)/, + /^(?:[\}])/, + /^(?:[^\}]*)/, + /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, + /^(?:%%[^\n]*(\r?\n)*)/, + /^(?:\s*(\r?\n)+)/, + /^(?:\s+)/, + /^(?:C4Context\b)/, + /^(?:C4Container\b)/, + /^(?:C4Component\b)/, + /^(?:C4Dynamic\b)/, + /^(?:C4Deployment\b)/, + /^(?:Person_Ext\b)/, + /^(?:Person\b)/, + /^(?:SystemQueue_Ext\b)/, + /^(?:SystemDb_Ext\b)/, + /^(?:System_Ext\b)/, + /^(?:SystemQueue\b)/, + /^(?:SystemDb\b)/, + /^(?:System\b)/, + /^(?:Boundary\b)/, + /^(?:Enterprise_Boundary\b)/, + /^(?:System_Boundary\b)/, + /^(?:ContainerQueue_Ext\b)/, + /^(?:ContainerDb_Ext\b)/, + /^(?:Container_Ext\b)/, + /^(?:ContainerQueue\b)/, + /^(?:ContainerDb\b)/, + /^(?:Container\b)/, + /^(?:Container_Boundary\b)/, + /^(?:ComponentQueue_Ext\b)/, + /^(?:ComponentDb_Ext\b)/, + /^(?:Component_Ext\b)/, + /^(?:ComponentQueue\b)/, + /^(?:ComponentDb\b)/, + /^(?:Component\b)/, + /^(?:Deployment_Node\b)/, + /^(?:Node\b)/, + /^(?:Node_L\b)/, + /^(?:Node_R\b)/, + /^(?:Rel\b)/, + /^(?:BiRel\b)/, + /^(?:Rel_Up\b)/, + /^(?:Rel_U\b)/, + /^(?:Rel_Down\b)/, + /^(?:Rel_D\b)/, + /^(?:Rel_Left\b)/, + /^(?:Rel_L\b)/, + /^(?:Rel_Right\b)/, + /^(?:Rel_R\b)/, + /^(?:Rel_Back\b)/, + /^(?:RelIndex\b)/, + /^(?:UpdateElementStyle\b)/, + /^(?:UpdateRelStyle\b)/, + /^(?:UpdateLayoutConfig\b)/, + /^(?:$)/, + /^(?:[(][ ]*[,])/, + /^(?:[(])/, + /^(?:[)])/, + /^(?:,,)/, + /^(?:,)/, + /^(?:[ ]*["]["])/, + /^(?:[ ]*["])/, + /^(?:["])/, + /^(?:[^"]*)/, + /^(?:[ ]*[\$])/, + /^(?:[^=]*)/, + /^(?:[=][ ]*["])/, + /^(?:[^"]+)/, + /^(?:["])/, + /^(?:[^,]+)/, + /^(?:\{)/, + /^(?:\})/, + /^(?:[\s]+)/, + /^(?:[\n\r]+)/, + /^(?:$)/, + ], + conditions: { + acc_descr_multiline: { rules: [16, 17], inclusive: !1 }, + acc_descr: { rules: [14], inclusive: !1 }, + acc_title: { rules: [12], inclusive: !1 }, + close_directive: { rules: [], inclusive: !1 }, + arg_directive: { rules: [7, 8], inclusive: !1 }, + type_directive: { rules: [6, 7], inclusive: !1 }, + open_directive: { rules: [5], inclusive: !1 }, + string_kv_value: { rules: [83, 84], inclusive: !1 }, + string_kv_key: { rules: [82], inclusive: !1 }, + string_kv: { rules: [81], inclusive: !1 }, + string: { rules: [78, 79], inclusive: !1 }, + attribute: { rules: [73, 74, 75, 76, 77, 80, 85], inclusive: !1 }, + update_layout_config: { rules: [70, 71, 72, 73], inclusive: !1 }, + update_rel_style: { rules: [70, 71, 72, 73], inclusive: !1 }, + update_el_style: { rules: [70, 71, 72, 73], inclusive: !1 }, + rel_b: { rules: [70, 71, 72, 73], inclusive: !1 }, + rel_r: { rules: [70, 71, 72, 73], inclusive: !1 }, + rel_l: { rules: [70, 71, 72, 73], inclusive: !1 }, + rel_d: { rules: [70, 71, 72, 73], inclusive: !1 }, + rel_u: { rules: [70, 71, 72, 73], inclusive: !1 }, + rel_bi: { rules: [], inclusive: !1 }, + rel: { rules: [70, 71, 72, 73], inclusive: !1 }, + node_r: { rules: [70, 71, 72, 73], inclusive: !1 }, + node_l: { rules: [70, 71, 72, 73], inclusive: !1 }, + node: { rules: [70, 71, 72, 73], inclusive: !1 }, + index: { rules: [], inclusive: !1 }, + rel_index: { rules: [70, 71, 72, 73], inclusive: !1 }, + component_ext_queue: { rules: [], inclusive: !1 }, + component_ext_db: { rules: [70, 71, 72, 73], inclusive: !1 }, + component_ext: { rules: [70, 71, 72, 73], inclusive: !1 }, + component_queue: { rules: [70, 71, 72, 73], inclusive: !1 }, + component_db: { rules: [70, 71, 72, 73], inclusive: !1 }, + component: { rules: [70, 71, 72, 73], inclusive: !1 }, + container_boundary: { rules: [70, 71, 72, 73], inclusive: !1 }, + container_ext_queue: { rules: [70, 71, 72, 73], inclusive: !1 }, + container_ext_db: { rules: [70, 71, 72, 73], inclusive: !1 }, + container_ext: { rules: [70, 71, 72, 73], inclusive: !1 }, + container_queue: { rules: [70, 71, 72, 73], inclusive: !1 }, + container_db: { rules: [70, 71, 72, 73], inclusive: !1 }, + container: { rules: [70, 71, 72, 73], inclusive: !1 }, + birel: { rules: [70, 71, 72, 73], inclusive: !1 }, + system_boundary: { rules: [70, 71, 72, 73], inclusive: !1 }, + enterprise_boundary: { rules: [70, 71, 72, 73], inclusive: !1 }, + boundary: { rules: [70, 71, 72, 73], inclusive: !1 }, + system_ext_queue: { rules: [70, 71, 72, 73], inclusive: !1 }, + system_ext_db: { rules: [70, 71, 72, 73], inclusive: !1 }, + system_ext: { rules: [70, 71, 72, 73], inclusive: !1 }, + system_queue: { rules: [70, 71, 72, 73], inclusive: !1 }, + system_db: { rules: [70, 71, 72, 73], inclusive: !1 }, + system: { rules: [70, 71, 72, 73], inclusive: !1 }, + person_ext: { rules: [70, 71, 72, 73], inclusive: !1 }, + person: { rules: [70, 71, 72, 73], inclusive: !1 }, + INITIAL: { + rules: [ + 0, 1, 2, 3, 4, 9, 10, 11, 13, 15, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 86, 87, 88, + 89, 90, + ], + inclusive: !0, + }, + }, + }; + function gt() { + this.yy = {}; + } + return (ft.lexer = bt), (gt.prototype = ft), (ft.Parser = gt), new gt(); + })()); + l.parser = l; + const o = l; + let h = [], + d = [""], + u = "global", + p = "", + y = [ + { + alias: "global", + label: { text: "global" }, + type: { text: "global" }, + tags: null, + link: null, + parentBoundary: "", + }, + ], + f = [], + b = "", + g = !1, + _ = 4, + x = 2; + var m; + const E = function (t) { + return null == t ? h : h.filter((e) => e.parentBoundary === t); + }, + A = function () { + return g; + }, + S = { + addPersonOrSystem: function (t, e, n, i, a, s, r) { + if (null === e || null === n) return; + let l = {}; + const o = h.find((t) => t.alias === e); + if ((o && e === o.alias ? (l = o) : ((l.alias = e), h.push(l)), (l.label = null == n ? { text: "" } : { text: n }), null == i)) + l.descr = { text: "" }; + else if ("object" == typeof i) { + let [t, e] = Object.entries(i)[0]; + l[t] = { text: e }; + } else l.descr = { text: i }; + if ("object" == typeof a) { + let [t, e] = Object.entries(a)[0]; + l[t] = e; + } else l.sprite = a; + if ("object" == typeof s) { + let [t, e] = Object.entries(s)[0]; + l[t] = e; + } else l.tags = s; + if ("object" == typeof r) { + let [t, e] = Object.entries(r)[0]; + l[t] = e; + } else l.link = r; + (l.typeC4Shape = { text: t }), (l.parentBoundary = u), (l.wrap = A()); + }, + addPersonOrSystemBoundary: function (t, e, n, i, a) { + if (null === t || null === e) return; + let s = {}; + const r = y.find((e) => e.alias === t); + if ((r && t === r.alias ? (s = r) : ((s.alias = t), y.push(s)), (s.label = null == e ? { text: "" } : { text: e }), null == n)) + s.type = { text: "system" }; + else if ("object" == typeof n) { + let [t, e] = Object.entries(n)[0]; + s[t] = { text: e }; + } else s.type = { text: n }; + if ("object" == typeof i) { + let [t, e] = Object.entries(i)[0]; + s[t] = e; + } else s.tags = i; + if ("object" == typeof a) { + let [t, e] = Object.entries(a)[0]; + s[t] = e; + } else s.link = a; + (s.parentBoundary = u), (s.wrap = A()), (p = u), (u = t), d.push(p); + }, + addContainer: function (t, e, n, i, a, s, r, l) { + if (null === e || null === n) return; + let o = {}; + const c = h.find((t) => t.alias === e); + if ((c && e === c.alias ? (o = c) : ((o.alias = e), h.push(o)), (o.label = null == n ? { text: "" } : { text: n }), null == i)) + o.techn = { text: "" }; + else if ("object" == typeof i) { + let [t, e] = Object.entries(i)[0]; + o[t] = { text: e }; + } else o.techn = { text: i }; + if (null == a) o.descr = { text: "" }; + else if ("object" == typeof a) { + let [t, e] = Object.entries(a)[0]; + o[t] = { text: e }; + } else o.descr = { text: a }; + if ("object" == typeof s) { + let [t, e] = Object.entries(s)[0]; + o[t] = e; + } else o.sprite = s; + if ("object" == typeof r) { + let [t, e] = Object.entries(r)[0]; + o[t] = e; + } else o.tags = r; + if ("object" == typeof l) { + let [t, e] = Object.entries(l)[0]; + o[t] = e; + } else o.link = l; + (o.wrap = A()), (o.typeC4Shape = { text: t }), (o.parentBoundary = u); + }, + addContainerBoundary: function (t, e, n, i, a) { + if (null === t || null === e) return; + let s = {}; + const r = y.find((e) => e.alias === t); + if ((r && t === r.alias ? (s = r) : ((s.alias = t), y.push(s)), (s.label = null == e ? { text: "" } : { text: e }), null == n)) + s.type = { text: "container" }; + else if ("object" == typeof n) { + let [t, e] = Object.entries(n)[0]; + s[t] = { text: e }; + } else s.type = { text: n }; + if ("object" == typeof i) { + let [t, e] = Object.entries(i)[0]; + s[t] = e; + } else s.tags = i; + if ("object" == typeof a) { + let [t, e] = Object.entries(a)[0]; + s[t] = e; + } else s.link = a; + (s.parentBoundary = u), (s.wrap = A()), (p = u), (u = t), d.push(p); + }, + addComponent: function (t, e, n, i, a, s, r, l) { + if (null === e || null === n) return; + let o = {}; + const c = h.find((t) => t.alias === e); + if ((c && e === c.alias ? (o = c) : ((o.alias = e), h.push(o)), (o.label = null == n ? { text: "" } : { text: n }), null == i)) + o.techn = { text: "" }; + else if ("object" == typeof i) { + let [t, e] = Object.entries(i)[0]; + o[t] = { text: e }; + } else o.techn = { text: i }; + if (null == a) o.descr = { text: "" }; + else if ("object" == typeof a) { + let [t, e] = Object.entries(a)[0]; + o[t] = { text: e }; + } else o.descr = { text: a }; + if ("object" == typeof s) { + let [t, e] = Object.entries(s)[0]; + o[t] = e; + } else o.sprite = s; + if ("object" == typeof r) { + let [t, e] = Object.entries(r)[0]; + o[t] = e; + } else o.tags = r; + if ("object" == typeof l) { + let [t, e] = Object.entries(l)[0]; + o[t] = e; + } else o.link = l; + (o.wrap = A()), (o.typeC4Shape = { text: t }), (o.parentBoundary = u); + }, + addDeploymentNode: function (t, e, n, i, a, s, r, l) { + if (null === e || null === n) return; + let o = {}; + const c = y.find((t) => t.alias === e); + if ((c && e === c.alias ? (o = c) : ((o.alias = e), y.push(o)), (o.label = null == n ? { text: "" } : { text: n }), null == i)) + o.type = { text: "node" }; + else if ("object" == typeof i) { + let [t, e] = Object.entries(i)[0]; + o[t] = { text: e }; + } else o.type = { text: i }; + if (null == a) o.descr = { text: "" }; + else if ("object" == typeof a) { + let [t, e] = Object.entries(a)[0]; + o[t] = { text: e }; + } else o.descr = { text: a }; + if ("object" == typeof r) { + let [t, e] = Object.entries(r)[0]; + o[t] = e; + } else o.tags = r; + if ("object" == typeof l) { + let [t, e] = Object.entries(l)[0]; + o[t] = e; + } else o.link = l; + (o.nodeType = t), (o.parentBoundary = u), (o.wrap = A()), (p = u), (u = e), d.push(p); + }, + popBoundaryParseStack: function () { + (u = p), d.pop(), (p = d.pop()), d.push(p); + }, + addRel: function (t, e, n, i, a, s, r, l, o) { + if (null == t || null == e || null == n || null == i) return; + let c = {}; + const h = f.find((t) => t.from === e && t.to === n); + if ((h ? (c = h) : f.push(c), (c.type = t), (c.from = e), (c.to = n), (c.label = { text: i }), null == a)) c.techn = { text: "" }; + else if ("object" == typeof a) { + let [t, e] = Object.entries(a)[0]; + c[t] = { text: e }; + } else c.techn = { text: a }; + if (null == s) c.descr = { text: "" }; + else if ("object" == typeof s) { + let [t, e] = Object.entries(s)[0]; + c[t] = { text: e }; + } else c.descr = { text: s }; + if ("object" == typeof r) { + let [t, e] = Object.entries(r)[0]; + c[t] = e; + } else c.sprite = r; + if ("object" == typeof l) { + let [t, e] = Object.entries(l)[0]; + c[t] = e; + } else c.tags = l; + if ("object" == typeof o) { + let [t, e] = Object.entries(o)[0]; + c[t] = e; + } else c.link = o; + c.wrap = A(); + }, + updateElStyle: function (t, e, n, i, a, s, r, l, o, c, d) { + let u = h.find((t) => t.alias === e); + if (void 0 !== u || ((u = y.find((t) => t.alias === e)), void 0 !== u)) { + if (null != n) + if ("object" == typeof n) { + let [t, e] = Object.entries(n)[0]; + u[t] = e; + } else u.bgColor = n; + if (null != i) + if ("object" == typeof i) { + let [t, e] = Object.entries(i)[0]; + u[t] = e; + } else u.fontColor = i; + if (null != a) + if ("object" == typeof a) { + let [t, e] = Object.entries(a)[0]; + u[t] = e; + } else u.borderColor = a; + if (null != s) + if ("object" == typeof s) { + let [t, e] = Object.entries(s)[0]; + u[t] = e; + } else u.shadowing = s; + if (null != r) + if ("object" == typeof r) { + let [t, e] = Object.entries(r)[0]; + u[t] = e; + } else u.shape = r; + if (null != l) + if ("object" == typeof l) { + let [t, e] = Object.entries(l)[0]; + u[t] = e; + } else u.sprite = l; + if (null != o) + if ("object" == typeof o) { + let [t, e] = Object.entries(o)[0]; + u[t] = e; + } else u.techn = o; + if (null != c) + if ("object" == typeof c) { + let [t, e] = Object.entries(c)[0]; + u[t] = e; + } else u.legendText = c; + if (null != d) + if ("object" == typeof d) { + let [t, e] = Object.entries(d)[0]; + u[t] = e; + } else u.legendSprite = d; + } + }, + updateRelStyle: function (t, e, n, i, a, s, r) { + const l = f.find((t) => t.from === e && t.to === n); + if (void 0 !== l) { + if (null != i) + if ("object" == typeof i) { + let [t, e] = Object.entries(i)[0]; + l[t] = e; + } else l.textColor = i; + if (null != a) + if ("object" == typeof a) { + let [t, e] = Object.entries(a)[0]; + l[t] = e; + } else l.lineColor = a; + if (null != s) + if ("object" == typeof s) { + let [t, e] = Object.entries(s)[0]; + l[t] = parseInt(e); + } else l.offsetX = parseInt(s); + if (null != r) + if ("object" == typeof r) { + let [t, e] = Object.entries(r)[0]; + l[t] = parseInt(e); + } else l.offsetY = parseInt(r); + } + }, + updateLayoutConfig: function (t, e, n) { + let i = _, + a = x; + if ("object" == typeof e) { + const t = Object.values(e)[0]; + i = parseInt(t); + } else i = parseInt(e); + if ("object" == typeof n) { + const t = Object.values(n)[0]; + a = parseInt(t); + } else a = parseInt(n); + i >= 1 && (_ = i), a >= 1 && (x = a); + }, + autoWrap: A, + setWrap: function (t) { + g = t; + }, + getC4ShapeArray: E, + getC4Shape: function (t) { + return h.find((e) => e.alias === t); + }, + getC4ShapeKeys: function (t) { + return Object.keys(E(t)); + }, + getBoundarys: function (t) { + return null == t ? y : y.filter((e) => e.parentBoundary === t); + }, + getCurrentBoundaryParse: function () { + return u; + }, + getParentBoundaryParse: function () { + return p; + }, + getRels: function () { + return f; + }, + getTitle: function () { + return b; + }, + getC4Type: function () { + return m; + }, + getC4ShapeInRow: function () { + return _; + }, + getC4BoundaryInRow: function () { + return x; + }, + setAccTitle: i.s, + getAccTitle: i.g, + getAccDescription: i.a, + setAccDescription: i.b, + parseDirective: function (t, e, n) { + i.m.parseDirective(this, t, e, n); + }, + getConfig: () => (0, i.c)().c4, + clear: function () { + (h = []), + (y = [ + { + alias: "global", + label: { text: "global" }, + type: { text: "global" }, + tags: null, + link: null, + parentBoundary: "", + }, + ]), + (p = ""), + (u = "global"), + (d = [""]), + (f = []), + (d = [""]), + (b = ""), + (g = !1), + (_ = 4), + (x = 2); + }, + LINETYPE: { + SOLID: 0, + DOTTED: 1, + NOTE: 2, + SOLID_CROSS: 3, + DOTTED_CROSS: 4, + SOLID_OPEN: 5, + DOTTED_OPEN: 6, + LOOP_START: 10, + LOOP_END: 11, + ALT_START: 12, + ALT_ELSE: 13, + ALT_END: 14, + OPT_START: 15, + OPT_END: 16, + ACTIVE_START: 17, + ACTIVE_END: 18, + PAR_START: 19, + PAR_AND: 20, + PAR_END: 21, + RECT_START: 22, + RECT_END: 23, + SOLID_POINT: 24, + DOTTED_POINT: 25, + }, + ARROWTYPE: { FILLED: 0, OPEN: 1 }, + PLACEMENT: { LEFTOF: 0, RIGHTOF: 1, OVER: 2 }, + setTitle: function (t) { + let e = (0, i.d)(t, (0, i.c)()); + b = e; + }, + setC4Type: function (t) { + let e = (0, i.d)(t, (0, i.c)()); + m = e; + }, + }, + v = function (t, e) { + return (0, s.d)(t, e); + }, + C = (function () { + function t(t, e, n, i, s, r, l) { + a( + e + .append("text") + .attr("x", n + s / 2) + .attr("y", i + r / 2 + 5) + .style("text-anchor", "middle") + .text(t), + l, + ); + } + function e(t, e, n, s, r, l, o, c) { + const { fontSize: h, fontFamily: d, fontWeight: u } = c, + p = t.split(i.e.lineBreakRegex); + for (let t = 0; t < p.length; t++) { + const i = t * h - (h * (p.length - 1)) / 2, + l = e + .append("text") + .attr("x", n + r / 2) + .attr("y", s) + .style("text-anchor", "middle") + .attr("dominant-baseline", "middle") + .style("font-size", h) + .style("font-weight", u) + .style("font-family", d); + l.append("tspan").attr("dy", i).text(p[t]).attr("alignment-baseline", "mathematical"), a(l, o); + } + } + function n(t, n, i, s, r, l, o, c) { + const h = n.append("switch"), + d = h + .append("foreignObject") + .attr("x", i) + .attr("y", s) + .attr("width", r) + .attr("height", l) + .append("xhtml:div") + .style("display", "table") + .style("height", "100%") + .style("width", "100%"); + d.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(t), + e(t, h, i, s, r, 0, o, c), + a(d, o); + } + function a(t, e) { + for (const n in e) e.hasOwnProperty(n) && t.attr(n, e[n]); + } + return function (i) { + return "fo" === i.textPlacement ? n : "old" === i.textPlacement ? t : e; + }; + })(), + k = function (t, e, n) { + var i; + let a = e.bgColor ? e.bgColor : n[e.typeC4Shape.text + "_bg_color"], + l = e.borderColor ? e.borderColor : n[e.typeC4Shape.text + "_border_color"], + o = e.fontColor ? e.fontColor : "#FFFFFF", + c = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII="; + switch (e.typeC4Shape.text) { + case "person": + c = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII="; + break; + case "external_person": + c = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII="; + } + const h = t.append("g"); + h.attr("class", "person-man"); + const d = (0, s.g)(); + switch (e.typeC4Shape.text) { + case "person": + case "external_person": + case "system": + case "external_system": + case "container": + case "external_container": + case "component": + case "external_component": + (d.x = e.x), + (d.y = e.y), + (d.fill = a), + (d.width = e.width), + (d.height = e.height), + (d.stroke = l), + (d.rx = 2.5), + (d.ry = 2.5), + (d.attrs = { "stroke-width": 0.5 }), + v(h, d); + break; + case "system_db": + case "external_system_db": + case "container_db": + case "external_container_db": + case "component_db": + case "external_component_db": + h + .append("path") + .attr("fill", a) + .attr("stroke-width", "0.5") + .attr("stroke", l) + .attr( + "d", + "Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height" + .replaceAll("startx", e.x) + .replaceAll("starty", e.y) + .replaceAll("half", e.width / 2) + .replaceAll("height", e.height), + ), + h + .append("path") + .attr("fill", "none") + .attr("stroke-width", "0.5") + .attr("stroke", l) + .attr( + "d", + "Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10" + .replaceAll("startx", e.x) + .replaceAll("starty", e.y) + .replaceAll("half", e.width / 2), + ); + break; + case "system_queue": + case "external_system_queue": + case "container_queue": + case "external_container_queue": + case "component_queue": + case "external_component_queue": + h + .append("path") + .attr("fill", a) + .attr("stroke-width", "0.5") + .attr("stroke", l) + .attr( + "d", + "Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half" + .replaceAll("startx", e.x) + .replaceAll("starty", e.y) + .replaceAll("width", e.width) + .replaceAll("half", e.height / 2), + ), + h + .append("path") + .attr("fill", "none") + .attr("stroke-width", "0.5") + .attr("stroke", l) + .attr( + "d", + "Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half" + .replaceAll("startx", e.x + e.width) + .replaceAll("starty", e.y) + .replaceAll("half", e.height / 2), + ); + } + let u = + ((p = n), + (y = e.typeC4Shape.text), + { + fontFamily: p[y + "FontFamily"], + fontSize: p[y + "FontSize"], + fontWeight: p[y + "FontWeight"], + }); + var p, y; + switch ( + (h + .append("text") + .attr("fill", o) + .attr("font-family", u.fontFamily) + .attr("font-size", u.fontSize - 2) + .attr("font-style", "italic") + .attr("lengthAdjust", "spacing") + .attr("textLength", e.typeC4Shape.width) + .attr("x", e.x + e.width / 2 - e.typeC4Shape.width / 2) + .attr("y", e.y + e.typeC4Shape.Y) + .text("<<" + e.typeC4Shape.text + ">>"), + e.typeC4Shape.text) + ) { + case "person": + case "external_person": + !(function (t, e, n, i, a, s) { + const l = t.append("image"); + l.attr("width", e), l.attr("height", n), l.attr("x", i), l.attr("y", a); + let o = s.startsWith("data:image/png;base64") ? s : (0, r.Nm)(s); + l.attr("xlink:href", o); + })(h, 48, 48, e.x + e.width / 2 - 24, e.y + e.image.Y, c); + } + let f = n[e.typeC4Shape.text + "Font"](); + return ( + (f.fontWeight = "bold"), + (f.fontSize = f.fontSize + 2), + (f.fontColor = o), + C(n)(e.label.text, h, e.x, e.y + e.label.Y, e.width, e.height, { fill: o }, f), + (f = n[e.typeC4Shape.text + "Font"]()), + (f.fontColor = o), + e.techn && "" !== (null == (i = e.techn) ? void 0 : i.text) + ? C(n)(e.techn.text, h, e.x, e.y + e.techn.Y, e.width, e.height, { fill: o, "font-style": "italic" }, f) + : e.type && "" !== e.type.text && C(n)(e.type.text, h, e.x, e.y + e.type.Y, e.width, e.height, { fill: o, "font-style": "italic" }, f), + e.descr && + "" !== e.descr.text && + ((f = n.personFont()), (f.fontColor = o), C(n)(e.descr.text, h, e.x, e.y + e.descr.Y, e.width, e.height, { fill: o }, f)), + e.height + ); + }; + let O = 0, + T = 0, + w = 4, + D = 2; + l.yy = S; + let R = {}; + class N { + constructor(t) { + (this.name = ""), + (this.data = {}), + (this.data.startx = void 0), + (this.data.stopx = void 0), + (this.data.starty = void 0), + (this.data.stopy = void 0), + (this.data.widthLimit = void 0), + (this.nextData = {}), + (this.nextData.startx = void 0), + (this.nextData.stopx = void 0), + (this.nextData.starty = void 0), + (this.nextData.stopy = void 0), + (this.nextData.cnt = 0), + P(t.db.getConfig()); + } + setData(t, e, n, i) { + (this.nextData.startx = this.data.startx = t), + (this.nextData.stopx = this.data.stopx = e), + (this.nextData.starty = this.data.starty = n), + (this.nextData.stopy = this.data.stopy = i); + } + updateVal(t, e, n, i) { + void 0 === t[e] ? (t[e] = n) : (t[e] = i(n, t[e])); + } + insert(t) { + this.nextData.cnt = this.nextData.cnt + 1; + let e = this.nextData.startx === this.nextData.stopx ? this.nextData.stopx + t.margin : this.nextData.stopx + 2 * t.margin, + n = e + t.width, + i = this.nextData.starty + 2 * t.margin, + a = i + t.height; + (e >= this.data.widthLimit || n >= this.data.widthLimit || this.nextData.cnt > w) && + ((e = this.nextData.startx + t.margin + R.nextLinePaddingX), + (i = this.nextData.stopy + 2 * t.margin), + (this.nextData.stopx = n = e + t.width), + (this.nextData.starty = this.nextData.stopy), + (this.nextData.stopy = a = i + t.height), + (this.nextData.cnt = 1)), + (t.x = e), + (t.y = i), + this.updateVal(this.data, "startx", e, Math.min), + this.updateVal(this.data, "starty", i, Math.min), + this.updateVal(this.data, "stopx", n, Math.max), + this.updateVal(this.data, "stopy", a, Math.max), + this.updateVal(this.nextData, "startx", e, Math.min), + this.updateVal(this.nextData, "starty", i, Math.min), + this.updateVal(this.nextData, "stopx", n, Math.max), + this.updateVal(this.nextData, "stopy", a, Math.max); + } + init(t) { + (this.name = ""), + (this.data = { + startx: void 0, + stopx: void 0, + starty: void 0, + stopy: void 0, + widthLimit: void 0, + }), + (this.nextData = { + startx: void 0, + stopx: void 0, + starty: void 0, + stopy: void 0, + cnt: 0, + }), + P(t.db.getConfig()); + } + bumpLastMargin(t) { + (this.data.stopx += t), (this.data.stopy += t); + } + } + const P = function (t) { + (0, i.f)(R, t), + t.fontFamily && (R.personFontFamily = R.systemFontFamily = R.messageFontFamily = t.fontFamily), + t.fontSize && (R.personFontSize = R.systemFontSize = R.messageFontSize = t.fontSize), + t.fontWeight && (R.personFontWeight = R.systemFontWeight = R.messageFontWeight = t.fontWeight); + }, + M = (t, e) => ({ + fontFamily: t[e + "FontFamily"], + fontSize: t[e + "FontSize"], + fontWeight: t[e + "FontWeight"], + }), + j = (t) => ({ + fontFamily: t.boundaryFontFamily, + fontSize: t.boundaryFontSize, + fontWeight: t.boundaryFontWeight, + }); + function B(t, e, n, a, s) { + if (!e[t].width) + if (n) + (e[t].text = (0, i.w)(e[t].text, s, a)), + (e[t].textLines = e[t].text.split(i.e.lineBreakRegex).length), + (e[t].width = s), + (e[t].height = (0, i.j)(e[t].text, a)); + else { + let n = e[t].text.split(i.e.lineBreakRegex); + e[t].textLines = n.length; + let s = 0; + (e[t].height = 0), (e[t].width = 0); + for (const r of n) (e[t].width = Math.max((0, i.h)(r, a), e[t].width)), (s = (0, i.j)(r, a)), (e[t].height = e[t].height + s); + } + } + const Y = function (t, e, n) { + (e.x = n.data.startx), + (e.y = n.data.starty), + (e.width = n.data.stopx - n.data.startx), + (e.height = n.data.stopy - n.data.starty), + (e.label.y = R.c4ShapeMargin - 35); + let a = e.wrap && R.wrap, + s = j(R); + (s.fontSize = s.fontSize + 2), + (s.fontWeight = "bold"), + B("label", e, a, s, (0, i.h)(e.label.text, s)), + (function (t, e, n) { + const i = t.append("g"); + let a = e.bgColor ? e.bgColor : "none", + s = e.borderColor ? e.borderColor : "#444444", + r = e.fontColor ? e.fontColor : "black", + l = { "stroke-width": 1, "stroke-dasharray": "7.0,7.0" }; + e.nodeType && (l = { "stroke-width": 1 }); + let o = { + x: e.x, + y: e.y, + fill: a, + stroke: s, + width: e.width, + height: e.height, + rx: 2.5, + ry: 2.5, + attrs: l, + }; + v(i, o); + let c = n.boundaryFont(); + (c.fontWeight = "bold"), + (c.fontSize = c.fontSize + 2), + (c.fontColor = r), + C(n)(e.label.text, i, e.x, e.y + e.label.Y, e.width, e.height, { fill: "#444444" }, c), + e.type && + "" !== e.type.text && + ((c = n.boundaryFont()), (c.fontColor = r), C(n)(e.type.text, i, e.x, e.y + e.type.Y, e.width, e.height, { fill: "#444444" }, c)), + e.descr && + "" !== e.descr.text && + ((c = n.boundaryFont()), + (c.fontSize = c.fontSize - 2), + (c.fontColor = r), + C(n)(e.descr.text, i, e.x, e.y + e.descr.Y, e.width, e.height, { fill: "#444444" }, c)); + })(t, e, R); + }, + L = function (t, e, n, a) { + let s = 0; + for (const r of a) { + s = 0; + const a = n[r]; + let l = M(R, a.typeC4Shape.text); + switch ( + ((l.fontSize = l.fontSize - 2), + (a.typeC4Shape.width = (0, i.h)("«" + a.typeC4Shape.text + "»", l)), + (a.typeC4Shape.height = l.fontSize + 2), + (a.typeC4Shape.Y = R.c4ShapePadding), + (s = a.typeC4Shape.Y + a.typeC4Shape.height - 4), + (a.image = { width: 0, height: 0, Y: 0 }), + a.typeC4Shape.text) + ) { + case "person": + case "external_person": + (a.image.width = 48), (a.image.height = 48), (a.image.Y = s), (s = a.image.Y + a.image.height); + } + a.sprite && ((a.image.width = 48), (a.image.height = 48), (a.image.Y = s), (s = a.image.Y + a.image.height)); + let o = a.wrap && R.wrap, + c = R.width - 2 * R.c4ShapePadding, + h = M(R, a.typeC4Shape.text); + (h.fontSize = h.fontSize + 2), + (h.fontWeight = "bold"), + B("label", a, o, h, c), + (a.label.Y = s + 8), + (s = a.label.Y + a.label.height), + a.type && "" !== a.type.text + ? ((a.type.text = "[" + a.type.text + "]"), + B("type", a, o, M(R, a.typeC4Shape.text), c), + (a.type.Y = s + 5), + (s = a.type.Y + a.type.height)) + : a.techn && + "" !== a.techn.text && + ((a.techn.text = "[" + a.techn.text + "]"), + B("techn", a, o, M(R, a.techn.text), c), + (a.techn.Y = s + 5), + (s = a.techn.Y + a.techn.height)); + let d = s, + u = a.label.width; + a.descr && + "" !== a.descr.text && + (B("descr", a, o, M(R, a.typeC4Shape.text), c), + (a.descr.Y = s + 20), + (s = a.descr.Y + a.descr.height), + (u = Math.max(a.label.width, a.descr.width)), + (d = s - 5 * a.descr.textLines)), + (u += R.c4ShapePadding), + (a.width = Math.max(a.width || R.width, u, R.width)), + (a.height = Math.max(a.height || R.height, d, R.height)), + (a.margin = a.margin || R.c4ShapeMargin), + t.insert(a), + k(e, a, R); + } + t.bumpLastMargin(R.c4ShapeMargin); + }; + class I { + constructor(t, e) { + (this.x = t), (this.y = e); + } + } + let U = function (t, e) { + let n = t.x, + i = t.y, + a = e.x, + s = e.y, + r = n + t.width / 2, + l = i + t.height / 2, + o = Math.abs(n - a), + c = Math.abs(i - s), + h = c / o, + d = t.height / t.width, + u = null; + return ( + i == s && n < a + ? (u = new I(n + t.width, l)) + : i == s && n > a + ? (u = new I(n, l)) + : n == a && i < s + ? (u = new I(r, i + t.height)) + : n == a && i > s && (u = new I(r, i)), + n > a && i < s + ? (u = d >= h ? new I(n, l + (h * t.width) / 2) : new I(r - ((o / c) * t.height) / 2, i + t.height)) + : n < a && i < s + ? (u = d >= h ? new I(n + t.width, l + (h * t.width) / 2) : new I(r + ((o / c) * t.height) / 2, i + t.height)) + : n < a && i > s + ? (u = d >= h ? new I(n + t.width, l - (h * t.width) / 2) : new I(r + ((t.height / 2) * o) / c, i)) + : n > a && i > s && (u = d >= h ? new I(n, l - (t.width / 2) * h) : new I(r - ((t.height / 2) * o) / c, i)), + u + ); + }, + F = function (t, e) { + let n = { x: 0, y: 0 }; + (n.x = e.x + e.width / 2), (n.y = e.y + e.height / 2); + let i = U(t, n); + return (n.x = t.x + t.width / 2), (n.y = t.y + t.height / 2), { startPoint: i, endPoint: U(e, n) }; + }; + function X(t, e, n, i, a) { + let s = new N(a); + s.data.widthLimit = n.data.widthLimit / Math.min(D, i.length); + for (let [r, l] of i.entries()) { + let i = 0; + (l.image = { width: 0, height: 0, Y: 0 }), + l.sprite && ((l.image.width = 48), (l.image.height = 48), (l.image.Y = i), (i = l.image.Y + l.image.height)); + let o = l.wrap && R.wrap, + c = j(R); + if ( + ((c.fontSize = c.fontSize + 2), + (c.fontWeight = "bold"), + B("label", l, o, c, s.data.widthLimit), + (l.label.Y = i + 8), + (i = l.label.Y + l.label.height), + l.type && + "" !== l.type.text && + ((l.type.text = "[" + l.type.text + "]"), B("type", l, o, j(R), s.data.widthLimit), (l.type.Y = i + 5), (i = l.type.Y + l.type.height)), + l.descr && "" !== l.descr.text) + ) { + let t = j(R); + (t.fontSize = t.fontSize - 2), B("descr", l, o, t, s.data.widthLimit), (l.descr.Y = i + 20), (i = l.descr.Y + l.descr.height); + } + if (0 == r || r % D == 0) { + let t = n.data.startx + R.diagramMarginX, + e = n.data.stopy + R.diagramMarginY + i; + s.setData(t, t, e, e); + } else { + let t = s.data.stopx !== s.data.startx ? s.data.stopx + R.diagramMarginX : s.data.startx, + e = s.data.starty; + s.setData(t, t, e, e); + } + s.name = l.alias; + let h = a.db.getC4ShapeArray(l.alias), + d = a.db.getC4ShapeKeys(l.alias); + d.length > 0 && L(s, t, h, d), (e = l.alias); + let u = a.db.getBoundarys(e); + u.length > 0 && X(t, e, s, u, a), + "global" !== l.alias && Y(t, l, s), + (n.data.stopy = Math.max(s.data.stopy + R.c4ShapeMargin, n.data.stopy)), + (n.data.stopx = Math.max(s.data.stopx + R.c4ShapeMargin, n.data.stopx)), + (O = Math.max(O, n.data.stopx)), + (T = Math.max(T, n.data.stopy)); + } + } + const z = { + drawPersonOrSystemArray: L, + drawBoundary: Y, + setConf: P, + draw: function (t, e, n, s) { + R = (0, i.c)().c4; + const r = (0, i.c)().securityLevel; + let l; + "sandbox" === r && (l = (0, a.Ys)("#i" + e)); + const o = "sandbox" === r ? (0, a.Ys)(l.nodes()[0].contentDocument.body) : (0, a.Ys)("body"); + let c = s.db; + s.db.setWrap(R.wrap), (w = c.getC4ShapeInRow()), (D = c.getC4BoundaryInRow()), i.l.debug(`C:${JSON.stringify(R, null, 2)}`); + const h = "sandbox" === r ? o.select(`[id="${e}"]`) : (0, a.Ys)(`[id="${e}"]`); + h + .append("defs") + .append("symbol") + .attr("id", "computer") + .attr("width", "24") + .attr("height", "24") + .append("path") + .attr("transform", "scale(.5)") + .attr( + "d", + "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z", + ), + (function (t) { + t.append("defs") + .append("symbol") + .attr("id", "database") + .attr("fill-rule", "evenodd") + .attr("clip-rule", "evenodd") + .append("path") + .attr("transform", "scale(.5)") + .attr( + "d", + "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z", + ); + })(h), + (function (t) { + t.append("defs") + .append("symbol") + .attr("id", "clock") + .attr("width", "24") + .attr("height", "24") + .append("path") + .attr("transform", "scale(.5)") + .attr( + "d", + "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z", + ); + })(h); + let d = new N(s); + d.setData(R.diagramMarginX, R.diagramMarginX, R.diagramMarginY, R.diagramMarginY), + (d.data.widthLimit = screen.availWidth), + (O = R.diagramMarginX), + (T = R.diagramMarginY); + const u = s.db.getTitle(); + X(h, "", d, s.db.getBoundarys(""), s), + (function (t) { + t.append("defs") + .append("marker") + .attr("id", "arrowhead") + .attr("refX", 9) + .attr("refY", 5) + .attr("markerUnits", "userSpaceOnUse") + .attr("markerWidth", 12) + .attr("markerHeight", 12) + .attr("orient", "auto") + .append("path") + .attr("d", "M 0 0 L 10 5 L 0 10 z"); + })(h), + (function (t) { + t.append("defs") + .append("marker") + .attr("id", "arrowend") + .attr("refX", 1) + .attr("refY", 5) + .attr("markerUnits", "userSpaceOnUse") + .attr("markerWidth", 12) + .attr("markerHeight", 12) + .attr("orient", "auto") + .append("path") + .attr("d", "M 10 0 L 0 5 L 10 10 z"); + })(h), + (function (t) { + const e = t + .append("defs") + .append("marker") + .attr("id", "crosshead") + .attr("markerWidth", 15) + .attr("markerHeight", 8) + .attr("orient", "auto") + .attr("refX", 16) + .attr("refY", 4); + e + .append("path") + .attr("fill", "black") + .attr("stroke", "#000000") + .style("stroke-dasharray", "0, 0") + .attr("stroke-width", "1px") + .attr("d", "M 9,2 V 6 L16,4 Z"), + e + .append("path") + .attr("fill", "none") + .attr("stroke", "#000000") + .style("stroke-dasharray", "0, 0") + .attr("stroke-width", "1px") + .attr("d", "M 0,1 L 6,7 M 6,1 L 0,7"); + })(h), + (function (t) { + t.append("defs") + .append("marker") + .attr("id", "filled-head") + .attr("refX", 18) + .attr("refY", 7) + .attr("markerWidth", 20) + .attr("markerHeight", 28) + .attr("orient", "auto") + .append("path") + .attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); + })(h), + (function (t, e, n, a) { + let s = 0; + for (let t of e) { + s += 1; + let e = t.wrap && R.wrap, + l = { + fontFamily: (r = R).messageFontFamily, + fontSize: r.messageFontSize, + fontWeight: r.messageFontWeight, + }; + "C4Dynamic" === a.db.getC4Type() && (t.label.text = s + ": " + t.label.text); + let o = (0, i.h)(t.label.text, l); + B("label", t, e, l, o), + t.techn && "" !== t.techn.text && ((o = (0, i.h)(t.techn.text, l)), B("techn", t, e, l, o)), + t.descr && "" !== t.descr.text && ((o = (0, i.h)(t.descr.text, l)), B("descr", t, e, l, o)); + let c = n(t.from), + h = n(t.to), + d = F(c, h); + (t.startPoint = d.startPoint), (t.endPoint = d.endPoint); + } + var r; + ((t, e, n) => { + const i = t.append("g"); + let a = 0; + for (let t of e) { + let e = t.textColor ? t.textColor : "#444444", + s = t.lineColor ? t.lineColor : "#444444", + r = t.offsetX ? parseInt(t.offsetX) : 0, + l = t.offsetY ? parseInt(t.offsetY) : 0, + o = ""; + if (0 === a) { + let e = i.append("line"); + e.attr("x1", t.startPoint.x), + e.attr("y1", t.startPoint.y), + e.attr("x2", t.endPoint.x), + e.attr("y2", t.endPoint.y), + e.attr("stroke-width", "1"), + e.attr("stroke", s), + e.style("fill", "none"), + "rel_b" !== t.type && e.attr("marker-end", "url(" + o + "#arrowhead)"), + ("birel" !== t.type && "rel_b" !== t.type) || e.attr("marker-start", "url(" + o + "#arrowend)"), + (a = -1); + } else { + let e = i.append("path"); + e + .attr("fill", "none") + .attr("stroke-width", "1") + .attr("stroke", s) + .attr( + "d", + "Mstartx,starty Qcontrolx,controly stopx,stopy " + .replaceAll("startx", t.startPoint.x) + .replaceAll("starty", t.startPoint.y) + .replaceAll("controlx", t.startPoint.x + (t.endPoint.x - t.startPoint.x) / 2 - (t.endPoint.x - t.startPoint.x) / 4) + .replaceAll("controly", t.startPoint.y + (t.endPoint.y - t.startPoint.y) / 2) + .replaceAll("stopx", t.endPoint.x) + .replaceAll("stopy", t.endPoint.y), + ), + "rel_b" !== t.type && e.attr("marker-end", "url(" + o + "#arrowhead)"), + ("birel" !== t.type && "rel_b" !== t.type) || e.attr("marker-start", "url(" + o + "#arrowend)"); + } + let c = n.messageFont(); + C(n)( + t.label.text, + i, + Math.min(t.startPoint.x, t.endPoint.x) + Math.abs(t.endPoint.x - t.startPoint.x) / 2 + r, + Math.min(t.startPoint.y, t.endPoint.y) + Math.abs(t.endPoint.y - t.startPoint.y) / 2 + l, + t.label.width, + t.label.height, + { fill: e }, + c, + ), + t.techn && + "" !== t.techn.text && + ((c = n.messageFont()), + C(n)( + "[" + t.techn.text + "]", + i, + Math.min(t.startPoint.x, t.endPoint.x) + Math.abs(t.endPoint.x - t.startPoint.x) / 2 + r, + Math.min(t.startPoint.y, t.endPoint.y) + Math.abs(t.endPoint.y - t.startPoint.y) / 2 + n.messageFontSize + 5 + l, + Math.max(t.label.width, t.techn.width), + t.techn.height, + { fill: e, "font-style": "italic" }, + c, + )); + } + })(t, e, R); + })(h, s.db.getRels(), s.db.getC4Shape, s), + (d.data.stopx = O), + (d.data.stopy = T); + const p = d.data; + let y = p.stopy - p.starty + 2 * R.diagramMarginY; + const f = p.stopx - p.startx + 2 * R.diagramMarginX; + u && + h + .append("text") + .text(u) + .attr("x", (p.stopx - p.startx) / 2 - 4 * R.diagramMarginX) + .attr("y", p.starty + R.diagramMarginY), + (0, i.i)(h, y, f, R.useMaxWidth); + const b = u ? 60 : 0; + h.attr("viewBox", p.startx - R.diagramMarginX + " -" + (R.diagramMarginY + b) + " " + f + " " + (y + b)), i.l.debug("models:", p); + }, + }, + Q = { + parser: o, + db: S, + renderer: z, + styles: (t) => `.person {\n stroke: ${t.personBorder};\n fill: ${t.personBkg};\n }\n`, + init: (t) => { + z.setConf(t.c4); + }, + }; + }, + 8252: function (t, e, n) { + n.d(e, { + a: function () { + return r; + }, + b: function () { + return c; + }, + c: function () { + return o; + }, + d: function () { + return s; + }, + e: function () { + return d; + }, + f: function () { + return l; + }, + g: function () { + return h; + }, + }); + var i = n(7967), + a = n(9339); + const s = (t, e) => { + const n = t.append("rect"); + if ( + (n.attr("x", e.x), + n.attr("y", e.y), + n.attr("fill", e.fill), + n.attr("stroke", e.stroke), + n.attr("width", e.width), + n.attr("height", e.height), + void 0 !== e.rx && n.attr("rx", e.rx), + void 0 !== e.ry && n.attr("ry", e.ry), + void 0 !== e.attrs) + ) + for (const t in e.attrs) n.attr(t, e.attrs[t]); + return void 0 !== e.class && n.attr("class", e.class), n; + }, + r = (t, e) => { + const n = { + x: e.startx, + y: e.starty, + width: e.stopx - e.startx, + height: e.stopy - e.starty, + fill: e.fill, + stroke: e.stroke, + class: "rect", + }; + s(t, n).lower(); + }, + l = (t, e) => { + const n = e.text.replace(a.J, " "), + i = t.append("text"); + i.attr("x", e.x), + i.attr("y", e.y), + i.attr("class", "legend"), + i.style("text-anchor", e.anchor), + void 0 !== e.class && i.attr("class", e.class); + const s = i.append("tspan"); + return s.attr("x", e.x + 2 * e.textMargin), s.text(n), i; + }, + o = (t, e, n, a) => { + const s = t.append("image"); + s.attr("x", e), s.attr("y", n); + const r = (0, i.Nm)(a); + s.attr("xlink:href", r); + }, + c = (t, e, n, a) => { + const s = t.append("use"); + s.attr("x", e), s.attr("y", n); + const r = (0, i.Nm)(a); + s.attr("xlink:href", `#${r}`); + }, + h = () => ({ + x: 0, + y: 0, + width: 100, + height: 100, + fill: "#EDF2AE", + stroke: "#666", + anchor: "start", + rx: 0, + ry: 0, + }), + d = () => ({ + x: 0, + y: 0, + width: 100, + height: 100, + "text-anchor": "start", + style: "#666", + textMargin: 0, + rx: 0, + ry: 0, + tspan: !0, + }); + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/546-560b35c2.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/546-560b35c2.chunk.min.js new file mode 100644 index 000000000..d2c25727e --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/546-560b35c2.chunk.min.js @@ -0,0 +1,745 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [546], + { + 3546: function (t, e, i) { + i.d(e, { + diagram: function () { + return y; + }, + }); + var n = i(9339), + s = i(7274), + r = + (i(7484), + i(7967), + i(7856), + (function () { + var t = function (t, e, i, n) { + for (i = i || {}, n = t.length; n--; i[t[n]] = e); + return i; + }, + e = [1, 4], + i = [1, 5], + n = [1, 6], + s = [1, 7], + r = [1, 9], + c = [1, 11, 13, 15, 17, 19, 20, 26, 27, 28, 29], + l = [2, 5], + a = [1, 6, 11, 13, 15, 17, 19, 20, 26, 27, 28, 29], + o = [26, 27, 28], + h = [2, 8], + u = [1, 18], + y = [1, 19], + p = [1, 20], + d = [1, 21], + g = [1, 22], + _ = [1, 23], + f = [1, 28], + m = [6, 26, 27, 28, 29], + v = { + trace: function () {}, + yy: {}, + symbols_: { + error: 2, + start: 3, + eol: 4, + directive: 5, + PIE: 6, + document: 7, + showData: 8, + line: 9, + statement: 10, + txt: 11, + value: 12, + title: 13, + title_value: 14, + acc_title: 15, + acc_title_value: 16, + acc_descr: 17, + acc_descr_value: 18, + acc_descr_multiline_value: 19, + section: 20, + openDirective: 21, + typeDirective: 22, + closeDirective: 23, + ":": 24, + argDirective: 25, + NEWLINE: 26, + ";": 27, + EOF: 28, + open_directive: 29, + type_directive: 30, + arg_directive: 31, + close_directive: 32, + $accept: 0, + $end: 1, + }, + terminals_: { + 2: "error", + 6: "PIE", + 8: "showData", + 11: "txt", + 12: "value", + 13: "title", + 14: "title_value", + 15: "acc_title", + 16: "acc_title_value", + 17: "acc_descr", + 18: "acc_descr_value", + 19: "acc_descr_multiline_value", + 20: "section", + 24: ":", + 26: "NEWLINE", + 27: ";", + 28: "EOF", + 29: "open_directive", + 30: "type_directive", + 31: "arg_directive", + 32: "close_directive", + }, + productions_: [ + 0, + [3, 2], + [3, 2], + [3, 2], + [3, 3], + [7, 0], + [7, 2], + [9, 2], + [10, 0], + [10, 2], + [10, 2], + [10, 2], + [10, 2], + [10, 1], + [10, 1], + [10, 1], + [5, 3], + [5, 5], + [4, 1], + [4, 1], + [4, 1], + [21, 1], + [22, 1], + [25, 1], + [23, 1], + ], + performAction: function (t, e, i, n, s, r, c) { + var l = r.length - 1; + switch (s) { + case 4: + n.setShowData(!0); + break; + case 7: + this.$ = r[l - 1]; + break; + case 9: + n.addSection(r[l - 1], n.cleanupValue(r[l])); + break; + case 10: + (this.$ = r[l].trim()), n.setDiagramTitle(this.$); + break; + case 11: + (this.$ = r[l].trim()), n.setAccTitle(this.$); + break; + case 12: + case 13: + (this.$ = r[l].trim()), n.setAccDescription(this.$); + break; + case 14: + n.addSection(r[l].substr(8)), (this.$ = r[l].substr(8)); + break; + case 21: + n.parseDirective("%%{", "open_directive"); + break; + case 22: + n.parseDirective(r[l], "type_directive"); + break; + case 23: + (r[l] = r[l].trim().replace(/'/g, '"')), n.parseDirective(r[l], "arg_directive"); + break; + case 24: + n.parseDirective("}%%", "close_directive", "pie"); + } + }, + table: [ + { 3: 1, 4: 2, 5: 3, 6: e, 21: 8, 26: i, 27: n, 28: s, 29: r }, + { 1: [3] }, + { 3: 10, 4: 2, 5: 3, 6: e, 21: 8, 26: i, 27: n, 28: s, 29: r }, + { 3: 11, 4: 2, 5: 3, 6: e, 21: 8, 26: i, 27: n, 28: s, 29: r }, + t(c, l, { 7: 12, 8: [1, 13] }), + t(a, [2, 18]), + t(a, [2, 19]), + t(a, [2, 20]), + { 22: 14, 30: [1, 15] }, + { 30: [2, 21] }, + { 1: [2, 1] }, + { 1: [2, 2] }, + t(o, h, { + 21: 8, + 9: 16, + 10: 17, + 5: 24, + 1: [2, 3], + 11: u, + 13: y, + 15: p, + 17: d, + 19: g, + 20: _, + 29: r, + }), + t(c, l, { 7: 25 }), + { 23: 26, 24: [1, 27], 32: f }, + t([24, 32], [2, 22]), + t(c, [2, 6]), + { 4: 29, 26: i, 27: n, 28: s }, + { 12: [1, 30] }, + { 14: [1, 31] }, + { 16: [1, 32] }, + { 18: [1, 33] }, + t(o, [2, 13]), + t(o, [2, 14]), + t(o, [2, 15]), + t(o, h, { + 21: 8, + 9: 16, + 10: 17, + 5: 24, + 1: [2, 4], + 11: u, + 13: y, + 15: p, + 17: d, + 19: g, + 20: _, + 29: r, + }), + t(m, [2, 16]), + { 25: 34, 31: [1, 35] }, + t(m, [2, 24]), + t(c, [2, 7]), + t(o, [2, 9]), + t(o, [2, 10]), + t(o, [2, 11]), + t(o, [2, 12]), + { 23: 36, 32: f }, + { 32: [2, 23] }, + t(m, [2, 17]), + ], + defaultActions: { 9: [2, 21], 10: [2, 1], 11: [2, 2], 35: [2, 23] }, + parseError: function (t, e) { + if (!e.recoverable) { + var i = new Error(t); + throw ((i.hash = e), i); + } + this.trace(t); + }, + parse: function (t) { + var e = [0], + i = [], + n = [null], + s = [], + r = this.table, + c = "", + l = 0, + a = 0, + o = s.slice.call(arguments, 1), + h = Object.create(this.lexer), + u = { yy: {} }; + for (var y in this.yy) Object.prototype.hasOwnProperty.call(this.yy, y) && (u.yy[y] = this.yy[y]); + h.setInput(t, u.yy), (u.yy.lexer = h), (u.yy.parser = this), void 0 === h.yylloc && (h.yylloc = {}); + var p = h.yylloc; + s.push(p); + var d = h.options && h.options.ranges; + "function" == typeof u.yy.parseError + ? (this.parseError = u.yy.parseError) + : (this.parseError = Object.getPrototypeOf(this).parseError); + for (var g, _, f, m, v, b, k, x, S, w = {}; ; ) { + if ( + ((_ = e[e.length - 1]), + this.defaultActions[_] + ? (f = this.defaultActions[_]) + : (null == g && + ((S = void 0), + "number" != typeof (S = i.pop() || h.lex() || 1) && + (S instanceof Array && (S = (i = S).pop()), (S = this.symbols_[S] || S)), + (g = S)), + (f = r[_] && r[_][g])), + void 0 === f || !f.length || !f[0]) + ) { + var $; + for (v in ((x = []), r[_])) this.terminals_[v] && v > 2 && x.push("'" + this.terminals_[v] + "'"); + ($ = h.showPosition + ? "Parse error on line " + + (l + 1) + + ":\n" + + h.showPosition() + + "\nExpecting " + + x.join(", ") + + ", got '" + + (this.terminals_[g] || g) + + "'" + : "Parse error on line " + (l + 1) + ": Unexpected " + (1 == g ? "end of input" : "'" + (this.terminals_[g] || g) + "'")), + this.parseError($, { + text: h.match, + token: this.terminals_[g] || g, + line: h.yylineno, + loc: p, + expected: x, + }); + } + if (f[0] instanceof Array && f.length > 1) + throw new Error("Parse Error: multiple actions possible at state: " + _ + ", token: " + g); + switch (f[0]) { + case 1: + e.push(g), + n.push(h.yytext), + s.push(h.yylloc), + e.push(f[1]), + (g = null), + (a = h.yyleng), + (c = h.yytext), + (l = h.yylineno), + (p = h.yylloc); + break; + case 2: + if ( + ((b = this.productions_[f[1]][1]), + (w.$ = n[n.length - b]), + (w._$ = { + first_line: s[s.length - (b || 1)].first_line, + last_line: s[s.length - 1].last_line, + first_column: s[s.length - (b || 1)].first_column, + last_column: s[s.length - 1].last_column, + }), + d && (w._$.range = [s[s.length - (b || 1)].range[0], s[s.length - 1].range[1]]), + void 0 !== (m = this.performAction.apply(w, [c, a, l, u.yy, f[1], n, s].concat(o)))) + ) + return m; + b && ((e = e.slice(0, -1 * b * 2)), (n = n.slice(0, -1 * b)), (s = s.slice(0, -1 * b))), + e.push(this.productions_[f[1]][0]), + n.push(w.$), + s.push(w._$), + (k = r[e[e.length - 2]][e[e.length - 1]]), + e.push(k); + break; + case 3: + return !0; + } + } + return !0; + }, + }, + b = { + EOF: 1, + parseError: function (t, e) { + if (!this.yy.parser) throw new Error(t); + this.yy.parser.parseError(t, e); + }, + setInput: function (t, e) { + return ( + (this.yy = e || this.yy || {}), + (this._input = t), + (this._more = this._backtrack = this.done = !1), + (this.yylineno = this.yyleng = 0), + (this.yytext = this.matched = this.match = ""), + (this.conditionStack = ["INITIAL"]), + (this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0, + }), + this.options.ranges && (this.yylloc.range = [0, 0]), + (this.offset = 0), + this + ); + }, + input: function () { + var t = this._input[0]; + return ( + (this.yytext += t), + this.yyleng++, + this.offset++, + (this.match += t), + (this.matched += t), + t.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, + this.options.ranges && this.yylloc.range[1]++, + (this._input = this._input.slice(1)), + t + ); + }, + unput: function (t) { + var e = t.length, + i = t.split(/(?:\r\n?|\n)/g); + (this._input = t + this._input), (this.yytext = this.yytext.substr(0, this.yytext.length - e)), (this.offset -= e); + var n = this.match.split(/(?:\r\n?|\n)/g); + (this.match = this.match.substr(0, this.match.length - 1)), + (this.matched = this.matched.substr(0, this.matched.length - 1)), + i.length - 1 && (this.yylineno -= i.length - 1); + var s = this.yylloc.range; + return ( + (this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: i + ? (i.length === n.length ? this.yylloc.first_column : 0) + n[n.length - i.length].length - i[0].length + : this.yylloc.first_column - e, + }), + this.options.ranges && (this.yylloc.range = [s[0], s[0] + this.yyleng - e]), + (this.yyleng = this.yytext.length), + this + ); + }, + more: function () { + return (this._more = !0), this; + }, + reject: function () { + return this.options.backtrack_lexer + ? ((this._backtrack = !0), this) + : this.parseError( + "Lexical error on line " + + (this.yylineno + 1) + + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + + this.showPosition(), + { text: "", token: null, line: this.yylineno }, + ); + }, + less: function (t) { + this.unput(this.match.slice(t)); + }, + pastInput: function () { + var t = this.matched.substr(0, this.matched.length - this.match.length); + return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, ""); + }, + upcomingInput: function () { + var t = this.match; + return ( + t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "") + ); + }, + showPosition: function () { + var t = this.pastInput(), + e = new Array(t.length + 1).join("-"); + return t + this.upcomingInput() + "\n" + e + "^"; + }, + test_match: function (t, e) { + var i, n, s; + if ( + (this.options.backtrack_lexer && + ((s = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column, + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done, + }), + this.options.ranges && (s.yylloc.range = this.yylloc.range.slice(0))), + (n = t[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += n.length), + (this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: n ? n[n.length - 1].length - n[n.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length, + }), + (this.yytext += t[0]), + (this.match += t[0]), + (this.matches = t), + (this.yyleng = this.yytext.length), + this.options.ranges && (this.yylloc.range = [this.offset, (this.offset += this.yyleng)]), + (this._more = !1), + (this._backtrack = !1), + (this._input = this._input.slice(t[0].length)), + (this.matched += t[0]), + (i = this.performAction.call(this, this.yy, this, e, this.conditionStack[this.conditionStack.length - 1])), + this.done && this._input && (this.done = !1), + i) + ) + return i; + if (this._backtrack) { + for (var r in s) this[r] = s[r]; + return !1; + } + return !1; + }, + next: function () { + if (this.done) return this.EOF; + var t, e, i, n; + this._input || (this.done = !0), this._more || ((this.yytext = ""), (this.match = "")); + for (var s = this._currentRules(), r = 0; r < s.length; r++) + if ((i = this._input.match(this.rules[s[r]])) && (!e || i[0].length > e[0].length)) { + if (((e = i), (n = r), this.options.backtrack_lexer)) { + if (!1 !== (t = this.test_match(i, s[r]))) return t; + if (this._backtrack) { + e = !1; + continue; + } + return !1; + } + if (!this.options.flex) break; + } + return e + ? !1 !== (t = this.test_match(e, s[n])) && t + : "" === this._input + ? this.EOF + : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno, + }); + }, + lex: function () { + return this.next() || this.lex(); + }, + begin: function (t) { + this.conditionStack.push(t); + }, + popState: function () { + return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]; + }, + _currentRules: function () { + return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] + ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules + : this.conditions.INITIAL.rules; + }, + topState: function (t) { + return (t = this.conditionStack.length - 1 - Math.abs(t || 0)) >= 0 ? this.conditionStack[t] : "INITIAL"; + }, + pushState: function (t) { + this.begin(t); + }, + stateStackSize: function () { + return this.conditionStack.length; + }, + options: { "case-insensitive": !0 }, + performAction: function (t, e, i, n) { + switch (i) { + case 0: + return this.begin("open_directive"), 29; + case 1: + return this.begin("type_directive"), 30; + case 2: + return this.popState(), this.begin("arg_directive"), 24; + case 3: + return this.popState(), this.popState(), 32; + case 4: + return 31; + case 5: + case 6: + case 8: + case 9: + break; + case 7: + return 26; + case 10: + return this.begin("title"), 13; + case 11: + return this.popState(), "title_value"; + case 12: + return this.begin("acc_title"), 15; + case 13: + return this.popState(), "acc_title_value"; + case 14: + return this.begin("acc_descr"), 17; + case 15: + return this.popState(), "acc_descr_value"; + case 16: + this.begin("acc_descr_multiline"); + break; + case 17: + case 20: + this.popState(); + break; + case 18: + return "acc_descr_multiline_value"; + case 19: + this.begin("string"); + break; + case 21: + return "txt"; + case 22: + return 6; + case 23: + return 8; + case 24: + return "value"; + case 25: + return 28; + } + }, + rules: [ + /^(?:%%\{)/i, + /^(?:((?:(?!\}%%)[^:.])*))/i, + /^(?::)/i, + /^(?:\}%%)/i, + /^(?:((?:(?!\}%%).|\n)*))/i, + /^(?:%%(?!\{)[^\n]*)/i, + /^(?:[^\}]%%[^\n]*)/i, + /^(?:[\n\r]+)/i, + /^(?:%%[^\n]*)/i, + /^(?:[\s]+)/i, + /^(?:title\b)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accTitle\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*\{\s*)/i, + /^(?:[\}])/i, + /^(?:[^\}]*)/i, + /^(?:["])/i, + /^(?:["])/i, + /^(?:[^"]*)/i, + /^(?:pie\b)/i, + /^(?:showData\b)/i, + /^(?::[\s]*[\d]+(?:\.[\d]+)?)/i, + /^(?:$)/i, + ], + conditions: { + acc_descr_multiline: { rules: [17, 18], inclusive: !1 }, + acc_descr: { rules: [15], inclusive: !1 }, + acc_title: { rules: [13], inclusive: !1 }, + close_directive: { rules: [], inclusive: !1 }, + arg_directive: { rules: [3, 4], inclusive: !1 }, + type_directive: { rules: [2, 3], inclusive: !1 }, + open_directive: { rules: [1], inclusive: !1 }, + title: { rules: [11], inclusive: !1 }, + string: { rules: [20, 21], inclusive: !1 }, + INITIAL: { + rules: [0, 5, 6, 7, 8, 9, 10, 12, 14, 16, 19, 22, 23, 24, 25], + inclusive: !0, + }, + }, + }; + function k() { + this.yy = {}; + } + return (v.lexer = b), (k.prototype = v), (v.Parser = k), new k(); + })()); + r.parser = r; + const c = r, + l = n.C.pie, + a = {}; + let o = a, + h = false; + const u = structuredClone(l), + y = { + parser: c, + db: { + getConfig: () => structuredClone(u), + parseDirective: (t, e, i) => { + (0, n.D)(void 0, t, e, i); + }, + clear: () => { + (o = structuredClone(a)), (h = false), (0, n.v)(); + }, + setDiagramTitle: n.r, + getDiagramTitle: n.t, + setAccTitle: n.s, + getAccTitle: n.g, + setAccDescription: n.b, + getAccDescription: n.a, + addSection: (t, e) => { + (t = (0, n.d)(t, (0, n.c)())), void 0 === o[t] && ((o[t] = e), n.l.debug(`added new section: ${t}, with value: ${e}`)); + }, + getSections: () => o, + cleanupValue: (t) => (":" === t.substring(0, 1) && (t = t.substring(1).trim()), Number(t.trim())), + setShowData: (t) => { + h = t; + }, + getShowData: () => h, + }, + renderer: { + draw: (t, e, i, r) => { + var c, l; + n.l.debug("rendering pie chart\n" + t); + const a = r.db, + o = (0, n.c)(), + h = (0, n.E)(a.getConfig(), o.pie), + u = (null == (l = null == (c = document.getElementById(e)) ? void 0 : c.parentElement) ? void 0 : l.offsetWidth) ?? h.useWidth, + y = (0, n.B)(e); + y.attr("viewBox", `0 0 ${u} 450`), (0, n.i)(y, 450, u, h.useMaxWidth); + const p = y.append("g"); + p.attr("transform", "translate(" + u / 2 + ",225)"); + const { themeVariables: d } = o; + let [g] = (0, n.F)(d.pieOuterStrokeWidth); + g ?? (g = 2); + const _ = h.textPosition, + f = Math.min(u, 450) / 2 - 40, + m = (0, s.Nb1)().innerRadius(0).outerRadius(f), + v = (0, s.Nb1)() + .innerRadius(f * _) + .outerRadius(f * _); + p.append("circle") + .attr("cx", 0) + .attr("cy", 0) + .attr("r", f + g / 2) + .attr("class", "pieOuterCircle"); + const b = a.getSections(), + k = ((t) => { + const e = Object.entries(t).map((t) => ({ label: t[0], value: t[1] })); + return (0, s.ve8)().value((t) => t.value)(e); + })(b), + x = [d.pie1, d.pie2, d.pie3, d.pie4, d.pie5, d.pie6, d.pie7, d.pie8, d.pie9, d.pie10, d.pie11, d.pie12], + S = (0, s.PKp)(x); + p.selectAll("mySlices") + .data(k) + .enter() + .append("path") + .attr("d", m) + .attr("fill", (t) => S(t.data.label)) + .attr("class", "pieCircle"); + let w = 0; + Object.keys(b).forEach((t) => { + w += b[t]; + }), + p + .selectAll("mySlices") + .data(k) + .enter() + .append("text") + .text((t) => ((t.data.value / w) * 100).toFixed(0) + "%") + .attr("transform", (t) => "translate(" + v.centroid(t) + ")") + .style("text-anchor", "middle") + .attr("class", "slice"), + p.append("text").text(a.getDiagramTitle()).attr("x", 0).attr("y", -200).attr("class", "pieTitleText"); + const $ = p + .selectAll(".legend") + .data(S.domain()) + .enter() + .append("g") + .attr("class", "legend") + .attr("transform", (t, e) => "translate(216," + (22 * e - (22 * S.domain().length) / 2) + ")"); + $.append("rect").attr("width", 18).attr("height", 18).style("fill", S).style("stroke", S), + $.data(k) + .append("text") + .attr("x", 22) + .attr("y", 14) + .text((t) => { + const { label: e, value: i } = t.data; + return a.getShowData() ? `${e} [${i}]` : e; + }); + }, + }, + styles: (t) => + `\n .pieCircle{\n stroke: ${t.pieStrokeColor};\n stroke-width : ${t.pieStrokeWidth};\n opacity : ${t.pieOpacity};\n }\n .pieOuterCircle{\n stroke: ${t.pieOuterStrokeColor};\n stroke-width: ${t.pieOuterStrokeWidth};\n fill: none;\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${t.pieTitleTextSize};\n fill: ${t.pieTitleTextColor};\n font-family: ${t.fontFamily};\n }\n .slice {\n font-family: ${t.fontFamily};\n fill: ${t.pieSectionTextColor};\n font-size:${t.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${t.pieLegendTextColor};\n font-family: ${t.fontFamily};\n font-size: ${t.pieLegendTextSize};\n }\n`, + }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/579-9222afff.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/579-9222afff.chunk.min.js new file mode 100644 index 000000000..ce91a9c73 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/579-9222afff.chunk.min.js @@ -0,0 +1,1098 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [579], + { + 8579: function (t, n, e) { + e.d(n, { + diagram: function () { + return R; + }, + }); + var i = e(9339), + s = e(7274); + function r(t, n) { + let e; + if (void 0 === n) for (const n of t) null != n && (e > n || (void 0 === e && n >= n)) && (e = n); + else { + let i = -1; + for (let s of t) null != (s = n(s, ++i, t)) && (e > s || (void 0 === e && s >= s)) && (e = s); + } + return e; + } + function o(t) { + return t.target.depth; + } + function c(t, n) { + return t.sourceLinks.length ? t.depth : n - 1; + } + function l(t, n) { + let e = 0; + if (void 0 === n) for (let n of t) (n = +n) && (e += n); + else { + let i = -1; + for (let s of t) (s = +n(s, ++i, t)) && (e += s); + } + return e; + } + function h(t, n) { + let e; + if (void 0 === n) for (const n of t) null != n && (e < n || (void 0 === e && n >= n)) && (e = n); + else { + let i = -1; + for (let s of t) null != (s = n(s, ++i, t)) && (e < s || (void 0 === e && s >= s)) && (e = s); + } + return e; + } + function a(t) { + return function () { + return t; + }; + } + function u(t, n) { + return y(t.source, n.source) || t.index - n.index; + } + function f(t, n) { + return y(t.target, n.target) || t.index - n.index; + } + function y(t, n) { + return t.y0 - n.y0; + } + function d(t) { + return t.value; + } + function p(t) { + return t.index; + } + function g(t) { + return t.nodes; + } + function _(t) { + return t.links; + } + function k(t, n) { + const e = t.get(n); + if (!e) throw new Error("missing: " + n); + return e; + } + function x({ nodes: t }) { + for (const n of t) { + let t = n.y0, + e = t; + for (const e of n.sourceLinks) (e.y0 = t + e.width / 2), (t += e.width); + for (const t of n.targetLinks) (t.y1 = e + t.width / 2), (e += t.width); + } + } + var m = Math.PI, + v = 2 * m, + b = 1e-6, + w = v - b; + function E() { + (this._x0 = this._y0 = this._x1 = this._y1 = null), (this._ = ""); + } + function L() { + return new E(); + } + E.prototype = L.prototype = { + constructor: E, + moveTo: function (t, n) { + this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +n); + }, + closePath: function () { + null !== this._x1 && ((this._x1 = this._x0), (this._y1 = this._y0), (this._ += "Z")); + }, + lineTo: function (t, n) { + this._ += "L" + (this._x1 = +t) + "," + (this._y1 = +n); + }, + quadraticCurveTo: function (t, n, e, i) { + this._ += "Q" + +t + "," + +n + "," + (this._x1 = +e) + "," + (this._y1 = +i); + }, + bezierCurveTo: function (t, n, e, i, s, r) { + this._ += "C" + +t + "," + +n + "," + +e + "," + +i + "," + (this._x1 = +s) + "," + (this._y1 = +r); + }, + arcTo: function (t, n, e, i, s) { + (t = +t), (n = +n), (e = +e), (i = +i), (s = +s); + var r = this._x1, + o = this._y1, + c = e - t, + l = i - n, + h = r - t, + a = o - n, + u = h * h + a * a; + if (s < 0) throw new Error("negative radius: " + s); + if (null === this._x1) this._ += "M" + (this._x1 = t) + "," + (this._y1 = n); + else if (u > b) + if (Math.abs(a * c - l * h) > b && s) { + var f = e - r, + y = i - o, + d = c * c + l * l, + p = f * f + y * y, + g = Math.sqrt(d), + _ = Math.sqrt(u), + k = s * Math.tan((m - Math.acos((d + u - p) / (2 * g * _))) / 2), + x = k / _, + v = k / g; + Math.abs(x - 1) > b && (this._ += "L" + (t + x * h) + "," + (n + x * a)), + (this._ += "A" + s + "," + s + ",0,0," + +(a * f > h * y) + "," + (this._x1 = t + v * c) + "," + (this._y1 = n + v * l)); + } else this._ += "L" + (this._x1 = t) + "," + (this._y1 = n); + }, + arc: function (t, n, e, i, s, r) { + (t = +t), (n = +n), (r = !!r); + var o = (e = +e) * Math.cos(i), + c = e * Math.sin(i), + l = t + o, + h = n + c, + a = 1 ^ r, + u = r ? i - s : s - i; + if (e < 0) throw new Error("negative radius: " + e); + null === this._x1 + ? (this._ += "M" + l + "," + h) + : (Math.abs(this._x1 - l) > b || Math.abs(this._y1 - h) > b) && (this._ += "L" + l + "," + h), + e && + (u < 0 && (u = (u % v) + v), + u > w + ? (this._ += + "A" + + e + + "," + + e + + ",0,1," + + a + + "," + + (t - o) + + "," + + (n - c) + + "A" + + e + + "," + + e + + ",0,1," + + a + + "," + + (this._x1 = l) + + "," + + (this._y1 = h)) + : u > b && + (this._ += + "A" + + e + + "," + + e + + ",0," + + +(u >= m) + + "," + + a + + "," + + (this._x1 = t + e * Math.cos(s)) + + "," + + (this._y1 = n + e * Math.sin(s)))); + }, + rect: function (t, n, e, i) { + this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +n) + "h" + +e + "v" + +i + "h" + -e + "Z"; + }, + toString: function () { + return this._; + }, + }; + var A = L, + S = Array.prototype.slice; + function M(t) { + return function () { + return t; + }; + } + function I(t) { + return t[0]; + } + function T(t) { + return t[1]; + } + function O(t) { + return t.source; + } + function P(t) { + return t.target; + } + function C(t, n, e, i, s) { + t.moveTo(n, e), t.bezierCurveTo((n = (n + i) / 2), e, n, s, i, s); + } + function D(t) { + return [t.source.x1, t.y0]; + } + function N(t) { + return [t.target.x0, t.y1]; + } + function $() { + return (function (t) { + var n = O, + e = P, + i = I, + s = T, + r = null; + function o() { + var o, + c = S.call(arguments), + l = n.apply(this, c), + h = e.apply(this, c); + if ((r || (r = o = A()), t(r, +i.apply(this, ((c[0] = l), c)), +s.apply(this, c), +i.apply(this, ((c[0] = h), c)), +s.apply(this, c)), o)) + return (r = null), o + "" || null; + } + return ( + (o.source = function (t) { + return arguments.length ? ((n = t), o) : n; + }), + (o.target = function (t) { + return arguments.length ? ((e = t), o) : e; + }), + (o.x = function (t) { + return arguments.length ? ((i = "function" == typeof t ? t : M(+t)), o) : i; + }), + (o.y = function (t) { + return arguments.length ? ((s = "function" == typeof t ? t : M(+t)), o) : s; + }), + (o.context = function (t) { + return arguments.length ? ((r = null == t ? null : t), o) : r; + }), + o + ); + })(C) + .source(D) + .target(N); + } + e(7484), e(7967), e(7856); + var j = (function () { + var t = function (t, n, e, i) { + for (e = e || {}, i = t.length; i--; e[t[i]] = n); + return e; + }, + n = [1, 9], + e = [1, 10], + i = [1, 5, 10, 12], + s = { + trace: function () {}, + yy: {}, + symbols_: { + error: 2, + start: 3, + SANKEY: 4, + NEWLINE: 5, + csv: 6, + opt_eof: 7, + record: 8, + csv_tail: 9, + EOF: 10, + "field[source]": 11, + COMMA: 12, + "field[target]": 13, + "field[value]": 14, + field: 15, + escaped: 16, + non_escaped: 17, + DQUOTE: 18, + ESCAPED_TEXT: 19, + NON_ESCAPED_TEXT: 20, + $accept: 0, + $end: 1, + }, + terminals_: { + 2: "error", + 4: "SANKEY", + 5: "NEWLINE", + 10: "EOF", + 11: "field[source]", + 12: "COMMA", + 13: "field[target]", + 14: "field[value]", + 18: "DQUOTE", + 19: "ESCAPED_TEXT", + 20: "NON_ESCAPED_TEXT", + }, + productions_: [0, [3, 4], [6, 2], [9, 2], [9, 0], [7, 1], [7, 0], [8, 5], [15, 1], [15, 1], [16, 3], [17, 1]], + performAction: function (t, n, e, i, s, r, o) { + var c = r.length - 1; + switch (s) { + case 7: + const t = i.findOrCreateNode(r[c - 4].trim().replaceAll('""', '"')), + n = i.findOrCreateNode(r[c - 2].trim().replaceAll('""', '"')), + e = parseFloat(r[c].trim()); + i.addLink(t, n, e); + break; + case 8: + case 9: + case 11: + this.$ = r[c]; + break; + case 10: + this.$ = r[c - 1]; + } + }, + table: [ + { 3: 1, 4: [1, 2] }, + { 1: [3] }, + { 5: [1, 3] }, + { 6: 4, 8: 5, 15: 6, 16: 7, 17: 8, 18: n, 20: e }, + { 1: [2, 6], 7: 11, 10: [1, 12] }, + t(e, [2, 4], { 9: 13, 5: [1, 14] }), + { 12: [1, 15] }, + t(i, [2, 8]), + t(i, [2, 9]), + { 19: [1, 16] }, + t(i, [2, 11]), + { 1: [2, 1] }, + { 1: [2, 5] }, + t(e, [2, 2]), + { 6: 17, 8: 5, 15: 6, 16: 7, 17: 8, 18: n, 20: e }, + { 15: 18, 16: 7, 17: 8, 18: n, 20: e }, + { 18: [1, 19] }, + t(e, [2, 3]), + { 12: [1, 20] }, + t(i, [2, 10]), + { 15: 21, 16: 7, 17: 8, 18: n, 20: e }, + t([1, 5, 10], [2, 7]), + ], + defaultActions: { 11: [2, 1], 12: [2, 5] }, + parseError: function (t, n) { + if (!n.recoverable) { + var e = new Error(t); + throw ((e.hash = n), e); + } + this.trace(t); + }, + parse: function (t) { + var n = [0], + e = [], + i = [null], + s = [], + r = this.table, + o = "", + c = 0, + l = 0, + h = s.slice.call(arguments, 1), + a = Object.create(this.lexer), + u = { yy: {} }; + for (var f in this.yy) Object.prototype.hasOwnProperty.call(this.yy, f) && (u.yy[f] = this.yy[f]); + a.setInput(t, u.yy), (u.yy.lexer = a), (u.yy.parser = this), void 0 === a.yylloc && (a.yylloc = {}); + var y = a.yylloc; + s.push(y); + var d = a.options && a.options.ranges; + "function" == typeof u.yy.parseError ? (this.parseError = u.yy.parseError) : (this.parseError = Object.getPrototypeOf(this).parseError); + for (var p, g, _, k, x, m, v, b, w, E = {}; ; ) { + if ( + ((g = n[n.length - 1]), + this.defaultActions[g] + ? (_ = this.defaultActions[g]) + : (null == p && + ((w = void 0), + "number" != typeof (w = e.pop() || a.lex() || 1) && (w instanceof Array && (w = (e = w).pop()), (w = this.symbols_[w] || w)), + (p = w)), + (_ = r[g] && r[g][p])), + void 0 === _ || !_.length || !_[0]) + ) { + var L; + for (x in ((b = []), r[g])) this.terminals_[x] && x > 2 && b.push("'" + this.terminals_[x] + "'"); + (L = a.showPosition + ? "Parse error on line " + + (c + 1) + + ":\n" + + a.showPosition() + + "\nExpecting " + + b.join(", ") + + ", got '" + + (this.terminals_[p] || p) + + "'" + : "Parse error on line " + (c + 1) + ": Unexpected " + (1 == p ? "end of input" : "'" + (this.terminals_[p] || p) + "'")), + this.parseError(L, { + text: a.match, + token: this.terminals_[p] || p, + line: a.yylineno, + loc: y, + expected: b, + }); + } + if (_[0] instanceof Array && _.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + g + ", token: " + p); + switch (_[0]) { + case 1: + n.push(p), + i.push(a.yytext), + s.push(a.yylloc), + n.push(_[1]), + (p = null), + (l = a.yyleng), + (o = a.yytext), + (c = a.yylineno), + (y = a.yylloc); + break; + case 2: + if ( + ((m = this.productions_[_[1]][1]), + (E.$ = i[i.length - m]), + (E._$ = { + first_line: s[s.length - (m || 1)].first_line, + last_line: s[s.length - 1].last_line, + first_column: s[s.length - (m || 1)].first_column, + last_column: s[s.length - 1].last_column, + }), + d && (E._$.range = [s[s.length - (m || 1)].range[0], s[s.length - 1].range[1]]), + void 0 !== (k = this.performAction.apply(E, [o, l, c, u.yy, _[1], i, s].concat(h)))) + ) + return k; + m && ((n = n.slice(0, -1 * m * 2)), (i = i.slice(0, -1 * m)), (s = s.slice(0, -1 * m))), + n.push(this.productions_[_[1]][0]), + i.push(E.$), + s.push(E._$), + (v = r[n[n.length - 2]][n[n.length - 1]]), + n.push(v); + break; + case 3: + return !0; + } + } + return !0; + }, + }, + r = { + EOF: 1, + parseError: function (t, n) { + if (!this.yy.parser) throw new Error(t); + this.yy.parser.parseError(t, n); + }, + setInput: function (t, n) { + return ( + (this.yy = n || this.yy || {}), + (this._input = t), + (this._more = this._backtrack = this.done = !1), + (this.yylineno = this.yyleng = 0), + (this.yytext = this.matched = this.match = ""), + (this.conditionStack = ["INITIAL"]), + (this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }), + this.options.ranges && (this.yylloc.range = [0, 0]), + (this.offset = 0), + this + ); + }, + input: function () { + var t = this._input[0]; + return ( + (this.yytext += t), + this.yyleng++, + this.offset++, + (this.match += t), + (this.matched += t), + t.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, + this.options.ranges && this.yylloc.range[1]++, + (this._input = this._input.slice(1)), + t + ); + }, + unput: function (t) { + var n = t.length, + e = t.split(/(?:\r\n?|\n)/g); + (this._input = t + this._input), (this.yytext = this.yytext.substr(0, this.yytext.length - n)), (this.offset -= n); + var i = this.match.split(/(?:\r\n?|\n)/g); + (this.match = this.match.substr(0, this.match.length - 1)), + (this.matched = this.matched.substr(0, this.matched.length - 1)), + e.length - 1 && (this.yylineno -= e.length - 1); + var s = this.yylloc.range; + return ( + (this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: e + ? (e.length === i.length ? this.yylloc.first_column : 0) + i[i.length - e.length].length - e[0].length + : this.yylloc.first_column - n, + }), + this.options.ranges && (this.yylloc.range = [s[0], s[0] + this.yyleng - n]), + (this.yyleng = this.yytext.length), + this + ); + }, + more: function () { + return (this._more = !0), this; + }, + reject: function () { + return this.options.backtrack_lexer + ? ((this._backtrack = !0), this) + : this.parseError( + "Lexical error on line " + + (this.yylineno + 1) + + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + + this.showPosition(), + { text: "", token: null, line: this.yylineno }, + ); + }, + less: function (t) { + this.unput(this.match.slice(t)); + }, + pastInput: function () { + var t = this.matched.substr(0, this.matched.length - this.match.length); + return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, ""); + }, + upcomingInput: function () { + var t = this.match; + return ( + t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "") + ); + }, + showPosition: function () { + var t = this.pastInput(), + n = new Array(t.length + 1).join("-"); + return t + this.upcomingInput() + "\n" + n + "^"; + }, + test_match: function (t, n) { + var e, i, s; + if ( + (this.options.backtrack_lexer && + ((s = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column, + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done, + }), + this.options.ranges && (s.yylloc.range = this.yylloc.range.slice(0))), + (i = t[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += i.length), + (this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: i ? i[i.length - 1].length - i[i.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length, + }), + (this.yytext += t[0]), + (this.match += t[0]), + (this.matches = t), + (this.yyleng = this.yytext.length), + this.options.ranges && (this.yylloc.range = [this.offset, (this.offset += this.yyleng)]), + (this._more = !1), + (this._backtrack = !1), + (this._input = this._input.slice(t[0].length)), + (this.matched += t[0]), + (e = this.performAction.call(this, this.yy, this, n, this.conditionStack[this.conditionStack.length - 1])), + this.done && this._input && (this.done = !1), + e) + ) + return e; + if (this._backtrack) { + for (var r in s) this[r] = s[r]; + return !1; + } + return !1; + }, + next: function () { + if (this.done) return this.EOF; + var t, n, e, i; + this._input || (this.done = !0), this._more || ((this.yytext = ""), (this.match = "")); + for (var s = this._currentRules(), r = 0; r < s.length; r++) + if ((e = this._input.match(this.rules[s[r]])) && (!n || e[0].length > n[0].length)) { + if (((n = e), (i = r), this.options.backtrack_lexer)) { + if (!1 !== (t = this.test_match(e, s[r]))) return t; + if (this._backtrack) { + n = !1; + continue; + } + return !1; + } + if (!this.options.flex) break; + } + return n + ? !1 !== (t = this.test_match(n, s[i])) && t + : "" === this._input + ? this.EOF + : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno, + }); + }, + lex: function () { + return this.next() || this.lex(); + }, + begin: function (t) { + this.conditionStack.push(t); + }, + popState: function () { + return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]; + }, + _currentRules: function () { + return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] + ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules + : this.conditions.INITIAL.rules; + }, + topState: function (t) { + return (t = this.conditionStack.length - 1 - Math.abs(t || 0)) >= 0 ? this.conditionStack[t] : "INITIAL"; + }, + pushState: function (t) { + this.begin(t); + }, + stateStackSize: function () { + return this.conditionStack.length; + }, + options: { easy_keword_rules: !0 }, + performAction: function (t, n, e, i) { + switch (e) { + case 0: + return this.pushState("csv"), 4; + case 1: + return 10; + case 2: + return 5; + case 3: + return 12; + case 4: + return this.pushState("escaped_text"), 18; + case 5: + return 20; + case 6: + return this.popState("escaped_text"), 18; + case 7: + return 19; + } + }, + rules: [ + /^(?:sankey-beta\b)/, + /^(?:$)/, + /^(?:((\u000D\u000A)|(\u000A)))/, + /^(?:(\u002C))/, + /^(?:(\u0022))/, + /^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/, + /^(?:(\u0022)(?!(\u0022)))/, + /^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/, + ], + conditions: { + csv: { rules: [1, 2, 3, 4, 5, 6, 7], inclusive: !1 }, + escaped_text: { rules: [6, 7], inclusive: !1 }, + INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7], inclusive: !0 }, + }, + }; + function o() { + this.yy = {}; + } + return (s.lexer = r), (o.prototype = s), (s.Parser = o), new o(); + })(); + j.parser = j; + const z = j; + let Y = [], + F = [], + U = {}; + class W { + constructor(t, n, e = 0) { + (this.source = t), (this.target = n), (this.value = e); + } + } + class K { + constructor(t) { + this.ID = t; + } + } + const G = { + nodesMap: U, + getConfig: () => (0, i.c)().sankey, + getNodes: () => F, + getLinks: () => Y, + getGraph: () => ({ + nodes: F.map((t) => ({ id: t.ID })), + links: Y.map((t) => ({ source: t.source.ID, target: t.target.ID, value: t.value })), + }), + addLink: (t, n, e) => { + Y.push(new W(t, n, e)); + }, + findOrCreateNode: (t) => ((t = i.e.sanitizeText(t, (0, i.c)())), U[t] || ((U[t] = new K(t)), F.push(U[t])), U[t]), + getAccTitle: i.g, + setAccTitle: i.s, + getAccDescription: i.a, + setAccDescription: i.b, + getDiagramTitle: i.t, + setDiagramTitle: i.r, + clear: () => { + (Y = []), (F = []), (U = {}), (0, i.v)(); + }, + }, + V = class { + static next(t) { + return new V(t + ++V.count); + } + constructor(t) { + (this.id = t), (this.href = `#${t}`); + } + toString() { + return "url(" + this.href + ")"; + } + }; + let X = V; + X.count = 0; + const q = { + left: function (t) { + return t.depth; + }, + right: function (t, n) { + return n - 1 - t.height; + }, + center: function (t) { + return t.targetLinks.length ? t.depth : t.sourceLinks.length ? r(t.sourceLinks, o) - 1 : 0; + }, + justify: c, + }, + Q = { + draw: function (t, n, e, o) { + const { securityLevel: m, sankey: v } = (0, i.c)(), + b = i.K.sankey; + let w; + "sandbox" === m && (w = (0, s.Ys)("#i" + n)); + const E = "sandbox" === m ? (0, s.Ys)(w.nodes()[0].contentDocument.body) : (0, s.Ys)("body"), + L = "sandbox" === m ? E.select(`[id="${n}"]`) : (0, s.Ys)(`[id="${n}"]`), + A = (null == v ? void 0 : v.width) ?? b.width, + S = (null == v ? void 0 : v.height) ?? b.width, + M = (null == v ? void 0 : v.useMaxWidth) ?? b.useMaxWidth, + I = (null == v ? void 0 : v.nodeAlignment) ?? b.nodeAlignment, + T = (null == v ? void 0 : v.prefix) ?? b.prefix, + O = (null == v ? void 0 : v.suffix) ?? b.suffix, + P = (null == v ? void 0 : v.showValues) ?? b.showValues; + (0, i.i)(L, S, A, M); + const C = o.db.getGraph(), + D = q[I]; + (function () { + let t, + n, + e, + i = 0, + s = 0, + o = 1, + m = 1, + v = 24, + b = 8, + w = p, + E = c, + L = g, + A = _, + S = 6; + function M() { + const c = { nodes: L.apply(null, arguments), links: A.apply(null, arguments) }; + return ( + (function ({ nodes: t, links: n }) { + for (const [n, e] of t.entries()) (e.index = n), (e.sourceLinks = []), (e.targetLinks = []); + const i = new Map(t.map((n, e) => [w(n, e, t), n])); + for (const [t, e] of n.entries()) { + e.index = t; + let { source: n, target: s } = e; + "object" != typeof n && (n = e.source = k(i, n)), + "object" != typeof s && (s = e.target = k(i, s)), + n.sourceLinks.push(e), + s.targetLinks.push(e); + } + if (null != e) for (const { sourceLinks: n, targetLinks: i } of t) n.sort(e), i.sort(e); + })(c), + (function ({ nodes: t }) { + for (const n of t) n.value = void 0 === n.fixedValue ? Math.max(l(n.sourceLinks, d), l(n.targetLinks, d)) : n.fixedValue; + })(c), + (function ({ nodes: t }) { + const n = t.length; + let e = new Set(t), + i = new Set(), + s = 0; + for (; e.size; ) { + for (const t of e) { + t.depth = s; + for (const { target: n } of t.sourceLinks) i.add(n); + } + if (++s > n) throw new Error("circular link"); + (e = i), (i = new Set()); + } + })(c), + (function ({ nodes: t }) { + const n = t.length; + let e = new Set(t), + i = new Set(), + s = 0; + for (; e.size; ) { + for (const t of e) { + t.height = s; + for (const { source: n } of t.targetLinks) i.add(n); + } + if (++s > n) throw new Error("circular link"); + (e = i), (i = new Set()); + } + })(c), + (function (e) { + const c = (function ({ nodes: t }) { + const e = h(t, (t) => t.depth) + 1, + s = (o - i - v) / (e - 1), + r = new Array(e); + for (const n of t) { + const t = Math.max(0, Math.min(e - 1, Math.floor(E.call(null, n, e)))); + (n.layer = t), (n.x0 = i + t * s), (n.x1 = n.x0 + v), r[t] ? r[t].push(n) : (r[t] = [n]); + } + if (n) for (const t of r) t.sort(n); + return r; + })(e); + (t = Math.min(b, (m - s) / (h(c, (t) => t.length) - 1))), + (function (n) { + const e = r(n, (n) => (m - s - (n.length - 1) * t) / l(n, d)); + for (const i of n) { + let n = s; + for (const s of i) { + (s.y0 = n), (s.y1 = n + s.value * e), (n = s.y1 + t); + for (const t of s.sourceLinks) t.width = t.value * e; + } + n = (m - n + t) / (i.length + 1); + for (let t = 0; t < i.length; ++t) { + const e = i[t]; + (e.y0 += n * (t + 1)), (e.y1 += n * (t + 1)); + } + N(i); + } + })(c); + for (let t = 0; t < S; ++t) { + const n = Math.pow(0.99, t), + e = Math.max(1 - n, (t + 1) / S); + T(c, n, e), I(c, n, e); + } + })(c), + x(c), + c + ); + } + function I(t, e, i) { + for (let s = 1, r = t.length; s < r; ++s) { + const r = t[s]; + for (const t of r) { + let n = 0, + i = 0; + for (const { source: e, value: s } of t.targetLinks) { + let r = s * (t.layer - e.layer); + (n += $(e, t) * r), (i += r); + } + if (!(i > 0)) continue; + let s = (n / i - t.y0) * e; + (t.y0 += s), (t.y1 += s), D(t); + } + void 0 === n && r.sort(y), O(r, i); + } + } + function T(t, e, i) { + for (let s = t.length - 2; s >= 0; --s) { + const r = t[s]; + for (const t of r) { + let n = 0, + i = 0; + for (const { target: e, value: s } of t.sourceLinks) { + let r = s * (e.layer - t.layer); + (n += j(t, e) * r), (i += r); + } + if (!(i > 0)) continue; + let s = (n / i - t.y0) * e; + (t.y0 += s), (t.y1 += s), D(t); + } + void 0 === n && r.sort(y), O(r, i); + } + } + function O(n, e) { + const i = n.length >> 1, + r = n[i]; + C(n, r.y0 - t, i - 1, e), P(n, r.y1 + t, i + 1, e), C(n, m, n.length - 1, e), P(n, s, 0, e); + } + function P(n, e, i, s) { + for (; i < n.length; ++i) { + const r = n[i], + o = (e - r.y0) * s; + o > 1e-6 && ((r.y0 += o), (r.y1 += o)), (e = r.y1 + t); + } + } + function C(n, e, i, s) { + for (; i >= 0; --i) { + const r = n[i], + o = (r.y1 - e) * s; + o > 1e-6 && ((r.y0 -= o), (r.y1 -= o)), (e = r.y0 - t); + } + } + function D({ sourceLinks: t, targetLinks: n }) { + if (void 0 === e) { + for (const { + source: { sourceLinks: t }, + } of n) + t.sort(f); + for (const { + target: { targetLinks: n }, + } of t) + n.sort(u); + } + } + function N(t) { + if (void 0 === e) for (const { sourceLinks: n, targetLinks: e } of t) n.sort(f), e.sort(u); + } + function $(n, e) { + let i = n.y0 - ((n.sourceLinks.length - 1) * t) / 2; + for (const { target: s, width: r } of n.sourceLinks) { + if (s === e) break; + i += r + t; + } + for (const { source: t, width: s } of e.targetLinks) { + if (t === n) break; + i -= s; + } + return i; + } + function j(n, e) { + let i = e.y0 - ((e.targetLinks.length - 1) * t) / 2; + for (const { source: s, width: r } of e.targetLinks) { + if (s === n) break; + i += r + t; + } + for (const { target: t, width: s } of n.sourceLinks) { + if (t === e) break; + i -= s; + } + return i; + } + return ( + (M.update = function (t) { + return x(t), t; + }), + (M.nodeId = function (t) { + return arguments.length ? ((w = "function" == typeof t ? t : a(t)), M) : w; + }), + (M.nodeAlign = function (t) { + return arguments.length ? ((E = "function" == typeof t ? t : a(t)), M) : E; + }), + (M.nodeSort = function (t) { + return arguments.length ? ((n = t), M) : n; + }), + (M.nodeWidth = function (t) { + return arguments.length ? ((v = +t), M) : v; + }), + (M.nodePadding = function (n) { + return arguments.length ? ((b = t = +n), M) : b; + }), + (M.nodes = function (t) { + return arguments.length ? ((L = "function" == typeof t ? t : a(t)), M) : L; + }), + (M.links = function (t) { + return arguments.length ? ((A = "function" == typeof t ? t : a(t)), M) : A; + }), + (M.linkSort = function (t) { + return arguments.length ? ((e = t), M) : e; + }), + (M.size = function (t) { + return arguments.length ? ((i = s = 0), (o = +t[0]), (m = +t[1]), M) : [o - i, m - s]; + }), + (M.extent = function (t) { + return arguments.length + ? ((i = +t[0][0]), (o = +t[1][0]), (s = +t[0][1]), (m = +t[1][1]), M) + : [ + [i, s], + [o, m], + ]; + }), + (M.iterations = function (t) { + return arguments.length ? ((S = +t), M) : S; + }), + M + ); + })() + .nodeId((t) => t.id) + .nodeWidth(10) + .nodePadding(10 + (P ? 15 : 0)) + .nodeAlign(D) + .extent([ + [0, 0], + [A, S], + ])(C); + const N = (0, s.PKp)(s.K2I); + L.append("g") + .attr("class", "nodes") + .selectAll(".node") + .data(C.nodes) + .join("g") + .attr("class", "node") + .attr("id", (t) => (t.uid = X.next("node-")).id) + .attr("transform", function (t) { + return "translate(" + t.x0 + "," + t.y0 + ")"; + }) + .attr("x", (t) => t.x0) + .attr("y", (t) => t.y0) + .append("rect") + .attr("height", (t) => t.y1 - t.y0) + .attr("width", (t) => t.x1 - t.x0) + .attr("fill", (t) => N(t.id)), + L.append("g") + .attr("class", "node-labels") + .attr("font-family", "sans-serif") + .attr("font-size", 14) + .selectAll("text") + .data(C.nodes) + .join("text") + .attr("x", (t) => (t.x0 < A / 2 ? t.x1 + 6 : t.x0 - 6)) + .attr("y", (t) => (t.y1 + t.y0) / 2) + .attr("dy", (P ? "0" : "0.35") + "em") + .attr("text-anchor", (t) => (t.x0 < A / 2 ? "start" : "end")) + .text(({ id: t, value: n }) => (P ? `${t}\n${T}${Math.round(100 * n) / 100}${O}` : t)); + const j = L.append("g") + .attr("class", "links") + .attr("fill", "none") + .attr("stroke-opacity", 0.5) + .selectAll(".link") + .data(C.links) + .join("g") + .attr("class", "link") + .style("mix-blend-mode", "multiply"), + z = (null == v ? void 0 : v.linkColor) || "gradient"; + if ("gradient" === z) { + const t = j + .append("linearGradient") + .attr("id", (t) => (t.uid = X.next("linearGradient-")).id) + .attr("gradientUnits", "userSpaceOnUse") + .attr("x1", (t) => t.source.x1) + .attr("x2", (t) => t.target.x0); + t + .append("stop") + .attr("offset", "0%") + .attr("stop-color", (t) => N(t.source.id)), + t + .append("stop") + .attr("offset", "100%") + .attr("stop-color", (t) => N(t.target.id)); + } + let Y; + switch (z) { + case "gradient": + Y = (t) => t.uid; + break; + case "source": + Y = (t) => N(t.source.id); + break; + case "target": + Y = (t) => N(t.target.id); + break; + default: + Y = z; + } + j.append("path") + .attr("d", $()) + .attr("stroke", Y) + .attr("stroke-width", (t) => Math.max(1, t.width)); + }, + }, + B = z.parse.bind(z); + z.parse = (t) => + B( + ((t) => + t + .replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g, "") + .replaceAll(/([\n\r])+/g, "\n") + .trim())(t), + ); + const R = { parser: z, db: G, renderer: Q }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/626-1706197a.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/626-1706197a.chunk.min.js new file mode 100644 index 000000000..4feb3951b --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/626-1706197a.chunk.min.js @@ -0,0 +1,230 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [626], + { + 1626: function (e, t, s) { + s.d(t, { + diagram: function () { + return N; + }, + }); + var o = s(1535), + i = s(5625), + a = s(7274), + r = s(9339), + n = s(6476); + s(7484), s(7967), s(7856), s(3771), s(9368); + const d = "rect", + c = "rectWithTitle", + l = "statediagram", + p = `${l}-state`, + g = "transition", + b = `${g} note-edge`, + h = `${l}-note`, + u = `${l}-cluster`, + y = `${l}-cluster-alt`, + f = "parent", + w = "note", + x = "----", + $ = `${x}${w}`, + m = `${x}${f}`, + T = "fill:none", + k = "fill: #333", + S = "text", + D = "normal"; + let A = {}, + v = 0; + function B(e = "", t = 0, s = "", o = x) { + return `state-${e}${null !== s && s.length > 0 ? `${o}${s}` : ""}-${t}`; + } + const C = (e, t, s, i, a, n) => { + const l = s.id, + g = null == (x = i[l]) ? "" : x.classes ? x.classes.join(" ") : ""; + var x; + if ("root" !== l) { + let t = d; + !0 === s.start && (t = "start"), + !1 === s.start && (t = "end"), + s.type !== o.D && (t = s.type), + A[l] || + (A[l] = { + id: l, + shape: t, + description: r.e.sanitizeText(l, (0, r.c)()), + classes: `${g} ${p}`, + }); + const i = A[l]; + s.description && + (Array.isArray(i.description) + ? ((i.shape = c), i.description.push(s.description)) + : i.description.length > 0 + ? ((i.shape = c), i.description === l ? (i.description = [s.description]) : (i.description = [i.description, s.description])) + : ((i.shape = d), (i.description = s.description)), + (i.description = r.e.sanitizeTextOrArray(i.description, (0, r.c)()))), + 1 === i.description.length && i.shape === c && (i.shape = d), + !i.type && + s.doc && + (r.l.info("Setting cluster for ", l, R(s)), + (i.type = "group"), + (i.dir = R(s)), + (i.shape = s.type === o.a ? "divider" : "roundedWithTitle"), + (i.classes = i.classes + " " + u + " " + (n ? y : ""))); + const a = { + labelStyle: "", + shape: i.shape, + labelText: i.description, + classes: i.classes, + style: "", + id: l, + dir: i.dir, + domId: B(l, v), + type: i.type, + padding: 15, + centerLabel: !0, + }; + if (s.note) { + const t = { + labelStyle: "", + shape: "note", + labelText: s.note.text, + classes: h, + style: "", + id: l + $ + "-" + v, + domId: B(l, v, w), + type: i.type, + padding: 15, + }, + o = { + labelStyle: "", + shape: "noteGroup", + labelText: s.note.text, + classes: i.classes, + style: "", + id: l + m, + domId: B(l, v, f), + type: "group", + padding: 0, + }; + v++; + const r = l + m; + e.setNode(r, o), e.setNode(t.id, t), e.setNode(l, a), e.setParent(l, r), e.setParent(t.id, r); + let n = l, + d = t.id; + "left of" === s.note.position && ((n = t.id), (d = l)), + e.setEdge(n, d, { + arrowhead: "none", + arrowType: "", + style: T, + labelStyle: "", + classes: b, + arrowheadStyle: k, + labelpos: "c", + labelType: S, + thickness: D, + }); + } else e.setNode(l, a); + } + t && "root" !== t.id && (r.l.trace("Setting node ", l, " to be child of its parent ", t.id), e.setParent(l, t.id)), + s.doc && (r.l.trace("Adding nodes children "), E(e, s, s.doc, i, a, !n)); + }, + E = (e, t, s, i, a, n) => { + r.l.trace("items", s), + s.forEach((s) => { + switch (s.stmt) { + case o.b: + case o.D: + C(e, t, s, i, a, n); + break; + case o.S: { + C(e, t, s.state1, i, a, n), C(e, t, s.state2, i, a, n); + const o = { + id: "edge" + v, + arrowhead: "normal", + arrowTypeEnd: "arrow_barb", + style: T, + labelStyle: "", + label: r.e.sanitizeText(s.description, (0, r.c)()), + arrowheadStyle: k, + labelpos: "c", + labelType: S, + thickness: D, + classes: g, + }; + e.setEdge(s.state1.id, s.state2.id, o, v), v++; + } + } + }); + }, + R = (e, t = o.c) => { + let s = t; + if (e.doc) + for (let t = 0; t < e.doc.length; t++) { + const o = e.doc[t]; + "dir" === o.stmt && (s = o.value); + } + return s; + }, + V = { + setConf: function (e) { + const t = Object.keys(e); + for (const s of t) e[s]; + }, + getClasses: function (e, t) { + return t.db.extract(t.db.getRootDocV2()), t.db.getClasses(); + }, + draw: async function (e, t, s, o) { + r.l.info("Drawing state diagram (v2)", t), (A = {}), o.db.getDirection(); + const { securityLevel: c, state: p } = (0, r.c)(), + g = p.nodeSpacing || 50, + b = p.rankSpacing || 50; + r.l.info(o.db.getRootDocV2()), o.db.extract(o.db.getRootDocV2()), r.l.info(o.db.getRootDocV2()); + const h = o.db.getStates(), + u = new i.k({ multigraph: !0, compound: !0 }) + .setGraph({ + rankdir: R(o.db.getRootDocV2()), + nodesep: g, + ranksep: b, + marginx: 8, + marginy: 8, + }) + .setDefaultEdgeLabel(function () { + return {}; + }); + let y; + C(u, void 0, o.db.getRootDocV2(), h, o.db, !0), "sandbox" === c && (y = (0, a.Ys)("#i" + t)); + const f = "sandbox" === c ? (0, a.Ys)(y.nodes()[0].contentDocument.body) : (0, a.Ys)("body"), + w = f.select(`[id="${t}"]`), + x = f.select("#" + t + " g"); + await (0, n.r)(x, u, ["barb"], l, t), r.u.insertTitle(w, "statediagramTitleText", p.titleTopMargin, o.db.getDiagramTitle()); + const $ = w.node().getBBox(), + m = $.width + 16, + T = $.height + 16; + w.attr("class", l); + const k = w.node().getBBox(); + (0, r.i)(w, T, m, p.useMaxWidth); + const S = `${k.x - 8} ${k.y - 8} ${m} ${T}`; + r.l.debug(`viewBox ${S}`), w.attr("viewBox", S); + const D = document.querySelectorAll('[id="' + t + '"] .edgeLabel .label'); + for (const e of D) { + const t = e.getBBox(), + s = document.createElementNS("http://www.w3.org/2000/svg", d); + s.setAttribute("rx", 0), + s.setAttribute("ry", 0), + s.setAttribute("width", t.width), + s.setAttribute("height", t.height), + e.insertBefore(s, e.firstChild); + } + }, + }, + N = { + parser: o.p, + db: o.d, + renderer: V, + styles: o.s, + init: (e) => { + e.state || (e.state = {}), (e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute), o.d.clear(); + }, + }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/637-86fbbecd.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/637-86fbbecd.chunk.min.js new file mode 100644 index 000000000..76f9f0361 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/637-86fbbecd.chunk.min.js @@ -0,0 +1,13646 @@ +/*! For license information please see 637-86fbbecd.chunk.min.js.LICENSE.txt */ +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [637], + { + 7967: function (t, e) { + "use strict"; + e.Nm = e.Rq = void 0; + var i = /^([^\w]*)(javascript|data|vbscript)/im, + r = /&#(\w+)(^\w|;)?/g, + n = /&(newline|tab);/gi, + o = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim, + a = /^.+(:|:)/gim, + s = [".", "/"]; + (e.Rq = "about:blank"), + (e.Nm = function (t) { + if (!t) return e.Rq; + var l, + h = ((l = t), + l.replace(o, "").replace(r, function (t, e) { + return String.fromCharCode(e); + })) + .replace(n, "") + .replace(o, "") + .trim(); + if (!h) return e.Rq; + if ( + (function (t) { + return s.indexOf(t[0]) > -1; + })(h) + ) + return h; + var c = h.match(a); + if (!c) return h; + var u = c[0]; + return i.test(u) ? e.Rq : h; + }); + }, + 7484: function (t) { + t.exports = (function () { + "use strict"; + var t = 6e4, + e = 36e5, + i = "millisecond", + r = "second", + n = "minute", + o = "hour", + a = "day", + s = "week", + l = "month", + h = "quarter", + c = "year", + u = "date", + f = "Invalid Date", + d = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, + p = /\[([^\]]+)]|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, + g = { + 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 (t) { + var e = ["th", "st", "nd", "rd"], + i = t % 100; + return "[" + t + (e[(i - 20) % 10] || e[i] || e[0]) + "]"; + }, + }, + m = function (t, e, i) { + var r = String(t); + return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(i) + t; + }, + y = { + s: m, + z: function (t) { + var e = -t.utcOffset(), + i = Math.abs(e), + r = Math.floor(i / 60), + n = i % 60; + return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(n, 2, "0"); + }, + m: function t(e, i) { + if (e.date() < i.date()) return -t(i, e); + var r = 12 * (i.year() - e.year()) + (i.month() - e.month()), + n = e.clone().add(r, l), + o = i - n < 0, + a = e.clone().add(r + (o ? -1 : 1), l); + return +(-(r + (i - n) / (o ? n - a : a - n)) || 0); + }, + a: function (t) { + return t < 0 ? Math.ceil(t) || 0 : Math.floor(t); + }, + p: function (t) { + return ( + { M: l, y: c, w: s, d: a, D: u, h: o, m: n, s: r, ms: i, Q: h }[t] || + String(t || "") + .toLowerCase() + .replace(/s$/, "") + ); + }, + u: function (t) { + return void 0 === t; + }, + }, + _ = "en", + b = {}; + b[_] = g; + var C = function (t) { + return t instanceof T; + }, + x = function t(e, i, r) { + var n; + if (!e) return _; + if ("string" == typeof e) { + var o = e.toLowerCase(); + b[o] && (n = o), i && ((b[o] = i), (n = o)); + var a = e.split("-"); + if (!n && a.length > 1) return t(a[0]); + } else { + var s = e.name; + (b[s] = e), (n = s); + } + return !r && n && (_ = n), n || (!r && _); + }, + v = function (t, e) { + if (C(t)) return t.clone(); + var i = "object" == typeof e ? e : {}; + return (i.date = t), (i.args = arguments), new T(i); + }, + k = y; + (k.l = x), + (k.i = C), + (k.w = function (t, e) { + return v(t, { locale: e.$L, utc: e.$u, x: e.$x, $offset: e.$offset }); + }); + var T = (function () { + function g(t) { + (this.$L = x(t.locale, null, !0)), this.parse(t); + } + var m = g.prototype; + return ( + (m.parse = function (t) { + (this.$d = (function (t) { + var e = t.date, + i = t.utc; + if (null === e) return new Date(NaN); + if (k.u(e)) return new Date(); + if (e instanceof Date) return new Date(e); + if ("string" == typeof e && !/Z$/i.test(e)) { + var r = e.match(d); + if (r) { + var n = r[2] - 1 || 0, + o = (r[7] || "0").substring(0, 3); + return i + ? new Date(Date.UTC(r[1], n, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, o)) + : new Date(r[1], n, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, o); + } + } + return new Date(e); + })(t)), + (this.$x = t.x || {}), + this.init(); + }), + (m.init = function () { + var t = this.$d; + (this.$y = t.getFullYear()), + (this.$M = t.getMonth()), + (this.$D = t.getDate()), + (this.$W = t.getDay()), + (this.$H = t.getHours()), + (this.$m = t.getMinutes()), + (this.$s = t.getSeconds()), + (this.$ms = t.getMilliseconds()); + }), + (m.$utils = function () { + return k; + }), + (m.isValid = function () { + return !(this.$d.toString() === f); + }), + (m.isSame = function (t, e) { + var i = v(t); + return this.startOf(e) <= i && i <= this.endOf(e); + }), + (m.isAfter = function (t, e) { + return v(t) < this.startOf(e); + }), + (m.isBefore = function (t, e) { + return this.endOf(e) < v(t); + }), + (m.$g = function (t, e, i) { + return k.u(t) ? this[e] : this.set(i, t); + }), + (m.unix = function () { + return Math.floor(this.valueOf() / 1e3); + }), + (m.valueOf = function () { + return this.$d.getTime(); + }), + (m.startOf = function (t, e) { + var i = this, + h = !!k.u(e) || e, + f = k.p(t), + d = function (t, e) { + var r = k.w(i.$u ? Date.UTC(i.$y, e, t) : new Date(i.$y, e, t), i); + return h ? r : r.endOf(a); + }, + p = function (t, e) { + return k.w(i.toDate()[t].apply(i.toDate("s"), (h ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), i); + }, + g = this.$W, + m = this.$M, + y = this.$D, + _ = "set" + (this.$u ? "UTC" : ""); + switch (f) { + case c: + return h ? d(1, 0) : d(31, 11); + case l: + return h ? d(1, m) : d(0, m + 1); + case s: + var b = this.$locale().weekStart || 0, + C = (g < b ? g + 7 : g) - b; + return d(h ? y - C : y + (6 - C), m); + case a: + case u: + return p(_ + "Hours", 0); + case o: + return p(_ + "Minutes", 1); + case n: + return p(_ + "Seconds", 2); + case r: + return p(_ + "Milliseconds", 3); + default: + return this.clone(); + } + }), + (m.endOf = function (t) { + return this.startOf(t, !1); + }), + (m.$set = function (t, e) { + var s, + h = k.p(t), + f = "set" + (this.$u ? "UTC" : ""), + d = ((s = {}), + (s[a] = f + "Date"), + (s[u] = f + "Date"), + (s[l] = f + "Month"), + (s[c] = f + "FullYear"), + (s[o] = f + "Hours"), + (s[n] = f + "Minutes"), + (s[r] = f + "Seconds"), + (s[i] = f + "Milliseconds"), + s)[h], + p = h === a ? this.$D + (e - this.$W) : e; + if (h === l || h === c) { + var g = this.clone().set(u, 1); + g.$d[d](p), g.init(), (this.$d = g.set(u, Math.min(this.$D, g.daysInMonth())).$d); + } else d && this.$d[d](p); + return this.init(), this; + }), + (m.set = function (t, e) { + return this.clone().$set(t, e); + }), + (m.get = function (t) { + return this[k.p(t)](); + }), + (m.add = function (i, h) { + var u, + f = this; + i = Number(i); + var d = k.p(h), + p = function (t) { + var e = v(f); + return k.w(e.date(e.date() + Math.round(t * i)), f); + }; + if (d === l) return this.set(l, this.$M + i); + if (d === c) return this.set(c, this.$y + i); + if (d === a) return p(1); + if (d === s) return p(7); + var g = ((u = {}), (u[n] = t), (u[o] = e), (u[r] = 1e3), u)[d] || 1, + m = this.$d.getTime() + i * g; + return k.w(m, this); + }), + (m.subtract = function (t, e) { + return this.add(-1 * t, e); + }), + (m.format = function (t) { + var e = this, + i = this.$locale(); + if (!this.isValid()) return i.invalidDate || f; + var r = t || "YYYY-MM-DDTHH:mm:ssZ", + n = k.z(this), + o = this.$H, + a = this.$m, + s = this.$M, + l = i.weekdays, + h = i.months, + c = i.meridiem, + u = function (t, i, n, o) { + return (t && (t[i] || t(e, r))) || n[i].slice(0, o); + }, + d = function (t) { + return k.s(o % 12 || 12, t, "0"); + }, + g = + c || + function (t, e, i) { + var r = t < 12 ? "AM" : "PM"; + return i ? r.toLowerCase() : r; + }; + return r.replace(p, function (t, r) { + return ( + r || + (function (t) { + switch (t) { + case "YY": + return String(e.$y).slice(-2); + case "YYYY": + return k.s(e.$y, 4, "0"); + case "M": + return s + 1; + case "MM": + return k.s(s + 1, 2, "0"); + case "MMM": + return u(i.monthsShort, s, h, 3); + case "MMMM": + return u(h, s); + case "D": + return e.$D; + case "DD": + return k.s(e.$D, 2, "0"); + case "d": + return String(e.$W); + case "dd": + return u(i.weekdaysMin, e.$W, l, 2); + case "ddd": + return u(i.weekdaysShort, e.$W, l, 3); + case "dddd": + return l[e.$W]; + case "H": + return String(o); + case "HH": + return k.s(o, 2, "0"); + case "h": + return d(1); + case "hh": + return d(2); + case "a": + return g(o, a, !0); + case "A": + return g(o, a, !1); + case "m": + return String(a); + case "mm": + return k.s(a, 2, "0"); + case "s": + return String(e.$s); + case "ss": + return k.s(e.$s, 2, "0"); + case "SSS": + return k.s(e.$ms, 3, "0"); + case "Z": + return n; + } + return null; + })(t) || + n.replace(":", "") + ); + }); + }), + (m.utcOffset = function () { + return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); + }), + (m.diff = function (i, u, f) { + var d, + p = this, + g = k.p(u), + m = v(i), + y = (m.utcOffset() - this.utcOffset()) * t, + _ = this - m, + b = function () { + return k.m(p, m); + }; + switch (g) { + case c: + d = b() / 12; + break; + case l: + d = b(); + break; + case h: + d = b() / 3; + break; + case s: + d = (_ - y) / 6048e5; + break; + case a: + d = (_ - y) / 864e5; + break; + case o: + d = _ / e; + break; + case n: + d = _ / t; + break; + case r: + d = _ / 1e3; + break; + default: + d = _; + } + return f ? d : k.a(d); + }), + (m.daysInMonth = function () { + return this.endOf(l).$D; + }), + (m.$locale = function () { + return b[this.$L]; + }), + (m.locale = function (t, e) { + if (!t) return this.$L; + var i = this.clone(), + r = x(t, e, !0); + return r && (i.$L = r), i; + }), + (m.clone = function () { + return k.w(this.$d, this); + }), + (m.toDate = function () { + return new Date(this.valueOf()); + }), + (m.toJSON = function () { + return this.isValid() ? this.toISOString() : null; + }), + (m.toISOString = function () { + return this.$d.toISOString(); + }), + (m.toString = function () { + return this.$d.toUTCString(); + }), + g + ); + })(), + w = T.prototype; + return ( + (v.prototype = w), + [ + ["$ms", i], + ["$s", r], + ["$m", n], + ["$H", o], + ["$W", a], + ["$M", l], + ["$y", c], + ["$D", u], + ].forEach(function (t) { + w[t[1]] = function (e) { + return this.$g(e, t[0], t[1]); + }; + }), + (v.extend = function (t, e) { + return t.$i || (t(e, T, v), (t.$i = !0)), v; + }), + (v.locale = x), + (v.isDayjs = C), + (v.unix = function (t) { + return v(1e3 * t); + }), + (v.en = b[_]), + (v.Ls = b), + (v.p = {}), + v + ); + })(); + }, + 7856: function (t) { + t.exports = (function () { + "use strict"; + const { entries: t, setPrototypeOf: e, isFrozen: i, getPrototypeOf: r, getOwnPropertyDescriptor: n } = Object; + let { freeze: o, seal: a, create: s } = Object, + { apply: l, construct: h } = "undefined" != typeof Reflect && Reflect; + l || + (l = function (t, e, i) { + return t.apply(e, i); + }), + o || + (o = function (t) { + return t; + }), + a || + (a = function (t) { + return t; + }), + h || + (h = function (t, e) { + return new t(...e); + }); + const c = v(Array.prototype.forEach), + u = v(Array.prototype.pop), + f = v(Array.prototype.push), + d = v(String.prototype.toLowerCase), + p = v(String.prototype.toString), + g = v(String.prototype.match), + m = v(String.prototype.replace), + y = v(String.prototype.indexOf), + _ = v(String.prototype.trim), + b = v(RegExp.prototype.test), + C = + ((x = TypeError), + function () { + for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++) e[i] = arguments[i]; + return h(x, e); + }); + var x; + function v(t) { + return function (e) { + for (var i = arguments.length, r = new Array(i > 1 ? i - 1 : 0), n = 1; n < i; n++) r[n - 1] = arguments[n]; + return l(t, e, r); + }; + } + function k(t, r, n) { + var o; + (n = null !== (o = n) && void 0 !== o ? o : d), e && e(t, null); + let a = r.length; + for (; a--; ) { + let e = r[a]; + if ("string" == typeof e) { + const t = n(e); + t !== e && (i(r) || (r[a] = t), (e = t)); + } + t[e] = !0; + } + return t; + } + function T(e) { + const i = s(null); + for (const [r, n] of t(e)) i[r] = n; + return i; + } + function w(t, e) { + for (; null !== t; ) { + const i = n(t, e); + if (i) { + if (i.get) return v(i.get); + if ("function" == typeof i.value) return v(i.value); + } + t = r(t); + } + return function (t) { + return console.warn("fallback value for", t), null; + }; + } + const S = o([ + "a", + "abbr", + "acronym", + "address", + "area", + "article", + "aside", + "audio", + "b", + "bdi", + "bdo", + "big", + "blink", + "blockquote", + "body", + "br", + "button", + "canvas", + "caption", + "center", + "cite", + "code", + "col", + "colgroup", + "content", + "data", + "datalist", + "dd", + "decorator", + "del", + "details", + "dfn", + "dialog", + "dir", + "div", + "dl", + "dt", + "element", + "em", + "fieldset", + "figcaption", + "figure", + "font", + "footer", + "form", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "head", + "header", + "hgroup", + "hr", + "html", + "i", + "img", + "input", + "ins", + "kbd", + "label", + "legend", + "li", + "main", + "map", + "mark", + "marquee", + "menu", + "menuitem", + "meter", + "nav", + "nobr", + "ol", + "optgroup", + "option", + "output", + "p", + "picture", + "pre", + "progress", + "q", + "rp", + "rt", + "ruby", + "s", + "samp", + "section", + "select", + "shadow", + "small", + "source", + "spacer", + "span", + "strike", + "strong", + "style", + "sub", + "summary", + "sup", + "table", + "tbody", + "td", + "template", + "textarea", + "tfoot", + "th", + "thead", + "time", + "tr", + "track", + "tt", + "u", + "ul", + "var", + "video", + "wbr", + ]), + B = o([ + "svg", + "a", + "altglyph", + "altglyphdef", + "altglyphitem", + "animatecolor", + "animatemotion", + "animatetransform", + "circle", + "clippath", + "defs", + "desc", + "ellipse", + "filter", + "font", + "g", + "glyph", + "glyphref", + "hkern", + "image", + "line", + "lineargradient", + "marker", + "mask", + "metadata", + "mpath", + "path", + "pattern", + "polygon", + "polyline", + "radialgradient", + "rect", + "stop", + "style", + "switch", + "symbol", + "text", + "textpath", + "title", + "tref", + "tspan", + "view", + "vkern", + ]), + F = o([ + "feBlend", + "feColorMatrix", + "feComponentTransfer", + "feComposite", + "feConvolveMatrix", + "feDiffuseLighting", + "feDisplacementMap", + "feDistantLight", + "feDropShadow", + "feFlood", + "feFuncA", + "feFuncB", + "feFuncG", + "feFuncR", + "feGaussianBlur", + "feImage", + "feMerge", + "feMergeNode", + "feMorphology", + "feOffset", + "fePointLight", + "feSpecularLighting", + "feSpotLight", + "feTile", + "feTurbulence", + ]), + L = o([ + "animate", + "color-profile", + "cursor", + "discard", + "font-face", + "font-face-format", + "font-face-name", + "font-face-src", + "font-face-uri", + "foreignobject", + "hatch", + "hatchpath", + "mesh", + "meshgradient", + "meshpatch", + "meshrow", + "missing-glyph", + "script", + "set", + "solidcolor", + "unknown", + "use", + ]), + M = o([ + "math", + "menclose", + "merror", + "mfenced", + "mfrac", + "mglyph", + "mi", + "mlabeledtr", + "mmultiscripts", + "mn", + "mo", + "mover", + "mpadded", + "mphantom", + "mroot", + "mrow", + "ms", + "mspace", + "msqrt", + "mstyle", + "msub", + "msup", + "msubsup", + "mtable", + "mtd", + "mtext", + "mtr", + "munder", + "munderover", + "mprescripts", + ]), + A = o([ + "maction", + "maligngroup", + "malignmark", + "mlongdiv", + "mscarries", + "mscarry", + "msgroup", + "mstack", + "msline", + "msrow", + "semantics", + "annotation", + "annotation-xml", + "mprescripts", + "none", + ]), + E = o(["#text"]), + Z = o([ + "accept", + "action", + "align", + "alt", + "autocapitalize", + "autocomplete", + "autopictureinpicture", + "autoplay", + "background", + "bgcolor", + "border", + "capture", + "cellpadding", + "cellspacing", + "checked", + "cite", + "class", + "clear", + "color", + "cols", + "colspan", + "controls", + "controlslist", + "coords", + "crossorigin", + "datetime", + "decoding", + "default", + "dir", + "disabled", + "disablepictureinpicture", + "disableremoteplayback", + "download", + "draggable", + "enctype", + "enterkeyhint", + "face", + "for", + "headers", + "height", + "hidden", + "high", + "href", + "hreflang", + "id", + "inputmode", + "integrity", + "ismap", + "kind", + "label", + "lang", + "list", + "loading", + "loop", + "low", + "max", + "maxlength", + "media", + "method", + "min", + "minlength", + "multiple", + "muted", + "name", + "nonce", + "noshade", + "novalidate", + "nowrap", + "open", + "optimum", + "pattern", + "placeholder", + "playsinline", + "poster", + "preload", + "pubdate", + "radiogroup", + "readonly", + "rel", + "required", + "rev", + "reversed", + "role", + "rows", + "rowspan", + "spellcheck", + "scope", + "selected", + "shape", + "size", + "sizes", + "span", + "srclang", + "start", + "src", + "srcset", + "step", + "style", + "summary", + "tabindex", + "title", + "translate", + "type", + "usemap", + "valign", + "value", + "width", + "xmlns", + "slot", + ]), + O = o([ + "accent-height", + "accumulate", + "additive", + "alignment-baseline", + "ascent", + "attributename", + "attributetype", + "azimuth", + "basefrequency", + "baseline-shift", + "begin", + "bias", + "by", + "class", + "clip", + "clippathunits", + "clip-path", + "clip-rule", + "color", + "color-interpolation", + "color-interpolation-filters", + "color-profile", + "color-rendering", + "cx", + "cy", + "d", + "dx", + "dy", + "diffuseconstant", + "direction", + "display", + "divisor", + "dur", + "edgemode", + "elevation", + "end", + "fill", + "fill-opacity", + "fill-rule", + "filter", + "filterunits", + "flood-color", + "flood-opacity", + "font-family", + "font-size", + "font-size-adjust", + "font-stretch", + "font-style", + "font-variant", + "font-weight", + "fx", + "fy", + "g1", + "g2", + "glyph-name", + "glyphref", + "gradientunits", + "gradienttransform", + "height", + "href", + "id", + "image-rendering", + "in", + "in2", + "k", + "k1", + "k2", + "k3", + "k4", + "kerning", + "keypoints", + "keysplines", + "keytimes", + "lang", + "lengthadjust", + "letter-spacing", + "kernelmatrix", + "kernelunitlength", + "lighting-color", + "local", + "marker-end", + "marker-mid", + "marker-start", + "markerheight", + "markerunits", + "markerwidth", + "maskcontentunits", + "maskunits", + "max", + "mask", + "media", + "method", + "mode", + "min", + "name", + "numoctaves", + "offset", + "operator", + "opacity", + "order", + "orient", + "orientation", + "origin", + "overflow", + "paint-order", + "path", + "pathlength", + "patterncontentunits", + "patterntransform", + "patternunits", + "points", + "preservealpha", + "preserveaspectratio", + "primitiveunits", + "r", + "rx", + "ry", + "radius", + "refx", + "refy", + "repeatcount", + "repeatdur", + "restart", + "result", + "rotate", + "scale", + "seed", + "shape-rendering", + "specularconstant", + "specularexponent", + "spreadmethod", + "startoffset", + "stddeviation", + "stitchtiles", + "stop-color", + "stop-opacity", + "stroke-dasharray", + "stroke-dashoffset", + "stroke-linecap", + "stroke-linejoin", + "stroke-miterlimit", + "stroke-opacity", + "stroke", + "stroke-width", + "style", + "surfacescale", + "systemlanguage", + "tabindex", + "targetx", + "targety", + "transform", + "transform-origin", + "text-anchor", + "text-decoration", + "text-rendering", + "textlength", + "type", + "u1", + "u2", + "unicode", + "values", + "viewbox", + "visibility", + "version", + "vert-adv-y", + "vert-origin-x", + "vert-origin-y", + "width", + "word-spacing", + "wrap", + "writing-mode", + "xchannelselector", + "ychannelselector", + "x", + "x1", + "x2", + "xmlns", + "y", + "y1", + "y2", + "z", + "zoomandpan", + ]), + q = o([ + "accent", + "accentunder", + "align", + "bevelled", + "close", + "columnsalign", + "columnlines", + "columnspan", + "denomalign", + "depth", + "dir", + "display", + "displaystyle", + "encoding", + "fence", + "frame", + "height", + "href", + "id", + "largeop", + "length", + "linethickness", + "lspace", + "lquote", + "mathbackground", + "mathcolor", + "mathsize", + "mathvariant", + "maxsize", + "minsize", + "movablelimits", + "notation", + "numalign", + "open", + "rowalign", + "rowlines", + "rowspacing", + "rowspan", + "rspace", + "rquote", + "scriptlevel", + "scriptminsize", + "scriptsizemultiplier", + "selection", + "separator", + "separators", + "stretchy", + "subscriptshift", + "supscriptshift", + "symmetric", + "voffset", + "width", + "xmlns", + ]), + I = o(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), + N = a(/\{\{[\w\W]*|[\w\W]*\}\}/gm), + D = a(/<%[\w\W]*|[\w\W]*%>/gm), + $ = a(/\${[\w\W]*}/gm), + z = a(/^data-[\-\w.\u00B7-\uFFFF]/), + j = a(/^aria-[\-\w]+$/), + P = a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), + R = a(/^(?:\w+script|data):/i), + W = a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), + U = a(/^html$/i); + var H = Object.freeze({ + __proto__: null, + MUSTACHE_EXPR: N, + ERB_EXPR: D, + TMPLIT_EXPR: $, + DATA_ATTR: z, + ARIA_ATTR: j, + IS_ALLOWED_URI: P, + IS_SCRIPT_OR_DATA: R, + ATTR_WHITESPACE: W, + DOCTYPE_NAME: U, + }); + const Y = () => ("undefined" == typeof window ? null : window); + return (function e() { + let i = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : Y(); + const r = (t) => e(t); + if (((r.version = "3.0.5"), (r.removed = []), !i || !i.document || 9 !== i.document.nodeType)) return (r.isSupported = !1), r; + const n = i.document, + a = n.currentScript; + let { document: s } = i; + const { + DocumentFragment: l, + HTMLTemplateElement: h, + Node: x, + Element: v, + NodeFilter: N, + NamedNodeMap: D = i.NamedNodeMap || i.MozNamedAttrMap, + HTMLFormElement: $, + DOMParser: z, + trustedTypes: j, + } = i, + R = v.prototype, + W = w(R, "cloneNode"), + V = w(R, "nextSibling"), + G = w(R, "childNodes"), + X = w(R, "parentNode"); + if ("function" == typeof h) { + const t = s.createElement("template"); + t.content && t.content.ownerDocument && (s = t.content.ownerDocument); + } + let J, + Q = ""; + const { implementation: K, createNodeIterator: tt, createDocumentFragment: et, getElementsByTagName: it } = s, + { importNode: rt } = n; + let nt = {}; + r.isSupported = "function" == typeof t && "function" == typeof X && K && void 0 !== K.createHTMLDocument; + const { MUSTACHE_EXPR: ot, ERB_EXPR: at, TMPLIT_EXPR: st, DATA_ATTR: lt, ARIA_ATTR: ht, IS_SCRIPT_OR_DATA: ct, ATTR_WHITESPACE: ut } = H; + let { IS_ALLOWED_URI: ft } = H, + dt = null; + const pt = k({}, [...S, ...B, ...F, ...M, ...E]); + let gt = null; + const mt = k({}, [...Z, ...O, ...q, ...I]); + let yt = Object.seal( + Object.create(null, { + tagNameCheck: { writable: !0, configurable: !1, enumerable: !0, value: null }, + attributeNameCheck: { writable: !0, configurable: !1, enumerable: !0, value: null }, + allowCustomizedBuiltInElements: { + writable: !0, + configurable: !1, + enumerable: !0, + value: !1, + }, + }), + ), + _t = null, + bt = null, + Ct = !0, + xt = !0, + vt = !1, + kt = !0, + Tt = !1, + wt = !1, + St = !1, + Bt = !1, + Ft = !1, + Lt = !1, + Mt = !1, + At = !0, + Et = !1, + Zt = !0, + Ot = !1, + qt = {}, + It = null; + const Nt = k({}, [ + "annotation-xml", + "audio", + "colgroup", + "desc", + "foreignobject", + "head", + "iframe", + "math", + "mi", + "mn", + "mo", + "ms", + "mtext", + "noembed", + "noframes", + "noscript", + "plaintext", + "script", + "style", + "svg", + "template", + "thead", + "title", + "video", + "xmp", + ]); + let Dt = null; + const $t = k({}, ["audio", "video", "img", "source", "image", "track"]); + let zt = null; + const jt = k({}, [ + "alt", + "class", + "for", + "id", + "label", + "name", + "pattern", + "placeholder", + "role", + "summary", + "title", + "value", + "style", + "xmlns", + ]), + Pt = "http://www.w3.org/1998/Math/MathML", + Rt = "http://www.w3.org/2000/svg", + Wt = "http://www.w3.org/1999/xhtml"; + let Ut = Wt, + Ht = !1, + Yt = null; + const Vt = k({}, [Pt, Rt, Wt], p); + let Gt; + const Xt = ["application/xhtml+xml", "text/html"]; + let Jt, + Qt = null; + const Kt = s.createElement("form"), + te = function (t) { + return t instanceof RegExp || t instanceof Function; + }, + ee = function (t) { + if (!Qt || Qt !== t) { + if ( + ((t && "object" == typeof t) || (t = {}), + (t = T(t)), + (Gt = Gt = -1 === Xt.indexOf(t.PARSER_MEDIA_TYPE) ? "text/html" : t.PARSER_MEDIA_TYPE), + (Jt = "application/xhtml+xml" === Gt ? p : d), + (dt = "ALLOWED_TAGS" in t ? k({}, t.ALLOWED_TAGS, Jt) : pt), + (gt = "ALLOWED_ATTR" in t ? k({}, t.ALLOWED_ATTR, Jt) : mt), + (Yt = "ALLOWED_NAMESPACES" in t ? k({}, t.ALLOWED_NAMESPACES, p) : Vt), + (zt = "ADD_URI_SAFE_ATTR" in t ? k(T(jt), t.ADD_URI_SAFE_ATTR, Jt) : jt), + (Dt = "ADD_DATA_URI_TAGS" in t ? k(T($t), t.ADD_DATA_URI_TAGS, Jt) : $t), + (It = "FORBID_CONTENTS" in t ? k({}, t.FORBID_CONTENTS, Jt) : Nt), + (_t = "FORBID_TAGS" in t ? k({}, t.FORBID_TAGS, Jt) : {}), + (bt = "FORBID_ATTR" in t ? k({}, t.FORBID_ATTR, Jt) : {}), + (qt = "USE_PROFILES" in t && t.USE_PROFILES), + (Ct = !1 !== t.ALLOW_ARIA_ATTR), + (xt = !1 !== t.ALLOW_DATA_ATTR), + (vt = t.ALLOW_UNKNOWN_PROTOCOLS || !1), + (kt = !1 !== t.ALLOW_SELF_CLOSE_IN_ATTR), + (Tt = t.SAFE_FOR_TEMPLATES || !1), + (wt = t.WHOLE_DOCUMENT || !1), + (Ft = t.RETURN_DOM || !1), + (Lt = t.RETURN_DOM_FRAGMENT || !1), + (Mt = t.RETURN_TRUSTED_TYPE || !1), + (Bt = t.FORCE_BODY || !1), + (At = !1 !== t.SANITIZE_DOM), + (Et = t.SANITIZE_NAMED_PROPS || !1), + (Zt = !1 !== t.KEEP_CONTENT), + (Ot = t.IN_PLACE || !1), + (ft = t.ALLOWED_URI_REGEXP || P), + (Ut = t.NAMESPACE || Wt), + (yt = t.CUSTOM_ELEMENT_HANDLING || {}), + t.CUSTOM_ELEMENT_HANDLING && + te(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && + (yt.tagNameCheck = t.CUSTOM_ELEMENT_HANDLING.tagNameCheck), + t.CUSTOM_ELEMENT_HANDLING && + te(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && + (yt.attributeNameCheck = t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), + t.CUSTOM_ELEMENT_HANDLING && + "boolean" == typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && + (yt.allowCustomizedBuiltInElements = t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), + Tt && (xt = !1), + Lt && (Ft = !0), + qt && + ((dt = k({}, [...E])), + (gt = []), + !0 === qt.html && (k(dt, S), k(gt, Z)), + !0 === qt.svg && (k(dt, B), k(gt, O), k(gt, I)), + !0 === qt.svgFilters && (k(dt, F), k(gt, O), k(gt, I)), + !0 === qt.mathMl && (k(dt, M), k(gt, q), k(gt, I))), + t.ADD_TAGS && (dt === pt && (dt = T(dt)), k(dt, t.ADD_TAGS, Jt)), + t.ADD_ATTR && (gt === mt && (gt = T(gt)), k(gt, t.ADD_ATTR, Jt)), + t.ADD_URI_SAFE_ATTR && k(zt, t.ADD_URI_SAFE_ATTR, Jt), + t.FORBID_CONTENTS && (It === Nt && (It = T(It)), k(It, t.FORBID_CONTENTS, Jt)), + Zt && (dt["#text"] = !0), + wt && k(dt, ["html", "head", "body"]), + dt.table && (k(dt, ["tbody"]), delete _t.tbody), + t.TRUSTED_TYPES_POLICY) + ) { + if ("function" != typeof t.TRUSTED_TYPES_POLICY.createHTML) + throw C('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.'); + if ("function" != typeof t.TRUSTED_TYPES_POLICY.createScriptURL) + throw C('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.'); + (J = t.TRUSTED_TYPES_POLICY), (Q = J.createHTML("")); + } else + void 0 === J && + (J = (function (t, e) { + if ("object" != typeof t || "function" != typeof t.createPolicy) return null; + let i = null; + const r = "data-tt-policy-suffix"; + e && e.hasAttribute(r) && (i = e.getAttribute(r)); + const n = "dompurify" + (i ? "#" + i : ""); + try { + return t.createPolicy(n, { + createHTML(t) { + return t; + }, + createScriptURL(t) { + return t; + }, + }); + } catch (t) { + return console.warn("TrustedTypes policy " + n + " could not be created."), null; + } + })(j, a)), + null !== J && "string" == typeof Q && (Q = J.createHTML("")); + o && o(t), (Qt = t); + } + }, + ie = k({}, ["mi", "mo", "mn", "ms", "mtext"]), + re = k({}, ["foreignobject", "desc", "title", "annotation-xml"]), + ne = k({}, ["title", "style", "font", "a", "script"]), + oe = k({}, B); + k(oe, F), k(oe, L); + const ae = k({}, M); + k(ae, A); + const se = function (t) { + f(r.removed, { element: t }); + try { + t.parentNode.removeChild(t); + } catch (e) { + t.remove(); + } + }, + le = function (t, e) { + try { + f(r.removed, { attribute: e.getAttributeNode(t), from: e }); + } catch (t) { + f(r.removed, { attribute: null, from: e }); + } + if ((e.removeAttribute(t), "is" === t && !gt[t])) + if (Ft || Lt) + try { + se(e); + } catch (t) {} + else + try { + e.setAttribute(t, ""); + } catch (t) {} + }, + he = function (t) { + let e, i; + if (Bt) t = "" + t; + else { + const e = g(t, /^[\r\n\t ]+/); + i = e && e[0]; + } + "application/xhtml+xml" === Gt && + Ut === Wt && + (t = '' + t + ""); + const r = J ? J.createHTML(t) : t; + if (Ut === Wt) + try { + e = new z().parseFromString(r, Gt); + } catch (t) {} + if (!e || !e.documentElement) { + e = K.createDocument(Ut, "template", null); + try { + e.documentElement.innerHTML = Ht ? Q : r; + } catch (t) {} + } + const n = e.body || e.documentElement; + return ( + t && i && n.insertBefore(s.createTextNode(i), n.childNodes[0] || null), + Ut === Wt ? it.call(e, wt ? "html" : "body")[0] : wt ? e.documentElement : n + ); + }, + ce = function (t) { + return tt.call(t.ownerDocument || t, t, N.SHOW_ELEMENT | N.SHOW_COMMENT | N.SHOW_TEXT, null, !1); + }, + ue = function (t) { + return "object" == typeof x + ? t instanceof x + : t && "object" == typeof t && "number" == typeof t.nodeType && "string" == typeof t.nodeName; + }, + fe = function (t, e, i) { + nt[t] && + c(nt[t], (t) => { + t.call(r, e, i, Qt); + }); + }, + de = function (t) { + let e; + if ( + (fe("beforeSanitizeElements", t, null), + (i = t) instanceof $ && + ("string" != typeof i.nodeName || + "string" != typeof i.textContent || + "function" != typeof i.removeChild || + !(i.attributes instanceof D) || + "function" != typeof i.removeAttribute || + "function" != typeof i.setAttribute || + "string" != typeof i.namespaceURI || + "function" != typeof i.insertBefore || + "function" != typeof i.hasChildNodes)) + ) + return se(t), !0; + var i; + const n = Jt(t.nodeName); + if ( + (fe("uponSanitizeElement", t, { tagName: n, allowedTags: dt }), + t.hasChildNodes() && + !ue(t.firstElementChild) && + (!ue(t.content) || !ue(t.content.firstElementChild)) && + b(/<[/\w]/g, t.innerHTML) && + b(/<[/\w]/g, t.textContent)) + ) + return se(t), !0; + if (!dt[n] || _t[n]) { + if (!_t[n] && ge(n)) { + if (yt.tagNameCheck instanceof RegExp && b(yt.tagNameCheck, n)) return !1; + if (yt.tagNameCheck instanceof Function && yt.tagNameCheck(n)) return !1; + } + if (Zt && !It[n]) { + const e = X(t) || t.parentNode, + i = G(t) || t.childNodes; + if (i && e) for (let r = i.length - 1; r >= 0; --r) e.insertBefore(W(i[r], !0), V(t)); + } + return se(t), !0; + } + return t instanceof v && + !(function (t) { + let e = X(t); + (e && e.tagName) || (e = { namespaceURI: Ut, tagName: "template" }); + const i = d(t.tagName), + r = d(e.tagName); + return ( + !!Yt[t.namespaceURI] && + (t.namespaceURI === Rt + ? e.namespaceURI === Wt + ? "svg" === i + : e.namespaceURI === Pt + ? "svg" === i && ("annotation-xml" === r || ie[r]) + : Boolean(oe[i]) + : t.namespaceURI === Pt + ? e.namespaceURI === Wt + ? "math" === i + : e.namespaceURI === Rt + ? "math" === i && re[r] + : Boolean(ae[i]) + : t.namespaceURI === Wt + ? !(e.namespaceURI === Rt && !re[r]) && !(e.namespaceURI === Pt && !ie[r]) && !ae[i] && (ne[i] || !oe[i]) + : !("application/xhtml+xml" !== Gt || !Yt[t.namespaceURI])) + ); + })(t) + ? (se(t), !0) + : ("noscript" !== n && "noembed" !== n && "noframes" !== n) || !b(/<\/no(script|embed|frames)/i, t.innerHTML) + ? (Tt && + 3 === t.nodeType && + ((e = t.textContent), + (e = m(e, ot, " ")), + (e = m(e, at, " ")), + (e = m(e, st, " ")), + t.textContent !== e && (f(r.removed, { element: t.cloneNode() }), (t.textContent = e))), + fe("afterSanitizeElements", t, null), + !1) + : (se(t), !0); + }, + pe = function (t, e, i) { + if (At && ("id" === e || "name" === e) && (i in s || i in Kt)) return !1; + if (xt && !bt[e] && b(lt, e)); + else if (Ct && b(ht, e)); + else if (!gt[e] || bt[e]) { + if ( + !( + (ge(t) && + ((yt.tagNameCheck instanceof RegExp && b(yt.tagNameCheck, t)) || (yt.tagNameCheck instanceof Function && yt.tagNameCheck(t))) && + ((yt.attributeNameCheck instanceof RegExp && b(yt.attributeNameCheck, e)) || + (yt.attributeNameCheck instanceof Function && yt.attributeNameCheck(e)))) || + ("is" === e && + yt.allowCustomizedBuiltInElements && + ((yt.tagNameCheck instanceof RegExp && b(yt.tagNameCheck, i)) || (yt.tagNameCheck instanceof Function && yt.tagNameCheck(i)))) + ) + ) + return !1; + } else if (zt[e]); + else if (b(ft, m(i, ut, ""))); + else if (("src" !== e && "xlink:href" !== e && "href" !== e) || "script" === t || 0 !== y(i, "data:") || !Dt[t]) + if (vt && !b(ct, m(i, ut, ""))); + else if (i) return !1; + return !0; + }, + ge = function (t) { + return t.indexOf("-") > 0; + }, + me = function (t) { + let e, i, n, o; + fe("beforeSanitizeAttributes", t, null); + const { attributes: a } = t; + if (!a) return; + const s = { attrName: "", attrValue: "", keepAttr: !0, allowedAttributes: gt }; + for (o = a.length; o--; ) { + e = a[o]; + const { name: l, namespaceURI: h } = e; + if ( + ((i = "value" === l ? e.value : _(e.value)), + (n = Jt(l)), + (s.attrName = n), + (s.attrValue = i), + (s.keepAttr = !0), + (s.forceKeepAttr = void 0), + fe("uponSanitizeAttribute", t, s), + (i = s.attrValue), + s.forceKeepAttr) + ) + continue; + if ((le(l, t), !s.keepAttr)) continue; + if (!kt && b(/\/>/i, i)) { + le(l, t); + continue; + } + Tt && ((i = m(i, ot, " ")), (i = m(i, at, " ")), (i = m(i, st, " "))); + const c = Jt(t.nodeName); + if (pe(c, n, i)) { + if ( + (!Et || ("id" !== n && "name" !== n) || (le(l, t), (i = "user-content-" + i)), + J && "object" == typeof j && "function" == typeof j.getAttributeType) + ) + if (h); + else + switch (j.getAttributeType(c, n)) { + case "TrustedHTML": + i = J.createHTML(i); + break; + case "TrustedScriptURL": + i = J.createScriptURL(i); + } + try { + h ? t.setAttributeNS(h, l, i) : t.setAttribute(l, i), u(r.removed); + } catch (t) {} + } + } + fe("afterSanitizeAttributes", t, null); + }, + ye = function t(e) { + let i; + const r = ce(e); + for (fe("beforeSanitizeShadowDOM", e, null); (i = r.nextNode()); ) + fe("uponSanitizeShadowNode", i, null), de(i) || (i.content instanceof l && t(i.content), me(i)); + fe("afterSanitizeShadowDOM", e, null); + }; + return ( + (r.sanitize = function (t) { + let e, + i, + o, + a, + s = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; + if (((Ht = !t), Ht && (t = "\x3c!--\x3e"), "string" != typeof t && !ue(t))) { + if ("function" != typeof t.toString) throw C("toString is not a function"); + if ("string" != typeof (t = t.toString())) throw C("dirty is not a string, aborting"); + } + if (!r.isSupported) return t; + if ((St || ee(s), (r.removed = []), "string" == typeof t && (Ot = !1), Ot)) { + if (t.nodeName) { + const e = Jt(t.nodeName); + if (!dt[e] || _t[e]) throw C("root node is forbidden and cannot be sanitized in-place"); + } + } else if (t instanceof x) + (e = he("\x3c!----\x3e")), + (i = e.ownerDocument.importNode(t, !0)), + (1 === i.nodeType && "BODY" === i.nodeName) || "HTML" === i.nodeName ? (e = i) : e.appendChild(i); + else { + if (!Ft && !Tt && !wt && -1 === t.indexOf("<")) return J && Mt ? J.createHTML(t) : t; + if (((e = he(t)), !e)) return Ft ? null : Mt ? Q : ""; + } + e && Bt && se(e.firstChild); + const h = ce(Ot ? t : e); + for (; (o = h.nextNode()); ) de(o) || (o.content instanceof l && ye(o.content), me(o)); + if (Ot) return t; + if (Ft) { + if (Lt) for (a = et.call(e.ownerDocument); e.firstChild; ) a.appendChild(e.firstChild); + else a = e; + return (gt.shadowroot || gt.shadowrootmode) && (a = rt.call(n, a, !0)), a; + } + let c = wt ? e.outerHTML : e.innerHTML; + return ( + wt && + dt["!doctype"] && + e.ownerDocument && + e.ownerDocument.doctype && + e.ownerDocument.doctype.name && + b(U, e.ownerDocument.doctype.name) && + (c = "\n" + c), + Tt && ((c = m(c, ot, " ")), (c = m(c, at, " ")), (c = m(c, st, " "))), + J && Mt ? J.createHTML(c) : c + ); + }), + (r.setConfig = function (t) { + ee(t), (St = !0); + }), + (r.clearConfig = function () { + (Qt = null), (St = !1); + }), + (r.isValidAttribute = function (t, e, i) { + Qt || ee({}); + const r = Jt(t), + n = Jt(e); + return pe(r, n, i); + }), + (r.addHook = function (t, e) { + "function" == typeof e && ((nt[t] = nt[t] || []), f(nt[t], e)); + }), + (r.removeHook = function (t) { + if (nt[t]) return u(nt[t]); + }), + (r.removeHooks = function (t) { + nt[t] && (nt[t] = []); + }), + (r.removeAllHooks = function () { + nt = {}; + }), + r + ); + })(); + })(); + }, + 8464: function (t, e, i) { + "use strict"; + function r(t) { + for (var e = [], i = 1; i < arguments.length; i++) e[i - 1] = arguments[i]; + var r = Array.from("string" == typeof t ? [t] : t); + r[r.length - 1] = r[r.length - 1].replace(/\r?\n([\t ]*)$/, ""); + var n = r.reduce(function (t, e) { + var i = e.match(/\n([\t ]+|(?!\s).)/g); + return i + ? t.concat( + i.map(function (t) { + var e, i; + return null !== (i = null === (e = t.match(/[\t ]/g)) || void 0 === e ? void 0 : e.length) && void 0 !== i ? i : 0; + }), + ) + : t; + }, []); + if (n.length) { + var o = new RegExp("\n[\t ]{" + Math.min.apply(Math, n) + "}", "g"); + r = r.map(function (t) { + return t.replace(o, "\n"); + }); + } + r[0] = r[0].replace(/^\r?\n/, ""); + var a = r[0]; + return ( + e.forEach(function (t, e) { + var i = a.match(/(?:^|\n)( *)$/), + n = i ? i[1] : "", + o = t; + "string" == typeof t && + t.includes("\n") && + (o = String(t) + .split("\n") + .map(function (t, e) { + return 0 === e ? t : "" + n + t; + }) + .join("\n")), + (a += o + r[e + 1]); + }), + a + ); + } + i.d(e, { + Z: function () { + return r; + }, + }); + }, + 7274: function (t, e, i) { + "use strict"; + function r(t, e) { + let i; + if (void 0 === e) for (const e of t) null != e && (i < e || (void 0 === i && e >= e)) && (i = e); + else { + let r = -1; + for (let n of t) null != (n = e(n, ++r, t)) && (i < n || (void 0 === i && n >= n)) && (i = n); + } + return i; + } + function n(t, e) { + let i; + if (void 0 === e) for (const e of t) null != e && (i > e || (void 0 === i && e >= e)) && (i = e); + else { + let r = -1; + for (let n of t) null != (n = e(n, ++r, t)) && (i > n || (void 0 === i && n >= n)) && (i = n); + } + return i; + } + function o(t) { + return t; + } + i.d(e, { + Nb1: function () { + return Ya; + }, + LLu: function () { + return _; + }, + F5q: function () { + return y; + }, + $0Z: function () { + return as; + }, + Dts: function () { + return ls; + }, + WQY: function () { + return cs; + }, + qpX: function () { + return fs; + }, + u93: function () { + return ds; + }, + tFB: function () { + return gs; + }, + YY7: function () { + return _s; + }, + OvA: function () { + return Cs; + }, + dCK: function () { + return vs; + }, + zgE: function () { + return ws; + }, + fGX: function () { + return Bs; + }, + $m7: function () { + return Ls; + }, + c_6: function () { + return Xa; + }, + fxm: function () { + return As; + }, + FdL: function () { + return $s; + }, + ak_: function () { + return zs; + }, + SxZ: function () { + return Rs; + }, + eA_: function () { + return Us; + }, + jsv: function () { + return Ys; + }, + iJ: function () { + return Hs; + }, + JHv: function () { + return or; + }, + jvg: function () { + return Ka; + }, + Fp7: function () { + return r; + }, + VV$: function () { + return n; + }, + ve8: function () { + return is; + }, + BYU: function () { + return Gr; + }, + PKp: function () { + return tn; + }, + Xf: function () { + return ya; + }, + K2I: function () { + return _a; + }, + Ys: function () { + return ba; + }, + td_: function () { + return Ca; + }, + YPS: function () { + return $i; + }, + rr1: function () { + return yn; + }, + i$Z: function () { + return Gn; + }, + y2j: function () { + return Sn; + }, + WQD: function () { + return gn; + }, + Z_i: function () { + return dn; + }, + Ox9: function () { + return vn; + }, + F0B: function () { + return In; + }, + LqH: function () { + return Bn; + }, + Zyz: function () { + return xn; + }, + Igq: function () { + return wn; + }, + YDX: function () { + return kn; + }, + EFj: function () { + return Tn; + }, + }); + var a = 1, + s = 2, + l = 3, + h = 4, + c = 1e-6; + function u(t) { + return "translate(" + t + ",0)"; + } + function f(t) { + return "translate(0," + t + ")"; + } + function d(t) { + return (e) => +t(e); + } + function p(t, e) { + return (e = Math.max(0, t.bandwidth() - 2 * e) / 2), t.round() && (e = Math.round(e)), (i) => +t(i) + e; + } + function g() { + return !this.__axis; + } + function m(t, e) { + var i = [], + r = null, + n = null, + m = 6, + y = 6, + _ = 3, + b = "undefined" != typeof window && window.devicePixelRatio > 1 ? 0 : 0.5, + C = t === a || t === h ? -1 : 1, + x = t === h || t === s ? "x" : "y", + v = t === a || t === l ? u : f; + function k(u) { + var f = null == r ? (e.ticks ? e.ticks.apply(e, i) : e.domain()) : r, + k = null == n ? (e.tickFormat ? e.tickFormat.apply(e, i) : o) : n, + T = Math.max(m, 0) + _, + w = e.range(), + S = +w[0] + b, + B = +w[w.length - 1] + b, + F = (e.bandwidth ? p : d)(e.copy(), b), + L = u.selection ? u.selection() : u, + M = L.selectAll(".domain").data([null]), + A = L.selectAll(".tick").data(f, e).order(), + E = A.exit(), + Z = A.enter().append("g").attr("class", "tick"), + O = A.select("line"), + q = A.select("text"); + (M = M.merge(M.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor"))), + (A = A.merge(Z)), + (O = O.merge( + Z.append("line") + .attr("stroke", "currentColor") + .attr(x + "2", C * m), + )), + (q = q.merge( + Z.append("text") + .attr("fill", "currentColor") + .attr(x, C * T) + .attr("dy", t === a ? "0em" : t === l ? "0.71em" : "0.32em"), + )), + u !== L && + ((M = M.transition(u)), + (A = A.transition(u)), + (O = O.transition(u)), + (q = q.transition(u)), + (E = E.transition(u) + .attr("opacity", c) + .attr("transform", function (t) { + return isFinite((t = F(t))) ? v(t + b) : this.getAttribute("transform"); + })), + Z.attr("opacity", c).attr("transform", function (t) { + var e = this.parentNode.__axis; + return v((e && isFinite((e = e(t))) ? e : F(t)) + b); + })), + E.remove(), + M.attr( + "d", + t === h || t === s + ? y + ? "M" + C * y + "," + S + "H" + b + "V" + B + "H" + C * y + : "M" + b + "," + S + "V" + B + : y + ? "M" + S + "," + C * y + "V" + b + "H" + B + "V" + C * y + : "M" + S + "," + b + "H" + B, + ), + A.attr("opacity", 1).attr("transform", function (t) { + return v(F(t) + b); + }), + O.attr(x + "2", C * m), + q.attr(x, C * T).text(k), + L.filter(g) + .attr("fill", "none") + .attr("font-size", 10) + .attr("font-family", "sans-serif") + .attr("text-anchor", t === s ? "start" : t === h ? "end" : "middle"), + L.each(function () { + this.__axis = F; + }); + } + return ( + (k.scale = function (t) { + return arguments.length ? ((e = t), k) : e; + }), + (k.ticks = function () { + return (i = Array.from(arguments)), k; + }), + (k.tickArguments = function (t) { + return arguments.length ? ((i = null == t ? [] : Array.from(t)), k) : i.slice(); + }), + (k.tickValues = function (t) { + return arguments.length ? ((r = null == t ? null : Array.from(t)), k) : r && r.slice(); + }), + (k.tickFormat = function (t) { + return arguments.length ? ((n = t), k) : n; + }), + (k.tickSize = function (t) { + return arguments.length ? ((m = y = +t), k) : m; + }), + (k.tickSizeInner = function (t) { + return arguments.length ? ((m = +t), k) : m; + }), + (k.tickSizeOuter = function (t) { + return arguments.length ? ((y = +t), k) : y; + }), + (k.tickPadding = function (t) { + return arguments.length ? ((_ = +t), k) : _; + }), + (k.offset = function (t) { + return arguments.length ? ((b = +t), k) : b; + }), + k + ); + } + function y(t) { + return m(a, t); + } + function _(t) { + return m(l, t); + } + function b() {} + function C(t) { + return null == t + ? b + : function () { + return this.querySelector(t); + }; + } + function x(t) { + return null == t ? [] : Array.isArray(t) ? t : Array.from(t); + } + function v() { + return []; + } + function k(t) { + return null == t + ? v + : function () { + return this.querySelectorAll(t); + }; + } + function T(t) { + return function () { + return this.matches(t); + }; + } + function w(t) { + return function (e) { + return e.matches(t); + }; + } + var S = Array.prototype.find; + function B() { + return this.firstElementChild; + } + var F = Array.prototype.filter; + function L() { + return Array.from(this.children); + } + function M(t) { + return new Array(t.length); + } + function A(t, e) { + (this.ownerDocument = t.ownerDocument), (this.namespaceURI = t.namespaceURI), (this._next = null), (this._parent = t), (this.__data__ = e); + } + function E(t, e, i, r, n, o) { + for (var a, s = 0, l = e.length, h = o.length; s < h; ++s) (a = e[s]) ? ((a.__data__ = o[s]), (r[s] = a)) : (i[s] = new A(t, o[s])); + for (; s < l; ++s) (a = e[s]) && (n[s] = a); + } + function Z(t, e, i, r, n, o, a) { + var s, + l, + h, + c = new Map(), + u = e.length, + f = o.length, + d = new Array(u); + for (s = 0; s < u; ++s) (l = e[s]) && ((d[s] = h = a.call(l, l.__data__, s, e) + ""), c.has(h) ? (n[s] = l) : c.set(h, l)); + for (s = 0; s < f; ++s) + (h = a.call(t, o[s], s, o) + ""), (l = c.get(h)) ? ((r[s] = l), (l.__data__ = o[s]), c.delete(h)) : (i[s] = new A(t, o[s])); + for (s = 0; s < u; ++s) (l = e[s]) && c.get(d[s]) === l && (n[s] = l); + } + function O(t) { + return t.__data__; + } + function q(t) { + return "object" == typeof t && "length" in t ? t : Array.from(t); + } + function I(t, e) { + return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; + } + A.prototype = { + constructor: A, + appendChild: function (t) { + return this._parent.insertBefore(t, this._next); + }, + insertBefore: function (t, e) { + return this._parent.insertBefore(t, e); + }, + querySelector: function (t) { + return this._parent.querySelector(t); + }, + querySelectorAll: function (t) { + return this._parent.querySelectorAll(t); + }, + }; + var N = "http://www.w3.org/1999/xhtml", + D = { + svg: "http://www.w3.org/2000/svg", + xhtml: N, + xlink: "http://www.w3.org/1999/xlink", + xml: "http://www.w3.org/XML/1998/namespace", + xmlns: "http://www.w3.org/2000/xmlns/", + }; + function $(t) { + var e = (t += ""), + i = e.indexOf(":"); + return i >= 0 && "xmlns" !== (e = t.slice(0, i)) && (t = t.slice(i + 1)), D.hasOwnProperty(e) ? { space: D[e], local: t } : t; + } + function z(t) { + return function () { + this.removeAttribute(t); + }; + } + function j(t) { + return function () { + this.removeAttributeNS(t.space, t.local); + }; + } + function P(t, e) { + return function () { + this.setAttribute(t, e); + }; + } + function R(t, e) { + return function () { + this.setAttributeNS(t.space, t.local, e); + }; + } + function W(t, e) { + return function () { + var i = e.apply(this, arguments); + null == i ? this.removeAttribute(t) : this.setAttribute(t, i); + }; + } + function U(t, e) { + return function () { + var i = e.apply(this, arguments); + null == i ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, i); + }; + } + function H(t) { + return (t.ownerDocument && t.ownerDocument.defaultView) || (t.document && t) || t.defaultView; + } + function Y(t) { + return function () { + this.style.removeProperty(t); + }; + } + function V(t, e, i) { + return function () { + this.style.setProperty(t, e, i); + }; + } + function G(t, e, i) { + return function () { + var r = e.apply(this, arguments); + null == r ? this.style.removeProperty(t) : this.style.setProperty(t, r, i); + }; + } + function X(t, e) { + return t.style.getPropertyValue(e) || H(t).getComputedStyle(t, null).getPropertyValue(e); + } + function J(t) { + return function () { + delete this[t]; + }; + } + function Q(t, e) { + return function () { + this[t] = e; + }; + } + function K(t, e) { + return function () { + var i = e.apply(this, arguments); + null == i ? delete this[t] : (this[t] = i); + }; + } + function tt(t) { + return t.trim().split(/^|\s+/); + } + function et(t) { + return t.classList || new it(t); + } + function it(t) { + (this._node = t), (this._names = tt(t.getAttribute("class") || "")); + } + function rt(t, e) { + for (var i = et(t), r = -1, n = e.length; ++r < n; ) i.add(e[r]); + } + function nt(t, e) { + for (var i = et(t), r = -1, n = e.length; ++r < n; ) i.remove(e[r]); + } + function ot(t) { + return function () { + rt(this, t); + }; + } + function at(t) { + return function () { + nt(this, t); + }; + } + function st(t, e) { + return function () { + (e.apply(this, arguments) ? rt : nt)(this, t); + }; + } + function lt() { + this.textContent = ""; + } + function ht(t) { + return function () { + this.textContent = t; + }; + } + function ct(t) { + return function () { + var e = t.apply(this, arguments); + this.textContent = null == e ? "" : e; + }; + } + function ut() { + this.innerHTML = ""; + } + function ft(t) { + return function () { + this.innerHTML = t; + }; + } + function dt(t) { + return function () { + var e = t.apply(this, arguments); + this.innerHTML = null == e ? "" : e; + }; + } + function pt() { + this.nextSibling && this.parentNode.appendChild(this); + } + function gt() { + this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); + } + function mt(t) { + return function () { + var e = this.ownerDocument, + i = this.namespaceURI; + return i === N && e.documentElement.namespaceURI === N ? e.createElement(t) : e.createElementNS(i, t); + }; + } + function yt(t) { + return function () { + return this.ownerDocument.createElementNS(t.space, t.local); + }; + } + function _t(t) { + var e = $(t); + return (e.local ? yt : mt)(e); + } + function bt() { + return null; + } + function Ct() { + var t = this.parentNode; + t && t.removeChild(this); + } + function xt() { + var t = this.cloneNode(!1), + e = this.parentNode; + return e ? e.insertBefore(t, this.nextSibling) : t; + } + function vt() { + var t = this.cloneNode(!0), + e = this.parentNode; + return e ? e.insertBefore(t, this.nextSibling) : t; + } + function kt(t) { + return function () { + var e = this.__on; + if (e) { + for (var i, r = 0, n = -1, o = e.length; r < o; ++r) + (i = e[r]), (t.type && i.type !== t.type) || i.name !== t.name ? (e[++n] = i) : this.removeEventListener(i.type, i.listener, i.options); + ++n ? (e.length = n) : delete this.__on; + } + }; + } + function Tt(t, e, i) { + return function () { + var r, + n = this.__on, + o = (function (t) { + return function (e) { + t.call(this, e, this.__data__); + }; + })(e); + if (n) + for (var a = 0, s = n.length; a < s; ++a) + if ((r = n[a]).type === t.type && r.name === t.name) + return ( + this.removeEventListener(r.type, r.listener, r.options), + this.addEventListener(r.type, (r.listener = o), (r.options = i)), + void (r.value = e) + ); + this.addEventListener(t.type, o, i), + (r = { type: t.type, name: t.name, value: e, listener: o, options: i }), + n ? n.push(r) : (this.__on = [r]); + }; + } + function wt(t, e, i) { + var r = H(t), + n = r.CustomEvent; + "function" == typeof n + ? (n = new n(e, i)) + : ((n = r.document.createEvent("Event")), i ? (n.initEvent(e, i.bubbles, i.cancelable), (n.detail = i.detail)) : n.initEvent(e, !1, !1)), + t.dispatchEvent(n); + } + function St(t, e) { + return function () { + return wt(this, t, e); + }; + } + function Bt(t, e) { + return function () { + return wt(this, t, e.apply(this, arguments)); + }; + } + it.prototype = { + add: function (t) { + this._names.indexOf(t) < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); + }, + remove: function (t) { + var e = this._names.indexOf(t); + e >= 0 && (this._names.splice(e, 1), this._node.setAttribute("class", this._names.join(" "))); + }, + contains: function (t) { + return this._names.indexOf(t) >= 0; + }, + }; + var Ft = [null]; + function Lt(t, e) { + (this._groups = t), (this._parents = e); + } + function Mt() { + return new Lt([[document.documentElement]], Ft); + } + Lt.prototype = Mt.prototype = { + constructor: Lt, + select: function (t) { + "function" != typeof t && (t = C(t)); + for (var e = this._groups, i = e.length, r = new Array(i), n = 0; n < i; ++n) + for (var o, a, s = e[n], l = s.length, h = (r[n] = new Array(l)), c = 0; c < l; ++c) + (o = s[c]) && (a = t.call(o, o.__data__, c, s)) && ("__data__" in o && (a.__data__ = o.__data__), (h[c] = a)); + return new Lt(r, this._parents); + }, + selectAll: function (t) { + t = + "function" == typeof t + ? (function (t) { + return function () { + return x(t.apply(this, arguments)); + }; + })(t) + : k(t); + for (var e = this._groups, i = e.length, r = [], n = [], o = 0; o < i; ++o) + for (var a, s = e[o], l = s.length, h = 0; h < l; ++h) (a = s[h]) && (r.push(t.call(a, a.__data__, h, s)), n.push(a)); + return new Lt(r, n); + }, + selectChild: function (t) { + return this.select( + null == t + ? B + : (function (t) { + return function () { + return S.call(this.children, t); + }; + })("function" == typeof t ? t : w(t)), + ); + }, + selectChildren: function (t) { + return this.selectAll( + null == t + ? L + : (function (t) { + return function () { + return F.call(this.children, t); + }; + })("function" == typeof t ? t : w(t)), + ); + }, + filter: function (t) { + "function" != typeof t && (t = T(t)); + for (var e = this._groups, i = e.length, r = new Array(i), n = 0; n < i; ++n) + for (var o, a = e[n], s = a.length, l = (r[n] = []), h = 0; h < s; ++h) (o = a[h]) && t.call(o, o.__data__, h, a) && l.push(o); + return new Lt(r, this._parents); + }, + data: function (t, e) { + if (!arguments.length) return Array.from(this, O); + var i, + r = e ? Z : E, + n = this._parents, + o = this._groups; + "function" != typeof t && + ((i = t), + (t = function () { + return i; + })); + for (var a = o.length, s = new Array(a), l = new Array(a), h = new Array(a), c = 0; c < a; ++c) { + var u = n[c], + f = o[c], + d = f.length, + p = q(t.call(u, u && u.__data__, c, n)), + g = p.length, + m = (l[c] = new Array(g)), + y = (s[c] = new Array(g)); + r(u, f, m, y, (h[c] = new Array(d)), p, e); + for (var _, b, C = 0, x = 0; C < g; ++C) + if ((_ = m[C])) { + for (C >= x && (x = C + 1); !(b = y[x]) && ++x < g; ); + _._next = b || null; + } + } + return ((s = new Lt(s, n))._enter = l), (s._exit = h), s; + }, + enter: function () { + return new Lt(this._enter || this._groups.map(M), this._parents); + }, + exit: function () { + return new Lt(this._exit || this._groups.map(M), this._parents); + }, + join: function (t, e, i) { + var r = this.enter(), + n = this, + o = this.exit(); + return ( + "function" == typeof t ? (r = t(r)) && (r = r.selection()) : (r = r.append(t + "")), + null != e && (n = e(n)) && (n = n.selection()), + null == i ? o.remove() : i(o), + r && n ? r.merge(n).order() : n + ); + }, + merge: function (t) { + for ( + var e = t.selection ? t.selection() : t, + i = this._groups, + r = e._groups, + n = i.length, + o = r.length, + a = Math.min(n, o), + s = new Array(n), + l = 0; + l < a; + ++l + ) + for (var h, c = i[l], u = r[l], f = c.length, d = (s[l] = new Array(f)), p = 0; p < f; ++p) (h = c[p] || u[p]) && (d[p] = h); + for (; l < n; ++l) s[l] = i[l]; + return new Lt(s, this._parents); + }, + selection: function () { + return this; + }, + order: function () { + for (var t = this._groups, e = -1, i = t.length; ++e < i; ) + for (var r, n = t[e], o = n.length - 1, a = n[o]; --o >= 0; ) + (r = n[o]) && (a && 4 ^ r.compareDocumentPosition(a) && a.parentNode.insertBefore(r, a), (a = r)); + return this; + }, + sort: function (t) { + function e(e, i) { + return e && i ? t(e.__data__, i.__data__) : !e - !i; + } + t || (t = I); + for (var i = this._groups, r = i.length, n = new Array(r), o = 0; o < r; ++o) { + for (var a, s = i[o], l = s.length, h = (n[o] = new Array(l)), c = 0; c < l; ++c) (a = s[c]) && (h[c] = a); + h.sort(e); + } + return new Lt(n, this._parents).order(); + }, + call: function () { + var t = arguments[0]; + return (arguments[0] = this), t.apply(null, arguments), this; + }, + nodes: function () { + return Array.from(this); + }, + node: function () { + for (var t = this._groups, e = 0, i = t.length; e < i; ++e) + for (var r = t[e], n = 0, o = r.length; n < o; ++n) { + var a = r[n]; + if (a) return a; + } + return null; + }, + size: function () { + let t = 0; + for (const e of this) ++t; + return t; + }, + empty: function () { + return !this.node(); + }, + each: function (t) { + for (var e = this._groups, i = 0, r = e.length; i < r; ++i) + for (var n, o = e[i], a = 0, s = o.length; a < s; ++a) (n = o[a]) && t.call(n, n.__data__, a, o); + return this; + }, + attr: function (t, e) { + var i = $(t); + if (arguments.length < 2) { + var r = this.node(); + return i.local ? r.getAttributeNS(i.space, i.local) : r.getAttribute(i); + } + return this.each((null == e ? (i.local ? j : z) : "function" == typeof e ? (i.local ? U : W) : i.local ? R : P)(i, e)); + }, + style: function (t, e, i) { + return arguments.length > 1 ? this.each((null == e ? Y : "function" == typeof e ? G : V)(t, e, null == i ? "" : i)) : X(this.node(), t); + }, + property: function (t, e) { + return arguments.length > 1 ? this.each((null == e ? J : "function" == typeof e ? K : Q)(t, e)) : this.node()[t]; + }, + classed: function (t, e) { + var i = tt(t + ""); + if (arguments.length < 2) { + for (var r = et(this.node()), n = -1, o = i.length; ++n < o; ) if (!r.contains(i[n])) return !1; + return !0; + } + return this.each(("function" == typeof e ? st : e ? ot : at)(i, e)); + }, + text: function (t) { + return arguments.length ? this.each(null == t ? lt : ("function" == typeof t ? ct : ht)(t)) : this.node().textContent; + }, + html: function (t) { + return arguments.length ? this.each(null == t ? ut : ("function" == typeof t ? dt : ft)(t)) : this.node().innerHTML; + }, + raise: function () { + return this.each(pt); + }, + lower: function () { + return this.each(gt); + }, + append: function (t) { + var e = "function" == typeof t ? t : _t(t); + return this.select(function () { + return this.appendChild(e.apply(this, arguments)); + }); + }, + insert: function (t, e) { + var i = "function" == typeof t ? t : _t(t), + r = null == e ? bt : "function" == typeof e ? e : C(e); + return this.select(function () { + return this.insertBefore(i.apply(this, arguments), r.apply(this, arguments) || null); + }); + }, + remove: function () { + return this.each(Ct); + }, + clone: function (t) { + return this.select(t ? vt : xt); + }, + datum: function (t) { + return arguments.length ? this.property("__data__", t) : this.node().__data__; + }, + on: function (t, e, i) { + var r, + n, + o = (function (t) { + return t + .trim() + .split(/^|\s+/) + .map(function (t) { + var e = "", + i = t.indexOf("."); + return i >= 0 && ((e = t.slice(i + 1)), (t = t.slice(0, i))), { type: t, name: e }; + }); + })(t + ""), + a = o.length; + if (!(arguments.length < 2)) { + for (s = e ? Tt : kt, r = 0; r < a; ++r) this.each(s(o[r], e, i)); + return this; + } + var s = this.node().__on; + if (s) + for (var l, h = 0, c = s.length; h < c; ++h) + for (r = 0, l = s[h]; r < a; ++r) if ((n = o[r]).type === l.type && n.name === l.name) return l.value; + }, + dispatch: function (t, e) { + return this.each(("function" == typeof e ? Bt : St)(t, e)); + }, + [Symbol.iterator]: function* () { + for (var t = this._groups, e = 0, i = t.length; e < i; ++e) for (var r, n = t[e], o = 0, a = n.length; o < a; ++o) (r = n[o]) && (yield r); + }, + }; + var At = Mt, + Et = { value: () => {} }; + function Zt() { + for (var t, e = 0, i = arguments.length, r = {}; e < i; ++e) { + if (!(t = arguments[e] + "") || t in r || /[\s.]/.test(t)) throw new Error("illegal type: " + t); + r[t] = []; + } + return new Ot(r); + } + function Ot(t) { + this._ = t; + } + function qt(t, e) { + for (var i, r = 0, n = t.length; r < n; ++r) if ((i = t[r]).name === e) return i.value; + } + function It(t, e, i) { + for (var r = 0, n = t.length; r < n; ++r) + if (t[r].name === e) { + (t[r] = Et), (t = t.slice(0, r).concat(t.slice(r + 1))); + break; + } + return null != i && t.push({ name: e, value: i }), t; + } + Ot.prototype = Zt.prototype = { + constructor: Ot, + on: function (t, e) { + var i, + r, + n = this._, + o = + ((r = n), + (t + "") + .trim() + .split(/^|\s+/) + .map(function (t) { + var e = "", + i = t.indexOf("."); + if ((i >= 0 && ((e = t.slice(i + 1)), (t = t.slice(0, i))), t && !r.hasOwnProperty(t))) throw new Error("unknown type: " + t); + return { type: t, name: e }; + })), + a = -1, + s = o.length; + if (!(arguments.length < 2)) { + if (null != e && "function" != typeof e) throw new Error("invalid callback: " + e); + for (; ++a < s; ) + if ((i = (t = o[a]).type)) n[i] = It(n[i], t.name, e); + else if (null == e) for (i in n) n[i] = It(n[i], t.name, null); + return this; + } + for (; ++a < s; ) if ((i = (t = o[a]).type) && (i = qt(n[i], t.name))) return i; + }, + copy: function () { + var t = {}, + e = this._; + for (var i in e) t[i] = e[i].slice(); + return new Ot(t); + }, + call: function (t, e) { + if ((i = arguments.length - 2) > 0) for (var i, r, n = new Array(i), o = 0; o < i; ++o) n[o] = arguments[o + 2]; + if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); + for (o = 0, i = (r = this._[t]).length; o < i; ++o) r[o].value.apply(e, n); + }, + apply: function (t, e, i) { + if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); + for (var r = this._[t], n = 0, o = r.length; n < o; ++n) r[n].value.apply(e, i); + }, + }; + var Nt, + Dt, + $t = Zt, + zt = 0, + jt = 0, + Pt = 0, + Rt = 1e3, + Wt = 0, + Ut = 0, + Ht = 0, + Yt = "object" == typeof performance && performance.now ? performance : Date, + Vt = + "object" == typeof window && window.requestAnimationFrame + ? window.requestAnimationFrame.bind(window) + : function (t) { + setTimeout(t, 17); + }; + function Gt() { + return Ut || (Vt(Xt), (Ut = Yt.now() + Ht)); + } + function Xt() { + Ut = 0; + } + function Jt() { + this._call = this._time = this._next = null; + } + function Qt(t, e, i) { + var r = new Jt(); + return r.restart(t, e, i), r; + } + function Kt() { + (Ut = (Wt = Yt.now()) + Ht), (zt = jt = 0); + try { + !(function () { + Gt(), ++zt; + for (var t, e = Nt; e; ) (t = Ut - e._time) >= 0 && e._call.call(void 0, t), (e = e._next); + --zt; + })(); + } finally { + (zt = 0), + (function () { + for (var t, e, i = Nt, r = 1 / 0; i; ) + i._call + ? (r > i._time && (r = i._time), (t = i), (i = i._next)) + : ((e = i._next), (i._next = null), (i = t ? (t._next = e) : (Nt = e))); + (Dt = t), ee(r); + })(), + (Ut = 0); + } + } + function te() { + var t = Yt.now(), + e = t - Wt; + e > Rt && ((Ht -= e), (Wt = t)); + } + function ee(t) { + zt || + (jt && (jt = clearTimeout(jt)), + t - Ut > 24 + ? (t < 1 / 0 && (jt = setTimeout(Kt, t - Yt.now() - Ht)), Pt && (Pt = clearInterval(Pt))) + : (Pt || ((Wt = Yt.now()), (Pt = setInterval(te, Rt))), (zt = 1), Vt(Kt))); + } + function ie(t, e, i) { + var r = new Jt(); + return ( + (e = null == e ? 0 : +e), + r.restart( + (i) => { + r.stop(), t(i + e); + }, + e, + i, + ), + r + ); + } + Jt.prototype = Qt.prototype = { + constructor: Jt, + restart: function (t, e, i) { + if ("function" != typeof t) throw new TypeError("callback is not a function"); + (i = (null == i ? Gt() : +i) + (null == e ? 0 : +e)), + this._next || Dt === this || (Dt ? (Dt._next = this) : (Nt = this), (Dt = this)), + (this._call = t), + (this._time = i), + ee(); + }, + stop: function () { + this._call && ((this._call = null), (this._time = 1 / 0), ee()); + }, + }; + var re = $t("start", "end", "cancel", "interrupt"), + ne = [], + oe = 0, + ae = 3; + function se(t, e, i, r, n, o) { + var a = t.__transition; + if (a) { + if (i in a) return; + } else t.__transition = {}; + !(function (t, e, i) { + var r, + n = t.__transition; + function o(l) { + var h, c, u, f; + if (1 !== i.state) return s(); + for (h in n) + if ((f = n[h]).name === i.name) { + if (f.state === ae) return ie(o); + 4 === f.state + ? ((f.state = 6), f.timer.stop(), f.on.call("interrupt", t, t.__data__, f.index, f.group), delete n[h]) + : +h < e && ((f.state = 6), f.timer.stop(), f.on.call("cancel", t, t.__data__, f.index, f.group), delete n[h]); + } + if ( + (ie(function () { + i.state === ae && ((i.state = 4), i.timer.restart(a, i.delay, i.time), a(l)); + }), + (i.state = 2), + i.on.call("start", t, t.__data__, i.index, i.group), + 2 === i.state) + ) { + for (i.state = ae, r = new Array((u = i.tween.length)), h = 0, c = -1; h < u; ++h) + (f = i.tween[h].value.call(t, t.__data__, i.index, i.group)) && (r[++c] = f); + r.length = c + 1; + } + } + function a(e) { + for (var n = e < i.duration ? i.ease.call(null, e / i.duration) : (i.timer.restart(s), (i.state = 5), 1), o = -1, a = r.length; ++o < a; ) + r[o].call(t, n); + 5 === i.state && (i.on.call("end", t, t.__data__, i.index, i.group), s()); + } + function s() { + for (var r in ((i.state = 6), i.timer.stop(), delete n[e], n)) return; + delete t.__transition; + } + (n[e] = i), + (i.timer = Qt( + function (t) { + (i.state = 1), i.timer.restart(o, i.delay, i.time), i.delay <= t && o(t - i.delay); + }, + 0, + i.time, + )); + })(t, i, { + name: e, + index: r, + group: n, + on: re, + tween: ne, + time: o.time, + delay: o.delay, + duration: o.duration, + ease: o.ease, + timer: null, + state: oe, + }); + } + function le(t, e) { + var i = ce(t, e); + if (i.state > oe) throw new Error("too late; already scheduled"); + return i; + } + function he(t, e) { + var i = ce(t, e); + if (i.state > ae) throw new Error("too late; already running"); + return i; + } + function ce(t, e) { + var i = t.__transition; + if (!i || !(i = i[e])) throw new Error("transition not found"); + return i; + } + function ue(t, e) { + return ( + (t = +t), + (e = +e), + function (i) { + return t * (1 - i) + e * i; + } + ); + } + var fe, + de = 180 / Math.PI, + pe = { translateX: 0, translateY: 0, rotate: 0, skewX: 0, scaleX: 1, scaleY: 1 }; + function ge(t, e, i, r, n, o) { + var a, s, l; + return ( + (a = Math.sqrt(t * t + e * e)) && ((t /= a), (e /= a)), + (l = t * i + e * r) && ((i -= t * l), (r -= e * l)), + (s = Math.sqrt(i * i + r * r)) && ((i /= s), (r /= s), (l /= s)), + t * r < e * i && ((t = -t), (e = -e), (l = -l), (a = -a)), + { + translateX: n, + translateY: o, + rotate: Math.atan2(e, t) * de, + skewX: Math.atan(l) * de, + scaleX: a, + scaleY: s, + } + ); + } + function me(t, e, i, r) { + function n(t) { + return t.length ? t.pop() + " " : ""; + } + return function (o, a) { + var s = [], + l = []; + return ( + (o = t(o)), + (a = t(a)), + (function (t, r, n, o, a, s) { + if (t !== n || r !== o) { + var l = a.push("translate(", null, e, null, i); + s.push({ i: l - 4, x: ue(t, n) }, { i: l - 2, x: ue(r, o) }); + } else (n || o) && a.push("translate(" + n + e + o + i); + })(o.translateX, o.translateY, a.translateX, a.translateY, s, l), + (function (t, e, i, o) { + t !== e + ? (t - e > 180 ? (e += 360) : e - t > 180 && (t += 360), o.push({ i: i.push(n(i) + "rotate(", null, r) - 2, x: ue(t, e) })) + : e && i.push(n(i) + "rotate(" + e + r); + })(o.rotate, a.rotate, s, l), + (function (t, e, i, o) { + t !== e ? o.push({ i: i.push(n(i) + "skewX(", null, r) - 2, x: ue(t, e) }) : e && i.push(n(i) + "skewX(" + e + r); + })(o.skewX, a.skewX, s, l), + (function (t, e, i, r, o, a) { + if (t !== i || e !== r) { + var s = o.push(n(o) + "scale(", null, ",", null, ")"); + a.push({ i: s - 4, x: ue(t, i) }, { i: s - 2, x: ue(e, r) }); + } else (1 === i && 1 === r) || o.push(n(o) + "scale(" + i + "," + r + ")"); + })(o.scaleX, o.scaleY, a.scaleX, a.scaleY, s, l), + (o = a = null), + function (t) { + for (var e, i = -1, r = l.length; ++i < r; ) s[(e = l[i]).i] = e.x(t); + return s.join(""); + } + ); + }; + } + var ye = me( + function (t) { + const e = new ("function" == typeof DOMMatrix ? DOMMatrix : WebKitCSSMatrix)(t + ""); + return e.isIdentity ? pe : ge(e.a, e.b, e.c, e.d, e.e, e.f); + }, + "px, ", + "px)", + "deg)", + ), + _e = me( + function (t) { + return null == t + ? pe + : (fe || (fe = document.createElementNS("http://www.w3.org/2000/svg", "g")), + fe.setAttribute("transform", t), + (t = fe.transform.baseVal.consolidate()) ? ge((t = t.matrix).a, t.b, t.c, t.d, t.e, t.f) : pe); + }, + ", ", + ")", + ")", + ); + function be(t, e) { + var i, r; + return function () { + var n = he(this, t), + o = n.tween; + if (o !== i) + for (var a = 0, s = (r = i = o).length; a < s; ++a) + if (r[a].name === e) { + (r = r.slice()).splice(a, 1); + break; + } + n.tween = r; + }; + } + function Ce(t, e, i) { + var r, n; + if ("function" != typeof i) throw new Error(); + return function () { + var o = he(this, t), + a = o.tween; + if (a !== r) { + n = (r = a).slice(); + for (var s = { name: e, value: i }, l = 0, h = n.length; l < h; ++l) + if (n[l].name === e) { + n[l] = s; + break; + } + l === h && n.push(s); + } + o.tween = n; + }; + } + function xe(t, e, i) { + var r = t._id; + return ( + t.each(function () { + var t = he(this, r); + (t.value || (t.value = {}))[e] = i.apply(this, arguments); + }), + function (t) { + return ce(t, r).value[e]; + } + ); + } + function ve(t, e, i) { + (t.prototype = e.prototype = i), (i.constructor = t); + } + function ke(t, e) { + var i = Object.create(t.prototype); + for (var r in e) i[r] = e[r]; + return i; + } + function Te() {} + var we = 0.7, + Se = 1 / we, + Be = "\\s*([+-]?\\d+)\\s*", + Fe = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", + Le = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", + Me = /^#([0-9a-f]{3,8})$/, + Ae = new RegExp(`^rgb\\(${Be},${Be},${Be}\\)$`), + Ee = new RegExp(`^rgb\\(${Le},${Le},${Le}\\)$`), + Ze = new RegExp(`^rgba\\(${Be},${Be},${Be},${Fe}\\)$`), + Oe = new RegExp(`^rgba\\(${Le},${Le},${Le},${Fe}\\)$`), + qe = new RegExp(`^hsl\\(${Fe},${Le},${Le}\\)$`), + Ie = new RegExp(`^hsla\\(${Fe},${Le},${Le},${Fe}\\)$`), + Ne = { + aliceblue: 15792383, + antiquewhite: 16444375, + aqua: 65535, + aquamarine: 8388564, + azure: 15794175, + beige: 16119260, + bisque: 16770244, + black: 0, + blanchedalmond: 16772045, + blue: 255, + blueviolet: 9055202, + brown: 10824234, + burlywood: 14596231, + cadetblue: 6266528, + chartreuse: 8388352, + chocolate: 13789470, + coral: 16744272, + cornflowerblue: 6591981, + cornsilk: 16775388, + crimson: 14423100, + cyan: 65535, + darkblue: 139, + darkcyan: 35723, + darkgoldenrod: 12092939, + darkgray: 11119017, + darkgreen: 25600, + darkgrey: 11119017, + darkkhaki: 12433259, + darkmagenta: 9109643, + darkolivegreen: 5597999, + darkorange: 16747520, + darkorchid: 10040012, + darkred: 9109504, + darksalmon: 15308410, + darkseagreen: 9419919, + darkslateblue: 4734347, + darkslategray: 3100495, + darkslategrey: 3100495, + darkturquoise: 52945, + darkviolet: 9699539, + deeppink: 16716947, + deepskyblue: 49151, + dimgray: 6908265, + dimgrey: 6908265, + dodgerblue: 2003199, + firebrick: 11674146, + floralwhite: 16775920, + forestgreen: 2263842, + fuchsia: 16711935, + gainsboro: 14474460, + ghostwhite: 16316671, + gold: 16766720, + goldenrod: 14329120, + gray: 8421504, + green: 32768, + greenyellow: 11403055, + grey: 8421504, + honeydew: 15794160, + hotpink: 16738740, + indianred: 13458524, + indigo: 4915330, + ivory: 16777200, + khaki: 15787660, + lavender: 15132410, + lavenderblush: 16773365, + lawngreen: 8190976, + lemonchiffon: 16775885, + lightblue: 11393254, + lightcoral: 15761536, + lightcyan: 14745599, + lightgoldenrodyellow: 16448210, + lightgray: 13882323, + lightgreen: 9498256, + lightgrey: 13882323, + lightpink: 16758465, + lightsalmon: 16752762, + lightseagreen: 2142890, + lightskyblue: 8900346, + lightslategray: 7833753, + lightslategrey: 7833753, + lightsteelblue: 11584734, + lightyellow: 16777184, + lime: 65280, + limegreen: 3329330, + linen: 16445670, + magenta: 16711935, + maroon: 8388608, + mediumaquamarine: 6737322, + mediumblue: 205, + mediumorchid: 12211667, + mediumpurple: 9662683, + mediumseagreen: 3978097, + mediumslateblue: 8087790, + mediumspringgreen: 64154, + mediumturquoise: 4772300, + mediumvioletred: 13047173, + midnightblue: 1644912, + mintcream: 16121850, + mistyrose: 16770273, + moccasin: 16770229, + navajowhite: 16768685, + navy: 128, + oldlace: 16643558, + olive: 8421376, + olivedrab: 7048739, + orange: 16753920, + orangered: 16729344, + orchid: 14315734, + palegoldenrod: 15657130, + palegreen: 10025880, + paleturquoise: 11529966, + palevioletred: 14381203, + papayawhip: 16773077, + peachpuff: 16767673, + peru: 13468991, + pink: 16761035, + plum: 14524637, + powderblue: 11591910, + purple: 8388736, + rebeccapurple: 6697881, + red: 16711680, + rosybrown: 12357519, + royalblue: 4286945, + saddlebrown: 9127187, + salmon: 16416882, + sandybrown: 16032864, + seagreen: 3050327, + seashell: 16774638, + sienna: 10506797, + silver: 12632256, + skyblue: 8900331, + slateblue: 6970061, + slategray: 7372944, + slategrey: 7372944, + snow: 16775930, + springgreen: 65407, + steelblue: 4620980, + tan: 13808780, + teal: 32896, + thistle: 14204888, + tomato: 16737095, + turquoise: 4251856, + violet: 15631086, + wheat: 16113331, + white: 16777215, + whitesmoke: 16119285, + yellow: 16776960, + yellowgreen: 10145074, + }; + function De() { + return this.rgb().formatHex(); + } + function $e() { + return this.rgb().formatRgb(); + } + function ze(t) { + var e, i; + return ( + (t = (t + "").trim().toLowerCase()), + (e = Me.exec(t)) + ? ((i = e[1].length), + (e = parseInt(e[1], 16)), + 6 === i + ? je(e) + : 3 === i + ? new Ue(((e >> 8) & 15) | ((e >> 4) & 240), ((e >> 4) & 15) | (240 & e), ((15 & e) << 4) | (15 & e), 1) + : 8 === i + ? Pe((e >> 24) & 255, (e >> 16) & 255, (e >> 8) & 255, (255 & e) / 255) + : 4 === i + ? Pe( + ((e >> 12) & 15) | ((e >> 8) & 240), + ((e >> 8) & 15) | ((e >> 4) & 240), + ((e >> 4) & 15) | (240 & e), + (((15 & e) << 4) | (15 & e)) / 255, + ) + : null) + : (e = Ae.exec(t)) + ? new Ue(e[1], e[2], e[3], 1) + : (e = Ee.exec(t)) + ? new Ue((255 * e[1]) / 100, (255 * e[2]) / 100, (255 * e[3]) / 100, 1) + : (e = Ze.exec(t)) + ? Pe(e[1], e[2], e[3], e[4]) + : (e = Oe.exec(t)) + ? Pe((255 * e[1]) / 100, (255 * e[2]) / 100, (255 * e[3]) / 100, e[4]) + : (e = qe.exec(t)) + ? Je(e[1], e[2] / 100, e[3] / 100, 1) + : (e = Ie.exec(t)) + ? Je(e[1], e[2] / 100, e[3] / 100, e[4]) + : Ne.hasOwnProperty(t) + ? je(Ne[t]) + : "transparent" === t + ? new Ue(NaN, NaN, NaN, 0) + : null + ); + } + function je(t) { + return new Ue((t >> 16) & 255, (t >> 8) & 255, 255 & t, 1); + } + function Pe(t, e, i, r) { + return r <= 0 && (t = e = i = NaN), new Ue(t, e, i, r); + } + function Re(t) { + return t instanceof Te || (t = ze(t)), t ? new Ue((t = t.rgb()).r, t.g, t.b, t.opacity) : new Ue(); + } + function We(t, e, i, r) { + return 1 === arguments.length ? Re(t) : new Ue(t, e, i, null == r ? 1 : r); + } + function Ue(t, e, i, r) { + (this.r = +t), (this.g = +e), (this.b = +i), (this.opacity = +r); + } + function He() { + return `#${Xe(this.r)}${Xe(this.g)}${Xe(this.b)}`; + } + function Ye() { + const t = Ve(this.opacity); + return `${1 === t ? "rgb(" : "rgba("}${Ge(this.r)}, ${Ge(this.g)}, ${Ge(this.b)}${1 === t ? ")" : `, ${t})`}`; + } + function Ve(t) { + return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); + } + function Ge(t) { + return Math.max(0, Math.min(255, Math.round(t) || 0)); + } + function Xe(t) { + return ((t = Ge(t)) < 16 ? "0" : "") + t.toString(16); + } + function Je(t, e, i, r) { + return r <= 0 ? (t = e = i = NaN) : i <= 0 || i >= 1 ? (t = e = NaN) : e <= 0 && (t = NaN), new Ke(t, e, i, r); + } + function Qe(t) { + if (t instanceof Ke) return new Ke(t.h, t.s, t.l, t.opacity); + if ((t instanceof Te || (t = ze(t)), !t)) return new Ke(); + if (t instanceof Ke) return t; + var e = (t = t.rgb()).r / 255, + i = t.g / 255, + r = t.b / 255, + n = Math.min(e, i, r), + o = Math.max(e, i, r), + a = NaN, + s = o - n, + l = (o + n) / 2; + return ( + s + ? ((a = e === o ? (i - r) / s + 6 * (i < r) : i === o ? (r - e) / s + 2 : (e - i) / s + 4), (s /= l < 0.5 ? o + n : 2 - o - n), (a *= 60)) + : (s = l > 0 && l < 1 ? 0 : a), + new Ke(a, s, l, t.opacity) + ); + } + function Ke(t, e, i, r) { + (this.h = +t), (this.s = +e), (this.l = +i), (this.opacity = +r); + } + function ti(t) { + return (t = (t || 0) % 360) < 0 ? t + 360 : t; + } + function ei(t) { + return Math.max(0, Math.min(1, t || 0)); + } + function ii(t, e, i) { + return 255 * (t < 60 ? e + ((i - e) * t) / 60 : t < 180 ? i : t < 240 ? e + ((i - e) * (240 - t)) / 60 : e); + } + function ri(t, e, i, r, n) { + var o = t * t, + a = o * t; + return ((1 - 3 * t + 3 * o - a) * e + (4 - 6 * o + 3 * a) * i + (1 + 3 * t + 3 * o - 3 * a) * r + a * n) / 6; + } + ve(Te, ze, { + copy(t) { + return Object.assign(new this.constructor(), this, t); + }, + displayable() { + return this.rgb().displayable(); + }, + hex: De, + formatHex: De, + formatHex8: function () { + return this.rgb().formatHex8(); + }, + formatHsl: function () { + return Qe(this).formatHsl(); + }, + formatRgb: $e, + toString: $e, + }), + ve( + Ue, + We, + ke(Te, { + brighter(t) { + return (t = null == t ? Se : Math.pow(Se, t)), new Ue(this.r * t, this.g * t, this.b * t, this.opacity); + }, + darker(t) { + return (t = null == t ? we : Math.pow(we, t)), new Ue(this.r * t, this.g * t, this.b * t, this.opacity); + }, + rgb() { + return this; + }, + clamp() { + return new Ue(Ge(this.r), Ge(this.g), Ge(this.b), Ve(this.opacity)); + }, + displayable() { + return ( + -0.5 <= this.r && + this.r < 255.5 && + -0.5 <= this.g && + this.g < 255.5 && + -0.5 <= this.b && + this.b < 255.5 && + 0 <= this.opacity && + this.opacity <= 1 + ); + }, + hex: He, + formatHex: He, + formatHex8: function () { + return `#${Xe(this.r)}${Xe(this.g)}${Xe(this.b)}${Xe(255 * (isNaN(this.opacity) ? 1 : this.opacity))}`; + }, + formatRgb: Ye, + toString: Ye, + }), + ), + ve( + Ke, + function (t, e, i, r) { + return 1 === arguments.length ? Qe(t) : new Ke(t, e, i, null == r ? 1 : r); + }, + ke(Te, { + brighter(t) { + return (t = null == t ? Se : Math.pow(Se, t)), new Ke(this.h, this.s, this.l * t, this.opacity); + }, + darker(t) { + return (t = null == t ? we : Math.pow(we, t)), new Ke(this.h, this.s, this.l * t, this.opacity); + }, + rgb() { + var t = (this.h % 360) + 360 * (this.h < 0), + e = isNaN(t) || isNaN(this.s) ? 0 : this.s, + i = this.l, + r = i + (i < 0.5 ? i : 1 - i) * e, + n = 2 * i - r; + return new Ue(ii(t >= 240 ? t - 240 : t + 120, n, r), ii(t, n, r), ii(t < 120 ? t + 240 : t - 120, n, r), this.opacity); + }, + clamp() { + return new Ke(ti(this.h), ei(this.s), ei(this.l), Ve(this.opacity)); + }, + displayable() { + return ((0 <= this.s && this.s <= 1) || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1; + }, + formatHsl() { + const t = Ve(this.opacity); + return `${1 === t ? "hsl(" : "hsla("}${ti(this.h)}, ${100 * ei(this.s)}%, ${100 * ei(this.l)}%${1 === t ? ")" : `, ${t})`}`; + }, + }), + ); + var ni = (t) => () => t; + function oi(t, e) { + return function (i) { + return t + i * e; + }; + } + function ai(t, e) { + var i = e - t; + return i ? oi(t, i) : ni(isNaN(t) ? e : t); + } + var si = (function t(e) { + var i = (function (t) { + return 1 == (t = +t) + ? ai + : function (e, i) { + return i - e + ? (function (t, e, i) { + return ( + (t = Math.pow(t, i)), + (e = Math.pow(e, i) - t), + (i = 1 / i), + function (r) { + return Math.pow(t + r * e, i); + } + ); + })(e, i, t) + : ni(isNaN(e) ? i : e); + }; + })(e); + function r(t, e) { + var r = i((t = We(t)).r, (e = We(e)).r), + n = i(t.g, e.g), + o = i(t.b, e.b), + a = ai(t.opacity, e.opacity); + return function (e) { + return (t.r = r(e)), (t.g = n(e)), (t.b = o(e)), (t.opacity = a(e)), t + ""; + }; + } + return (r.gamma = t), r; + })(1); + function li(t) { + return function (e) { + var i, + r, + n = e.length, + o = new Array(n), + a = new Array(n), + s = new Array(n); + for (i = 0; i < n; ++i) (r = We(e[i])), (o[i] = r.r || 0), (a[i] = r.g || 0), (s[i] = r.b || 0); + return ( + (o = t(o)), + (a = t(a)), + (s = t(s)), + (r.opacity = 1), + function (t) { + return (r.r = o(t)), (r.g = a(t)), (r.b = s(t)), r + ""; + } + ); + }; + } + li(function (t) { + var e = t.length - 1; + return function (i) { + var r = i <= 0 ? (i = 0) : i >= 1 ? ((i = 1), e - 1) : Math.floor(i * e), + n = t[r], + o = t[r + 1], + a = r > 0 ? t[r - 1] : 2 * n - o, + s = r < e - 1 ? t[r + 2] : 2 * o - n; + return ri((i - r / e) * e, a, n, o, s); + }; + }), + li(function (t) { + var e = t.length; + return function (i) { + var r = Math.floor(((i %= 1) < 0 ? ++i : i) * e), + n = t[(r + e - 1) % e], + o = t[r % e], + a = t[(r + 1) % e], + s = t[(r + 2) % e]; + return ri((i - r / e) * e, n, o, a, s); + }; + }); + var hi = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, + ci = new RegExp(hi.source, "g"); + function ui(t, e) { + var i, + r, + n, + o = (hi.lastIndex = ci.lastIndex = 0), + a = -1, + s = [], + l = []; + for (t += "", e += ""; (i = hi.exec(t)) && (r = ci.exec(e)); ) + (n = r.index) > o && ((n = e.slice(o, n)), s[a] ? (s[a] += n) : (s[++a] = n)), + (i = i[0]) === (r = r[0]) ? (s[a] ? (s[a] += r) : (s[++a] = r)) : ((s[++a] = null), l.push({ i: a, x: ue(i, r) })), + (o = ci.lastIndex); + return ( + o < e.length && ((n = e.slice(o)), s[a] ? (s[a] += n) : (s[++a] = n)), + s.length < 2 + ? l[0] + ? (function (t) { + return function (e) { + return t(e) + ""; + }; + })(l[0].x) + : (function (t) { + return function () { + return t; + }; + })(e) + : ((e = l.length), + function (t) { + for (var i, r = 0; r < e; ++r) s[(i = l[r]).i] = i.x(t); + return s.join(""); + }) + ); + } + function fi(t, e) { + var i; + return ("number" == typeof e ? ue : e instanceof ze ? si : (i = ze(e)) ? ((e = i), si) : ui)(t, e); + } + function di(t) { + return function () { + this.removeAttribute(t); + }; + } + function pi(t) { + return function () { + this.removeAttributeNS(t.space, t.local); + }; + } + function gi(t, e, i) { + var r, + n, + o = i + ""; + return function () { + var a = this.getAttribute(t); + return a === o ? null : a === r ? n : (n = e((r = a), i)); + }; + } + function mi(t, e, i) { + var r, + n, + o = i + ""; + return function () { + var a = this.getAttributeNS(t.space, t.local); + return a === o ? null : a === r ? n : (n = e((r = a), i)); + }; + } + function yi(t, e, i) { + var r, n, o; + return function () { + var a, + s, + l = i(this); + if (null != l) return (a = this.getAttribute(t)) === (s = l + "") ? null : a === r && s === n ? o : ((n = s), (o = e((r = a), l))); + this.removeAttribute(t); + }; + } + function _i(t, e, i) { + var r, n, o; + return function () { + var a, + s, + l = i(this); + if (null != l) + return (a = this.getAttributeNS(t.space, t.local)) === (s = l + "") ? null : a === r && s === n ? o : ((n = s), (o = e((r = a), l))); + this.removeAttributeNS(t.space, t.local); + }; + } + function bi(t, e) { + var i, r; + function n() { + var n = e.apply(this, arguments); + return ( + n !== r && + (i = + (r = n) && + (function (t, e) { + return function (i) { + this.setAttributeNS(t.space, t.local, e.call(this, i)); + }; + })(t, n)), + i + ); + } + return (n._value = e), n; + } + function Ci(t, e) { + var i, r; + function n() { + var n = e.apply(this, arguments); + return ( + n !== r && + (i = + (r = n) && + (function (t, e) { + return function (i) { + this.setAttribute(t, e.call(this, i)); + }; + })(t, n)), + i + ); + } + return (n._value = e), n; + } + function xi(t, e) { + return function () { + le(this, t).delay = +e.apply(this, arguments); + }; + } + function vi(t, e) { + return ( + (e = +e), + function () { + le(this, t).delay = e; + } + ); + } + function ki(t, e) { + return function () { + he(this, t).duration = +e.apply(this, arguments); + }; + } + function Ti(t, e) { + return ( + (e = +e), + function () { + he(this, t).duration = e; + } + ); + } + var wi = At.prototype.constructor; + function Si(t) { + return function () { + this.style.removeProperty(t); + }; + } + var Bi = 0; + function Fi(t, e, i, r) { + (this._groups = t), (this._parents = e), (this._name = i), (this._id = r); + } + function Li() { + return ++Bi; + } + var Mi = At.prototype; + Fi.prototype = function (t) { + return At().transition(t); + }.prototype = { + constructor: Fi, + select: function (t) { + var e = this._name, + i = this._id; + "function" != typeof t && (t = C(t)); + for (var r = this._groups, n = r.length, o = new Array(n), a = 0; a < n; ++a) + for (var s, l, h = r[a], c = h.length, u = (o[a] = new Array(c)), f = 0; f < c; ++f) + (s = h[f]) && + (l = t.call(s, s.__data__, f, h)) && + ("__data__" in s && (l.__data__ = s.__data__), (u[f] = l), se(u[f], e, i, f, u, ce(s, i))); + return new Fi(o, this._parents, e, i); + }, + selectAll: function (t) { + var e = this._name, + i = this._id; + "function" != typeof t && (t = k(t)); + for (var r = this._groups, n = r.length, o = [], a = [], s = 0; s < n; ++s) + for (var l, h = r[s], c = h.length, u = 0; u < c; ++u) + if ((l = h[u])) { + for (var f, d = t.call(l, l.__data__, u, h), p = ce(l, i), g = 0, m = d.length; g < m; ++g) (f = d[g]) && se(f, e, i, g, d, p); + o.push(d), a.push(l); + } + return new Fi(o, a, e, i); + }, + selectChild: Mi.selectChild, + selectChildren: Mi.selectChildren, + filter: function (t) { + "function" != typeof t && (t = T(t)); + for (var e = this._groups, i = e.length, r = new Array(i), n = 0; n < i; ++n) + for (var o, a = e[n], s = a.length, l = (r[n] = []), h = 0; h < s; ++h) (o = a[h]) && t.call(o, o.__data__, h, a) && l.push(o); + return new Fi(r, this._parents, this._name, this._id); + }, + merge: function (t) { + if (t._id !== this._id) throw new Error(); + for (var e = this._groups, i = t._groups, r = e.length, n = i.length, o = Math.min(r, n), a = new Array(r), s = 0; s < o; ++s) + for (var l, h = e[s], c = i[s], u = h.length, f = (a[s] = new Array(u)), d = 0; d < u; ++d) (l = h[d] || c[d]) && (f[d] = l); + for (; s < r; ++s) a[s] = e[s]; + return new Fi(a, this._parents, this._name, this._id); + }, + selection: function () { + return new wi(this._groups, this._parents); + }, + transition: function () { + for (var t = this._name, e = this._id, i = Li(), r = this._groups, n = r.length, o = 0; o < n; ++o) + for (var a, s = r[o], l = s.length, h = 0; h < l; ++h) + if ((a = s[h])) { + var c = ce(a, e); + se(a, t, i, h, s, { + time: c.time + c.delay + c.duration, + delay: 0, + duration: c.duration, + ease: c.ease, + }); + } + return new Fi(r, this._parents, t, i); + }, + call: Mi.call, + nodes: Mi.nodes, + node: Mi.node, + size: Mi.size, + empty: Mi.empty, + each: Mi.each, + on: function (t, e) { + var i = this._id; + return arguments.length < 2 + ? ce(this.node(), i).on.on(t) + : this.each( + (function (t, e, i) { + var r, + n, + o = (function (t) { + return (t + "") + .trim() + .split(/^|\s+/) + .every(function (t) { + var e = t.indexOf("."); + return e >= 0 && (t = t.slice(0, e)), !t || "start" === t; + }); + })(e) + ? le + : he; + return function () { + var a = o(this, t), + s = a.on; + s !== r && (n = (r = s).copy()).on(e, i), (a.on = n); + }; + })(i, t, e), + ); + }, + attr: function (t, e) { + var i = $(t), + r = "transform" === i ? _e : fi; + return this.attrTween( + t, + "function" == typeof e + ? (i.local ? _i : yi)(i, r, xe(this, "attr." + t, e)) + : null == e + ? (i.local ? pi : di)(i) + : (i.local ? mi : gi)(i, r, e), + ); + }, + attrTween: function (t, e) { + var i = "attr." + t; + if (arguments.length < 2) return (i = this.tween(i)) && i._value; + if (null == e) return this.tween(i, null); + if ("function" != typeof e) throw new Error(); + var r = $(t); + return this.tween(i, (r.local ? bi : Ci)(r, e)); + }, + style: function (t, e, i) { + var r = "transform" == (t += "") ? ye : fi; + return null == e + ? this.styleTween( + t, + (function (t, e) { + var i, r, n; + return function () { + var o = X(this, t), + a = (this.style.removeProperty(t), X(this, t)); + return o === a ? null : o === i && a === r ? n : (n = e((i = o), (r = a))); + }; + })(t, r), + ).on("end.style." + t, Si(t)) + : "function" == typeof e + ? this.styleTween( + t, + (function (t, e, i) { + var r, n, o; + return function () { + var a = X(this, t), + s = i(this), + l = s + ""; + return ( + null == s && (this.style.removeProperty(t), (l = s = X(this, t))), + a === l ? null : a === r && l === n ? o : ((n = l), (o = e((r = a), s))) + ); + }; + })(t, r, xe(this, "style." + t, e)), + ).each( + (function (t, e) { + var i, + r, + n, + o, + a = "style." + e, + s = "end." + a; + return function () { + var l = he(this, t), + h = l.on, + c = null == l.value[a] ? o || (o = Si(e)) : void 0; + (h === i && n === c) || (r = (i = h).copy()).on(s, (n = c)), (l.on = r); + }; + })(this._id, t), + ) + : this.styleTween( + t, + (function (t, e, i) { + var r, + n, + o = i + ""; + return function () { + var a = X(this, t); + return a === o ? null : a === r ? n : (n = e((r = a), i)); + }; + })(t, r, e), + i, + ).on("end.style." + t, null); + }, + styleTween: function (t, e, i) { + var r = "style." + (t += ""); + if (arguments.length < 2) return (r = this.tween(r)) && r._value; + if (null == e) return this.tween(r, null); + if ("function" != typeof e) throw new Error(); + return this.tween( + r, + (function (t, e, i) { + var r, n; + function o() { + var o = e.apply(this, arguments); + return ( + o !== n && + (r = + (n = o) && + (function (t, e, i) { + return function (r) { + this.style.setProperty(t, e.call(this, r), i); + }; + })(t, o, i)), + r + ); + } + return (o._value = e), o; + })(t, e, null == i ? "" : i), + ); + }, + text: function (t) { + return this.tween( + "text", + "function" == typeof t + ? (function (t) { + return function () { + var e = t(this); + this.textContent = null == e ? "" : e; + }; + })(xe(this, "text", t)) + : (function (t) { + return function () { + this.textContent = t; + }; + })(null == t ? "" : t + ""), + ); + }, + textTween: function (t) { + var e = "text"; + if (arguments.length < 1) return (e = this.tween(e)) && e._value; + if (null == t) return this.tween(e, null); + if ("function" != typeof t) throw new Error(); + return this.tween( + e, + (function (t) { + var e, i; + function r() { + var r = t.apply(this, arguments); + return ( + r !== i && + (e = + (i = r) && + (function (t) { + return function (e) { + this.textContent = t.call(this, e); + }; + })(r)), + e + ); + } + return (r._value = t), r; + })(t), + ); + }, + remove: function () { + return this.on( + "end.remove", + (function (t) { + return function () { + var e = this.parentNode; + for (var i in this.__transition) if (+i !== t) return; + e && e.removeChild(this); + }; + })(this._id), + ); + }, + tween: function (t, e) { + var i = this._id; + if (((t += ""), arguments.length < 2)) { + for (var r, n = ce(this.node(), i).tween, o = 0, a = n.length; o < a; ++o) if ((r = n[o]).name === t) return r.value; + return null; + } + return this.each((null == e ? be : Ce)(i, t, e)); + }, + delay: function (t) { + var e = this._id; + return arguments.length ? this.each(("function" == typeof t ? xi : vi)(e, t)) : ce(this.node(), e).delay; + }, + duration: function (t) { + var e = this._id; + return arguments.length ? this.each(("function" == typeof t ? ki : Ti)(e, t)) : ce(this.node(), e).duration; + }, + ease: function (t) { + var e = this._id; + return arguments.length + ? this.each( + (function (t, e) { + if ("function" != typeof e) throw new Error(); + return function () { + he(this, t).ease = e; + }; + })(e, t), + ) + : ce(this.node(), e).ease; + }, + easeVarying: function (t) { + if ("function" != typeof t) throw new Error(); + return this.each( + (function (t, e) { + return function () { + var i = e.apply(this, arguments); + if ("function" != typeof i) throw new Error(); + he(this, t).ease = i; + }; + })(this._id, t), + ); + }, + end: function () { + var t, + e, + i = this, + r = i._id, + n = i.size(); + return new Promise(function (o, a) { + var s = { value: a }, + l = { + value: function () { + 0 == --n && o(); + }, + }; + i.each(function () { + var i = he(this, r), + n = i.on; + n !== t && ((e = (t = n).copy())._.cancel.push(s), e._.interrupt.push(s), e._.end.push(l)), (i.on = e); + }), + 0 === n && o(); + }); + }, + [Symbol.iterator]: Mi[Symbol.iterator], + }; + var Ai = { + time: null, + delay: 0, + duration: 250, + ease: function (t) { + return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; + }, + }; + function Ei(t, e) { + for (var i; !(i = t.__transition) || !(i = i[e]); ) if (!(t = t.parentNode)) throw new Error(`transition ${e} not found`); + return i; + } + (At.prototype.interrupt = function (t) { + return this.each(function () { + !(function (t, e) { + var i, + r, + n, + o = t.__transition, + a = !0; + if (o) { + for (n in ((e = null == e ? null : e + ""), o)) + (i = o[n]).name === e + ? ((r = i.state > 2 && i.state < 5), + (i.state = 6), + i.timer.stop(), + i.on.call(r ? "interrupt" : "cancel", t, t.__data__, i.index, i.group), + delete o[n]) + : (a = !1); + a && delete t.__transition; + } + })(this, t); + }); + }), + (At.prototype.transition = function (t) { + var e, i; + t instanceof Fi ? ((e = t._id), (t = t._name)) : ((e = Li()), ((i = Ai).time = Gt()), (t = null == t ? null : t + "")); + for (var r = this._groups, n = r.length, o = 0; o < n; ++o) + for (var a, s = r[o], l = s.length, h = 0; h < l; ++h) (a = s[h]) && se(a, t, e, h, s, i || Ei(a, e)); + return new Fi(r, this._parents, t, e); + }); + const { abs: Zi, max: Oi, min: qi } = Math; + function Ii(t) { + return { type: t }; + } + function Ni(t) { + if (!t.ok) throw new Error(t.status + " " + t.statusText); + return t.text(); + } + function Di(t) { + return (e, i) => + (function (t, e) { + return fetch(t, e).then(Ni); + })(e, i).then((e) => new DOMParser().parseFromString(e, t)); + } + ["w", "e"].map(Ii), ["n", "s"].map(Ii), ["n", "w", "e", "s", "nw", "ne", "sw", "se"].map(Ii), Di("application/xml"), Di("text/html"); + var $i = Di("image/svg+xml"); + const zi = Math.PI / 180, + ji = 180 / Math.PI, + Pi = 0.96422, + Ri = 1, + Wi = 0.82521, + Ui = 4 / 29, + Hi = 6 / 29, + Yi = 3 * Hi * Hi, + Vi = Hi * Hi * Hi; + function Gi(t) { + if (t instanceof Xi) return new Xi(t.l, t.a, t.b, t.opacity); + if (t instanceof ir) return rr(t); + t instanceof Ue || (t = Re(t)); + var e, + i, + r = tr(t.r), + n = tr(t.g), + o = tr(t.b), + a = Ji((0.2225045 * r + 0.7168786 * n + 0.0606169 * o) / Ri); + return ( + r === n && n === o + ? (e = i = a) + : ((e = Ji((0.4360747 * r + 0.3850649 * n + 0.1430804 * o) / Pi)), (i = Ji((0.0139322 * r + 0.0971045 * n + 0.7141733 * o) / Wi))), + new Xi(116 * a - 16, 500 * (e - a), 200 * (a - i), t.opacity) + ); + } + function Xi(t, e, i, r) { + (this.l = +t), (this.a = +e), (this.b = +i), (this.opacity = +r); + } + function Ji(t) { + return t > Vi ? Math.pow(t, 1 / 3) : t / Yi + Ui; + } + function Qi(t) { + return t > Hi ? t * t * t : Yi * (t - Ui); + } + function Ki(t) { + return 255 * (t <= 0.0031308 ? 12.92 * t : 1.055 * Math.pow(t, 1 / 2.4) - 0.055); + } + function tr(t) { + return (t /= 255) <= 0.04045 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4); + } + function er(t, e, i, r) { + return 1 === arguments.length + ? (function (t) { + if (t instanceof ir) return new ir(t.h, t.c, t.l, t.opacity); + if ((t instanceof Xi || (t = Gi(t)), 0 === t.a && 0 === t.b)) return new ir(NaN, 0 < t.l && t.l < 100 ? 0 : NaN, t.l, t.opacity); + var e = Math.atan2(t.b, t.a) * ji; + return new ir(e < 0 ? e + 360 : e, Math.sqrt(t.a * t.a + t.b * t.b), t.l, t.opacity); + })(t) + : new ir(t, e, i, null == r ? 1 : r); + } + function ir(t, e, i, r) { + (this.h = +t), (this.c = +e), (this.l = +i), (this.opacity = +r); + } + function rr(t) { + if (isNaN(t.h)) return new Xi(t.l, 0, 0, t.opacity); + var e = t.h * zi; + return new Xi(t.l, Math.cos(e) * t.c, Math.sin(e) * t.c, t.opacity); + } + function nr(t) { + return function (e, i) { + var r = t((e = er(e)).h, (i = er(i)).h), + n = ai(e.c, i.c), + o = ai(e.l, i.l), + a = ai(e.opacity, i.opacity); + return function (t) { + return (e.h = r(t)), (e.c = n(t)), (e.l = o(t)), (e.opacity = a(t)), e + ""; + }; + }; + } + ve( + Xi, + function (t, e, i, r) { + return 1 === arguments.length ? Gi(t) : new Xi(t, e, i, null == r ? 1 : r); + }, + ke(Te, { + brighter(t) { + return new Xi(this.l + 18 * (null == t ? 1 : t), this.a, this.b, this.opacity); + }, + darker(t) { + return new Xi(this.l - 18 * (null == t ? 1 : t), this.a, this.b, this.opacity); + }, + rgb() { + var t = (this.l + 16) / 116, + e = isNaN(this.a) ? t : t + this.a / 500, + i = isNaN(this.b) ? t : t - this.b / 200; + return new Ue( + Ki(3.1338561 * (e = Pi * Qi(e)) - 1.6168667 * (t = Ri * Qi(t)) - 0.4906146 * (i = Wi * Qi(i))), + Ki(-0.9787684 * e + 1.9161415 * t + 0.033454 * i), + Ki(0.0719453 * e - 0.2289914 * t + 1.4052427 * i), + this.opacity, + ); + }, + }), + ), + ve( + ir, + er, + ke(Te, { + brighter(t) { + return new ir(this.h, this.c, this.l + 18 * (null == t ? 1 : t), this.opacity); + }, + darker(t) { + return new ir(this.h, this.c, this.l - 18 * (null == t ? 1 : t), this.opacity); + }, + rgb() { + return rr(this).rgb(); + }, + }), + ); + var or = nr(function (t, e) { + var i = e - t; + return i ? oi(t, i > 180 || i < -180 ? i - 360 * Math.round(i / 360) : i) : ni(isNaN(t) ? e : t); + }); + nr(ai); + const ar = Math.sqrt(50), + sr = Math.sqrt(10), + lr = Math.sqrt(2); + function hr(t, e, i) { + const r = (e - t) / Math.max(0, i), + n = Math.floor(Math.log10(r)), + o = r / Math.pow(10, n), + a = o >= ar ? 10 : o >= sr ? 5 : o >= lr ? 2 : 1; + let s, l, h; + return ( + n < 0 + ? ((h = Math.pow(10, -n) / a), (s = Math.round(t * h)), (l = Math.round(e * h)), s / h < t && ++s, l / h > e && --l, (h = -h)) + : ((h = Math.pow(10, n) * a), (s = Math.round(t / h)), (l = Math.round(e / h)), s * h < t && ++s, l * h > e && --l), + l < s && 0.5 <= i && i < 2 ? hr(t, e, 2 * i) : [s, l, h] + ); + } + function cr(t, e, i) { + return hr((t = +t), (e = +e), (i = +i))[2]; + } + function ur(t, e, i) { + i = +i; + const r = (e = +e) < (t = +t), + n = r ? cr(e, t, i) : cr(t, e, i); + return (r ? -1 : 1) * (n < 0 ? 1 / -n : n); + } + function fr(t, e) { + return null == t || null == e ? NaN : t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; + } + function dr(t, e) { + return null == t || null == e ? NaN : e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; + } + function pr(t) { + let e, i, r; + function n(t, r, n = 0, o = t.length) { + if (n < o) { + if (0 !== e(r, r)) return o; + do { + const e = (n + o) >>> 1; + i(t[e], r) < 0 ? (n = e + 1) : (o = e); + } while (n < o); + } + return n; + } + return ( + 2 !== t.length + ? ((e = fr), (i = (e, i) => fr(t(e), i)), (r = (e, i) => t(e) - i)) + : ((e = t === fr || t === dr ? t : gr), (i = t), (r = t)), + { + left: n, + center: function (t, e, i = 0, o = t.length) { + const a = n(t, e, i, o - 1); + return a > i && r(t[a - 1], e) > -r(t[a], e) ? a - 1 : a; + }, + right: function (t, r, n = 0, o = t.length) { + if (n < o) { + if (0 !== e(r, r)) return o; + do { + const e = (n + o) >>> 1; + i(t[e], r) <= 0 ? (n = e + 1) : (o = e); + } while (n < o); + } + return n; + }, + } + ); + } + function gr() { + return 0; + } + const mr = pr(fr), + yr = mr.right; + mr.left, + pr(function (t) { + return null === t ? NaN : +t; + }).center; + var _r = yr; + function br(t, e) { + var i, + r = e ? e.length : 0, + n = t ? Math.min(r, t.length) : 0, + o = new Array(n), + a = new Array(r); + for (i = 0; i < n; ++i) o[i] = kr(t[i], e[i]); + for (; i < r; ++i) a[i] = e[i]; + return function (t) { + for (i = 0; i < n; ++i) a[i] = o[i](t); + return a; + }; + } + function Cr(t, e) { + var i = new Date(); + return ( + (t = +t), + (e = +e), + function (r) { + return i.setTime(t * (1 - r) + e * r), i; + } + ); + } + function xr(t, e) { + var i, + r = {}, + n = {}; + for (i in ((null !== t && "object" == typeof t) || (t = {}), (null !== e && "object" == typeof e) || (e = {}), e)) + i in t ? (r[i] = kr(t[i], e[i])) : (n[i] = e[i]); + return function (t) { + for (i in r) n[i] = r[i](t); + return n; + }; + } + function vr(t, e) { + e || (e = []); + var i, + r = t ? Math.min(e.length, t.length) : 0, + n = e.slice(); + return function (o) { + for (i = 0; i < r; ++i) n[i] = t[i] * (1 - o) + e[i] * o; + return n; + }; + } + function kr(t, e) { + var i, + r, + n = typeof e; + return null == e || "boolean" === n + ? ni(e) + : ("number" === n + ? ue + : "string" === n + ? (i = ze(e)) + ? ((e = i), si) + : ui + : e instanceof ze + ? si + : e instanceof Date + ? Cr + : ((r = e), + !ArrayBuffer.isView(r) || r instanceof DataView + ? Array.isArray(e) + ? br + : ("function" != typeof e.valueOf && "function" != typeof e.toString) || isNaN(e) + ? xr + : ue + : vr))(t, e); + } + function Tr(t, e) { + return ( + (t = +t), + (e = +e), + function (i) { + return Math.round(t * (1 - i) + e * i); + } + ); + } + function wr(t) { + return +t; + } + var Sr = [0, 1]; + function Br(t) { + return t; + } + function Fr(t, e) { + return (e -= t = +t) + ? function (i) { + return (i - t) / e; + } + : ((i = isNaN(e) ? NaN : 0.5), + function () { + return i; + }); + var i; + } + function Lr(t, e, i) { + var r = t[0], + n = t[1], + o = e[0], + a = e[1]; + return ( + n < r ? ((r = Fr(n, r)), (o = i(a, o))) : ((r = Fr(r, n)), (o = i(o, a))), + function (t) { + return o(r(t)); + } + ); + } + function Mr(t, e, i) { + var r = Math.min(t.length, e.length) - 1, + n = new Array(r), + o = new Array(r), + a = -1; + for (t[r] < t[0] && ((t = t.slice().reverse()), (e = e.slice().reverse())); ++a < r; ) + (n[a] = Fr(t[a], t[a + 1])), (o[a] = i(e[a], e[a + 1])); + return function (e) { + var i = _r(t, e, 1, r) - 1; + return o[i](n[i](e)); + }; + } + function Ar(t, e) { + return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown()); + } + function Er() { + return (function () { + var t, + e, + i, + r, + n, + o, + a = Sr, + s = Sr, + l = kr, + h = Br; + function c() { + var t, + e, + i, + l = Math.min(a.length, s.length); + return ( + h !== Br && + ((t = a[0]), + (e = a[l - 1]), + t > e && ((i = t), (t = e), (e = i)), + (h = function (i) { + return Math.max(t, Math.min(e, i)); + })), + (r = l > 2 ? Mr : Lr), + (n = o = null), + u + ); + } + function u(e) { + return null == e || isNaN((e = +e)) ? i : (n || (n = r(a.map(t), s, l)))(t(h(e))); + } + return ( + (u.invert = function (i) { + return h(e((o || (o = r(s, a.map(t), ue)))(i))); + }), + (u.domain = function (t) { + return arguments.length ? ((a = Array.from(t, wr)), c()) : a.slice(); + }), + (u.range = function (t) { + return arguments.length ? ((s = Array.from(t)), c()) : s.slice(); + }), + (u.rangeRound = function (t) { + return (s = Array.from(t)), (l = Tr), c(); + }), + (u.clamp = function (t) { + return arguments.length ? ((h = !!t || Br), c()) : h !== Br; + }), + (u.interpolate = function (t) { + return arguments.length ? ((l = t), c()) : l; + }), + (u.unknown = function (t) { + return arguments.length ? ((i = t), u) : i; + }), + function (i, r) { + return (t = i), (e = r), c(); + } + ); + })()(Br, Br); + } + function Zr(t, e) { + switch (arguments.length) { + case 0: + break; + case 1: + this.range(t); + break; + default: + this.range(e).domain(t); + } + return this; + } + var Or, + qr = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; + function Ir(t) { + if (!(e = qr.exec(t))) throw new Error("invalid format: " + t); + var e; + return new Nr({ + fill: e[1], + align: e[2], + sign: e[3], + symbol: e[4], + zero: e[5], + width: e[6], + comma: e[7], + precision: e[8] && e[8].slice(1), + trim: e[9], + type: e[10], + }); + } + function Nr(t) { + (this.fill = void 0 === t.fill ? " " : t.fill + ""), + (this.align = void 0 === t.align ? ">" : t.align + ""), + (this.sign = void 0 === t.sign ? "-" : t.sign + ""), + (this.symbol = void 0 === t.symbol ? "" : t.symbol + ""), + (this.zero = !!t.zero), + (this.width = void 0 === t.width ? void 0 : +t.width), + (this.comma = !!t.comma), + (this.precision = void 0 === t.precision ? void 0 : +t.precision), + (this.trim = !!t.trim), + (this.type = void 0 === t.type ? "" : t.type + ""); + } + function Dr(t, e) { + if ((i = (t = e ? t.toExponential(e - 1) : t.toExponential()).indexOf("e")) < 0) return null; + var i, + r = t.slice(0, i); + return [r.length > 1 ? r[0] + r.slice(2) : r, +t.slice(i + 1)]; + } + function $r(t) { + return (t = Dr(Math.abs(t))) ? t[1] : NaN; + } + function zr(t, e) { + var i = Dr(t, e); + if (!i) return t + ""; + var r = i[0], + n = i[1]; + return n < 0 + ? "0." + new Array(-n).join("0") + r + : r.length > n + 1 + ? r.slice(0, n + 1) + "." + r.slice(n + 1) + : r + new Array(n - r.length + 2).join("0"); + } + (Ir.prototype = Nr.prototype), + (Nr.prototype.toString = function () { + return ( + this.fill + + this.align + + this.sign + + this.symbol + + (this.zero ? "0" : "") + + (void 0 === this.width ? "" : Math.max(1, 0 | this.width)) + + (this.comma ? "," : "") + + (void 0 === this.precision ? "" : "." + Math.max(0, 0 | this.precision)) + + (this.trim ? "~" : "") + + this.type + ); + }); + var jr = { + "%": (t, e) => (100 * t).toFixed(e), + b: (t) => Math.round(t).toString(2), + c: (t) => t + "", + d: function (t) { + return Math.abs((t = Math.round(t))) >= 1e21 ? t.toLocaleString("en").replace(/,/g, "") : t.toString(10); + }, + e: (t, e) => t.toExponential(e), + f: (t, e) => t.toFixed(e), + g: (t, e) => t.toPrecision(e), + o: (t) => Math.round(t).toString(8), + p: (t, e) => zr(100 * t, e), + r: zr, + s: function (t, e) { + var i = Dr(t, e); + if (!i) return t + ""; + var r = i[0], + n = i[1], + o = n - (Or = 3 * Math.max(-8, Math.min(8, Math.floor(n / 3)))) + 1, + a = r.length; + return o === a + ? r + : o > a + ? r + new Array(o - a + 1).join("0") + : o > 0 + ? r.slice(0, o) + "." + r.slice(o) + : "0." + new Array(1 - o).join("0") + Dr(t, Math.max(0, e + o - 1))[0]; + }, + X: (t) => Math.round(t).toString(16).toUpperCase(), + x: (t) => Math.round(t).toString(16), + }; + function Pr(t) { + return t; + } + var Rr, + Wr, + Ur, + Hr = Array.prototype.map, + Yr = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"]; + function Vr(t) { + var e = t.domain; + return ( + (t.ticks = function (t) { + var i = e(); + return (function (t, e, i) { + if (!((i = +i) > 0)) return []; + if ((t = +t) == (e = +e)) return [t]; + const r = e < t, + [n, o, a] = r ? hr(e, t, i) : hr(t, e, i); + if (!(o >= n)) return []; + const s = o - n + 1, + l = new Array(s); + if (r) + if (a < 0) for (let t = 0; t < s; ++t) l[t] = (o - t) / -a; + else for (let t = 0; t < s; ++t) l[t] = (o - t) * a; + else if (a < 0) for (let t = 0; t < s; ++t) l[t] = (n + t) / -a; + else for (let t = 0; t < s; ++t) l[t] = (n + t) * a; + return l; + })(i[0], i[i.length - 1], null == t ? 10 : t); + }), + (t.tickFormat = function (t, i) { + var r = e(); + return (function (t, e, i, r) { + var n, + o = ur(t, e, i); + switch ((r = Ir(null == r ? ",f" : r)).type) { + case "s": + var a = Math.max(Math.abs(t), Math.abs(e)); + return ( + null != r.precision || + isNaN( + (n = (function (t, e) { + return Math.max(0, 3 * Math.max(-8, Math.min(8, Math.floor($r(e) / 3))) - $r(Math.abs(t))); + })(o, a)), + ) || + (r.precision = n), + Ur(r, a) + ); + case "": + case "e": + case "g": + case "p": + case "r": + null != r.precision || + isNaN( + (n = (function (t, e) { + return (t = Math.abs(t)), (e = Math.abs(e) - t), Math.max(0, $r(e) - $r(t)) + 1; + })(o, Math.max(Math.abs(t), Math.abs(e)))), + ) || + (r.precision = n - ("e" === r.type)); + break; + case "f": + case "%": + null != r.precision || + isNaN( + (n = (function (t) { + return Math.max(0, -$r(Math.abs(t))); + })(o)), + ) || + (r.precision = n - 2 * ("%" === r.type)); + } + return Wr(r); + })(r[0], r[r.length - 1], null == t ? 10 : t, i); + }), + (t.nice = function (i) { + null == i && (i = 10); + var r, + n, + o = e(), + a = 0, + s = o.length - 1, + l = o[a], + h = o[s], + c = 10; + for (h < l && ((n = l), (l = h), (h = n), (n = a), (a = s), (s = n)); c-- > 0; ) { + if ((n = cr(l, h, i)) === r) return (o[a] = l), (o[s] = h), e(o); + if (n > 0) (l = Math.floor(l / n) * n), (h = Math.ceil(h / n) * n); + else { + if (!(n < 0)) break; + (l = Math.ceil(l * n) / n), (h = Math.floor(h * n) / n); + } + r = n; + } + return t; + }), + t + ); + } + function Gr() { + var t = Er(); + return ( + (t.copy = function () { + return Ar(t, Gr()); + }), + Zr.apply(t, arguments), + Vr(t) + ); + } + (Rr = (function (t) { + var e, + i, + r = + void 0 === t.grouping || void 0 === t.thousands + ? Pr + : ((e = Hr.call(t.grouping, Number)), + (i = t.thousands + ""), + function (t, r) { + for ( + var n = t.length, o = [], a = 0, s = e[0], l = 0; + n > 0 && s > 0 && (l + s + 1 > r && (s = Math.max(1, r - l)), o.push(t.substring((n -= s), n + s)), !((l += s + 1) > r)); + + ) + s = e[(a = (a + 1) % e.length)]; + return o.reverse().join(i); + }), + n = void 0 === t.currency ? "" : t.currency[0] + "", + o = void 0 === t.currency ? "" : t.currency[1] + "", + a = void 0 === t.decimal ? "." : t.decimal + "", + s = + void 0 === t.numerals + ? Pr + : (function (t) { + return function (e) { + return e.replace(/[0-9]/g, function (e) { + return t[+e]; + }); + }; + })(Hr.call(t.numerals, String)), + l = void 0 === t.percent ? "%" : t.percent + "", + h = void 0 === t.minus ? "−" : t.minus + "", + c = void 0 === t.nan ? "NaN" : t.nan + ""; + function u(t) { + var e = (t = Ir(t)).fill, + i = t.align, + u = t.sign, + f = t.symbol, + d = t.zero, + p = t.width, + g = t.comma, + m = t.precision, + y = t.trim, + _ = t.type; + "n" === _ ? ((g = !0), (_ = "g")) : jr[_] || (void 0 === m && (m = 12), (y = !0), (_ = "g")), + (d || ("0" === e && "=" === i)) && ((d = !0), (e = "0"), (i = "=")); + var b = "$" === f ? n : "#" === f && /[boxX]/.test(_) ? "0" + _.toLowerCase() : "", + C = "$" === f ? o : /[%p]/.test(_) ? l : "", + x = jr[_], + v = /[defgprs%]/.test(_); + function k(t) { + var n, + o, + l, + f = b, + k = C; + if ("c" === _) (k = x(t) + k), (t = ""); + else { + var T = (t = +t) < 0 || 1 / t < 0; + if ( + ((t = isNaN(t) ? c : x(Math.abs(t), m)), + y && + (t = (function (t) { + t: for (var e, i = t.length, r = 1, n = -1; r < i; ++r) + switch (t[r]) { + case ".": + n = e = r; + break; + case "0": + 0 === n && (n = r), (e = r); + break; + default: + if (!+t[r]) break t; + n > 0 && (n = 0); + } + return n > 0 ? t.slice(0, n) + t.slice(e + 1) : t; + })(t)), + T && 0 == +t && "+" !== u && (T = !1), + (f = (T ? ("(" === u ? u : h) : "-" === u || "(" === u ? "" : u) + f), + (k = ("s" === _ ? Yr[8 + Or / 3] : "") + k + (T && "(" === u ? ")" : "")), + v) + ) + for (n = -1, o = t.length; ++n < o; ) + if (48 > (l = t.charCodeAt(n)) || l > 57) { + (k = (46 === l ? a + t.slice(n + 1) : t.slice(n)) + k), (t = t.slice(0, n)); + break; + } + } + g && !d && (t = r(t, 1 / 0)); + var w = f.length + t.length + k.length, + S = w < p ? new Array(p - w + 1).join(e) : ""; + switch ((g && d && ((t = r(S + t, S.length ? p - k.length : 1 / 0)), (S = "")), i)) { + case "<": + t = f + t + k + S; + break; + case "=": + t = f + S + t + k; + break; + case "^": + t = S.slice(0, (w = S.length >> 1)) + f + t + k + S.slice(w); + break; + default: + t = S + f + t + k; + } + return s(t); + } + return ( + (m = void 0 === m ? 6 : /[gprs]/.test(_) ? Math.max(1, Math.min(21, m)) : Math.max(0, Math.min(20, m))), + (k.toString = function () { + return t + ""; + }), + k + ); + } + return { + format: u, + formatPrefix: function (t, e) { + var i = u((((t = Ir(t)).type = "f"), t)), + r = 3 * Math.max(-8, Math.min(8, Math.floor($r(e) / 3))), + n = Math.pow(10, -r), + o = Yr[8 + r / 3]; + return function (t) { + return i(n * t) + o; + }; + }, + }; + })({ thousands: ",", grouping: [3], currency: ["$", ""] })), + (Wr = Rr.format), + (Ur = Rr.formatPrefix); + class Xr extends Map { + constructor(t, e = Qr) { + if ((super(), Object.defineProperties(this, { _intern: { value: new Map() }, _key: { value: e } }), null != t)) + for (const [e, i] of t) this.set(e, i); + } + get(t) { + return super.get(Jr(this, t)); + } + has(t) { + return super.has(Jr(this, t)); + } + set(t, e) { + return super.set( + (function ({ _intern: t, _key: e }, i) { + const r = e(i); + return t.has(r) ? t.get(r) : (t.set(r, i), i); + })(this, t), + e, + ); + } + delete(t) { + return super.delete( + (function ({ _intern: t, _key: e }, i) { + const r = e(i); + return t.has(r) && ((i = t.get(r)), t.delete(r)), i; + })(this, t), + ); + } + } + function Jr({ _intern: t, _key: e }, i) { + const r = e(i); + return t.has(r) ? t.get(r) : i; + } + function Qr(t) { + return null !== t && "object" == typeof t ? t.valueOf() : t; + } + const Kr = Symbol("implicit"); + function tn() { + var t = new Xr(), + e = [], + i = [], + r = Kr; + function n(n) { + let o = t.get(n); + if (void 0 === o) { + if (r !== Kr) return r; + t.set(n, (o = e.push(n) - 1)); + } + return i[o % i.length]; + } + return ( + (n.domain = function (i) { + if (!arguments.length) return e.slice(); + (e = []), (t = new Xr()); + for (const r of i) t.has(r) || t.set(r, e.push(r) - 1); + return n; + }), + (n.range = function (t) { + return arguments.length ? ((i = Array.from(t)), n) : i.slice(); + }), + (n.unknown = function (t) { + return arguments.length ? ((r = t), n) : r; + }), + (n.copy = function () { + return tn(e, i).unknown(r); + }), + Zr.apply(n, arguments), + n + ); + } + const en = 1e3, + rn = 6e4, + nn = 36e5, + on = 864e5, + an = 6048e5, + sn = 31536e6, + ln = new Date(), + hn = new Date(); + function cn(t, e, i, r) { + function n(e) { + return t((e = 0 === arguments.length ? new Date() : new Date(+e))), e; + } + return ( + (n.floor = (e) => (t((e = new Date(+e))), e)), + (n.ceil = (i) => (t((i = new Date(i - 1))), e(i, 1), t(i), i)), + (n.round = (t) => { + const e = n(t), + i = n.ceil(t); + return t - e < i - t ? e : i; + }), + (n.offset = (t, i) => (e((t = new Date(+t)), null == i ? 1 : Math.floor(i)), t)), + (n.range = (i, r, o) => { + const a = []; + if (((i = n.ceil(i)), (o = null == o ? 1 : Math.floor(o)), !(i < r && o > 0))) return a; + let s; + do { + a.push((s = new Date(+i))), e(i, o), t(i); + } while (s < i && i < r); + return a; + }), + (n.filter = (i) => + cn( + (e) => { + if (e >= e) for (; t(e), !i(e); ) e.setTime(e - 1); + }, + (t, r) => { + if (t >= t) + if (r < 0) for (; ++r <= 0; ) for (; e(t, -1), !i(t); ); + else for (; --r >= 0; ) for (; e(t, 1), !i(t); ); + }, + )), + i && + ((n.count = (e, r) => (ln.setTime(+e), hn.setTime(+r), t(ln), t(hn), Math.floor(i(ln, hn)))), + (n.every = (t) => ( + (t = Math.floor(t)), isFinite(t) && t > 0 ? (t > 1 ? n.filter(r ? (e) => r(e) % t == 0 : (e) => n.count(0, e) % t == 0) : n) : null + ))), + n + ); + } + const un = cn( + () => {}, + (t, e) => { + t.setTime(+t + e); + }, + (t, e) => e - t, + ); + (un.every = (t) => ( + (t = Math.floor(t)), + isFinite(t) && t > 0 + ? t > 1 + ? cn( + (e) => { + e.setTime(Math.floor(e / t) * t); + }, + (e, i) => { + e.setTime(+e + i * t); + }, + (e, i) => (i - e) / t, + ) + : un + : null + )), + un.range; + const fn = cn( + (t) => { + t.setTime(t - t.getMilliseconds()); + }, + (t, e) => { + t.setTime(+t + e * en); + }, + (t, e) => (e - t) / en, + (t) => t.getUTCSeconds(), + ), + dn = + (fn.range, + cn( + (t) => { + t.setTime(t - t.getMilliseconds() - t.getSeconds() * en); + }, + (t, e) => { + t.setTime(+t + e * rn); + }, + (t, e) => (e - t) / rn, + (t) => t.getMinutes(), + )), + pn = + (dn.range, + cn( + (t) => { + t.setUTCSeconds(0, 0); + }, + (t, e) => { + t.setTime(+t + e * rn); + }, + (t, e) => (e - t) / rn, + (t) => t.getUTCMinutes(), + )), + gn = + (pn.range, + cn( + (t) => { + t.setTime(t - t.getMilliseconds() - t.getSeconds() * en - t.getMinutes() * rn); + }, + (t, e) => { + t.setTime(+t + e * nn); + }, + (t, e) => (e - t) / nn, + (t) => t.getHours(), + )), + mn = + (gn.range, + cn( + (t) => { + t.setUTCMinutes(0, 0, 0); + }, + (t, e) => { + t.setTime(+t + e * nn); + }, + (t, e) => (e - t) / nn, + (t) => t.getUTCHours(), + )), + yn = + (mn.range, + cn( + (t) => t.setHours(0, 0, 0, 0), + (t, e) => t.setDate(t.getDate() + e), + (t, e) => (e - t - (e.getTimezoneOffset() - t.getTimezoneOffset()) * rn) / on, + (t) => t.getDate() - 1, + )), + _n = + (yn.range, + cn( + (t) => { + t.setUTCHours(0, 0, 0, 0); + }, + (t, e) => { + t.setUTCDate(t.getUTCDate() + e); + }, + (t, e) => (e - t) / on, + (t) => t.getUTCDate() - 1, + )), + bn = + (_n.range, + cn( + (t) => { + t.setUTCHours(0, 0, 0, 0); + }, + (t, e) => { + t.setUTCDate(t.getUTCDate() + e); + }, + (t, e) => (e - t) / on, + (t) => Math.floor(t / on), + )); + function Cn(t) { + return cn( + (e) => { + e.setDate(e.getDate() - ((e.getDay() + 7 - t) % 7)), e.setHours(0, 0, 0, 0); + }, + (t, e) => { + t.setDate(t.getDate() + 7 * e); + }, + (t, e) => (e - t - (e.getTimezoneOffset() - t.getTimezoneOffset()) * rn) / an, + ); + } + bn.range; + const xn = Cn(0), + vn = Cn(1), + kn = Cn(2), + Tn = Cn(3), + wn = Cn(4), + Sn = Cn(5), + Bn = Cn(6); + function Fn(t) { + return cn( + (e) => { + e.setUTCDate(e.getUTCDate() - ((e.getUTCDay() + 7 - t) % 7)), e.setUTCHours(0, 0, 0, 0); + }, + (t, e) => { + t.setUTCDate(t.getUTCDate() + 7 * e); + }, + (t, e) => (e - t) / an, + ); + } + xn.range, vn.range, kn.range, Tn.range, wn.range, Sn.range, Bn.range; + const Ln = Fn(0), + Mn = Fn(1), + An = Fn(2), + En = Fn(3), + Zn = Fn(4), + On = Fn(5), + qn = Fn(6), + In = + (Ln.range, + Mn.range, + An.range, + En.range, + Zn.range, + On.range, + qn.range, + cn( + (t) => { + t.setDate(1), t.setHours(0, 0, 0, 0); + }, + (t, e) => { + t.setMonth(t.getMonth() + e); + }, + (t, e) => e.getMonth() - t.getMonth() + 12 * (e.getFullYear() - t.getFullYear()), + (t) => t.getMonth(), + )), + Nn = + (In.range, + cn( + (t) => { + t.setUTCDate(1), t.setUTCHours(0, 0, 0, 0); + }, + (t, e) => { + t.setUTCMonth(t.getUTCMonth() + e); + }, + (t, e) => e.getUTCMonth() - t.getUTCMonth() + 12 * (e.getUTCFullYear() - t.getUTCFullYear()), + (t) => t.getUTCMonth(), + )), + Dn = + (Nn.range, + cn( + (t) => { + t.setMonth(0, 1), t.setHours(0, 0, 0, 0); + }, + (t, e) => { + t.setFullYear(t.getFullYear() + e); + }, + (t, e) => e.getFullYear() - t.getFullYear(), + (t) => t.getFullYear(), + )); + (Dn.every = (t) => + isFinite((t = Math.floor(t))) && t > 0 + ? cn( + (e) => { + e.setFullYear(Math.floor(e.getFullYear() / t) * t), e.setMonth(0, 1), e.setHours(0, 0, 0, 0); + }, + (e, i) => { + e.setFullYear(e.getFullYear() + i * t); + }, + ) + : null), + Dn.range; + const $n = cn( + (t) => { + t.setUTCMonth(0, 1), t.setUTCHours(0, 0, 0, 0); + }, + (t, e) => { + t.setUTCFullYear(t.getUTCFullYear() + e); + }, + (t, e) => e.getUTCFullYear() - t.getUTCFullYear(), + (t) => t.getUTCFullYear(), + ); + function zn(t, e, i, r, n, o) { + const a = [ + [fn, 1, en], + [fn, 5, 5e3], + [fn, 15, 15e3], + [fn, 30, 3e4], + [o, 1, rn], + [o, 5, 3e5], + [o, 15, 9e5], + [o, 30, 18e5], + [n, 1, nn], + [n, 3, 108e5], + [n, 6, 216e5], + [n, 12, 432e5], + [r, 1, on], + [r, 2, 1728e5], + [i, 1, an], + [e, 1, 2592e6], + [e, 3, 7776e6], + [t, 1, sn], + ]; + function s(e, i, r) { + const n = Math.abs(i - e) / r, + o = pr(([, , t]) => t).right(a, n); + if (o === a.length) return t.every(ur(e / sn, i / sn, r)); + if (0 === o) return un.every(Math.max(ur(e, i, r), 1)); + const [s, l] = a[n / a[o - 1][2] < a[o][2] / n ? o - 1 : o]; + return s.every(l); + } + return [ + function (t, e, i) { + const r = e < t; + r && ([t, e] = [e, t]); + const n = i && "function" == typeof i.range ? i : s(t, e, i), + o = n ? n.range(t, +e + 1) : []; + return r ? o.reverse() : o; + }, + s, + ]; + } + ($n.every = (t) => + isFinite((t = Math.floor(t))) && t > 0 + ? cn( + (e) => { + e.setUTCFullYear(Math.floor(e.getUTCFullYear() / t) * t), e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0); + }, + (e, i) => { + e.setUTCFullYear(e.getUTCFullYear() + i * t); + }, + ) + : null), + $n.range; + const [jn, Pn] = zn($n, Nn, Ln, bn, mn, pn), + [Rn, Wn] = zn(Dn, In, xn, yn, gn, dn); + function Un(t) { + if (0 <= t.y && t.y < 100) { + var e = new Date(-1, t.m, t.d, t.H, t.M, t.S, t.L); + return e.setFullYear(t.y), e; + } + return new Date(t.y, t.m, t.d, t.H, t.M, t.S, t.L); + } + function Hn(t) { + if (0 <= t.y && t.y < 100) { + var e = new Date(Date.UTC(-1, t.m, t.d, t.H, t.M, t.S, t.L)); + return e.setUTCFullYear(t.y), e; + } + return new Date(Date.UTC(t.y, t.m, t.d, t.H, t.M, t.S, t.L)); + } + function Yn(t, e, i) { + return { y: t, m: e, d: i, H: 0, M: 0, S: 0, L: 0 }; + } + var Vn, + Gn, + Xn = { "-": "", _: " ", 0: "0" }, + Jn = /^\s*\d+/, + Qn = /^%/, + Kn = /[\\^$*+?|[\]().{}]/g; + function to(t, e, i) { + var r = t < 0 ? "-" : "", + n = (r ? -t : t) + "", + o = n.length; + return r + (o < i ? new Array(i - o + 1).join(e) + n : n); + } + function eo(t) { + return t.replace(Kn, "\\$&"); + } + function io(t) { + return new RegExp("^(?:" + t.map(eo).join("|") + ")", "i"); + } + function ro(t) { + return new Map(t.map((t, e) => [t.toLowerCase(), e])); + } + function no(t, e, i) { + var r = Jn.exec(e.slice(i, i + 1)); + return r ? ((t.w = +r[0]), i + r[0].length) : -1; + } + function oo(t, e, i) { + var r = Jn.exec(e.slice(i, i + 1)); + return r ? ((t.u = +r[0]), i + r[0].length) : -1; + } + function ao(t, e, i) { + var r = Jn.exec(e.slice(i, i + 2)); + return r ? ((t.U = +r[0]), i + r[0].length) : -1; + } + function so(t, e, i) { + var r = Jn.exec(e.slice(i, i + 2)); + return r ? ((t.V = +r[0]), i + r[0].length) : -1; + } + function lo(t, e, i) { + var r = Jn.exec(e.slice(i, i + 2)); + return r ? ((t.W = +r[0]), i + r[0].length) : -1; + } + function ho(t, e, i) { + var r = Jn.exec(e.slice(i, i + 4)); + return r ? ((t.y = +r[0]), i + r[0].length) : -1; + } + function co(t, e, i) { + var r = Jn.exec(e.slice(i, i + 2)); + return r ? ((t.y = +r[0] + (+r[0] > 68 ? 1900 : 2e3)), i + r[0].length) : -1; + } + function uo(t, e, i) { + var r = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(i, i + 6)); + return r ? ((t.Z = r[1] ? 0 : -(r[2] + (r[3] || "00"))), i + r[0].length) : -1; + } + function fo(t, e, i) { + var r = Jn.exec(e.slice(i, i + 1)); + return r ? ((t.q = 3 * r[0] - 3), i + r[0].length) : -1; + } + function po(t, e, i) { + var r = Jn.exec(e.slice(i, i + 2)); + return r ? ((t.m = r[0] - 1), i + r[0].length) : -1; + } + function go(t, e, i) { + var r = Jn.exec(e.slice(i, i + 2)); + return r ? ((t.d = +r[0]), i + r[0].length) : -1; + } + function mo(t, e, i) { + var r = Jn.exec(e.slice(i, i + 3)); + return r ? ((t.m = 0), (t.d = +r[0]), i + r[0].length) : -1; + } + function yo(t, e, i) { + var r = Jn.exec(e.slice(i, i + 2)); + return r ? ((t.H = +r[0]), i + r[0].length) : -1; + } + function _o(t, e, i) { + var r = Jn.exec(e.slice(i, i + 2)); + return r ? ((t.M = +r[0]), i + r[0].length) : -1; + } + function bo(t, e, i) { + var r = Jn.exec(e.slice(i, i + 2)); + return r ? ((t.S = +r[0]), i + r[0].length) : -1; + } + function Co(t, e, i) { + var r = Jn.exec(e.slice(i, i + 3)); + return r ? ((t.L = +r[0]), i + r[0].length) : -1; + } + function xo(t, e, i) { + var r = Jn.exec(e.slice(i, i + 6)); + return r ? ((t.L = Math.floor(r[0] / 1e3)), i + r[0].length) : -1; + } + function vo(t, e, i) { + var r = Qn.exec(e.slice(i, i + 1)); + return r ? i + r[0].length : -1; + } + function ko(t, e, i) { + var r = Jn.exec(e.slice(i)); + return r ? ((t.Q = +r[0]), i + r[0].length) : -1; + } + function To(t, e, i) { + var r = Jn.exec(e.slice(i)); + return r ? ((t.s = +r[0]), i + r[0].length) : -1; + } + function wo(t, e) { + return to(t.getDate(), e, 2); + } + function So(t, e) { + return to(t.getHours(), e, 2); + } + function Bo(t, e) { + return to(t.getHours() % 12 || 12, e, 2); + } + function Fo(t, e) { + return to(1 + yn.count(Dn(t), t), e, 3); + } + function Lo(t, e) { + return to(t.getMilliseconds(), e, 3); + } + function Mo(t, e) { + return Lo(t, e) + "000"; + } + function Ao(t, e) { + return to(t.getMonth() + 1, e, 2); + } + function Eo(t, e) { + return to(t.getMinutes(), e, 2); + } + function Zo(t, e) { + return to(t.getSeconds(), e, 2); + } + function Oo(t) { + var e = t.getDay(); + return 0 === e ? 7 : e; + } + function qo(t, e) { + return to(xn.count(Dn(t) - 1, t), e, 2); + } + function Io(t) { + var e = t.getDay(); + return e >= 4 || 0 === e ? wn(t) : wn.ceil(t); + } + function No(t, e) { + return (t = Io(t)), to(wn.count(Dn(t), t) + (4 === Dn(t).getDay()), e, 2); + } + function Do(t) { + return t.getDay(); + } + function $o(t, e) { + return to(vn.count(Dn(t) - 1, t), e, 2); + } + function zo(t, e) { + return to(t.getFullYear() % 100, e, 2); + } + function jo(t, e) { + return to((t = Io(t)).getFullYear() % 100, e, 2); + } + function Po(t, e) { + return to(t.getFullYear() % 1e4, e, 4); + } + function Ro(t, e) { + var i = t.getDay(); + return to((t = i >= 4 || 0 === i ? wn(t) : wn.ceil(t)).getFullYear() % 1e4, e, 4); + } + function Wo(t) { + var e = t.getTimezoneOffset(); + return (e > 0 ? "-" : ((e *= -1), "+")) + to((e / 60) | 0, "0", 2) + to(e % 60, "0", 2); + } + function Uo(t, e) { + return to(t.getUTCDate(), e, 2); + } + function Ho(t, e) { + return to(t.getUTCHours(), e, 2); + } + function Yo(t, e) { + return to(t.getUTCHours() % 12 || 12, e, 2); + } + function Vo(t, e) { + return to(1 + _n.count($n(t), t), e, 3); + } + function Go(t, e) { + return to(t.getUTCMilliseconds(), e, 3); + } + function Xo(t, e) { + return Go(t, e) + "000"; + } + function Jo(t, e) { + return to(t.getUTCMonth() + 1, e, 2); + } + function Qo(t, e) { + return to(t.getUTCMinutes(), e, 2); + } + function Ko(t, e) { + return to(t.getUTCSeconds(), e, 2); + } + function ta(t) { + var e = t.getUTCDay(); + return 0 === e ? 7 : e; + } + function ea(t, e) { + return to(Ln.count($n(t) - 1, t), e, 2); + } + function ia(t) { + var e = t.getUTCDay(); + return e >= 4 || 0 === e ? Zn(t) : Zn.ceil(t); + } + function ra(t, e) { + return (t = ia(t)), to(Zn.count($n(t), t) + (4 === $n(t).getUTCDay()), e, 2); + } + function na(t) { + return t.getUTCDay(); + } + function oa(t, e) { + return to(Mn.count($n(t) - 1, t), e, 2); + } + function aa(t, e) { + return to(t.getUTCFullYear() % 100, e, 2); + } + function sa(t, e) { + return to((t = ia(t)).getUTCFullYear() % 100, e, 2); + } + function la(t, e) { + return to(t.getUTCFullYear() % 1e4, e, 4); + } + function ha(t, e) { + var i = t.getUTCDay(); + return to((t = i >= 4 || 0 === i ? Zn(t) : Zn.ceil(t)).getUTCFullYear() % 1e4, e, 4); + } + function ca() { + return "+0000"; + } + function ua() { + return "%"; + } + function fa(t) { + return +t; + } + function da(t) { + return Math.floor(+t / 1e3); + } + function pa(t) { + return new Date(t); + } + function ga(t) { + return t instanceof Date ? +t : +new Date(+t); + } + function ma(t, e, i, r, n, o, a, s, l, h) { + var c = Er(), + u = c.invert, + f = c.domain, + d = h(".%L"), + p = h(":%S"), + g = h("%I:%M"), + m = h("%I %p"), + y = h("%a %d"), + _ = h("%b %d"), + b = h("%B"), + C = h("%Y"); + function x(t) { + return (l(t) < t ? d : s(t) < t ? p : a(t) < t ? g : o(t) < t ? m : r(t) < t ? (n(t) < t ? y : _) : i(t) < t ? b : C)(t); + } + return ( + (c.invert = function (t) { + return new Date(u(t)); + }), + (c.domain = function (t) { + return arguments.length ? f(Array.from(t, ga)) : f().map(pa); + }), + (c.ticks = function (e) { + var i = f(); + return t(i[0], i[i.length - 1], null == e ? 10 : e); + }), + (c.tickFormat = function (t, e) { + return null == e ? x : h(e); + }), + (c.nice = function (t) { + var i = f(); + return ( + (t && "function" == typeof t.range) || (t = e(i[0], i[i.length - 1], null == t ? 10 : t)), + t + ? f( + (function (t, e) { + var i, + r = 0, + n = (t = t.slice()).length - 1, + o = t[r], + a = t[n]; + return a < o && ((i = r), (r = n), (n = i), (i = o), (o = a), (a = i)), (t[r] = e.floor(o)), (t[n] = e.ceil(a)), t; + })(i, t), + ) + : c + ); + }), + (c.copy = function () { + return Ar(c, ma(t, e, i, r, n, o, a, s, l, h)); + }), + c + ); + } + function ya() { + return Zr.apply(ma(Rn, Wn, Dn, In, xn, yn, gn, dn, fn, Gn).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments); + } + (Vn = (function (t) { + var e = t.dateTime, + i = t.date, + r = t.time, + n = t.periods, + o = t.days, + a = t.shortDays, + s = t.months, + l = t.shortMonths, + h = io(n), + c = ro(n), + u = io(o), + f = ro(o), + d = io(a), + p = ro(a), + g = io(s), + m = ro(s), + y = io(l), + _ = ro(l), + b = { + a: function (t) { + return a[t.getDay()]; + }, + A: function (t) { + return o[t.getDay()]; + }, + b: function (t) { + return l[t.getMonth()]; + }, + B: function (t) { + return s[t.getMonth()]; + }, + c: null, + d: wo, + e: wo, + f: Mo, + g: jo, + G: Ro, + H: So, + I: Bo, + j: Fo, + L: Lo, + m: Ao, + M: Eo, + p: function (t) { + return n[+(t.getHours() >= 12)]; + }, + q: function (t) { + return 1 + ~~(t.getMonth() / 3); + }, + Q: fa, + s: da, + S: Zo, + u: Oo, + U: qo, + V: No, + w: Do, + W: $o, + x: null, + X: null, + y: zo, + Y: Po, + Z: Wo, + "%": ua, + }, + C = { + a: function (t) { + return a[t.getUTCDay()]; + }, + A: function (t) { + return o[t.getUTCDay()]; + }, + b: function (t) { + return l[t.getUTCMonth()]; + }, + B: function (t) { + return s[t.getUTCMonth()]; + }, + c: null, + d: Uo, + e: Uo, + f: Xo, + g: sa, + G: ha, + H: Ho, + I: Yo, + j: Vo, + L: Go, + m: Jo, + M: Qo, + p: function (t) { + return n[+(t.getUTCHours() >= 12)]; + }, + q: function (t) { + return 1 + ~~(t.getUTCMonth() / 3); + }, + Q: fa, + s: da, + S: Ko, + u: ta, + U: ea, + V: ra, + w: na, + W: oa, + x: null, + X: null, + y: aa, + Y: la, + Z: ca, + "%": ua, + }, + x = { + a: function (t, e, i) { + var r = d.exec(e.slice(i)); + return r ? ((t.w = p.get(r[0].toLowerCase())), i + r[0].length) : -1; + }, + A: function (t, e, i) { + var r = u.exec(e.slice(i)); + return r ? ((t.w = f.get(r[0].toLowerCase())), i + r[0].length) : -1; + }, + b: function (t, e, i) { + var r = y.exec(e.slice(i)); + return r ? ((t.m = _.get(r[0].toLowerCase())), i + r[0].length) : -1; + }, + B: function (t, e, i) { + var r = g.exec(e.slice(i)); + return r ? ((t.m = m.get(r[0].toLowerCase())), i + r[0].length) : -1; + }, + c: function (t, i, r) { + return T(t, e, i, r); + }, + d: go, + e: go, + f: xo, + g: co, + G: ho, + H: yo, + I: yo, + j: mo, + L: Co, + m: po, + M: _o, + p: function (t, e, i) { + var r = h.exec(e.slice(i)); + return r ? ((t.p = c.get(r[0].toLowerCase())), i + r[0].length) : -1; + }, + q: fo, + Q: ko, + s: To, + S: bo, + u: oo, + U: ao, + V: so, + w: no, + W: lo, + x: function (t, e, r) { + return T(t, i, e, r); + }, + X: function (t, e, i) { + return T(t, r, e, i); + }, + y: co, + Y: ho, + Z: uo, + "%": vo, + }; + function v(t, e) { + return function (i) { + var r, + n, + o, + a = [], + s = -1, + l = 0, + h = t.length; + for (i instanceof Date || (i = new Date(+i)); ++s < h; ) + 37 === t.charCodeAt(s) && + (a.push(t.slice(l, s)), + null != (n = Xn[(r = t.charAt(++s))]) ? (r = t.charAt(++s)) : (n = "e" === r ? " " : "0"), + (o = e[r]) && (r = o(i, n)), + a.push(r), + (l = s + 1)); + return a.push(t.slice(l, s)), a.join(""); + }; + } + function k(t, e) { + return function (i) { + var r, + n, + o = Yn(1900, void 0, 1); + if (T(o, t, (i += ""), 0) != i.length) return null; + if ("Q" in o) return new Date(o.Q); + if ("s" in o) return new Date(1e3 * o.s + ("L" in o ? o.L : 0)); + if ((e && !("Z" in o) && (o.Z = 0), "p" in o && (o.H = (o.H % 12) + 12 * o.p), void 0 === o.m && (o.m = "q" in o ? o.q : 0), "V" in o)) { + if (o.V < 1 || o.V > 53) return null; + "w" in o || (o.w = 1), + "Z" in o + ? ((n = (r = Hn(Yn(o.y, 0, 1))).getUTCDay()), + (r = n > 4 || 0 === n ? Mn.ceil(r) : Mn(r)), + (r = _n.offset(r, 7 * (o.V - 1))), + (o.y = r.getUTCFullYear()), + (o.m = r.getUTCMonth()), + (o.d = r.getUTCDate() + ((o.w + 6) % 7))) + : ((n = (r = Un(Yn(o.y, 0, 1))).getDay()), + (r = n > 4 || 0 === n ? vn.ceil(r) : vn(r)), + (r = yn.offset(r, 7 * (o.V - 1))), + (o.y = r.getFullYear()), + (o.m = r.getMonth()), + (o.d = r.getDate() + ((o.w + 6) % 7))); + } else + ("W" in o || "U" in o) && + ("w" in o || (o.w = "u" in o ? o.u % 7 : "W" in o ? 1 : 0), + (n = "Z" in o ? Hn(Yn(o.y, 0, 1)).getUTCDay() : Un(Yn(o.y, 0, 1)).getDay()), + (o.m = 0), + (o.d = "W" in o ? ((o.w + 6) % 7) + 7 * o.W - ((n + 5) % 7) : o.w + 7 * o.U - ((n + 6) % 7))); + return "Z" in o ? ((o.H += (o.Z / 100) | 0), (o.M += o.Z % 100), Hn(o)) : Un(o); + }; + } + function T(t, e, i, r) { + for (var n, o, a = 0, s = e.length, l = i.length; a < s; ) { + if (r >= l) return -1; + if (37 === (n = e.charCodeAt(a++))) { + if (((n = e.charAt(a++)), !(o = x[n in Xn ? e.charAt(a++) : n]) || (r = o(t, i, r)) < 0)) return -1; + } else if (n != i.charCodeAt(r++)) return -1; + } + return r; + } + return ( + (b.x = v(i, b)), + (b.X = v(r, b)), + (b.c = v(e, b)), + (C.x = v(i, C)), + (C.X = v(r, C)), + (C.c = v(e, C)), + { + format: function (t) { + var e = v((t += ""), b); + return ( + (e.toString = function () { + return t; + }), + e + ); + }, + parse: function (t) { + var e = k((t += ""), !1); + return ( + (e.toString = function () { + return t; + }), + e + ); + }, + utcFormat: function (t) { + var e = v((t += ""), C); + return ( + (e.toString = function () { + return t; + }), + e + ); + }, + utcParse: function (t) { + var e = k((t += ""), !0); + return ( + (e.toString = function () { + return t; + }), + e + ); + }, + } + ); + })({ + dateTime: "%x, %X", + date: "%-m/%-d/%Y", + time: "%-I:%M:%S %p", + periods: ["AM", "PM"], + days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + })), + (Gn = Vn.format), + Vn.parse, + Vn.utcFormat, + Vn.utcParse; + var _a = (function (t) { + for (var e = new Array(10), i = 0; i < 10; ) e[i] = "#" + t.slice(6 * i, 6 * ++i); + return e; + })("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"); + function ba(t) { + return "string" == typeof t ? new Lt([[document.querySelector(t)]], [document.documentElement]) : new Lt([[t]], Ft); + } + function Ca(t) { + return "string" == typeof t ? new Lt([document.querySelectorAll(t)], [document.documentElement]) : new Lt([x(t)], Ft); + } + function xa(t) { + return function () { + return t; + }; + } + const va = Math.abs, + ka = Math.atan2, + Ta = Math.cos, + wa = Math.max, + Sa = Math.min, + Ba = Math.sin, + Fa = Math.sqrt, + La = 1e-12, + Ma = Math.PI, + Aa = Ma / 2, + Ea = 2 * Ma; + function Za(t) { + return t >= 1 ? Aa : t <= -1 ? -Aa : Math.asin(t); + } + const Oa = Math.PI, + qa = 2 * Oa, + Ia = 1e-6, + Na = qa - Ia; + function Da(t) { + this._ += t[0]; + for (let e = 1, i = t.length; e < i; ++e) this._ += arguments[e] + t[e]; + } + class $a { + constructor(t) { + (this._x0 = this._y0 = this._x1 = this._y1 = null), + (this._ = ""), + (this._append = + null == t + ? Da + : (function (t) { + let e = Math.floor(t); + if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); + if (e > 15) return Da; + const i = 10 ** e; + return function (t) { + this._ += t[0]; + for (let e = 1, r = t.length; e < r; ++e) this._ += Math.round(arguments[e] * i) / i + t[e]; + }; + })(t)); + } + moveTo(t, e) { + this._append`M${(this._x0 = this._x1 = +t)},${(this._y0 = this._y1 = +e)}`; + } + closePath() { + null !== this._x1 && ((this._x1 = this._x0), (this._y1 = this._y0), this._append`Z`); + } + lineTo(t, e) { + this._append`L${(this._x1 = +t)},${(this._y1 = +e)}`; + } + quadraticCurveTo(t, e, i, r) { + this._append`Q${+t},${+e},${(this._x1 = +i)},${(this._y1 = +r)}`; + } + bezierCurveTo(t, e, i, r, n, o) { + this._append`C${+t},${+e},${+i},${+r},${(this._x1 = +n)},${(this._y1 = +o)}`; + } + arcTo(t, e, i, r, n) { + if (((t = +t), (e = +e), (i = +i), (r = +r), (n = +n) < 0)) throw new Error(`negative radius: ${n}`); + let o = this._x1, + a = this._y1, + s = i - t, + l = r - e, + h = o - t, + c = a - e, + u = h * h + c * c; + if (null === this._x1) this._append`M${(this._x1 = t)},${(this._y1 = e)}`; + else if (u > Ia) + if (Math.abs(c * s - l * h) > Ia && n) { + let f = i - o, + d = r - a, + p = s * s + l * l, + g = f * f + d * d, + m = Math.sqrt(p), + y = Math.sqrt(u), + _ = n * Math.tan((Oa - Math.acos((p + u - g) / (2 * m * y))) / 2), + b = _ / y, + C = _ / m; + Math.abs(b - 1) > Ia && this._append`L${t + b * h},${e + b * c}`, + this._append`A${n},${n},0,0,${+(c * f > h * d)},${(this._x1 = t + C * s)},${(this._y1 = e + C * l)}`; + } else this._append`L${(this._x1 = t)},${(this._y1 = e)}`; + } + arc(t, e, i, r, n, o) { + if (((t = +t), (e = +e), (o = !!o), (i = +i) < 0)) throw new Error(`negative radius: ${i}`); + let a = i * Math.cos(r), + s = i * Math.sin(r), + l = t + a, + h = e + s, + c = 1 ^ o, + u = o ? r - n : n - r; + null === this._x1 ? this._append`M${l},${h}` : (Math.abs(this._x1 - l) > Ia || Math.abs(this._y1 - h) > Ia) && this._append`L${l},${h}`, + i && + (u < 0 && (u = (u % qa) + qa), + u > Na + ? this._append`A${i},${i},0,1,${c},${t - a},${e - s}A${i},${i},0,1,${c},${(this._x1 = l)},${(this._y1 = h)}` + : u > Ia && this._append`A${i},${i},0,${+(u >= Oa)},${c},${(this._x1 = t + i * Math.cos(n))},${(this._y1 = e + i * Math.sin(n))}`); + } + rect(t, e, i, r) { + this._append`M${(this._x0 = this._x1 = +t)},${(this._y0 = this._y1 = +e)}h${(i = +i)}v${+r}h${-i}Z`; + } + toString() { + return this._; + } + } + function za(t) { + let e = 3; + return ( + (t.digits = function (i) { + if (!arguments.length) return e; + if (null == i) e = null; + else { + const t = Math.floor(i); + if (!(t >= 0)) throw new RangeError(`invalid digits: ${i}`); + e = t; + } + return t; + }), + () => new $a(e) + ); + } + function ja(t) { + return t.innerRadius; + } + function Pa(t) { + return t.outerRadius; + } + function Ra(t) { + return t.startAngle; + } + function Wa(t) { + return t.endAngle; + } + function Ua(t) { + return t && t.padAngle; + } + function Ha(t, e, i, r, n, o, a) { + var s = t - i, + l = e - r, + h = (a ? o : -o) / Fa(s * s + l * l), + c = h * l, + u = -h * s, + f = t + c, + d = e + u, + p = i + c, + g = r + u, + m = (f + p) / 2, + y = (d + g) / 2, + _ = p - f, + b = g - d, + C = _ * _ + b * b, + x = n - o, + v = f * g - p * d, + k = (b < 0 ? -1 : 1) * Fa(wa(0, x * x * C - v * v)), + T = (v * b - _ * k) / C, + w = (-v * _ - b * k) / C, + S = (v * b + _ * k) / C, + B = (-v * _ + b * k) / C, + F = T - m, + L = w - y, + M = S - m, + A = B - y; + return F * F + L * L > M * M + A * A && ((T = S), (w = B)), { cx: T, cy: w, x01: -c, y01: -u, x11: T * (n / x - 1), y11: w * (n / x - 1) }; + } + function Ya() { + var t = ja, + e = Pa, + i = xa(0), + r = null, + n = Ra, + o = Wa, + a = Ua, + s = null, + l = za(h); + function h() { + var h, + c, + u, + f = +t.apply(this, arguments), + d = +e.apply(this, arguments), + p = n.apply(this, arguments) - Aa, + g = o.apply(this, arguments) - Aa, + m = va(g - p), + y = g > p; + if ((s || (s = h = l()), d < f && ((c = d), (d = f), (f = c)), d > La)) + if (m > Ea - La) + s.moveTo(d * Ta(p), d * Ba(p)), s.arc(0, 0, d, p, g, !y), f > La && (s.moveTo(f * Ta(g), f * Ba(g)), s.arc(0, 0, f, g, p, y)); + else { + var _, + b, + C = p, + x = g, + v = p, + k = g, + T = m, + w = m, + S = a.apply(this, arguments) / 2, + B = S > La && (r ? +r.apply(this, arguments) : Fa(f * f + d * d)), + F = Sa(va(d - f) / 2, +i.apply(this, arguments)), + L = F, + M = F; + if (B > La) { + var A = Za((B / f) * Ba(S)), + E = Za((B / d) * Ba(S)); + (T -= 2 * A) > La ? ((v += A *= y ? 1 : -1), (k -= A)) : ((T = 0), (v = k = (p + g) / 2)), + (w -= 2 * E) > La ? ((C += E *= y ? 1 : -1), (x -= E)) : ((w = 0), (C = x = (p + g) / 2)); + } + var Z = d * Ta(C), + O = d * Ba(C), + q = f * Ta(k), + I = f * Ba(k); + if (F > La) { + var N, + D = d * Ta(x), + $ = d * Ba(x), + z = f * Ta(v), + j = f * Ba(v); + if (m < Ma) + if ( + (N = (function (t, e, i, r, n, o, a, s) { + var l = i - t, + h = r - e, + c = a - n, + u = s - o, + f = u * l - c * h; + if (!(f * f < La)) return [t + (f = (c * (e - o) - u * (t - n)) / f) * l, e + f * h]; + })(Z, O, z, j, D, $, q, I)) + ) { + var P = Z - N[0], + R = O - N[1], + W = D - N[0], + U = $ - N[1], + H = 1 / Ba(((u = (P * W + R * U) / (Fa(P * P + R * R) * Fa(W * W + U * U))) > 1 ? 0 : u < -1 ? Ma : Math.acos(u)) / 2), + Y = Fa(N[0] * N[0] + N[1] * N[1]); + (L = Sa(F, (f - Y) / (H - 1))), (M = Sa(F, (d - Y) / (H + 1))); + } else L = M = 0; + } + w > La + ? M > La + ? ((_ = Ha(z, j, Z, O, d, M, y)), + (b = Ha(D, $, q, I, d, M, y)), + s.moveTo(_.cx + _.x01, _.cy + _.y01), + M < F + ? s.arc(_.cx, _.cy, M, ka(_.y01, _.x01), ka(b.y01, b.x01), !y) + : (s.arc(_.cx, _.cy, M, ka(_.y01, _.x01), ka(_.y11, _.x11), !y), + s.arc(0, 0, d, ka(_.cy + _.y11, _.cx + _.x11), ka(b.cy + b.y11, b.cx + b.x11), !y), + s.arc(b.cx, b.cy, M, ka(b.y11, b.x11), ka(b.y01, b.x01), !y))) + : (s.moveTo(Z, O), s.arc(0, 0, d, C, x, !y)) + : s.moveTo(Z, O), + f > La && T > La + ? L > La + ? ((_ = Ha(q, I, D, $, f, -L, y)), + (b = Ha(Z, O, z, j, f, -L, y)), + s.lineTo(_.cx + _.x01, _.cy + _.y01), + L < F + ? s.arc(_.cx, _.cy, L, ka(_.y01, _.x01), ka(b.y01, b.x01), !y) + : (s.arc(_.cx, _.cy, L, ka(_.y01, _.x01), ka(_.y11, _.x11), !y), + s.arc(0, 0, f, ka(_.cy + _.y11, _.cx + _.x11), ka(b.cy + b.y11, b.cx + b.x11), y), + s.arc(b.cx, b.cy, L, ka(b.y11, b.x11), ka(b.y01, b.x01), !y))) + : s.arc(0, 0, f, k, v, y) + : s.lineTo(q, I); + } + else s.moveTo(0, 0); + if ((s.closePath(), h)) return (s = null), h + "" || null; + } + return ( + (h.centroid = function () { + var i = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, + r = (+n.apply(this, arguments) + +o.apply(this, arguments)) / 2 - Ma / 2; + return [Ta(r) * i, Ba(r) * i]; + }), + (h.innerRadius = function (e) { + return arguments.length ? ((t = "function" == typeof e ? e : xa(+e)), h) : t; + }), + (h.outerRadius = function (t) { + return arguments.length ? ((e = "function" == typeof t ? t : xa(+t)), h) : e; + }), + (h.cornerRadius = function (t) { + return arguments.length ? ((i = "function" == typeof t ? t : xa(+t)), h) : i; + }), + (h.padRadius = function (t) { + return arguments.length ? ((r = null == t ? null : "function" == typeof t ? t : xa(+t)), h) : r; + }), + (h.startAngle = function (t) { + return arguments.length ? ((n = "function" == typeof t ? t : xa(+t)), h) : n; + }), + (h.endAngle = function (t) { + return arguments.length ? ((o = "function" == typeof t ? t : xa(+t)), h) : o; + }), + (h.padAngle = function (t) { + return arguments.length ? ((a = "function" == typeof t ? t : xa(+t)), h) : a; + }), + (h.context = function (t) { + return arguments.length ? ((s = null == t ? null : t), h) : s; + }), + h + ); + } + function Va(t) { + return "object" == typeof t && "length" in t ? t : Array.from(t); + } + function Ga(t) { + this._context = t; + } + function Xa(t) { + return new Ga(t); + } + function Ja(t) { + return t[0]; + } + function Qa(t) { + return t[1]; + } + function Ka(t, e) { + var i = xa(!0), + r = null, + n = Xa, + o = null, + a = za(s); + function s(s) { + var l, + h, + c, + u = (s = Va(s)).length, + f = !1; + for (null == r && (o = n((c = a()))), l = 0; l <= u; ++l) + !(l < u && i((h = s[l]), l, s)) === f && ((f = !f) ? o.lineStart() : o.lineEnd()), f && o.point(+t(h, l, s), +e(h, l, s)); + if (c) return (o = null), c + "" || null; + } + return ( + (t = "function" == typeof t ? t : void 0 === t ? Ja : xa(t)), + (e = "function" == typeof e ? e : void 0 === e ? Qa : xa(e)), + (s.x = function (e) { + return arguments.length ? ((t = "function" == typeof e ? e : xa(+e)), s) : t; + }), + (s.y = function (t) { + return arguments.length ? ((e = "function" == typeof t ? t : xa(+t)), s) : e; + }), + (s.defined = function (t) { + return arguments.length ? ((i = "function" == typeof t ? t : xa(!!t)), s) : i; + }), + (s.curve = function (t) { + return arguments.length ? ((n = t), null != r && (o = n(r)), s) : n; + }), + (s.context = function (t) { + return arguments.length ? (null == t ? (r = o = null) : (o = n((r = t))), s) : r; + }), + s + ); + } + function ts(t, e) { + return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; + } + function es(t) { + return t; + } + function is() { + var t = es, + e = ts, + i = null, + r = xa(0), + n = xa(Ea), + o = xa(0); + function a(a) { + var s, + l, + h, + c, + u, + f = (a = Va(a)).length, + d = 0, + p = new Array(f), + g = new Array(f), + m = +r.apply(this, arguments), + y = Math.min(Ea, Math.max(-Ea, n.apply(this, arguments) - m)), + _ = Math.min(Math.abs(y) / f, o.apply(this, arguments)), + b = _ * (y < 0 ? -1 : 1); + for (s = 0; s < f; ++s) (u = g[(p[s] = s)] = +t(a[s], s, a)) > 0 && (d += u); + for ( + null != e + ? p.sort(function (t, i) { + return e(g[t], g[i]); + }) + : null != i && + p.sort(function (t, e) { + return i(a[t], a[e]); + }), + s = 0, + h = d ? (y - f * b) / d : 0; + s < f; + ++s, m = c + ) + (l = p[s]), + (c = m + ((u = g[l]) > 0 ? u * h : 0) + b), + (g[l] = { data: a[l], index: s, value: u, startAngle: m, endAngle: c, padAngle: _ }); + return g; + } + return ( + (a.value = function (e) { + return arguments.length ? ((t = "function" == typeof e ? e : xa(+e)), a) : t; + }), + (a.sortValues = function (t) { + return arguments.length ? ((e = t), (i = null), a) : e; + }), + (a.sort = function (t) { + return arguments.length ? ((i = t), (e = null), a) : i; + }), + (a.startAngle = function (t) { + return arguments.length ? ((r = "function" == typeof t ? t : xa(+t)), a) : r; + }), + (a.endAngle = function (t) { + return arguments.length ? ((n = "function" == typeof t ? t : xa(+t)), a) : n; + }), + (a.padAngle = function (t) { + return arguments.length ? ((o = "function" == typeof t ? t : xa(+t)), a) : o; + }), + a + ); + } + function rs() {} + function ns(t, e, i) { + t._context.bezierCurveTo( + (2 * t._x0 + t._x1) / 3, + (2 * t._y0 + t._y1) / 3, + (t._x0 + 2 * t._x1) / 3, + (t._y0 + 2 * t._y1) / 3, + (t._x0 + 4 * t._x1 + e) / 6, + (t._y0 + 4 * t._y1 + i) / 6, + ); + } + function os(t) { + this._context = t; + } + function as(t) { + return new os(t); + } + function ss(t) { + this._context = t; + } + function ls(t) { + return new ss(t); + } + function hs(t) { + this._context = t; + } + function cs(t) { + return new hs(t); + } + $a.prototype, + Array.prototype.slice, + (Ga.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + this._point = 0; + }, + lineEnd: function () { + (this._line || (0 !== this._line && 1 === this._point)) && this._context.closePath(), (this._line = 1 - this._line); + }, + point: function (t, e) { + switch (((t = +t), (e = +e), this._point)) { + case 0: + (this._point = 1), this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); + break; + case 1: + this._point = 2; + default: + this._context.lineTo(t, e); + } + }, + }), + (os.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + (this._x0 = this._x1 = this._y0 = this._y1 = NaN), (this._point = 0); + }, + lineEnd: function () { + switch (this._point) { + case 3: + ns(this, this._x1, this._y1); + case 2: + this._context.lineTo(this._x1, this._y1); + } + (this._line || (0 !== this._line && 1 === this._point)) && this._context.closePath(), (this._line = 1 - this._line); + }, + point: function (t, e) { + switch (((t = +t), (e = +e), this._point)) { + case 0: + (this._point = 1), this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); + break; + case 1: + this._point = 2; + break; + case 2: + (this._point = 3), this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); + default: + ns(this, t, e); + } + (this._x0 = this._x1), (this._x1 = t), (this._y0 = this._y1), (this._y1 = e); + }, + }), + (ss.prototype = { + areaStart: rs, + areaEnd: rs, + lineStart: function () { + (this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN), (this._point = 0); + }, + lineEnd: function () { + switch (this._point) { + case 1: + this._context.moveTo(this._x2, this._y2), this._context.closePath(); + break; + case 2: + this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3), + this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3), + this._context.closePath(); + break; + case 3: + this.point(this._x2, this._y2), this.point(this._x3, this._y3), this.point(this._x4, this._y4); + } + }, + point: function (t, e) { + switch (((t = +t), (e = +e), this._point)) { + case 0: + (this._point = 1), (this._x2 = t), (this._y2 = e); + break; + case 1: + (this._point = 2), (this._x3 = t), (this._y3 = e); + break; + case 2: + (this._point = 3), + (this._x4 = t), + (this._y4 = e), + this._context.moveTo((this._x0 + 4 * this._x1 + t) / 6, (this._y0 + 4 * this._y1 + e) / 6); + break; + default: + ns(this, t, e); + } + (this._x0 = this._x1), (this._x1 = t), (this._y0 = this._y1), (this._y1 = e); + }, + }), + (hs.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + (this._x0 = this._x1 = this._y0 = this._y1 = NaN), (this._point = 0); + }, + lineEnd: function () { + (this._line || (0 !== this._line && 3 === this._point)) && this._context.closePath(), (this._line = 1 - this._line); + }, + point: function (t, e) { + switch (((t = +t), (e = +e), this._point)) { + case 0: + this._point = 1; + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3; + var i = (this._x0 + 4 * this._x1 + t) / 6, + r = (this._y0 + 4 * this._y1 + e) / 6; + this._line ? this._context.lineTo(i, r) : this._context.moveTo(i, r); + break; + case 3: + this._point = 4; + default: + ns(this, t, e); + } + (this._x0 = this._x1), (this._x1 = t), (this._y0 = this._y1), (this._y1 = e); + }, + }); + class us { + constructor(t, e) { + (this._context = t), (this._x = e); + } + areaStart() { + this._line = 0; + } + areaEnd() { + this._line = NaN; + } + lineStart() { + this._point = 0; + } + lineEnd() { + (this._line || (0 !== this._line && 1 === this._point)) && this._context.closePath(), (this._line = 1 - this._line); + } + point(t, e) { + switch (((t = +t), (e = +e), this._point)) { + case 0: + (this._point = 1), this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); + break; + case 1: + this._point = 2; + default: + this._x + ? this._context.bezierCurveTo((this._x0 = (this._x0 + t) / 2), this._y0, this._x0, e, t, e) + : this._context.bezierCurveTo(this._x0, (this._y0 = (this._y0 + e) / 2), t, this._y0, t, e); + } + (this._x0 = t), (this._y0 = e); + } + } + function fs(t) { + return new us(t, !0); + } + function ds(t) { + return new us(t, !1); + } + function ps(t, e) { + (this._basis = new os(t)), (this._beta = e); + } + ps.prototype = { + lineStart: function () { + (this._x = []), (this._y = []), this._basis.lineStart(); + }, + lineEnd: function () { + var t = this._x, + e = this._y, + i = t.length - 1; + if (i > 0) + for (var r, n = t[0], o = e[0], a = t[i] - n, s = e[i] - o, l = -1; ++l <= i; ) + (r = l / i), this._basis.point(this._beta * t[l] + (1 - this._beta) * (n + r * a), this._beta * e[l] + (1 - this._beta) * (o + r * s)); + (this._x = this._y = null), this._basis.lineEnd(); + }, + point: function (t, e) { + this._x.push(+t), this._y.push(+e); + }, + }; + var gs = (function t(e) { + function i(t) { + return 1 === e ? new os(t) : new ps(t, e); + } + return ( + (i.beta = function (e) { + return t(+e); + }), + i + ); + })(0.85); + function ms(t, e, i) { + t._context.bezierCurveTo( + t._x1 + t._k * (t._x2 - t._x0), + t._y1 + t._k * (t._y2 - t._y0), + t._x2 + t._k * (t._x1 - e), + t._y2 + t._k * (t._y1 - i), + t._x2, + t._y2, + ); + } + function ys(t, e) { + (this._context = t), (this._k = (1 - e) / 6); + } + ys.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + (this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN), (this._point = 0); + }, + lineEnd: function () { + switch (this._point) { + case 2: + this._context.lineTo(this._x2, this._y2); + break; + case 3: + ms(this, this._x1, this._y1); + } + (this._line || (0 !== this._line && 1 === this._point)) && this._context.closePath(), (this._line = 1 - this._line); + }, + point: function (t, e) { + switch (((t = +t), (e = +e), this._point)) { + case 0: + (this._point = 1), this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); + break; + case 1: + (this._point = 2), (this._x1 = t), (this._y1 = e); + break; + case 2: + this._point = 3; + default: + ms(this, t, e); + } + (this._x0 = this._x1), (this._x1 = this._x2), (this._x2 = t), (this._y0 = this._y1), (this._y1 = this._y2), (this._y2 = e); + }, + }; + var _s = (function t(e) { + function i(t) { + return new ys(t, e); + } + return ( + (i.tension = function (e) { + return t(+e); + }), + i + ); + })(0); + function bs(t, e) { + (this._context = t), (this._k = (1 - e) / 6); + } + bs.prototype = { + areaStart: rs, + areaEnd: rs, + lineStart: function () { + (this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN), + (this._point = 0); + }, + lineEnd: function () { + switch (this._point) { + case 1: + this._context.moveTo(this._x3, this._y3), this._context.closePath(); + break; + case 2: + this._context.lineTo(this._x3, this._y3), this._context.closePath(); + break; + case 3: + this.point(this._x3, this._y3), this.point(this._x4, this._y4), this.point(this._x5, this._y5); + } + }, + point: function (t, e) { + switch (((t = +t), (e = +e), this._point)) { + case 0: + (this._point = 1), (this._x3 = t), (this._y3 = e); + break; + case 1: + (this._point = 2), this._context.moveTo((this._x4 = t), (this._y4 = e)); + break; + case 2: + (this._point = 3), (this._x5 = t), (this._y5 = e); + break; + default: + ms(this, t, e); + } + (this._x0 = this._x1), (this._x1 = this._x2), (this._x2 = t), (this._y0 = this._y1), (this._y1 = this._y2), (this._y2 = e); + }, + }; + var Cs = (function t(e) { + function i(t) { + return new bs(t, e); + } + return ( + (i.tension = function (e) { + return t(+e); + }), + i + ); + })(0); + function xs(t, e) { + (this._context = t), (this._k = (1 - e) / 6); + } + xs.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + (this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN), (this._point = 0); + }, + lineEnd: function () { + (this._line || (0 !== this._line && 3 === this._point)) && this._context.closePath(), (this._line = 1 - this._line); + }, + point: function (t, e) { + switch (((t = +t), (e = +e), this._point)) { + case 0: + this._point = 1; + break; + case 1: + this._point = 2; + break; + case 2: + (this._point = 3), this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); + break; + case 3: + this._point = 4; + default: + ms(this, t, e); + } + (this._x0 = this._x1), (this._x1 = this._x2), (this._x2 = t), (this._y0 = this._y1), (this._y1 = this._y2), (this._y2 = e); + }, + }; + var vs = (function t(e) { + function i(t) { + return new xs(t, e); + } + return ( + (i.tension = function (e) { + return t(+e); + }), + i + ); + })(0); + function ks(t, e, i) { + var r = t._x1, + n = t._y1, + o = t._x2, + a = t._y2; + if (t._l01_a > La) { + var s = 2 * t._l01_2a + 3 * t._l01_a * t._l12_a + t._l12_2a, + l = 3 * t._l01_a * (t._l01_a + t._l12_a); + (r = (r * s - t._x0 * t._l12_2a + t._x2 * t._l01_2a) / l), (n = (n * s - t._y0 * t._l12_2a + t._y2 * t._l01_2a) / l); + } + if (t._l23_a > La) { + var h = 2 * t._l23_2a + 3 * t._l23_a * t._l12_a + t._l12_2a, + c = 3 * t._l23_a * (t._l23_a + t._l12_a); + (o = (o * h + t._x1 * t._l23_2a - e * t._l12_2a) / c), (a = (a * h + t._y1 * t._l23_2a - i * t._l12_2a) / c); + } + t._context.bezierCurveTo(r, n, o, a, t._x2, t._y2); + } + function Ts(t, e) { + (this._context = t), (this._alpha = e); + } + Ts.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + (this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN), + (this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0); + }, + lineEnd: function () { + switch (this._point) { + case 2: + this._context.lineTo(this._x2, this._y2); + break; + case 3: + this.point(this._x2, this._y2); + } + (this._line || (0 !== this._line && 1 === this._point)) && this._context.closePath(), (this._line = 1 - this._line); + }, + point: function (t, e) { + if (((t = +t), (e = +e), this._point)) { + var i = this._x2 - t, + r = this._y2 - e; + this._l23_a = Math.sqrt((this._l23_2a = Math.pow(i * i + r * r, this._alpha))); + } + switch (this._point) { + case 0: + (this._point = 1), this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3; + default: + ks(this, t, e); + } + (this._l01_a = this._l12_a), + (this._l12_a = this._l23_a), + (this._l01_2a = this._l12_2a), + (this._l12_2a = this._l23_2a), + (this._x0 = this._x1), + (this._x1 = this._x2), + (this._x2 = t), + (this._y0 = this._y1), + (this._y1 = this._y2), + (this._y2 = e); + }, + }; + var ws = (function t(e) { + function i(t) { + return e ? new Ts(t, e) : new ys(t, 0); + } + return ( + (i.alpha = function (e) { + return t(+e); + }), + i + ); + })(0.5); + function Ss(t, e) { + (this._context = t), (this._alpha = e); + } + Ss.prototype = { + areaStart: rs, + areaEnd: rs, + lineStart: function () { + (this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN), + (this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0); + }, + lineEnd: function () { + switch (this._point) { + case 1: + this._context.moveTo(this._x3, this._y3), this._context.closePath(); + break; + case 2: + this._context.lineTo(this._x3, this._y3), this._context.closePath(); + break; + case 3: + this.point(this._x3, this._y3), this.point(this._x4, this._y4), this.point(this._x5, this._y5); + } + }, + point: function (t, e) { + if (((t = +t), (e = +e), this._point)) { + var i = this._x2 - t, + r = this._y2 - e; + this._l23_a = Math.sqrt((this._l23_2a = Math.pow(i * i + r * r, this._alpha))); + } + switch (this._point) { + case 0: + (this._point = 1), (this._x3 = t), (this._y3 = e); + break; + case 1: + (this._point = 2), this._context.moveTo((this._x4 = t), (this._y4 = e)); + break; + case 2: + (this._point = 3), (this._x5 = t), (this._y5 = e); + break; + default: + ks(this, t, e); + } + (this._l01_a = this._l12_a), + (this._l12_a = this._l23_a), + (this._l01_2a = this._l12_2a), + (this._l12_2a = this._l23_2a), + (this._x0 = this._x1), + (this._x1 = this._x2), + (this._x2 = t), + (this._y0 = this._y1), + (this._y1 = this._y2), + (this._y2 = e); + }, + }; + var Bs = (function t(e) { + function i(t) { + return e ? new Ss(t, e) : new bs(t, 0); + } + return ( + (i.alpha = function (e) { + return t(+e); + }), + i + ); + })(0.5); + function Fs(t, e) { + (this._context = t), (this._alpha = e); + } + Fs.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + (this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN), + (this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0); + }, + lineEnd: function () { + (this._line || (0 !== this._line && 3 === this._point)) && this._context.closePath(), (this._line = 1 - this._line); + }, + point: function (t, e) { + if (((t = +t), (e = +e), this._point)) { + var i = this._x2 - t, + r = this._y2 - e; + this._l23_a = Math.sqrt((this._l23_2a = Math.pow(i * i + r * r, this._alpha))); + } + switch (this._point) { + case 0: + this._point = 1; + break; + case 1: + this._point = 2; + break; + case 2: + (this._point = 3), this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); + break; + case 3: + this._point = 4; + default: + ks(this, t, e); + } + (this._l01_a = this._l12_a), + (this._l12_a = this._l23_a), + (this._l01_2a = this._l12_2a), + (this._l12_2a = this._l23_2a), + (this._x0 = this._x1), + (this._x1 = this._x2), + (this._x2 = t), + (this._y0 = this._y1), + (this._y1 = this._y2), + (this._y2 = e); + }, + }; + var Ls = (function t(e) { + function i(t) { + return e ? new Fs(t, e) : new xs(t, 0); + } + return ( + (i.alpha = function (e) { + return t(+e); + }), + i + ); + })(0.5); + function Ms(t) { + this._context = t; + } + function As(t) { + return new Ms(t); + } + function Es(t) { + return t < 0 ? -1 : 1; + } + function Zs(t, e, i) { + var r = t._x1 - t._x0, + n = e - t._x1, + o = (t._y1 - t._y0) / (r || (n < 0 && -0)), + a = (i - t._y1) / (n || (r < 0 && -0)), + s = (o * n + a * r) / (r + n); + return (Es(o) + Es(a)) * Math.min(Math.abs(o), Math.abs(a), 0.5 * Math.abs(s)) || 0; + } + function Os(t, e) { + var i = t._x1 - t._x0; + return i ? ((3 * (t._y1 - t._y0)) / i - e) / 2 : e; + } + function qs(t, e, i) { + var r = t._x0, + n = t._y0, + o = t._x1, + a = t._y1, + s = (o - r) / 3; + t._context.bezierCurveTo(r + s, n + s * e, o - s, a - s * i, o, a); + } + function Is(t) { + this._context = t; + } + function Ns(t) { + this._context = new Ds(t); + } + function Ds(t) { + this._context = t; + } + function $s(t) { + return new Is(t); + } + function zs(t) { + return new Ns(t); + } + function js(t) { + this._context = t; + } + function Ps(t) { + var e, + i, + r = t.length - 1, + n = new Array(r), + o = new Array(r), + a = new Array(r); + for (n[0] = 0, o[0] = 2, a[0] = t[0] + 2 * t[1], e = 1; e < r - 1; ++e) (n[e] = 1), (o[e] = 4), (a[e] = 4 * t[e] + 2 * t[e + 1]); + for (n[r - 1] = 2, o[r - 1] = 7, a[r - 1] = 8 * t[r - 1] + t[r], e = 1; e < r; ++e) + (i = n[e] / o[e - 1]), (o[e] -= i), (a[e] -= i * a[e - 1]); + for (n[r - 1] = a[r - 1] / o[r - 1], e = r - 2; e >= 0; --e) n[e] = (a[e] - n[e + 1]) / o[e]; + for (o[r - 1] = (t[r] + n[r - 1]) / 2, e = 0; e < r - 1; ++e) o[e] = 2 * t[e + 1] - n[e + 1]; + return [n, o]; + } + function Rs(t) { + return new js(t); + } + function Ws(t, e) { + (this._context = t), (this._t = e); + } + function Us(t) { + return new Ws(t, 0.5); + } + function Hs(t) { + return new Ws(t, 0); + } + function Ys(t) { + return new Ws(t, 1); + } + function Vs(t, e, i) { + (this.k = t), (this.x = e), (this.y = i); + } + (Ms.prototype = { + areaStart: rs, + areaEnd: rs, + lineStart: function () { + this._point = 0; + }, + lineEnd: function () { + this._point && this._context.closePath(); + }, + point: function (t, e) { + (t = +t), (e = +e), this._point ? this._context.lineTo(t, e) : ((this._point = 1), this._context.moveTo(t, e)); + }, + }), + (Is.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + (this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN), (this._point = 0); + }, + lineEnd: function () { + switch (this._point) { + case 2: + this._context.lineTo(this._x1, this._y1); + break; + case 3: + qs(this, this._t0, Os(this, this._t0)); + } + (this._line || (0 !== this._line && 1 === this._point)) && this._context.closePath(), (this._line = 1 - this._line); + }, + point: function (t, e) { + var i = NaN; + if (((e = +e), (t = +t) !== this._x1 || e !== this._y1)) { + switch (this._point) { + case 0: + (this._point = 1), this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); + break; + case 1: + this._point = 2; + break; + case 2: + (this._point = 3), qs(this, Os(this, (i = Zs(this, t, e))), i); + break; + default: + qs(this, this._t0, (i = Zs(this, t, e))); + } + (this._x0 = this._x1), (this._x1 = t), (this._y0 = this._y1), (this._y1 = e), (this._t0 = i); + } + }, + }), + ((Ns.prototype = Object.create(Is.prototype)).point = function (t, e) { + Is.prototype.point.call(this, e, t); + }), + (Ds.prototype = { + moveTo: function (t, e) { + this._context.moveTo(e, t); + }, + closePath: function () { + this._context.closePath(); + }, + lineTo: function (t, e) { + this._context.lineTo(e, t); + }, + bezierCurveTo: function (t, e, i, r, n, o) { + this._context.bezierCurveTo(e, t, r, i, o, n); + }, + }), + (js.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + (this._x = []), (this._y = []); + }, + lineEnd: function () { + var t = this._x, + e = this._y, + i = t.length; + if (i) + if ((this._line ? this._context.lineTo(t[0], e[0]) : this._context.moveTo(t[0], e[0]), 2 === i)) this._context.lineTo(t[1], e[1]); + else + for (var r = Ps(t), n = Ps(e), o = 0, a = 1; a < i; ++o, ++a) + this._context.bezierCurveTo(r[0][o], n[0][o], r[1][o], n[1][o], t[a], e[a]); + (this._line || (0 !== this._line && 1 === i)) && this._context.closePath(), (this._line = 1 - this._line), (this._x = this._y = null); + }, + point: function (t, e) { + this._x.push(+t), this._y.push(+e); + }, + }), + (Ws.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + (this._x = this._y = NaN), (this._point = 0); + }, + lineEnd: function () { + 0 < this._t && this._t < 1 && 2 === this._point && this._context.lineTo(this._x, this._y), + (this._line || (0 !== this._line && 1 === this._point)) && this._context.closePath(), + this._line >= 0 && ((this._t = 1 - this._t), (this._line = 1 - this._line)); + }, + point: function (t, e) { + switch (((t = +t), (e = +e), this._point)) { + case 0: + (this._point = 1), this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); + break; + case 1: + this._point = 2; + default: + if (this._t <= 0) this._context.lineTo(this._x, e), this._context.lineTo(t, e); + else { + var i = this._x * (1 - this._t) + t * this._t; + this._context.lineTo(i, this._y), this._context.lineTo(i, e); + } + } + (this._x = t), (this._y = e); + }, + }), + (Vs.prototype = { + constructor: Vs, + scale: function (t) { + return 1 === t ? this : new Vs(this.k * t, this.x, this.y); + }, + translate: function (t, e) { + return (0 === t) & (0 === e) ? this : new Vs(this.k, this.x + this.k * t, this.y + this.k * e); + }, + apply: function (t) { + return [t[0] * this.k + this.x, t[1] * this.k + this.y]; + }, + applyX: function (t) { + return t * this.k + this.x; + }, + applyY: function (t) { + return t * this.k + this.y; + }, + invert: function (t) { + return [(t[0] - this.x) / this.k, (t[1] - this.y) / this.k]; + }, + invertX: function (t) { + return (t - this.x) / this.k; + }, + invertY: function (t) { + return (t - this.y) / this.k; + }, + rescaleX: function (t) { + return t.copy().domain(t.range().map(this.invertX, this).map(t.invert, t)); + }, + rescaleY: function (t) { + return t.copy().domain(t.range().map(this.invertY, this).map(t.invert, t)); + }, + toString: function () { + return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; + }, + }), + new Vs(1, 0, 0), + Vs.prototype; + }, + 4549: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return o; + }, + }); + var r = i(5971), + n = i(2142), + o = new (class { + constructor(t, e) { + (this.color = e), + (this.changed = !1), + (this.data = t), + (this.type = new (class { + constructor() { + this.type = n.w.ALL; + } + get() { + return this.type; + } + set(t) { + if (this.type && this.type !== t) throw new Error("Cannot change both RGB and HSL channels at the same time"); + this.type = t; + } + reset() { + this.type = n.w.ALL; + } + is(t) { + return this.type === t; + } + })()); + } + set(t, e) { + return (this.color = e), (this.changed = !1), (this.data = t), (this.type.type = n.w.ALL), this; + } + _ensureHSL() { + const t = this.data, + { h: e, s: i, l: n } = t; + void 0 === e && (t.h = r.Z.channel.rgb2hsl(t, "h")), + void 0 === i && (t.s = r.Z.channel.rgb2hsl(t, "s")), + void 0 === n && (t.l = r.Z.channel.rgb2hsl(t, "l")); + } + _ensureRGB() { + const t = this.data, + { r: e, g: i, b: n } = t; + void 0 === e && (t.r = r.Z.channel.hsl2rgb(t, "r")), + void 0 === i && (t.g = r.Z.channel.hsl2rgb(t, "g")), + void 0 === n && (t.b = r.Z.channel.hsl2rgb(t, "b")); + } + get r() { + const t = this.data, + e = t.r; + return this.type.is(n.w.HSL) || void 0 === e ? (this._ensureHSL(), r.Z.channel.hsl2rgb(t, "r")) : e; + } + get g() { + const t = this.data, + e = t.g; + return this.type.is(n.w.HSL) || void 0 === e ? (this._ensureHSL(), r.Z.channel.hsl2rgb(t, "g")) : e; + } + get b() { + const t = this.data, + e = t.b; + return this.type.is(n.w.HSL) || void 0 === e ? (this._ensureHSL(), r.Z.channel.hsl2rgb(t, "b")) : e; + } + get h() { + const t = this.data, + e = t.h; + return this.type.is(n.w.RGB) || void 0 === e ? (this._ensureRGB(), r.Z.channel.rgb2hsl(t, "h")) : e; + } + get s() { + const t = this.data, + e = t.s; + return this.type.is(n.w.RGB) || void 0 === e ? (this._ensureRGB(), r.Z.channel.rgb2hsl(t, "s")) : e; + } + get l() { + const t = this.data, + e = t.l; + return this.type.is(n.w.RGB) || void 0 === e ? (this._ensureRGB(), r.Z.channel.rgb2hsl(t, "l")) : e; + } + get a() { + return this.data.a; + } + set r(t) { + this.type.set(n.w.RGB), (this.changed = !0), (this.data.r = t); + } + set g(t) { + this.type.set(n.w.RGB), (this.changed = !0), (this.data.g = t); + } + set b(t) { + this.type.set(n.w.RGB), (this.changed = !0), (this.data.b = t); + } + set h(t) { + this.type.set(n.w.HSL), (this.changed = !0), (this.data.h = t); + } + set s(t) { + this.type.set(n.w.HSL), (this.changed = !0), (this.data.s = t); + } + set l(t) { + this.type.set(n.w.HSL), (this.changed = !0), (this.data.l = t); + } + set a(t) { + (this.changed = !0), (this.data.a = t); + } + })({ r: 0, g: 0, b: 0, a: 0 }, "transparent"); + }, + 1767: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return g; + }, + }); + var r = i(4549), + n = i(2142); + const o = { + re: /^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i, + parse: (t) => { + if (35 !== t.charCodeAt(0)) return; + const e = t.match(o.re); + if (!e) return; + const i = e[1], + n = parseInt(i, 16), + a = i.length, + s = a % 4 == 0, + l = a > 4, + h = l ? 1 : 17, + c = l ? 8 : 4, + u = s ? 0 : -1, + f = l ? 255 : 15; + return r.Z.set( + { + r: ((n >> (c * (u + 3))) & f) * h, + g: ((n >> (c * (u + 2))) & f) * h, + b: ((n >> (c * (u + 1))) & f) * h, + a: s ? ((n & f) * h) / 255 : 1, + }, + t, + ); + }, + stringify: (t) => { + const { r: e, g: i, b: r, a: o } = t; + return o < 1 + ? `#${n.Q[Math.round(e)]}${n.Q[Math.round(i)]}${n.Q[Math.round(r)]}${n.Q[Math.round(255 * o)]}` + : `#${n.Q[Math.round(e)]}${n.Q[Math.round(i)]}${n.Q[Math.round(r)]}`; + }, + }; + var a = o, + s = i(5971); + const l = { + re: /^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i, + hueRe: /^(.+?)(deg|grad|rad|turn)$/i, + _hue2deg: (t) => { + const e = t.match(l.hueRe); + if (e) { + const [, t, i] = e; + switch (i) { + case "grad": + return s.Z.channel.clamp.h(0.9 * parseFloat(t)); + case "rad": + return s.Z.channel.clamp.h((180 * parseFloat(t)) / Math.PI); + case "turn": + return s.Z.channel.clamp.h(360 * parseFloat(t)); + } + } + return s.Z.channel.clamp.h(parseFloat(t)); + }, + parse: (t) => { + const e = t.charCodeAt(0); + if (104 !== e && 72 !== e) return; + const i = t.match(l.re); + if (!i) return; + const [, n, o, a, h, c] = i; + return r.Z.set( + { + h: l._hue2deg(n), + s: s.Z.channel.clamp.s(parseFloat(o)), + l: s.Z.channel.clamp.l(parseFloat(a)), + a: h ? s.Z.channel.clamp.a(c ? parseFloat(h) / 100 : parseFloat(h)) : 1, + }, + t, + ); + }, + stringify: (t) => { + const { h: e, s: i, l: r, a: n } = t; + return n < 1 + ? `hsla(${s.Z.lang.round(e)}, ${s.Z.lang.round(i)}%, ${s.Z.lang.round(r)}%, ${n})` + : `hsl(${s.Z.lang.round(e)}, ${s.Z.lang.round(i)}%, ${s.Z.lang.round(r)}%)`; + }, + }; + var h = l; + const c = { + colors: { + aliceblue: "#f0f8ff", + antiquewhite: "#faebd7", + aqua: "#00ffff", + aquamarine: "#7fffd4", + azure: "#f0ffff", + beige: "#f5f5dc", + bisque: "#ffe4c4", + black: "#000000", + blanchedalmond: "#ffebcd", + blue: "#0000ff", + blueviolet: "#8a2be2", + brown: "#a52a2a", + burlywood: "#deb887", + cadetblue: "#5f9ea0", + chartreuse: "#7fff00", + chocolate: "#d2691e", + coral: "#ff7f50", + cornflowerblue: "#6495ed", + cornsilk: "#fff8dc", + crimson: "#dc143c", + cyanaqua: "#00ffff", + darkblue: "#00008b", + darkcyan: "#008b8b", + darkgoldenrod: "#b8860b", + darkgray: "#a9a9a9", + darkgreen: "#006400", + darkgrey: "#a9a9a9", + darkkhaki: "#bdb76b", + darkmagenta: "#8b008b", + darkolivegreen: "#556b2f", + darkorange: "#ff8c00", + darkorchid: "#9932cc", + darkred: "#8b0000", + darksalmon: "#e9967a", + darkseagreen: "#8fbc8f", + darkslateblue: "#483d8b", + darkslategray: "#2f4f4f", + darkslategrey: "#2f4f4f", + darkturquoise: "#00ced1", + darkviolet: "#9400d3", + deeppink: "#ff1493", + deepskyblue: "#00bfff", + dimgray: "#696969", + dimgrey: "#696969", + dodgerblue: "#1e90ff", + firebrick: "#b22222", + floralwhite: "#fffaf0", + forestgreen: "#228b22", + fuchsia: "#ff00ff", + gainsboro: "#dcdcdc", + ghostwhite: "#f8f8ff", + gold: "#ffd700", + goldenrod: "#daa520", + gray: "#808080", + green: "#008000", + greenyellow: "#adff2f", + grey: "#808080", + honeydew: "#f0fff0", + hotpink: "#ff69b4", + indianred: "#cd5c5c", + indigo: "#4b0082", + ivory: "#fffff0", + khaki: "#f0e68c", + lavender: "#e6e6fa", + lavenderblush: "#fff0f5", + lawngreen: "#7cfc00", + lemonchiffon: "#fffacd", + lightblue: "#add8e6", + lightcoral: "#f08080", + lightcyan: "#e0ffff", + lightgoldenrodyellow: "#fafad2", + lightgray: "#d3d3d3", + lightgreen: "#90ee90", + lightgrey: "#d3d3d3", + lightpink: "#ffb6c1", + lightsalmon: "#ffa07a", + lightseagreen: "#20b2aa", + lightskyblue: "#87cefa", + lightslategray: "#778899", + lightslategrey: "#778899", + lightsteelblue: "#b0c4de", + lightyellow: "#ffffe0", + lime: "#00ff00", + limegreen: "#32cd32", + linen: "#faf0e6", + magenta: "#ff00ff", + maroon: "#800000", + mediumaquamarine: "#66cdaa", + mediumblue: "#0000cd", + mediumorchid: "#ba55d3", + mediumpurple: "#9370db", + mediumseagreen: "#3cb371", + mediumslateblue: "#7b68ee", + mediumspringgreen: "#00fa9a", + mediumturquoise: "#48d1cc", + mediumvioletred: "#c71585", + midnightblue: "#191970", + mintcream: "#f5fffa", + mistyrose: "#ffe4e1", + moccasin: "#ffe4b5", + navajowhite: "#ffdead", + navy: "#000080", + oldlace: "#fdf5e6", + olive: "#808000", + olivedrab: "#6b8e23", + orange: "#ffa500", + orangered: "#ff4500", + orchid: "#da70d6", + palegoldenrod: "#eee8aa", + palegreen: "#98fb98", + paleturquoise: "#afeeee", + palevioletred: "#db7093", + papayawhip: "#ffefd5", + peachpuff: "#ffdab9", + peru: "#cd853f", + pink: "#ffc0cb", + plum: "#dda0dd", + powderblue: "#b0e0e6", + purple: "#800080", + rebeccapurple: "#663399", + red: "#ff0000", + rosybrown: "#bc8f8f", + royalblue: "#4169e1", + saddlebrown: "#8b4513", + salmon: "#fa8072", + sandybrown: "#f4a460", + seagreen: "#2e8b57", + seashell: "#fff5ee", + sienna: "#a0522d", + silver: "#c0c0c0", + skyblue: "#87ceeb", + slateblue: "#6a5acd", + slategray: "#708090", + slategrey: "#708090", + snow: "#fffafa", + springgreen: "#00ff7f", + tan: "#d2b48c", + teal: "#008080", + thistle: "#d8bfd8", + transparent: "#00000000", + turquoise: "#40e0d0", + violet: "#ee82ee", + wheat: "#f5deb3", + white: "#ffffff", + whitesmoke: "#f5f5f5", + yellow: "#ffff00", + yellowgreen: "#9acd32", + }, + parse: (t) => { + t = t.toLowerCase(); + const e = c.colors[t]; + if (e) return a.parse(e); + }, + stringify: (t) => { + const e = a.stringify(t); + for (const t in c.colors) if (c.colors[t] === e) return t; + }, + }; + var u = c; + const f = { + re: /^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i, + parse: (t) => { + const e = t.charCodeAt(0); + if (114 !== e && 82 !== e) return; + const i = t.match(f.re); + if (!i) return; + const [, n, o, a, l, h, c, u, d] = i; + return r.Z.set( + { + r: s.Z.channel.clamp.r(o ? 2.55 * parseFloat(n) : parseFloat(n)), + g: s.Z.channel.clamp.g(l ? 2.55 * parseFloat(a) : parseFloat(a)), + b: s.Z.channel.clamp.b(c ? 2.55 * parseFloat(h) : parseFloat(h)), + a: u ? s.Z.channel.clamp.a(d ? parseFloat(u) / 100 : parseFloat(u)) : 1, + }, + t, + ); + }, + stringify: (t) => { + const { r: e, g: i, b: r, a: n } = t; + return n < 1 + ? `rgba(${s.Z.lang.round(e)}, ${s.Z.lang.round(i)}, ${s.Z.lang.round(r)}, ${s.Z.lang.round(n)})` + : `rgb(${s.Z.lang.round(e)}, ${s.Z.lang.round(i)}, ${s.Z.lang.round(r)})`; + }, + }; + var d = f; + const p = { + format: { keyword: c, hex: a, rgb: f, rgba: f, hsl: l, hsla: l }, + parse: (t) => { + if ("string" != typeof t) return t; + const e = a.parse(t) || d.parse(t) || h.parse(t) || u.parse(t); + if (e) return e; + throw new Error(`Unsupported color format: "${t}"`); + }, + stringify: (t) => + !t.changed && t.color + ? t.color + : t.type.is(n.w.HSL) || void 0 === t.data.r + ? h.stringify(t) + : t.a < 1 || !Number.isInteger(t.r) || !Number.isInteger(t.g) || !Number.isInteger(t.b) + ? d.stringify(t) + : a.stringify(t), + }; + var g = p; + }, + 2142: function (t, e, i) { + "use strict"; + i.d(e, { + Q: function () { + return n; + }, + w: function () { + return o; + }, + }); + var r = i(5971); + const n = {}; + for (let t = 0; t <= 255; t++) n[t] = r.Z.unit.dec2hex(t); + const o = { ALL: 0, RGB: 1, HSL: 2 }; + }, + 6174: function (t, e, i) { + "use strict"; + var r = i(5971), + n = i(1767); + e.Z = (t, e, i) => { + const o = n.Z.parse(t), + a = o[e], + s = r.Z.channel.clamp[e](a + i); + return a !== s && (o[e] = s), n.Z.stringify(o); + }; + }, + 3438: function (t, e, i) { + "use strict"; + var r = i(5971), + n = i(1767); + e.Z = (t, e) => { + const i = n.Z.parse(t); + for (const t in e) i[t] = r.Z.channel.clamp[t](e[t]); + return n.Z.stringify(i); + }; + }, + 7201: function (t, e, i) { + "use strict"; + var r = i(6174); + e.Z = (t, e) => (0, r.Z)(t, "l", -e); + }, + 6500: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return a; + }, + }); + var r = i(5971), + n = i(1767), + o = (t) => + ((t) => { + const { r: e, g: i, b: o } = n.Z.parse(t), + a = 0.2126 * r.Z.channel.toLinear(e) + 0.7152 * r.Z.channel.toLinear(i) + 0.0722 * r.Z.channel.toLinear(o); + return r.Z.lang.round(a); + })(t) >= 0.5, + a = (t) => !o(t); + }, + 2281: function (t, e, i) { + "use strict"; + var r = i(6174); + e.Z = (t, e) => (0, r.Z)(t, "l", e); + }, + 1117: function (t, e, i) { + "use strict"; + var r = i(5971), + n = i(4549), + o = i(1767), + a = i(3438); + e.Z = (t, e, i = 0, s = 1) => { + if ("number" != typeof t) return (0, a.Z)(t, { a: e }); + const l = n.Z.set({ + r: r.Z.channel.clamp.r(t), + g: r.Z.channel.clamp.g(e), + b: r.Z.channel.clamp.b(i), + a: r.Z.channel.clamp.a(s), + }); + return o.Z.stringify(l); + }; + }, + 5971: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return n; + }, + }); + const r = { + min: { r: 0, g: 0, b: 0, s: 0, l: 0, a: 0 }, + max: { r: 255, g: 255, b: 255, h: 360, s: 100, l: 100, a: 1 }, + clamp: { + r: (t) => (t >= 255 ? 255 : t < 0 ? 0 : t), + g: (t) => (t >= 255 ? 255 : t < 0 ? 0 : t), + b: (t) => (t >= 255 ? 255 : t < 0 ? 0 : t), + h: (t) => t % 360, + s: (t) => (t >= 100 ? 100 : t < 0 ? 0 : t), + l: (t) => (t >= 100 ? 100 : t < 0 ? 0 : t), + a: (t) => (t >= 1 ? 1 : t < 0 ? 0 : t), + }, + toLinear: (t) => { + const e = t / 255; + return t > 0.03928 ? Math.pow((e + 0.055) / 1.055, 2.4) : e / 12.92; + }, + hue2rgb: (t, e, i) => ( + i < 0 && (i += 1), i > 1 && (i -= 1), i < 1 / 6 ? t + 6 * (e - t) * i : i < 0.5 ? e : i < 2 / 3 ? t + (e - t) * (2 / 3 - i) * 6 : t + ), + hsl2rgb: ({ h: t, s: e, l: i }, n) => { + if (!e) return 2.55 * i; + (t /= 360), (e /= 100); + const o = (i /= 100) < 0.5 ? i * (1 + e) : i + e - i * e, + a = 2 * i - o; + switch (n) { + case "r": + return 255 * r.hue2rgb(a, o, t + 1 / 3); + case "g": + return 255 * r.hue2rgb(a, o, t); + case "b": + return 255 * r.hue2rgb(a, o, t - 1 / 3); + } + }, + rgb2hsl: ({ r: t, g: e, b: i }, r) => { + (t /= 255), (e /= 255), (i /= 255); + const n = Math.max(t, e, i), + o = Math.min(t, e, i), + a = (n + o) / 2; + if ("l" === r) return 100 * a; + if (n === o) return 0; + const s = n - o; + if ("s" === r) return 100 * (a > 0.5 ? s / (2 - n - o) : s / (n + o)); + switch (n) { + case t: + return 60 * ((e - i) / s + (e < i ? 6 : 0)); + case e: + return 60 * ((i - t) / s + 2); + case i: + return 60 * ((t - e) / s + 4); + default: + return -1; + } + }, + }; + var n = { + channel: r, + lang: { + clamp: (t, e, i) => (e > i ? Math.min(e, Math.max(i, t)) : Math.min(i, Math.max(e, t))), + round: (t) => Math.round(1e10 * t) / 1e10, + }, + unit: { + dec2hex: (t) => { + const e = Math.round(t).toString(16); + return e.length > 1 ? e : `0${e}`; + }, + }, + }; + }, + 2536: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return s; + }, + }); + var r = i(9651), + n = function (t, e) { + for (var i = t.length; i--; ) if ((0, r.Z)(t[i][0], e)) return i; + return -1; + }, + o = Array.prototype.splice; + function a(t) { + var e = -1, + i = null == t ? 0 : t.length; + for (this.clear(); ++e < i; ) { + var r = t[e]; + this.set(r[0], r[1]); + } + } + (a.prototype.clear = function () { + (this.__data__ = []), (this.size = 0); + }), + (a.prototype.delete = function (t) { + var e = this.__data__, + i = n(e, t); + return !(i < 0 || (i == e.length - 1 ? e.pop() : o.call(e, i, 1), --this.size, 0)); + }), + (a.prototype.get = function (t) { + var e = this.__data__, + i = n(e, t); + return i < 0 ? void 0 : e[i][1]; + }), + (a.prototype.has = function (t) { + return n(this.__data__, t) > -1; + }), + (a.prototype.set = function (t, e) { + var i = this.__data__, + r = n(i, t); + return r < 0 ? (++this.size, i.push([t, e])) : (i[r][1] = e), this; + }); + var s = a; + }, + 6183: function (t, e, i) { + "use strict"; + var r = i(2119), + n = i(6092), + o = (0, r.Z)(n.Z, "Map"); + e.Z = o; + }, + 520: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return f; + }, + }); + var r = (0, i(2119).Z)(Object, "create"), + n = Object.prototype.hasOwnProperty, + o = Object.prototype.hasOwnProperty; + function a(t) { + var e = -1, + i = null == t ? 0 : t.length; + for (this.clear(); ++e < i; ) { + var r = t[e]; + this.set(r[0], r[1]); + } + } + (a.prototype.clear = function () { + (this.__data__ = r ? r(null) : {}), (this.size = 0); + }), + (a.prototype.delete = function (t) { + var e = this.has(t) && delete this.__data__[t]; + return (this.size -= e ? 1 : 0), e; + }), + (a.prototype.get = function (t) { + var e = this.__data__; + if (r) { + var i = e[t]; + return "__lodash_hash_undefined__" === i ? void 0 : i; + } + return n.call(e, t) ? e[t] : void 0; + }), + (a.prototype.has = function (t) { + var e = this.__data__; + return r ? void 0 !== e[t] : o.call(e, t); + }), + (a.prototype.set = function (t, e) { + var i = this.__data__; + return (this.size += this.has(t) ? 0 : 1), (i[t] = r && void 0 === e ? "__lodash_hash_undefined__" : e), this; + }); + var s = a, + l = i(2536), + h = i(6183), + c = function (t, e) { + var i, + r, + n = t.__data__; + return ("string" == (r = typeof (i = e)) || "number" == r || "symbol" == r || "boolean" == r ? "__proto__" !== i : null === i) + ? n["string" == typeof e ? "string" : "hash"] + : n.map; + }; + function u(t) { + var e = -1, + i = null == t ? 0 : t.length; + for (this.clear(); ++e < i; ) { + var r = t[e]; + this.set(r[0], r[1]); + } + } + (u.prototype.clear = function () { + (this.size = 0), (this.__data__ = { hash: new s(), map: new (h.Z || l.Z)(), string: new s() }); + }), + (u.prototype.delete = function (t) { + var e = c(this, t).delete(t); + return (this.size -= e ? 1 : 0), e; + }), + (u.prototype.get = function (t) { + return c(this, t).get(t); + }), + (u.prototype.has = function (t) { + return c(this, t).has(t); + }), + (u.prototype.set = function (t, e) { + var i = c(this, t), + r = i.size; + return i.set(t, e), (this.size += i.size == r ? 0 : 1), this; + }); + var f = u; + }, + 3203: function (t, e, i) { + "use strict"; + var r = i(2119), + n = i(6092), + o = (0, r.Z)(n.Z, "Set"); + e.Z = o; + }, + 5365: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return s; + }, + }); + var r = i(2536), + n = i(6183), + o = i(520); + function a(t) { + var e = (this.__data__ = new r.Z(t)); + this.size = e.size; + } + (a.prototype.clear = function () { + (this.__data__ = new r.Z()), (this.size = 0); + }), + (a.prototype.delete = function (t) { + var e = this.__data__, + i = e.delete(t); + return (this.size = e.size), i; + }), + (a.prototype.get = function (t) { + return this.__data__.get(t); + }), + (a.prototype.has = function (t) { + return this.__data__.has(t); + }), + (a.prototype.set = function (t, e) { + var i = this.__data__; + if (i instanceof r.Z) { + var a = i.__data__; + if (!n.Z || a.length < 199) return a.push([t, e]), (this.size = ++i.size), this; + i = this.__data__ = new o.Z(a); + } + return i.set(t, e), (this.size = i.size), this; + }); + var s = a; + }, + 7685: function (t, e, i) { + "use strict"; + var r = i(6092).Z.Symbol; + e.Z = r; + }, + 4073: function (t, e, i) { + "use strict"; + var r = i(6092).Z.Uint8Array; + e.Z = r; + }, + 9001: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return h; + }, + }); + var r = i(4732), + n = i(7771), + o = i(6706), + a = i(6009), + s = i(7212), + l = Object.prototype.hasOwnProperty, + h = function (t, e) { + var i = (0, n.Z)(t), + h = !i && (0, r.Z)(t), + c = !i && !h && (0, o.Z)(t), + u = !i && !h && !c && (0, s.Z)(t), + f = i || h || c || u, + d = f + ? (function (t, e) { + for (var i = -1, r = Array(t); ++i < t; ) r[i] = e(i); + return r; + })(t.length, String) + : [], + p = d.length; + for (var g in t) + (!e && !l.call(t, g)) || + (f && + ("length" == g || + (c && ("offset" == g || "parent" == g)) || + (u && ("buffer" == g || "byteLength" == g || "byteOffset" == g)) || + (0, a.Z)(g, p))) || + d.push(g); + return d; + }; + }, + 2954: function (t, e, i) { + "use strict"; + var r = i(4752), + n = i(9651), + o = Object.prototype.hasOwnProperty; + e.Z = function (t, e, i) { + var a = t[e]; + (o.call(t, e) && (0, n.Z)(a, i) && (void 0 !== i || e in t)) || (0, r.Z)(t, e, i); + }; + }, + 4752: function (t, e, i) { + "use strict"; + var r = i(7904); + e.Z = function (t, e, i) { + "__proto__" == e && r.Z ? (0, r.Z)(t, e, { configurable: !0, enumerable: !0, value: i, writable: !0 }) : (t[e] = i); + }; + }, + 5381: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return r; + }, + }); + var r = function (t, e, i) { + for (var r = -1, n = Object(t), o = i(t), a = o.length; a--; ) { + var s = o[++r]; + if (!1 === e(n[s], s, n)) break; + } + return t; + }; + }, + 1922: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return c; + }, + }); + var r = i(7685), + n = Object.prototype, + o = n.hasOwnProperty, + a = n.toString, + s = r.Z ? r.Z.toStringTag : void 0, + l = Object.prototype.toString, + h = r.Z ? r.Z.toStringTag : void 0, + c = function (t) { + return null == t + ? void 0 === t + ? "[object Undefined]" + : "[object Null]" + : h && h in Object(t) + ? (function (t) { + var e = o.call(t, s), + i = t[s]; + try { + t[s] = void 0; + var r = !0; + } catch (t) {} + var n = a.call(t); + return r && (e ? (t[s] = i) : delete t[s]), n; + })(t) + : (function (t) { + return l.call(t); + })(t); + }; + }, + 8448: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return a; + }, + }); + var r = i(2764), + n = (0, i(1851).Z)(Object.keys, Object), + o = Object.prototype.hasOwnProperty, + a = function (t) { + if (!(0, r.Z)(t)) return n(t); + var e = []; + for (var i in Object(t)) o.call(t, i) && "constructor" != i && e.push(i); + return e; + }; + }, + 9581: function (t, e, i) { + "use strict"; + var r = i(9203), + n = i(3948), + o = i(3626); + e.Z = function (t, e) { + return (0, o.Z)((0, n.Z)(t, e, r.Z), t + ""); + }; + }, + 1162: function (t, e) { + "use strict"; + e.Z = function (t) { + return function (e) { + return t(e); + }; + }; + }, + 1884: function (t, e, i) { + "use strict"; + var r = i(4073); + e.Z = function (t) { + var e = new t.constructor(t.byteLength); + return new r.Z(e).set(new r.Z(t)), e; + }; + }, + 1050: function (t, e, i) { + "use strict"; + var r = i(6092), + n = "object" == typeof exports && exports && !exports.nodeType && exports, + o = n && "object" == typeof module && module && !module.nodeType && module, + a = o && o.exports === n ? r.Z.Buffer : void 0, + s = a ? a.allocUnsafe : void 0; + e.Z = function (t, e) { + if (e) return t.slice(); + var i = t.length, + r = s ? s(i) : new t.constructor(i); + return t.copy(r), r; + }; + }, + 2701: function (t, e, i) { + "use strict"; + var r = i(1884); + e.Z = function (t, e) { + var i = e ? (0, r.Z)(t.buffer) : t.buffer; + return new t.constructor(i, t.byteOffset, t.length); + }; + }, + 7215: function (t, e) { + "use strict"; + e.Z = function (t, e) { + var i = -1, + r = t.length; + for (e || (e = Array(r)); ++i < r; ) e[i] = t[i]; + return e; + }; + }, + 1899: function (t, e, i) { + "use strict"; + var r = i(2954), + n = i(4752); + e.Z = function (t, e, i, o) { + var a = !i; + i || (i = {}); + for (var s = -1, l = e.length; ++s < l; ) { + var h = e[s], + c = o ? o(i[h], t[h], h, i, t) : void 0; + void 0 === c && (c = t[h]), a ? (0, n.Z)(i, h, c) : (0, r.Z)(i, h, c); + } + return i; + }; + }, + 7904: function (t, e, i) { + "use strict"; + var r = i(2119), + n = (function () { + try { + var t = (0, r.Z)(Object, "defineProperty"); + return t({}, "", {}), t; + } catch (t) {} + })(); + e.Z = n; + }, + 3413: function (t, e) { + "use strict"; + var i = "object" == typeof global && global && global.Object === Object && global; + e.Z = i; + }, + 2119: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return m; + }, + }); + var r, + n = i(3234), + o = i(6092).Z["__core-js_shared__"], + a = (r = /[^.]+$/.exec((o && o.keys && o.keys.IE_PROTO) || "")) ? "Symbol(src)_1." + r : "", + s = i(7226), + l = i(19), + h = /^\[object .+?Constructor\]$/, + c = Function.prototype, + u = Object.prototype, + f = c.toString, + d = u.hasOwnProperty, + p = RegExp( + "^" + + f + .call(d) + .replace(/[\\^$.*+?()[\]{}|]/g, "\\$&") + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + + "$", + ), + g = function (t) { + return !(!(0, s.Z)(t) || ((e = t), a && a in e)) && ((0, n.Z)(t) ? p : h).test((0, l.Z)(t)); + var e; + }, + m = function (t, e) { + var i = (function (t, e) { + return null == t ? void 0 : t[e]; + })(t, e); + return g(i) ? i : void 0; + }; + }, + 2513: function (t, e, i) { + "use strict"; + var r = (0, i(1851).Z)(Object.getPrototypeOf, Object); + e.Z = r; + }, + 6155: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return k; + }, + }); + var r = i(2119), + n = i(6092), + o = (0, r.Z)(n.Z, "DataView"), + a = i(6183), + s = (0, r.Z)(n.Z, "Promise"), + l = i(3203), + h = (0, r.Z)(n.Z, "WeakMap"), + c = i(1922), + u = i(19), + f = "[object Map]", + d = "[object Promise]", + p = "[object Set]", + g = "[object WeakMap]", + m = "[object DataView]", + y = (0, u.Z)(o), + _ = (0, u.Z)(a.Z), + b = (0, u.Z)(s), + C = (0, u.Z)(l.Z), + x = (0, u.Z)(h), + v = c.Z; + ((o && v(new o(new ArrayBuffer(1))) != m) || + (a.Z && v(new a.Z()) != f) || + (s && v(s.resolve()) != d) || + (l.Z && v(new l.Z()) != p) || + (h && v(new h()) != g)) && + (v = function (t) { + var e = (0, c.Z)(t), + i = "[object Object]" == e ? t.constructor : void 0, + r = i ? (0, u.Z)(i) : ""; + if (r) + switch (r) { + case y: + return m; + case _: + return f; + case b: + return d; + case C: + return p; + case x: + return g; + } + return e; + }); + var k = v; + }, + 5418: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return l; + }, + }); + var r = i(7226), + n = Object.create, + o = (function () { + function t() {} + return function (e) { + if (!(0, r.Z)(e)) return {}; + if (n) return n(e); + t.prototype = e; + var i = new t(); + return (t.prototype = void 0), i; + }; + })(), + a = i(2513), + s = i(2764), + l = function (t) { + return "function" != typeof t.constructor || (0, s.Z)(t) ? {} : o((0, a.Z)(t)); + }; + }, + 6009: function (t, e) { + "use strict"; + var i = /^(?:0|[1-9]\d*)$/; + e.Z = function (t, e) { + var r = typeof t; + return !!(e = null == e ? 9007199254740991 : e) && ("number" == r || ("symbol" != r && i.test(t))) && t > -1 && t % 1 == 0 && t < e; + }; + }, + 439: function (t, e, i) { + "use strict"; + var r = i(9651), + n = i(585), + o = i(6009), + a = i(7226); + e.Z = function (t, e, i) { + if (!(0, a.Z)(i)) return !1; + var s = typeof e; + return !!("number" == s ? (0, n.Z)(i) && (0, o.Z)(e, i.length) : "string" == s && e in i) && (0, r.Z)(i[e], t); + }; + }, + 2764: function (t, e) { + "use strict"; + var i = Object.prototype; + e.Z = function (t) { + var e = t && t.constructor; + return t === (("function" == typeof e && e.prototype) || i); + }; + }, + 4254: function (t, e, i) { + "use strict"; + var r = i(3413), + n = "object" == typeof exports && exports && !exports.nodeType && exports, + o = n && "object" == typeof module && module && !module.nodeType && module, + a = o && o.exports === n && r.Z.process, + s = (function () { + try { + return (o && o.require && o.require("util").types) || (a && a.binding && a.binding("util")); + } catch (t) {} + })(); + e.Z = s; + }, + 1851: function (t, e) { + "use strict"; + e.Z = function (t, e) { + return function (i) { + return t(e(i)); + }; + }; + }, + 3948: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return n; + }, + }); + var r = Math.max, + n = function (t, e, i) { + return ( + (e = r(void 0 === e ? t.length - 1 : e, 0)), + function () { + for (var n = arguments, o = -1, a = r(n.length - e, 0), s = Array(a); ++o < a; ) s[o] = n[e + o]; + o = -1; + for (var l = Array(e + 1); ++o < e; ) l[o] = n[o]; + return ( + (l[e] = i(s)), + (function (t, e, i) { + switch (i.length) { + case 0: + return t.call(e); + case 1: + return t.call(e, i[0]); + case 2: + return t.call(e, i[0], i[1]); + case 3: + return t.call(e, i[0], i[1], i[2]); + } + return t.apply(e, i); + })(t, this, l) + ); + } + ); + }; + }, + 6092: function (t, e, i) { + "use strict"; + var r = i(3413), + n = "object" == typeof self && self && self.Object === Object && self, + o = r.Z || n || Function("return this")(); + e.Z = o; + }, + 3626: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return u; + }, + }); + var r, + n, + o, + a = i(2002), + s = i(7904), + l = i(9203), + h = s.Z + ? function (t, e) { + return (0, s.Z)(t, "toString", { + configurable: !0, + enumerable: !1, + value: (0, a.Z)(e), + writable: !0, + }); + } + : l.Z, + c = Date.now, + u = + ((r = h), + (n = 0), + (o = 0), + function () { + var t = c(), + e = 16 - (t - o); + if (((o = t), e > 0)) { + if (++n >= 800) return arguments[0]; + } else n = 0; + return r.apply(void 0, arguments); + }); + }, + 19: function (t, e) { + "use strict"; + var i = Function.prototype.toString; + e.Z = function (t) { + if (null != t) { + try { + return i.call(t); + } catch (t) {} + try { + return t + ""; + } catch (t) {} + } + return ""; + }; + }, + 2002: function (t, e) { + "use strict"; + e.Z = function (t) { + return function () { + return t; + }; + }; + }, + 9651: function (t, e) { + "use strict"; + e.Z = function (t, e) { + return t === e || (t != t && e != e); + }; + }, + 9203: function (t, e) { + "use strict"; + e.Z = function (t) { + return t; + }; + }, + 4732: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return c; + }, + }); + var r = i(1922), + n = i(8533), + o = function (t) { + return (0, n.Z)(t) && "[object Arguments]" == (0, r.Z)(t); + }, + a = Object.prototype, + s = a.hasOwnProperty, + l = a.propertyIsEnumerable, + h = o( + (function () { + return arguments; + })(), + ) + ? o + : function (t) { + return (0, n.Z)(t) && s.call(t, "callee") && !l.call(t, "callee"); + }, + c = h; + }, + 7771: function (t, e) { + "use strict"; + var i = Array.isArray; + e.Z = i; + }, + 585: function (t, e, i) { + "use strict"; + var r = i(3234), + n = i(1656); + e.Z = function (t) { + return null != t && (0, n.Z)(t.length) && !(0, r.Z)(t); + }; + }, + 836: function (t, e, i) { + "use strict"; + var r = i(585), + n = i(8533); + e.Z = function (t) { + return (0, n.Z)(t) && (0, r.Z)(t); + }; + }, + 6706: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return s; + }, + }); + var r = i(6092), + n = "object" == typeof exports && exports && !exports.nodeType && exports, + o = n && "object" == typeof module && module && !module.nodeType && module, + a = o && o.exports === n ? r.Z.Buffer : void 0, + s = + (a ? a.isBuffer : void 0) || + function () { + return !1; + }; + }, + 9697: function (t, e, i) { + "use strict"; + var r = i(8448), + n = i(6155), + o = i(4732), + a = i(7771), + s = i(585), + l = i(6706), + h = i(2764), + c = i(7212), + u = Object.prototype.hasOwnProperty; + e.Z = function (t) { + if (null == t) return !0; + if ((0, s.Z)(t) && ((0, a.Z)(t) || "string" == typeof t || "function" == typeof t.splice || (0, l.Z)(t) || (0, c.Z)(t) || (0, o.Z)(t))) + return !t.length; + var e = (0, n.Z)(t); + if ("[object Map]" == e || "[object Set]" == e) return !t.size; + if ((0, h.Z)(t)) return !(0, r.Z)(t).length; + for (var i in t) if (u.call(t, i)) return !1; + return !0; + }; + }, + 3234: function (t, e, i) { + "use strict"; + var r = i(1922), + n = i(7226); + e.Z = function (t) { + if (!(0, n.Z)(t)) return !1; + var e = (0, r.Z)(t); + return "[object Function]" == e || "[object GeneratorFunction]" == e || "[object AsyncFunction]" == e || "[object Proxy]" == e; + }; + }, + 1656: function (t, e) { + "use strict"; + e.Z = function (t) { + return "number" == typeof t && t > -1 && t % 1 == 0 && t <= 9007199254740991; + }; + }, + 7226: function (t, e) { + "use strict"; + e.Z = function (t) { + var e = typeof t; + return null != t && ("object" == e || "function" == e); + }; + }, + 8533: function (t, e) { + "use strict"; + e.Z = function (t) { + return null != t && "object" == typeof t; + }; + }, + 7514: function (t, e, i) { + "use strict"; + var r = i(1922), + n = i(2513), + o = i(8533), + a = Function.prototype, + s = Object.prototype, + l = a.toString, + h = s.hasOwnProperty, + c = l.call(Object); + e.Z = function (t) { + if (!(0, o.Z)(t) || "[object Object]" != (0, r.Z)(t)) return !1; + var e = (0, n.Z)(t); + if (null === e) return !0; + var i = h.call(e, "constructor") && e.constructor; + return "function" == typeof i && i instanceof i && l.call(i) == c; + }; + }, + 7212: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return c; + }, + }); + var r = i(1922), + n = i(1656), + o = i(8533), + a = {}; + (a["[object Float32Array]"] = + a["[object Float64Array]"] = + a["[object Int8Array]"] = + a["[object Int16Array]"] = + a["[object Int32Array]"] = + a["[object Uint8Array]"] = + a["[object Uint8ClampedArray]"] = + a["[object Uint16Array]"] = + a["[object Uint32Array]"] = + !0), + (a["[object Arguments]"] = + a["[object Array]"] = + a["[object ArrayBuffer]"] = + a["[object Boolean]"] = + a["[object DataView]"] = + a["[object Date]"] = + a["[object Error]"] = + a["[object Function]"] = + a["[object Map]"] = + a["[object Number]"] = + a["[object Object]"] = + a["[object RegExp]"] = + a["[object Set]"] = + a["[object String]"] = + a["[object WeakMap]"] = + !1); + var s = i(1162), + l = i(4254), + h = l.Z && l.Z.isTypedArray, + c = h + ? (0, s.Z)(h) + : function (t) { + return (0, o.Z)(t) && (0, n.Z)(t.length) && !!a[(0, r.Z)(t)]; + }; + }, + 7590: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return h; + }, + }); + var r = i(9001), + n = i(7226), + o = i(2764), + a = Object.prototype.hasOwnProperty, + s = function (t) { + if (!(0, n.Z)(t)) + return (function (t) { + var e = []; + if (null != t) for (var i in Object(t)) e.push(i); + return e; + })(t); + var e = (0, o.Z)(t), + i = []; + for (var r in t) ("constructor" != r || (!e && a.call(t, r))) && i.push(r); + return i; + }, + l = i(585), + h = function (t) { + return (0, l.Z)(t) ? (0, r.Z)(t, !0) : s(t); + }; + }, + 2454: function (t, e, i) { + "use strict"; + var r = i(520); + function n(t, e) { + if ("function" != typeof t || (null != e && "function" != typeof e)) throw new TypeError("Expected a function"); + var i = function () { + var r = arguments, + n = e ? e.apply(this, r) : r[0], + o = i.cache; + if (o.has(n)) return o.get(n); + var a = t.apply(this, r); + return (i.cache = o.set(n, a) || o), a; + }; + return (i.cache = new (n.Cache || r.Z)()), i; + } + (n.Cache = r.Z), (e.Z = n); + }, + 6841: function (t, e, i) { + "use strict"; + i.d(e, { + Z: function () { + return F; + }, + }); + var r, + n = i(5365), + o = i(4752), + a = i(9651), + s = function (t, e, i) { + ((void 0 !== i && !(0, a.Z)(t[e], i)) || (void 0 === i && !(e in t))) && (0, o.Z)(t, e, i); + }, + l = i(5381), + h = i(1050), + c = i(2701), + u = i(7215), + f = i(5418), + d = i(4732), + p = i(7771), + g = i(836), + m = i(6706), + y = i(3234), + _ = i(7226), + b = i(7514), + C = i(7212), + x = function (t, e) { + if (("constructor" !== e || "function" != typeof t[e]) && "__proto__" != e) return t[e]; + }, + v = i(1899), + k = i(7590), + T = function (t, e, i, r, n, o, a) { + var l, + T = x(t, i), + w = x(e, i), + S = a.get(w); + if (S) s(t, i, S); + else { + var B = o ? o(T, w, i + "", t, e, a) : void 0, + F = void 0 === B; + if (F) { + var L = (0, p.Z)(w), + M = !L && (0, m.Z)(w), + A = !L && !M && (0, C.Z)(w); + (B = w), + L || M || A + ? (0, p.Z)(T) + ? (B = T) + : (0, g.Z)(T) + ? (B = (0, u.Z)(T)) + : M + ? ((F = !1), (B = (0, h.Z)(w, !0))) + : A + ? ((F = !1), (B = (0, c.Z)(w, !0))) + : (B = []) + : (0, b.Z)(w) || (0, d.Z)(w) + ? ((B = T), (0, d.Z)(T) ? ((l = T), (B = (0, v.Z)(l, (0, k.Z)(l)))) : ((0, _.Z)(T) && !(0, y.Z)(T)) || (B = (0, f.Z)(w))) + : (F = !1); + } + F && (a.set(w, B), n(B, w, r, o, a), a.delete(w)), s(t, i, B); + } + }, + w = function t(e, i, r, o, a) { + e !== i && + (0, l.Z)( + i, + function (l, h) { + if ((a || (a = new n.Z()), (0, _.Z)(l))) T(e, i, h, r, t, o, a); + else { + var c = o ? o(x(e, h), l, h + "", e, i, a) : void 0; + void 0 === c && (c = l), s(e, h, c); + } + }, + k.Z, + ); + }, + S = i(9581), + B = i(439), + F = + ((r = function (t, e, i) { + w(t, e, i); + }), + (0, S.Z)(function (t, e) { + var i = -1, + n = e.length, + o = n > 1 ? e[n - 1] : void 0, + a = n > 2 ? e[2] : void 0; + for ( + o = r.length > 3 && "function" == typeof o ? (n--, o) : void 0, + a && (0, B.Z)(e[0], e[1], a) && ((o = n < 3 ? void 0 : o), (n = 1)), + t = Object(t); + ++i < n; + + ) { + var s = e[i]; + s && r(t, s, i); + } + return t; + })); + }, + 9339: function (t, e, i) { + "use strict"; + i.d(e, { + A: function () { + return Ei; + }, + B: function () { + return Je; + }, + C: function () { + return St; + }, + D: function () { + return Si; + }, + E: function () { + return ne; + }, + F: function () { + return re; + }, + G: function () { + return bt; + }, + H: function () { + return bn; + }, + I: function () { + return Ut; + }, + J: function () { + return st; + }, + K: function () { + return se; + }, + L: function () { + return kn; + }, + M: function () { + return Ti; + }, + N: function () { + return Dn; + }, + Z: function () { + return Nt; + }, + a: function () { + return Ci; + }, + b: function () { + return bi; + }, + c: function () { + return ge; + }, + d: function () { + return ct; + }, + e: function () { + return gt; + }, + f: function () { + return It; + }, + g: function () { + return _i; + }, + h: function () { + return Jt; + }, + i: function () { + return Qe; + }, + j: function () { + return Xt; + }, + k: function () { + return Rt; + }, + l: function () { + return nt; + }, + m: function () { + return Fn; + }, + n: function () { + return dt; + }, + o: function () { + return jt; + }, + p: function () { + return Ke; + }, + q: function () { + return pe; + }, + r: function () { + return xi; + }, + s: function () { + return yi; + }, + t: function () { + return vi; + }, + u: function () { + return oe; + }, + v: function () { + return mi; + }, + w: function () { + return Vt; + }, + x: function () { + return pt; + }, + y: function () { + return Ht; + }, + z: function () { + return Mi; + }, + }); + var r = i(8464), + n = i(7484), + o = i(7967), + a = i(7274), + s = i(7856), + l = i(1767), + h = i(3438), + c = (t, e) => { + const i = l.Z.parse(t), + r = {}; + for (const t in e) e[t] && (r[t] = i[t] + e[t]); + return (0, h.Z)(t, r); + }, + u = i(1117), + f = (t, e = 100) => { + const i = l.Z.parse(t); + return ( + (i.r = 255 - i.r), + (i.g = 255 - i.g), + (i.b = 255 - i.b), + ((t, e, i = 50) => { + const { r: r, g: n, b: o, a: a } = l.Z.parse(t), + { r: s, g: h, b: c, a: f } = l.Z.parse(e), + d = i / 100, + p = 2 * d - 1, + g = a - f, + m = ((p * g == -1 ? p : (p + g) / (1 + p * g)) + 1) / 2, + y = 1 - m, + _ = r * m + s * y, + b = n * m + h * y, + C = o * m + c * y, + x = a * d + f * (1 - d); + return (0, u.Z)(_, b, C, x); + })(i, t, e) + ); + }, + d = i(7201), + p = i(2281), + g = i(6500), + m = i(2454), + y = i(6841), + _ = "comm", + b = "rule", + C = "decl", + x = Math.abs, + v = String.fromCharCode; + function k(t) { + return t.trim(); + } + function T(t, e, i) { + return t.replace(e, i); + } + function w(t, e) { + return t.indexOf(e); + } + function S(t, e) { + return 0 | t.charCodeAt(e); + } + function B(t, e, i) { + return t.slice(e, i); + } + function F(t) { + return t.length; + } + function L(t, e) { + return e.push(t), t; + } + function M(t, e) { + for (var i = "", r = 0; r < t.length; r++) i += e(t[r], r, t, e) || ""; + return i; + } + function A(t, e, i, r) { + switch (t.type) { + case "@layer": + if (t.children.length) break; + case "@import": + case C: + return (t.return = t.return || t.value); + case _: + return ""; + case "@keyframes": + return (t.return = t.value + "{" + M(t.children, r) + "}"); + case b: + if (!F((t.value = t.props.join(",")))) return ""; + } + return F((i = M(t.children, r))) ? (t.return = t.value + "{" + i + "}") : ""; + } + Object.assign; + var E = 1, + Z = 1, + O = 0, + q = 0, + I = 0, + N = ""; + function D(t, e, i, r, n, o, a, s) { + return { + value: t, + root: e, + parent: i, + type: r, + props: n, + children: o, + line: E, + column: Z, + length: a, + return: "", + siblings: s, + }; + } + function $() { + return (I = q > 0 ? S(N, --q) : 0), Z--, 10 === I && ((Z = 1), E--), I; + } + function z() { + return (I = q < O ? S(N, q++) : 0), Z++, 10 === I && ((Z = 1), E++), I; + } + function j() { + return S(N, q); + } + function P() { + return q; + } + function R(t, e) { + return B(N, t, e); + } + function W(t) { + switch (t) { + case 0: + case 9: + case 10: + case 13: + case 32: + return 5; + case 33: + case 43: + case 44: + case 47: + case 62: + case 64: + case 126: + case 59: + case 123: + case 125: + return 4; + case 58: + return 3; + case 34: + case 39: + case 40: + case 91: + return 2; + case 41: + case 93: + return 1; + } + return 0; + } + function U(t) { + return k(R(q - 1, V(91 === t ? t + 2 : 40 === t ? t + 1 : t))); + } + function H(t) { + for (; (I = j()) && I < 33; ) z(); + return W(t) > 2 || W(I) > 3 ? "" : " "; + } + function Y(t, e) { + for (; --e && z() && !(I < 48 || I > 102 || (I > 57 && I < 65) || (I > 70 && I < 97)); ); + return R(t, P() + (e < 6 && 32 == j() && 32 == z())); + } + function V(t) { + for (; z(); ) + switch (I) { + case t: + return q; + case 34: + case 39: + 34 !== t && 39 !== t && V(I); + break; + case 40: + 41 === t && V(t); + break; + case 92: + z(); + } + return q; + } + function G(t, e) { + for (; z() && t + I !== 57 && (t + I !== 84 || 47 !== j()); ); + return "/*" + R(e, q - 1) + "*" + v(47 === t ? t : z()); + } + function X(t) { + for (; !W(j()); ) z(); + return R(t, q); + } + function J(t) { + return (function (t) { + return (N = ""), t; + })( + Q( + "", + null, + null, + null, + [""], + (t = (function (t) { + return (E = Z = 1), (O = F((N = t))), (q = 0), []; + })(t)), + 0, + [0], + t, + ), + ); + } + function Q(t, e, i, r, n, o, a, s, l) { + for (var h = 0, c = 0, u = a, f = 0, d = 0, p = 0, g = 1, m = 1, y = 1, _ = 0, b = "", C = n, x = o, k = r, B = b; m; ) + switch (((p = _), (_ = z()))) { + case 40: + if (108 != p && 58 == S(B, u - 1)) { + -1 != w((B += T(U(_), "&", "&\f")), "&\f") && (y = -1); + break; + } + case 34: + case 39: + case 91: + B += U(_); + break; + case 9: + case 10: + case 13: + case 32: + B += H(p); + break; + case 92: + B += Y(P() - 1, 7); + continue; + case 47: + switch (j()) { + case 42: + case 47: + L(tt(G(z(), P()), e, i, l), l); + break; + default: + B += "/"; + } + break; + case 123 * g: + s[h++] = F(B) * y; + case 125 * g: + case 59: + case 0: + switch (_) { + case 0: + case 125: + m = 0; + case 59 + c: + -1 == y && (B = T(B, /\f/g, "")), + d > 0 && F(B) - u && L(d > 32 ? et(B + ";", r, i, u - 1, l) : et(T(B, " ", "") + ";", r, i, u - 2, l), l); + break; + case 59: + B += ";"; + default: + if ((L((k = K(B, e, i, h, c, n, s, b, (C = []), (x = []), u, o)), o), 123 === _)) + if (0 === c) Q(B, e, k, k, C, o, u, s, x); + else + switch (99 === f && 110 === S(B, 3) ? 100 : f) { + case 100: + case 108: + case 109: + case 115: + Q(t, k, k, r && L(K(t, k, k, 0, 0, n, s, b, n, (C = []), u, x), x), n, x, u, s, r ? C : x); + break; + default: + Q(B, k, k, k, [""], x, 0, s, x); + } + } + (h = c = d = 0), (g = y = 1), (b = B = ""), (u = a); + break; + case 58: + (u = 1 + F(B)), (d = p); + default: + if (g < 1) + if (123 == _) --g; + else if (125 == _ && 0 == g++ && 125 == $()) continue; + switch (((B += v(_)), _ * g)) { + case 38: + y = c > 0 ? 1 : ((B += "\f"), -1); + break; + case 44: + (s[h++] = (F(B) - 1) * y), (y = 1); + break; + case 64: + 45 === j() && (B += U(z())), (f = j()), (c = u = F((b = B += X(P())))), _++; + break; + case 45: + 45 === p && 2 == F(B) && (g = 0); + } + } + return o; + } + function K(t, e, i, r, n, o, a, s, l, h, c, u) { + for ( + var f = n - 1, + d = 0 === n ? o : [""], + p = (function (t) { + return t.length; + })(d), + g = 0, + m = 0, + y = 0; + g < r; + ++g + ) + for (var _ = 0, C = B(t, f + 1, (f = x((m = a[g])))), v = t; _ < p; ++_) + (v = k(m > 0 ? d[_] + " " + C : T(C, /&\f/g, d[_]))) && (l[y++] = v); + return D(t, e, i, 0 === n ? b : s, l, h, c, u); + } + function tt(t, e, i, r) { + return D(t, e, i, _, v(I), B(t, 2, -2), 0, r); + } + function et(t, e, i, r, n) { + return D(t, e, i, C, B(t, 0, r), B(t, r + 1, -1), r, n); + } + var it = i(9697); + const rt = { trace: 0, debug: 1, info: 2, warn: 3, error: 4, fatal: 5 }, + nt = { + trace: (...t) => {}, + debug: (...t) => {}, + info: (...t) => {}, + warn: (...t) => {}, + error: (...t) => {}, + fatal: (...t) => {}, + }, + ot = function (t = "fatal") { + let e = rt.fatal; + "string" == typeof t ? (t = t.toLowerCase()) in rt && (e = rt[t]) : "number" == typeof t && (e = t), + (nt.trace = () => {}), + (nt.debug = () => {}), + (nt.info = () => {}), + (nt.warn = () => {}), + (nt.error = () => {}), + (nt.fatal = () => {}), + e <= rt.fatal && + (nt.fatal = console.error ? console.error.bind(console, at("FATAL"), "color: orange") : console.log.bind(console, "", at("FATAL"))), + e <= rt.error && + (nt.error = console.error ? console.error.bind(console, at("ERROR"), "color: orange") : console.log.bind(console, "", at("ERROR"))), + e <= rt.warn && + (nt.warn = console.warn ? console.warn.bind(console, at("WARN"), "color: orange") : console.log.bind(console, "", at("WARN"))), + e <= rt.info && + (nt.info = console.info ? console.info.bind(console, at("INFO"), "color: lightblue") : console.log.bind(console, "", at("INFO"))), + e <= rt.debug && + (nt.debug = console.debug + ? console.debug.bind(console, at("DEBUG"), "color: lightgreen") + : console.log.bind(console, "", at("DEBUG"))), + e <= rt.trace && + (nt.trace = console.debug + ? console.debug.bind(console, at("TRACE"), "color: lightgreen") + : console.log.bind(console, "", at("TRACE"))); + }, + at = (t) => `%c${n().format("ss.SSS")} : ${t} : `, + st = //gi, + lt = (t) => s.sanitize(t), + ht = (t, e) => { + var i; + if (!1 !== (null == (i = e.flowchart) ? void 0 : i.htmlLabels)) { + const i = e.securityLevel; + "antiscript" === i || "strict" === i + ? (t = lt(t)) + : "loose" !== i && ((t = (t = (t = ft(t)).replace(//g, ">")).replace(/=/g, "=")), (t = ut(t))); + } + return t; + }, + ct = (t, e) => + t + ? (t = e.dompurifyConfig + ? s.sanitize(ht(t, e), e.dompurifyConfig).toString() + : s.sanitize(ht(t, e), { FORBID_TAGS: ["style"] }).toString()) + : t, + ut = (t) => t.replace(/#br#/g, "
    "), + ft = (t) => t.replace(st, "#br#"), + dt = (t) => !1 !== t && !["false", "null", "0"].includes(String(t).trim().toLowerCase()), + pt = function (t) { + let e = t; + if (t.split("~").length - 1 >= 2) { + let t = e; + do { + (e = t), (t = e.replace(/~([^\s,:;]+)~/, "<$1>")); + } while (t != e); + return pt(t); + } + return e; + }, + gt = { + getRows: (t) => (t ? ft(t).replace(/\\n/g, "#br#").split("#br#") : [""]), + sanitizeText: ct, + sanitizeTextOrArray: (t, e) => ("string" == typeof t ? ct(t, e) : t.flat().map((t) => ct(t, e))), + hasBreaks: (t) => st.test(t), + splitBreaks: (t) => t.split(st), + lineBreakRegex: st, + removeScript: lt, + getUrl: (t) => { + let e = ""; + return ( + t && + ((e = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search), + (e = e.replaceAll(/\(/g, "\\(")), + (e = e.replaceAll(/\)/g, "\\)"))), + e + ); + }, + evaluate: dt, + getMax: function (...t) { + const e = t.filter((t) => !isNaN(t)); + return Math.max(...e); + }, + getMin: function (...t) { + const e = t.filter((t) => !isNaN(t)); + return Math.min(...e); + }, + }, + mt = (t, e) => c(t, e ? { s: -40, l: 10 } : { s: -40, l: -10 }), + yt = "#ffffff", + _t = "#f2f2f2", + bt = (t) => { + const e = new (class { + constructor() { + (this.background = "#f4f4f4"), + (this.primaryColor = "#ECECFF"), + (this.secondaryColor = c(this.primaryColor, { h: 120 })), + (this.secondaryColor = "#ffffde"), + (this.tertiaryColor = c(this.primaryColor, { h: -160 })), + (this.primaryBorderColor = mt(this.primaryColor, this.darkMode)), + (this.secondaryBorderColor = mt(this.secondaryColor, this.darkMode)), + (this.tertiaryBorderColor = mt(this.tertiaryColor, this.darkMode)), + (this.primaryTextColor = f(this.primaryColor)), + (this.secondaryTextColor = f(this.secondaryColor)), + (this.tertiaryTextColor = f(this.tertiaryColor)), + (this.lineColor = f(this.background)), + (this.textColor = f(this.background)), + (this.background = "white"), + (this.mainBkg = "#ECECFF"), + (this.secondBkg = "#ffffde"), + (this.lineColor = "#333333"), + (this.border1 = "#9370DB"), + (this.border2 = "#aaaa33"), + (this.arrowheadColor = "#333333"), + (this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'), + (this.fontSize = "16px"), + (this.labelBackground = "#e8e8e8"), + (this.textColor = "#333"), + (this.THEME_COLOR_LIMIT = 12), + (this.nodeBkg = "calculated"), + (this.nodeBorder = "calculated"), + (this.clusterBkg = "calculated"), + (this.clusterBorder = "calculated"), + (this.defaultLinkColor = "calculated"), + (this.titleColor = "calculated"), + (this.edgeLabelBackground = "calculated"), + (this.actorBorder = "calculated"), + (this.actorBkg = "calculated"), + (this.actorTextColor = "black"), + (this.actorLineColor = "grey"), + (this.signalColor = "calculated"), + (this.signalTextColor = "calculated"), + (this.labelBoxBkgColor = "calculated"), + (this.labelBoxBorderColor = "calculated"), + (this.labelTextColor = "calculated"), + (this.loopTextColor = "calculated"), + (this.noteBorderColor = "calculated"), + (this.noteBkgColor = "#fff5ad"), + (this.noteTextColor = "calculated"), + (this.activationBorderColor = "#666"), + (this.activationBkgColor = "#f4f4f4"), + (this.sequenceNumberColor = "white"), + (this.sectionBkgColor = "calculated"), + (this.altSectionBkgColor = "calculated"), + (this.sectionBkgColor2 = "calculated"), + (this.excludeBkgColor = "#eeeeee"), + (this.taskBorderColor = "calculated"), + (this.taskBkgColor = "calculated"), + (this.taskTextLightColor = "calculated"), + (this.taskTextColor = this.taskTextLightColor), + (this.taskTextDarkColor = "calculated"), + (this.taskTextOutsideColor = this.taskTextDarkColor), + (this.taskTextClickableColor = "calculated"), + (this.activeTaskBorderColor = "calculated"), + (this.activeTaskBkgColor = "calculated"), + (this.gridColor = "calculated"), + (this.doneTaskBkgColor = "calculated"), + (this.doneTaskBorderColor = "calculated"), + (this.critBorderColor = "calculated"), + (this.critBkgColor = "calculated"), + (this.todayLineColor = "calculated"), + (this.sectionBkgColor = (0, u.Z)(102, 102, 255, 0.49)), + (this.altSectionBkgColor = "white"), + (this.sectionBkgColor2 = "#fff400"), + (this.taskBorderColor = "#534fbc"), + (this.taskBkgColor = "#8a90dd"), + (this.taskTextLightColor = "white"), + (this.taskTextColor = "calculated"), + (this.taskTextDarkColor = "black"), + (this.taskTextOutsideColor = "calculated"), + (this.taskTextClickableColor = "#003163"), + (this.activeTaskBorderColor = "#534fbc"), + (this.activeTaskBkgColor = "#bfc7ff"), + (this.gridColor = "lightgrey"), + (this.doneTaskBkgColor = "lightgrey"), + (this.doneTaskBorderColor = "grey"), + (this.critBorderColor = "#ff8888"), + (this.critBkgColor = "red"), + (this.todayLineColor = "red"), + (this.personBorder = this.primaryBorderColor), + (this.personBkg = this.mainBkg), + (this.labelColor = "black"), + (this.errorBkgColor = "#552222"), + (this.errorTextColor = "#552222"), + this.updateColors(); + } + updateColors() { + (this.cScale0 = this.cScale0 || this.primaryColor), + (this.cScale1 = this.cScale1 || this.secondaryColor), + (this.cScale2 = this.cScale2 || this.tertiaryColor), + (this.cScale3 = this.cScale3 || c(this.primaryColor, { h: 30 })), + (this.cScale4 = this.cScale4 || c(this.primaryColor, { h: 60 })), + (this.cScale5 = this.cScale5 || c(this.primaryColor, { h: 90 })), + (this.cScale6 = this.cScale6 || c(this.primaryColor, { h: 120 })), + (this.cScale7 = this.cScale7 || c(this.primaryColor, { h: 150 })), + (this.cScale8 = this.cScale8 || c(this.primaryColor, { h: 210 })), + (this.cScale9 = this.cScale9 || c(this.primaryColor, { h: 270 })), + (this.cScale10 = this.cScale10 || c(this.primaryColor, { h: 300 })), + (this.cScale11 = this.cScale11 || c(this.primaryColor, { h: 330 })), + (this.cScalePeer1 = this.cScalePeer1 || (0, d.Z)(this.secondaryColor, 45)), + (this.cScalePeer2 = this.cScalePeer2 || (0, d.Z)(this.tertiaryColor, 40)); + for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) + (this["cScale" + t] = (0, d.Z)(this["cScale" + t], 10)), + (this["cScalePeer" + t] = this["cScalePeer" + t] || (0, d.Z)(this["cScale" + t], 25)); + for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) this["cScaleInv" + t] = this["cScaleInv" + t] || c(this["cScale" + t], { h: 180 }); + for (let t = 0; t < 5; t++) + (this["surface" + t] = this["surface" + t] || c(this.mainBkg, { h: 30, l: -(5 + 5 * t) })), + (this["surfacePeer" + t] = this["surfacePeer" + t] || c(this.mainBkg, { h: 30, l: -(7 + 5 * t) })); + if ( + ((this.scaleLabelColor = "calculated" !== this.scaleLabelColor && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor), + "calculated" !== this.labelTextColor) + ) { + (this.cScaleLabel0 = this.cScaleLabel0 || f(this.labelTextColor)), (this.cScaleLabel3 = this.cScaleLabel3 || f(this.labelTextColor)); + for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) this["cScaleLabel" + t] = this["cScaleLabel" + t] || this.labelTextColor; + } + (this.nodeBkg = this.mainBkg), + (this.nodeBorder = this.border1), + (this.clusterBkg = this.secondBkg), + (this.clusterBorder = this.border2), + (this.defaultLinkColor = this.lineColor), + (this.titleColor = this.textColor), + (this.edgeLabelBackground = this.labelBackground), + (this.actorBorder = (0, p.Z)(this.border1, 23)), + (this.actorBkg = this.mainBkg), + (this.labelBoxBkgColor = this.actorBkg), + (this.signalColor = this.textColor), + (this.signalTextColor = this.textColor), + (this.labelBoxBorderColor = this.actorBorder), + (this.labelTextColor = this.actorTextColor), + (this.loopTextColor = this.actorTextColor), + (this.noteBorderColor = this.border2), + (this.noteTextColor = this.actorTextColor), + (this.taskTextColor = this.taskTextLightColor), + (this.taskTextOutsideColor = this.taskTextDarkColor), + (this.transitionColor = this.transitionColor || this.lineColor), + (this.transitionLabelColor = this.transitionLabelColor || this.textColor), + (this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor), + (this.stateBkg = this.stateBkg || this.mainBkg), + (this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg), + (this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor), + (this.altBackground = this.altBackground || "#f0f0f0"), + (this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg), + (this.compositeBorder = this.compositeBorder || this.nodeBorder), + (this.innerEndBackground = this.nodeBorder), + (this.specialStateColor = this.lineColor), + (this.errorBkgColor = this.errorBkgColor || this.tertiaryColor), + (this.errorTextColor = this.errorTextColor || this.tertiaryTextColor), + (this.transitionColor = this.transitionColor || this.lineColor), + (this.classText = this.primaryTextColor), + (this.fillType0 = this.primaryColor), + (this.fillType1 = this.secondaryColor), + (this.fillType2 = c(this.primaryColor, { h: 64 })), + (this.fillType3 = c(this.secondaryColor, { h: 64 })), + (this.fillType4 = c(this.primaryColor, { h: -64 })), + (this.fillType5 = c(this.secondaryColor, { h: -64 })), + (this.fillType6 = c(this.primaryColor, { h: 128 })), + (this.fillType7 = c(this.secondaryColor, { h: 128 })), + (this.pie1 = this.pie1 || this.primaryColor), + (this.pie2 = this.pie2 || this.secondaryColor), + (this.pie3 = this.pie3 || c(this.tertiaryColor, { l: -40 })), + (this.pie4 = this.pie4 || c(this.primaryColor, { l: -10 })), + (this.pie5 = this.pie5 || c(this.secondaryColor, { l: -30 })), + (this.pie6 = this.pie6 || c(this.tertiaryColor, { l: -20 })), + (this.pie7 = this.pie7 || c(this.primaryColor, { h: 60, l: -20 })), + (this.pie8 = this.pie8 || c(this.primaryColor, { h: -60, l: -40 })), + (this.pie9 = this.pie9 || c(this.primaryColor, { h: 120, l: -40 })), + (this.pie10 = this.pie10 || c(this.primaryColor, { h: 60, l: -40 })), + (this.pie11 = this.pie11 || c(this.primaryColor, { h: -90, l: -40 })), + (this.pie12 = this.pie12 || c(this.primaryColor, { h: 120, l: -30 })), + (this.pieTitleTextSize = this.pieTitleTextSize || "25px"), + (this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor), + (this.pieSectionTextSize = this.pieSectionTextSize || "17px"), + (this.pieSectionTextColor = this.pieSectionTextColor || this.textColor), + (this.pieLegendTextSize = this.pieLegendTextSize || "17px"), + (this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor), + (this.pieStrokeColor = this.pieStrokeColor || "black"), + (this.pieStrokeWidth = this.pieStrokeWidth || "2px"), + (this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px"), + (this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black"), + (this.pieOpacity = this.pieOpacity || "0.7"), + (this.quadrant1Fill = this.quadrant1Fill || this.primaryColor), + (this.quadrant2Fill = this.quadrant2Fill || c(this.primaryColor, { r: 5, g: 5, b: 5 })), + (this.quadrant3Fill = this.quadrant3Fill || c(this.primaryColor, { r: 10, g: 10, b: 10 })), + (this.quadrant4Fill = this.quadrant4Fill || c(this.primaryColor, { r: 15, g: 15, b: 15 })), + (this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor), + (this.quadrant2TextFill = this.quadrant2TextFill || c(this.primaryTextColor, { r: -5, g: -5, b: -5 })), + (this.quadrant3TextFill = this.quadrant3TextFill || c(this.primaryTextColor, { r: -10, g: -10, b: -10 })), + (this.quadrant4TextFill = this.quadrant4TextFill || c(this.primaryTextColor, { r: -15, g: -15, b: -15 })), + (this.quadrantPointFill = + this.quadrantPointFill || (0, g.Z)(this.quadrant1Fill) ? (0, p.Z)(this.quadrant1Fill) : (0, d.Z)(this.quadrant1Fill)), + (this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor), + (this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor), + (this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor), + (this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor), + (this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor), + (this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor), + (this.requirementBackground = this.requirementBackground || this.primaryColor), + (this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor), + (this.requirementBorderSize = this.requirementBorderSize || "1"), + (this.requirementTextColor = this.requirementTextColor || this.primaryTextColor), + (this.relationColor = this.relationColor || this.lineColor), + (this.relationLabelBackground = this.relationLabelBackground || this.labelBackground), + (this.relationLabelColor = this.relationLabelColor || this.actorTextColor), + (this.git0 = this.git0 || this.primaryColor), + (this.git1 = this.git1 || this.secondaryColor), + (this.git2 = this.git2 || this.tertiaryColor), + (this.git3 = this.git3 || c(this.primaryColor, { h: -30 })), + (this.git4 = this.git4 || c(this.primaryColor, { h: -60 })), + (this.git5 = this.git5 || c(this.primaryColor, { h: -90 })), + (this.git6 = this.git6 || c(this.primaryColor, { h: 60 })), + (this.git7 = this.git7 || c(this.primaryColor, { h: 120 })), + this.darkMode + ? ((this.git0 = (0, p.Z)(this.git0, 25)), + (this.git1 = (0, p.Z)(this.git1, 25)), + (this.git2 = (0, p.Z)(this.git2, 25)), + (this.git3 = (0, p.Z)(this.git3, 25)), + (this.git4 = (0, p.Z)(this.git4, 25)), + (this.git5 = (0, p.Z)(this.git5, 25)), + (this.git6 = (0, p.Z)(this.git6, 25)), + (this.git7 = (0, p.Z)(this.git7, 25))) + : ((this.git0 = (0, d.Z)(this.git0, 25)), + (this.git1 = (0, d.Z)(this.git1, 25)), + (this.git2 = (0, d.Z)(this.git2, 25)), + (this.git3 = (0, d.Z)(this.git3, 25)), + (this.git4 = (0, d.Z)(this.git4, 25)), + (this.git5 = (0, d.Z)(this.git5, 25)), + (this.git6 = (0, d.Z)(this.git6, 25)), + (this.git7 = (0, d.Z)(this.git7, 25))), + (this.gitInv0 = this.gitInv0 || (0, d.Z)(f(this.git0), 25)), + (this.gitInv1 = this.gitInv1 || f(this.git1)), + (this.gitInv2 = this.gitInv2 || f(this.git2)), + (this.gitInv3 = this.gitInv3 || f(this.git3)), + (this.gitInv4 = this.gitInv4 || f(this.git4)), + (this.gitInv5 = this.gitInv5 || f(this.git5)), + (this.gitInv6 = this.gitInv6 || f(this.git6)), + (this.gitInv7 = this.gitInv7 || f(this.git7)), + (this.gitBranchLabel0 = this.gitBranchLabel0 || f(this.labelTextColor)), + (this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor), + (this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor), + (this.gitBranchLabel3 = this.gitBranchLabel3 || f(this.labelTextColor)), + (this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor), + (this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor), + (this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor), + (this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor), + (this.tagLabelColor = this.tagLabelColor || this.primaryTextColor), + (this.tagLabelBackground = this.tagLabelBackground || this.primaryColor), + (this.tagLabelBorder = this.tagBorder || this.primaryBorderColor), + (this.tagLabelFontSize = this.tagLabelFontSize || "10px"), + (this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor), + (this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor), + (this.commitLabelFontSize = this.commitLabelFontSize || "10px"), + (this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || yt), + (this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || _t); + } + calculate(t) { + if ("object" != typeof t) return void this.updateColors(); + const e = Object.keys(t); + e.forEach((e) => { + this[e] = t[e]; + }), + this.updateColors(), + e.forEach((e) => { + this[e] = t[e]; + }); + } + })(); + return e.calculate(t), e; + }; + class Ct { + constructor() { + (this.primaryColor = "#eee"), + (this.contrast = "#707070"), + (this.secondaryColor = (0, p.Z)(this.contrast, 55)), + (this.background = "#ffffff"), + (this.tertiaryColor = c(this.primaryColor, { h: -160 })), + (this.primaryBorderColor = mt(this.primaryColor, this.darkMode)), + (this.secondaryBorderColor = mt(this.secondaryColor, this.darkMode)), + (this.tertiaryBorderColor = mt(this.tertiaryColor, this.darkMode)), + (this.primaryTextColor = f(this.primaryColor)), + (this.secondaryTextColor = f(this.secondaryColor)), + (this.tertiaryTextColor = f(this.tertiaryColor)), + (this.lineColor = f(this.background)), + (this.textColor = f(this.background)), + (this.mainBkg = "#eee"), + (this.secondBkg = "calculated"), + (this.lineColor = "#666"), + (this.border1 = "#999"), + (this.border2 = "calculated"), + (this.note = "#ffa"), + (this.text = "#333"), + (this.critical = "#d42"), + (this.done = "#bbb"), + (this.arrowheadColor = "#333333"), + (this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'), + (this.fontSize = "16px"), + (this.THEME_COLOR_LIMIT = 12), + (this.nodeBkg = "calculated"), + (this.nodeBorder = "calculated"), + (this.clusterBkg = "calculated"), + (this.clusterBorder = "calculated"), + (this.defaultLinkColor = "calculated"), + (this.titleColor = "calculated"), + (this.edgeLabelBackground = "white"), + (this.actorBorder = "calculated"), + (this.actorBkg = "calculated"), + (this.actorTextColor = "calculated"), + (this.actorLineColor = "calculated"), + (this.signalColor = "calculated"), + (this.signalTextColor = "calculated"), + (this.labelBoxBkgColor = "calculated"), + (this.labelBoxBorderColor = "calculated"), + (this.labelTextColor = "calculated"), + (this.loopTextColor = "calculated"), + (this.noteBorderColor = "calculated"), + (this.noteBkgColor = "calculated"), + (this.noteTextColor = "calculated"), + (this.activationBorderColor = "#666"), + (this.activationBkgColor = "#f4f4f4"), + (this.sequenceNumberColor = "white"), + (this.sectionBkgColor = "calculated"), + (this.altSectionBkgColor = "white"), + (this.sectionBkgColor2 = "calculated"), + (this.excludeBkgColor = "#eeeeee"), + (this.taskBorderColor = "calculated"), + (this.taskBkgColor = "calculated"), + (this.taskTextLightColor = "white"), + (this.taskTextColor = "calculated"), + (this.taskTextDarkColor = "calculated"), + (this.taskTextOutsideColor = "calculated"), + (this.taskTextClickableColor = "#003163"), + (this.activeTaskBorderColor = "calculated"), + (this.activeTaskBkgColor = "calculated"), + (this.gridColor = "calculated"), + (this.doneTaskBkgColor = "calculated"), + (this.doneTaskBorderColor = "calculated"), + (this.critBkgColor = "calculated"), + (this.critBorderColor = "calculated"), + (this.todayLineColor = "calculated"), + (this.personBorder = this.primaryBorderColor), + (this.personBkg = this.mainBkg), + (this.labelColor = "black"), + (this.errorBkgColor = "#552222"), + (this.errorTextColor = "#552222"); + } + updateColors() { + (this.secondBkg = (0, p.Z)(this.contrast, 55)), + (this.border2 = this.contrast), + (this.actorBorder = (0, p.Z)(this.border1, 23)), + (this.actorBkg = this.mainBkg), + (this.actorTextColor = this.text), + (this.actorLineColor = this.lineColor), + (this.signalColor = this.text), + (this.signalTextColor = this.text), + (this.labelBoxBkgColor = this.actorBkg), + (this.labelBoxBorderColor = this.actorBorder), + (this.labelTextColor = this.text), + (this.loopTextColor = this.text), + (this.noteBorderColor = "#999"), + (this.noteBkgColor = "#666"), + (this.noteTextColor = "#fff"), + (this.cScale0 = this.cScale0 || "#555"), + (this.cScale1 = this.cScale1 || "#F4F4F4"), + (this.cScale2 = this.cScale2 || "#555"), + (this.cScale3 = this.cScale3 || "#BBB"), + (this.cScale4 = this.cScale4 || "#777"), + (this.cScale5 = this.cScale5 || "#999"), + (this.cScale6 = this.cScale6 || "#DDD"), + (this.cScale7 = this.cScale7 || "#FFF"), + (this.cScale8 = this.cScale8 || "#DDD"), + (this.cScale9 = this.cScale9 || "#BBB"), + (this.cScale10 = this.cScale10 || "#999"), + (this.cScale11 = this.cScale11 || "#777"); + for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) this["cScaleInv" + t] = this["cScaleInv" + t] || f(this["cScale" + t]); + for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) + this.darkMode + ? (this["cScalePeer" + t] = this["cScalePeer" + t] || (0, p.Z)(this["cScale" + t], 10)) + : (this["cScalePeer" + t] = this["cScalePeer" + t] || (0, d.Z)(this["cScale" + t], 10)); + (this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor)), + (this.cScaleLabel0 = this.cScaleLabel0 || this.cScale1), + (this.cScaleLabel2 = this.cScaleLabel2 || this.cScale1); + for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) this["cScaleLabel" + t] = this["cScaleLabel" + t] || this.scaleLabelColor; + for (let t = 0; t < 5; t++) + (this["surface" + t] = this["surface" + t] || c(this.mainBkg, { l: -(5 + 5 * t) })), + (this["surfacePeer" + t] = this["surfacePeer" + t] || c(this.mainBkg, { l: -(8 + 5 * t) })); + (this.nodeBkg = this.mainBkg), + (this.nodeBorder = this.border1), + (this.clusterBkg = this.secondBkg), + (this.clusterBorder = this.border2), + (this.defaultLinkColor = this.lineColor), + (this.titleColor = this.text), + (this.sectionBkgColor = (0, p.Z)(this.contrast, 30)), + (this.sectionBkgColor2 = (0, p.Z)(this.contrast, 30)), + (this.taskBorderColor = (0, d.Z)(this.contrast, 10)), + (this.taskBkgColor = this.contrast), + (this.taskTextColor = this.taskTextLightColor), + (this.taskTextDarkColor = this.text), + (this.taskTextOutsideColor = this.taskTextDarkColor), + (this.activeTaskBorderColor = this.taskBorderColor), + (this.activeTaskBkgColor = this.mainBkg), + (this.gridColor = (0, p.Z)(this.border1, 30)), + (this.doneTaskBkgColor = this.done), + (this.doneTaskBorderColor = this.lineColor), + (this.critBkgColor = this.critical), + (this.critBorderColor = (0, d.Z)(this.critBkgColor, 10)), + (this.todayLineColor = this.critBkgColor), + (this.transitionColor = this.transitionColor || "#000"), + (this.transitionLabelColor = this.transitionLabelColor || this.textColor), + (this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor), + (this.stateBkg = this.stateBkg || this.mainBkg), + (this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg), + (this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor), + (this.altBackground = this.altBackground || "#f4f4f4"), + (this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg), + (this.stateBorder = this.stateBorder || "#000"), + (this.innerEndBackground = this.primaryBorderColor), + (this.specialStateColor = "#222"), + (this.errorBkgColor = this.errorBkgColor || this.tertiaryColor), + (this.errorTextColor = this.errorTextColor || this.tertiaryTextColor), + (this.classText = this.primaryTextColor), + (this.fillType0 = this.primaryColor), + (this.fillType1 = this.secondaryColor), + (this.fillType2 = c(this.primaryColor, { h: 64 })), + (this.fillType3 = c(this.secondaryColor, { h: 64 })), + (this.fillType4 = c(this.primaryColor, { h: -64 })), + (this.fillType5 = c(this.secondaryColor, { h: -64 })), + (this.fillType6 = c(this.primaryColor, { h: 128 })), + (this.fillType7 = c(this.secondaryColor, { h: 128 })); + for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) this["pie" + t] = this["cScale" + t]; + (this.pie12 = this.pie0), + (this.pieTitleTextSize = this.pieTitleTextSize || "25px"), + (this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor), + (this.pieSectionTextSize = this.pieSectionTextSize || "17px"), + (this.pieSectionTextColor = this.pieSectionTextColor || this.textColor), + (this.pieLegendTextSize = this.pieLegendTextSize || "17px"), + (this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor), + (this.pieStrokeColor = this.pieStrokeColor || "black"), + (this.pieStrokeWidth = this.pieStrokeWidth || "2px"), + (this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px"), + (this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black"), + (this.pieOpacity = this.pieOpacity || "0.7"), + (this.quadrant1Fill = this.quadrant1Fill || this.primaryColor), + (this.quadrant2Fill = this.quadrant2Fill || c(this.primaryColor, { r: 5, g: 5, b: 5 })), + (this.quadrant3Fill = this.quadrant3Fill || c(this.primaryColor, { r: 10, g: 10, b: 10 })), + (this.quadrant4Fill = this.quadrant4Fill || c(this.primaryColor, { r: 15, g: 15, b: 15 })), + (this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor), + (this.quadrant2TextFill = this.quadrant2TextFill || c(this.primaryTextColor, { r: -5, g: -5, b: -5 })), + (this.quadrant3TextFill = this.quadrant3TextFill || c(this.primaryTextColor, { r: -10, g: -10, b: -10 })), + (this.quadrant4TextFill = this.quadrant4TextFill || c(this.primaryTextColor, { r: -15, g: -15, b: -15 })), + (this.quadrantPointFill = + this.quadrantPointFill || (0, g.Z)(this.quadrant1Fill) ? (0, p.Z)(this.quadrant1Fill) : (0, d.Z)(this.quadrant1Fill)), + (this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor), + (this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor), + (this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor), + (this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor), + (this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor), + (this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor), + (this.requirementBackground = this.requirementBackground || this.primaryColor), + (this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor), + (this.requirementBorderSize = this.requirementBorderSize || "1"), + (this.requirementTextColor = this.requirementTextColor || this.primaryTextColor), + (this.relationColor = this.relationColor || this.lineColor), + (this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground), + (this.relationLabelColor = this.relationLabelColor || this.actorTextColor), + (this.git0 = (0, d.Z)(this.pie1, 25) || this.primaryColor), + (this.git1 = this.pie2 || this.secondaryColor), + (this.git2 = this.pie3 || this.tertiaryColor), + (this.git3 = this.pie4 || c(this.primaryColor, { h: -30 })), + (this.git4 = this.pie5 || c(this.primaryColor, { h: -60 })), + (this.git5 = this.pie6 || c(this.primaryColor, { h: -90 })), + (this.git6 = this.pie7 || c(this.primaryColor, { h: 60 })), + (this.git7 = this.pie8 || c(this.primaryColor, { h: 120 })), + (this.gitInv0 = this.gitInv0 || f(this.git0)), + (this.gitInv1 = this.gitInv1 || f(this.git1)), + (this.gitInv2 = this.gitInv2 || f(this.git2)), + (this.gitInv3 = this.gitInv3 || f(this.git3)), + (this.gitInv4 = this.gitInv4 || f(this.git4)), + (this.gitInv5 = this.gitInv5 || f(this.git5)), + (this.gitInv6 = this.gitInv6 || f(this.git6)), + (this.gitInv7 = this.gitInv7 || f(this.git7)), + (this.branchLabelColor = this.branchLabelColor || this.labelTextColor), + (this.gitBranchLabel0 = this.branchLabelColor), + (this.gitBranchLabel1 = "white"), + (this.gitBranchLabel2 = this.branchLabelColor), + (this.gitBranchLabel3 = "white"), + (this.gitBranchLabel4 = this.branchLabelColor), + (this.gitBranchLabel5 = this.branchLabelColor), + (this.gitBranchLabel6 = this.branchLabelColor), + (this.gitBranchLabel7 = this.branchLabelColor), + (this.tagLabelColor = this.tagLabelColor || this.primaryTextColor), + (this.tagLabelBackground = this.tagLabelBackground || this.primaryColor), + (this.tagLabelBorder = this.tagBorder || this.primaryBorderColor), + (this.tagLabelFontSize = this.tagLabelFontSize || "10px"), + (this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor), + (this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor), + (this.commitLabelFontSize = this.commitLabelFontSize || "10px"), + (this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || yt), + (this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || _t); + } + calculate(t) { + if ("object" != typeof t) return void this.updateColors(); + const e = Object.keys(t); + e.forEach((e) => { + this[e] = t[e]; + }), + this.updateColors(), + e.forEach((e) => { + this[e] = t[e]; + }); + } + } + const xt = { + base: { + getThemeVariables: (t) => { + const e = new (class { + constructor() { + (this.background = "#f4f4f4"), + (this.primaryColor = "#fff4dd"), + (this.noteBkgColor = "#fff5ad"), + (this.noteTextColor = "#333"), + (this.THEME_COLOR_LIMIT = 12), + (this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'), + (this.fontSize = "16px"); + } + updateColors() { + if ( + ((this.primaryTextColor = this.primaryTextColor || (this.darkMode ? "#eee" : "#333")), + (this.secondaryColor = this.secondaryColor || c(this.primaryColor, { h: -120 })), + (this.tertiaryColor = this.tertiaryColor || c(this.primaryColor, { h: 180, l: 5 })), + (this.primaryBorderColor = this.primaryBorderColor || mt(this.primaryColor, this.darkMode)), + (this.secondaryBorderColor = this.secondaryBorderColor || mt(this.secondaryColor, this.darkMode)), + (this.tertiaryBorderColor = this.tertiaryBorderColor || mt(this.tertiaryColor, this.darkMode)), + (this.noteBorderColor = this.noteBorderColor || mt(this.noteBkgColor, this.darkMode)), + (this.noteBkgColor = this.noteBkgColor || "#fff5ad"), + (this.noteTextColor = this.noteTextColor || "#333"), + (this.secondaryTextColor = this.secondaryTextColor || f(this.secondaryColor)), + (this.tertiaryTextColor = this.tertiaryTextColor || f(this.tertiaryColor)), + (this.lineColor = this.lineColor || f(this.background)), + (this.arrowheadColor = this.arrowheadColor || f(this.background)), + (this.textColor = this.textColor || this.primaryTextColor), + (this.border2 = this.border2 || this.tertiaryBorderColor), + (this.nodeBkg = this.nodeBkg || this.primaryColor), + (this.mainBkg = this.mainBkg || this.primaryColor), + (this.nodeBorder = this.nodeBorder || this.primaryBorderColor), + (this.clusterBkg = this.clusterBkg || this.tertiaryColor), + (this.clusterBorder = this.clusterBorder || this.tertiaryBorderColor), + (this.defaultLinkColor = this.defaultLinkColor || this.lineColor), + (this.titleColor = this.titleColor || this.tertiaryTextColor), + (this.edgeLabelBackground = + this.edgeLabelBackground || (this.darkMode ? (0, d.Z)(this.secondaryColor, 30) : this.secondaryColor)), + (this.nodeTextColor = this.nodeTextColor || this.primaryTextColor), + (this.actorBorder = this.actorBorder || this.primaryBorderColor), + (this.actorBkg = this.actorBkg || this.mainBkg), + (this.actorTextColor = this.actorTextColor || this.primaryTextColor), + (this.actorLineColor = this.actorLineColor || "grey"), + (this.labelBoxBkgColor = this.labelBoxBkgColor || this.actorBkg), + (this.signalColor = this.signalColor || this.textColor), + (this.signalTextColor = this.signalTextColor || this.textColor), + (this.labelBoxBorderColor = this.labelBoxBorderColor || this.actorBorder), + (this.labelTextColor = this.labelTextColor || this.actorTextColor), + (this.loopTextColor = this.loopTextColor || this.actorTextColor), + (this.activationBorderColor = this.activationBorderColor || (0, d.Z)(this.secondaryColor, 10)), + (this.activationBkgColor = this.activationBkgColor || this.secondaryColor), + (this.sequenceNumberColor = this.sequenceNumberColor || f(this.lineColor)), + (this.sectionBkgColor = this.sectionBkgColor || this.tertiaryColor), + (this.altSectionBkgColor = this.altSectionBkgColor || "white"), + (this.sectionBkgColor = this.sectionBkgColor || this.secondaryColor), + (this.sectionBkgColor2 = this.sectionBkgColor2 || this.primaryColor), + (this.excludeBkgColor = this.excludeBkgColor || "#eeeeee"), + (this.taskBorderColor = this.taskBorderColor || this.primaryBorderColor), + (this.taskBkgColor = this.taskBkgColor || this.primaryColor), + (this.activeTaskBorderColor = this.activeTaskBorderColor || this.primaryColor), + (this.activeTaskBkgColor = this.activeTaskBkgColor || (0, p.Z)(this.primaryColor, 23)), + (this.gridColor = this.gridColor || "lightgrey"), + (this.doneTaskBkgColor = this.doneTaskBkgColor || "lightgrey"), + (this.doneTaskBorderColor = this.doneTaskBorderColor || "grey"), + (this.critBorderColor = this.critBorderColor || "#ff8888"), + (this.critBkgColor = this.critBkgColor || "red"), + (this.todayLineColor = this.todayLineColor || "red"), + (this.taskTextColor = this.taskTextColor || this.textColor), + (this.taskTextOutsideColor = this.taskTextOutsideColor || this.textColor), + (this.taskTextLightColor = this.taskTextLightColor || this.textColor), + (this.taskTextColor = this.taskTextColor || this.primaryTextColor), + (this.taskTextDarkColor = this.taskTextDarkColor || this.textColor), + (this.taskTextClickableColor = this.taskTextClickableColor || "#003163"), + (this.personBorder = this.personBorder || this.primaryBorderColor), + (this.personBkg = this.personBkg || this.mainBkg), + (this.transitionColor = this.transitionColor || this.lineColor), + (this.transitionLabelColor = this.transitionLabelColor || this.textColor), + (this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor), + (this.stateBkg = this.stateBkg || this.mainBkg), + (this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg), + (this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor), + (this.altBackground = this.altBackground || this.tertiaryColor), + (this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg), + (this.compositeBorder = this.compositeBorder || this.nodeBorder), + (this.innerEndBackground = this.nodeBorder), + (this.errorBkgColor = this.errorBkgColor || this.tertiaryColor), + (this.errorTextColor = this.errorTextColor || this.tertiaryTextColor), + (this.transitionColor = this.transitionColor || this.lineColor), + (this.specialStateColor = this.lineColor), + (this.cScale0 = this.cScale0 || this.primaryColor), + (this.cScale1 = this.cScale1 || this.secondaryColor), + (this.cScale2 = this.cScale2 || this.tertiaryColor), + (this.cScale3 = this.cScale3 || c(this.primaryColor, { h: 30 })), + (this.cScale4 = this.cScale4 || c(this.primaryColor, { h: 60 })), + (this.cScale5 = this.cScale5 || c(this.primaryColor, { h: 90 })), + (this.cScale6 = this.cScale6 || c(this.primaryColor, { h: 120 })), + (this.cScale7 = this.cScale7 || c(this.primaryColor, { h: 150 })), + (this.cScale8 = this.cScale8 || c(this.primaryColor, { h: 210, l: 150 })), + (this.cScale9 = this.cScale9 || c(this.primaryColor, { h: 270 })), + (this.cScale10 = this.cScale10 || c(this.primaryColor, { h: 300 })), + (this.cScale11 = this.cScale11 || c(this.primaryColor, { h: 330 })), + this.darkMode) + ) + for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) this["cScale" + t] = (0, d.Z)(this["cScale" + t], 75); + else for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) this["cScale" + t] = (0, d.Z)(this["cScale" + t], 25); + for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) this["cScaleInv" + t] = this["cScaleInv" + t] || f(this["cScale" + t]); + for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) + this.darkMode + ? (this["cScalePeer" + t] = this["cScalePeer" + t] || (0, p.Z)(this["cScale" + t], 10)) + : (this["cScalePeer" + t] = this["cScalePeer" + t] || (0, d.Z)(this["cScale" + t], 10)); + this.scaleLabelColor = this.scaleLabelColor || this.labelTextColor; + for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) this["cScaleLabel" + t] = this["cScaleLabel" + t] || this.scaleLabelColor; + const t = this.darkMode ? -4 : -1; + for (let e = 0; e < 5; e++) + (this["surface" + e] = this["surface" + e] || c(this.mainBkg, { h: 180, s: -15, l: t * (5 + 3 * e) })), + (this["surfacePeer" + e] = this["surfacePeer" + e] || c(this.mainBkg, { h: 180, s: -15, l: t * (8 + 3 * e) })); + (this.classText = this.classText || this.textColor), + (this.fillType0 = this.fillType0 || this.primaryColor), + (this.fillType1 = this.fillType1 || this.secondaryColor), + (this.fillType2 = this.fillType2 || c(this.primaryColor, { h: 64 })), + (this.fillType3 = this.fillType3 || c(this.secondaryColor, { h: 64 })), + (this.fillType4 = this.fillType4 || c(this.primaryColor, { h: -64 })), + (this.fillType5 = this.fillType5 || c(this.secondaryColor, { h: -64 })), + (this.fillType6 = this.fillType6 || c(this.primaryColor, { h: 128 })), + (this.fillType7 = this.fillType7 || c(this.secondaryColor, { h: 128 })), + (this.pie1 = this.pie1 || this.primaryColor), + (this.pie2 = this.pie2 || this.secondaryColor), + (this.pie3 = this.pie3 || this.tertiaryColor), + (this.pie4 = this.pie4 || c(this.primaryColor, { l: -10 })), + (this.pie5 = this.pie5 || c(this.secondaryColor, { l: -10 })), + (this.pie6 = this.pie6 || c(this.tertiaryColor, { l: -10 })), + (this.pie7 = this.pie7 || c(this.primaryColor, { h: 60, l: -10 })), + (this.pie8 = this.pie8 || c(this.primaryColor, { h: -60, l: -10 })), + (this.pie9 = this.pie9 || c(this.primaryColor, { h: 120, l: 0 })), + (this.pie10 = this.pie10 || c(this.primaryColor, { h: 60, l: -20 })), + (this.pie11 = this.pie11 || c(this.primaryColor, { h: -60, l: -20 })), + (this.pie12 = this.pie12 || c(this.primaryColor, { h: 120, l: -10 })), + (this.pieTitleTextSize = this.pieTitleTextSize || "25px"), + (this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor), + (this.pieSectionTextSize = this.pieSectionTextSize || "17px"), + (this.pieSectionTextColor = this.pieSectionTextColor || this.textColor), + (this.pieLegendTextSize = this.pieLegendTextSize || "17px"), + (this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor), + (this.pieStrokeColor = this.pieStrokeColor || "black"), + (this.pieStrokeWidth = this.pieStrokeWidth || "2px"), + (this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px"), + (this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black"), + (this.pieOpacity = this.pieOpacity || "0.7"), + (this.quadrant1Fill = this.quadrant1Fill || this.primaryColor), + (this.quadrant2Fill = this.quadrant2Fill || c(this.primaryColor, { r: 5, g: 5, b: 5 })), + (this.quadrant3Fill = this.quadrant3Fill || c(this.primaryColor, { r: 10, g: 10, b: 10 })), + (this.quadrant4Fill = this.quadrant4Fill || c(this.primaryColor, { r: 15, g: 15, b: 15 })), + (this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor), + (this.quadrant2TextFill = this.quadrant2TextFill || c(this.primaryTextColor, { r: -5, g: -5, b: -5 })), + (this.quadrant3TextFill = this.quadrant3TextFill || c(this.primaryTextColor, { r: -10, g: -10, b: -10 })), + (this.quadrant4TextFill = this.quadrant4TextFill || c(this.primaryTextColor, { r: -15, g: -15, b: -15 })), + (this.quadrantPointFill = + this.quadrantPointFill || (0, g.Z)(this.quadrant1Fill) ? (0, p.Z)(this.quadrant1Fill) : (0, d.Z)(this.quadrant1Fill)), + (this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor), + (this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor), + (this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor), + (this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor), + (this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor), + (this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor), + (this.requirementBackground = this.requirementBackground || this.primaryColor), + (this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor), + (this.requirementBorderSize = this.requirementBorderSize || "1"), + (this.requirementTextColor = this.requirementTextColor || this.primaryTextColor), + (this.relationColor = this.relationColor || this.lineColor), + (this.relationLabelBackground = + this.relationLabelBackground || (this.darkMode ? (0, d.Z)(this.secondaryColor, 30) : this.secondaryColor)), + (this.relationLabelColor = this.relationLabelColor || this.actorTextColor), + (this.git0 = this.git0 || this.primaryColor), + (this.git1 = this.git1 || this.secondaryColor), + (this.git2 = this.git2 || this.tertiaryColor), + (this.git3 = this.git3 || c(this.primaryColor, { h: -30 })), + (this.git4 = this.git4 || c(this.primaryColor, { h: -60 })), + (this.git5 = this.git5 || c(this.primaryColor, { h: -90 })), + (this.git6 = this.git6 || c(this.primaryColor, { h: 60 })), + (this.git7 = this.git7 || c(this.primaryColor, { h: 120 })), + this.darkMode + ? ((this.git0 = (0, p.Z)(this.git0, 25)), + (this.git1 = (0, p.Z)(this.git1, 25)), + (this.git2 = (0, p.Z)(this.git2, 25)), + (this.git3 = (0, p.Z)(this.git3, 25)), + (this.git4 = (0, p.Z)(this.git4, 25)), + (this.git5 = (0, p.Z)(this.git5, 25)), + (this.git6 = (0, p.Z)(this.git6, 25)), + (this.git7 = (0, p.Z)(this.git7, 25))) + : ((this.git0 = (0, d.Z)(this.git0, 25)), + (this.git1 = (0, d.Z)(this.git1, 25)), + (this.git2 = (0, d.Z)(this.git2, 25)), + (this.git3 = (0, d.Z)(this.git3, 25)), + (this.git4 = (0, d.Z)(this.git4, 25)), + (this.git5 = (0, d.Z)(this.git5, 25)), + (this.git6 = (0, d.Z)(this.git6, 25)), + (this.git7 = (0, d.Z)(this.git7, 25))), + (this.gitInv0 = this.gitInv0 || f(this.git0)), + (this.gitInv1 = this.gitInv1 || f(this.git1)), + (this.gitInv2 = this.gitInv2 || f(this.git2)), + (this.gitInv3 = this.gitInv3 || f(this.git3)), + (this.gitInv4 = this.gitInv4 || f(this.git4)), + (this.gitInv5 = this.gitInv5 || f(this.git5)), + (this.gitInv6 = this.gitInv6 || f(this.git6)), + (this.gitInv7 = this.gitInv7 || f(this.git7)), + (this.branchLabelColor = this.branchLabelColor || (this.darkMode ? "black" : this.labelTextColor)), + (this.gitBranchLabel0 = this.gitBranchLabel0 || this.branchLabelColor), + (this.gitBranchLabel1 = this.gitBranchLabel1 || this.branchLabelColor), + (this.gitBranchLabel2 = this.gitBranchLabel2 || this.branchLabelColor), + (this.gitBranchLabel3 = this.gitBranchLabel3 || this.branchLabelColor), + (this.gitBranchLabel4 = this.gitBranchLabel4 || this.branchLabelColor), + (this.gitBranchLabel5 = this.gitBranchLabel5 || this.branchLabelColor), + (this.gitBranchLabel6 = this.gitBranchLabel6 || this.branchLabelColor), + (this.gitBranchLabel7 = this.gitBranchLabel7 || this.branchLabelColor), + (this.tagLabelColor = this.tagLabelColor || this.primaryTextColor), + (this.tagLabelBackground = this.tagLabelBackground || this.primaryColor), + (this.tagLabelBorder = this.tagBorder || this.primaryBorderColor), + (this.tagLabelFontSize = this.tagLabelFontSize || "10px"), + (this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor), + (this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor), + (this.commitLabelFontSize = this.commitLabelFontSize || "10px"), + (this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || yt), + (this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || _t); + } + calculate(t) { + if ("object" != typeof t) return void this.updateColors(); + const e = Object.keys(t); + e.forEach((e) => { + this[e] = t[e]; + }), + this.updateColors(), + e.forEach((e) => { + this[e] = t[e]; + }); + } + })(); + return e.calculate(t), e; + }, + }, + dark: { + getThemeVariables: (t) => { + const e = new (class { + constructor() { + (this.background = "#333"), + (this.primaryColor = "#1f2020"), + (this.secondaryColor = (0, p.Z)(this.primaryColor, 16)), + (this.tertiaryColor = c(this.primaryColor, { h: -160 })), + (this.primaryBorderColor = f(this.background)), + (this.secondaryBorderColor = mt(this.secondaryColor, this.darkMode)), + (this.tertiaryBorderColor = mt(this.tertiaryColor, this.darkMode)), + (this.primaryTextColor = f(this.primaryColor)), + (this.secondaryTextColor = f(this.secondaryColor)), + (this.tertiaryTextColor = f(this.tertiaryColor)), + (this.lineColor = f(this.background)), + (this.textColor = f(this.background)), + (this.mainBkg = "#1f2020"), + (this.secondBkg = "calculated"), + (this.mainContrastColor = "lightgrey"), + (this.darkTextColor = (0, p.Z)(f("#323D47"), 10)), + (this.lineColor = "calculated"), + (this.border1 = "#81B1DB"), + (this.border2 = (0, u.Z)(255, 255, 255, 0.25)), + (this.arrowheadColor = "calculated"), + (this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'), + (this.fontSize = "16px"), + (this.labelBackground = "#181818"), + (this.textColor = "#ccc"), + (this.THEME_COLOR_LIMIT = 12), + (this.nodeBkg = "calculated"), + (this.nodeBorder = "calculated"), + (this.clusterBkg = "calculated"), + (this.clusterBorder = "calculated"), + (this.defaultLinkColor = "calculated"), + (this.titleColor = "#F9FFFE"), + (this.edgeLabelBackground = "calculated"), + (this.actorBorder = "calculated"), + (this.actorBkg = "calculated"), + (this.actorTextColor = "calculated"), + (this.actorLineColor = "calculated"), + (this.signalColor = "calculated"), + (this.signalTextColor = "calculated"), + (this.labelBoxBkgColor = "calculated"), + (this.labelBoxBorderColor = "calculated"), + (this.labelTextColor = "calculated"), + (this.loopTextColor = "calculated"), + (this.noteBorderColor = "calculated"), + (this.noteBkgColor = "#fff5ad"), + (this.noteTextColor = "calculated"), + (this.activationBorderColor = "calculated"), + (this.activationBkgColor = "calculated"), + (this.sequenceNumberColor = "black"), + (this.sectionBkgColor = (0, d.Z)("#EAE8D9", 30)), + (this.altSectionBkgColor = "calculated"), + (this.sectionBkgColor2 = "#EAE8D9"), + (this.excludeBkgColor = (0, d.Z)(this.sectionBkgColor, 10)), + (this.taskBorderColor = (0, u.Z)(255, 255, 255, 70)), + (this.taskBkgColor = "calculated"), + (this.taskTextColor = "calculated"), + (this.taskTextLightColor = "calculated"), + (this.taskTextOutsideColor = "calculated"), + (this.taskTextClickableColor = "#003163"), + (this.activeTaskBorderColor = (0, u.Z)(255, 255, 255, 50)), + (this.activeTaskBkgColor = "#81B1DB"), + (this.gridColor = "calculated"), + (this.doneTaskBkgColor = "calculated"), + (this.doneTaskBorderColor = "grey"), + (this.critBorderColor = "#E83737"), + (this.critBkgColor = "#E83737"), + (this.taskTextDarkColor = "calculated"), + (this.todayLineColor = "#DB5757"), + (this.personBorder = this.primaryBorderColor), + (this.personBkg = this.mainBkg), + (this.labelColor = "calculated"), + (this.errorBkgColor = "#a44141"), + (this.errorTextColor = "#ddd"); + } + updateColors() { + (this.secondBkg = (0, p.Z)(this.mainBkg, 16)), + (this.lineColor = this.mainContrastColor), + (this.arrowheadColor = this.mainContrastColor), + (this.nodeBkg = this.mainBkg), + (this.nodeBorder = this.border1), + (this.clusterBkg = this.secondBkg), + (this.clusterBorder = this.border2), + (this.defaultLinkColor = this.lineColor), + (this.edgeLabelBackground = (0, p.Z)(this.labelBackground, 25)), + (this.actorBorder = this.border1), + (this.actorBkg = this.mainBkg), + (this.actorTextColor = this.mainContrastColor), + (this.actorLineColor = this.mainContrastColor), + (this.signalColor = this.mainContrastColor), + (this.signalTextColor = this.mainContrastColor), + (this.labelBoxBkgColor = this.actorBkg), + (this.labelBoxBorderColor = this.actorBorder), + (this.labelTextColor = this.mainContrastColor), + (this.loopTextColor = this.mainContrastColor), + (this.noteBorderColor = this.secondaryBorderColor), + (this.noteBkgColor = this.secondBkg), + (this.noteTextColor = this.secondaryTextColor), + (this.activationBorderColor = this.border1), + (this.activationBkgColor = this.secondBkg), + (this.altSectionBkgColor = this.background), + (this.taskBkgColor = (0, p.Z)(this.mainBkg, 23)), + (this.taskTextColor = this.darkTextColor), + (this.taskTextLightColor = this.mainContrastColor), + (this.taskTextOutsideColor = this.taskTextLightColor), + (this.gridColor = this.mainContrastColor), + (this.doneTaskBkgColor = this.mainContrastColor), + (this.taskTextDarkColor = this.darkTextColor), + (this.transitionColor = this.transitionColor || this.lineColor), + (this.transitionLabelColor = this.transitionLabelColor || this.textColor), + (this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor), + (this.stateBkg = this.stateBkg || this.mainBkg), + (this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg), + (this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor), + (this.altBackground = this.altBackground || "#555"), + (this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg), + (this.compositeBorder = this.compositeBorder || this.nodeBorder), + (this.innerEndBackground = this.primaryBorderColor), + (this.specialStateColor = "#f4f4f4"), + (this.errorBkgColor = this.errorBkgColor || this.tertiaryColor), + (this.errorTextColor = this.errorTextColor || this.tertiaryTextColor), + (this.fillType0 = this.primaryColor), + (this.fillType1 = this.secondaryColor), + (this.fillType2 = c(this.primaryColor, { h: 64 })), + (this.fillType3 = c(this.secondaryColor, { h: 64 })), + (this.fillType4 = c(this.primaryColor, { h: -64 })), + (this.fillType5 = c(this.secondaryColor, { h: -64 })), + (this.fillType6 = c(this.primaryColor, { h: 128 })), + (this.fillType7 = c(this.secondaryColor, { h: 128 })), + (this.cScale1 = this.cScale1 || "#0b0000"), + (this.cScale2 = this.cScale2 || "#4d1037"), + (this.cScale3 = this.cScale3 || "#3f5258"), + (this.cScale4 = this.cScale4 || "#4f2f1b"), + (this.cScale5 = this.cScale5 || "#6e0a0a"), + (this.cScale6 = this.cScale6 || "#3b0048"), + (this.cScale7 = this.cScale7 || "#995a01"), + (this.cScale8 = this.cScale8 || "#154706"), + (this.cScale9 = this.cScale9 || "#161722"), + (this.cScale10 = this.cScale10 || "#00296f"), + (this.cScale11 = this.cScale11 || "#01629c"), + (this.cScale12 = this.cScale12 || "#010029"), + (this.cScale0 = this.cScale0 || this.primaryColor), + (this.cScale1 = this.cScale1 || this.secondaryColor), + (this.cScale2 = this.cScale2 || this.tertiaryColor), + (this.cScale3 = this.cScale3 || c(this.primaryColor, { h: 30 })), + (this.cScale4 = this.cScale4 || c(this.primaryColor, { h: 60 })), + (this.cScale5 = this.cScale5 || c(this.primaryColor, { h: 90 })), + (this.cScale6 = this.cScale6 || c(this.primaryColor, { h: 120 })), + (this.cScale7 = this.cScale7 || c(this.primaryColor, { h: 150 })), + (this.cScale8 = this.cScale8 || c(this.primaryColor, { h: 210 })), + (this.cScale9 = this.cScale9 || c(this.primaryColor, { h: 270 })), + (this.cScale10 = this.cScale10 || c(this.primaryColor, { h: 300 })), + (this.cScale11 = this.cScale11 || c(this.primaryColor, { h: 330 })); + for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) this["cScaleInv" + t] = this["cScaleInv" + t] || f(this["cScale" + t]); + for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) + this["cScalePeer" + t] = this["cScalePeer" + t] || (0, p.Z)(this["cScale" + t], 10); + for (let t = 0; t < 5; t++) + (this["surface" + t] = this["surface" + t] || c(this.mainBkg, { h: 30, s: -30, l: -(4 * t - 10) })), + (this["surfacePeer" + t] = this["surfacePeer" + t] || c(this.mainBkg, { h: 30, s: -30, l: -(4 * t - 7) })); + this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor); + for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) this["cScaleLabel" + t] = this["cScaleLabel" + t] || this.scaleLabelColor; + for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) this["pie" + t] = this["cScale" + t]; + (this.pieTitleTextSize = this.pieTitleTextSize || "25px"), + (this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor), + (this.pieSectionTextSize = this.pieSectionTextSize || "17px"), + (this.pieSectionTextColor = this.pieSectionTextColor || this.textColor), + (this.pieLegendTextSize = this.pieLegendTextSize || "17px"), + (this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor), + (this.pieStrokeColor = this.pieStrokeColor || "black"), + (this.pieStrokeWidth = this.pieStrokeWidth || "2px"), + (this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px"), + (this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black"), + (this.pieOpacity = this.pieOpacity || "0.7"), + (this.quadrant1Fill = this.quadrant1Fill || this.primaryColor), + (this.quadrant2Fill = this.quadrant2Fill || c(this.primaryColor, { r: 5, g: 5, b: 5 })), + (this.quadrant3Fill = this.quadrant3Fill || c(this.primaryColor, { r: 10, g: 10, b: 10 })), + (this.quadrant4Fill = this.quadrant4Fill || c(this.primaryColor, { r: 15, g: 15, b: 15 })), + (this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor), + (this.quadrant2TextFill = this.quadrant2TextFill || c(this.primaryTextColor, { r: -5, g: -5, b: -5 })), + (this.quadrant3TextFill = this.quadrant3TextFill || c(this.primaryTextColor, { r: -10, g: -10, b: -10 })), + (this.quadrant4TextFill = this.quadrant4TextFill || c(this.primaryTextColor, { r: -15, g: -15, b: -15 })), + (this.quadrantPointFill = + this.quadrantPointFill || (0, g.Z)(this.quadrant1Fill) ? (0, p.Z)(this.quadrant1Fill) : (0, d.Z)(this.quadrant1Fill)), + (this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor), + (this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor), + (this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor), + (this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor), + (this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor), + (this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor), + (this.classText = this.primaryTextColor), + (this.requirementBackground = this.requirementBackground || this.primaryColor), + (this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor), + (this.requirementBorderSize = this.requirementBorderSize || "1"), + (this.requirementTextColor = this.requirementTextColor || this.primaryTextColor), + (this.relationColor = this.relationColor || this.lineColor), + (this.relationLabelBackground = + this.relationLabelBackground || (this.darkMode ? (0, d.Z)(this.secondaryColor, 30) : this.secondaryColor)), + (this.relationLabelColor = this.relationLabelColor || this.actorTextColor), + (this.git0 = (0, p.Z)(this.secondaryColor, 20)), + (this.git1 = (0, p.Z)(this.pie2 || this.secondaryColor, 20)), + (this.git2 = (0, p.Z)(this.pie3 || this.tertiaryColor, 20)), + (this.git3 = (0, p.Z)(this.pie4 || c(this.primaryColor, { h: -30 }), 20)), + (this.git4 = (0, p.Z)(this.pie5 || c(this.primaryColor, { h: -60 }), 20)), + (this.git5 = (0, p.Z)(this.pie6 || c(this.primaryColor, { h: -90 }), 10)), + (this.git6 = (0, p.Z)(this.pie7 || c(this.primaryColor, { h: 60 }), 10)), + (this.git7 = (0, p.Z)(this.pie8 || c(this.primaryColor, { h: 120 }), 20)), + (this.gitInv0 = this.gitInv0 || f(this.git0)), + (this.gitInv1 = this.gitInv1 || f(this.git1)), + (this.gitInv2 = this.gitInv2 || f(this.git2)), + (this.gitInv3 = this.gitInv3 || f(this.git3)), + (this.gitInv4 = this.gitInv4 || f(this.git4)), + (this.gitInv5 = this.gitInv5 || f(this.git5)), + (this.gitInv6 = this.gitInv6 || f(this.git6)), + (this.gitInv7 = this.gitInv7 || f(this.git7)), + (this.gitBranchLabel0 = this.gitBranchLabel0 || f(this.labelTextColor)), + (this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor), + (this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor), + (this.gitBranchLabel3 = this.gitBranchLabel3 || f(this.labelTextColor)), + (this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor), + (this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor), + (this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor), + (this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor), + (this.tagLabelColor = this.tagLabelColor || this.primaryTextColor), + (this.tagLabelBackground = this.tagLabelBackground || this.primaryColor), + (this.tagLabelBorder = this.tagBorder || this.primaryBorderColor), + (this.tagLabelFontSize = this.tagLabelFontSize || "10px"), + (this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor), + (this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor), + (this.commitLabelFontSize = this.commitLabelFontSize || "10px"), + (this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || (0, p.Z)(this.background, 12)), + (this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || (0, p.Z)(this.background, 2)); + } + calculate(t) { + if ("object" != typeof t) return void this.updateColors(); + const e = Object.keys(t); + e.forEach((e) => { + this[e] = t[e]; + }), + this.updateColors(), + e.forEach((e) => { + this[e] = t[e]; + }); + } + })(); + return e.calculate(t), e; + }, + }, + default: { getThemeVariables: bt }, + forest: { + getThemeVariables: (t) => { + const e = new (class { + constructor() { + (this.background = "#f4f4f4"), + (this.primaryColor = "#cde498"), + (this.secondaryColor = "#cdffb2"), + (this.background = "white"), + (this.mainBkg = "#cde498"), + (this.secondBkg = "#cdffb2"), + (this.lineColor = "green"), + (this.border1 = "#13540c"), + (this.border2 = "#6eaa49"), + (this.arrowheadColor = "green"), + (this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'), + (this.fontSize = "16px"), + (this.tertiaryColor = (0, p.Z)("#cde498", 10)), + (this.primaryBorderColor = mt(this.primaryColor, this.darkMode)), + (this.secondaryBorderColor = mt(this.secondaryColor, this.darkMode)), + (this.tertiaryBorderColor = mt(this.tertiaryColor, this.darkMode)), + (this.primaryTextColor = f(this.primaryColor)), + (this.secondaryTextColor = f(this.secondaryColor)), + (this.tertiaryTextColor = f(this.primaryColor)), + (this.lineColor = f(this.background)), + (this.textColor = f(this.background)), + (this.THEME_COLOR_LIMIT = 12), + (this.nodeBkg = "calculated"), + (this.nodeBorder = "calculated"), + (this.clusterBkg = "calculated"), + (this.clusterBorder = "calculated"), + (this.defaultLinkColor = "calculated"), + (this.titleColor = "#333"), + (this.edgeLabelBackground = "#e8e8e8"), + (this.actorBorder = "calculated"), + (this.actorBkg = "calculated"), + (this.actorTextColor = "black"), + (this.actorLineColor = "grey"), + (this.signalColor = "#333"), + (this.signalTextColor = "#333"), + (this.labelBoxBkgColor = "calculated"), + (this.labelBoxBorderColor = "#326932"), + (this.labelTextColor = "calculated"), + (this.loopTextColor = "calculated"), + (this.noteBorderColor = "calculated"), + (this.noteBkgColor = "#fff5ad"), + (this.noteTextColor = "calculated"), + (this.activationBorderColor = "#666"), + (this.activationBkgColor = "#f4f4f4"), + (this.sequenceNumberColor = "white"), + (this.sectionBkgColor = "#6eaa49"), + (this.altSectionBkgColor = "white"), + (this.sectionBkgColor2 = "#6eaa49"), + (this.excludeBkgColor = "#eeeeee"), + (this.taskBorderColor = "calculated"), + (this.taskBkgColor = "#487e3a"), + (this.taskTextLightColor = "white"), + (this.taskTextColor = "calculated"), + (this.taskTextDarkColor = "black"), + (this.taskTextOutsideColor = "calculated"), + (this.taskTextClickableColor = "#003163"), + (this.activeTaskBorderColor = "calculated"), + (this.activeTaskBkgColor = "calculated"), + (this.gridColor = "lightgrey"), + (this.doneTaskBkgColor = "lightgrey"), + (this.doneTaskBorderColor = "grey"), + (this.critBorderColor = "#ff8888"), + (this.critBkgColor = "red"), + (this.todayLineColor = "red"), + (this.personBorder = this.primaryBorderColor), + (this.personBkg = this.mainBkg), + (this.labelColor = "black"), + (this.errorBkgColor = "#552222"), + (this.errorTextColor = "#552222"); + } + updateColors() { + (this.actorBorder = (0, d.Z)(this.mainBkg, 20)), + (this.actorBkg = this.mainBkg), + (this.labelBoxBkgColor = this.actorBkg), + (this.labelTextColor = this.actorTextColor), + (this.loopTextColor = this.actorTextColor), + (this.noteBorderColor = this.border2), + (this.noteTextColor = this.actorTextColor), + (this.cScale0 = this.cScale0 || this.primaryColor), + (this.cScale1 = this.cScale1 || this.secondaryColor), + (this.cScale2 = this.cScale2 || this.tertiaryColor), + (this.cScale3 = this.cScale3 || c(this.primaryColor, { h: 30 })), + (this.cScale4 = this.cScale4 || c(this.primaryColor, { h: 60 })), + (this.cScale5 = this.cScale5 || c(this.primaryColor, { h: 90 })), + (this.cScale6 = this.cScale6 || c(this.primaryColor, { h: 120 })), + (this.cScale7 = this.cScale7 || c(this.primaryColor, { h: 150 })), + (this.cScale8 = this.cScale8 || c(this.primaryColor, { h: 210 })), + (this.cScale9 = this.cScale9 || c(this.primaryColor, { h: 270 })), + (this.cScale10 = this.cScale10 || c(this.primaryColor, { h: 300 })), + (this.cScale11 = this.cScale11 || c(this.primaryColor, { h: 330 })), + (this.cScalePeer1 = this.cScalePeer1 || (0, d.Z)(this.secondaryColor, 45)), + (this.cScalePeer2 = this.cScalePeer2 || (0, d.Z)(this.tertiaryColor, 40)); + for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) + (this["cScale" + t] = (0, d.Z)(this["cScale" + t], 10)), + (this["cScalePeer" + t] = this["cScalePeer" + t] || (0, d.Z)(this["cScale" + t], 25)); + for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) this["cScaleInv" + t] = this["cScaleInv" + t] || c(this["cScale" + t], { h: 180 }); + this.scaleLabelColor = "calculated" !== this.scaleLabelColor && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor; + for (let t = 0; t < this.THEME_COLOR_LIMIT; t++) this["cScaleLabel" + t] = this["cScaleLabel" + t] || this.scaleLabelColor; + for (let t = 0; t < 5; t++) + (this["surface" + t] = this["surface" + t] || c(this.mainBkg, { h: 30, s: -30, l: -(5 + 5 * t) })), + (this["surfacePeer" + t] = this["surfacePeer" + t] || c(this.mainBkg, { h: 30, s: -30, l: -(8 + 5 * t) })); + (this.nodeBkg = this.mainBkg), + (this.nodeBorder = this.border1), + (this.clusterBkg = this.secondBkg), + (this.clusterBorder = this.border2), + (this.defaultLinkColor = this.lineColor), + (this.taskBorderColor = this.border1), + (this.taskTextColor = this.taskTextLightColor), + (this.taskTextOutsideColor = this.taskTextDarkColor), + (this.activeTaskBorderColor = this.taskBorderColor), + (this.activeTaskBkgColor = this.mainBkg), + (this.transitionColor = this.transitionColor || this.lineColor), + (this.transitionLabelColor = this.transitionLabelColor || this.textColor), + (this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor), + (this.stateBkg = this.stateBkg || this.mainBkg), + (this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg), + (this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor), + (this.altBackground = this.altBackground || "#f0f0f0"), + (this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg), + (this.compositeBorder = this.compositeBorder || this.nodeBorder), + (this.innerEndBackground = this.primaryBorderColor), + (this.specialStateColor = this.lineColor), + (this.errorBkgColor = this.errorBkgColor || this.tertiaryColor), + (this.errorTextColor = this.errorTextColor || this.tertiaryTextColor), + (this.transitionColor = this.transitionColor || this.lineColor), + (this.classText = this.primaryTextColor), + (this.fillType0 = this.primaryColor), + (this.fillType1 = this.secondaryColor), + (this.fillType2 = c(this.primaryColor, { h: 64 })), + (this.fillType3 = c(this.secondaryColor, { h: 64 })), + (this.fillType4 = c(this.primaryColor, { h: -64 })), + (this.fillType5 = c(this.secondaryColor, { h: -64 })), + (this.fillType6 = c(this.primaryColor, { h: 128 })), + (this.fillType7 = c(this.secondaryColor, { h: 128 })), + (this.pie1 = this.pie1 || this.primaryColor), + (this.pie2 = this.pie2 || this.secondaryColor), + (this.pie3 = this.pie3 || this.tertiaryColor), + (this.pie4 = this.pie4 || c(this.primaryColor, { l: -30 })), + (this.pie5 = this.pie5 || c(this.secondaryColor, { l: -30 })), + (this.pie6 = this.pie6 || c(this.tertiaryColor, { h: 40, l: -40 })), + (this.pie7 = this.pie7 || c(this.primaryColor, { h: 60, l: -10 })), + (this.pie8 = this.pie8 || c(this.primaryColor, { h: -60, l: -10 })), + (this.pie9 = this.pie9 || c(this.primaryColor, { h: 120, l: 0 })), + (this.pie10 = this.pie10 || c(this.primaryColor, { h: 60, l: -50 })), + (this.pie11 = this.pie11 || c(this.primaryColor, { h: -60, l: -50 })), + (this.pie12 = this.pie12 || c(this.primaryColor, { h: 120, l: -50 })), + (this.pieTitleTextSize = this.pieTitleTextSize || "25px"), + (this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor), + (this.pieSectionTextSize = this.pieSectionTextSize || "17px"), + (this.pieSectionTextColor = this.pieSectionTextColor || this.textColor), + (this.pieLegendTextSize = this.pieLegendTextSize || "17px"), + (this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor), + (this.pieStrokeColor = this.pieStrokeColor || "black"), + (this.pieStrokeWidth = this.pieStrokeWidth || "2px"), + (this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px"), + (this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black"), + (this.pieOpacity = this.pieOpacity || "0.7"), + (this.quadrant1Fill = this.quadrant1Fill || this.primaryColor), + (this.quadrant2Fill = this.quadrant2Fill || c(this.primaryColor, { r: 5, g: 5, b: 5 })), + (this.quadrant3Fill = this.quadrant3Fill || c(this.primaryColor, { r: 10, g: 10, b: 10 })), + (this.quadrant4Fill = this.quadrant4Fill || c(this.primaryColor, { r: 15, g: 15, b: 15 })), + (this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor), + (this.quadrant2TextFill = this.quadrant2TextFill || c(this.primaryTextColor, { r: -5, g: -5, b: -5 })), + (this.quadrant3TextFill = this.quadrant3TextFill || c(this.primaryTextColor, { r: -10, g: -10, b: -10 })), + (this.quadrant4TextFill = this.quadrant4TextFill || c(this.primaryTextColor, { r: -15, g: -15, b: -15 })), + (this.quadrantPointFill = + this.quadrantPointFill || (0, g.Z)(this.quadrant1Fill) ? (0, p.Z)(this.quadrant1Fill) : (0, d.Z)(this.quadrant1Fill)), + (this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor), + (this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor), + (this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor), + (this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor), + (this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor), + (this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor), + (this.requirementBackground = this.requirementBackground || this.primaryColor), + (this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor), + (this.requirementBorderSize = this.requirementBorderSize || "1"), + (this.requirementTextColor = this.requirementTextColor || this.primaryTextColor), + (this.relationColor = this.relationColor || this.lineColor), + (this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground), + (this.relationLabelColor = this.relationLabelColor || this.actorTextColor), + (this.git0 = this.git0 || this.primaryColor), + (this.git1 = this.git1 || this.secondaryColor), + (this.git2 = this.git2 || this.tertiaryColor), + (this.git3 = this.git3 || c(this.primaryColor, { h: -30 })), + (this.git4 = this.git4 || c(this.primaryColor, { h: -60 })), + (this.git5 = this.git5 || c(this.primaryColor, { h: -90 })), + (this.git6 = this.git6 || c(this.primaryColor, { h: 60 })), + (this.git7 = this.git7 || c(this.primaryColor, { h: 120 })), + this.darkMode + ? ((this.git0 = (0, p.Z)(this.git0, 25)), + (this.git1 = (0, p.Z)(this.git1, 25)), + (this.git2 = (0, p.Z)(this.git2, 25)), + (this.git3 = (0, p.Z)(this.git3, 25)), + (this.git4 = (0, p.Z)(this.git4, 25)), + (this.git5 = (0, p.Z)(this.git5, 25)), + (this.git6 = (0, p.Z)(this.git6, 25)), + (this.git7 = (0, p.Z)(this.git7, 25))) + : ((this.git0 = (0, d.Z)(this.git0, 25)), + (this.git1 = (0, d.Z)(this.git1, 25)), + (this.git2 = (0, d.Z)(this.git2, 25)), + (this.git3 = (0, d.Z)(this.git3, 25)), + (this.git4 = (0, d.Z)(this.git4, 25)), + (this.git5 = (0, d.Z)(this.git5, 25)), + (this.git6 = (0, d.Z)(this.git6, 25)), + (this.git7 = (0, d.Z)(this.git7, 25))), + (this.gitInv0 = this.gitInv0 || f(this.git0)), + (this.gitInv1 = this.gitInv1 || f(this.git1)), + (this.gitInv2 = this.gitInv2 || f(this.git2)), + (this.gitInv3 = this.gitInv3 || f(this.git3)), + (this.gitInv4 = this.gitInv4 || f(this.git4)), + (this.gitInv5 = this.gitInv5 || f(this.git5)), + (this.gitInv6 = this.gitInv6 || f(this.git6)), + (this.gitInv7 = this.gitInv7 || f(this.git7)), + (this.gitBranchLabel0 = this.gitBranchLabel0 || f(this.labelTextColor)), + (this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor), + (this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor), + (this.gitBranchLabel3 = this.gitBranchLabel3 || f(this.labelTextColor)), + (this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor), + (this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor), + (this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor), + (this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor), + (this.tagLabelColor = this.tagLabelColor || this.primaryTextColor), + (this.tagLabelBackground = this.tagLabelBackground || this.primaryColor), + (this.tagLabelBorder = this.tagBorder || this.primaryBorderColor), + (this.tagLabelFontSize = this.tagLabelFontSize || "10px"), + (this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor), + (this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor), + (this.commitLabelFontSize = this.commitLabelFontSize || "10px"), + (this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || yt), + (this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || _t); + } + calculate(t) { + if ("object" != typeof t) return void this.updateColors(); + const e = Object.keys(t); + e.forEach((e) => { + this[e] = t[e]; + }), + this.updateColors(), + e.forEach((e) => { + this[e] = t[e]; + }); + } + })(); + return e.calculate(t), e; + }, + }, + neutral: { + getThemeVariables: (t) => { + const e = new Ct(); + return e.calculate(t), e; + }, + }, + }, + vt = { + flowchart: { + useMaxWidth: !0, + titleTopMargin: 25, + diagramPadding: 8, + htmlLabels: !0, + nodeSpacing: 50, + rankSpacing: 50, + curve: "basis", + padding: 15, + defaultRenderer: "dagre-wrapper", + wrappingWidth: 200, + }, + sequence: { + useMaxWidth: !0, + hideUnusedParticipants: !1, + activationWidth: 10, + diagramMarginX: 50, + diagramMarginY: 10, + actorMargin: 50, + width: 150, + height: 65, + boxMargin: 10, + boxTextMargin: 5, + noteMargin: 10, + messageMargin: 35, + messageAlign: "center", + mirrorActors: !0, + forceMenus: !1, + bottomMarginAdj: 1, + rightAngles: !1, + showSequenceNumbers: !1, + actorFontSize: 14, + actorFontFamily: '"Open Sans", sans-serif', + actorFontWeight: 400, + noteFontSize: 14, + noteFontFamily: '"trebuchet ms", verdana, arial, sans-serif', + noteFontWeight: 400, + noteAlign: "center", + messageFontSize: 16, + messageFontFamily: '"trebuchet ms", verdana, arial, sans-serif', + messageFontWeight: 400, + wrap: !1, + wrapPadding: 10, + labelBoxWidth: 50, + labelBoxHeight: 20, + }, + gantt: { + useMaxWidth: !0, + titleTopMargin: 25, + barHeight: 20, + barGap: 4, + topPadding: 50, + rightPadding: 75, + leftPadding: 75, + gridLineStartPadding: 35, + fontSize: 11, + sectionFontSize: 11, + numberSectionStyles: 4, + axisFormat: "%Y-%m-%d", + topAxis: !1, + displayMode: "", + weekday: "sunday", + }, + journey: { + useMaxWidth: !0, + diagramMarginX: 50, + diagramMarginY: 10, + leftMargin: 150, + width: 150, + height: 50, + boxMargin: 10, + boxTextMargin: 5, + noteMargin: 10, + messageMargin: 35, + messageAlign: "center", + bottomMarginAdj: 1, + rightAngles: !1, + taskFontSize: 14, + taskFontFamily: '"Open Sans", sans-serif', + taskMargin: 50, + activationWidth: 10, + textPlacement: "fo", + actorColours: ["#8FBC8F", "#7CFC00", "#00FFFF", "#20B2AA", "#B0E0E6", "#FFFFE0"], + sectionFills: ["#191970", "#8B008B", "#4B0082", "#2F4F4F", "#800000", "#8B4513", "#00008B"], + sectionColours: ["#fff"], + }, + class: { + useMaxWidth: !0, + titleTopMargin: 25, + arrowMarkerAbsolute: !1, + dividerMargin: 10, + padding: 5, + textHeight: 10, + defaultRenderer: "dagre-wrapper", + htmlLabels: !1, + }, + state: { + useMaxWidth: !0, + titleTopMargin: 25, + dividerMargin: 10, + sizeUnit: 5, + padding: 8, + textHeight: 10, + titleShift: -15, + noteMargin: 10, + forkWidth: 70, + forkHeight: 7, + miniPadding: 2, + fontSizeFactor: 5.02, + fontSize: 24, + labelHeight: 16, + edgeLengthFactor: "20", + compositTitleSize: 35, + radius: 5, + defaultRenderer: "dagre-wrapper", + }, + er: { + useMaxWidth: !0, + titleTopMargin: 25, + diagramPadding: 20, + layoutDirection: "TB", + minEntityWidth: 100, + minEntityHeight: 75, + entityPadding: 15, + stroke: "gray", + fill: "honeydew", + fontSize: 12, + }, + pie: { useMaxWidth: !0, textPosition: 0.75 }, + quadrantChart: { + useMaxWidth: !0, + chartWidth: 500, + chartHeight: 500, + titleFontSize: 20, + titlePadding: 10, + quadrantPadding: 5, + xAxisLabelPadding: 5, + yAxisLabelPadding: 5, + xAxisLabelFontSize: 16, + yAxisLabelFontSize: 16, + quadrantLabelFontSize: 16, + quadrantTextTopPadding: 5, + pointTextPadding: 5, + pointLabelFontSize: 12, + pointRadius: 5, + xAxisPosition: "top", + yAxisPosition: "left", + quadrantInternalBorderStrokeWidth: 1, + quadrantExternalBorderStrokeWidth: 2, + }, + requirement: { + useMaxWidth: !0, + rect_fill: "#f9f9f9", + text_color: "#333", + rect_border_size: "0.5px", + rect_border_color: "#bbb", + rect_min_width: 200, + rect_min_height: 200, + fontSize: 14, + rect_padding: 10, + line_height: 20, + }, + mindmap: { useMaxWidth: !0, padding: 10, maxNodeWidth: 200 }, + timeline: { + useMaxWidth: !0, + diagramMarginX: 50, + diagramMarginY: 10, + leftMargin: 150, + width: 150, + height: 50, + boxMargin: 10, + boxTextMargin: 5, + noteMargin: 10, + messageMargin: 35, + messageAlign: "center", + bottomMarginAdj: 1, + rightAngles: !1, + taskFontSize: 14, + taskFontFamily: '"Open Sans", sans-serif', + taskMargin: 50, + activationWidth: 10, + textPlacement: "fo", + actorColours: ["#8FBC8F", "#7CFC00", "#00FFFF", "#20B2AA", "#B0E0E6", "#FFFFE0"], + sectionFills: ["#191970", "#8B008B", "#4B0082", "#2F4F4F", "#800000", "#8B4513", "#00008B"], + sectionColours: ["#fff"], + disableMulticolor: !1, + }, + gitGraph: { + useMaxWidth: !0, + titleTopMargin: 25, + diagramPadding: 8, + nodeLabel: { width: 75, height: 100, x: -25, y: 0 }, + mainBranchName: "main", + mainBranchOrder: 0, + showCommitLabel: !0, + showBranches: !0, + rotateCommitLabel: !0, + arrowMarkerAbsolute: !1, + }, + c4: { + useMaxWidth: !0, + diagramMarginX: 50, + diagramMarginY: 10, + c4ShapeMargin: 50, + c4ShapePadding: 20, + width: 216, + height: 60, + boxMargin: 10, + c4ShapeInRow: 4, + nextLinePaddingX: 0, + c4BoundaryInRow: 2, + personFontSize: 14, + personFontFamily: '"Open Sans", sans-serif', + personFontWeight: "normal", + external_personFontSize: 14, + external_personFontFamily: '"Open Sans", sans-serif', + external_personFontWeight: "normal", + systemFontSize: 14, + systemFontFamily: '"Open Sans", sans-serif', + systemFontWeight: "normal", + external_systemFontSize: 14, + external_systemFontFamily: '"Open Sans", sans-serif', + external_systemFontWeight: "normal", + system_dbFontSize: 14, + system_dbFontFamily: '"Open Sans", sans-serif', + system_dbFontWeight: "normal", + external_system_dbFontSize: 14, + external_system_dbFontFamily: '"Open Sans", sans-serif', + external_system_dbFontWeight: "normal", + system_queueFontSize: 14, + system_queueFontFamily: '"Open Sans", sans-serif', + system_queueFontWeight: "normal", + external_system_queueFontSize: 14, + external_system_queueFontFamily: '"Open Sans", sans-serif', + external_system_queueFontWeight: "normal", + boundaryFontSize: 14, + boundaryFontFamily: '"Open Sans", sans-serif', + boundaryFontWeight: "normal", + messageFontSize: 12, + messageFontFamily: '"Open Sans", sans-serif', + messageFontWeight: "normal", + containerFontSize: 14, + containerFontFamily: '"Open Sans", sans-serif', + containerFontWeight: "normal", + external_containerFontSize: 14, + external_containerFontFamily: '"Open Sans", sans-serif', + external_containerFontWeight: "normal", + container_dbFontSize: 14, + container_dbFontFamily: '"Open Sans", sans-serif', + container_dbFontWeight: "normal", + external_container_dbFontSize: 14, + external_container_dbFontFamily: '"Open Sans", sans-serif', + external_container_dbFontWeight: "normal", + container_queueFontSize: 14, + container_queueFontFamily: '"Open Sans", sans-serif', + container_queueFontWeight: "normal", + external_container_queueFontSize: 14, + external_container_queueFontFamily: '"Open Sans", sans-serif', + external_container_queueFontWeight: "normal", + componentFontSize: 14, + componentFontFamily: '"Open Sans", sans-serif', + componentFontWeight: "normal", + external_componentFontSize: 14, + external_componentFontFamily: '"Open Sans", sans-serif', + external_componentFontWeight: "normal", + component_dbFontSize: 14, + component_dbFontFamily: '"Open Sans", sans-serif', + component_dbFontWeight: "normal", + external_component_dbFontSize: 14, + external_component_dbFontFamily: '"Open Sans", sans-serif', + external_component_dbFontWeight: "normal", + component_queueFontSize: 14, + component_queueFontFamily: '"Open Sans", sans-serif', + component_queueFontWeight: "normal", + external_component_queueFontSize: 14, + external_component_queueFontFamily: '"Open Sans", sans-serif', + external_component_queueFontWeight: "normal", + wrap: !0, + wrapPadding: 10, + person_bg_color: "#08427B", + person_border_color: "#073B6F", + external_person_bg_color: "#686868", + external_person_border_color: "#8A8A8A", + system_bg_color: "#1168BD", + system_border_color: "#3C7FC0", + system_db_bg_color: "#1168BD", + system_db_border_color: "#3C7FC0", + system_queue_bg_color: "#1168BD", + system_queue_border_color: "#3C7FC0", + external_system_bg_color: "#999999", + external_system_border_color: "#8A8A8A", + external_system_db_bg_color: "#999999", + external_system_db_border_color: "#8A8A8A", + external_system_queue_bg_color: "#999999", + external_system_queue_border_color: "#8A8A8A", + container_bg_color: "#438DD5", + container_border_color: "#3C7FC0", + container_db_bg_color: "#438DD5", + container_db_border_color: "#3C7FC0", + container_queue_bg_color: "#438DD5", + container_queue_border_color: "#3C7FC0", + external_container_bg_color: "#B3B3B3", + external_container_border_color: "#A6A6A6", + external_container_db_bg_color: "#B3B3B3", + external_container_db_border_color: "#A6A6A6", + external_container_queue_bg_color: "#B3B3B3", + external_container_queue_border_color: "#A6A6A6", + component_bg_color: "#85BBF0", + component_border_color: "#78A8D8", + component_db_bg_color: "#85BBF0", + component_db_border_color: "#78A8D8", + component_queue_bg_color: "#85BBF0", + component_queue_border_color: "#78A8D8", + external_component_bg_color: "#CCCCCC", + external_component_border_color: "#BFBFBF", + external_component_db_bg_color: "#CCCCCC", + external_component_db_border_color: "#BFBFBF", + external_component_queue_bg_color: "#CCCCCC", + external_component_queue_border_color: "#BFBFBF", + }, + sankey: { + useMaxWidth: !0, + width: 600, + height: 400, + linkColor: "gradient", + nodeAlignment: "justify", + showValues: !0, + prefix: "", + suffix: "", + }, + theme: "default", + maxTextSize: 5e4, + darkMode: !1, + fontFamily: '"trebuchet ms", verdana, arial, sans-serif;', + logLevel: 5, + securityLevel: "strict", + startOnLoad: !0, + arrowMarkerAbsolute: !1, + secure: ["secure", "securityLevel", "startOnLoad", "maxTextSize"], + deterministicIds: !1, + fontSize: 16, + }, + kt = { + ...vt, + deterministicIDSeed: void 0, + themeCSS: void 0, + themeVariables: xt.default.getThemeVariables(), + sequence: { + ...vt.sequence, + messageFont: function () { + return { + fontFamily: this.messageFontFamily, + fontSize: this.messageFontSize, + fontWeight: this.messageFontWeight, + }; + }, + noteFont: function () { + return { + fontFamily: this.noteFontFamily, + fontSize: this.noteFontSize, + fontWeight: this.noteFontWeight, + }; + }, + actorFont: function () { + return { + fontFamily: this.actorFontFamily, + fontSize: this.actorFontSize, + fontWeight: this.actorFontWeight, + }; + }, + }, + gantt: { ...vt.gantt, tickInterval: void 0, useWidth: void 0 }, + c4: { + ...vt.c4, + useWidth: void 0, + personFont: function () { + return { + fontFamily: this.personFontFamily, + fontSize: this.personFontSize, + fontWeight: this.personFontWeight, + }; + }, + external_personFont: function () { + return { + fontFamily: this.external_personFontFamily, + fontSize: this.external_personFontSize, + fontWeight: this.external_personFontWeight, + }; + }, + systemFont: function () { + return { + fontFamily: this.systemFontFamily, + fontSize: this.systemFontSize, + fontWeight: this.systemFontWeight, + }; + }, + external_systemFont: function () { + return { + fontFamily: this.external_systemFontFamily, + fontSize: this.external_systemFontSize, + fontWeight: this.external_systemFontWeight, + }; + }, + system_dbFont: function () { + return { + fontFamily: this.system_dbFontFamily, + fontSize: this.system_dbFontSize, + fontWeight: this.system_dbFontWeight, + }; + }, + external_system_dbFont: function () { + return { + fontFamily: this.external_system_dbFontFamily, + fontSize: this.external_system_dbFontSize, + fontWeight: this.external_system_dbFontWeight, + }; + }, + system_queueFont: function () { + return { + fontFamily: this.system_queueFontFamily, + fontSize: this.system_queueFontSize, + fontWeight: this.system_queueFontWeight, + }; + }, + external_system_queueFont: function () { + return { + fontFamily: this.external_system_queueFontFamily, + fontSize: this.external_system_queueFontSize, + fontWeight: this.external_system_queueFontWeight, + }; + }, + containerFont: function () { + return { + fontFamily: this.containerFontFamily, + fontSize: this.containerFontSize, + fontWeight: this.containerFontWeight, + }; + }, + external_containerFont: function () { + return { + fontFamily: this.external_containerFontFamily, + fontSize: this.external_containerFontSize, + fontWeight: this.external_containerFontWeight, + }; + }, + container_dbFont: function () { + return { + fontFamily: this.container_dbFontFamily, + fontSize: this.container_dbFontSize, + fontWeight: this.container_dbFontWeight, + }; + }, + external_container_dbFont: function () { + return { + fontFamily: this.external_container_dbFontFamily, + fontSize: this.external_container_dbFontSize, + fontWeight: this.external_container_dbFontWeight, + }; + }, + container_queueFont: function () { + return { + fontFamily: this.container_queueFontFamily, + fontSize: this.container_queueFontSize, + fontWeight: this.container_queueFontWeight, + }; + }, + external_container_queueFont: function () { + return { + fontFamily: this.external_container_queueFontFamily, + fontSize: this.external_container_queueFontSize, + fontWeight: this.external_container_queueFontWeight, + }; + }, + componentFont: function () { + return { + fontFamily: this.componentFontFamily, + fontSize: this.componentFontSize, + fontWeight: this.componentFontWeight, + }; + }, + external_componentFont: function () { + return { + fontFamily: this.external_componentFontFamily, + fontSize: this.external_componentFontSize, + fontWeight: this.external_componentFontWeight, + }; + }, + component_dbFont: function () { + return { + fontFamily: this.component_dbFontFamily, + fontSize: this.component_dbFontSize, + fontWeight: this.component_dbFontWeight, + }; + }, + external_component_dbFont: function () { + return { + fontFamily: this.external_component_dbFontFamily, + fontSize: this.external_component_dbFontSize, + fontWeight: this.external_component_dbFontWeight, + }; + }, + component_queueFont: function () { + return { + fontFamily: this.component_queueFontFamily, + fontSize: this.component_queueFontSize, + fontWeight: this.component_queueFontWeight, + }; + }, + external_component_queueFont: function () { + return { + fontFamily: this.external_component_queueFontFamily, + fontSize: this.external_component_queueFontSize, + fontWeight: this.external_component_queueFontWeight, + }; + }, + boundaryFont: function () { + return { + fontFamily: this.boundaryFontFamily, + fontSize: this.boundaryFontSize, + fontWeight: this.boundaryFontWeight, + }; + }, + messageFont: function () { + return { + fontFamily: this.messageFontFamily, + fontSize: this.messageFontSize, + fontWeight: this.messageFontWeight, + }; + }, + }, + pie: { ...vt.pie, useWidth: 984 }, + requirement: { ...vt.requirement, useWidth: void 0 }, + gitGraph: { ...vt.gitGraph, useMaxWidth: !1 }, + sankey: { ...vt.sankey, useMaxWidth: !1 }, + }, + Tt = (t, e = "") => + Object.keys(t).reduce( + (i, r) => (Array.isArray(t[r]) ? i : "object" == typeof t[r] && null !== t[r] ? [...i, e + r, ...Tt(t[r], "")] : [...i, e + r]), + [], + ), + wt = new Set(Tt(kt, "")), + St = kt, + Bt = /^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s, + Ft = /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi, + Lt = /\s*%%.*\n/gm; + class Mt extends Error { + constructor(t) { + super(t), (this.name = "UnknownDiagramError"); + } + } + const At = {}, + Et = function (t, e) { + t = t.replace(Bt, "").replace(Ft, "").replace(Lt, "\n"); + for (const [i, { detector: r }] of Object.entries(At)) if (r(t, e)) return i; + throw new Mt(`No diagram type detected matching given configuration for text: ${t}`); + }, + Zt = (...t) => { + for (const { id: e, detector: i, loader: r } of t) Ot(e, i, r); + }, + Ot = (t, e, i) => { + At[t] ? nt.error(`Detector with key ${t} already exists`) : (At[t] = { detector: e, loader: i }), + nt.debug(`Detector with key ${t} added${i ? " with loader" : ""}`); + }, + qt = (t, e, { depth: i = 2, clobber: r = !1 } = {}) => { + const n = { depth: i, clobber: r }; + return Array.isArray(e) && !Array.isArray(t) + ? (e.forEach((e) => qt(t, e, n)), t) + : Array.isArray(e) && Array.isArray(t) + ? (e.forEach((e) => { + t.includes(e) || t.push(e); + }), + t) + : void 0 === t || i <= 0 + ? null != t && "object" == typeof t && "object" == typeof e + ? Object.assign(t, e) + : e + : (void 0 !== e && + "object" == typeof t && + "object" == typeof e && + Object.keys(e).forEach((n) => { + "object" != typeof e[n] || (void 0 !== t[n] && "object" != typeof t[n]) + ? (r || ("object" != typeof t[n] && "object" != typeof e[n])) && (t[n] = e[n]) + : (void 0 === t[n] && (t[n] = Array.isArray(e[n]) ? [] : {}), (t[n] = qt(t[n], e[n], { depth: i - 1, clobber: r }))); + }), + t); + }, + It = qt, + Nt = "​", + Dt = { + curveBasis: a.$0Z, + curveBasisClosed: a.Dts, + curveBasisOpen: a.WQY, + curveBumpX: a.qpX, + curveBumpY: a.u93, + curveBundle: a.tFB, + curveCardinalClosed: a.OvA, + curveCardinalOpen: a.dCK, + curveCardinal: a.YY7, + curveCatmullRomClosed: a.fGX, + curveCatmullRomOpen: a.$m7, + curveCatmullRom: a.zgE, + curveLinear: a.c_6, + curveLinearClosed: a.fxm, + curveMonotoneX: a.FdL, + curveMonotoneY: a.ak_, + curveNatural: a.SxZ, + curveStep: a.eA_, + curveStepAfter: a.jsv, + curveStepBefore: a.iJ, + }, + $t = /\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi, + zt = function (t, e = null) { + try { + const i = new RegExp(`[%]{2}(?![{]${$t.source})(?=[}][%]{2}).*\n`, "ig"); + let r; + (t = t.trim().replace(i, "").replace(/'/gm, '"')), + nt.debug(`Detecting diagram directive${null !== e ? " type:" + e : ""} based on the text:${t}`); + const n = []; + for (; null !== (r = Ft.exec(t)); ) + if ((r.index === Ft.lastIndex && Ft.lastIndex++, (r && !e) || (e && r[1] && r[1].match(e)) || (e && r[2] && r[2].match(e)))) { + const t = r[1] ? r[1] : r[2], + e = r[3] ? r[3].trim() : r[4] ? JSON.parse(r[4].trim()) : null; + n.push({ type: t, args: e }); + } + return 0 === n.length && n.push({ type: t, args: null }), 1 === n.length ? n[0] : n; + } catch (i) { + return ( + nt.error(`ERROR: ${i.message} - Unable to parse directive\n ${null !== e ? " type:" + e : ""} based on the text:${t}`), + { type: null, args: null } + ); + } + }; + function jt(t, e) { + if (!t) return e; + const i = `curve${t.charAt(0).toUpperCase() + t.slice(1)}`; + return Dt[i] || e; + } + function Pt(t, e) { + return t && e ? Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2)) : 0; + } + function Rt(t) { + let e = "", + i = ""; + for (const r of t) void 0 !== r && (r.startsWith("color:") || r.startsWith("text-align:") ? (i = i + r + ";") : (e = e + r + ";")); + return { style: e, labelStyle: i }; + } + let Wt = 0; + const Ut = () => (Wt++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + Wt), + Ht = (t) => + (function (t) { + let e = ""; + for (let i = 0; i < t; i++) e += "0123456789abcdef".charAt(Math.floor(16 * Math.random())); + return e; + })(t.length), + Yt = function (t, e) { + const i = e.text.replace(gt.lineBreakRegex, " "), + [, r] = re(e.fontSize), + n = t.append("text"); + n.attr("x", e.x), + n.attr("y", e.y), + n.style("text-anchor", e.anchor), + n.style("font-family", e.fontFamily), + n.style("font-size", r), + n.style("font-weight", e.fontWeight), + n.attr("fill", e.fill), + void 0 !== e.class && n.attr("class", e.class); + const o = n.append("tspan"); + return o.attr("x", e.x + 2 * e.textMargin), o.attr("fill", e.fill), o.text(i), n; + }, + Vt = (0, m.Z)( + (t, e, i) => { + if (!t) return t; + if (((i = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: "Arial", joinWith: "
    " }, i)), gt.lineBreakRegex.test(t))) + return t; + const r = t.split(" "), + n = []; + let o = ""; + return ( + r.forEach((t, a) => { + const s = Jt(`${t} `, i), + l = Jt(o, i); + if (s > e) { + const { hyphenatedStrings: r, remainingWord: a } = Gt(t, e, "-", i); + n.push(o, ...r), (o = a); + } else l + s >= e ? (n.push(o), (o = t)) : (o = [o, t].filter(Boolean).join(" ")); + a + 1 === r.length && n.push(o); + }), + n.filter((t) => "" !== t).join(i.joinWith) + ); + }, + (t, e, i) => `${t}${e}${i.fontSize}${i.fontWeight}${i.fontFamily}${i.joinWith}`, + ), + Gt = (0, m.Z)( + (t, e, i = "-", r) => { + r = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: "Arial", margin: 0 }, r); + const n = [...t], + o = []; + let a = ""; + return ( + n.forEach((t, s) => { + const l = `${a}${t}`; + if (Jt(l, r) >= e) { + const t = s + 1, + e = n.length === t, + r = `${l}${i}`; + o.push(e ? l : r), (a = ""); + } else a = l; + }), + { hyphenatedStrings: o, remainingWord: a } + ); + }, + (t, e, i = "-", r) => `${t}${e}${i}${r.fontSize}${r.fontWeight}${r.fontFamily}`, + ); + function Xt(t, e) { + return (e = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: "Arial", margin: 15 }, e)), Qt(t, e).height; + } + function Jt(t, e) { + return (e = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: "Arial" }, e)), Qt(t, e).width; + } + const Qt = (0, m.Z)( + (t, e) => { + e = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: "Arial" }, e); + const { fontSize: i, fontFamily: r, fontWeight: n } = e; + if (!t) return { width: 0, height: 0 }; + const [, o] = re(i), + s = ["sans-serif", r], + l = t.split(gt.lineBreakRegex), + h = [], + c = (0, a.Ys)("body"); + if (!c.remove) return { width: 0, height: 0, lineHeight: 0 }; + const u = c.append("svg"); + for (const t of s) { + let e = 0; + const i = { width: 0, height: 0, lineHeight: 0 }; + for (const r of l) { + const a = { + x: 0, + y: 0, + fill: void 0, + anchor: "start", + style: "#666", + width: 100, + height: 100, + textMargin: 0, + rx: 0, + ry: 0, + valign: void 0, + }; + a.text = r || Nt; + const s = Yt(u, a).style("font-size", o).style("font-weight", n).style("font-family", t), + l = (s._groups || s)[0][0].getBBox(); + if (0 === l.width && 0 === l.height) throw new Error("svg element not in render tree"); + (i.width = Math.round(Math.max(i.width, l.width))), + (e = Math.round(l.height)), + (i.height += e), + (i.lineHeight = Math.round(Math.max(i.lineHeight, e))); + } + h.push(i); + } + return ( + u.remove(), + h[ + isNaN(h[1].height) || + isNaN(h[1].width) || + isNaN(h[1].lineHeight) || + (h[0].height > h[1].height && h[0].width > h[1].width && h[0].lineHeight > h[1].lineHeight) + ? 0 + : 1 + ] + ); + }, + (t, e) => `${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`, + ); + let Kt; + const te = (t) => { + if ((nt.debug("sanitizeDirective called with", t), "object" == typeof t && null != t)) + if (Array.isArray(t)) t.forEach((t) => te(t)); + else { + for (const e of Object.keys(t)) { + if ((nt.debug("Checking key", e), e.startsWith("__") || e.includes("proto") || e.includes("constr") || !wt.has(e) || null == t[e])) { + nt.debug("sanitize deleting key: ", e), delete t[e]; + continue; + } + if ("object" == typeof t[e]) { + nt.debug("sanitizing object", e), te(t[e]); + continue; + } + const i = ["themeCSS", "fontFamily", "altFontFamily"]; + for (const r of i) e.includes(r) && (nt.debug("sanitizing css option", e), (t[e] = ee(t[e]))); + } + if (t.themeVariables) + for (const e of Object.keys(t.themeVariables)) { + const i = t.themeVariables[e]; + (null == i ? void 0 : i.match) && !i.match(/^[\d "#%(),.;A-Za-z]+$/) && (t.themeVariables[e] = ""); + } + nt.debug("After sanitization", t); + } + }, + ee = (t) => { + let e = 0, + i = 0; + for (const r of t) { + if (e < i) return "{ /* ERROR: Unbalanced CSS */ }"; + "{" === r ? e++ : "}" === r && i++; + } + return e !== i ? "{ /* ERROR: Unbalanced CSS */ }" : t; + }; + function ie(t) { + return "str" in t; + } + const re = (t) => { + if ("number" == typeof t) return [t, t + "px"]; + const e = parseInt(t, 10); + return Number.isNaN(e) ? [void 0, void 0] : t === String(e) ? [e, t + "px"] : [e, t]; + }; + function ne(t, e) { + return (0, y.Z)({}, t, e); + } + const oe = { + assignWithDepth: It, + wrapLabel: Vt, + calculateTextHeight: Xt, + calculateTextWidth: Jt, + calculateTextDimensions: Qt, + cleanAndMerge: ne, + detectInit: function (t, e) { + const i = zt(t, /(?:init\b)|(?:initialize\b)/); + let r = {}; + if (Array.isArray(i)) { + const t = i.map((t) => t.args); + te(t), (r = It(r, [...t])); + } else r = i.args; + if (!r) return; + let n = Et(t, e); + return ( + ["config"].forEach((t) => { + void 0 !== r[t] && ("flowchart-v2" === n && (n = "flowchart"), (r[n] = r[t]), delete r[t]); + }), + r + ); + }, + detectDirective: zt, + isSubstringInArray: function (t, e) { + for (const [i, r] of e.entries()) if (r.match(t)) return i; + return -1; + }, + interpolateToCurve: jt, + calcLabelPosition: function (t) { + return 1 === t.length + ? t[0] + : (function (t) { + let e, + i = 0; + t.forEach((t) => { + (i += Pt(t, e)), (e = t); + }); + let r, + n = i / 2; + return ( + (e = void 0), + t.forEach((t) => { + if (e && !r) { + const i = Pt(t, e); + if (i < n) n -= i; + else { + const o = n / i; + o <= 0 && (r = e), + o >= 1 && (r = { x: t.x, y: t.y }), + o > 0 && o < 1 && (r = { x: (1 - o) * e.x + o * t.x, y: (1 - o) * e.y + o * t.y }); + } + } + e = t; + }), + r + ); + })(t); + }, + calcCardinalityPosition: (t, e, i) => { + let r; + nt.info(`our points ${JSON.stringify(e)}`), e[0] !== i && (e = e.reverse()); + let n, + o = 25; + (r = void 0), + e.forEach((t) => { + if (r && !n) { + const e = Pt(t, r); + if (e < o) o -= e; + else { + const i = o / e; + i <= 0 && (n = r), + i >= 1 && (n = { x: t.x, y: t.y }), + i > 0 && i < 1 && (n = { x: (1 - i) * r.x + i * t.x, y: (1 - i) * r.y + i * t.y }); + } + } + r = t; + }); + const a = t ? 10 : 5, + s = Math.atan2(e[0].y - n.y, e[0].x - n.x), + l = { x: 0, y: 0 }; + return (l.x = Math.sin(s) * a + (e[0].x + n.x) / 2), (l.y = -Math.cos(s) * a + (e[0].y + n.y) / 2), l; + }, + calcTerminalLabelPosition: function (t, e, i) { + let r, + n = JSON.parse(JSON.stringify(i)); + nt.info("our points", n), + "start_left" !== e && "start_right" !== e && (n = n.reverse()), + n.forEach((t) => { + r = t; + }); + let o, + a = 25 + t; + (r = void 0), + n.forEach((t) => { + if (r && !o) { + const e = Pt(t, r); + if (e < a) a -= e; + else { + const i = a / e; + i <= 0 && (o = r), + i >= 1 && (o = { x: t.x, y: t.y }), + i > 0 && i < 1 && (o = { x: (1 - i) * r.x + i * t.x, y: (1 - i) * r.y + i * t.y }); + } + } + r = t; + }); + const s = 10 + 0.5 * t, + l = Math.atan2(n[0].y - o.y, n[0].x - o.x), + h = { x: 0, y: 0 }; + return ( + (h.x = Math.sin(l) * s + (n[0].x + o.x) / 2), + (h.y = -Math.cos(l) * s + (n[0].y + o.y) / 2), + "start_left" === e && ((h.x = Math.sin(l + Math.PI) * s + (n[0].x + o.x) / 2), (h.y = -Math.cos(l + Math.PI) * s + (n[0].y + o.y) / 2)), + "end_right" === e && + ((h.x = Math.sin(l - Math.PI) * s + (n[0].x + o.x) / 2 - 5), (h.y = -Math.cos(l - Math.PI) * s + (n[0].y + o.y) / 2 - 5)), + "end_left" === e && ((h.x = Math.sin(l) * s + (n[0].x + o.x) / 2 - 5), (h.y = -Math.cos(l) * s + (n[0].y + o.y) / 2 - 5)), + h + ); + }, + formatUrl: function (t, e) { + const i = t.trim(); + if (i) return "loose" !== e.securityLevel ? (0, o.Nm)(i) : i; + }, + getStylesFromArray: Rt, + generateId: Ut, + random: Ht, + runFunc: (t, ...e) => { + const i = t.split("."), + r = i.length - 1, + n = i[r]; + let o = window; + for (let t = 0; t < r; t++) if (((o = o[i[t]]), !o)) return; + o[n](...e); + }, + entityDecode: function (t) { + return ( + (Kt = Kt || document.createElement("div")), + (t = escape(t).replace(/%26/g, "&").replace(/%23/g, "#").replace(/%3B/g, ";")), + (Kt.innerHTML = t), + unescape(Kt.textContent) + ); + }, + initIdGenerator: class { + constructor(t, e) { + (this.deterministic = t), (this.seed = e), (this.count = e ? e.length : 0); + } + next() { + return this.deterministic ? this.count++ : Date.now(); + } + }, + sanitizeDirective: te, + sanitizeCss: ee, + insertTitle: (t, e, i, r) => { + if (!r) return; + const n = t.node().getBBox(); + t.append("text") + .text(r) + .attr("x", n.x + n.width / 2) + .attr("y", -i) + .attr("class", e); + }, + parseFontSize: re, + }, + ae = "10.4.0", + se = Object.freeze(St); + let le, + he = It({}, se), + ce = [], + ue = It({}, se); + const fe = (t, e) => { + let i = It({}, t), + r = {}; + for (const t of e) me(t), (r = It(r, t)); + if (((i = It(i, r)), r.theme && r.theme in xt)) { + const t = It({}, le), + e = It(t.themeVariables || {}, r.themeVariables); + i.theme && i.theme in xt && (i.themeVariables = xt[i.theme].getThemeVariables(e)); + } + return (ue = i), xe(ue), ue; + }, + de = () => It({}, he), + pe = (t) => (xe(t), It(ue, t), ge()), + ge = () => It({}, ue), + me = (t) => { + t && + (["secure", ...(he.secure ?? [])].forEach((e) => { + Object.hasOwn(t, e) && (nt.debug(`Denied attempt to modify a secure key ${e}`, t[e]), delete t[e]); + }), + Object.keys(t).forEach((e) => { + e.startsWith("__") && delete t[e]; + }), + Object.keys(t).forEach((e) => { + "string" == typeof t[e] && (t[e].includes("<") || t[e].includes(">") || t[e].includes("url(data:")) && delete t[e], + "object" == typeof t[e] && me(t[e]); + })); + }, + ye = (t) => { + te(t), + !t.fontFamily || (t.themeVariables && t.themeVariables.fontFamily) || (t.themeVariables = { fontFamily: t.fontFamily }), + ce.push(t), + fe(he, ce); + }, + _e = (t = he) => { + (ce = []), fe(t, ce); + }, + be = { + LAZY_LOAD_DEPRECATED: + "The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.", + }, + Ce = {}, + xe = (t) => { + var e; + t && (t.lazyLoadedDiagrams || t.loadExternalDiagramsAtStartup) && (Ce[(e = "LAZY_LOAD_DEPRECATED")] || (nt.warn(be[e]), (Ce[e] = !0))); + }, + ve = { + id: "c4", + detector: (t) => /^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t), + loader: async () => { + const { diagram: t } = await i.e(545).then(i.bind(i, 4545)); + return { id: "c4", diagram: t }; + }, + }, + ke = "flowchart", + Te = { + id: ke, + detector: (t, e) => { + var i, r; + return ( + "dagre-wrapper" !== (null == (i = null == e ? void 0 : e.flowchart) ? void 0 : i.defaultRenderer) && + "elk" !== (null == (r = null == e ? void 0 : e.flowchart) ? void 0 : r.defaultRenderer) && + /^\s*graph/.test(t) + ); + }, + loader: async () => { + const { diagram: t } = await Promise.all([i.e(771), i.e(506), i.e(76), i.e(476), i.e(813), i.e(728)]).then(i.bind(i, 8728)); + return { id: ke, diagram: t }; + }, + }, + we = "flowchart-v2", + Se = { + id: we, + detector: (t, e) => { + var i, r, n; + return ( + "dagre-d3" !== (null == (i = null == e ? void 0 : e.flowchart) ? void 0 : i.defaultRenderer) && + "elk" !== (null == (r = null == e ? void 0 : e.flowchart) ? void 0 : r.defaultRenderer) && + (!(!/^\s*graph/.test(t) || "dagre-wrapper" !== (null == (n = null == e ? void 0 : e.flowchart) ? void 0 : n.defaultRenderer)) || + /^\s*flowchart/.test(t)) + ); + }, + loader: async () => { + const { diagram: t } = await Promise.all([i.e(771), i.e(506), i.e(76), i.e(476), i.e(813), i.e(81)]).then(i.bind(i, 3081)); + return { id: we, diagram: t }; + }, + }, + Be = { + id: "er", + detector: (t) => /^\s*erDiagram/.test(t), + loader: async () => { + const { diagram: t } = await Promise.all([i.e(771), i.e(430)]).then(i.bind(i, 4430)); + return { id: "er", diagram: t }; + }, + }, + Fe = "gitGraph", + Le = { + id: Fe, + detector: (t) => /^\s*gitGraph/.test(t), + loader: async () => { + const { diagram: t } = await i.e(729).then(i.bind(i, 7729)); + return { id: Fe, diagram: t }; + }, + }, + Me = "gantt", + Ae = { + id: Me, + detector: (t) => /^\s*gantt/.test(t), + loader: async () => { + const { diagram: t } = await i.e(773).then(i.bind(i, 9773)); + return { id: Me, diagram: t }; + }, + }, + Ee = "info", + Ze = { + id: Ee, + detector: (t) => /^\s*info/.test(t), + loader: async () => { + const { diagram: t } = await i.e(433).then(i.bind(i, 6433)); + return { id: Ee, diagram: t }; + }, + }, + Oe = { + id: "pie", + detector: (t) => /^\s*pie/.test(t), + loader: async () => { + const { diagram: t } = await i.e(546).then(i.bind(i, 3546)); + return { id: "pie", diagram: t }; + }, + }, + qe = "quadrantChart", + Ie = { + id: qe, + detector: (t) => /^\s*quadrantChart/.test(t), + loader: async () => { + const { diagram: t } = await i.e(118).then(i.bind(i, 7118)); + return { id: qe, diagram: t }; + }, + }, + Ne = "requirement", + De = { + id: Ne, + detector: (t) => /^\s*requirement(Diagram)?/.test(t), + loader: async () => { + const { diagram: t } = await Promise.all([i.e(771), i.e(19)]).then(i.bind(i, 4019)); + return { id: Ne, diagram: t }; + }, + }, + $e = "sequence", + ze = { + id: $e, + detector: (t) => /^\s*sequenceDiagram/.test(t), + loader: async () => { + const { diagram: t } = await i.e(361).then(i.bind(i, 5510)); + return { id: $e, diagram: t }; + }, + }, + je = "class", + Pe = { + id: je, + detector: (t, e) => { + var i; + return "dagre-wrapper" !== (null == (i = null == e ? void 0 : e.class) ? void 0 : i.defaultRenderer) && /^\s*classDiagram/.test(t); + }, + loader: async () => { + const { diagram: t } = await Promise.all([i.e(771), i.e(423), i.e(519)]).then(i.bind(i, 9519)); + return { id: je, diagram: t }; + }, + }, + Re = "classDiagram", + We = { + id: Re, + detector: (t, e) => { + var i; + return ( + !(!/^\s*classDiagram/.test(t) || "dagre-wrapper" !== (null == (i = null == e ? void 0 : e.class) ? void 0 : i.defaultRenderer)) || + /^\s*classDiagram-v2/.test(t) + ); + }, + loader: async () => { + const { diagram: t } = await Promise.all([i.e(771), i.e(506), i.e(76), i.e(476), i.e(423), i.e(747)]).then(i.bind(i, 6747)); + return { id: Re, diagram: t }; + }, + }, + Ue = "state", + He = { + id: Ue, + detector: (t, e) => { + var i; + return "dagre-wrapper" !== (null == (i = null == e ? void 0 : e.state) ? void 0 : i.defaultRenderer) && /^\s*stateDiagram/.test(t); + }, + loader: async () => { + const { diagram: t } = await Promise.all([i.e(771), i.e(535), i.e(642)]).then(i.bind(i, 7642)); + return { id: Ue, diagram: t }; + }, + }, + Ye = "stateDiagram", + Ve = { + id: Ye, + detector: (t, e) => { + var i; + return ( + !!/^\s*stateDiagram-v2/.test(t) || + !(!/^\s*stateDiagram/.test(t) || "dagre-wrapper" !== (null == (i = null == e ? void 0 : e.state) ? void 0 : i.defaultRenderer)) + ); + }, + loader: async () => { + const { diagram: t } = await Promise.all([i.e(771), i.e(506), i.e(76), i.e(476), i.e(535), i.e(626)]).then(i.bind(i, 1626)); + return { id: Ye, diagram: t }; + }, + }, + Ge = "journey", + Xe = { + id: Ge, + detector: (t) => /^\s*journey/.test(t), + loader: async () => { + const { diagram: t } = await i.e(438).then(i.bind(i, 2438)); + return { id: Ge, diagram: t }; + }, + }, + Je = (t) => { + var e; + const { securityLevel: i } = ge(); + let r = (0, a.Ys)("body"); + if ("sandbox" === i) { + const i = (null == (e = (0, a.Ys)(`#i${t}`).node()) ? void 0 : e.contentDocument) ?? document; + r = (0, a.Ys)(i.body); + } + return r.select(`#${t}`); + }, + Qe = function (t, e, i, r) { + const n = (function (t, e, i) { + let r = new Map(); + return i ? (r.set("width", "100%"), r.set("style", `max-width: ${e}px;`)) : (r.set("height", t), r.set("width", e)), r; + })(e, i, r); + !(function (t, e) { + for (let i of e) t.attr(i[0], i[1]); + })(t, n); + }, + Ke = function (t, e, i, r) { + const n = e.node().getBBox(), + o = n.width, + a = n.height; + nt.info(`SVG bounds: ${o}x${a}`, n); + let s = 0, + l = 0; + nt.info(`Graph bounds: ${s}x${l}`, t), (s = o + 2 * i), (l = a + 2 * i), nt.info(`Calculated bounds: ${s}x${l}`), Qe(e, l, s, r); + const h = `${n.x - i} ${n.y - i} ${n.width + 2 * i} ${n.height + 2 * i}`; + e.attr("viewBox", h); + }, + ti = { + draw: (t, e, i) => { + nt.debug("renering svg for syntax error\n"); + const r = Je(e); + r.attr("viewBox", "0 0 2412 512"), Qe(r, 100, 512, !0); + const n = r.append("g"); + n + .append("path") + .attr("class", "error-icon") + .attr( + "d", + "m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z", + ), + n + .append("path") + .attr("class", "error-icon") + .attr( + "d", + "m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z", + ), + n + .append("path") + .attr("class", "error-icon") + .attr( + "d", + "m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z", + ), + n + .append("path") + .attr("class", "error-icon") + .attr("d", "m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"), + n + .append("path") + .attr("class", "error-icon") + .attr("d", "m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"), + n + .append("path") + .attr("class", "error-icon") + .attr( + "d", + "m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z", + ), + n + .append("text") + .attr("class", "error-text") + .attr("x", 1440) + .attr("y", 250) + .attr("font-size", "150px") + .style("text-anchor", "middle") + .text("Syntax error in text"), + n + .append("text") + .attr("class", "error-text") + .attr("x", 1250) + .attr("y", 400) + .attr("font-size", "100px") + .style("text-anchor", "middle") + .text(`mermaid version ${i}`); + }, + }, + ei = ti, + ii = { db: {}, renderer: ti, parser: { parser: { yy: {} }, parse: () => {} } }, + ri = "flowchart-elk", + ni = { + id: ri, + detector: (t, e) => { + var i; + return !!( + /^\s*flowchart-elk/.test(t) || + (/^\s*flowchart|graph/.test(t) && "elk" === (null == (i = null == e ? void 0 : e.flowchart) ? void 0 : i.defaultRenderer)) + ); + }, + loader: async () => { + const { diagram: t } = await Promise.all([i.e(506), i.e(76), i.e(813), i.e(639)]).then(i.bind(i, 1639)); + return { id: ri, diagram: t }; + }, + }, + oi = "timeline", + ai = { + id: oi, + detector: (t) => /^\s*timeline/.test(t), + loader: async () => { + const { diagram: t } = await i.e(940).then(i.bind(i, 5940)); + return { id: oi, diagram: t }; + }, + }, + si = "mindmap", + li = { + id: si, + detector: (t) => /^\s*mindmap/.test(t), + loader: async () => { + const { diagram: t } = await Promise.all([i.e(506), i.e(662)]).then(i.bind(i, 4662)); + return { id: si, diagram: t }; + }, + }, + hi = "sankey", + ci = { + id: hi, + detector: (t) => /^\s*sankey-beta/.test(t), + loader: async () => { + const { diagram: t } = await i.e(579).then(i.bind(i, 8579)); + return { id: hi, diagram: t }; + }, + }, + ui = {}; + let fi = "", + di = "", + pi = ""; + const gi = (t) => ct(t, ge()), + mi = function () { + (fi = ""), (pi = ""), (di = ""); + }, + yi = function (t) { + fi = gi(t).replace(/^\s+/g, ""); + }, + _i = function () { + return fi || di; + }, + bi = function (t) { + pi = gi(t).replace(/\n\s+/g, "\n"); + }, + Ci = function () { + return pi; + }, + xi = function (t) { + di = gi(t); + }, + vi = function () { + return di; + }, + ki = { + getAccTitle: _i, + setAccTitle: yi, + getDiagramTitle: vi, + setDiagramTitle: xi, + getAccDescription: Ci, + setAccDescription: bi, + clear: mi, + }, + Ti = Object.freeze( + Object.defineProperty( + { + __proto__: null, + clear: mi, + default: ki, + getAccDescription: Ci, + getAccTitle: _i, + getDiagramTitle: vi, + setAccDescription: bi, + setAccTitle: yi, + setDiagramTitle: xi, + }, + Symbol.toStringTag, + { value: "Module" }, + ), + ); + let wi = {}; + const Si = function (t, e, i, r) { + nt.debug("parseDirective is being called", e, i, r); + try { + if (void 0 !== e) + switch (((e = e.trim()), i)) { + case "open_directive": + wi = {}; + break; + case "type_directive": + if (!wi) throw new Error("currentDirective is undefined"); + wi.type = e.toLowerCase(); + break; + case "arg_directive": + if (!wi) throw new Error("currentDirective is undefined"); + wi.args = JSON.parse(e); + break; + case "close_directive": + Bi(t, wi, r), (wi = void 0); + } + } catch (t) { + nt.error(`Error while rendering sequenceDiagram directive: ${e} jison context: ${i}`), nt.error(t.message); + } + }, + Bi = function (t, e, i) { + switch ((nt.info(`Directive type=${e.type} with args:`, e.args), e.type)) { + case "init": + case "initialize": + ["config"].forEach((t) => { + void 0 !== e.args[t] && ("flowchart-v2" === i && (i = "flowchart"), (e.args[i] = e.args[t]), delete e.args[t]); + }), + ye(e.args); + break; + case "wrap": + case "nowrap": + t && t.setWrap && t.setWrap("wrap" === e.type); + break; + case "themeCss": + nt.warn("themeCss encountered"); + break; + default: + nt.warn(`Unhandled directive: source: '%%{${e.type}: ${JSON.stringify(e.args ? e.args : {})}}%%`, e); + } + }, + Fi = nt, + Li = ot, + Mi = ge, + Ai = (t) => ct(t, Mi()), + Ei = Ke, + Zi = (t, e, i, r) => Si(t, e, i, r), + Oi = {}, + qi = (t, e, i) => { + if (Oi[t]) throw new Error(`Diagram ${t} already registered.`); + var r, n; + (Oi[t] = e), i && Ot(t, i), (r = t), void 0 !== (n = e.styles) && (ui[r] = n), e.injectUtils && e.injectUtils(Fi, Li, Mi, Ai, Ei, Ti, Zi); + }, + Ii = (t) => { + if (t in Oi) return Oi[t]; + throw new Ni(t); + }; + class Ni extends Error { + constructor(t) { + super(`Diagram ${t} not found.`); + } + } + let Di = !1; + const $i = () => { + Di || + ((Di = !0), + qi("error", ii, (t) => "error" === t.toLowerCase().trim()), + qi( + "---", + { + db: { clear: () => {} }, + styles: {}, + renderer: {}, + parser: { + parser: { yy: {} }, + parse: () => { + throw new Error( + "Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks", + ); + }, + }, + init: () => null, + }, + (t) => t.toLowerCase().trimStart().startsWith("---"), + ), + Zt(ve, We, Pe, Be, Ae, Ze, Oe, De, ze, ni, Se, Te, li, ai, Le, Ve, He, Xe, Ie, ci)); + }; + function zi(t) { + return null == t; + } + var ji = { + isNothing: zi, + isObject: function (t) { + return "object" == typeof t && null !== t; + }, + toArray: function (t) { + return Array.isArray(t) ? t : zi(t) ? [] : [t]; + }, + repeat: function (t, e) { + var i, + r = ""; + for (i = 0; i < e; i += 1) r += t; + return r; + }, + isNegativeZero: function (t) { + return 0 === t && Number.NEGATIVE_INFINITY === 1 / t; + }, + extend: function (t, e) { + var i, r, n, o; + if (e) for (i = 0, r = (o = Object.keys(e)).length; i < r; i += 1) t[(n = o[i])] = e[n]; + return t; + }, + }; + function Pi(t, e) { + var i = "", + r = t.reason || "(unknown reason)"; + return t.mark + ? (t.mark.name && (i += 'in "' + t.mark.name + '" '), + (i += "(" + (t.mark.line + 1) + ":" + (t.mark.column + 1) + ")"), + !e && t.mark.snippet && (i += "\n\n" + t.mark.snippet), + r + " " + i) + : r; + } + function Ri(t, e) { + Error.call(this), + (this.name = "YAMLException"), + (this.reason = t), + (this.mark = e), + (this.message = Pi(this, !1)), + Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : (this.stack = new Error().stack || ""); + } + (Ri.prototype = Object.create(Error.prototype)), + (Ri.prototype.constructor = Ri), + (Ri.prototype.toString = function (t) { + return this.name + ": " + Pi(this, t); + }); + var Wi = Ri; + function Ui(t, e, i, r, n) { + var o = "", + a = "", + s = Math.floor(n / 2) - 1; + return ( + r - e > s && (e = r - s + (o = " ... ").length), + i - r > s && (i = r + s - (a = " ...").length), + { str: o + t.slice(e, i).replace(/\t/g, "→") + a, pos: r - e + o.length } + ); + } + function Hi(t, e) { + return ji.repeat(" ", e - t.length) + t; + } + var Yi = function (t, e) { + if (((e = Object.create(e || null)), !t.buffer)) return null; + e.maxLength || (e.maxLength = 79), + "number" != typeof e.indent && (e.indent = 1), + "number" != typeof e.linesBefore && (e.linesBefore = 3), + "number" != typeof e.linesAfter && (e.linesAfter = 2); + for (var i, r = /\r?\n|\r|\0/g, n = [0], o = [], a = -1; (i = r.exec(t.buffer)); ) + o.push(i.index), n.push(i.index + i[0].length), t.position <= i.index && a < 0 && (a = n.length - 2); + a < 0 && (a = n.length - 1); + var s, + l, + h = "", + c = Math.min(t.line + e.linesAfter, o.length).toString().length, + u = e.maxLength - (e.indent + c + 3); + for (s = 1; s <= e.linesBefore && !(a - s < 0); s++) + (l = Ui(t.buffer, n[a - s], o[a - s], t.position - (n[a] - n[a - s]), u)), + (h = ji.repeat(" ", e.indent) + Hi((t.line - s + 1).toString(), c) + " | " + l.str + "\n" + h); + for ( + l = Ui(t.buffer, n[a], o[a], t.position, u), + h += ji.repeat(" ", e.indent) + Hi((t.line + 1).toString(), c) + " | " + l.str + "\n", + h += ji.repeat("-", e.indent + c + 3 + l.pos) + "^\n", + s = 1; + s <= e.linesAfter && !(a + s >= o.length); + s++ + ) + (l = Ui(t.buffer, n[a + s], o[a + s], t.position - (n[a] - n[a + s]), u)), + (h += ji.repeat(" ", e.indent) + Hi((t.line + s + 1).toString(), c) + " | " + l.str + "\n"); + return h.replace(/\n$/, ""); + }, + Vi = ["kind", "multi", "resolve", "construct", "instanceOf", "predicate", "represent", "representName", "defaultStyle", "styleAliases"], + Gi = ["scalar", "sequence", "mapping"], + Xi = function (t, e) { + var i, r; + if ( + ((e = e || {}), + Object.keys(e).forEach(function (e) { + if (-1 === Vi.indexOf(e)) throw new Wi('Unknown option "' + e + '" is met in definition of "' + t + '" YAML type.'); + }), + (this.options = e), + (this.tag = t), + (this.kind = e.kind || null), + (this.resolve = + e.resolve || + function () { + return !0; + }), + (this.construct = + e.construct || + function (t) { + return t; + }), + (this.instanceOf = e.instanceOf || null), + (this.predicate = e.predicate || null), + (this.represent = e.represent || null), + (this.representName = e.representName || null), + (this.defaultStyle = e.defaultStyle || null), + (this.multi = e.multi || !1), + (this.styleAliases = + ((i = e.styleAliases || null), + (r = {}), + null !== i && + Object.keys(i).forEach(function (t) { + i[t].forEach(function (e) { + r[String(e)] = t; + }); + }), + r)), + -1 === Gi.indexOf(this.kind)) + ) + throw new Wi('Unknown kind "' + this.kind + '" is specified for "' + t + '" YAML type.'); + }; + function Ji(t, e) { + var i = []; + return ( + t[e].forEach(function (t) { + var e = i.length; + i.forEach(function (i, r) { + i.tag === t.tag && i.kind === t.kind && i.multi === t.multi && (e = r); + }), + (i[e] = t); + }), + i + ); + } + function Qi(t) { + return this.extend(t); + } + Qi.prototype.extend = function (t) { + var e = [], + i = []; + if (t instanceof Xi) i.push(t); + else if (Array.isArray(t)) i = i.concat(t); + else { + if (!t || (!Array.isArray(t.implicit) && !Array.isArray(t.explicit))) + throw new Wi("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })"); + t.implicit && (e = e.concat(t.implicit)), t.explicit && (i = i.concat(t.explicit)); + } + e.forEach(function (t) { + if (!(t instanceof Xi)) throw new Wi("Specified list of YAML types (or a single Type object) contains a non-Type object."); + if (t.loadKind && "scalar" !== t.loadKind) + throw new Wi("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); + if (t.multi) throw new Wi("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit."); + }), + i.forEach(function (t) { + if (!(t instanceof Xi)) throw new Wi("Specified list of YAML types (or a single Type object) contains a non-Type object."); + }); + var r = Object.create(Qi.prototype); + return ( + (r.implicit = (this.implicit || []).concat(e)), + (r.explicit = (this.explicit || []).concat(i)), + (r.compiledImplicit = Ji(r, "implicit")), + (r.compiledExplicit = Ji(r, "explicit")), + (r.compiledTypeMap = (function () { + var t, + e, + i = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { scalar: [], sequence: [], mapping: [], fallback: [] }, + }; + function r(t) { + t.multi ? (i.multi[t.kind].push(t), i.multi.fallback.push(t)) : (i[t.kind][t.tag] = i.fallback[t.tag] = t); + } + for (t = 0, e = arguments.length; t < e; t += 1) arguments[t].forEach(r); + return i; + })(r.compiledImplicit, r.compiledExplicit)), + r + ); + }; + var Ki = new Qi({ + explicit: [ + new Xi("tag:yaml.org,2002:str", { + kind: "scalar", + construct: function (t) { + return null !== t ? t : ""; + }, + }), + new Xi("tag:yaml.org,2002:seq", { + kind: "sequence", + construct: function (t) { + return null !== t ? t : []; + }, + }), + new Xi("tag:yaml.org,2002:map", { + kind: "mapping", + construct: function (t) { + return null !== t ? t : {}; + }, + }), + ], + }), + tr = new Xi("tag:yaml.org,2002:null", { + kind: "scalar", + resolve: function (t) { + if (null === t) return !0; + var e = t.length; + return (1 === e && "~" === t) || (4 === e && ("null" === t || "Null" === t || "NULL" === t)); + }, + construct: function () { + return null; + }, + predicate: function (t) { + return null === t; + }, + represent: { + canonical: function () { + return "~"; + }, + lowercase: function () { + return "null"; + }, + uppercase: function () { + return "NULL"; + }, + camelcase: function () { + return "Null"; + }, + empty: function () { + return ""; + }, + }, + defaultStyle: "lowercase", + }), + er = new Xi("tag:yaml.org,2002:bool", { + kind: "scalar", + resolve: function (t) { + if (null === t) return !1; + var e = t.length; + return (4 === e && ("true" === t || "True" === t || "TRUE" === t)) || (5 === e && ("false" === t || "False" === t || "FALSE" === t)); + }, + construct: function (t) { + return "true" === t || "True" === t || "TRUE" === t; + }, + predicate: function (t) { + return "[object Boolean]" === Object.prototype.toString.call(t); + }, + represent: { + lowercase: function (t) { + return t ? "true" : "false"; + }, + uppercase: function (t) { + return t ? "TRUE" : "FALSE"; + }, + camelcase: function (t) { + return t ? "True" : "False"; + }, + }, + defaultStyle: "lowercase", + }); + function ir(t) { + return 48 <= t && t <= 55; + } + function rr(t) { + return 48 <= t && t <= 57; + } + var nr = new Xi("tag:yaml.org,2002:int", { + kind: "scalar", + resolve: function (t) { + if (null === t) return !1; + var e, + i, + r = t.length, + n = 0, + o = !1; + if (!r) return !1; + if ((("-" !== (e = t[n]) && "+" !== e) || (e = t[++n]), "0" === e)) { + if (n + 1 === r) return !0; + if ("b" === (e = t[++n])) { + for (n++; n < r; n++) + if ("_" !== (e = t[n])) { + if ("0" !== e && "1" !== e) return !1; + o = !0; + } + return o && "_" !== e; + } + if ("x" === e) { + for (n++; n < r; n++) + if ("_" !== (e = t[n])) { + if (!((48 <= (i = t.charCodeAt(n)) && i <= 57) || (65 <= i && i <= 70) || (97 <= i && i <= 102))) return !1; + o = !0; + } + return o && "_" !== e; + } + if ("o" === e) { + for (n++; n < r; n++) + if ("_" !== (e = t[n])) { + if (!ir(t.charCodeAt(n))) return !1; + o = !0; + } + return o && "_" !== e; + } + } + if ("_" === e) return !1; + for (; n < r; n++) + if ("_" !== (e = t[n])) { + if (!rr(t.charCodeAt(n))) return !1; + o = !0; + } + return !(!o || "_" === e); + }, + construct: function (t) { + var e, + i = t, + r = 1; + if ( + (-1 !== i.indexOf("_") && (i = i.replace(/_/g, "")), + ("-" !== (e = i[0]) && "+" !== e) || ("-" === e && (r = -1), (e = (i = i.slice(1))[0])), + "0" === i) + ) + return 0; + if ("0" === e) { + if ("b" === i[1]) return r * parseInt(i.slice(2), 2); + if ("x" === i[1]) return r * parseInt(i.slice(2), 16); + if ("o" === i[1]) return r * parseInt(i.slice(2), 8); + } + return r * parseInt(i, 10); + }, + predicate: function (t) { + return "[object Number]" === Object.prototype.toString.call(t) && t % 1 == 0 && !ji.isNegativeZero(t); + }, + represent: { + binary: function (t) { + return t >= 0 ? "0b" + t.toString(2) : "-0b" + t.toString(2).slice(1); + }, + octal: function (t) { + return t >= 0 ? "0o" + t.toString(8) : "-0o" + t.toString(8).slice(1); + }, + decimal: function (t) { + return t.toString(10); + }, + hexadecimal: function (t) { + return t >= 0 ? "0x" + t.toString(16).toUpperCase() : "-0x" + t.toString(16).toUpperCase().slice(1); + }, + }, + defaultStyle: "decimal", + styleAliases: { + binary: [2, "bin"], + octal: [8, "oct"], + decimal: [10, "dec"], + hexadecimal: [16, "hex"], + }, + }), + or = new RegExp( + "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$", + ), + ar = /^[-+]?[0-9]+e/, + sr = new Xi("tag:yaml.org,2002:float", { + kind: "scalar", + resolve: function (t) { + return null !== t && !(!or.test(t) || "_" === t[t.length - 1]); + }, + construct: function (t) { + var e, i; + return ( + (i = "-" === (e = t.replace(/_/g, "").toLowerCase())[0] ? -1 : 1), + "+-".indexOf(e[0]) >= 0 && (e = e.slice(1)), + ".inf" === e ? (1 === i ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY) : ".nan" === e ? NaN : i * parseFloat(e, 10) + ); + }, + predicate: function (t) { + return "[object Number]" === Object.prototype.toString.call(t) && (t % 1 != 0 || ji.isNegativeZero(t)); + }, + represent: function (t, e) { + var i; + if (isNaN(t)) + switch (e) { + case "lowercase": + return ".nan"; + case "uppercase": + return ".NAN"; + case "camelcase": + return ".NaN"; + } + else if (Number.POSITIVE_INFINITY === t) + switch (e) { + case "lowercase": + return ".inf"; + case "uppercase": + return ".INF"; + case "camelcase": + return ".Inf"; + } + else if (Number.NEGATIVE_INFINITY === t) + switch (e) { + case "lowercase": + return "-.inf"; + case "uppercase": + return "-.INF"; + case "camelcase": + return "-.Inf"; + } + else if (ji.isNegativeZero(t)) return "-0.0"; + return (i = t.toString(10)), ar.test(i) ? i.replace("e", ".e") : i; + }, + defaultStyle: "lowercase", + }), + lr = Ki.extend({ implicit: [tr, er, nr, sr] }), + hr = lr, + cr = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"), + ur = new RegExp( + "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$", + ), + fr = new Xi("tag:yaml.org,2002:timestamp", { + kind: "scalar", + resolve: function (t) { + return null !== t && (null !== cr.exec(t) || null !== ur.exec(t)); + }, + construct: function (t) { + var e, + i, + r, + n, + o, + a, + s, + l, + h = 0, + c = null; + if ((null === (e = cr.exec(t)) && (e = ur.exec(t)), null === e)) throw new Error("Date resolve error"); + if (((i = +e[1]), (r = +e[2] - 1), (n = +e[3]), !e[4])) return new Date(Date.UTC(i, r, n)); + if (((o = +e[4]), (a = +e[5]), (s = +e[6]), e[7])) { + for (h = e[7].slice(0, 3); h.length < 3; ) h += "0"; + h = +h; + } + return ( + e[9] && ((c = 6e4 * (60 * +e[10] + +(e[11] || 0))), "-" === e[9] && (c = -c)), + (l = new Date(Date.UTC(i, r, n, o, a, s, h))), + c && l.setTime(l.getTime() - c), + l + ); + }, + instanceOf: Date, + represent: function (t) { + return t.toISOString(); + }, + }), + dr = new Xi("tag:yaml.org,2002:merge", { + kind: "scalar", + resolve: function (t) { + return "<<" === t || null === t; + }, + }), + pr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r", + gr = new Xi("tag:yaml.org,2002:binary", { + kind: "scalar", + resolve: function (t) { + if (null === t) return !1; + var e, + i, + r = 0, + n = t.length, + o = pr; + for (i = 0; i < n; i++) + if (!((e = o.indexOf(t.charAt(i))) > 64)) { + if (e < 0) return !1; + r += 6; + } + return r % 8 == 0; + }, + construct: function (t) { + var e, + i, + r = t.replace(/[\r\n=]/g, ""), + n = r.length, + o = pr, + a = 0, + s = []; + for (e = 0; e < n; e++) + e % 4 == 0 && e && (s.push((a >> 16) & 255), s.push((a >> 8) & 255), s.push(255 & a)), (a = (a << 6) | o.indexOf(r.charAt(e))); + return ( + 0 == (i = (n % 4) * 6) + ? (s.push((a >> 16) & 255), s.push((a >> 8) & 255), s.push(255 & a)) + : 18 === i + ? (s.push((a >> 10) & 255), s.push((a >> 2) & 255)) + : 12 === i && s.push((a >> 4) & 255), + new Uint8Array(s) + ); + }, + predicate: function (t) { + return "[object Uint8Array]" === Object.prototype.toString.call(t); + }, + represent: function (t) { + var e, + i, + r = "", + n = 0, + o = t.length, + a = pr; + for (e = 0; e < o; e++) + e % 3 == 0 && e && ((r += a[(n >> 18) & 63]), (r += a[(n >> 12) & 63]), (r += a[(n >> 6) & 63]), (r += a[63 & n])), + (n = (n << 8) + t[e]); + return ( + 0 == (i = o % 3) + ? ((r += a[(n >> 18) & 63]), (r += a[(n >> 12) & 63]), (r += a[(n >> 6) & 63]), (r += a[63 & n])) + : 2 === i + ? ((r += a[(n >> 10) & 63]), (r += a[(n >> 4) & 63]), (r += a[(n << 2) & 63]), (r += a[64])) + : 1 === i && ((r += a[(n >> 2) & 63]), (r += a[(n << 4) & 63]), (r += a[64]), (r += a[64])), + r + ); + }, + }), + mr = Object.prototype.hasOwnProperty, + yr = Object.prototype.toString, + _r = new Xi("tag:yaml.org,2002:omap", { + kind: "sequence", + resolve: function (t) { + if (null === t) return !0; + var e, + i, + r, + n, + o, + a = [], + s = t; + for (e = 0, i = s.length; e < i; e += 1) { + if (((r = s[e]), (o = !1), "[object Object]" !== yr.call(r))) return !1; + for (n in r) + if (mr.call(r, n)) { + if (o) return !1; + o = !0; + } + if (!o) return !1; + if (-1 !== a.indexOf(n)) return !1; + a.push(n); + } + return !0; + }, + construct: function (t) { + return null !== t ? t : []; + }, + }), + br = Object.prototype.toString, + Cr = new Xi("tag:yaml.org,2002:pairs", { + kind: "sequence", + resolve: function (t) { + if (null === t) return !0; + var e, + i, + r, + n, + o, + a = t; + for (o = new Array(a.length), e = 0, i = a.length; e < i; e += 1) { + if (((r = a[e]), "[object Object]" !== br.call(r))) return !1; + if (1 !== (n = Object.keys(r)).length) return !1; + o[e] = [n[0], r[n[0]]]; + } + return !0; + }, + construct: function (t) { + if (null === t) return []; + var e, + i, + r, + n, + o, + a = t; + for (o = new Array(a.length), e = 0, i = a.length; e < i; e += 1) (r = a[e]), (n = Object.keys(r)), (o[e] = [n[0], r[n[0]]]); + return o; + }, + }), + xr = Object.prototype.hasOwnProperty, + vr = new Xi("tag:yaml.org,2002:set", { + kind: "mapping", + resolve: function (t) { + if (null === t) return !0; + var e, + i = t; + for (e in i) if (xr.call(i, e) && null !== i[e]) return !1; + return !0; + }, + construct: function (t) { + return null !== t ? t : {}; + }, + }), + kr = hr.extend({ implicit: [fr, dr], explicit: [gr, _r, Cr, vr] }), + Tr = Object.prototype.hasOwnProperty, + wr = 1, + Sr = 2, + Br = 3, + Fr = 4, + Lr = 1, + Mr = 2, + Ar = 3, + Er = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, + Zr = /[\x85\u2028\u2029]/, + Or = /[,\[\]\{\}]/, + qr = /^(?:!|!!|![a-z\-]+!)$/i, + Ir = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + function Nr(t) { + return Object.prototype.toString.call(t); + } + function Dr(t) { + return 10 === t || 13 === t; + } + function $r(t) { + return 9 === t || 32 === t; + } + function zr(t) { + return 9 === t || 32 === t || 10 === t || 13 === t; + } + function jr(t) { + return 44 === t || 91 === t || 93 === t || 123 === t || 125 === t; + } + function Pr(t) { + var e; + return 48 <= t && t <= 57 ? t - 48 : 97 <= (e = 32 | t) && e <= 102 ? e - 97 + 10 : -1; + } + function Rr(t) { + return 48 === t + ? "\0" + : 97 === t + ? "" + : 98 === t + ? "\b" + : 116 === t || 9 === t + ? "\t" + : 110 === t + ? "\n" + : 118 === t + ? "\v" + : 102 === t + ? "\f" + : 114 === t + ? "\r" + : 101 === t + ? "" + : 32 === t + ? " " + : 34 === t + ? '"' + : 47 === t + ? "/" + : 92 === t + ? "\\" + : 78 === t + ? "…" + : 95 === t + ? " " + : 76 === t + ? "\u2028" + : 80 === t + ? "\u2029" + : ""; + } + function Wr(t) { + return t <= 65535 ? String.fromCharCode(t) : String.fromCharCode(55296 + ((t - 65536) >> 10), 56320 + ((t - 65536) & 1023)); + } + for (var Ur = new Array(256), Hr = new Array(256), Yr = 0; Yr < 256; Yr++) (Ur[Yr] = Rr(Yr) ? 1 : 0), (Hr[Yr] = Rr(Yr)); + function Vr(t, e) { + (this.input = t), + (this.filename = e.filename || null), + (this.schema = e.schema || kr), + (this.onWarning = e.onWarning || null), + (this.legacy = e.legacy || !1), + (this.json = e.json || !1), + (this.listener = e.listener || null), + (this.implicitTypes = this.schema.compiledImplicit), + (this.typeMap = this.schema.compiledTypeMap), + (this.length = t.length), + (this.position = 0), + (this.line = 0), + (this.lineStart = 0), + (this.lineIndent = 0), + (this.firstTabInLine = -1), + (this.documents = []); + } + function Gr(t, e) { + var i = { + name: t.filename, + buffer: t.input.slice(0, -1), + position: t.position, + line: t.line, + column: t.position - t.lineStart, + }; + return (i.snippet = Yi(i)), new Wi(e, i); + } + function Xr(t, e) { + throw Gr(t, e); + } + function Jr(t, e) { + t.onWarning && t.onWarning.call(null, Gr(t, e)); + } + var Qr = { + YAML: function (t, e, i) { + var r, n, o; + null !== t.version && Xr(t, "duplication of %YAML directive"), + 1 !== i.length && Xr(t, "YAML directive accepts exactly one argument"), + null === (r = /^([0-9]+)\.([0-9]+)$/.exec(i[0])) && Xr(t, "ill-formed argument of the YAML directive"), + (n = parseInt(r[1], 10)), + (o = parseInt(r[2], 10)), + 1 !== n && Xr(t, "unacceptable YAML version of the document"), + (t.version = i[0]), + (t.checkLineBreaks = o < 2), + 1 !== o && 2 !== o && Jr(t, "unsupported YAML version of the document"); + }, + TAG: function (t, e, i) { + var r, n; + 2 !== i.length && Xr(t, "TAG directive accepts exactly two arguments"), + (r = i[0]), + (n = i[1]), + qr.test(r) || Xr(t, "ill-formed tag handle (first argument) of the TAG directive"), + Tr.call(t.tagMap, r) && Xr(t, 'there is a previously declared suffix for "' + r + '" tag handle'), + Ir.test(n) || Xr(t, "ill-formed tag prefix (second argument) of the TAG directive"); + try { + n = decodeURIComponent(n); + } catch (e) { + Xr(t, "tag prefix is malformed: " + n); + } + t.tagMap[r] = n; + }, + }; + function Kr(t, e, i, r) { + var n, o, a, s; + if (e < i) { + if (((s = t.input.slice(e, i)), r)) + for (n = 0, o = s.length; n < o; n += 1) + 9 === (a = s.charCodeAt(n)) || (32 <= a && a <= 1114111) || Xr(t, "expected valid JSON character"); + else Er.test(s) && Xr(t, "the stream contains non-printable characters"); + t.result += s; + } + } + function tn(t, e, i, r) { + var n, o, a, s; + for ( + ji.isObject(i) || Xr(t, "cannot merge mappings; the provided source object is unacceptable"), a = 0, s = (n = Object.keys(i)).length; + a < s; + a += 1 + ) + (o = n[a]), Tr.call(e, o) || ((e[o] = i[o]), (r[o] = !0)); + } + function en(t, e, i, r, n, o, a, s, l) { + var h, c; + if (Array.isArray(n)) + for (h = 0, c = (n = Array.prototype.slice.call(n)).length; h < c; h += 1) + Array.isArray(n[h]) && Xr(t, "nested arrays are not supported inside keys"), + "object" == typeof n && "[object Object]" === Nr(n[h]) && (n[h] = "[object Object]"); + if ( + ("object" == typeof n && "[object Object]" === Nr(n) && (n = "[object Object]"), + (n = String(n)), + null === e && (e = {}), + "tag:yaml.org,2002:merge" === r) + ) + if (Array.isArray(o)) for (h = 0, c = o.length; h < c; h += 1) tn(t, e, o[h], i); + else tn(t, e, o, i); + else + t.json || + Tr.call(i, n) || + !Tr.call(e, n) || + ((t.line = a || t.line), (t.lineStart = s || t.lineStart), (t.position = l || t.position), Xr(t, "duplicated mapping key")), + "__proto__" === n + ? Object.defineProperty(e, n, { + configurable: !0, + enumerable: !0, + writable: !0, + value: o, + }) + : (e[n] = o), + delete i[n]; + return e; + } + function rn(t) { + var e; + 10 === (e = t.input.charCodeAt(t.position)) + ? t.position++ + : 13 === e + ? (t.position++, 10 === t.input.charCodeAt(t.position) && t.position++) + : Xr(t, "a line break is expected"), + (t.line += 1), + (t.lineStart = t.position), + (t.firstTabInLine = -1); + } + function nn(t, e, i) { + for (var r = 0, n = t.input.charCodeAt(t.position); 0 !== n; ) { + for (; $r(n); ) 9 === n && -1 === t.firstTabInLine && (t.firstTabInLine = t.position), (n = t.input.charCodeAt(++t.position)); + if (e && 35 === n) + do { + n = t.input.charCodeAt(++t.position); + } while (10 !== n && 13 !== n && 0 !== n); + if (!Dr(n)) break; + for (rn(t), n = t.input.charCodeAt(t.position), r++, t.lineIndent = 0; 32 === n; ) t.lineIndent++, (n = t.input.charCodeAt(++t.position)); + } + return -1 !== i && 0 !== r && t.lineIndent < i && Jr(t, "deficient indentation"), r; + } + function on(t) { + var e, + i = t.position; + return !( + (45 !== (e = t.input.charCodeAt(i)) && 46 !== e) || + e !== t.input.charCodeAt(i + 1) || + e !== t.input.charCodeAt(i + 2) || + ((i += 3), 0 !== (e = t.input.charCodeAt(i)) && !zr(e)) + ); + } + function an(t, e) { + 1 === e ? (t.result += " ") : e > 1 && (t.result += ji.repeat("\n", e - 1)); + } + function sn(t, e) { + var i, + r, + n = t.tag, + o = t.anchor, + a = [], + s = !1; + if (-1 !== t.firstTabInLine) return !1; + for ( + null !== t.anchor && (t.anchorMap[t.anchor] = a), r = t.input.charCodeAt(t.position); + 0 !== r && + (-1 !== t.firstTabInLine && ((t.position = t.firstTabInLine), Xr(t, "tab characters must not be used in indentation")), 45 === r) && + zr(t.input.charCodeAt(t.position + 1)); + + ) + if (((s = !0), t.position++, nn(t, !0, -1) && t.lineIndent <= e)) a.push(null), (r = t.input.charCodeAt(t.position)); + else if ( + ((i = t.line), + cn(t, e, Br, !1, !0), + a.push(t.result), + nn(t, !0, -1), + (r = t.input.charCodeAt(t.position)), + (t.line === i || t.lineIndent > e) && 0 !== r) + ) + Xr(t, "bad indentation of a sequence entry"); + else if (t.lineIndent < e) break; + return !!s && ((t.tag = n), (t.anchor = o), (t.kind = "sequence"), (t.result = a), !0); + } + function ln(t) { + var e, + i, + r, + n, + o = !1, + a = !1; + if (33 !== (n = t.input.charCodeAt(t.position))) return !1; + if ( + (null !== t.tag && Xr(t, "duplication of a tag property"), + 60 === (n = t.input.charCodeAt(++t.position)) + ? ((o = !0), (n = t.input.charCodeAt(++t.position))) + : 33 === n + ? ((a = !0), (i = "!!"), (n = t.input.charCodeAt(++t.position))) + : (i = "!"), + (e = t.position), + o) + ) { + do { + n = t.input.charCodeAt(++t.position); + } while (0 !== n && 62 !== n); + t.position < t.length + ? ((r = t.input.slice(e, t.position)), (n = t.input.charCodeAt(++t.position))) + : Xr(t, "unexpected end of the stream within a verbatim tag"); + } else { + for (; 0 !== n && !zr(n); ) + 33 === n && + (a + ? Xr(t, "tag suffix cannot contain exclamation marks") + : ((i = t.input.slice(e - 1, t.position + 1)), + qr.test(i) || Xr(t, "named tag handle cannot contain such characters"), + (a = !0), + (e = t.position + 1))), + (n = t.input.charCodeAt(++t.position)); + (r = t.input.slice(e, t.position)), Or.test(r) && Xr(t, "tag suffix cannot contain flow indicator characters"); + } + r && !Ir.test(r) && Xr(t, "tag name cannot contain such characters: " + r); + try { + r = decodeURIComponent(r); + } catch (e) { + Xr(t, "tag name is malformed: " + r); + } + return ( + o + ? (t.tag = r) + : Tr.call(t.tagMap, i) + ? (t.tag = t.tagMap[i] + r) + : "!" === i + ? (t.tag = "!" + r) + : "!!" === i + ? (t.tag = "tag:yaml.org,2002:" + r) + : Xr(t, 'undeclared tag handle "' + i + '"'), + !0 + ); + } + function hn(t) { + var e, i; + if (38 !== (i = t.input.charCodeAt(t.position))) return !1; + for ( + null !== t.anchor && Xr(t, "duplication of an anchor property"), i = t.input.charCodeAt(++t.position), e = t.position; + 0 !== i && !zr(i) && !jr(i); + + ) + i = t.input.charCodeAt(++t.position); + return t.position === e && Xr(t, "name of an anchor node must contain at least one character"), (t.anchor = t.input.slice(e, t.position)), !0; + } + function cn(t, e, i, r, n) { + var o, + a, + s, + l, + h, + c, + u, + f, + d, + p = 1, + g = !1, + m = !1; + if ( + (null !== t.listener && t.listener("open", t), + (t.tag = null), + (t.anchor = null), + (t.kind = null), + (t.result = null), + (o = a = s = Fr === i || Br === i), + r && nn(t, !0, -1) && ((g = !0), t.lineIndent > e ? (p = 1) : t.lineIndent === e ? (p = 0) : t.lineIndent < e && (p = -1)), + 1 === p) + ) + for (; ln(t) || hn(t); ) + nn(t, !0, -1) ? ((g = !0), (s = o), t.lineIndent > e ? (p = 1) : t.lineIndent === e ? (p = 0) : t.lineIndent < e && (p = -1)) : (s = !1); + if ( + (s && (s = g || n), + (1 !== p && Fr !== i) || + ((f = wr === i || Sr === i ? e : e + 1), + (d = t.position - t.lineStart), + 1 === p + ? (s && + (sn(t, d) || + (function (t, e, i) { + var r, + n, + o, + a, + s, + l, + h, + c = t.tag, + u = t.anchor, + f = {}, + d = Object.create(null), + p = null, + g = null, + m = null, + y = !1, + _ = !1; + if (-1 !== t.firstTabInLine) return !1; + for (null !== t.anchor && (t.anchorMap[t.anchor] = f), h = t.input.charCodeAt(t.position); 0 !== h; ) { + if ( + (y || -1 === t.firstTabInLine || ((t.position = t.firstTabInLine), Xr(t, "tab characters must not be used in indentation")), + (r = t.input.charCodeAt(t.position + 1)), + (o = t.line), + (63 !== h && 58 !== h) || !zr(r)) + ) { + if (((a = t.line), (s = t.lineStart), (l = t.position), !cn(t, i, Sr, !1, !0))) break; + if (t.line === o) { + for (h = t.input.charCodeAt(t.position); $r(h); ) h = t.input.charCodeAt(++t.position); + if (58 === h) + zr((h = t.input.charCodeAt(++t.position))) || + Xr(t, "a whitespace character is expected after the key-value separator within a block mapping"), + y && (en(t, f, d, p, g, null, a, s, l), (p = g = m = null)), + (_ = !0), + (y = !1), + (n = !1), + (p = t.tag), + (g = t.result); + else { + if (!_) return (t.tag = c), (t.anchor = u), !0; + Xr(t, "can not read an implicit mapping pair; a colon is missed"); + } + } else { + if (!_) return (t.tag = c), (t.anchor = u), !0; + Xr(t, "can not read a block mapping entry; a multiline key may not be an implicit key"); + } + } else + 63 === h + ? (y && (en(t, f, d, p, g, null, a, s, l), (p = g = m = null)), (_ = !0), (y = !0), (n = !0)) + : y + ? ((y = !1), (n = !0)) + : Xr(t, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), + (t.position += 1), + (h = r); + if ( + ((t.line === o || t.lineIndent > e) && + (y && ((a = t.line), (s = t.lineStart), (l = t.position)), + cn(t, e, Fr, !0, n) && (y ? (g = t.result) : (m = t.result)), + y || (en(t, f, d, p, g, m, a, s, l), (p = g = m = null)), + nn(t, !0, -1), + (h = t.input.charCodeAt(t.position))), + (t.line === o || t.lineIndent > e) && 0 !== h) + ) + Xr(t, "bad indentation of a mapping entry"); + else if (t.lineIndent < e) break; + } + return y && en(t, f, d, p, g, null, a, s, l), _ && ((t.tag = c), (t.anchor = u), (t.kind = "mapping"), (t.result = f)), _; + })(t, d, f))) || + (function (t, e) { + var i, + r, + n, + o, + a, + s, + l, + h, + c, + u, + f, + d, + p = !0, + g = t.tag, + m = t.anchor, + y = Object.create(null); + if (91 === (d = t.input.charCodeAt(t.position))) (a = 93), (h = !1), (o = []); + else { + if (123 !== d) return !1; + (a = 125), (h = !0), (o = {}); + } + for (null !== t.anchor && (t.anchorMap[t.anchor] = o), d = t.input.charCodeAt(++t.position); 0 !== d; ) { + if ((nn(t, !0, e), (d = t.input.charCodeAt(t.position)) === a)) + return t.position++, (t.tag = g), (t.anchor = m), (t.kind = h ? "mapping" : "sequence"), (t.result = o), !0; + p ? 44 === d && Xr(t, "expected the node content, but found ','") : Xr(t, "missed comma between flow collection entries"), + (f = null), + (s = l = !1), + 63 === d && zr(t.input.charCodeAt(t.position + 1)) && ((s = l = !0), t.position++, nn(t, !0, e)), + (i = t.line), + (r = t.lineStart), + (n = t.position), + cn(t, e, wr, !1, !0), + (u = t.tag), + (c = t.result), + nn(t, !0, e), + (d = t.input.charCodeAt(t.position)), + (!l && t.line !== i) || + 58 !== d || + ((s = !0), (d = t.input.charCodeAt(++t.position)), nn(t, !0, e), cn(t, e, wr, !1, !0), (f = t.result)), + h ? en(t, o, y, u, c, f, i, r, n) : s ? o.push(en(t, null, y, u, c, f, i, r, n)) : o.push(c), + nn(t, !0, e), + 44 === (d = t.input.charCodeAt(t.position)) ? ((p = !0), (d = t.input.charCodeAt(++t.position))) : (p = !1); + } + Xr(t, "unexpected end of the stream within a flow collection"); + })(t, f) + ? (m = !0) + : ((a && + (function (t, e) { + var i, + r, + n, + o, + a, + s = Lr, + l = !1, + h = !1, + c = e, + u = 0, + f = !1; + if (124 === (o = t.input.charCodeAt(t.position))) r = !1; + else { + if (62 !== o) return !1; + r = !0; + } + for (t.kind = "scalar", t.result = ""; 0 !== o; ) + if (43 === (o = t.input.charCodeAt(++t.position)) || 45 === o) + Lr === s ? (s = 43 === o ? Ar : Mr) : Xr(t, "repeat of a chomping mode identifier"); + else { + if (!((n = 48 <= (a = o) && a <= 57 ? a - 48 : -1) >= 0)) break; + 0 === n + ? Xr(t, "bad explicit indentation width of a block scalar; it cannot be less than one") + : h + ? Xr(t, "repeat of an indentation width identifier") + : ((c = e + n - 1), (h = !0)); + } + if ($r(o)) { + do { + o = t.input.charCodeAt(++t.position); + } while ($r(o)); + if (35 === o) + do { + o = t.input.charCodeAt(++t.position); + } while (!Dr(o) && 0 !== o); + } + for (; 0 !== o; ) { + for (rn(t), t.lineIndent = 0, o = t.input.charCodeAt(t.position); (!h || t.lineIndent < c) && 32 === o; ) + t.lineIndent++, (o = t.input.charCodeAt(++t.position)); + if ((!h && t.lineIndent > c && (c = t.lineIndent), Dr(o))) u++; + else { + if (t.lineIndent < c) { + s === Ar ? (t.result += ji.repeat("\n", l ? 1 + u : u)) : s === Lr && l && (t.result += "\n"); + break; + } + for ( + r + ? $r(o) + ? ((f = !0), (t.result += ji.repeat("\n", l ? 1 + u : u))) + : f + ? ((f = !1), (t.result += ji.repeat("\n", u + 1))) + : 0 === u + ? l && (t.result += " ") + : (t.result += ji.repeat("\n", u)) + : (t.result += ji.repeat("\n", l ? 1 + u : u)), + l = !0, + h = !0, + u = 0, + i = t.position; + !Dr(o) && 0 !== o; + + ) + o = t.input.charCodeAt(++t.position); + Kr(t, i, t.position, !1); + } + } + return !0; + })(t, f)) || + (function (t, e) { + var i, r, n; + if (39 !== (i = t.input.charCodeAt(t.position))) return !1; + for (t.kind = "scalar", t.result = "", t.position++, r = n = t.position; 0 !== (i = t.input.charCodeAt(t.position)); ) + if (39 === i) { + if ((Kr(t, r, t.position, !0), 39 !== (i = t.input.charCodeAt(++t.position)))) return !0; + (r = t.position), t.position++, (n = t.position); + } else + Dr(i) + ? (Kr(t, r, n, !0), an(t, nn(t, !1, e)), (r = n = t.position)) + : t.position === t.lineStart && on(t) + ? Xr(t, "unexpected end of the document within a single quoted scalar") + : (t.position++, (n = t.position)); + Xr(t, "unexpected end of the stream within a single quoted scalar"); + })(t, f) || + (function (t, e) { + var i, r, n, o, a, s, l; + if (34 !== (s = t.input.charCodeAt(t.position))) return !1; + for (t.kind = "scalar", t.result = "", t.position++, i = r = t.position; 0 !== (s = t.input.charCodeAt(t.position)); ) { + if (34 === s) return Kr(t, i, t.position, !0), t.position++, !0; + if (92 === s) { + if ((Kr(t, i, t.position, !0), Dr((s = t.input.charCodeAt(++t.position))))) nn(t, !1, e); + else if (s < 256 && Ur[s]) (t.result += Hr[s]), t.position++; + else if ((a = 120 === (l = s) ? 2 : 117 === l ? 4 : 85 === l ? 8 : 0) > 0) { + for (n = a, o = 0; n > 0; n--) + (a = Pr((s = t.input.charCodeAt(++t.position)))) >= 0 ? (o = (o << 4) + a) : Xr(t, "expected hexadecimal character"); + (t.result += Wr(o)), t.position++; + } else Xr(t, "unknown escape sequence"); + i = r = t.position; + } else + Dr(s) + ? (Kr(t, i, r, !0), an(t, nn(t, !1, e)), (i = r = t.position)) + : t.position === t.lineStart && on(t) + ? Xr(t, "unexpected end of the document within a double quoted scalar") + : (t.position++, (r = t.position)); + } + Xr(t, "unexpected end of the stream within a double quoted scalar"); + })(t, f) + ? (m = !0) + : (function (t) { + var e, i, r; + if (42 !== (r = t.input.charCodeAt(t.position))) return !1; + for (r = t.input.charCodeAt(++t.position), e = t.position; 0 !== r && !zr(r) && !jr(r); ) + r = t.input.charCodeAt(++t.position); + return ( + t.position === e && Xr(t, "name of an alias node must contain at least one character"), + (i = t.input.slice(e, t.position)), + Tr.call(t.anchorMap, i) || Xr(t, 'unidentified alias "' + i + '"'), + (t.result = t.anchorMap[i]), + nn(t, !0, -1), + !0 + ); + })(t) + ? ((m = !0), (null === t.tag && null === t.anchor) || Xr(t, "alias node should not have any properties")) + : (function (t, e, i) { + var r, + n, + o, + a, + s, + l, + h, + c, + u = t.kind, + f = t.result; + if ( + zr((c = t.input.charCodeAt(t.position))) || + jr(c) || + 35 === c || + 38 === c || + 42 === c || + 33 === c || + 124 === c || + 62 === c || + 39 === c || + 34 === c || + 37 === c || + 64 === c || + 96 === c + ) + return !1; + if ((63 === c || 45 === c) && (zr((r = t.input.charCodeAt(t.position + 1))) || (i && jr(r)))) return !1; + for (t.kind = "scalar", t.result = "", n = o = t.position, a = !1; 0 !== c; ) { + if (58 === c) { + if (zr((r = t.input.charCodeAt(t.position + 1))) || (i && jr(r))) break; + } else if (35 === c) { + if (zr(t.input.charCodeAt(t.position - 1))) break; + } else { + if ((t.position === t.lineStart && on(t)) || (i && jr(c))) break; + if (Dr(c)) { + if (((s = t.line), (l = t.lineStart), (h = t.lineIndent), nn(t, !1, -1), t.lineIndent >= e)) { + (a = !0), (c = t.input.charCodeAt(t.position)); + continue; + } + (t.position = o), (t.line = s), (t.lineStart = l), (t.lineIndent = h); + break; + } + } + a && (Kr(t, n, o, !1), an(t, t.line - s), (n = o = t.position), (a = !1)), + $r(c) || (o = t.position + 1), + (c = t.input.charCodeAt(++t.position)); + } + return Kr(t, n, o, !1), !!t.result || ((t.kind = u), (t.result = f), !1); + })(t, f, wr === i) && ((m = !0), null === t.tag && (t.tag = "?")), + null !== t.anchor && (t.anchorMap[t.anchor] = t.result)) + : 0 === p && (m = s && sn(t, d))), + null === t.tag) + ) + null !== t.anchor && (t.anchorMap[t.anchor] = t.result); + else if ("?" === t.tag) { + for ( + null !== t.result && "scalar" !== t.kind && Xr(t, 'unacceptable node kind for ! tag; it should be "scalar", not "' + t.kind + '"'), + l = 0, + h = t.implicitTypes.length; + l < h; + l += 1 + ) + if ((u = t.implicitTypes[l]).resolve(t.result)) { + (t.result = u.construct(t.result)), (t.tag = u.tag), null !== t.anchor && (t.anchorMap[t.anchor] = t.result); + break; + } + } else if ("!" !== t.tag) { + if (Tr.call(t.typeMap[t.kind || "fallback"], t.tag)) u = t.typeMap[t.kind || "fallback"][t.tag]; + else + for (u = null, l = 0, h = (c = t.typeMap.multi[t.kind || "fallback"]).length; l < h; l += 1) + if (t.tag.slice(0, c[l].tag.length) === c[l].tag) { + u = c[l]; + break; + } + u || Xr(t, "unknown tag !<" + t.tag + ">"), + null !== t.result && + u.kind !== t.kind && + Xr(t, "unacceptable node kind for !<" + t.tag + '> tag; it should be "' + u.kind + '", not "' + t.kind + '"'), + u.resolve(t.result, t.tag) + ? ((t.result = u.construct(t.result, t.tag)), null !== t.anchor && (t.anchorMap[t.anchor] = t.result)) + : Xr(t, "cannot resolve a node with !<" + t.tag + "> explicit tag"); + } + return null !== t.listener && t.listener("close", t), null !== t.tag || null !== t.anchor || m; + } + function un(t) { + var e, + i, + r, + n, + o = t.position, + a = !1; + for ( + t.version = null, t.checkLineBreaks = t.legacy, t.tagMap = Object.create(null), t.anchorMap = Object.create(null); + 0 !== (n = t.input.charCodeAt(t.position)) && (nn(t, !0, -1), (n = t.input.charCodeAt(t.position)), !(t.lineIndent > 0 || 37 !== n)); + + ) { + for (a = !0, n = t.input.charCodeAt(++t.position), e = t.position; 0 !== n && !zr(n); ) n = t.input.charCodeAt(++t.position); + for ( + r = [], (i = t.input.slice(e, t.position)).length < 1 && Xr(t, "directive name must not be less than one character in length"); + 0 !== n; + + ) { + for (; $r(n); ) n = t.input.charCodeAt(++t.position); + if (35 === n) { + do { + n = t.input.charCodeAt(++t.position); + } while (0 !== n && !Dr(n)); + break; + } + if (Dr(n)) break; + for (e = t.position; 0 !== n && !zr(n); ) n = t.input.charCodeAt(++t.position); + r.push(t.input.slice(e, t.position)); + } + 0 !== n && rn(t), Tr.call(Qr, i) ? Qr[i](t, i, r) : Jr(t, 'unknown document directive "' + i + '"'); + } + nn(t, !0, -1), + 0 === t.lineIndent && + 45 === t.input.charCodeAt(t.position) && + 45 === t.input.charCodeAt(t.position + 1) && + 45 === t.input.charCodeAt(t.position + 2) + ? ((t.position += 3), nn(t, !0, -1)) + : a && Xr(t, "directives end mark is expected"), + cn(t, t.lineIndent - 1, Fr, !1, !0), + nn(t, !0, -1), + t.checkLineBreaks && Zr.test(t.input.slice(o, t.position)) && Jr(t, "non-ASCII line breaks are interpreted as content"), + t.documents.push(t.result), + t.position === t.lineStart && on(t) + ? 46 === t.input.charCodeAt(t.position) && ((t.position += 3), nn(t, !0, -1)) + : t.position < t.length - 1 && Xr(t, "end of the stream or a document separator is expected"); + } + function fn(t, e) { + (e = e || {}), + 0 !== (t = String(t)).length && + (10 !== t.charCodeAt(t.length - 1) && 13 !== t.charCodeAt(t.length - 1) && (t += "\n"), 65279 === t.charCodeAt(0) && (t = t.slice(1))); + var i = new Vr(t, e), + r = t.indexOf("\0"); + for (-1 !== r && ((i.position = r), Xr(i, "null byte is not allowed in input")), i.input += "\0"; 32 === i.input.charCodeAt(i.position); ) + (i.lineIndent += 1), (i.position += 1); + for (; i.position < i.length - 1; ) un(i); + return i.documents; + } + var dn = lr, + pn = function (t, e) { + var i = fn(t, e); + if (0 !== i.length) { + if (1 === i.length) return i[0]; + throw new Wi("expected a single document in the stream, but found more"); + } + }; + function gn(t, e, i) { + var r, n; + const o = t.match(Bt); + if (!o) return t; + const a = pn(o[1], { schema: dn }); + return ( + (null == a ? void 0 : a.title) && (null == (r = e.setDiagramTitle) || r.call(e, a.title.toString())), + (null == a ? void 0 : a.displayMode) && (null == (n = e.setDisplayMode) || n.call(e, a.displayMode.toString())), + (null == a ? void 0 : a.config) && (null == i || i(a.config)), + t.slice(o[0].length) + ); + } + class mn { + constructor(t) { + (this.text = t), (this.type = "graph"), (this.text += "\n"); + const e = ge(); + try { + this.type = Et(t, e); + } catch (t) { + (this.type = "error"), (this.detectError = t); + } + const i = Ii(this.type); + nt.debug("Type " + this.type), (this.db = i.db), (this.renderer = i.renderer), (this.parser = i.parser); + const r = this.parser.parse.bind(this.parser); + (this.parser.parse = (t) => r(((t) => t.trimStart().replace(/^\s*%%(?!{)[^\n]+\n?/gm, ""))(gn(t, this.db, ye)))), + (this.parser.parser.yy = this.db), + (this.init = i.init), + this.parse(); + } + parse() { + var t, e, i; + if (this.detectError) throw this.detectError; + null == (e = (t = this.db).clear) || e.call(t), null == (i = this.init) || i.call(this, ge()), this.parser.parse(this.text); + } + async render(t, e) { + await this.renderer.draw(this.text, t, e, this); + } + getParser() { + return this.parser; + } + getType() { + return this.type; + } + } + const yn = async (t) => { + const e = Et(t, ge()); + try { + Ii(e); + } catch (t) { + const i = At[e].loader; + if (!i) throw new Mt(`Diagram ${e} not found.`); + const { id: r, diagram: n } = await i(); + qi(r, n); + } + return new mn(t); + }; + let _n = []; + const bn = (t) => { + _n.push(t); + }, + Cn = ["graph", "flowchart", "flowchart-v2", "flowchart-elk", "stateDiagram", "stateDiagram-v2"], + xn = ["foreignobject"], + vn = ["dominant-baseline"], + kn = function (t) { + return t.replace(/fl°°/g, "&#").replace(/fl°/g, "&").replace(/¶ß/g, ";"); + }, + Tn = (t, e, i = []) => `\n.${t} ${e} { ${i.join(" !important; ")} !important; }`, + wn = (t, e, i, r) => { + const n = ((t, e, i = {}) => { + var r; + let n = ""; + if ( + (void 0 !== t.themeCSS && (n += `\n${t.themeCSS}`), + void 0 !== t.fontFamily && (n += `\n:root { --mermaid-font-family: ${t.fontFamily}}`), + void 0 !== t.altFontFamily && (n += `\n:root { --mermaid-alt-font-family: ${t.altFontFamily}}`), + !(0, it.Z)(i) && Cn.includes(e)) + ) { + const e = + t.htmlLabels || (null == (r = t.flowchart) ? void 0 : r.htmlLabels) + ? ["> *", "span"] + : ["rect", "polygon", "ellipse", "circle", "path"]; + for (const t in i) { + const r = i[t]; + (0, it.Z)(r.styles) || + e.forEach((t) => { + n += Tn(r.id, t, r.styles); + }), + (0, it.Z)(r.textStyles) || (n += Tn(r.id, "tspan", r.textStyles)); + } + } + return n; + })(t, e, i); + return M( + J( + `${r}{${((t, e, i) => { + let r = ""; + return ( + t in ui && ui[t] ? (r = ui[t](i)) : nt.warn(`No theme found for ${t}`), + ` & {\n font-family: ${i.fontFamily};\n font-size: ${i.fontSize};\n fill: ${i.textColor}\n }\n\n /* Classes common for multiple diagrams */\n\n & .error-icon {\n fill: ${i.errorBkgColor};\n }\n & .error-text {\n fill: ${i.errorTextColor};\n stroke: ${i.errorTextColor};\n }\n\n & .edge-thickness-normal {\n stroke-width: 2px;\n }\n & .edge-thickness-thick {\n stroke-width: 3.5px\n }\n & .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n\n & .edge-pattern-dashed{\n stroke-dasharray: 3;\n }\n .edge-pattern-dotted {\n stroke-dasharray: 2;\n }\n\n & .marker {\n fill: ${i.lineColor};\n stroke: ${i.lineColor};\n }\n & .marker.cross {\n stroke: ${i.lineColor};\n }\n\n & svg {\n font-family: ${i.fontFamily};\n font-size: ${i.fontSize};\n }\n\n ${r}\n\n ${e}\n` + ); + })(e, n, t.themeVariables)}}`, + ), + A, + ); + }, + Sn = (t, e, i, r, n) => { + const o = t.append("div"); + o.attr("id", i), r && o.attr("style", r); + const a = o.append("svg").attr("id", e).attr("width", "100%").attr("xmlns", "http://www.w3.org/2000/svg"); + return n && a.attr("xmlns:xlink", n), a.append("g"), t; + }; + function Bn(t, e) { + return t.append("iframe").attr("id", e).attr("style", "width: 100%; height: 100%;").attr("sandbox", ""); + } + const Fn = Object.freeze({ + render: async function (t, e, i) { + var r, n, o, l; + $i(), _e(), gn(e, {}, ye); + const h = oe.detectInit(e); + h && ye(h); + const c = ge(); + nt.debug(c), + e.length > ((null == c ? void 0 : c.maxTextSize) ?? 5e4) && (e = "graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa"), + (e = (e = e.replace(/\r\n?/g, "\n")).replace(/<(\w+)([^>]*)>/g, (t, e, i) => "<" + e + i.replace(/="([^"]*)"/g, "='$1'") + ">")); + const u = "#" + t, + f = "i" + t, + d = "#" + f, + p = "d" + t, + g = "#" + p; + let m = (0, a.Ys)("body"); + const y = "sandbox" === c.securityLevel, + _ = "loose" === c.securityLevel, + b = c.fontFamily; + if (void 0 !== i) { + if ((i && (i.innerHTML = ""), y)) { + const t = Bn((0, a.Ys)(i), f); + (m = (0, a.Ys)(t.nodes()[0].contentDocument.body)), (m.node().style.margin = 0); + } else m = (0, a.Ys)(i); + Sn(m, t, p, `font-family: ${b}`, "http://www.w3.org/1999/xlink"); + } else { + if ( + (((t, e, i, r) => { + var n, o, a; + null == (n = t.getElementById(e)) || n.remove(), + null == (o = t.getElementById(i)) || o.remove(), + null == (a = t.getElementById(r)) || a.remove(); + })(document, t, p, f), + y) + ) { + const t = Bn((0, a.Ys)("body"), f); + (m = (0, a.Ys)(t.nodes()[0].contentDocument.body)), (m.node().style.margin = 0); + } else m = (0, a.Ys)("body"); + Sn(m, t, p); + } + let C, x; + e = (function (t) { + let e = t; + return ( + (e = e.replace(/style.*:\S*#.*;/g, function (t) { + return t.substring(0, t.length - 1); + })), + (e = e.replace(/classDef.*:\S*#.*;/g, function (t) { + return t.substring(0, t.length - 1); + })), + (e = e.replace(/#\w+;/g, function (t) { + const e = t.substring(1, t.length - 1); + return /^\+?\d+$/.test(e) ? "fl°°" + e + "¶ß" : "fl°" + e + "¶ß"; + })), + e + ); + })(e); + try { + C = await yn(e); + } catch (t) { + (C = new mn("error")), (x = t); + } + const v = m.select(g).node(), + k = C.type, + T = v.firstChild, + w = T.firstChild, + S = Cn.includes(k) ? C.renderer.getClasses(e, C) : {}, + B = wn(c, k, S, u), + F = document.createElement("style"); + (F.innerHTML = B), T.insertBefore(F, w); + try { + await C.renderer.draw(e, t, ae, C); + } catch (i) { + throw (ei.draw(e, t, ae), i); + } + !(function (t, e, i, r) { + (function (t, e) { + t.attr("role", "graphics-document document"), "" !== e && t.attr("aria-roledescription", e); + })(e, t), + (function (t, e, i, r) { + if (void 0 !== t.insert) { + if (i) { + const e = `chart-desc-${r}`; + t.attr("aria-describedby", e), t.insert("desc", ":first-child").attr("id", e).text(i); + } + if (e) { + const i = `chart-title-${r}`; + t.attr("aria-labelledby", i), t.insert("title", ":first-child").attr("id", i).text(e); + } + } + })(e, i, r, e.attr("id")); + })( + k, + m.select(`${g} svg`), + null == (n = (r = C.db).getAccTitle) ? void 0 : n.call(r), + null == (l = (o = C.db).getAccDescription) ? void 0 : l.call(o), + ), + m.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns", "http://www.w3.org/1999/xhtml"); + let L = m.select(g).node().innerHTML; + if ( + (nt.debug("config.arrowMarkerAbsolute", c.arrowMarkerAbsolute), + (L = ((t = "", e, i) => { + let r = t; + return ( + i || e || (r = r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g, 'marker-end="url(#')), + (r = kn(r)), + (r = r.replace(/
    /g, "
    ")), + r + ); + })(L, y, dt(c.arrowMarkerAbsolute))), + y + ? (L = ((t = "", e) => { + var i, r; + return ``; + })(L, m.select(g + " svg").node())) + : _ || (L = s.sanitize(L, { ADD_TAGS: xn, ADD_ATTR: vn })), + _n.forEach((t) => { + t(); + }), + (_n = []), + x) + ) + throw x; + const M = y ? d : g, + A = (0, a.Ys)(M).node(); + return A && "remove" in A && A.remove(), { svg: L, bindFunctions: C.db.bindFunctions }; + }, + parse: async function (t, e) { + $i(); + try { + await yn(t); + } catch (t) { + if (null == e ? void 0 : e.suppressErrors) return !1; + throw t; + } + return !0; + }, + parseDirective: Si, + getDiagramFromText: yn, + initialize: function (t = {}) { + var e; + (null == t ? void 0 : t.fontFamily) && + !(null == (e = t.themeVariables) ? void 0 : e.fontFamily) && + (t.themeVariables || (t.themeVariables = {}), (t.themeVariables.fontFamily = t.fontFamily)), + (le = It({}, t)), + (null == t ? void 0 : t.theme) && t.theme in xt + ? (t.themeVariables = xt[t.theme].getThemeVariables(t.themeVariables)) + : t && (t.themeVariables = xt.default.getThemeVariables(t.themeVariables)); + const i = + "object" == typeof t + ? ((r = t), + (he = It({}, se)), + (he = It(he, r)), + r.theme && xt[r.theme] && (he.themeVariables = xt[r.theme].getThemeVariables(r.themeVariables)), + fe(he, ce), + he) + : de(); + var r; + ot(i.logLevel), $i(); + }, + getConfig: ge, + setConfig: pe, + getSiteConfig: de, + updateSiteConfig: (t) => ((he = It(he, t)), fe(he, ce), he), + reset: () => { + _e(); + }, + globalReset: () => { + _e(se); + }, + defaultConfig: se, + }); + ot(ge().logLevel), _e(ge()); + const Ln = (t, e, i) => { + nt.warn(t), + ie(t) + ? (i && i(t.str, t.hash), e.push({ ...t, message: t.str, error: t })) + : (i && i(t), t instanceof Error && e.push({ str: t.message, message: t.message, hash: t.name, error: t })); + }, + Mn = async function (t = { querySelector: ".mermaid" }) { + try { + await An(t); + } catch (e) { + if ((ie(e) && nt.error(e.str), Dn.parseError && Dn.parseError(e), !t.suppressErrors)) + throw (nt.error("Use the suppressErrors option to suppress these errors"), e); + } + }, + An = async function ({ postRenderCallback: t, querySelector: e, nodes: i } = { querySelector: ".mermaid" }) { + const n = Fn.getConfig(); + let o; + if ((nt.debug((t ? "" : "No ") + "Callback function found"), i)) o = i; + else { + if (!e) throw new Error("Nodes and querySelector are both undefined"); + o = document.querySelectorAll(e); + } + nt.debug(`Found ${o.length} diagrams`), + void 0 !== (null == n ? void 0 : n.startOnLoad) && + (nt.debug("Start On Load: " + (null == n ? void 0 : n.startOnLoad)), + Fn.updateSiteConfig({ startOnLoad: null == n ? void 0 : n.startOnLoad })); + const a = new oe.initIdGenerator(n.deterministicIds, n.deterministicIDSeed); + let s; + const l = []; + for (const e of Array.from(o)) { + if ((nt.info("Rendering diagram: " + e.id), e.getAttribute("data-processed"))) continue; + e.setAttribute("data-processed", "true"); + const i = `mermaid-${a.next()}`; + (s = e.innerHTML), + (s = (0, r.Z)(oe.entityDecode(s)) + .trim() + .replace(//gi, "
    ")); + const n = oe.detectInit(s); + n && nt.debug("Detected early reinit: ", n); + try { + const { svg: r, bindFunctions: n } = await Nn(i, s, e); + (e.innerHTML = r), t && (await t(i)), n && n(e); + } catch (t) { + Ln(t, l, Dn.parseError); + } + } + if (l.length > 0) throw l[0]; + }, + En = function (t) { + Fn.initialize(t); + }, + Zn = function () { + if (Dn.startOnLoad) { + const { startOnLoad: t } = Fn.getConfig(); + t && Dn.run().catch((t) => nt.error("Mermaid failed to initialize", t)); + } + }; + "undefined" != typeof document && window.addEventListener("load", Zn, !1); + const On = []; + let qn = !1; + const In = async () => { + if (!qn) { + for (qn = !0; On.length > 0; ) { + const t = On.shift(); + if (t) + try { + await t(); + } catch (t) { + nt.error("Error executing queue", t); + } + } + qn = !1; + } + }, + Nn = (t, e, i) => + new Promise((r, n) => { + On.push( + () => + new Promise((o, a) => { + Fn.render(t, e, i).then( + (t) => { + o(t), r(t); + }, + (t) => { + var e; + nt.error("Error parsing", t), null == (e = Dn.parseError) || e.call(Dn, t), a(t), n(t); + }, + ); + }), + ), + In().catch(n); + }), + Dn = { + startOnLoad: !0, + mermaidAPI: Fn, + parse: async (t, e) => + new Promise((i, r) => { + On.push( + () => + new Promise((n, o) => { + Fn.parse(t, e).then( + (t) => { + n(t), i(t); + }, + (t) => { + var e; + nt.error("Error parsing", t), null == (e = Dn.parseError) || e.call(Dn, t), o(t), r(t); + }, + ); + }), + ), + In().catch(r); + }), + render: Nn, + init: async function (t, e, i) { + nt.warn("mermaid.init is deprecated. Please use run instead."), t && En(t); + const r = { postRenderCallback: i, querySelector: ".mermaid" }; + "string" == typeof e ? (r.querySelector = e) : e && (e instanceof HTMLElement ? (r.nodes = [e]) : (r.nodes = e)), await Mn(r); + }, + run: Mn, + registerExternalDiagrams: async (t, { lazyLoad: e = !0 } = {}) => { + Zt(...t), + !1 === e && + (await (async () => { + nt.debug("Loading registered diagrams"); + const t = ( + await Promise.allSettled( + Object.entries(At).map(async ([t, { detector: e, loader: i }]) => { + if (i) + try { + Ii(t); + } catch (r) { + try { + const { diagram: t, id: r } = await i(); + qi(r, t, e); + } catch (e) { + throw (nt.error(`Failed to load external diagram with key ${t}. Removing from detectors.`), delete At[t], e); + } + } + }), + ) + ).filter((t) => "rejected" === t.status); + if (t.length > 0) { + nt.error(`Failed to load ${t.length} external diagrams`); + for (const e of t) nt.error(e); + throw new Error(`Failed to load ${t.length} external diagrams`); + } + })()); + }, + initialize: En, + parseError: void 0, + contentLoaded: Zn, + setParseErrorHandler: function (t) { + Dn.parseError = t; + }, + detectType: Et, + }; + }, + 6637: function (t, e, i) { + "use strict"; + i.r(e), + i.d(e, { + default: function () { + return r.N; + }, + }); + var r = i(9339); + i(7484), i(7967), i(7274), i(7856); + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/637-86fbbecd.chunk.min.js.LICENSE.txt b/docs/themes/hugo-geekdoc/static/js/637-86fbbecd.chunk.min.js.LICENSE.txt new file mode 100644 index 000000000..8e6284a61 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/637-86fbbecd.chunk.min.js.LICENSE.txt @@ -0,0 +1,9 @@ +/*! + * Wait for document loaded before starting the execution + */ + +/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */ + +/*! Check if previously processed */ + +/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ diff --git a/docs/themes/hugo-geekdoc/static/js/639-88c6538a.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/639-88c6538a.chunk.min.js new file mode 100644 index 000000000..63f37b045 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/639-88c6538a.chunk.min.js @@ -0,0 +1,74385 @@ +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [639], + { + 7295: function (n, t, e) { + n.exports = (function n(t, e, i) { + function r(a, u) { + if (!e[a]) { + if (!t[a]) { + if (c) return c(a, !0); + var o = new Error("Cannot find module '" + a + "'"); + throw ((o.code = "MODULE_NOT_FOUND"), o); + } + var s = (e[a] = { exports: {} }); + t[a][0].call( + s.exports, + function (n) { + return r(t[a][1][n] || n); + }, + s, + s.exports, + n, + t, + e, + i, + ); + } + return e[a].exports; + } + for (var c = void 0, a = 0; a < i.length; a++) r(i[a]); + return r; + })( + { + 1: [ + function (n, t, e) { + "use strict"; + Object.defineProperty(e, "__esModule", { value: !0 }); + var i = (function () { + function n(n, t) { + for (var e = 0; e < t.length; e++) { + var i = t[e]; + (i.enumerable = i.enumerable || !1), (i.configurable = !0), "value" in i && (i.writable = !0), Object.defineProperty(n, i.key, i); + } + } + return function (t, e, i) { + return e && n(t.prototype, e), i && n(t, i), t; + }; + })(); + function r(n, t) { + if (!(n instanceof t)) throw new TypeError("Cannot call a class as a function"); + } + var c = (function () { + function n() { + var t = this, + e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + i = e.defaultLayoutOptions, + c = void 0 === i ? {} : i, + u = e.algorithms, + o = + void 0 === u + ? ["layered", "stress", "mrtree", "radial", "force", "disco", "sporeOverlap", "sporeCompaction", "rectpacking"] + : u, + s = e.workerFactory, + h = e.workerUrl; + if ((r(this, n), (this.defaultLayoutOptions = c), (this.initialized = !1), void 0 === h && void 0 === s)) + throw new Error("Cannot construct an ELK without both 'workerUrl' and 'workerFactory'."); + var f = s; + void 0 !== h && + void 0 === s && + (f = function (n) { + return new Worker(n); + }); + var l = f(h); + if ("function" != typeof l.postMessage) throw new TypeError("Created worker does not provide the required 'postMessage' function."); + (this.worker = new a(l)), + this.worker + .postMessage({ cmd: "register", algorithms: o }) + .then(function (n) { + return (t.initialized = !0); + }) + .catch(console.err); + } + return ( + i(n, [ + { + key: "layout", + value: function (n) { + var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, + e = t.layoutOptions, + i = void 0 === e ? this.defaultLayoutOptions : e, + r = t.logging, + c = void 0 !== r && r, + a = t.measureExecutionTime, + u = void 0 !== a && a; + return n + ? this.worker.postMessage({ + cmd: "layout", + graph: n, + layoutOptions: i, + options: { logging: c, measureExecutionTime: u }, + }) + : Promise.reject(new Error("Missing mandatory parameter 'graph'.")); + }, + }, + { + key: "knownLayoutAlgorithms", + value: function () { + return this.worker.postMessage({ cmd: "algorithms" }); + }, + }, + { + key: "knownLayoutOptions", + value: function () { + return this.worker.postMessage({ cmd: "options" }); + }, + }, + { + key: "knownLayoutCategories", + value: function () { + return this.worker.postMessage({ cmd: "categories" }); + }, + }, + { + key: "terminateWorker", + value: function () { + this.worker.terminate(); + }, + }, + ]), + n + ); + })(); + e.default = c; + var a = (function () { + function n(t) { + var e = this; + if ((r(this, n), void 0 === t)) throw new Error("Missing mandatory parameter 'worker'."); + (this.resolvers = {}), + (this.worker = t), + (this.worker.onmessage = function (n) { + setTimeout(function () { + e.receive(e, n); + }, 0); + }); + } + return ( + i(n, [ + { + key: "postMessage", + value: function (n) { + var t = this.id || 0; + (this.id = t + 1), (n.id = t); + var e = this; + return new Promise(function (i, r) { + (e.resolvers[t] = function (n, t) { + n ? (e.convertGwtStyleError(n), r(n)) : i(t); + }), + e.worker.postMessage(n); + }); + }, + }, + { + key: "receive", + value: function (n, t) { + var e = t.data, + i = n.resolvers[e.id]; + i && (delete n.resolvers[e.id], e.error ? i(e.error) : i(null, e.data)); + }, + }, + { + key: "terminate", + value: function () { + this.worker.terminate && this.worker.terminate(); + }, + }, + { + key: "convertGwtStyleError", + value: function (n) { + if (n) { + var t = n.__java$exception; + t && + (t.cause && t.cause.backingJsObject && ((n.cause = t.cause.backingJsObject), this.convertGwtStyleError(n.cause)), + delete n.__java$exception); + } + }, + }, + ]), + n + ); + })(); + }, + {}, + ], + 2: [ + function (n, t, i) { + (function (n) { + (function () { + "use strict"; + var e; + function r() {} + function c() {} + function a() {} + function u() {} + function o() {} + function s() {} + function h() {} + function f() {} + function l() {} + function b() {} + function w() {} + function d() {} + function g() {} + function p() {} + function v() {} + function m() {} + function y() {} + function k() {} + function j() {} + function E() {} + function T() {} + function M() {} + function S() {} + function P() {} + function I() {} + function C() {} + function O() {} + function A() {} + function $() {} + function L() {} + function N() {} + function x() {} + function D() {} + function R() {} + function K() {} + function _() {} + function F() {} + function B() {} + function H() {} + function q() {} + function G() {} + function z() {} + function U() {} + function X() {} + function W() {} + function V() {} + function Q() {} + function Y() {} + function J() {} + function Z() {} + function nn() {} + function tn() {} + function en() {} + function rn() {} + function cn() {} + function an() {} + function un() {} + function on() {} + function sn() {} + function hn() {} + function fn() {} + function ln() {} + function bn() {} + function wn() {} + function dn() {} + function gn() {} + function pn() {} + function vn() {} + function mn() {} + function yn() {} + function kn() {} + function jn() {} + function En() {} + function Tn() {} + function Mn() {} + function Sn() {} + function Pn() {} + function In() {} + function Cn() {} + function On() {} + function An() {} + function $n() {} + function Ln() {} + function Nn() {} + function xn() {} + function Dn() {} + function Rn() {} + function Kn() {} + function _n() {} + function Fn() {} + function Bn() {} + function Hn() {} + function qn() {} + function Gn() {} + function zn() {} + function Un() {} + function Xn() {} + function Wn() {} + function Vn() {} + function Qn() {} + function Yn() {} + function Jn() {} + function Zn() {} + function nt() {} + function tt() {} + function et() {} + function it() {} + function rt() {} + function ct() {} + function at() {} + function ut() {} + function ot() {} + function st() {} + function ht() {} + function ft() {} + function lt() {} + function bt() {} + function wt() {} + function dt() {} + function gt() {} + function pt() {} + function vt() {} + function mt() {} + function yt() {} + function kt() {} + function jt() {} + function Et() {} + function Tt() {} + function Mt() {} + function St() {} + function Pt() {} + function It() {} + function Ct() {} + function Ot() {} + function At() {} + function $t() {} + function Lt() {} + function Nt() {} + function xt() {} + function Dt() {} + function Rt() {} + function Kt() {} + function _t() {} + function Ft() {} + function Bt() {} + function Ht() {} + function qt() {} + function Gt() {} + function zt() {} + function Ut() {} + function Xt() {} + function Wt() {} + function Vt() {} + function Qt() {} + function Yt() {} + function Jt() {} + function Zt() {} + function ne() {} + function te() {} + function ee() {} + function ie() {} + function re() {} + function ce() {} + function ae() {} + function ue() {} + function oe() {} + function se() {} + function he() {} + function fe() {} + function le() {} + function be() {} + function we() {} + function de() {} + function ge() {} + function pe() {} + function ve() {} + function me() {} + function ye() {} + function ke() {} + function je() {} + function Ee() {} + function Te() {} + function Me() {} + function Se() {} + function Pe() {} + function Ie() {} + function Ce() {} + function Oe() {} + function Ae() {} + function $e() {} + function Le() {} + function Ne() {} + function xe() {} + function De() {} + function Re() {} + function Ke() {} + function _e() {} + function Fe() {} + function Be() {} + function He() {} + function qe() {} + function Ge() {} + function ze() {} + function Ue() {} + function Xe() {} + function We() {} + function Ve() {} + function Qe() {} + function Ye() {} + function Je() {} + function Ze() {} + function ni() {} + function ti() {} + function ei() {} + function ii() {} + function ri() {} + function ci() {} + function ai() {} + function ui() {} + function oi() {} + function si() {} + function hi() {} + function fi() {} + function li() {} + function bi() {} + function wi() {} + function di() {} + function gi() {} + function pi() {} + function vi() {} + function mi() {} + function yi() {} + function ki() {} + function ji() {} + function Ei() {} + function Ti() {} + function Mi() {} + function Si() {} + function Pi() {} + function Ii() {} + function Ci() {} + function Oi() {} + function Ai() {} + function $i() {} + function Li() {} + function Ni() {} + function xi() {} + function Di() {} + function Ri() {} + function Ki() {} + function _i() {} + function Fi() {} + function Bi() {} + function Hi() {} + function qi() {} + function Gi() {} + function zi() {} + function Ui() {} + function Xi() {} + function Wi() {} + function Vi() {} + function Qi() {} + function Yi() {} + function Ji() {} + function Zi() {} + function nr() {} + function tr() {} + function er() {} + function ir() {} + function rr() {} + function cr() {} + function ar() {} + function ur() {} + function or() {} + function sr() {} + function hr() {} + function fr() {} + function lr() {} + function br() {} + function wr() {} + function dr() {} + function gr() {} + function pr() {} + function vr() {} + function mr() {} + function yr() {} + function kr() {} + function jr() {} + function Er() {} + function Tr() {} + function Mr() {} + function Sr() {} + function Pr() {} + function Ir() {} + function Cr() {} + function Or() {} + function Ar() {} + function $r() {} + function Lr() {} + function Nr() {} + function xr() {} + function Dr() {} + function Rr() {} + function Kr() {} + function _r() {} + function Fr() {} + function Br() {} + function Hr() {} + function qr() {} + function Gr() {} + function zr() {} + function Ur() {} + function Xr() {} + function Wr() {} + function Vr() {} + function Qr() {} + function Yr() {} + function Jr() {} + function Zr() {} + function nc() {} + function tc() {} + function ec() {} + function ic() {} + function rc() {} + function cc() {} + function ac() {} + function uc() {} + function oc() {} + function sc() {} + function hc() {} + function fc() {} + function lc() {} + function bc() {} + function wc() {} + function dc() {} + function gc() {} + function pc() {} + function vc() {} + function mc() {} + function yc() {} + function kc() {} + function jc() {} + function Ec() {} + function Tc() {} + function Mc() {} + function Sc() {} + function Pc() {} + function Ic() {} + function Cc() {} + function Oc() {} + function Ac() {} + function $c() {} + function Lc() {} + function Nc() {} + function xc() {} + function Dc() {} + function Rc() {} + function Kc() {} + function _c() {} + function Fc() {} + function Bc() {} + function Hc() {} + function qc() {} + function Gc() {} + function zc() {} + function Uc() {} + function Xc() {} + function Wc() {} + function Vc() {} + function Qc() {} + function Yc() {} + function Jc() {} + function Zc() {} + function na() {} + function ta() {} + function ea() {} + function ia() {} + function ra() {} + function ca() {} + function aa() {} + function ua() {} + function oa() {} + function sa() {} + function ha() {} + function fa() {} + function la() {} + function ba() {} + function wa() {} + function da() {} + function ga() {} + function pa() {} + function va() {} + function ma() {} + function ya() {} + function ka() {} + function ja() {} + function Ea() {} + function Ta() {} + function Ma() {} + function Sa() {} + function Pa() {} + function Ia() {} + function Ca() {} + function Oa() {} + function Aa() {} + function $a() {} + function La() {} + function Na() {} + function xa() {} + function Da() {} + function Ra() {} + function Ka() {} + function _a() {} + function Fa() {} + function Ba() {} + function Ha() {} + function qa() {} + function Ga() {} + function za() {} + function Ua() {} + function Xa() {} + function Wa() {} + function Va() {} + function Qa() {} + function Ya() {} + function Ja() {} + function Za() {} + function nu() {} + function tu() {} + function eu() {} + function iu() {} + function ru() {} + function cu() {} + function au() {} + function uu() {} + function ou() {} + function su() {} + function hu() {} + function fu() {} + function lu() {} + function bu() {} + function wu() {} + function du() {} + function gu() {} + function pu() {} + function vu() {} + function mu() {} + function yu() {} + function ku() {} + function ju() {} + function Eu() {} + function Tu() {} + function Mu() {} + function Su() {} + function Pu() {} + function Iu() {} + function Cu() {} + function Ou() {} + function Au() {} + function $u() {} + function Lu() {} + function Nu() {} + function xu() {} + function Du() {} + function Ru() {} + function Ku() {} + function _u() {} + function Fu() {} + function Bu() {} + function Hu() {} + function qu() {} + function Gu() {} + function zu() {} + function Uu() {} + function Xu() {} + function Wu() {} + function Vu() {} + function Qu() {} + function Yu() {} + function Ju() {} + function Zu() {} + function no() {} + function to() {} + function eo() {} + function io() {} + function ro() {} + function co() {} + function ao() {} + function uo() {} + function oo() {} + function so() {} + function ho() {} + function fo() {} + function lo() {} + function bo() {} + function wo() {} + function go() {} + function po() {} + function vo() {} + function mo() {} + function yo() {} + function ko() {} + function jo() {} + function Eo() {} + function To() {} + function Mo() {} + function So() {} + function Po() {} + function Io() {} + function Co() {} + function Oo() {} + function Ao() {} + function $o() {} + function Lo() {} + function No() {} + function xo() {} + function Do() {} + function Ro() {} + function Ko() {} + function _o() {} + function Fo() {} + function Bo() {} + function Ho() {} + function qo() {} + function Go() {} + function zo() {} + function Uo() {} + function Xo() {} + function Wo() {} + function Vo() {} + function Qo() {} + function Yo() {} + function Jo() {} + function Zo() {} + function ns() {} + function ts() {} + function es() {} + function is() {} + function rs() {} + function cs() {} + function as() {} + function us() {} + function os() {} + function ss() {} + function hs() {} + function fs() {} + function ls() {} + function bs() {} + function ws() {} + function ds() {} + function gs() {} + function ps() {} + function vs() {} + function ms() {} + function ys() {} + function ks() {} + function js() {} + function Es() {} + function Ts() {} + function Ms() {} + function Ss() {} + function Ps() {} + function Is() {} + function Cs() {} + function Os() {} + function As() {} + function $s() {} + function Ls() {} + function Ns() {} + function xs() {} + function Ds() {} + function Rs() {} + function Ks() {} + function _s() {} + function Fs() {} + function Bs() {} + function Hs() {} + function qs() {} + function Gs() {} + function zs() {} + function Us() {} + function Xs() {} + function Ws() {} + function Vs() {} + function Qs() {} + function Ys() {} + function Js() {} + function Zs() {} + function nh() {} + function th() {} + function eh() {} + function ih() {} + function rh() {} + function ch() {} + function ah() {} + function uh() {} + function oh() {} + function sh() {} + function hh() {} + function fh() {} + function lh() {} + function bh() {} + function wh() {} + function dh() {} + function gh() {} + function ph() {} + function vh() {} + function mh() {} + function yh() {} + function kh() {} + function jh() {} + function Eh() {} + function Th() {} + function Mh() {} + function Sh() {} + function Ph() {} + function Ih() {} + function Ch() {} + function Oh() {} + function Ah() {} + function $h() {} + function Lh() {} + function Nh() {} + function xh() {} + function Dh() {} + function Rh() {} + function Kh() {} + function _h() { + gm(); + } + function Fh() { + O6(); + } + function Bh() { + len(); + } + function Hh() { + pcn(); + } + function qh() { + Eon(); + } + function Gh() { + Bdn(); + } + function zh() { + Lrn(); + } + function Uh() { + Wrn(); + } + function Xh() { + QE(); + } + function Wh() { + UE(); + } + function Vh() { + Ax(); + } + function Qh() { + YE(); + } + function Yh() { + m2(); + } + function Jh() { + ZE(); + } + function Zh() { + eQ(); + } + function nf() { + P0(); + } + function tf() { + uY(); + } + function ef() { + oz(); + } + function rf() { + A6(); + } + function cf() { + Qun(); + } + function af() { + I0(); + } + function uf() { + gX(); + } + function of() { + Ajn(); + } + function sf() { + Rrn(); + } + function hf() { + sz(); + } + function ff() { + gjn(); + } + function lf() { + az(); + } + function bf() { + C0(); + } + function wf() { + e5(); + } + function df() { + bz(); + } + function gf() { + MY(); + } + function pf() { + nT(); + } + function vf() { + lln(); + } + function mf() { + _rn(); + } + function yf() { + b3(); + } + function kf() { + Dun(); + } + function jf() { + Hdn(); + } + function Ef() { + lin(); + } + function Tf() { + cln(); + } + function Mf() { + i4(); + } + function Sf() { + fz(); + } + function Pf() { + epn(); + } + function If() { + uln(); + } + function Cf() { + Jln(); + } + function Of() { + IY(); + } + function Af() { + Run(); + } + function $f() { + Cjn(); + } + function Lf() { + L6(); + } + function Nf() { + Onn(); + } + function xf() { + Jvn(); + } + function Df() { + dx(); + } + function Rf() { + W2(); + } + function Kf() { + Fpn(); + } + function _f(n) { + vB(n); + } + function Ff(n) { + this.a = n; + } + function Bf(n) { + this.a = n; + } + function Hf(n) { + this.a = n; + } + function qf(n) { + this.a = n; + } + function Gf(n) { + this.a = n; + } + function zf(n) { + this.a = n; + } + function Uf(n) { + this.a = n; + } + function Xf(n) { + this.a = n; + } + function Wf(n) { + this.a = n; + } + function Vf(n) { + this.a = n; + } + function Qf(n) { + this.a = n; + } + function Yf(n) { + this.a = n; + } + function Jf(n) { + this.a = n; + } + function Zf(n) { + this.a = n; + } + function nl(n) { + this.a = n; + } + function tl(n) { + this.a = n; + } + function el(n) { + this.a = n; + } + function il(n) { + this.a = n; + } + function rl(n) { + this.a = n; + } + function cl(n) { + this.a = n; + } + function al(n) { + this.a = n; + } + function ul(n) { + this.b = n; + } + function ol(n) { + this.c = n; + } + function sl(n) { + this.a = n; + } + function hl(n) { + this.a = n; + } + function fl(n) { + this.a = n; + } + function ll(n) { + this.a = n; + } + function bl(n) { + this.a = n; + } + function wl(n) { + this.a = n; + } + function dl(n) { + this.a = n; + } + function gl(n) { + this.a = n; + } + function pl(n) { + this.a = n; + } + function vl(n) { + this.a = n; + } + function ml(n) { + this.a = n; + } + function yl(n) { + this.a = n; + } + function kl(n) { + this.a = n; + } + function jl(n) { + this.a = n; + } + function El(n) { + this.a = n; + } + function Tl(n) { + this.a = n; + } + function Ml(n) { + this.a = n; + } + function Sl() { + this.a = []; + } + function Pl(n, t) { + n.a = t; + } + function Il(n, t) { + n.j = t; + } + function Cl(n, t) { + n.c = t; + } + function Ol(n, t) { + n.d = t; + } + function Al(n, t) { + n.k = t; + } + function $l(n, t) { + n.c = t; + } + function Ll(n, t) { + n.a = t; + } + function Nl(n, t) { + n.a = t; + } + function xl(n, t) { + n.f = t; + } + function Dl(n, t) { + n.a = t; + } + function Rl(n, t) { + n.b = t; + } + function Kl(n, t) { + n.d = t; + } + function _l(n, t) { + n.i = t; + } + function Fl(n, t) { + n.o = t; + } + function Bl(n, t) { + n.e = t; + } + function Hl(n, t) { + n.g = t; + } + function ql(n, t) { + n.e = t; + } + function Gl(n, t) { + n.f = t; + } + function zl(n, t) { + n.f = t; + } + function Ul(n, t) { + n.n = t; + } + function Xl(n) { + n.b = n.a; + } + function Wl(n) { + n.c = n.d.d; + } + function Vl(n) { + this.d = n; + } + function Ql(n) { + this.a = n; + } + function Yl(n) { + this.a = n; + } + function Jl(n) { + this.a = n; + } + function Zl(n) { + this.a = n; + } + function nb(n) { + this.a = n; + } + function tb(n) { + this.a = n; + } + function eb(n) { + this.a = n; + } + function ib(n) { + this.a = n; + } + function rb(n) { + this.a = n; + } + function cb(n) { + this.a = n; + } + function ab(n) { + this.a = n; + } + function ub(n) { + this.a = n; + } + function ob(n) { + this.a = n; + } + function sb(n) { + this.a = n; + } + function hb(n) { + this.b = n; + } + function fb(n) { + this.b = n; + } + function lb(n) { + this.b = n; + } + function bb(n) { + this.a = n; + } + function wb(n) { + this.a = n; + } + function db(n) { + this.a = n; + } + function gb(n) { + this.c = n; + } + function pb(n) { + this.c = n; + } + function vb(n) { + this.c = n; + } + function mb(n) { + this.a = n; + } + function yb(n) { + this.a = n; + } + function kb(n) { + this.a = n; + } + function jb(n) { + this.a = n; + } + function Eb(n) { + this.a = n; + } + function Tb(n) { + this.a = n; + } + function Mb(n) { + this.a = n; + } + function Sb(n) { + this.a = n; + } + function Pb(n) { + this.a = n; + } + function Ib(n) { + this.a = n; + } + function Cb(n) { + this.a = n; + } + function Ob(n) { + this.a = n; + } + function Ab(n) { + this.a = n; + } + function $b(n) { + this.a = n; + } + function Lb(n) { + this.a = n; + } + function Nb(n) { + this.a = n; + } + function xb(n) { + this.a = n; + } + function Db(n) { + this.a = n; + } + function Rb(n) { + this.a = n; + } + function Kb(n) { + this.a = n; + } + function _b(n) { + this.a = n; + } + function Fb(n) { + this.a = n; + } + function Bb(n) { + this.a = n; + } + function Hb(n) { + this.a = n; + } + function qb(n) { + this.a = n; + } + function Gb(n) { + this.a = n; + } + function zb(n) { + this.a = n; + } + function Ub(n) { + this.a = n; + } + function Xb(n) { + this.a = n; + } + function Wb(n) { + this.a = n; + } + function Vb(n) { + this.a = n; + } + function Qb(n) { + this.a = n; + } + function Yb(n) { + this.a = n; + } + function Jb(n) { + this.a = n; + } + function Zb(n) { + this.a = n; + } + function nw(n) { + this.a = n; + } + function tw(n) { + this.a = n; + } + function ew(n) { + this.a = n; + } + function iw(n) { + this.a = n; + } + function rw(n) { + this.a = n; + } + function cw(n) { + this.a = n; + } + function aw(n) { + this.a = n; + } + function uw(n) { + this.a = n; + } + function ow(n) { + this.a = n; + } + function sw(n) { + this.a = n; + } + function hw(n) { + this.e = n; + } + function fw(n) { + this.a = n; + } + function lw(n) { + this.a = n; + } + function bw(n) { + this.a = n; + } + function ww(n) { + this.a = n; + } + function dw(n) { + this.a = n; + } + function gw(n) { + this.a = n; + } + function pw(n) { + this.a = n; + } + function vw(n) { + this.a = n; + } + function mw(n) { + this.a = n; + } + function yw(n) { + this.a = n; + } + function kw(n) { + this.a = n; + } + function jw(n) { + this.a = n; + } + function Ew(n) { + this.a = n; + } + function Tw(n) { + this.a = n; + } + function Mw(n) { + this.a = n; + } + function Sw(n) { + this.a = n; + } + function Pw(n) { + this.a = n; + } + function Iw(n) { + this.a = n; + } + function Cw(n) { + this.a = n; + } + function Ow(n) { + this.a = n; + } + function Aw(n) { + this.a = n; + } + function $w(n) { + this.a = n; + } + function Lw(n) { + this.a = n; + } + function Nw(n) { + this.a = n; + } + function xw(n) { + this.a = n; + } + function Dw(n) { + this.a = n; + } + function Rw(n) { + this.a = n; + } + function Kw(n) { + this.a = n; + } + function _w(n) { + this.a = n; + } + function Fw(n) { + this.a = n; + } + function Bw(n) { + this.a = n; + } + function Hw(n) { + this.a = n; + } + function qw(n) { + this.a = n; + } + function Gw(n) { + this.a = n; + } + function zw(n) { + this.a = n; + } + function Uw(n) { + this.a = n; + } + function Xw(n) { + this.a = n; + } + function Ww(n) { + this.a = n; + } + function Vw(n) { + this.a = n; + } + function Qw(n) { + this.a = n; + } + function Yw(n) { + this.a = n; + } + function Jw(n) { + this.a = n; + } + function Zw(n) { + this.a = n; + } + function nd(n) { + this.a = n; + } + function td(n) { + this.a = n; + } + function ed(n) { + this.a = n; + } + function id(n) { + this.a = n; + } + function rd(n) { + this.a = n; + } + function cd(n) { + this.a = n; + } + function ad(n) { + this.a = n; + } + function ud(n) { + this.a = n; + } + function od(n) { + this.a = n; + } + function sd(n) { + this.a = n; + } + function hd(n) { + this.c = n; + } + function fd(n) { + this.b = n; + } + function ld(n) { + this.a = n; + } + function bd(n) { + this.a = n; + } + function wd(n) { + this.a = n; + } + function dd(n) { + this.a = n; + } + function gd(n) { + this.a = n; + } + function pd(n) { + this.a = n; + } + function vd(n) { + this.a = n; + } + function md(n) { + this.a = n; + } + function yd(n) { + this.a = n; + } + function kd(n) { + this.a = n; + } + function jd(n) { + this.a = n; + } + function Ed(n) { + this.a = n; + } + function Td(n) { + this.a = n; + } + function Md(n) { + this.a = n; + } + function Sd(n) { + this.a = n; + } + function Pd(n) { + this.a = n; + } + function Id(n) { + this.a = n; + } + function Cd(n) { + this.a = n; + } + function Od(n) { + this.a = n; + } + function Ad(n) { + this.a = n; + } + function $d(n) { + this.a = n; + } + function Ld(n) { + this.a = n; + } + function Nd(n) { + this.a = n; + } + function xd(n) { + this.a = n; + } + function Dd(n) { + this.a = n; + } + function Rd(n) { + this.a = n; + } + function Kd(n) { + this.a = n; + } + function _d(n) { + this.a = n; + } + function Fd(n) { + this.a = n; + } + function Bd(n) { + this.a = n; + } + function Hd(n) { + this.a = n; + } + function qd(n) { + this.a = n; + } + function Gd(n) { + this.a = n; + } + function zd(n) { + this.a = n; + } + function Ud(n) { + this.a = n; + } + function Xd(n) { + this.a = n; + } + function Wd(n) { + this.a = n; + } + function Vd(n) { + this.a = n; + } + function Qd(n) { + this.a = n; + } + function Yd(n) { + this.a = n; + } + function Jd(n) { + this.a = n; + } + function Zd(n) { + this.a = n; + } + function ng(n) { + this.a = n; + } + function tg(n) { + this.a = n; + } + function eg(n) { + this.a = n; + } + function ig(n) { + this.a = n; + } + function rg(n) { + this.a = n; + } + function cg(n) { + this.a = n; + } + function ag(n) { + this.a = n; + } + function ug(n) { + this.a = n; + } + function og(n) { + this.a = n; + } + function sg(n) { + this.a = n; + } + function hg(n) { + this.a = n; + } + function fg(n) { + this.a = n; + } + function lg(n) { + this.a = n; + } + function bg(n) { + this.a = n; + } + function wg(n) { + this.a = n; + } + function dg(n) { + this.a = n; + } + function gg(n) { + this.a = n; + } + function pg(n) { + this.a = n; + } + function vg(n) { + this.a = n; + } + function mg(n) { + this.a = n; + } + function yg(n) { + this.a = n; + } + function kg(n) { + this.a = n; + } + function jg(n) { + this.a = n; + } + function Eg(n) { + this.a = n; + } + function Tg(n) { + this.a = n; + } + function Mg(n) { + this.a = n; + } + function Sg(n) { + this.a = n; + } + function Pg(n) { + this.a = n; + } + function Ig(n) { + this.a = n; + } + function Cg(n) { + this.a = n; + } + function Og(n) { + this.b = n; + } + function Ag(n) { + this.f = n; + } + function $g(n) { + this.a = n; + } + function Lg(n) { + this.a = n; + } + function Ng(n) { + this.a = n; + } + function xg(n) { + this.a = n; + } + function Dg(n) { + this.a = n; + } + function Rg(n) { + this.a = n; + } + function Kg(n) { + this.a = n; + } + function _g(n) { + this.a = n; + } + function Fg(n) { + this.a = n; + } + function Bg(n) { + this.a = n; + } + function Hg(n) { + this.a = n; + } + function qg(n) { + this.b = n; + } + function Gg(n) { + this.c = n; + } + function zg(n) { + this.e = n; + } + function Ug(n) { + this.a = n; + } + function Xg(n) { + this.a = n; + } + function Wg(n) { + this.a = n; + } + function Vg(n) { + this.a = n; + } + function Qg(n) { + this.a = n; + } + function Yg(n) { + this.d = n; + } + function Jg(n) { + this.a = n; + } + function Zg(n) { + this.a = n; + } + function np(n) { + this.e = n; + } + function tp() { + this.a = 0; + } + function ep() { + $C(this); + } + function ip() { + AC(this); + } + function rp() { + U_(this); + } + function cp() { + QB(this); + } + function ap() {} + function up() { + this.c = Wat; + } + function op(n, t) { + n.b += t; + } + function sp(n) { + n.b = new gy(); + } + function hp(n) { + return n.e; + } + function fp(n) { + return n.a; + } + function lp(n) { + return n.a; + } + function bp(n) { + return n.a; + } + function wp(n) { + return n.a; + } + function dp(n) { + return n.a; + } + function gp() { + return null; + } + function pp() { + return null; + } + function vp(n, t) { + n.b = t - n.b; + } + function mp(n, t) { + n.a = t - n.a; + } + function yp(n, t) { + t.ad(n.a); + } + function kp(n, t) { + (n.e = t), (t.b = n); + } + function jp(n) { + px(), (this.a = n); + } + function Ep(n) { + px(), (this.a = n); + } + function Tp(n) { + px(), (this.a = n); + } + function Mp(n) { + VF(), (this.a = n); + } + function Sp(n) { + $q(), p_n.be(n); + } + function Pp() { + OA.call(this); + } + function Ip() { + OA.call(this); + } + function Cp() { + Pp.call(this); + } + function Op() { + Pp.call(this); + } + function Ap() { + Pp.call(this); + } + function $p() { + Pp.call(this); + } + function Lp() { + Pp.call(this); + } + function Np() { + Pp.call(this); + } + function xp() { + Pp.call(this); + } + function Dp() { + Pp.call(this); + } + function Rp() { + Pp.call(this); + } + function Kp() { + Pp.call(this); + } + function _p() { + Pp.call(this); + } + function Fp() { + this.a = this; + } + function Bp() { + this.Bb |= 256; + } + function Hp() { + this.b = new xI(); + } + function qp() { + (qp = O), new rp(); + } + function Gp() { + Cp.call(this); + } + function zp(n, t) { + n.length = t; + } + function Up(n, t) { + eD(n.a, t); + } + function Xp(n, t) { + K3(n.e, t); + } + function Wp(n) { + kfn(n.c, n.b); + } + function Vp(n) { + this.a = (function (n) { + var t; + return (t = gon(n)) > 34028234663852886e22 ? JTn : t < -34028234663852886e22 ? ZTn : t; + })(n); + } + function Qp() { + this.a = new rp(); + } + function Yp() { + this.a = new rp(); + } + function Jp() { + this.a = new ip(); + } + function Zp() { + this.a = new ip(); + } + function nv() { + this.a = new ip(); + } + function tv() { + this.a = new kn(); + } + function ev() { + this.a = new WV(); + } + function iv() { + this.a = new bt(); + } + function rv() { + this.a = new jE(); + } + function cv() { + this.a = new gU(); + } + function av() { + this.a = new NG(); + } + function uv() { + this.a = new aN(); + } + function ov() { + this.a = new ip(); + } + function sv() { + this.a = new ip(); + } + function hv() { + this.a = new ip(); + } + function fv() { + this.a = new ip(); + } + function lv() { + this.d = new ip(); + } + function bv() { + this.a = new Qp(); + } + function wv() { + this.a = new rp(); + } + function dv() { + this.b = new rp(); + } + function gv() { + this.b = new ip(); + } + function pv() { + this.e = new ip(); + } + function vv() { + this.d = new ip(); + } + function mv() { + this.a = new cf(); + } + function yv() { + ip.call(this); + } + function kv() { + Jp.call(this); + } + function jv() { + sN.call(this); + } + function Ev() { + sv.call(this); + } + function Tv() { + Mv.call(this); + } + function Mv() { + ap.call(this); + } + function Sv() { + ap.call(this); + } + function Pv() { + Sv.call(this); + } + function Iv() { + Eq.call(this); + } + function Cv() { + Eq.call(this); + } + function Ov() { + um.call(this); + } + function Av() { + um.call(this); + } + function $v() { + um.call(this); + } + function Lv() { + om.call(this); + } + function Nv() { + ME.call(this); + } + function xv() { + eo.call(this); + } + function Dv() { + eo.call(this); + } + function Rv() { + bm.call(this); + } + function Kv() { + bm.call(this); + } + function _v() { + rp.call(this); + } + function Fv() { + rp.call(this); + } + function Bv() { + rp.call(this); + } + function Hv() { + Qp.call(this); + } + function qv() { + T0.call(this); + } + function Gv() { + Bp.call(this); + } + function zv() { + zO.call(this); + } + function Uv() { + zO.call(this); + } + function Xv() { + rp.call(this); + } + function Wv() { + rp.call(this); + } + function Vv() { + rp.call(this); + } + function Qv() { + yo.call(this); + } + function Yv() { + yo.call(this); + } + function Jv() { + Qv.call(this); + } + function Zv() { + Dh.call(this); + } + function nm(n) { + _Z.call(this, n); + } + function tm(n) { + _Z.call(this, n); + } + function em(n) { + Wf.call(this, n); + } + function im(n) { + tE.call(this, n); + } + function rm(n) { + im.call(this, n); + } + function cm(n) { + tE.call(this, n); + } + function am() { + this.a = new ME(); + } + function um() { + this.a = new Qp(); + } + function om() { + this.a = new rp(); + } + function sm() { + this.a = new ip(); + } + function hm() { + this.j = new ip(); + } + function fm() { + this.a = new Xa(); + } + function lm() { + this.a = new bj(); + } + function bm() { + this.a = new mo(); + } + function wm() { + (wm = O), (n_n = new Ky()); + } + function dm() { + (dm = O), (ZKn = new Ry()); + } + function gm() { + (gm = O), (zKn = new c()); + } + function pm() { + (pm = O), (a_n = new mA()); + } + function vm(n) { + im.call(this, n); + } + function mm(n) { + im.call(this, n); + } + function ym(n) { + hW.call(this, n); + } + function km(n) { + hW.call(this, n); + } + function jm(n) { + ix.call(this, n); + } + function Em(n) { + kon.call(this, n); + } + function Tm(n) { + rE.call(this, n); + } + function Mm(n) { + aE.call(this, n); + } + function Sm(n) { + aE.call(this, n); + } + function Pm(n) { + aE.call(this, n); + } + function Im(n) { + xK.call(this, n); + } + function Cm(n) { + Im.call(this, n); + } + function Om() { + Ml.call(this, {}); + } + function Am(n) { + qO(), (this.a = n); + } + function $m(n) { + (n.b = null), (n.c = 0); + } + function Lm(n, t) { + (n.a = t), + (function (n) { + var t, i, r; + for ( + (function (n) { + var t, i, r; + for (i = new pb(n.a.a.b); i.a < i.c.c.length; ) + (t = Yx(Hz(i), 81)), + vB(0), + (r = 0) > 0 && + ((!lC(n.a.c) || !t.n.d) && (!bC(n.a.c) || !t.n.b) && (t.g.d -= e.Math.max(0, r / 2 - 0.5)), + (!lC(n.a.c) || !t.n.a) && (!bC(n.a.c) || !t.n.c) && (t.g.a += e.Math.max(0, r - 1))); + })(n), + r = new ip(), + i = new pb(n.a.a.b); + i.a < i.c.c.length; + + ) + eD(r, new CM((t = Yx(Hz(i), 81)), !0)), eD(r, new CM(t, !1)); + (function (n) { + var t, e; + for ($m(n.b.a), n.a = VQ(hzn, iEn, 81, n.c.a.a.b.c.length, 0, 1), t = 0, e = new pb(n.c.a.a.b); e.a < e.c.c.length; ) + Yx(Hz(e), 81).i = t++; + })(n.c), + $U(r, n.b, new ay(x4(Gy(lzn, 1), iEn, 369, 0, [n.c]))), + (function (n) { + var t, i, r; + for (i = new pb(n.a.a.b); i.a < i.c.c.length; ) + (t = Yx(Hz(i), 81)), + vB(0), + (r = 0) > 0 && + ((!lC(n.a.c) || !t.n.d) && (!bC(n.a.c) || !t.n.b) && (t.g.d += e.Math.max(0, r / 2 - 0.5)), + (!lC(n.a.c) || !t.n.a) && (!bC(n.a.c) || !t.n.c) && (t.g.a -= r - 1)); + })(n); + })(n); + } + function Nm(n, t, e) { + n.a[t.g] = e; + } + function xm(n, t, e) { + !(function (n, t, e) { + var i, r; + for (TC(n, n.j + t, n.k + e), r = new UO((!n.a && (n.a = new XO(Qrt, n, 5)), n.a)); r.e != r.i.gc(); ) + yC((i = Yx(hen(r), 469)), i.a + t, i.b + e); + EC(n, n.b + t, n.c + e); + })(e, n, t); + } + function Dm(n, t) { + !(function (n, t) { + lC(n.f) + ? (function (n, t) { + var e, i, r, c, a; + for (c = n.g.a, a = n.g.b, i = new pb(n.d); i.a < i.c.c.length; ) + (r = (e = Yx(Hz(i), 70)).n), + n.a == (K4(), LXn) || n.i == (Ikn(), Eit) + ? (r.a = c) + : n.a == NXn || n.i == (Ikn(), qit) + ? (r.a = c + n.j.a - e.o.a) + : (r.a = c + (n.j.a - e.o.a) / 2), + (r.b = a), + mN(r, t), + (a += e.o.b + n.e); + })(n, t) + : (function (n, t) { + var e, i, r, c, a; + for (c = n.g.a, a = n.g.b, i = new pb(n.d); i.a < i.c.c.length; ) + ((r = (e = Yx(Hz(i), 70)).n).a = c), + n.i == (Ikn(), Tit) ? (r.b = a + n.j.b - e.o.b) : (r.b = a), + mN(r, t), + (c += e.o.a + n.e); + })(n, t); + })(t.i, n.n); + } + function Rm(n, t) { + (function (n) { + return eD(n.c, (H4(), b7n)), d1(n.a, ty(fL(oen((cnn(), s2n))))) ? new qu() : new Yd(n); + })(n).td(t); + } + function Km(n, t) { + return n.g - t.g; + } + function _m(n) { + return new Tl(n); + } + function Fm(n) { + return new zF(n); + } + function Bm(n) { + Im.call(this, n); + } + function Hm(n) { + Im.call(this, n); + } + function qm(n) { + Im.call(this, n); + } + function Gm(n) { + xK.call(this, n); + } + function zm(n) { + l3(), (this.a = n); + } + function Um(n) { + wx(), (this.a = n); + } + function Xm(n) { + gK(), (this.f = n); + } + function Wm(n) { + gK(), (this.f = n); + } + function Vm(n) { + Im.call(this, n); + } + function Qm(n) { + Im.call(this, n); + } + function Ym(n) { + Im.call(this, n); + } + function Jm(n) { + Im.call(this, n); + } + function Zm(n) { + Im.call(this, n); + } + function ny(n) { + return vB(n), n; + } + function ty(n) { + return vB(n), n; + } + function ey(n) { + return vB(n), n; + } + function iy(n) { + return vB(n), n; + } + function ry(n) { + return n.b == n.c; + } + function cy(n) { + return !!n && n.b; + } + function ay(n) { + vB(n), (this.a = n); + } + function uy(n) { + return X5(n), n; + } + function oy(n) { + x_(n, n.length); + } + function sy(n) { + Im.call(this, n); + } + function hy(n) { + Im.call(this, n); + } + function fy(n) { + Im.call(this, n); + } + function ly(n) { + Im.call(this, n); + } + function by(n) { + Im.call(this, n); + } + function wy(n) { + Im.call(this, n); + } + function dy(n) { + i$.call(this, n, 0); + } + function gy() { + Cz.call(this, 12, 3); + } + function py() { + (py = O), (g_n = new j()); + } + function vy() { + (vy = O), (l_n = new r()); + } + function my() { + (my = O), (m_n = new g()); + } + function yy() { + (yy = O), (M_n = new v()); + } + function ky() { + throw hp(new xp()); + } + function jy() { + throw hp(new xp()); + } + function Ey() { + throw hp(new xp()); + } + function Ty() { + this.a = lL(MF(tEn)); + } + function My(n) { + px(), (this.a = MF(n)); + } + function Sy(n, t) { + n.Td(t), t.Sd(n); + } + function Py(n) { + Hm.call(this, n); + } + function Iy(n) { + Qm.call(this, n); + } + function Cy() { + nb.call(this, ""); + } + function Oy() { + nb.call(this, ""); + } + function Ay() { + nb.call(this, ""); + } + function $y() { + nb.call(this, ""); + } + function Ly(n) { + Hm.call(this, n); + } + function Ny(n) { + fb.call(this, n); + } + function xy(n) { + PA.call(this, n); + } + function Dy(n) { + Ny.call(this, n); + } + function Ry() { + Zf.call(this, null); + } + function Ky() { + Zf.call(this, null); + } + function _y() { + (_y = O), $q(); + } + function Fy() { + (Fy = O), + (xFn = (function () { + function n() { + try { + return new Map().entries().next().done; + } catch (n) { + return !1; + } + } + return typeof Map === Qjn && Map.prototype.entries && n() + ? Map + : (function () { + function n() { + this.obj = this.createObject(); + } + return ( + (n.prototype.createObject = function (n) { + return Object.create(null); + }), + (n.prototype.get = function (n) { + return this.obj[n]; + }), + (n.prototype.set = function (n, t) { + this.obj[n] = t; + }), + (n.prototype[vMn] = function (n) { + delete this.obj[n]; + }), + (n.prototype.keys = function () { + return Object.getOwnPropertyNames(this.obj); + }), + (n.prototype.entries = function () { + var n = this.keys(), + t = this, + e = 0; + return { + next: function () { + if (e >= n.length) return { done: !0 }; + var i = n[e++]; + return { value: [i, t.get(i)], done: !1 }; + }, + }; + }), + (function () { + if (!Object.create || !Object.getOwnPropertyNames) return !1; + var n = "__proto__", + t = Object.create(null); + return ( + void 0 === t[n] && + 0 == Object.getOwnPropertyNames(t).length && + ((t[n] = 42), 42 === t[n] && 0 != Object.getOwnPropertyNames(t).length) + ); + })() || + ((n.prototype.createObject = function () { + return {}; + }), + (n.prototype.get = function (n) { + return this.obj[":" + n]; + }), + (n.prototype.set = function (n, t) { + this.obj[":" + n] = t; + }), + (n.prototype[vMn] = function (n) { + delete this.obj[":" + n]; + }), + (n.prototype.keys = function () { + var n = []; + for (var t in this.obj) 58 == t.charCodeAt(0) && n.push(t.substring(1)); + return n; + })), + n + ); + })(); + })()); + } + function By(n) { + return n.a ? n.b : 0; + } + function Hy(n) { + return n.a ? n.b : 0; + } + function qy(n, t) { + return aJ(n, t); + } + function Gy(n, t) { + return qG(n, t); + } + function zy(n, t) { + return (n.f = t), n; + } + function Uy(n, t) { + return (n.c = t), n; + } + function Xy(n, t) { + return (n.a = t), n; + } + function Wy(n, t) { + return (n.f = t), n; + } + function Vy(n, t) { + return (n.k = t), n; + } + function Qy(n, t) { + return (n.a = t), n; + } + function Yy(n, t) { + return (n.e = t), n; + } + function Jy(n, t) { + (n.b = !0), (n.d = t); + } + function Zy(n, t) { + return n ? 0 : t - 1; + } + function nk(n, t) { + return (n.b = t), n; + } + function tk(n, t) { + return (n.a = t), n; + } + function ek(n, t) { + return (n.c = t), n; + } + function ik(n, t) { + return (n.d = t), n; + } + function rk(n, t) { + return (n.e = t), n; + } + function ck(n, t) { + return (n.f = t), n; + } + function ak(n, t) { + return (n.a = t), n; + } + function uk(n, t) { + return (n.b = t), n; + } + function ok(n, t) { + return (n.c = t), n; + } + function sk(n, t) { + return (n.c = t), n; + } + function hk(n, t) { + return (n.b = t), n; + } + function fk(n, t) { + return (n.d = t), n; + } + function lk(n, t) { + return (n.e = t), n; + } + function bk(n, t) { + return (n.g = t), n; + } + function wk(n, t) { + return (n.a = t), n; + } + function dk(n, t) { + return (n.i = t), n; + } + function gk(n, t) { + return (n.j = t), n; + } + function pk(n, t) { + return (n.k = t), n; + } + function vk(n, t, e) { + !(function (n, t, e) { + __(n, new ZT(t.a, e.a)); + })(n.a, t, e); + } + function mk(n) { + wH.call(this, n); + } + function yk(n) { + wH.call(this, n); + } + function kk(n) { + ox.call(this, n); + } + function jk(n) { + O7.call(this, n); + } + function Ek(n) { + FZ.call(this, n); + } + function Tk(n) { + KH.call(this, n); + } + function Mk(n) { + KH.call(this, n); + } + function Sk() { + sO.call(this, ""); + } + function Pk() { + (this.a = 0), (this.b = 0); + } + function Ik() { + (this.b = 0), (this.a = 0); + } + function Ck(n, t) { + (n.b = 0), F1(n, t); + } + function Ok(n, t) { + return n.c._b(t); + } + function Ak(n) { + return n.e && n.e(); + } + function $k(n) { + return n ? n.d : null; + } + function Lk(n, t) { + return R8(n.b, t); + } + function Nk(n) { + return sL(n), n.o; + } + function xk() { + (xk = O), + (Ort = (function () { + var n, t; + Jvn(); + try { + if ((t = Yx(Jcn((mT(), aat), xNn), 2014))) return t; + } catch (t) { + if (!CO((t = j4(t)), 102)) throw hp(t); + (n = t), AK((GC(), n)); + } + return new ao(); + })()); + } + function Dk() { + var n; + (Dk = O), + (Art = sct + ? Yx(Hln((mT(), aat), xNn), 2016) + : ((n = Yx(CO(aG((mT(), aat), xNn), 555) ? aG(aat, xNn) : new Gfn(), 555)), + (sct = !0), + (function (n) { + n.q || + ((n.q = !0), + (n.p = q3(n, 0)), + (n.a = q3(n, 1)), + P2(n.a, 0), + (n.f = q3(n, 2)), + P2(n.f, 1), + S2(n.f, 2), + (n.n = q3(n, 3)), + S2(n.n, 3), + S2(n.n, 4), + S2(n.n, 5), + S2(n.n, 6), + (n.g = q3(n, 4)), + P2(n.g, 7), + S2(n.g, 8), + (n.c = q3(n, 5)), + P2(n.c, 7), + P2(n.c, 8), + (n.i = q3(n, 6)), + P2(n.i, 9), + P2(n.i, 10), + P2(n.i, 11), + P2(n.i, 12), + S2(n.i, 13), + (n.j = q3(n, 7)), + P2(n.j, 9), + (n.d = q3(n, 8)), + P2(n.d, 3), + P2(n.d, 4), + P2(n.d, 5), + P2(n.d, 6), + S2(n.d, 7), + S2(n.d, 8), + S2(n.d, 9), + S2(n.d, 10), + (n.b = q3(n, 9)), + S2(n.b, 0), + S2(n.b, 1), + (n.e = q3(n, 10)), + S2(n.e, 1), + S2(n.e, 2), + S2(n.e, 3), + S2(n.e, 4), + P2(n.e, 5), + P2(n.e, 6), + P2(n.e, 7), + P2(n.e, 8), + P2(n.e, 9), + P2(n.e, 10), + S2(n.e, 11), + (n.k = q3(n, 11)), + S2(n.k, 0), + S2(n.k, 1), + (n.o = G3(n, 12)), + (n.s = G3(n, 13))); + })(n), + (function (n) { + var t, e, i, r, c, a, u; + n.r || + ((n.r = !0), + E2(n, "graph"), + T2(n, "graph"), + M2(n, xNn), + g4(n.o, "T"), + fY(Iq(n.a), n.p), + fY(Iq(n.f), n.a), + fY(Iq(n.n), n.f), + fY(Iq(n.g), n.n), + fY(Iq(n.c), n.n), + fY(Iq(n.i), n.c), + fY(Iq(n.j), n.c), + fY(Iq(n.d), n.f), + fY(Iq(n.e), n.a), + TU(n.p, uqn, zSn, !0, !0, !1), + (u = $4((a = o6(n.p, n.p, "setProperty")))), + (t = SH(n.o)), + (e = new up()), + fY((!t.d && (t.d = new XO(hat, t, 1)), t.d), e), + van(e, (i = PH(u))), + Ycn(a, t, RNn), + Ycn(a, (t = PH(u)), KNn), + (u = $4((a = o6(n.p, null, "getProperty")))), + (t = SH(n.o)), + (e = PH(u)), + fY((!t.d && (t.d = new XO(hat, t, 1)), t.d), e), + Ycn(a, t, RNn), + (c = fun(a, (t = PH(u)), null)) && c.Fi(), + (a = o6(n.p, n.wb.e, "hasProperty")), + (t = SH(n.o)), + (e = new up()), + fY((!t.d && (t.d = new XO(hat, t, 1)), t.d), e), + Ycn(a, t, RNn), + Crn((a = o6(n.p, n.p, "copyProperties")), n.p, _Nn), + (a = o6(n.p, null, "getAllProperties")), + (t = SH(n.wb.P)), + (e = SH(n.o)), + fY((!t.d && (t.d = new XO(hat, t, 1)), t.d), e), + (i = new up()), + fY((!e.d && (e.d = new XO(hat, e, 1)), e.d), i), + (e = SH(n.wb.M)), + fY((!t.d && (t.d = new XO(hat, t, 1)), t.d), e), + (r = fun(a, t, null)) && r.Fi(), + TU(n.a, Vrt, aNn, !0, !1, !0), + Prn(Yx(c1(aq(n.a), 0), 18), n.k, null, FNn, 0, -1, Vrt, !1, !1, !0, !0, !1, !1, !1), + TU(n.f, Yrt, oNn, !0, !1, !0), + Prn(Yx(c1(aq(n.f), 0), 18), n.g, Yx(c1(aq(n.g), 0), 18), "labels", 0, -1, Yrt, !1, !1, !0, !0, !1, !1, !1), + z2(Yx(c1(aq(n.f), 1), 34), n.wb._, BNn, null, 0, 1, Yrt, !1, !1, !0, !1, !0, !1), + TU(n.n, Jrt, "ElkShape", !0, !1, !0), + z2(Yx(c1(aq(n.n), 0), 34), n.wb.t, HNn, sMn, 1, 1, Jrt, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.n), 1), 34), n.wb.t, qNn, sMn, 1, 1, Jrt, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.n), 2), 34), n.wb.t, "x", sMn, 1, 1, Jrt, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.n), 3), 34), n.wb.t, "y", sMn, 1, 1, Jrt, !1, !1, !0, !1, !0, !1), + Crn((a = o6(n.n, null, "setDimensions")), n.wb.t, qNn), + Crn(a, n.wb.t, HNn), + Crn((a = o6(n.n, null, "setLocation")), n.wb.t, "x"), + Crn(a, n.wb.t, "y"), + TU(n.g, act, wNn, !1, !1, !0), + Prn(Yx(c1(aq(n.g), 0), 18), n.f, Yx(c1(aq(n.f), 0), 18), GNn, 0, 1, act, !1, !1, !0, !1, !1, !1, !1), + z2(Yx(c1(aq(n.g), 1), 34), n.wb._, zNn, "", 0, 1, act, !1, !1, !0, !1, !0, !1), + TU(n.c, Zrt, sNn, !0, !1, !0), + Prn(Yx(c1(aq(n.c), 0), 18), n.d, Yx(c1(aq(n.d), 1), 18), "outgoingEdges", 0, -1, Zrt, !1, !1, !0, !1, !0, !1, !1), + Prn(Yx(c1(aq(n.c), 1), 18), n.d, Yx(c1(aq(n.d), 2), 18), "incomingEdges", 0, -1, Zrt, !1, !1, !0, !1, !0, !1, !1), + TU(n.i, uct, dNn, !1, !1, !0), + Prn(Yx(c1(aq(n.i), 0), 18), n.j, Yx(c1(aq(n.j), 0), 18), "ports", 0, -1, uct, !1, !1, !0, !0, !1, !1, !1), + Prn(Yx(c1(aq(n.i), 1), 18), n.i, Yx(c1(aq(n.i), 2), 18), UNn, 0, -1, uct, !1, !1, !0, !0, !1, !1, !1), + Prn(Yx(c1(aq(n.i), 2), 18), n.i, Yx(c1(aq(n.i), 1), 18), GNn, 0, 1, uct, !1, !1, !0, !1, !1, !1, !1), + Prn(Yx(c1(aq(n.i), 3), 18), n.d, Yx(c1(aq(n.d), 0), 18), "containedEdges", 0, -1, uct, !1, !1, !0, !0, !1, !1, !1), + z2(Yx(c1(aq(n.i), 4), 34), n.wb.e, XNn, null, 0, 1, uct, !0, !0, !1, !1, !0, !0), + TU(n.j, oct, gNn, !1, !1, !0), + Prn(Yx(c1(aq(n.j), 0), 18), n.i, Yx(c1(aq(n.i), 0), 18), GNn, 0, 1, oct, !1, !1, !0, !1, !1, !1, !1), + TU(n.d, nct, hNn, !1, !1, !0), + Prn(Yx(c1(aq(n.d), 0), 18), n.i, Yx(c1(aq(n.i), 3), 18), "containingNode", 0, 1, nct, !1, !1, !0, !1, !1, !1, !1), + Prn(Yx(c1(aq(n.d), 1), 18), n.c, Yx(c1(aq(n.c), 0), 18), WNn, 0, -1, nct, !1, !1, !0, !1, !0, !1, !1), + Prn(Yx(c1(aq(n.d), 2), 18), n.c, Yx(c1(aq(n.c), 1), 18), VNn, 0, -1, nct, !1, !1, !0, !1, !0, !1, !1), + Prn(Yx(c1(aq(n.d), 3), 18), n.e, Yx(c1(aq(n.e), 5), 18), QNn, 0, -1, nct, !1, !1, !0, !0, !1, !1, !1), + z2(Yx(c1(aq(n.d), 4), 34), n.wb.e, "hyperedge", null, 0, 1, nct, !0, !0, !1, !1, !0, !0), + z2(Yx(c1(aq(n.d), 5), 34), n.wb.e, XNn, null, 0, 1, nct, !0, !0, !1, !1, !0, !0), + z2(Yx(c1(aq(n.d), 6), 34), n.wb.e, "selfloop", null, 0, 1, nct, !0, !0, !1, !1, !0, !0), + z2(Yx(c1(aq(n.d), 7), 34), n.wb.e, "connected", null, 0, 1, nct, !0, !0, !1, !1, !0, !0), + TU(n.b, Qrt, uNn, !1, !1, !0), + z2(Yx(c1(aq(n.b), 0), 34), n.wb.t, "x", sMn, 1, 1, Qrt, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.b), 1), 34), n.wb.t, "y", sMn, 1, 1, Qrt, !1, !1, !0, !1, !0, !1), + Crn((a = o6(n.b, null, "set")), n.wb.t, "x"), + Crn(a, n.wb.t, "y"), + TU(n.e, tct, fNn, !1, !1, !0), + z2(Yx(c1(aq(n.e), 0), 34), n.wb.t, "startX", null, 0, 1, tct, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.e), 1), 34), n.wb.t, "startY", null, 0, 1, tct, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.e), 2), 34), n.wb.t, "endX", null, 0, 1, tct, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.e), 3), 34), n.wb.t, "endY", null, 0, 1, tct, !1, !1, !0, !1, !0, !1), + Prn(Yx(c1(aq(n.e), 4), 18), n.b, null, YNn, 0, -1, tct, !1, !1, !0, !0, !1, !1, !1), + Prn(Yx(c1(aq(n.e), 5), 18), n.d, Yx(c1(aq(n.d), 3), 18), GNn, 0, 1, tct, !1, !1, !0, !1, !1, !1, !1), + Prn(Yx(c1(aq(n.e), 6), 18), n.c, null, JNn, 0, 1, tct, !1, !1, !0, !1, !0, !1, !1), + Prn(Yx(c1(aq(n.e), 7), 18), n.c, null, ZNn, 0, 1, tct, !1, !1, !0, !1, !0, !1, !1), + Prn(Yx(c1(aq(n.e), 8), 18), n.e, Yx(c1(aq(n.e), 9), 18), nxn, 0, -1, tct, !1, !1, !0, !1, !0, !1, !1), + Prn(Yx(c1(aq(n.e), 9), 18), n.e, Yx(c1(aq(n.e), 8), 18), txn, 0, -1, tct, !1, !1, !0, !1, !0, !1, !1), + z2(Yx(c1(aq(n.e), 10), 34), n.wb._, BNn, null, 0, 1, tct, !1, !1, !0, !1, !0, !1), + Crn((a = o6(n.e, null, "setStartLocation")), n.wb.t, "x"), + Crn(a, n.wb.t, "y"), + Crn((a = o6(n.e, null, "setEndLocation")), n.wb.t, "x"), + Crn(a, n.wb.t, "y"), + TU(n.k, i_n, "ElkPropertyToValueMapEntry", !1, !1, !1), + (t = SH(n.o)), + (e = new up()), + fY((!t.d && (t.d = new XO(hat, t, 1)), t.d), e), + Pfn(Yx(c1(aq(n.k), 0), 34), t, "key", i_n, !1, !1, !0, !1), + z2(Yx(c1(aq(n.k), 1), 34), n.s, KNn, null, 0, 1, i_n, !1, !1, !0, !1, !0, !1), + YB(n.o, S7n, "IProperty", !0), + YB(n.s, UKn, "PropertyValue", !0), + s8(n, xNn)); + })(n), + Srn(n), + GG(aat, xNn, n), + n)); + } + function Rk() { + (Rk = O), + (dat = (function () { + var n, t; + Jvn(); + try { + if ((t = Yx(Jcn((mT(), aat), hRn), 1941))) return t; + } catch (t) { + if (!CO((t = j4(t)), 102)) throw hp(t); + (n = t), AK((GC(), n)); + } + return new qo(); + })()); + } + function Kk() { + (Kk = O), + (Out = (function () { + var n, t; + rJ(); + try { + if ((t = Yx(Jcn((mT(), aat), BRn), 2024))) return t; + } catch (t) { + if (!CO((t = j4(t)), 102)) throw hp(t); + (n = t), AK((GC(), n)); + } + return new Ds(); + })()); + } + function _k() { + var n; + (_k = O), + (Aut = wot + ? Yx(Hln((mT(), aat), BRn), 1945) + : (zI(Cut, new Vs()), + zI(aot, new ah()), + zI(uot, new ph()), + zI(oot, new Ih()), + zI(fFn, new $h()), + zI(Gy(Yot, 1), new Lh()), + zI(D_n, new Nh()), + zI(__n, new xh()), + zI(fFn, new _s()), + zI(fFn, new Fs()), + zI(fFn, new Bs()), + zI(H_n, new Hs()), + zI(fFn, new qs()), + zI(JKn, new Gs()), + zI(JKn, new zs()), + zI(fFn, new Us()), + zI(q_n, new Xs()), + zI(fFn, new Ws()), + zI(fFn, new Qs()), + zI(fFn, new Ys()), + zI(fFn, new Js()), + zI(fFn, new Zs()), + zI(Gy(Yot, 1), new nh()), + zI(fFn, new th()), + zI(fFn, new eh()), + zI(JKn, new ih()), + zI(JKn, new rh()), + zI(fFn, new ch()), + zI(U_n, new uh()), + zI(fFn, new oh()), + zI(J_n, new sh()), + zI(fFn, new hh()), + zI(fFn, new fh()), + zI(fFn, new lh()), + zI(fFn, new bh()), + zI(JKn, new wh()), + zI(JKn, new dh()), + zI(fFn, new gh()), + zI(fFn, new vh()), + zI(fFn, new mh()), + zI(fFn, new yh()), + zI(fFn, new kh()), + zI(fFn, new jh()), + zI(nFn, new Eh()), + zI(fFn, new Th()), + zI(fFn, new Mh()), + zI(fFn, new Sh()), + zI(nFn, new Ph()), + zI(J_n, new Ch()), + zI(fFn, new Oh()), + zI(U_n, new Ah()), + (n = Yx(CO(aG((mT(), aat), BRn), 586) ? aG(aat, BRn) : new AB(), 586)), + (wot = !0), + (function (n) { + n.N || + ((n.N = !0), + (n.b = q3(n, 0)), + S2(n.b, 0), + S2(n.b, 1), + S2(n.b, 2), + (n.bb = q3(n, 1)), + S2(n.bb, 0), + S2(n.bb, 1), + (n.fb = q3(n, 2)), + S2(n.fb, 3), + S2(n.fb, 4), + P2(n.fb, 5), + (n.qb = q3(n, 3)), + S2(n.qb, 0), + P2(n.qb, 1), + P2(n.qb, 2), + S2(n.qb, 3), + S2(n.qb, 4), + P2(n.qb, 5), + S2(n.qb, 6), + (n.a = G3(n, 4)), + (n.c = G3(n, 5)), + (n.d = G3(n, 6)), + (n.e = G3(n, 7)), + (n.f = G3(n, 8)), + (n.g = G3(n, 9)), + (n.i = G3(n, 10)), + (n.j = G3(n, 11)), + (n.k = G3(n, 12)), + (n.n = G3(n, 13)), + (n.o = G3(n, 14)), + (n.p = G3(n, 15)), + (n.q = G3(n, 16)), + (n.s = G3(n, 17)), + (n.r = G3(n, 18)), + (n.t = G3(n, 19)), + (n.u = G3(n, 20)), + (n.v = G3(n, 21)), + (n.w = G3(n, 22)), + (n.B = G3(n, 23)), + (n.A = G3(n, 24)), + (n.C = G3(n, 25)), + (n.D = G3(n, 26)), + (n.F = G3(n, 27)), + (n.G = G3(n, 28)), + (n.H = G3(n, 29)), + (n.J = G3(n, 30)), + (n.I = G3(n, 31)), + (n.K = G3(n, 32)), + (n.M = G3(n, 33)), + (n.L = G3(n, 34)), + (n.P = G3(n, 35)), + (n.Q = G3(n, 36)), + (n.R = G3(n, 37)), + (n.S = G3(n, 38)), + (n.T = G3(n, 39)), + (n.U = G3(n, 40)), + (n.V = G3(n, 41)), + (n.X = G3(n, 42)), + (n.W = G3(n, 43)), + (n.Y = G3(n, 44)), + (n.Z = G3(n, 45)), + (n.$ = G3(n, 46)), + (n._ = G3(n, 47)), + (n.ab = G3(n, 48)), + (n.cb = G3(n, 49)), + (n.db = G3(n, 50)), + (n.eb = G3(n, 51)), + (n.gb = G3(n, 52)), + (n.hb = G3(n, 53)), + (n.ib = G3(n, 54)), + (n.jb = G3(n, 55)), + (n.kb = G3(n, 56)), + (n.lb = G3(n, 57)), + (n.mb = G3(n, 58)), + (n.nb = G3(n, 59)), + (n.ob = G3(n, 60)), + (n.pb = G3(n, 61))); + })(n), + (function (n) { + var t; + n.O || + ((n.O = !0), + E2(n, "type"), + T2(n, "ecore.xml.type"), + M2(n, BRn), + (t = Yx(Hln((mT(), aat), BRn), 1945)), + fY(Iq(n.fb), n.b), + TU(n.b, Cut, "AnyType", !1, !1, !0), + z2(Yx(c1(aq(n.b), 0), 34), n.wb.D, ZDn, null, 0, -1, Cut, !1, !1, !0, !1, !1, !1), + z2(Yx(c1(aq(n.b), 1), 34), n.wb.D, "any", null, 0, -1, Cut, !0, !0, !0, !1, !1, !0), + z2(Yx(c1(aq(n.b), 2), 34), n.wb.D, "anyAttribute", null, 0, -1, Cut, !1, !1, !0, !1, !1, !1), + TU(n.bb, aot, URn, !1, !1, !0), + z2(Yx(c1(aq(n.bb), 0), 34), n.gb, "data", null, 0, 1, aot, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.bb), 1), 34), n.gb, lxn, null, 1, 1, aot, !1, !1, !0, !1, !0, !1), + TU(n.fb, uot, XRn, !1, !1, !0), + z2(Yx(c1(aq(n.fb), 0), 34), t.gb, "rawValue", null, 0, 1, uot, !0, !0, !0, !1, !0, !0), + z2(Yx(c1(aq(n.fb), 1), 34), t.a, KNn, null, 0, 1, uot, !0, !0, !0, !1, !0, !0), + Prn(Yx(c1(aq(n.fb), 2), 18), n.wb.q, null, "instanceType", 1, 1, uot, !1, !1, !0, !1, !1, !1, !1), + TU(n.qb, oot, WRn, !1, !1, !0), + z2(Yx(c1(aq(n.qb), 0), 34), n.wb.D, ZDn, null, 0, -1, null, !1, !1, !0, !1, !1, !1), + Prn(Yx(c1(aq(n.qb), 1), 18), n.wb.ab, null, "xMLNSPrefixMap", 0, -1, null, !0, !1, !0, !0, !1, !1, !1), + Prn(Yx(c1(aq(n.qb), 2), 18), n.wb.ab, null, "xSISchemaLocation", 0, -1, null, !0, !1, !0, !0, !1, !1, !1), + z2(Yx(c1(aq(n.qb), 3), 34), n.gb, "cDATA", null, 0, -2, null, !0, !0, !0, !1, !1, !0), + z2(Yx(c1(aq(n.qb), 4), 34), n.gb, "comment", null, 0, -2, null, !0, !0, !0, !1, !1, !0), + Prn(Yx(c1(aq(n.qb), 5), 18), n.bb, null, yKn, 0, -2, null, !0, !0, !0, !0, !1, !1, !0), + z2(Yx(c1(aq(n.qb), 6), 34), n.gb, zNn, null, 0, -2, null, !0, !0, !0, !1, !1, !0), + YB(n.a, UKn, "AnySimpleType", !0), + YB(n.c, fFn, "AnyURI", !0), + YB(n.d, Gy(Yot, 1), "Base64Binary", !0), + YB(n.e, Vot, "Boolean", !0), + YB(n.f, D_n, "BooleanObject", !0), + YB(n.g, Yot, "Byte", !0), + YB(n.i, __n, "ByteObject", !0), + YB(n.j, fFn, "Date", !0), + YB(n.k, fFn, "DateTime", !0), + YB(n.n, vFn, "Decimal", !0), + YB(n.o, Jot, "Double", !0), + YB(n.p, H_n, "DoubleObject", !0), + YB(n.q, fFn, "Duration", !0), + YB(n.s, JKn, "ENTITIES", !0), + YB(n.r, JKn, "ENTITIESBase", !0), + YB(n.t, fFn, nKn, !0), + YB(n.u, Zot, "Float", !0), + YB(n.v, q_n, "FloatObject", !0), + YB(n.w, fFn, "GDay", !0), + YB(n.B, fFn, "GMonth", !0), + YB(n.A, fFn, "GMonthDay", !0), + YB(n.C, fFn, "GYear", !0), + YB(n.D, fFn, "GYearMonth", !0), + YB(n.F, Gy(Yot, 1), "HexBinary", !0), + YB(n.G, fFn, "ID", !0), + YB(n.H, fFn, "IDREF", !0), + YB(n.J, JKn, "IDREFS", !0), + YB(n.I, JKn, "IDREFSBase", !0), + YB(n.K, Wot, "Int", !0), + YB(n.M, EFn, "Integer", !0), + YB(n.L, U_n, "IntObject", !0), + YB(n.P, fFn, "Language", !0), + YB(n.Q, Qot, "Long", !0), + YB(n.R, J_n, "LongObject", !0), + YB(n.S, fFn, "Name", !0), + YB(n.T, fFn, tKn, !0), + YB(n.U, EFn, "NegativeInteger", !0), + YB(n.V, fFn, fKn, !0), + YB(n.X, JKn, "NMTOKENS", !0), + YB(n.W, JKn, "NMTOKENSBase", !0), + YB(n.Y, EFn, "NonNegativeInteger", !0), + YB(n.Z, EFn, "NonPositiveInteger", !0), + YB(n.$, fFn, "NormalizedString", !0), + YB(n._, fFn, "NOTATION", !0), + YB(n.ab, fFn, "PositiveInteger", !0), + YB(n.cb, fFn, "QName", !0), + YB(n.db, nst, "Short", !0), + YB(n.eb, nFn, "ShortObject", !0), + YB(n.gb, fFn, rTn, !0), + YB(n.hb, fFn, "Time", !0), + YB(n.ib, fFn, "Token", !0), + YB(n.jb, nst, "UnsignedByte", !0), + YB(n.kb, nFn, "UnsignedByteObject", !0), + YB(n.lb, Qot, "UnsignedInt", !0), + YB(n.mb, J_n, "UnsignedIntObject", !0), + YB(n.nb, EFn, "UnsignedLong", !0), + YB(n.ob, Wot, "UnsignedShort", !0), + YB(n.pb, U_n, "UnsignedShortObject", !0), + s8(n, BRn), + (function (n) { + Zln(n.a, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "anySimpleType"])), + Zln(n.b, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "anyType", tRn, ZDn])), + Zln(Yx(c1(aq(n.b), 0), 34), nRn, x4(Gy(fFn, 1), TEn, 2, 6, [tRn, NRn, gxn, ":mixed"])), + Zln(Yx(c1(aq(n.b), 1), 34), nRn, x4(Gy(fFn, 1), TEn, 2, 6, [tRn, NRn, FRn, HRn, gxn, ":1", YRn, "lax"])), + Zln(Yx(c1(aq(n.b), 2), 34), nRn, x4(Gy(fFn, 1), TEn, 2, 6, [tRn, $Rn, FRn, HRn, gxn, ":2", YRn, "lax"])), + Zln(n.c, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "anyURI", _Rn, xRn])), + Zln(n.d, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "base64Binary", _Rn, xRn])), + Zln(n.e, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, Xjn, _Rn, xRn])), + Zln(n.f, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "boolean:Object", bRn, Xjn])), + Zln(n.g, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, BDn])), + Zln(n.i, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "byte:Object", bRn, BDn])), + Zln(n.j, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "date", _Rn, xRn])), + Zln(n.k, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "dateTime", _Rn, xRn])), + Zln(n.n, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "decimal", _Rn, xRn])), + Zln(n.o, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, qDn, _Rn, xRn])), + Zln(n.p, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "double:Object", bRn, qDn])), + Zln(n.q, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "duration", _Rn, xRn])), + Zln(n.s, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "ENTITIES", bRn, JRn, ZRn, "1"])), + Zln(n.r, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, JRn, DRn, nKn])), + Zln(n.t, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, nKn, bRn, tKn])), + Zln(n.u, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, GDn, _Rn, xRn])), + Zln(n.v, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "float:Object", bRn, GDn])), + Zln(n.w, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "gDay", _Rn, xRn])), + Zln(n.B, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "gMonth", _Rn, xRn])), + Zln(n.A, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "gMonthDay", _Rn, xRn])), + Zln(n.C, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "gYear", _Rn, xRn])), + Zln(n.D, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "gYearMonth", _Rn, xRn])), + Zln(n.F, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "hexBinary", _Rn, xRn])), + Zln(n.G, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "ID", bRn, tKn])), + Zln(n.H, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "IDREF", bRn, tKn])), + Zln(n.J, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "IDREFS", bRn, eKn, ZRn, "1"])), + Zln(n.I, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, eKn, DRn, "IDREF"])), + Zln(n.K, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, zDn])), + Zln(n.M, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, iKn])), + Zln(n.L, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "int:Object", bRn, zDn])), + Zln(n.P, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "language", bRn, rKn, cKn, aKn])), + Zln(n.Q, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, UDn])), + Zln(n.R, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "long:Object", bRn, UDn])), + Zln(n.S, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "Name", bRn, rKn, cKn, uKn])), + Zln(n.T, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, tKn, bRn, "Name", cKn, oKn])), + Zln(n.U, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "negativeInteger", bRn, sKn, hKn, "-1"])), + Zln(n.V, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, fKn, bRn, rKn, cKn, "\\c+"])), + Zln(n.X, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "NMTOKENS", bRn, lKn, ZRn, "1"])), + Zln(n.W, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, lKn, DRn, fKn])), + Zln(n.Y, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, bKn, bRn, iKn, wKn, "0"])), + Zln(n.Z, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, sKn, bRn, iKn, hKn, "0"])), + Zln(n.$, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, dKn, bRn, Vjn, _Rn, "replace"])), + Zln(n._, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "NOTATION", _Rn, xRn])), + Zln(n.ab, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "positiveInteger", bRn, bKn, wKn, "1"])), + Zln(n.bb, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "processingInstruction_._type", tRn, "empty"])), + Zln(Yx(c1(aq(n.bb), 0), 34), nRn, x4(Gy(fFn, 1), TEn, 2, 6, [tRn, ARn, gxn, "data"])), + Zln(Yx(c1(aq(n.bb), 1), 34), nRn, x4(Gy(fFn, 1), TEn, 2, 6, [tRn, ARn, gxn, lxn])), + Zln(n.cb, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "QName", _Rn, xRn])), + Zln(n.db, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, XDn])), + Zln(n.eb, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "short:Object", bRn, XDn])), + Zln(n.fb, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "simpleAnyType", tRn, ORn])), + Zln(Yx(c1(aq(n.fb), 0), 34), nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, ":3", tRn, ORn])), + Zln(Yx(c1(aq(n.fb), 1), 34), nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, ":4", tRn, ORn])), + Zln(Yx(c1(aq(n.fb), 2), 18), nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, ":5", tRn, ORn])), + Zln(n.gb, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, Vjn, _Rn, "preserve"])), + Zln(n.hb, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "time", _Rn, xRn])), + Zln(n.ib, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, rKn, bRn, dKn, _Rn, xRn])), + Zln(n.jb, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, gKn, hKn, "255", wKn, "0"])), + Zln(n.kb, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "unsignedByte:Object", bRn, gKn])), + Zln(n.lb, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, pKn, hKn, "4294967295", wKn, "0"])), + Zln(n.mb, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "unsignedInt:Object", bRn, pKn])), + Zln(n.nb, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "unsignedLong", bRn, bKn, hKn, vKn, wKn, "0"])), + Zln(n.ob, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, mKn, hKn, "65535", wKn, "0"])), + Zln(n.pb, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "unsignedShort:Object", bRn, mKn])), + Zln(n.qb, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [gxn, "", tRn, ZDn])), + Zln(Yx(c1(aq(n.qb), 0), 34), nRn, x4(Gy(fFn, 1), TEn, 2, 6, [tRn, NRn, gxn, ":mixed"])), + Zln(Yx(c1(aq(n.qb), 1), 18), nRn, x4(Gy(fFn, 1), TEn, 2, 6, [tRn, ARn, gxn, "xmlns:prefix"])), + Zln(Yx(c1(aq(n.qb), 2), 18), nRn, x4(Gy(fFn, 1), TEn, 2, 6, [tRn, ARn, gxn, "xsi:schemaLocation"])), + Zln(Yx(c1(aq(n.qb), 3), 34), nRn, x4(Gy(fFn, 1), TEn, 2, 6, [tRn, LRn, gxn, "cDATA", RRn, KRn])), + Zln(Yx(c1(aq(n.qb), 4), 34), nRn, x4(Gy(fFn, 1), TEn, 2, 6, [tRn, LRn, gxn, "comment", RRn, KRn])), + Zln(Yx(c1(aq(n.qb), 5), 18), nRn, x4(Gy(fFn, 1), TEn, 2, 6, [tRn, LRn, gxn, yKn, RRn, KRn])), + Zln(Yx(c1(aq(n.qb), 6), 34), nRn, x4(Gy(fFn, 1), TEn, 2, 6, [tRn, LRn, gxn, zNn, RRn, KRn])); + })(n)); + })(n), + xB((yT(), wat), n, new Ks()), + Srn(n), + GG(aat, BRn, n), + n)); + } + function Fk() { + (Fk = O), (Pct = s0()); + } + function Bk() { + throw hp(new xp()); + } + function Hk() { + throw hp(new xp()); + } + function qk() { + throw hp(new xp()); + } + function Gk() { + throw hp(new xp()); + } + function zk() { + throw hp(new xp()); + } + function Uk() { + throw hp(new xp()); + } + function Xk(n) { + this.a = new kE(n); + } + function Wk(n) { + Ekn(), + (function (n, t) { + var e, i, r, c, a, u, o, s; + if ( + ((e = 0), + (a = 0), + (c = t.length), + (u = null), + (s = new $y()), + a < c && + (Lz(a, t.length), 43 == t.charCodeAt(a)) && + (++e, ++a < c && (Lz(a, t.length), 43 == t.charCodeAt(a) || (Lz(a, t.length), 45 == t.charCodeAt(a))))) + ) + throw hp(new Iy(YTn + t + '"')); + for ( + ; + a < c && + (Lz(a, t.length), 46 != t.charCodeAt(a)) && + (Lz(a, t.length), 101 != t.charCodeAt(a)) && + (Lz(a, t.length), 69 != t.charCodeAt(a)); + + ) + ++a; + if (((s.a += "" + l$(null == t ? aEn : (vB(t), t), e, a)), a < c && (Lz(a, t.length), 46 == t.charCodeAt(a)))) { + for (e = ++a; a < c && (Lz(a, t.length), 101 != t.charCodeAt(a)) && (Lz(a, t.length), 69 != t.charCodeAt(a)); ) ++a; + (n.e = a - e), (s.a += "" + l$(null == t ? aEn : (vB(t), t), e, a)); + } else n.e = 0; + if ( + a < c && + (Lz(a, t.length), 101 == t.charCodeAt(a) || (Lz(a, t.length), 69 == t.charCodeAt(a))) && + ((e = ++a), + a < c && (Lz(a, t.length), 43 == t.charCodeAt(a)) && ++a < c && (Lz(a, t.length), 45 != t.charCodeAt(a)) && ++e, + (u = t.substr(e, c - e)), + (n.e = n.e - ipn(u, nTn, Yjn)), + n.e != oG(n.e)) + ) + throw hp(new Iy("Scale out of range.")); + if ((o = s.a).length < 16) { + if (((n.f = (null == hFn && (hFn = new RegExp("^[+-]?\\d*$", "i")), hFn.test(o) ? parseInt(o, 10) : NaN)), isNaN(n.f))) + throw hp(new Iy(YTn + t + '"')); + n.a = Thn(n.f); + } else + !(function (n, t) { + var e; + (n.c = t), + (n.a = (function (n) { + var t, e; + return 0 == n.e + ? 0 + : ((t = n.d << 5), (e = n.a[n.d - 1]), n.e < 0 && r3(n) == n.d - 1 && (--e, (e |= 0)), (t -= Yhn(e))); + })(t)), + n.a < 54 && (n.f = ((e = t.d > 1 ? zz(GK(t.a[1], 32), Gz(t.a[0], uMn)) : Gz(t.a[0], uMn)), VU(e7(t.e, e)))); + })(n, new IC(o)); + for (n.d = s.a.length, r = 0; r < s.a.length && (45 == (i = XB(s.a, r)) || 48 == i); ++r) --n.d; + 0 == n.d && (n.d = 1); + })(this, n); + } + function Vk(n) { + this.a = new f_(n); + } + function Qk(n, t) { + for (; n.ye(t); ); + } + function Yk(n, t) { + for (; n.sd(t); ); + } + function Jk(n, t) { + return (n.a += t), n; + } + function Zk(n, t) { + return (n.a += t), n; + } + function nj(n, t) { + return (n.a += t), n; + } + function tj(n, t) { + return (n.a += t), n; + } + function ej(n) { + return yB(n), n.a; + } + function ij(n) { + return n.b != n.d.c; + } + function rj(n) { + return n.l | (n.m << 22); + } + function cj(n, t) { + return n.d[t.p]; + } + function aj(n, t) { + return (function (n, t) { + var e, i; + if ((H4(), (e = hV(s0(), t.tg())))) { + if (((i = e.j), CO(n, 239))) + return (function (n) { + return !n.a && (n.a = new m_(uct, n, 10, 11)), n.a.i > 0; + })(Yx(n, 33)) + ? KA(i, (Qtn(), E7n)) || KA(i, T7n) + : KA(i, (Qtn(), E7n)); + if (CO(n, 352)) return KA(i, (Qtn(), k7n)); + if (CO(n, 186)) return KA(i, (Qtn(), M7n)); + if (CO(n, 354)) return KA(i, (Qtn(), j7n)); + } + return !0; + })(n, t); + } + function uj(n, t, e) { + n.splice(t, e); + } + function oj(n) { + n.c ? pdn(n) : vdn(n); + } + function sj(n) { + (this.a = 0), (this.b = n); + } + function hj() { + this.a = new Ubn(p6n); + } + function fj() { + this.b = new Ubn(i5n); + } + function lj() { + this.b = new Ubn(o9n); + } + function bj() { + this.b = new Ubn(o9n); + } + function wj() { + throw hp(new xp()); + } + function dj() { + throw hp(new xp()); + } + function gj() { + throw hp(new xp()); + } + function pj() { + throw hp(new xp()); + } + function vj() { + throw hp(new xp()); + } + function mj() { + throw hp(new xp()); + } + function yj() { + throw hp(new xp()); + } + function kj() { + throw hp(new xp()); + } + function jj() { + throw hp(new xp()); + } + function Ej() { + throw hp(new xp()); + } + function Tj(n) { + this.a = new Mj(n); + } + function Mj(n) { + !(function (n, t, e) { + var i; + (n.b = t), + (n.a = e), + (i = 512 == (512 & n.a) ? new Zv() : new Dh()), + (n.c = (function (n, t, e) { + var i, r, c; + if ( + ((n.e = e), + (n.d = 0), + (n.b = 0), + (n.f = 1), + (n.i = t), + 16 == (16 & n.e) && + (n.i = (function (n) { + var t, e, i, r, c; + for (i = n.length, t = new Oy(), c = 0; c < i; ) + if (9 != (e = XB(n, c++)) && 10 != e && 12 != e && 13 != e && 32 != e) + if (35 != e) + 92 == e && c < i + ? 35 == (Lz(c, n.length), (r = n.charCodeAt(c))) || 9 == r || 10 == r || 12 == r || 13 == r || 32 == r + ? (KF(t, r & fTn), ++c) + : ((t.a += "\\"), KF(t, r & fTn), ++c) + : KF(t, e & fTn); + else for (; c < i && 13 != (e = XB(n, c++)) && 10 != e; ); + return t.a; + })(n.i)), + (n.j = n.i.length), + kjn(n), + (c = etn(n)), + n.d != n.j) + ) + throw hp(new wy(Kjn((GC(), Cxn)))); + if (n.g) { + for (i = 0; i < n.g.a.c.length; i++) if (((r = Yx(lB(n.g, i), 584)), n.f <= r.a)) throw hp(new wy(Kjn((GC(), Oxn)))); + n.g.a.c = VQ(UKn, iEn, 1, 0, 5, 1); + } + return c; + })(i, n.b, n.a)); + })( + this, + n, + (function () { + var n, t, e; + for (t = 0, n = 0; n < 1; n++) { + if (0 == (e = xfn((Lz(n, 1), "X".charCodeAt(n))))) throw hp(new wy("Unknown Option: " + "X".substr(n))); + t |= e; + } + return t; + })(), + ); + } + function Sj(n) { + return !n || wB(n); + } + function Pj(n) { + return -1 != sot[n]; + } + function Ij() { + 0 != y_n && (y_n = 0), (j_n = -1); + } + function Cj() { + null == Hjn && (Hjn = []); + } + function Oj(n, t) { + iA.call(this, n, t); + } + function Aj(n, t) { + Oj.call(this, n, t); + } + function $j(n, t) { + (this.b = n), (this.c = t); + } + function Lj(n, t) { + (this.b = n), (this.a = t); + } + function Nj(n, t) { + (this.a = n), (this.b = t); + } + function xj(n, t) { + (this.a = n), (this.b = t); + } + function Dj(n, t) { + (this.a = n), (this.b = t); + } + function Rj(n, t) { + (this.a = n), (this.b = t); + } + function Kj(n, t) { + (this.a = n), (this.b = t); + } + function _j(n, t) { + (this.a = n), (this.b = t); + } + function Fj(n, t) { + (this.a = n), (this.b = t); + } + function Bj(n, t) { + (this.a = n), (this.b = t); + } + function Hj(n, t) { + (this.b = n), (this.a = t); + } + function qj(n, t) { + (this.b = n), (this.a = t); + } + function Gj(n, t) { + (this.b = n), (this.a = t); + } + function zj(n, t) { + (this.b = n), (this.a = t); + } + function Uj(n, t) { + (this.f = n), (this.g = t); + } + function Xj(n, t) { + (this.e = n), (this.d = t); + } + function Wj(n, t) { + (this.g = n), (this.i = t); + } + function Vj(n, t) { + (this.a = n), (this.b = t); + } + function Qj(n, t) { + (this.a = n), (this.f = t); + } + function Yj(n, t) { + (this.b = n), (this.c = t); + } + function Jj(n, t) { + (this.a = n), (this.b = t); + } + function Zj(n, t) { + (this.a = n), (this.b = t); + } + function nE(n, t) { + (this.a = n), (this.b = t); + } + function tE(n) { + yA(n.dc()), (this.c = n); + } + function eE(n) { + this.b = Yx(MF(n), 83); + } + function iE(n) { + this.a = Yx(MF(n), 83); + } + function rE(n) { + this.a = Yx(MF(n), 15); + } + function cE(n) { + this.a = Yx(MF(n), 15); + } + function aE(n) { + this.b = Yx(MF(n), 47); + } + function uE() { + this.q = new e.Date(); + } + function oE() { + (oE = O), (eFn = new A()); + } + function sE() { + (sE = O), (PFn = new P()); + } + function hE(n) { + return n.f.c + n.g.c; + } + function fE(n, t) { + return n.b.Hc(t); + } + function lE(n, t) { + return n.b.Ic(t); + } + function bE(n, t) { + return n.b.Qc(t); + } + function wE(n, t) { + return n.b.Hc(t); + } + function dE(n, t) { + return n.c.uc(t); + } + function gE(n, t) { + return n.a._b(t); + } + function pE(n, t) { + return Q8(n.c, t); + } + function vE(n, t) { + return P_(n.b, t); + } + function mE(n, t) { + return n > t && t < zEn; + } + function yE(n) { + return WF(), n ? T_n : E_n; + } + function kE(n) { + c5.call(this, n, 0); + } + function jE() { + f_.call(this, null); + } + function EE() { + ZQ.call(this, null); + } + function TE(n) { + (this.c = n), cZ(this); + } + function ME() { + aO(this), BH(this); + } + function SE(n, t) { + yB(n), n.a.Nb(t); + } + function PE(n, t) { + return n.Gc(t), n; + } + function IE(n, t) { + return (n.a.f = t), n; + } + function CE(n, t) { + return (n.a.d = t), n; + } + function OE(n, t) { + return (n.a.g = t), n; + } + function AE(n, t) { + return (n.a.j = t), n; + } + function $E(n, t) { + return (n.a.a = t), n; + } + function LE(n, t) { + return (n.a.d = t), n; + } + function NE(n, t) { + return (n.a.e = t), n; + } + function xE(n, t) { + return (n.a.g = t), n; + } + function DE(n, t) { + return (n.a.f = t), n; + } + function RE() { + (RE = O), (BFn = new DI()); + } + function KE() { + (KE = O), (HFn = new RI()); + } + function _E() { + (_E = O), (eBn = new U()); + } + function FE() { + (FE = O), ($zn = new Kt()); + } + function BE() { + (BE = O), (vqn = new I$()); + } + function HE() { + (HE = O), (dBn = new hn()); + } + function qE() { + (qE = O), (xzn = new _t()); + } + function GE() { + (GE = O), (EBn = new dn()); + } + function zE() { + (zE = O), (rzn = new yt()); + } + function UE() { + (UE = O), (nUn = new Pk()); + } + function XE() { + (XE = O), (czn = new Pt()); + } + function WE() { + (WE = O), (szn = new lK()); + } + function VE() { + (VE = O), (Tzn = new Mt()); + } + function QE() { + (QE = O), (tUn = new be()); + } + function YE() { + (YE = O), (wXn = new Ye()); + } + function JE() { + (JE = O), (IXn = new Lr()); + } + function ZE() { + (ZE = O), (hWn = new rc()); + } + function nT() { + (nT = O), (o6n = new fX()); + } + function tT() { + (tT = O), (u9n = new aT()); + } + function eT() { + (eT = O), (h9n = new aL()); + } + function iT() { + (iT = O), (r7n = new LB()); + } + function rT() { + (rT = O), (o2n = new Wu()); + } + function cT() { + S0(), (this.c = new gy()); + } + function aT() { + Uj.call(this, iCn, 0); + } + function uT(n, t) { + Gtn(n.c.b, t.c, t); + } + function oT(n, t) { + Gtn(n.c.c, t.b, t); + } + function sT(n, t, e) { + GG(n.d, t.f, e); + } + function hT(n, t, e, i) { + !(function (n, t, e, i) { + var r; + (r = (function (n) { + var t, e, i, r; + for (Njn(), i = 0, r = (e = Xtn()).length; i < r; ++i) if (-1 != hJ((t = e[i]).a, n, 0)) return t; + return qHn; + })(t.Xe((Cjn(), Qnt)) ? Yx(t.We(Qnt), 21) : n.j)) != (Njn(), qHn) && + ((e && !ftn(r)) || + Fon( + (function (n, t, e) { + var i, r, c; + if (!(r = Yx(GB(n.i, t), 306))) + if (((r = new KZ(n.d, t, e)), YR(n.i, t, r), ftn(t))) + !(function (n, t, e, i) { + DF(n.a[t.g], e.g, i); + })(n.a, t.c, t.b, r); + else + switch ( + ((c = (function (n) { + switch (n.g) { + case 0: + case 1: + case 2: + return Ikn(), Tit; + case 3: + case 4: + case 5: + return Ikn(), Bit; + case 6: + case 7: + case 8: + return Ikn(), qit; + case 9: + case 10: + case 11: + return Ikn(), Eit; + default: + return Ikn(), Hit; + } + })(t)), + (i = Yx(GB(n.p, c), 244)), + c.g) + ) { + case 1: + case 3: + (r.j = !0), Nm(i, t.b, r); + break; + case 4: + case 2: + (r.k = !0), Nm(i, t.c, r); + } + return r; + })(n, r, i), + t, + )); + })(n, i, t, e); + } + function fT(n, t, e, i) { + !(function (n, t, e, i) { + var r, c, a, u, o, s; + for (a = n.j.c.length, o = VQ(yHn, mSn, 306, a, 0, 1), u = 0; u < a; u++) + ((c = Yx(TR(n.j, u), 11)).p = u), (o[u] = cfn(Jfn(c), e, i)); + for ( + (function (n, t, e, i, r) { + var c, a, u, o; + for (o = new cx((c = Yx(Ak(trt), 9)), Yx(eN(c, c.length), 9), 0), u = new pb(n.j); u.a < u.c.c.length; ) + t[(a = Yx(Hz(u), 11)).p] && (Rkn(a, t[a.p], i), n2(o, a.j)); + r + ? (Aan(n, t, (Ikn(), Eit), 2 * e, i), Aan(n, t, qit, 2 * e, i)) + : (Aan(n, t, (Ikn(), Tit), 2 * e, i), Aan(n, t, Bit, 2 * e, i)); + })(n, o, e, t, i), + s = new rp(), + r = 0; + r < o.length; + r++ + ) + o[r] && xB(s, Yx(TR(n.j, r), 11), o[r]); + s.f.c + s.g.c != 0 && + (b5(n, (Ojn(), cQn), s), + (function (n, t) { + var e, i, r, c, a, u, o; + for (a = n.d, o = n.o, u = new mH(-a.b, -a.d, a.b + o.a + a.c, a.d + o.b + a.a), r = 0, c = (i = t).length; r < c; ++r) + (e = i[r]) && bsn(u, e.i); + (a.b = -u.c), (a.d = -u.d), (a.c = u.b - a.b - o.a), (a.a = u.a - a.d - o.b); + })(n, o)); + })(i, n, t, e); + } + function lT(n, t, i, r) { + !(function (n, t, i, r) { + var c, a, u, o, s, h, f, l, b, w, d, g; + if ( + ((b = ty(fL(Aun(n, (gjn(), H0n))))), + (w = ty(fL(Aun(n, q0n)))), + (l = ty(fL(Aun(n, F0n)))), + (o = n.o), + (u = (a = Yx(TR(n.j, 0), 11)).n), + (g = (function (n, t) { + var i, r, c; + if (0 == n.f.c.length) return null; + for (c = new hC(), i = new pb(n.f); i.a < i.c.c.length; ) (r = Yx(Hz(i), 70).o), (c.b = e.Math.max(c.b, r.a)), (c.a += r.b); + return (c.a += (n.f.c.length - 1) * t), c; + })(a, l))) + ) { + if (t.Hc((Chn(), pit))) + switch (Yx(Aun(n, (Ojn(), hQn)), 61).g) { + case 1: + (g.c = (o.a - g.b) / 2 - u.a), (g.d = w); + break; + case 3: + (g.c = (o.a - g.b) / 2 - u.a), (g.d = -w - g.a); + break; + case 2: + i && 0 == a.e.c.length && 0 == a.g.c.length + ? ((f = r ? g.a : Yx(TR(a.f, 0), 70).o.b), (g.d = (o.b - f) / 2 - u.b)) + : (g.d = o.b + w - u.b), + (g.c = -b - g.b); + break; + case 4: + i && 0 == a.e.c.length && 0 == a.g.c.length + ? ((f = r ? g.a : Yx(TR(a.f, 0), 70).o.b), (g.d = (o.b - f) / 2 - u.b)) + : (g.d = o.b + w - u.b), + (g.c = b); + } + else if (t.Hc(mit)) + switch (Yx(Aun(n, (Ojn(), hQn)), 61).g) { + case 1: + case 3: + g.c = u.a + b; + break; + case 2: + case 4: + i && !a.c ? ((f = r ? g.a : Yx(TR(a.f, 0), 70).o.b), (g.d = (o.b - f) / 2 - u.b)) : (g.d = u.b + w); + } + for (c = g.d, h = new pb(a.f); h.a < h.c.c.length; ) ((d = (s = Yx(Hz(h), 70)).n).a = g.c), (d.b = c), (c += s.o.b + l); + } + })(r, n, t, i); + } + function bT(n, t) { + return (n.a = t.g), n; + } + function wT(n, t) { + return (function (n, t) { + var i, r, c; + if ( + 0 == + (i = (function (n, t, i) { + var r, c, a, u, o, s, h, f, l; + for (u = new Tcn(), h = x4(Gy(Wot, 1), MTn, 25, 15, [0]), c = -1, a = 0, r = 0, s = 0; s < n.b.c.length; ++s) { + if (!((f = Yx(TR(n.b, s), 434)).b > 0)) { + if (((c = -1), 32 == XB(f.c, 0))) { + if (((l = h[0]), JJ(t, h), h[0] > l)) continue; + } else if (Rq(t, f.c, h[0])) { + h[0] += f.c.length; + continue; + } + return 0; + } + if ((c < 0 && f.a && ((c = s), (a = h[0]), (r = 0)), c >= 0)) { + if (((o = f.b), s == c && 0 == (o -= r++))) return 0; + if (!Lkn(t, h, f, o, u)) { + (s = c - 1), (h[0] = a); + continue; + } + } else if (((c = -1), !Lkn(t, h, f, 0, u))) return 0; + } + return (function (n, t) { + var i, r, c, a, u, o; + if ( + (0 == n.e && n.p > 0 && (n.p = -(n.p - 1)), + n.p > nTn && JX(t, n.p - TTn), + (u = t.q.getDate()), + mG(t, 1), + n.k >= 0 && + (function (n, t) { + var e; + (e = n.q.getHours()), n.q.setMonth(t), Ivn(n, e); + })(t, n.k), + n.c >= 0 + ? mG(t, n.c) + : n.k >= 0 + ? ((r = 35 - new y5(t.q.getFullYear() - TTn, t.q.getMonth(), 35).q.getDate()), mG(t, e.Math.min(r, u))) + : mG(t, u), + n.f < 0 && (n.f = t.q.getHours()), + n.b > 0 && n.f < 12 && (n.f += 12), + (function (n, t) { + n.q.setHours(t), Ivn(n, t); + })(t, 24 == n.f && n.g ? 0 : n.f), + n.j >= 0 && + (function (n, t) { + var e; + (e = n.q.getHours() + ((t / 60) | 0)), n.q.setMinutes(t), Ivn(n, e); + })(t, n.j), + n.n >= 0 && + (function (n, t) { + var e; + (e = n.q.getHours() + ((t / 3600) | 0)), n.q.setSeconds(t), Ivn(n, e); + })(t, n.n), + n.i >= 0 && TI(t, t7(e7(Bcn(D3(t.q.getTime()), hTn), hTn), n.i)), + n.a && + (JX((c = new uE()), c.q.getFullYear() - TTn - 80), + LT(D3(t.q.getTime()), D3(c.q.getTime())) && JX(t, c.q.getFullYear() - TTn + 100)), + n.d >= 0) + ) + if (-1 == n.c) + (i = (7 + n.d - t.q.getDay()) % 7) > 3 && (i -= 7), + (o = t.q.getMonth()), + mG(t, t.q.getDate() + i), + t.q.getMonth() != o && mG(t, t.q.getDate() + (i > 0 ? -7 : 7)); + else if (t.q.getDay() != n.d) return !1; + return n.o > nTn && ((a = t.q.getTimezoneOffset()), TI(t, t7(D3(t.q.getTime()), 60 * (n.o - a) * hTn))), !0; + })(u, i) + ? h[0] + : 0; + })(n, t, (c = new y5((r = new uE()).q.getFullYear() - TTn, r.q.getMonth(), r.q.getDate())))) || + i < t.length + ) + throw hp(new Qm(t)); + return c; + })(n.a, t); + } + function dT() { + (dT = O), (Prt = new to()); + } + function gT() { + (gT = O), (qrt = new ho()); + } + function pT() { + (pT = O), (Jct = new Fv()); + } + function vT() { + (vT = O), (uat = new Bv()); + } + function mT() { + (mT = O), (aat = new Xv()); + } + function yT() { + (yT = O), (wat = new Vv()); + } + function kT() { + (kT = O), (Vat = new vO()); + } + function jT() { + (jT = O), (Qat = new mO()); + } + function ET() { + (ET = O), (mut = new Ns()); + } + function TT() { + (TT = O), (kut = new xs()); + } + function MT() { + (MT = O), (Nct = new rp()); + } + function ST() { + (ST = O), (hut = new ip()); + } + function PT() { + (PT = O), (Fot = new Kh()); + } + function IT(n) { + this.a = Yx(MF(n), 224); + } + function CT(n) { + return Yx(n, 42).cd(); + } + function OT(n) { + return n.b < n.d.gc(); + } + function AT(n, t) { + return rK(n.a, t); + } + function $T(n, t) { + return k8(n, t) > 0; + } + function LT(n, t) { + return k8(n, t) < 0; + } + function NT(n, t) { + return n.a.get(t); + } + function xT(n, t) { + return P_(n.e, t); + } + function DT(n) { + return vB(n), !1; + } + function RT(n) { + Nz.call(this, n, 21); + } + function KT(n, t) { + vG.call(this, n, t); + } + function _T(n, t) { + Uj.call(this, n, t); + } + function FT(n, t) { + Uj.call(this, n, t); + } + function BT(n) { + QF(), ix.call(this, n); + } + function HT(n, t) { + nK(n, n.length, t); + } + function qT(n, t) { + cF(n, n.length, t); + } + function GT(n, t, e) { + n.splice(t, 0, e); + } + function zT(n, t) { + (this.d = n), (this.e = t); + } + function UT(n, t) { + (this.b = n), (this.a = t); + } + function XT(n, t) { + (this.b = n), (this.a = t); + } + function WT(n, t) { + (this.b = n), (this.a = t); + } + function VT(n, t) { + (this.a = n), (this.b = t); + } + function QT(n, t) { + (this.a = n), (this.b = t); + } + function YT(n, t) { + (this.a = n), (this.b = t); + } + function JT(n, t) { + (this.a = n), (this.b = t); + } + function ZT(n, t) { + (this.a = n), (this.b = t); + } + function nM(n, t) { + (this.b = n), (this.a = t); + } + function tM(n, t) { + (this.b = n), (this.a = t); + } + function eM(n, t) { + Uj.call(this, n, t); + } + function iM(n, t) { + Uj.call(this, n, t); + } + function rM(n, t) { + Uj.call(this, n, t); + } + function cM(n, t) { + Uj.call(this, n, t); + } + function aM(n, t) { + Uj.call(this, n, t); + } + function uM(n, t) { + Uj.call(this, n, t); + } + function oM(n, t) { + Uj.call(this, n, t); + } + function sM(n, t) { + Uj.call(this, n, t); + } + function hM(n, t) { + Uj.call(this, n, t); + } + function fM(n, t) { + Uj.call(this, n, t); + } + function lM(n, t) { + Uj.call(this, n, t); + } + function bM(n, t) { + Uj.call(this, n, t); + } + function wM(n, t) { + Uj.call(this, n, t); + } + function dM(n, t) { + Uj.call(this, n, t); + } + function gM(n, t) { + Uj.call(this, n, t); + } + function pM(n, t) { + Uj.call(this, n, t); + } + function vM(n, t) { + Uj.call(this, n, t); + } + function mM(n, t) { + Uj.call(this, n, t); + } + function yM(n, t) { + (this.a = n), (this.b = t); + } + function kM(n, t) { + (this.a = n), (this.b = t); + } + function jM(n, t) { + (this.a = n), (this.b = t); + } + function EM(n, t) { + (this.a = n), (this.b = t); + } + function TM(n, t) { + (this.a = n), (this.b = t); + } + function MM(n, t) { + (this.a = n), (this.b = t); + } + function SM(n, t) { + (this.a = n), (this.b = t); + } + function PM(n, t) { + (this.a = n), (this.b = t); + } + function IM(n, t) { + (this.a = n), (this.b = t); + } + function CM(n, t) { + (this.b = n), (this.a = t); + } + function OM(n, t) { + (this.b = n), (this.a = t); + } + function AM(n, t) { + (this.b = n), (this.a = t); + } + function $M(n, t) { + (this.b = n), (this.a = t); + } + function LM(n, t) { + (this.c = n), (this.d = t); + } + function NM(n, t) { + (this.e = n), (this.d = t); + } + function xM(n, t) { + (this.a = n), (this.b = t); + } + function DM(n, t) { + (this.b = t), (this.c = n); + } + function RM(n, t) { + Uj.call(this, n, t); + } + function KM(n, t) { + Uj.call(this, n, t); + } + function _M(n, t) { + Uj.call(this, n, t); + } + function FM(n, t) { + Uj.call(this, n, t); + } + function BM(n, t) { + Uj.call(this, n, t); + } + function HM(n, t) { + Uj.call(this, n, t); + } + function qM(n, t) { + Uj.call(this, n, t); + } + function GM(n, t) { + Uj.call(this, n, t); + } + function zM(n, t) { + Uj.call(this, n, t); + } + function UM(n, t) { + Uj.call(this, n, t); + } + function XM(n, t) { + Uj.call(this, n, t); + } + function WM(n, t) { + Uj.call(this, n, t); + } + function VM(n, t) { + Uj.call(this, n, t); + } + function QM(n, t) { + Uj.call(this, n, t); + } + function YM(n, t) { + Uj.call(this, n, t); + } + function JM(n, t) { + Uj.call(this, n, t); + } + function ZM(n, t) { + Uj.call(this, n, t); + } + function nS(n, t) { + Uj.call(this, n, t); + } + function tS(n, t) { + Uj.call(this, n, t); + } + function eS(n, t) { + Uj.call(this, n, t); + } + function iS(n, t) { + Uj.call(this, n, t); + } + function rS(n, t) { + Uj.call(this, n, t); + } + function cS(n, t) { + Uj.call(this, n, t); + } + function aS(n, t) { + Uj.call(this, n, t); + } + function uS(n, t) { + Uj.call(this, n, t); + } + function oS(n, t) { + Uj.call(this, n, t); + } + function sS(n, t) { + Uj.call(this, n, t); + } + function hS(n, t) { + Uj.call(this, n, t); + } + function fS(n, t) { + Uj.call(this, n, t); + } + function lS(n, t) { + Uj.call(this, n, t); + } + function bS(n, t) { + Uj.call(this, n, t); + } + function wS(n, t) { + Uj.call(this, n, t); + } + function dS(n, t) { + Uj.call(this, n, t); + } + function gS(n, t) { + Uj.call(this, n, t); + } + function pS(n, t) { + (this.b = n), (this.a = t); + } + function vS(n, t) { + (this.a = n), (this.b = t); + } + function mS(n, t) { + (this.a = n), (this.b = t); + } + function yS(n, t) { + (this.a = n), (this.b = t); + } + function kS(n, t) { + (this.a = n), (this.b = t); + } + function jS(n, t) { + Uj.call(this, n, t); + } + function ES(n, t) { + Uj.call(this, n, t); + } + function TS(n, t) { + (this.b = n), (this.d = t); + } + function MS(n, t) { + Uj.call(this, n, t); + } + function SS(n, t) { + Uj.call(this, n, t); + } + function PS(n, t) { + (this.a = n), (this.b = t); + } + function IS(n, t) { + (this.a = n), (this.b = t); + } + function CS(n, t) { + Uj.call(this, n, t); + } + function OS(n, t) { + Uj.call(this, n, t); + } + function AS(n, t) { + Uj.call(this, n, t); + } + function $S(n, t) { + Uj.call(this, n, t); + } + function LS(n, t) { + Uj.call(this, n, t); + } + function NS(n, t) { + Uj.call(this, n, t); + } + function xS(n, t) { + Uj.call(this, n, t); + } + function DS(n, t) { + Uj.call(this, n, t); + } + function RS(n, t) { + Uj.call(this, n, t); + } + function KS(n, t) { + Uj.call(this, n, t); + } + function _S(n, t) { + Uj.call(this, n, t); + } + function FS(n, t) { + Uj.call(this, n, t); + } + function BS(n, t) { + Uj.call(this, n, t); + } + function HS(n, t) { + Uj.call(this, n, t); + } + function qS(n, t) { + Uj.call(this, n, t); + } + function GS(n, t) { + Uj.call(this, n, t); + } + function zS(n, t) { + return KA(n.g, t); + } + function US(n, t) { + Uj.call(this, n, t); + } + function XS(n, t) { + Uj.call(this, n, t); + } + function WS(n, t) { + (this.a = n), (this.b = t); + } + function VS(n, t) { + (this.a = n), (this.b = t); + } + function QS(n, t) { + (this.a = n), (this.b = t); + } + function YS(n, t) { + Uj.call(this, n, t); + } + function JS(n, t) { + Uj.call(this, n, t); + } + function ZS(n, t) { + Uj.call(this, n, t); + } + function nP(n, t) { + Uj.call(this, n, t); + } + function tP(n, t) { + Uj.call(this, n, t); + } + function eP(n, t) { + Uj.call(this, n, t); + } + function iP(n, t) { + Uj.call(this, n, t); + } + function rP(n, t) { + Uj.call(this, n, t); + } + function cP(n, t) { + Uj.call(this, n, t); + } + function aP(n, t) { + Uj.call(this, n, t); + } + function uP(n, t) { + Uj.call(this, n, t); + } + function oP(n, t) { + Uj.call(this, n, t); + } + function sP(n, t) { + Uj.call(this, n, t); + } + function hP(n, t) { + Uj.call(this, n, t); + } + function fP(n, t) { + Uj.call(this, n, t); + } + function lP(n, t) { + Uj.call(this, n, t); + } + function bP(n, t) { + (this.a = n), (this.b = t); + } + function wP(n, t) { + (this.a = n), (this.b = t); + } + function dP(n, t) { + (this.a = n), (this.b = t); + } + function gP(n, t) { + (this.a = n), (this.b = t); + } + function pP(n, t) { + (this.a = n), (this.b = t); + } + function vP(n, t) { + (this.a = n), (this.b = t); + } + function mP(n, t) { + (this.a = n), (this.b = t); + } + function yP(n, t) { + Uj.call(this, n, t); + } + function kP(n, t) { + (this.a = n), (this.b = t); + } + function jP(n, t) { + (this.a = n), (this.b = t); + } + function EP(n, t) { + (this.a = n), (this.b = t); + } + function TP(n, t) { + (this.a = n), (this.b = t); + } + function MP(n, t) { + (this.a = n), (this.b = t); + } + function SP(n, t) { + (this.a = n), (this.b = t); + } + function PP(n, t) { + (this.b = n), (this.a = t); + } + function IP(n, t) { + (this.b = n), (this.a = t); + } + function CP(n, t) { + (this.b = n), (this.a = t); + } + function OP(n, t) { + (this.b = n), (this.a = t); + } + function AP(n, t) { + (this.a = n), (this.b = t); + } + function $P(n, t) { + (this.a = n), (this.b = t); + } + function LP(n, t) { + !(function (n, t) { + if (CO(t, 239)) + return (function (n, t) { + var e; + if (null == (e = g1(n.i, t))) throw hp(new hy("Node did not exist in input.")); + return f3(t, e), null; + })(n, Yx(t, 33)); + if (CO(t, 186)) + return (function (n, t) { + var e; + if (null == (e = BF(n.k, t))) throw hp(new hy("Port did not exist in input.")); + return f3(t, e), null; + })(n, Yx(t, 118)); + if (CO(t, 354)) + return (function (n, t) { + return f3(t, BF(n.f, t)), null; + })(n, Yx(t, 137)); + if (CO(t, 352)) + return (function (n, t) { + var e, i, r, c, a, u; + if (!(a = Yx(BF(n.c, t), 183))) throw hp(new hy("Edge did not exist in input.")); + return ( + (i = itn(a)), + !Sj((!t.a && (t.a = new m_(tct, t, 6, 6)), t.a)) && + ((e = new Rx(n, i, (u = new Sl()))), + (function (n, t) { + !(function (n, t) { + var e; + for (e = 0; n.e != n.i.gc(); ) sR(t, hen(n), d9(e)), e != Yjn && ++e; + })(new UO(n), t); + })((!t.a && (t.a = new m_(tct, t, 6, 6)), t.a), e), + OZ(a, QNn, u)), + zQ(t, (Cjn(), Gnt)) && + !(!(r = Yx(jln(t, Gnt), 74)) || wB(r)) && + (XW(r, new mg((c = new Sl()))), OZ(a, "junctionPoints", c)), + ND(a, "container", EG(t).k), + null + ); + })(n, Yx(t, 79)); + if (t) return null; + throw hp(new Qm(axn + Gun(new ay(x4(Gy(UKn, 1), iEn, 1, 5, [t]))))); + })(n.a, Yx(t, 56)); + } + function NP(n, t) { + !(function (n, t) { + dD(), eD(n, new mP(t, d9(t.e.c.length + t.g.c.length))); + })(n.a, Yx(t, 11)); + } + function xP() { + return Fy(), new xFn(); + } + function DP() { + lz(), (this.b = new Qp()); + } + function RP() { + ywn(), (this.a = new Qp()); + } + function KP() { + uz(), wK.call(this); + } + function _P(n, t) { + Uj.call(this, n, t); + } + function FP(n, t) { + (this.a = n), (this.b = t); + } + function BP(n, t) { + (this.a = n), (this.b = t); + } + function HP(n, t) { + (this.a = n), (this.b = t); + } + function qP(n, t) { + (this.a = n), (this.b = t); + } + function GP(n, t) { + (this.a = n), (this.b = t); + } + function zP(n, t) { + (this.a = n), (this.b = t); + } + function UP(n, t) { + (this.d = n), (this.b = t); + } + function XP(n, t) { + (this.d = n), (this.e = t); + } + function WP(n, t) { + (this.f = n), (this.c = t); + } + function VP(n, t) { + (this.b = n), (this.c = t); + } + function QP(n, t) { + (this.i = n), (this.g = t); + } + function YP(n, t) { + (this.e = n), (this.a = t); + } + function JP(n, t) { + (this.a = n), (this.b = t); + } + function ZP(n, t) { + (n.i = null), J0(n, t); + } + function nI(n, t) { + return mnn(n.a, t); + } + function tI(n) { + return knn(n.c, n.b); + } + function eI(n) { + return n ? n.dd() : null; + } + function iI(n) { + return null == n ? null : n; + } + function rI(n) { + return typeof n === Xjn; + } + function cI(n) { + return typeof n === Wjn; + } + function aI(n) { + return typeof n === Vjn; + } + function uI(n, t) { + return n.Hd().Xb(t); + } + function oI(n, t) { + return (function (n, t) { + for (MF(t); n.Ob(); ) if (!f4(Yx(n.Pb(), 10))) return !1; + return !0; + })(n.Kc(), t); + } + function sI(n, t) { + return 0 == k8(n, t); + } + function hI(n, t) { + return 0 != k8(n, t); + } + function fI(n) { + return "" + (vB(n), n); + } + function lI(n, t) { + return n.substr(t); + } + function bI(n) { + return A7(n), n.d.gc(); + } + function wI(n) { + return ( + (function (n, t) { + var e, i, r; + for (e = new pb(n.a.a); e.a < e.c.c.length; ) Yx(Hz(e), 189).g = !0; + for (r = new pb(n.a.b); r.a < r.c.c.length; ) + ((i = Yx(Hz(r), 81)).k = ny(hL(n.e.Kb(new mP(i, t))))), (i.d.g = i.d.g & ny(hL(n.e.Kb(new mP(i, t))))); + })(n, n.c), + n + ); + } + function dI(n) { + return QD(null == n), n; + } + function gI(n, t) { + return (n.a += "" + t), n; + } + function pI(n, t) { + return (n.a += "" + t), n; + } + function vI(n, t) { + return (n.a += "" + t), n; + } + function mI(n, t) { + return (n.a += "" + t), n; + } + function yI(n, t) { + return (n.a += "" + t), n; + } + function kI(n, t) { + return (n.a += "" + t), n; + } + function jI(n, t) { + VW(n, t, n.a, n.a.a); + } + function EI(n, t) { + VW(n, t, n.c.b, n.c); + } + function TI(n, t) { + n.q.setTime(VU(t)); + } + function MI(n, t) { + o_.call(this, n, t); + } + function SI(n, t) { + o_.call(this, n, t); + } + function PI(n, t) { + o_.call(this, n, t); + } + function II(n) { + U_(this), i3(this, n); + } + function CI(n) { + return $z(n, 0), null; + } + function OI(n) { + return (n.a = 0), (n.b = 0), n; + } + function AI(n, t) { + return (n.a = t.g + 1), n; + } + function $I(n) { + return (function (n) { + return UH(), IG(Kun(n)) == IG(Bun(n)); + })(Yx(n, 79)); + } + function LI() { + (LI = O), (zHn = z6(Xtn())); + } + function NI() { + (NI = O), (bXn = z6(Gbn())); + } + function xI() { + this.b = new kE(IZ(12)); + } + function DI() { + (this.b = 0), (this.a = !1); + } + function RI() { + (this.b = 0), (this.a = !1); + } + function KI(n) { + (this.a = n), _h.call(this); + } + function _I(n) { + (this.a = n), _h.call(this); + } + function FI(n, t) { + _L.call(this, n, t); + } + function BI(n, t) { + jN.call(this, n, t); + } + function HI(n, t) { + QP.call(this, n, t); + } + function qI(n, t) { + Y3.call(this, n, t); + } + function GI(n, t) { + n$.call(this, n, t); + } + function zI(n, t) { + MT(), xB(Nct, n, t); + } + function UI(n, t) { + return l$(n.a, 0, t); + } + function XI(n, t) { + return n.a.a.a.cc(t); + } + function WI(n, t) { + return iI(n) === iI(t); + } + function VI(n, t) { + return n.indexOf(t); + } + function QI(n, t) { + return n == t ? 0 : n ? 1 : -1; + } + function YI(n) { + return n < 10 ? "0" + n : "" + n; + } + function JI(n) { + return rO(n.l, n.m, n.h); + } + function ZI(n) { + return oG((vB(n), n)); + } + function nC(n, t) { + return eO(n.g, t.g); + } + function tC(n) { + return typeof n === Wjn; + } + function eC(n) { + return hJ(n.b.b, n, 0); + } + function iC(n) { + (this.a = xP()), (this.b = n); + } + function rC(n) { + (this.a = xP()), (this.b = n); + } + function cC(n, t) { + return eD(n.a, t), t; + } + function aC(n, t) { + return T3(n.a, t), n; + } + function uC(n, t) { + DY(n, 0, n.length, t); + } + function oC() { + Mb.call(this, new bW()); + } + function sC() { + FR.call(this, 0, 0, 0, 0); + } + function hC() { + mH.call(this, 0, 0, 0, 0); + } + function fC(n) { + (this.a = n.a), (this.b = n.b); + } + function lC(n) { + return n == Ztt || n == net; + } + function bC(n) { + return n == eet || n == Jtt; + } + function wC(n) { + return n == M2n || n == T2n; + } + function dC(n) { + return n != fit && n != lit; + } + function gC(n) { + return n.Lg() && n.Mg(); + } + function pC(n) { + return JB(Yx(n, 118)); + } + function vC(n) { + return T3(new fX(), n); + } + function mC(n, t) { + return new Y3(t, n); + } + function yC(n, t, e) { + I1(n, t), C1(n, e); + } + function kC(n, t, e) { + $1(n, t), A1(n, e); + } + function jC(n, t, e) { + L1(n, t), N1(n, e); + } + function EC(n, t, e) { + O1(n, t), D1(n, e); + } + function TC(n, t, e) { + x1(n, t), R1(n, e); + } + function MC(n, t) { + j6(n, t), B1(n, n.D); + } + function SC(n) { + WP.call(this, n, !0); + } + function PC(n, t, e) { + yL.call(this, n, t, e); + } + function IC(n) { + bdn(), N3.call(this, n); + } + function CC() { + _T.call(this, "Head", 1); + } + function OC() { + _T.call(this, "Tail", 3); + } + function AC(n) { + n.c = VQ(UKn, iEn, 1, 0, 5, 1); + } + function $C(n) { + n.a = VQ(UKn, iEn, 1, 8, 5, 1); + } + function LC(n) { + WZ(n.xf(), new Vb(n)); + } + function NC(n) { + return null != n ? W5(n) : 0; + } + function xC(n) { + return (function (n, t) { + return MF(n), MF(t), new Hj(n, t); + })(n.b.Kc(), n.a); + } + function DC(n, t) { + _L.call(this, n.b, t); + } + function RC(n) { + FR.call(this, n, n, n, n); + } + function KC(n) { + return n.b && tmn(n), n.a; + } + function _C(n) { + return n.b && tmn(n), n.c; + } + function FC(n, t, e) { + return DF(n, t, e), e; + } + function BC(n, t, e) { + DF(n.c[t.g], t.g, e); + } + function HC(n) { + Ljn(), np.call(this, n); + } + function qC() { + (qC = O), (E4n = new C7(Eet)); + } + function GC() { + (GC = O), new zC(), new ip(); + } + function zC() { + new rp(), new rp(), new rp(); + } + function UC() { + (UC = O), qp(), (v_n = new rp()); + } + function XC() { + (XC = O), e.Math.log(2); + } + function WC() { + (WC = O), gT(), (Jat = qrt); + } + function VC(n) { + (this.a = n), rD.call(this, n); + } + function QC(n) { + (this.a = n), eE.call(this, n); + } + function YC(n) { + (this.a = n), eE.call(this, n); + } + function JC(n, t) { + JR(n.c, n.c.length, t); + } + function ZC(n) { + return n.a < n.c.c.length; + } + function nO(n) { + return n.a < n.c.a.length; + } + function tO(n, t) { + return n.a ? n.b : t.De(); + } + function eO(n, t) { + return n < t ? -1 : n > t ? 1 : 0; + } + function iO(n, t) { + return k8(n, t) > 0 ? n : t; + } + function rO(n, t, e) { + return { l: n, m: t, h: e }; + } + function cO(n, t) { + null != n.a && NP(t, n.a); + } + function aO(n) { + (n.a = new $()), (n.c = new $()); + } + function uO(n) { + (this.b = n), (this.a = new ip()); + } + function oO(n) { + (this.b = new et()), (this.a = n); + } + function sO(n) { + oN.call(this), (this.a = n); + } + function hO() { + _T.call(this, "Range", 2); + } + function fO() { + Mcn(), (this.a = new Ubn(azn)); + } + function lO(n, t, e) { + return Fnn(t, e, n.c); + } + function bO(n) { + return new QS(n.c, n.d); + } + function wO(n) { + return new QS(n.c, n.d); + } + function dO(n) { + return new QS(n.a, n.b); + } + function gO(n, t) { + return (function (n, t, e) { + var i, r, c, a, u, o, s, h, f; + for ( + !e && + (e = (function (n) { + var t; + return ( + ((t = new p()).a = n), + (t.b = (function (n) { + var t; + return 0 == n ? "Etc/GMT" : (n < 0 ? ((n = -n), (t = "Etc/GMT-")) : (t = "Etc/GMT+"), t + XJ(n)); + })(n)), + (t.c = VQ(fFn, TEn, 2, 2, 6, 1)), + (t.c[0] = A2(n)), + (t.c[1] = A2(n)), + t + ); + })(t.q.getTimezoneOffset())), + r = 6e4 * (t.q.getTimezoneOffset() - e.a), + o = u = new bL(t7(D3(t.q.getTime()), r)), + u.q.getTimezoneOffset() != t.q.getTimezoneOffset() && + (r > 0 ? (r -= 864e5) : (r += 864e5), (o = new bL(t7(D3(t.q.getTime()), r)))), + h = new $y(), + s = n.a.length, + c = 0; + c < s; + + ) + if (((i = XB(n.a, c)) >= 97 && i <= 122) || (i >= 65 && i <= 90)) { + for (a = c + 1; a < s && XB(n.a, a) == i; ++a); + Pjn(h, i, a - c, u, o, e), (c = a); + } else if (39 == i) { + if (++c < s && 39 == XB(n.a, c)) { + (h.a += "'"), ++c; + continue; + } + for (f = !1; !f; ) { + for (a = c; a < s && 39 != XB(n.a, a); ) ++a; + if (a >= s) throw hp(new Qm("Missing trailing '")); + a + 1 < s && 39 == XB(n.a, a + 1) ? ++a : (f = !0), yI(h, l$(n.a, c, a)), (c = a + 1); + } + } else (h.a += String.fromCharCode(i)), ++c; + return h.a; + })(n.a, t, null); + } + function pO(n) { + pz(n, null), vz(n, null); + } + function vO() { + n$.call(this, null, null); + } + function mO() { + t$.call(this, null, null); + } + function yO(n) { + (this.a = n), rp.call(this); + } + function kO(n) { + this.b = (XH(), new gb(n)); + } + function jO(n) { + n.j = VQ(tFn, TEn, 310, 0, 0, 1); + } + function EO(n, t) { + Hmn(n), n.Gc(Yx(t, 15)); + } + function TO(n, t) { + return (function (n, t, e) { + var i, r, c, a, u, o, s, h; + if (0 == e.gc()) return !1; + if ((TT(), (c = (u = Yx(t, 66).Oj()) ? e : new FZ(e.gc())), Lwn(n.e, t))) { + if (t.hi()) + for (s = e.Kc(); s.Ob(); ) + fvn(n, t, (o = s.Pb()), CO(t, 99) && 0 != (Yx(t, 18).Bb & eMn)) || ((r = VX(t, o)), c.Hc(r) || c.Fc(r)); + else if (!u) for (s = e.Kc(); s.Ob(); ) (r = VX(t, (o = s.Pb()))), c.Fc(r); + } else { + if (e.gc() > 1) throw hp(new Qm(GRn)); + for (h = dwn(n.e.Tg(), t), i = Yx(n.g, 119), a = 0; a < n.i; ++a) + if (((r = i[a]), h.rl(r.ak()))) { + if (e.Hc(u ? r : r.dd())) return !1; + for (s = e.Kc(); s.Ob(); ) (o = s.Pb()), Yx(Ken(n, a, u ? Yx(o, 72) : VX(t, o)), 72); + return !0; + } + u || ((r = VX(t, e.Kc().Pb())), c.Fc(r)); + } + return jF(n, c); + })(n.c, n.b, t); + } + function MO(n, t) { + return ( + -1 != + (function (n, t) { + var e, i; + for (rq(t, "predicate"), i = 0; n.Ob(); i++) if (((e = n.Pb()), t.Lb(e))) return i; + return -1; + })(n.Kc(), t) + ); + } + function SO(n, t) { + return null != n.a.Bc(t); + } + function PO(n) { + return n.Ob() ? n.Pb() : null; + } + function IO(n) { + return Vnn(n, 0, n.length); + } + function CO(n, t) { + return null != n && Oen(n, t); + } + function OO(n, t) { + n.c && (_D(t), iG(t)); + } + function AO(n, t, e) { + return ( + (function (n, t, e) { + var i, r, c, a, u, o, s, h; + for (o = new ip(), u = new pb(t.a); u.a < u.c.c.length; ) + for (h = i7(Yx(Hz(u), 10), (Ikn(), Eit)).Kc(); h.Ob(); ) + for (r = new pb(Yx(h.Pb(), 11).g); r.a < r.c.c.length; ) + (!ZW((i = Yx(Hz(r), 17))) && i.c.i.c == i.d.i.c) || ZW(i) || i.d.i.c != e || (o.c[o.c.length] = i); + for (a = I3(e.a).Kc(); a.Ob(); ) + for (h = i7(Yx(a.Pb(), 10), (Ikn(), qit)).Kc(); h.Ob(); ) + for (r = new pb(Yx(h.Pb(), 11).e); r.a < r.c.c.length; ) + if ((ZW((i = Yx(Hz(r), 17))) || i.c.i.c != i.d.i.c) && !ZW(i) && i.c.i.c == t) { + for (S$((s = new JU(o, o.c.length)).b > 0), c = Yx(s.a.Xb((s.c = --s.b)), 17); c != i && s.b > 0; ) + (n.a[c.p] = !0), (n.a[i.p] = !0), S$(s.b > 0), (c = Yx(s.a.Xb((s.c = --s.b)), 17)); + s.b > 0 && hB(s); + } + })(n, t, e), + e + ); + } + function $O(n, t, e) { + (n.a = 1502 ^ t), (n.b = e ^ kMn); + } + function LO(n, t, e) { + return n.a[t.g][e.g]; + } + function NO(n, t) { + return n.a[t.c.p][t.p]; + } + function xO(n, t) { + return n.e[t.c.p][t.p]; + } + function DO(n, t) { + return n.c[t.c.p][t.p]; + } + function RO(n, t) { + return (n.j[t.p] = (function (n) { + var t, e, i, r; + for (t = 0, e = 0, r = new pb(n.j); r.a < r.c.c.length; ) + if ( + ((t = WR(t7(t, fQ(hH(new SR(null, new Nz((i = Yx(Hz(r), 11)).e, 16)), new Yc()))))), + (e = WR(t7(e, fQ(hH(new SR(null, new Nz(i.g, 16)), new Jc()))))), + t > 1 || e > 1) + ) + return 2; + return t + e == 1 ? 2 : 0; + })(t)); + } + function KO(n, t) { + return (n.a *= t), (n.b *= t), n; + } + function _O(n, t, e) { + return DF(n.g, t, e), e; + } + function FO(n) { + n.a = Yx(H3(n.b.a, 4), 126); + } + function BO(n) { + n.a = Yx(H3(n.b.a, 4), 126); + } + function HO(n) { + xq(n, vxn), + Sbn( + n, + (function (n) { + var t, e, i, r, c; + switch ((xq(n, vxn), (!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b).i + (!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c).i)) { + case 0: + throw hp(new Qm("The edge must have at least one source or target.")); + case 1: + return 0 == (!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b).i + ? IG(iun(Yx(c1((!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c), 0), 82))) + : IG(iun(Yx(c1((!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b), 0), 82))); + } + if (1 == (!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b).i && 1 == (!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c).i) { + if ( + ((r = iun(Yx(c1((!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b), 0), 82))), + (c = iun(Yx(c1((!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c), 0), 82))), + IG(r) == IG(c)) + ) + return IG(r); + if (r == IG(c)) return r; + if (c == IG(r)) return c; + } + for ( + t = iun( + Yx( + kV( + (i = W_( + n0( + x4(Gy(QKn, 1), iEn, 20, 0, [ + (!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b), + (!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c), + ]), + ), + )), + ), + 82, + ), + ); + Vfn(i); + + ) + if ((e = iun(Yx(kV(i), 82))) != t && !XZ(e, t)) + if (IG(e) == IG(t)) t = IG(e); + else if (!(t = Uln(t, e))) return null; + return t; + })(n), + ); + } + function qO() { + (qO = O), (FFn = new Am(null)); + } + function GO() { + (GO = O)(), (UFn = new z()); + } + function zO() { + (this.Bb |= 256), (this.Bb |= 512); + } + function UO(n) { + (this.i = n), (this.f = this.i.j); + } + function XO(n, t, e) { + TD.call(this, n, t, e); + } + function WO(n, t, e) { + XO.call(this, n, t, e); + } + function VO(n, t, e) { + XO.call(this, n, t, e); + } + function QO(n, t, e) { + WO.call(this, n, t, e); + } + function YO(n, t, e) { + TD.call(this, n, t, e); + } + function JO(n, t, e) { + TD.call(this, n, t, e); + } + function ZO(n, t, e) { + CD.call(this, n, t, e); + } + function nA(n, t, e) { + CD.call(this, n, t, e); + } + function tA(n, t, e) { + ZO.call(this, n, t, e); + } + function eA(n, t, e) { + YO.call(this, n, t, e); + } + function iA(n, t) { + (this.a = n), eE.call(this, t); + } + function rA(n, t) { + (this.a = n), dy.call(this, t); + } + function cA(n, t) { + (this.a = n), dy.call(this, t); + } + function aA(n, t) { + (this.a = n), dy.call(this, t); + } + function uA(n) { + (this.a = n), ol.call(this, n.d); + } + function oA(n) { + (this.c = n), (this.a = this.c.a); + } + function sA(n, t) { + (this.a = t), dy.call(this, n); + } + function hA(n, t) { + (this.a = t), hW.call(this, n); + } + function fA(n, t) { + (this.a = n), hW.call(this, t); + } + function lA(n, t) { + return (function (n, t, e) { + try { + !(function (n, t, e) { + if ((MF(t), e.Ob())) for (kI(t, $F(e.Pb())); e.Ob(); ) kI(t, n.a), kI(t, $F(e.Pb())); + })(n, t, e); + } catch (n) { + throw CO((n = j4(n)), 597) ? hp(new eV(n)) : hp(n); + } + return t; + })(n, new Ay(), t).a; + } + function bA(n, t) { + return MF(t), new wA(n, t); + } + function wA(n, t) { + (this.a = t), aE.call(this, n); + } + function dA(n) { + (this.b = n), (this.a = this.b.a.e); + } + function gA(n) { + n.b.Qb(), --n.d.f.d, oK(n.d); + } + function pA(n) { + Zf.call(this, Yx(MF(n), 35)); + } + function vA(n) { + Zf.call(this, Yx(MF(n), 35)); + } + function mA() { + Uj.call(this, "INSTANCE", 0); + } + function yA(n) { + if (!n) throw hp(new $p()); + } + function kA(n) { + if (!n) throw hp(new Lp()); + } + function jA(n) { + if (!n) throw hp(new Kp()); + } + function EA() { + (EA = O), ET(), (yut = new Kf()); + } + function TA() { + (TA = O), ($_n = !1), (L_n = !0); + } + function MA(n) { + nb.call(this, (vB(n), n)); + } + function SA(n) { + nb.call(this, (vB(n), n)); + } + function PA(n) { + fb.call(this, n), (this.a = n); + } + function IA(n) { + lb.call(this, n), (this.a = n); + } + function CA(n) { + Ny.call(this, n), (this.a = n); + } + function OA() { + jO(this), qH(this), this._d(); + } + function AA(n, t) { + (this.a = t), aE.call(this, n); + } + function $A(n, t) { + return new jsn(n.a, n.b, t); + } + function LA(n, t) { + return n.lastIndexOf(t); + } + function NA(n, t, e) { + return n.indexOf(t, e); + } + function xA(n) { + return null == n ? aEn : I7(n); + } + function DA(n) { + return null != n.a ? n.a : null; + } + function RA(n, t) { + return null != fG(n.a, t); + } + function KA(n, t) { + return !!t && n.b[t.g] == t; + } + function _A(n) { + return n.$H || (n.$H = ++mBn); + } + function FA(n, t) { + return eD(t.a, n.a), n.a; + } + function BA(n, t) { + return eD(t.b, n.a), n.a; + } + function HA(n, t) { + return eD(t.a, n.a), n.a; + } + function qA(n) { + return S$(null != n.a), n.a; + } + function GA(n) { + Mb.call(this, new tY(n)); + } + function zA(n, t) { + Etn.call(this, n, t, null); + } + function UA(n) { + (this.a = n), hb.call(this, n); + } + function XA() { + (XA = O), (XHn = new _L(OSn, 0)); + } + function WA(n, t) { + return ++n.b, eD(n.a, t); + } + function VA(n, t) { + return ++n.b, uJ(n.a, t); + } + function QA(n, t) { + return Yx(_V(n.b, t), 15); + } + function YA(n) { + return ZC(n.a) || ZC(n.b); + } + function JA(n, t, e) { + return $X(n, t, e, n.c); + } + function ZA(n, t, e) { + Yx(jJ(n, t), 21).Fc(e); + } + function n$(n, t) { + kT(), (this.a = n), (this.b = t); + } + function t$(n, t) { + jT(), (this.b = n), (this.c = t); + } + function e$(n, t) { + gK(), (this.f = t), (this.d = n); + } + function i$(n, t) { + qV(t, n), (this.d = n), (this.c = t); + } + function r$(n) { + var t; + (t = n.a), (n.a = n.b), (n.b = t); + } + function c$(n, t) { + return new NN(n, n.gc(), t); + } + function a$(n) { + (this.d = n), UO.call(this, n); + } + function u$(n) { + (this.c = n), UO.call(this, n); + } + function o$(n) { + (this.c = n), a$.call(this, n); + } + function s$() { + JE(), (this.b = new qw(this)); + } + function h$(n) { + return g0(n, UEn), new pQ(n); + } + function f$(n) { + return $q(), parseInt(n) || -1; + } + function l$(n, t, e) { + return n.substr(t, e - t); + } + function b$(n, t, e) { + return NA(n, gun(t), e); + } + function w$(n) { + return rF(n.c, n.c.length); + } + function d$(n) { + return null != n.f ? n.f : "" + n.g; + } + function g$(n) { + return S$(0 != n.b), n.a.a.c; + } + function p$(n) { + return S$(0 != n.b), n.c.b.c; + } + function v$(n) { + CO(n, 150) && Yx(n, 150).Gh(); + } + function m$(n) { + return (n.b = Yx(FH(n.a), 42)); + } + function y$(n) { + RE(), (this.b = n), (this.a = !0); + } + function k$(n) { + KE(), (this.b = n), (this.a = !0); + } + function j$(n) { + (n.d = new P$(n)), (n.e = new rp()); + } + function E$(n) { + if (!n) throw hp(new Dp()); + } + function T$(n) { + if (!n) throw hp(new $p()); + } + function M$(n) { + if (!n) throw hp(new Lp()); + } + function S$(n) { + if (!n) throw hp(new Kp()); + } + function P$(n) { + oD.call(this, n, null, null); + } + function I$() { + Uj.call(this, "POLYOMINO", 0); + } + function C$(n, t, e, i) { + LK.call(this, n, t, e, i); + } + function O$(n, t) { + return !!n.q && P_(n.q, t); + } + function A$(n, t, e) { + n.Zc(t).Rb(e); + } + function $$(n, t, e) { + return (n.a += t), (n.b += e), n; + } + function L$(n, t, e) { + return (n.a *= t), (n.b *= e), n; + } + function N$(n, t, e) { + return (n.a -= t), (n.b -= e), n; + } + function x$(n, t) { + return (n.a = t.a), (n.b = t.b), n; + } + function D$(n) { + return (n.a = -n.a), (n.b = -n.b), n; + } + function R$(n) { + (this.c = n), (this.a = 1), (this.b = 1); + } + function K$(n) { + (this.c = n), L1(n, 0), N1(n, 0); + } + function _$(n) { + ME.call(this), r0(this, n); + } + function F$(n) { + ljn(), sp(this), this.mf(n); + } + function B$(n, t) { + kT(), n$.call(this, n, t); + } + function H$(n, t) { + jT(), t$.call(this, n, t); + } + function q$(n, t) { + jT(), t$.call(this, n, t); + } + function G$(n, t) { + jT(), H$.call(this, n, t); + } + function z$(n, t, e) { + yY.call(this, n, t, e, 2); + } + function U$(n, t) { + WC(), KR.call(this, n, t); + } + function X$(n, t) { + WC(), U$.call(this, n, t); + } + function W$(n, t) { + WC(), U$.call(this, n, t); + } + function V$(n, t) { + WC(), W$.call(this, n, t); + } + function Q$(n, t) { + WC(), KR.call(this, n, t); + } + function Y$(n, t) { + WC(), Q$.call(this, n, t); + } + function J$(n, t) { + WC(), KR.call(this, n, t); + } + function Z$(n, t, e) { + return Imn(SJ(n, t), e); + } + function nL(n, t) { + return P8(n.e, Yx(t, 49)); + } + function tL(n, t) { + t.$modCount = n.$modCount; + } + function eL() { + (eL = O), (s6n = new Og("root")); + } + function iL() { + (iL = O), ($ct = new Rv()), new Kv(); + } + function rL() { + (this.a = new Zq()), (this.b = new Zq()); + } + function cL() { + T0.call(this), (this.Bb |= eMn); + } + function aL() { + Uj.call(this, "GROW_TREE", 0); + } + function uL(n) { + return null == n + ? null + : (function (n) { + var t, e, i, r, c, a, u, o, s, h, f, l, b, w, d; + if ((Jpn(), null == n)) return null; + if (0 == (f = 8 * n.length)) return ""; + for ( + l = (f / 24) | 0, + c = null, + c = VQ(Xot, sTn, 25, 4 * (0 != (u = f % 24) ? l + 1 : l), 15, 1), + s = 0, + h = 0, + t = 0, + e = 0, + i = 0, + a = 0, + r = 0, + o = 0; + o < l; + o++ + ) + (t = n[r++]), + (h = ((15 & (e = n[r++])) << 24) >> 24), + (s = ((3 & t) << 24) >> 24), + (b = 0 == (-128 & t) ? ((t >> 2) << 24) >> 24 : (((t >> 2) ^ 192) << 24) >> 24), + (w = 0 == (-128 & e) ? ((e >> 4) << 24) >> 24 : (((e >> 4) ^ 240) << 24) >> 24), + (d = 0 == (-128 & (i = n[r++])) ? ((i >> 6) << 24) >> 24 : (((i >> 6) ^ 252) << 24) >> 24), + (c[a++] = hot[b]), + (c[a++] = hot[w | (s << 4)]), + (c[a++] = hot[(h << 2) | d]), + (c[a++] = hot[63 & i]); + return ( + 8 == u + ? ((s = ((3 & (t = n[r])) << 24) >> 24), + (b = 0 == (-128 & t) ? ((t >> 2) << 24) >> 24 : (((t >> 2) ^ 192) << 24) >> 24), + (c[a++] = hot[b]), + (c[a++] = hot[s << 4]), + (c[a++] = 61), + (c[a++] = 61)) + : 16 == u && + ((t = n[r]), + (h = ((15 & (e = n[r + 1])) << 24) >> 24), + (s = ((3 & t) << 24) >> 24), + (b = 0 == (-128 & t) ? ((t >> 2) << 24) >> 24 : (((t >> 2) ^ 192) << 24) >> 24), + (w = 0 == (-128 & e) ? ((e >> 4) << 24) >> 24 : (((e >> 4) ^ 240) << 24) >> 24), + (c[a++] = hot[b]), + (c[a++] = hot[w | (s << 4)]), + (c[a++] = hot[h << 2]), + (c[a++] = 61)), + Vnn(c, 0, c.length) + ); + })(n); + } + function oL(n) { + return null == n + ? null + : (function (n) { + var t, e, i, r; + if ((kdn(), null == n)) return null; + for (i = n.length, t = VQ(Xot, sTn, 25, 2 * i, 15, 1), e = 0; e < i; e++) + (r = n[e]) < 0 && (r += 256), (t[2 * e] = lot[r >> 4]), (t[2 * e + 1] = lot[15 & r]); + return Vnn(t, 0, t.length); + })(n); + } + function sL(n) { + null == n.o && + (function (n) { + if (n.pe()) { + var t = n.c; + return ( + t.qe() ? (n.o = "[" + t.n) : t.pe() ? (n.o = "[" + t.ne()) : (n.o = "[L" + t.ne() + ";"), + (n.b = t.me() + "[]"), + void (n.k = t.oe() + "[]") + ); + } + var e = n.j, + i = n.d; + (i = i.split("/")), (n.o = Wnn(".", [e, Wnn("$", i)])), (n.b = Wnn(".", [e, Wnn(".", i)])), (n.k = i[i.length - 1]); + })(n); + } + function hL(n) { + return QD(null == n || rI(n)), n; + } + function fL(n) { + return QD(null == n || cI(n)), n; + } + function lL(n) { + return QD(null == n || aI(n)), n; + } + function bL(n) { + this.q = new e.Date(VU(n)); + } + function wL(n, t) { + (this.c = n), Xj.call(this, n, t); + } + function dL(n, t) { + (this.a = n), wL.call(this, n, t); + } + function gL(n, t) { + (this.d = n), Wl(this), (this.b = t); + } + function pL(n, t) { + ZQ.call(this, n), (this.a = t); + } + function vL(n, t) { + ZQ.call(this, n), (this.a = t); + } + function mL(n) { + hnn.call(this, 0, 0), (this.f = n); + } + function yL(n, t, e) { + dQ.call(this, n, t, e, null); + } + function kL(n, t, e) { + dQ.call(this, n, t, e, null); + } + function jL(n, t) { + return Yx(UJ(n.b, t), 149); + } + function EL(n, t) { + return Yx(UJ(n.c, t), 229); + } + function TL(n) { + return Yx(TR(n.a, n.b), 287); + } + function ML(n) { + return new QS(n.c, n.d + n.a); + } + function SL(n) { + return hz(), wC(Yx(n, 197)); + } + function PL() { + (PL = O), (UHn = J9((Ann(), nrt))); + } + function IL(n, t) { + t.a + ? (function (n, t) { + var e, i, r; + if (!uF(n.a, t.b)) throw hp(new Ym("Invalid hitboxes for scanline overlap calculation.")); + for (r = !1, i = new sb(new gN(new UA(new ob(n.a.a).a).b)); OT(i.a.a); ) + if (((e = Yx(m$(i.a).cd(), 65)), u5(t.b, e))) vk(n.b.a, t.b, e), (r = !0); + else if (r) break; + })(n, t) + : RA(n.a, t.b); + } + function CL(n, t) { + hBn || eD(n.a, t); + } + function OL(n, t) { + return xq(t, jSn), (n.f = t), n; + } + function AL(n, t, e) { + return opn(n, t, 3, e); + } + function $L(n, t, e) { + return opn(n, t, 6, e); + } + function LL(n, t, e) { + return opn(n, t, 9, e); + } + function NL(n, t, e) { + ++n.j, n.Ki(), XQ(n, t, e); + } + function xL(n, t, e) { + ++n.j, n.Hi(t, n.oi(t, e)); + } + function DL(n, t, e) { + n.Zc(t).Rb(e); + } + function RL(n, t, e) { + return rmn(n.c, n.b, t, e); + } + function KL(n, t) { + return (t & Yjn) % n.d.length; + } + function _L(n, t) { + Og.call(this, n), (this.a = t); + } + function FL(n, t) { + Gg.call(this, n), (this.a = t); + } + function BL(n, t) { + Gg.call(this, n), (this.a = t); + } + function HL(n, t) { + (this.c = n), FZ.call(this, t); + } + function qL(n, t) { + (this.a = n), qg.call(this, t); + } + function GL(n, t) { + (this.a = n), qg.call(this, t); + } + function zL(n) { + this.a = (g0(n, UEn), new pQ(n)); + } + function UL(n) { + this.a = (g0(n, UEn), new pQ(n)); + } + function XL(n) { + return !n.a && (n.a = new w()), n.a; + } + function WL(n) { + return n > 8 ? 0 : n + 1; + } + function VL(n, t, e) { + return YR(n, Yx(t, 22), e); + } + function QL(n, t, e) { + return (n.a += Vnn(t, 0, e)), n; + } + function YL(n, t) { + var e; + return (e = n.e), (n.e = t), e; + } + function JL(n, t) { + n[vMn].call(n, t); + } + function ZL(n, t) { + n.a.Vc(n.b, t), ++n.b, (n.c = -1); + } + function nN(n) { + U_(n.e), (n.d.b = n.d), (n.d.a = n.d); + } + function tN(n) { + n.b ? tN(n.b) : n.f.c.zc(n.e, n.d); + } + function eN(n, t) { + return qy(new Array(t), n); + } + function iN(n) { + return String.fromCharCode(n); + } + function rN() { + (this.a = new ip()), (this.b = new ip()); + } + function cN() { + (this.a = new bt()), (this.b = new Hp()); + } + function aN() { + (this.b = new Pk()), (this.c = new ip()); + } + function uN() { + (this.d = new Pk()), (this.e = new Pk()); + } + function oN() { + (this.n = new Pk()), (this.o = new Pk()); + } + function sN() { + (this.n = new Sv()), (this.i = new hC()); + } + function hN() { + (this.a = new Jh()), (this.b = new uc()); + } + function fN() { + (this.a = new ip()), (this.d = new ip()); + } + function lN() { + (this.b = new Qp()), (this.a = new Qp()); + } + function bN() { + (this.b = new rp()), (this.a = new rp()); + } + function wN() { + (this.b = new fj()), (this.a = new da()); + } + function dN() { + sN.call(this), (this.a = new Pk()); + } + function gN(n) { + Q3.call(this, n, (HY(), WFn)); + } + function pN(n, t, e, i) { + FR.call(this, n, t, e, i); + } + function vN(n, t, e) { + return opn(n, t, 11, e); + } + function mN(n, t) { + return (n.a += t.a), (n.b += t.b), n; + } + function yN(n, t) { + return (n.a -= t.a), (n.b -= t.b), n; + } + function kN(n, t) { + return null == xB(n.a, t, ""); + } + function jN(n, t) { + Hm.call(this, pDn + n + Exn + t); + } + function EN(n, t, e, i) { + m_.call(this, n, t, e, i); + } + function TN(n, t, e, i) { + m_.call(this, n, t, e, i); + } + function MN(n, t, e, i) { + TN.call(this, n, t, e, i); + } + function SN(n, t, e, i) { + y_.call(this, n, t, e, i); + } + function PN(n, t, e, i) { + y_.call(this, n, t, e, i); + } + function IN(n, t, e, i) { + y_.call(this, n, t, e, i); + } + function CN(n, t, e, i) { + PN.call(this, n, t, e, i); + } + function ON(n, t, e, i) { + PN.call(this, n, t, e, i); + } + function AN(n, t, e, i) { + IN.call(this, n, t, e, i); + } + function $N(n, t, e, i) { + ON.call(this, n, t, e, i); + } + function LN(n, t, e, i) { + g_.call(this, n, t, e, i); + } + function NN(n, t, e) { + (this.a = n), i$.call(this, t, e); + } + function xN(n, t, e) { + (this.c = t), (this.b = e), (this.a = n); + } + function DN(n, t) { + return n.Aj().Nh().Kh(n, t); + } + function RN(n, t) { + return n.Aj().Nh().Ih(n, t); + } + function KN(n, t) { + return vB(n), iI(n) === iI(t); + } + function _N(n, t) { + return vB(n), iI(n) === iI(t); + } + function FN(n, t) { + return $k(Dnn(n.a, t, !1)); + } + function BN(n, t) { + return $k(Rnn(n.a, t, !1)); + } + function HN(n, t) { + return n.b.sd(new JT(n, t)); + } + function qN(n, t, e) { + return n.lastIndexOf(t, e); + } + function GN(n) { + return n.c ? hJ(n.c.a, n, 0) : -1; + } + function zN(n) { + return n == uit || n == sit || n == oit; + } + function UN(n, t) { + return CO(t, 15) && Pdn(n.c, t); + } + function XN(n, t) { + return !!c6(n, t); + } + function WN(n, t) { + (this.c = n), Z_.call(this, n, t); + } + function VN(n) { + (this.c = n), PI.call(this, IEn, 0); + } + function QN(n, t) { + aD.call(this, n, n.length, t); + } + function YN(n, t, e) { + return Yx(n.c, 69).mk(t, e); + } + function JN(n, t, e) { + return (function (n, t, e) { + return t.Rk(n.e, n.c, e); + })(n, Yx(t, 332), e); + } + function ZN(n, t, e) { + return (function (n, t, e) { + var i, r, c; + return ( + (i = t.ak()), + (c = t.dd()), + (r = i.$j() + ? Kq(n, 4, i, c, null, $vn(n, i, c, CO(i, 99) && 0 != (Yx(i, 18).Bb & eMn)), !0) + : Kq(n, i.Kj() ? 2 : 1, i, c, i.zj(), -1, !0)), + e ? e.Ei(r) : (e = r), + e + ); + })(n, Yx(t, 332), e); + } + function nx(n, t) { + return null == t ? null : x8(n.b, t); + } + function tx(n) { + return cI(n) ? (vB(n), n) : n.ke(); + } + function ex(n) { + return !isNaN(n) && !isFinite(n); + } + function ix(n) { + px(), (this.a = (XH(), new Ny(n))); + } + function rx(n) { + dD(), (this.d = n), (this.a = new ep()); + } + function cx(n, t, e) { + (this.a = n), (this.b = t), (this.c = e); + } + function ax(n, t, e) { + (this.a = n), (this.b = t), (this.c = e); + } + function ux(n, t, e) { + (this.d = n), (this.b = e), (this.a = t); + } + function ox(n) { + aO(this), BH(this), C2(this, n); + } + function sx(n) { + AC(this), sD(this.c, 0, n.Pc()); + } + function hx(n) { + hB(n.a), iY(n.c, n.b), (n.b = null); + } + function fx(n) { + (this.a = n), oE(), D3(Date.now()); + } + function lx() { + (lx = O), (pBn = new r()), (vBn = new r()); + } + function bx() { + (bx = O), (KFn = new L()), (_Fn = new N()); + } + function wx() { + (wx = O), (Cct = VQ(UKn, iEn, 1, 0, 5, 1)); + } + function dx() { + (dx = O), (Fat = VQ(UKn, iEn, 1, 0, 5, 1)); + } + function gx() { + (gx = O), (Bat = VQ(UKn, iEn, 1, 0, 5, 1)); + } + function px() { + (px = O), new jp((XH(), XH(), TFn)); + } + function vx(n, t) { + if (!n) throw hp(new Qm(t)); + } + function mx(n) { + FR.call(this, n.d, n.c, n.a, n.b); + } + function yx(n) { + FR.call(this, n.d, n.c, n.a, n.b); + } + function kx(n, t, e) { + (this.b = n), (this.c = t), (this.a = e); + } + function jx(n, t, e) { + (this.b = n), (this.a = t), (this.c = e); + } + function Ex(n, t, e) { + (this.a = n), (this.b = t), (this.c = e); + } + function Tx(n, t, e) { + (this.a = n), (this.b = t), (this.c = e); + } + function Mx(n, t, e) { + (this.a = n), (this.b = t), (this.c = e); + } + function Sx(n, t, e) { + (this.a = n), (this.b = t), (this.c = e); + } + function Px(n, t, e) { + (this.b = n), (this.a = t), (this.c = e); + } + function Ix(n, t, e) { + (this.e = t), (this.b = n), (this.d = e); + } + function Cx(n) { + var t; + return ((t = new jn()).e = n), t; + } + function Ox(n) { + var t; + return ((t = new lv()).b = n), t; + } + function Ax() { + (Ax = O), (aUn = new Ne()), (uUn = new xe()); + } + function $x() { + ($x = O), (CXn = new vr()), (OXn = new mr()); + } + function Lx(n, t) { + (this.c = n), (this.a = t), (this.b = t - n); + } + function Nx(n, t, e) { + (this.a = n), (this.b = t), (this.c = e); + } + function xx(n, t, e) { + (this.a = n), (this.b = t), (this.c = e); + } + function Dx(n, t, e) { + (this.a = n), (this.b = t), (this.c = e); + } + function Rx(n, t, e) { + (this.a = n), (this.b = t), (this.c = e); + } + function Kx(n, t, e) { + (this.a = n), (this.b = t), (this.c = e); + } + function _x(n, t, e) { + (this.e = n), (this.a = t), (this.c = e); + } + function Fx(n, t, e) { + WC(), tG.call(this, n, t, e); + } + function Bx(n, t, e) { + WC(), iB.call(this, n, t, e); + } + function Hx(n, t, e) { + WC(), iB.call(this, n, t, e); + } + function qx(n, t, e) { + WC(), iB.call(this, n, t, e); + } + function Gx(n, t, e) { + WC(), Bx.call(this, n, t, e); + } + function zx(n, t, e) { + WC(), Bx.call(this, n, t, e); + } + function Ux(n, t, e) { + WC(), zx.call(this, n, t, e); + } + function Xx(n, t, e) { + WC(), Hx.call(this, n, t, e); + } + function Wx(n, t, e) { + WC(), qx.call(this, n, t, e); + } + function Vx(n, t) { + return MF(n), MF(t), new Fj(n, t); + } + function Qx(n, t) { + return MF(n), MF(t), new BD(n, t); + } + function Yx(n, t) { + return QD(null == n || Oen(n, t)), n; + } + function Jx(n) { + var t; + return zJ((t = new ip()), n), t; + } + function Zx(n) { + var t; + return $2((t = new rv()), n), t; + } + function nD(n) { + var t; + return $2((t = new ME()), n), t; + } + function tD(n) { + return !n.e && (n.e = new ip()), n.e; + } + function eD(n, t) { + return (n.c[n.c.length] = t), !0; + } + function iD(n, t) { + (this.c = n), (this.b = t), (this.a = !1); + } + function rD(n) { + (this.d = n), + Wl(this), + (this.b = (function (n) { + return CO(n, 15) ? Yx(n, 15).Yc() : n.Kc(); + })(n.d)); + } + function cD() { + (this.a = ";,;"), (this.b = ""), (this.c = ""); + } + function aD(n, t, e) { + s_.call(this, t, e), (this.a = n); + } + function uD(n, t, e) { + (this.b = n), MI.call(this, t, e); + } + function oD(n, t, e) { + (this.c = n), zT.call(this, t, e); + } + function sD(n, t, e) { + hhn(e, 0, n, t, e.length, !1); + } + function hD(n, t, e, i, r) { + (n.b = t), (n.c = e), (n.d = i), (n.a = r); + } + function fD(n, t, e, i, r) { + (n.d = t), (n.c = e), (n.a = i), (n.b = r); + } + function lD(n) { + var t, e; + (t = n.b), (e = n.c), (n.b = e), (n.c = t); + } + function bD(n) { + var t, e; + (e = n.d), (t = n.a), (n.d = t), (n.a = e); + } + function wD(n) { + return $3( + (function (n) { + return rO(~n.l & BTn, ~n.m & BTn, ~n.h & HTn); + })(tC(n) ? W3(n) : n), + ); + } + function dD() { + (dD = O), Ikn(), (Y3n = qit), (J3n = Eit); + } + function gD() { + this.b = ty(fL(oen((Bdn(), yGn)))); + } + function pD(n) { + return HE(), VQ(UKn, iEn, 1, n, 5, 1); + } + function vD(n) { + return new QS(n.c + n.b, n.d + n.a); + } + function mD(n) { + return S$(0 != n.b), VZ(n, n.a.a); + } + function yD(n) { + return S$(0 != n.b), VZ(n, n.c.b); + } + function kD(n, t) { + if (!n) throw hp(new qm(t)); + } + function jD(n, t) { + if (!n) throw hp(new Qm(t)); + } + function ED(n, t, e) { + LM.call(this, n, t), (this.b = e); + } + function TD(n, t, e) { + XP.call(this, n, t), (this.c = e); + } + function MD(n, t, e) { + RZ.call(this, t, e), (this.d = n); + } + function SD(n) { + gx(), yo.call(this), this.th(n); + } + function PD(n, t, e) { + (this.a = n), HI.call(this, t, e); + } + function ID(n, t, e) { + (this.a = n), HI.call(this, t, e); + } + function CD(n, t, e) { + XP.call(this, n, t), (this.c = e); + } + function OD() { + wV(), uB.call(this, (mT(), aat)); + } + function AD(n) { + return null != n && !$7(n, Wct, Vct); + } + function $D(n, t) { + return ((u9(n) << 4) | u9(t)) & fTn; + } + function LD(n, t) { + var e; + n.n && ((e = t), eD(n.f, e)); + } + function ND(n, t, e) { + OZ(n, t, new zF(e)); + } + function xD(n, t) { + return (n.g = t < 0 ? -1 : t), n; + } + function DD(n, t) { + return ( + (function (n) { + var t; + (t = e.Math.sqrt(n.a * n.a + n.b * n.b)) > 0 && ((n.a /= t), (n.b /= t)); + })(n), + (n.a *= t), + (n.b *= t), + n + ); + } + function RD(n, t, e, i, r) { + (n.c = t), (n.d = e), (n.b = i), (n.a = r); + } + function KD(n, t) { + return VW(n, t, n.c.b, n.c), !0; + } + function _D(n) { + (n.a.b = n.b), (n.b.a = n.a), (n.a = n.b = null); + } + function FD(n) { + (this.b = n), (this.a = DK(this.b.a).Ed()); + } + function BD(n, t) { + (this.b = n), (this.a = t), _h.call(this); + } + function HD(n, t) { + (this.a = n), (this.b = t), _h.call(this); + } + function qD(n, t) { + s_.call(this, t, 1040), (this.a = n); + } + function GD(n) { + return 0 == n || isNaN(n) ? n : n < 0 ? -1 : 1; + } + function zD(n, t) { + return ean(n, new LM(t.a, t.b)); + } + function UD(n) { + var t; + return (t = n.n), n.a.b + t.d + t.a; + } + function XD(n) { + var t; + return (t = n.n), n.e.b + t.d + t.a; + } + function WD(n) { + var t; + return (t = n.n), n.e.a + t.b + t.c; + } + function VD(n) { + return Ljn(), new BR(0, n); + } + function QD(n) { + if (!n) throw hp(new Vm(null)); + } + function YD() { + (YD = O), XH(), (jut = new bb(HRn)); + } + function JD() { + (JD = O), new _en((wm(), n_n), (dm(), ZKn)); + } + function ZD() { + (ZD = O), (G_n = VQ(U_n, TEn, 19, 256, 0, 1)); + } + function nR(n, t, e, i) { + F7.call(this, n, t, e, i, 0, 0); + } + function tR(n) { + return n.e.c.length + n.g.c.length; + } + function eR(n) { + return n.e.c.length - n.g.c.length; + } + function iR(n) { + return n.b.c.length - n.e.c.length; + } + function rR(n) { + gx(), SD.call(this, n), (this.a = -1); + } + function cR(n, t) { + VP.call(this, n, t), (this.a = this); + } + function aR(n, t) { + var e; + return ((e = TF(n, t)).i = 2), e; + } + function uR(n, t) { + return ++n.j, n.Ti(t); + } + function oR(n, t, e) { + return (n.a = -1), ZA(n, t.g, e), n; + } + function sR(n, t, e) { + !(function (n, t, e, i, r) { + var c, a, u, o, s, h, f, l, b, w, d, g; + null == (w = BF(n.e, i)) && ((s = Yx((w = new Om()), 183)), (o = new zF(t + "_s" + r)), OZ(s, rxn, o)), + nB(e, (b = Yx(w, 183))), + nq((g = new Om()), "x", i.j), + nq(g, "y", i.k), + OZ(b, uxn, g), + nq((f = new Om()), "x", i.b), + nq(f, "y", i.c), + OZ(b, "endPoint", f), + !Sj((!i.a && (i.a = new XO(Qrt, i, 5)), i.a)) && + ((c = new pg((h = new Sl()))), XW((!i.a && (i.a = new XO(Qrt, i, 5)), i.a), c), OZ(b, YNn, h)), + !!Jen(i) && jun(n.a, b, ZNn, ksn(n, Jen(i))), + !!Zen(i) && jun(n.a, b, JNn, ksn(n, Zen(i))), + !(0 == (!i.e && (i.e = new AN(tct, i, 10, 9)), i.e).i) && + ((a = new FP(n, (l = new Sl()))), XW((!i.e && (i.e = new AN(tct, i, 10, 9)), i.e), a), OZ(b, txn, l)), + 0 != (!i.g && (i.g = new AN(tct, i, 9, 10)), i.g).i && + ((u = new BP(n, (d = new Sl()))), XW((!i.g && (i.g = new AN(tct, i, 9, 10)), i.g), u), OZ(b, nxn, d)); + })(n.a, n.b, n.c, Yx(t, 202), e); + } + function hR(n, t, e) { + return new xN( + (function (n) { + return 0 >= n + ? new EE() + : (function (n) { + return 0 > n ? new EE() : new vL(null, new cV(n + 1, n)); + })(n - 1); + })(n).Ie(), + e, + t, + ); + } + function fR(n, t, e, i, r, c) { + return nan(n, t, e, i, r, 0, c); + } + function lR() { + (lR = O), (R_n = VQ(__n, TEn, 217, 256, 0, 1)); + } + function bR() { + (bR = O), (X_n = VQ(J_n, TEn, 162, 256, 0, 1)); + } + function wR() { + (wR = O), (Z_n = VQ(nFn, TEn, 184, 256, 0, 1)); + } + function dR() { + (dR = O), (F_n = VQ(B_n, TEn, 172, 128, 0, 1)); + } + function gR() { + hD(this, !1, !1, !1, !1); + } + function pR(n) { + VF(), (this.a = (XH(), new bb(MF(n)))); + } + function vR(n) { + for (MF(n); n.Ob(); ) n.Pb(), n.Qb(); + } + function mR(n) { + (this.c = n), (this.b = this.c.d.vc().Kc()); + } + function yR(n) { + (this.c = n), (this.a = new TE(this.c.a)); + } + function kR(n) { + (this.a = new kE(n.gc())), C2(this, n); + } + function jR(n) { + Mb.call(this, new bW()), C2(this, n); + } + function ER(n, t) { + return (n.a += Vnn(t, 0, t.length)), n; + } + function TR(n, t) { + return $z(t, n.c.length), n.c[t]; + } + function MR(n, t) { + return $z(t, n.a.length), n.a[t]; + } + function SR(n, t) { + HE(), ZQ.call(this, n), (this.a = t); + } + function PR(n, t) { + return (function (n, t) { + return ytn(t7(ytn(n.a).a, t.a)); + })(Yx(n, 162), Yx(t, 162)); + } + function IR(n) { + return n.c - Yx(TR(n.a, n.b), 287).b; + } + function CR(n) { + return n.q ? n.q : (XH(), XH(), MFn); + } + function OR(n) { + return n.e.Hd().gc() * n.c.Hd().gc(); + } + function AR(n, t, i) { + return e.Math.min(i / n, 1 / t); + } + function $R(n, t) { + return n ? 0 : e.Math.max(0, t - 1); + } + function LR(n) { + var t; + return (t = han(n)) ? LR(t) : n; + } + function NR(n, t) { + return null == n.a && qdn(n), n.a[t]; + } + function xR(n) { + return n.c ? n.c.f : n.e.b; + } + function DR(n) { + return n.c ? n.c.g : n.e.a; + } + function RR(n) { + FZ.call(this, n.gc()), jF(this, n); + } + function KR(n, t) { + WC(), zg.call(this, t), (this.a = n); + } + function _R(n, t, e) { + (this.a = n), XO.call(this, t, e, 2); + } + function FR(n, t, e, i) { + fD(this, n, t, e, i); + } + function BR(n, t) { + Ljn(), np.call(this, n), (this.a = t); + } + function HR(n) { + (this.b = new ME()), (this.a = n), (this.c = -1); + } + function qR() { + (this.d = new QS(0, 0)), (this.e = new Qp()); + } + function GR(n) { + i$.call(this, 0, 0), (this.a = n), (this.b = 0); + } + function zR(n) { + (this.a = n), + (this.c = new rp()), + (function (n) { + var t, e, i, r; + for (i = 0, r = (e = n.a).length; i < r; ++i) P5(n, (t = e[i]), (Ikn(), Bit)), P5(n, t, Tit); + })(this); + } + function UR(n) { + if (n.e.c != n.b) throw hp(new Dp()); + } + function XR(n) { + if (n.c.e != n.a) throw hp(new Dp()); + } + function WR(n) { + return tC(n) ? 0 | n : rj(n); + } + function VR(n, t) { + return Ljn(), new tF(n, t); + } + function QR(n, t) { + return null == n ? null == t : _N(n, t); + } + function YR(n, t, e) { + return n2(n.a, t), K_(n, t.g, e); + } + function JR(n, t, e) { + _6(0, t, n.length), DY(n, 0, t, e); + } + function ZR(n, t, e) { + iz(t, n.c.length), GT(n.c, t, e); + } + function nK(n, t, e) { + var i; + for (i = 0; i < t; ++i) n[i] = e; + } + function tK(n, t) { + var e; + return L5((e = J9(n)), t), e; + } + function eK(n, t) { + return !n && (n = []), (n[n.length] = t), n; + } + function iK(n, t) { + return (function (n, t, e) { + return kJ(n, new Nb(t), new un(), new xb(e), x4(Gy(wBn, 1), XEn, 132, 0, [])); + })(new nn(), new Ob(n), t); + } + function rK(n, t) { + return CO(t, 22) && KA(n, Yx(t, 22)); + } + function cK(n, t) { + return ( + CO(t, 22) && + (function (n, t) { + return !(!t || n.b[t.g] != t || (DF(n.b, t.g, null), --n.c, 0)); + })(n, Yx(t, 22)) + ); + } + function aK(n) { + return Xln(n, 26) * mMn + Xln(n, 27) * yMn; + } + function uK(n) { + return Array.isArray(n) && n.im === C; + } + function oK(n) { + n.b ? oK(n.b) : n.d.dc() && n.f.c.Bc(n.e); + } + function sK(n, t) { + mN(n.c, t), (n.b.c += t.a), (n.b.d += t.b); + } + function hK(n, t) { + sK(n, yN(new QS(t.a, t.b), n.c)); + } + function fK(n, t) { + (this.b = new ME()), (this.a = n), (this.c = t); + } + function lK() { + (this.b = new Ot()), (this.c = new yq(this)); + } + function bK() { + (this.d = new mn()), (this.e = new mq(this)); + } + function wK() { + uz(), (this.f = new ME()), (this.e = new ME()); + } + function dK() { + hz(), (this.k = new rp()), (this.d = new Qp()); + } + function gK() { + (gK = O), (Irt = new DC((Cjn(), ytt), 0)); + } + function pK() { + (pK = O), (r_n = new GR(VQ(UKn, iEn, 1, 0, 5, 1))); + } + function vK(n, t, e) { + var i; + n && (((i = n.i).c = t), (i.b = e)); + } + function mK(n, t, e) { + var i; + n && (((i = n.i).d = t), (i.a = e)); + } + function yK(n, t, e) { + return (n.a = -1), ZA(n, t.g + 1, e), n; + } + function kK(n, t, e) { + return opn(n, Yx(t, 49), 7, e); + } + function jK(n, t, e) { + return opn(n, Yx(t, 49), 3, e); + } + function EK(n, t, e) { + (this.a = n), WO.call(this, t, e, 22); + } + function TK(n, t, e) { + (this.a = n), WO.call(this, t, e, 14); + } + function MK(n, t, e, i) { + WC(), wU.call(this, n, t, e, i); + } + function SK(n, t, e, i) { + WC(), wU.call(this, n, t, e, i); + } + function PK(n) { + return null != n && V_(n) && !(n.im === C); + } + function IK(n) { + return !Array.isArray(n) && n.im === C; + } + function CK(n) { + return n.Qc(VQ(UKn, iEn, 1, n.gc(), 5, 1)); + } + function OK(n, t) { + return (function (n) { + var t; + return ( + n.b || + (function (n, t) { + (n.c = t), (n.b = !0); + })( + n, + !(t = (function (n, t) { + return t.Hh(n.a); + })(n.e, n.a)) || !_N(jLn, ynn((!t.b && (t.b = new z$((xjn(), Dat), out, t)), t.b), "qualified")), + ), + n.c + ); + })(SJ(n, t)) + ? t.Qh() + : null; + } + function AK(n) { + n ? Jin(n, (oE(), eFn), "") : oE(); + } + function $K(n) { + (this.a = (pK(), r_n)), (this.d = Yx(MF(n), 47)); + } + function LK(n, t, e, i) { + (this.a = n), dQ.call(this, n, t, e, i); + } + function NK(n) { + PT(), (this.a = 0), (this.b = n - 1), (this.c = 1); + } + function xK(n) { + jO(this), (this.g = n), qH(this), this._d(); + } + function DK(n) { + return n.c ? n.c : (n.c = n.Id()); + } + function RK(n) { + return n.d ? n.d : (n.d = n.Jd()); + } + function KK(n) { + return n.c || (n.c = n.Dd()); + } + function _K(n) { + return n.f || (n.f = n.Dc()); + } + function FK(n) { + return n.i || (n.i = n.bc()); + } + function BK(n) { + return Ljn(), new nG(10, n, 0); + } + function HK(n) { + return tC(n) ? "" + n : Mdn(n); + } + function qK(n) { + if (n.e.j != n.d) throw hp(new Dp()); + } + function GK(n, t) { + return $3(don(tC(n) ? W3(n) : n, t)); + } + function zK(n, t) { + return $3(tln(tC(n) ? W3(n) : n, t)); + } + function UK(n, t) { + return $3( + (function (n, t) { + var e, i, r, c; + return ( + (t &= 63), + (e = n.h & HTn), + t < 22 + ? ((c = e >>> t), (r = (n.m >> t) | (e << (22 - t))), (i = (n.l >> t) | (n.m << (22 - t)))) + : t < 44 + ? ((c = 0), (r = e >>> (t - 22)), (i = (n.m >> (t - 22)) | (n.h << (44 - t)))) + : ((c = 0), (r = 0), (i = e >>> (t - 44))), + rO(i & BTn, r & BTn, c & HTn) + ); + })(tC(n) ? W3(n) : n, t), + ); + } + function XK(n, t) { + return (function (n, t) { + return TA(), n == t ? 0 : n ? 1 : -1; + })((vB(n), n), (vB(t), t)); + } + function WK(n, t) { + return $9((vB(n), n), (vB(t), t)); + } + function VK(n, t) { + return MF(t), n.a.Ad(t) && !n.b.Ad(t); + } + function QK(n, t) { + return W8(n, (vB(t), new Pb(t))); + } + function YK(n, t) { + return W8(n, (vB(t), new Ib(t))); + } + function JK(n) { + return Q2(), 0 != Yx(n, 11).e.c.length; + } + function ZK(n) { + return Q2(), 0 != Yx(n, 11).g.c.length; + } + function n_(n, t, e) { + return (function (n, t, e) { + var i, r, c, a, u, o, s, h, f, l; + if (0 != t.e.c.length && 0 != e.e.c.length) { + if ((i = Yx(TR(t.e, 0), 17).c.i) == (a = Yx(TR(e.e, 0), 17).c.i)) + return eO(Yx(Aun(Yx(TR(t.e, 0), 17), (Ojn(), IQn)), 19).a, Yx(Aun(Yx(TR(e.e, 0), 17), IQn), 19).a); + for (f = 0, l = (h = n.a).length; f < l; ++f) { + if ((s = h[f]) == i) return 1; + if (s == a) return -1; + } + } + return 0 != t.g.c.length && 0 != e.g.c.length + ? ((c = Yx(Aun(t, (Ojn(), SQn)), 10)), + (o = Yx(Aun(e, SQn), 10)), + (r = 0), + (u = 0), + O$(Yx(TR(t.g, 0), 17), IQn) && (r = Yx(Aun(Yx(TR(t.g, 0), 17), IQn), 19).a), + O$(Yx(TR(e.g, 0), 17), IQn) && (u = Yx(Aun(Yx(TR(t.g, 0), 17), IQn), 19).a), + c && c == o + ? ny(hL(Aun(Yx(TR(t.g, 0), 17), HQn))) && !ny(hL(Aun(Yx(TR(e.g, 0), 17), HQn))) + ? 1 + : (!ny(hL(Aun(Yx(TR(t.g, 0), 17), HQn))) && ny(hL(Aun(Yx(TR(e.g, 0), 17), HQn)))) || r < u + ? -1 + : r > u + ? 1 + : 0 + : (n.b && (n.b._b(c) && (r = Yx(n.b.xc(c), 19).a), n.b._b(o) && (u = Yx(n.b.xc(o), 19).a)), r < u ? -1 : r > u ? 1 : 0)) + : 0 != t.e.c.length && 0 != e.g.c.length + ? 1 + : -1; + })(n, Yx(t, 11), Yx(e, 11)); + } + function t_(n) { + return n.e ? oQ(n.e) : null; + } + function e_(n) { + n.d || ((n.d = n.b.Kc()), (n.c = n.b.gc())); + } + function i_(n, t) { + if (n < 0 || n >= t) throw hp(new Gp()); + } + function r_(n, t, e) { + return udn(), s3(n, t) && s3(n, e); + } + function c_(n) { + return Chn(), !n.Hc(pit) && !n.Hc(mit); + } + function a_(n) { + return new QS(n.c + n.b / 2, n.d + n.a / 2); + } + function u_(n, t) { + return t.kh() ? P8(n.b, Yx(t, 49)) : t; + } + function o_(n, t) { + (this.e = n), (this.d = 0 != (64 & t) ? t | MEn : t); + } + function s_(n, t) { + (this.c = 0), (this.d = n), (this.b = 64 | t | MEn); + } + function h_(n) { + (this.b = new pQ(11)), (this.a = (WH(), n)); + } + function f_(n) { + (this.b = null), (this.a = (WH(), n || IFn)); + } + function l_(n) { + (this.a = xen(n.a)), (this.b = new sx(n.b)); + } + function b_(n) { + (this.b = n), a$.call(this, n), FO(this); + } + function w_(n) { + (this.b = n), o$.call(this, n), BO(this); + } + function d_(n, t, e) { + (this.a = n), EN.call(this, t, e, 5, 6); + } + function g_(n, t, e, i) { + (this.b = n), XO.call(this, t, e, i); + } + function p_(n, t, e, i, r) { + kY.call(this, n, t, e, i, r, -1); + } + function v_(n, t, e, i, r) { + jY.call(this, n, t, e, i, r, -1); + } + function m_(n, t, e, i) { + XO.call(this, n, t, e), (this.b = i); + } + function y_(n, t, e, i) { + TD.call(this, n, t, e), (this.b = i); + } + function k_(n) { + WP.call(this, n, !1), (this.a = !1); + } + function j_(n, t) { + (this.b = n), ol.call(this, n.b), (this.a = t); + } + function E_(n, t) { + VF(), Jj.call(this, n, $8(new ay(t))); + } + function T_(n, t) { + return Ljn(), new rB(n, t, 0); + } + function M_(n, t) { + return Ljn(), new rB(6, n, t); + } + function S_(n, t) { + return _N(n.substr(0, t.length), t); + } + function P_(n, t) { + return aI(t) ? hq(n, t) : !!Dq(n.f, t); + } + function I_(n, t) { + for (vB(t); n.Ob(); ) t.td(n.Pb()); + } + function C_(n, t, e) { + bdn(), (this.e = n), (this.d = t), (this.a = e); + } + function O_(n, t, e, i) { + var r; + ((r = n.i).i = t), (r.a = e), (r.b = i); + } + function A_(n) { + var t; + for (t = n; t.f; ) t = t.f; + return t; + } + function $_(n) { + var t; + return S$(null != (t = T5(n))), t; + } + function L_(n) { + var t; + return ( + S$( + null != + (t = (function (n) { + var t; + return null == (t = n.a[(n.c - 1) & (n.a.length - 1)]) + ? null + : ((n.c = (n.c - 1) & (n.a.length - 1)), DF(n.a, n.c, null), t); + })(n)), + ), + t + ); + } + function N_(n, t) { + var e; + return qV(t, (e = n.a.gc())), e - t; + } + function x_(n, t) { + var e; + for (e = 0; e < t; ++e) n[e] = !1; + } + function D_(n, t, e, i) { + _6(t, e, n.length), + (function (n, t, e, i) { + var r; + for (r = t; r < e; ++r) n[r] = i; + })(n, t, e, i); + } + function R_(n, t, e) { + (this.c = n), (this.a = t), XH(), (this.b = e); + } + function K_(n, t, e) { + var i; + return (i = n.b[t]), (n.b[t] = e), i; + } + function __(n, t) { + return null == n.a.zc(t, n); + } + function F_(n) { + if (!n) throw hp(new Kp()); + return n.d; + } + function B_(n, t) { + if (null == n) throw hp(new Zm(t)); + } + function H_(n, t) { + return !!t && C2(n, t); + } + function q_(n, t, e) { + return ( + (function (n, t, e) { + if (t < 0) throw hp(new Hm(dLn + t)); + t < n.j.c.length ? QW(n.j, t, e) : (AX(n, t), eD(n.j, e)); + })(n, t.g, e), + n2(n.c, t), + n + ); + } + function G_(n) { + return ( + !n.j && + (function (n, t) { + n.j = t; + })( + n, + (function (n, t) { + var e, i, r, c, a, u, o; + if ((e = t.Hh(n.a)) && null != (o = lL(ynn((!e.b && (e.b = new z$((xjn(), Dat), out, e)), e.b), FRn)))) { + for (i = new ip(), a = 0, u = (c = Ogn(o, "\\w")).length; a < u; ++a) + _N((r = c[a]), "##other") + ? eD(i, "!##" + OK(n, i1(t.Hj()))) + : _N(r, "##local") + ? (i.c[i.c.length] = null) + : _N(r, KRn) + ? eD(i, OK(n, i1(t.Hj()))) + : (i.c[i.c.length] = r); + return i; + } + return XH(), XH(), TFn; + })(n.g, n.b), + ), + n.j + ); + } + function z_(n) { + M$(-1 != n.b), KV(n.c, (n.a = n.b)), (n.b = -1); + } + function U_(n) { + (n.f = new iC(n)), (n.g = new rC(n)), gq(n); + } + function X_(n) { + return new SR( + null, + (function (n, t) { + return ( + (function (n, t) { + if (0 > n || n > t) throw hp(new Py("fromIndex: 0, toIndex: " + n + MMn + t)); + })(t, n.length), + new qD(n, t) + ); + })(n, n.length), + ); + } + function W_(n) { + return new $K(new sA(n.a.length, n.a)); + } + function V_(n) { + return typeof n === Ujn || typeof n === Qjn; + } + function Q_(n, t) { + return k8(n, t) < 0 ? -1 : k8(n, t) > 0 ? 1 : 0; + } + function Y_(n, t, e) { + return jmn(n, Yx(t, 46), Yx(e, 167)); + } + function J_(n, t) { + return Yx(KK(DK(n.a)).Xb(t), 42).cd(); + } + function Z_(n, t) { + (this.d = n), UO.call(this, n), (this.e = t); + } + function nF(n) { + (this.d = (vB(n), n)), (this.a = 0), (this.c = IEn); + } + function tF(n, t) { + np.call(this, 1), (this.a = n), (this.b = t); + } + function eF(n, t) { + return n.c ? eF(n.c, t) : eD(n.b, t), n; + } + function iF(n, t, e) { + var i; + return (i = VJ(n, t)), ZX(n, t, e), i; + } + function rF(n, t) { + return aJ(n.slice(0, t), n); + } + function cF(n, t, e) { + var i; + for (i = 0; i < t; ++i) DF(n, i, e); + } + function aF(n, t, e, i, r) { + for (; t < e; ) i[r++] = XB(n, t++); + } + function uF(n, t) { + return null == S5(n.a, t, (TA(), $_n)); + } + function oF(n, t) { + VW(n.d, t, n.b.b, n.b), ++n.a, (n.c = null); + } + function sF(n, t) { + EO(n, CO(t, 153) ? t : Yx(t, 1937).gl()); + } + function hF(n, t) { + SE(fH(n.Oc(), new Yr()), new Jw(t)); + } + function fF(n, t, e, i, r) { + Man(n, Yx(_V(t.k, e), 15), e, i, r); + } + function lF(n) { + (n.s = NaN), (n.c = NaN), Dfn(n, n.e), Dfn(n, n.j); + } + function bF(n) { + (n.a = null), (n.e = null), U_(n.b), (n.d = 0), ++n.c; + } + function wF(n) { + return e.Math.abs(n.d.e - n.e.e) - n.a; + } + function dF(n) { + uN.call(this), (this.a = n), eD(n.a, this); + } + function gF(n, t) { + (this.d = (function (n) { + switch (n) { + case 0: + return new $v(); + case 1: + return new Ov(); + case 2: + return new Av(); + default: + throw hp(new $p()); + } + })(n)), + (this.c = t), + (this.a = 0.5 * t); + } + function pF() { + bW.call(this), (this.a = !0), (this.b = !0); + } + function vF(n) { + return (null == n.i && svn(n), n.i).length; + } + function mF(n) { + return CO(n, 99) && 0 != (Yx(n, 18).Bb & MNn); + } + function yF(n, t) { + ++n.j, + zan(n, n.i, t), + (function (n, t) { + var e, i, r, c; + (n.j = -1), + gC(n.e) + ? ((e = n.i), + (c = 0 != n.i), + NV(n, t), + (i = new yJ(n.e, 3, n.c, null, t, e, c)), + (r = t.Qk(n.e, n.c, null)), + (r = jan(n, t, r)) ? (r.Ei(i), r.Fi()) : K3(n.e, i)) + : (NV(n, t), (r = t.Qk(n.e, n.c, null)) && r.Fi()); + })(n, Yx(t, 332)); + } + function kF(n, t) { + return (t = n.nk(null, t)), aun(n, null, t); + } + function jF(n, t) { + return n.hi() && (t = OG(n, t)), n.Wh(t); + } + function EF(n, t, e) { + var i; + return e0(e, (i = TF(n, t))), i; + } + function TF(n, t) { + var e; + return ((e = new m5()).j = n), (e.d = t), e; + } + function MF(n) { + if (null == n) throw hp(new Np()); + return n; + } + function SF(n) { + return n.j || (n.j = new ll(n)); + } + function PF(n) { + return n.f || (n.f = new uA(n)); + } + function IF(n) { + return n.k || (n.k = new Vf(n)); + } + function CF(n) { + return n.k || (n.k = new Vf(n)); + } + function OF(n) { + return n.g || (n.g = new Wf(n)); + } + function AF(n) { + return n.d || (n.d = new tl(n)); + } + function $F(n) { + return MF(n), CO(n, 475) ? Yx(n, 475) : I7(n); + } + function LF(n) { + return CO(n, 607) ? n : new Vq(n); + } + function NF(n, t) { + return HU(t, n.c.b.c.gc()), new _j(n, t); + } + function xF(n, t, e) { + return Ljn(), new rU(n, t, e); + } + function DF(n, t, e) { + return ( + (function (n) { + if (!n) throw hp(new Op()); + })( + null == e || + (function (n, t) { + var e; + switch (QJ(n)) { + case 6: + return aI(t); + case 7: + return cI(t); + case 8: + return rI(t); + case 3: + return Array.isArray(t) && !((e = QJ(t)) >= 14 && e <= 16); + case 11: + return null != t && typeof t === Qjn; + case 12: + return null != t && (typeof t === Ujn || typeof t == Qjn); + case 0: + return Oen(t, n.__elementTypeId$); + case 2: + return V_(t) && !(t.im === C); + case 1: + return (V_(t) && !(t.im === C)) || Oen(t, n.__elementTypeId$); + default: + return !0; + } + })(n, e), + ), + (n[t] = e) + ); + } + function RF(n, t) { + var e; + return HU(t, (e = n.a.gc())), e - 1 - t; + } + function KF(n, t) { + return (n.a += String.fromCharCode(t)), n; + } + function _F(n, t) { + return (n.a += String.fromCharCode(t)), n; + } + function FF(n, t) { + for (vB(t); n.c < n.d; ) n.ze(t, n.c++); + } + function BF(n, t) { + return aI(t) ? aG(n, t) : eI(Dq(n.f, t)); + } + function HF(n) { + (this.b = new ip()), (this.a = new ip()), (this.c = n); + } + function qF(n) { + (this.c = new Pk()), (this.a = new ip()), (this.b = n); + } + function GF(n) { + uN.call(this), (this.a = new Pk()), (this.c = n); + } + function zF(n) { + if (null == n) throw hp(new Np()); + this.a = n; + } + function UF(n) { + qp(), + (this.b = new ip()), + (this.a = n), + (function (n, t) { + var e, i, r, c, a; + for (e = new $y(), a = !1, c = 0; c < t.length; c++) + if ((Lz(c, t.length), 32 != (i = t.charCodeAt(c)))) + a + ? 39 == i + ? c + 1 < t.length && (Lz(c + 1, t.length), 39 == t.charCodeAt(c + 1)) + ? ((e.a += String.fromCharCode(i)), ++c) + : (a = !1) + : (e.a += String.fromCharCode(i)) + : VI("GyMLdkHmsSEcDahKzZv", gun(i)) > 0 + ? (den(n, e, 0), (e.a += String.fromCharCode(i)), den(n, e, (r = htn(t, c))), (c += r - 1)) + : 39 == i + ? c + 1 < t.length && (Lz(c + 1, t.length), 39 == t.charCodeAt(c + 1)) + ? ((e.a += "'"), ++c) + : (a = !0) + : (e.a += String.fromCharCode(i)); + else + for (den(n, e, 0), e.a += " ", den(n, e, 0); c + 1 < t.length && (Lz(c + 1, t.length), 32 == t.charCodeAt(c + 1)); ) ++c; + den(n, e, 0), + (function (n) { + var t, e, i; + for (t = !1, i = n.b.c.length, e = 0; e < i; e++) + z5(Yx(TR(n.b, e), 434)) + ? !t && e + 1 < i && z5(Yx(TR(n.b, e + 1), 434)) && ((t = !0), (Yx(TR(n.b, e), 434).a = !0)) + : (t = !1); + })(n); + })(this, n); + } + function XF(n) { + (this.c = n), (this.a = new ME()), (this.b = new ME()); + } + function WF() { + (WF = O), (E_n = new El(!1)), (T_n = new El(!0)); + } + function VF() { + (VF = O), px(), (t_n = new Aq((XH(), XH(), TFn))); + } + function QF() { + (QF = O), px(), (h_n = new BT((XH(), XH(), SFn))); + } + function YF() { + var n; + (YF = O), + ST(), + (gat = fut + ? Yx(Hln((mT(), aat), hRn), 1939) + : (zI(i_n, new Is()), + zI(eat, new ts()), + zI(Zct, new ls()), + zI(rat, new Es()), + zI(iat, new Cs()), + zI(cat, new Os()), + zI(oat, new As()), + zI(sat, new $s()), + zI(ict, new Ls()), + zI(ect, new zo()), + zI(rct, new Uo()), + zI(Wrt, new Xo()), + zI(fat, new Wo()), + zI(cct, new Vo()), + zI(lat, new Qo()), + zI(bat, new Yo()), + zI(tat, new Jo()), + zI(nat, new Zo()), + zI(out, new ns()), + zI(hat, new es()), + zI(zat, new is()), + zI(D_n, new rs()), + zI(Gy(Yot, 1), new cs()), + zI(__n, new as()), + zI(B_n, new us()), + zI(N_n, new os()), + zI(est, new ss()), + zI(H_n, new hs()), + zI(jct, new fs()), + zI(xct, new bs()), + zI(Eut, new ws()), + zI(Xat, new ds()), + zI(q_n, new gs()), + zI(U_n, new ps()), + zI(XKn, new vs()), + zI(J_n, new ms()), + zI(VKn, new ys()), + zI(vut, new ks()), + zI(ist, new js()), + zI(nFn, new Ts()), + zI(fFn, new Ms()), + zI(Tct, new Ss()), + zI(rst, new Ps()), + (n = Yx(CO(aG((mT(), aat), hRn), 547) ? aG(aat, hRn) : new $B(), 547)), + (fut = !0), + (function (n) { + n.gb || + ((n.gb = !0), + (n.b = q3(n, 0)), + S2(n.b, 18), + P2(n.b, 19), + (n.a = q3(n, 1)), + S2(n.a, 1), + P2(n.a, 2), + P2(n.a, 3), + P2(n.a, 4), + P2(n.a, 5), + (n.o = q3(n, 2)), + S2(n.o, 8), + S2(n.o, 9), + P2(n.o, 10), + P2(n.o, 11), + P2(n.o, 12), + P2(n.o, 13), + P2(n.o, 14), + P2(n.o, 15), + P2(n.o, 16), + P2(n.o, 17), + P2(n.o, 18), + P2(n.o, 19), + P2(n.o, 20), + P2(n.o, 21), + P2(n.o, 22), + P2(n.o, 23), + NZ(n.o), + NZ(n.o), + NZ(n.o), + NZ(n.o), + NZ(n.o), + NZ(n.o), + NZ(n.o), + NZ(n.o), + NZ(n.o), + NZ(n.o), + (n.p = q3(n, 3)), + S2(n.p, 2), + S2(n.p, 3), + S2(n.p, 4), + S2(n.p, 5), + P2(n.p, 6), + P2(n.p, 7), + NZ(n.p), + NZ(n.p), + (n.q = q3(n, 4)), + S2(n.q, 8), + (n.v = q3(n, 5)), + P2(n.v, 9), + NZ(n.v), + NZ(n.v), + NZ(n.v), + (n.w = q3(n, 6)), + S2(n.w, 2), + S2(n.w, 3), + S2(n.w, 4), + P2(n.w, 5), + (n.B = q3(n, 7)), + P2(n.B, 1), + NZ(n.B), + NZ(n.B), + NZ(n.B), + (n.Q = q3(n, 8)), + P2(n.Q, 0), + NZ(n.Q), + (n.R = q3(n, 9)), + S2(n.R, 1), + (n.S = q3(n, 10)), + NZ(n.S), + NZ(n.S), + NZ(n.S), + NZ(n.S), + NZ(n.S), + NZ(n.S), + NZ(n.S), + NZ(n.S), + NZ(n.S), + NZ(n.S), + NZ(n.S), + NZ(n.S), + NZ(n.S), + NZ(n.S), + NZ(n.S), + (n.T = q3(n, 11)), + P2(n.T, 10), + P2(n.T, 11), + P2(n.T, 12), + P2(n.T, 13), + P2(n.T, 14), + NZ(n.T), + NZ(n.T), + (n.U = q3(n, 12)), + S2(n.U, 2), + S2(n.U, 3), + P2(n.U, 4), + P2(n.U, 5), + P2(n.U, 6), + P2(n.U, 7), + NZ(n.U), + (n.V = q3(n, 13)), + P2(n.V, 10), + (n.W = q3(n, 14)), + S2(n.W, 18), + S2(n.W, 19), + S2(n.W, 20), + P2(n.W, 21), + P2(n.W, 22), + P2(n.W, 23), + (n.bb = q3(n, 15)), + S2(n.bb, 10), + S2(n.bb, 11), + S2(n.bb, 12), + S2(n.bb, 13), + S2(n.bb, 14), + S2(n.bb, 15), + S2(n.bb, 16), + P2(n.bb, 17), + NZ(n.bb), + NZ(n.bb), + (n.eb = q3(n, 16)), + S2(n.eb, 2), + S2(n.eb, 3), + S2(n.eb, 4), + S2(n.eb, 5), + S2(n.eb, 6), + S2(n.eb, 7), + P2(n.eb, 8), + P2(n.eb, 9), + (n.ab = q3(n, 17)), + S2(n.ab, 0), + S2(n.ab, 1), + (n.H = q3(n, 18)), + P2(n.H, 0), + P2(n.H, 1), + P2(n.H, 2), + P2(n.H, 3), + P2(n.H, 4), + P2(n.H, 5), + NZ(n.H), + (n.db = q3(n, 19)), + P2(n.db, 2), + (n.c = G3(n, 20)), + (n.d = G3(n, 21)), + (n.e = G3(n, 22)), + (n.f = G3(n, 23)), + (n.i = G3(n, 24)), + (n.g = G3(n, 25)), + (n.j = G3(n, 26)), + (n.k = G3(n, 27)), + (n.n = G3(n, 28)), + (n.r = G3(n, 29)), + (n.s = G3(n, 30)), + (n.t = G3(n, 31)), + (n.u = G3(n, 32)), + (n.fb = G3(n, 33)), + (n.A = G3(n, 34)), + (n.C = G3(n, 35)), + (n.D = G3(n, 36)), + (n.F = G3(n, 37)), + (n.G = G3(n, 38)), + (n.I = G3(n, 39)), + (n.J = G3(n, 40)), + (n.L = G3(n, 41)), + (n.M = G3(n, 42)), + (n.N = G3(n, 43)), + (n.O = G3(n, 44)), + (n.P = G3(n, 45)), + (n.X = G3(n, 46)), + (n.Y = G3(n, 47)), + (n.Z = G3(n, 48)), + (n.$ = G3(n, 49)), + (n._ = G3(n, 50)), + (n.cb = G3(n, 51)), + (n.K = G3(n, 52))); + })(n), + (function (n) { + var t, e, i, r, c, a, u; + n.hb || + ((n.hb = !0), + E2(n, "ecore"), + T2(n, "ecore"), + M2(n, hRn), + g4(n.fb, "E"), + g4(n.L, "T"), + g4(n.P, "K"), + g4(n.P, "V"), + g4(n.cb, "E"), + fY(Iq(n.b), n.bb), + fY(Iq(n.a), n.Q), + fY(Iq(n.o), n.p), + fY(Iq(n.p), n.R), + fY(Iq(n.q), n.p), + fY(Iq(n.v), n.q), + fY(Iq(n.w), n.R), + fY(Iq(n.B), n.Q), + fY(Iq(n.R), n.Q), + fY(Iq(n.T), n.eb), + fY(Iq(n.U), n.R), + fY(Iq(n.V), n.eb), + fY(Iq(n.W), n.bb), + fY(Iq(n.bb), n.eb), + fY(Iq(n.eb), n.R), + fY(Iq(n.db), n.R), + TU(n.b, eat, PDn, !1, !1, !0), + z2(Yx(c1(aq(n.b), 0), 34), n.e, "iD", null, 0, 1, eat, !1, !1, !0, !1, !0, !1), + Prn(Yx(c1(aq(n.b), 1), 18), n.q, null, "eAttributeType", 1, 1, eat, !0, !0, !1, !1, !0, !1, !0), + TU(n.a, Zct, TDn, !1, !1, !0), + z2(Yx(c1(aq(n.a), 0), 34), n._, _Nn, null, 0, 1, Zct, !1, !1, !0, !1, !0, !1), + Prn(Yx(c1(aq(n.a), 1), 18), n.ab, null, "details", 0, -1, Zct, !1, !1, !0, !0, !1, !1, !1), + Prn(Yx(c1(aq(n.a), 2), 18), n.Q, Yx(c1(aq(n.Q), 0), 18), "eModelElement", 0, 1, Zct, !0, !1, !0, !1, !1, !1, !1), + Prn(Yx(c1(aq(n.a), 3), 18), n.S, null, "contents", 0, -1, Zct, !1, !1, !0, !0, !1, !1, !1), + Prn(Yx(c1(aq(n.a), 4), 18), n.S, null, "references", 0, -1, Zct, !1, !1, !0, !1, !0, !1, !1), + TU(n.o, rat, "EClass", !1, !1, !0), + z2(Yx(c1(aq(n.o), 0), 34), n.e, "abstract", null, 0, 1, rat, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.o), 1), 34), n.e, "interface", null, 0, 1, rat, !1, !1, !0, !1, !0, !1), + Prn(Yx(c1(aq(n.o), 2), 18), n.o, null, "eSuperTypes", 0, -1, rat, !1, !1, !0, !1, !0, !0, !1), + Prn(Yx(c1(aq(n.o), 3), 18), n.T, Yx(c1(aq(n.T), 0), 18), "eOperations", 0, -1, rat, !1, !1, !0, !0, !1, !1, !1), + Prn(Yx(c1(aq(n.o), 4), 18), n.b, null, "eAllAttributes", 0, -1, rat, !0, !0, !1, !1, !0, !1, !0), + Prn(Yx(c1(aq(n.o), 5), 18), n.W, null, "eAllReferences", 0, -1, rat, !0, !0, !1, !1, !0, !1, !0), + Prn(Yx(c1(aq(n.o), 6), 18), n.W, null, "eReferences", 0, -1, rat, !0, !0, !1, !1, !0, !1, !0), + Prn(Yx(c1(aq(n.o), 7), 18), n.b, null, "eAttributes", 0, -1, rat, !0, !0, !1, !1, !0, !1, !0), + Prn(Yx(c1(aq(n.o), 8), 18), n.W, null, "eAllContainments", 0, -1, rat, !0, !0, !1, !1, !0, !1, !0), + Prn(Yx(c1(aq(n.o), 9), 18), n.T, null, "eAllOperations", 0, -1, rat, !0, !0, !1, !1, !0, !1, !0), + Prn(Yx(c1(aq(n.o), 10), 18), n.bb, null, "eAllStructuralFeatures", 0, -1, rat, !0, !0, !1, !1, !0, !1, !0), + Prn(Yx(c1(aq(n.o), 11), 18), n.o, null, "eAllSuperTypes", 0, -1, rat, !0, !0, !1, !1, !0, !1, !0), + Prn(Yx(c1(aq(n.o), 12), 18), n.b, null, "eIDAttribute", 0, 1, rat, !0, !0, !1, !1, !1, !1, !0), + Prn( + Yx(c1(aq(n.o), 13), 18), + n.bb, + Yx(c1(aq(n.bb), 7), 18), + "eStructuralFeatures", + 0, + -1, + rat, + !1, + !1, + !0, + !0, + !1, + !1, + !1, + ), + Prn(Yx(c1(aq(n.o), 14), 18), n.H, null, "eGenericSuperTypes", 0, -1, rat, !1, !1, !0, !0, !1, !0, !1), + Prn(Yx(c1(aq(n.o), 15), 18), n.H, null, "eAllGenericSuperTypes", 0, -1, rat, !0, !0, !1, !1, !0, !1, !0), + Crn((u = d0(Yx(c1(cq(n.o), 0), 59), n.e, "isSuperTypeOf")), n.o, "someClass"), + d0(Yx(c1(cq(n.o), 1), 59), n.I, "getFeatureCount"), + Crn((u = d0(Yx(c1(cq(n.o), 2), 59), n.bb, wRn)), n.I, "featureID"), + Crn((u = d0(Yx(c1(cq(n.o), 3), 59), n.I, dRn)), n.bb, gRn), + Crn((u = d0(Yx(c1(cq(n.o), 4), 59), n.bb, wRn)), n._, "featureName"), + d0(Yx(c1(cq(n.o), 5), 59), n.I, "getOperationCount"), + Crn((u = d0(Yx(c1(cq(n.o), 6), 59), n.T, "getEOperation")), n.I, "operationID"), + Crn((u = d0(Yx(c1(cq(n.o), 7), 59), n.I, pRn)), n.T, vRn), + Crn((u = d0(Yx(c1(cq(n.o), 8), 59), n.T, "getOverride")), n.T, vRn), + Crn((u = d0(Yx(c1(cq(n.o), 9), 59), n.H, "getFeatureType")), n.bb, gRn), + TU(n.p, iat, IDn, !0, !1, !0), + z2(Yx(c1(aq(n.p), 0), 34), n._, "instanceClassName", null, 0, 1, iat, !1, !0, !0, !0, !0, !1), + (t = SH(n.L)), + (e = KU()), + fY((!t.d && (t.d = new XO(hat, t, 1)), t.d), e), + Pfn(Yx(c1(aq(n.p), 1), 34), t, "instanceClass", iat, !0, !0, !1, !0), + z2(Yx(c1(aq(n.p), 2), 34), n.M, mRn, null, 0, 1, iat, !0, !0, !1, !1, !0, !0), + z2(Yx(c1(aq(n.p), 3), 34), n._, "instanceTypeName", null, 0, 1, iat, !1, !0, !0, !0, !0, !1), + Prn(Yx(c1(aq(n.p), 4), 18), n.U, Yx(c1(aq(n.U), 3), 18), "ePackage", 0, 1, iat, !0, !1, !1, !1, !0, !1, !1), + Prn(Yx(c1(aq(n.p), 5), 18), n.db, null, yRn, 0, -1, iat, !1, !1, !0, !0, !0, !1, !1), + Crn((u = d0(Yx(c1(cq(n.p), 0), 59), n.e, kRn)), n.M, Ujn), + d0(Yx(c1(cq(n.p), 1), 59), n.I, "getClassifierID"), + TU(n.q, cat, "EDataType", !1, !1, !0), + z2(Yx(c1(aq(n.q), 0), 34), n.e, "serializable", kLn, 0, 1, cat, !1, !1, !0, !1, !0, !1), + TU(n.v, oat, "EEnum", !1, !1, !0), + Prn(Yx(c1(aq(n.v), 0), 18), n.w, Yx(c1(aq(n.w), 3), 18), "eLiterals", 0, -1, oat, !1, !1, !0, !0, !1, !1, !1), + Crn((u = d0(Yx(c1(cq(n.v), 0), 59), n.w, jRn)), n._, gxn), + Crn((u = d0(Yx(c1(cq(n.v), 1), 59), n.w, jRn)), n.I, KNn), + Crn((u = d0(Yx(c1(cq(n.v), 2), 59), n.w, "getEEnumLiteralByLiteral")), n._, "literal"), + TU(n.w, sat, CDn, !1, !1, !0), + z2(Yx(c1(aq(n.w), 0), 34), n.I, KNn, null, 0, 1, sat, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.w), 1), 34), n.A, "instance", null, 0, 1, sat, !0, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.w), 2), 34), n._, "literal", null, 0, 1, sat, !1, !1, !0, !1, !0, !1), + Prn(Yx(c1(aq(n.w), 3), 18), n.v, Yx(c1(aq(n.v), 0), 18), "eEnum", 0, 1, sat, !0, !1, !1, !1, !1, !1, !1), + TU(n.B, ict, "EFactory", !1, !1, !0), + Prn(Yx(c1(aq(n.B), 0), 18), n.U, Yx(c1(aq(n.U), 2), 18), "ePackage", 1, 1, ict, !0, !1, !0, !1, !1, !1, !1), + Crn((u = d0(Yx(c1(cq(n.B), 0), 59), n.S, "create")), n.o, "eClass"), + Crn((u = d0(Yx(c1(cq(n.B), 1), 59), n.M, "createFromString")), n.q, "eDataType"), + Crn(u, n._, "literalValue"), + Crn((u = d0(Yx(c1(cq(n.B), 2), 59), n._, "convertToString")), n.q, "eDataType"), + Crn(u, n.M, "instanceValue"), + TU(n.Q, ect, lNn, !0, !1, !0), + Prn(Yx(c1(aq(n.Q), 0), 18), n.a, Yx(c1(aq(n.a), 2), 18), "eAnnotations", 0, -1, ect, !1, !1, !0, !0, !1, !1, !1), + Crn((u = d0(Yx(c1(cq(n.Q), 0), 59), n.a, "getEAnnotation")), n._, _Nn), + TU(n.R, rct, bNn, !0, !1, !0), + z2(Yx(c1(aq(n.R), 0), 34), n._, gxn, null, 0, 1, rct, !1, !1, !0, !1, !0, !1), + TU(n.S, Wrt, "EObject", !1, !1, !0), + d0(Yx(c1(cq(n.S), 0), 59), n.o, "eClass"), + d0(Yx(c1(cq(n.S), 1), 59), n.e, "eIsProxy"), + d0(Yx(c1(cq(n.S), 2), 59), n.X, "eResource"), + d0(Yx(c1(cq(n.S), 3), 59), n.S, "eContainer"), + d0(Yx(c1(cq(n.S), 4), 59), n.bb, "eContainingFeature"), + d0(Yx(c1(cq(n.S), 5), 59), n.W, "eContainmentFeature"), + (u = d0(Yx(c1(cq(n.S), 6), 59), null, "eContents")), + (t = SH(n.fb)), + (e = SH(n.S)), + fY((!t.d && (t.d = new XO(hat, t, 1)), t.d), e), + (r = fun(u, t, null)) && r.Fi(), + (u = d0(Yx(c1(cq(n.S), 7), 59), null, "eAllContents")), + (t = SH(n.cb)), + (e = SH(n.S)), + fY((!t.d && (t.d = new XO(hat, t, 1)), t.d), e), + (c = fun(u, t, null)) && c.Fi(), + (u = d0(Yx(c1(cq(n.S), 8), 59), null, "eCrossReferences")), + (t = SH(n.fb)), + (e = SH(n.S)), + fY((!t.d && (t.d = new XO(hat, t, 1)), t.d), e), + (a = fun(u, t, null)) && a.Fi(), + Crn((u = d0(Yx(c1(cq(n.S), 9), 59), n.M, "eGet")), n.bb, gRn), + Crn((u = d0(Yx(c1(cq(n.S), 10), 59), n.M, "eGet")), n.bb, gRn), + Crn(u, n.e, "resolve"), + Crn((u = d0(Yx(c1(cq(n.S), 11), 59), null, "eSet")), n.bb, gRn), + Crn(u, n.M, "newValue"), + Crn((u = d0(Yx(c1(cq(n.S), 12), 59), n.e, "eIsSet")), n.bb, gRn), + Crn((u = d0(Yx(c1(cq(n.S), 13), 59), null, "eUnset")), n.bb, gRn), + Crn((u = d0(Yx(c1(cq(n.S), 14), 59), n.M, "eInvoke")), n.T, vRn), + (t = SH(n.fb)), + (e = KU()), + fY((!t.d && (t.d = new XO(hat, t, 1)), t.d), e), + Ycn(u, t, "arguments"), + (function (n, t) { + fY((!n.a && (n.a = new GL(n, n)), n.a), t); + })(u, n.K), + TU(n.T, fat, ADn, !1, !1, !0), + Prn(Yx(c1(aq(n.T), 0), 18), n.o, Yx(c1(aq(n.o), 3), 18), ERn, 0, 1, fat, !0, !1, !1, !1, !1, !1, !1), + Prn(Yx(c1(aq(n.T), 1), 18), n.db, null, yRn, 0, -1, fat, !1, !1, !0, !0, !0, !1, !1), + Prn(Yx(c1(aq(n.T), 2), 18), n.V, Yx(c1(aq(n.V), 0), 18), "eParameters", 0, -1, fat, !1, !1, !0, !0, !1, !1, !1), + Prn(Yx(c1(aq(n.T), 3), 18), n.p, null, "eExceptions", 0, -1, fat, !1, !1, !0, !1, !0, !0, !1), + Prn(Yx(c1(aq(n.T), 4), 18), n.H, null, "eGenericExceptions", 0, -1, fat, !1, !1, !0, !0, !1, !0, !1), + d0(Yx(c1(cq(n.T), 0), 59), n.I, pRn), + Crn((u = d0(Yx(c1(cq(n.T), 1), 59), n.e, "isOverrideOf")), n.T, "someOperation"), + TU(n.U, cct, "EPackage", !1, !1, !0), + z2(Yx(c1(aq(n.U), 0), 34), n._, "nsURI", null, 0, 1, cct, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.U), 1), 34), n._, "nsPrefix", null, 0, 1, cct, !1, !1, !0, !1, !0, !1), + Prn(Yx(c1(aq(n.U), 2), 18), n.B, Yx(c1(aq(n.B), 0), 18), "eFactoryInstance", 1, 1, cct, !0, !1, !0, !1, !1, !1, !1), + Prn(Yx(c1(aq(n.U), 3), 18), n.p, Yx(c1(aq(n.p), 4), 18), "eClassifiers", 0, -1, cct, !1, !1, !0, !0, !0, !1, !1), + Prn(Yx(c1(aq(n.U), 4), 18), n.U, Yx(c1(aq(n.U), 5), 18), "eSubpackages", 0, -1, cct, !1, !1, !0, !0, !0, !1, !1), + Prn(Yx(c1(aq(n.U), 5), 18), n.U, Yx(c1(aq(n.U), 4), 18), "eSuperPackage", 0, 1, cct, !0, !1, !1, !1, !0, !1, !1), + Crn((u = d0(Yx(c1(cq(n.U), 0), 59), n.p, "getEClassifier")), n._, gxn), + TU(n.V, lat, $Dn, !1, !1, !0), + Prn(Yx(c1(aq(n.V), 0), 18), n.T, Yx(c1(aq(n.T), 2), 18), "eOperation", 0, 1, lat, !0, !1, !1, !1, !1, !1, !1), + TU(n.W, bat, LDn, !1, !1, !0), + z2(Yx(c1(aq(n.W), 0), 34), n.e, "containment", null, 0, 1, bat, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.W), 1), 34), n.e, "container", null, 0, 1, bat, !0, !0, !1, !1, !0, !0), + z2(Yx(c1(aq(n.W), 2), 34), n.e, "resolveProxies", kLn, 0, 1, bat, !1, !1, !0, !1, !0, !1), + Prn(Yx(c1(aq(n.W), 3), 18), n.W, null, "eOpposite", 0, 1, bat, !1, !1, !0, !1, !0, !1, !1), + Prn(Yx(c1(aq(n.W), 4), 18), n.o, null, "eReferenceType", 1, 1, bat, !0, !0, !1, !1, !0, !1, !0), + Prn(Yx(c1(aq(n.W), 5), 18), n.b, null, "eKeys", 0, -1, bat, !1, !1, !0, !1, !0, !1, !1), + TU(n.bb, tat, SDn, !0, !1, !0), + z2(Yx(c1(aq(n.bb), 0), 34), n.e, "changeable", kLn, 0, 1, tat, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.bb), 1), 34), n.e, "volatile", null, 0, 1, tat, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.bb), 2), 34), n.e, "transient", null, 0, 1, tat, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.bb), 3), 34), n._, "defaultValueLiteral", null, 0, 1, tat, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.bb), 4), 34), n.M, mRn, null, 0, 1, tat, !0, !0, !1, !1, !0, !0), + z2(Yx(c1(aq(n.bb), 5), 34), n.e, "unsettable", null, 0, 1, tat, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.bb), 6), 34), n.e, "derived", null, 0, 1, tat, !1, !1, !0, !1, !0, !1), + Prn(Yx(c1(aq(n.bb), 7), 18), n.o, Yx(c1(aq(n.o), 13), 18), ERn, 0, 1, tat, !0, !1, !1, !1, !1, !1, !1), + d0(Yx(c1(cq(n.bb), 0), 59), n.I, dRn), + (u = d0(Yx(c1(cq(n.bb), 1), 59), null, "getContainerClass")), + (t = SH(n.L)), + (e = KU()), + fY((!t.d && (t.d = new XO(hat, t, 1)), t.d), e), + (i = fun(u, t, null)) && i.Fi(), + TU(n.eb, nat, MDn, !0, !1, !0), + z2(Yx(c1(aq(n.eb), 0), 34), n.e, "ordered", kLn, 0, 1, nat, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.eb), 1), 34), n.e, "unique", kLn, 0, 1, nat, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.eb), 2), 34), n.I, "lowerBound", null, 0, 1, nat, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.eb), 3), 34), n.I, "upperBound", "1", 0, 1, nat, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.eb), 4), 34), n.e, "many", null, 0, 1, nat, !0, !0, !1, !1, !0, !0), + z2(Yx(c1(aq(n.eb), 5), 34), n.e, "required", null, 0, 1, nat, !0, !0, !1, !1, !0, !0), + Prn(Yx(c1(aq(n.eb), 6), 18), n.p, null, "eType", 0, 1, nat, !1, !0, !0, !1, !0, !0, !1), + Prn(Yx(c1(aq(n.eb), 7), 18), n.H, null, "eGenericType", 0, 1, nat, !1, !0, !0, !0, !1, !0, !1), + TU(n.ab, i_n, "EStringToStringMapEntry", !1, !1, !1), + z2(Yx(c1(aq(n.ab), 0), 34), n._, "key", null, 0, 1, i_n, !1, !1, !0, !1, !0, !1), + z2(Yx(c1(aq(n.ab), 1), 34), n._, KNn, null, 0, 1, i_n, !1, !1, !0, !1, !0, !1), + TU(n.H, hat, ODn, !1, !1, !0), + Prn(Yx(c1(aq(n.H), 0), 18), n.H, null, "eUpperBound", 0, 1, hat, !1, !1, !0, !0, !1, !1, !1), + Prn(Yx(c1(aq(n.H), 1), 18), n.H, null, "eTypeArguments", 0, -1, hat, !1, !1, !0, !0, !1, !1, !1), + Prn(Yx(c1(aq(n.H), 2), 18), n.p, null, "eRawType", 1, 1, hat, !0, !1, !1, !1, !0, !1, !0), + Prn(Yx(c1(aq(n.H), 3), 18), n.H, null, "eLowerBound", 0, 1, hat, !1, !1, !0, !0, !1, !1, !1), + Prn(Yx(c1(aq(n.H), 4), 18), n.db, null, "eTypeParameter", 0, 1, hat, !1, !1, !0, !1, !1, !1, !1), + Prn(Yx(c1(aq(n.H), 5), 18), n.p, null, "eClassifier", 0, 1, hat, !1, !1, !0, !1, !0, !1, !1), + Crn((u = d0(Yx(c1(cq(n.H), 0), 59), n.e, kRn)), n.M, Ujn), + TU(n.db, zat, NDn, !1, !1, !0), + Prn(Yx(c1(aq(n.db), 0), 18), n.H, null, "eBounds", 0, -1, zat, !1, !1, !0, !0, !1, !1, !1), + YB(n.c, vFn, "EBigDecimal", !0), + YB(n.d, EFn, "EBigInteger", !0), + YB(n.e, Vot, "EBoolean", !0), + YB(n.f, D_n, "EBooleanObject", !0), + YB(n.i, Yot, "EByte", !0), + YB(n.g, Gy(Yot, 1), "EByteArray", !0), + YB(n.j, __n, "EByteObject", !0), + YB(n.k, Xot, "EChar", !0), + YB(n.n, B_n, "ECharacterObject", !0), + YB(n.r, N_n, "EDate", !0), + YB(n.s, est, "EDiagnosticChain", !1), + YB(n.t, Jot, "EDouble", !0), + YB(n.u, H_n, "EDoubleObject", !0), + YB(n.fb, jct, "EEList", !1), + YB(n.A, xct, "EEnumerator", !1), + YB(n.C, Eut, "EFeatureMap", !1), + YB(n.D, Xat, "EFeatureMapEntry", !1), + YB(n.F, Zot, "EFloat", !0), + YB(n.G, q_n, "EFloatObject", !0), + YB(n.I, Wot, "EInt", !0), + YB(n.J, U_n, "EIntegerObject", !0), + YB(n.L, XKn, "EJavaClass", !0), + YB(n.M, UKn, "EJavaObject", !0), + YB(n.N, Qot, "ELong", !0), + YB(n.O, J_n, "ELongObject", !0), + YB(n.P, VKn, "EMap", !1), + YB(n.X, vut, "EResource", !1), + YB(n.Y, ist, "EResourceSet", !1), + YB(n.Z, nst, "EShort", !0), + YB(n.$, nFn, "EShortObject", !0), + YB(n._, fFn, "EString", !0), + YB(n.cb, Tct, "ETreeIterator", !1), + YB(n.K, rst, "EInvocationTargetException", !1), + s8(n, hRn)); + })(n), + xB((yT(), wat), n, new Go()), + GG(aat, hRn, n), + n)), + xjn(), + vat && + (function () { + var n; + for ( + ST(), + (function (n) { + Zln(n.c, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "http://www.w3.org/2001/XMLSchema#decimal"])), + Zln(n.d, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "http://www.w3.org/2001/XMLSchema#integer"])), + Zln(n.e, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "http://www.w3.org/2001/XMLSchema#boolean"])), + Zln(n.f, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "EBoolean", gxn, "EBoolean:Object"])), + Zln(n.i, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "http://www.w3.org/2001/XMLSchema#byte"])), + Zln(n.g, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "http://www.w3.org/2001/XMLSchema#hexBinary"])), + Zln(n.j, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "EByte", gxn, "EByte:Object"])), + Zln(n.n, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "EChar", gxn, "EChar:Object"])), + Zln(n.t, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "http://www.w3.org/2001/XMLSchema#double"])), + Zln(n.u, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "EDouble", gxn, "EDouble:Object"])), + Zln(n.F, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "http://www.w3.org/2001/XMLSchema#float"])), + Zln(n.G, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "EFloat", gxn, "EFloat:Object"])), + Zln(n.I, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "http://www.w3.org/2001/XMLSchema#int"])), + Zln(n.J, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "EInt", gxn, "EInt:Object"])), + Zln(n.N, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "http://www.w3.org/2001/XMLSchema#long"])), + Zln(n.O, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "ELong", gxn, "ELong:Object"])), + Zln(n.Z, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "http://www.w3.org/2001/XMLSchema#short"])), + Zln(n.$, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "EShort", gxn, "EShort:Object"])), + Zln(n._, nRn, x4(Gy(fFn, 1), TEn, 2, 6, [bRn, "http://www.w3.org/2001/XMLSchema#string"])); + })((YF(), gat)), + (function (n) { + Zln(n.b, hRn, x4(Gy(fFn, 1), TEn, 2, 6, [lRn, "ConsistentTransient"])), + Zln(n.a, hRn, x4(Gy(fFn, 1), TEn, 2, 6, [lRn, "WellFormedSourceURI"])), + Zln( + n.o, + hRn, + x4(Gy(fFn, 1), TEn, 2, 6, [ + lRn, + "InterfaceIsAbstract AtMostOneID UniqueFeatureNames UniqueOperationSignatures NoCircularSuperTypes WellFormedMapEntryClass ConsistentSuperTypes DisjointFeatureAndOperationSignatures", + ]), + ), + Zln(n.p, hRn, x4(Gy(fFn, 1), TEn, 2, 6, [lRn, "WellFormedInstanceTypeName UniqueTypeParameterNames"])), + Zln(n.v, hRn, x4(Gy(fFn, 1), TEn, 2, 6, [lRn, "UniqueEnumeratorNames UniqueEnumeratorLiterals"])), + Zln(n.R, hRn, x4(Gy(fFn, 1), TEn, 2, 6, [lRn, "WellFormedName"])), + Zln(n.T, hRn, x4(Gy(fFn, 1), TEn, 2, 6, [lRn, "UniqueParameterNames UniqueTypeParameterNames NoRepeatingVoid"])), + Zln( + n.U, + hRn, + x4(Gy(fFn, 1), TEn, 2, 6, [ + lRn, + "WellFormedNsURI WellFormedNsPrefix UniqueSubpackageNames UniqueClassifierNames UniqueNsURIs", + ]), + ), + Zln( + n.W, + hRn, + x4(Gy(fFn, 1), TEn, 2, 6, [ + lRn, + "ConsistentOpposite SingleContainer ConsistentKeys ConsistentUnique ConsistentContainer", + ]), + ), + Zln(n.bb, hRn, x4(Gy(fFn, 1), TEn, 2, 6, [lRn, "ValidDefaultValueLiteral"])), + Zln(n.eb, hRn, x4(Gy(fFn, 1), TEn, 2, 6, [lRn, "ValidLowerBound ValidUpperBound ConsistentBounds ValidType"])), + Zln(n.H, hRn, x4(Gy(fFn, 1), TEn, 2, 6, [lRn, "ConsistentType ConsistentBounds ConsistentArguments"])); + })(gat), + Srn(gat), + xjn(), + Wat = Pat, + n = new pb(hut); + n.a < n.c.c.length; + + ) + zyn(Yx(Hz(n), 241), Pat, null); + })(); + } + function JF(n, t, e, i) { + return 0 == e || (e - i) / e < n.e || t >= n.g; + } + function ZF(n, t, e) { + return tgn(n, h2(n, t, e)); + } + function nB(n, t) { + var e; + VJ(n, (e = n.a.length)), ZX(n, e, t); + } + function tB(n, t) { + console[n].call(console, t); + } + function eB(n, t) { + var e; + ++n.j, (e = n.Vi()), n.Ii(n.oi(e, t)); + } + function iB(n, t, e) { + zg.call(this, t), (this.a = n), (this.b = e); + } + function rB(n, t, e) { + np.call(this, n), (this.a = t), (this.b = e); + } + function cB(n, t, e) { + (this.a = n), Gg.call(this, t), (this.b = e); + } + function aB(n, t, e) { + (this.a = n), lX.call(this, 8, t, null, e); + } + function uB(n) { + (this.a = (vB(nRn), nRn)), (this.b = n), new Xv(); + } + function oB(n) { + (this.c = n), (this.b = this.c.a), (this.a = this.c.e); + } + function sB(n) { + (this.c = n), (this.b = n.a.d.a), tL(n.a.e, this); + } + function hB(n) { + M$(-1 != n.c), n.d.$c(n.c), (n.b = n.c), (n.c = -1); + } + function fB(n) { + return e.Math.sqrt(n.a * n.a + n.b * n.b); + } + function lB(n, t) { + return i_(t, n.a.c.length), TR(n.a, t); + } + function bB(n, t) { + return iI(n) === iI(t) || (null != n && Q8(n, t)); + } + function wB(n) { + return n ? n.dc() : !n.Kc().Ob(); + } + function dB(n) { + return !n.a && n.c ? n.c.b : n.a; + } + function gB(n) { + return !n.a && (n.a = new XO(Wrt, n, 4)), n.a; + } + function pB(n) { + return !n.d && (n.d = new XO(hat, n, 1)), n.d; + } + function vB(n) { + if (null == n) throw hp(new Np()); + return n; + } + function mB(n) { + n.c + ? n.c.He() + : ((n.d = !0), + (function (n) { + var t, e, i, r, c; + if (((c = new ip()), WZ(n.b, new Gb(c)), (n.b.c = VQ(UKn, iEn, 1, 0, 5, 1)), 0 != c.c.length)) { + for ($z(0, c.c.length), t = Yx(c.c[0], 78), e = 1, i = c.c.length; e < i; ++e) + $z(e, c.c.length), (r = Yx(c.c[e], 78)) != t && bun(t, r); + if (CO(t, 60)) throw hp(Yx(t, 60)); + if (CO(t, 289)) throw hp(Yx(t, 289)); + } + })(n)); + } + function yB(n) { + n.c ? yB(n.c) : (W9(n), (n.d = !0)); + } + function kB(n) { + iH(n.a), (n.b = VQ(UKn, iEn, 1, n.b.length, 5, 1)); + } + function jB(n) { + return n.c.i.c == n.d.i.c; + } + function EB(n) { + return !n.b && (n.b = new Xg(new Wv())), n.b; + } + function TB(n) { + return ( + -2 == n.c && + (function (n, t) { + n.c = t; + })( + n, + (function (n, t) { + var e, i, r; + if ((e = t.Hh(n.a)) && null != (r = ynn((!e.b && (e.b = new z$((xjn(), Dat), out, e)), e.b), tRn))) + for (i = 1; i < (wsn(), but).length; ++i) if (_N(but[i], r)) return i; + return 0; + })(n.g, n.b), + ), + n.c + ); + } + function MB(n, t) { + var e; + return ((e = TF("", n)).n = t), (e.i = 1), e; + } + function SB(n, t) { + (this.b = n), Z_.call(this, n, t), FO(this); + } + function PB(n, t) { + (this.b = n), WN.call(this, n, t), BO(this); + } + function IB(n, t, e, i) { + Wj.call(this, n, t), (this.d = e), (this.a = i); + } + function CB(n, t, e, i) { + Wj.call(this, n, e), (this.a = t), (this.f = i); + } + function OB(n, t) { + kO.call( + this, + (function (n, t) { + var e; + return XH(), (e = new kE(1)), aI(n) ? GG(e, n, t) : Ysn(e.f, n, t), new gb(e); + })(MF(n), MF(t)), + ), + (this.a = t); + } + function AB() { + var n; + Iun.call(this, BRn, (Kk(), Out)), + ((n = this).b = null), + (n.bb = null), + (n.fb = null), + (n.qb = null), + (n.a = null), + (n.c = null), + (n.d = null), + (n.e = null), + (n.f = null), + (n.n = null), + (n.M = null), + (n.L = null), + (n.Q = null), + (n.R = null), + (n.K = null), + (n.db = null), + (n.eb = null), + (n.g = null), + (n.i = null), + (n.j = null), + (n.k = null), + (n.gb = null), + (n.o = null), + (n.p = null), + (n.q = null), + (n.r = null), + (n.$ = null), + (n.ib = null), + (n.S = null), + (n.T = null), + (n.t = null), + (n.s = null), + (n.u = null), + (n.v = null), + (n.w = null), + (n.B = null), + (n.A = null), + (n.C = null), + (n.D = null), + (n.F = null), + (n.G = null), + (n.H = null), + (n.I = null), + (n.J = null), + (n.P = null), + (n.Z = null), + (n.U = null), + (n.V = null), + (n.W = null), + (n.X = null), + (n.Y = null), + (n._ = null), + (n.ab = null), + (n.cb = null), + (n.hb = null), + (n.nb = null), + (n.lb = null), + (n.mb = null), + (n.ob = null), + (n.pb = null), + (n.jb = null), + (n.kb = null), + (n.N = !1), + (n.O = !1); + } + function $B() { + var n; + Iun.call(this, hRn, (Rk(), dat)), + ((n = this).b = null), + (n.a = null), + (n.o = null), + (n.q = null), + (n.v = null), + (n.w = null), + (n.B = null), + (n.p = null), + (n.Q = null), + (n.R = null), + (n.S = null), + (n.T = null), + (n.U = null), + (n.V = null), + (n.W = null), + (n.bb = null), + (n.eb = null), + (n.ab = null), + (n.H = null), + (n.db = null), + (n.c = null), + (n.d = null), + (n.f = null), + (n.n = null), + (n.r = null), + (n.s = null), + (n.u = null), + (n.G = null), + (n.J = null), + (n.e = null), + (n.j = null), + (n.i = null), + (n.g = null), + (n.k = null), + (n.t = null), + (n.F = null), + (n.I = null), + (n.L = null), + (n.M = null), + (n.O = null), + (n.P = null), + (n.$ = null), + (n.N = null), + (n.Z = null), + (n.cb = null), + (n.K = null), + (n.D = null), + (n.A = null), + (n.C = null), + (n._ = null), + (n.fb = null), + (n.X = null), + (n.Y = null), + (n.gb = !1), + (n.hb = !1); + } + function LB() { + Uj.call(this, "DELAUNAY_TRIANGULATION", 0); + } + function NB(n) { + return String.fromCharCode.apply(null, n); + } + function xB(n, t, e) { + return aI(t) ? GG(n, t, e) : Ysn(n.f, t, e); + } + function DB(n) { + return XH(), n ? n.ve() : (WH(), WH(), OFn); + } + function RB(n, t) { + return JD(), new _en(new vA(n), new pA(t)); + } + function KB() { + (KB = O), (e_n = new Em(x4(Gy(i_n, 1), DEn, 42, 0, []))); + } + function _B(n) { + return !n.d && (n.d = new fb(n.c.Cc())), n.d; + } + function FB(n) { + return !n.a && (n.a = new Dy(n.c.vc())), n.a; + } + function BB(n) { + return !n.b && (n.b = new Ny(n.c.ec())), n.b; + } + function HB(n, t) { + for (; t-- > 0; ) n = (n << 1) | (n < 0 ? 1 : 0); + return n; + } + function qB(n, t) { + return iI(n) === iI(t) || (null != n && Q8(n, t)); + } + function GB(n, t) { + return rK(n.a, t) ? n.b[Yx(t, 22).g] : null; + } + function zB(n, t, e, i) { + n.a = l$(n.a, 0, t) + "" + i + lI(n.a, e); + } + function UB(n, t) { + n.u.Hc((Chn(), pit)) && + (function (n, t) { + var i, r, c, a; + for (i = (a = Yx(GB(n.b, t), 124)).a, c = Yx(Yx(_V(n.r, t), 21), 84).Kc(); c.Ob(); ) + (r = Yx(c.Pb(), 111)).c && (i.a = e.Math.max(i.a, WD(r.c))); + if (i.a > 0) + switch (t.g) { + case 2: + a.n.c = n.s; + break; + case 4: + a.n.b = n.s; + } + })(n, t), + (function (n, t) { + var e; + n.C && (((e = Yx(GB(n.b, t), 124).n).d = n.C.d), (e.a = n.C.a)); + })(n, t); + } + function XB(n, t) { + return Lz(t, n.length), n.charCodeAt(t); + } + function WB() { + Im.call(this, "There is no more element."); + } + function VB(n) { + (this.d = n), (this.a = this.d.b), (this.b = this.d.c); + } + function QB(n) { + (n.b = !1), (n.c = !1), (n.d = !1), (n.a = !1); + } + function YB(n, t, e, i) { + return h3(n, t, e, !1), f9(n, i), n; + } + function JB(n) { + return !n.n && (n.n = new m_(act, n, 1, 7)), n.n; + } + function ZB(n) { + return !n.c && (n.c = new m_(oct, n, 9, 9)), n.c; + } + function nH(n) { + return ( + n.e == qRn && + (function (n, t) { + n.e = t; + })( + n, + (function (n, t) { + var e, i; + return (e = t.Hh(n.a)) && null != (i = lL(ynn((!e.b && (e.b = new z$((xjn(), Dat), out, e)), e.b), gxn))) ? i : t.ne(); + })(n.g, n.b), + ), + n.e + ); + } + function tH(n) { + return ( + n.f == qRn && + (function (n, t) { + n.f = t; + })( + n, + (function (n, t) { + var e, i; + return (e = t.Hh(n.a)) + ? ((i = lL(ynn((!e.b && (e.b = new z$((xjn(), Dat), out, e)), e.b), RRn))), _N(KRn, i) ? OK(n, i1(t.Hj())) : i) + : null; + })(n.g, n.b), + ), + n.f + ); + } + function eH(n) { + var t; + return !(t = n.b) && (n.b = t = new Qf(n)), t; + } + function iH(n) { + var t; + for (t = n.Kc(); t.Ob(); ) t.Pb(), t.Qb(); + } + function rH(n) { + if ((A7(n.d), n.d.d != n.c)) throw hp(new Dp()); + } + function cH(n, t) { + (this.b = n), (this.c = t), (this.a = new TE(this.b)); + } + function aH(n, t, e) { + (this.a = oTn), (this.d = n), (this.b = t), (this.c = e); + } + function uH(n, t) { + (this.d = (vB(n), n)), (this.a = 16449), (this.c = t); + } + function oH(n, t) { + Q9(n, ty(q1(t, "x")), ty(q1(t, "y"))); + } + function sH(n, t) { + Q9(n, ty(q1(t, "x")), ty(q1(t, "y"))); + } + function hH(n, t) { + return W9(n), new SR(n, new _Y(t, n.a)); + } + function fH(n, t) { + return W9(n), new SR(n, new JV(t, n.a)); + } + function lH(n, t) { + return W9(n), new pL(n, new QV(t, n.a)); + } + function bH(n, t) { + return W9(n), new vL(n, new YV(t, n.a)); + } + function wH(n) { + (this.a = new ip()), (this.e = VQ(Wot, TEn, 48, n, 0, 2)); + } + function dH(n, t, e, i) { + (this.a = n), (this.e = t), (this.d = e), (this.c = i); + } + function gH(n, t, e, i) { + (this.a = n), (this.c = t), (this.b = e), (this.d = i); + } + function pH(n, t, e, i) { + (this.c = n), (this.b = t), (this.a = e), (this.d = i); + } + function vH(n, t, e, i) { + (this.c = n), (this.b = t), (this.d = e), (this.a = i); + } + function mH(n, t, e, i) { + (this.c = n), (this.d = t), (this.b = e), (this.a = i); + } + function yH(n, t, e, i) { + (this.a = n), (this.d = t), (this.c = e), (this.b = i); + } + function kH(n, t, e, i) { + Uj.call(this, n, t), (this.a = e), (this.b = i); + } + function jH(n, t, e, i) { + (this.a = n), (this.c = t), (this.d = e), (this.b = i); + } + function EH(n, t, i) { + (function (n, t) { + var e, i, r, c; + for ( + (function (n) { + var t; + for (t = 0; t < n.c.length; t++) ($z(t, n.c.length), Yx(n.c[t], 11)).p = t; + })(t.b.j), + SE(fH(new SR(null, new Nz(t.d, 16)), new cc()), new ac()), + c = new pb(t.d); + c.a < c.c.c.length; + + ) { + switch ((r = Yx(Hz(c), 101)).e.g) { + case 0: + (e = Yx(TR(r.j, 0), 113).d.j), + Ll(r, Yx(qA(YK(Yx(_V(r.k, e), 15).Oc(), hWn)), 113)), + $l(r, Yx(qA(QK(Yx(_V(r.k, e), 15).Oc(), hWn)), 113)); + break; + case 1: + (i = xrn(r)), + Ll(r, Yx(qA(YK(Yx(_V(r.k, i[0]), 15).Oc(), hWn)), 113)), + $l(r, Yx(qA(QK(Yx(_V(r.k, i[1]), 15).Oc(), hWn)), 113)); + break; + case 2: + Lsn(n, r); + break; + case 3: + twn(r); + break; + case 4: + awn(n, r); + } + a1(r); + } + n.a = null; + })(n.a, i), + (function (n) { + var t, e; + for ( + (function (n) { + var t, e, i, r, c, a, u, o, s, h, f; + for ( + e = null, + u = null, + (r = Yx(Aun(n.b, (gjn(), p1n)), 376)) == (rQ(), l3n) && ((e = new ip()), (u = new ip())), + a = new pb(n.d); + a.a < a.c.c.length; + + ) + if ((c = Yx(Hz(a), 101)).i) + switch (c.e.g) { + case 0: + (t = Yx(eW(new TE(c.b)), 61)), + r == l3n && t == (Ikn(), Tit) + ? (e.c[e.c.length] = c) + : r == l3n && t == (Ikn(), Bit) + ? (u.c[u.c.length] = c) + : Uin(c, t); + break; + case 1: + (o = c.a.d.j), + (s = c.c.d.j), + o == (Ikn(), Tit) + ? O_(c, Tit, (K4(), LXn), c.a) + : s == Tit + ? O_(c, Tit, (K4(), NXn), c.c) + : o == Bit + ? O_(c, Bit, (K4(), NXn), c.a) + : s == Bit && O_(c, Bit, (K4(), LXn), c.c); + break; + case 2: + case 3: + KA((i = c.b), (Ikn(), Tit)) + ? KA(i, Bit) + ? KA(i, qit) + ? KA(i, Eit) || O_(c, Tit, (K4(), NXn), c.c) + : O_(c, Tit, (K4(), LXn), c.a) + : O_(c, Tit, (K4(), $Xn), null) + : O_(c, Bit, (K4(), $Xn), null); + break; + case 4: + (h = c.a.d.j), + (f = c.a.d.j), + h == (Ikn(), Tit) || f == Tit ? O_(c, Bit, (K4(), $Xn), null) : O_(c, Tit, (K4(), $Xn), null); + } + e && (0 == e.c.length || dvn(e, (Ikn(), Tit)), 0 == u.c.length || dvn(u, (Ikn(), Bit))); + })(n), + e = new pb(n.d); + e.a < e.c.c.length; + + ) + (t = Yx(Hz(e), 101)).i && Bon(t); + })(i), + (function (n, t) { + var i, r; + (function (n, t, e) { + var i, r, c, a, u, o, s; + for (s = t.d, n.a = new pQ(s.c.length), n.c = new rp(), u = new pb(s); u.a < u.c.c.length; ) + (a = Yx(Hz(u), 101)), (c = new a4(null)), eD(n.a, c), xB(n.c, a, c); + for ( + n.b = new rp(), + (function (n, t) { + var e, i, r, c, a, u, o; + for (o = t.d, r = t.b.j, u = new pb(o); u.a < u.c.c.length; ) + for ( + a = Yx(Hz(u), 101), c = VQ(Vot, wSn, 25, r.c.length, 16, 1), xB(n.b, a, c), e = a.a.d.p - 1, i = a.c.d.p; + e != i; + + ) + c[(e = (e + 1) % r.c.length)] = !0; + })(n, t), + i = 0; + i < s.c.length - 1; + i++ + ) + for (o = Yx(TR(t.d, i), 101), r = i + 1; r < s.c.length; r++) $bn(n, o, Yx(TR(t.d, r), 101), e); + })( + n, + t, + (i = (function (n) { + var t, e, i, r, c, a, u, o, s, h; + for (e = 0, u = new pb(n.d); u.a < u.c.c.length; ) (a = Yx(Hz(u), 101)).i && (a.i.c = e++); + for (t = fR(Vot, [TEn, wSn], [177, 25], 16, [e, e], 2), h = n.d, r = 0; r < h.c.length; r++) + if (($z(r, h.c.length), (o = Yx(h.c[r], 101)).i)) + for (c = r + 1; c < h.c.length; c++) + $z(c, h.c.length), (s = Yx(h.c[c], 101)).i && ((i = kun(o, s)), (t[o.i.c][s.i.c] = i), (t[s.i.c][o.i.c] = i)); + return t; + })(t)), + ), + Han(n.a, Yx(Aun(dB(t.b), (Ojn(), FQn)), 230)), + (function (n) { + var t, i, r, c, a, u; + for (a = new ME(), c = new pb(n.a); c.a < c.c.c.length; ) + Kl((r = Yx(Hz(c), 112)), r.f.c.length), _l(r, r.k.c.length), 0 == r.i && ((r.o = 0), VW(a, r, a.c.b, a.c)); + for (; 0 != a.b; ) + for (i = (r = Yx(0 == a.b ? null : (S$(0 != a.b), VZ(a, a.a.a)), 112)).o + 1, t = new pb(r.f); t.a < t.c.c.length; ) + Fl((u = Yx(Hz(t), 129).a), e.Math.max(u.o, i)), _l(u, u.i - 1), 0 == u.i && VW(a, u, a.c.b, a.c); + })(n), + (function (n, t) { + var e, i, r, c; + for (r = new pb(t.d); r.a < r.c.c.length; ) + for (i = Yx(Hz(r), 101), c = Yx(BF(n.c, i), 112).o, e = new TE(i.b); e.a < e.c.a.length; ) gY(i, Yx(eW(e), 61), c); + })(n, t), + (r = VQ(Wot, MTn, 25, t.b.j.c.length, 15, 1)), + Xyn(n, t, (Ikn(), Tit), r, i), + Xyn(n, t, Eit, r, i), + Xyn(n, t, Bit, r, i), + Xyn(n, t, qit, r, i), + (n.a = null), + (n.c = null), + (n.b = null); + })(n.b, i), + (function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m; + for ( + h = (a = t.b).o, + o = a.d, + i = ty(fL(cen(a, (gjn(), N0n)))), + r = ty(fL(cen(a, D0n))), + s = ty(fL(cen(a, U0n))), + fD((u = new Tv()), o.d, o.c, o.a, o.b), + l = (function (n, t, e, i) { + var r, c, a, u, o; + for ( + o = VQ(Jot, TEn, 104, (Ikn(), x4(Gy(trt, 1), lIn, 61, 0, [Hit, Tit, Eit, Bit, qit])).length, 0, 2), + a = 0, + u = (c = x4(Gy(trt, 1), lIn, 61, 0, [Hit, Tit, Eit, Bit, qit])).length; + a < u; + ++a + ) + o[(r = c[a]).g] = VQ(Jot, rMn, 25, n.c[r.g], 15, 1); + return ( + mcn(o, n, Tit), + mcn(o, n, Bit), + Xin(o, n, Tit, t, e, i), + Xin(o, n, Eit, t, e, i), + Xin(o, n, Bit, t, e, i), + Xin(o, n, qit, t, e, i), + o + ); + })(t, i, r, s), + p = new pb(t.d); + p.a < p.c.c.length; + + ) { + for (w = (g = Yx(Hz(p), 101)).f.a.ec().Kc(); w.Ob(); ) + (c = (b = Yx(w.Pb(), 409)).a), + (f = Zan(b)), + (v = new Nv()), + Wan(b, b.c, l, v), + Yun(b, f, l, v), + Wan(b, b.d, l, v), + (e = v), + (e = n.Uf(b, f, e)), + BH(c.a), + C2(c.a, e), + SE(new SR(null, new Nz(e, 16)), new $M(h, u)); + (d = g.i) && (Gan(g, d, l, r), ptn(h, u, (m = new fC(d.g))), mN(m, d.j), ptn(h, u, m)); + } + fD(o, u.d, u.c, u.a, u.b); + })(t, i); + } + function TH(n, t, e) { + var i; + return (i = $kn(n)), t.Kh(e, i); + } + function MH(n, t) { + var e, i; + return (e = n / t) > (i = oG(e)) && ++i, i; + } + function SH(n) { + var t; + return b1((t = new up()), n), t; + } + function PH(n) { + var t; + return Xun((t = new up()), n), t; + } + function IH(n) { + return ( + (function (n) { + var t; + return CO((t = Aun(n, (Ojn(), CQn))), 160) ? W7(Yx(t, 160)) : null; + })(n) || null + ); + } + function CH(n) { + return !n.b && (n.b = new m_(nct, n, 12, 3)), n.b; + } + function OH(n, t, e) { + e.a ? N1(n, t.b - n.f / 2) : L1(n, t.a - n.g / 2); + } + function AH(n, t, e, i) { + (this.a = n), (this.b = t), (this.c = e), (this.d = i); + } + function $H(n, t, e, i) { + (this.a = n), (this.b = t), (this.c = e), (this.d = i); + } + function LH(n, t, e, i) { + (this.e = n), (this.a = t), (this.c = e), (this.d = i); + } + function NH(n, t, e, i) { + (this.a = n), (this.c = t), (this.d = e), (this.b = i); + } + function xH(n, t, e, i) { + WC(), AV.call(this, t, e, i), (this.a = n); + } + function DH(n, t, e, i) { + WC(), AV.call(this, t, e, i), (this.a = n); + } + function RH(n, t) { + (this.a = n), gL.call(this, n, Yx(n.d, 15).Zc(t)); + } + function KH(n) { + (this.f = n), (this.c = this.f.e), n.f > 0 && Icn(this); + } + function _H(n, t, e, i) { + (this.b = n), (this.c = i), PI.call(this, t, e); + } + function FH(n) { + return S$(n.b < n.d.gc()), n.d.Xb((n.c = n.b++)); + } + function BH(n) { + (n.a.a = n.c), (n.c.b = n.a), (n.a.b = n.c.a = null), (n.b = 0); + } + function HH(n, t) { + return (n.b = t.b), (n.c = t.c), (n.d = t.d), (n.a = t.a), n; + } + function qH(n) { + return n.n && (n.e !== tTn && n._d(), (n.j = null)), n; + } + function GH(n) { + return QD(null == n || (V_(n) && !(n.im === C))), n; + } + function zH(n) { + (this.b = new ip()), S4(this.b, this.b), (this.a = n); + } + function UH() { + (UH = O), (Fqn = new ip()), (_qn = new rp()), (Kqn = new ip()); + } + function XH() { + (XH = O), (TFn = new S()), (MFn = new I()), (SFn = new M()); + } + function WH() { + (WH = O), (IFn = new R()), (CFn = new R()), (OFn = new K()); + } + function VH() { + (VH = O), (TBn = new gn()), (SBn = new bK()), (MBn = new pn()); + } + function QH(n) { + return n.f || (n.f = new Xj(n, n.c)); + } + function YH(n, t) { + return G8(n.j, t.s, t.c) + G8(t.e, n.s, n.c); + } + function JH(n, t) { + n.e && !n.e.a && (op(n.e, t), JH(n.e, t)); + } + function ZH(n, t) { + n.d && !n.d.a && (op(n.d, t), ZH(n.d, t)); + } + function nq(n, t, e) { + OZ(n, t, new Tl(tx(e))); + } + function tq(n, t, e, i, r, c) { + jY.call(this, n, t, e, i, r, c ? -2 : -1); + } + function eq(n, t, e, i) { + XP.call(this, t, e), (this.b = n), (this.a = i); + } + function iq(n, t) { + new ME(), (this.a = new Nv()), (this.b = n), (this.c = t); + } + function rq(n, t) { + if (null == n) throw hp(new Zm(t)); + return n; + } + function cq(n) { + return !n.q && (n.q = new m_(fat, n, 11, 10)), n.q; + } + function aq(n) { + return !n.s && (n.s = new m_(tat, n, 21, 17)), n.s; + } + function uq(n) { + return !n.a && (n.a = new m_(uct, n, 10, 11)), n.a; + } + function oq(n) { + return CO(n, 14) + ? new kR(Yx(n, 14)) + : (function (n) { + var t; + return zJ((t = new Qp()), n), t; + })(n.Kc()); + } + function sq(n) { + return n && n.hashCode ? n.hashCode() : _A(n); + } + function hq(n, t) { + return null == t + ? !!Dq(n.f, null) + : (function (n, t) { + return !(void 0 === n.a.get(t)); + })(n.g, t); + } + function fq(n) { + return MF(n), Ein(new $K(bA(n.a.Kc(), new h()))); + } + function lq(n) { + return XH(), CO(n, 54) ? new xy(n) : new PA(n); + } + function bq(n, t, e) { + return !!n.f && n.f.Ne(t, e); + } + function wq(n, t) { + return (n.a = l$(n.a, 0, t) + "" + lI(n.a, t + 1)), n; + } + function dq(n, t) { + var e; + return (e = SO(n.a, t)) && (t.d = null), e; + } + function gq(n) { + var t, e; + (t = 0 | (e = n).$modCount), (e.$modCount = t + 1); + } + function pq(n) { + (this.b = n), (this.c = n), (n.e = null), (n.c = null), (this.a = 1); + } + function vq(n) { + (this.b = n), (this.a = new Vk(Yx(MF(new tt()), 62))); + } + function mq(n) { + (this.c = n), (this.b = new Vk(Yx(MF(new vn()), 62))); + } + function yq(n) { + (this.c = n), (this.b = new Vk(Yx(MF(new Ct()), 62))); + } + function kq() { + (this.a = new sv()), (this.b = new Ev()), (this.d = new Dt()); + } + function jq() { + (this.a = new Nv()), (this.b = (g0(3, UEn), new pQ(3))); + } + function Eq() { + (this.b = new Qp()), (this.d = new ME()), (this.e = new kv()); + } + function Tq(n) { + (this.c = n.c), (this.d = n.d), (this.b = n.b), (this.a = n.a); + } + function Mq(n, t) { + rm.call(this, new f_(n)), (this.a = n), (this.b = t); + } + function Sq() { + lon(this, new xf()), (this.wb = (YF(), gat)), Rk(); + } + function Pq(n) { + _y(), + e.setTimeout(function () { + throw n; + }, 0); + } + function Iq(n) { + return n.u || (bV(n), (n.u = new qL(n, n))), n.u; + } + function Cq(n) { + return Yx(H3(n, 16), 26) || n.zh(); + } + function Oq(n, t) { + return CO(t, 146) && _N(n.b, Yx(t, 146).tg()); + } + function Aq(n) { + this.a = (XH(), CO(n, 54) ? new xy(n) : new PA(n)); + } + function $q() { + var n, t; + ($q = O), + (t = !(Error.stackTraceLimit > 0 ? ((e.Error.stackTraceLimit = Error.stackTraceLimit = 64), 1) : "stack" in new Error())), + (n = new d()), + (p_n = t ? new E() : n); + } + function Lq(n, t) { + var e; + return (e = Nk(n.gm)), null == t ? e : e + ": " + t; + } + function Nq(n, t) { + var e; + return pW((e = n.b.Qc(t)), n.b.gc()), e; + } + function xq(n, t) { + if (null == n) throw hp(new Zm(t)); + return n; + } + function Dq(n, t) { + return q6( + n, + t, + (function (n, t) { + var e; + return null == (e = n.a.get(t)) ? new Array() : e; + })(n, null == t ? 0 : n.b.se(t)), + ); + } + function Rq(n, t, e) { + return e >= 0 && _N(n.substr(e, t.length), t); + } + function Kq(n, t, e, i, r, c, a) { + return new oW(n.e, t, e, i, r, c, a); + } + function _q(n, t, e, i, r, c) { + (this.a = n), E0.call(this, t, e, i, r, c); + } + function Fq(n, t, e, i, r, c) { + (this.a = n), E0.call(this, t, e, i, r, c); + } + function Bq(n, t) { + (this.g = n), (this.d = x4(Gy(Gzn, 1), kIn, 10, 0, [t])); + } + function Hq(n, t) { + (this.e = n), (this.a = UKn), (this.b = Zdn(t)), (this.c = t); + } + function qq(n, t) { + sN.call(this), YZ(this), (this.a = n), (this.c = t); + } + function Gq(n, t, e, i) { + DF(n.c[t.g], e.g, i), DF(n.c[e.g], t.g, i); + } + function zq(n, t, e, i) { + DF(n.c[t.g], t.g, e), DF(n.b[t.g], t.g, i); + } + function Uq(n, t, e, i) { + return e >= 0 ? n.jh(t, e, i) : n.Sg(null, e, i); + } + function Xq(n) { + return 0 == n.b.b ? n.a.$e() : mD(n.b); + } + function Wq(n) { + return ( + iI(n.a) === iI((W2(), Gat)) && + (function (n) { + var t, e, i, r, c, a, u, o, s, h; + for ( + t = new To(), + e = new To(), + s = _N(ZDn, (r = dpn(n.b, nRn)) ? lL(ynn((!r.b && (r.b = new z$((xjn(), Dat), out, r)), r.b), tRn)) : null), + o = 0; + o < n.i; + ++o + ) + CO((u = Yx(n.g[o], 170)), 99) + ? 0 != ((a = Yx(u, 18)).Bb & MNn) + ? (0 == (a.Bb & MEn) || + (!s && null == ((c = dpn(a, nRn)) ? lL(ynn((!c.b && (c.b = new z$((xjn(), Dat), out, c)), c.b), dxn)) : null))) && + fY(t, a) + : ((h = nin(a)) && 0 != (h.Bb & MNn)) || + ((0 == (a.Bb & MEn) || + (!s && null == ((i = dpn(a, nRn)) ? lL(ynn((!i.b && (i.b = new z$((xjn(), Dat), out, i)), i.b), dxn)) : null))) && + fY(e, a)) + : (TT(), Yx(u, 66).Oj() && (u.Jj() || (fY(t, u), fY(e, u)))); + B6(t), B6(e), (n.a = Yx(t.g, 247)), Yx(e.g, 247); + })(n), + n.a + ); + } + function Vq(n) { + (this.a = Yx(MF(n), 271)), (this.b = (XH(), new CA(n))); + } + function Qq(n, t) { + (function (n, t) { + n.a = t; + })(this, new QS(n.a, n.b)), + (function (n, t) { + n.b = t; + })(this, nD(t)); + } + function Yq() { + (Yq = O), (X4n = new SS(ySn, 0)), (W4n = new SS(kSn, 1)); + } + function Jq() { + (Jq = O), (d4n = new ES(kSn, 0)), (w4n = new ES(ySn, 1)); + } + function Zq() { + mm.call(this, new kE(IZ(12))), yA(!0), (this.a = 2); + } + function nG(n, t, e) { + Ljn(), np.call(this, n), (this.b = t), (this.a = e); + } + function tG(n, t, e) { + WC(), zg.call(this, t), (this.a = n), (this.b = e); + } + function eG(n) { + sN.call(this), YZ(this), (this.a = n), (this.c = !0); + } + function iG(n) { + var t; + (t = n.c.d.b), (n.b = t), (n.a = n.c.d), (t.a = n.c.d.b = n); + } + function rG(n) { + (function (n) { + var t; + for (t = new pb(hrn(n)); t.a < t.c.c.length; ) Yx(Hz(t), 680).Gf(); + })(n.a), + LC(n.a), + R7(new Qb(n.a)); + } + function cG(n, t) { + return ( + nW(t), + (function (n, t, i) { + var r; + return (r = n.length), hhn(n, 0, t, 0, e.Math.min(i, r), !0), t; + })(n, VQ(Wot, MTn, 25, t, 15, 1), t) + ); + } + function aG(n, t) { + return null == t ? eI(Dq(n.f, null)) : NT(n.g, t); + } + function uG(n) { + return 0 == n.b ? null : (S$(0 != n.b), VZ(n, n.a.a)); + } + function oG(n) { + return 0 | Math.max(Math.min(n, Yjn), -2147483648); + } + function sG(n, t) { + return rq(n, "set1"), rq(t, "set2"), new Zj(n, t); + } + function hG(n, t) { + return mN( + D$( + (function (n, t) { + return yN(dO(Yx(BF(n.g, t), 8)), bO(Yx(BF(n.f, t), 460).b)); + })(n.f, t), + ), + n.f.d, + ); + } + function fG(n, t) { + var e; + return Fyn(n, t, (e = new q())), e.d; + } + function lG(n, t, e, i) { + var r; + (r = new dN()), (t.a[e.g] = r), YR(n.b, i, r); + } + function bG(n, t, e) { + var i; + (i = n.Yg(t)) >= 0 ? n.sh(i, e) : pbn(n, t, e); + } + function wG(n, t, e) { + _G(), n && xB(Sct, n, t), n && xB(Mct, n, e); + } + function dG(n, t, e) { + (this.i = new ip()), (this.b = n), (this.g = t), (this.a = e); + } + function gG(n, t, e) { + (this.c = new ip()), (this.e = n), (this.f = t), (this.b = e); + } + function pG(n, t, e) { + (this.a = new ip()), (this.e = n), (this.f = t), (this.c = e); + } + function vG(n, t) { + jO(this), (this.f = t), (this.g = n), qH(this), this._d(); + } + function mG(n, t) { + var e; + (e = n.q.getHours()), n.q.setDate(t), Ivn(n, e); + } + function yG(n, t) { + var e; + for (MF(t), e = n.a; e; e = e.c) t.Od(e.g, e.i); + } + function kG(n) { + var t; + return L5((t = new Xk(IZ(n.length))), n), t; + } + function jG(n, t) { + if (null == t) throw hp(new Np()); + return (function (n, t) { + var e, + i = n.a; + (t = String(t)), i.hasOwnProperty(t) && (e = i[t]); + var r = (r5(), S_n)[typeof e]; + return r ? r(e) : Z6(typeof e); + })(n, t); + } + function EG(n) { + return n.Db >> 16 != 3 ? null : Yx(n.Cb, 33); + } + function TG(n) { + return n.Db >> 16 != 9 ? null : Yx(n.Cb, 33); + } + function MG(n) { + return n.Db >> 16 != 6 ? null : Yx(n.Cb, 79); + } + function SG(n) { + return n.Db >> 16 != 7 ? null : Yx(n.Cb, 235); + } + function PG(n) { + return n.Db >> 16 != 7 ? null : Yx(n.Cb, 160); + } + function IG(n) { + return n.Db >> 16 != 11 ? null : Yx(n.Cb, 33); + } + function CG(n, t) { + var e; + return (e = n.Yg(t)) >= 0 ? n.lh(e) : zhn(n, t); + } + function OG(n, t) { + var e; + return Eun((e = new jR(t)), n), new sx(e); + } + function AG(n) { + var t; + return (t = n.d), (t = n.si(n.f)), fY(n, t), t.Ob(); + } + function $G(n, t) { + return (n.b += t.b), (n.c += t.c), (n.d += t.d), (n.a += t.a), n; + } + function LG(n, t) { + return e.Math.abs(n) < e.Math.abs(t) ? n : t; + } + function NG() { + (this.a = new oC()), (this.e = new Qp()), (this.g = 0), (this.i = 0); + } + function xG(n) { + (this.a = n), (this.b = VQ(Z3n, TEn, 1944, n.e.length, 0, 2)); + } + function DG(n, t, e) { + var i; + (i = x5(n, t, e)), (n.b = new s2(i.c.length)); + } + function RG() { + (RG = O), (v4n = new jS($Sn, 0)), (m4n = new jS("UP", 1)); + } + function KG() { + (KG = O), (Y5n = new AS(u$n, 0)), (J5n = new AS("FAN", 1)); + } + function _G() { + var n, t; + (_G = O), (Sct = new rp()), (Mct = new rp()), (n = NFn), (t = new wo()), n && xB(Mct, n, t); + } + function FG(n) { + return n.Db >> 16 != 3 ? null : Yx(n.Cb, 147); + } + function BG(n) { + return n.Db >> 16 != 6 ? null : Yx(n.Cb, 235); + } + function HG(n) { + return n.Db >> 16 != 17 ? null : Yx(n.Cb, 26); + } + function qG(n, t) { + var e = (n.a = n.a || []); + return e[t] || (e[t] = n.le(t)); + } + function GG(n, t, e) { + return null == t ? Ysn(n.f, null, e) : r7(n.g, t, e); + } + function zG(n, t, e, i, r, c) { + return new yJ(n.e, t, n.aj(), e, i, r, c); + } + function UG(n, t, e) { + return (n.a = l$(n.a, 0, t) + "" + e + lI(n.a, t)), n; + } + function XG(n, t, e) { + return eD(n.a, (KB(), gin(t, e), new Wj(t, e))), n; + } + function WG(n) { + return jA(n.c), (n.e = n.a = n.c), (n.c = n.c.c), ++n.d, n.a.f; + } + function VG(n) { + return jA(n.e), (n.c = n.a = n.e), (n.e = n.e.e), --n.d, n.a.f; + } + function QG(n, t) { + n.d && uJ(n.d.e, n), (n.d = t), n.d && eD(n.d.e, n); + } + function YG(n, t) { + n.c && uJ(n.c.g, n), (n.c = t), n.c && eD(n.c.g, n); + } + function JG(n, t) { + n.c && uJ(n.c.a, n), (n.c = t), n.c && eD(n.c.a, n); + } + function ZG(n, t) { + n.i && uJ(n.i.j, n), (n.i = t), n.i && eD(n.i.j, n); + } + function nz(n, t, e) { + (this.a = t), (this.c = n), (this.b = (MF(e), new sx(e))); + } + function tz(n, t, e) { + (this.a = t), (this.c = n), (this.b = (MF(e), new sx(e))); + } + function ez(n, t) { + (this.a = n), (this.c = dO(this.a)), (this.b = new Tq(t)); + } + function iz(n, t) { + if (n < 0 || n > t) throw hp(new Hm(RMn + n + KMn + t)); + } + function rz(n, t) { + return cK(n.a, t) ? K_(n, Yx(t, 22).g, null) : null; + } + function cz() { + (cz = O), (o_n = z6((pm(), x4(Gy(s_n, 1), XEn, 538, 0, [a_n])))); + } + function az() { + (az = O), (A3n = yK(new fX(), ($un(), tzn), ($jn(), iXn))); + } + function uz() { + (uz = O), ($3n = yK(new fX(), ($un(), tzn), ($jn(), iXn))); + } + function oz() { + (oz = O), (N3n = yK(new fX(), ($un(), tzn), ($jn(), iXn))); + } + function sz() { + (sz = O), (c4n = oR(new fX(), ($un(), tzn), ($jn(), CUn))); + } + function hz() { + (hz = O), (h4n = oR(new fX(), ($un(), tzn), ($jn(), CUn))); + } + function fz() { + (fz = O), (b4n = oR(new fX(), ($un(), tzn), ($jn(), CUn))); + } + function lz() { + (lz = O), (j4n = oR(new fX(), ($un(), tzn), ($jn(), CUn))); + } + function bz() { + (bz = O), (c6n = yK(new fX(), (Krn(), n5n), (ysn(), c5n))); + } + function wz(n, t, e, i) { + (this.c = n), (this.d = i), pz(this, t), vz(this, e); + } + function dz(n) { + (this.c = new ME()), (this.b = n.b), (this.d = n.c), (this.a = n.a); + } + function gz(n) { + (this.a = e.Math.cos(n)), (this.b = e.Math.sin(n)); + } + function pz(n, t) { + n.a && uJ(n.a.k, n), (n.a = t), n.a && eD(n.a.k, n); + } + function vz(n, t) { + n.b && uJ(n.b.f, n), (n.b = t), n.b && eD(n.b.f, n); + } + function mz(n, t) { + (function (n, t, e) { + Yx(t.b, 65), WZ(t.a, new xx(n, e, t)); + })(n, n.b, n.c), + Yx(n.b.b, 65), + t && Yx(t.b, 65).b; + } + function yz(n, t) { + CO(n.Cb, 88) && rhn(bV(Yx(n.Cb, 88)), 4), E2(n, t); + } + function kz(n, t) { + CO(n.Cb, 179) && (Yx(n.Cb, 179).tb = null), E2(n, t); + } + function jz(n, t) { + return TT(), GJ(t) ? new cR(t, n) : new VP(t, n); + } + function Ez(n) { + var t; + return Rk(), b1((t = new up()), n), t; + } + function Tz(n) { + var t; + return Rk(), b1((t = new up()), n), t; + } + function Mz(n, t) { + var e; + return (e = new qF(n)), (t.c[t.c.length] = e), e; + } + function Sz(n, t) { + var e; + return (e = Yx(x8(QH(n.a), t), 14)) ? e.gc() : 0; + } + function Pz(n) { + return W9(n), WH(), WH(), HZ(n, CFn); + } + function Iz(n) { + for (var t; ; ) if (((t = n.Pb()), !n.Ob())) return t; + } + function Cz(n, t) { + cm.call(this, new kE(IZ(n))), g0(t, EEn), (this.a = t); + } + function Oz(n, t, e) { + i9(t, e, n.gc()), (this.c = n), (this.a = t), (this.b = e - t); + } + function Az(n, t, e) { + var i; + i9(t, e, n.c.length), (i = e - t), uj(n.c, t, i); + } + function $z(n, t) { + if (n < 0 || n >= t) throw hp(new Hm(RMn + n + KMn + t)); + } + function Lz(n, t) { + if (n < 0 || n >= t) throw hp(new Ly(RMn + n + KMn + t)); + } + function Nz(n, t) { + (this.b = (vB(n), n)), (this.a = 0 == (t & nMn) ? 64 | t | MEn : t); + } + function xz(n) { + $C(this), zp(this.a, j5(e.Math.max(8, n)) << 1); + } + function Dz(n) { + return $5(x4(Gy(B7n, 1), TEn, 8, 0, [n.i.n, n.n, n.a])); + } + function Rz(n, t) { + return (function (n, t, e) { + var i, r, c, a, u, o; + if (((a = new go()), (u = dwn(n.e.Tg(), t)), (i = Yx(n.g, 119)), TT(), Yx(t, 66).Oj())) + for (c = 0; c < n.i; ++c) (r = i[c]), u.rl(r.ak()) && fY(a, r); + else for (c = 0; c < n.i; ++c) (r = i[c]), u.rl(r.ak()) && ((o = r.dd()), fY(a, e ? qhn(n, t, c, a.i, o) : o)); + return KX(a); + })(n, t, CO(t, 99) && 0 != (Yx(t, 18).Bb & eMn)); + } + function Kz(n, t, e) { + var i; + ((i = new ca()).b = t), (i.a = e), ++t.b, eD(n.d, i); + } + function _z(n, t) { + var e, i; + return (i = N_(n, t)), (e = n.a.Zc(i)), new Yj(n, e); + } + function Fz(n) { + return ( + n.a == (wV(), put) && + (function (n, t) { + n.a = t; + })( + n, + (function (n, t) { + var e, i, r; + return (e = t.Hh(n.a)) && null != (r = lL(ynn((!e.b && (e.b = new z$((xjn(), Dat), out, e)), e.b), "affiliation"))) + ? -1 == (i = LA(r, gun(35))) + ? v9(n, OK(n, i1(t.Hj())), r) + : 0 == i + ? v9(n, null, r.substr(1)) + : v9(n, r.substr(0, i), r.substr(i + 1)) + : null; + })(n.g, n.b), + ), + n.a + ); + } + function Bz(n) { + return ( + n.d == (wV(), put) && + (function (n, t) { + n.d = t; + })( + n, + (function (n, t) { + var e, i, r, c, a, u; + if ((e = t.Hh(n.a)) && null != (u = lL(ynn((!e.b && (e.b = new z$((xjn(), Dat), out, e)), e.b), dxn)))) + switch ( + ((r = LA(u, gun(35))), + (i = t.Hj()), + -1 == r + ? ((a = OK(n, i1(i))), (c = u)) + : 0 == r + ? ((a = null), (c = u.substr(1))) + : ((a = u.substr(0, r)), (c = u.substr(r + 1))), + TB(PJ(n, t))) + ) { + case 2: + case 3: + return (function (n, t, e, i) { + var r; + return (r = $ln(n, t, e, i)) || + !(r = (function (n, t, e) { + var i, r; + return (r = Hln(n.b, t)) && (i = Yx(Imn(SJ(n, r), ""), 26)) ? $ln(n, i, t, e) : null; + })(n, e, i)) || + iyn(n, t, r) + ? r + : null; + })(n, i, a, c); + case 0: + case 4: + case 5: + case 6: + return (function (n, t, e, i) { + var r; + return (r = Lln(n, t, e, i)) || !(r = v9(n, e, i)) || iyn(n, t, r) ? r : null; + })(n, i, a, c); + } + return null; + })(n.g, n.b), + ), + n.d + ); + } + function Hz(n) { + return S$(n.a < n.c.c.length), (n.b = n.a++), n.c.c[n.b]; + } + function qz(n, t) { + (n.b = n.b | t.b), (n.c = n.c | t.c), (n.d = n.d | t.d), (n.a = n.a | t.a); + } + function Gz(n, t) { + return $3( + (function (n, t) { + return rO(n.l & t.l, n.m & t.m, n.h & t.h); + })(tC(n) ? W3(n) : n, tC(t) ? W3(t) : t), + ); + } + function zz(n, t) { + return $3( + (function (n, t) { + return rO(n.l | t.l, n.m | t.m, n.h | t.h); + })(tC(n) ? W3(n) : n, tC(t) ? W3(t) : t), + ); + } + function Uz(n, t) { + return $3( + (function (n, t) { + return rO(n.l ^ t.l, n.m ^ t.m, n.h ^ t.h); + })(tC(n) ? W3(n) : n, tC(t) ? W3(t) : t), + ); + } + function Xz(n) { + return MF(n), CO(n, 14) ? new sx(Yx(n, 14)) : Jx(n.Kc()); + } + function Wz(n, t) { + var e; + return (e = lJ(t)), Yx(BF(n.c, e), 19).a; + } + function Vz(n, t) { + var e; + for (e = n + ""; e.length < t; ) e = "0" + e; + return e; + } + function Qz(n) { + return null == n.c || 0 == n.c.length ? "n_" + n.g : "n_" + n.c; + } + function Yz(n) { + return null == n.c || 0 == n.c.length ? "n_" + n.b : "n_" + n.c; + } + function Jz(n, t) { + return n && n.equals ? n.equals(t) : iI(n) === iI(t); + } + function Zz(n, t) { + return 0 == t ? !!n.o && 0 != n.o.f : uen(n, t); + } + function nU(n, t, e) { + var i; + n.n && t && e && ((i = new Zu()), eD(n.e, i)); + } + function tU(n, t, e) { + var i; + (i = n.d[t.p]), (n.d[t.p] = n.d[e.p]), (n.d[e.p] = i); + } + function eU(n, t, e) { + (this.d = n), (this.j = t), (this.e = e), (this.o = -1), (this.p = 3); + } + function iU(n, t, e) { + (this.d = n), (this.k = t), (this.f = e), (this.o = -1), (this.p = 5); + } + function rU(n, t, e) { + np.call(this, 25), (this.b = n), (this.a = t), (this.c = e); + } + function cU(n) { + Ljn(), np.call(this, n), (this.c = !1), (this.a = !1); + } + function aU(n, t, e, i, r, c) { + W1.call(this, n, t, e, i, r), c && (this.o = -2); + } + function uU(n, t, e, i, r, c) { + V1.call(this, n, t, e, i, r), c && (this.o = -2); + } + function oU(n, t, e, i, r, c) { + PV.call(this, n, t, e, i, r), c && (this.o = -2); + } + function sU(n, t, e, i, r, c) { + J1.call(this, n, t, e, i, r), c && (this.o = -2); + } + function hU(n, t, e, i, r, c) { + IV.call(this, n, t, e, i, r), c && (this.o = -2); + } + function fU(n, t, e, i, r, c) { + Q1.call(this, n, t, e, i, r), c && (this.o = -2); + } + function lU(n, t, e, i, r, c) { + Y1.call(this, n, t, e, i, r), c && (this.o = -2); + } + function bU(n, t, e, i, r, c) { + CV.call(this, n, t, e, i, r), c && (this.o = -2); + } + function wU(n, t, e, i) { + zg.call(this, e), (this.b = n), (this.c = t), (this.d = i); + } + function dU(n, t) { + (this.a = new ip()), (this.d = new ip()), (this.f = n), (this.c = t); + } + function gU() { + (this.c = new fO()), (this.a = new kq()), (this.b = new dv()), FE(); + } + function pU() { + H4(), (this.b = new rp()), (this.a = new rp()), (this.c = new ip()); + } + function vU(n, t) { + (this.g = n), (this.d = (wV(), put)), (this.a = put), (this.b = t); + } + function mU(n, t) { + (this.f = n), (this.a = (wV(), gut)), (this.c = gut), (this.b = t); + } + function yU(n, t) { + !n.c && (n.c = new e3(n, 0)), kmn(n.c, (ayn(), Wut), t); + } + function kU() { + (kU = O), (e6n = new $S("DFS", 0)), (t6n = new $S("BFS", 1)); + } + function jU(n, t, e) { + var i; + return !!(i = Yx(n.Zb().xc(t), 14)) && i.Mc(e); + } + function EU(n, t, e, i) { + return (n.a += "" + l$(null == t ? aEn : I7(t), e, i)), n; + } + function TU(n, t, e, i, r, c) { + return h3(n, t, e, c), h9(n, i), b9(n, r), n; + } + function MU(n) { + return S$(n.b.b != n.d.a), (n.c = n.b = n.b.b), --n.a, n.c.c; + } + function SU(n) { + for (; n.d > 0 && 0 == n.a[--n.d]; ); + 0 == n.a[n.d++] && (n.e = 0); + } + function PU(n) { + return n.a ? (0 == n.e.length ? n.a.a : n.a.a + "" + n.e) : n.c; + } + function IU(n) { + return hR(n.e.Hd().gc() * n.c.Hd().gc(), 16, new qf(n)); + } + function CU(n) { + return Yx(Htn(n, VQ(Nzn, yIn, 17, n.c.length, 0, 1)), 474); + } + function OU(n) { + return Yx(Htn(n, VQ(Gzn, kIn, 10, n.c.length, 0, 1)), 193); + } + function AU(n, t, e) { + MF(n), + (function (n) { + var t, e, i; + for (XH(), JC(n.c, n.a), i = new pb(n.c); i.a < i.c.c.length; ) + for (e = Hz(i), t = new pb(n.b); t.a < t.c.c.length; ) Yx(Hz(t), 679).Ke(e); + })(new nz(new sx(n), t, e)); + } + function $U(n, t, e) { + MF(n), + (function (n) { + var t, e, i; + for (XH(), JC(n.c, n.a), i = new pb(n.c); i.a < i.c.c.length; ) + for (e = Hz(i), t = new pb(n.b); t.a < t.c.c.length; ) Yx(Hz(t), 369).Ke(e); + })(new tz(new sx(n), t, e)); + } + function LU(n, t) { + var e; + return (e = 1 - t), (n.a[e] = c2(n.a[e], e)), c2(n, t); + } + function NU(n, t) { + var e; + (n.e = new fm()), JC((e = idn(t)), n.c), ldn(n, e, 0); + } + function xU(n, t, e, i) { + var r; + ((r = new vu()).a = t), (r.b = e), (r.c = i), KD(n.a, r); + } + function DU(n, t, e, i) { + var r; + ((r = new vu()).a = t), (r.b = e), (r.c = i), KD(n.b, r); + } + function RU(n) { + var t, e; + return ( + (e = Qgn((t = new pF()), n)), + (function (n) { + var t, e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j; + for (f = new sB(new Sb(n)); f.b != f.c.a.d; ) + for (u = Yx((h = sY(f)).d, 56), t = Yx(h.e, 56), d = 0, y = (null == (a = u.Tg()).i && svn(a), a.i).length; d < y; ++d) + if ((null == a.i && svn(a), (c = a.i), (s = d >= 0 && d < c.length ? c[d] : null).Ij() && !s.Jj())) + if (CO(s, 99)) 0 == ((o = Yx(s, 18)).Bb & MNn) && (!(j = nin(o)) || 0 == (j.Bb & MNn)) && Lvn(n, o, u, t); + else if ((TT(), Yx(s, 66).Oj() && (e = Yx((k = s) ? Yx(t, 49).xh(k) : null, 153)))) + for (b = Yx(u.ah(s), 153), i = e.gc(), g = 0, w = b.gc(); g < w; ++g) + if (CO((l = b.il(g)), 99)) { + if (null == (r = UJ(n, (m = b.jl(g)))) && null != m) { + if (((v = Yx(l, 18)), !n.b || 0 != (v.Bb & MNn) || nin(v))) continue; + r = m; + } + if (!e.dl(l, r)) + for (p = 0; p < i; ++p) + if (e.il(p) == l && iI(e.jl(p)) === iI(r)) { + e.ii(e.gc() - 1, p), --i; + break; + } + } else e.dl(b.il(g), b.jl(g)); + })(t), + e + ); + } + function KU() { + var n, t; + return (n = new up()), eD(hut, (t = n)), t; + } + function _U(n) { + return ( + (n.j.c = VQ(UKn, iEn, 1, 0, 5, 1)), + iH(n.c), + (function (n) { + (n.j.c = VQ(UKn, iEn, 1, 0, 5, 1)), (n.a = -1); + })(n.a), + n + ); + } + function FU(n) { + return JE(), CO(n.g, 10) ? Yx(n.g, 10) : null; + } + function BU(n) { + return ( + !eH(n).dc() && + ((function (n, t) { + MF(t), eH(n).Jc(new b()); + })(n, new m()), + !0) + ); + } + function HU(n, t) { + if (n < 0 || n >= t) + throw hp( + new Hm( + (function (n, t) { + if (n < 0) return ngn(eEn, x4(Gy(UKn, 1), iEn, 1, 5, ["index", d9(n)])); + if (t < 0) throw hp(new Qm(rEn + t)); + return ngn("%s (%s) must be less than size (%s)", x4(Gy(UKn, 1), iEn, 1, 5, ["index", d9(n), d9(t)])); + })(n, t), + ), + ); + return n; + } + function qU(n, t, e) { + if (n < 0 || t < n || t > e) + throw hp( + new Hm( + (function (n, t, e) { + return n < 0 || n > e + ? Usn(n, e, "start index") + : t < 0 || t > e + ? Usn(t, e, "end index") + : ngn("end index (%s) must not be less than start index (%s)", x4(Gy(UKn, 1), iEn, 1, 5, [d9(t), d9(n)])); + })(n, t, e), + ), + ); + } + function GU(n, t) { + if ((__(n.a, t), t.d)) throw hp(new Im(GMn)); + t.d = n; + } + function zU(n, t) { + if (t.$modCount != n.$modCount) throw hp(new Dp()); + } + function UU(n, t) { + return !!CO(t, 42) && Fin(n.a, Yx(t, 42)); + } + function XU(n, t) { + return !!CO(t, 42) && Fin(n.a, Yx(t, 42)); + } + function WU(n, t) { + return !!CO(t, 42) && Fin(n.a, Yx(t, 42)); + } + function VU(n) { + var t; + return tC(n) + ? -0 == (t = n) + ? 0 + : t + : (function (n) { + return gcn(n, (LJ(), A_n)) < 0 + ? -(function (n) { + return n.l + n.m * GTn + n.h * zTn; + })(h5(n)) + : n.l + n.m * GTn + n.h * zTn; + })(n); + } + function QU(n) { + var t; + return yB(n), (t = new F()), Qk(n.a, new _b(t)), t; + } + function YU(n) { + var t; + return yB(n), (t = new _()), Qk(n.a, new Kb(t)), t; + } + function JU(n, t) { + (this.a = n), Vl.call(this, n), iz(t, n.gc()), (this.b = t); + } + function ZU(n) { + (this.e = n), (this.b = this.e.a.entries()), (this.a = new Array()); + } + function nX(n) { + return new pQ((g0(n, VEn), PZ(t7(t7(5, n), (n / 10) | 0)))); + } + function tX(n) { + return Yx(Htn(n, VQ(rUn, jIn, 11, n.c.length, 0, 1)), 1943); + } + function eX(n, t, e) { + n.d && uJ(n.d.e, n), (n.d = t), n.d && ZR(n.d.e, e, n); + } + function iX(n, t) { + (function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k; + if (((m = 0), 0 == t.f.b)) + for (p = new pb(n); p.a < p.c.c.length; ) (d = Yx(Hz(p), 10)), (m = e.Math.max(m, d.n.b + d.o.b + d.d.a)); + else m = t.f.b - t.c.b; + for (m -= t.c.b, g = new pb(n); g.a < g.c.c.length; ) { + switch ( + (vp((d = Yx(Hz(g), 10)).n, m - d.o.b), + bD(d.f), + urn(d), + (d.q ? d.q : (XH(), XH(), MFn))._b((gjn(), E0n)) && vp(Yx(Aun(d, E0n), 8), m - d.o.b), + Yx(Aun(d, xZn), 248).g) + ) { + case 3: + b5(d, xZn, (qen(), q7n)); + break; + case 4: + b5(d, xZn, (qen(), X7n)); + } + for (v = d.o, k = new pb(d.j); k.a < k.c.c.length; ) { + for ( + vp((y = Yx(Hz(k), 11)).n, v.b - y.o.b), + vp(y.a, y.o.b), + whn(y, a3(y.j)), + (u = Yx(Aun(y, p0n), 19)) && b5(y, p0n, d9(-u.a)), + a = new pb(y.g); + a.a < a.c.c.length; + + ) { + for (r = Ztn((c = Yx(Hz(a), 17)).a, 0); r.b != r.d.c; ) (i = Yx(IX(r), 8)).b = m - i.b; + if ((h = Yx(Aun(c, $1n), 74))) for (s = Ztn(h, 0); s.b != s.d.c; ) (o = Yx(IX(s), 8)).b = m - o.b; + for (b = new pb(c.b); b.a < b.c.c.length; ) vp((f = Yx(Hz(b), 70)).n, m - f.o.b); + } + for (w = new pb(y.f); w.a < w.c.c.length; ) vp((f = Yx(Hz(w), 70)).n, y.o.b - f.o.b); + } + for (d.k == (bon(), _zn) && (b5(d, (Ojn(), hQn), a3(Yx(Aun(d, hQn), 61))), E9(d)), l = new pb(d.b); l.a < l.c.c.length; ) + urn((f = Yx(Hz(l), 70))), vp(f.n, v.b - f.o.b); + } + })(t, n), + bD(n.d), + bD(Yx(Aun(n, (gjn(), z1n)), 207)); + } + function rX(n, t) { + (function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k; + if (((m = 0), 0 == t.f.a)) + for (p = new pb(n); p.a < p.c.c.length; ) (d = Yx(Hz(p), 10)), (m = e.Math.max(m, d.n.a + d.o.a + d.d.c)); + else m = t.f.a - t.c.a; + for (m -= t.c.a, g = new pb(n); g.a < g.c.c.length; ) { + switch ( + (mp((d = Yx(Hz(g), 10)).n, m - d.o.a), + lD(d.f), + arn(d), + (d.q ? d.q : (XH(), XH(), MFn))._b((gjn(), E0n)) && mp(Yx(Aun(d, E0n), 8), m - d.o.a), + Yx(Aun(d, xZn), 248).g) + ) { + case 1: + b5(d, xZn, (qen(), U7n)); + break; + case 2: + b5(d, xZn, (qen(), z7n)); + } + for (v = d.o, k = new pb(d.j); k.a < k.c.c.length; ) { + for ( + mp((y = Yx(Hz(k), 11)).n, v.a - y.o.a), + mp(y.a, y.o.a), + whn(y, c3(y.j)), + (u = Yx(Aun(y, p0n), 19)) && b5(y, p0n, d9(-u.a)), + a = new pb(y.g); + a.a < a.c.c.length; + + ) { + for (r = Ztn((c = Yx(Hz(a), 17)).a, 0); r.b != r.d.c; ) (i = Yx(IX(r), 8)).a = m - i.a; + if ((h = Yx(Aun(c, $1n), 74))) for (s = Ztn(h, 0); s.b != s.d.c; ) (o = Yx(IX(s), 8)).a = m - o.a; + for (b = new pb(c.b); b.a < b.c.c.length; ) mp((f = Yx(Hz(b), 70)).n, m - f.o.a); + } + for (w = new pb(y.f); w.a < w.c.c.length; ) mp((f = Yx(Hz(w), 70)).n, y.o.a - f.o.a); + } + for (d.k == (bon(), _zn) && (b5(d, (Ojn(), hQn), c3(Yx(Aun(d, hQn), 61))), aon(d)), l = new pb(d.b); l.a < l.c.c.length; ) + arn((f = Yx(Hz(l), 70))), mp(f.n, v.a - f.o.a); + } + })(t, n), + lD(n.d), + lD(Yx(Aun(n, (gjn(), z1n)), 207)); + } + function cX(n, t) { + var e, i; + return (i = null), (e = jG(n, t)) && (i = e.fe()), i; + } + function aX(n, t) { + var e, i; + return (i = null), (e = VJ(n, t)) && (i = e.ie()), i; + } + function uX(n, t) { + var e, i; + return (i = null), (e = jG(n, t)) && (i = e.ie()), i; + } + function oX(n, t) { + var e, i; + return (i = null), (e = jG(n, t)) && (i = osn(e)), i; + } + function sX(n, t, i) { + var r; + r = (function () { + var n; + return ( + 0 != y_n && (n = Date.now ? Date.now() : new Date().getTime()) - k_n > 2e3 && ((k_n = n), (j_n = e.setTimeout(Ij, 10))), + 0 == y_n++ && + ((function (n) { + var t, e; + if (n.a) { + e = null; + do { + (t = n.a), (n.a = null), (e = Zon(t, e)); + } while (n.a); + n.a = e; + } + })((py(), g_n)), + !0) + ); + })(); + try { + return (function (n, t, e) { + return n.apply(t, e); + })(n, t, i); + } finally { + !(function (n) { + n && + (function (n) { + var t, e; + if (n.b) { + e = null; + do { + (t = n.b), (n.b = null), (e = Zon(t, e)); + } while (n.b); + n.b = e; + } + })((py(), g_n)), + --y_n, + n && + -1 != j_n && + ((function (n) { + e.clearTimeout(n); + })(j_n), + (j_n = -1)); + })(r); + } + } + function hX(n) { + var t; + (t = n.Wg()), (this.a = CO(t, 69) ? Yx(t, 69).Zh() : t.Kc()); + } + function fX() { + hm.call(this), (this.j.c = VQ(UKn, iEn, 1, 0, 5, 1)), (this.a = -1); + } + function lX(n, t, e, i) { + (this.d = n), (this.n = t), (this.g = e), (this.o = i), (this.p = -1); + } + function bX(n, t, e, i) { + (this.e = i), (this.d = null), (this.c = n), (this.a = t), (this.b = e); + } + function wX(n, t, e) { + (this.d = new sd(this)), (this.e = n), (this.i = t), (this.f = e); + } + function dX() { + (dX = O), (zVn = new nS(pSn, 0)), (UVn = new nS("TOP_LEFT", 1)); + } + function gX() { + (gX = O), (K3n = RB(d9(1), d9(4))), (R3n = RB(d9(1), d9(2))); + } + function pX() { + (pX = O), (l9n = z6((eT(), x4(Gy(d9n, 1), XEn, 551, 0, [h9n])))); + } + function vX() { + (vX = O), (s9n = z6((tT(), x4(Gy(f9n, 1), XEn, 482, 0, [u9n])))); + } + function mX() { + (mX = O), (a7n = z6((iT(), x4(Gy(s7n, 1), XEn, 530, 0, [r7n])))); + } + function yX() { + (yX = O), (yqn = z6((BE(), x4(Gy(Bqn, 1), XEn, 481, 0, [vqn])))); + } + function kX(n, t, e, i) { + return CO(e, 54) ? new C$(n, t, e, i) : new LK(n, t, e, i); + } + function jX(n, t) { + return Yx(qA(QK(Yx(_V(n.k, t), 15).Oc(), hWn)), 113); + } + function EX(n, t) { + return Yx(qA(YK(Yx(_V(n.k, t), 15).Oc(), hWn)), 113); + } + function TX(n) { + return new Nz( + (function (n, t) { + var e, i; + for (XH(), i = new ip(), e = 0; e < n; ++e) i.c[i.c.length] = t; + return new xy(i); + })(Yx(n.a.dd(), 14).gc(), n.a.cd()), + 16, + ); + } + function MX(n) { + return CO(n, 14) ? Yx(n, 14).dc() : !n.Kc().Ob(); + } + function SX(n) { + return JE(), CO(n.g, 145) ? Yx(n.g, 145) : null; + } + function PX(n) { + if (n.e.g != n.b) throw hp(new Dp()); + return !!n.c && n.d > 0; + } + function IX(n) { + return S$(n.b != n.d.c), (n.c = n.b), (n.b = n.b.a), ++n.a, n.c.c; + } + function CX(n, t) { + vB(t), DF(n.a, n.c, t), (n.c = (n.c + 1) & (n.a.length - 1)), vrn(n); + } + function OX(n, t) { + vB(t), (n.b = (n.b - 1) & (n.a.length - 1)), DF(n.a, n.b, t), vrn(n); + } + function AX(n, t) { + var e; + for (e = n.j.c.length; e < t; e++) eD(n.j, n.rg()); + } + function $X(n, t, e, i) { + var r; + return (r = i[t.g][e.g]), ty(fL(Aun(n.a, r))); + } + function LX(n, t, e, i, r) { + (this.i = n), (this.a = t), (this.e = e), (this.j = i), (this.f = r); + } + function NX(n, t, e, i, r) { + (this.a = n), (this.e = t), (this.f = e), (this.b = i), (this.g = r); + } + function xX(n, t, e) { + return t < 0 ? zhn(n, e) : Yx(e, 66).Nj().Sj(n, n.yh(), t); + } + function DX(n, t, e) { + var i; + return (i = itn(e)), Sgn(n.j, i, t), xB(n.k, t, e), t; + } + function RX(n) { + var t; + return xk(), (t = new io()), n && Sbn(t, n), t; + } + function KX(n) { + var t; + return (t = n.ri(n.i)), n.i > 0 && smn(n.g, 0, t, 0, n.i), t; + } + function _X(n, t) { + var e; + return MT(), !(e = Yx(BF(Nct, n), 55)) || e.wj(t); + } + function FX(n) { + var t; + for (t = 0; n.Ob(); ) n.Pb(), (t = t7(t, 1)); + return PZ(t); + } + function BX(n, t) { + var e; + return (e = new $y()), n.xd(e), (e.a += ".."), t.yd(e), e.a; + } + function HX(n, t, e) { + return fvn(n, t, e, CO(t, 99) && 0 != (Yx(t, 18).Bb & eMn)); + } + function qX(n, t, e) { + return (function (n, t, e, i) { + var r, c, a, u, o, s; + if (((u = new go()), (o = dwn(n.e.Tg(), t)), (r = Yx(n.g, 119)), TT(), Yx(t, 66).Oj())) + for (a = 0; a < n.i; ++a) (c = r[a]), o.rl(c.ak()) && fY(u, c); + else for (a = 0; a < n.i; ++a) (c = r[a]), o.rl(c.ak()) && ((s = c.dd()), fY(u, i ? qhn(n, t, a, u.i, s) : s)); + return bnn(u, e); + })(n, t, e, CO(t, 99) && 0 != (Yx(t, 18).Bb & eMn)); + } + function GX(n, t) { + return n == (bon(), Hzn) && t == Hzn ? 4 : n == Hzn || t == Hzn ? 8 : 32; + } + function zX(n, t) { + return iI(t) === iI(n) ? "(this Map)" : null == t ? aEn : I7(t); + } + function UX(n, t, e) { + var i; + return (i = itn(e)), xB(n.b, i, t), xB(n.c, t, e), t; + } + function XX(n, t) { + var e; + for (e = t; e; ) $$(n, e.i, e.j), (e = IG(e)); + return n; + } + function WX(n, t) { + var e; + return (e = lq(Jx(new wJ(n, t)))), vR(new wJ(n, t)), e; + } + function VX(n, t) { + var e; + return ( + TT(), + (function (n, t) { + var e; + if (null != t && !n.c.Yj().wj(t)) + throw ( + ((e = CO(t, 56) ? Yx(t, 56).Tg().zb : Nk(V5(t))), + hp(new Vm(mNn + n.c.ne() + "'s type '" + n.c.Yj().ne() + "' does not permit a value of type '" + e + "'"))) + ); + })((e = Yx(n, 66).Mj()), t), + e.Ok(t) + ); + } + function QX(n, t, e, i, r) { + eD( + t, + (function (n, t) { + for ( + n.r = new a4(n.p), + (function (n, t) { + n.r = t; + })(n.r, n), + C2(n.r.j, n.j), + BH(n.j), + KD(n.j, t), + KD(n.r.e, t), + lF(n), + lF(n.r); + 0 != n.f.c.length; + + ) + pO(Yx(TR(n.f, 0), 129)); + for (; 0 != n.k.c.length; ) pO(Yx(TR(n.k, 0), 129)); + return n.r; + })( + r, + (function (n, t, e) { + var i, r, c, a, u, o; + for (c = -1, u = -1, a = 0; a < t.c.length && ($z(a, t.c.length), !((r = Yx(t.c[a], 329)).c > n.c)); a++) + r.a >= n.s && (c < 0 && (c = a), (u = a)); + return ( + (o = (n.s + n.c) / 2), + c >= 0 && + ((o = (function (n) { + return (n.c + n.a) / 2; + })( + ($z( + (i = (function (n, t, e, i) { + var r, c, a, u, o, s, h, f, l, b, w; + if (((c = e), e < i)) + for ( + b = new a4(n.p), + w = new a4(n.p), + C2(b.e, n.e), + b.q = n.q, + b.r = w, + lF(b), + C2(w.j, n.j), + w.r = b, + lF(w), + f = Yx((l = new mP(b, w)).a, 112), + h = Yx(l.b, 112), + $z(c, t.c.length), + a = ddn(n, f, h, (r = Yx(t.c[c], 329))), + s = e + 1; + s <= i; + s++ + ) + $z(s, t.c.length), Cen((u = Yx(t.c[s], 329)), (o = ddn(n, f, h, u)), r, a) && ((r = u), (a = o)); + return c; + })(n, t, c, u)), + t.c.length, + ), + Yx(t.c[i], 329)), + )), + (function (n, t, e) { + var i, r, c, a, u, o; + $z(t, n.c.length), + (u = Yx(n.c[t], 329)), + KV(n, t), + u.b / 2 >= e && + ((i = t), + (c = (o = (u.c + u.a) / 2) - e), + u.c <= o - e && ZR(n, i++, new Lx(u.c, c)), + (a = o + e) <= u.a && ((r = new Lx(a, u.a)), iz(i, n.c.length), GT(n.c, i, r))); + })(t, i, e)), + o + ); + })(r, e, i), + ), + ), + (function (n, t, e) { + var i, r, c, a; + for (c = t.q, a = t.r, new wz((iQ(), K4n), t, c, 1), new wz(K4n, c, a, 1), r = new pb(e); r.a < r.c.c.length; ) + (i = Yx(Hz(r), 112)) != c && i != t && i != a && (gmn(n.a, i, t), gmn(n.a, i, a)); + })(n, r, t); + } + function YX(n, t, e) { + (n.i = 0), (n.e = 0), t != e && (q5(n, t, e), H5(n, t, e)); + } + function JX(n, t) { + var e; + (e = n.q.getHours()), n.q.setFullYear(t + TTn), Ivn(n, e); + } + function ZX(n, t, e) { + if (e) { + var i = e.ee(); + e = i(e); + } else e = void 0; + n.a[t] = e; + } + function nW(n) { + if (n < 0) throw hp(new Jm("Negative array size: " + n)); + } + function tW(n) { + return n.n || (bV(n), (n.n = new EK(n, hat, n)), Iq(n)), n.n; + } + function eW(n) { + return S$(n.a < n.c.a.length), (n.b = n.a), cZ(n), n.c.b[n.b]; + } + function iW(n) { + n.b != n.c && ((n.a = VQ(UKn, iEn, 1, 8, 5, 1)), (n.b = 0), (n.c = 0)); + } + function rW(n) { + (this.b = new rp()), (this.c = new rp()), (this.d = new rp()), (this.a = n); + } + function cW(n, t) { + Ljn(), np.call(this, n), (this.a = t), (this.c = -1), (this.b = -1); + } + function aW(n, t, e, i) { + eU.call(this, 1, e, i), (this.c = n), (this.b = t); + } + function uW(n, t, e, i) { + iU.call(this, 1, e, i), (this.c = n), (this.b = t); + } + function oW(n, t, e, i, r, c, a) { + E0.call(this, t, i, r, c, a), (this.c = n), (this.a = e); + } + function sW(n, t, e) { + (this.e = n), (this.a = UKn), (this.b = Zdn(t)), (this.c = t), (this.d = e); + } + function hW(n) { + (this.e = n), (this.c = this.e.a), (this.b = this.e.g), (this.d = this.e.i); + } + function fW(n) { + (this.c = n), (this.a = Yx(fcn(n), 148)), (this.b = this.a.Aj().Nh()); + } + function lW(n) { + (this.d = n), (this.b = this.d.a.entries()), (this.a = this.b.next()); + } + function bW() { + rp.call(this), j$(this), (this.d.b = this.d), (this.d.a = this.d); + } + function wW(n, t) { + uN.call(this), (this.a = n), (this.b = t), eD(this.a.b, this); + } + function dW(n, t) { + return dI(null != t ? aG(n, t) : eI(Dq(n.f, t))); + } + function gW(n, t) { + return dI(null != t ? aG(n, t) : eI(Dq(n.f, t))); + } + function pW(n, t) { + var e; + for (e = 0; e < t; ++e) DF(n, e, new db(Yx(n[e], 42))); + } + function vW(n, t) { + var e; + return A6(), 0 != (e = n.j.g - t.j.g) ? e : 0; + } + function mW(n, t) { + return ( + vB(t), + null != n.a + ? (function (n) { + return null == n ? FFn : new Am(vB(n)); + })(t.Kb(n.a)) + : FFn + ); + } + function yW(n) { + var t; + return n ? new jR(n) : ($2((t = new oC()), n), t); + } + function kW(n, t) { + return t.b.Kb(fJ(n, t.c.Ee(), new qb(t))); + } + function jW(n) { + Qan(), $O(this, WR(Gz(zK(n, 24), TMn)), WR(Gz(n, TMn))); + } + function EW() { + (EW = O), (ABn = z6((nen(), x4(Gy(NBn, 1), XEn, 428, 0, [CBn, IBn])))); + } + function TW() { + (TW = O), (xBn = z6((sZ(), x4(Gy(JBn, 1), XEn, 427, 0, [$Bn, LBn])))); + } + function MW() { + (MW = O), (Zqn = z6((hZ(), x4(Gy(UGn, 1), XEn, 424, 0, [Qqn, Yqn])))); + } + function SW() { + (SW = O), (cUn = z6((g2(), x4(Gy(oUn, 1), XEn, 511, 0, [iUn, eUn])))); + } + function PW() { + (PW = O), (qWn = z6((fZ(), x4(Gy(XWn, 1), XEn, 419, 0, [FWn, BWn])))); + } + function IW() { + (IW = O), (aVn = z6((cJ(), x4(Gy(bVn, 1), XEn, 479, 0, [rVn, iVn])))); + } + function CW() { + (CW = O), (d3n = z6((rQ(), x4(Gy(m3n, 1), XEn, 376, 0, [b3n, l3n])))); + } + function OW() { + (OW = O), (t3n = z6(($J(), x4(Gy(c3n, 1), XEn, 421, 0, [J2n, Z2n])))); + } + function AW() { + (AW = O), (jWn = z6((aY(), x4(Gy(SWn, 1), XEn, 422, 0, [mWn, yWn])))); + } + function $W() { + ($W = O), (WVn = z6((dX(), x4(Gy(rYn, 1), XEn, 420, 0, [zVn, UVn])))); + } + function LW() { + (LW = O), (B4n = z6((iQ(), x4(Gy(V4n, 1), XEn, 520, 0, [_4n, K4n])))); + } + function NW() { + (NW = O), (r4n = z6((GW(), x4(Gy(s4n, 1), XEn, 523, 0, [e4n, t4n])))); + } + function xW() { + (xW = O), (p4n = z6((Jq(), x4(Gy(y4n, 1), XEn, 516, 0, [d4n, w4n])))); + } + function DW() { + (DW = O), (k4n = z6((RG(), x4(Gy(F4n, 1), XEn, 515, 0, [v4n, m4n])))); + } + function RW() { + (RW = O), (Q4n = z6((Yq(), x4(Gy(t5n, 1), XEn, 455, 0, [X4n, W4n])))); + } + function KW() { + (KW = O), (r6n = z6((kU(), x4(Gy(l6n, 1), XEn, 425, 0, [e6n, t6n])))); + } + function _W() { + (_W = O), (b6n = z6((p2(), x4(Gy(p6n, 1), XEn, 495, 0, [h6n, f6n])))); + } + function FW() { + (FW = O), (n6n = z6((KG(), x4(Gy(i6n, 1), XEn, 480, 0, [Y5n, J5n])))); + } + function BW() { + (BW = O), (j6n = z6((CY(), x4(Gy(S6n, 1), XEn, 426, 0, [m6n, y6n])))); + } + function HW() { + (HW = O), (h7n = z6((B4(), x4(Gy(f7n, 1), XEn, 429, 0, [o7n, u7n])))); + } + function qW() { + (qW = O), (g9n = z6((cQ(), x4(Gy(j9n, 1), XEn, 430, 0, [w9n, b9n])))); + } + function GW() { + (GW = O), (e4n = new gS("UPPER", 0)), (t4n = new gS("LOWER", 1)); + } + function zW(n, t) { + var e, i; + for (e = t, i = 0; e > 0; ) (i += n.a[e]), (e -= e & -e); + return i; + } + function UW(n, t) { + var e; + for (e = t; e; ) $$(n, -e.i, -e.j), (e = IG(e)); + return n; + } + function XW(n, t) { + var e, i; + for (vB(t), i = n.Kc(); i.Ob(); ) (e = i.Pb()), t.td(e); + } + function WW(n, t) { + var e; + return new Wj((e = t.cd()), n.e.pc(e, Yx(t.dd(), 14))); + } + function VW(n, t, e, i) { + var r; + ((r = new $()).c = t), (r.b = e), (r.a = i), (i.b = e.a = r), ++n.b; + } + function QW(n, t, e) { + var i; + return $z(t, n.c.length), (i = n.c[t]), (n.c[t] = e), i; + } + function YW(n) { + return n.c && n.d ? Yz(n.c) + "->" + Yz(n.d) : "e_" + _A(n); + } + function JW(n, t) { + return (W9(n), ej(new SR(n, new _Y(t, n.a)))).sd(dBn); + } + function ZW(n) { + return !(!n.c || !n.d || !n.c.i || n.c.i != n.d.i); + } + function nV(n) { + if (!n.c.Sb()) throw hp(new Kp()); + return (n.a = !0), n.c.Ub(); + } + function tV(n) { + (n.i = 0), qT(n.b, null), qT(n.c, null), (n.a = null), (n.e = null), ++n.g; + } + function eV(n) { + KT.call(this, null == n ? aEn : I7(n), CO(n, 78) ? Yx(n, 78) : null); + } + function iV(n) { + Tjn(), sp(this), (this.a = new ME()), a6(this, n), KD(this.a, n); + } + function rV() { + AC(this), (this.b = new QS(JTn, JTn)), (this.a = new QS(ZTn, ZTn)); + } + function cV(n, t) { + (this.c = 0), (this.b = t), SI.call(this, n, 17493), (this.a = this.c); + } + function aV(n) { + uV(), hBn || ((this.c = n), (this.e = !0), (this.a = new ip())); + } + function uV() { + (uV = O), (hBn = !0), (oBn = !1), (sBn = !1), (lBn = !1), (fBn = !1); + } + function oV(n, t) { + return !!CO(t, 149) && _N(n.c, Yx(t, 149).c); + } + function sV(n, t) { + var e; + return (e = 0), n && (e += n.f.a / 2), t && (e += t.f.a / 2), e; + } + function hV(n, t) { + return Yx(UJ(n.d, t), 23) || Yx(UJ(n.e, t), 23); + } + function fV(n) { + (this.b = n), UO.call(this, n), (this.a = Yx(H3(this.b.a, 4), 126)); + } + function lV(n) { + (this.b = n), u$.call(this, n), (this.a = Yx(H3(this.b.a, 4), 126)); + } + function bV(n) { + return n.t || ((n.t = new Kg(n)), y9(new Um(n), 0, n.t)), n.t; + } + function wV() { + var n, t; + (wV = O), Rk(), (t = new Bp()), (gut = t), (n = new qv()), (put = n); + } + function dV(n) { + var t; + return n.c || (CO((t = n.r), 88) && (n.c = Yx(t, 26))), n.c; + } + function gV(n) { + return rO(n & BTn, (n >> 22) & BTn, n < 0 ? HTn : 0); + } + function pV(n, t) { + var e, i; + (e = Yx( + (function (n, t) { + MF(n); + try { + return n.Bc(t); + } catch (n) { + if (CO((n = j4(n)), 205) || CO(n, 173)) return null; + throw hp(n); + } + })(n.c, t), + 14, + )) && ((i = e.gc()), e.$b(), (n.d -= i)); + } + function vV(n, t) { + var e; + return !!(e = c6(n, t.cd())) && qB(e.e, t.dd()); + } + function mV(n, t) { + return 0 == t || 0 == n.e ? n : t > 0 ? Nnn(n, t) : Own(n, -t); + } + function yV(n, t) { + return 0 == t || 0 == n.e ? n : t > 0 ? Own(n, t) : Nnn(n, -t); + } + function kV(n) { + if (Vfn(n)) return (n.c = n.a), n.a.Pb(); + throw hp(new Kp()); + } + function jV(n) { + var t, e; + return (t = n.c.i), (e = n.d.i), t.k == (bon(), _zn) && e.k == _zn; + } + function EV(n) { + var t; + return o4((t = new jq()), n), b5(t, (gjn(), $1n), null), t; + } + function TV(n, t, e) { + var i; + return (i = n.Yg(t)) >= 0 ? n._g(i, e, !0) : tfn(n, t, e); + } + function MV(n, t, e, i) { + var r; + for (r = 0; r < bHn; r++) mK(n.a[t.g][r], e, i[t.g]); + } + function SV(n, t, e, i) { + var r; + for (r = 0; r < wHn; r++) vK(n.a[r][t.g], e, i[t.g]); + } + function PV(n, t, e, i, r) { + eU.call(this, t, i, r), (this.c = n), (this.a = e); + } + function IV(n, t, e, i, r) { + iU.call(this, t, i, r), (this.c = n), (this.a = e); + } + function CV(n, t, e, i, r) { + $V.call(this, t, i, r), (this.c = n), (this.a = e); + } + function OV(n, t, e, i, r) { + $V.call(this, t, i, r), (this.c = n), (this.b = e); + } + function AV(n, t, e) { + zg.call(this, e), (this.b = n), (this.c = t), (this.d = (onn(), aut)); + } + function $V(n, t, e) { + (this.d = n), (this.k = t ? 1 : 0), (this.f = e ? 1 : 0), (this.o = -1), (this.p = 0); + } + function LV(n, t, e) { + var i; + i3((i = new yO(n.a)), n.a.a), Ysn(i.f, t, e), (n.a.a = i); + } + function NV(n, t) { + n.qi(n.i + 1), _O(n, n.i, n.oi(n.i, t)), n.bi(n.i++, t), n.ci(); + } + function xV(n) { + var t, e; + ++n.j, (t = n.g), (e = n.i), (n.g = null), (n.i = 0), n.di(e, t), n.ci(); + } + function DV(n) { + var t; + return ( + MF(n), + L5( + (t = new pQ( + (function (n) { + return g0(n, VEn), PZ(t7(t7(5, n), (n / 10) | 0)); + })(n.length), + )), + n, + ), + t + ); + } + function RV(n) { + var t; + return MF(n), Dsn((t = n ? new sx(n) : Jx(n.Kc()))), $8(t); + } + function KV(n, t) { + var e; + return $z(t, n.c.length), (e = n.c[t]), uj(n.c, t, 1), e; + } + function _V(n, t) { + var e; + return !(e = Yx(n.c.xc(t), 14)) && (e = n.ic(t)), n.pc(t, e); + } + function FV(n, t) { + var e, i; + return vB(n), (e = n), vB(t), e == (i = t) ? 0 : e < i ? -1 : 1; + } + function BV(n) { + var t; + return (t = n.e + n.f), isNaN(t) && ex(n.d) ? n.d : t; + } + function HV(n, t) { + return n.a ? yI(n.a, n.b) : (n.a = new SA(n.d)), vI(n.a, t), n; + } + function qV(n, t) { + if (n < 0 || n > t) throw hp(new Hm(Usn(n, t, "index"))); + return n; + } + function GV(n, t, e, i) { + var r; + return ( + (function (n, t, e, i, r) { + var c, a; + for (c = 0, a = 0; a < r; a++) (c = t7(c, n7(Gz(t[a], uMn), Gz(i[a], uMn)))), (n[a] = WR(c)), (c = zK(c, 32)); + for (; a < e; a++) (c = t7(c, Gz(t[a], uMn))), (n[a] = WR(c)), (c = zK(c, 32)); + })((r = VQ(Wot, MTn, 25, t, 15, 1)), n, t, e, i), + r + ); + } + function zV(n, t) { + return aI(t) ? (null == t ? Qfn(n.f, null) : s4(n.g, t)) : Qfn(n.f, t); + } + function UV(n) { + (this.c = n), (this.a = new pb(this.c.a)), (this.b = new pb(this.c.b)); + } + function XV() { + (this.e = new ip()), (this.c = new ip()), (this.d = new ip()), (this.b = new ip()); + } + function WV() { + (this.g = new nv()), (this.b = new nv()), (this.a = new ip()), (this.k = new ip()); + } + function VV(n, t, e) { + (this.a = n), (this.c = t), (this.d = e), eD(t.e, this), eD(e.b, this); + } + function QV(n, t) { + MI.call(this, t.rd(), -6 & t.qd()), vB(n), (this.a = n), (this.b = t); + } + function YV(n, t) { + SI.call(this, t.rd(), -6 & t.qd()), vB(n), (this.a = n), (this.b = t); + } + function JV(n, t) { + PI.call(this, t.rd(), -6 & t.qd()), vB(n), (this.a = n), (this.b = t); + } + function ZV(n, t, e) { + (this.a = n), (this.b = t), (this.c = e), eD(n.t, this), eD(t.i, this); + } + function nQ() { + (this.b = new ME()), (this.a = new ME()), (this.b = new ME()), (this.a = new ME()); + } + function tQ() { + (tQ = O), (K7n = new Og("org.eclipse.elk.labels.labelManager")); + } + function eQ() { + (eQ = O), (gXn = new _L("separateLayerConnections", (R4(), yXn))); + } + function iQ() { + (iQ = O), (_4n = new MS("REGULAR", 0)), (K4n = new MS("CRITICAL", 1)); + } + function rQ() { + (rQ = O), (b3n = new fS("STACKED", 0)), (l3n = new fS("SEQUENCED", 1)); + } + function cQ() { + (cQ = O), (w9n = new HS("FIXED", 0)), (b9n = new HS("CENTER_NODE", 1)); + } + function aQ(n, t) { + var e; + return ( + (e = (function (n, t) { + var e, i, r, c, a, u, o, s, h, f; + for (h = new ip(), f = new ep(), c = null, r = 0, i = 0; i < t.length; ++i) + switch ((E6(c, (e = t[i])) && (r = _nn(n, f, h, J3n, r)), O$(e, (Ojn(), vQn)) && (c = Yx(Aun(e, vQn), 10)), e.k.g)) { + case 0: + for (o = xC(Qx(i7(e, (Ikn(), Tit)), new xc())); X0(o); ) (a = Yx(bJ(o), 11)), (n.d[a.p] = r++), (h.c[h.c.length] = a); + for (r = _nn(n, f, h, J3n, r), s = xC(Qx(i7(e, Bit), new xc())); X0(s); ) + (a = Yx(bJ(s), 11)), (n.d[a.p] = r++), (h.c[h.c.length] = a); + break; + case 3: + i7(e, Y3n).dc() || ((a = Yx(i7(e, Y3n).Xb(0), 11)), (n.d[a.p] = r++), (h.c[h.c.length] = a)), + i7(e, J3n).dc() || OX(f, e); + break; + case 1: + for (u = i7(e, (Ikn(), qit)).Kc(); u.Ob(); ) (a = Yx(u.Pb(), 11)), (n.d[a.p] = r++), (h.c[h.c.length] = a); + i7(e, Eit).Jc(new pS(f, e)); + } + return _nn(n, f, h, J3n, r), h; + })(n, t)), + (n.b = new s2(e.c.length)), + (function (n, t) { + var e, i, r, c, a, u, o; + for (e = 0, o = new ip(), c = new pb(t); c.a < c.c.c.length; ) { + switch (((r = Yx(Hz(c), 11)), R6(n.b, n.d[r.p]), (o.c = VQ(UKn, iEn, 1, 0, 5, 1)), r.i.k.g)) { + case 0: + WZ(Yx(Aun(r, (Ojn(), RQn)), 10).j, new jd(o)); + break; + case 1: + cO(G5(hH(new SR(null, new Nz(r.i.j, 16)), new Ed(r))), new Td(o)); + break; + case 3: + eD(o, new mP(Yx(Aun(r, (Ojn(), CQn)), 11), d9(r.e.c.length + r.g.c.length))); + } + for (u = new pb(o); u.a < u.c.c.length; ) + (a = Yx(Hz(u), 46)), (i = cj(n, Yx(a.a, 11))) > n.d[r.p] && ((e += zW(n.b, i) * Yx(a.b, 19).a), OX(n.a, d9(i))); + for (; !ry(n.a); ) eZ(n.b, Yx($_(n.a), 19).a); + } + return e; + })(n, e) + ); + } + function uQ(n) { + var t; + return n.a || (CO((t = n.r), 148) && (n.a = Yx(t, 148))), n.a; + } + function oQ(n) { + return n.a ? (n.e ? oQ(n.e) : null) : n; + } + function sQ(n, t) { + return vB(t), n.c < n.d && (n.ze(t, n.c++), !0); + } + function hQ(n, t) { + return !!P_(n.a, t) && (zV(n.a, t), !0); + } + function fQ(n) { + var t; + for (yB(n), t = 0; n.a.sd(new fn()); ) t = t7(t, 1); + return t; + } + function lQ(n, t, e) { + var i, r; + for (i = 0, r = 0; r < t.length; r++) i += n.$f(t[r], i, e); + } + function bQ(n, t, e) { + return HU(t, n.e.Hd().gc()), HU(e, n.c.Hd().gc()), n.a[t][e]; + } + function wQ(n, t) { + bdn(), (this.e = n), (this.d = 1), (this.a = x4(Gy(Wot, 1), MTn, 25, 15, [t])); + } + function dQ(n, t, e, i) { + (this.f = n), (this.e = t), (this.d = e), (this.b = i), (this.c = i ? i.d : null); + } + function gQ(n) { + var t, e, i, r; + (r = n.d), (t = n.a), (e = n.b), (i = n.c), (n.d = e), (n.a = i), (n.b = r), (n.c = t); + } + function pQ(n) { + AC(this), jD(n >= 0, "Initial capacity must not be negative"); + } + function vQ() { + (vQ = O), (oHn = z6((JZ(), x4(Gy(sHn, 1), XEn, 232, 0, [rHn, cHn, aHn])))); + } + function mQ() { + (mQ = O), (dHn = z6((BY(), x4(Gy(gHn, 1), XEn, 461, 0, [fHn, hHn, lHn])))); + } + function yQ() { + (yQ = O), (kHn = z6((OJ(), x4(Gy(GHn, 1), XEn, 462, 0, [mHn, vHn, pHn])))); + } + function kQ() { + (kQ = O), (bBn = z6((C6(), x4(Gy(wBn, 1), XEn, 132, 0, [cBn, aBn, uBn])))); + } + function jQ() { + (jQ = O), (XGn = z6((CJ(), x4(Gy(ezn, 1), XEn, 379, 0, [GGn, qGn, zGn])))); + } + function EQ() { + (EQ = O), (Ozn = z6((e9(), x4(Gy(Lzn, 1), XEn, 423, 0, [Izn, Pzn, Szn])))); + } + function TQ() { + (TQ = O), (PWn = z6((O0(), x4(Gy(AWn, 1), XEn, 314, 0, [TWn, EWn, MWn])))); + } + function MQ() { + (MQ = O), ($Wn = z6((f0(), x4(Gy(KWn, 1), XEn, 337, 0, [IWn, OWn, CWn])))); + } + function SQ() { + (SQ = O), (WWn = z6((i5(), x4(Gy(tVn, 1), XEn, 450, 0, [zWn, GWn, UWn])))); + } + function PQ() { + (PQ = O), (ZXn = z6((v2(), x4(Gy(oWn, 1), XEn, 361, 0, [YXn, QXn, VXn])))); + } + function IQ() { + (IQ = O), (GVn = z6((AJ(), x4(Gy(XVn, 1), XEn, 303, 0, [BVn, HVn, FVn])))); + } + function CQ() { + (CQ = O), (_Vn = z6((r4(), x4(Gy(qVn, 1), XEn, 292, 0, [DVn, RVn, xVn])))); + } + function OQ() { + (OQ = O), (E2n = z6((i8(), x4(Gy(I2n, 1), XEn, 378, 0, [m2n, y2n, k2n])))); + } + function AQ() { + (AQ = O), (f3n = z6((d3(), x4(Gy(w3n, 1), XEn, 375, 0, [u3n, o3n, s3n])))); + } + function $Q() { + ($Q = O), (Y2n = z6((k5(), x4(Gy(n3n, 1), XEn, 339, 0, [W2n, X2n, V2n])))); + } + function LQ() { + (LQ = O), (a3n = z6((h0(), x4(Gy(h3n, 1), XEn, 452, 0, [r3n, e3n, i3n])))); + } + function NQ() { + (NQ = O), (O3n = z6((F4(), x4(Gy(F3n, 1), XEn, 377, 0, [P3n, I3n, S3n])))); + } + function xQ() { + (xQ = O), (y3n = z6(($6(), x4(Gy(T3n, 1), XEn, 336, 0, [g3n, p3n, v3n])))); + } + function DQ() { + (DQ = O), (M3n = z6((V2(), x4(Gy(C3n, 1), XEn, 338, 0, [E3n, k3n, j3n])))); + } + function RQ() { + (RQ = O), (W3n = z6((l0(), x4(Gy(V3n, 1), XEn, 454, 0, [G3n, z3n, U3n])))); + } + function KQ() { + (KQ = O), (v6n = z6((m7(), x4(Gy(k6n, 1), XEn, 442, 0, [g6n, w6n, d6n])))); + } + function _Q() { + (_Q = O), (P6n = z6((I6(), x4(Gy(r8n, 1), XEn, 380, 0, [E6n, T6n, M6n])))); + } + function FQ() { + (FQ = O), (g8n = z6((p7(), x4(Gy(W8n, 1), XEn, 381, 0, [b8n, w8n, l8n])))); + } + function BQ() { + (BQ = O), (h8n = z6((w3(), x4(Gy(f8n, 1), XEn, 293, 0, [u8n, o8n, a8n])))); + } + function HQ() { + (HQ = O), (a9n = z6((v7(), x4(Gy(o9n, 1), XEn, 437, 0, [e9n, i9n, r9n])))); + } + function qQ() { + (qQ = O), (Det = z6((O8(), x4(Gy(Bet, 1), XEn, 334, 0, [Let, $et, Net])))); + } + function GQ() { + (GQ = O), (set = z6((ZZ(), x4(Gy(det, 1), XEn, 272, 0, [cet, aet, uet])))); + } + function zQ(n, t) { + return !n.o && (n.o = new yY((ajn(), Frt), mct, n, 0)), mnn(n.o, t); + } + function UQ(n) { + return !n.g && (n.g = new oo()), !n.g.c && (n.g.c = new Rg(n)), n.g.c; + } + function XQ(n, t, e) { + var i, r; + if (null != e) for (i = 0; i < t; ++i) (r = e[i]), n.fi(i, r); + } + function WQ(n, t, e, i) { + var r; + return ( + (function (n, t, e, i, r) { + var c, a; + if (((c = t7(Gz(t[0], uMn), Gz(i[0], uMn))), (n[0] = WR(c)), (c = zK(c, 32)), e >= r)) { + for (a = 1; a < r; a++) (c = t7(c, t7(Gz(t[a], uMn), Gz(i[a], uMn)))), (n[a] = WR(c)), (c = zK(c, 32)); + for (; a < e; a++) (c = t7(c, Gz(t[a], uMn))), (n[a] = WR(c)), (c = zK(c, 32)); + } else { + for (a = 1; a < e; a++) (c = t7(c, t7(Gz(t[a], uMn), Gz(i[a], uMn)))), (n[a] = WR(c)), (c = zK(c, 32)); + for (; a < r; a++) (c = t7(c, Gz(i[a], uMn))), (n[a] = WR(c)), (c = zK(c, 32)); + } + 0 != k8(c, 0) && (n[a] = WR(c)); + })((r = VQ(Wot, MTn, 25, t + 1, 15, 1)), n, t, e, i), + r + ); + } + function VQ(n, t, e, i, r, c) { + var a; + return (a = Zin(r, i)), 10 != r && x4(Gy(n, c), t, e, r, a), a; + } + function QQ(n, t, e) { + Yx(n.b, 65), Yx(n.b, 65), Yx(n.b, 65), WZ(n.a, new Ex(e, t, n)); + } + function YQ(n, t, e) { + if (n < 0 || t > e || t < n) throw hp(new Ly(NMn + n + DMn + t + MMn + e)); + } + function JQ(n) { + if (!n) throw hp(new Ym("Unable to add element to queue")); + } + function ZQ(n) { + n ? ((this.c = n), (this.b = null)) : ((this.c = null), (this.b = new ip())); + } + function nY(n, t) { + zT.call(this, n, t), (this.a = VQ(JFn, DEn, 436, 2, 0, 1)), (this.b = !0); + } + function tY(n) { + c5.call(this, n, 0), j$(this), (this.d.b = this.d), (this.d.a = this.d); + } + function eY(n) { + var t; + return 0 == (t = n.b).b ? null : Yx(ken(t, 0), 188).b; + } + function iY(n, t) { + var e; + return ((e = new q()).c = !0), (e.d = t.dd()), Fyn(n, t.cd(), e); + } + function rY(n, t, e) { + var i; + ((i = n.b[e.c.p][e.p]).b += t.b), (i.c += t.c), (i.a += t.a), ++i.a; + } + function cY(n, t) { + var i, r; + return (i = n.a - t.a), (r = n.b - t.b), e.Math.sqrt(i * i + r * r); + } + function aY() { + (aY = O), (mWn = new BM("QUADRATIC", 0)), (yWn = new BM("SCANLINE", 1)); + } + function uY() { + (uY = O), (L3n = yK(oR(new fX(), ($un(), YGn), ($jn(), xUn)), tzn, iXn)); + } + function oY(n) { + M$(!!n.c), zU(n.e, n), n.c.Qb(), (n.c = null), (n.b = M4(n)), tL(n.e, n); + } + function sY(n) { + return zU(n.c.a.e, n), S$(n.b != n.c.a.d), (n.a = n.b), (n.b = n.b.a), n.a; + } + function hY(n) { + var t; + return n.a || -1 == n.b || ((t = n.c.Tg()), (n.a = CZ(t, n.b))), n.a; + } + function fY(n, t) { + return !((n.hi() && n.Hc(t)) || (n.Yh(t), 0)); + } + function lY(n, t) { + return xq(t, "Horizontal alignment cannot be null"), (n.b = t), n; + } + function bY(n, t, e) { + var i; + return ( + Ljn(), + (i = Gkn(n, t)), + e && + i && + (function (n) { + return !!Bot && hq(Bot, n); + })(n) && + (i = null), + i + ); + } + function wY(n, t, e) { + var i; + for (i = n.Kc(); i.Ob(); ) bgn(Yx(i.Pb(), 37), t, e); + } + function dY(n, t) { + var e; + for (e = t.Kc(); e.Ob(); ) Dgn(n, Yx(e.Pb(), 37), 0, 0); + } + function gY(n, t, i) { + var r; + (n.d[t.g] = i), ((r = n.g.c)[t.g] = e.Math.max(r[t.g], i + 1)); + } + function pY(n, t) { + var e, i, r; + return (r = n.r), (i = n.d), (e = omn(n, t, !0)).b != r || e.a != i; + } + function vY(n, t) { + return xT(n.e, t) || Gtn(n.e, t, new Vtn(t)), Yx(UJ(n.e, t), 113); + } + function mY(n, t, e, i) { + return vB(n), vB(t), vB(e), vB(i), new R_(n, t, new G()); + } + function yY(n, t, e, i) { + this.rj(), (this.a = t), (this.b = n), (this.c = new g_(this, t, e, i)); + } + function kY(n, t, e, i, r, c) { + lX.call(this, t, i, r, c), (this.c = n), (this.b = e); + } + function jY(n, t, e, i, r, c) { + lX.call(this, t, i, r, c), (this.c = n), (this.a = e); + } + function EY(n, t, e) { + var i; + return (i = Hln(n.b, t)) ? Imn(SJ(n, i), e) : null; + } + function TY(n, t) { + var e; + return (e = n.Yg(t)) >= 0 ? n._g(e, !0, !0) : tfn(n, t, !0); + } + function MY() { + (MY = O), (a6n = ltn(ltn(bT(new fX(), (Krn(), J4n)), (ysn(), h5n)), a5n)); + } + function SY(n) { + for (; !n.a; ) if (!HN(n.c, new Fb(n))) return !1; + return !0; + } + function PY(n) { + return MF(n), CO(n, 198) ? Yx(n, 198) : new al(n); + } + function IY() { + var n, t, e, i; + (IY = O), + (d7n = new bu()), + (p7n = new wu()), + Cjn(), + (n = Ttt), + (t = d7n), + (e = itt), + (i = p7n), + KB(), + (g7n = new Em(x4(Gy(i_n, 1), DEn, 42, 0, [(gin(n, t), new Wj(n, t)), (gin(e, i), new Wj(e, i))]))); + } + function CY() { + (CY = O), (m6n = new xS("LEAF_NUMBER", 0)), (y6n = new xS("NODE_SIZE", 1)); + } + function OY(n) { + (n.a = VQ(Wot, MTn, 25, n.b + 1, 15, 1)), (n.c = VQ(Wot, MTn, 25, n.b, 15, 1)), (n.d = 0); + } + function AY(n, t) { + if (null == n.g || t >= n.i) throw hp(new BI(t, n.i)); + return n.g[t]; + } + function $Y(n, t, e) { + if ((k6(n, e), null != e && !n.wj(e))) throw hp(new Op()); + return e; + } + function LY(n) { + var t; + if (n.Ek()) for (t = n.i - 1; t >= 0; --t) c1(n, t); + return KX(n); + } + function NY(n) { + var t, e; + if (!n.b) return null; + for (e = n.b; (t = e.a[0]); ) e = t; + return e; + } + function xY(n, t) { + var e; + return nW(t), ((e = aJ(n.slice(0, t), n)).length = t), e; + } + function DY(n, t, e, i) { + WH(), (i = i || IFn), Xsn(n.slice(t, e), n, t, e, -t, i); + } + function RY(n, t, e, i, r) { + return t < 0 ? tfn(n, e, i) : Yx(e, 66).Nj().Pj(n, n.yh(), t, i, r); + } + function KY(n, t) { + if (t.a) throw hp(new Im(GMn)); + __(n.a, t), (t.a = n), !n.j && (n.j = t); + } + function _Y(n, t) { + PI.call(this, t.rd(), -16449 & t.qd()), vB(n), (this.a = n), (this.c = t); + } + function FY(n, t) { + var e, i; + return (i = (t / n.c.Hd().gc()) | 0), (e = t % n.c.Hd().gc()), bQ(n, i, e); + } + function BY() { + (BY = O), (fHn = new oM(ySn, 0)), (hHn = new oM(pSn, 1)), (lHn = new oM(kSn, 2)); + } + function HY() { + (HY = O), (WFn = new _T("All", 0)), (VFn = new CC()), (QFn = new hO()), (YFn = new OC()); + } + function qY() { + (qY = O), (ZFn = z6((HY(), x4(Gy(nBn, 1), XEn, 297, 0, [WFn, VFn, QFn, YFn])))); + } + function GY() { + (GY = O), (vzn = z6((_4(), x4(Gy(Czn, 1), XEn, 405, 0, [bzn, gzn, wzn, dzn])))); + } + function zY() { + (zY = O), (ZHn = z6((e4(), x4(Gy(rqn, 1), XEn, 406, 0, [YHn, WHn, VHn, QHn])))); + } + function UY() { + (UY = O), (cqn = z6((Sen(), x4(Gy(aqn, 1), XEn, 323, 0, [tqn, nqn, eqn, iqn])))); + } + function XY() { + (XY = O), (pqn = z6((Pen(), x4(Gy(mqn, 1), XEn, 394, 0, [bqn, lqn, wqn, dqn])))); + } + function WY() { + (WY = O), (e5n = z6((Krn(), x4(Gy(i5n, 1), XEn, 393, 0, [Y4n, J4n, Z4n, n5n])))); + } + function VY() { + (VY = O), (jXn = z6((R4(), x4(Gy(AXn, 1), XEn, 360, 0, [yXn, vXn, mXn, pXn])))); + } + function QY() { + (QY = O), (c8n = z6((Hin(), x4(Gy(s8n, 1), XEn, 340, 0, [i8n, t8n, e8n, n8n])))); + } + function YY() { + (YY = O), (RXn = z6((K4(), x4(Gy(qXn, 1), XEn, 411, 0, [$Xn, LXn, NXn, xXn])))); + } + function JY() { + (JY = O), (C2n = z6((Hen(), x4(Gy(x2n, 1), XEn, 197, 0, [S2n, P2n, M2n, T2n])))); + } + function ZY() { + (ZY = O), (Srt = z6((P6(), x4(Gy(Crt, 1), XEn, 396, 0, [jrt, Ert, krt, Trt])))); + } + function nJ() { + (nJ = O), (Het = z6((Frn(), x4(Gy(Jet, 1), XEn, 285, 0, [Fet, Ret, Ket, _et])))); + } + function tJ() { + (tJ = O), (get = z6((g7(), x4(Gy(Eet, 1), XEn, 218, 0, [wet, fet, het, bet])))); + } + function eJ() { + (eJ = O), (mrt = z6((unn(), x4(Gy(yrt, 1), XEn, 311, 0, [prt, wrt, grt, drt])))); + } + function iJ() { + (iJ = O), (ert = z6((Ann(), x4(Gy(lrt, 1), XEn, 374, 0, [Zit, nrt, Jit, Yit])))); + } + function rJ() { + (rJ = O), Jvn(), (iot = JTn), (eot = ZTn), (cot = new ib(JTn)), (rot = new ib(ZTn)); + } + function cJ() { + (cJ = O), (rVn = new WM(fIn, 0)), (iVn = new WM("IMPROVE_STRAIGHTNESS", 1)); + } + function aJ(n, t) { + return 10 != QJ(t) && x4(V5(t), t.hm, t.__elementTypeId$, QJ(t), n), n; + } + function uJ(n, t) { + var e; + return -1 != (e = hJ(n, t, 0)) && (KV(n, e), !0); + } + function oJ(n, t) { + var e; + return (e = Yx(zV(n.e, t), 387)) ? (_D(e), e.e) : null; + } + function sJ(n) { + var t; + return tC(n) && ((t = 0 - n), !isNaN(t)) ? t : $3(h5(n)); + } + function hJ(n, t, e) { + for (; e < n.c.length; ++e) if (qB(t, n.c[e])) return e; + return -1; + } + function fJ(n, t, e) { + var i; + return yB(n), ((i = new sn()).a = t), n.a.Nb(new XT(i, e)), i.a; + } + function lJ(n) { + var t; + return (t = Yx(TR(n.j, 0), 11)), Yx(Aun(t, (Ojn(), CQn)), 11); + } + function bJ(n) { + var t; + if (!X0(n)) throw hp(new Kp()); + return (n.e = 1), (t = n.d), (n.d = null), t; + } + function wJ(n, t) { + var e; + (this.f = n), (this.b = t), (e = Yx(BF(n.b, t), 283)), (this.c = e ? e.b : null); + } + function dJ() { + $x(), (this.b = new rp()), (this.f = new rp()), (this.g = new rp()), (this.e = new rp()); + } + function gJ(n, t) { + (this.a = VQ(Gzn, kIn, 10, n.a.c.length, 0, 1)), Htn(n.a, this.a), (this.b = t); + } + function pJ(n) { + var t; + for (t = n.p + 1; t < n.c.a.c.length; ++t) --Yx(TR(n.c.a, t), 10).p; + } + function vJ(n) { + var t; + null != (t = n.Ai()) && -1 != n.d && Yx(t, 92).Ng(n), n.i && n.i.Fi(); + } + function mJ(n) { + jO(this), (this.g = n ? Lq(n, n.$d()) : null), (this.f = n), qH(this), this._d(); + } + function yJ(n, t, e, i, r, c, a) { + E0.call(this, t, i, r, c, a), (this.c = n), (this.b = e); + } + function kJ(n, t, e, i, r) { + return vB(n), vB(t), vB(e), vB(i), vB(r), new R_(n, t, i); + } + function jJ(n, t) { + if (t < 0) throw hp(new Hm(dLn + t)); + return AX(n, t + 1), TR(n.j, t); + } + function EJ(n, t, e, i) { + if (!n) throw hp(new Qm(ngn(t, x4(Gy(UKn, 1), iEn, 1, 5, [e, i])))); + } + function TJ(n, t) { + return qB(t, TR(n.f, 0)) || qB(t, TR(n.f, 1)) || qB(t, TR(n.f, 2)); + } + function MJ(n, t) { + zN(Yx(Yx(n.f, 33).We((Cjn(), ktt)), 98)) && + (function (n, t) { + var e, i, r, c; + for (iL(), r = t, DY((i = LY(n)), 0, i.length, r), e = 0; e < i.length; e++) e != (c = rcn(n, i[e], e)) && L9(n, e, c); + })(ZB(Yx(n.f, 33)), t); + } + function SJ(n, t) { + var e, i; + return !(i = (e = Yx(t, 675)).Oh()) && e.Rh((i = new YP(n, t))), i; + } + function PJ(n, t) { + var e, i; + return !(i = (e = Yx(t, 677)).pk()) && e.tk((i = new vU(n, t))), i; + } + function IJ(n) { + return n.b || ((n.b = new TK(n, hat, n)), !n.a && (n.a = new GL(n, n))), n.b; + } + function CJ() { + (CJ = O), (GGn = new lM("XY", 0)), (qGn = new lM("X", 1)), (zGn = new lM("Y", 2)); + } + function OJ() { + (OJ = O), (mHn = new sM("TOP", 0)), (vHn = new sM(pSn, 1)), (pHn = new sM(ESn, 2)); + } + function AJ() { + (AJ = O), (BVn = new ZM(fIn, 0)), (HVn = new ZM("TOP", 1)), (FVn = new ZM(ESn, 2)); + } + function $J() { + ($J = O), (J2n = new oS("INPUT_ORDER", 0)), (Z2n = new oS("PORT_DEGREE", 1)); + } + function LJ() { + (LJ = O), (I_n = rO(BTn, BTn, 524287)), (C_n = rO(0, 0, qTn)), (O_n = gV(1)), gV(2), (A_n = gV(0)); + } + function NJ(n, t, i) { + (n.a.c = VQ(UKn, iEn, 1, 0, 5, 1)), + (function (n, t, i) { + var r, c, a, u, o, s, h, f, l; + (n.c = 0), (n.b = 0), (r = 2 * t.c.a.c.length + 1); + n: for (h = i.Kc(); h.Ob(); ) { + if (((l = 0), (u = (s = Yx(h.Pb(), 11)).j == (Ikn(), Tit) || s.j == Bit))) { + if (!(f = Yx(Aun(s, (Ojn(), RQn)), 10))) continue; + l += Ndn(n, r, s, f); + } else { + for (o = new pb(s.g); o.a < o.c.c.length; ) { + if ((c = Yx(Hz(o), 17).d).i.c == t.c) { + eD(n.a, s); + continue n; + } + l += n.g[c.p]; + } + for (a = new pb(s.e); a.a < a.c.c.length; ) { + if ((c = Yx(Hz(a), 17).c).i.c == t.c) { + eD(n.a, s); + continue n; + } + l -= n.g[c.p]; + } + } + s.e.c.length + s.g.c.length > 0 + ? ((n.f[s.p] = l / (s.e.c.length + s.g.c.length)), (n.c = e.Math.min(n.c, n.f[s.p])), (n.b = e.Math.max(n.b, n.f[s.p]))) + : u && (n.f[s.p] = l); + } + })(n, t, i), + 0 == n.a.c.length || + (function (n, t) { + var e, i, r, c, a, u, o, s, h, f; + for (s = n.e[t.c.p][t.p] + 1, o = t.c.a.c.length + 1, u = new pb(n.a); u.a < u.c.c.length; ) { + for (a = Yx(Hz(u), 11), f = 0, c = 0, r = W_(n0(x4(Gy(QKn, 1), iEn, 20, 0, [new fw(a), new bw(a)]))); Vfn(r); ) + (i = Yx(kV(r), 11)).i.c == t.c && ((f += xO(n, i.i) + 1), ++c); + (e = f / c), + (h = a.j) == (Ikn(), Eit) + ? (n.f[a.p] = e < s ? n.c - e : n.b + (o - e)) + : h == qit && (n.f[a.p] = e < s ? n.b + e : n.c - (o - e)); + } + })(n, t); + } + function xJ(n) { + var t, e; + return aF(n, 0, (e = n.length), (t = VQ(Xot, sTn, 25, e, 15, 1)), 0), t; + } + function DJ(n) { + var t; + return n.dh() || ((t = vF(n.Tg()) - n.Ah()), n.ph().bk(t)), n.Pg(); + } + function RJ(n) { + var t; + return null == (t = h1(H3(n, 32))) && (dtn(n), (t = h1(H3(n, 32)))), t; + } + function KJ(n, t) { + var e; + return (e = tnn(n.d, t)) >= 0 ? $en(n, e, !0, !0) : tfn(n, t, !0); + } + function _J(n, t) { + var e, i; + return JE(), (e = SX(n)), (i = SX(t)), !!e && !!i && !Een(e.k, i.k); + } + function FJ(n) { + (this.q ? this.q : (XH(), XH(), MFn)).Ac(n.q ? n.q : (XH(), XH(), MFn)); + } + function BJ(n, t) { + (sqn = new it()), (gqn = t), Yx((oqn = n).b, 65), QQ(oqn, sqn, null), Bmn(oqn); + } + function HJ(n, t, e) { + var i; + return (i = n.g[t]), _O(n, t, n.oi(t, e)), n.gi(t, e, i), n.ci(), i; + } + function qJ(n, t) { + var e; + return (e = n.Xc(t)) >= 0 && (n.$c(e), !0); + } + function GJ(n) { + var t; + return n.d != n.r && ((t = fcn(n)), (n.e = !!t && t.Cj() == KDn), (n.d = t)), n.e; + } + function zJ(n, t) { + var e; + for (MF(n), MF(t), e = !1; t.Ob(); ) e |= n.Fc(t.Pb()); + return e; + } + function UJ(n, t) { + var e; + return (e = Yx(BF(n.e, t), 387)) ? (OO(n, e), e.e) : null; + } + function XJ(n) { + var t, e; + return (t = (n / 60) | 0), 0 == (e = n % 60) ? "" + t : t + ":" + e; + } + function WJ(n, t) { + return W9(n), new SR(n, new VN(new JV(t, n.a))); + } + function VJ(n, t) { + var e = n.a[t], + i = (r5(), S_n)[typeof e]; + return i ? i(e) : Z6(typeof e); + } + function QJ(n) { + return null == n.__elementTypeCategory$ ? 10 : n.__elementTypeCategory$; + } + function YJ(n) { + var t; + return null != (t = 0 == n.b.c.length ? null : TR(n.b, 0)) && e2(n, 0), t; + } + function JJ(n, t) { + for (; t[0] < n.length && VI(" \t\r\n", gun(XB(n, t[0]))) >= 0; ) ++t[0]; + } + function ZJ(n, t) { + (this.e = t), (this.a = h4(n)), this.a < 54 ? (this.f = VU(n)) : (this.c = Utn(n)); + } + function nZ(n, t, e, i) { + Ljn(), np.call(this, 26), (this.c = n), (this.a = t), (this.d = e), (this.b = i); + } + function tZ(n, t, e) { + var i, r; + for (i = 10, r = 0; r < e - 1; r++) t < i && (n.a += "0"), (i *= 10); + n.a += t; + } + function eZ(n, t) { + var e; + for (++n.d, ++n.c[t], e = t + 1; e < n.a.length; ) ++n.a[e], (e += e & -e); + } + function iZ(n) { + var t, e; + return (t = n + 128), !(e = (lR(), R_n)[t]) && (e = R_n[t] = new tb(n)), e; + } + function rZ(n, t) { + var e; + return ( + vB(t), + (function (n, t) { + if (!n) + throw hp( + new Qm( + (function (n, t) { + var e, i, r, c; + for (n = null == n ? aEn : (vB(n), n), e = new $y(), c = 0, i = 0; i < t.length && -1 != (r = n.indexOf("%s", c)); ) + yI(e, n.substr(c, r - c)), mI(e, t[i++]), (c = r + 2); + if ((yI(e, n.substr(c)), i < t.length)) { + for (e.a += " [", mI(e, t[i++]); i < t.length; ) (e.a += tEn), mI(e, t[i++]); + e.a += "]"; + } + return e.a; + })("Enum constant undefined: %s", t), + ), + ); + })(!!(e = n[":" + t]), x4(Gy(UKn, 1), iEn, 1, 5, [t])), + e + ); + } + function cZ(n) { + var t; + for (++n.a, t = n.c.a.length; n.a < t; ++n.a) if (n.c.b[n.a]) return; + } + function aZ(n, t) { + var e, i; + for (e = (i = t.c) + 1; e <= t.f; e++) n.a[e] > n.a[i] && (i = e); + return i; + } + function uZ(n, t) { + return 0 == t.e || 0 == n.e ? pFn : (jfn(), Vbn(n, t)); + } + function oZ() { + (oZ = O), (kzn = new St()), (jzn = new Tt()), (mzn = new At()), (yzn = new $t()), (Ezn = new Lt()); + } + function sZ() { + (sZ = O), ($Bn = new cM("BY_SIZE", 0)), (LBn = new cM("BY_SIZE_AND_SHAPE", 1)); + } + function hZ() { + (hZ = O), (Qqn = new fM("EADES", 0)), (Yqn = new fM("FRUCHTERMAN_REINGOLD", 1)); + } + function fZ() { + (fZ = O), (FWn = new zM("READING_DIRECTION", 0)), (BWn = new zM("ROTATION", 1)); + } + function lZ() { + (lZ = O), (_Wn = z6((min(), x4(Gy(HWn, 1), XEn, 335, 0, [NWn, LWn, DWn, RWn, xWn])))); + } + function bZ() { + (bZ = O), (D2n = z6((ain(), x4(Gy(z2n, 1), XEn, 315, 0, [N2n, A2n, $2n, O2n, L2n])))); + } + function wZ() { + (wZ = O), (GXn = z6((Tan(), x4(Gy(JXn, 1), XEn, 363, 0, [_Xn, BXn, HXn, FXn, KXn])))); + } + function dZ() { + (dZ = O), (cYn = z6((d7(), x4(Gy(p2n, 1), XEn, 163, 0, [iYn, ZQn, nYn, tYn, eYn])))); + } + function gZ() { + (gZ = O), (E9n = z6((Aon(), x4(Gy(c7n, 1), XEn, 316, 0, [p9n, v9n, k9n, m9n, y9n])))); + } + function pZ() { + (pZ = O), (P7n = z6((Qtn(), x4(Gy(D7n, 1), XEn, 175, 0, [T7n, E7n, k7n, M7n, j7n])))); + } + function vZ() { + (vZ = O), (t9n = z6((xbn(), x4(Gy(c9n, 1), XEn, 355, 0, [Q8n, V8n, J8n, Y8n, Z8n])))); + } + function mZ() { + (mZ = O), (izn = z6(($un(), x4(Gy(azn, 1), XEn, 356, 0, [YGn, JGn, ZGn, nzn, tzn])))); + } + function yZ() { + (yZ = O), (ret = z6((t9(), x4(Gy(oet, 1), XEn, 103, 0, [tet, net, Ztt, Jtt, eet])))); + } + function kZ() { + (kZ = O), (ait = z6((Ytn(), x4(Gy(bit, 1), XEn, 249, 0, [eit, rit, nit, tit, iit])))); + } + function jZ() { + (jZ = O), (zit = z6((Ikn(), x4(Gy(trt, 1), lIn, 61, 0, [Hit, Tit, Eit, Bit, qit])))); + } + function EZ(n, t) { + var e; + return (e = Yx(BF(n.a, t), 134)) || ((e = new Zn()), xB(n.a, t, e)), e; + } + function TZ(n) { + var t; + return !!(t = Yx(Aun(n, (Ojn(), YVn)), 305)) && t.a == n; + } + function MZ(n) { + var t; + return !!(t = Yx(Aun(n, (Ojn(), YVn)), 305)) && t.i == n; + } + function SZ(n, t) { + return vB(t), e_(n), !!n.d.Ob() && (t.td(n.d.Pb()), !0); + } + function PZ(n) { + return k8(n, Yjn) > 0 ? Yjn : k8(n, nTn) < 0 ? nTn : WR(n); + } + function IZ(n) { + return n < 3 ? (g0(n, GEn), n + 1) : n < zEn ? oG(n / 0.75 + 1) : Yjn; + } + function CZ(n, t) { + var e; + return null == n.i && svn(n), (e = n.i), t >= 0 && t < e.length ? e[t] : null; + } + function OZ(n, t, e) { + var i; + if (null == t) throw hp(new Np()); + return ( + (i = jG(n, t)), + (function (n, t, e) { + if (e) { + var i = e.ee(); + n.a[t] = i(e); + } else delete n.a[t]; + })(n, t, e), + i + ); + } + function AZ(n) { + return n.a >= -0.01 && n.a <= SSn && (n.a = 0), n.b >= -0.01 && n.b <= SSn && (n.b = 0), n; + } + function $Z(n, t) { + return t == (bx(), bx(), _Fn) ? n.toLocaleLowerCase() : n.toLowerCase(); + } + function LZ(n) { + return (0 != (2 & n.i) ? "interface " : 0 != (1 & n.i) ? "" : "class ") + (sL(n), n.o); + } + function NZ(n) { + var t; + (t = new zv()), fY((!n.q && (n.q = new m_(fat, n, 11, 10)), n.q), t); + } + function xZ(n) { + (this.g = n), (this.f = new ip()), (this.a = e.Math.min(this.g.c.c, this.g.d.c)); + } + function DZ(n) { + (this.b = new ip()), (this.a = new ip()), (this.c = new ip()), (this.d = new ip()), (this.e = n); + } + function RZ(n, t) { + (this.a = new rp()), (this.e = new rp()), (this.b = (i8(), k2n)), (this.c = n), (this.b = t); + } + function KZ(n, t, e) { + sN.call(this), YZ(this), (this.a = n), (this.c = e), (this.b = t.d), (this.f = t.e); + } + function _Z(n) { + (this.d = n), (this.c = n.c.vc().Kc()), (this.b = null), (this.a = null), (this.e = (pm(), a_n)); + } + function FZ(n) { + if (n < 0) throw hp(new Qm("Illegal Capacity: " + n)); + this.g = this.ri(n); + } + function BZ(n) { + var t; + M$(!!n.c), (t = n.c.a), VZ(n.d, n.c), n.b == n.c ? (n.b = t) : --n.a, (n.c = null); + } + function HZ(n, t) { + var e; + return W9(n), (e = new _H(n, n.a.rd(), 4 | n.a.qd(), t)), new SR(n, e); + } + function qZ(n, t) { + var e; + for (e = n.Kc(); e.Ob(); ) b5(Yx(e.Pb(), 70), (Ojn(), kQn), t); + } + function GZ(n) { + var t; + return (t = ty(fL(Aun(n, (gjn(), y1n))))) < 0 && b5(n, y1n, (t = 0)), t; + } + function zZ(n, t, e, i, r, c) { + var a; + YG((a = EV(i)), r), QG(a, c), Qhn(n.a, i, new jx(a, t, e.f)); + } + function UZ(n, t) { + var e; + if (!(e = Ybn(n.Tg(), t))) throw hp(new Qm(mNn + t + jNn)); + return e; + } + function XZ(n, t) { + var e; + for (e = n; IG(e); ) if ((e = IG(e)) == t) return !0; + return !1; + } + function WZ(n, t) { + var e, i, r, c; + for (vB(t), r = 0, c = (i = n.c).length; r < c; ++r) (e = i[r]), t.td(e); + } + function VZ(n, t) { + var e; + return (e = t.c), (t.a.b = t.b), (t.b.a = t.a), (t.a = t.b = null), (t.c = null), --n.b, e; + } + function QZ(n, t) { + return !!_2(n, t, WR(e7(BEn, HB(WR(e7(null == t ? 0 : W5(t), HEn)), 15)))); + } + function YZ(n) { + (n.b = (BY(), hHn)), (n.f = (OJ(), vHn)), (n.d = (g0(2, UEn), new pQ(2))), (n.e = new Pk()); + } + function JZ() { + (JZ = O), (rHn = new uM("BEGIN", 0)), (cHn = new uM(pSn, 1)), (aHn = new uM("END", 2)); + } + function ZZ() { + (ZZ = O), (cet = new nP(pSn, 0)), (aet = new nP("HEAD", 1)), (uet = new nP("TAIL", 2)); + } + function n1() { + (n1 = O), (wit = z6((Ran(), x4(Gy(kit, 1), XEn, 98, 0, [lit, fit, hit, uit, sit, oit])))); + } + function t1() { + (t1 = O), (wHn = (JZ(), x4(Gy(sHn, 1), XEn, 232, 0, [rHn, cHn, aHn])).length), (bHn = wHn); + } + function e1(n) { + (this.b = (MF(n), new sx(n))), (this.a = new ip()), (this.d = new ip()), (this.e = new Pk()); + } + function i1(n) { + var t; + return n.w + ? n.w + : ((t = (function (n) { + return n.Db >> 16 != 6 ? null : Yx(Bfn(n), 235); + })(n)) && + !t.kh() && + (n.w = t), + t); + } + function r1(n) { + var t; + return null == n + ? null + : (function (n, t) { + var e, i, r, c, a; + if (null == n) return null; + for (a = VQ(Xot, sTn, 25, 2 * t, 15, 1), i = 0, r = 0; i < t; ++i) + (e = (n[i] >> 4) & 15), (c = 15 & n[i]), (a[r++] = zrt[e]), (a[r++] = zrt[c]); + return Vnn(a, 0, a.length); + })((t = Yx(n, 190)), t.length); + } + function c1(n, t) { + if (null == n.g || t >= n.i) throw hp(new BI(t, n.i)); + return n.li(t, n.g[t]); + } + function a1(n) { + var t, e; + for (t = n.a.d.j, e = n.c.d.j; t != e; ) n2(n.b, t), (t = A9(t)); + n2(n.b, t); + } + function u1(n, t) { + var e, i, r, c; + for (r = 0, c = (i = n.d).length; r < c; ++r) (e = i[r]), (NO(n.g, e).a = t); + } + function o1(n, t) { + var e; + for (e = Ztn(n, 0); e.b != e.d.c; ) mN(Yx(IX(e), 8), t); + return n; + } + function s1(n) { + var t; + return zU(n.e, n), S$(n.b), (n.c = n.a), (t = Yx(n.a.Pb(), 42)), (n.b = M4(n)), t; + } + function h1(n) { + var t; + return QD(null == n || (Array.isArray(n) && !((t = QJ(n)) >= 14 && t <= 16))), n; + } + function f1(n, t, e) { + var i = function () { + return n.apply(i, arguments); + }; + return t.apply(i, e), i; + } + function l1(n, t, e) { + var i, r; + i = t; + do { + (r = ty(n.p[i.p]) + e), (n.p[i.p] = r), (i = n.a[i.p]); + } while (i != t); + } + function b1(n, t) { + var e, i; + (i = n.a), + (e = (function (n, t, e) { + var i, r; + return ( + (r = n.a), (n.a = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && ((i = new p_(n, 1, 5, r, n.a)), e ? Pan(e, i) : (e = i)), e + ); + })(n, t, null)), + i != t && !n.e && (e = zyn(n, t, e)), + e && e.Fi(); + } + function w1(n, t) { + return XC(), o0(ZEn), e.Math.abs(n - t) <= ZEn || n == t || (isNaN(n) && isNaN(t)); + } + function d1(n, t) { + return XC(), o0(ZEn), e.Math.abs(n - t) <= ZEn || n == t || (isNaN(n) && isNaN(t)); + } + function g1(n, t) { + return (function (n) { + return n ? n.i : null; + })(K2(n, t, WR(e7(BEn, HB(WR(e7(null == t ? 0 : W5(t), HEn)), 15))))); + } + function p1() { + (p1 = O), (zzn = z6((bon(), x4(Gy(Uzn, 1), XEn, 267, 0, [Hzn, Bzn, _zn, qzn, Fzn, Kzn])))); + } + function v1() { + (v1 = O), (dnt = z6((dan(), x4(Gy(iet, 1), XEn, 291, 0, [bnt, lnt, fnt, snt, ont, hnt])))); + } + function m1() { + (m1 = O), (V7n = z6((qen(), x4(Gy(wnt, 1), XEn, 248, 0, [H7n, z7n, U7n, X7n, q7n, G7n])))); + } + function y1() { + (y1 = O), (vWn = z6((psn(), x4(Gy(kWn, 1), XEn, 227, 0, [bWn, dWn, lWn, wWn, gWn, fWn])))); + } + function k1() { + (k1 = O), (jVn = z6((uon(), x4(Gy(LVn, 1), XEn, 275, 0, [mVn, gVn, yVn, vVn, pVn, dVn])))); + } + function j1() { + (j1 = O), (wVn = z6((Wcn(), x4(Gy(kVn, 1), XEn, 274, 0, [hVn, sVn, lVn, oVn, fVn, uVn])))); + } + function E1() { + (E1 = O), (v2n = z6((nun(), x4(Gy(j2n, 1), XEn, 313, 0, [d2n, b2n, f2n, l2n, g2n, w2n])))); + } + function T1() { + (T1 = O), (eVn = z6((pon(), x4(Gy(cVn, 1), XEn, 276, 0, [QWn, VWn, JWn, YWn, nVn, ZWn])))); + } + function M1() { + (M1 = O), (l5n = z6((ysn(), x4(Gy(Z5n, 1), XEn, 327, 0, [h5n, a5n, o5n, u5n, s5n, c5n])))); + } + function S1() { + (S1 = O), (jit = z6((Chn(), x4(Gy(Git, 1), XEn, 273, 0, [mit, pit, vit, git, dit, yit])))); + } + function P1() { + (P1 = O), (Tet = z6((vun(), x4(Gy(xet, 1), XEn, 312, 0, [ket, met, jet, pet, yet, vet])))); + } + function I1(n, t) { + var e; + (e = n.a), (n.a = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new aW(n, 0, e, n.a)); + } + function C1(n, t) { + var e; + (e = n.b), (n.b = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new aW(n, 1, e, n.b)); + } + function O1(n, t) { + var e; + (e = n.b), (n.b = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new aW(n, 3, e, n.b)); + } + function A1(n, t) { + var e; + (e = n.f), (n.f = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new aW(n, 3, e, n.f)); + } + function $1(n, t) { + var e; + (e = n.g), (n.g = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new aW(n, 4, e, n.g)); + } + function L1(n, t) { + var e; + (e = n.i), (n.i = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new aW(n, 5, e, n.i)); + } + function N1(n, t) { + var e; + (e = n.j), (n.j = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new aW(n, 6, e, n.j)); + } + function x1(n, t) { + var e; + (e = n.j), (n.j = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new aW(n, 1, e, n.j)); + } + function D1(n, t) { + var e; + (e = n.c), (n.c = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new aW(n, 4, e, n.c)); + } + function R1(n, t) { + var e; + (e = n.k), (n.k = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new aW(n, 2, e, n.k)); + } + function K1(n, t) { + var e; + (e = n.d), (n.d = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new uW(n, 2, e, n.d)); + } + function _1(n, t) { + var e; + (e = n.s), (n.s = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new uW(n, 4, e, n.s)); + } + function F1(n, t) { + var e; + (e = n.t), (n.t = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new uW(n, 5, e, n.t)); + } + function B1(n, t) { + var e; + (e = n.F), (n.F = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 5, e, t)); + } + function H1(n, t) { + var e; + return (e = Yx(BF((MT(), Nct), n), 55)) ? e.xj(t) : VQ(UKn, iEn, 1, t, 5, 1); + } + function q1(n, t) { + var e; + return t in n.a && (e = jG(n, t).he()) ? e.a : null; + } + function G1(n, t) { + var e, i; + return xk(), (i = new uo()), !!t && Xbn(i, t), x0((e = i), n), e; + } + function z1(n, t, e) { + if ((k6(n, e), !n.Bk() && null != e && !n.wj(e))) throw hp(new Op()); + return e; + } + function U1(n, t) { + return (n.n = t), n.n ? ((n.f = new ip()), (n.e = new ip())) : ((n.f = null), (n.e = null)), n; + } + function X1(n, t, e, i, r, c) { + var a; + return e0(e, (a = TF(n, t))), (a.i = r ? 8 : 0), (a.f = i), (a.e = r), (a.g = c), a; + } + function W1(n, t, e, i, r) { + (this.d = t), (this.k = i), (this.f = r), (this.o = -1), (this.p = 1), (this.c = n), (this.a = e); + } + function V1(n, t, e, i, r) { + (this.d = t), (this.k = i), (this.f = r), (this.o = -1), (this.p = 2), (this.c = n), (this.a = e); + } + function Q1(n, t, e, i, r) { + (this.d = t), (this.k = i), (this.f = r), (this.o = -1), (this.p = 6), (this.c = n), (this.a = e); + } + function Y1(n, t, e, i, r) { + (this.d = t), (this.k = i), (this.f = r), (this.o = -1), (this.p = 7), (this.c = n), (this.a = e); + } + function J1(n, t, e, i, r) { + (this.d = t), (this.j = i), (this.e = r), (this.o = -1), (this.p = 4), (this.c = n), (this.a = e); + } + function Z1(n, t) { + var e, i, r, c; + for (r = 0, c = (i = t).length; r < c; ++r) (e = i[r]), KY(n.a, e); + return n; + } + function n0(n) { + var t, e, i; + for (e = 0, i = (t = n).length; e < i; ++e) MF(t[e]); + return new _I(n); + } + function t0(n) { + var t = /function(?:\s+([\w$]+))?\s*\(/.exec(n); + return (t && t[1]) || aTn; + } + function e0(n, t) { + if (n) { + t.n = n; + var e = (function (n) { + if (n.qe()) return null; + var t = n.n; + return Bjn[t]; + })(t); + e ? (e.gm = t) : (Bjn[n] = [t]); + } + } + function i0(n, t, e) { + var i, r; + for (r = t.Kc(); r.Ob(); ) (i = Yx(r.Pb(), 79)), __(n, Yx(e.Kb(i), 33)); + } + function r0(n, t) { + var e, i, r; + for (i = 0, r = (e = t).length; i < r; ++i) VW(n, e[i], n.c.b, n.c); + } + function c0(n, t) { + (n.b = e.Math.max(n.b, t.d)), (n.e += t.r + (0 == n.a.c.length ? 0 : n.c)), eD(n.a, t); + } + function a0(n) { + M$(n.c >= 0), + (function (n, t) { + var e, i, r; + return ( + (i = n.a.length - 1), + (e = (t - n.b) & i), + (r = (n.c - t) & i), + E$(e < ((n.c - n.b) & i)), + e >= r + ? ((function (n, t) { + var e, i; + for (e = n.a.length - 1, n.c = (n.c - 1) & e; t != n.c; ) (i = (t + 1) & e), DF(n.a, t, n.a[i]), (t = i); + DF(n.a, n.c, null); + })(n, t), + -1) + : ((function (n, t) { + var e, i; + for (e = n.a.length - 1; t != n.b; ) (i = (t - 1) & e), DF(n.a, t, n.a[i]), (t = i); + DF(n.a, n.b, null), (n.b = (n.b + 1) & e); + })(n, t), + 1) + ); + })(n.d, n.c) < 0 && ((n.a = (n.a - 1) & (n.d.a.length - 1)), (n.b = n.d.c)), + (n.c = -1); + } + function u0(n) { + return n.a < 54 ? (n.f < 0 ? -1 : n.f > 0 ? 1 : 0) : (!n.c && (n.c = J6(n.f)), n.c).e; + } + function o0(n) { + if (!(n >= 0)) throw hp(new Qm("tolerance (" + n + ") must be >= 0")); + return n; + } + function s0() { + return m7n || h6((m7n = new Jdn()), x4(Gy(ZBn, 1), iEn, 130, 0, [new $f()])), m7n; + } + function h0() { + (h0 = O), (r3n = new sS(MSn, 0)), (e3n = new sS("INPUT", 1)), (i3n = new sS("OUTPUT", 2)); + } + function f0() { + (f0 = O), (IWn = new qM("ARD", 0)), (OWn = new qM("MSD", 1)), (CWn = new qM("MANUAL", 2)); + } + function l0() { + (l0 = O), (G3n = new dS("BARYCENTER", 0)), (z3n = new dS(KIn, 1)), (U3n = new dS(_In, 2)); + } + function b0(n, t) { + var e; + if (((e = n.gc()), t < 0 || t > e)) throw hp(new jN(t, e)); + return new WN(n, t); + } + function w0(n, t) { + var e; + return CO(t, 42) ? n.c.Mc(t) : ((e = mnn(n, t)), ttn(n, t), e); + } + function d0(n, t, e) { + return a8(n, t), E2(n, e), _1(n, 0), F1(n, 1), l9(n, !0), s9(n, !0), n; + } + function g0(n, t) { + if (n < 0) throw hp(new Qm(t + " cannot be negative but was: " + n)); + return n; + } + function p0(n, t) { + var e, i; + for (e = 0, i = n.gc(); e < i; ++e) if (qB(t, n.Xb(e))) return e; + return -1; + } + function v0(n) { + var t; + for (t = n.c.Cc().Kc(); t.Ob(); ) Yx(t.Pb(), 14).$b(); + n.c.$b(), (n.d = 0); + } + function m0(n) { + var t, e; + if (0 == n) return 32; + for (e = 0, t = 1; 0 == (t & n); t <<= 1) ++e; + return e; + } + function y0(n) { + zE(), (this.g = new rp()), (this.f = new rp()), (this.b = new rp()), (this.c = new Zq()), (this.i = n); + } + function k0() { + (this.f = new Pk()), (this.d = new Pv()), (this.c = new Pk()), (this.a = new ip()), (this.b = new ip()); + } + function j0(n, t, e, i) { + this.rj(), (this.a = t), (this.b = n), (this.c = null), (this.c = new LN(this, t, e, i)); + } + function E0(n, t, e, i, r) { + (this.d = n), (this.n = t), (this.g = e), (this.o = i), (this.p = -1), r || (this.o = -2 - i - 1); + } + function T0() { + zO.call(this), (this.n = -1), (this.g = null), (this.i = null), (this.j = null), (this.Bb |= DNn); + } + function M0() { + (M0 = O), (z_n = x4(Gy(Wot, 1), MTn, 25, 15, [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15])); + } + function S0() { + (S0 = O), (x3n = oR(oR(oR(new fX(), ($un(), YGn), ($jn(), mUn)), JGn, GUn), ZGn, qUn)); + } + function P0() { + (P0 = O), (D3n = oR(oR(oR(new fX(), ($un(), YGn), ($jn(), mUn)), JGn, GUn), ZGn, qUn)); + } + function I0() { + (I0 = O), (_3n = oR(oR(oR(new fX(), ($un(), YGn), ($jn(), mUn)), JGn, GUn), ZGn, qUn)); + } + function C0() { + (C0 = O), (H3n = yK(oR(oR(new fX(), ($un(), ZGn), ($jn(), XUn)), nzn, RUn), tzn, UUn)); + } + function O0() { + (O0 = O), (TWn = new HM("LAYER_SWEEP", 0)), (EWn = new HM(eCn, 1)), (MWn = new HM(fIn, 2)); + } + function A0(n, t) { + var e, i; + return (e = n.c), (i = t.e[n.p]) > 0 ? Yx(TR(e.a, i - 1), 10) : null; + } + function $0(n, t) { + var e; + (e = n.k), (n.k = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 2, e, n.k)); + } + function L0(n, t) { + var e; + (e = n.f), (n.f = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 8, e, n.f)); + } + function N0(n, t) { + var e; + (e = n.i), (n.i = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 7, e, n.i)); + } + function x0(n, t) { + var e; + (e = n.a), (n.a = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 8, e, n.a)); + } + function D0(n, t) { + var e; + (e = n.b), (n.b = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 0, e, n.b)); + } + function R0(n, t) { + var e; + (e = n.b), (n.b = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 0, e, n.b)); + } + function K0(n, t) { + var e; + (e = n.c), (n.c = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 1, e, n.c)); + } + function _0(n, t) { + var e; + (e = n.c), (n.c = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 1, e, n.c)); + } + function F0(n, t) { + var e; + (e = n.c), (n.c = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 4, e, n.c)); + } + function B0(n, t) { + var e; + (e = n.d), (n.d = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 1, e, n.d)); + } + function H0(n, t) { + var e; + (e = n.D), (n.D = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 2, e, n.D)); + } + function q0(n, t) { + n.r > 0 && n.c < n.r && ((n.c += t), n.i && n.i.d > 0 && 0 != n.g && q0(n.i, (t / n.r) * n.i.d)); + } + function G0(n, t) { + return Lwn(n.e, t) ? (TT(), GJ(t) ? new cR(t, n) : new VP(t, n)) : new JP(t, n); + } + function z0(n, t) { + return (function (n) { + return n ? n.g : null; + })(_2(n.a, t, WR(e7(BEn, HB(WR(e7(null == t ? 0 : W5(t), HEn)), 15))))); + } + function U0(n) { + var t; + return (n = e.Math.max(n, 2)) > (t = j5(n)) ? ((t <<= 1) > 0 ? t : zEn) : t; + } + function X0(n) { + switch ((kA(3 != n.e), n.e)) { + case 2: + return !1; + case 0: + return !0; + } + return (function (n) { + return (n.e = 3), (n.d = n.Yb()), 2 != n.e && ((n.e = 0), !0); + })(n); + } + function W0(n, t) { + var e; + return !!CO(t, 8) && ((e = Yx(t, 8)), n.a == e.a && n.b == e.b); + } + function V0(n, t, e) { + var i, r; + return (r = t >> 5), (i = 31 & t), Gz(UK(n.n[e][r], WR(GK(i, 1))), 3); + } + function Q0(n, t) { + var e; + (e = n.b), (n.b = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 21, e, n.b)); + } + function Y0(n, t) { + var e; + (e = n.d), (n.d = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 11, e, n.d)); + } + function J0(n, t) { + var e; + (e = n.j), (n.j = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 13, e, n.j)); + } + function Z0(n, t, e) { + var i, r, c; + for (c = n.a.length - 1, r = n.b, i = 0; i < e; r = (r + 1) & c, ++i) DF(t, i, n.a[r]); + } + function n2(n, t) { + var e; + return vB(t), (e = t.g), !n.b[e] && (DF(n.b, e, t), ++n.c, !0); + } + function t2(n, t) { + var e; + return !((e = null == t ? -1 : hJ(n.b, t, 0)) < 0 || (e2(n, e), 0)); + } + function e2(n, t) { + var e; + (e = KV(n.b, n.b.c.length - 1)), t < n.b.c.length && (QW(n.b, t, e), shn(n, t)); + } + function i2(n, t) { + run(t, "Hierarchical port constraint processing", 1), + (function (n) { + var t; + zN(Yx(Aun(n, (gjn(), g0n)), 98)) && (afn(($z(0, (t = n.b).c.length), Yx(t.c[0], 29))), afn(Yx(TR(t, t.c.length - 1), 29))); + })(n), + (function (n) { + var t, e, i, r, c, a, u, o, s, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M, S, P; + if ((j = Yx(Aun(n, (gjn(), g0n)), 98)) != (Ran(), fit) && j != lit) { + for ( + s = new pQ((g0((b = (w = n.b).c.length) + 2, VEn), PZ(t7(t7(5, b + 2), ((b + 2) / 10) | 0)))), + d = new pQ((g0(b + 2, VEn), PZ(t7(t7(5, b + 2), ((b + 2) / 10) | 0)))), + eD(s, new rp()), + eD(s, new rp()), + eD(d, new ip()), + eD(d, new ip()), + k = new ip(), + t = 0; + t < b; + t++ + ) + for ( + $z(t, w.c.length), + e = Yx(w.c[t], 29), + $z(t, s.c.length), + E = Yx(s.c[t], 83), + g = new rp(), + s.c[s.c.length] = g, + $z(t, d.c.length), + M = Yx(d.c[t], 15), + v = new ip(), + d.c[d.c.length] = v, + r = new pb(e.a); + r.a < r.c.c.length; + + ) + if (p9((i = Yx(Hz(r), 10)))) k.c[k.c.length] = i; + else { + for (o = new $K(bA(u7(i).a.Kc(), new h())); Vfn(o); ) + p9((S = (a = Yx(kV(o), 17)).c.i)) && + ((T = Yx(E.xc(Aun(S, (Ojn(), CQn))), 10)) || ((T = Mhn(n, S)), E.zc(Aun(S, CQn), T), M.Fc(T)), + YG(a, Yx(TR(T.j, 1), 11))); + for (u = new $K(bA(o7(i).a.Kc(), new h())); Vfn(u); ) + p9((P = (a = Yx(kV(u), 17)).d.i)) && + ((p = Yx(BF(g, Aun(P, (Ojn(), CQn))), 10)) || ((p = Mhn(n, P)), xB(g, Aun(P, CQn), p), (v.c[v.c.length] = p)), + QG(a, Yx(TR(p.j, 0), 11))); + } + for (f = 0; f < d.c.length; f++) + if (($z(f, d.c.length), !(m = Yx(d.c[f], 15)).dc())) + for ( + l = null, + 0 == f + ? ((l = new qF(n)), iz(0, w.c.length), GT(w.c, 0, l)) + : f == s.c.length - 1 + ? ((l = new qF(n)), (w.c[w.c.length] = l)) + : ($z(f - 1, w.c.length), (l = Yx(w.c[f - 1], 29))), + c = m.Kc(); + c.Ob(); + + ) + JG(Yx(c.Pb(), 10), l); + for (y = new pb(k); y.a < y.c.c.length; ) JG(Yx(Hz(y), 10), null); + b5(n, (Ojn(), oQn), k); + } + })(n), + Ron(t); + } + function r2(n, t) { + var e, i; + for (i = t.Kc(); i.Ob(); ) (e = Yx(i.Pb(), 266)), (n.b = !0), __(n.e, e), (e.b = n); + } + function c2(n, t) { + var e, i; + return (e = 1 - t), (i = n.a[e]), (n.a[e] = i.a[t]), (i.a[t] = n), (n.b = !0), (i.b = !1), i; + } + function a2(n) { + bK.call(this), (this.b = ty(fL(Aun(n, (gjn(), N0n))))), (this.a = Yx(Aun(n, b1n), 218)); + } + function u2(n, t, e) { + wX.call(this, n, t, e), (this.a = new rp()), (this.b = new rp()), (this.d = new pd(this)); + } + function o2(n) { + (this.e = n), (this.d = new Xk(IZ(FK(this.e).gc()))), (this.c = this.e.a), (this.b = this.e.c); + } + function s2(n) { + (this.b = n), (this.a = VQ(Wot, MTn, 25, n + 1, 15, 1)), (this.c = VQ(Wot, MTn, 25, n, 15, 1)), (this.d = 0); + } + function h2(n, t, e) { + var i; + return Swn(n, t, (i = new ip()), e, !0, !0), (n.b = new s2(i.c.length)), i; + } + function f2(n, t) { + var e; + return (e = Yx(BF(n.c, t), 458)) || (((e = new vv()).c = t), xB(n.c, e.c, e)), e; + } + function l2(n, t) { + var e = n.a, + i = 0; + for (var r in e) e.hasOwnProperty(r) && (t[i++] = r); + return t; + } + function b2(n) { + return null == n.b ? (jT(), jT(), Qat) : n.Lk() ? n.Kk() : n.Jk(); + } + function w2(n) { + var t, e; + for (e = new UO(n); e.e != e.i.gc(); ) L1((t = Yx(hen(e), 33)), 0), N1(t, 0); + } + function d2() { + (d2 = O), (EGn = new Og(zPn)), (TGn = new Og(UPn)), (jGn = new Og(XPn)), (kGn = new Og(WPn)); + } + function g2() { + (g2 = O), (iUn = new pM("TO_INTERNAL_LTR", 0)), (eUn = new pM("TO_INPUT_DIRECTION", 1)); + } + function p2() { + (p2 = O), (h6n = new LS("P1_NODE_PLACEMENT", 0)), (f6n = new LS("P2_EDGE_ROUTING", 1)); + } + function v2() { + (v2 = O), (YXn = new _M("START", 0)), (QXn = new _M("MIDDLE", 1)), (VXn = new _M("END", 2)); + } + function m2() { + (m2 = O), (dXn = new _L("edgelabelcenterednessanalysis.includelabel", (TA(), $_n))); + } + function y2() { + (this.c = new sj(0)), (this.b = new sj(e$n)), (this.d = new sj(t$n)), (this.a = new sj(bPn)); + } + function k2(n) { + var t, e; + for (e = n.c.a.ec().Kc(); e.Ob(); ) xl((t = Yx(e.Pb(), 214)), new Zun(t.e)); + } + function j2(n) { + var t, e; + for (e = n.c.a.ec().Kc(); e.Ob(); ) Nl((t = Yx(e.Pb(), 214)), new l_(t.f)); + } + function E2(n, t) { + var e; + (e = n.zb), (n.zb = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 1, e, n.zb)); + } + function T2(n, t) { + var e; + (e = n.xb), (n.xb = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 3, e, n.xb)); + } + function M2(n, t) { + var e; + (e = n.yb), (n.yb = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 2, e, n.yb)); + } + function S2(n, t) { + var e; + ((e = new qv()).n = t), fY((!n.s && (n.s = new m_(tat, n, 21, 17)), n.s), e); + } + function P2(n, t) { + var e; + ((e = new cL()).n = t), fY((!n.s && (n.s = new m_(tat, n, 21, 17)), n.s), e); + } + function I2(n, t) { + var e, i; + for (DY((e = n.Pc()), 0, e.length, t), i = 0; i < e.length; i++) n._c(i, e[i]); + } + function C2(n, t) { + var e, i, r; + for (vB(t), e = !1, r = t.Kc(); r.Ob(); ) (i = r.Pb()), (e |= n.Fc(i)); + return e; + } + function O2(n) { + var t, e, i; + for (t = 0, i = n.Kc(); i.Ob(); ) t = ~~(t += null != (e = i.Pb()) ? W5(e) : 0); + return t; + } + function A2(n) { + var t; + return 0 == n ? "UTC" : (n < 0 ? ((n = -n), (t = "UTC+")) : (t = "UTC-"), t + XJ(n)); + } + function $2(n, t) { + var e; + return CO(t, 14) ? ((e = Yx(t, 14)), n.Gc(e)) : zJ(n, Yx(MF(t), 20).Kc()); + } + function L2(n, t, e) { + RZ.call(this, t, e), (this.d = VQ(Gzn, kIn, 10, n.a.c.length, 0, 1)), Htn(n.a, this.d); + } + function N2(n, t) { + t ? null == n.B && ((n.B = n.D), (n.D = null)) : null != n.B && ((n.D = n.B), (n.B = null)); + } + function x2(n, t) { + return ty(fL(qA(W8(fH(new SR(null, new Nz(n.c.b, 16)), new rd(n)), t)))); + } + function D2(n, t) { + return ty(fL(qA(W8(fH(new SR(null, new Nz(n.c.b, 16)), new id(n)), t)))); + } + function R2(n, t, e) { + var i, r; + for (r = Ztn(n, 0); r.b != r.d.c; ) ((i = Yx(IX(r), 8)).a += t), (i.b += e); + return n; + } + function K2(n, t, e) { + var i; + for (i = n.b[e & n.f]; i; i = i.b) if (e == i.a && bB(t, i.g)) return i; + return null; + } + function _2(n, t, e) { + var i; + for (i = n.c[e & n.f]; i; i = i.d) if (e == i.f && bB(t, i.i)) return i; + return null; + } + function F2(n) { + var t; + return sI((t = YU(n)).a, 0) ? (RE(), RE(), BFn) : (RE(), new y$(t.b)); + } + function B2(n) { + var t; + return sI((t = YU(n)).a, 0) ? (RE(), RE(), BFn) : (RE(), new y$(t.c)); + } + function H2(n) { + var t; + return sI((t = QU(n)).a, 0) ? (KE(), KE(), HFn) : (KE(), new k$(t.b)); + } + function q2(n) { + return n.b.c.i.k == (bon(), _zn) ? Yx(Aun(n.b.c.i, (Ojn(), CQn)), 11) : n.b.c; + } + function G2(n) { + return n.b.d.i.k == (bon(), _zn) ? Yx(Aun(n.b.d.i, (Ojn(), CQn)), 11) : n.b.d; + } + function z2(n, t, e, i, r, c, a, u, o, s, h, f, l) { + return Gsn(n, t, e, i, r, c, a, u, o, s, h, f, l), q9(n, !1), n; + } + function U2(n, t, e, i, r, c, a) { + Uj.call(this, n, t), (this.d = e), (this.e = i), (this.c = r), (this.b = c), (this.a = DV(a)); + } + function X2(n, t) { + return XC(), o0(SSn), e.Math.abs(0 - t) <= SSn || 0 == t || (isNaN(0) && isNaN(t)) ? 0 : n / t; + } + function W2() { + (W2 = O), (Hat = new Hv()), (Gat = x4(Gy(tat, 1), VDn, 170, 0, [])), (qat = x4(Gy(fat, 1), QDn, 59, 0, [])); + } + function V2() { + (V2 = O), (E3n = new bS("NO", 0)), (k3n = new bS("GREEDY", 1)), (j3n = new bS("LOOK_BACK", 2)); + } + function Q2() { + (Q2 = O), (Qzn = new Ht()), (Wzn = new Bt()), (Vzn = new qt()), (Xzn = new Gt()), (Yzn = new zt()), (Jzn = new Ut()); + } + function Y2(n, t) { + var e; + return Fhn(new QS((e = oun(n)).c, e.d), new QS(e.b, e.a), n.rf(), t, n.Hf()); + } + function J2(n, t) { + var e; + return n.b + ? null + : ((e = (function (n, t) { + var e; + return ( + (e = t > 0 ? t - 1 : t), + pk( + (function (n, t) { + return (n.j = t), n; + })(U1(xD(new am(), e), n.n), n.j), + n.k, + ) + ); + })(n, n.g)), + KD(n.a, e), + (e.i = n), + (n.d = t), + e); + } + function Z2(n, t, e) { + run(e, "DFS Treeifying phase", 1), + (function (n, t) { + var e, i, r; + for (r = t.b.b, n.a = new ME(), n.b = VQ(Wot, MTn, 25, r, 15, 1), e = 0, i = Ztn(t.b, 0); i.b != i.d.c; ) + Yx(IX(i), 86).g = e++; + })(n, t), + (function (n, t) { + var e, i, r, c, a; + for (a = Yx(Aun(t, (cln(), X5n)), 425), c = Ztn(t.b, 0); c.b != c.d.c; ) + if (((r = Yx(IX(c), 86)), 0 == n.b[r.g])) { + switch (a.g) { + case 0: + yin(n, r); + break; + case 1: + gln(n, r); + } + n.b[r.g] = 2; + } + for (i = Ztn(n.a, 0); i.b != i.d.c; ) V7((e = Yx(IX(i), 188)).b.d, e, !0), V7(e.c.b, e, !0); + b5(t, (ryn(), S5n), n.a); + })(n, t), + (n.a = null), + (n.b = null), + Ron(e); + } + function n3(n, t, e) { + (this.g = n), + (this.d = t), + (this.e = e), + (this.a = new ip()), + (function (n) { + var t, e, i, r; + for (r = V8(n.d, n.e).Kc(); r.Ob(); ) + for (i = Yx(r.Pb(), 11), e = new pb(n.e == (Ikn(), qit) ? i.e : i.g); e.a < e.c.c.length; ) + ZW((t = Yx(Hz(e), 17))) || t.c.i.c == t.d.i.c || (Lon(n, t), ++n.f, ++n.c); + })(this), + XH(), + JC(this.a, null); + } + function t3(n) { + (this.i = n.gc()), this.i > 0 && ((this.g = this.ri(this.i + ((this.i / 8) | 0) + 1)), n.Qc(this.g)); + } + function e3(n, t) { + CD.call(this, sut, n, t), (this.b = this), (this.a = dwn(n.Tg(), CZ(this.e.Tg(), this.c))); + } + function i3(n, t) { + var e, i; + for (vB(t), i = t.vc().Kc(); i.Ob(); ) (e = Yx(i.Pb(), 42)), n.zc(e.cd(), e.dd()); + } + function r3(n) { + var t; + if (-2 == n.b) { + if (0 == n.e) t = -1; + else for (t = 0; 0 == n.a[t]; t++); + n.b = t; + } + return n.b; + } + function c3(n) { + switch (n.g) { + case 2: + return Ikn(), qit; + case 4: + return Ikn(), Eit; + default: + return n; + } + } + function a3(n) { + switch (n.g) { + case 1: + return Ikn(), Bit; + case 3: + return Ikn(), Tit; + default: + return n; + } + } + function u3(n, t) { + return TA(), aI(n) ? FV(n, lL(t)) : cI(n) ? WK(n, fL(t)) : rI(n) ? XK(n, hL(t)) : n.wd(t); + } + function o3(n, t) { + (t.q = n), (n.d = e.Math.max(n.d, t.r)), (n.b += t.d + (0 == n.a.c.length ? 0 : n.c)), eD(n.a, t); + } + function s3(n, t) { + var e, i, r, c; + return (r = n.c), (e = n.c + n.b), (c = n.d), (i = n.d + n.a), t.a > r && t.a < e && t.b > c && t.b < i; + } + function h3(n, t, e, i) { + CO(n.Cb, 179) && (Yx(n.Cb, 179).tb = null), + E2(n, e), + t && + (function (n, t) { + var e, i, r; + if (t) + if (0 != (4 & t.i)) + for (i = "[]", e = t.c; ; e = e.c) { + if (0 == (4 & e.i)) { + H0(n, (r = iy((sL(e), e.o + i)))), B1(n, r); + break; + } + i += "[]"; + } + else H0(n, (r = iy((sL(t), t.o)))), B1(n, r); + else H0(n, null), B1(n, null); + n.yk(t); + })(n, t), + i && n.xk(!0); + } + function f3(n, t) { + var e; + nq((e = Yx(t, 183)), "x", n.i), nq(e, "y", n.j), nq(e, qNn, n.g), nq(e, HNn, n.f); + } + function l3() { + (l3 = O), (q3n = ltn(AI(oR(oR(new fX(), ($un(), ZGn), ($jn(), XUn)), nzn, RUn), tzn), UUn)); + } + function b3() { + (b3 = O), (Q3n = ltn(AI(oR(oR(new fX(), ($un(), ZGn), ($jn(), XUn)), nzn, RUn), tzn), UUn)); + } + function w3() { + (w3 = O), (u8n = new KS(fIn, 0)), (o8n = new KS("POLAR_COORDINATE", 1)), (a8n = new KS("ID", 2)); + } + function d3() { + (d3 = O), (u3n = new hS("EQUALLY", 0)), (o3n = new hS(NSn, 1)), (s3n = new hS("NORTH_SOUTH", 2)); + } + function g3() { + (g3 = O), (U2n = z6((_bn(), x4(Gy(Q2n, 1), XEn, 260, 0, [q2n, K2n, B2n, _2n, F2n, R2n, H2n, G2n])))); + } + function p3() { + (p3 = O), (sWn = z6((adn(), x4(Gy(pWn, 1), XEn, 270, 0, [tWn, rWn, nWn, uWn, iWn, eWn, aWn, cWn])))); + } + function v3() { + (v3 = O), (R7n = z6((lsn(), x4(Gy(F7n, 1), XEn, 277, 0, [x7n, I7n, $7n, N7n, C7n, O7n, A7n, L7n])))); + } + function m3() { + (m3 = O), (yct = z6((zfn(), x4(Gy(kct, 1), XEn, 237, 0, [vct, dct, gct, wct, pct, lct, fct, bct])))); + } + function y3() { + (y3 = O), (hqn = new _L("debugSVG", (TA(), !1))), (fqn = new _L("overlapsExisted", !0)); + } + function k3(n, t) { + return kJ(new Ab(n), new $b(t), new Lb(t), new tn(), x4(Gy(wBn, 1), XEn, 132, 0, [])); + } + function j3() { + var n; + return ( + iBn || + ((iBn = new Yp()), + (function (n, t) { + hBn || (n.b = t); + })((n = new aV("")), (_E(), eBn)), + (function (n, t) { + 0 == (uV(), hBn ? null : t.c).length && CL(t, new X()), GG(n.a, hBn ? null : t.c, t); + })(iBn, n)), + iBn + ); + } + function E3(n, t) { + var e; + return !!(e = sgn(s0(), n)) && (Aen(t, (Cjn(), Ltt), e), !0); + } + function T3(n, t) { + var e; + for (e = 0; e < t.j.c.length; e++) Yx(jJ(n, e), 21).Gc(Yx(jJ(t, e), 14)); + return n; + } + function M3(n, t) { + var e, i; + for (i = new pb(t.b); i.a < i.c.c.length; ) (e = Yx(Hz(i), 29)), (n.a[e.p] = con(e)); + } + function S3(n, t) { + var e, i; + for (vB(t), i = n.vc().Kc(); i.Ob(); ) (e = Yx(i.Pb(), 42)), t.Od(e.cd(), e.dd()); + } + function P3(n, t) { + CO(t, 83) + ? (Yx(n.c, 76).Xj(), + (function (n, t) { + var e, i; + for (i = t.vc().Kc(); i.Ob(); ) xcn(n, (e = Yx(i.Pb(), 42)).cd(), e.dd()); + })(n, Yx(t, 83))) + : Yx(n.c, 76).Wb(t); + } + function I3(n) { + return CO(n, 152) ? RV(Yx(n, 152)) : CO(n, 131) ? Yx(n, 131).a : CO(n, 54) ? new Tm(n) : new rE(n); + } + function C3(n, t) { + (n.a = t7(n.a, 1)), (n.c = e.Math.min(n.c, t)), (n.b = e.Math.max(n.b, t)), (n.d = t7(n.d, t)); + } + function O3(n, t) { + run(t, "Edge and layer constraint edge reversal", 1), + (function (n) { + var t, e, i, r, c, a, u, o, s, h, f; + for (s = new pb(n); s.a < s.c.c.length; ) { + switch (((o = Yx(Hz(s), 10)), (c = null), (a = Yx(Aun(o, (gjn(), x1n)), 163)).g)) { + case 1: + case 2: + i5(), (c = UWn); + break; + case 3: + case 4: + i5(), (c = GWn); + } + if (c) b5(o, (Ojn(), rQn), (i5(), UWn)), c == GWn ? nwn(o, a, (h0(), e3n)) : c == UWn && nwn(o, a, (h0(), i3n)); + else if (dC(Yx(Aun(o, g0n), 98)) && 0 != o.j.c.length) { + for (t = !0, f = new pb(o.j); f.a < f.c.c.length; ) { + if ( + !( + ((h = Yx(Hz(f), 11)).j == (Ikn(), Eit) && h.e.c.length - h.g.c.length > 0) || + (h.j == qit && h.e.c.length - h.g.c.length < 0) + ) + ) { + t = !1; + break; + } + for (r = new pb(h.g); r.a < r.c.c.length; ) + if (((e = Yx(Hz(r), 17)), (u = Yx(Aun(e.d.i, x1n), 163)) == (d7(), tYn) || u == eYn)) { + t = !1; + break; + } + for (i = new pb(h.e); i.a < i.c.c.length; ) + if (((e = Yx(Hz(i), 17)), (u = Yx(Aun(e.c.i, x1n), 163)) == (d7(), ZQn) || u == nYn)) { + t = !1; + break; + } + } + t && nwn(o, a, (h0(), r3n)); + } + } + })( + (function (n) { + var t, e, i, r, c; + for (c = new pQ(n.a.c.length), r = new pb(n.a); r.a < r.c.c.length; ) { + switch (((i = Yx(Hz(r), 10)), (t = null), (e = Yx(Aun(i, (gjn(), x1n)), 163)).g)) { + case 1: + case 2: + i5(), (t = UWn); + break; + case 3: + case 4: + i5(), (t = GWn); + } + t + ? (b5(i, (Ojn(), rQn), (i5(), UWn)), t == GWn ? nwn(i, e, (h0(), e3n)) : t == UWn && nwn(i, e, (h0(), i3n))) + : (c.c[c.c.length] = i); + } + return c; + })(n), + ), + Ron(t); + } + function A3(n) { + var t; + null == n.d ? (++n.e, (n.f = 0), C8(null)) : (++n.e, (t = n.d), (n.d = null), (n.f = 0), C8(t)); + } + function $3(n) { + var t; + return 0 == (t = n.h) ? n.l + n.m * GTn : t == HTn ? n.l + n.m * GTn - zTn : n; + } + function L3(n) { + return PL(), n.A.Hc((Ann(), Yit)) && !n.B.Hc((Vgn(), urt)) ? dnn(n) : null; + } + function N3(n) { + if ((vB(n), 0 == n.length)) throw hp(new Iy("Zero length BigInteger")); + !(function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g; + for ( + o = b = t.length, + Lz(0, t.length), + 45 == t.charCodeAt(0) ? ((f = -1), (l = 1), --b) : ((f = 1), (l = 0)), + r = (b / (c = (hmn(), yFn)[10])) | 0, + 0 != (g = b % c) && ++r, + u = VQ(Wot, MTn, 25, r, 15, 1), + e = mFn[8], + a = 0, + w = l + (0 == g ? c : g), + d = l; + d < o; + w = (d = w) + c + ) + (i = ipn(t.substr(d, w - d), nTn, Yjn)), jfn(), (s = Gen(u, u, a, e)), (s += fnn(u, a, i)), (u[a++] = s); + (h = a), (n.e = f), (n.d = h), (n.a = u), SU(n); + })(this, n); + } + function x3(n) { + if (!n) throw hp(new Ym("no calls to next() since the last call to remove()")); + } + function D3(n) { + return XTn < n && n < zTn + ? n < 0 + ? e.Math.ceil(n) + : e.Math.floor(n) + : $3( + (function (n) { + var t, e, i, r; + return isNaN(n) + ? (LJ(), A_n) + : n < -0x8000000000000000 + ? (LJ(), C_n) + : n >= 0x8000000000000000 + ? (LJ(), I_n) + : ((i = !1), + n < 0 && ((i = !0), (n = -n)), + (e = 0), + n >= zTn && (n -= (e = oG(n / zTn)) * zTn), + (t = 0), + n >= GTn && (n -= (t = oG(n / GTn)) * GTn), + (r = rO(oG(n), t, e)), + i && A5(r), + r); + })(n), + ); + } + function R3(n, t) { + var e, i, r; + for (e = n.c.Ee(), r = t.Kc(); r.Ob(); ) (i = r.Pb()), n.a.Od(e, i); + return n.b.Kb(e); + } + function K3(n, t) { + var e, i, r; + if (null != (e = n.Jg()) && n.Mg()) for (i = 0, r = e.length; i < r; ++i) e[i].ui(t); + } + function _3(n, t) { + var e, i; + for (i = dB((e = n)).e; i; ) { + if ((e = i) == t) return !0; + i = dB(e).e; + } + return !1; + } + function F3(n, t, e) { + var i, r; + return (r = Yx(nx(n.d, t), 19)), (i = Yx(nx(n.b, e), 19)), r && i ? bQ(n, r.a, i.a) : null; + } + function B3(n, t) { + var e, i; + (i = new ip()), (e = t); + do { + (i.c[i.c.length] = e), (e = Yx(BF(n.k, e), 17)); + } while (e); + return i; + } + function H3(n, t) { + var e; + return 0 != (n.Db & t) ? (-1 == (e = Vin(n, t)) ? n.Eb : h1(n.Eb)[e]) : null; + } + function q3(n, t) { + var e; + return ((e = new Rf()).G = t), !n.rb && (n.rb = new d_(n, iat, n)), fY(n.rb, e), e; + } + function G3(n, t) { + var e; + return ((e = new Bp()).G = t), !n.rb && (n.rb = new d_(n, iat, n)), fY(n.rb, e), e; + } + function z3(n, t) { + switch (t) { + case 1: + return !!n.n && 0 != n.n.i; + case 2: + return null != n.k; + } + return Zz(n, t); + } + function U3(n) { + switch (n.a.g) { + case 1: + return new RP(); + case 3: + return new grn(); + default: + return new Pf(); + } + } + function X3(n) { + var t; + if (n.g > 1 || n.Ob()) return ++n.a, (n.g = 0), (t = n.i), n.Ob(), t; + throw hp(new Kp()); + } + function W3(n) { + var t, e, i; + return (e = 0), (i = n) < 0 && ((i += zTn), (e = HTn)), (t = oG(i / GTn)), rO(oG(i - t * GTn), t, e); + } + function V3(n) { + var t, e, i; + for (i = 0, e = new TE(n.a); e.a < e.c.a.length; ) (t = eW(e)), n.b.Hc(t) && ++i; + return i; + } + function Q3(n, t) { + var e; + (this.c = n), Lin(n, (e = new ip()), t, n.b, null, !1, null, !1), (this.a = new JU(e, 0)); + } + function Y3(n, t) { + (this.b = n), (this.e = t), (this.d = t.j), (this.f = (TT(), Yx(n, 66).Oj())), (this.k = dwn(t.e.Tg(), n)); + } + function J3(n, t, e) { + (this.b = (vB(n), n)), (this.d = (vB(t), t)), (this.e = (vB(e), e)), (this.c = this.d + "" + this.e); + } + function Z3() { + (this.a = Yx(oen((Bdn(), iGn)), 19).a), (this.c = ty(fL(oen(mGn)))), (this.b = ty(fL(oen(dGn)))); + } + function n4() { + (n4 = O), (Zet = z6((Eln(), x4(Gy(cit, 1), XEn, 93, 0, [Get, qet, Uet, Yet, Qet, Vet, Xet, Wet, zet])))); + } + function t4() { + (t4 = O), (nHn = z6(($dn(), x4(Gy(tHn, 1), XEn, 250, 0, [YBn, UBn, XBn, zBn, VBn, QBn, WBn, GBn, qBn])))); + } + function e4() { + (e4 = O), (YHn = new hM("UP", 0)), (WHn = new hM($Sn, 1)), (VHn = new hM(ySn, 2)), (QHn = new hM(kSn, 3)); + } + function i4() { + (i4 = O), KG(), (N5n = new FI(o$n, (x5n = Y5n))), kU(), ($5n = new FI(s$n, (L5n = e6n))); + } + function r4() { + (r4 = O), (DVn = new JM("ONE_SIDED", 0)), (RVn = new JM("TWO_SIDED", 1)), (xVn = new JM("OFF", 2)); + } + function c4(n) { + (n.r = new Qp()), (n.w = new Qp()), (n.t = new ip()), (n.i = new ip()), (n.d = new Qp()), (n.a = new hC()), (n.c = new rp()); + } + function a4(n) { + (this.n = new ip()), (this.e = new ME()), (this.j = new ME()), (this.k = new ip()), (this.f = new ip()), (this.p = n); + } + function u4(n, t) { + n.c && (Xgn(n, t, !0), SE(new SR(null, new Nz(t, 16)), new ld(n))), Xgn(n, t, !1); + } + function o4(n, t) { + var e; + return t ? ((e = t.Ve()).dc() || (n.q ? i3(n.q, e) : (n.q = new II(e))), n) : n; + } + function s4(n, t) { + var e; + return ( + void 0 === (e = n.a.get(t)) + ? ++n.d + : ((function (n, t) { + n[vMn].call(n, t); + })(n.a, t), + --n.c, + gq(n.b)), + e + ); + } + function h4(n) { + var t; + return k8(n, 0) < 0 && (n = wD(n)), 64 - (0 != (t = WR(zK(n, 32))) ? Yhn(t) : Yhn(WR(n)) + 32); + } + function f4(n) { + var t; + return (t = Yx(Aun(n, (Ojn(), hQn)), 61)), n.k == (bon(), _zn) && (t == (Ikn(), qit) || t == Eit); + } + function l4(n, t, e) { + var i, r; + (r = Yx(Aun(n, (gjn(), $1n)), 74)) && (N6((i = new Nv()), 0, r), o1(i, e), C2(t, i)); + } + function b4(n, t, e) { + var i, r, c, a; + (i = (a = dB(n)).d), (r = a.c), (c = n.n), t && (c.a = c.a - i.b - r.a), e && (c.b = c.b - i.d - r.b); + } + function w4(n, t, e, i, r) { + DF(n.c[t.g], e.g, i), DF(n.c[e.g], t.g, i), DF(n.b[t.g], e.g, r), DF(n.b[e.g], t.g, r); + } + function d4(n, t, e, i) { + return 1 == e ? (!n.n && (n.n = new m_(act, n, 1, 7)), Ten(n.n, t, i)) : fon(n, t, e, i); + } + function g4(n, t) { + var e; + return E2((e = new Ho()), t), fY((!n.A && (n.A = new VO(zat, n, 7)), n.A), e), e; + } + function p4(n, t, e) { + var i, r; + return ( + (r = cX(t, UNn)), + (function (n, t, e) { + var i, r, c; + if (e) + for (c = ((i = new NK(e.a.length)).b - i.a) * i.c < 0 ? (PT(), Fot) : new oA(i); c.Ob(); ) + (r = aX(e, Yx(c.Pb(), 19).a)) && Ohn(n, r, t); + })((i = new kP(n, e)).a, i.b, r), + r + ); + } + function v4(n) { + var t; + return (!n.a || (0 == (1 & n.Bb) && n.a.kh())) && CO((t = fcn(n)), 148) && (n.a = Yx(t, 148)), n.a; + } + function m4(n, t) { + var e, i; + for (vB(t), i = t.Kc(); i.Ob(); ) if (((e = i.Pb()), !n.Hc(e))) return !1; + return !0; + } + function y4(n, t) { + var e, i, r; + return (e = n.l - t.l), (i = n.m - t.m + (e >> 22)), (r = n.h - t.h + (i >> 22)), rO(e & BTn, i & BTn, r & HTn); + } + function k4(n) { + var t; + return n < 128 ? (!(t = (dR(), F_n)[n]) && (t = F_n[n] = new eb(n)), t) : new eb(n); + } + function j4(n) { + var t; + return CO(n, 78) ? n : ((t = n && n.__java$exception) || Sp((t = new n8(n))), t); + } + function E4(n) { + if (CO(n, 186)) return Yx(n, 118); + if (n) return null; + throw hp(new Zm(pxn)); + } + function T4(n, t) { + if (null == t) return !1; + for (; n.a != n.b; ) if (Q8(t, w8(n))) return !0; + return !1; + } + function M4(n) { + return !!n.a.Ob() || (n.a == n.d && ((n.a = new ZU(n.e.f)), n.a.Ob())); + } + function S4(n, t) { + var e; + return 0 != (e = t.Pc()).length && (sD(n.c, n.c.length, e), !0); + } + function P4(n, t) { + var e; + for (e = new pb(n.b); e.a < e.c.c.length; ) b5(Yx(Hz(e), 70), (Ojn(), kQn), t); + } + function I4(n, t) { + if (!n) throw hp(new Qm(ngn("value already present: %s", x4(Gy(UKn, 1), iEn, 1, 5, [t])))); + } + function C4(n, t) { + return !(!n || !t || n == t) && Xnn(n.d.c, t.d.c + t.d.b) && Xnn(t.d.c, n.d.c + n.d.b); + } + function O4() { + return uV(), hBn ? new aV(null) : Ifn(j3(), "com.google.common.base.Strings"); + } + function A4(n, t) { + var e; + return (e = h$(t.a.gc())), SE(HZ(new SR(null, new Nz(t, 1)), n.i), new VS(n, e)), e; + } + function $4(n) { + var t; + return E2((t = new Ho()), "T"), fY((!n.d && (n.d = new VO(zat, n, 11)), n.d), t), t; + } + function L4(n) { + var t, e, i, r; + for (t = 1, e = 0, r = n.gc(); e < r; ++e) t = 31 * t + (null == (i = n.ki(e)) ? 0 : W5(i)); + return t; + } + function N4(n, t, e, i) { + var r; + return HU(t, n.e.Hd().gc()), HU(e, n.c.Hd().gc()), (r = n.a[t][e]), DF(n.a[t], e, i), r; + } + function x4(n, t, e, i, r) { + return (r.gm = n), (r.hm = t), (r.im = C), (r.__elementTypeId$ = e), (r.__elementTypeCategory$ = i), r; + } + function D4(n, t, i, r, c) { + return udn(), e.Math.min(Ryn(n, t, i, r, c), Ryn(i, r, n, t, D$(new QS(c.a, c.b)))); + } + function R4() { + (R4 = O), (yXn = new mM(fIn, 0)), (vXn = new mM(qIn, 1)), (mXn = new mM(GIn, 2)), (pXn = new mM("BOTH", 3)); + } + function K4() { + (K4 = O), ($Xn = new RM(pSn, 0)), (LXn = new RM(ySn, 1)), (NXn = new RM(kSn, 2)), (xXn = new RM("TOP", 3)); + } + function _4() { + (_4 = O), (bzn = new wM("Q1", 0)), (gzn = new wM("Q4", 1)), (wzn = new wM("Q2", 2)), (dzn = new wM("Q3", 3)); + } + function F4() { + (F4 = O), (P3n = new wS("OFF", 0)), (I3n = new wS("SINGLE_EDGE", 1)), (S3n = new wS("MULTI_EDGE", 2)); + } + function B4() { + (B4 = O), (o7n = new GS("MINIMUM_SPANNING_TREE", 0)), (u7n = new GS("MAXIMUM_SPANNING_TREE", 1)); + } + function H4() { + (H4 = O), new Og("org.eclipse.elk.addLayoutConfig"), (b7n = new ou()), (l7n = new au()), new uu(); + } + function q4(n) { + var t, e; + for (t = new ME(), e = Ztn(n.d, 0); e.b != e.d.c; ) KD(t, Yx(IX(e), 188).c); + return t; + } + function G4(n) { + var t, e; + for (e = new ip(), t = n.Kc(); t.Ob(); ) S4(e, idn(Yx(t.Pb(), 33))); + return e; + } + function z4(n, t, e) { + var i; + U_(n.a), WZ(e.i, new zd(n)), mtn(n, (i = new uO(Yx(BF(n.a, t.b), 65))), t), (e.f = i); + } + function U4(n, t) { + var e, i; + return (e = n.c), (i = t.e[n.p]) < e.a.c.length - 1 ? Yx(TR(e.a, i + 1), 10) : null; + } + function X4(n, t) { + var e, i; + if (((i = 0), n < 64 && n <= t)) for (t = t < 64 ? t : 63, e = n; e <= t; e++) i = zz(i, GK(1, e)); + return i; + } + function W4(n) { + var t, e, i; + for (XH(), i = 0, e = n.Kc(); e.Ob(); ) (i += null != (t = e.Pb()) ? W5(t) : 0), (i |= 0); + return i; + } + function V4(n) { + var t; + return xk(), (t = new co()), n && fY((!n.a && (n.a = new m_(tct, n, 6, 6)), n.a), t), t; + } + function Q4(n, t) { + if (0 === t) return !n.o && (n.o = new yY((ajn(), Frt), mct, n, 0)), void n.o.c.$b(); + usn(n, t); + } + function Y4(n, t, e) { + switch (e.g) { + case 2: + n.b = t; + break; + case 1: + n.c = t; + break; + case 4: + n.d = t; + break; + case 3: + n.a = t; + } + } + function J4(n) { + switch (n.g) { + case 1: + return Ket; + case 2: + return Ret; + case 3: + return _et; + default: + return Fet; + } + } + function Z4(n) { + switch (Yx(Aun(n, (gjn(), x1n)), 163).g) { + case 2: + case 4: + return !0; + default: + return !1; + } + } + function n5() { + (n5 = O), (NVn = z6((edn(), x4(Gy(KVn, 1), XEn, 256, 0, [TVn, SVn, PVn, IVn, CVn, OVn, $Vn, EVn, MVn, AVn])))); + } + function t5() { + (t5 = O), (brt = z6((Vgn(), x4(Gy(vrt, 1), XEn, 259, 0, [crt, urt, rrt, ort, srt, frt, hrt, art, irt])))); + } + function e5() { + (e5 = O), (u6n = oR(ltn(ltn(bT(oR(new fX(), (Krn(), J4n), (ysn(), h5n)), Z4n), u5n), o5n), n5n, s5n)); + } + function i5() { + (i5 = O), (zWn = new UM(fIn, 0)), (GWn = new UM("INCOMING_ONLY", 1)), (UWn = new UM("OUTGOING_ONLY", 2)); + } + function r5() { + (r5 = O), + (S_n = { + boolean: yE, + number: _m, + string: Fm, + object: Zsn, + function: Zsn, + undefined: gp, + }); + } + function c5(n, t) { + jD(n >= 0, "Negative initial capacity"), jD(t >= 0, "Non-positive load factor"), U_(this); + } + function a5(n, t, e) { + return !(n >= 128) && hI(n < 64 ? Gz(GK(1, n), e) : Gz(GK(1, n - 64), t), 0); + } + function u5(n, t) { + return !(!n || !t || n == t) && y7(n.b.c, t.b.c + t.b.b) < 0 && y7(t.b.c, n.b.c + n.b.b) < 0; + } + function o5(n) { + var t, e, i; + return (e = n.n), (i = n.o), (t = n.d), new mH(e.a - t.b, e.b - t.d, i.a + (t.b + t.c), i.b + (t.d + t.a)); + } + function s5(n) { + var t, i; + for ( + null == n.j && + (n.j = + ($q(), + (function (n) { + var t, i, r; + for (t = "Sz", i = "ez", r = e.Math.min(n.length, 5) - 1; r >= 0; r--) + if (_N(n[r].d, t) || _N(n[r].d, i)) { + n.length >= r + 1 && n.splice(0, r + 1); + break; + } + return n; + })(p_n.ce(n)))), + t = 0, + i = n.j.length; + t < i; + ++t + ); + } + function h5(n) { + var t, e; + return rO((t = (1 + ~n.l) & BTn), (e = (~n.m + (0 == t ? 1 : 0)) & BTn), (~n.h + (0 == t && 0 == e ? 1 : 0)) & HTn); + } + function f5(n, t, e) { + var i; + if (t > (i = n.gc())) throw hp(new jN(t, i)); + return n.hi() && (e = OG(n, e)), n.Vh(t, e); + } + function l5(n, t, e) { + return null == e ? (!n.q && (n.q = new rp()), zV(n.q, t)) : (!n.q && (n.q = new rp()), xB(n.q, t, e)), n; + } + function b5(n, t, e) { + return null == e ? (!n.q && (n.q = new rp()), zV(n.q, t)) : (!n.q && (n.q = new rp()), xB(n.q, t, e)), n; + } + function w5(n) { + var t, i; + return ( + o4((i = new XV()), n), + b5(i, (d2(), EGn), n), + (function (n, t, i) { + var r, c, a, u, o; + for (r = 0, a = new UO((!n.a && (n.a = new m_(uct, n, 10, 11)), n.a)); a.e != a.i.gc(); ) + (u = ""), + 0 == (!(c = Yx(hen(a), 33)).n && (c.n = new m_(act, c, 1, 7)), c.n).i || + (u = Yx(c1((!c.n && (c.n = new m_(act, c, 1, 7)), c.n), 0), 137).a), + o4((o = new GF(u)), c), + b5(o, (d2(), EGn), c), + (o.b = r++), + (o.d.a = c.i + c.g / 2), + (o.d.b = c.j + c.f / 2), + (o.e.a = e.Math.max(c.g, 1)), + (o.e.b = e.Math.max(c.f, 1)), + eD(t.e, o), + Ysn(i.f, c, o), + Yx(jln(c, (Bdn(), fGn)), 98), + Ran(); + })(n, i, (t = new rp())), + (function (n, t, i) { + var r, c, a, u, o, s, f, l; + for (s = new UO((!n.a && (n.a = new m_(uct, n, 10, 11)), n.a)); s.e != s.i.gc(); ) + for (c = new $K(bA(lbn((o = Yx(hen(s), 33))).a.Kc(), new h())); Vfn(c); ) { + if ( + (!(r = Yx(kV(c), 79)).b && (r.b = new AN(Zrt, r, 4, 7)), + !(r.b.i <= 1 && (!r.c && (r.c = new AN(Zrt, r, 5, 8)), r.c.i <= 1))) + ) + throw hp(new by("Graph must not contain hyperedges.")); + if (!Rfn(r) && o != iun(Yx(c1((!r.c && (r.c = new AN(Zrt, r, 5, 8)), r.c), 0), 82))) + for ( + o4((f = new rN()), r), + b5(f, (d2(), EGn), r), + Cl(f, Yx(eI(Dq(i.f, o)), 144)), + Ol(f, Yx(BF(i, iun(Yx(c1((!r.c && (r.c = new AN(Zrt, r, 5, 8)), r.c), 0), 82))), 144)), + eD(t.c, f), + u = new UO((!r.n && (r.n = new m_(act, r, 1, 7)), r.n)); + u.e != u.i.gc(); + + ) + o4((l = new wW(f, (a = Yx(hen(u), 137)).a)), a), + b5(l, EGn, a), + (l.e.a = e.Math.max(a.g, 1)), + (l.e.b = e.Math.max(a.f, 1)), + Wvn(l), + eD(t.d, l); + } + })(n, i, t), + i + ); + } + function d5(n, t) { + var e, i, r; + for (e = !1, i = n.a[t].length, r = 0; r < i - 1; r++) e |= Knn(n, t, r, r + 1); + return e; + } + function g5(n, t, e, i, r) { + var c, a; + for (a = e; a <= r; a++) for (c = t; c <= i; c++) Nin(n, c, a) || cgn(n, c, a, !0, !1); + } + function p5(n, t) { + (this.b = n), HI.call(this, (Yx(c1(aq((YF(), gat).o), 10), 18), t.i), t.g), (this.a = (W2(), Gat)); + } + function v5(n, t) { + (this.c = n), (this.d = t), (this.b = (this.d / this.c.c.Hd().gc()) | 0), (this.a = this.d % this.c.c.Hd().gc()); + } + function m5() { + (this.o = null), (this.k = null), (this.j = null), (this.d = null), (this.b = null), (this.n = null), (this.a = null); + } + function y5(n, t, i) { + (this.q = new e.Date()), this.q.setFullYear(n + TTn, t, i), this.q.setHours(0, 0, 0, 0), Ivn(this, 0); + } + function k5() { + (k5 = O), (W2n = new uS(fIn, 0)), (X2n = new uS("NODES_AND_EDGES", 1)), (V2n = new uS("PREFER_EDGES", 2)); + } + function j5(n) { + var t; + if (n < 0) return nTn; + if (0 == n) return 0; + for (t = zEn; 0 == (t & n); t >>= 1); + return t; + } + function E5(n) { + var t, e; + return 32 == (e = Yhn(n.h)) ? (32 == (t = Yhn(n.m)) ? Yhn(n.l) + 32 : t + 20 - 10) : e - 12; + } + function T5(n) { + var t; + return null == (t = n.a[n.b]) ? null : (DF(n.a, n.b, null), (n.b = (n.b + 1) & (n.a.length - 1)), t); + } + function M5(n) { + var t, e; + return (t = n.t - n.k[n.o.p] * n.d + n.j[n.o.p] > n.f), (e = n.u + n.e[n.o.p] * n.d > n.f * n.s * n.d), t || e; + } + function S5(n, t, e) { + var i, r; + return (i = new nY(t, e)), (r = new q()), (n.b = Hwn(n, n.b, i, r)), r.b || ++n.c, (n.b.b = !1), r.d; + } + function P5(n, t, e) { + var i, r, c; + for (c = 0, r = V8(t, e).Kc(); r.Ob(); ) (i = Yx(r.Pb(), 11)), xB(n.c, i, d9(c++)); + } + function I5(n) { + var t, e; + for (e = new pb(n.a.b); e.a < e.c.c.length; ) (t = Yx(Hz(e), 81)).g.c = -t.g.c - t.g.b; + qbn(n); + } + function C5(n) { + var t, e; + for (e = new pb(n.a.b); e.a < e.c.c.length; ) (t = Yx(Hz(e), 57)).d.c = -t.d.c - t.d.b; + Hbn(n); + } + function O5(n) { + var t; + return (!n.c || (0 == (1 & n.Bb) && 0 != (64 & n.c.Db))) && CO((t = fcn(n)), 88) && (n.c = Yx(t, 26)), n.c; + } + function A5(n) { + var t, e, i; + (t = (1 + ~n.l) & BTn), + (e = (~n.m + (0 == t ? 1 : 0)) & BTn), + (i = (~n.h + (0 == t && 0 == e ? 1 : 0)) & HTn), + (n.l = t), + (n.m = e), + (n.h = i); + } + function $5(n) { + var t, e, i, r, c; + for (t = new Pk(), r = 0, c = (i = n).length; r < c; ++r) (e = i[r]), (t.a += e.a), (t.b += e.b); + return t; + } + function L5(n, t) { + var e, i, r, c, a; + for (XH(), a = !1, r = 0, c = (i = t).length; r < c; ++r) (e = i[r]), (a |= n.Fc(e)); + return a; + } + function N5(n) { + var t, e; + for (udn(), e = -17976931348623157e292, t = 0; t < n.length; t++) n[t] > e && (e = n[t]); + return e; + } + function x5(n, t, e) { + var i; + return Swn(n, t, (i = new ip()), (Ikn(), Eit), !0, !1), Swn(n, e, i, qit, !1, !1), i; + } + function D5(n, t, e) { + var i, r; + return ( + (r = cX(t, "labels")), + (function (n, t, e) { + var i, r, c, a; + if (e) + for (r = ((i = new NK(e.a.length)).b - i.a) * i.c < 0 ? (PT(), Fot) : new oA(i); r.Ob(); ) + (c = aX(e, Yx(r.Pb(), 19).a)) && + ((a = G1(oX(c, zNn), t)), xB(n.f, a, c), rxn in c.a && $0(a, oX(c, rxn)), eun(c, a), ihn(c, a)); + })((i = new AP(n, e)).a, i.b, r), + r + ); + } + function R5(n, t) { + var e; + for (e = 0; e < n.a.a.length; e++) if (!Yx(MR(n.a, e), 169).Lb(t)) return !1; + return !0; + } + function K5(n) { + var t, e, i; + for (XH(), i = 1, e = n.Kc(); e.Ob(); ) (i = 31 * i + (null != (t = e.Pb()) ? W5(t) : 0)), (i |= 0); + return i; + } + function _5(n, t, e, i, r) { + var c; + return ( + (c = tln(n, t)), + e && A5(c), + r && + ((n = (function (n, t) { + var e, i, r; + return ( + t <= 22 + ? ((e = n.l & ((1 << t) - 1)), (i = r = 0)) + : t <= 44 + ? ((e = n.l), (i = n.m & ((1 << (t - 22)) - 1)), (r = 0)) + : ((e = n.l), (i = n.m), (r = n.h & ((1 << (t - 44)) - 1))), + rO(e, i, r) + ); + })(n, t)), + (P_n = i ? h5(n) : rO(n.l, n.m, n.h))), + c + ); + } + function F5(n, t, e) { + var i, r; + return CO(t, 144) && e ? ((i = Yx(t, 144)), (r = e), n.a[i.b][r.b] + n.a[r.b][i.b]) : 0; + } + function B5(n, t) { + switch (t) { + case 7: + return !!n.e && 0 != n.e.i; + case 8: + return !!n.d && 0 != n.d.i; + } + return z7(n, t); + } + function H5(n, t, e) { + (n.g = gsn(n, t, (Ikn(), Eit), n.b)), (n.d = gsn(n, e, Eit, n.b)), 0 != n.g.c && 0 != n.d.c && eon(n); + } + function q5(n, t, e) { + (n.g = gsn(n, t, (Ikn(), qit), n.j)), (n.d = gsn(n, e, qit, n.j)), 0 != n.g.c && 0 != n.d.c && eon(n); + } + function G5(n) { + var t; + return yB(n), (t = new sn()), n.a.sd(t) ? (qO(), new Am(vB(t.a))) : (qO(), qO(), FFn); + } + function z5(n) { + var t; + return !(n.b <= 0) && ((t = VI("MLydhHmsSDkK", gun(XB(n.c, 0)))) > 1 || (t >= 0 && n.b < 3)); + } + function U5(n) { + var t, e; + for (t = new Nv(), e = Ztn(n, 0); e.b != e.d.c; ) A$(t, 0, new fC(Yx(IX(e), 8))); + return t; + } + function X5(n) { + var t; + for (t = new pb(n.a.b); t.a < t.c.c.length; ) Yx(Hz(t), 81).f.$b(); + Lm(n.b, n), rwn(n); + } + function W5(n) { + return aI(n) ? Xen(n) : cI(n) ? ZI(n) : rI(n) ? (vB(n), n ? 1231 : 1237) : IK(n) ? n.Hb() : uK(n) ? _A(n) : sq(n); + } + function V5(n) { + return aI(n) ? fFn : cI(n) ? H_n : rI(n) ? D_n : IK(n) || uK(n) ? n.gm : n.gm || (Array.isArray(n) && Gy(d_n, 1)) || d_n; + } + function Q5(n) { + if (0 === n.g) return new cu(); + throw hp(new Qm(V$n + (null != n.f ? n.f : "" + n.g))); + } + function Y5(n) { + if (0 === n.g) return new iu(); + throw hp(new Qm(V$n + (null != n.f ? n.f : "" + n.g))); + } + function J5(n, t, e) { + if (0 === t) return !n.o && (n.o = new yY((ajn(), Frt), mct, n, 0)), void P3(n.o, e); + Vsn(n, t, e); + } + function Z5(n, t, e) { + (this.g = n), (this.e = new Pk()), (this.f = new Pk()), (this.d = new ME()), (this.b = new ME()), (this.a = t), (this.c = e); + } + function n6(n, t, e, i) { + (this.b = new ip()), (this.n = new ip()), (this.i = i), (this.j = e), (this.s = n), (this.t = t), (this.r = 0), (this.d = 0); + } + function t6(n) { + (this.e = n), (this.d = new lW(this.e.g)), (this.a = this.d), (this.b = M4(this)), (this.$modCount = n.$modCount); + } + function e6(n) { + for (; !n.d || !n.d.Ob(); ) { + if (!n.b || ry(n.b)) return null; + n.d = Yx($_(n.b), 47); + } + return n.d; + } + function i6(n) { + switch (n.g) { + case 1: + return t$n; + default: + case 2: + return 0; + case 3: + return bPn; + case 4: + return e$n; + } + } + function r6() { + var n; + return ( + Ljn(), + Hot || + ((n = (function (n) { + return new cW(3, n); + })(Gkn("M", !0))), + (n = VR(Gkn("M", !1), n)), + (Hot = n)) + ); + } + function c6(n, t) { + var e, i, r; + for (r = n.b; r; ) { + if (0 == (e = n.a.ue(t, r.d))) return r; + (i = e < 0 ? 0 : 1), (r = r.a[i]); + } + return null; + } + function a6(n, t) { + return !!Fbn(n, t) && (Qhn(n.b, Yx(Aun(t, (Ojn(), uQn)), 21), t), KD(n.a, t), !0); + } + function u6(n) { + return hBn ? VQ(rBn, OMn, 572, 0, 0, 1) : Yx(Htn(n.a, VQ(rBn, OMn, 572, n.a.c.length, 0, 1)), 842); + } + function o6(n, t, e) { + var i; + return d0((i = new zv()), t, e), fY((!n.q && (n.q = new m_(fat, n, 11, 10)), n.q), i), i; + } + function s6(n) { + var t, e, i, r; + for ( + e = (r = (function (n, t) { + return t.split(n); + })(Urt, n)).length, + i = VQ(fFn, TEn, 2, e, 6, 1), + t = 0; + t < e; + ++t + ) + i[t] = r[t]; + return i; + } + function h6(n, t) { + var e, i, r, c, a; + for (r = 0, c = (i = t).length; r < c; ++r) (e = i[r]), (a = new XF(n)), e.Qe(a), zvn(a); + U_(n.f); + } + function f6(n, t) { + var e; + return t === n || (!!CO(t, 224) && ((e = Yx(t, 224)), Q8(n.Zb(), e.Zb()))); + } + function l6(n, t) { + var e; + 2 * t + 1 >= n.b.c.length || (l6(n, 2 * t + 1), (e = 2 * t + 2) < n.b.c.length && l6(n, e), shn(n, t)); + } + function b6(n, t, e) { + var i, r; + (this.g = n), (this.c = t), (this.a = this), (this.d = this), (r = U0(e)), (i = VQ(f_n, qEn, 330, r, 0, 1)), (this.b = i); + } + function w6(n, t, e) { + var i; + for (i = e - 1; i >= 0 && n[i] === t[i]; i--); + return i < 0 ? 0 : LT(Gz(n[i], uMn), Gz(t[i], uMn)) ? -1 : 1; + } + function d6(n, t) { + var e, i; + return (i = Yx(H3(n.a, 4), 126)), (e = VQ(Oct, vDn, 415, t, 0, 1)), null != i && smn(i, 0, e, 0, i.length), e; + } + function g6(n, t) { + var e; + return (e = new xdn(0 != (256 & n.f), n.i, n.a, n.d, 0 != (16 & n.f), n.j, n.g, t)), null != n.e || (e.c = n), e; + } + function p6(n, t, e, i, r) { + var c, a; + for (a = e; a <= r; a++) for (c = t; c <= i; c++) if (Nin(n, c, a)) return !0; + return !1; + } + function v6(n, t, e) { + var i, r, c, a; + for (vB(e), a = !1, c = n.Zc(t), r = e.Kc(); r.Ob(); ) (i = r.Pb()), c.Rb(i), (a = !0); + return a; + } + function m6(n, t, e) { + var i, r; + for (r = e.Kc(); r.Ob(); ) if (((i = Yx(r.Pb(), 42)), n.re(t, i.dd()))) return !0; + return !1; + } + function y6(n, t, e) { + return ( + n.d[t.p][e.p] || + ((function (n, t, e) { + if (n.e) + switch (n.b) { + case 1: + !(function (n, t, e) { + (n.i = 0), (n.e = 0), t != e && H5(n, t, e); + })(n.c, t, e); + break; + case 0: + !(function (n, t, e) { + (n.i = 0), (n.e = 0), t != e && q5(n, t, e); + })(n.c, t, e); + } + else YX(n.c, t, e); + (n.a[t.p][e.p] = n.c.i), (n.a[e.p][t.p] = n.c.e); + })(n, t, e), + (n.d[t.p][e.p] = !0), + (n.d[e.p][t.p] = !0)), + n.a[t.p][e.p] + ); + } + function k6(n, t) { + if (!n.ai() && null == t) throw hp(new Qm("The 'no null' constraint is violated")); + return t; + } + function j6(n, t) { + null == n.D && null != n.B && ((n.D = n.B), (n.B = null)), H0(n, null == t ? null : (vB(t), t)), n.C && n.yk(null); + } + function E6(n, t) { + return !(!n || n == t || !O$(t, (Ojn(), vQn))) && Yx(Aun(t, (Ojn(), vQn)), 10) != n; + } + function T6(n) { + switch (n.i) { + case 2: + return !0; + case 1: + return !1; + case -1: + ++n.c; + default: + return n.pl(); + } + } + function M6(n) { + switch (n.i) { + case -2: + return !0; + case -1: + return !1; + case 1: + --n.c; + default: + return n.ql(); + } + } + function S6(n) { + vG.call(this, "The given string does not match the expected format for individual spacings.", n); + } + function P6() { + (P6 = O), (jrt = new yP("ELK", 0)), (Ert = new yP("JSON", 1)), (krt = new yP("DOT", 2)), (Trt = new yP("SVG", 3)); + } + function I6() { + (I6 = O), (E6n = new DS(fIn, 0)), (T6n = new DS("RADIAL_COMPACTION", 1)), (M6n = new DS("WEDGE_COMPACTION", 2)); + } + function C6() { + (C6 = O), (cBn = new FT("CONCURRENT", 0)), (aBn = new FT("IDENTITY_FINISH", 1)), (uBn = new FT("UNORDERED", 2)); + } + function O6() { + (O6 = O), BE(), (jqn = new FI(ePn, (Eqn = vqn))), (kqn = new Og(iPn)), (Tqn = new Og(rPn)), (Mqn = new Og(cPn)); + } + function A6() { + (A6 = O), (SXn = new ji()), (PXn = new Ei()), (MXn = new Ti()), (TXn = new Mi()), vB(new Si()), (EXn = new D()); + } + function $6() { + ($6 = O), (g3n = new lS("CONSERVATIVE", 0)), (p3n = new lS("CONSERVATIVE_SOFT", 1)), (v3n = new lS("SLOPPY", 2)); + } + function L6() { + (L6 = O), (Oet = new RC(15)), (Cet = new DC((Cjn(), utt), Oet)), (Aet = Ott), (Met = ynt), (Set = Jnt), (Iet = ttt), (Pet = ntt); + } + function N6(n, t, e) { + var i, r; + for (i = new ME(), r = Ztn(e, 0); r.b != r.d.c; ) KD(i, new fC(Yx(IX(r), 8))); + v6(n, t, i); + } + function x6(n) { + var t; + return ( + !n.a && (n.a = new m_(sat, n, 9, 5)), + 0 != (t = n.a).i + ? (function (n) { + return n.b ? n.b : n.a; + })(Yx(c1(t, 0), 678)) + : null + ); + } + function D6(n, t) { + var e; + return ( + (e = t7(n, t)), + LT(Uz(n, t), 0) | + (function (n, t) { + return k8(n, t) >= 0; + })(Uz(n, e), 0) + ? e + : t7(IEn, Uz(UK(e, 63), 1)) + ); + } + function R6(n, t) { + var e, i; + if (0 != (i = n.c[t])) for (n.c[t] = 0, n.d -= i, e = t + 1; e < n.a.length; ) (n.a[e] -= i), (e += e & -e); + } + function K6(n) { + var t; + if ((t = n.a.c.length) > 0) return i_(t - 1, n.a.c.length), KV(n.a, t - 1); + throw hp(new Rp()); + } + function _6(n, t, e) { + if (n > t) throw hp(new Qm(NMn + n + xMn + t)); + if (n < 0 || t > e) throw hp(new Py(NMn + n + DMn + t + MMn + e)); + } + function F6(n) { + if (!n.a || 0 == (8 & n.a.i)) throw hp(new Ym("Enumeration class expected for layout option " + n.f)); + } + function B6(n) { + var t; + ++n.j, 0 == n.i ? (n.g = null) : n.i < n.g.length && ((t = n.g), (n.g = n.ri(n.i)), smn(t, 0, n.g, 0, n.i)); + } + function H6(n, t, e) { + var i; + return iz(t, n.c.length), 0 != (i = e.Pc()).length && (sD(n.c, t, i), !0); + } + function q6(n, t, e) { + var i, r, c, a; + for (c = 0, a = (r = e).length; c < a; ++c) if (((i = r[c]), n.b.re(t, i.cd()))) return i; + return null; + } + function G6(n) { + var t, e, i, r, c; + for (c = 1, i = 0, r = (e = n).length; i < r; ++i) (c = 31 * c + (null != (t = e[i]) ? W5(t) : 0)), (c |= 0); + return c; + } + function z6(n) { + var t, e, i, r, c; + for (t = {}, r = 0, c = (i = n).length; r < c; ++r) t[":" + (null != (e = i[r]).f ? e.f : "" + e.g)] = e; + return t; + } + function U6(n) { + var t, e, i; + for (i = 0, e = new $K(bA(n.a.Kc(), new h())); Vfn(e); ) (t = Yx(kV(e), 17)).c.i == t.d.i || ++i; + return i; + } + function X6(n, t) { + var e, i, r; + for (e = n, r = 0; ; ) { + if (e == t) return r; + if (!(i = e.e)) throw hp(new $p()); + (e = dB(i)), ++r; + } + } + function W6(n, t) { + var e, i, r; + for (r = t - n.f, i = new pb(n.d); i.a < i.c.c.length; ) Lnn((e = Yx(Hz(i), 443)), e.e, e.f + r); + n.f = t; + } + function V6(n, t, i) { + return e.Math.abs(t - n) < n$n || e.Math.abs(i - n) < n$n || (t - n > n$n ? n - i > n$n : i - n > n$n); + } + function Q6(n, t) { + return n ? ((t && !n.j) || (CO(n, 124) && 0 == Yx(n, 124).a.b) ? 0 : n.Re()) : 0; + } + function Y6(n, t) { + return n ? ((t && !n.k) || (CO(n, 124) && 0 == Yx(n, 124).a.a) ? 0 : n.Se()) : 0; + } + function J6(n) { + return bdn(), n < 0 ? (-1 != n ? new jen(-1, -n) : lFn) : n <= 10 ? wFn[oG(n)] : new jen(1, n); + } + function Z6(n) { + throw (r5(), hp(new Cm("Unexpected typeof result '" + n + "'; please report this bug to the GWT team"))); + } + function n8(n) { + vy(), + jO(this), + qH(this), + (this.e = n), + Cwn(this, n), + (this.g = null == n ? aEn : I7(n)), + (this.a = ""), + (this.b = n), + (this.a = ""); + } + function t8() { + (this.a = new nu()), (this.f = new Kd(this)), (this.b = new _d(this)), (this.i = new Fd(this)), (this.e = new Bd(this)); + } + function e8() { + vm.call(this, new tY(IZ(16))), g0(2, EEn), (this.b = 2), (this.a = new IB(null, null, 0, null)), kp(this.a, this.a); + } + function i8() { + (i8 = O), (m2n = new eS("DUMMY_NODE_OVER", 0)), (y2n = new eS("DUMMY_NODE_UNDER", 1)), (k2n = new eS("EQUAL", 2)); + } + function r8() { + (r8 = O), (uzn = kG(x4(Gy(oet, 1), XEn, 103, 0, [(t9(), Ztt), net]))), (ozn = kG(x4(Gy(oet, 1), XEn, 103, 0, [eet, Jtt]))); + } + function c8(n) { + return (Ikn(), xit).Hc(n.j) ? ty(fL(Aun(n, (Ojn(), XQn)))) : $5(x4(Gy(B7n, 1), TEn, 8, 0, [n.i.n, n.n, n.a])).b; + } + function a8(n, t) { + var e, i; + (e = n.nk(t, null)), (i = null), t && (Rk(), b1((i = new up()), n.r)), (e = fun(n, i, e)) && e.Fi(); + } + function u8(n, t) { + var e, i, r; + return (i = !1), (e = t.q.d), t.d < n.b && ((r = Bbn(t.q, n.b)), t.q.d > r && (san(t.q, r), (i = e != t.q.d))), i; + } + function o8(n, t) { + var i, r, c, a, u; + return (a = t.i), (u = t.j), (r = a - (i = n.f).i), (c = u - i.j), e.Math.sqrt(r * r + c * c); + } + function s8(n, t) { + var e; + return (e = rtn(n)) || (!Xrt && (Xrt = new Oo()), Cmn(), fY((e = new Yg(xsn(t))).Vk(), n)), e; + } + function h8(n, t) { + var e, i; + return (e = Yx(n.c.Bc(t), 14)) ? ((i = n.hc()).Gc(e), (n.d -= e.gc()), e.$b(), n.mc(i)) : n.jc(); + } + function f8(n, t) { + var e; + for (e = 0; e < t.length; e++) if (n == (Lz(e, t.length), t.charCodeAt(e))) return !0; + return !1; + } + function l8(n, t) { + var e; + for (e = 0; e < t.length; e++) if (n == (Lz(e, t.length), t.charCodeAt(e))) return !0; + return !1; + } + function b8(n) { + var t; + if (0 != n.c) return n.c; + for (t = 0; t < n.a.length; t++) n.c = 33 * n.c + (-1 & n.a[t]); + return (n.c = n.c * n.e), n.c; + } + function w8(n) { + var t; + return S$(n.a != n.b), (t = n.d.a[n.a]), E$(n.b == n.d.c && null != t), (n.c = n.a), (n.a = (n.a + 1) & (n.d.a.length - 1)), t; + } + function d8(n) { + var t; + return o4((t = new sO(n.a)), n), b5(t, (Ojn(), CQn), n), (t.o.a = n.g), (t.o.b = n.f), (t.n.a = n.i), (t.n.b = n.j), t; + } + function g8(n, t, e, i) { + var r, c; + for (c = n.Kc(); c.Ob(); ) ((r = Yx(c.Pb(), 70)).n.a = t.a + (i.a - r.o.a) / 2), (r.n.b = t.b), (t.b += r.o.b + e); + } + function p8(n, t, e) { + var i; + for (i = t.a.a.ec().Kc(); i.Ob(); ) if (bq(n, Yx(i.Pb(), 57), e)) return !0; + return !1; + } + function v8(n) { + var t, e; + for (e = new pb(n.r); e.a < e.c.c.length; ) if (((t = Yx(Hz(e), 10)), n.n[t.p] <= 0)) return t; + return null; + } + function m8(n) { + var t, e; + for (e = new Qp(), t = new pb(n); t.a < t.c.c.length; ) C2(e, rdn(Yx(Hz(t), 33))); + return e; + } + function y8(n, t, e) { + var i; + (i = new gfn(n, t)), Qhn(n.r, t.Hf(), i), e && !c_(n.u) && ((i.c = new eG(n.d)), WZ(t.wf(), new Yb(i))); + } + function k8(n, t) { + var e; + return tC(n) && tC(t) && ((e = n - t), !isNaN(e)) ? e : gcn(tC(n) ? W3(n) : n, tC(t) ? W3(t) : t); + } + function j8(n, t) { + return t < n.length && (Lz(t, n.length), 63 != n.charCodeAt(t)) && (Lz(t, n.length), 35 != n.charCodeAt(t)); + } + function E8(n, t, e, i) { + var r, c; + (n.a = t), (c = i ? 0 : 1), (n.f = ((r = new zon(n.c, n.a, e, c)), new Kdn(e, n.a, r, n.e, n.b, n.c == (l0(), z3n)))); + } + function T8(n, t, e) { + var i, r; + return (r = n.a), (n.a = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && ((i = new p_(n, 1, 1, r, t)), e ? e.Ei(i) : (e = i)), e; + } + function M8(n, t, e) { + var i, r; + return (r = n.b), (n.b = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && ((i = new p_(n, 1, 3, r, t)), e ? e.Ei(i) : (e = i)), e; + } + function S8(n, t, e) { + var i, r; + return (r = n.f), (n.f = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && ((i = new p_(n, 1, 0, r, t)), e ? e.Ei(i) : (e = i)), e; + } + function P8(n, t) { + var e, i, r, c; + return (c = Qsn(((i = t), (r = n ? rtn(n) : null) && r.Xk(), i))) == t && (e = rtn(n)) && e.Xk(), c; + } + function I8(n, t) { + var e, i, r; + for (r = 1, e = n, i = t >= 0 ? t : -t; i > 0; ) i % 2 == 0 ? ((e *= e), (i = (i / 2) | 0)) : ((r *= e), (i -= 1)); + return t < 0 ? 1 / r : r; + } + function C8(n) { + var t, e, i, r; + if (null != n) for (e = 0; e < n.length; ++e) if ((t = n[e])) for (Yx(t.g, 367), r = t.i, i = 0; i < r; ++i); + } + function O8() { + (O8 = O), (Let = new iP("INHERIT", 0)), ($et = new iP("INCLUDE_CHILDREN", 1)), (Net = new iP("SEPARATE_CHILDREN", 2)); + } + function A8(n, t) { + switch (t) { + case 1: + return !n.n && (n.n = new m_(act, n, 1, 7)), void Hmn(n.n); + case 2: + return void $0(n, null); + } + Q4(n, t); + } + function $8(n) { + switch (n.gc()) { + case 0: + return t_n; + case 1: + return new pR(MF(n.Xb(0))); + default: + return new Aq(n); + } + } + function L8(n) { + switch ((px(), n.gc())) { + case 0: + return QF(), h_n; + case 1: + return new My(n.Kc().Pb()); + default: + return new BT(n); + } + } + function N8(n) { + switch ((px(), n.c)) { + case 0: + return QF(), h_n; + case 1: + return new My(vhn(new TE(n))); + default: + return new jm(n); + } + } + function x8(n, t) { + MF(n); + try { + return n.xc(t); + } catch (n) { + if (CO((n = j4(n)), 205) || CO(n, 173)) return null; + throw hp(n); + } + } + function D8(n, t) { + MF(n); + try { + return n.Hc(t); + } catch (n) { + if (CO((n = j4(n)), 205) || CO(n, 173)) return !1; + throw hp(n); + } + } + function R8(n, t) { + MF(n); + try { + return n._b(t); + } catch (n) { + if (CO((n = j4(n)), 205) || CO(n, 173)) return !1; + throw hp(n); + } + } + function K8(n, t) { + (n.a.c.length > 0 && a6(Yx(TR(n.a, n.a.c.length - 1), 570), t)) || eD(n.a, new iV(t)); + } + function _8(n) { + var t; + return ((t = new Ay()).a += "VerticalSegment "), mI(t, n.e), (t.a += " "), yI(t, lA(new Ty(), new pb(n.k))), t.a; + } + function F8(n) { + var t; + return (t = Yx(UJ(n.c.c, ""), 229)) || ((t = new dz(ok(uk(new pu(), ""), "Other"))), Gtn(n.c.c, "", t)), t; + } + function B8(n) { + var t; + return 0 != (64 & n.Db) ? Kln(n) : (((t = new MA(Kln(n))).a += " (name: "), pI(t, n.zb), (t.a += ")"), t.a); + } + function H8(n, t, e) { + var i, r; + return (r = n.sb), (n.sb = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && ((i = new p_(n, 1, 4, r, t)), e ? e.Ei(i) : (e = i)), e; + } + function q8(n, t) { + var e, i; + for (e = 0, i = i7(n, t).Kc(); i.Ob(); ) e += null != Aun(Yx(i.Pb(), 11), (Ojn(), RQn)) ? 1 : 0; + return e; + } + function G8(n, t, e) { + var i, r, c; + for (i = 0, c = Ztn(n, 0); c.b != c.d.c && !((r = ty(fL(IX(c)))) > e); ) r >= t && ++i; + return i; + } + function z8(n, t, e) { + var i, r; + return (r = n.r), (n.r = t), 0 != (4 & n.Db) && 0 == (1 & n.Db) && ((i = new p_(n, 1, 8, r, n.r)), e ? e.Ei(i) : (e = i)), e; + } + function U8(n, t) { + var e, i; + return !(i = (e = Yx(t, 676)).vk()) && e.wk((i = CO(t, 88) ? new UP(n, Yx(t, 26)) : new mU(n, Yx(t, 148)))), i; + } + function X8(n, t, e) { + var i; + n.qi(n.i + 1), (i = n.oi(t, e)), t != n.i && smn(n.g, t, n.g, t + 1, n.i - t), DF(n.g, t, i), ++n.i, n.bi(t, e), n.ci(); + } + function W8(n, t) { + var e; + return (e = new sn()), n.a.sd(e) ? (qO(), new Am(vB(fJ(n, e.a, t)))) : (yB(n), qO(), qO(), FFn); + } + function V8(n, t) { + switch (t.g) { + case 2: + case 1: + return i7(n, t); + case 3: + case 4: + return I3(i7(n, t)); + } + return XH(), XH(), TFn; + } + function Q8(n, t) { + return aI(n) ? _N(n, t) : cI(n) ? KN(n, t) : rI(n) ? (vB(n), iI(n) === iI(t)) : IK(n) ? n.Fb(t) : uK(n) ? WI(n, t) : Jz(n, t); + } + function Y8(n, t, e, i, r) { + 0 != t && + 0 != i && + (1 == t + ? (r[i] = Gen(r, e, i, n[0])) + : 1 == i + ? (r[t] = Gen(r, n, t, e[0])) + : (function (n, t, e, i, r) { + var c, a, u, o; + if (iI(n) !== iI(t) || i != r) + for (u = 0; u < i; u++) { + for (a = 0, c = n[u], o = 0; o < r; o++) + (a = t7(t7(e7(Gz(c, uMn), Gz(t[o], uMn)), Gz(e[u + o], uMn)), Gz(WR(a), uMn))), + (e[u + o] = WR(a)), + (a = UK(a, 32)); + e[u + r] = WR(a); + } + else fpn(n, i, e); + })(n, e, r, t, i)); + } + function J8(n, t) { + var e; + 0 != n.c.length && (uC((e = Yx(Htn(n, VQ(Gzn, kIn, 10, n.c.length, 0, 1)), 193)), new Oe()), Zhn(e, t)); + } + function Z8(n, t) { + var e; + 0 != n.c.length && (uC((e = Yx(Htn(n, VQ(Gzn, kIn, 10, n.c.length, 0, 1)), 193)), new Ae()), Zhn(e, t)); + } + function n9(n, t, e, i) { + switch (t) { + case 1: + return !n.n && (n.n = new m_(act, n, 1, 7)), n.n; + case 2: + return n.k; + } + return Mrn(n, t, e, i); + } + function t9() { + (t9 = O), (tet = new ZS(MSn, 0)), (net = new ZS(kSn, 1)), (Ztt = new ZS(ySn, 2)), (Jtt = new ZS($Sn, 3)), (eet = new ZS("UP", 4)); + } + function e9() { + (e9 = O), (Izn = new dM(fIn, 0)), (Pzn = new dM("INSIDE_PORT_SIDE_GROUPS", 1)), (Szn = new dM("FORCE_MODEL_ORDER", 2)); + } + function i9(n, t, e) { + if (n < 0 || t > e) throw hp(new Hm(NMn + n + DMn + t + ", size: " + e)); + if (n > t) throw hp(new Qm(NMn + n + xMn + t)); + } + function r9(n, t, e) { + if (t < 0) Ehn(n, e); + else { + if (!e.Ij()) throw hp(new Qm(mNn + e.ne() + yNn)); + Yx(e, 66).Nj().Vj(n, n.yh(), t); + } + } + function c9(n, t, e, i, r, c) { + (this.e = new ip()), (this.f = (h0(), r3n)), eD(this.e, n), (this.d = t), (this.a = e), (this.b = i), (this.f = r), (this.c = c); + } + function a9(n, t) { + var e, i; + for (i = new UO(n); i.e != i.i.gc(); ) if (((e = Yx(hen(i), 26)), iI(t) === iI(e))) return !0; + return !1; + } + function u9(n) { + return n >= 65 && n <= 70 ? n - 65 + 10 : n >= 97 && n <= 102 ? n - 97 + 10 : n >= 48 && n <= 57 ? n - 48 : 0; + } + function o9(n) { + var t; + return 0 != (64 & n.Db) ? Kln(n) : (((t = new MA(Kln(n))).a += " (source: "), pI(t, n.d), (t.a += ")"), t.a); + } + function s9(n, t) { + var e; + (e = 0 != (256 & n.Bb)), t ? (n.Bb |= 256) : (n.Bb &= -257), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new OV(n, 1, 2, e, t)); + } + function h9(n, t) { + var e; + (e = 0 != (256 & n.Bb)), t ? (n.Bb |= 256) : (n.Bb &= -257), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new OV(n, 1, 8, e, t)); + } + function f9(n, t) { + var e; + (e = 0 != (256 & n.Bb)), t ? (n.Bb |= 256) : (n.Bb &= -257), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new OV(n, 1, 8, e, t)); + } + function l9(n, t) { + var e; + (e = 0 != (512 & n.Bb)), t ? (n.Bb |= 512) : (n.Bb &= -513), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new OV(n, 1, 3, e, t)); + } + function b9(n, t) { + var e; + (e = 0 != (512 & n.Bb)), t ? (n.Bb |= 512) : (n.Bb &= -513), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new OV(n, 1, 9, e, t)); + } + function w9(n, t) { + var e; + return -1 == n.b && n.a && ((e = n.a.Gj()), (n.b = e ? n.c.Xg(n.a.aj(), e) : tnn(n.c.Tg(), n.a))), n.c.Og(n.b, t); + } + function d9(n) { + var t, e; + return n > -129 && n < 128 ? ((t = n + 128), !(e = (ZD(), G_n)[t]) && (e = G_n[t] = new rb(n)), e) : new rb(n); + } + function g9(n) { + var t, e; + return n > -129 && n < 128 ? ((t = n + 128), !(e = (wR(), Z_n)[t]) && (e = Z_n[t] = new ab(n)), e) : new ab(n); + } + function p9(n) { + var t; + return n.k == (bon(), _zn) && ((t = Yx(Aun(n, (Ojn(), hQn)), 61)) == (Ikn(), Tit) || t == Bit); + } + function v9(n, t, e) { + var i, r; + return (r = Hln(n.b, t)) && (i = Yx(Imn(SJ(n, r), ""), 26)) ? Lln(n, i, t, e) : null; + } + function m9(n, t) { + var e, i; + for (i = new UO(n); i.e != i.i.gc(); ) if (((e = Yx(hen(i), 138)), iI(t) === iI(e))) return !0; + return !1; + } + function y9(n, t, e) { + var i; + if (t > (i = n.gc())) throw hp(new jN(t, i)); + if (n.hi() && n.Hc(e)) throw hp(new Qm(kxn)); + n.Xh(t, e); + } + function k9(n, t) { + var e; + if (CO((e = Ybn(n, t)), 322)) return Yx(e, 34); + throw hp(new Qm(mNn + t + "' is not a valid attribute")); + } + function j9(n) { + var t, e, i; + for (t = new ip(), i = new pb(n.b); i.a < i.c.c.length; ) (e = Yx(Hz(i), 594)), S4(t, Yx(e.jf(), 14)); + return t; + } + function E9(n) { + switch (Yx(Aun(n, (Ojn(), pQn)), 303).g) { + case 1: + b5(n, pQn, (AJ(), FVn)); + break; + case 2: + b5(n, pQn, (AJ(), HVn)); + } + } + function T9(n) { + var t; + n.g && (xwn((t = n.c.Rf() ? n.f : n.a).a, n.o, !0), xwn(t.a, n.o, !1), b5(n.o, (gjn(), g0n), (Ran(), uit))); + } + function M9(n) { + var t; + if (!n.a) throw hp(new Ym("Cannot offset an unassigned cut.")); + (t = n.c - n.b), (n.b += t), ZH(n, t), JH(n, t); + } + function S9(n) { + var t, e; + for (e = n.p.a.ec().Kc(); e.Ob(); ) if ((t = Yx(e.Pb(), 213)).f && n.b[t.c] < -1e-10) return t; + return null; + } + function P9(n, t) { + switch (n.b.g) { + case 0: + case 1: + return t; + case 2: + case 3: + return new mH(t.d, 0, t.a, t.b); + default: + return null; + } + } + function I9(n) { + switch (n.g) { + case 2: + return net; + case 1: + return Ztt; + case 4: + return Jtt; + case 3: + return eet; + default: + return tet; + } + } + function C9(n) { + switch (n.g) { + case 1: + return qit; + case 2: + return Tit; + case 3: + return Eit; + case 4: + return Bit; + default: + return Hit; + } + } + function O9(n) { + switch (n.g) { + case 1: + return Bit; + case 2: + return qit; + case 3: + return Tit; + case 4: + return Eit; + default: + return Hit; + } + } + function A9(n) { + switch (n.g) { + case 1: + return Eit; + case 2: + return Bit; + case 3: + return qit; + case 4: + return Tit; + default: + return Hit; + } + } + function $9(n, t) { + return n < t ? -1 : n > t ? 1 : n == t ? (0 == n ? $9(1 / n, 1 / t) : 0) : isNaN(n) ? (isNaN(t) ? 0 : 1) : -1; + } + function L9(n, t, e) { + var i, r; + return n.ej() ? ((r = n.fj()), (i = Vhn(n, t, e)), n.$i(n.Zi(7, d9(e), i, t, r)), i) : Vhn(n, t, e); + } + function N9(n, t) { + var e, i, r; + null == n.d + ? (++n.e, --n.f) + : ((r = t.cd()), + (function (n, t, e) { + ++n.e, --n.f, Yx(n.d[t].$c(e), 133).dd(); + })(n, (i = ((e = t.Sh()) & Yjn) % n.d.length), Bln(n, i, e, r))); + } + function x9(n, t) { + var e; + (e = 0 != (n.Bb & DNn)), t ? (n.Bb |= DNn) : (n.Bb &= -1025), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new OV(n, 1, 10, e, t)); + } + function D9(n, t) { + var e; + (e = 0 != (n.Bb & nMn)), t ? (n.Bb |= nMn) : (n.Bb &= -4097), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new OV(n, 1, 12, e, t)); + } + function R9(n, t) { + var e; + (e = 0 != (n.Bb & _Dn)), t ? (n.Bb |= _Dn) : (n.Bb &= -8193), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new OV(n, 1, 15, e, t)); + } + function K9(n, t) { + var e; + (e = 0 != (n.Bb & FDn)), t ? (n.Bb |= FDn) : (n.Bb &= -2049), 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new OV(n, 1, 11, e, t)); + } + function _9(n) { + var t, e; + for (e = Vln(i1(n)).Kc(); e.Ob(); ) if (dpn(n, (t = lL(e.Pb())))) return dW((pT(), Jct), t); + return null; + } + function F9(n, t, e) { + var i; + if (n.c) Pun(n.c, t, e); + else for (i = new pb(n.b); i.a < i.c.c.length; ) F9(Yx(Hz(i), 157), t, e); + } + function B9(n, t) { + var e, i; + for (i = new pb(t); i.a < i.c.c.length; ) (e = Yx(Hz(i), 46)), uJ(n.b.b, e.b), dq(Yx(e.a, 189), Yx(e.b, 81)); + } + function H9(n, t) { + var e; + (e = 0 != (n.Bb & MEn)), + t ? (n.Bb |= MEn) : (n.Bb &= -16385), + 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new OV(n, 1, 16, e, t)); + } + function q9(n, t) { + var e; + (e = 0 != (n.Bb & MNn)), + t ? (n.Bb |= MNn) : (n.Bb &= -32769), + 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new OV(n, 1, 18, e, t)); + } + function G9(n, t) { + var e; + (e = 0 != (n.Bb & MNn)), + t ? (n.Bb |= MNn) : (n.Bb &= -32769), + 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new OV(n, 1, 18, e, t)); + } + function z9(n, t) { + var e; + (e = 0 != (n.Bb & eMn)), + t ? (n.Bb |= eMn) : (n.Bb &= -65537), + 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new OV(n, 1, 20, e, t)); + } + function U9(n) { + var t; + return ( + (t = VQ(Xot, sTn, 25, 2, 15, 1)), + (n -= eMn), + (t[0] = ((n >> 10) + iMn) & fTn), + (t[1] = (56320 + (1023 & n)) & fTn), + Vnn(t, 0, t.length) + ); + } + function X9(n) { + var t; + return (t = Yx(Aun(n, (gjn(), a1n)), 103)) == (t9(), tet) ? (ty(fL(Aun(n, RZn))) >= 1 ? net : Jtt) : t; + } + function W9(n) { + if (n.c) W9(n.c); + else if (n.d) throw hp(new Ym("Stream already terminated, can't be modified or used")); + } + function V9(n) { + var t; + return 0 != (64 & n.Db) ? Kln(n) : (((t = new MA(Kln(n))).a += " (identifier: "), pI(t, n.k), (t.a += ")"), t.a); + } + function Q9(n, t, e) { + var i; + return xk(), I1((i = new ro()), t), C1(i, e), n && fY((!n.a && (n.a = new XO(Qrt, n, 5)), n.a), i), i; + } + function Y9(n, t, e, i) { + var r, c; + return vB(i), vB(e), null == (c = null == (r = n.xc(t)) ? e : PE(Yx(r, 15), Yx(e, 14))) ? n.Bc(t) : n.zc(t, c), c; + } + function J9(n) { + var t, e, i, r; + return n2((e = new cx((t = Yx(Ak((r = (i = n.gm).f) == u_n ? i : r), 9)), Yx(eN(t, t.length), 9), 0)), n), e; + } + function Z9(n, t, e) { + var i, r; + for (r = n.a.ec().Kc(); r.Ob(); ) if (((i = Yx(r.Pb(), 10)), m4(e, Yx(TR(t, i.p), 14)))) return i; + return null; + } + function n7(n, t) { + var e; + return tC(n) && tC(t) && XTn < (e = n - t) && e < zTn ? e : $3(y4(tC(n) ? W3(n) : n, tC(t) ? W3(t) : t)); + } + function t7(n, t) { + var e; + return tC(n) && tC(t) && XTn < (e = n + t) && e < zTn + ? e + : $3( + (function (n, t) { + var e, i, r; + return (e = n.l + t.l), (i = n.m + t.m + (e >> 22)), (r = n.h + t.h + (i >> 22)), rO(e & BTn, i & BTn, r & HTn); + })(tC(n) ? W3(n) : n, tC(t) ? W3(t) : t), + ); + } + function e7(n, t) { + var e; + return tC(n) && tC(t) && XTn < (e = n * t) && e < zTn + ? e + : $3( + (function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m; + return ( + (e = 8191 & n.l), + (i = (n.l >> 13) | ((15 & n.m) << 9)), + (r = (n.m >> 4) & 8191), + (c = (n.m >> 17) | ((255 & n.h) << 5)), + (a = (1048320 & n.h) >> 8), + (g = i * (u = 8191 & t.l)), + (p = r * u), + (v = c * u), + (m = a * u), + 0 != (o = (t.l >> 13) | ((15 & t.m) << 9)) && ((g += e * o), (p += i * o), (v += r * o), (m += c * o)), + 0 != (s = (t.m >> 4) & 8191) && ((p += e * s), (v += i * s), (m += r * s)), + 0 != (h = (t.m >> 17) | ((255 & t.h) << 5)) && ((v += e * h), (m += i * h)), + 0 != (f = (1048320 & t.h) >> 8) && (m += e * f), + (b = ((d = e * u) >> 22) + (g >> 9) + ((262143 & p) << 4) + ((31 & v) << 17)), + (w = (p >> 18) + (v >> 5) + ((4095 & m) << 8)), + (w += (b += (l = (d & BTn) + ((511 & g) << 13)) >> 22) >> 22), + rO((l &= BTn), (b &= BTn), (w &= HTn)) + ); + })(tC(n) ? W3(n) : n, tC(t) ? W3(t) : t), + ); + } + function i7(n, t) { + var e; + return n.i || yhn(n), (e = Yx(GB(n.g, t), 46)) ? new Oz(n.j, Yx(e.a, 19).a, Yx(e.b, 19).a) : (XH(), XH(), TFn); + } + function r7(n, t, e) { + var i; + return (i = n.a.get(t)), n.a.set(t, void 0 === e ? null : e), void 0 === i ? (++n.c, gq(n.b)) : ++n.d, i; + } + function c7() { + var n, t, i; + Qan(), + (i = XFn++ + Date.now()), + (n = oG(e.Math.floor(i * jMn)) & TMn), + (t = oG(i - n * EMn)), + (this.a = 1502 ^ n), + (this.b = t ^ kMn); + } + function a7(n) { + var t, e; + for (t = new ip(), e = new pb(n.j); e.a < e.c.c.length; ) eD(t, Yx(Hz(e), 11).b); + return MF(t), new KI(t); + } + function u7(n) { + var t, e; + for (t = new ip(), e = new pb(n.j); e.a < e.c.c.length; ) eD(t, Yx(Hz(e), 11).e); + return MF(t), new KI(t); + } + function o7(n) { + var t, e; + for (t = new ip(), e = new pb(n.j); e.a < e.c.c.length; ) eD(t, Yx(Hz(e), 11).g); + return MF(t), new KI(t); + } + function s7(n) { + var t, e; + for ( + e = (function (n) { + var t, e, i, r, c, a, u; + if ((t = n.Hh(hRn)) && null != (u = lL(ynn((!t.b && (t.b = new z$((xjn(), Dat), out, t)), t.b), "settingDelegates")))) { + for (e = new ip(), c = 0, a = (r = Ogn(u, "\\w+")).length; c < a; ++c) (i = r[c]), (e.c[e.c.length] = i); + return e; + } + return XH(), XH(), TFn; + })(i1(HG(n))).Kc(); + e.Ob(); + + ) + if (dpn(n, (t = lL(e.Pb())))) return gW((vT(), uat), t); + return null; + } + function h7(n) { + return ( + (n = (((n = (((n -= (n >> 1) & 1431655765) >> 2) & 858993459) + (858993459 & n)) >> 4) + n) & 252645135), + 63 & ((n += n >> 8) + (n >> 16)) + ); + } + function f7(n) { + var t, e, i; + for (t = new UL(n.Hd().gc()), i = 0, e = PY(n.Hd().Kc()); e.Ob(); ) XG(t, e.Pb(), d9(i++)); + return (function (n) { + var t; + switch ((KB(), n.c.length)) { + case 0: + return e_n; + case 1: + return (function (n, t) { + return KB(), gin(n, t), new OB(n, t); + })((t = Yx(vhn(new pb(n)), 42)).cd(), t.dd()); + default: + return new Em(Yx(Htn(n, VQ(i_n, DEn, 42, n.c.length, 0, 1)), 165)); + } + })(t.a); + } + function l7(n, t) { + 0 == n.n.c.length && eD(n.n, new gG(n.s, n.t, n.i)), eD(n.b, t), Cin(Yx(TR(n.n, n.n.c.length - 1), 211), t), uvn(n, t); + } + function b7(n) { + return ( + (n.c == n.b.b && n.i == n.g.b) || + ((n.a.c = VQ(UKn, iEn, 1, 0, 5, 1)), S4(n.a, n.b), S4(n.a, n.g), (n.c = n.b.b), (n.i = n.g.b)), + n.a + ); + } + function w7(n, t) { + var e, i; + for (i = 0, e = Yx(t.Kb(n), 20).Kc(); e.Ob(); ) ny(hL(Aun(Yx(e.Pb(), 17), (Ojn(), HQn)))) || ++i; + return i; + } + function d7() { + (d7 = O), + (iYn = new cS(fIn, 0)), + (ZQn = new cS("FIRST", 1)), + (nYn = new cS(qIn, 2)), + (tYn = new cS("LAST", 3)), + (eYn = new cS(GIn, 4)); + } + function g7() { + (g7 = O), (wet = new tP(MSn, 0)), (fet = new tP("POLYLINE", 1)), (het = new tP("ORTHOGONAL", 2)), (bet = new tP("SPLINES", 3)); + } + function p7() { + (p7 = O), (b8n = new _S("ASPECT_RATIO_DRIVEN", 0)), (w8n = new _S("MAX_SCALE_DRIVEN", 1)), (l8n = new _S("AREA_DRIVEN", 2)); + } + function v7() { + (v7 = O), (e9n = new BS("P1_STRUCTURE", 0)), (i9n = new BS("P2_PROCESSING_ORDER", 1)), (r9n = new BS("P3_EXECUTION", 2)); + } + function m7() { + (m7 = O), (g6n = new NS("OVERLAP_REMOVAL", 0)), (w6n = new NS("COMPACTION", 1)), (d6n = new NS("GRAPH_SIZE_CALCULATION", 2)); + } + function y7(n, t) { + return ( + XC(), + o0(ZEn), + e.Math.abs(n - t) <= ZEn || n == t || (isNaN(n) && isNaN(t)) ? 0 : n < t ? -1 : n > t ? 1 : QI(isNaN(n), isNaN(t)) + ); + } + function k7(n, t) { + var e, i; + for (e = Ztn(n, 0); e.b != e.d.c; ) { + if ((i = ey(fL(IX(e)))) == t) return; + if (i > t) { + MU(e); + break; + } + } + oF(e, t); + } + function j7(n, t) { + var e, i, r, c, a; + if (((e = t.f), Gtn(n.c.d, e, t), null != t.g)) for (c = 0, a = (r = t.g).length; c < a; ++c) (i = r[c]), Gtn(n.c.e, i, t); + } + function E7(n, t, e, i) { + if (t < 0) pbn(n, e, i); + else { + if (!e.Ij()) throw hp(new Qm(mNn + e.ne() + yNn)); + Yx(e, 66).Nj().Tj(n, n.yh(), t, i); + } + } + function T7(n, t) { + if (t == n.d) return n.e; + if (t == n.e) return n.d; + throw hp(new Qm("Node " + t + " not part of edge " + n)); + } + function M7(n, t) { + switch (t.g) { + case 2: + return n.b; + case 1: + return n.c; + case 4: + return n.d; + case 3: + return n.a; + default: + return !1; + } + } + function S7(n, t, e, i) { + switch (t) { + case 3: + return n.f; + case 4: + return n.g; + case 5: + return n.i; + case 6: + return n.j; + } + return n9(n, t, e, i); + } + function P7(n) { + return n.k == (bon(), Hzn) && JW(new SR(null, new nF(new $K(bA(o7(n).a.Kc(), new h())))), new qr()); + } + function I7(n) { + return Array.isArray(n) && n.im === C ? Nk(V5(n)) + "@" + (W5(n) >>> 0).toString(16) : n.toString(); + } + function C7(n) { + var t; + (this.a = new cx((t = Yx(n.e && n.e(), 9)), Yx(eN(t, t.length), 9), 0)), (this.b = VQ(UKn, iEn, 1, this.a.a.length, 5, 1)); + } + function O7(n) { + var t, e, i; + for (this.a = new oC(), i = new pb(n); i.a < i.c.c.length; ) (e = Yx(Hz(i), 14)), r2((t = new qR()), e), __(this.a, t); + } + function A7(n) { + var t; + if (n.b) { + if ((A7(n.b), n.b.d != n.c)) throw hp(new Dp()); + } else n.d.dc() && (t = Yx(n.f.c.xc(n.e), 14)) && (n.d = t); + } + function $7(n, t, e) { + var i, r; + for (i = 0, r = n.length; i < r; i++) if (a5((Lz(i, n.length), n.charCodeAt(i)), t, e)) return !0; + return !1; + } + function L7(n, t) { + var e, i; + for (i = n.e.a.ec().Kc(); i.Ob(); ) if (hon(t, (e = Yx(i.Pb(), 266)).d) || ehn(t, e.d)) return !0; + return !1; + } + function N7(n, t) { + var i, r, c; + for ( + c = + (r = (function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b; + for ( + c = 2 * ty(fL(Aun((s = dB(t.a)), (gjn(), K0n)))), + f = ty(fL(Aun(s, z0n))), + h = e.Math.max(c, f), + a = VQ(Jot, rMn, 25, t.f - t.c + 1, 15, 1), + r = -h, + i = 0, + o = t.b.Kc(); + o.Ob(); + + ) + (u = Yx(o.Pb(), 10)), (r += n.a[u.c.p] + h), (a[i++] = r); + for (r += n.a[t.a.c.p] + h, a[i++] = r, b = new pb(t.e); b.a < b.c.c.length; ) + (l = Yx(Hz(b), 10)), (r += n.a[l.c.p] + h), (a[i++] = r); + return a; + })(n, t))[r.length - 1] / 2, + i = 0; + i < r.length; + i++ + ) + if (r[i] >= c) return t.c + i; + return t.c + t.b.gc(); + } + function x7(n, t) { + var e, i, r, c, a, u; + for (i = 0, e = 0, a = 0, u = (c = t).length; a < u; ++a) (r = c[a]) > 0 && ((i += r), ++e); + return e > 1 && (i += n.d * (e - 1)), i; + } + function D7(n) { + var t, e, i; + for ((i = new Cy()).a += "[", t = 0, e = n.gc(); t < e; ) pI(i, xA(n.ki(t))), ++t < e && (i.a += tEn); + return (i.a += "]"), i.a; + } + function R7(n) { + var t, e; + for (e = ty(fL(n.a.We((Cjn(), Gtt)))), t = new pb(n.a.xf()); t.a < t.c.c.length; ) Hkn(n, Yx(Hz(t), 680), e); + } + function K7(n, t) { + var e, i; + for (i = new pb(t); i.a < i.c.c.length; ) (e = Yx(Hz(i), 46)), eD(n.b.b, Yx(e.b, 81)), GU(Yx(e.a, 189), Yx(e.b, 81)); + } + function _7(n, t, i) { + var r; + !(r = i) && (r = xD(new am(), 0)), + run(r, rIn, 2), + Wen(n.b, t, J2(r, 1)), + (function (n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b; + for ( + o = (function (n) { + var t, e, i, r, c; + for (t = new ep(), e = new ep(), OX(t, n), OX(e, n); e.b != e.c; ) + for (c = new pb(Yx($_(e), 37).a); c.a < c.c.c.length; ) (r = Yx(Hz(c), 10)).e && (OX(t, (i = r.e)), OX(e, i)); + return t; + })(t), + Yx(Aun(t, (gjn(), i1n)), 314) != (O0(), TWn) && XW(o, new vt()), + XW(o, new cw(Yx(Aun(t, YZn), 292))), + b = 0, + s = new ip(), + r = new VB(o); + r.a != r.b; + + ) + (i = Yx(w8(r), 37)), $yn(n.c, i), (b += (f = Yx(Aun(i, (Ojn(), _Qn)), 15)).gc()), eD(s, new mP(i, f.Kc())); + for (run(e, "Recursive hierarchical layout", b), l = Yx(Yx(TR(s, s.c.length - 1), 46).b, 47); l.Ob(); ) + for (u = new pb(s); u.a < u.c.c.length; ) + for (a = Yx(Hz(u), 46), f = Yx(a.b, 47), c = Yx(a.a, 37); f.Ob(); ) { + if (CO((h = Yx(f.Pb(), 51)), 507)) { + if (c.e) break; + h.pf(c, J2(e, 1)); + break; + } + h.pf(c, J2(e, 1)); + } + Ron(e); + })(n, t, J2(r, 1)), + (function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M, S; + for ( + run(t, "Compound graph postprocessor", 1), + i = ny(hL(Aun(n, (gjn(), Q0n)))), + o = Yx(Aun(n, (Ojn(), eQn)), 224), + f = new Qp(), + v = o.ec().Kc(); + v.Ob(); + + ) { + for ( + p = Yx(v.Pb(), 17), + u = new sx(o.cc(p)), + XH(), + JC(u, new ow(n)), + j = q2(($z(0, u.c.length), Yx(u.c[0], 243))), + T = G2(Yx(TR(u, u.c.length - 1), 243)), + y = j.i, + m = _3(T.i, y) ? y.e : dB(y), + l = pen(p, u), + BH(p.a), + b = null, + a = new pb(u); + a.a < a.c.c.length; + + ) + (c = Yx(Hz(a), 243)), + dsn((g = new Pk()), c.a, m), + (w = c.b), + N6((r = new Nv()), 0, w.a), + o1(r, g), + (k = new fC(Dz(w.c))), + (E = new fC(Dz(w.d))), + mN(k, g), + mN(E, g), + b && + (0 == r.b ? (d = E) : (S$(0 != r.b), (d = Yx(r.a.a.c, 8))), + (M = e.Math.abs(b.a - d.a) > PPn), + (S = e.Math.abs(b.b - d.b) > PPn), + ((!i && M && S) || (i && (M || S))) && KD(p.a, k)), + C2(p.a, r), + 0 == r.b ? (b = k) : (S$(0 != r.b), (b = Yx(r.c.b.c, 8))), + l4(w, l, g), + G2(c) == T && (dB(T.i) != c.a && dsn((g = new Pk()), dB(T.i), m), b5(p, YQn, g)), + Mon(w, p, m), + f.a.zc(w, f); + YG(p, j), QG(p, T); + } + for (h = f.a.ec().Kc(); h.Ob(); ) YG((s = Yx(h.Pb(), 17)), null), QG(s, null); + Ron(t); + })(t, J2(r, 1)), + Ron(r); + } + function F7(n, t, e, i, r, c) { + (this.a = n), + (this.c = t), + (this.b = e), + (this.f = i), + (this.d = r), + (this.e = c), + this.c > 0 && this.b > 0 && AR(this.c, this.b, this.a); + } + function B7(n) { + cnn(), + (this.c = DV(x4(Gy(v7n, 1), iEn, 831, 0, [o2n]))), + (this.b = new rp()), + (this.a = n), + xB(this.b, s2n, 1), + WZ(h2n, new Qd(this)); + } + function H7(n, t) { + var e; + return n.d ? (P_(n.b, t) ? Yx(BF(n.b, t), 51) : ((e = t.Kf()), xB(n.b, t, e), e)) : t.Kf(); + } + function q7(n, t) { + var e; + return ( + iI(n) === iI(t) || + (!!CO(t, 91) && + ((e = Yx(t, 91)), + n.e == e.e && + n.d == e.d && + (function (n, t) { + var e; + for (e = n.d - 1; e >= 0 && n.a[e] === t[e]; e--); + return e < 0; + })(n, e.a))) + ); + } + function G7(n) { + switch ((Ikn(), n.g)) { + case 4: + return Tit; + case 1: + return Eit; + case 3: + return Bit; + case 2: + return qit; + default: + return Hit; + } + } + function z7(n, t) { + switch (t) { + case 3: + return 0 != n.f; + case 4: + return 0 != n.g; + case 5: + return 0 != n.i; + case 6: + return 0 != n.j; + } + return z3(n, t); + } + function U7(n) { + switch (n.g) { + case 0: + return new qa(); + case 1: + return new Ua(); + default: + throw hp(new Qm(FIn + (null != n.f ? n.f : "" + n.g))); + } + } + function X7(n) { + switch (n.g) { + case 0: + return new om(); + case 1: + return new Lv(); + default: + throw hp(new Qm(V$n + (null != n.f ? n.f : "" + n.g))); + } + } + function W7(n) { + var t, e, i; + return (e = n.zg()) ? (CO((t = n.Ug()), 160) && null != (i = W7(Yx(t, 160))) ? i + "." + e : e) : null; + } + function V7(n, t, e) { + var i, r; + for (r = n.Kc(); r.Ob(); ) if (((i = r.Pb()), iI(t) === iI(i) || (null != t && Q8(t, i)))) return e && r.Qb(), !0; + return !1; + } + function Q7(n, t, e) { + var i, r; + if ((++n.j, e.dc())) return !1; + for (r = e.Kc(); r.Ob(); ) (i = r.Pb()), n.Hi(t, n.oi(t, i)), ++t; + return !0; + } + function Y7(n, t) { + var e; + if (t) { + for (e = 0; e < n.i; ++e) if (Yx(n.g[e], 366).Di(t)) return !1; + return fY(n, t); + } + return !1; + } + function J7(n) { + var t, e, i; + for (t = new Sl(), i = new lb(n.b.Kc()); i.b.Ob(); ) (e = qon(Yx(i.b.Pb(), 686))), iF(t, t.a.length, e); + return t.a; + } + function Z7(n) { + var t; + return ( + !n.c && (n.c = new Nn()), + JC(n.d, new Dn()), + (function (n) { + var t, e, i, r, c, a, u; + for (c = new Vk(Yx(MF(new Rn()), 62)), u = ZTn, e = new pb(n.d); e.a < e.c.c.length; ) { + for (u = (t = Yx(Hz(e), 222)).c.c; 0 != c.a.c && (a = Yx(F_(NY(c.a)), 222)).c.c + a.c.b < u; ) fG(c.a, a); + for (r = new sb(new gN(new UA(new ob(c.a).a).b)); OT(r.a.a); ) KD((i = Yx(m$(r.a).cd(), 222)).b, t), KD(t.b, i); + S5(c.a, t, (TA(), $_n)); + } + })(n), + (t = (function (n) { + var t, i, r, c, a, u, o, s, h, f; + for (h = n.a, t = new Qp(), s = 0, r = new pb(n.d); r.a < r.c.c.length; ) { + for (f = 0, I2((i = Yx(Hz(r), 222)).b, new $n()), u = Ztn(i.b, 0); u.b != u.d.c; ) + (a = Yx(IX(u), 222)), t.a._b(a) && ((c = i.c), f < (o = a.c).d + o.a + h && f + c.a + h > o.d && (f = o.d + o.a + h)); + (i.c.d = f), t.a.zc(i, t), (s = e.Math.max(s, i.c.d + i.c.a)); + } + return s; + })(n)), + SE(new SR(null, new Nz(n.d, 16)), new Jb(n)), + t + ); + } + function nnn(n) { + var t; + return 0 != (64 & n.Db) ? B8(n) : (((t = new MA(B8(n))).a += " (instanceClassName: "), pI(t, n.D), (t.a += ")"), t.a); + } + function tnn(n, t) { + var e, i, r; + if ((null == n.i && svn(n), (e = n.i), -1 != (i = t.aj()))) for (r = e.length; i < r; ++i) if (e[i] == t) return i; + return -1; + } + function enn(n) { + var t; + switch ((VF(), (t = n.Pc()).length)) { + case 0: + return t_n; + case 1: + return new pR(MF(t[0])); + default: + return new Aq( + (function (n) { + var t, e; + for (t = 0, e = n.length; t < e; t++) if (null == n[t]) throw hp(new Zm("at index " + t)); + return new ay(n); + })(t), + ); + } + } + function inn(n, t) { + switch (t.g) { + case 1: + return Qx(n.j, (Q2(), Wzn)); + case 2: + return Qx(n.j, (Q2(), Qzn)); + default: + return XH(), XH(), TFn; + } + } + function rnn(n, t) { + switch (t) { + case 3: + return void A1(n, 0); + case 4: + return void $1(n, 0); + case 5: + return void L1(n, 0); + case 6: + return void N1(n, 0); + } + A8(n, t); + } + function cnn() { + (cnn = O), + rT(), + gjn(), + (s2n = G0n), + (h2n = DV(x4(Gy(S7n, 1), DAn, 146, 0, [L0n, N0n, D0n, R0n, F0n, B0n, H0n, q0n, U0n, W0n, x0n, K0n, z0n]))); + } + function ann(n) { + var t, e; + (t = n.d == (psn(), lWn)), (e = Ean(n)), b5(n.a, (gjn(), xZn), (t && !e) || (!t && e) ? (qen(), U7n) : (qen(), z7n)); + } + function unn() { + (unn = O), + (prt = new lP("SIMPLE", 0)), + (wrt = new lP("GROUP_DEC", 1)), + (grt = new lP("GROUP_MIXED", 2)), + (drt = new lP("GROUP_INC", 3)); + } + function onn() { + (onn = O), + (aut = new $o()), + (Zat = new Lo()), + (nut = new No()), + (tut = new xo()), + (eut = new Do()), + (iut = new Ro()), + (rut = new Ko()), + (cut = new _o()), + (uut = new Fo()); + } + function snn(n, t, e) { + t1(), + jv.call(this), + (this.a = fR(uHn, [TEn, mSn], [595, 212], 0, [wHn, bHn], 2)), + (this.c = new hC()), + (this.g = n), + (this.f = t), + (this.d = e); + } + function hnn(n, t) { + (this.n = fR(Qot, [TEn, tMn], [364, 25], 14, [t, oG(e.Math.ceil(n / 32))], 2)), + (this.o = n), + (this.p = t), + (this.j = (n - 1) >> 1), + (this.k = (t - 1) >> 1); + } + function fnn(n, t, e) { + var i, r; + for (i = Gz(e, uMn), r = 0; 0 != k8(i, 0) && r < t; r++) (i = t7(i, Gz(n[r], uMn))), (n[r] = WR(i)), (i = zK(i, 32)); + return WR(i); + } + function lnn(n) { + var t, e, i, r; + for (r = 0, e = 0, i = n.length; e < i; e++) Lz(e, n.length), (t = n.charCodeAt(e)) < 64 && (r = zz(r, GK(1, t))); + return r; + } + function bnn(n, t) { + return n.i > 0 && (t.length < n.i && (t = H1(V5(t).c, n.i)), smn(n.g, 0, t, 0, n.i)), t.length > n.i && DF(t, n.i, null), t; + } + function wnn(n, t, e) { + var i, r, c; + return n.ej() ? ((i = n.i), (c = n.fj()), X8(n, i, t), (r = n.Zi(3, null, t, i, c)), e ? e.Ei(r) : (e = r)) : X8(n, n.i, t), e; + } + function dnn(n) { + var t; + return ( + PL(), (t = new fC(Yx(n.e.We((Cjn(), ttt)), 8))), n.B.Hc((Vgn(), crt)) && (t.a <= 0 && (t.a = 20), t.b <= 0 && (t.b = 20)), t + ); + } + function gnn(n) { + return Hen(), (n.q ? n.q : (XH(), XH(), MFn))._b((gjn(), Y1n)) ? Yx(Aun(n, Y1n), 197) : Yx(Aun(dB(n), J1n), 197); + } + function pnn(n, t) { + var e, i; + return (i = null), O$(n, (gjn(), _0n)) && (e = Yx(Aun(n, _0n), 94)).Xe(t) && (i = e.We(t)), null == i && (i = Aun(dB(n), t)), i; + } + function vnn(n, t) { + var e, i, r; + return !!CO(t, 42) && ((i = (e = Yx(t, 42)).cd()), bB((r = x8(n.Rc(), i)), e.dd()) && (null != r || n.Rc()._b(i))); + } + function mnn(n, t) { + var e; + return n.f > 0 && (n.qj(), -1 != Bln(n, ((e = null == t ? 0 : W5(t)) & Yjn) % n.d.length, e, t)); + } + function ynn(n, t) { + var e, i; + return n.f > 0 && (n.qj(), (e = efn(n, ((i = null == t ? 0 : W5(t)) & Yjn) % n.d.length, i, t))) ? e.dd() : null; + } + function knn(n, t) { + var e, i, r, c; + for (c = dwn(n.e.Tg(), t), e = Yx(n.g, 119), r = 0; r < n.i; ++r) if (((i = e[r]), c.rl(i.ak()))) return !1; + return !0; + } + function jnn(n) { + if (null == n.b) { + for (; n.a.Ob(); ) if (((n.b = n.a.Pb()), !Yx(n.b, 49).Zg())) return !0; + return (n.b = null), !1; + } + return !0; + } + function Enn(n, t) { + n.mj(); + try { + n.d.Vc(n.e++, t), (n.f = n.d.j), (n.g = -1); + } catch (n) { + throw CO((n = j4(n)), 73) ? hp(new Dp()) : hp(n); + } + } + function Tnn(n, t) { + var e, i; + return ( + UC(), + (i = null), + t == (e = XL((my(), my(), m_n))) && (i = Yx(aG(v_n, n), 615)), + i || ((i = new UF(n)), t == e && GG(v_n, n, i)), + i + ); + } + function Mnn(n, t) { + var i, r; + (n.a = t7(n.a, 1)), + (n.c = e.Math.min(n.c, t)), + (n.b = e.Math.max(n.b, t)), + (n.d += t), + (i = t - n.f), + (r = n.e + i), + (n.f = r - n.e - i), + (n.e = r); + } + function Snn(n, t) { + var e; + return tC(n) && tC(t) && XTn < (e = n % t) && e < zTn ? e : $3((Jmn(tC(n) ? W3(n) : n, tC(t) ? W3(t) : t, !0), P_n)); + } + function Pnn(n, t) { + var e; + (function (n) { + var t, e, i, r, c, a, u, o, s, h, f, l, b, w; + for (l = new pb(n); l.a < l.c.c.length; ) { + for (r$((f = Yx(Hz(l), 10)).n), r$(f.o), gQ(f.f), hgn(f), Rdn(f), w = new pb(f.j); w.a < w.c.c.length; ) { + for ( + r$((b = Yx(Hz(w), 11)).n), + r$(b.a), + r$(b.o), + whn(b, Pin(b.j)), + (r = Yx(Aun(b, (gjn(), p0n)), 19)) && b5(b, p0n, d9(-r.a)), + i = new pb(b.g); + i.a < i.c.c.length; + + ) { + for (t = Ztn((e = Yx(Hz(i), 17)).a, 0); t.b != t.d.c; ) r$(Yx(IX(t), 8)); + if ((a = Yx(Aun(e, $1n), 74))) for (c = Ztn(a, 0); c.b != c.d.c; ) r$(Yx(IX(c), 8)); + for (s = new pb(e.b); s.a < s.c.c.length; ) r$((u = Yx(Hz(s), 70)).n), r$(u.o); + } + for (h = new pb(b.f); h.a < h.c.c.length; ) r$((u = Yx(Hz(h), 70)).n), r$(u.o); + } + for (f.k == (bon(), _zn) && (b5(f, (Ojn(), hQn), Pin(Yx(Aun(f, hQn), 61))), mwn(f)), o = new pb(f.b); o.a < o.c.c.length; ) + hgn((u = Yx(Hz(o), 70))), r$(u.o), r$(u.n); + } + })(t), + (e = Yx(Aun(n, (gjn(), l1n)), 276)) && + b5( + n, + l1n, + (function (n) { + switch (n.g) { + case 0: + return VWn; + case 1: + return QWn; + case 2: + return YWn; + case 3: + return JWn; + case 4: + return ZWn; + case 5: + return nVn; + default: + return null; + } + })(e), + ), + r$(n.c), + r$(n.f), + gQ(n.d), + gQ(Yx(Aun(n, z1n), 207)); + } + function Inn(n) { + (this.e = VQ(Wot, MTn, 25, n.length, 15, 1)), + (this.c = VQ(Vot, wSn, 25, n.length, 16, 1)), + (this.b = VQ(Vot, wSn, 25, n.length, 16, 1)), + (this.f = 0); + } + function Cnn(n) { + var t; + 0 != n.c && (1 == (t = Yx(TR(n.a, n.b), 287)).b ? (++n.b, n.b < n.a.c.length && Xl(Yx(TR(n.a, n.b), 287))) : --t.b, --n.c); + } + function Onn() { + (Onn = O), + (Wit = new RC(15)), + (Xit = new DC((Cjn(), utt), Wit)), + (Qit = new DC(Xtt, 15)), + (Vit = new DC($tt, d9(0))), + (Uit = new DC(mnt, OPn)); + } + function Ann() { + (Ann = O), + (Zit = new hP("PORTS", 0)), + (nrt = new hP("PORT_LABELS", 1)), + (Jit = new hP("NODE_LABELS", 2)), + (Yit = new hP("MINIMUM_SIZE", 3)); + } + function $nn(n, t) { + var e, i; + for (i = t.length, e = 0; e < i; e += 2) zwn(n, (Lz(e, t.length), t.charCodeAt(e)), (Lz(e + 1, t.length), t.charCodeAt(e + 1))); + } + function Lnn(n, t, e) { + var i, r, c, a; + for (c = t - n.e, a = e - n.f, r = new pb(n.a); r.a < r.c.c.length; ) Qen((i = Yx(Hz(r), 187)), i.s + c, i.t + a); + (n.e = t), (n.f = e); + } + function Nnn(n, t) { + var e, i, r, c; + return ( + (e = t >> 5), + (t &= 31), + (r = n.d + e + (0 == t ? 0 : 1)), + (function (n, t, e, i) { + var r, c, a; + if (0 == i) smn(t, 0, n, e, n.length - e); + else + for (a = 32 - i, n[n.length - 1] = 0, c = n.length - 1; c > e; c--) + (n[c] |= t[c - e - 1] >>> a), (n[c - 1] = t[c - e - 1] << i); + for (r = 0; r < e; r++) n[r] = 0; + })((i = VQ(Wot, MTn, 25, r, 15, 1)), n.a, e, t), + SU((c = new C_(n.e, r, i))), + c + ); + } + function xnn(n, t, e) { + var i, r; + (i = Yx(aG(vot, t), 117)), (r = Yx(aG(mot, t), 117)), e ? (GG(vot, n, i), GG(mot, n, r)) : (GG(mot, n, i), GG(vot, n, r)); + } + function Dnn(n, t, e) { + var i, r, c; + for (r = null, c = n.b; c; ) { + if (((i = n.a.ue(t, c.d)), e && 0 == i)) return c; + i >= 0 ? (c = c.a[1]) : ((r = c), (c = c.a[0])); + } + return r; + } + function Rnn(n, t, e) { + var i, r, c; + for (r = null, c = n.b; c; ) { + if (((i = n.a.ue(t, c.d)), e && 0 == i)) return c; + i <= 0 ? (c = c.a[0]) : ((r = c), (c = c.a[1])); + } + return r; + } + function Knn(n, t, e, i) { + var r, c, a; + return ( + (r = !1), + (function (n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k; + return ( + (l = n.c[t]), + (b = n.c[e]), + !( + ((w = Yx(Aun(l, (Ojn(), mQn)), 15)) && 0 != w.gc() && w.Hc(b)) || + ((d = l.k != (bon(), Bzn) && b.k != Bzn), + (v = (g = Yx(Aun(l, vQn), 10)) != (p = Yx(Aun(b, vQn), 10))), + (m = (!!g && g != l) || (!!p && p != b)), + (y = Iin(l, (Ikn(), Tit))), + (k = Iin(b, Bit)), + (m |= Iin(l, Bit) || Iin(b, Tit)), + d && ((m && v) || y || k)) || + (l.k == (bon(), qzn) && b.k == Hzn) || + (b.k == (bon(), qzn) && l.k == Hzn) + ) && + ((h = n.c[t]), + (c = n.c[e]), + (r = Acn(n.e, h, c, (Ikn(), qit))), + (o = Acn(n.i, h, c, Eit)), + (function (n, t, e) { + (n.d = 0), + (n.b = 0), + t.k == (bon(), qzn) && + e.k == qzn && + Yx(Aun(t, (Ojn(), CQn)), 10) == Yx(Aun(e, CQn), 10) && + (lJ(t).j == (Ikn(), Tit) ? Wln(n, t, e) : Wln(n, e, t)), + t.k == qzn && e.k == Bzn + ? lJ(t).j == (Ikn(), Tit) + ? (n.d = 1) + : (n.b = 1) + : e.k == qzn && t.k == Bzn && (lJ(e).j == (Ikn(), Tit) ? (n.b = 1) : (n.d = 1)), + (function (n, t, e) { + t.k == (bon(), Hzn) && e.k == Bzn && ((n.d = q8(t, (Ikn(), Bit))), (n.b = q8(t, Tit))), + e.k == Hzn && t.k == Bzn && ((n.d = q8(e, (Ikn(), Tit))), (n.b = q8(e, Bit))); + })(n, t, e); + })(n.f, h, c), + (s = y6(n.b, h, c) + Yx(r.a, 19).a + Yx(o.a, 19).a + n.f.d), + (u = y6(n.b, c, h) + Yx(r.b, 19).a + Yx(o.b, 19).a + n.f.b), + n.a && + ((f = Yx(Aun(h, CQn), 11)), (a = Yx(Aun(c, CQn), 11)), (s += Yx((i = Drn(n.g, f, a)).a, 19).a), (u += Yx(i.b, 19).a)), + s > u) + ); + })(n.f, e, i) && + ((function (n, t, e) { + var i, r; + Sun(n.e, t, e, (Ikn(), qit)), + Sun(n.i, t, e, Eit), + n.a && ((r = Yx(Aun(t, (Ojn(), CQn)), 11)), (i = Yx(Aun(e, CQn), 11)), tU(n.g, r, i)); + })(n.f, n.a[t][e], n.a[t][i]), + (a = (c = n.a[t])[i]), + (c[i] = c[e]), + (c[e] = a), + (r = !0)), + r + ); + } + function _nn(n, t, e, i, r) { + var c, a, u; + for (a = r; t.b != t.c; ) (c = Yx($_(t), 10)), (u = Yx(i7(c, i).Xb(0), 11)), (n.d[u.p] = a++), (e.c[e.c.length] = u); + return a; + } + function Fnn(n, t, i) { + var r, c, a, u, o; + return (u = n.k), (o = t.k), (c = fL(pnn(n, (r = i[u.g][o.g])))), (a = fL(pnn(t, r))), e.Math.max((vB(c), c), (vB(a), a)); + } + function Bnn(n, t, e) { + var i, r, c; + for (r = Yx(BF(n.b, e), 177), i = 0, c = new pb(t.j); c.a < c.c.c.length; ) r[Yx(Hz(c), 113).d.p] && ++i; + return i; + } + function Hnn(n) { + var t, e; + return null != (t = Yx(H3(n.a, 4), 126)) ? (smn(t, 0, (e = VQ(Oct, vDn, 415, t.length, 0, 1)), 0, t.length), e) : Cct; + } + function qnn(n, t) { + var e; + for (e = new $K(bA(o7(n).a.Kc(), new h())); Vfn(e); ) if (Yx(kV(e), 17).d.i.c == t) return !1; + return !0; + } + function Gnn(n, t) { + var e; + if (CO(t, 245)) { + e = Yx(t, 245); + try { + return 0 == n.vd(e); + } catch (n) { + if (!CO((n = j4(n)), 205)) throw hp(n); + } + } + return !1; + } + function znn(n, t) { + return ( + XC(), + XC(), + o0(ZEn), + (e.Math.abs(n - t) <= ZEn || n == t || (isNaN(n) && isNaN(t)) ? 0 : n < t ? -1 : n > t ? 1 : QI(isNaN(n), isNaN(t))) > 0 + ); + } + function Unn(n, t) { + return ( + XC(), + XC(), + o0(ZEn), + (e.Math.abs(n - t) <= ZEn || n == t || (isNaN(n) && isNaN(t)) ? 0 : n < t ? -1 : n > t ? 1 : QI(isNaN(n), isNaN(t))) < 0 + ); + } + function Xnn(n, t) { + return ( + XC(), + XC(), + o0(ZEn), + (e.Math.abs(n - t) <= ZEn || n == t || (isNaN(n) && isNaN(t)) ? 0 : n < t ? -1 : n > t ? 1 : QI(isNaN(n), isNaN(t))) <= 0 + ); + } + function Wnn(n, t) { + for (var e = 0; !t[e] || "" == t[e]; ) e++; + for (var i = t[e++]; e < t.length; e++) t[e] && "" != t[e] && (i += n + t[e]); + return i; + } + function Vnn(n, t, i) { + var r, c, a, u; + for (YQ(t, (a = t + i), n.length), u = "", c = t; c < a; ) (r = e.Math.min(c + 1e4, a)), (u += NB(n.slice(c, r))), (c = r); + return u; + } + function Qnn(n) { + var t, e, i, r; + if (null == n) return null; + for (r = new ip(), e = 0, i = (t = s6(n)).length; e < i; ++e) eD(r, Vvn(t[e], !0)); + return r; + } + function Ynn(n) { + var t, e, i, r; + if (null == n) return null; + for (r = new ip(), e = 0, i = (t = s6(n)).length; e < i; ++e) eD(r, Vvn(t[e], !0)); + return r; + } + function Jnn(n) { + var t, e, i, r; + if (null == n) return null; + for (r = new ip(), e = 0, i = (t = s6(n)).length; e < i; ++e) eD(r, Vvn(t[e], !0)); + return r; + } + function Znn(n, t) { + var e, i, r; + if (n.c) $1(n.c, t); + else for (e = t - DR(n), r = new pb(n.d); r.a < r.c.c.length; ) Znn((i = Yx(Hz(r), 157)), DR(i) + e); + } + function ntn(n, t) { + var e, i, r; + if (n.c) A1(n.c, t); + else for (e = t - xR(n), r = new pb(n.a); r.a < r.c.c.length; ) ntn((i = Yx(Hz(r), 157)), xR(i) + e); + } + function ttn(n, t) { + var e, i; + return n.qj(), (e = efn(n, ((i = null == t ? 0 : W5(t)) & Yjn) % n.d.length, i, t)) ? (w0(n, e), e.dd()) : null; + } + function etn(n) { + var t, e; + for (e = Jon(n), t = null; 2 == n.c; ) kjn(n), t || (Ljn(), Ljn(), Rmn((t = new HC(2)), e), (e = t)), e.$l(Jon(n)); + return e; + } + function itn(n) { + if (!(rxn in n.a)) throw hp(new hy("Every element must have an id.")); + return Nhn(jG(n, rxn)); + } + function rtn(n) { + var t, e, i; + if (!(i = n.Zg())) + for (t = 0, e = n.eh(); e; e = e.eh()) { + if (++t > cMn) return e.fh(); + if ((i = e.Zg()) || e == n) break; + } + return i; + } + function ctn(n) { + return _G(), CO(n, 156) ? Yx(BF(Mct, NFn), 288).vg(n) : P_(Mct, V5(n)) ? Yx(BF(Mct, V5(n)), 288).vg(n) : null; + } + function atn(n, t) { + if (t.c == n) return t.d; + if (t.d == n) return t.c; + throw hp(new Qm("Input edge is not connected to the input port.")); + } + function utn(n, t) { + return n.e > t.e ? 1 : n.e < t.e ? -1 : n.d > t.d ? n.e : n.d < t.d ? -t.e : n.e * w6(n.a, t.a, n.d); + } + function otn(n) { + return n >= 48 && n < 48 + e.Math.min(10, 10) ? n - 48 : n >= 97 && n < 97 ? n - 97 + 10 : n >= 65 && n < 65 ? n - 65 + 10 : -1; + } + function stn(n, t) { + var e; + return iI(t) === iI(n) || (!!CO(t, 21) && (e = Yx(t, 21)).gc() == n.gc() && n.Ic(e)); + } + function htn(n, t) { + var e, i; + for (Lz(t, n.length), e = n.charCodeAt(t), i = t + 1; i < n.length && (Lz(i, n.length), n.charCodeAt(i) == e); ) ++i; + return i - t; + } + function ftn(n) { + switch (n.g) { + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + return !0; + default: + return !1; + } + } + function ltn(n, t) { + if (n.a < 0) throw hp(new Ym("Did not call before(...) or after(...) before calling add(...).")); + return ZA(n, n.a, t), n; + } + function btn(n, t, e, i) { + var r; + 0 != t.c.length && + ((r = (function (n, t) { + var e, i, r, c, a; + for ( + e = new ip(), + r = WJ(new SR(null, new Nz(n, 16)), new Ea()), + c = WJ(new SR(null, new Nz(n, 16)), new Ta()), + a = (function (n) { + var t; + return yB(n), (t = VQ(Jot, rMn, 25, 0, 15, 1)), Qk(n.a, new Rb(t)), t; + })( + (function (n) { + return W9(n), new pL(n, new uD(n, n.a.e, 4 | n.a.d)); + })( + lH( + (function (n) { + var t, e, i, r, c, a, u, o; + for (t = 336, e = 0, r = new zL(n.length), u = 0, o = (a = n).length; u < o; ++u) + W9((c = a[u])), yB(c), (i = c.a), eD(r.a, MF(i)), (t &= i.qd()), (e = D6(e, i.rd())); + return Yx(Yx(eF(new SR(null, lun(new Nz((VF(), enn(r.a)), 16), new k(), t, e)), new kl(n)), 670), 833); + })(x4(Gy(gBn, 1), iEn, 833, 0, [r, c])), + new Ma(), + ), + ), + ), + i = 1; + i < a.length; + i++ + ) + a[i] - a[i - 1] >= 2 * t && eD(e, new Lx(a[i - 1] + t, a[i] - t)); + return e; + })(e, i)), + SE( + HZ( + new SR( + null, + new Nz( + (function (n) { + var t, e, i, r, c, a, u; + for (c = new oC(), e = new pb(n); e.a < e.c.c.length; ) + (a = (t = Yx(Hz(e), 129)).a), + (u = t.b), + c.a._b(a) || + c.a._b(u) || + ((r = a), (i = u), a.e.b + a.j.b > 2 && u.e.b + u.j.b <= 2 && ((r = u), (i = a)), c.a.zc(r, c), (r.q = i)); + return c; + })(t), + 1, + ), + ), + new ja(), + ), + new yH(n, e, r, i), + )); + } + function wtn(n, t, e) { + var i; + 0 != (n.Db & t) + ? null == e + ? (function (n, t) { + var e, i, r, c, a, u, o; + if (1 == (i = h7(254 & n.Db))) n.Eb = null; + else if (((c = h1(n.Eb)), 2 == i)) (r = Vin(n, t)), (n.Eb = c[0 == r ? 1 : 0]); + else { + for (a = VQ(UKn, iEn, 1, i - 1, 5, 1), e = 2, u = 0, o = 0; e <= 128; e <<= 1) + e == t ? ++u : 0 != (n.Db & e) && (a[o++] = c[u++]); + n.Eb = a; + } + n.Db &= ~t; + })(n, t) + : -1 == (i = Vin(n, t)) + ? (n.Eb = e) + : DF(h1(n.Eb), i, e) + : null != e && + (function (n, t, e) { + var i, r, c, a, u, o; + if (0 == (r = h7(254 & n.Db))) n.Eb = e; + else { + if (1 == r) (a = VQ(UKn, iEn, 1, 2, 5, 1)), 0 == Vin(n, t) ? ((a[0] = e), (a[1] = n.Eb)) : ((a[0] = n.Eb), (a[1] = e)); + else + for (a = VQ(UKn, iEn, 1, r + 1, 5, 1), c = h1(n.Eb), i = 2, u = 0, o = 0; i <= 128; i <<= 1) + i == t ? (a[o++] = e) : 0 != (n.Db & i) && (a[o++] = c[u++]); + n.Eb = a; + } + n.Db |= t; + })(n, t, e); + } + function dtn(n) { + var t; + return 0 == (32 & n.Db) && 0 != (t = vF(Yx(H3(n, 16), 26) || n.zh()) - vF(n.zh())) && wtn(n, 32, VQ(UKn, iEn, 1, t, 5, 1)), n; + } + function gtn(n) { + var t, e; + for (t = new pb(n.g); t.a < t.c.c.length; ) Yx(Hz(t), 562); + (function (n) { + var t, e, i, r, c, a, u, o; + switch ( + ((u = n.b), + (t = n.a), + 0 === Yx(Aun(n, (pcn(), _Bn)), 427).g ? JC(u, new Eb(new Gn())) : JC(u, new Eb(new zn())), + 1 === Yx(Aun(n, RBn), 428).g ? (JC(u, new qn()), JC(u, new Un()), JC(u, new Kn())) : (JC(u, new qn()), JC(u, new Hn())), + Yx(Aun(n, BBn), 250).g) + ) { + case 0: + o = new Yn(); + break; + case 1: + o = new Vn(); + break; + case 2: + o = new Qn(); + break; + case 3: + o = new Wn(); + break; + case 5: + o = new Zb(new Qn()); + break; + case 4: + o = new Zb(new Vn()); + break; + case 7: + o = new nM(new Zb(new Vn()), new Zb(new Qn())); + break; + case 8: + o = new nM(new Zb(new Wn()), new Zb(new Qn())); + break; + default: + o = new Zb(new Wn()); + } + for (a = new pb(u); a.a < a.c.c.length; ) { + for (c = Yx(Hz(a), 167), r = 0, e = new mP(d9((i = 0)), d9(r)); jpn(t, c, i, r); ) + (e = Yx(o.Ce(e, c), 46)), (i = Yx(e.a, 19).a), (r = Yx(e.b, 19).a); + rgn(t, c, i, r); + } + })((e = new Twn(n.g, ty(n.a), n.c))), + (n.g = e.b), + (n.d = e.a); + } + function ptn(n, t, i) { + (t.b = e.Math.max(t.b, -i.a)), + (t.c = e.Math.max(t.c, i.a - n.a)), + (t.d = e.Math.max(t.d, -i.b)), + (t.a = e.Math.max(t.a, i.b - n.b)); + } + function vtn(n, t) { + return vB(n), null != t && (!!_N(n, t) || (n.length == t.length && _N(n.toLowerCase(), t.toLowerCase()))); + } + function mtn(n, t, e) { + var i, r, c; + for (c = new pb(e.a); c.a < c.c.c.length; ) (r = Yx(Hz(c), 221)), (i = new uO(Yx(BF(n.a, r.b), 65))), eD(t.a, i), mtn(n, i, r); + } + function ytn(n) { + var t, e; + return k8(n, -129) > 0 && k8(n, 128) < 0 ? ((t = WR(n) + 128), !(e = (bR(), X_n)[t]) && (e = X_n[t] = new cb(n)), e) : new cb(n); + } + function ktn(n, t) { + var e, i; + return (e = t.Hh(n.a)) && null != (i = lL(ynn((!e.b && (e.b = new z$((xjn(), Dat), out, e)), e.b), gxn))) ? i : t.ne(); + } + function jtn(n, t) { + var e, i; + for (lz(), i = new $K(bA(a7(n).a.Kc(), new h())); Vfn(i); ) if ((e = Yx(kV(i), 17)).d.i == t || e.c.i == t) return e; + return null; + } + function Etn(n, t, e) { + (this.c = n), + (this.f = new ip()), + (this.e = new Pk()), + (this.j = new gR()), + (this.n = new gR()), + (this.b = t), + (this.g = new mH(t.c, t.d, t.b, t.a)), + (this.a = e); + } + function Ttn(n) { + var t, e, i, r; + for (this.a = new oC(), this.d = new Qp(), this.e = 0, i = 0, r = (e = n).length; i < r; ++i) + (t = e[i]), !this.f && (this.f = t), GU(this, t); + } + function Mtn(n) { + bdn(), + 0 == n.length + ? ((this.e = 0), (this.d = 1), (this.a = x4(Gy(Wot, 1), MTn, 25, 15, [0]))) + : ((this.e = 1), (this.d = n.length), (this.a = n), SU(this)); + } + function Stn(n, t, e) { + jv.call(this), + (this.a = VQ(uHn, mSn, 212, (JZ(), x4(Gy(sHn, 1), XEn, 232, 0, [rHn, cHn, aHn])).length, 0, 1)), + (this.b = n), + (this.d = t), + (this.c = e); + } + function Ptn(n) { + (this.d = new ip()), + (this.e = new bW()), + (this.c = VQ(Wot, MTn, 25, (Ikn(), x4(Gy(trt, 1), lIn, 61, 0, [Hit, Tit, Eit, Bit, qit])).length, 15, 1)), + (this.b = n); + } + function Itn(n) { + var t, e, i, r; + for (b5((r = Yx(Aun(n, (Ojn(), CQn)), 11)), XQn, n.i.n.b), e = 0, i = (t = CU(n.e)).length; e < i; ++e) QG(t[e], r); + } + function Ctn(n) { + var t, e, i, r; + for (b5((t = Yx(Aun(n, (Ojn(), CQn)), 11)), XQn, n.i.n.b), i = 0, r = (e = CU(n.g)).length; i < r; ++i) YG(e[i], t); + } + function Otn(n) { + var t; + iI(jln(n, (Cjn(), Rnt))) === iI((O8(), Let)) && (IG(n) ? ((t = Yx(jln(IG(n), Rnt), 334)), Aen(n, Rnt, t)) : Aen(n, Rnt, Net)); + } + function Atn(n, t, e) { + var i, r, c; + (i = t.c.p), + (c = t.p), + (n.b[i][c] = new Bq(n, t)), + e && ((n.a[i][c] = new hd(t)), (r = Yx(Aun(t, (Ojn(), vQn)), 10)) && Qhn(n.d, r, t)); + } + function $tn(n, t) { + var e, i, r; + if ((eD(Fqn, n), t.Fc(n), (e = Yx(BF(_qn, n), 21)))) + for (r = e.Kc(); r.Ob(); ) (i = Yx(r.Pb(), 33)), -1 != hJ(Fqn, i, 0) || $tn(i, t); + } + function Ltn(n, t, e) { + var i; + (oBn + ? ((function (n) { + var t, e; + if (n.b) return n.b; + for (e = hBn ? null : n.d; e; ) { + if ((t = hBn ? null : e.b)) return t; + e = hBn ? null : e.d; + } + _E(); + })(n), + 1) + : sBn || lBn + ? (_E(), 1) + : fBn && (_E(), 0)) && + (((i = new fx(t)).b = e), + (function (n, t) { + var e, i, r, c, a; + for (i = 0, c = u6(n).length; i < c; ++i) Oun(t); + for (a = !hBn && n.e ? (hBn ? null : n.d) : null; a; ) { + for (e = 0, r = u6(a).length; e < r; ++e) Oun(t); + a = !hBn && a.e ? (hBn ? null : a.d) : null; + } + })(n, i)); + } + function Ntn(n, t) { + var i; + (i = !n.A.Hc((Ann(), nrt)) || n.q == (Ran(), oit)), + n.u.Hc((Chn(), pit)) + ? i + ? (function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E; + if (((b = Yx(Yx(_V(n.r, t), 21), 84)), t != (Ikn(), Eit) && t != qit)) { + for ( + a = t == Tit ? (e4(), WHn) : (e4(), YHn), + k = t == Tit ? (OJ(), mHn) : (OJ(), pHn), + c = (r = (i = Yx(GB(n.b, t), 124)).i).c + N5(x4(Gy(Jot, 1), rMn, 25, 15, [i.n.b, n.C.b, n.k])), + v = r.c + r.b - N5(x4(Gy(Jot, 1), rMn, 25, 15, [i.n.c, n.C.c, n.k])), + u = Qy(Ox(a), n.t), + m = t == Tit ? ZTn : JTn, + l = b.Kc(); + l.Ob(); + + ) + !(h = Yx(l.Pb(), 111)).c || + h.c.d.c.length <= 0 || + ((p = h.b.rf()), + (g = h.e), + ((d = (w = h.c).i).b = ((s = w.n), w.e.a + s.b + s.c)), + (d.a = ((o = w.n), w.e.b + o.d + o.a)), + xq(k, jSn), + (w.f = k), + lY(w, (BY(), lHn)), + (d.c = g.a - (d.b - p.a) / 2), + (j = e.Math.min(c, g.a)), + (E = e.Math.max(v, g.a + p.a)), + d.c < j ? (d.c = j) : d.c + d.b > E && (d.c = E - d.b), + eD(u.d, new fK(d, P9(u, d))), + (m = t == Tit ? e.Math.max(m, g.b + h.b.rf().b) : e.Math.min(m, g.b))); + for (m += t == Tit ? n.t : -n.t, (y = Z7(((u.e = m), u))) > 0 && (Yx(GB(n.b, t), 124).a.b = y), f = b.Kc(); f.Ob(); ) + !(h = Yx(f.Pb(), 111)).c || h.c.d.c.length <= 0 || (((d = h.c.i).c -= h.e.a), (d.d -= h.e.b)); + } else kkn(n, t); + })(n, t) + : kkn(n, t) + : n.u.Hc(mit) && + (i + ? (function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v; + if ((f = Yx(Yx(_V(n.r, t), 21), 84)).gc() <= 2 || t == (Ikn(), Eit) || t == (Ikn(), qit)) qkn(n, t); + else { + for ( + g = n.u.Hc((Chn(), yit)), + i = t == (Ikn(), Tit) ? (e4(), YHn) : (e4(), WHn), + v = t == Tit ? (OJ(), pHn) : (OJ(), mHn), + r = Qy(Ox(i), n.s), + p = t == Tit ? JTn : ZTn, + h = f.Kc(); + h.Ob(); + + ) + !(o = Yx(h.Pb(), 111)).c || + o.c.d.c.length <= 0 || + ((d = o.b.rf()), + (w = o.e), + ((b = (l = o.c).i).b = ((a = l.n), l.e.a + a.b + a.c)), + (b.a = ((u = l.n), l.e.b + u.d + u.a)), + g ? ((b.c = w.a - ((c = l.n), l.e.a + c.b + c.c) - n.s), (g = !1)) : (b.c = w.a + d.a + n.s), + xq(v, jSn), + (l.f = v), + lY(l, (BY(), lHn)), + eD(r.d, new fK(b, P9(r, b))), + (p = t == Tit ? e.Math.min(p, w.b) : e.Math.max(p, w.b + o.b.rf().b))); + for (p += t == Tit ? -n.t : n.t, Z7(((r.e = p), r)), s = f.Kc(); s.Ob(); ) + !(o = Yx(s.Pb(), 111)).c || o.c.d.c.length <= 0 || (((b = o.c.i).c -= o.e.a), (b.d -= o.e.b)); + } + })(n, t) + : qkn(n, t)); + } + function xtn(n, t) { + var e, i; + ++n.j, + null != t && + (function (n, t) { + var e, i, r; + if (iI(n) === iI(t)) return !0; + if (null == n || null == t) return !1; + if (n.length != t.length) return !1; + for (e = 0; e < n.length; ++e) if (((i = n[e]), (r = t[e]), !(iI(i) === iI(r) || (null != i && Q8(i, r))))) return !1; + return !0; + })(t, (e = CO((i = n.a.Cb), 97) ? Yx(i, 97).Jg() : null)) + ? wtn(n.a, 4, e) + : wtn(n.a, 4, Yx(t, 126)); + } + function Dtn(n, t, i) { + return new mH(e.Math.min(n.a, t.a) - i / 2, e.Math.min(n.b, t.b) - i / 2, e.Math.abs(n.a - t.a) + i, e.Math.abs(n.b - t.b) + i); + } + function Rtn(n, t, e) { + var i; + if (!e[t.d]) for (e[t.d] = !0, i = new pb(b7(t)); i.a < i.c.c.length; ) Rtn(n, T7(Yx(Hz(i), 213), t), e); + } + function Ktn(n, t, e) { + var i; + switch (((i = e[n.g][t]), n.g)) { + case 1: + case 3: + return new QS(0, i); + case 2: + case 4: + return new QS(i, 0); + default: + return null; + } + } + function _tn(n, t, e) { + var i; + i = Yx(Xq(t.f), 209); + try { + i.Ze(n, e), + (function (n, t) { + n.c < 0 || n.b.b < n.c ? EI(n.b, t) : n.a._e(t); + })(t.f, i); + } catch (n) { + throw (CO((n = j4(n)), 102), hp(n)); + } + } + function Ftn(n, t, e) { + var i, r, c, a; + return (i = null), (c = yyn(s0(), t)) && ((r = null), null != (a = oyn(c, e)) && (r = n.Ye(c, a)), (i = r)), i; + } + function Btn(n, t, e, i) { + var r; + if (t >= (r = n.length)) return r; + for (t = t > 0 ? t : 0; t < r && !a5((Lz(t, n.length), n.charCodeAt(t)), e, i); t++); + return t; + } + function Htn(n, t) { + var e, i; + for (i = n.c.length, t.length < i && (t = qy(new Array(i), t)), e = 0; e < i; ++e) DF(t, e, n.c[e]); + return t.length > i && DF(t, i, null), t; + } + function qtn(n, t) { + var e, i; + for (i = n.a.length, t.length < i && (t = qy(new Array(i), t)), e = 0; e < i; ++e) DF(t, e, n.a[e]); + return t.length > i && DF(t, i, null), t; + } + function Gtn(n, t, e) { + var i, r, c; + return (r = Yx(BF(n.e, t), 387)) ? ((c = YL(r, e)), OO(n, r), c) : ((i = new oD(n, t, e)), xB(n.e, t, i), iG(i), null); + } + function ztn(n) { + var t; + if (null == n) return null; + if ( + null == + (t = (function (n) { + var t, e, i, r, c, a, u; + if ((kdn(), null == n)) return null; + if ((r = n.length) % 2 != 0) return null; + for (t = xJ(n), e = VQ(Yot, LNn, 25, (c = (r / 2) | 0), 15, 1), i = 0; i < c; i++) { + if (-1 == (a = fot[t[2 * i]])) return null; + if (-1 == (u = fot[t[2 * i + 1]])) return null; + e[i] = (((a << 4) | u) << 24) >> 24; + } + return e; + })(Vvn(n, !0))) + ) + throw hp(new fy("Invalid hexBinary value: '" + n + "'")); + return t; + } + function Utn(n) { + return bdn(), k8(n, 0) < 0 ? (0 != k8(n, -1) ? new pan(-1, sJ(n)) : lFn) : k8(n, 10) <= 0 ? wFn[WR(n)] : new pan(1, n); + } + function Xtn() { + return ( + Njn(), + x4(Gy(JHn, 1), XEn, 159, 0, [ + BHn, + FHn, + HHn, + $Hn, + AHn, + LHn, + DHn, + xHn, + NHn, + _Hn, + KHn, + RHn, + CHn, + IHn, + OHn, + SHn, + MHn, + PHn, + EHn, + jHn, + THn, + qHn, + ]) + ); + } + function Wtn(n) { + var t; + (this.d = new ip()), + (this.j = new Pk()), + (this.g = new Pk()), + (t = n.g.b), + (this.f = Yx(Aun(dB(t), (gjn(), a1n)), 103)), + (this.e = ty(fL(cen(t, F0n)))); + } + function Vtn(n) { + (this.b = new ip()), + (this.e = new ip()), + (this.d = n), + (this.a = !ej(hH(new SR(null, new nF(new UV(n.b))), new Cb(new Gr()))).sd((HE(), dBn))); + } + function Qtn() { + (Qtn = O), + (T7n = new US("PARENTS", 0)), + (E7n = new US("NODES", 1)), + (k7n = new US("EDGES", 2)), + (M7n = new US("PORTS", 3)), + (j7n = new US("LABELS", 4)); + } + function Ytn() { + (Ytn = O), + (eit = new aP("DISTRIBUTED", 0)), + (rit = new aP("JUSTIFIED", 1)), + (nit = new aP("BEGIN", 2)), + (tit = new aP(pSn, 3)), + (iit = new aP("END", 4)); + } + function Jtn(n) { + switch (n.g) { + case 1: + return t9(), eet; + case 4: + return t9(), Ztt; + case 2: + return t9(), net; + case 3: + return t9(), Jtt; + } + return t9(), tet; + } + function Ztn(n, t) { + var e, i; + if ((iz(t, n.b), t >= n.b >> 1)) for (i = n.c, e = n.b; e > t; --e) i = i.b; + else for (i = n.a.a, e = 0; e < t; ++e) i = i.a; + return new ux(n, t, i); + } + function nen() { + (nen = O), + (CBn = new rM("NUM_OF_EXTERNAL_SIDES_THAN_NUM_OF_EXTENSIONS_LAST", 0)), + (IBn = new rM("CORNER_CASES_THAN_SINGLE_SIDE_LAST", 1)); + } + function ten(n) { + var t, e, i; + for ( + JC( + (e = (function (n) { + var t, e, i, r; + for (e = new rp(), r = new pb(n.d); r.a < r.c.c.length; ) + (i = Yx(Hz(r), 181)), + (t = Yx(i.We((Ojn(), aQn)), 17)), + Dq(e.f, t) || xB(e, t, new zH(t)), + eD(Yx(eI(Dq(e.f, t)), 456).b, i); + return new sx(new Zl(e)); + })(n)), + tUn, + ), + (i = n.d).c = VQ(UKn, iEn, 1, 0, 5, 1), + t = new pb(e); + t.a < t.c.c.length; + + ) + S4(i, Yx(Hz(t), 456).b); + } + function een(n) { + var t, e; + for (!n.o && (n.o = new yY((ajn(), Frt), mct, n, 0)), t = (e = n.o).c.Kc(); t.e != t.i.gc(); ) Yx(t.nj(), 42).dd(); + return UQ(e); + } + function ien(n, t) { + var i, r, c, a; + for (i = 0, c = new pb(t.a); c.a < c.c.c.length; ) (a = (r = Yx(Hz(c), 10)).o.a + r.d.c + r.d.b + n.j), (i = e.Math.max(i, a)); + return i; + } + function ren(n) { + var t, e, i, r; + for (r = 0, e = 0, i = n.length; e < i; e++) + Lz(e, n.length), (t = n.charCodeAt(e)) >= 64 && t < 128 && (r = zz(r, GK(1, t - 64))); + return r; + } + function cen(n, t) { + var e, i; + return ( + (i = null), + O$(n, (Cjn(), Htt)) && (e = Yx(Aun(n, Htt), 94)).Xe(t) && (i = e.We(t)), + null == i && dB(n) && (i = Aun(dB(n), t)), + i + ); + } + function aen(n, t) { + var e, i, r; + (i = (r = t.d.i).k) != (bon(), Hzn) && i != Kzn && Vfn((e = new $K(bA(o7(r).a.Kc(), new h())))) && xB(n.k, t, Yx(kV(e), 17)); + } + function uen(n, t) { + var e, i, r; + return ( + (i = CZ(n.Tg(), t)), + (e = t - n.Ah()) < 0 ? ((r = n.Yg(i)) >= 0 ? n.lh(r) : zhn(n, i)) : e < 0 ? zhn(n, i) : Yx(i, 66).Nj().Sj(n, n.yh(), e) + ); + } + function oen(n) { + var t; + if (CO(n.a, 4)) { + if (null == (t = ctn(n.a))) throw hp(new Ym(ELn + n.b + "'. " + mLn + (sL(Ict), Ict.k) + yLn)); + return t; + } + return n.a; + } + function sen(n) { + var t; + if (null == n) return null; + if ( + null == + (t = (function (n) { + var t, e, i, r, c, a, u, o, s, h, f, l, b, w, d, g; + if ((Jpn(), null == n)) return null; + if ( + (w = (function (n) { + var t, e, i; + for (i = 0, e = n.length, t = 0; t < e; t++) 32 == n[t] || 13 == n[t] || 10 == n[t] || 9 == n[t] || (n[i++] = n[t]); + return i; + })((c = xJ(n)))) % + 4 != + 0 + ) + return null; + if (0 == (d = (w / 4) | 0)) return VQ(Yot, LNn, 25, 0, 15, 1); + for ( + f = null, t = 0, e = 0, i = 0, r = 0, a = 0, u = 0, o = 0, s = 0, b = 0, l = 0, h = 0, f = VQ(Yot, LNn, 25, 3 * d, 15, 1); + b < d - 1; + b++ + ) { + if (!(Pj((a = c[h++])) && Pj((u = c[h++])) && Pj((o = c[h++])) && Pj((s = c[h++])))) return null; + (t = sot[a]), + (e = sot[u]), + (i = sot[o]), + (r = sot[s]), + (f[l++] = (((t << 2) | (e >> 4)) << 24) >> 24), + (f[l++] = ((((15 & e) << 4) | ((i >> 2) & 15)) << 24) >> 24), + (f[l++] = (((i << 6) | r) << 24) >> 24); + } + return Pj((a = c[h++])) && Pj((u = c[h++])) + ? ((t = sot[a]), + (e = sot[u]), + (o = c[h++]), + (s = c[h++]), + -1 == sot[o] || -1 == sot[s] + ? 61 == o && 61 == s + ? 0 != (15 & e) + ? null + : (smn(f, 0, (g = VQ(Yot, LNn, 25, 3 * b + 1, 15, 1)), 0, 3 * b), (g[l] = (((t << 2) | (e >> 4)) << 24) >> 24), g) + : 61 != o && 61 == s + ? 0 != (3 & (i = sot[o])) + ? null + : (smn(f, 0, (g = VQ(Yot, LNn, 25, 3 * b + 2, 15, 1)), 0, 3 * b), + (g[l++] = (((t << 2) | (e >> 4)) << 24) >> 24), + (g[l] = ((((15 & e) << 4) | ((i >> 2) & 15)) << 24) >> 24), + g) + : null + : ((i = sot[o]), + (r = sot[s]), + (f[l++] = (((t << 2) | (e >> 4)) << 24) >> 24), + (f[l++] = ((((15 & e) << 4) | ((i >> 2) & 15)) << 24) >> 24), + (f[l++] = (((i << 6) | r) << 24) >> 24), + f)) + : null; + })(Vvn(n, !0))) + ) + throw hp(new fy("Invalid base64Binary value: '" + n + "'")); + return t; + } + function hen(n) { + var t; + try { + return (t = n.i.Xb(n.e)), n.mj(), (n.g = n.e++), t; + } catch (t) { + throw CO((t = j4(t)), 73) ? (n.mj(), hp(new Kp())) : hp(t); + } + } + function fen(n) { + var t; + try { + return (t = n.c.ki(n.e)), n.mj(), (n.g = n.e++), t; + } catch (t) { + throw CO((t = j4(t)), 73) ? (n.mj(), hp(new Kp())) : hp(t); + } + } + function len() { + (len = O), + Cjn(), + (Rqn = Ktt), + (Aqn = Nnt), + (Sqn = mnt), + ($qn = utt), + pcn(), + (xqn = _Bn), + (Nqn = RBn), + (Dqn = BBn), + (Lqn = DBn), + O6(), + (Iqn = jqn), + (Pqn = kqn), + (Cqn = Tqn), + (Oqn = Mqn); + } + function ben(n) { + switch ((VE(), (this.c = new ip()), (this.d = n), n.g)) { + case 0: + case 2: + (this.a = DB(Tzn)), (this.b = JTn); + break; + case 3: + case 1: + (this.a = Tzn), (this.b = ZTn); + } + } + function wen(n, t, e) { + var i; + if (n.c) L1(n.c, n.c.i + t), N1(n.c, n.c.j + e); + else for (i = new pb(n.b); i.a < i.c.c.length; ) wen(Yx(Hz(i), 157), t, e); + } + function den(n, t, e) { + var i; + t.a.length > 0 && + (eD(n.b, new iD(t.a, e)), 0 < (i = t.a.length) ? (t.a = t.a.substr(0, 0)) : 0 > i && (t.a += IO(VQ(Xot, sTn, 25, -i, 15, 1)))); + } + function gen(n, t) { + var e, i, r; + for (e = n.o, r = Yx(Yx(_V(n.r, t), 21), 84).Kc(); r.Ob(); ) + ((i = Yx(r.Pb(), 111)).e.a = mrn(i, e.a)), (i.e.b = e.b * ty(fL(i.b.We(XHn)))); + } + function pen(n, t) { + var e; + return (e = Yx(Aun(n, (gjn(), $1n)), 74)), MO(t, $zn) ? (e ? BH(e) : ((e = new Nv()), b5(n, $1n, e))) : e && b5(n, $1n, null), e; + } + function ven(n) { + var t; + return ( + ((t = new Ay()).a += "n"), + n.k != (bon(), Hzn) && yI(yI(((t.a += "("), t), d$(n.k).toLowerCase()), ")"), + yI(((t.a += "_"), t), yrn(n)), + t.a + ); + } + function men(n, t, e, i) { + var r; + return e >= 0 ? n.hh(t, e, i) : (n.eh() && (i = (r = n.Vg()) >= 0 ? n.Qg(i) : n.eh().ih(n, -1 - r, null, i)), n.Sg(t, e, i)); + } + function yen(n, t) { + switch (t) { + case 7: + return !n.e && (n.e = new AN(nct, n, 7, 4)), void Hmn(n.e); + case 8: + return !n.d && (n.d = new AN(nct, n, 8, 5)), void Hmn(n.d); + } + rnn(n, t); + } + function ken(n, t) { + var e; + e = n.Zc(t); + try { + return e.Pb(); + } catch (n) { + throw CO((n = j4(n)), 109) ? hp(new Hm("Can't get element " + t)) : hp(n); + } + } + function jen(n, t) { + (this.e = n), + t < oMn + ? ((this.d = 1), (this.a = x4(Gy(Wot, 1), MTn, 25, 15, [0 | t]))) + : ((this.d = 2), (this.a = x4(Gy(Wot, 1), MTn, 25, 15, [t % oMn | 0, (t / oMn) | 0]))); + } + function Een(n, t) { + var e, i, r, c; + for (XH(), e = n, c = t, CO(n, 21) && !CO(t, 21) && ((e = t), (c = n)), r = e.Kc(); r.Ob(); ) + if (((i = r.Pb()), c.Hc(i))) return !1; + return !0; + } + function Ten(n, t, e) { + var i, r, c, a; + return ( + -1 != (i = n.Xc(t)) && + (n.ej() ? ((c = n.fj()), (a = Orn(n, i)), (r = n.Zi(4, a, null, i, c)), e ? e.Ei(r) : (e = r)) : Orn(n, i)), + e + ); + } + function Men(n, t) { + var e; + switch (((e = Yx(GB(n.b, t), 124).n), t.g)) { + case 1: + n.t >= 0 && (e.d = n.t); + break; + case 3: + n.t >= 0 && (e.a = n.t); + } + n.C && ((e.b = n.C.b), (e.c = n.C.c)); + } + function Sen() { + (Sen = O), + (tqn = new iM(NSn, 0)), + (nqn = new iM(xSn, 1)), + (eqn = new iM(DSn, 2)), + (iqn = new iM(RSn, 3)), + (tqn.a = !1), + (nqn.a = !0), + (eqn.a = !1), + (iqn.a = !0); + } + function Pen() { + (Pen = O), + (bqn = new eM(NSn, 0)), + (lqn = new eM(xSn, 1)), + (wqn = new eM(DSn, 2)), + (dqn = new eM(RSn, 3)), + (bqn.a = !1), + (lqn.a = !0), + (wqn.a = !1), + (dqn.a = !0); + } + function Ien(n) { + var t, e, i; + if (((e = 0), 0 == (i = idn(n)).c.length)) return 1; + for (t = new pb(i); t.a < t.c.c.length; ) e += Ien(Yx(Hz(t), 33)); + return e; + } + function Cen(n, t, e, i) { + if (t.a < i.a) return !0; + if (t.a == i.a) { + if (t.b < i.b) return !0; + if (t.b == i.b && n.b > e.b) return !0; + } + return !1; + } + function Oen(n, t) { + return aI(n) ? !!zjn[t] : n.hm ? !!n.hm[t] : cI(n) ? !!Gjn[t] : !!rI(n) && !!qjn[t]; + } + function Aen(n, t, e) { + return ( + null == e + ? (!n.o && (n.o = new yY((ajn(), Frt), mct, n, 0)), ttn(n.o, t)) + : (!n.o && (n.o = new yY((ajn(), Frt), mct, n, 0)), xcn(n.o, t, e)), + n + ); + } + function $en(n, t, e, i) { + var r, c, a; + return ( + (c = CZ(n.Tg(), t)), + (r = t - n.Ah()) < 0 ? ((a = n.Yg(c)) >= 0 ? n._g(a, e, !0) : tfn(n, c, e)) : Yx(c, 66).Nj().Pj(n, n.yh(), r, e, i) + ); + } + function Len(n, t, e, i) { + var r, c; + e.mh(t) && + (TT(), + GJ(t) + ? (function (n, t) { + var e, i, r, c; + for (i = 0, r = t.gc(); i < r; ++i) + CO((e = t.il(i)), 99) && 0 != (Yx(e, 18).Bb & MNn) && null != (c = t.jl(i)) && Qgn(n, Yx(c, 56)); + })(n, Yx(e.ah(t), 153)) + : (r = (c = t) ? Yx(i, 49).xh(c) : null) && + (function (n, t) { + t.Wb(n); + })(e.ah(t), r)); + } + function Nen(n) { + switch (typeof n) { + case Vjn: + return Xen(n); + case Wjn: + return oG(n); + case Xjn: + return TA(), n ? 1231 : 1237; + default: + return null == n ? 0 : _A(n); + } + } + function xen(n) { + var t, e; + if (null == n) return null; + for (e = VQ(Gzn, TEn, 193, n.length, 0, 2), t = 0; t < e.length; t++) e[t] = Yx(xY(n[t], n[t].length), 193); + return e; + } + function Den(n) { + var t; + if (T6(n)) return qK(n), n.Lk() && ((t = qhn(n.e, n.b, n.c, n.a, n.j)), (n.j = t)), (n.g = n.a), ++n.a, ++n.c, (n.i = 0), n.j; + throw hp(new Kp()); + } + function Ren(n, t) { + var e, i; + if ((i = Brn(n, t)) >= 0) return i; + if (n.Fk()) for (e = 0; e < n.i; ++e) if (iI(n.Gk(Yx(n.g[e], 56))) === iI(t)) return e; + return -1; + } + function Ken(n, t, e) { + var i, r; + if (t >= (r = n.gc())) throw hp(new jN(t, r)); + if (n.hi() && (i = n.Xc(e)) >= 0 && i != t) throw hp(new Qm(kxn)); + return n.mi(t, e); + } + function _en(n, t) { + if (((this.a = Yx(MF(n), 245)), (this.b = Yx(MF(t), 245)), n.vd(t) > 0 || n == (dm(), ZKn) || t == (wm(), n_n))) + throw hp(new Qm("Invalid range: " + BX(n, t))); + } + function Fen(n) { + var t, e; + for (this.b = new ip(), this.c = n, this.a = !1, e = new pb(n.a); e.a < e.c.c.length; ) + (t = Yx(Hz(e), 10)), (this.a = this.a | (t.k == (bon(), Hzn))); + } + function Ben(n, t, e) { + var i, r, c; + for (r = new $K(bA((t ? u7(n) : o7(n)).a.Kc(), new h())); Vfn(r); ) + (i = Yx(kV(r), 17)), (c = t ? i.c.i : i.d.i).k == (bon(), Fzn) && JG(c, e); + } + function Hen() { + (Hen = O), + (S2n = new iS(fIn, 0)), + (P2n = new iS("PORT_POSITION", 1)), + (M2n = new iS("NODE_SIZE_WHERE_SPACE_PERMITS", 2)), + (T2n = new iS("NODE_SIZE", 3)); + } + function qen() { + (qen = O), + (H7n = new YS("AUTOMATIC", 0)), + (z7n = new YS(ySn, 1)), + (U7n = new YS(kSn, 2)), + (X7n = new YS("TOP", 3)), + (q7n = new YS(ESn, 4)), + (G7n = new YS(pSn, 5)); + } + function Gen(n, t, e, i) { + var r, c; + for (jfn(), r = 0, c = 0; c < e; c++) (r = t7(e7(Gz(t[c], uMn), Gz(i, uMn)), Gz(WR(r), uMn))), (n[c] = WR(r)), (r = UK(r, 32)); + return WR(r); + } + function zen(n, t, i) { + var r, c; + for (c = 0, r = 0; r < bHn; r++) c = e.Math.max(c, Q6(n.a[t.g][r], i)); + return t == (JZ(), cHn) && n.b && (c = e.Math.max(c, n.b.b)), c; + } + function Uen(n, t) { + var e, i; + if ((T$(t > 0), (t & -t) == t)) return oG(t * Xln(n, 31) * 4.656612873077393e-10); + do { + i = (e = Xln(n, 31)) % t; + } while (e - i + (t - 1) < 0); + return oG(i); + } + function Xen(n) { + var t, e, i; + return ( + lx(), + null != (i = vBn[(e = ":" + n)]) + ? oG((vB(i), i)) + : ((t = + null == (i = pBn[e]) + ? (function (n) { + var t, e, i, r; + for (t = 0, r = (i = n.length) - 4, e = 0; e < r; ) + Lz(e + 3, n.length), + (t = + n.charCodeAt(e + 3) + + (Lz(e + 2, n.length), + 31 * + (n.charCodeAt(e + 2) + + (Lz(e + 1, n.length), 31 * (n.charCodeAt(e + 1) + (Lz(e, n.length), 31 * (n.charCodeAt(e) + 31 * t))))))), + (t |= 0), + (e += 4); + for (; e < i; ) t = 31 * t + XB(n, e++); + return 0 | t; + })(n) + : oG((vB(i), i))), + 256 == yBn && ((pBn = vBn), (vBn = new r()), (yBn = 0)), + ++yBn, + (vBn[e] = t), + t) + ); + } + function Wen(n, t, e) { + run(e, "Compound graph preprocessor", 1), + (n.a = new Zq()), + akn(n, t, null), + (function (n, t) { + var e, i, r, c, a, u, o; + for (a = FK(n.a).Kc(); a.Ob(); ) { + if ((c = Yx(a.Pb(), 17)).b.c.length > 0) + for (i = new sx(Yx(_V(n.a, c), 21)), XH(), JC(i, new ow(t)), r = new JU(c.b, 0); r.b < r.d.gc(); ) { + switch ((S$(r.b < r.d.gc()), (e = Yx(r.d.Xb((r.c = r.b++)), 70)), (u = -1), Yx(Aun(e, (gjn(), f1n)), 272).g)) { + case 1: + u = i.c.length - 1; + break; + case 0: + u = ian(i); + break; + case 2: + u = 0; + } + -1 != u && + ($z(u, i.c.length), + eD((o = Yx(i.c[u], 243)).b.b, e), + Yx(Aun(dB(o.b.c.i), (Ojn(), bQn)), 21).Fc((edn(), MVn)), + Yx(Aun(dB(o.b.c.i), bQn), 21).Fc(EVn), + hB(r), + b5(e, $Qn, c)); + } + YG(c, null), QG(c, null); + } + })(n, t), + (function (n) { + var t, e, i, r; + for (i = new t6(new Ql(n.b).a); i.b; ) + (r = Yx((e = s1(i)).cd(), 11)), + b5((t = Yx(e.dd(), 10)), (Ojn(), CQn), r), + b5(r, RQn, t), + b5(r, gQn, (TA(), !0)), + whn(r, Yx(Aun(t, hQn), 61)), + Aun(t, hQn), + b5(r.i, (gjn(), g0n), (Ran(), hit)), + Yx(Aun(dB(r.i), bQn), 21).Fc((edn(), CVn)); + })(n), + b5(t, (Ojn(), eQn), n.a), + (n.a = null), + U_(n.b), + Ron(e); + } + function Ven(n) { + switch (n.g) { + case 0: + return null; + case 1: + return new y2(); + case 2: + return new fm(); + default: + throw hp(new Qm(y$n + (null != n.f ? n.f : "" + n.g))); + } + } + function Qen(n, t, e) { + var i, r; + for ( + (function (n, t, e) { + var i, r; + for (r = new pb(n.b); r.a < r.c.c.length; ) jC((i = Yx(Hz(r), 33)), i.i + t, i.j + e); + })(n, t - n.s, e - n.t), + r = new pb(n.n); + r.a < r.c.c.length; + + ) + ql((i = Yx(Hz(r), 211)), i.e + t - n.s), Gl(i, i.f + e - n.t); + (n.s = t), (n.t = e); + } + function Yen(n) { + var t, e, i, r; + for (e = 0, i = new pb(n.a); i.a < i.c.c.length; ) Yx(Hz(i), 121).d = e++; + return ( + (r = null), + (t = (function (n) { + var t, e, i, r; + for (t = new ip(), x_((e = VQ(Vot, wSn, 25, n.a.c.length, 16, 1)), e.length), r = new pb(n.a); r.a < r.c.c.length; ) + e[(i = Yx(Hz(r), 121)).d] || ((t.c[t.c.length] = i), Rtn(n, i, e)); + return t; + })(n)).c.length > 1 && + (r = (function (n, t) { + var e, i, r; + for (e = HA(new ev(), n), r = new pb(t); r.a < r.c.c.length; ) + (i = Yx(Hz(r), 121)), uwn(NE(LE(xE($E(new tv(), 0), 0), e), i)); + return e; + })(n, t)), + r + ); + } + function Jen(n) { + var t; + return ( + n.f && + n.f.kh() && + ((t = Yx(n.f, 49)), + (n.f = Yx(P8(n, t), 82)), + n.f != t && 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 9, 8, t, n.f))), + n.f + ); + } + function Zen(n) { + var t; + return ( + n.i && + n.i.kh() && + ((t = Yx(n.i, 49)), + (n.i = Yx(P8(n, t), 82)), + n.i != t && 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 9, 7, t, n.i))), + n.i + ); + } + function nin(n) { + var t; + return ( + n.b && + 0 != (64 & n.b.Db) && + ((t = n.b), (n.b = Yx(P8(n, t), 18)), n.b != t && 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 9, 21, t, n.b))), + n.b + ); + } + function tin(n, t) { + var e, i, r; + null == n.d + ? (++n.e, ++n.f) + : ((i = t.Sh()), + (function (n, t) { + var e, i, r, c, a, u, o, s, h, f; + if ((++n.e, t > (o = null == n.d ? 0 : n.d.length))) { + for (h = n.d, n.d = VQ(Ect, yDn, 63, 2 * o + 4, 0, 1), c = 0; c < o; ++c) + if ((s = h[c])) + for (i = s.g, f = s.i, u = 0; u < f; ++u) + (a = KL(n, (r = Yx(i[u], 133)).Sh())), !(e = n.d[a]) && (e = n.d[a] = n.uj()), e.Fc(r); + return !0; + } + })(n, n.f + 1), + (r = (i & Yjn) % n.d.length), + !(e = n.d[r]) && (e = n.d[r] = n.uj()), + e.Fc(t), + ++n.f); + } + function ein(n, t, e) { + var i; + return !t.Kj() && (-2 != t.Zj() ? (null == (i = t.zj()) ? null == e : Q8(i, e)) : t.Hj() == n.e.Tg() && null == e); + } + function iin() { + var n; + g0(16, GEn), + (n = U0(16)), + (this.b = VQ(c_n, qEn, 317, n, 0, 1)), + (this.c = VQ(c_n, qEn, 317, n, 0, 1)), + (this.a = null), + (this.e = null), + (this.i = 0), + (this.f = n - 1), + (this.g = 0); + } + function rin(n) { + oN.call(this), + (this.k = (bon(), Hzn)), + (this.j = (g0(6, UEn), new pQ(6))), + (this.b = (g0(2, UEn), new pQ(2))), + (this.d = new Tv()), + (this.f = new Pv()), + (this.a = n); + } + function cin(n) { + var t, e; + n.c.length <= 1 || + (rsn(n, Yx((t = odn(n, (Ikn(), Bit))).a, 19).a, Yx(t.b, 19).a), rsn(n, Yx((e = odn(n, qit)).a, 19).a, Yx(e.b, 19).a)); + } + function ain() { + (ain = O), + (N2n = new rS("SIMPLE", 0)), + (A2n = new rS(eCn, 1)), + ($2n = new rS("LINEAR_SEGMENTS", 2)), + (O2n = new rS("BRANDES_KOEPF", 3)), + (L2n = new rS(RAn, 4)); + } + function uin(n, t, e) { + zN(Yx(Aun(t, (gjn(), g0n)), 98)) || + (NJ(n, t, $on(t, e)), NJ(n, t, $on(t, (Ikn(), Bit))), NJ(n, t, $on(t, Tit)), XH(), JC(t.j, new od(n))); + } + function oin(n, t, e, i) { + var r; + for (r = Yx(_V(i ? n.a : n.b, t), 21).Kc(); r.Ob(); ) if (jdn(n, e, Yx(r.Pb(), 33))) return !0; + return !1; + } + function sin(n) { + var t, e; + for (e = new UO(n); e.e != e.i.gc(); ) if ((t = Yx(hen(e), 87)).e || 0 != (!t.d && (t.d = new XO(hat, t, 1)), t.d).i) return !0; + return !1; + } + function hin(n) { + var t, e; + for (e = new UO(n); e.e != e.i.gc(); ) if ((t = Yx(hen(e), 87)).e || 0 != (!t.d && (t.d = new XO(hat, t, 1)), t.d).i) return !0; + return !1; + } + function fin(n) { + var t, i; + for ( + n.c || + (function (n) { + var t, i, r, c, a, u; + if (((c = new JU(n.e, 0)), (r = new JU(n.a, 0)), n.d)) for (i = 0; i < n.b; i++) S$(c.b < c.d.gc()), c.d.Xb((c.c = c.b++)); + else for (i = 0; i < n.b - 1; i++) S$(c.b < c.d.gc()), c.d.Xb((c.c = c.b++)), hB(c); + for (t = ty((S$(c.b < c.d.gc()), fL(c.d.Xb((c.c = c.b++))))); n.f - t > YAn; ) { + for (a = t, u = 0; e.Math.abs(t - a) < YAn; ) + ++u, (t = ty((S$(c.b < c.d.gc()), fL(c.d.Xb((c.c = c.b++)))))), S$(r.b < r.d.gc()), r.d.Xb((r.c = r.b++)); + u < n.b && (S$(c.b > 0), c.a.Xb((c.c = --c.b)), rvn(n, n.b - u, a, r, c), S$(c.b < c.d.gc()), c.d.Xb((c.c = c.b++))), + S$(r.b > 0), + r.a.Xb((r.c = --r.b)); + } + if (!n.d) for (i = 0; i < n.b - 1; i++) S$(c.b < c.d.gc()), c.d.Xb((c.c = c.b++)), hB(c); + (n.d = !0), (n.c = !0); + })(n), + i = new Nv(), + Hz((t = new pb(n.a))); + t.a < t.c.c.length; + + ) + KD(i, Yx(Hz(t), 407).a); + return S$(0 != i.b), VZ(i, i.c.b), i; + } + function lin() { + (lin = O), + Hdn(), + (i7n = Y9n), + (t7n = new RC(8)), + new DC((Cjn(), utt), t7n), + new DC(Xtt, 8), + (e7n = V9n), + (Z9n = _9n), + (n7n = F9n), + (J9n = new DC(Snt, (TA(), !1))); + } + function bin(n, t, e, i) { + switch (t) { + case 7: + return !n.e && (n.e = new AN(nct, n, 7, 4)), n.e; + case 8: + return !n.d && (n.d = new AN(nct, n, 8, 5)), n.d; + } + return S7(n, t, e, i); + } + function win(n) { + var t; + return ( + n.a && + n.a.kh() && + ((t = Yx(n.a, 49)), + (n.a = Yx(P8(n, t), 138)), + n.a != t && 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 9, 5, t, n.a))), + n.a + ); + } + function din(n) { + return n < 48 || n > 102 ? -1 : n <= 57 ? n - 48 : n < 65 ? -1 : n <= 70 ? n - 65 + 10 : n < 97 ? -1 : n - 97 + 10; + } + function gin(n, t) { + if (null == n) throw hp(new Zm("null key in entry: null=" + t)); + if (null == t) throw hp(new Zm("null value in entry: " + n + "=null")); + } + function pin(n, t) { + var i; + return ( + (i = x4(Gy(Jot, 1), rMn, 25, 15, [Q6(n.a[0], t), Q6(n.a[1], t), Q6(n.a[2], t)])), + n.d && ((i[0] = e.Math.max(i[0], i[2])), (i[2] = i[0])), + i + ); + } + function vin(n, t) { + var i; + return ( + (i = x4(Gy(Jot, 1), rMn, 25, 15, [Y6(n.a[0], t), Y6(n.a[1], t), Y6(n.a[2], t)])), + n.d && ((i[0] = e.Math.max(i[0], i[2])), (i[2] = i[0])), + i + ); + } + function min() { + (min = O), + (NWn = new GM("GREEDY", 0)), + (LWn = new GM(iCn, 1)), + (DWn = new GM(eCn, 2)), + (RWn = new GM("MODEL_ORDER", 3)), + (xWn = new GM("GREEDY_MODEL_ORDER", 4)); + } + function yin(n, t) { + var e, i, r; + for (n.b[t.g] = 1, i = Ztn(t.d, 0); i.b != i.d.c; ) + (r = (e = Yx(IX(i), 188)).c), 1 == n.b[r.g] ? KD(n.a, e) : 2 == n.b[r.g] ? (n.b[r.g] = 1) : yin(n, r); + } + function kin(n, t, e) { + var i, r, c, a; + for (a = n.r + t, n.r += t, n.d += e, i = e / n.n.c.length, r = 0, c = new pb(n.n); c.a < c.c.c.length; ) + Oln(Yx(Hz(c), 211), a, i, r), ++r; + } + function jin(n, t, e) { + run(e, "Shrinking tree compaction", 1), + ny(hL(Aun(t, (y3(), hqn)))) + ? ((function (n, t) { + var e; + (e = new it()), Yx(t.b, 65), Yx(t.b, 65), Yx(t.b, 65), WZ(t.a, new Dx(n, e, t)); + })(n, t.f), + BJ(t.f, t.c)) + : BJ(t.f, t.c), + Ron(e); + } + function Ein(n) { + var t; + if ( + ((t = (function (n) { + var t; + for (MF(n), vx(!0, "numberToAdvance must be nonnegative"), t = 0; t < 0 && Vfn(n); t++) kV(n); + return t; + })(n)), + !Vfn(n)) + ) + throw hp(new Hm("position (0) must be less than the number of elements that remained (" + t + ")")); + return kV(n); + } + function Tin(n, t, e) { + try { + return Nin(n, t + n.j, e + n.k); + } catch (n) { + throw CO((n = j4(n)), 73) ? hp(new Hm(n.g + qSn + t + tEn + e + ").")) : hp(n); + } + } + function Min(n, t, e) { + try { + return xin(n, t + n.j, e + n.k); + } catch (n) { + throw CO((n = j4(n)), 73) ? hp(new Hm(n.g + qSn + t + tEn + e + ").")) : hp(n); + } + } + function Sin(n, t, e) { + try { + return Din(n, t + n.j, e + n.k); + } catch (n) { + throw CO((n = j4(n)), 73) ? hp(new Hm(n.g + qSn + t + tEn + e + ").")) : hp(n); + } + } + function Pin(n) { + switch (n.g) { + case 1: + return Ikn(), qit; + case 4: + return Ikn(), Tit; + case 3: + return Ikn(), Eit; + case 2: + return Ikn(), Bit; + default: + return Ikn(), Hit; + } + } + function Iin(n, t) { + var e, i; + for (i = i7(n, t).Kc(); i.Ob(); ) if (null != Aun((e = Yx(i.Pb(), 11)), (Ojn(), RQn)) || YA(new UV(e.b))) return !0; + return !1; + } + function Cin(n, t) { + return ( + L1(t, n.e + n.d + (0 == n.c.c.length ? 0 : n.b)), + N1(t, n.f), + (n.a = e.Math.max(n.a, t.f)), + (n.d += t.g + (0 == n.c.c.length ? 0 : n.b)), + eD(n.c, t), + !0 + ); + } + function Oin(n, t, e) { + var i, r, c, a; + for (a = 0, i = e / n.a.c.length, c = new pb(n.a); c.a < c.c.c.length; ) + Qen((r = Yx(Hz(c), 187)), r.s, r.t + a * i), kin(r, n.d - r.r + t, i), ++a; + } + function Ain(n, t) { + var e, i, r, c, a, u; + for (r = t.length - 1, a = 0, u = 0, i = 0; i <= r; i++) + (c = t[i]), (e = von(r, i) * I8(1 - n, r - i) * I8(n, i)), (a += c.a * e), (u += c.b * e); + return new QS(a, u); + } + function $in(n, t) { + var e, i, r, c, a; + for (e = t.gc(), n.qi(n.i + e), c = t.Kc(), a = n.i, n.i += e, i = a; i < n.i; ++i) + (r = c.Pb()), _O(n, i, n.oi(i, r)), n.bi(i, r), n.ci(); + return 0 != e; + } + function Lin(n, t, e, i, r, c, a, u) { + var o, s; + i && + ((o = i.a[0]) && Lin(n, t, e, o, r, c, a, u), + (function (n, t, e, i, r, c, a) { + var u, o; + return !( + (t.Ae() && ((o = n.a.ue(e, i)), o < 0 || (!r && 0 == o))) || + (t.Be() && ((u = n.a.ue(e, c)), u > 0 || (!a && 0 == u))) + ); + })(n, e, i.d, r, c, a, u) && t.Fc(i), + (s = i.a[1]) && Lin(n, t, e, s, r, c, a, u)); + } + function Nin(n, t, e) { + try { + return sI(V0(n, t, e), 1); + } catch (i) { + throw CO((i = j4(i)), 320) ? hp(new Hm(FSn + n.o + "*" + n.p + BSn + t + tEn + e + HSn)) : hp(i); + } + } + function xin(n, t, e) { + try { + return sI(V0(n, t, e), 0); + } catch (i) { + throw CO((i = j4(i)), 320) ? hp(new Hm(FSn + n.o + "*" + n.p + BSn + t + tEn + e + HSn)) : hp(i); + } + } + function Din(n, t, e) { + try { + return sI(V0(n, t, e), 2); + } catch (i) { + throw CO((i = j4(i)), 320) ? hp(new Hm(FSn + n.o + "*" + n.p + BSn + t + tEn + e + HSn)) : hp(i); + } + } + function Rin(n, t) { + if (-1 == n.g) throw hp(new Lp()); + n.mj(); + try { + n.d._c(n.g, t), (n.f = n.d.j); + } catch (n) { + throw CO((n = j4(n)), 73) ? hp(new Dp()) : hp(n); + } + } + function Kin(n, t, i) { + run(i, "Linear segments node placement", 1), + (n.b = Yx(Aun(t, (Ojn(), zQn)), 304)), + (function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M, S, P, I, C, O, A, $; + for (O = new ip(), w = new pb(t.b); w.a < w.c.c.length; ) + for (k = new pb(Yx(Hz(w), 29).a); k.a < k.c.c.length; ) { + for ((y = Yx(Hz(k), 10)).p = -1, l = nTn, T = nTn, S = new pb(y.j); S.a < S.c.c.length; ) { + for (c = new pb((M = Yx(Hz(S), 11)).e); c.a < c.c.c.length; ) + (i = Yx(Hz(c), 17)), (P = Yx(Aun(i, (gjn(), P0n)), 19).a), (l = e.Math.max(l, P)); + for (r = new pb(M.g); r.a < r.c.c.length; ) + (i = Yx(Hz(r), 17)), (P = Yx(Aun(i, (gjn(), P0n)), 19).a), (T = e.Math.max(T, P)); + } + b5(y, u4n, d9(l)), b5(y, o4n, d9(T)); + } + for (p = 0, b = new pb(t.b); b.a < b.c.c.length; ) + for (k = new pb(Yx(Hz(b), 29).a); k.a < k.c.c.length; ) + (y = Yx(Hz(k), 10)).p < 0 && (((C = new pv()).b = p++), Vdn(n, y, C), (O.c[O.c.length] = C)); + for (E = h$(O.c.length), f = h$(O.c.length), u = 0; u < O.c.length; u++) eD(E, new ip()), eD(f, d9(0)); + for ( + (function (n, t, e, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g, p, v; + for (b = t.c.length, l = 0, f = new pb(n.b); f.a < f.c.c.length; ) + if (0 != (p = (h = Yx(Hz(f), 29)).a).c.length) { + for (s = 0, v = null, r = Yx(Hz((g = new pb(p))), 10), c = null; r; ) { + if ((c = Yx(TR(t, r.p), 257)).c >= 0) { + for ( + o = null, u = new JU(h.a, s + 1); + u.b < u.d.gc() && + (S$(u.b < u.d.gc()), (a = Yx(u.d.Xb((u.c = u.b++)), 10)), !((o = Yx(TR(t, a.p), 257)).d == c.d && o.c < c.c)); + + ) + o = null; + o && + (v && (QW(i, r.p, d9(Yx(TR(i, r.p), 19).a - 1)), Yx(TR(e, v.p), 15).Mc(c)), + (c = Van(c, r, b++)), + (t.c[t.c.length] = c), + eD(e, new ip()), + v ? (Yx(TR(e, v.p), 15).Fc(c), eD(i, d9(1))) : eD(i, d9(0))); + } + (w = null), + g.a < g.c.c.length && + ((w = Yx(Hz(g), 10)), + (d = Yx(TR(t, w.p), 257)), + Yx(TR(e, r.p), 15).Fc(d), + QW(i, w.p, d9(Yx(TR(i, w.p), 19).a + 1))), + (c.d = l), + (c.c = s++), + (v = r), + (r = w); + } + ++l; + } + })(t, O, E, f), + A = Yx(Htn(O, VQ(f4n, zAn, 257, O.c.length, 0, 1)), 840), + j = Yx(Htn(E, VQ(JKn, dPn, 15, E.c.length, 0, 1)), 192), + h = VQ(Wot, MTn, 25, f.c.length, 15, 1), + o = 0; + o < h.length; + o++ + ) + h[o] = ($z(o, f.c.length), Yx(f.c[o], 19)).a; + for (v = 0, m = new ip(), s = 0; s < A.length; s++) 0 == h[s] && eD(m, A[s]); + for (g = VQ(Wot, MTn, 25, A.length, 15, 1); 0 != m.c.length; ) + for (g[(C = Yx(KV(m, 0), 257)).b] = v++; !j[C.b].dc(); ) + --h[($ = Yx(j[C.b].$c(0), 257)).b], 0 == h[$.b] && (m.c[m.c.length] = $); + for (n.a = VQ(f4n, zAn, 257, A.length, 0, 1), a = 0; a < A.length; a++) + for (d = A[a], I = g[a], n.a[I] = d, d.b = I, k = new pb(d.e); k.a < k.c.c.length; ) (y = Yx(Hz(k), 10)).p = I; + n.a; + })(n, t), + (function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g; + for ( + o = VQ(Wot, MTn, 25, t.b.c.length, 15, 1), + h = VQ(Uzn, XEn, 267, t.b.c.length, 0, 1), + s = VQ(Gzn, kIn, 10, t.b.c.length, 0, 1), + b = 0, + w = (l = n.a).length; + b < w; + ++b + ) { + for (g = 0, u = new pb((f = l[b]).e); u.a < u.c.c.length; ) + ++o[(r = eC((c = Yx(Hz(u), 10)).c))], + (d = ty(fL(Aun(t, (gjn(), N0n))))), + o[r] > 0 && s[r] && (d = lO(n.b, s[r], c)), + (g = e.Math.max(g, c.c.c.b + d)); + for (a = new pb(f.e); a.a < a.c.c.length; ) + ((c = Yx(Hz(a), 10)).n.b = g + c.d.d), + ((i = c.c).c.b = g + c.d.d + c.o.b + c.d.a), + (h[hJ(i.b.b, i, 0)] = c.k), + (s[hJ(i.b.b, i, 0)] = c); + } + })(n, t), + (function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E; + (r = ty(fL(Aun(t, (gjn(), Q1n))))), (l = 4), (c = 3), (j = 20 / (k = Yx(Aun(t, V0n), 19).a)), (b = !1), (s = 0), (u = Yjn); + do { + for (a = 1 != s, f = 0 != s, E = 0, v = 0, y = (g = n.a).length; v < y; ++v) + ((w = g[v]).f = null), okn(n, w, a, f, r), (E += e.Math.abs(w.a)); + do { + o = Mpn(n, t); + } while (o); + for (p = 0, m = (d = n.a).length; p < m; ++p) + if (0 != (i = A_((w = d[p])).a)) for (h = new pb(w.e); h.a < h.c.c.length; ) Yx(Hz(h), 10).n.b += i; + 0 == s || 1 == s + ? --l <= 0 && (E < u || -l > k) + ? ((s = 2), (u = Yjn)) + : 0 == s + ? ((s = 1), (u = E)) + : ((s = 0), (u = E)) + : ((b = E >= u || u - E < j), (u = E), b && --c); + } while (!(b && c <= 0)); + })(n, t), + (function (n) { + var t, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M, S; + for (y = 0, k = (m = n.a).length; y < k; ++y) { + for (v = m[y], s = Yjn, h = Yjn, w = new pb(v.e); w.a < w.c.c.length; ) + (a = (l = Yx(Hz(w), 10)).c ? hJ(l.c.a, l, 0) : -1) > 0 + ? ((f = Yx(TR(l.c.a, a - 1), 10)), (T = lO(n.b, l, f)), (g = l.n.b - l.d.d - (f.n.b + f.o.b + f.d.a + T))) + : (g = l.n.b - l.d.d), + (s = e.Math.min(g, s)), + a < l.c.a.c.length - 1 + ? ((f = Yx(TR(l.c.a, a + 1), 10)), (T = lO(n.b, l, f)), (p = f.n.b - f.d.d - (l.n.b + l.o.b + l.d.a + T))) + : (p = 2 * l.n.b), + (h = e.Math.min(p, h)); + for (o = Yjn, c = !1, S = new pb((r = Yx(TR(v.e, 0), 10)).j); S.a < S.c.c.length; ) + for (M = Yx(Hz(S), 11), d = r.n.b + M.n.b + M.a.b, i = new pb(M.e); i.a < i.c.c.length; ) + (t = (j = Yx(Hz(i), 17).c).i.n.b + j.n.b + j.a.b - d), + e.Math.abs(t) < e.Math.abs(o) && e.Math.abs(t) < (t < 0 ? s : h) && ((o = t), (c = !0)); + for (E = new pb((u = Yx(TR(v.e, v.e.c.length - 1), 10)).j); E.a < E.c.c.length; ) + for (j = Yx(Hz(E), 11), d = u.n.b + j.n.b + j.a.b, i = new pb(j.g); i.a < i.c.c.length; ) + (t = (M = Yx(Hz(i), 17).d).i.n.b + M.n.b + M.a.b - d), + e.Math.abs(t) < e.Math.abs(o) && e.Math.abs(t) < (t < 0 ? s : h) && ((o = t), (c = !0)); + if (c && 0 != o) for (b = new pb(v.e); b.a < b.c.c.length; ) (l = Yx(Hz(b), 10)).n.b += o; + } + })(n), + (n.a = null), + (n.b = null), + Ron(i); + } + function _in(n, t) { + var e, i, r, c; + for (c = n.gc(), t.length < c && (t = qy(new Array(c), t)), r = t, i = n.Kc(), e = 0; e < c; ++e) DF(r, e, i.Pb()); + return t.length > c && DF(t, c, null), t; + } + function Fin(n, t) { + var e, i, r; + return (e = t.cd()), (r = t.dd()), (i = n.xc(e)), !(!(iI(r) === iI(i) || (null != r && Q8(r, i))) || (null == i && !n._b(e))); + } + function Bin(n, t, e, i) { + var r, c; + (this.a = t), + (this.c = i), + (function (n, t) { + n.b = t; + })(this, new QS(-(r = n.a).c, -r.d)), + mN(this.b, e), + (c = i / 2), + t.a ? N$(this.b, 0, c) : N$(this.b, c, 0), + eD(n.c, this); + } + function Hin() { + (Hin = O), + (i8n = new RS(fIn, 0)), + (t8n = new RS(rCn, 1)), + (e8n = new RS("EDGE_LENGTH_BY_POSITION", 2)), + (n8n = new RS("CROSSING_MINIMIZATION_BY_POSITION", 3)); + } + function qin(n, t) { + var e, i; + if ((e = Yx(g1(n.g, t), 33))) return e; + if ((i = Yx(g1(n.j, t), 118))) return i; + throw hp(new hy("Referenced shape does not exist: " + t)); + } + function Gin(n, t) { + if (n.c == t) return n.d; + if (n.d == t) return n.c; + throw hp(new Qm("Node 'one' must be either source or target of edge 'edge'.")); + } + function zin(n, t) { + if (n.c.i == t) return n.d.i; + if (n.d.i == t) return n.c.i; + throw hp(new Qm("Node " + t + " is neither source nor target of edge " + n)); + } + function Uin(n, t) { + var e; + switch (t.g) { + case 2: + case 4: + (e = n.a), n.c.d.n.b < e.d.n.b && (e = n.c), O_(n, t, (K4(), xXn), e); + break; + case 1: + case 3: + O_(n, t, (K4(), $Xn), null); + } + } + function Xin(n, t, e, i, r, c) { + var a, u, o, s, h; + for ( + a = (function (n, t, e) { + var i, r; + switch (((i = (r = n.b).d), t.g)) { + case 1: + return -i.d - e; + case 2: + return r.o.a + i.c + e; + case 3: + return r.o.b + i.a + e; + case 4: + return -i.b - e; + default: + return -1; + } + })(t, e, c), + u = e == (Ikn(), Tit) || e == qit ? -1 : 1, + s = n[e.g], + h = 0; + h < s.length; + h++ + ) + (o = s[h]) > 0 && (o += r), (s[h] = a), (a += u * (o + i)); + } + function Win(n) { + var t, e, i; + for (i = n.f, n.n = VQ(Jot, rMn, 25, i, 15, 1), n.d = VQ(Jot, rMn, 25, i, 15, 1), t = 0; t < i; t++) + (e = Yx(TR(n.c.b, t), 29)), (n.n[t] = ien(n, e)), (n.d[t] = Lbn(n, e)); + } + function Vin(n, t) { + var e, i, r; + for (r = 0, i = 2; i < t; i <<= 1) 0 != (n.Db & i) && ++r; + if (0 == r) { + for (e = t <<= 1; e <= 128; e <<= 1) if (0 != (n.Db & e)) return 0; + return -1; + } + return r; + } + function Qin(n, t) { + var e, i, r, c, a; + for (a = dwn(n.e.Tg(), t), c = null, e = Yx(n.g, 119), r = 0; r < n.i; ++r) + (i = e[r]), a.rl(i.ak()) && (!c && (c = new go()), fY(c, i)); + c && Xkn(n, c); + } + function Yin(n) { + var t, e; + if (!n) return null; + if (n.dc()) return ""; + for (e = new Cy(), t = n.Kc(); t.Ob(); ) pI(e, lL(t.Pb())), (e.a += " "); + return UI(e, e.a.length - 1); + } + function Jin(n, t, e) { + var i, r, c, a; + for (s5(n), null == n.k && (n.k = VQ(b_n, TEn, 78, 0, 0, 1)), r = 0, c = (i = n.k).length; r < c; ++r) Jin(i[r], t, "\t" + e); + (a = n.f) && Jin(a, t, e); + } + function Zin(n, t) { + var e, + i = new Array(t); + switch (n) { + case 14: + case 15: + e = 0; + break; + case 16: + e = !1; + break; + default: + return i; + } + for (var r = 0; r < t; ++r) i[r] = e; + return i; + } + function nrn(n) { + var t; + for (t = new pb(n.a.b); t.a < t.c.c.length; ) Yx(Hz(t), 57).c.$b(); + WZ(lC(n.d) ? n.a.c : n.a.d, new Wb(n)), n.c.Me(n), _wn(n); + } + function trn(n) { + var t, e, i; + for (e = new pb(n.e.c); e.a < e.c.c.length; ) { + for (i = new pb((t = Yx(Hz(e), 282)).b); i.a < i.c.c.length; ) Wvn(Yx(Hz(i), 447)); + lhn(t); + } + } + function ern(n) { + var t, i, r, c, a; + for (r = 0, a = 0, c = 0, i = new pb(n.a); i.a < i.c.c.length; ) + (t = Yx(Hz(i), 187)), (a = e.Math.max(a, t.r)), (r += t.d + (c > 0 ? n.c : 0)), ++c; + (n.b = r), (n.d = a); + } + function irn(n, t) { + var i; + return ( + (i = x4(Gy(Jot, 1), rMn, 25, 15, [zen(n, (JZ(), rHn), t), zen(n, cHn, t), zen(n, aHn, t)])), + n.f && ((i[0] = e.Math.max(i[0], i[2])), (i[2] = i[0])), + i + ); + } + function rrn(n, t, e) { + try { + cgn(n, t + n.j, e + n.k, !1, !0); + } catch (n) { + throw CO((n = j4(n)), 73) ? hp(new Hm(n.g + qSn + t + tEn + e + ").")) : hp(n); + } + } + function crn(n, t, e) { + try { + cgn(n, t + n.j, e + n.k, !0, !1); + } catch (n) { + throw CO((n = j4(n)), 73) ? hp(new Hm(n.g + qSn + t + tEn + e + ").")) : hp(n); + } + } + function arn(n) { + var t; + O$(n, (gjn(), U1n)) && + ((t = Yx(Aun(n, U1n), 21)).Hc((Eln(), Get)) ? (t.Mc(Get), t.Fc(Uet)) : t.Hc(Uet) && (t.Mc(Uet), t.Fc(Get))); + } + function urn(n) { + var t; + O$(n, (gjn(), U1n)) && + ((t = Yx(Aun(n, U1n), 21)).Hc((Eln(), Yet)) ? (t.Mc(Yet), t.Fc(Vet)) : t.Hc(Vet) && (t.Mc(Vet), t.Fc(Yet))); + } + function orn(n, t, e, i) { + var r, c; + for (r = t; r < n.c.length; r++) { + if (($z(r, n.c.length), (c = Yx(n.c[r], 11)), !e.Mb(c))) return r; + i.c[i.c.length] = c; + } + return n.c.length; + } + function srn(n, t, e, i) { + var r, c, a; + return ( + null == n.a && + (function (n, t) { + var e, i, r, c; + for (c = t.b.j, n.a = VQ(Wot, MTn, 25, c.c.length, 15, 1), r = 0, i = 0; i < c.c.length; i++) + $z(i, c.c.length), 0 == (e = Yx(c.c[i], 11)).e.c.length && 0 == e.g.c.length ? (r += 1) : (r += 3), (n.a[i] = r); + })(n, t), + (a = t.b.j.c.length), + (c = e.d.p), + (r = i.d.p - 1) < 0 && (r = a - 1), + c <= r ? n.a[r] - n.a[c] : n.a[a - 1] - n.a[c] + n.a[r] + ); + } + function hrn(n) { + var t, e; + if (!n.a) + for (n.a = nX(uq(Yx(n.f, 33)).i), e = new UO(uq(Yx(n.f, 33))); e.e != e.i.gc(); ) (t = Yx(hen(e), 33)), eD(n.a, new e$(n, t)); + return n.a; + } + function frn(n) { + var t; + if (!n.C && (null != n.D || null != n.B)) + if ( + (t = (function (n) { + var t, e, i, r; + if (-1 != (t = VI((e = null != n.D ? n.D : n.B), gun(91)))) { + (i = e.substr(0, t)), (r = new Cy()); + do { + r.a += "["; + } while (-1 != (t = b$(e, 91, ++t))); + _N(i, Xjn) + ? (r.a += "Z") + : _N(i, BDn) + ? (r.a += "B") + : _N(i, HDn) + ? (r.a += "C") + : _N(i, qDn) + ? (r.a += "D") + : _N(i, GDn) + ? (r.a += "F") + : _N(i, zDn) + ? (r.a += "I") + : _N(i, UDn) + ? (r.a += "J") + : _N(i, XDn) + ? (r.a += "S") + : ((r.a += "L"), (r.a += "" + i), (r.a += ";")); + try { + return null; + } catch (n) { + if (!CO((n = j4(n)), 60)) throw hp(n); + } + } else if (-1 == VI(e, gun(46))) { + if (_N(e, Xjn)) return Vot; + if (_N(e, BDn)) return Yot; + if (_N(e, HDn)) return Xot; + if (_N(e, qDn)) return Jot; + if (_N(e, GDn)) return Zot; + if (_N(e, zDn)) return Wot; + if (_N(e, UDn)) return Qot; + if (_N(e, XDn)) return nst; + } + return null; + })(n)) + ) + n.yk(t); + else + try { + n.yk(null); + } catch (n) { + if (!CO((n = j4(n)), 60)) throw hp(n); + } + return n.C; + } + function lrn(n, t) { + var i, r, c; + for (c = new Pk(), r = n.Kc(); r.Ob(); ) bgn((i = Yx(r.Pb(), 37)), c.a, 0), (c.a += i.f.a + t), (c.b = e.Math.max(c.b, i.f.b)); + return c.b > 0 && (c.b += t), c; + } + function brn(n, t) { + var i, r, c; + for (c = new Pk(), r = n.Kc(); r.Ob(); ) bgn((i = Yx(r.Pb(), 37)), 0, c.b), (c.b += i.f.b + t), (c.a = e.Math.max(c.a, i.f.a)); + return c.a > 0 && (c.a += t), c; + } + function wrn(n) { + var t, i, r; + for (r = Yjn, i = new pb(n.a); i.a < i.c.c.length; ) + O$((t = Yx(Hz(i), 10)), (Ojn(), IQn)) && (r = e.Math.min(r, Yx(Aun(t, IQn), 19).a)); + return r; + } + function drn(n, t) { + var e, i; + if (0 == t.length) return 0; + for (e = ZF(n.a, t[0], (Ikn(), qit)), e += ZF(n.a, t[t.length - 1], Eit), i = 0; i < t.length; i++) e += non(n, i, t); + return e; + } + function grn() { + kwn(), + (this.c = new ip()), + (this.i = new ip()), + (this.e = new oC()), + (this.f = new oC()), + (this.g = new oC()), + (this.j = new ip()), + (this.a = new ip()), + (this.b = new rp()), + (this.k = new rp()); + } + function prn(n, t) { + var e; + return n.Db >> 16 == 6 + ? n.Cb.ih(n, 5, cct, t) + : ((e = nin(Yx(CZ(Yx(H3(n, 16), 26) || n.zh(), n.Db >> 16), 18))), n.Cb.ih(n, e.n, e.f, t)); + } + function vrn(n) { + var t, i, r; + n.b == n.c && + ((r = n.a.length), + (i = j5(e.Math.max(8, r)) << 1), + 0 != n.b ? (Z0(n, (t = eN(n.a, i)), r), (n.a = t), (n.b = 0)) : zp(n.a, i), + (n.c = r)); + } + function mrn(n, t) { + var e; + return (e = n.b).Xe((Cjn(), ytt)) + ? e.Hf() == (Ikn(), qit) + ? -e.rf().a - ty(fL(e.We(ytt))) + : t + ty(fL(e.We(ytt))) + : e.Hf() == (Ikn(), qit) + ? -e.rf().a + : t; + } + function yrn(n) { + var t; + return 0 != n.b.c.length && Yx(TR(n.b, 0), 70).a + ? Yx(TR(n.b, 0), 70).a + : null != (t = IH(n)) + ? t + : "" + (n.c ? hJ(n.c.a, n, 0) : -1); + } + function krn(n) { + var t; + return 0 != n.f.c.length && Yx(TR(n.f, 0), 70).a + ? Yx(TR(n.f, 0), 70).a + : null != (t = IH(n)) + ? t + : "" + (n.i ? hJ(n.i.j, n, 0) : -1); + } + function jrn(n, t) { + var e, i; + if (t < 0 || t >= n.gc()) return null; + for (e = t; e < n.gc(); ++e) if (((i = Yx(n.Xb(e), 128)), e == n.gc() - 1 || !i.o)) return new mP(d9(e), i); + return null; + } + function Ern(n, t, e) { + var i, r, c, a; + for (c = n.c, i = e ? n : t, r = (e ? t : n).p + 1; r < i.p; ++r) + if ((a = Yx(TR(c.a, r), 10)).k != (bon(), Kzn) && !wcn(a)) return !1; + return !0; + } + function Trn(n) { + var t, i, r, c, a; + for (a = 0, c = ZTn, r = 0, i = new pb(n.a); i.a < i.c.c.length; ) + (a += (t = Yx(Hz(i), 187)).r + (r > 0 ? n.c : 0)), (c = e.Math.max(c, t.d)), ++r; + (n.e = a), (n.b = c); + } + function Mrn(n, t, e, i) { + return 0 == t + ? i + ? (!n.o && (n.o = new yY((ajn(), Frt), mct, n, 0)), n.o) + : (!n.o && (n.o = new yY((ajn(), Frt), mct, n, 0)), UQ(n.o)) + : $en(n, t, e, i); + } + function Srn(n) { + var t, e; + if (n.rb) for (t = 0, e = n.rb.i; t < e; ++t) v$(c1(n.rb, t)); + if (n.vb) for (t = 0, e = n.vb.i; t < e; ++t) v$(c1(n.vb, t)); + OK((wsn(), wut), n), (n.Bb |= 1); + } + function Prn(n, t, e, i, r, c, a, u, o, s, h, f, l, b) { + return ( + Gsn(n, t, i, null, r, c, a, u, o, s, l, !0, b), G9(n, h), CO(n.Cb, 88) && rhn(bV(Yx(n.Cb, 88)), 2), e && Q0(n, e), z9(n, f), n + ); + } + function Irn(n, t) { + var e, i, r; + return !( + (r = n.h - t.h) < 0 || + ((e = n.l - t.l), (r += (i = n.m - t.m + (e >> 22)) >> 22) < 0 || ((n.l = e & BTn), (n.m = i & BTn), (n.h = r & HTn), 0)) + ); + } + function Crn(n, t, e) { + var i, r; + return ( + a8((r = new Uv()), t), + E2(r, e), + fY((!n.c && (n.c = new m_(lat, n, 12, 10)), n.c), r), + _1((i = r), 0), + F1(i, 1), + l9(i, !0), + s9(i, !0), + i + ); + } + function Orn(n, t) { + var e, i; + if (t >= n.i) throw hp(new BI(t, n.i)); + return ++n.j, (e = n.g[t]), (i = n.i - t - 1) > 0 && smn(n.g, t + 1, n.g, t, i), DF(n.g, --n.i, null), n.fi(t, e), n.ci(), e; + } + function Arn(n, t) { + var e; + return n.Db >> 16 == 17 + ? n.Cb.ih(n, 21, rat, t) + : ((e = nin(Yx(CZ(Yx(H3(n, 16), 26) || n.zh(), n.Db >> 16), 18))), n.Cb.ih(n, e.n, e.f, t)); + } + function $rn(n) { + var t, e, i, r, c; + for (r = Yjn, c = null, i = new pb(n.d); i.a < i.c.c.length; ) + (e = Yx(Hz(i), 213)).d.j ^ e.e.j && (t = e.e.e - e.d.e - e.a) < r && ((r = t), (c = e)); + return c; + } + function Lrn() { + (Lrn = O), + (CGn = new FI(VPn, (TA(), !1))), + (MGn = new FI(QPn, 100)), + CJ(), + (SGn = new FI(YPn, (PGn = GGn))), + (IGn = new FI(JPn, PPn)), + (OGn = new FI(ZPn, d9(Yjn))); + } + function Nrn(n, t, e) { + var i, r, c, a, u, o; + for (o = 0, r = 0, c = (i = n.a[t]).length; r < c; ++r) + for (u = V8(i[r], e).Kc(); u.Ob(); ) (a = Yx(u.Pb(), 11)), xB(n.f, a, d9(o++)); + } + function xrn(n) { + var t; + return ( + Qun(), + DY((t = Yx(_in(FK(n.k), VQ(trt, lIn, 61, 2, 0, 1)), 122)), 0, t.length, null), + t[0] == (Ikn(), Tit) && t[1] == qit && (DF(t, 0, qit), DF(t, 1, Tit)), + t + ); + } + function Drn(n, t, e) { + var i, r, c; + return ( + (c = Zwn( + n, + (r = (function (n, t, e) { + var i, r, c, a, u, o, s; + for (s = new Vk(new kd(n)), u = 0, o = (a = x4(Gy(rUn, 1), jIn, 11, 0, [t, e])).length; u < o; ++u) + for (c = a[u], S5(s.a, c, (TA(), $_n)), r = new UV(c.b); ZC(r.a) || ZC(r.b); ) + (i = Yx(ZC(r.a) ? Hz(r.a) : Hz(r.b), 17)).c == i.d || uF(s, c == i.c ? i.d : i.c); + return MF(s), new sx(s); + })(n, t, e)), + )), + OY(n.b), + tU(n, t, e), + XH(), + JC(r, new vd(n)), + (i = Zwn(n, r)), + OY(n.b), + tU(n, e, t), + new mP(d9(c), d9(i)) + ); + } + function Rrn() { + (Rrn = O), + (a4n = oR(new fX(), ($un(), tzn), ($jn(), CUn))), + (u4n = new _L("linearSegments.inputPrio", d9(0))), + (o4n = new _L("linearSegments.outputPrio", d9(0))); + } + function Krn() { + (Krn = O), + (Y4n = new CS("P1_TREEIFICATION", 0)), + (J4n = new CS("P2_NODE_ORDERING", 1)), + (Z4n = new CS("P3_NODE_PLACEMENT", 2)), + (n5n = new CS("P4_EDGE_ROUTING", 3)); + } + function _rn() { + (_rn = O), + Cjn(), + (V6n = Ott), + (J6n = Xtt), + (H6n = Jnt), + (q6n = ttt), + (G6n = itt), + (B6n = Qnt), + (z6n = att), + (W6n = Mtt), + lln(), + (_6n = I6n), + (F6n = C6n), + (U6n = A6n), + (X6n = L6n), + (Q6n = N6n), + (Y6n = x6n), + (Z6n = R6n); + } + function Frn() { + (Frn = O), + (Fet = new rP("UNKNOWN", 0)), + (Ret = new rP("ABOVE", 1)), + (Ket = new rP("BELOW", 2)), + (_et = new rP("INLINE", 3)), + new _L("org.eclipse.elk.labelSide", Fet); + } + function Brn(n, t) { + var e; + if (n.ni() && null != t) { + for (e = 0; e < n.i; ++e) if (Q8(t, n.g[e])) return e; + } else for (e = 0; e < n.i; ++e) if (iI(n.g[e]) === iI(t)) return e; + return -1; + } + function Hrn(n, t, e) { + if (e && (t < 0 || t > e.a.c.length)) throw hp(new Qm("index must be >= 0 and <= layer node count")); + n.c && uJ(n.c.a, n), (n.c = e), e && ZR(e.a, t, n); + } + function qrn(n, t) { + var e, i, r; + for (i = new $K(bA(a7(n).a.Kc(), new h())); Vfn(i); ) + return (e = Yx(kV(i), 17)), new Bf(MF((r = Yx(t.Kb(e), 10)).n.b + r.o.b / 2)); + return gm(), gm(), zKn; + } + function Grn(n, t) { + (this.c = new rp()), + (this.a = n), + (this.b = t), + (this.d = Yx(Aun(n, (Ojn(), zQn)), 304)), + iI(Aun(n, (gjn(), X1n))) === iI((cJ(), iVn)) ? (this.e = new Cv()) : (this.e = new Iv()); + } + function zrn(n, t) { + var e, i; + return ( + (i = null), + n.Xe((Cjn(), Htt)) && (e = Yx(n.We(Htt), 94)).Xe(t) && (i = e.We(t)), + null == i && n.yf() && (i = n.yf().We(t)), + null == i && (i = oen(t)), + i + ); + } + function Urn(n, t) { + var e, i; + e = n.Zc(t); + try { + return (i = e.Pb()), e.Qb(), i; + } catch (n) { + throw CO((n = j4(n)), 109) ? hp(new Hm("Can't remove element " + t)) : hp(n); + } + } + function Xrn(n, t) { + var e, i, r; + for (vB(t), T$(t != n), r = n.b.c.length, i = t.Kc(); i.Ob(); ) (e = i.Pb()), eD(n.b, vB(e)); + return r != n.b.c.length && (l6(n, 0), !0); + } + function Wrn() { + (Wrn = O), + Cjn(), + (xGn = Hnt), + new DC(Cnt, (TA(), !0)), + (KGn = Jnt), + (_Gn = ttt), + (FGn = itt), + (RGn = Qnt), + (BGn = att), + (HGn = Mtt), + Lrn(), + (NGn = CGn), + ($Gn = SGn), + (LGn = IGn), + (DGn = OGn), + (AGn = MGn); + } + function Vrn(n, t, e, i) { + var r, c, a; + for (JG(t, Yx(i.Xb(0), 29)), a = i.bd(1, i.gc()), c = Yx(e.Kb(t), 20).Kc(); c.Ob(); ) + Vrn(n, (r = Yx(c.Pb(), 17)).c.i == t ? r.d.i : r.c.i, e, a); + } + function Qrn(n) { + var t; + return ( + (t = new rp()), + O$(n, (Ojn(), QQn)) ? Yx(Aun(n, QQn), 83) : (SE(hH(new SR(null, new Nz(n.j, 16)), new tr()), new _w(t)), b5(n, QQn, t), t) + ); + } + function Yrn(n, t) { + var e; + return n.Db >> 16 == 6 + ? n.Cb.ih(n, 6, nct, t) + : ((e = nin(Yx(CZ(Yx(H3(n, 16), 26) || (ajn(), xrt), n.Db >> 16), 18))), n.Cb.ih(n, e.n, e.f, t)); + } + function Jrn(n, t) { + var e; + return n.Db >> 16 == 7 + ? n.Cb.ih(n, 1, Yrt, t) + : ((e = nin(Yx(CZ(Yx(H3(n, 16), 26) || (ajn(), Rrt), n.Db >> 16), 18))), n.Cb.ih(n, e.n, e.f, t)); + } + function Zrn(n, t) { + var e; + return n.Db >> 16 == 9 + ? n.Cb.ih(n, 9, uct, t) + : ((e = nin(Yx(CZ(Yx(H3(n, 16), 26) || (ajn(), _rt), n.Db >> 16), 18))), n.Cb.ih(n, e.n, e.f, t)); + } + function ncn(n, t) { + var e; + return n.Db >> 16 == 5 + ? n.Cb.ih(n, 9, oat, t) + : ((e = nin(Yx(CZ(Yx(H3(n, 16), 26) || (xjn(), Tat), n.Db >> 16), 18))), n.Cb.ih(n, e.n, e.f, t)); + } + function tcn(n, t) { + var e; + return n.Db >> 16 == 3 + ? n.Cb.ih(n, 0, ect, t) + : ((e = nin(Yx(CZ(Yx(H3(n, 16), 26) || (xjn(), pat), n.Db >> 16), 18))), n.Cb.ih(n, e.n, e.f, t)); + } + function ecn(n, t) { + var e; + return n.Db >> 16 == 7 + ? n.Cb.ih(n, 6, cct, t) + : ((e = nin(Yx(CZ(Yx(H3(n, 16), 26) || (xjn(), Lat), n.Db >> 16), 18))), n.Cb.ih(n, e.n, e.f, t)); + } + function icn() { + (this.a = new lo()), + (this.g = new iin()), + (this.j = new iin()), + (this.b = new rp()), + (this.d = new iin()), + (this.i = new iin()), + (this.k = new rp()), + (this.c = new rp()), + (this.e = new rp()), + (this.f = new rp()); + } + function rcn(n, t, e) { + var i, r, c; + for (e < 0 && (e = 0), c = n.i, r = e; r < c; r++) + if (((i = c1(n, r)), null == t)) { + if (null == i) return r; + } else if (iI(t) === iI(i) || Q8(t, i)) return r; + return -1; + } + function ccn(n, t) { + var e, i; + if (t) { + if (t == n) return !0; + for (e = 0, i = Yx(t, 49).eh(); i && i != t; i = i.eh()) { + if (++e > cMn) return ccn(n, i); + if (i == n) return !0; + } + } + return !1; + } + function acn(n, t) { + var i, r, c; + for (uJ(n.a, t), n.e -= t.r + (0 == n.a.c.length ? 0 : n.c), c = d$n, r = new pb(n.a); r.a < r.c.c.length; ) + (i = Yx(Hz(r), 187)), (c = e.Math.max(c, i.d)); + n.b = c; + } + function ucn(n, t) { + var e; + return n.Db >> 16 == 3 + ? n.Cb.ih(n, 12, uct, t) + : ((e = nin(Yx(CZ(Yx(H3(n, 16), 26) || (ajn(), Nrt), n.Db >> 16), 18))), n.Cb.ih(n, e.n, e.f, t)); + } + function ocn(n, t) { + var e; + return n.Db >> 16 == 11 + ? n.Cb.ih(n, 10, uct, t) + : ((e = nin(Yx(CZ(Yx(H3(n, 16), 26) || (ajn(), Krt), n.Db >> 16), 18))), n.Cb.ih(n, e.n, e.f, t)); + } + function scn(n, t) { + var e; + return n.Db >> 16 == 10 + ? n.Cb.ih(n, 11, rat, t) + : ((e = nin(Yx(CZ(Yx(H3(n, 16), 26) || (xjn(), Aat), n.Db >> 16), 18))), n.Cb.ih(n, e.n, e.f, t)); + } + function hcn(n, t) { + var e; + return n.Db >> 16 == 10 + ? n.Cb.ih(n, 12, fat, t) + : ((e = nin(Yx(CZ(Yx(H3(n, 16), 26) || (xjn(), Nat), n.Db >> 16), 18))), n.Cb.ih(n, e.n, e.f, t)); + } + function fcn(n) { + var t; + return ( + 0 == (1 & n.Bb) && + n.r && + n.r.kh() && + ((t = Yx(n.r, 49)), + (n.r = Yx(P8(n, t), 138)), + n.r != t && 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 9, 8, t, n.r))), + n.r + ); + } + function lcn(n, t, i) { + var r; + return ( + (r = x4(Gy(Jot, 1), rMn, 25, 15, [yun(n, (JZ(), rHn), t, i), yun(n, cHn, t, i), yun(n, aHn, t, i)])), + n.f && ((r[0] = e.Math.max(r[0], r[2])), (r[2] = r[0])), + r + ); + } + function bcn(n, t) { + var e, i, r; + if ( + 0 != + (r = (function (n, t) { + var e, i, r; + for (r = new pQ(t.gc()), i = t.Kc(); i.Ob(); ) + (e = Yx(i.Pb(), 286)).c == e.f ? nsn(n, e, e.c) : Von(n, e) || (r.c[r.c.length] = e); + return r; + })(n, t)).c.length + ) + for (JC(r, new ti()), e = r.c.length, i = 0; i < e; i++) nsn(n, ($z(i, r.c.length), Yx(r.c[i], 286)), sdn(n, r, i)); + } + function wcn(n) { + var t, e; + if (n.k == (bon(), Bzn)) + for (e = new $K(bA(a7(n).a.Kc(), new h())); Vfn(e); ) if (!ZW((t = Yx(kV(e), 17))) && n.c == Hcn(t, n).c) return !0; + return !1; + } + function dcn(n) { + var t, e; + if (n.k == (bon(), Bzn)) + for (e = new $K(bA(a7(n).a.Kc(), new h())); Vfn(e); ) if (!ZW((t = Yx(kV(e), 17))) && t.c.i.c == t.d.i.c) return !0; + return !1; + } + function gcn(n, t) { + var e, i, r, c, a, u; + return (a = n.h >> 19) != (u = t.h >> 19) ? u - a : (i = n.h) != (c = t.h) ? i - c : (e = n.m) != (r = t.m) ? e - r : n.l - t.l; + } + function pcn() { + (pcn = O), + $dn(), + (BBn = new FI(uSn, (HBn = VBn))), + sZ(), + (_Bn = new FI(oSn, (FBn = LBn))), + nen(), + (RBn = new FI(sSn, (KBn = CBn))), + (DBn = new FI(hSn, (TA(), !0))); + } + function vcn(n, t, e) { + var i, r; + (i = t * e), + CO(n.g, 145) + ? (r = SX(n)).f.d + ? r.f.a || (n.d.a += i + SSn) + : ((n.d.d -= i + SSn), (n.d.a += i + SSn)) + : CO(n.g, 10) && ((n.d.d -= i), (n.d.a += 2 * i)); + } + function mcn(n, t, i) { + var r, c, a, u, o; + for (c = n[i.g], o = new pb(t.d); o.a < o.c.c.length; ) + (a = (u = Yx(Hz(o), 101)).i) && a.i == i && (c[(r = u.d[i.g])] = e.Math.max(c[r], a.j.b)); + } + function ycn(n, t) { + var i, r, c, a, u; + for (r = 0, c = 0, i = 0, u = new pb(t.d); u.a < u.c.c.length; ) + ern((a = Yx(Hz(u), 443))), (r = e.Math.max(r, a.b)), (c += a.d + (i > 0 ? n.g : 0)), ++i; + (t.b = r), (t.e = c); + } + function kcn(n) { + var t, e, i; + if (((i = n.b), mE(n.i, i.length))) { + for ( + e = 2 * i.length, n.b = VQ(c_n, qEn, 317, e, 0, 1), n.c = VQ(c_n, qEn, 317, e, 0, 1), n.f = e - 1, n.i = 0, t = n.a; + t; + t = t.c + ) + phn(n, t, t); + ++n.g; + } + } + function jcn(n, t, e) { + var i; + (i = t.c.i).k == (bon(), Bzn) + ? (b5(n, (Ojn(), TQn), Yx(Aun(i, TQn), 11)), b5(n, MQn, Yx(Aun(i, MQn), 11))) + : (b5(n, (Ojn(), TQn), t.c), b5(n, MQn, e.d)); + } + function Ecn(n, t, i) { + var r, c, a, u, o, s; + return ( + udn(), + (u = t / 2), + (a = i / 2), + (o = 1), + (s = 1), + (r = e.Math.abs(n.a)) > u && (o = u / r), + (c = e.Math.abs(n.b)) > a && (s = a / c), + KO(n, e.Math.min(o, s)), + n + ); + } + function Tcn() { + uE.call(this), + (this.e = -1), + (this.a = !1), + (this.p = nTn), + (this.k = -1), + (this.c = -1), + (this.b = -1), + (this.g = !1), + (this.f = -1), + (this.j = -1), + (this.n = -1), + (this.i = -1), + (this.d = -1), + (this.o = nTn); + } + function Mcn() { + (Mcn = O), + (WGn = yK(oR(oR(oR(new fX(), ($un(), nzn), ($jn(), NUn)), nzn, KUn), tzn, zUn), tzn, jUn)), + (QGn = oR(oR(new fX(), nzn, lUn), nzn, EUn)), + (VGn = yK(new fX(), tzn, MUn)); + } + function Scn(n, t) { + var e, i, r, c; + for (c = new rp(), t.e = null, t.f = null, i = new pb(t.i); i.a < i.c.c.length; ) + (e = Yx(Hz(i), 65)), (r = Yx(BF(n.g, e.a), 46)), (e.a = a_(e.b)), xB(c, e.a, r); + n.g = c; + } + function Pcn(n, t, e) { + var i, r, c, a, u; + for (r = (t - n.e) / n.d.c.length, c = 0, u = new pb(n.d); u.a < u.c.c.length; ) + (a = Yx(Hz(u), 443)), (i = n.b - a.b + e), Lnn(a, a.e + c * r, a.f), Oin(a, r, i), ++c; + } + function Icn(n) { + var t; + if ((n.f.qj(), -1 != n.b)) { + if ((++n.b, (t = n.f.d[n.a]), n.b < t.i)) return; + ++n.a; + } + for (; n.a < n.f.d.length; ++n.a) if ((t = n.f.d[n.a]) && 0 != t.i) return void (n.b = 0); + n.b = -1; + } + function Ccn(n, t) { + var e, i, r; + for ( + e = (function (n, t) { + var e, i; + if (((i = 0), t.length > 0)) + try { + i = ipn(t, nTn, Yjn); + } catch (n) { + throw CO((n = j4(n)), 127) ? hp(new mJ(n)) : hp(n); + } + return !n.a && (n.a = new Vg(n)), i < (e = n.a).i && i >= 0 ? Yx(c1(e, i), 56) : null; + })(n, 0 == (r = t.c.length) ? "" : ($z(0, t.c.length), lL(t.c[0]))), + i = 1; + i < r && e; + ++i + ) + e = Yx(e, 49).oh(($z(i, t.c.length), lL(t.c[i]))); + return e; + } + function Ocn(n, t) { + var e, i; + for (i = new pb(t); i.a < i.c.c.length; ) + (e = Yx(Hz(i), 10)), (n.c[e.c.p][e.p].a = aK(n.i)), (n.c[e.c.p][e.p].d = ty(n.c[e.c.p][e.p].a)), (n.c[e.c.p][e.p].b = 1); + } + function Acn(n, t, e, i) { + var r, c, a; + return ( + (a = tgn( + n, + (c = (function (n, t, e, i) { + var r, c, a, u, o, s, h, f; + for (f = new Vk(new yd(n)), u = 0, o = (a = x4(Gy(Gzn, 1), kIn, 10, 0, [t, e])).length; u < o; ++u) + for (h = V8(a[u], i).Kc(); h.Ob(); ) + for (c = new UV((s = Yx(h.Pb(), 11)).b); ZC(c.a) || ZC(c.b); ) + ZW((r = Yx(ZC(c.a) ? Hz(c.a) : Hz(c.b), 17))) || (S5(f.a, s, (TA(), $_n)), jB(r) && uF(f, s == r.c ? r.d : r.c)); + return MF(f), new sx(f); + })(n, t, e, i)), + )), + Sun(n, t, e, i), + OY(n.b), + XH(), + JC(c, new md(n)), + (r = tgn(n, c)), + Sun(n, e, t, i), + OY(n.b), + new mP(d9(a), d9(r)) + ); + } + function $cn(n, t) { + run(t, "General Compactor", 1), + t.n && n && nU(t, RU(n), (P6(), jrt)), + (function (n) { + switch (n.g) { + case 1: + return new Ra(); + case 2: + return new rL(); + default: + throw hp(new Qm(y$n + (null != n.f ? n.f : "" + n.g))); + } + })(Yx(jln(n, (_rn(), F6n)), 380)).hg(n), + t.n && n && nU(t, RU(n), (P6(), jrt)); + } + function Lcn(n, t, e, i) { + switch (e) { + case 7: + return !n.e && (n.e = new AN(nct, n, 7, 4)), wnn(n.e, t, i); + case 8: + return !n.d && (n.d = new AN(nct, n, 8, 5)), wnn(n.d, t, i); + } + return sun(n, t, e, i); + } + function Ncn(n, t, e, i) { + switch (e) { + case 7: + return !n.e && (n.e = new AN(nct, n, 7, 4)), Ten(n.e, t, i); + case 8: + return !n.d && (n.d = new AN(nct, n, 8, 5)), Ten(n.d, t, i); + } + return d4(n, t, e, i); + } + function xcn(n, t, e) { + var i, r, c; + return ( + n.qj(), + (c = null == t ? 0 : W5(t)), + n.f > 0 && (r = efn(n, (c & Yjn) % n.d.length, c, t)) ? r.ed(e) : ((i = n.tj(c, t, e)), n.c.Fc(i), null) + ); + } + function Dcn(n, t) { + var e, i, r, c; + switch (U8(n, t)._k()) { + case 3: + case 2: + for (r = 0, c = (e = emn(t)).i; r < c; ++r) if (5 == TB(PJ(n, (i = Yx(c1(e, r), 34))))) return i; + } + return null; + } + function Rcn(n, t) { + var i, r, c, a; + for (a = 0, c = Yx(Yx(_V(n.r, t), 21), 84).Kc(); c.Ob(); ) (r = Yx(c.Pb(), 111)), (a = e.Math.max(a, r.e.a + r.b.rf().a)); + ((i = Yx(GB(n.b, t), 124)).n.b = 0), (i.a.a = a); + } + function Kcn(n, t) { + var i, r, c, a; + for (i = 0, a = Yx(Yx(_V(n.r, t), 21), 84).Kc(); a.Ob(); ) (c = Yx(a.Pb(), 111)), (i = e.Math.max(i, c.e.b + c.b.rf().b)); + ((r = Yx(GB(n.b, t), 124)).n.d = 0), (r.a.b = i); + } + function _cn(n) { + if (n < 0) throw hp(new Qm("The input must be positive")); + return n < _7n.length + ? VU(_7n[n]) + : e.Math.sqrt(w$n * n) * + ((function (n, t) { + var e, i, r; + for (r = 1, e = n, i = t >= 0 ? t : -t; i > 0; ) i % 2 == 0 ? ((e *= e), (i = (i / 2) | 0)) : ((r *= e), (i -= 1)); + return t < 0 ? 1 / r : r; + })(n, n) / + I8(2.718281828459045, n)); + } + function Fcn(n, t) { + var e; + if (n.ni() && null != t) { + for (e = 0; e < n.i; ++e) if (Q8(t, n.g[e])) return !0; + } else for (e = 0; e < n.i; ++e) if (iI(n.g[e]) === iI(t)) return !0; + return !1; + } + function Bcn(n, t) { + var i; + return tC(n) && tC(t) && XTn < (i = n / t) && i < zTn + ? i < 0 + ? e.Math.ceil(i) + : e.Math.floor(i) + : $3(Jmn(tC(n) ? W3(n) : n, tC(t) ? W3(t) : t, !1)); + } + function Hcn(n, t) { + if (t == n.c.i) return n.d.i; + if (t == n.d.i) return n.c.i; + throw hp(new Qm("'node' must either be the source node or target node of the edge.")); + } + function qcn(n, t) { + var e, i; + for (e = new $K(bA((t ? o7(n) : u7(n)).a.Kc(), new h())); Vfn(e); ) + if ((i = Hcn(Yx(kV(e), 17), n)).k == (bon(), Bzn) && i.c != n.c) return i; + return null; + } + function Gcn(n, t, e) { + var i, r, c; + for (c = new pb(t); c.a < c.c.c.length; ) (i = Yx(Hz(c), 10)), (n.c[i.c.p][i.p].e = !1); + for (r = new pb(t); r.a < r.c.c.length; ) ukn(n, (i = Yx(Hz(r), 10)), e); + } + function zcn(n, t, i) { + var r, c; + (r = G8(t.j, i.s, i.c) + G8(i.e, t.s, t.c)) == (c = G8(i.j, t.s, t.c) + G8(t.e, i.s, i.c)) + ? r > 0 && ((n.b += 2), (n.a += r)) + : ((n.b += 1), (n.a += e.Math.min(r, c))); + } + function Ucn(n, t) { + var e; + if (((e = !1), aI(t) && ((e = !0), nB(n, new zF(lL(t)))), e || (CO(t, 236) && ((e = !0), nB(n, new Tl(tx(Yx(t, 236)))))), !e)) + throw hp(new Gm(ixn)); + } + function Xcn(n) { + var t, e; + switch (Yx(Aun(dB(n), (gjn(), A1n)), 420).g) { + case 0: + return (t = n.n), (e = n.o), new QS(t.a + e.a / 2, t.b + e.b / 2); + case 1: + return new fC(n.n); + default: + return null; + } + } + function Wcn() { + (Wcn = O), + (hVn = new VM(fIn, 0)), + (sVn = new VM("LEFTUP", 1)), + (lVn = new VM("RIGHTUP", 2)), + (oVn = new VM("LEFTDOWN", 3)), + (fVn = new VM("RIGHTDOWN", 4)), + (uVn = new VM("BALANCED", 5)); + } + function Vcn(n, t, e) { + switch (t) { + case 1: + return !n.n && (n.n = new m_(act, n, 1, 7)), Hmn(n.n), !n.n && (n.n = new m_(act, n, 1, 7)), void jF(n.n, Yx(e, 14)); + case 2: + return void $0(n, lL(e)); + } + J5(n, t, e); + } + function Qcn(n, t, e) { + switch (t) { + case 3: + return void A1(n, ty(fL(e))); + case 4: + return void $1(n, ty(fL(e))); + case 5: + return void L1(n, ty(fL(e))); + case 6: + return void N1(n, ty(fL(e))); + } + Vcn(n, t, e); + } + function Ycn(n, t, e) { + var i, r; + (i = fun((r = new Uv()), t, null)) && i.Fi(), + E2(r, e), + fY((!n.c && (n.c = new m_(lat, n, 12, 10)), n.c), r), + _1(r, 0), + F1(r, 1), + l9(r, !0), + s9(r, !0); + } + function Jcn(n, t) { + var e, i; + return CO((e = NT(n.g, t)), 235) ? ((i = Yx(e, 235)).Qh(), i.Nh()) : CO(e, 498) ? (i = Yx(e, 1938).b) : null; + } + function Zcn(n, t, e, i) { + var r, c; + return ( + MF(t), + MF(e), + EJ(!!(c = Yx(nx(n.d, t), 19)), "Row %s not in %s", t, n.e), + EJ(!!(r = Yx(nx(n.b, e), 19)), "Column %s not in %s", e, n.c), + N4(n, c.a, r.a, i) + ); + } + function nan(n, t, e, i, r, c, a) { + var u, o, s, h, f; + if (((f = Zin((u = (s = c == a - 1) ? i : 0), (h = r[c]))), 10 != i && x4(Gy(n, a - c), t[c], e[c], u, f), !s)) + for (++c, o = 0; o < h; ++o) f[o] = nan(n, t, e, i, r, c, a); + return f; + } + function tan(n) { + if (-1 == n.g) throw hp(new Lp()); + n.mj(); + try { + n.i.$c(n.g), (n.f = n.i.j), n.g < n.e && --n.e, (n.g = -1); + } catch (n) { + throw CO((n = j4(n)), 73) ? hp(new Dp()) : hp(n); + } + } + function ean(n, t) { + return ( + (n.b.a = e.Math.min(n.b.a, t.c)), + (n.b.b = e.Math.min(n.b.b, t.d)), + (n.a.a = e.Math.max(n.a.a, t.c)), + (n.a.b = e.Math.max(n.a.b, t.d)), + (n.c[n.c.length] = t), + !0 + ); + } + function ian(n) { + var t, e, i; + for (i = -1, e = 0, t = new pb(n); t.a < t.c.c.length; ) { + if (Yx(Hz(t), 243).c == (h0(), e3n)) { + i = 0 == e ? 0 : e - 1; + break; + } + e == n.c.length - 1 && (i = e), (e += 1); + } + return i; + } + function ran(n) { + var t, i, r, c; + for (c = 0, t = 0, r = new pb(n.c); r.a < r.c.c.length; ) + L1((i = Yx(Hz(r), 33)), n.e + c), N1(i, n.f), (c += i.g + n.b), (t = e.Math.max(t, i.f + n.b)); + (n.d = c - n.b), (n.a = t - n.b); + } + function can(n) { + var t, e, i; + for (e = new pb(n.a.b); e.a < e.c.c.length; ) + (i = (t = Yx(Hz(e), 57)).d.c), + (t.d.c = t.d.d), + (t.d.d = i), + (i = t.d.b), + (t.d.b = t.d.a), + (t.d.a = i), + (i = t.b.a), + (t.b.a = t.b.b), + (t.b.b = i); + Hbn(n); + } + function aan(n) { + var t, e, i; + for (e = new pb(n.a.b); e.a < e.c.c.length; ) + (i = (t = Yx(Hz(e), 81)).g.c), + (t.g.c = t.g.d), + (t.g.d = i), + (i = t.g.b), + (t.g.b = t.g.a), + (t.g.a = i), + (i = t.e.a), + (t.e.a = t.e.b), + (t.e.b = i); + qbn(n); + } + function uan(n, t) { + var e, i; + return (i = Yx(DA(G5(hH(new SR(null, new Nz(t.j, 16)), new bc()))), 11)) && (e = Yx(TR(i.e, 0), 17)) + ? Yx(Aun(e, (Ojn(), IQn)), 19).a + : (function (n) { + switch (n.g) { + case 0: + return Yjn; + case 1: + return -1; + default: + return 0; + } + })(n.b); + } + function oan(n, t) { + var i, r; + for (uJ(n.b, t), r = new pb(n.n); r.a < r.c.c.length; ) + if (-1 != hJ((i = Yx(Hz(r), 211)).c, t, 0)) { + uJ(i.c, t), ran(i), 0 == i.c.c.length && uJ(n.n, i); + break; + } + !(function (n) { + var t, i, r, c, a, u, o, s; + for (r = 0, i = 0, s = new ME(), t = 0, o = new pb(n.n); o.a < o.c.c.length; ) + 0 == (u = Yx(Hz(o), 211)).c.c.length ? VW(s, u, s.c.b, s.c) : ((r = e.Math.max(r, u.d)), (i += u.a + (t > 0 ? n.i : 0))), ++t; + for ( + (function (n, t) { + var e, i; + for (vB(t), e = !1, i = new pb(n); i.a < i.c.c.length; ) V7(t, Hz(i), !1) && (z_(i), (e = !0)); + })(n.n, s), + n.d = i, + n.r = r, + n.g = 0, + n.f = 0, + n.e = 0, + n.o = JTn, + n.p = JTn, + a = new pb(n.b); + a.a < a.c.c.length; + + ) + (c = Yx(Hz(a), 33)), + (n.p = e.Math.min(n.p, c.g)), + (n.g = e.Math.max(n.g, c.g)), + (n.f = e.Math.max(n.f, c.f)), + (n.o = e.Math.min(n.o, c.f)), + (n.e += c.f + n.i); + (n.a = n.e / n.b.c.length - n.i * ((n.b.c.length - 1) / n.b.c.length)), Trn(n.j); + })(n); + } + function san(n, t) { + var i, r, c, a, u; + for (u = n.f, c = 0, a = 0, r = new pb(n.a); r.a < r.c.c.length; ) + Qen((i = Yx(Hz(r), 187)), n.e, u), pY(i, t), (a = e.Math.max(a, i.r)), (c = u += i.d + n.c); + (n.d = a), (n.b = c); + } + function han(n) { + var t, e; + return MX((e = fbn(n))) + ? null + : (MF(e), (t = Yx(Ein(new $K(bA(e.a.Kc(), new h()))), 79)), iun(Yx(c1((!t.b && (t.b = new AN(Zrt, t, 4, 7)), t.b), 0), 82))); + } + function fan(n) { + return ( + n.o || + (n.Lj() + ? (n.o = new cB(n, n, null)) + : n.rk() + ? (n.o = new FL(n, null)) + : 1 == TB(PJ((wsn(), wut), n)) + ? (n.o = new fW(n)) + : (n.o = new BL(n, null))), + n.o + ); + } + function lan(n, t, e, i) { + var r, c, a, u, o; + e.mh(t) && + (r = (a = t) ? Yx(i, 49).xh(a) : null) && + ((o = e.ah(t)), + (u = t.t) > 1 || -1 == u + ? ((c = Yx(o, 15)), + r.Wb( + (function (n, t) { + var e, i, r; + for (i = new pQ(t.gc()), e = t.Kc(); e.Ob(); ) (r = Qgn(n, Yx(e.Pb(), 56))) && (i.c[i.c.length] = r); + return i; + })(n, c), + )) + : r.Wb(Qgn(n, Yx(o, 56)))); + } + function ban(n) { + switch (Yx(Aun(n.b, (gjn(), g1n)), 375).g) { + case 1: + SE(fH(WJ(new SR(null, new Nz(n.d, 16)), new _r()), new Fr()), new Br()); + break; + case 2: + !(function (n) { + var t, e, i, r, c, a, u; + for (i = 0, u = 0, a = new pb(n.d); a.a < a.c.c.length; ) + (c = Yx(Hz(a), 101)), + (r = Yx( + kW( + hH(new SR(null, new Nz(c.j, 16)), new Xr()), + mY(new H(), new B(), new rn(), x4(Gy(wBn, 1), XEn, 132, 0, [(C6(), aBn)])), + ), + 15, + )), + (e = null), + i <= u ? (Ikn(), (e = Tit), (i += r.gc())) : u < i && (Ikn(), (e = Bit), (u += r.gc())), + (t = e), + SE(fH(r.Oc(), new Hr()), new nd(t)); + })(n); + break; + case 0: + !(function (n) { + var t, e, i, r; + for ( + JC((r = new sx(n.d)), new zr()), + adn(), + t = x4(Gy(pWn, 1), XEn, 270, 0, [tWn, rWn, nWn, uWn, iWn, eWn, aWn, cWn]), + e = 0, + i = new pb(r); + i.a < i.c.c.length; + + ) + mfn(Yx(Hz(i), 101), t[e % t.length]), ++e; + })(n); + } + } + function wan(n, t, e) { + run(e, "Straight Line Edge Routing", 1), + e.n && t && nU(e, RU(t), (P6(), jrt)), + vmn(n, Yx(jln(t, (eL(), s6n)), 33)), + e.n && t && nU(e, RU(t), (P6(), jrt)); + } + function dan() { + (dan = O), + (bnt = new JS("V_TOP", 0)), + (lnt = new JS("V_CENTER", 1)), + (fnt = new JS("V_BOTTOM", 2)), + (snt = new JS("H_LEFT", 3)), + (ont = new JS("H_CENTER", 4)), + (hnt = new JS("H_RIGHT", 5)); + } + function gan(n) { + var t; + return 0 != (64 & n.Db) + ? nnn(n) + : (((t = new MA(nnn(n))).a += " (abstract: "), + nj(t, 0 != (256 & n.Bb)), + (t.a += ", interface: "), + nj(t, 0 != (512 & n.Bb)), + (t.a += ")"), + t.a); + } + function pan(n, t) { + (this.e = n), + sI(Gz(t, -4294967296), 0) + ? ((this.d = 1), (this.a = x4(Gy(Wot, 1), MTn, 25, 15, [WR(t)]))) + : ((this.d = 2), (this.a = x4(Gy(Wot, 1), MTn, 25, 15, [WR(t), WR(zK(t, 32))]))); + } + function van(n, t) { + var e; + t != n.b + ? ((e = null), n.b && (e = Uq(n.b, n, -4, e)), t && (e = men(t, n, -4, e)), (e = M8(n, t, e)) && e.Fi()) + : 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 3, t, t)); + } + function man(n, t) { + var e; + t != n.f + ? ((e = null), n.f && (e = Uq(n.f, n, -1, e)), t && (e = men(t, n, -1, e)), (e = S8(n, t, e)) && e.Fi()) + : 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 0, t, t)); + } + function yan(n) { + var t, e, i; + if (null == n) return null; + if ((e = Yx(n, 15)).dc()) return ""; + for (i = new Cy(), t = e.Kc(); t.Ob(); ) pI(i, (ayn(), lL(t.Pb()))), (i.a += " "); + return UI(i, i.a.length - 1); + } + function kan(n) { + var t, e, i; + if (null == n) return null; + if ((e = Yx(n, 15)).dc()) return ""; + for (i = new Cy(), t = e.Kc(); t.Ob(); ) pI(i, (ayn(), lL(t.Pb()))), (i.a += " "); + return UI(i, i.a.length - 1); + } + function jan(n, t, e) { + var i, r, c; + return ( + (i = t.ak()), + (c = t.dd()), + (r = i.$j() ? Kq(n, 3, i, null, c, $vn(n, i, c, CO(i, 99) && 0 != (Yx(i, 18).Bb & eMn)), !0) : Kq(n, 1, i, i.zj(), c, -1, !0)), + e ? e.Ei(r) : (e = r), + e + ); + } + function Ean(n) { + var t, e; + return ( + (t = Yx(kV(new $K(bA(u7(n.a).a.Kc(), new h()))), 17)), + (e = Yx(kV(new $K(bA(o7(n.a).a.Kc(), new h()))), 17)), + ny(hL(Aun(t, (Ojn(), HQn)))) || ny(hL(Aun(e, HQn))) + ); + } + function Tan() { + (Tan = O), + (_Xn = new KM("ONE_SIDE", 0)), + (BXn = new KM("TWO_SIDES_CORNER", 1)), + (HXn = new KM("TWO_SIDES_OPPOSING", 2)), + (FXn = new KM("THREE_SIDES", 3)), + (KXn = new KM("FOUR_SIDES", 4)); + } + function Man(n, t, e, i, r) { + var c, a; + (c = Yx(kW(hH(t.Oc(), new Zr()), mY(new H(), new B(), new rn(), x4(Gy(wBn, 1), XEn, 132, 0, [(C6(), aBn)]))), 15)), + (a = Yx(F3(n.b, e, i), 15)), + 0 == r ? a.Wc(0, c) : a.Gc(c); + } + function San(n, t) { + var e, i, r; + for (i = new pb(t.a); i.a < i.c.c.length; ) + for (e = new $K(bA(u7(Yx(Hz(i), 10)).a.Kc(), new h())); Vfn(e); ) (r = Yx(kV(e), 17).c.i.p), (n.n[r] = n.n[r] - 1); + } + function Pan(n, t) { + return !!t && !n.Di(t) && (n.i ? n.i.Ei(t) : CO(t, 143) ? ((n.i = Yx(t, 143)), !0) : ((n.i = new po()), n.i.Ei(t))); + } + function Ian(n, t, e) { + var i, r, c; + for (r = n.vc().Kc(); r.Ob(); ) + if (((c = (i = Yx(r.Pb(), 42)).cd()), iI(t) === iI(c) || (null != t && Q8(t, c)))) + return e && ((i = new zT(i.cd(), i.dd())), r.Qb()), i; + return null; + } + function Can(n, t, i, r) { + var c, a, u; + for (u = e.Math.min(i, bvn(Yx(n.b, 65), t, i, r)), a = new pb(n.a); a.a < a.c.c.length; ) + (c = Yx(Hz(a), 221)) != t && (u = e.Math.min(u, Can(c, t, u, r))); + return u; + } + function Oan(n) { + var t, e, i; + for (i = VQ(Gzn, TEn, 193, n.b.c.length, 0, 2), e = new JU(n.b, 0); e.b < e.d.gc(); ) + S$(e.b < e.d.gc()), (t = Yx(e.d.Xb((e.c = e.b++)), 29)), (i[e.b - 1] = OU(t.a)); + return i; + } + function Aan(n, t, e, i, r) { + var c, a, u, o; + for ( + a = (function (n, t) { + return (n.e = t), n; + })( + Qy( + Ox( + (function (n) { + switch (n.g) { + case 1: + return e4(), YHn; + case 3: + return e4(), WHn; + case 2: + return e4(), QHn; + case 4: + return e4(), VHn; + default: + return null; + } + })(e), + ), + i, + ), + (function (n, t, e) { + var i, r; + switch (((r = n.o), (i = n.d), t.g)) { + case 1: + return -i.d - e; + case 3: + return r.b + i.a + e; + case 2: + return r.a + i.c + e; + case 4: + return -i.b - e; + default: + return 0; + } + })(n, e, r), + ), + o = $on(n, e).Kc(); + o.Ob(); + + ) + t[(u = Yx(o.Pb(), 11)).p] && ((c = t[u.p].i), eD(a.d, new fK(c, P9(a, c)))); + Z7(a); + } + function $an(n, t) { + (this.f = new rp()), + (this.b = new rp()), + (this.j = new rp()), + (this.a = n), + (this.c = t), + this.c > 0 && Nrn(this, this.c - 1, (Ikn(), Eit)), + this.c < this.a.length - 1 && Nrn(this, this.c + 1, (Ikn(), qit)); + } + function Lan(n) { + n.length > 0 && n[0].length > 0 && (this.c = ny(hL(Aun(dB(n[0][0]), (Ojn(), yQn))))), + (this.a = VQ(B3n, TEn, 2018, n.length, 0, 2)), + (this.b = VQ(X3n, TEn, 2019, n.length, 0, 2)), + (this.d = new e8()); + } + function Nan(n) { + return ( + 0 != n.c.length && + (($z(0, n.c.length), Yx(n.c[0], 17)).c.i.k == (bon(), Bzn) || JW(fH(new SR(null, new Nz(n, 16)), new Kc()), new _c())) + ); + } + function xan(n, t, e) { + return ( + run(e, "Tree layout", 1), + _U(n.b), + q_(n.b, (Krn(), Y4n), Y4n), + q_(n.b, J4n, J4n), + q_(n.b, Z4n, Z4n), + q_(n.b, n5n, n5n), + (n.a = Zmn(n.b, t)), + (function (n, t, e) { + var i, r, c; + if ((!(r = e) && (r = new am()), run(r, "Layout", n.a.c.length), ny(hL(Aun(t, (cln(), R5n)))))) + for (oE(), i = 0; i < n.a.c.length; i++) i++, Nk(V5(Yx(TR(n.a, i), 51))); + for (c = new pb(n.a); c.a < c.c.c.length; ) Yx(Hz(c), 51).pf(t, J2(r, 1)); + Ron(r); + })(n, t, J2(e, 1)), + Ron(e), + t + ); + } + function Dan(n, t) { + var i, r, c, a, u, o; + for (u = idn(t), c = t.f, o = t.g, a = e.Math.sqrt(c * c + o * o), r = 0, i = new pb(u); i.a < i.c.c.length; ) + r += Dan(n, Yx(Hz(i), 33)); + return e.Math.max(r, a); + } + function Ran() { + (Ran = O), + (lit = new uP(MSn, 0)), + (fit = new uP("FREE", 1)), + (hit = new uP("FIXED_SIDE", 2)), + (uit = new uP("FIXED_ORDER", 3)), + (sit = new uP("FIXED_RATIO", 4)), + (oit = new uP("FIXED_POS", 5)); + } + function Kan(n) { + var t, e, i, r; + if (null == n) return aEn; + for (r = new J3(tEn, "[", "]"), e = 0, i = (t = n).length; e < i; ++e) HV(r, "" + t[e]); + return r.a ? (0 == r.e.length ? r.a.a : r.a.a + "" + r.e) : r.c; + } + function _an(n) { + var t, e, i, r; + if (null == n) return aEn; + for (r = new J3(tEn, "[", "]"), e = 0, i = (t = n).length; e < i; ++e) HV(r, "" + t[e]); + return r.a ? (0 == r.e.length ? r.a.a : r.a.a + "" + r.e) : r.c; + } + function Fan(n) { + var t, e, i; + for (i = new J3(tEn, "{", "}"), e = n.vc().Kc(); e.Ob(); ) HV(i, zX(n, (t = Yx(e.Pb(), 42)).cd()) + "=" + zX(n, t.dd())); + return i.a ? (0 == i.e.length ? i.a.a : i.a.a + "" + i.e) : i.c; + } + function Ban(n, t) { + var e, i, r; + for (e = null, r = Yx(t.Kb(n), 20).Kc(); r.Ob(); ) + if (((i = Yx(r.Pb(), 17)), e)) { + if ((i.c.i == n ? i.d.i : i.c.i) != e) return !1; + } else e = i.c.i == n ? i.d.i : i.c.i; + return !0; + } + function Han(n, t) { + var e, i, r; + for (i = new pb(Nbn(n, !1, t)); i.a < i.c.c.length; ) + 0 == (e = Yx(Hz(i), 129)).d ? (pz(e, null), vz(e, null)) : ((r = e.a), pz(e, e.b), vz(e, r)); + } + function qan(n) { + var t, e, i, r; + for ( + (function (n) { + var t, e, i; + if ((e = Yx(Aun(n, (gjn(), x1n)), 163)) == (d7(), nYn)) { + for (t = new $K(bA(u7(n).a.Kc(), new h())); Vfn(t); ) + if (!jV(Yx(kV(t), 17))) + throw hp( + new ly( + HIn + + yrn(n) + + "' has its layer constraint set to FIRST_SEPARATE, but has at least one incoming edge. FIRST_SEPARATE nodes must not have incoming edges.", + ), + ); + } else if (e == eYn) + for (i = new $K(bA(o7(n).a.Kc(), new h())); Vfn(i); ) + if (!jV(Yx(kV(i), 17))) + throw hp( + new ly( + HIn + + yrn(n) + + "' has its layer constraint set to LAST_SEPARATE, but has at least one outgoing edge. LAST_SEPARATE nodes must not have outgoing edges.", + ), + ); + })(n), + e = new $K(bA(a7(n).a.Kc(), new h())); + Vfn(e); + + ) + (r = (i = (t = Yx(kV(e), 17)).c.i == n) ? t.d : t.c), i ? QG(t, null) : YG(t, null), b5(t, (Ojn(), LQn), r), qfn(n, r.i); + } + function Gan(n, t, e, i) { + var r, c; + switch (((r = e[(c = t.i).g][n.d[c.g]]), c.g)) { + case 1: + (r -= i + t.j.b), (t.g.b = r); + break; + case 3: + (r += i), (t.g.b = r); + break; + case 4: + (r -= i + t.j.a), (t.g.a = r); + break; + case 2: + (r += i), (t.g.a = r); + } + } + function zan(n, t, e) { + var i, r; + if (0 == n.j) return e; + if (((r = Yx(z1(n, 0, e), 72)), !(i = e.ak()).Ij() || !n.a.rl(i))) + throw hp(new Im("Invalid entry feature '" + i.Hj().zb + "." + i.ne() + "'")); + return r; + } + function Uan(n) { + var t, e, i; + return ( + k8(n, 0) >= 0 + ? ((e = Bcn(n, UTn)), (i = Snn(n, UTn))) + : ((e = Bcn((t = UK(n, 1)), 5e8)), (i = t7(GK((i = Snn(t, 5e8)), 1), Gz(n, 1)))), + zz(GK(i, 32), Gz(e, uMn)) + ); + } + function Xan(n, t, e) { + var i; + switch ((S$(0 != t.b), (i = Yx(VZ(t, t.a.a), 8)), e.g)) { + case 0: + i.b = 0; + break; + case 2: + i.b = n.f; + break; + case 3: + i.a = 0; + break; + default: + i.a = n.g; + } + return oF(Ztn(t, 0), i), t; + } + function Wan(n, t, e, i) { + var r, c, a, u, o; + switch (((o = n.b), (u = Ktn((a = (c = t.d).j), o.d[a.g], e)), (r = mN(dO(c.n), c.a)), c.j.g)) { + case 1: + case 3: + u.a += r.a; + break; + case 2: + case 4: + u.b += r.b; + } + VW(i, u, i.c.b, i.c); + } + function Van(n, t, e) { + var i, r, c, a; + for (a = hJ(n.e, t, 0), (c = new pv()).b = e, i = new JU(n.e, a); i.b < i.d.gc(); ) + S$(i.b < i.d.gc()), ((r = Yx(i.d.Xb((i.c = i.b++)), 10)).p = e), eD(c.e, r), hB(i); + return c; + } + function Qan() { + var n, t, e, i; + for (Qan = O, GFn = VQ(Jot, rMn, 25, 25, 15, 1), zFn = VQ(Jot, rMn, 25, 33, 15, 1), i = 152587890625e-16, t = 32; t >= 0; t--) + (zFn[t] = i), (i *= 0.5); + for (e = 1, n = 24; n >= 0; n--) (GFn[n] = e), (e *= 0.5); + } + function Yan(n) { + var t, e; + if (ny(hL(jln(n, (gjn(), I1n))))) + for (e = new $K(bA(lbn(n).a.Kc(), new h())); Vfn(e); ) if (Whn((t = Yx(kV(e), 79))) && ny(hL(jln(t, C1n)))) return !0; + return !1; + } + function Jan(n, t) { + var e, i, r; + __(n.f, t) && + ((t.b = n), + (i = t.c), + -1 != hJ(n.j, i, 0) || eD(n.j, i), + (r = t.d), + -1 != hJ(n.j, r, 0) || eD(n.j, r), + 0 != (e = t.a.b).c.length && + (!n.i && (n.i = new Wtn(n)), + (function (n, t) { + var e, i; + for (i = new pb(t); i.a < i.c.c.length; ) (e = Yx(Hz(i), 70)), eD(n.d, e), Vun(n, e); + })(n.i, e))); + } + function Zan(n) { + var t, e, i, r; + return (e = (t = n.c.d).j) == (r = (i = n.d.d).j) + ? t.p < i.p + ? 0 + : 1 + : A9(e) == r + ? 0 + : C9(e) == r + ? 1 + : KA(n.b.b, A9(e)) + ? 0 + : 1; + } + function nun() { + (nun = O), + (d2n = new tS(RAn, 0)), + (b2n = new tS("LONGEST_PATH", 1)), + (f2n = new tS("COFFMAN_GRAHAM", 2)), + (l2n = new tS(eCn, 3)), + (g2n = new tS("STRETCH_WIDTH", 4)), + (w2n = new tS("MIN_WIDTH", 5)); + } + function tun(n) { + var t; + (this.d = new rp()), + (this.c = n.c), + (this.e = n.d), + (this.b = n.b), + (this.f = new HR(n.e)), + (this.a = n.a), + n.f ? (this.g = n.f) : (this.g = new cx((t = Yx(Ak(kct), 9)), Yx(eN(t, t.length), 9), 0)); + } + function eun(n, t) { + var e, i, r, c; + !(r = uX((i = n), "layoutOptions")) && (r = uX(i, FNn)), + r && ((e = null), (c = r) && (e = new nE(c, l2(c, VQ(fFn, TEn, 2, 0, 6, 1)))), e && XW(e, new CP(c, t))); + } + function iun(n) { + if (CO(n, 239)) return Yx(n, 33); + if (CO(n, 186)) return TG(Yx(n, 118)); + throw hp(n ? new sy("Only support nodes and ports.") : new Zm(pxn)); + } + function run(n, t, e) { + if (n.b) throw hp(new Ym("The task is already done.")); + return null == n.p && ((n.p = t), (n.r = e), n.k && (n.o = (oE(), e7(D3(Date.now()), hTn))), !0); + } + function cun(n) { + var t; + return ( + (t = new Om()), + null != n.tg() && ND(t, rxn, n.tg()), + null != n.ne() && ND(t, gxn, n.ne()), + null != n.sg() && ND(t, "description", n.sg()), + t + ); + } + function aun(n, t, e) { + var i, r, c; + return ( + (c = n.q), + (n.q = t), + 0 != (4 & n.Db) && 0 == (1 & n.Db) && ((r = new p_(n, 1, 9, c, t)), e ? e.Ei(r) : (e = r)), + t ? (i = t.c) != n.r && (e = n.nk(i, e)) : n.r && (e = n.nk(null, e)), + e + ); + } + function uun(n, t) { + var e, i, r, c; + for (c = new ip(), r = 0, i = t.Kc(); i.Ob(); ) { + for (e = d9(Yx(i.Pb(), 19).a + r); e.a < n.f && !NR(n, e.a); ) (e = d9(e.a + 1)), ++r; + if (e.a >= n.f) break; + c.c[c.c.length] = e; + } + return c; + } + function oun(n) { + var t, e, i, r; + for (t = null, r = new pb(n.wf()); r.a < r.c.c.length; ) + (e = new mH((i = Yx(Hz(r), 181)).qf().a, i.qf().b, i.rf().a, i.rf().b)), t ? bsn(t, e) : (t = e); + return !t && (t = new hC()), t; + } + function sun(n, t, e, i) { + return 1 == e + ? (!n.n && (n.n = new m_(act, n, 1, 7)), wnn(n.n, t, i)) + : Yx(CZ(Yx(H3(n, 16), 26) || n.zh(), e), 66) + .Nj() + .Qj(n, dtn(n), e - vF(n.zh()), t, i); + } + function hun(n, t, e) { + var i, r, c, a, u; + for (i = e.gc(), n.qi(n.i + i), (u = n.i - t) > 0 && smn(n.g, t, n.g, t + i, u), a = e.Kc(), n.i += i, r = 0; r < i; ++r) + (c = a.Pb()), _O(n, t, n.oi(t, c)), n.bi(t, c), n.ci(), ++t; + return 0 != i; + } + function fun(n, t, e) { + var i; + return ( + t != n.q + ? (n.q && (e = Uq(n.q, n, -10, e)), t && (e = men(t, n, -10, e)), (e = aun(n, t, e))) + : 0 != (4 & n.Db) && 0 == (1 & n.Db) && ((i = new p_(n, 1, 9, t, t)), e ? e.Ei(i) : (e = i)), + e + ); + } + function lun(n, t, e, i) { + return ( + vx(0 == (e & MEn), "flatMap does not support SUBSIZED characteristic"), + vx(0 == (4 & e), "flatMap does not support SORTED characteristic"), + MF(n), + MF(t), + new bX(n, e, i, t) + ); + } + function bun(n, t) { + B_(t, "Cannot suppress a null exception."), + jD(t != n, "Exception can not suppress itself."), + n.i || (null == n.k ? (n.k = x4(Gy(b_n, 1), TEn, 78, 0, [t])) : (n.k[n.k.length] = t)); + } + function wun(n, t, e, i) { + var r, c, a, u, o, s; + for (a = e.length, c = 0, r = -1, s = $Z(n.substr(t), (bx(), KFn)), u = 0; u < a; ++u) + (o = e[u].length) > c && S_(s, $Z(e[u], KFn)) && ((r = u), (c = o)); + return r >= 0 && (i[0] = t + c), r; + } + function dun(n, t, e) { + run(e, "Grow Tree", 1), + (n.b = t.f), + ny(hL(Aun(t, (y3(), hqn)))) ? ((n.c = new it()), mz(n, null)) : (n.c = new it()), + (n.a = !1), + iwn(n, t.f), + b5(t, fqn, (TA(), !!n.a)), + Ron(e); + } + function gun(n) { + var t, e; + return n >= eMn + ? ((t = (iMn + (((n - eMn) >> 10) & 1023)) & fTn), + (e = (56320 + ((n - eMn) & 1023)) & fTn), + String.fromCharCode(t) + "" + String.fromCharCode(e)) + : String.fromCharCode(n & fTn); + } + function pun(n, t, e, i, r) { + var c, a, u; + for (c = Vwn(n, t, e, i, r), u = !1; !c; ) Nln(n, r, !0), (u = !0), (c = Vwn(n, t, e, i, r)); + u && Nln(n, r, !1), 0 != (a = G4(r)).c.length && (n.d && n.d.lg(a), pun(n, r, e, i, a)); + } + function vun() { + (vun = O), + (ket = new eP(fIn, 0)), + (met = new eP("DIRECTED", 1)), + (jet = new eP("UNDIRECTED", 2)), + (pet = new eP("ASSOCIATION", 3)), + (yet = new eP("GENERALIZATION", 4)), + (vet = new eP("DEPENDENCY", 5)); + } + function mun(n, t) { + var e, i; + for (vB(t), i = n.b.c.length, eD(n.b, t); i > 0; ) { + if (((e = i), (i = ((i - 1) / 2) | 0), n.a.ue(TR(n.b, i), t) <= 0)) return QW(n.b, e, t), !0; + QW(n.b, e, TR(n.b, i)); + } + return QW(n.b, i, t), !0; + } + function yun(n, t, i, r) { + var c, a; + if (((c = 0), i)) c = Y6(n.a[i.g][t.g], r); + else for (a = 0; a < wHn; a++) c = e.Math.max(c, Y6(n.a[a][t.g], r)); + return t == (JZ(), cHn) && n.b && (c = e.Math.max(c, n.b.a)), c; + } + function kun(n, t) { + var e, i, r, c, a; + return ( + (i = n.i), + (r = t.i), + !(!i || !r) && + i.i == r.i && + i.i != (Ikn(), Eit) && + i.i != (Ikn(), qit) && + ((e = (c = i.g.a) + i.j.a), c <= (a = r.g.a) + r.j.a && e >= a) + ); + } + function jun(n, t, e, i) { + var r; + if ( + ((r = !1), + aI(i) && ((r = !0), ND(t, e, lL(i))), + r || (rI(i) && ((r = !0), jun(n, t, e, i))), + r || (CO(i, 236) && ((r = !0), nq(t, e, Yx(i, 236)))), + !r) + ) + throw hp(new Gm(ixn)); + } + function Eun(n, t) { + var e, i, r, c; + if ((vB(t), (c = n.a.gc()) < t.gc())) for (e = n.a.ec().Kc(); e.Ob(); ) (i = e.Pb()), t.Hc(i) && e.Qb(); + else for (r = t.Kc(); r.Ob(); ) (i = r.Pb()), n.a.Bc(i); + return c != n.a.gc(); + } + function Tun(n) { + var t, e; + switch (((e = dO($5(x4(Gy(B7n, 1), TEn, 8, 0, [n.i.n, n.n, n.a])))), (t = n.i.d), n.j.g)) { + case 1: + e.b -= t.d; + break; + case 2: + e.a += t.c; + break; + case 3: + e.b += t.a; + break; + case 4: + e.a -= t.b; + } + return e; + } + function Mun(n) { + var t; + for (m2(), t = Yx(kV(new $K(bA(u7(n).a.Kc(), new h()))), 17).c.i; t.k == (bon(), Bzn); ) + b5(t, (Ojn(), jQn), (TA(), !0)), (t = Yx(kV(new $K(bA(u7(t).a.Kc(), new h()))), 17).c.i); + } + function Sun(n, t, e, i) { + var r, c, a; + for (a = V8(t, i).Kc(); a.Ob(); ) (r = Yx(a.Pb(), 11)), (n.d[r.p] = n.d[r.p] + n.c[e.p]); + for (c = V8(e, i).Kc(); c.Ob(); ) (r = Yx(c.Pb(), 11)), (n.d[r.p] = n.d[r.p] - n.c[t.p]); + } + function Pun(n, t, e) { + var i, r; + for (r = new UO((!n.a && (n.a = new m_(uct, n, 10, 11)), n.a)); r.e != r.i.gc(); ) jC((i = Yx(hen(r), 33)), i.i + t, i.j + e); + XW((!n.b && (n.b = new m_(nct, n, 12, 3)), n.b), new gP(t, e)); + } + function Iun(n, t) { + CO(aG((mT(), aat), n), 498) ? GG(aat, n, new GP(this, t)) : GG(aat, n, this), + lon(this, t), + t == (Rk(), dat) ? ((this.wb = Yx(this, 1939)), Yx(t, 1941)) : (this.wb = (YF(), gat)); + } + function Cun() { + (Cun = O), + (AFn = x4(Gy(fFn, 1), TEn, 2, 6, ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"])), + ($Fn = x4(Gy(fFn, 1), TEn, 2, 6, ["Jan", "Feb", "Mar", "Apr", gTn, "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"])); + } + function Oun(n) { + var t, e; + (t = _N(typeof t, AMn) ? null : new ln()) && + (_E(), tB((e = 900 >= hTn ? "error" : "warn"), n.a), n.b && Jbn(t, e, n.b, "Exception: ", !0)); + } + function Aun(n, t) { + var e, i; + return ( + !n.q && (n.q = new rp()), + null != (i = BF(n.q, t)) + ? i + : (CO((e = t.wg()), 4) && (null == e ? (!n.q && (n.q = new rp()), zV(n.q, t)) : (!n.q && (n.q = new rp()), xB(n.q, t, e))), e) + ); + } + function $un() { + ($un = O), + (YGn = new bM("P1_CYCLE_BREAKING", 0)), + (JGn = new bM("P2_LAYERING", 1)), + (ZGn = new bM("P3_NODE_ORDERING", 2)), + (nzn = new bM("P4_NODE_PLACEMENT", 3)), + (tzn = new bM("P5_EDGE_ROUTING", 4)); + } + function Lun(n, t) { + var e, i, r, c; + for (i = (1 == t ? ozn : uzn).a.ec().Kc(); i.Ob(); ) + for (e = Yx(i.Pb(), 103), c = Yx(_V(n.f.c, e), 21).Kc(); c.Ob(); ) + (r = Yx(c.Pb(), 46)), uJ(n.b.b, r.b), uJ(n.b.a, Yx(r.b, 81).d); + } + function Nun(n, t) { + var e; + if ((oZ(), n.c == t.c)) { + if ( + n.b == t.b || + (function (n, t) { + return _4(), (n == bzn && t == gzn) || (n == gzn && t == bzn) || (n == dzn && t == wzn) || (n == wzn && t == dzn); + })(n.b, t.b) + ) { + if ( + ((e = (function (n) { + return n == bzn || n == gzn; + })(n.b) + ? 1 + : -1), + n.a && !t.a) + ) + return e; + if (!n.a && t.a) return -e; + } + return eO(n.b.g, t.b.g); + } + return $9(n.c, t.c); + } + function xun(n, t) { + var e, i; + if (zun(n, t)) return !0; + for (i = new pb(t); i.a < i.c.c.length; ) { + if (jdn(n, (e = Yx(Hz(i), 33)), han(e))) return !0; + if (o8(n, e) - n.g <= n.a) return !0; + } + return !1; + } + function Dun() { + (Dun = O), + Hdn(), + (x9n = Y9n), + ($9n = X9n), + (A9n = z9n), + (C9n = B9n), + (O9n = q9n), + (I9n = new RC(8)), + (P9n = new DC((Cjn(), utt), I9n)), + (L9n = new DC(Xtt, 8)), + (N9n = V9n), + (T9n = D9n), + (M9n = K9n), + (S9n = new DC(Snt, (TA(), !1))); + } + function Run() { + (Run = O), + (cnt = new RC(15)), + (rnt = new DC((Cjn(), utt), cnt)), + (unt = new DC(Xtt, 15)), + (ant = new DC(Att, d9(0))), + (Z7n = Dnt), + (tnt = Jnt), + (int = itt), + (Q7n = new DC(mnt, SLn)), + (nnt = Hnt), + (ent = ttt), + (Y7n = knt), + (J7n = Tnt); + } + function Kun(n) { + if (1 != (!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b).i || 1 != (!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c).i) + throw hp(new Qm(mxn)); + return iun(Yx(c1((!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b), 0), 82)); + } + function _un(n) { + if (1 != (!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b).i || 1 != (!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c).i) + throw hp(new Qm(mxn)); + return E4(Yx(c1((!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b), 0), 82)); + } + function Fun(n) { + if (1 != (!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b).i || 1 != (!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c).i) + throw hp(new Qm(mxn)); + return E4(Yx(c1((!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c), 0), 82)); + } + function Bun(n) { + if (1 != (!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b).i || 1 != (!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c).i) + throw hp(new Qm(mxn)); + return iun(Yx(c1((!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c), 0), 82)); + } + function Hun(n, t, e) { + var i, r, c; + if ((++n.j, t >= (r = n.Vi()) || t < 0)) throw hp(new Hm(jxn + t + Exn + r)); + if (e >= r || e < 0) throw hp(new Hm(Txn + e + Exn + r)); + return t != e ? ((c = n.Ti(e)), n.Hi(t, c), (i = c)) : (i = n.Oi(e)), i; + } + function qun(n) { + var t, e, i; + if (((i = n), n)) + for (t = 0, e = n.Ug(); e; e = e.Ug()) { + if (++t > cMn) return qun(e); + if (((i = e), e == n)) throw hp(new Ym("There is a cycle in the containment hierarchy of " + n)); + } + return i; + } + function Gun(n) { + var t, e, i; + for (i = new J3(tEn, "[", "]"), e = n.Kc(); e.Ob(); ) + HV(i, iI((t = e.Pb())) === iI(n) ? "(this Collection)" : null == t ? aEn : I7(t)); + return i.a ? (0 == i.e.length ? i.a.a : i.a.a + "" + i.e) : i.c; + } + function zun(n, t) { + var e, i; + if (((i = !1), t.gc() < 2)) return !1; + for (e = 0; e < t.gc(); e++) + e < t.gc() - 1 ? (i |= jdn(n, Yx(t.Xb(e), 33), Yx(t.Xb(e + 1), 33))) : (i |= jdn(n, Yx(t.Xb(e), 33), Yx(t.Xb(0), 33))); + return i; + } + function Uun(n, t) { + var e; + t != n.a + ? ((e = null), n.a && (e = Yx(n.a, 49).ih(n, 4, cct, e)), t && (e = Yx(t, 49).gh(n, 4, cct, e)), (e = T8(n, t, e)) && e.Fi()) + : 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 1, t, t)); + } + function Xun(n, t) { + var e; + t != n.e + ? (n.e && hQ(EB(n.e), n), + t && (!t.b && (t.b = new Xg(new Wv())), kN(t.b, n)), + (e = (function (n, t, e) { + var i, r; + return ( + (r = n.e), + (n.e = t), + 0 != (4 & n.Db) && 0 == (1 & n.Db) && ((i = new p_(n, 1, 4, r, t)), e ? e.Ei(i) : (e = i)), + r != t && (e = zyn(n, t ? dbn(n, t) : n.a, e)), + e + ); + })(n, t, null)) && e.Fi()) + : 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 4, t, t)); + } + function Wun(n) { + var t, e, i; + for (e = n.length, i = 0; i < e && (Lz(i, n.length), n.charCodeAt(i) <= 32); ) ++i; + for (t = e; t > i && (Lz(t - 1, n.length), n.charCodeAt(t - 1) <= 32); ) --t; + return i > 0 || t < e ? n.substr(i, t - i) : n; + } + function Vun(n, t) { + var i; + (i = t.o), + lC(n.f) + ? ((n.j.a = e.Math.max(n.j.a, i.a)), (n.j.b += i.b), n.d.c.length > 1 && (n.j.b += n.e)) + : ((n.j.a += i.a), (n.j.b = e.Math.max(n.j.b, i.b)), n.d.c.length > 1 && (n.j.a += n.e)); + } + function Qun() { + (Qun = O), + (UXn = x4(Gy(trt, 1), lIn, 61, 0, [(Ikn(), Tit), Eit, Bit])), + (zXn = x4(Gy(trt, 1), lIn, 61, 0, [Eit, Bit, qit])), + (XXn = x4(Gy(trt, 1), lIn, 61, 0, [Bit, qit, Tit])), + (WXn = x4(Gy(trt, 1), lIn, 61, 0, [qit, Tit, Eit])); + } + function Yun(n, t, e, i) { + var r, c, a, u, o; + if (((c = n.c.d), (a = n.d.d), c.j != a.j)) + for (o = n.b, r = c.j, u = null; r != a.j; ) + (u = 0 == t ? A9(r) : C9(r)), KD(i, mN(Ktn(r, o.d[r.g], e), Ktn(u, o.d[u.g], e))), (r = u); + } + function Jun(n, t, e, i) { + var r, c, a, u, o; + return ( + (u = Yx((a = Drn(n.a, t, e)).a, 19).a), + (c = Yx(a.b, 19).a), + i && ((o = Yx(Aun(t, (Ojn(), RQn)), 10)), (r = Yx(Aun(e, RQn), 10)), o && r && (YX(n.b, o, r), (u += n.b.i), (c += n.b.e))), + u > c + ); + } + function Zun(n) { + var t, e, i, r, c, a, u, o; + for (this.a = xen(n), this.b = new ip(), i = 0, r = (e = n).length; i < r; ++i) + for (t = e[i], c = new ip(), eD(this.b, c), u = 0, o = (a = t).length; u < o; ++u) eD(c, new sx(a[u].j)); + } + function non(n, t, i) { + var r, c, a; + return ( + (a = 0), + (r = i[t]), + t < i.length - 1 && + ((c = i[t + 1]), + n.b[t] + ? ((a = (function (n, t, i) { + var r, + c, + a, + u, + o, + s, + h, + f, + l, + b, + w, + d, + g, + p, + v, + m, + y, + k, + j, + E, + T, + M, + S, + P, + I, + C, + O, + A, + $, + L, + N, + x, + D, + R, + K, + _, + F, + B, + H, + q, + G, + z, + U, + X, + W, + V, + Q, + Y, + J, + Z, + nn, + tn, + en, + rn, + cn, + an, + un, + on; + for (J = 0, L = 0, D = (O = t).length; L < D; ++L) + for (G = new pb((I = O[L]).j); G.a < G.c.c.length; ) { + for (U = 0, o = new pb((q = Yx(Hz(G), 11)).g); o.a < o.c.c.length; ) (u = Yx(Hz(o), 17)), I.c != u.d.i.c && ++U; + U > 0 && (n.a[q.p] = J++); + } + for (rn = 0, N = 0, R = (A = i).length; N < R; ++N) { + for (K = 0, G = new pb((I = A[N]).j); G.a < G.c.c.length && (q = Yx(Hz(G), 11)).j == (Ikn(), Tit); ) + for (o = new pb(q.e); o.a < o.c.c.length; ) + if (((u = Yx(Hz(o), 17)), I.c != u.c.i.c)) { + ++K; + break; + } + for (F = 0, X = new JU(I.j, I.j.c.length); X.b > 0; ) { + for (S$(X.b > 0), U = 0, o = new pb((q = Yx(X.a.Xb((X.c = --X.b)), 11)).e); o.a < o.c.c.length; ) + (u = Yx(Hz(o), 17)), I.c != u.c.i.c && ++U; + U > 0 && (q.j == (Ikn(), Tit) ? ((n.a[q.p] = rn), ++rn) : ((n.a[q.p] = rn + K + F), ++F)); + } + rn += F; + } + for (z = new rp(), d = new oC(), $ = 0, x = (C = t).length; $ < x; ++$) + for (tn = new pb((I = C[$]).j); tn.a < tn.c.c.length; ) + for (o = new pb((nn = Yx(Hz(tn), 11)).g); o.a < o.c.c.length; ) + if (((an = (u = Yx(Hz(o), 17)).d), I.c != an.i.c)) + if (((Z = Yx(eI(Dq(z.f, nn)), 467)), (cn = Yx(eI(Dq(z.f, an)), 467)), Z || cn)) + if (Z) + if (cn) + if (Z == cn) eD(Z.a, u); + else { + for (eD(Z.a, u), H = new pb(cn.d); H.a < H.c.c.length; ) (B = Yx(Hz(H), 11)), Ysn(z.f, B, Z); + S4(Z.a, cn.a), S4(Z.d, cn.d), d.a.Bc(cn); + } + else eD(Z.a, u), eD(Z.d, an), Ysn(z.f, an, Z); + else eD(cn.a, u), eD(cn.d, nn), Ysn(z.f, nn, cn); + else (w = new fN()), d.a.zc(w, d), eD(w.a, u), eD(w.d, nn), Ysn(z.f, nn, w), eD(w.d, an), Ysn(z.f, an, w); + for ( + g = Yx(_in(d, VQ(n4n, { 3: 1, 4: 1, 5: 1, 1946: 1 }, 467, d.a.gc(), 0, 1)), 1946), + P = t[0].c, + Y = i[0].c, + l = 0, + b = (f = g).length; + l < b; + ++l + ) + for ((h = f[l]).e = J, h.f = rn, G = new pb(h.d); G.a < G.c.c.length; ) + (q = Yx(Hz(G), 11)), + (W = n.a[q.p]), + q.i.c == P + ? (W < h.e && (h.e = W), W > h.b && (h.b = W)) + : q.i.c == Y && (W < h.f && (h.f = W), W > h.c && (h.c = W)); + for ( + DY(g, 0, g.length, null), en = VQ(Wot, MTn, 25, g.length, 15, 1), r = VQ(Wot, MTn, 25, rn + 1, 15, 1), v = 0; + v < g.length; + v++ + ) + (en[v] = g[v].f), (r[en[v]] = 1); + for (a = 0, m = 0; m < r.length; m++) 1 == r[m] ? (r[m] = a) : --a; + for (V = 0, y = 0; y < en.length; y++) (en[y] += r[en[y]]), (V = e.Math.max(V, en[y] + 1)); + for (s = 1; s < V; ) s *= 2; + for (on = 2 * s - 1, s -= 1, un = VQ(Wot, MTn, 25, on, 15, 1), c = 0, M = 0; M < en.length; M++) + for (++un[(T = en[M] + s)]; T > 0; ) T % 2 > 0 && (c += un[T + 1]), ++un[(T = ((T - 1) / 2) | 0)]; + for (S = VQ(i4n, iEn, 362, 2 * g.length, 0, 1), k = 0; k < g.length; k++) + (S[2 * k] = new gH(g[k], g[k].e, g[k].b, (GW(), e4n))), (S[2 * k + 1] = new gH(g[k], g[k].b, g[k].e, t4n)); + for (DY(S, 0, S.length, null), _ = 0, j = 0; j < S.length; j++) + switch (S[j].d.g) { + case 0: + ++_; + break; + case 1: + c += --_; + } + for (Q = VQ(i4n, iEn, 362, 2 * g.length, 0, 1), E = 0; E < g.length; E++) + (Q[2 * E] = new gH(g[E], g[E].f, g[E].c, (GW(), e4n))), (Q[2 * E + 1] = new gH(g[E], g[E].c, g[E].f, t4n)); + for (DY(Q, 0, Q.length, null), _ = 0, p = 0; p < Q.length; p++) + switch (Q[p].d.g) { + case 0: + ++_; + break; + case 1: + c += --_; + } + return c; + })(n.d, r, c)), + (a += ZF(n.a, r, (Ikn(), Eit))), + (a += ZF(n.a, c, qit))) + : (a = (function (n, t, e) { + var i; + return (i = x5(n, t, e)), (n.b = new s2(i.c.length)), Zwn(n, i); + })(n.a, r, c))), + n.c[t] && (a += aQ(n.a, r)), + a + ); + } + function ton(n, t, e, i, r) { + var c, a, u, o; + for (o = null, u = new pb(i); u.a < u.c.c.length; ) + if ((a = Yx(Hz(u), 441)) != e && -1 != hJ(a.e, r, 0)) { + o = a; + break; + } + YG((c = EV(r)), e.b), QG(c, o.b), Qhn(n.a, r, new jx(c, t, e.f)); + } + function eon(n) { + for (; 0 != n.g.c && 0 != n.d.c; ) + TL(n.g).c > TL(n.d).c + ? ((n.i += n.g.c), Cnn(n.d)) + : TL(n.d).c > TL(n.g).c + ? ((n.e += n.d.c), Cnn(n.g)) + : ((n.i += IR(n.g)), (n.e += IR(n.d)), Cnn(n.g), Cnn(n.d)); + } + function ion(n, t, i, r) { + (n.a.d = e.Math.min(t, i)), + (n.a.a = e.Math.max(t, r) - n.a.d), + t < i + ? ((n.b = 0.5 * (t + i)), (n.g = ZAn * n.b + 0.9 * t), (n.f = ZAn * n.b + 0.9 * i)) + : ((n.b = 0.5 * (t + r)), (n.g = ZAn * n.b + 0.9 * r), (n.f = ZAn * n.b + 0.9 * t)); + } + function ron(n, t) { + var e, i; + (i = Yx(Aun(t, (gjn(), g0n)), 98)), + b5(t, (Ojn(), NQn), i), + (e = t.e) && (SE(new SR(null, new Nz(e.a, 16)), new aw(n)), SE(WJ(new SR(null, new Nz(e.b, 16)), new mt()), new uw(n))); + } + function con(n) { + var t, i, r, c; + if (bC(Yx(Aun(n.b, (gjn(), a1n)), 103))) return 0; + for (t = 0, r = new pb(n.a); r.a < r.c.c.length; ) (i = Yx(Hz(r), 10)).k == (bon(), Hzn) && ((c = i.o.a), (t = e.Math.max(t, c))); + return t; + } + function aon(n) { + switch (Yx(Aun(n, (gjn(), x1n)), 163).g) { + case 1: + b5(n, x1n, (d7(), tYn)); + break; + case 2: + b5(n, x1n, (d7(), eYn)); + break; + case 3: + b5(n, x1n, (d7(), ZQn)); + break; + case 4: + b5(n, x1n, (d7(), nYn)); + } + } + function uon() { + (uon = O), + (mVn = new QM(fIn, 0)), + (gVn = new QM(ySn, 1)), + (yVn = new QM(kSn, 2)), + (vVn = new QM("LEFT_RIGHT_CONSTRAINT_LOCKING", 3)), + (pVn = new QM("LEFT_RIGHT_CONNECTION_LOCKING", 4)), + (dVn = new QM(rCn, 5)); + } + function oon(n, t, i) { + var r, c, a, u, o, s, h; + (o = i.a / 2), + (a = i.b / 2), + (s = 1), + (h = 1), + (r = e.Math.abs(t.a - n.a)) > o && (s = o / r), + (c = e.Math.abs(t.b - n.b)) > a && (h = a / c), + (u = e.Math.min(s, h)), + (n.a += u * (t.a - n.a)), + (n.b += u * (t.b - n.b)); + } + function son(n, t, e, i, r) { + var c, a; + for (a = !1, c = Yx(TR(e.b, 0), 33); Svn(n, t, c, i, r) && ((a = !0), oan(e, c), 0 != e.b.c.length); ) c = Yx(TR(e.b, 0), 33); + return 0 == e.b.c.length && acn(e.j, e), a && ern(t.q), a; + } + function hon(n, t) { + var e, i, r, c; + if ((udn(), t.b < 2)) return !1; + for (i = e = Yx(IX((c = Ztn(t, 0))), 8); c.b != c.d.c; ) { + if (Rbn(n, i, (r = Yx(IX(c), 8)))) return !0; + i = r; + } + return !!Rbn(n, i, e); + } + function fon(n, t, e, i) { + return 0 == e + ? (!n.o && (n.o = new yY((ajn(), Frt), mct, n, 0)), YN(n.o, t, i)) + : Yx(CZ(Yx(H3(n, 16), 26) || n.zh(), e), 66) + .Nj() + .Rj(n, dtn(n), e - vF(n.zh()), t, i); + } + function lon(n, t) { + var e; + t != n.sb + ? ((e = null), n.sb && (e = Yx(n.sb, 49).ih(n, 1, ict, e)), t && (e = Yx(t, 49).gh(n, 1, ict, e)), (e = H8(n, t, e)) && e.Fi()) + : 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 4, t, t)); + } + function bon() { + (bon = O), + (Hzn = new gM("NORMAL", 0)), + (Bzn = new gM("LONG_EDGE", 1)), + (_zn = new gM("EXTERNAL_PORT", 2)), + (qzn = new gM("NORTH_SOUTH_PORT", 3)), + (Fzn = new gM("LABEL", 4)), + (Kzn = new gM("BREAKING_POINT", 5)); + } + function won(n, t, e) { + var i; + run(e, "Self-Loop routing", 1), + (i = (function (n) { + switch (Yx(Aun(n, (gjn(), b1n)), 218).g) { + case 1: + return new ic(); + case 3: + return new oc(); + default: + return new ec(); + } + })(t)), + dI(Aun(t, (tQ(), K7n))), + SE(fH(hH(hH(WJ(new SR(null, new Nz(t.b, 16)), new zi()), new Ui()), new Xi()), new Wi()), new yM(n, i)), + Ron(e); + } + function don(n, t) { + var e, i, r; + return ( + (t &= 63) < 22 + ? ((e = n.l << t), (i = (n.m << t) | (n.l >> (22 - t))), (r = (n.h << t) | (n.m >> (22 - t)))) + : t < 44 + ? ((e = 0), (i = n.l << (t - 22)), (r = (n.m << (t - 22)) | (n.l >> (44 - t)))) + : ((e = 0), (i = 0), (r = n.l << (t - 44))), + rO(e & BTn, i & BTn, r & HTn) + ); + } + function gon(n) { + if ( + (null == x_n && (x_n = new RegExp("^\\s*[+-]?(NaN|Infinity|((\\d+\\.?\\d*)|(\\.\\d+))([eE][+-]?\\d+)?[dDfF]?)\\s*$")), + !x_n.test(n)) + ) + throw hp(new Iy(YTn + n + '"')); + return parseFloat(n); + } + function pon() { + (pon = O), + (QWn = new XM("ALWAYS_UP", 0)), + (VWn = new XM("ALWAYS_DOWN", 1)), + (JWn = new XM("DIRECTION_UP", 2)), + (YWn = new XM("DIRECTION_DOWN", 3)), + (nVn = new XM("SMART_UP", 4)), + (ZWn = new XM("SMART_DOWN", 5)); + } + function von(n, t) { + if (n < 0 || t < 0) throw hp(new Qm("k and n must be positive")); + if (t > n) throw hp(new Qm("k must be smaller than n")); + return 0 == t || t == n ? 1 : 0 == n ? 0 : _cn(n) / (_cn(t) * _cn(n - t)); + } + function mon(n, t) { + var e, i, r, c; + for (e = new SC(n); null != e.g || e.c ? null == e.g || (0 != e.i && Yx(e.g[e.i - 1], 47).Ob()) : AG(e); ) + if (CO((c = Yx(abn(e), 56)), 160)) for (i = Yx(c, 160), r = 0; r < t.length; r++) t[r].og(i); + } + function yon(n) { + var t; + return 0 != (64 & n.Db) + ? V9(n) + : (((t = new MA(V9(n))).a += " (height: "), + Jk(t, n.f), + (t.a += ", width: "), + Jk(t, n.g), + (t.a += ", x: "), + Jk(t, n.i), + (t.a += ", y: "), + Jk(t, n.j), + (t.a += ")"), + t.a); + } + function kon(n) { + var t, e, i, r, c, a; + for (t = new bW(), r = 0, c = (i = n).length; r < c; ++r) + if (null != Gtn(t, (a = MF((e = i[r]).cd())), MF(e.dd()))) throw hp(new Qm("duplicate key: " + a)); + this.b = (XH(), new gb(t)); + } + function jon(n) { + var t, e, i, r, c; + if (null == n) return aEn; + for (c = new J3(tEn, "[", "]"), i = 0, r = (e = n).length; i < r; ++i) (t = e[i]), HV(c, String.fromCharCode(t)); + return c.a ? (0 == c.e.length ? c.a.a : c.a.a + "" + c.e) : c.c; + } + function Eon() { + (Eon = O), + hZ(), + (qqn = new FI(EPn, (Gqn = Yqn))), + d9(1), + (Hqn = new FI(TPn, d9(300))), + d9(0), + (Xqn = new FI(MPn, d9(0))), + new tp(), + (Wqn = new FI(SPn, PPn)), + new tp(), + (zqn = new FI(IPn, 5)), + (Vqn = Yqn), + (Uqn = Qqn); + } + function Ton(n, t) { + var e, i, r, c; + for (i = (1 == t ? ozn : uzn).a.ec().Kc(); i.Ob(); ) + for (e = Yx(i.Pb(), 103), c = Yx(_V(n.f.c, e), 21).Kc(); c.Ob(); ) + (r = Yx(c.Pb(), 46)), eD(n.b.b, Yx(r.b, 81)), eD(n.b.a, Yx(r.b, 81).d); + } + function Mon(n, t, e) { + var i, r; + for (r = new JU(n.b, 0); r.b < r.d.gc(); ) + S$(r.b < r.d.gc()), + iI(Aun((i = Yx(r.d.Xb((r.c = r.b++)), 70)), (Ojn(), $Qn))) === iI(t) && (dsn(i.n, dB(n.c.i), e), hB(r), eD(t.b, i)); + } + function Son(n, t) { + if (t.a) + switch (Yx(Aun(t.b, (Ojn(), NQn)), 98).g) { + case 0: + case 1: + ban(t); + case 2: + SE(new SR(null, new Nz(t.d, 16)), new Li()), + (function (n, t) { + var e; + (function (n) { + var t, e, i, r, c, a, u, o; + for ( + n.b = new lfn( + new ay((Ikn(), x4(Gy(trt, 1), lIn, 61, 0, [Hit, Tit, Eit, Bit, qit]))), + new ay((v2(), x4(Gy(oWn, 1), XEn, 361, 0, [YXn, QXn, VXn]))), + ), + u = 0, + o = (a = x4(Gy(trt, 1), lIn, 61, 0, [Hit, Tit, Eit, Bit, qit])).length; + u < o; + ++u + ) + for (c = a[u], i = 0, r = (e = x4(Gy(oWn, 1), XEn, 361, 0, [YXn, QXn, VXn])).length; i < r; ++i) + (t = e[i]), Zcn(n.b, c, t, new ip()); + })(n), + (n.a = ((e = new gy()), SE(new SR(null, new Nz(t.d, 16)), new Zw(e)), e)), + (function (n, t) { + var e, i, r, c, a; + for (r = Yx(_V(n.a, (Tan(), _Xn)), 15).Kc(); r.Ob(); ) + switch (((i = Yx(r.Pb(), 101)), (e = Yx(TR(i.j, 0), 113).d.j), JC((c = new sx(i.j)), new Jr()), t.g)) { + case 1: + Man(n, c, e, (v2(), QXn), 1); + break; + case 0: + Man(n, new Oz(c, 0, (a = Ebn(c))), e, (v2(), QXn), 0), Man(n, new Oz(c, a, c.c.length), e, QXn, 1); + } + })(n, Yx(Aun(t.b, (gjn(), p1n)), 376)), + (function (n) { + var t, e, i; + for (i = Yx(_V(n.a, (Tan(), BXn)), 15).Kc(); i.Ob(); ) + fF(n, (e = Yx(i.Pb(), 101)), (t = xrn(e))[0], (v2(), VXn), 0), fF(n, e, t[1], YXn, 1); + })(n), + (function (n) { + var t, e, i, r; + for (r = Yx(_V(n.a, (Tan(), FXn)), 15).Kc(); r.Ob(); ) + fF( + n, + (i = Yx(r.Pb(), 101)), + (e = (t = FK(i.k)).Hc((Ikn(), Tit)) + ? t.Hc(Eit) + ? t.Hc(Bit) + ? t.Hc(qit) + ? null + : UXn + : WXn + : XXn + : zXn)[0], + (v2(), VXn), + 0, + ), + fF(n, i, e[1], QXn, 1), + fF(n, i, e[2], YXn, 1); + })(n), + (function (n) { + var t, e, i; + for (i = Yx(_V(n.a, (Tan(), KXn)), 15).Kc(); i.Ob(); ) + for (t = FK((e = Yx(i.Pb(), 101)).k).Kc(); t.Ob(); ) fF(n, e, Yx(t.Pb(), 61), (v2(), QXn), 1); + })(n), + (function (n) { + var t, e, i; + for (i = Yx(_V(n.a, (Tan(), HXn)), 15).Kc(); i.Ob(); ) + fF(n, (e = Yx(i.Pb(), 101)), (t = xrn(e))[0], (v2(), VXn), 0), fF(n, e, t[1], YXn, 1); + })(n), + (function (n, t) { + var e, i, r, c; + (c = new sx((e = t.b).j)), + (r = 0), + ((i = e.j).c = VQ(UKn, iEn, 1, 0, 5, 1)), + hF(Yx(F3(n.b, (Ikn(), Tit), (v2(), YXn)), 15), e), + (r = orn(c, r, new xr(), i)), + hF(Yx(F3(n.b, Tit, QXn), 15), e), + (r = orn(c, r, new Nr(), i)), + hF(Yx(F3(n.b, Tit, VXn), 15), e), + hF(Yx(F3(n.b, Eit, YXn), 15), e), + hF(Yx(F3(n.b, Eit, QXn), 15), e), + (r = orn(c, r, new Dr(), i)), + hF(Yx(F3(n.b, Eit, VXn), 15), e), + hF(Yx(F3(n.b, Bit, YXn), 15), e), + (r = orn(c, r, new Rr(), i)), + hF(Yx(F3(n.b, Bit, QXn), 15), e), + (r = orn(c, r, new Kr(), i)), + hF(Yx(F3(n.b, Bit, VXn), 15), e), + hF(Yx(F3(n.b, qit, YXn), 15), e), + (r = orn(c, r, new Qr(), i)), + hF(Yx(F3(n.b, qit, QXn), 15), e), + hF(Yx(F3(n.b, qit, VXn), 15), e); + })(n, t), + SE( + WJ( + new SR( + null, + IU( + (function (n) { + return n.i || (n.i = new Jf(n)); + })(n.b).a, + ), + ), + new Wr(), + ), + new Vr(), + ), + (t.a = !1), + (n.a = null); + })(n.a, t); + } + else SE(new SR(null, new Nz(t.d, 16)), new Li()); + } + function Pon(n) { + var t, i; + return ( + (i = e.Math.sqrt( + (null == n.k && (n.k = D2(n, new Ec())), ty(n.k) / (n.b * (null == n.g && (n.g = x2(n, new jc())), ty(n.g)))), + )), + (t = WR(D3(e.Math.round(i)))), + e.Math.min(t, n.f) + ); + } + function Ion() { + Q2(), + oN.call(this), + (this.j = (Ikn(), Hit)), + (this.a = new Pk()), + new Tv(), + (this.f = (g0(2, UEn), new pQ(2))), + (this.e = (g0(4, UEn), new pQ(4))), + (this.g = (g0(4, UEn), new pQ(4))), + (this.b = new IM(this.e, this.g)); + } + function Con(n, t) { + var e; + return ( + !ny(hL(Aun(t, (Ojn(), HQn)))) && + ((e = t.c.i), (n != (d7(), ZQn) || e.k != (bon(), Fzn)) && Yx(Aun(e, (gjn(), x1n)), 163) != nYn) + ); + } + function Oon(n, t) { + var e; + return ( + !ny(hL(Aun(t, (Ojn(), HQn)))) && + ((e = t.d.i), (n != (d7(), tYn) || e.k != (bon(), Fzn)) && Yx(Aun(e, (gjn(), x1n)), 163) != eYn) + ); + } + function Aon() { + (Aon = O), + (p9n = new qS("CENTER_DISTANCE", 0)), + (v9n = new qS("CIRCLE_UNDERLAP", 1)), + (k9n = new qS("RECTANGLE_UNDERLAP", 2)), + (m9n = new qS("INVERTED_OVERLAP", 3)), + (y9n = new qS("MINIMUM_ROOT_DISTANCE", 4)); + } + function $on(n, t) { + switch (t.g) { + case 1: + return Qx(n.j, (Q2(), Vzn)); + case 2: + return Qx(n.j, (Q2(), Xzn)); + case 3: + return Qx(n.j, (Q2(), Yzn)); + case 4: + return Qx(n.j, (Q2(), Jzn)); + default: + return XH(), XH(), TFn; + } + } + function Lon(n, t) { + var e, i, r; + (e = (function (n, t) { + return t == (Ikn(), qit) ? n.c : n.d; + })(t, n.e)), + (i = Yx(BF(n.g.f, e), 19).a), + (r = n.a.c.length - 1), + 0 != n.a.c.length && Yx(TR(n.a, r), 287).c == i ? (++Yx(TR(n.a, r), 287).a, ++Yx(TR(n.a, r), 287).b) : eD(n.a, new R$(i)); + } + function Non(n, t, e) { + var i, r; + return 0 != + (i = (function (n, t, e) { + if (P_(n.a, t)) { + if (gE(Yx(BF(n.a, t), 53), e)) return 1; + } else xB(n.a, t, new Qp()); + if (P_(n.a, e)) { + if (gE(Yx(BF(n.a, e), 53), t)) return -1; + } else xB(n.a, e, new Qp()); + if (P_(n.b, t)) { + if (gE(Yx(BF(n.b, t), 53), e)) return -1; + } else xB(n.b, t, new Qp()); + if (P_(n.b, e)) { + if (gE(Yx(BF(n.b, e), 53), t)) return 1; + } else xB(n.b, e, new Qp()); + return 0; + })(n, t, e)) + ? i + : O$(t, (Ojn(), IQn)) && O$(e, IQn) + ? ((r = eO(Yx(Aun(t, IQn), 19).a, Yx(Aun(e, IQn), 19).a)) < 0 ? ygn(n, t, e) : r > 0 && ygn(n, e, t), r) + : (function (n, t, e) { + var i, r, c; + return ( + (i = n.c[t.c.p][t.p]), + (r = n.c[e.c.p][e.p]), + null != i.a && null != r.a + ? ((c = WK(i.a, r.a)) < 0 ? ygn(n, t, e) : c > 0 && ygn(n, e, t), c) + : null != i.a + ? (ygn(n, t, e), -1) + : null != r.a + ? (ygn(n, e, t), 1) + : 0 + ); + })(n, t, e); + } + function xon(n, t, e) { + var i, r, c, a; + if (0 != t.b) { + for (i = new ME(), a = Ztn(t, 0); a.b != a.d.c; ) + C2(i, q4((c = Yx(IX(a), 86)))), ((r = c.e).a = Yx(Aun(c, (ryn(), O5n)), 19).a), (r.b = Yx(Aun(c, A5n), 19).a); + xon(n, i, J2(e, (i.b / n.a) | 0)); + } + } + function Don(n, t) { + var e, i, r, c, a; + if (n.e <= t) return n.g; + if ( + (function (n, t, e) { + var i; + return (i = omn(n, t, !1)).b <= t && i.a <= e; + })(n, n.g, t) + ) + return n.g; + for (c = n.r, i = n.g, a = n.r, r = (c - i) / 2 + i; i + 1 < c; ) + (e = omn(n, r, !1)).b <= r && e.a <= t ? ((a = r), (c = r)) : (i = r), (r = (c - i) / 2 + i); + return a; + } + function Ron(n) { + var t; + if (null == n.p) throw hp(new Ym("The task has not begun yet.")); + n.b || (n.k && (oE(), (t = e7(D3(Date.now()), hTn)), (n.q = 1e-9 * VU(n7(t, n.o)))), n.c < n.r && q0(n, n.r - n.c), (n.b = !0)); + } + function Kon(n) { + var t, e, i; + for (KD((i = new Nv()), new QS(n.j, n.k)), e = new UO((!n.a && (n.a = new XO(Qrt, n, 5)), n.a)); e.e != e.i.gc(); ) + KD(i, new QS((t = Yx(hen(e), 469)).a, t.b)); + return KD(i, new QS(n.b, n.c)), i; + } + function _on(n, t) { + var e; + if (iI(n) === iI(t)) return !0; + if (CO(t, 21)) { + e = Yx(t, 21); + try { + return n.gc() == e.gc() && n.Ic(e); + } catch (n) { + if (CO((n = j4(n)), 173) || CO(n, 205)) return !1; + throw hp(n); + } + } + return !1; + } + function Fon(n, t) { + var i; + eD(n.d, t), + (i = t.rf()), + n.c + ? ((n.e.a = e.Math.max(n.e.a, i.a)), (n.e.b += i.b), n.d.c.length > 1 && (n.e.b += n.a)) + : ((n.e.a += i.a), (n.e.b = e.Math.max(n.e.b, i.b)), n.d.c.length > 1 && (n.e.a += n.a)); + } + function Bon(n) { + var t, e, i, r; + switch (((t = (r = n.i).b), (i = r.j), (e = r.g), r.a.g)) { + case 0: + e.a = (n.g.b.o.a - i.a) / 2; + break; + case 1: + e.a = t.d.n.a + t.d.a.a; + break; + case 2: + e.a = t.d.n.a + t.d.a.a - i.a; + break; + case 3: + e.b = t.d.n.b + t.d.a.b; + } + } + function Hon(n, t, e, i, r) { + if (i < t || r < e) throw hp(new Qm("The highx must be bigger then lowx and the highy must be bigger then lowy")); + return n.a < t ? (n.a = t) : n.a > i && (n.a = i), n.b < e ? (n.b = e) : n.b > r && (n.b = r), n; + } + function qon(n) { + if (CO(n, 149)) + return (function (n) { + var t, e, i, r, c; + return ( + (c = cun(n)), + null != n.a && ND(c, "category", n.a), + !Sj(new Yl(n.d)) && (OZ(c, "knownOptions", (i = new Sl())), (t = new Mg(i)), XW(new Yl(n.d), t)), + !Sj(n.g) && (OZ(c, "supportedFeatures", (r = new Sl())), (e = new Sg(r)), XW(n.g, e)), + c + ); + })(Yx(n, 149)); + if (CO(n, 229)) + return (function (n) { + var t, e, i; + return (i = cun(n)), !Sj(n.c) && (OZ(i, "knownLayouters", (e = new Sl())), (t = new Pg(e)), XW(n.c, t)), i; + })(Yx(n, 229)); + if (CO(n, 23)) + return (function (n) { + var t, e, i; + return ( + (i = cun(n)), + null != n.e && ND(i, dxn, n.e), + !!n.k && ND(i, "type", d$(n.k)), + !Sj(n.j) && ((e = new Sl()), OZ(i, VNn, e), (t = new Ig(e)), XW(n.j, t)), + i + ); + })(Yx(n, 23)); + throw hp(new Qm(axn + Gun(new ay(x4(Gy(UKn, 1), iEn, 1, 5, [n]))))); + } + function Gon(n, t, e, i) { + var r, c; + if (t.k == (bon(), Bzn)) + for (c = new $K(bA(u7(t).a.Kc(), new h())); Vfn(c); ) + if ((r = Yx(kV(c), 17)).c.i.k == Bzn && n.c.a[r.c.i.c.p] == i && n.c.a[t.c.p] == e) return !0; + return !1; + } + function zon(n, t, e, i) { + var r; + (this.b = i), + (this.e = n == (l0(), z3n)), + (r = t[e]), + (this.d = fR(Vot, [TEn, wSn], [177, 25], 16, [r.length, r.length], 2)), + (this.a = fR(Wot, [TEn, MTn], [48, 25], 15, [r.length, r.length], 2)), + (this.c = new $an(t, e)); + } + function Uon(n) { + var t, e, i; + for ( + n.k = new Cz((Ikn(), x4(Gy(trt, 1), lIn, 61, 0, [Hit, Tit, Eit, Bit, qit])).length, n.j.c.length), i = new pb(n.j); + i.a < i.c.c.length; + + ) + (t = (e = Yx(Hz(i), 113)).d.j), Qhn(n.k, t, e); + n.e = (function (n) { + var t, e; + if ((Tan(), n.Hc((Ikn(), Hit)))) throw hp(new Qm("Port sides must not contain UNDEFINED")); + switch (n.gc()) { + case 1: + return _Xn; + case 2: + return (t = n.Hc(Eit) && n.Hc(qit)), (e = n.Hc(Tit) && n.Hc(Bit)), t || e ? HXn : BXn; + case 3: + return FXn; + case 4: + return KXn; + default: + return null; + } + })(FK(n.k)); + } + function Xon(n, t) { + var e, i, r; + __(n.d, t), + (e = new ka()), + xB(n.c, t, e), + (e.f = c8(t.c)), + (e.a = c8(t.d)), + (e.d = (kwn(), (r = t.c.i.k) == (bon(), Hzn) || r == Kzn)), + (e.e = (i = t.d.i.k) == Hzn || i == Kzn), + (e.b = t.c.j == (Ikn(), qit)), + (e.c = t.d.j == Eit); + } + function Won(n) { + var t, e, i, r, c; + for (c = Yjn, r = Yjn, i = new pb(b7(n)); i.a < i.c.c.length; ) + (t = (e = Yx(Hz(i), 213)).e.e - e.d.e), e.e == n && t < r ? (r = t) : t < c && (c = t); + return r == Yjn && (r = -1), c == Yjn && (c = -1), new mP(d9(r), d9(c)); + } + function Von(n, t) { + var e, i, r; + for (e = t.a.o.a, r = new Vl(new Oz(dB(t.a).b, t.c, t.f + 1)); r.b < r.d.gc(); ) + if ((S$(r.b < r.d.gc()), (i = Yx(r.d.Xb((r.c = r.b++)), 29)).c.a >= e)) return nsn(n, t, i.p), !0; + return !1; + } + function Qon(n) { + var t; + return 0 != (64 & n.Db) + ? yon(n) + : ((t = new SA(wNn)), + !n.a || yI(yI(((t.a += ' "'), t), n.a), '"'), + yI(tj(yI(tj(yI(tj(yI(tj(((t.a += " ("), t), n.i), ","), n.j), " | "), n.g), ","), n.f), ")"), + t.a); + } + function Yon(n, t, e) { + var i, r, c, a, u; + for (u = dwn(n.e.Tg(), t), r = Yx(n.g, 119), i = 0, a = 0; a < n.i; ++a) + if (((c = r[a]), u.rl(c.ak()))) { + if (i == e) return tdn(n, a), TT(), Yx(t, 66).Oj() ? c : c.dd(); + ++i; + } + throw hp(new Hm(pDn + e + Exn + i)); + } + function Jon(n) { + var t, e, i; + if (2 == (t = n.c) || 7 == t || 1 == t) return Ljn(), Ljn(), Tot; + for (i = ujn(n), e = null; 2 != (t = n.c) && 7 != t && 1 != t; ) + e || (Ljn(), Ljn(), Rmn((e = new HC(1)), i), (i = e)), Rmn(e, ujn(n)); + return i; + } + function Zon(n, t) { + var e, i, r, c; + for (i = 0, r = n.length; i < r; i++) { + c = n[i]; + try { + c[1] ? c[0].jm() && (t = eK(t, c)) : c[0].jm(); + } catch (n) { + if (!CO((n = j4(n)), 78)) throw hp(n); + (e = n), _y(), Pq(CO(e, 477) ? Yx(e, 477).ae() : e); + } + } + return t; + } + function nsn(n, t, i) { + var r, c; + for ( + i != t.c + t.b.gc() && + (function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M; + for ( + y = n.c, + k = t.c, + e = hJ(y.a, n, 0), + i = hJ(k.a, t, 0), + v = Yx( + inn(n, (h0(), e3n)) + .Kc() + .Pb(), + 11, + ), + T = Yx(inn(n, i3n).Kc().Pb(), 11), + m = Yx(inn(t, e3n).Kc().Pb(), 11), + M = Yx(inn(t, i3n).Kc().Pb(), 11), + g = CU(v.e), + j = CU(T.g), + p = CU(m.e), + E = CU(M.g), + Hrn(n, i, k), + s = 0, + b = (c = p).length; + s < b; + ++s + ) + QG(c[s], v); + for (h = 0, w = (a = E).length; h < w; ++h) YG(a[h], T); + for (Hrn(t, e, y), f = 0, d = (u = g).length; f < d; ++f) QG(u[f], m); + for (o = 0, l = (r = j).length; o < l; ++o) YG(r[o], M); + })( + t.a, + (function (n, t) { + return t < n.b.gc() ? Yx(n.b.Xb(t), 10) : t == n.b.gc() ? n.a : Yx(TR(n.e, t - n.b.gc() - 1), 10); + })(t, i - t.c), + ), + c = t.a.c.p, + n.a[c] = e.Math.max(n.a[c], t.a.o.a), + r = Yx(Aun(t.a, (Ojn(), BQn)), 15).Kc(); + r.Ob(); + + ) + b5(Yx(r.Pb(), 70), dXn, (TA(), !0)); + } + function tsn(n, t) { + var i, r, c; + (c = (function (n) { + var t, e; + (e = null), (t = Yx(TR(n.g, 0), 17)); + do { + if (O$((e = t.d.i), (Ojn(), MQn))) return Yx(Aun(e, MQn), 11).i; + if (e.k != (bon(), Hzn) && Vfn(new $K(bA(o7(e).a.Kc(), new h())))) t = Yx(kV(new $K(bA(o7(e).a.Kc(), new h()))), 17); + else if (e.k != Hzn) return null; + } while (e && e.k != (bon(), Hzn)); + return e; + })(t)), + b5(t, (Ojn(), SQn), c), + c && + ((r = Yjn), + Dq(n.f, c) && (r = Yx(eI(Dq(n.f, c)), 19).a), + ny(hL(Aun((i = Yx(TR(t.g, 0), 17)), HQn))) || xB(n, c, d9(e.Math.min(Yx(Aun(i, IQn), 19).a, r)))); + } + function esn(n, t, e) { + var i, r, c, a; + for (t.p = -1, a = inn(t, (h0(), i3n)).Kc(); a.Ob(); ) + for (r = new pb(Yx(a.Pb(), 11).g); r.a < r.c.c.length; ) + t != (c = (i = Yx(Hz(r), 17)).d.i) && (c.p < 0 ? e.Fc(i) : c.p > 0 && esn(n, c, e)); + t.p = 0; + } + function isn(n) { + var t; + (this.c = new ME()), + (this.f = n.e), + (this.e = n.d), + (this.i = n.g), + (this.d = n.c), + (this.b = n.b), + (this.k = n.j), + (this.a = n.a), + n.i ? (this.j = n.i) : (this.j = new cx((t = Yx(Ak(D7n), 9)), Yx(eN(t, t.length), 9), 0)), + (this.g = n.f); + } + function rsn(n, t, e) { + var i, r, c; + if (!(e <= t + 2)) + for (r = ((e - t) / 2) | 0, i = 0; i < r; ++i) + $z(t + i, n.c.length), + (c = Yx(n.c[t + i], 11)), + QW(n, t + i, ($z(e - i - 1, n.c.length), Yx(n.c[e - i - 1], 11))), + $z(e - i - 1, n.c.length), + (n.c[e - i - 1] = c); + } + function csn(n) { + var t; + (this.j = new ip()), + (this.f = new Qp()), + (this.b = new cx((t = Yx(Ak(trt), 9)), Yx(eN(t, t.length), 9), 0)), + (this.d = VQ(Wot, MTn, 25, (Ikn(), x4(Gy(trt, 1), lIn, 61, 0, [Hit, Tit, Eit, Bit, qit])).length, 15, 1)), + (this.g = n); + } + function asn(n, t) { + var e, i, r; + if (0 != t.c.length) { + for (e = xun(n, t), r = !1; !e; ) Nln(n, t, !0), (r = !0), (e = xun(n, t)); + r && Nln(n, t, !1), (i = G4(t)), n.b && n.b.lg(i), (n.a = o8(n, ($z(0, t.c.length), Yx(t.c[0], 33)))), asn(n, i); + } + } + function usn(n, t) { + var e, i, r; + if (((i = CZ(n.Tg(), t)), (e = t - n.Ah()) < 0)) { + if (!i) throw hp(new Qm(ENn + t + TNn)); + if (!i.Ij()) throw hp(new Qm(mNn + i.ne() + yNn)); + (r = n.Yg(i)) >= 0 ? n.Bh(r) : Ehn(n, i); + } else r9(n, e, i); + } + function osn(n) { + var t, e; + if ( + ((e = null), + (t = !1), + CO(n, 204) && ((t = !0), (e = Yx(n, 204).a)), + t || (CO(n, 258) && ((t = !0), (e = "" + Yx(n, 258).a))), + t || (CO(n, 483) && ((t = !0), (e = "" + Yx(n, 483).a))), + !t) + ) + throw hp(new Gm(ixn)); + return e; + } + function ssn(n, t) { + var e, i; + if (n.f) { + for (; t.Ob(); ) + if ( + CO((i = (e = Yx(t.Pb(), 72)).ak()), 99) && + 0 != (Yx(i, 18).Bb & MNn) && + (!n.e || i.Gj() != Vrt || 0 != i.aj()) && + null != e.dd() + ) + return t.Ub(), !0; + return !1; + } + return t.Ob(); + } + function hsn(n, t) { + var e, i; + if (n.f) { + for (; t.Sb(); ) + if ( + CO((i = (e = Yx(t.Ub(), 72)).ak()), 99) && + 0 != (Yx(i, 18).Bb & MNn) && + (!n.e || i.Gj() != Vrt || 0 != i.aj()) && + null != e.dd() + ) + return t.Pb(), !0; + return !1; + } + return t.Sb(); + } + function fsn(n, t, e) { + var i, r, c, a, u, o; + for (o = dwn(n.e.Tg(), t), i = 0, u = n.i, r = Yx(n.g, 119), a = 0; a < n.i; ++a) + if (((c = r[a]), o.rl(c.ak()))) { + if (e == i) return a; + ++i, (u = a + 1); + } + if (e == i) return u; + throw hp(new Hm(pDn + e + Exn + i)); + } + function lsn() { + (lsn = O), + (x7n = new XS(MSn, 0)), + (I7n = new XS("BOOLEAN", 1)), + ($7n = new XS("INT", 2)), + (N7n = new XS("STRING", 3)), + (C7n = new XS("DOUBLE", 4)), + (O7n = new XS("ENUM", 5)), + (A7n = new XS("ENUMSET", 6)), + (L7n = new XS("OBJECT", 7)); + } + function bsn(n, t) { + var i, r, c, a, u; + (r = e.Math.min(n.c, t.c)), + (a = e.Math.min(n.d, t.d)), + (c = e.Math.max(n.c + n.b, t.c + t.b)) < r && ((i = r), (r = c), (c = i)), + (u = e.Math.max(n.d + n.a, t.d + t.a)) < a && ((i = a), (a = u), (u = i)), + RD(n, r, a, c - r, u - a); + } + function wsn() { + (wsn = O), + (but = x4(Gy(fFn, 1), TEn, 2, 6, [CRn, ORn, ARn, $Rn, LRn, NRn, dxn])), + (lut = x4(Gy(fFn, 1), TEn, 2, 6, [CRn, "empty", ORn, ZDn, "elementOnly"])), + (dut = x4(Gy(fFn, 1), TEn, 2, 6, [CRn, "preserve", "replace", xRn])), + (wut = new OD()); + } + function dsn(n, t, e) { + var i, r, c; + if (t != e) { + i = t; + do { + mN(n, i.c), (r = i.e) && ($$(n, (c = i.d).b, c.d), mN(n, r.n), (i = dB(r))); + } while (r); + i = e; + do { + yN(n, i.c), (r = i.e) && (N$(n, (c = i.d).b, c.d), yN(n, r.n), (i = dB(r))); + } while (r); + } + } + function gsn(n, t, e, i) { + var r, c, a, u, o; + if (i.f.c + i.g.c == 0) for (u = 0, o = (a = n.a[n.c]).length; u < o; ++u) xB(i, (c = a[u]), new n3(n, c, e)); + return ((r = Yx(eI(Dq(i.f, t)), 663)).b = 0), (r.c = r.f), 0 == r.c || Xl(Yx(TR(r.a, r.b), 287)), r; + } + function psn() { + (psn = O), + (bWn = new FM("MEDIAN_LAYER", 0)), + (dWn = new FM("TAIL_LAYER", 1)), + (lWn = new FM("HEAD_LAYER", 2)), + (wWn = new FM("SPACE_EFFICIENT_LAYER", 3)), + (gWn = new FM("WIDEST_LAYER", 4)), + (fWn = new FM("CENTER_LAYER", 5)); + } + function vsn(n, t) { + var e; + return ( + 0 != n.c.length && + ((e = gnn(($z(0, n.c.length), Yx(n.c[0], 17)).c.i)), + hz(), + e == (Hen(), M2n) || e == T2n || JW(fH(new SR(null, new Nz(n, 16)), new Fc()), new Sd(t))) + ); + } + function msn(n, t, e) { + var i, r, c; + if (!n.b[t.g]) { + for (n.b[t.g] = !0, !(i = e) && (i = new nQ()), KD(i.b, t), c = n.a[t.g].Kc(); c.Ob(); ) + (r = Yx(c.Pb(), 188)).b != t && msn(n, r.b, i), r.c != t && msn(n, r.c, i), KD(i.a, r); + return i; + } + return null; + } + function ysn() { + (ysn = O), + (h5n = new OS("ROOT_PROC", 0)), + (a5n = new OS("FAN_PROC", 1)), + (o5n = new OS("NEIGHBORS_PROC", 2)), + (u5n = new OS("LEVEL_HEIGHT", 3)), + (s5n = new OS("NODE_POSITION_PROC", 4)), + (c5n = new OS("DETREEIFYING_PROC", 5)); + } + function ksn(n, t) { + if (CO(t, 239)) + return (function (n, t) { + return z0(AF(n.g), t); + })(n, Yx(t, 33)); + if (CO(t, 186)) + return (function (n, t) { + return z0(AF(n.j), t); + })(n, Yx(t, 118)); + if (CO(t, 439)) + return (function (n, t) { + return z0(AF(n.d), t); + })(n, Yx(t, 202)); + throw hp(new Qm(axn + Gun(new ay(x4(Gy(UKn, 1), iEn, 1, 5, [t]))))); + } + function jsn(n, t, e) { + var i, r; + if (((this.f = n), qV(e, (r = (i = Yx(BF(n.b, t), 283)) ? i.a : 0)), e >= ((r / 2) | 0))) + for (this.e = i ? i.c : null, this.d = r; e++ < r; ) VG(this); + else for (this.c = i ? i.b : null; e-- > 0; ) WG(this); + (this.b = t), (this.a = null); + } + function Esn(n, t) { + var e, i; + t.a + ? (function (n, t) { + var e; + if (!uF(n.b, t.b)) throw hp(new Ym("Invalid hitboxes for scanline constraint calculation.")); + (C4( + t.b, + Yx( + (function (n, t) { + return $k(Rnn(n.a, t, !0)); + })(n.b, t.b), + 57, + ), + ) || + C4( + t.b, + Yx( + (function (n, t) { + return $k(Dnn(n.a, t, !0)); + })(n.b, t.b), + 57, + ), + )) && + (oE(), t.b), + (n.a[t.b.f] = Yx(BN(n.b, t.b), 57)), + (e = Yx(FN(n.b, t.b), 57)) && (n.a[e.f] = t.b); + })(n, t) + : (!!(e = Yx(BN(n.b, t.b), 57)) && e == n.a[t.b.f] && !!e.a && e.a != t.b.a && e.c.Fc(t.b), + !!(i = Yx(FN(n.b, t.b), 57)) && n.a[i.f] == t.b && !!i.a && i.a != t.b.a && t.b.c.Fc(i), + RA(n.b, t.b)); + } + function Tsn(n, t) { + var e, i; + if (((e = Yx(GB(n.b, t), 124)), Yx(Yx(_V(n.r, t), 21), 84).dc())) return (e.n.b = 0), void (e.n.c = 0); + (e.n.b = n.C.b), + (e.n.c = n.C.c), + n.A.Hc((Ann(), nrt)) && Xdn(n, t), + (i = (function (n, t) { + var e, i, r; + for (r = 0, i = Yx(Yx(_V(n.r, t), 21), 84).Kc(); i.Ob(); ) + (r += (e = Yx(i.Pb(), 111)).d.b + e.b.rf().a + e.d.c), i.Ob() && (r += n.w); + return r; + })(n, t)), + hdn(n, t) == (Ytn(), eit) && (i += 2 * n.w), + (e.a.a = i); + } + function Msn(n, t) { + var e, i; + if (((e = Yx(GB(n.b, t), 124)), Yx(Yx(_V(n.r, t), 21), 84).dc())) return (e.n.d = 0), void (e.n.a = 0); + (e.n.d = n.C.d), + (e.n.a = n.C.a), + n.A.Hc((Ann(), nrt)) && Wdn(n, t), + (i = (function (n, t) { + var e, i, r; + for (r = 0, i = Yx(Yx(_V(n.r, t), 21), 84).Kc(); i.Ob(); ) + (r += (e = Yx(i.Pb(), 111)).d.d + e.b.rf().b + e.d.a), i.Ob() && (r += n.w); + return r; + })(n, t)), + hdn(n, t) == (Ytn(), eit) && (i += 2 * n.w), + (e.a.b = i); + } + function Ssn(n, t) { + var e, i, r, c; + for (c = new ip(), i = new pb(t); i.a < i.c.c.length; ) eD(c, new tM((e = Yx(Hz(i), 65)), !0)), eD(c, new tM(e, !1)); + $m((r = new vq(n)).a.a), AU(c, n.b, new ay(x4(Gy(jBn, 1), iEn, 679, 0, [r]))); + } + function Psn(n, t, e, i) { + var r, c, a, u, o, s, h, f, l, b, w; + return ( + (u = n.a), + (f = n.b), + (o = t.a), + (l = t.b), + (s = e.a), + (b = e.b), + new QS( + ((c = u * l - f * o) * (s - (h = i.a)) - (a = s * (w = i.b) - b * h) * (u - o)) / (r = (u - o) * (b - w) - (f - l) * (s - h)), + (c * (b - w) - a * (f - l)) / r, + ) + ); + } + function Isn(n, t) { + var e, i, r; + if (!n.d[t.p]) { + for (n.d[t.p] = !0, n.a[t.p] = !0, i = new $K(bA(o7(t).a.Kc(), new h())); Vfn(i); ) + ZW((e = Yx(kV(i), 17))) || ((r = e.d.i), n.a[r.p] ? eD(n.b, e) : Isn(n, r)); + n.a[t.p] = !1; + } + } + function Csn(n, t, e) { + var i; + switch (((i = 0), Yx(Aun(t, (gjn(), x1n)), 163).g)) { + case 2: + (i = 2 * -e + n.a), ++n.a; + break; + case 1: + i = -e; + break; + case 3: + i = e; + break; + case 4: + (i = 2 * e + n.b), ++n.b; + } + return O$(t, (Ojn(), IQn)) && (i += Yx(Aun(t, IQn), 19).a), i; + } + function Osn(n, t, e) { + var i, r, c; + for ( + e.zc(t, n), + eD(n.n, t), + c = n.p.eg(t), + t.j == n.p.fg() ? k7(n.e, c) : k7(n.j, c), + lF(n), + r = W_(n0(x4(Gy(QKn, 1), iEn, 20, 0, [new fw(t), new bw(t)]))); + Vfn(r); + + ) + (i = Yx(kV(r), 11)), e._b(i) || Osn(n, i, e); + } + function Asn(n) { + var t, e; + return Yx(jln(n, (Cjn(), Jnt)), 21).Hc((Ann(), Yit)) + ? ((e = Yx(jln(n, itt), 21)), + (t = new fC(Yx(jln(n, ttt), 8))), + e.Hc((Vgn(), crt)) && (t.a <= 0 && (t.a = 20), t.b <= 0 && (t.b = 20)), + t) + : new Pk(); + } + function $sn(n) { + var t, e, i; + if (!n.b) { + for (i = new Io(), e = new u$(Uvn(n)); e.e != e.i.gc(); ) 0 != ((t = Yx(fen(e), 18)).Bb & MNn) && fY(i, t); + B6(i), (n.b = new HI((Yx(c1(aq((YF(), gat).o), 8), 18), i.i), i.g)), (bV(n).b &= -9); + } + return n.b; + } + function Lsn(n, t) { + var e, i, r, c, a, u; + (a = Yx(_in(FK(t.k), VQ(trt, lIn, 61, 2, 0, 1)), 122)), + srn(n, (u = t.g), (e = EX(t, a[0])), (i = jX(t, a[1]))) <= srn(n, u, (r = EX(t, a[1])), (c = jX(t, a[0]))) + ? ((t.a = e), (t.c = i)) + : ((t.a = r), (t.c = c)); + } + function Nsn(n, t, e) { + var i, r, c; + for (run(e, "Processor set neighbors", 1), n.a = 0 == t.b.b ? 1 : t.b.b, r = null, i = Ztn(t.b, 0); !r && i.b != i.d.c; ) + ny(hL(Aun((c = Yx(IX(i), 86)), (ryn(), C5n)))) && (r = c); + r && gdn(n, new Dd(r), e), Ron(e); + } + function xsn(n) { + var t, e, i, r; + return ( + Cmn(), + (t = -1 == (i = VI(n, gun(35))) ? n : n.substr(0, i)), + (e = -1 == i ? null : n.substr(i + 1)), + (r = (function (n, t) { + return Yx(null == t ? eI(Dq(n.f, null)) : NT(n.g, t), 281); + })(Kct, t)) + ? null != e && (r = g6(r, (vB(e), e))) + : ((r = (function (n) { + var t, e, i, r, c, a, u, o, s, h, f, l, b; + if ( + ((a = !0), + (f = null), + (i = null), + (r = null), + (t = !1), + (b = Dct), + (s = null), + (c = null), + (o = Btn(n, (u = 0), Uct, Xct)) < n.length && + (Lz(o, n.length), 58 == n.charCodeAt(o)) && + ((f = n.substr(u, o - u)), (u = o + 1)), + (e = null != f && fE(Rct, f.toLowerCase()))) + ) { + if (-1 == (o = n.lastIndexOf("!/"))) throw hp(new Qm("no archive separator")); + (a = !0), (i = l$(n, u, ++o)), (u = o); + } else + u >= 0 && _N(n.substr(u, 2), "//") + ? ((o = Btn(n, (u += 2), Wct, Vct)), (i = n.substr(u, o - u)), (u = o)) + : null == f || + (u != n.length && (Lz(u, n.length), 47 == n.charCodeAt(u))) || + ((a = !1), -1 == (o = NA(n, gun(35), u)) && (o = n.length), (i = n.substr(u, o - u)), (u = o)); + if ( + (!e && + u < n.length && + (Lz(u, n.length), 47 == n.charCodeAt(u)) && + ((o = Btn(n, u + 1, Wct, Vct)), + (h = n.substr(u + 1, o - (u + 1))).length > 0 && 58 == XB(h, h.length - 1) && ((r = h), (u = o))), + u < n.length && (Lz(u, n.length), 47 == n.charCodeAt(u)) && (++u, (t = !0)), + u < n.length && (Lz(u, n.length), 63 != n.charCodeAt(u)) && (Lz(u, n.length), 35 != n.charCodeAt(u))) + ) { + for ( + l = new ip(); + u < n.length && (Lz(u, n.length), 63 != n.charCodeAt(u)) && (Lz(u, n.length), 35 != n.charCodeAt(u)); + + ) + (o = Btn(n, u, Wct, Vct)), + eD(l, n.substr(u, o - u)), + (u = o) < n.length && (Lz(u, n.length), 47 == n.charCodeAt(u)) && (j8(n, ++u) || (l.c[l.c.length] = "")); + Htn(l, (b = VQ(fFn, TEn, 2, l.c.length, 6, 1))); + } + return ( + u < n.length && + (Lz(u, n.length), 63 == n.charCodeAt(u)) && + (-1 == (o = b$(n, 35, ++u)) && (o = n.length), (s = n.substr(u, o - u)), (u = o)), + u < n.length && (c = lI(n, ++u)), + (function (n, t, e, i, r, c) { + if (null != t && $7(t, Uct, Xct)) throw hp(new Qm("invalid scheme: " + t)); + if (!(n || (null != e && -1 == VI(e, gun(35)) && e.length > 0 && (Lz(0, e.length), 47 != e.charCodeAt(0))))) + throw hp(new Qm("invalid opaquePart: " + e)); + if (n && (null == t || !fE(Rct, t.toLowerCase())) && null != e && $7(e, Wct, Vct)) throw hp(new Qm(EDn + e)); + if ( + n && + null != t && + fE(Rct, t.toLowerCase()) && + !(function (n) { + if (null != n && n.length > 0 && 33 == XB(n, n.length - 1)) + try { + return null == xsn(l$(n, 0, n.length - 1)).e; + } catch (n) { + if (!CO((n = j4(n)), 32)) throw hp(n); + } + return !1; + })(e) + ) + throw hp(new Qm(EDn + e)); + if ( + !(function (n) { + var t; + return null == n || ((t = n.length) > 0 && (Lz(t - 1, n.length), 58 == n.charCodeAt(t - 1)) && !$7(n, Wct, Vct)); + })(i) + ) + throw hp(new Qm("invalid device: " + i)); + if ( + !(function (n) { + var t, e; + if (null == n) return !1; + for (t = 0, e = n.length; t < e; t++) if (!AD(n[t])) return !1; + return !0; + })(r) + ) + throw hp( + new Qm( + null == r + ? "invalid segments: null" + : "invalid segment: " + + (function (n) { + var t, e; + if (null == n) return null; + for (t = 0, e = n.length; t < e; t++) if (!AD(n[t])) return n[t]; + return null; + })(r), + ), + ); + if (null != c && -1 != VI(c, gun(35))) throw hp(new Qm("invalid query: " + c)); + })(a, f, i, r, b, s), + new xdn(a, f, i, r, t, b, s, c) + ); + })(t)), + (function (n, t, e) { + Yx(null == t ? Ysn(n.f, null, e) : r7(n.g, t, e), 281); + })(Kct, t, r), + null != e && (r = g6(r, e))), + r + ); + } + function Dsn(n) { + var t, e, i, r, c, a, u; + if ((XH(), CO(n, 54))) for (c = 0, r = n.gc() - 1; c < r; ++c, --r) (t = n.Xb(c)), n._c(c, n.Xb(r)), n._c(r, t); + else for (e = n.Yc(), a = n.Zc(n.gc()); e.Tb() < a.Vb(); ) (i = e.Pb()), (u = a.Ub()), e.Wb(u), a.Wb(i); + } + function Rsn(n, t) { + var e, i, r, c, a, u; + for (u = 0, OX((c = new ep()), t); c.b != c.c; ) + for (u += drn((a = Yx($_(c), 214)).d, a.e), r = new pb(a.b); r.a < r.c.c.length; ) + (i = Yx(Hz(r), 37)), (e = Yx(TR(n.b, i.p), 214)).s || (u += Rsn(n, e)); + return u; + } + function Ksn(n, t, i) { + var r, c; + c4(this), + t == (Yq(), X4n) ? __(this.r, n.c) : __(this.w, n.c), + __(i == X4n ? this.r : this.w, n.d), + Xon(this, n), + ion(this, (r = c8(n.c)), (c = c8(n.d)), c), + (this.o = (kwn(), e.Math.abs(r - c) < 0.2)); + } + function _sn(n, t, e) { + var i, r, c, a, u; + if (null != (a = Yx(H3(n.a, 8), 1936))) for (r = 0, c = a.length; r < c; ++r) null.jm(); + (i = e), 0 == (1 & n.a.Db) && ((u = new aB(n, e, t)), i.ui(u)), CO(i, 672) ? Yx(i, 672).wi(n.a) : i.ti() == n.a && i.vi(null); + } + function Fsn(n, t) { + var e, i, r, c, a; + for (i = new xz(n.j.c.length), e = null, c = new pb(n.j); c.a < c.c.c.length; ) + (r = Yx(Hz(c), 11)).j != e && (i.b == i.c || zln(i, e, t), iW(i), (e = r.j)), (a = Jfn(r)) && CX(i, a); + i.b == i.c || zln(i, e, t); + } + function Bsn(n) { + var t, i, r; + for (t = FX(new $K(bA(o7(n).a.Kc(), new h()))), i = new $K(bA(u7(n).a.Kc(), new h())); Vfn(i); ) + (r = FX(new $K(bA(o7(Yx(kV(i), 17).c.i).a.Kc(), new h())))), (t = e.Math.max(t, r)); + return d9(t); + } + function Hsn(n, t, e) { + var i, r, c, a; + for (run(e, "Processor arrange node", 1), r = null, c = new ME(), i = Ztn(t.b, 0); !r && i.b != i.d.c; ) + ny(hL(Aun((a = Yx(IX(i), 86)), (ryn(), C5n)))) && (r = a); + VW(c, r, c.c.b, c.c), wkn(n, c, J2(e, 1)), Ron(e); + } + function qsn(n, t, e) { + var i, r, c; + (i = Yx(jln(n, (Cjn(), Tnt)), 21)), + (r = 0), + (c = 0), + t.a > e.a && (i.Hc((dan(), ont)) ? (r = (t.a - e.a) / 2) : i.Hc(hnt) && (r = t.a - e.a)), + t.b > e.b && (i.Hc((dan(), lnt)) ? (c = (t.b - e.b) / 2) : i.Hc(fnt) && (c = t.b - e.b)), + Pun(n, r, c); + } + function Gsn(n, t, e, i, r, c, a, u, o, s, h, f, l) { + CO(n.Cb, 88) && rhn(bV(Yx(n.Cb, 88)), 4), + E2(n, e), + (n.f = a), + D9(n, u), + K9(n, o), + x9(n, s), + R9(n, h), + l9(n, f), + H9(n, l), + s9(n, !0), + _1(n, r), + n.ok(c), + a8(n, t), + null != i && ((n.i = null), J0(n, i)); + } + function zsn(n) { + var t, e; + if (n.f) { + for (; n.n > 0; ) { + if ( + CO((e = (t = Yx(n.k.Xb(n.n - 1), 72)).ak()), 99) && + 0 != (Yx(e, 18).Bb & MNn) && + (!n.e || e.Gj() != Vrt || 0 != e.aj()) && + null != t.dd() + ) + return !0; + --n.n; + } + return !1; + } + return n.n > 0; + } + function Usn(n, t, e) { + if (n < 0) return ngn(eEn, x4(Gy(UKn, 1), iEn, 1, 5, [e, d9(n)])); + if (t < 0) throw hp(new Qm(rEn + t)); + return ngn("%s (%s) must not be greater than size (%s)", x4(Gy(UKn, 1), iEn, 1, 5, [e, d9(n), d9(t)])); + } + function Xsn(n, t, e, i, r, c) { + var a, u, o; + if (i - e < 7) + !(function (n, t, e, i) { + var r, c, a; + for (r = t + 1; r < e; ++r) + for (c = r; c > t && i.ue(n[c - 1], n[c]) > 0; --c) (a = n[c]), DF(n, c, n[c - 1]), DF(n, c - 1, a); + })(t, e, i, c); + else if ((Xsn(t, n, (u = e + r), (o = u + (((a = i + r) - u) >> 1)), -r, c), Xsn(t, n, o, a, -r, c), c.ue(n[o - 1], n[o]) <= 0)) + for (; e < i; ) DF(t, e++, n[u++]); + else + !(function (n, t, e, i, r, c, a, u) { + var o; + for (o = e; c < a; ) o >= i || (t < e && u.ue(n[t], n[o]) <= 0) ? DF(r, c++, n[t++]) : DF(r, c++, n[o++]); + })(n, u, o, a, t, e, i, c); + } + function Wsn(n, t) { + var e, i, r; + for (r = new ip(), i = new pb(n.c.a.b); i.a < i.c.c.length; ) + (e = Yx(Hz(i), 57)), t.Lb(e) && (eD(r, new WT(e, !0)), eD(r, new WT(e, !1))); + (function (n) { + var t, e; + for ($m(n.b.a), n.a = VQ(PBn, iEn, 57, n.c.c.a.b.c.length, 0, 1), t = 0, e = new pb(n.c.c.a.b); e.a < e.c.c.length; ) + Yx(Hz(e), 57).f = t++; + })(n.e), + AU(r, n.d, new ay(x4(Gy(jBn, 1), iEn, 679, 0, [n.e]))); + } + function Vsn(n, t, e) { + var i, r, c; + if (((r = CZ(n.Tg(), t)), (i = t - n.Ah()) < 0)) { + if (!r) throw hp(new Qm(ENn + t + TNn)); + if (!r.Ij()) throw hp(new Qm(mNn + r.ne() + yNn)); + (c = n.Yg(r)) >= 0 ? n.sh(c, e) : pbn(n, r, e); + } else E7(n, i, r, e); + } + function Qsn(n) { + var t, e, i, r, c; + if ((e = Yx(n, 49).qh())) + try { + if ( + ((i = null), + (t = Hln( + (mT(), aat), + spn( + null == (c = e).e + ? c + : (!c.c && (c.c = new xdn(0 != (256 & c.f), c.i, c.a, c.d, 0 != (16 & c.f), c.j, c.g, null)), c.c), + ), + )) && + (r = t.rh()) && + (i = r.Wk( + (function (n) { + return vB(n), n; + })(e.e), + )), + i && i != n) + ) + return Qsn(i); + } catch (c) { + if (!CO((c = j4(c)), 60)) throw hp(c); + } + return n; + } + function Ysn(n, t, e) { + var i, r, c, a; + if (((a = null == t ? 0 : n.b.se(t)), 0 == (r = null == (i = n.a.get(a)) ? new Array() : i).length)) n.a.set(a, r); + else if ((c = q6(n, t, r))) return c.ed(e); + return DF(r, r.length, new zT(t, e)), ++n.c, gq(n.b), null; + } + function Jsn(n, t) { + var e; + return ( + _U(n.a), + q_(n.a, (p2(), h6n), h6n), + q_(n.a, f6n, f6n), + oR((e = new fX()), f6n, (m7(), g6n)), + iI(jln(t, (_rn(), F6n))) !== iI((I6(), E6n)) && oR(e, f6n, w6n), + oR(e, f6n, d6n), + aC(n.a, e), + Zmn(n.a, t) + ); + } + function Zsn(n) { + if (!n) return yy(), M_n; + var t = n.valueOf ? n.valueOf() : n; + if (t !== n) { + var i = S_n[typeof t]; + return i ? i(t) : Z6(typeof t); + } + return n instanceof Array || n instanceof e.Array ? new jl(n) : new Ml(n); + } + function nhn(n, t, i) { + var r, c, a; + switch ( + ((a = n.o), + ((c = (r = Yx(GB(n.p, i), 244)).i).b = Rhn(r)), + (c.a = Dhn(r)), + (c.b = e.Math.max(c.b, a.a)), + c.b > a.a && !t && (c.b = a.a), + (c.c = -(c.b - a.a) / 2), + i.g) + ) { + case 1: + c.d = -c.a; + break; + case 3: + c.d = a.b; + } + cvn(r), hvn(r); + } + function thn(n, t, i) { + var r, c, a; + switch ( + ((a = n.o), + ((c = (r = Yx(GB(n.p, i), 244)).i).b = Rhn(r)), + (c.a = Dhn(r)), + (c.a = e.Math.max(c.a, a.b)), + c.a > a.b && !t && (c.a = a.b), + (c.d = -(c.a - a.b) / 2), + i.g) + ) { + case 4: + c.c = -c.b; + break; + case 2: + c.c = a.a; + } + cvn(r), hvn(r); + } + function ehn(n, t) { + var e, i, r, c; + if ((udn(), t.b < 2)) return !1; + for (i = e = Yx(IX((c = Ztn(t, 0))), 8); c.b != c.d.c; ) { + if (((r = Yx(IX(c), 8)), !s3(n, i) || !s3(n, r))) return !1; + i = r; + } + return !(!s3(n, i) || !s3(n, e)); + } + function ihn(n, t) { + var e, i, r, c, a; + return ( + (e = q1((a = n), "x")), + (function (n, t) { + L1(n, null == t || ex((vB(t), t)) || isNaN((vB(t), t)) ? 0 : (vB(t), t)); + })(new lg(t).a, e), + (i = q1(a, "y")), + (function (n, t) { + N1(n, null == t || ex((vB(t), t)) || isNaN((vB(t), t)) ? 0 : (vB(t), t)); + })(new bg(t).a, i), + (r = q1(a, qNn)), + (function (n, t) { + $1(n, null == t || ex((vB(t), t)) || isNaN((vB(t), t)) ? 0 : (vB(t), t)); + })(new wg(t).a, r), + (c = q1(a, HNn)), + (function (n, t) { + A1(n, null == t || ex((vB(t), t)) || isNaN((vB(t), t)) ? 0 : (vB(t), t)); + })(new dg(t).a, c), + c + ); + } + function rhn(n, t) { + Gdn(n, t), + 0 != (1 & n.b) && (n.a.a = null), + 0 != (2 & n.b) && (n.a.f = null), + 0 != (4 & n.b) && ((n.a.g = null), (n.a.i = null)), + 0 != (16 & n.b) && ((n.a.d = null), (n.a.e = null)), + 0 != (8 & n.b) && (n.a.b = null), + 0 != (32 & n.b) && ((n.a.j = null), (n.a.c = null)); + } + function chn(n) { + var t, e, i, r, c; + if (null == n) return aEn; + for (c = new J3(tEn, "[", "]"), i = 0, r = (e = n).length; i < r; ++i) + (t = e[i]), c.a ? yI(c.a, c.b) : (c.a = new SA(c.d)), vI(c.a, "" + t); + return c.a ? (0 == c.e.length ? c.a.a : c.a.a + "" + c.e) : c.c; + } + function ahn(n) { + var t, e, i, r, c; + if (null == n) return aEn; + for (c = new J3(tEn, "[", "]"), i = 0, r = (e = n).length; i < r; ++i) + (t = e[i]), c.a ? yI(c.a, c.b) : (c.a = new SA(c.d)), vI(c.a, "" + t); + return c.a ? (0 == c.e.length ? c.a.a : c.a.a + "" + c.e) : c.c; + } + function uhn(n) { + var t, e, i, r, c; + if (null == n) return aEn; + for (c = new J3(tEn, "[", "]"), i = 0, r = (e = n).length; i < r; ++i) + (t = e[i]), c.a ? yI(c.a, c.b) : (c.a = new SA(c.d)), vI(c.a, "" + t); + return c.a ? (0 == c.e.length ? c.a.a : c.a.a + "" + c.e) : c.c; + } + function ohn(n) { + var t, e, i, r, c; + if (null == n) return aEn; + for (c = new J3(tEn, "[", "]"), i = 0, r = (e = n).length; i < r; ++i) + (t = e[i]), c.a ? yI(c.a, c.b) : (c.a = new SA(c.d)), vI(c.a, "" + t); + return c.a ? (0 == c.e.length ? c.a.a : c.a.a + "" + c.e) : c.c; + } + function shn(n, t) { + var e, i, r, c, a, u; + for ( + e = n.b.c.length, r = TR(n.b, t); + 2 * t + 1 < e && + ((u = c = 2 * t + 1), (a = c + 1) < e && n.a.ue(TR(n.b, a), TR(n.b, c)) < 0 && (u = a), (i = u), !(n.a.ue(r, TR(n.b, i)) < 0)); + + ) + QW(n.b, t, TR(n.b, i)), (t = i); + QW(n.b, t, r); + } + function hhn(n, t, i, r, c, a) { + var u, o, s, h, f; + for (iI(n) === iI(i) && ((n = n.slice(t, t + c)), (t = 0)), s = i, o = t, h = t + c; o < h; ) + (c = (u = e.Math.min(o + 1e4, h)) - o), + (f = n.slice(o, u)).splice(0, 0, r, a ? c : 0), + Array.prototype.splice.apply(s, f), + (o = u), + (r += c); + } + function fhn(n, t, e) { + var i, r; + return ( + (i = e.d), + (r = e.e), + n.g[i.d] <= n.i[t.d] && n.i[t.d] <= n.i[i.d] && n.g[r.d] <= n.i[t.d] && n.i[t.d] <= n.i[r.d] + ? !(n.i[i.d] < n.i[r.d]) + : n.i[i.d] < n.i[r.d] + ); + } + function lhn(n) { + var t, e, i, r, c, a, u; + if ((i = n.a.c.length) > 0) + for ( + a = n.c.d, r = KO(yN(new QS((u = n.d.d).a, u.b), a), 1 / (i + 1)), c = new QS(a.a, a.b), e = new pb(n.a); + e.a < e.c.c.length; + + ) + ((t = Yx(Hz(e), 559)).d.a = c.a), (t.d.b = c.b), mN(c, r); + } + function bhn(n, t, i) { + var r, c, a, u, o, s; + for (s = JTn, a = new pb(Ibn(n.b)); a.a < a.c.c.length; ) + for (c = Yx(Hz(a), 168), o = new pb(Ibn(t.b)); o.a < o.c.c.length; ) + (u = Yx(Hz(o), 168)), (r = D4(c.a, c.b, u.a, u.b, i)), (s = e.Math.min(s, r)); + return s; + } + function whn(n, t) { + if (!t) throw hp(new Np()); + if (((n.j = t), !n.d)) + switch (n.j.g) { + case 1: + (n.a.a = n.o.a / 2), (n.a.b = 0); + break; + case 2: + (n.a.a = n.o.a), (n.a.b = n.o.b / 2); + break; + case 3: + (n.a.a = n.o.a / 2), (n.a.b = n.o.b); + break; + case 4: + (n.a.a = 0), (n.a.b = n.o.b / 2); + } + } + function dhn(n, t) { + var e, i; + if (t.dc()) return XH(), XH(), TFn; + for (eD((i = new ip()), d9(nTn)), e = 1; e < n.f; ++e) null == n.a && qdn(n), n.a[e] && eD(i, d9(e)); + return 1 == i.c.length + ? (XH(), XH(), TFn) + : (eD(i, d9(Yjn)), + (function (n, t) { + var e, i, r, c, a, u; + for (r = new ip(), c = 0, e = 0, a = 0; c < t.c.length - 1 && e < n.gc(); ) { + for (i = Yx(n.Xb(e), 19).a + a; ($z(c + 1, t.c.length), Yx(t.c[c + 1], 19)).a < i; ) ++c; + for ( + u = 0, + i - ($z(c, t.c.length), Yx(t.c[c], 19)).a > ($z(c + 1, t.c.length), Yx(t.c[c + 1], 19)).a - i && ++u, + eD(r, ($z(c + u, t.c.length), Yx(t.c[c + u], 19))), + a += ($z(c + u, t.c.length), Yx(t.c[c + u], 19)).a - i, + ++e; + e < n.gc() && Yx(n.Xb(e), 19).a + a <= ($z(c + u, t.c.length), Yx(t.c[c + u], 19)).a; + + ) + ++e; + c += 1 + u; + } + return r; + })(t, i)); + } + function ghn(n, t) { + var e, i, r, c, a, u; + (e = (function (n, t) { + if (t == n.c) return n.d; + if (t == n.d) return n.c; + throw hp(new Qm("'port' must be either the source port or target port of the edge.")); + })(t, (u = t.c.i.k != (bon(), Hzn) ? t.d : t.c)).i), + (r = Yx(BF(n.k, u), 121)), + (i = n.i[e.p].a), + GN(u.i) < (e.c ? hJ(e.c.a, e, 0) : -1) ? ((c = r), (a = i)) : ((c = i), (a = r)), + uwn(NE(LE(xE($E(new tv(), 0), 4), c), a)); + } + function phn(n, t, e) { + var i, r; + (i = t.a & n.f), + (t.b = n.b[i]), + (n.b[i] = t), + (r = t.f & n.f), + (t.d = n.c[r]), + (n.c[r] = t), + e + ? ((t.e = e.e), t.e ? (t.e.c = t) : (n.a = t), (t.c = e.c), t.c ? (t.c.e = t) : (n.e = t)) + : ((t.e = n.e), (t.c = null), n.e ? (n.e.c = t) : (n.a = t), (n.e = t)), + ++n.i, + ++n.g; + } + function vhn(n) { + var t, e, i; + if (((t = n.Pb()), !n.Ob())) return t; + for (i = mI(yI(new Ay(), "expected one element but was: <"), t), e = 0; e < 4 && n.Ob(); e++) mI(((i.a += tEn), i), n.Pb()); + throw (n.Ob() && (i.a += ", ..."), (i.a += ">"), hp(new Qm(i.a))); + } + function mhn(n, t, e) { + var i, r; + for (i = t.d, r = e.d; i.a - r.a == 0 && i.b - r.b == 0; ) + (i.a += Xln(n, 26) * mMn + Xln(n, 27) * yMn - 0.5), + (i.b += Xln(n, 26) * mMn + Xln(n, 27) * yMn - 0.5), + (r.a += Xln(n, 26) * mMn + Xln(n, 27) * yMn - 0.5), + (r.b += Xln(n, 26) * mMn + Xln(n, 27) * yMn - 0.5); + } + function yhn(n) { + var t, e, i, r; + for (n.g = new C7(Yx(MF(trt), 290)), i = 0, Ikn(), e = Tit, t = 0; t < n.j.c.length; t++) + (r = Yx(TR(n.j, t), 11)).j != e && (i != t && YR(n.g, e, new mP(d9(i), d9(t))), (e = r.j), (i = t)); + YR(n.g, e, new mP(d9(i), d9(t))); + } + function khn(n) { + var t, e, i, r, c; + for (e = 0, t = new pb(n.b); t.a < t.c.c.length; ) + for (r = new pb(Yx(Hz(t), 29).a); r.a < r.c.c.length; ) + for ((i = Yx(Hz(r), 10)).p = e++, c = new pb(i.j); c.a < c.c.c.length; ) Yx(Hz(c), 11).p = e++; + } + function jhn(n, t, e, i, r) { + var c, a, u, o; + if (t) + for (a = t.Kc(); a.Ob(); ) + for (o = Ddn(Yx(a.Pb(), 10), (h0(), i3n), e).Kc(); o.Ob(); ) + (u = Yx(o.Pb(), 11)), (c = Yx(eI(Dq(r.f, u)), 112)) || ((c = new a4(n.d)), (i.c[i.c.length] = c), Osn(c, u, r)); + } + function Ehn(n, t) { + var e, i, r; + if (!(r = iyn((wsn(), wut), n.Tg(), t))) throw hp(new Qm(mNn + t.ne() + yNn)); + TT(), + Yx(r, 66).Oj() || (r = Bz(PJ(wut, r))), + (i = Yx((e = n.Yg(r)) >= 0 ? n._g(e, !0, !0) : tfn(n, r, !0), 153)), + Yx(i, 215).ol(t); + } + function Thn(n) { + var t, i; + return n > -0x800000000000 && n < 0x800000000000 + ? 0 == n + ? 0 + : ((t = n < 0) && (n = -n), + (i = oG(e.Math.floor(e.Math.log(n) / 0.6931471805599453))), + (!t || n != e.Math.pow(2, i)) && ++i, + i) + : h4(D3(n)); + } + function Mhn(n, t) { + var e, i, r; + return ( + o4((i = new rin(n)), t), + b5(i, (Ojn(), sQn), t), + b5(i, (gjn(), g0n), (Ran(), oit)), + b5(i, xZn, (qen(), G7n)), + Al(i, (bon(), _zn)), + ZG((e = new Ion()), i), + whn(e, (Ikn(), qit)), + ZG((r = new Ion()), i), + whn(r, Eit), + i + ); + } + function Shn(n) { + switch (n.g) { + case 0: + return new zm((l0(), G3n)); + case 1: + return new bf(); + case 2: + return new yf(); + default: + throw hp(new Qm("No implementation is available for the crossing minimizer " + (null != n.f ? n.f : "" + n.g))); + } + } + function Phn(n, t) { + var e, i, r, c; + for (n.c[t.p] = !0, eD(n.a, t), c = new pb(t.j); c.a < c.c.c.length; ) + for (e = new UV((r = Yx(Hz(c), 11)).b); ZC(e.a) || ZC(e.b); ) + (i = atn(r, Yx(ZC(e.a) ? Hz(e.a) : Hz(e.b), 17)).i), n.c[i.p] || Phn(n, i); + } + function Ihn(n) { + var t, i, r, c, a, u, o; + for (u = 0, i = new UO((!n.a && (n.a = new m_(uct, n, 10, 11)), n.a)); i.e != i.i.gc(); ) + (o = (t = Yx(hen(i), 33)).g), + (c = t.f), + (r = e.Math.sqrt(o * o + c * c)), + (u = e.Math.max(r, u)), + (a = Ihn(t)), + (u = e.Math.max(a, u)); + return u; + } + function Chn() { + (Chn = O), + (mit = new oP("OUTSIDE", 0)), + (pit = new oP("INSIDE", 1)), + (vit = new oP("NEXT_TO_PORT_IF_POSSIBLE", 2)), + (git = new oP("ALWAYS_SAME_SIDE", 3)), + (dit = new oP("ALWAYS_OTHER_SAME_SIDE", 4)), + (yit = new oP("SPACE_EFFICIENT", 5)); + } + function Ohn(n, t, e) { + var i, r, c, a; + return ( + $0( + (i = (function (n, t, e) { + var i; + return (i = itn(e)), Sgn(n.g, i, t), Sgn(n.i, t, e), t; + })(n, (xk(), (r = new xv()), !!e && Dbn(r, e), r), t)), + oX(t, rxn), + ), + eun(t, i), + (function (n, t) { + var e, i, r, c, a; + (c = uX(n, "individualSpacings")) && + (!zQ(t, (Cjn(), Htt)) && ((e = new Yu()), Aen(t, Htt, e)), + (r = Yx(jln(t, Htt), 373)), + (i = null), + (a = c) && (i = new nE(a, l2(a, VQ(fFn, TEn, 2, 0, 6, 1)))), + i && XW(i, new OP(a, r))); + })(t, i), + ihn(t, i), + (c = cX(t, "ports")), + (function (n, t, e) { + var i, r, c, a, u; + if (e) + for (c = ((i = new NK(e.a.length)).b - i.a) * i.c < 0 ? (PT(), Fot) : new oA(i); c.Ob(); ) + (r = aX(e, Yx(c.Pb(), 19).a)) && + ($0((a = DX(n, (xk(), (u = new Dv()), !!t && Mbn(u, t), u), r)), oX(r, rxn)), eun(r, a), ihn(r, a), D5(n, r, a)); + })((a = new $P(n, i)).a, a.b, c), + D5(n, t, i), + p4(n, t, i), + i + ); + } + function Ahn(n) { + var t, e, i, r, c; + if (null == n) return aEn; + for (c = new J3(tEn, "[", "]"), i = 0, r = (e = n).length; i < r; ++i) + (t = e[i]), c.a ? yI(c.a, c.b) : (c.a = new SA(c.d)), vI(c.a, "" + HK(t)); + return c.a ? (0 == c.e.length ? c.a.a : c.a.a + "" + c.e) : c.c; + } + function $hn(n, t) { + var i, r, c; + for (c = Yjn, r = new pb(b7(t)); r.a < r.c.c.length; ) + (i = Yx(Hz(r), 213)).f && !n.c[i.c] && ((n.c[i.c] = !0), (c = e.Math.min(c, $hn(n, T7(i, t))))); + return (n.i[t.d] = n.j), (n.g[t.d] = e.Math.min(c, n.j++)), n.g[t.d]; + } + function Lhn(n, t) { + var e, i, r; + for (r = Yx(Yx(_V(n.r, t), 21), 84).Kc(); r.Ob(); ) + (i = Yx(r.Pb(), 111)).e.b = (e = i.b).Xe((Cjn(), ytt)) + ? e.Hf() == (Ikn(), Tit) + ? -e.rf().b - ty(fL(e.We(ytt))) + : ty(fL(e.We(ytt))) + : e.Hf() == (Ikn(), Tit) + ? -e.rf().b + : 0; + } + function Nhn(n) { + var t; + if (((t = !1), CO(n, 204))) return (t = !0), Yx(n, 204).a; + if (!t && CO(n, 258) && Yx(n, 258).a % 1 == 0) + return ( + (t = !0), + d9( + (function (n) { + return oG((vB(n), n)); + })(Yx(n, 258).a), + ) + ); + throw hp(new hy("Id must be a string or an integer: '" + n + "'.")); + } + function xhn(n, t, e) { + var i, r, c, a, u; + if ((g0(e, "occurrences"), 0 == e)) return (u = Yx(x8(QH(n.a), t), 14)) ? u.gc() : 0; + if (!(a = Yx(x8(QH(n.a), t), 14))) return 0; + if (e >= (c = a.gc())) a.$b(); + else for (r = a.Kc(), i = 0; i < e; i++) r.Pb(), r.Qb(); + return c; + } + function Dhn(n) { + var t, e, i, r, c, a; + if (((a = 0), 0 == n.b)) { + for (t = 0, r = 0, c = (i = pin(n, !0)).length; r < c; ++r) (e = i[r]) > 0 && ((a += e), ++t); + t > 1 && (a += n.c * (t - 1)); + } else a = By(F2(lH(hH(X_(n.a), new Mn()), new Sn()))); + return a > 0 ? a + n.n.d + n.n.a : 0; + } + function Rhn(n) { + var t, e, i, r, c, a; + if (((a = 0), 0 == n.b)) a = By(F2(lH(hH(X_(n.a), new En()), new Tn()))); + else { + for (t = 0, r = 0, c = (i = vin(n, !0)).length; r < c; ++r) (e = i[r]) > 0 && ((a += e), ++t); + t > 1 && (a += n.c * (t - 1)); + } + return a > 0 ? a + n.n.b + n.n.c : 0; + } + function Khn(n) { + var t, e; + return ( + ((e = new Ay()).a += "e_"), + null != + (t = (function (n) { + return 0 != n.b.c.length && Yx(TR(n.b, 0), 70).a ? Yx(TR(n.b, 0), 70).a : IH(n); + })(n)) && (e.a += "" + t), + n.c && + n.d && + (yI(((e.a += " "), e), krn(n.c)), + yI(mI(((e.a += "["), e), n.c.i), "]"), + yI(((e.a += pIn), e), krn(n.d)), + yI(mI(((e.a += "["), e), n.d.i), "]")), + e.a + ); + } + function _hn(n) { + switch (n.g) { + case 0: + return new df(); + case 1: + return new gf(); + case 2: + return new wf(); + case 3: + return new pf(); + default: + throw hp(new Qm("No implementation is available for the layout phase " + (null != n.f ? n.f : "" + n.g))); + } + } + function Fhn(n, t, i, r, c) { + var a; + switch (((a = 0), c.g)) { + case 1: + a = e.Math.max(0, t.b + n.b - (i.b + r)); + break; + case 3: + a = e.Math.max(0, -n.b - r); + break; + case 2: + a = e.Math.max(0, -n.a - r); + break; + case 4: + a = e.Math.max(0, t.a + n.a - (i.a + r)); + } + return a; + } + function Bhn(n) { + var t, e; + switch (n.b) { + case -1: + return !0; + case 0: + return (e = n.t) > 1 || -1 == e || ((t = fcn(n)) && (TT(), t.Cj() == KDn)) ? ((n.b = -1), !0) : ((n.b = 1), !1); + default: + return !1; + } + } + function Hhn(n, t) { + var e, i, r, c; + if ((kjn(n), 0 != n.c || 123 != n.a)) throw hp(new wy(Kjn((GC(), Hxn)))); + if (((c = 112 == t), (i = n.d), (e = b$(n.i, 125, i)) < 0)) throw hp(new wy(Kjn((GC(), qxn)))); + return (r = l$(n.i, i, e)), (n.d = e + 1), bY(r, c, 512 == (512 & n.e)); + } + function qhn(n, t, e, i, r) { + var c, a, u, o; + return iI((o = nL(n, Yx(r, 56)))) !== iI(r) + ? ((u = Yx(n.g[e], 72)), + _O(n, e, zan(n, 0, (c = VX(t, o)))), + gC(n.e) && (Pan((a = Kq(n, 9, c.ak(), r, o, i, !1)), new yJ(n.e, 9, n.c, u, c, i, !1)), vJ(a)), + o) + : r; + } + function Ghn(n, t) { + var e, i; + try { + return (function (n, t) { + var e; + return T$(!!(e = (vB(n), n).g)), vB(t), e(t); + })(n.a, t); + } catch (r) { + if (CO((r = j4(r)), 32)) { + try { + if (((i = ipn(t, nTn, Yjn)), (e = Ak(n.a)), i >= 0 && i < e.length)) return e[i]; + } catch (n) { + if (!CO((n = j4(n)), 127)) throw hp(n); + } + return null; + } + throw hp(r); + } + } + function zhn(n, t) { + var e, i, r; + if ((r = iyn((wsn(), wut), n.Tg(), t))) + return ( + TT(), + Yx(r, 66).Oj() || (r = Bz(PJ(wut, r))), + (i = Yx((e = n.Yg(r)) >= 0 ? n._g(e, !0, !0) : tfn(n, r, !0), 153)), + Yx(i, 215).ll(t) + ); + throw hp(new Qm(mNn + t.ne() + jNn)); + } + function Uhn(n, t) { + var e, i, r; + if (((r = 0), (i = t[0]) >= n.length)) return -1; + for (Lz(i, n.length), e = n.charCodeAt(i); e >= 48 && e <= 57 && ((r = 10 * r + (e - 48)), !(++i >= n.length)); ) + Lz(i, n.length), (e = n.charCodeAt(i)); + return i > t[0] ? (t[0] = i) : (r = -1), r; + } + function Xhn(n, t, e) { + var i, r, c, a; + (c = n.c), + (a = n.d), + (r = ($5(x4(Gy(B7n, 1), TEn, 8, 0, [c.i.n, c.n, c.a])).b + $5(x4(Gy(B7n, 1), TEn, 8, 0, [a.i.n, a.n, a.a])).b) / 2), + (i = c.j == (Ikn(), Eit) ? new QS(t + c.i.c.c.a + e, r) : new QS(t - e, r)), + A$(n.a, 0, i); + } + function Whn(n) { + var t, e, i; + for ( + t = null, + e = W_( + n0(x4(Gy(QKn, 1), iEn, 20, 0, [(!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b), (!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c)])), + ); + Vfn(e); + + ) + if (((i = iun(Yx(kV(e), 82))), t)) { + if (t != i) return !1; + } else t = i; + return !0; + } + function Vhn(n, t, e) { + var i; + if ((++n.j, t >= n.i)) throw hp(new Hm(jxn + t + Exn + n.i)); + if (e >= n.i) throw hp(new Hm(Txn + e + Exn + n.i)); + return ( + (i = n.g[e]), + t != e && (t < e ? smn(n.g, t, n.g, t + 1, e - t) : smn(n.g, e + 1, n.g, e, t - e), DF(n.g, t, i), n.ei(t, i, e), n.ci()), + i + ); + } + function Qhn(n, t, e) { + var i; + if ((i = Yx(n.c.xc(t), 14))) return !!i.Fc(e) && (++n.d, !0); + if ((i = n.ic(t)).Fc(e)) return ++n.d, n.c.zc(t, i), !0; + throw hp(new eV("New Collection violated the Collection spec")); + } + function Yhn(n) { + var t, e, i; + return n < 0 + ? 0 + : 0 == n + ? 32 + : ((e = 16 - (t = (-(n >> 16) >> 16) & 16)), + (e += t = (((n >>= t) - 256) >> 16) & 8), + (e += t = (((n <<= t) - nMn) >> 16) & 4), + (e += t = (((n <<= t) - MEn) >> 16) & 2) + 2 - (t = (i = (n <<= t) >> 14) & ~(i >> 1))); + } + function Jhn(n) { + var t, e, i, r; + for ( + UH(), + Fqn = new ip(), + _qn = new rp(), + Kqn = new ip(), + !n.a && (n.a = new m_(uct, n, 10, 11)), + (function (n) { + var t, e, i, r, c, a, u, o, s, f; + for (t = new rp(), a = new UO(n); a.e != a.i.gc(); ) { + for ( + c = Yx(hen(a), 33), + e = new Qp(), + xB(_qn, c, e), + f = new ut(), + i = Yx( + kW( + new SR(null, new nF(new $K(bA(fbn(c).a.Kc(), new h())))), + iK(f, mY(new H(), new B(), new rn(), x4(Gy(wBn, 1), XEn, 132, 0, [(C6(), aBn)]))), + ), + 83, + ), + i0(e, Yx(i.xc((TA(), !0)), 14), new ot()), + r = Yx( + kW(hH(Yx(i.xc(!1), 15).Lc(), new st()), mY(new H(), new B(), new rn(), x4(Gy(wBn, 1), XEn, 132, 0, [aBn]))), + 15, + ).Kc(); + r.Ob(); + + ) + (s = _un(Yx(r.Pb(), 79))) && ((u = Yx(eI(Dq(t.f, s)), 21)) || ((u = Awn(s)), Ysn(t.f, s, u)), C2(e, u)); + for ( + i = Yx( + kW( + new SR(null, new nF(new $K(bA(lbn(c).a.Kc(), new h())))), + iK(f, mY(new H(), new B(), new rn(), x4(Gy(wBn, 1), XEn, 132, 0, [aBn]))), + ), + 83, + ), + i0(e, Yx(i.xc(!0), 14), new ht()), + o = Yx( + kW(hH(Yx(i.xc(!1), 15).Lc(), new ft()), mY(new H(), new B(), new rn(), x4(Gy(wBn, 1), XEn, 132, 0, [aBn]))), + 15, + ).Kc(); + o.Ob(); + + ) + (s = Fun(Yx(o.Pb(), 79))) && ((u = Yx(eI(Dq(t.f, s)), 21)) || ((u = Awn(s)), Ysn(t.f, s, u)), C2(e, u)); + } + })((t = n.a)), + r = new UO(t); + r.e != r.i.gc(); + + ) + (i = Yx(hen(r), 33)), -1 == hJ(Fqn, i, 0) && ((e = new ip()), eD(Kqn, e), $tn(i, e)); + return Kqn; + } + function Zhn(n, t) { + var i, r, c, a, u, o, s, h; + for (h = ty(fL(Aun(t, (gjn(), W0n)))), s = n[0].n.a + n[0].o.a + n[0].d.c + h, o = 1; o < n.length; o++) + (r = n[o].n), + (c = n[o].o), + (i = n[o].d), + (a = r.a - i.b - s) < 0 && (r.a -= a), + ((u = t.f).a = e.Math.max(u.a, r.a + c.a)), + (s = r.a + c.a + i.c + h); + } + function nfn(n, t) { + var i, r, c, a, u, o; + return ( + (r = Yx(Yx(BF(n.g, t.a), 46).a, 65)), + (c = Yx(Yx(BF(n.g, t.b), 46).a, 65)), + (i = (function (n, t) { + var i, r, c, a, u, o; + return ( + udn(), + (a = t.c - (n.c + n.b)), + (c = n.c - (t.c + t.b)), + (u = n.d - (t.d + t.a)), + (i = t.d - (n.d + n.a)), + (r = e.Math.max(c, a)), + (o = e.Math.max(u, i)), + XC(), + o0(UAn), + ((e.Math.abs(r) <= UAn || 0 == r || (isNaN(r) && isNaN(0)) ? 0 : r < 0 ? -1 : r > 0 ? 1 : QI(isNaN(r), isNaN(0))) >= 0) ^ + (o0(UAn), + (e.Math.abs(o) <= UAn || 0 == o || (isNaN(o) && isNaN(0)) ? 0 : o < 0 ? -1 : o > 0 ? 1 : QI(isNaN(o), isNaN(0))) >= 0) + ? e.Math.max(o, r) + : (o0(UAn), + (e.Math.abs(r) <= UAn || 0 == r || (isNaN(r) && isNaN(0)) ? 0 : r < 0 ? -1 : r > 0 ? 1 : QI(isNaN(r), isNaN(0))) > 0 + ? e.Math.sqrt(o * o + r * r) + : -e.Math.sqrt(o * o + r * r)) + ); + })((a = r.b), (u = c.b))) >= 0 + ? i + : ((o = fB(yN(new QS(u.c + u.b / 2, u.d + u.a / 2), new QS(a.c + a.b / 2, a.d + a.a / 2)))), -(Ppn(a, u) - 1) * o) + ); + } + function tfn(n, t, e) { + var i, r, c; + if ((c = iyn((wsn(), wut), n.Tg(), t))) + return ( + TT(), + Yx(c, 66).Oj() || (c = Bz(PJ(wut, c))), + (r = Yx((i = n.Yg(c)) >= 0 ? n._g(i, !0, !0) : tfn(n, c, !0), 153)), + Yx(r, 215).hl(t, e) + ); + throw hp(new Qm(mNn + t.ne() + jNn)); + } + function efn(n, t, e, i) { + var r, c, a, u, o; + if ((r = n.d[t])) + if (((c = r.g), (o = r.i), null != i)) { + for (u = 0; u < o; ++u) if ((a = Yx(c[u], 133)).Sh() == e && Q8(i, a.cd())) return a; + } else for (u = 0; u < o; ++u) if (iI((a = Yx(c[u], 133)).cd()) === iI(i)) return a; + return null; + } + function ifn(n, t) { + var e; + if (t < 0) throw hp(new Bm("Negative exponent")); + if (0 == t) return bFn; + if (1 == t || q7(n, bFn) || q7(n, pFn)) return n; + if (!Ufn(n, 0)) { + for (e = 1; !Ufn(n, e); ) ++e; + return uZ( + (function (n) { + var t, e, i; + return n < gFn.length + ? gFn[n] + : ((t = 31 & n), ((i = VQ(Wot, MTn, 25, 1 + (e = n >> 5), 15, 1))[e] = 1 << t), new C_(1, e + 1, i)); + })(e * t), + ifn(yV(n, e), t), + ); + } + return (function (n, t) { + var e, i; + for (jfn(), bdn(), i = bFn, e = n; t > 1; t >>= 1) + 0 != (1 & t) && (i = uZ(i, e)), (e = 1 == e.d ? uZ(e, e) : new Mtn(fpn(e.a, e.d, VQ(Wot, MTn, 25, e.d << 1, 15, 1)))); + return uZ(i, e); + })(n, t); + } + function rfn(n) { + var t, e, i; + for ( + WE(), this.b = szn, this.c = (t9(), tet), this.f = (XE(), czn), this.a = n, Yy(this, new It()), qbn(this), i = new pb(n.b); + i.a < i.c.c.length; + + ) + (e = Yx(Hz(i), 81)).d || ((t = new Ttn(x4(Gy(hzn, 1), iEn, 81, 0, [e]))), eD(n.a, t)); + } + function cfn(n, t, e) { + var i, r, c, a, u, o; + if (!n || 0 == n.c.length) return null; + for (c = new qq(t, !e), r = new pb(n); r.a < r.c.c.length; ) (i = Yx(Hz(r), 70)), Fon(c, (qE(), new hw(i))); + return ((a = c.i).a = ((o = c.n), c.e.b + o.d + o.a)), (a.b = ((u = c.n), c.e.a + u.b + u.c)), c; + } + function afn(n) { + var t, e, i, r, c, a, u; + for (uC((u = OU(n.a)), new Pe()), e = null, c = 0, a = (r = u).length; c < a && (i = r[c]).k == (bon(), _zn); ++c) + ((t = Yx(Aun(i, (Ojn(), hQn)), 61)) != (Ikn(), qit) && t != Eit) || (e && Yx(Aun(e, mQn), 15).Fc(i), (e = i)); + } + function ufn(n) { + var t; + if (n.c || null != n.g) { + if (null == n.g) return !0; + if (0 == n.i) return !1; + t = Yx(n.g[n.i - 1], 47); + } else (n.d = n.si(n.f)), fY(n, n.d), (t = n.d); + return t == n.b && null.km >= null.jm() ? (abn(n), ufn(n)) : t.Ob(); + } + function ofn(n, t, i) { + var r, c, a, u; + if ( + (!(u = i) && (u = xD(new am(), 0)), + run(u, rIn, 1), + $yn(n.c, t), + 1 == + (a = (function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b; + if ( + ((n.c = n.d), + (l = null == (b = hL(Aun(t, (gjn(), C0n)))) || (vB(b), b)), + (c = Yx(Aun(t, (Ojn(), bQn)), 21).Hc((edn(), SVn))), + (e = !((r = Yx(Aun(t, g0n), 98)) == (Ran(), uit) || r == sit || r == oit)), + !l || (!e && c)) + ) + f = new ay(x4(Gy(Dzn, 1), bIn, 37, 0, [t])); + else { + for (h = new pb(t.a); h.a < h.c.c.length; ) Yx(Hz(h), 10).p = 0; + for (f = new ip(), s = new pb(t.a); s.a < s.c.c.length; ) + if ((i = wpn(n, Yx(Hz(s), 10), null))) { + for (o4((o = new k0()), t), b5(o, uQn, Yx(i.b, 21)), HH(o.d, t.d), b5(o, e0n, null), u = Yx(i.a, 15).Kc(); u.Ob(); ) + (a = Yx(u.Pb(), 10)), eD(o.a, a), (a.a = o); + f.Fc(o); + } + c && (iI(Aun(t, HZn)) === iI((e9(), Szn)) ? (n.c = n.b) : (n.c = n.a)); + } + return iI(Aun(t, HZn)) !== iI((e9(), Izn)) && (XH(), f.ad(new xt())), f; + })(n.a, t)).gc()) + ) + xmn(Yx(a.Xb(0), 37), u); + else for (c = 1 / a.gc(), r = a.Kc(); r.Ob(); ) xmn(Yx(r.Pb(), 37), J2(u, c)); + (function (n, t, e) { + n.c.lf(t, e); + })(n.a, a, t), + (function (n) { + var t, i, r, c, a; + (c = Yx(Aun(n, (gjn(), n0n)), 21)), + (a = Yx(Aun(n, i0n), 21)), + (t = new fC((i = new QS(n.f.a + n.d.b + n.d.c, n.f.b + n.d.d + n.d.a)))), + c.Hc((Ann(), Yit)) && + ((r = Yx(Aun(n, e0n), 8)), + a.Hc((Vgn(), crt)) && (r.a <= 0 && (r.a = 20), r.b <= 0 && (r.b = 20)), + (t.a = e.Math.max(i.a, r.a)), + (t.b = e.Math.max(i.b, r.b))), + ny(hL(Aun(n, t0n))) || + (function (n, t, e) { + var i, r, c, a, u; + if ( + ((i = Yx(Aun(n, (gjn(), WZn)), 21)), + e.a > t.a && (i.Hc((dan(), ont)) ? (n.c.a += (e.a - t.a) / 2) : i.Hc(hnt) && (n.c.a += e.a - t.a)), + e.b > t.b && (i.Hc((dan(), lnt)) ? (n.c.b += (e.b - t.b) / 2) : i.Hc(fnt) && (n.c.b += e.b - t.b)), + Yx(Aun(n, (Ojn(), bQn)), 21).Hc((edn(), SVn)) && (e.a > t.a || e.b > t.b)) + ) + for (u = new pb(n.a); u.a < u.c.c.length; ) + (a = Yx(Hz(u), 10)).k == (bon(), _zn) && + ((r = Yx(Aun(a, hQn), 61)) == (Ikn(), Eit) ? (a.n.a += e.a - t.a) : r == Bit && (a.n.b += e.b - t.b)); + (c = n.d), (n.f.a = e.a - c.b - c.c), (n.f.b = e.b - c.d - c.a); + })(n, i, t); + })(t), + Ron(u); + } + function sfn(n) { + if (((this.a = n), n.c.i.k == (bon(), _zn))) (this.c = n.c), (this.d = Yx(Aun(n.c.i, (Ojn(), hQn)), 61)); + else { + if (n.d.i.k != _zn) throw hp(new Qm("Edge " + n + " is not an external edge.")); + (this.c = n.d), (this.d = Yx(Aun(n.d.i, (Ojn(), hQn)), 61)); + } + } + function hfn(n, t) { + var e, i, r; + (r = n.b), + (n.b = t), + 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 3, r, n.b)), + t + ? t != n && (E2(n, t.zb), K1(n, t.d), F0(n, null == (e = null == (i = t.c) ? t.zb : i) || _N(e, t.zb) ? null : e)) + : (E2(n, null), K1(n, 0), F0(n, null)); + } + function ffn(n) { + var t, e; + if (n.f) { + for (; n.n < n.o; ) { + if ( + CO((e = (t = Yx(n.j ? n.j.pi(n.n) : n.k.Xb(n.n), 72)).ak()), 99) && + 0 != (Yx(e, 18).Bb & MNn) && + (!n.e || e.Gj() != Vrt || 0 != e.aj()) && + null != t.dd() + ) + return !0; + ++n.n; + } + return !1; + } + return n.n < n.o; + } + function lfn(n, t) { + var e; + (this.e = (VF(), MF(n), VF(), enn(n))), + (this.c = (MF(t), enn(t))), + yA(this.e.Hd().dc() == this.c.Hd().dc()), + (this.d = f7(this.e)), + (this.b = f7(this.c)), + (e = fR(UKn, [TEn, iEn], [5, 1], 5, [this.e.Hd().gc(), this.c.Hd().gc()], 2)), + (this.a = e), + (function (n) { + var t, e, i, r; + for (i = 0, r = (e = n.a).length; i < r; ++i) cF((t = e[i]), t.length, null); + })(this); + } + function bfn(n) { + var t; + !w_n && + (((t = [ + "\\u0000", + "\\u0001", + "\\u0002", + "\\u0003", + "\\u0004", + "\\u0005", + "\\u0006", + "\\u0007", + "\\b", + "\\t", + "\\n", + "\\u000B", + "\\f", + "\\r", + "\\u000E", + "\\u000F", + "\\u0010", + "\\u0011", + "\\u0012", + "\\u0013", + "\\u0014", + "\\u0015", + "\\u0016", + "\\u0017", + "\\u0018", + "\\u0019", + "\\u001A", + "\\u001B", + "\\u001C", + "\\u001D", + "\\u001E", + "\\u001F", + ])[34] = '\\"'), + (t[92] = "\\\\"), + (t[173] = "\\u00ad"), + (t[1536] = "\\u0600"), + (t[1537] = "\\u0601"), + (t[1538] = "\\u0602"), + (t[1539] = "\\u0603"), + (t[1757] = "\\u06dd"), + (t[1807] = "\\u070f"), + (t[6068] = "\\u17b4"), + (t[6069] = "\\u17b5"), + (t[8203] = "\\u200b"), + (t[8204] = "\\u200c"), + (t[8205] = "\\u200d"), + (t[8206] = "\\u200e"), + (t[8207] = "\\u200f"), + (t[8232] = "\\u2028"), + (t[8233] = "\\u2029"), + (t[8234] = "\\u202a"), + (t[8235] = "\\u202b"), + (t[8236] = "\\u202c"), + (t[8237] = "\\u202d"), + (t[8238] = "\\u202e"), + (t[8288] = "\\u2060"), + (t[8289] = "\\u2061"), + (t[8290] = "\\u2062"), + (t[8291] = "\\u2063"), + (t[8292] = "\\u2064"), + (t[8298] = "\\u206a"), + (t[8299] = "\\u206b"), + (t[8300] = "\\u206c"), + (t[8301] = "\\u206d"), + (t[8302] = "\\u206e"), + (t[8303] = "\\u206f"), + (t[65279] = "\\ufeff"), + (t[65529] = "\\ufff9"), + (t[65530] = "\\ufffa"), + (t[65531] = "\\ufffb"), + (w_n = t)); + return ( + '"' + + n.replace( + /[\x00-\x1f\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200b-\u200f\u2028-\u202e\u2060-\u2064\u206a-\u206f\ufeff\ufff9-\ufffb"\\]/g, + function (n) { + return (function (n, t) { + var e = w_n[n.charCodeAt(0)]; + return null == e ? n : e; + })(n); + }, + ) + + '"' + ); + } + function wfn(n) { + var t, e; + for ( + VH(), this.b = TBn, this.c = SBn, this.g = (GE(), EBn), this.d = (t9(), tet), this.a = n, Hbn(this), e = new pb(n.b); + e.a < e.c.c.length; + + ) + !(t = Yx(Hz(e), 57)).a && FA(Z1(new av(), x4(Gy(PBn, 1), iEn, 57, 0, [t])), n), (t.e = new Tq(t.d)); + } + function dfn() { + (dfn = O), + (Put = Yx(c1(aq((_k(), Aut).qb), 6), 34)), + (Tut = Yx(c1(aq(Aut.qb), 3), 34)), + (Mut = Yx(c1(aq(Aut.qb), 4), 34)), + (Sut = Yx(c1(aq(Aut.qb), 5), 18)), + fan(Put), + fan(Tut), + fan(Mut), + fan(Sut), + (Iut = new ay(x4(Gy(tat, 1), VDn, 170, 0, [Put, Tut]))); + } + function gfn(n, t) { + var e; + (this.d = new Mv()), + (this.b = t), + (this.e = new fC(t.qf())), + (e = n.u.Hc((Chn(), vit))), + n.u.Hc(pit) + ? n.D + ? (this.a = e && !t.If()) + : (this.a = !0) + : n.u.Hc(mit) + ? (this.a = !!e && !(t.zf().Kc().Ob() || t.Bf().Kc().Ob())) + : (this.a = !1); + } + function pfn(n, t) { + var e, i, r, c; + for (e = n.o.a, c = Yx(Yx(_V(n.r, t), 21), 84).Kc(); c.Ob(); ) + (r = Yx(c.Pb(), 111)).e.a = (i = r.b).Xe((Cjn(), ytt)) + ? i.Hf() == (Ikn(), qit) + ? -i.rf().a - ty(fL(i.We(ytt))) + : e + ty(fL(i.We(ytt))) + : i.Hf() == (Ikn(), qit) + ? -i.rf().a + : e; + } + function vfn(n, t) { + var e, i, r; + (e = Yx(Aun(n, (gjn(), a1n)), 103)), + (r = Yx(jln(t, k0n), 61)), + (i = Yx(Aun(n, g0n), 98)) != (Ran(), fit) && i != lit + ? r == (Ikn(), Hit) && (r = Zpn(t, e)) == Hit && (r = G7(e)) + : (r = Nmn(t) > 0 ? G7(e) : O9(G7(e))), + Aen(t, k0n, r); + } + function mfn(n, t) { + var e, i, r, c, a; + for (a = n.j, t.a != t.b && JC(a, new Ur()), r = (a.c.length / 2) | 0, i = 0; i < r; i++) + $z(i, a.c.length), (c = Yx(a.c[i], 113)).c && whn(c.d, t.a); + for (e = r; e < a.c.length; e++) $z(e, a.c.length), (c = Yx(a.c[e], 113)).c && whn(c.d, t.b); + } + function yfn(n, t) { + var e, i, r, c; + n.ej() + ? ((e = n.Vi()), + (c = n.fj()), + ++n.j, + n.Hi(e, n.oi(e, t)), + (i = n.Zi(3, null, t, e, c)), + n.bj() && (r = n.cj(t, null)) ? (r.Ei(i), r.Fi()) : n.$i(i)) + : (eB(n, t), n.bj() && (r = n.cj(t, null)) && r.Fi()); + } + function kfn(n, t) { + var e, i, r, c, a; + for (a = dwn(n.e.Tg(), t), r = new go(), e = Yx(n.g, 119), c = n.i; --c >= 0; ) (i = e[c]), a.rl(i.ak()) && fY(r, i); + !Xkn(n, r) && gC(n.e) && Xp(n, t.$j() ? Kq(n, 6, t, (XH(), TFn), null, -1, !1) : Kq(n, t.Kj() ? 2 : 1, t, null, null, -1, !1)); + } + function jfn() { + var n, t; + for (jfn = O, kFn = VQ(EFn, TEn, 91, 32, 0, 1), jFn = VQ(EFn, TEn, 91, 32, 0, 1), n = 1, t = 0; t <= 18; t++) + (kFn[t] = Utn(n)), (jFn[t] = Utn(GK(n, t))), (n = e7(n, 5)); + for (; t < jFn.length; t++) (kFn[t] = uZ(kFn[t - 1], kFn[1])), (jFn[t] = uZ(jFn[t - 1], (bdn(), dFn))); + } + function Efn(n, t) { + var e, i, r, c; + return ( + n.a == (uon(), mVn) || + ((r = t.a.c), + (e = t.a.c + t.a.b), + !( + (t.j && ((c = (i = t.A).c.c.a - i.o.a / 2), r - (i.n.a + i.o.a) > c)) || + (t.q && ((c = (i = t.C).c.c.a - i.o.a / 2), i.n.a - e > c)) + )) + ); + } + function Tfn(n) { + var t, e, i, r, c, a; + for (lz(), e = new bW(), i = new pb(n.e.b); i.a < i.c.c.length; ) + for (c = new pb(Yx(Hz(i), 29).a); c.a < c.c.c.length; ) + (r = Yx(Hz(c), 10)), (t = Yx(UJ(e, (a = n.g[r.p])), 15)) || Gtn(e, a, (t = new ip())), t.Fc(r); + return e; + } + function Mfn(n) { + var t; + return 0 != (64 & n.Db) + ? Kln(n) + : (((t = new MA(Kln(n))).a += " (startX: "), + Jk(t, n.j), + (t.a += ", startY: "), + Jk(t, n.k), + (t.a += ", endX: "), + Jk(t, n.b), + (t.a += ", endY: "), + Jk(t, n.c), + (t.a += ", identifier: "), + pI(t, n.d), + (t.a += ")"), + t.a); + } + function Sfn(n) { + var t; + return 0 != (64 & n.Db) + ? B8(n) + : (((t = new MA(B8(n))).a += " (ordered: "), + nj(t, 0 != (256 & n.Bb)), + (t.a += ", unique: "), + nj(t, 0 != (512 & n.Bb)), + (t.a += ", lowerBound: "), + Zk(t, n.s), + (t.a += ", upperBound: "), + Zk(t, n.t), + (t.a += ")"), + t.a); + } + function Pfn(n, t, e, i, r, c, a, u) { + var o; + return ( + CO(n.Cb, 88) && rhn(bV(Yx(n.Cb, 88)), 4), + E2(n, e), + (n.f = i), + D9(n, r), + K9(n, c), + x9(n, a), + R9(n, !1), + l9(n, !0), + H9(n, u), + s9(n, !0), + _1(n, 0), + (n.b = 0), + F1(n, 1), + (o = fun(n, t, null)) && o.Fi(), + q9(n, !1), + n + ); + } + function Ifn(n, t) { + var i, r; + return ( + Yx(aG(n.a, t), 512) || + ((i = new aV(t)), + uV(), + (function (n, t) { + hBn || (t && (n.d = t)); + })(i, Ifn(n, l$((r = hBn ? null : i.c), 0, e.Math.max(0, LA(r, gun(46)))))), + 0 == (hBn ? null : i.c).length && CL(i, new X()), + GG(n.a, hBn ? null : i.c, i), + i) + ); + } + function Cfn(n, t) { + var i; + (n.b = t), + (n.g = new ip()), + (i = (function (n) { + var t, i, r, c, a, u, o, s, h, f, l; + for (f = 0, h = 0, o = (c = n.a).a.gc(), r = c.a.ec().Kc(); r.Ob(); ) + (i = Yx(r.Pb(), 561)).b && tmn(i), (f += (l = (t = i.a).a) + (u = t.b)), (h += l * u); + return (s = e.Math.sqrt(400 * o * h - 4 * h + f * f) + f), 0 == (a = 2 * (100 * o - 1)) ? s : s / a; + })(n.b)), + (n.e = i), + (n.f = i), + (n.c = ny(hL(Aun(n.b, (pcn(), DBn))))), + (n.a = fL(Aun(n.b, (Cjn(), mnt)))), + null == n.a && (n.a = 1), + ty(n.a) > 1 ? (n.e *= ty(n.a)) : (n.f /= ty(n.a)), + (function (n) { + var t, e; + for (t = n.b.a.a.ec().Kc(); t.Ob(); ) (e = new nbn(Yx(t.Pb(), 561), n.e, n.f)), eD(n.g, e); + })(n), + gtn(n), + (function (n) { + var t, i, r, c, a, u, o, s, h, f; + for ( + i = (function (n) { + var t, i, r, c, a, u, o, s, h, f; + for (i = n.o, t = n.p, u = Yjn, c = nTn, o = Yjn, a = nTn, h = 0; h < i; ++h) + for (f = 0; f < t; ++f) + Nin(n, h, f) && ((u = e.Math.min(u, h)), (c = e.Math.max(c, h)), (o = e.Math.min(o, f)), (a = e.Math.max(a, f))); + return (s = c - u + 1), (r = a - o + 1), new jH(d9(u), d9(o), d9(s), d9(r)); + })(n.d), + a = (c = Yx(Aun(n.b, (len(), $qn)), 116)).b + c.c, + u = c.d + c.a, + s = i.d.a * n.e + a, + o = i.b.a * n.f + u, + (function (n, t) { + n.b = t; + })(n.b, new QS(s, o)), + f = new pb(n.g); + f.a < f.c.c.length; + + ) + (t = mN( + L$(new QS((h = Yx(Hz(f), 562)).g - i.a.a, h.i - i.c.a), h.a, h.b), + KO(N$(dO(KC(h.e)), h.d * h.a, h.c * h.b), -0.5), + )), + (r = _C(h.e)), + Jy(h.e, yN(t, r)); + })(n), + b5(n.b, (len(), Oqn), n.g); + } + function Ofn(n, t, e) { + var i, r, c, a, u; + for (i = 0, u = e, t || ((i = e * (n.c.length - 1)), (u *= -1)), c = new pb(n); c.a < c.c.c.length; ) { + for (b5((r = Yx(Hz(c), 10)), (gjn(), xZn), (qen(), G7n)), r.o.a = i, a = $on(r, (Ikn(), Eit)).Kc(); a.Ob(); ) + Yx(a.Pb(), 11).n.a = i; + i += u; + } + } + function Afn(n, t, e) { + var i, r, c; + n.ej() + ? ((c = n.fj()), + X8(n, t, e), + (i = n.Zi(3, null, e, t, c)), + n.bj() ? ((r = n.cj(e, null)), n.ij() && (r = n.jj(e, r)), r ? (r.Ei(i), r.Fi()) : n.$i(i)) : n.$i(i)) + : (X8(n, t, e), n.bj() && (r = n.cj(e, null)) && r.Fi()); + } + function $fn(n, t, e) { + var i, r, c, a, u, o; + return (u = n.Gk(e)) != e + ? ((a = n.g[t]), + (o = u), + _O(n, t, n.oi(t, o)), + (c = a), + n.gi(t, o, c), + n.rk() && ((i = e), (r = n.dj(i, null)), !Yx(u, 49).eh() && (r = n.cj(o, r)), r && r.Fi()), + gC(n.e) && Xp(n, n.Zi(9, e, u, t, !1)), + u) + : e; + } + function Lfn(n) { + var t, e, i, r, c; + if (((e = new cx((t = Yx(Ak(trt), 9)), Yx(eN(t, t.length), 9), 0)), (c = Yx(Aun(n, (Ojn(), RQn)), 10)))) + for (r = new pb(c.j); r.a < r.c.c.length; ) iI(Aun((i = Yx(Hz(r), 11)), CQn)) === iI(n) && YA(new UV(i.b)) && n2(e, i.j); + return e; + } + function Nfn(n, t, e) { + var i, r, c, a; + if (!n.d[e.p]) { + for (i = new $K(bA(o7(e).a.Kc(), new h())); Vfn(i); ) { + for (c = new $K(bA(u7((a = Yx(kV(i), 17).d.i)).a.Kc(), new h())); Vfn(c); ) (r = Yx(kV(c), 17)).c.i == t && (n.a[r.p] = !0); + Nfn(n, t, a); + } + n.d[e.p] = !0; + } + } + function xfn(n) { + var t; + switch (((t = 0), n)) { + case 105: + t = 2; + break; + case 109: + t = 8; + break; + case 115: + t = 4; + break; + case 120: + t = 16; + break; + case 117: + t = 32; + break; + case 119: + t = 64; + break; + case 70: + t = 256; + break; + case 72: + t = 128; + break; + case 88: + t = 512; + break; + case 44: + t = DNn; + } + return t; + } + function Dfn(n, t) { + 0 != t.b && + (isNaN(n.s) ? (n.s = ty((S$(0 != t.b), fL(t.a.a.c)))) : (n.s = e.Math.min(n.s, ty((S$(0 != t.b), fL(t.a.a.c))))), + isNaN(n.c) ? (n.c = ty((S$(0 != t.b), fL(t.c.b.c)))) : (n.c = e.Math.max(n.c, ty((S$(0 != t.b), fL(t.c.b.c)))))); + } + function Rfn(n) { + var t, e, i; + for ( + t = null, + e = W_( + n0(x4(Gy(QKn, 1), iEn, 20, 0, [(!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b), (!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c)])), + ); + Vfn(e); + + ) + if (((i = iun(Yx(kV(e), 82))), t)) { + if (t != IG(i)) return !0; + } else t = IG(i); + return !1; + } + function Kfn(n, t) { + var e, i, r, c; + n.ej() + ? ((e = n.i), + (c = n.fj()), + NV(n, t), + (i = n.Zi(3, null, t, e, c)), + n.bj() ? ((r = n.cj(t, null)), n.ij() && (r = n.jj(t, r)), r ? (r.Ei(i), r.Fi()) : n.$i(i)) : n.$i(i)) + : (NV(n, t), n.bj() && (r = n.cj(t, null)) && r.Fi()); + } + function _fn(n, t, e) { + var i, r, c; + n.ej() + ? ((c = n.fj()), + ++n.j, + n.Hi(t, n.oi(t, e)), + (i = n.Zi(3, null, e, t, c)), + n.bj() && (r = n.cj(e, null)) ? (r.Ei(i), r.Fi()) : n.$i(i)) + : (++n.j, n.Hi(t, n.oi(t, e)), n.bj() && (r = n.cj(e, null)) && r.Fi()); + } + function Ffn(n) { + var t; + if (!n.a) throw hp(new Ym("IDataType class expected for layout option " + n.f)); + if ( + null == + (t = (function (n) { + return _G(), P_(Sct, n) ? Yx(BF(Sct, n), 331).ug() : null; + })(n.a)) + ) + throw hp(new Ym("Couldn't create new instance of property '" + n.f + "'. " + mLn + (sL(Ict), Ict.k) + yLn)); + return Yx(t, 414); + } + function Bfn(n) { + var t, e, i, r, c; + return (c = n.eh()) && c.kh() && (r = P8(n, c)) != c + ? ((e = n.Vg()), + (i = (t = n.Vg()) >= 0 ? n.Qg(null) : n.eh().ih(n, -1 - t, null, null)), + n.Rg(Yx(r, 49), e), + i && i.Fi(), + n.Lg() && n.Mg() && e > -1 && K3(n, new p_(n, 9, e, c, r)), + r) + : c; + } + function Hfn(n) { + var t, e, i, r, c, a, u; + for (c = 0, r = n.f.e, e = 0; e < r.c.length; ++e) + for ($z(e, r.c.length), a = Yx(r.c[e], 144), i = e + 1; i < r.c.length; ++i) + $z(i, r.c.length), (u = Yx(r.c[i], 144)), (t = cY(a.d, u.d) - n.a[a.b][u.b]), (c += n.i[a.b][u.b] * t * t); + return c; + } + function qfn(n, t) { + var e; + if ( + !O$(t, (gjn(), x1n)) && + ((e = (function (n, t) { + switch (n.g) { + case 0: + return t == (d7(), nYn) ? vXn : mXn; + case 1: + return t == (d7(), nYn) ? vXn : pXn; + case 2: + return t == (d7(), nYn) ? pXn : mXn; + default: + return pXn; + } + })(Yx(Aun(t, gXn), 360), Yx(Aun(n, x1n), 163))), + b5(t, gXn, e), + !Vfn(new $K(bA(a7(t).a.Kc(), new h())))) + ) + switch (e.g) { + case 1: + b5(t, x1n, (d7(), ZQn)); + break; + case 2: + b5(t, x1n, (d7(), tYn)); + } + } + function Gfn() { + Iun.call(this, xNn, (xk(), Ort)), + (this.p = null), + (this.a = null), + (this.f = null), + (this.n = null), + (this.g = null), + (this.c = null), + (this.i = null), + (this.j = null), + (this.d = null), + (this.b = null), + (this.e = null), + (this.k = null), + (this.o = null), + (this.s = null), + (this.q = !1), + (this.r = !1); + } + function zfn() { + (zfn = O), + (vct = new _P(cCn, 0)), + (dct = new _P("INSIDE_SELF_LOOPS", 1)), + (gct = new _P("MULTI_EDGES", 2)), + (wct = new _P("EDGE_LABELS", 3)), + (pct = new _P("PORTS", 4)), + (lct = new _P("COMPOUND", 5)), + (fct = new _P("CLUSTERS", 6)), + (bct = new _P("DISCONNECTED", 7)); + } + function Ufn(n, t) { + var e, i, r; + if (0 == t) return 0 != (1 & n.a[0]); + if (t < 0) throw hp(new Bm("Negative bit address")); + if ((r = t >> 5) >= n.d) return n.e < 0; + if (((e = n.a[r]), (t = 1 << (31 & t)), n.e < 0)) { + if (r < (i = r3(n))) return !1; + e = i == r ? -e : ~e; + } + return 0 != (e & t); + } + function Xfn(n, t) { + var e, i, r, c, a, u, o; + if ((c = t.e)) + for (e = Bfn(c), i = Yx(n.g, 674), a = 0; a < n.i; ++a) + if ( + win((o = i[a])) == e && + (!o.d && (o.d = new XO(hat, o, 1)), (r = o.d), (u = Yx(e.ah(Ign(c, c.Cb, c.Db >> 16)), 15).Xc(c)) < r.i) + ) + return Xfn(n, Yx(c1(r, u), 87)); + return t; + } + function Wfn(n, t, e) { + var i, + r = Bjn, + c = r[n], + a = c instanceof Array ? c[0] : null; + c && !a + ? (Fjn = c) + : (!(i = t && t.prototype) && (i = Bjn[t]), + ((Fjn = (function (n) { + function t() {} + return (t.prototype = n || {}), new t(); + })(i)).hm = e), + !t && (Fjn.im = C), + (r[n] = Fjn)); + for (var u = 3; u < arguments.length; ++u) arguments[u].prototype = Fjn; + a && (Fjn.gm = a); + } + function Vfn(n) { + for (var t; !Yx(MF(n.a), 47).Ob(); ) { + if (((n.d = e6(n)), !n.d)) return !1; + if (((n.a = Yx(n.d.Pb(), 47)), CO(n.a, 39))) { + if (((t = Yx(n.a, 39)), (n.a = t.a), !n.b && (n.b = new ep()), OX(n.b, n.d), t.b)) + for (; !ry(t.b); ) OX(n.b, Yx(L_(t.b), 47)); + n.d = t.d; + } + } + return !0; + } + function Qfn(n, t) { + var e, i, r, c, a; + for (c = null == t ? 0 : n.b.se(t), i = null == (e = n.a.get(c)) ? new Array() : e, a = 0; a < i.length; a++) + if (((r = i[a]), n.b.re(t, r.cd()))) + return 1 == i.length ? ((i.length = 0), JL(n.a, c)) : i.splice(a, 1), --n.c, gq(n.b), r.dd(); + return null; + } + function Yfn(n, t) { + var e, i, r, c; + for (r = 1, t.j = !0, c = null, i = new pb(b7(t)); i.a < i.c.c.length; ) + (e = Yx(Hz(i), 213)), + n.c[e.c] || + ((n.c[e.c] = !0), + (c = T7(e, t)), + e.f ? (r += Yfn(n, c)) : c.j || e.a != e.e.e - e.d.e || ((e.f = !0), __(n.p, e), (r += Yfn(n, c)))); + return r; + } + function Jfn(n) { + var t, i, r, c, a; + if (((a = mpn(n, (c = new ip()))), (t = Yx(Aun(n, (Ojn(), RQn)), 10)))) + for (r = new pb(t.j); r.a < r.c.c.length; ) iI(Aun((i = Yx(Hz(r), 11)), CQn)) === iI(n) && (a = e.Math.max(a, mpn(i, c))); + return 0 == c.c.length || b5(n, PQn, a), -1 != a ? c : null; + } + function Zfn(n, t, e) { + var i, r, c, a, u, o; + (r = (i = (c = Yx(TR(t.e, 0), 17).c).i).k), + (u = (a = (o = Yx(TR(e.g, 0), 17).d).i).k), + r == (bon(), Bzn) ? b5(n, (Ojn(), TQn), Yx(Aun(i, TQn), 11)) : b5(n, (Ojn(), TQn), c), + b5(n, (Ojn(), MQn), u == Bzn ? Yx(Aun(a, MQn), 11) : o); + } + function nln(n, t) { + var e, i, r, c; + for ( + e = (c = WR(e7(BEn, HB(WR(e7(null == t ? 0 : W5(t), HEn)), 15)))) & (n.b.length - 1), r = null, i = n.b[e]; + i; + r = i, i = i.a + ) + if (i.d == c && bB(i.i, t)) return r ? (r.a = i.a) : (n.b[e] = i.a), Sy(i.c, i.f), kp(i.b, i.e), --n.f, ++n.e, !0; + return !1; + } + function tln(n, t) { + var e, i, r, c, a; + return ( + (t &= 63), + (i = 0 != ((e = n.h) & qTn)) && (e |= -1048576), + t < 22 + ? ((a = e >> t), (c = (n.m >> t) | (e << (22 - t))), (r = (n.l >> t) | (n.m << (22 - t)))) + : t < 44 + ? ((a = i ? HTn : 0), (c = e >> (t - 22)), (r = (n.m >> (t - 22)) | (e << (44 - t)))) + : ((a = i ? HTn : 0), (c = i ? BTn : 0), (r = e >> (t - 44))), + rO(r & BTn, c & BTn, a & HTn) + ); + } + function eln(n) { + var t, i, r, c, a, u; + for (this.c = new ip(), this.d = n, r = JTn, c = JTn, t = ZTn, i = ZTn, u = Ztn(n, 0); u.b != u.d.c; ) + (a = Yx(IX(u), 8)), (r = e.Math.min(r, a.a)), (c = e.Math.min(c, a.b)), (t = e.Math.max(t, a.a)), (i = e.Math.max(i, a.b)); + this.a = new mH(r, c, t - r, i - c); + } + function iln(n, t) { + var e, i, r, c; + for (i = new pb(n.b); i.a < i.c.c.length; ) + for (c = new pb(Yx(Hz(i), 29).a); c.a < c.c.c.length; ) + for ((r = Yx(Hz(c), 10)).k == (bon(), Fzn) && _pn(r, t), e = new $K(bA(o7(r).a.Kc(), new h())); Vfn(e); ) + P4(Yx(kV(e), 17), t); + } + function rln(n) { + var t, e, i; + (this.c = n), + (i = Yx(Aun(n, (gjn(), a1n)), 103)), + (t = ty(fL(Aun(n, RZn)))), + (e = ty(fL(Aun(n, J0n)))), + i == (t9(), Ztt) || i == net || i == tet ? (this.b = t * e) : (this.b = 1 / (t * e)), + (this.j = ty(fL(Aun(n, z0n)))), + (this.e = ty(fL(Aun(n, G0n)))), + (this.f = n.b.c.length); + } + function cln() { + (cln = O), + (G5n = new RC(20)), + (q5n = new DC((Cjn(), utt), G5n)), + (V5n = new DC(Xtt, 20)), + (D5n = new DC(mnt, OPn)), + (U5n = new DC(Att, d9(1))), + (W5n = new DC(xtt, (TA(), !0))), + (R5n = Snt), + (_5n = Jnt), + (F5n = ttt), + (B5n = itt), + (K5n = Qnt), + (H5n = att), + (z5n = Mtt), + i4(), + (Q5n = N5n), + (X5n = $5n); + } + function aln(n, t) { + var e, i, r, c, a, u, o, s, h; + if (n.a.f > 0 && CO(t, 42) && (n.a.qj(), (c = null == (o = (s = Yx(t, 42)).cd()) ? 0 : W5(o)), (a = KL(n.a, c)), (e = n.a.d[a]))) + for (i = Yx(e.g, 367), h = e.i, u = 0; u < h; ++u) if ((r = i[u]).Sh() == c && r.Fb(s)) return aln(n, s), !0; + return !1; + } + function uln() { + (uln = O), + p7(), + (j8n = new FI(K$n, (E8n = w8n))), + (y8n = new FI(_$n, (TA(), !0))), + d9(-1), + (p8n = new FI(F$n, d9(-1))), + d9(-1), + (v8n = new FI(B$n, d9(-1))), + (k8n = new FI(H$n, !1)), + (T8n = new FI(q$n, !0)), + (m8n = new FI(G$n, !1)), + (M8n = new FI(z$n, -1)); + } + function oln(n, t, e) { + switch (t) { + case 7: + return !n.e && (n.e = new AN(nct, n, 7, 4)), Hmn(n.e), !n.e && (n.e = new AN(nct, n, 7, 4)), void jF(n.e, Yx(e, 14)); + case 8: + return !n.d && (n.d = new AN(nct, n, 8, 5)), Hmn(n.d), !n.d && (n.d = new AN(nct, n, 8, 5)), void jF(n.d, Yx(e, 14)); + } + Qcn(n, t, e); + } + function sln(n, t) { + var e, i, r, c, a; + if (iI(t) === iI(n)) return !0; + if (!CO(t, 15)) return !1; + if (((a = Yx(t, 15)), n.gc() != a.gc())) return !1; + for (c = a.Kc(), i = n.Kc(); i.Ob(); ) if (((e = i.Pb()), (r = c.Pb()), !(iI(e) === iI(r) || (null != e && Q8(e, r))))) return !1; + return !0; + } + function hln(n) { + switch (n.g) { + case 0: + return new Sf(); + case 1: + return new hf(); + case 2: + return new sf(); + case 3: + return new DP(); + case 4: + return new dK(); + default: + throw hp(new Qm("No implementation is available for the node placer " + (null != n.f ? n.f : "" + n.g))); + } + } + function fln(n) { + switch (n.g) { + case 0: + return new wK(); + case 1: + return new lf(); + case 2: + return new tf(); + case 3: + return new ef(); + case 4: + return new KP(); + default: + throw hp(new Qm("No implementation is available for the cycle breaker " + (null != n.f ? n.f : "" + n.g))); + } + } + function lln() { + (lln = O), + (L6n = new FI(j$n, d9(0))), + (N6n = new FI(E$n, 0)), + I6(), + (C6n = new FI(T$n, (O6n = E6n))), + d9(0), + (I6n = new FI(M$n, d9(1))), + w3(), + (x6n = new FI(S$n, (D6n = u8n))), + CY(), + (R6n = new FI(P$n, (K6n = y6n))), + Hin(), + (A6n = new FI(I$n, ($6n = i8n))); + } + function bln(n, t, e) { + var i; + (i = null), + t && (i = t.d), + ean(n, new LM(t.n.a - i.b + e.a, t.n.b - i.d + e.b)), + ean(n, new LM(t.n.a - i.b + e.a, t.n.b + t.o.b + i.a + e.b)), + ean(n, new LM(t.n.a + t.o.a + i.c + e.a, t.n.b - i.d + e.b)), + ean(n, new LM(t.n.a + t.o.a + i.c + e.a, t.n.b + t.o.b + i.a + e.b)); + } + function wln(n, t, e) { + var i, r, c; + for (t.p = e, c = W_(n0(x4(Gy(QKn, 1), iEn, 20, 0, [new fw(t), new bw(t)]))); Vfn(c); ) + -1 == (i = Yx(kV(c), 11)).p && wln(n, i, e); + if (t.i.k == (bon(), Bzn)) for (r = new pb(t.i.j); r.a < r.c.c.length; ) (i = Yx(Hz(r), 11)) != t && -1 == i.p && wln(n, i, e); + } + function dln(n) { + var t, i, r, c, a; + if ( + ((c = Yx( + kW( + (function (n) { + return W9(n), hH(n, new Bb(new Qp())); + })(Pz(n)), + mY(new H(), new B(), new rn(), x4(Gy(wBn, 1), XEn, 132, 0, [(C6(), aBn)])), + ), + 15, + )), + (r = wPn), + c.gc() >= 2) + ) + for (t = fL((i = c.Kc()).Pb()); i.Ob(); ) (a = t), (t = fL(i.Pb())), (r = e.Math.min(r, (vB(t), t - (vB(a), a)))); + return r; + } + function gln(n, t) { + var e, i, r, c, a; + VW((i = new ME()), t, i.c.b, i.c); + do { + for (S$(0 != i.b), e = Yx(VZ(i, i.a.a), 86), n.b[e.g] = 1, c = Ztn(e.d, 0); c.b != c.d.c; ) + (a = (r = Yx(IX(c), 188)).c), 1 == n.b[a.g] ? KD(n.a, r) : 2 == n.b[a.g] ? (n.b[a.g] = 1) : VW(i, a, i.c.b, i.c); + } while (0 != i.b); + } + function pln(n, t) { + var e, i, r; + if (iI(t) === iI(MF(n))) return !0; + if (!CO(t, 15)) return !1; + if (((i = Yx(t, 15)), (r = n.gc()) != i.gc())) return !1; + if (CO(i, 54)) { + for (e = 0; e < r; e++) if (!bB(n.Xb(e), i.Xb(e))) return !1; + return !0; + } + return (function (n, t) { + for (var e, i; n.Ob(); ) { + if (!t.Ob()) return !1; + if (((e = n.Pb()), (i = t.Pb()), !(iI(e) === iI(i) || (null != e && Q8(e, i))))) return !1; + } + return !t.Ob(); + })(n.Kc(), i.Kc()); + } + function vln(n, t) { + var e; + if (0 != n.c.length) { + if (2 == n.c.length) _pn(($z(0, n.c.length), Yx(n.c[0], 10)), (Frn(), Ret)), _pn(($z(1, n.c.length), Yx(n.c[1], 10)), Ket); + else for (e = new pb(n); e.a < e.c.c.length; ) _pn(Yx(Hz(e), 10), t); + n.c = VQ(UKn, iEn, 1, 0, 5, 1); + } + } + function mln(n) { + var t, e; + if (2 != n.c.length) throw hp(new Ym("Order only allowed for two paths.")); + $z(0, n.c.length), + (t = Yx(n.c[0], 17)), + $z(1, n.c.length), + (e = Yx(n.c[1], 17)), + t.d.i != e.c.i && ((n.c = VQ(UKn, iEn, 1, 0, 5, 1)), (n.c[n.c.length] = e), (n.c[n.c.length] = t)); + } + function yln(n, t, e) { + var i, r, c, a, u; + if ((!(r = n.f) && (r = Yx(n.a.a.ec().Kc().Pb(), 57)), vcn(r, t, e), 1 != n.a.a.gc())) + for (i = t * e, a = n.a.a.ec().Kc(); a.Ob(); ) + (c = Yx(a.Pb(), 57)) != r && ((u = SX(c)).f.d ? ((c.d.d += i + SSn), (c.d.a -= i + SSn)) : u.f.a && (c.d.a -= i + SSn)); + } + function kln(n, t, i, r, c) { + var a, u, o, s, h, f, l, b, w; + return ( + (u = i - n), + (o = r - t), + (s = (a = e.Math.atan2(u, o)) + bPn), + (h = a - bPn), + (f = c * e.Math.sin(s) + n), + (b = c * e.Math.cos(s) + t), + (l = c * e.Math.sin(h) + n), + (w = c * e.Math.cos(h) + t), + DV(x4(Gy(B7n, 1), TEn, 8, 0, [new QS(f, b), new QS(l, w)])) + ); + } + function jln(n, t) { + var e, i; + return ( + !n.o && (n.o = new yY((ajn(), Frt), mct, n, 0)), + null != (i = ynn(n.o, t)) + ? i + : (CO((e = t.wg()), 4) && + (null == e + ? (!n.o && (n.o = new yY((ajn(), Frt), mct, n, 0)), ttn(n.o, t)) + : (!n.o && (n.o = new yY((ajn(), Frt), mct, n, 0)), xcn(n.o, t, e))), + e) + ); + } + function Eln() { + (Eln = O), + (Get = new cP("H_LEFT", 0)), + (qet = new cP("H_CENTER", 1)), + (Uet = new cP("H_RIGHT", 2)), + (Yet = new cP("V_TOP", 3)), + (Qet = new cP("V_CENTER", 4)), + (Vet = new cP("V_BOTTOM", 5)), + (Xet = new cP("INSIDE", 6)), + (Wet = new cP("OUTSIDE", 7)), + (zet = new cP("H_PRIORITY", 8)); + } + function Tln(n, t) { + var e, i, r, c, a, u, o; + if (!t.f) throw hp(new Qm("The input edge is not a tree edge.")); + for (c = null, r = Yjn, i = new pb(n.d); i.a < i.c.c.length; ) + (u = (e = Yx(Hz(i), 213)).d), (o = e.e), fhn(n, u, t) && !fhn(n, o, t) && (a = o.e - u.e - e.a) < r && ((r = a), (c = e)); + return c; + } + function Mln(n) { + var t, e, i, r, c, a; + if (!(n.f.e.c.length <= 1)) { + (t = 0), (r = Hfn(n)), (e = JTn); + do { + for (t > 0 && (r = e), a = new pb(n.f.e); a.a < a.c.c.length; ) + ny(hL(Aun((c = Yx(Hz(a), 144)), (Wrn(), NGn)))) || ((i = Cpn(n, c)), mN(OI(c.d), i)); + e = Hfn(n); + } while (!JF(n, t++, r, e)); + } + } + function Sln(n, t, e) { + var i, r, c, a; + for (run(e, "Processor set coordinates", 1), n.a = 0 == t.b.b ? 1 : t.b.b, c = null, i = Ztn(t.b, 0); !c && i.b != i.d.c; ) + ny(hL(Aun((a = Yx(IX(i), 86)), (ryn(), C5n)))) && ((c = a), ((r = a.e).a = Yx(Aun(a, O5n), 19).a), (r.b = 0)); + xon(n, q4(c), J2(e, 1)), Ron(e); + } + function Pln(n, t, e) { + var i, r, c; + for ( + run(e, "Processor determine the height for each level", 1), n.a = 0 == t.b.b ? 1 : t.b.b, r = null, i = Ztn(t.b, 0); + !r && i.b != i.d.c; + + ) + ny(hL(Aun((c = Yx(IX(i), 86)), (ryn(), C5n)))) && (r = c); + r && Uwn(n, DV(x4(Gy(f5n, 1), gPn, 86, 0, [r])), e), Ron(e); + } + function Iln(n, t) { + var e, i, r, c, a, u; + return ( + (c = null), + (bxn in (a = n).a || wxn in a.a || YNn in a.a) && + ((u = V4(t)), + (i = uX(a, bxn)), + (function (n, t) { + var e, i; + t && ((e = q1(t, "x")), x1(new vg(n).a, (vB(e), e)), (i = q1(t, "y")), R1(new yg(n).a, (vB(i), i))); + })(new fg(u).a, i), + (r = uX(a, wxn)), + (function (n, t) { + var e, i; + t && ((e = q1(t, "x")), O1(new jg(n).a, (vB(e), e)), (i = q1(t, "y")), D1(new Eg(n).a, (vB(i), i))); + })(new kg(u).a, r), + (e = cX(a, YNn)), + (function (n, t) { + var e, i, r; + if (t) + for (r = ((e = new NK(t.a.length)).b - e.a) * e.c < 0 ? (PT(), Fot) : new oA(e); r.Ob(); ) + (i = aX(t, Yx(r.Pb(), 19).a)), oH(new tg(n).a, i); + })(new Tg(u).a, e), + (c = e)), + c + ); + } + function Cln(n, t) { + var i, r, c, a, u; + return ( + (u = (a = t.a).c.i == t.b ? a.d : a.c), + (r = a.c.i == t.b ? a.c : a.d), + (c = (function (n, t, e) { + var i; + return (i = ty(n.p[t.i.p]) + ty(n.d[t.i.p]) + t.n.b + t.a.b), ty(n.p[e.i.p]) + ty(n.d[e.i.p]) + e.n.b + e.a.b - i; + })(n.a, u, r)) > 0 && c < wPn + ? ((i = (function (n, t, i, r) { + var c, a, u, o, s, h, f, l; + (c = i), (a = f = t); + do { + (a = n.a[a.p]), + (l = n.g[a.p]), + (o = ty(n.p[l.p]) + ty(n.d[a.p]) - a.d.d), + (s = A0(a, r)) && + ((h = n.g[s.p]), (u = ty(n.p[h.p]) + ty(n.d[s.p]) + s.o.b + s.d.a), (c = e.Math.min(c, o - (u + lO(n.k, a, s))))); + } while (f != a); + return c; + })(n.a, r.i, c, n.c)), + l1(n.a, r.i, -i), + i > 0) + : c < 0 && + -c < wPn && + ((i = (function (n, t, i, r) { + var c, a, u, o, s, h, f, l; + (c = i), (a = f = t); + do { + (a = n.a[a.p]), + (l = n.g[a.p]), + (u = ty(n.p[l.p]) + ty(n.d[a.p]) + a.o.b + a.d.a), + (s = U4(a, r)) && + ((h = n.g[s.p]), (o = ty(n.p[h.p]) + ty(n.d[s.p]) - s.d.d), (c = e.Math.min(c, o - (u + lO(n.k, a, s))))); + } while (f != a); + return c; + })(n.a, r.i, -c, n.c)), + l1(n.a, r.i, i), + i > 0) + ); + } + function Oln(n, t, e, i) { + var r, c, a, u, o, s; + for (r = (t - n.d) / n.c.c.length, c = 0, n.a += e, n.d = t, s = new pb(n.c); s.a < s.c.c.length; ) + (u = (o = Yx(Hz(s), 33)).g), + (a = o.f), + L1(o, o.i + c * r), + N1(o, o.j + i * e), + $1(o, o.g + r), + A1(o, n.a), + ++c, + qsn(o, new QS(o.g, o.f), new QS(u, a)); + } + function Aln(n) { + var t, i, r, c, a, u, o; + for (r = JTn, i = ZTn, t = new pb(n.e.b); t.a < t.c.c.length; ) + for (a = new pb(Yx(Hz(t), 29).a); a.a < a.c.c.length; ) + (c = Yx(Hz(a), 10)), (u = (o = ty(n.p[c.p])) + ty(n.b[n.g[c.p].p])), (r = e.Math.min(r, o)), (i = e.Math.max(i, u)); + return i - r; + } + function $ln(n, t, e, i) { + var r, c, a, u, o, s; + for (o = null, u = 0, s = (r = Agn(n, t)).gc(); u < s; ++u) + if (_N(i, nH(PJ(n, (c = Yx(r.Xb(u), 170)))))) + if (((a = tH(PJ(n, c))), null == e)) { + if (null == a) return c; + !o && (o = c); + } else { + if (_N(e, a)) return c; + null == a && !o && (o = c); + } + return null; + } + function Lln(n, t, e, i) { + var r, c, a, u, o, s; + for (o = null, u = 0, s = (r = $gn(n, t)).gc(); u < s; ++u) + if (_N(i, nH(PJ(n, (c = Yx(r.Xb(u), 170)))))) + if (((a = tH(PJ(n, c))), null == e)) { + if (null == a) return c; + !o && (o = c); + } else { + if (_N(e, a)) return c; + null == a && !o && (o = c); + } + return null; + } + function Nln(n, t, i) { + var r, c, a, u, o, s, h, f; + for (a = t.Kc(); a.Ob(); ) + (s = (c = Yx(a.Pb(), 33)).i + c.g / 2), + (f = c.j + c.f / 2), + (o = s - ((u = n.f).i + u.g / 2)), + (h = f - (u.j + u.f / 2)), + (r = e.Math.sqrt(o * o + h * h)), + (o *= n.e / r), + (h *= n.e / r), + i ? ((s -= o), (f -= h)) : ((s += o), (f += h)), + L1(c, s - c.g / 2), + N1(c, f - c.f / 2); + } + function xln(n) { + var t, e, i; + if (!n.c && null != n.b) { + for (t = n.b.length - 4; t >= 0; t -= 2) + for (e = 0; e <= t; e += 2) + (n.b[e] > n.b[e + 2] || (n.b[e] === n.b[e + 2] && n.b[e + 1] > n.b[e + 3])) && + ((i = n.b[e + 2]), (n.b[e + 2] = n.b[e]), (n.b[e] = i), (i = n.b[e + 3]), (n.b[e + 3] = n.b[e + 1]), (n.b[e + 1] = i)); + n.c = !0; + } + } + function Dln(n, t) { + var e, i, r, c, a, u; + for (c = (1 == t ? ozn : uzn).a.ec().Kc(); c.Ob(); ) + for (r = Yx(c.Pb(), 103), u = Yx(_V(n.f.c, r), 21).Kc(); u.Ob(); ) + switch (((a = Yx(u.Pb(), 46)), (i = Yx(a.b, 81)), (e = Yx(a.a, 189).c), r.g)) { + case 2: + case 1: + i.g.d += e; + break; + case 4: + case 3: + i.g.c += e; + } + } + function Rln(n, t) { + var e, i, r, c, a, u, o, s, h; + for (s = -1, h = 0, u = 0, o = (a = n).length; u < o; ++u) { + for (c = a[u], e = new MD(-1 == s ? n[0] : n[s], t, (i8(), k2n)), i = 0; i < c.length; i++) + for (r = i + 1; r < c.length; r++) O$(c[i], (Ojn(), IQn)) && O$(c[r], IQn) && Qkn(e, c[i], c[r]) > 0 && ++h; + ++s; + } + return h; + } + function Kln(n) { + var t; + return ( + ((t = new SA(Nk(n.gm))).a += "@"), + yI(t, (W5(n) >>> 0).toString(16)), + n.kh() + ? ((t.a += " (eProxyURI: "), mI(t, n.qh()), n.$g() && ((t.a += " eClass: "), mI(t, n.$g())), (t.a += ")")) + : n.$g() && ((t.a += " (eClass: "), mI(t, n.$g()), (t.a += ")")), + t.a + ); + } + function _ln(n) { + var t, e, i; + if (n.e) throw hp(new Ym((sL(OBn), UMn + OBn.k + XMn))); + for (n.d == (t9(), tet) && ekn(n, Ztt), e = new pb(n.a.a); e.a < e.c.c.length; ) (t = Yx(Hz(e), 307)).g = t.i; + for (i = new pb(n.a.b); i.a < i.c.c.length; ) Yx(Hz(i), 57).i = ZTn; + return n.b.Le(n), n; + } + function Fln(n, t) { + var e, i, r, c, a; + if (((c = t), !(a = Yx(z0(AF(n.i), c), 33)))) + throw hp(new hy("Unable to find elk node for json object '" + oX(c, rxn) + "' Panic!")); + (i = cX(c, "edges")), + (function (n, t, e) { + var i, r, c; + if (e) + for (c = ((i = new NK(e.a.length)).b - i.a) * i.c < 0 ? (PT(), Fot) : new oA(i); c.Ob(); ) + (r = aX(e, Yx(c.Pb(), 19).a)), WNn in r.a || VNn in r.a ? jgn(n, r, t) : ejn(n, r, t), HO(Yx(BF(n.b, itn(r)), 79)); + })((e = new jP(n, a)).a, e.b, i), + (r = cX(c, UNn)), + (function (n, t) { + var e, i, r; + if (t) + for (r = ((e = new NK(t.a.length)).b - e.a) * e.c < 0 ? (PT(), Fot) : new oA(e); r.Ob(); ) + (i = aX(t, Yx(r.Pb(), 19).a)) && Fln(n, i); + })(new ig(n).a, r); + } + function Bln(n, t, e, i) { + var r, c, a, u, o; + if (null != i) { + if ((r = n.d[t])) for (c = r.g, o = r.i, u = 0; u < o; ++u) if ((a = Yx(c[u], 133)).Sh() == e && Q8(i, a.cd())) return u; + } else if ((r = n.d[t])) for (c = r.g, o = r.i, u = 0; u < o; ++u) if (iI((a = Yx(c[u], 133)).cd()) === iI(i)) return u; + return -1; + } + function Hln(n, t) { + var e, i; + return CO((e = null == t ? eI(Dq(n.f, null)) : NT(n.g, t)), 235) + ? ((i = Yx(e, 235)).Qh(), i) + : CO(e, 498) + ? ((i = Yx(e, 1938).a) && (null == i.yb || (null == t ? Ysn(n.f, null, i) : r7(n.g, t, i))), i) + : null; + } + function qln(n, t) { + var i, r, c, a, u, o; + if ((r = n.b[t.p]) >= 0) return r; + for (c = 1, a = new pb(t.j); a.a < a.c.c.length; ) + for (i = new pb(Yx(Hz(a), 11).g); i.a < i.c.c.length; ) + t != (o = Yx(Hz(i), 17).d.i) && ((u = qln(n, o)), (c = e.Math.max(c, u + 1))); + return ( + (function (n, t, e) { + var i, r; + for (i = (r = n.a.b).c.length; i < e; i++) ZR(r, 0, new qF(n.a)); + JG(t, Yx(TR(r, r.c.length - e), 29)), (n.b[t.p] = e); + })(n, t, c), + c + ); + } + function Gln(n, t, e) { + var i, r, c; + for (i = 1; i < n.c.length; i++) { + for ($z(i, n.c.length), c = Yx(n.c[i], 10), r = i; r > 0 && t.ue(($z(r - 1, n.c.length), Yx(n.c[r - 1], 10)), c) > 0; ) + QW(n, r, ($z(r - 1, n.c.length), Yx(n.c[r - 1], 10))), --r; + $z(r, n.c.length), (n.c[r] = c); + } + (e.a = new rp()), (e.b = new rp()); + } + function zln(n, t, e) { + var i; + if (2 == ((n.c - n.b) & (n.a.length - 1))) + t == (Ikn(), Tit) || t == Eit + ? (qZ(Yx(T5(n), 15), (Frn(), Ret)), qZ(Yx(T5(n), 15), Ket)) + : (qZ(Yx(T5(n), 15), (Frn(), Ket)), qZ(Yx(T5(n), 15), Ret)); + else for (i = new VB(n); i.a != i.b; ) qZ(Yx(w8(i), 15), e); + } + function Uln(n, t) { + var e, i, r, c, a, u; + for ( + a = new JU((i = Jx(new $g(n))), i.c.length), u = new JU((r = Jx(new $g(t))), r.c.length), c = null; + a.b > 0 && u.b > 0 && (S$(a.b > 0), (e = Yx(a.a.Xb((a.c = --a.b)), 33)), S$(u.b > 0), e == Yx(u.a.Xb((u.c = --u.b)), 33)); + + ) + c = e; + return c; + } + function Xln(n, t) { + var i, r, c, a; + return ( + (c = n.a * kMn + 1502 * n.b), + (a = n.b * kMn + 11), + (c += i = e.Math.floor(a * jMn)), + (a -= i * EMn), + (c %= EMn), + (n.a = c), + (n.b = a), + t <= 24 ? e.Math.floor(n.a * GFn[t]) : ((r = n.a * (1 << (t - 24)) + e.Math.floor(n.b * zFn[t])) >= 2147483648 && (r -= oMn), r) + ); + } + function Wln(n, t, e) { + var i, r, c, a; + Wz(n, t) > Wz(n, e) + ? ((i = i7(e, (Ikn(), Eit))), + (n.d = i.dc() ? 0 : tR(Yx(i.Xb(0), 11))), + (a = i7(t, qit)), + (n.b = a.dc() ? 0 : tR(Yx(a.Xb(0), 11)))) + : ((r = i7(e, (Ikn(), qit))), + (n.d = r.dc() ? 0 : tR(Yx(r.Xb(0), 11))), + (c = i7(t, Eit)), + (n.b = c.dc() ? 0 : tR(Yx(c.Xb(0), 11)))); + } + function Vln(n) { + var t, e, i, r, c, a, u; + if (n && (t = n.Hh(hRn)) && null != (a = lL(ynn((!t.b && (t.b = new z$((xjn(), Dat), out, t)), t.b), "conversionDelegates")))) { + for (u = new ip(), r = 0, c = (i = Ogn(a, "\\w+")).length; r < c; ++r) (e = i[r]), (u.c[u.c.length] = e); + return u; + } + return XH(), XH(), TFn; + } + function Qln(n, t) { + var e, i, r, c; + for (e = n.o.a, c = Yx(Yx(_V(n.r, t), 21), 84).Kc(); c.Ob(); ) + ((r = Yx(c.Pb(), 111)).e.a = e * ty(fL(r.b.We(XHn)))), + (r.e.b = (i = r.b).Xe((Cjn(), ytt)) + ? i.Hf() == (Ikn(), Tit) + ? -i.rf().b - ty(fL(i.We(ytt))) + : ty(fL(i.We(ytt))) + : i.Hf() == (Ikn(), Tit) + ? -i.rf().b + : 0); + } + function Yln(n) { + var t, e, i, r, c, a, u, o; + (t = !0), (r = null), (c = null); + n: for (o = new pb(n.a); o.a < o.c.c.length; ) + for (i = new $K(bA(u7((u = Yx(Hz(o), 10))).a.Kc(), new h())); Vfn(i); ) { + if (((e = Yx(kV(i), 17)), r && r != u)) { + t = !1; + break n; + } + if (((r = u), (a = e.c.i), c && c != a)) { + t = !1; + break n; + } + c = a; + } + return t; + } + function Jln() { + (Jln = O), + (S8n = new DC((Cjn(), mnt), 1.3)), + (O8n = Dnt), + (q8n = new RC(15)), + (H8n = new DC(utt, q8n)), + (U8n = new DC(Xtt, 15)), + (P8n = Tnt), + (D8n = Jnt), + (R8n = ttt), + (K8n = itt), + (x8n = Qnt), + (_8n = att), + (G8n = Mtt), + uln(), + (B8n = j8n), + (N8n = y8n), + (F8n = k8n), + (z8n = T8n), + (A8n = m8n), + ($8n = Hnt), + (L8n = qnt), + (C8n = v8n), + (I8n = p8n), + (X8n = M8n); + } + function Zln(n, t, e) { + var i, r, c, a, u; + for (B0((r = new jo()), (vB(t), t)), !r.b && (r.b = new z$((xjn(), Dat), out, r)), u = r.b, a = 1; a < e.length; a += 2) + xcn(u, e[a - 1], e[a]); + for (!n.Ab && (n.Ab = new m_(Zct, n, 0, 3)), i = n.Ab, c = 0; c < 0; ++c) i = gB(Yx(c1(i, i.i - 1), 590)); + fY(i, r); + } + function nbn(n, t, i) { + var r, c, a; + for ( + mL.call(this, new ip()), + this.a = t, + this.b = i, + this.e = n, + n.b && tmn(n), + r = n.a, + this.d = MH(r.a, this.a), + this.c = MH(r.b, this.b), + (function (n, t, i) { + (n.n = fR(Qot, [TEn, tMn], [364, 25], 14, [i, oG(e.Math.ceil(t / 32))], 2)), + (n.o = t), + (n.p = i), + (n.j = (t - 1) >> 1), + (n.k = (i - 1) >> 1); + })(this, this.d, this.c), + (function (n) { + var t, e, i, r, c, a, u; + for (e = _C(n.e), c = KO(N$(dO(KC(n.e)), n.d * n.a, n.c * n.b), -0.5), t = e.a - c.a, r = e.b - c.b, u = 0; u < n.c; u++) { + for (i = t, a = 0; a < n.d; a++) L7(n.e, new mH(i, r, n.a, n.b)) && cgn(n, a, u, !1, !0), (i += n.a); + r += n.b; + } + })(this), + a = this.e.e.a.ec().Kc(); + a.Ob(); + + ) + (c = Yx(a.Pb(), 266)).c.c.length > 0 && tyn(this, c); + } + function tbn(n, t, e, i, r, c) { + var a, u, o; + if (!r[t.b]) { + for (r[t.b] = !0, !(a = i) && (a = new XV()), eD(a.e, t), o = c[t.b].Kc(); o.Ob(); ) + (u = Yx(o.Pb(), 282)).d != e && + u.c != e && + (u.c != t && tbn(n, u.c, t, a, r, c), u.d != t && tbn(n, u.d, t, a, r, c), eD(a.c, u), S4(a.d, u.b)); + return a; + } + return null; + } + function ebn(n) { + var t, e, i; + for (t = 0, e = new pb(n.e); e.a < e.c.c.length; ) JW(new SR(null, new Nz(Yx(Hz(e), 17).b, 16)), new pe()) && ++t; + for (i = new pb(n.g); i.a < i.c.c.length; ) JW(new SR(null, new Nz(Yx(Hz(i), 17).b, 16)), new ve()) && ++t; + return t >= 2; + } + function ibn(n) { + var t, e; + try { + return null == n ? aEn : I7(n); + } catch (i) { + if (CO((i = j4(i)), 102)) + return ( + (t = i), + (e = Nk(V5(n)) + "@" + (oE(), (Nen(n) >>> 0).toString(16))), + Ltn(O4(), (_E(), "Exception during lenientFormat for " + e), t), + "<" + e + " threw " + Nk(t.gm) + ">" + ); + throw hp(i); + } + } + function rbn(n) { + switch (n.g) { + case 0: + return new af(); + case 1: + return new nf(); + case 2: + return new cT(); + case 3: + return new Cc(); + case 4: + return new lN(); + case 5: + return new uf(); + default: + throw hp(new Qm("No implementation is available for the layerer " + (null != n.f ? n.f : "" + n.g))); + } + } + function cbn(n, t, e) { + var i, r, c; + for (c = new pb(n.t); c.a < c.c.c.length; ) + (i = Yx(Hz(c), 268)).b.s < 0 && i.c > 0 && ((i.b.n -= i.c), i.b.n <= 0 && i.b.u > 0 && KD(t, i.b)); + for (r = new pb(n.i); r.a < r.c.c.length; ) + (i = Yx(Hz(r), 268)).a.s < 0 && i.c > 0 && ((i.a.u -= i.c), i.a.u <= 0 && i.a.n > 0 && KD(e, i.a)); + } + function abn(n) { + var t, e, i; + if (null == n.g && ((n.d = n.si(n.f)), fY(n, n.d), n.c)) return n.f; + if (((i = (t = Yx(n.g[n.i - 1], 47)).Pb()), (n.e = t), (e = n.si(i)).Ob())) (n.d = e), fY(n, e); + else for (n.d = null; !t.Ob() && (DF(n.g, --n.i, null), 0 != n.i); ) t = Yx(n.g[n.i - 1], 47); + return i; + } + function ubn(n, t, i, r) { + var c, a, u; + for ( + Al((c = new rin(n)), (bon(), Fzn)), + b5(c, (Ojn(), CQn), t), + b5(c, BQn, r), + b5(c, (gjn(), g0n), (Ran(), oit)), + b5(c, TQn, t.c), + b5(c, MQn, t.d), + Bwn(t, c), + u = e.Math.floor(i / 2), + a = new pb(c.j); + a.a < a.c.c.length; + + ) + Yx(Hz(a), 11).n.b = u; + return c; + } + function obn(n) { + var t, i, r, c, a, u; + for (t = 0, i = new pb(n.a); i.a < i.c.c.length; ) + for (c = new $K(bA(o7(Yx(Hz(i), 10)).a.Kc(), new h())); Vfn(c); ) + n == (r = Yx(kV(c), 17)).d.i.c && + r.c.j == (Ikn(), qit) && + ((a = Dz(r.c).b), (u = Dz(r.d).b), (t = e.Math.max(t, e.Math.abs(u - a)))); + return t; + } + function sbn(n, t, e) { + var i, r; + run(e, "Remove overlaps", 1), + e.n && t && nU(e, RU(t), (P6(), jrt)), + (i = Yx(jln(t, (eL(), s6n)), 33)), + (n.f = i), + (n.a = Ven(Yx(jln(t, (_rn(), Y6n)), 293))), + Hl(n, (vB((r = fL(jln(t, (Cjn(), Xtt))))), r)), + fkn(n, t, idn(i), e), + e.n && t && nU(e, RU(t), (P6(), jrt)); + } + function hbn(n, t, i) { + switch (i.g) { + case 1: + return new QS(t.a, e.Math.min(n.d.b, t.b)); + case 2: + return new QS(e.Math.max(n.c.a, t.a), t.b); + case 3: + return new QS(t.a, e.Math.max(n.c.b, t.b)); + case 4: + return new QS(e.Math.min(t.a, n.d.a), t.b); + } + return new QS(t.a, t.b); + } + function fbn(n) { + var t, e, i; + for ( + eD((t = h$(1 + (!n.c && (n.c = new m_(oct, n, 9, 9)), n.c).i)), (!n.d && (n.d = new AN(nct, n, 8, 5)), n.d)), + i = new UO((!n.c && (n.c = new m_(oct, n, 9, 9)), n.c)); + i.e != i.i.gc(); + + ) + eD(t, (!(e = Yx(hen(i), 118)).d && (e.d = new AN(nct, e, 8, 5)), e.d)); + return MF(t), new KI(t); + } + function lbn(n) { + var t, e, i; + for ( + eD((t = h$(1 + (!n.c && (n.c = new m_(oct, n, 9, 9)), n.c).i)), (!n.e && (n.e = new AN(nct, n, 7, 4)), n.e)), + i = new UO((!n.c && (n.c = new m_(oct, n, 9, 9)), n.c)); + i.e != i.i.gc(); + + ) + eD(t, (!(e = Yx(hen(i), 118)).e && (e.e = new AN(nct, e, 7, 4)), e.e)); + return MF(t), new KI(t); + } + function bbn(n, t, e) { + var i, r, c, a; + for ( + run(e, "ELK Force", 1), + ny(hL(jln(t, (Bdn(), oGn)))) || rG(new Xb((dT(), new Xm(t)))), + (function (n) { + var t, e; + (t = Yx(Aun(n, (Bdn(), wGn)), 19)) + ? ((e = t.a), b5(n, (d2(), TGn), 0 == e ? new c7() : new jW(e))) + : b5(n, (d2(), TGn), new jW(1)); + })((a = w5(t))), + (function (n, t) { + switch (t.g) { + case 0: + CO(n.b, 631) || (n.b = new Z3()); + break; + case 1: + CO(n.b, 632) || (n.b = new gD()); + } + })(n, Yx(Aun(a, rGn), 424)), + r = (c = ovn(n.a, a)).Kc(); + r.Ob(); + + ) + (i = Yx(r.Pb(), 231)), Ngn(n.b, i, J2(e, 1 / c.gc())); + Okn((a = _kn(c))), Ron(e); + } + function wbn(n, t) { + var e, i, r; + if ( + (run(t, "Breaking Point Processor", 1), + (function (n) { + var t, e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p; + for (ZL((o = new JU((s = n.b), 0)), new qF(n)), g = !1, c = 1; o.b < o.d.gc(); ) { + for ( + S$(o.b < o.d.gc()), + u = Yx(o.d.Xb((o.c = o.b++)), 29), + $z(c, s.c.length), + b = Yx(s.c[c], 29), + d = (w = Xz(u.a)).c.length, + l = new pb(w); + l.a < l.c.c.length; + + ) + JG((h = Yx(Hz(l), 10)), b); + if (g) { + for (f = _z(new Tm(w), 0); f.c.Sb(); ) + for (r = new pb(Xz(u7((h = Yx(nV(f), 10))))); r.a < r.c.c.length; ) + mvn((i = Yx(Hz(r), 17)), !0), + b5(n, (Ojn(), iQn), (TA(), !0)), + (e = fyn(n, i, d)), + (t = Yx(Aun(h, YVn), 305)), + (p = Yx(TR(e, e.c.length - 1), 17)), + (t.k = p.c.i), + (t.n = p), + (t.b = i.d.i), + (t.c = i); + g = !1; + } else 0 != w.c.length && ($z(0, w.c.length), Yx(w.c[0], 10).k == (bon(), Kzn) && ((g = !0), (c = -1))); + ++c; + } + for (a = new JU(n.b, 0); a.b < a.d.gc(); ) S$(a.b < a.d.gc()), 0 == Yx(a.d.Xb((a.c = a.b++)), 29).a.c.length && hB(a); + })(n), + ny(hL(Aun(n, (gjn(), r2n))))) + ) { + for (i = new pb(n.b); i.a < i.c.c.length; ) + for (e = 0, r = new pb(Yx(Hz(i), 29).a); r.a < r.c.c.length; ) Yx(Hz(r), 10).p = e++; + (function (n) { + var t, e, i, r, c, a, u; + for (i = new pb(n.b); i.a < i.c.c.length; ) + for (c = new pb(Xz(Yx(Hz(i), 29).a)); c.a < c.c.c.length; ) + if (MZ((r = Yx(Hz(c), 10))) && !(e = Yx(Aun(r, (Ojn(), YVn)), 305)).g && e.d) + for (t = e, u = e.d; u; ) + Ldn(u.i, u.k, !1, !0), + pJ(t.a), + pJ(u.i), + pJ(u.k), + pJ(u.b), + QG(u.c, t.c.d), + QG(t.c, null), + JG(t.a, null), + JG(u.i, null), + JG(u.k, null), + JG(u.b, null), + ((a = new LX(t.i, u.a, t.e, u.j, u.f)).k = t.k), + (a.n = t.n), + (a.b = t.b), + (a.c = u.c), + (a.g = t.g), + (a.d = u.d), + b5(t.i, YVn, a), + b5(u.a, YVn, a), + (u = u.d), + (t = a); + })(n), + Fwn(n, !0), + Fwn(n, !1); + } + Ron(t); + } + function dbn(n, t) { + var e, i, r, c; + if (t) { + for ( + c = !(r = CO(n.Cb, 88) || CO(n.Cb, 99)) && CO(n.Cb, 322), e = new UO((!t.a && (t.a = new _R(t, hat, t)), t.a)); + e.e != e.i.gc(); + + ) + if (((i = Bpn(Yx(hen(e), 87))), r ? CO(i, 88) : c ? CO(i, 148) : i)) return i; + return r ? (xjn(), Oat) : (xjn(), Pat); + } + return null; + } + function gbn(n, t, e, i) { + var r, c, a, u, o, s; + for (yN((u = new QS(e, i)), Yx(Aun(t, (ryn(), w5n)), 8)), s = Ztn(t.b, 0); s.b != s.d.c; ) + mN((o = Yx(IX(s), 86)).e, u), KD(n.b, o); + for (a = Ztn(t.a, 0); a.b != a.d.c; ) { + for (r = Ztn((c = Yx(IX(a), 188)).a, 0); r.b != r.d.c; ) mN(Yx(IX(r), 8), u); + KD(n.a, c); + } + } + function pbn(n, t, e) { + var i, r, c; + if (!(c = iyn((wsn(), wut), n.Tg(), t))) throw hp(new Qm(mNn + t.ne() + yNn)); + if ((TT(), !Yx(c, 66).Oj() && !(c = Bz(PJ(wut, c))))) throw hp(new Qm(mNn + t.ne() + yNn)); + (r = Yx((i = n.Yg(c)) >= 0 ? n._g(i, !0, !0) : tfn(n, c, !0), 153)), Yx(r, 215).ml(t, e); + } + function vbn(n, t, e) { + run(e, "Eades radial", 1), + e.n && t && nU(e, RU(t), (P6(), jrt)), + (n.d = Yx(jln(t, (eL(), s6n)), 33)), + (n.c = ty(fL(jln(t, (_rn(), Q6n))))), + (n.e = Ven(Yx(jln(t, Y6n), 293))), + (n.a = (function (n) { + switch (n.g) { + case 0: + return new Ga(); + case 1: + return new za(); + default: + throw hp(new Qm(y$n + (null != n.f ? n.f : "" + n.g))); + } + })(Yx(jln(t, Z6n), 426))), + (n.b = (function (n) { + switch (n.g) { + case 1: + return new _a(); + case 2: + return new Fa(); + case 3: + return new Ka(); + case 0: + return null; + default: + throw hp(new Qm(y$n + (null != n.f ? n.f : "" + n.g))); + } + })(Yx(jln(t, U6n), 340))), + (function (n) { + var t, e, i, r, c; + if (((i = 0), (r = wPn), n.b)) + for (t = 0; t < 360; t++) + (e = 0.017453292519943295 * t), qgn(n, n.d, 0, 0, w$n, e), (c = n.b.ig(n.d)) < r && ((i = e), (r = c)); + qgn(n, n.d, 0, 0, w$n, i); + })(n), + e.n && t && nU(e, RU(t), (P6(), jrt)); + } + function mbn(n) { + var t, e, i, r; + if (!n.j) { + if (((r = new Co()), null == (t = Hat).a.zc(n, t))) { + for (i = new UO(Iq(n)); i.e != i.i.gc(); ) jF(r, mbn((e = Yx(hen(i), 26)))), fY(r, e); + t.a.Bc(n); + } + B6(r), (n.j = new HI((Yx(c1(aq((YF(), gat).o), 11), 18), r.i), r.g)), (bV(n).b &= -33); + } + return n.j; + } + function ybn(n, t) { + var e, i, r, c, a; + for (r = t.a & n.f, c = null, i = n.b[r]; ; i = i.b) { + if (i == t) { + c ? (c.b = t.b) : (n.b[r] = t.b); + break; + } + c = i; + } + for (a = t.f & n.f, c = null, e = n.c[a]; ; e = e.d) { + if (e == t) { + c ? (c.d = t.d) : (n.c[a] = t.d); + break; + } + c = e; + } + t.e ? (t.e.c = t.c) : (n.a = t.c), t.c ? (t.c.e = t.e) : (n.e = t.e), --n.i, ++n.g; + } + function kbn(n, t) { + var e, i, r, c; + for (S$((c = new JU(n, 0)).b < c.d.gc()), e = Yx(c.d.Xb((c.c = c.b++)), 140); c.b < c.d.gc(); ) + S$(c.b < c.d.gc()), + (r = new ED((i = Yx(c.d.Xb((c.c = c.b++)), 140)).c, e.d, t)), + S$(c.b > 0), + c.a.Xb((c.c = --c.b)), + ZL(c, r), + S$(c.b < c.d.gc()), + c.d.Xb((c.c = c.b++)), + (r.a = !1), + (e = i); + } + function jbn(n) { + var t, e, i, r, c; + for (i = Yx(Aun(n, (Ojn(), JVn)), 11), c = new pb(n.j); c.a < c.c.c.length; ) { + for (e = new pb((r = Yx(Hz(c), 11)).g); e.a < e.c.c.length; ) return QG(Yx(Hz(e), 17), i), r; + for (t = new pb(r.e); t.a < t.c.c.length; ) return YG(Yx(Hz(t), 17), i), r; + } + return null; + } + function Ebn(n) { + var t, e; + for (e = 0; e < n.c.length && !(iR(($z(e, n.c.length), Yx(n.c[e], 113))) > 0); e++); + if (e > 0 && e < n.c.length - 1) return e; + for (t = 0; t < n.c.length && !(iR(($z(t, n.c.length), Yx(n.c[t], 113))) > 0); t++); + return t > 0 && e < n.c.length - 1 ? t : (n.c.length / 2) | 0; + } + function Tbn(n, t) { + var e, i; + if (t != n.Cb || (n.Db >> 16 != 6 && t)) { + if (ccn(n, t)) throw hp(new Qm(CNn + Mfn(n))); + (i = null), + n.Cb && (i = (e = n.Db >> 16) >= 0 ? Yrn(n, i) : n.Cb.ih(n, -1 - e, null, i)), + t && (i = men(t, n, 6, i)), + (i = $L(n, t, i)) && i.Fi(); + } else 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 6, t, t)); + } + function Mbn(n, t) { + var e, i; + if (t != n.Cb || (n.Db >> 16 != 9 && t)) { + if (ccn(n, t)) throw hp(new Qm(CNn + ogn(n))); + (i = null), + n.Cb && (i = (e = n.Db >> 16) >= 0 ? Zrn(n, i) : n.Cb.ih(n, -1 - e, null, i)), + t && (i = men(t, n, 9, i)), + (i = LL(n, t, i)) && i.Fi(); + } else 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 9, t, t)); + } + function Sbn(n, t) { + var e, i; + if (t != n.Cb || (n.Db >> 16 != 3 && t)) { + if (ccn(n, t)) throw hp(new Qm(CNn + bmn(n))); + (i = null), + n.Cb && (i = (e = n.Db >> 16) >= 0 ? ucn(n, i) : n.Cb.ih(n, -1 - e, null, i)), + t && (i = men(t, n, 12, i)), + (i = AL(n, t, i)) && i.Fi(); + } else 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 3, t, t)); + } + function Pbn(n) { + var t, e, i, r, c; + if (((i = fcn(n)), null == (c = n.j) && i)) return n.$j() ? null : i.zj(); + if (CO(i, 148)) { + if ((e = i.Aj()) && (r = e.Nh()) != n.i) { + if ((t = Yx(i, 148)).Ej()) + try { + n.g = r.Kh(t, c); + } catch (t) { + if (!CO((t = j4(t)), 78)) throw hp(t); + n.g = null; + } + n.i = r; + } + return n.g; + } + return null; + } + function Ibn(n) { + var t; + return ( + eD((t = new ip()), new ZT(new QS(n.c, n.d), new QS(n.c + n.b, n.d))), + eD(t, new ZT(new QS(n.c, n.d), new QS(n.c, n.d + n.a))), + eD(t, new ZT(new QS(n.c + n.b, n.d + n.a), new QS(n.c + n.b, n.d))), + eD(t, new ZT(new QS(n.c + n.b, n.d + n.a), new QS(n.c, n.d + n.a))), + t + ); + } + function Cbn(n, t, e, i) { + var r, c, a; + if (((a = Hcn(t, e)), (i.c[i.c.length] = t), -1 == n.j[a.p] || 2 == n.j[a.p] || n.a[t.p])) return i; + for (n.j[a.p] = -1, c = new $K(bA(a7(a).a.Kc(), new h())); Vfn(c); ) + if (!ZW((r = Yx(kV(c), 17))) && (ZW(r) || r.c.i.c != r.d.i.c) && r != t) return Cbn(n, r, a, i); + return i; + } + function Obn(n, t, e) { + var i, r; + for (r = t.a.ec().Kc(); r.Ob(); ) + (i = Yx(r.Pb(), 79)), + !Yx(BF(n.b, i), 266) && + (IG(Kun(i)) == IG(Bun(i)) + ? Wwn(n, i, e) + : Kun(i) == IG(Bun(i)) + ? null == BF(n.c, i) && null != BF(n.b, Bun(i)) && Gyn(n, i, e, !1) + : null == BF(n.d, i) && null != BF(n.b, Kun(i)) && Gyn(n, i, e, !0)); + } + function Abn(n, t) { + var e, i, r, c, a, u, o; + for (r = n.Kc(); r.Ob(); ) + for (i = Yx(r.Pb(), 10), ZG((u = new Ion()), i), whn(u, (Ikn(), Eit)), b5(u, (Ojn(), DQn), (TA(), !0)), a = t.Kc(); a.Ob(); ) + (c = Yx(a.Pb(), 10)), ZG((o = new Ion()), c), whn(o, qit), b5(o, DQn, !0), b5((e = new jq()), DQn, !0), YG(e, u), QG(e, o); + } + function $bn(n, t, e, i) { + var r, c, a, u; + (r = Bnn(n, t, e)), + (c = Bnn(n, e, t)), + (a = Yx(BF(n.c, t), 112)), + (u = Yx(BF(n.c, e), 112)), + r < c + ? new wz((iQ(), _4n), a, u, c - r) + : c < r + ? new wz((iQ(), _4n), u, a, r - c) + : (0 != r || (t.i && e.i && i[t.i.c][e.i.c])) && (new wz((iQ(), _4n), a, u, 0), new wz(_4n, u, a, 0)); + } + function Lbn(n, t) { + var e, i, r, c, a, u; + for (r = 0, a = new pb(t.a); a.a < a.c.c.length; ) + for (r += (c = Yx(Hz(a), 10)).o.b + c.d.a + c.d.d + n.e, i = new $K(bA(u7(c).a.Kc(), new h())); Vfn(i); ) + (e = Yx(kV(i), 17)).c.i.k == (bon(), qzn) && (r += (u = Yx(Aun(e.c.i, (Ojn(), CQn)), 10)).o.b + u.d.a + u.d.d); + return r; + } + function Nbn(n, t, e) { + var i, r, c, a, u, o, s; + for ( + c = new ip(), + (function (n, t, e, i) { + var r, c, a, u, o, s, h; + for (u = -1, h = new pb(n); h.a < h.c.c.length; ) + ((s = Yx(Hz(h), 112)).g = u--), + (a = r = WR(QU(bH(hH(new SR(null, new Nz(s.f, 16)), new sa()), new ha())).d)), + (o = c = WR(QU(bH(hH(new SR(null, new Nz(s.k, 16)), new fa()), new la())).d)), + i || + ((a = WR(QU(bH(new SR(null, new Nz(s.f, 16)), new ba())).d)), + (o = WR(QU(bH(new SR(null, new Nz(s.k, 16)), new wa())).d))), + (s.d = a), + (s.a = r), + (s.i = o), + (s.b = c), + 0 == o ? VW(e, s, e.c.b, e.c) : 0 == a && VW(t, s, t.c.b, t.c); + })(n, (s = new ME()), (a = new ME()), t), + (function (n, t, e, i, r) { + var c, a, u, o, s, h, f, l, b, w, d, g, p, v, m; + for (m = Zx(n), o = new ip(), s = (c = n.c.length) - 1, h = c + 1; 0 != m.a.c; ) { + for (; 0 != e.b; ) S$(0 != e.b), (p = Yx(VZ(e, e.a.a), 112)), fG(m.a, p), (p.g = s--), evn(p, t, e, i); + for (; 0 != t.b; ) S$(0 != t.b), (v = Yx(VZ(t, t.a.a), 112)), fG(m.a, v), (v.g = h++), evn(v, t, e, i); + for (u = nTn, d = new sb(new gN(new UA(new ob(m.a).a).b)); OT(d.a.a); ) { + if (((w = Yx(m$(d.a).cd(), 112)), !i && w.b > 0 && w.a <= 0)) { + (o.c = VQ(UKn, iEn, 1, 0, 5, 1)), (o.c[o.c.length] = w); + break; + } + (b = w.i - w.d) >= u && (b > u && ((o.c = VQ(UKn, iEn, 1, 0, 5, 1)), (u = b)), (o.c[o.c.length] = w)); + } + 0 != o.c.length && + ((a = Yx(TR(o, Uen(r, o.c.length)), 112)), fG(m.a, a), (a.g = h++), evn(a, t, e, i), (o.c = VQ(UKn, iEn, 1, 0, 5, 1))); + } + for (g = n.c.length + 1, l = new pb(n); l.a < l.c.c.length; ) (f = Yx(Hz(l), 112)).g < c && (f.g = f.g + g); + })(n, s, a, t, e), + o = new pb(n); + o.a < o.c.c.length; + + ) + for (r = new pb((u = Yx(Hz(o), 112)).k); r.a < r.c.c.length; ) + (i = Yx(Hz(r), 129)), (!t || i.c == (iQ(), K4n)) && u.g > i.b.g && (c.c[c.c.length] = i); + return c; + } + function xbn() { + (xbn = O), + (Q8n = new FS("CANDIDATE_POSITION_LAST_PLACED_RIGHT", 0)), + (V8n = new FS("CANDIDATE_POSITION_LAST_PLACED_BELOW", 1)), + (J8n = new FS("CANDIDATE_POSITION_WHOLE_DRAWING_RIGHT", 2)), + (Y8n = new FS("CANDIDATE_POSITION_WHOLE_DRAWING_BELOW", 3)), + (Z8n = new FS("WHOLE_DRAWING", 4)); + } + function Dbn(n, t) { + var e, i; + if (t != n.Cb || (n.Db >> 16 != 11 && t)) { + if (ccn(n, t)) throw hp(new Qm(CNn + ugn(n))); + (i = null), + n.Cb && (i = (e = n.Db >> 16) >= 0 ? ocn(n, i) : n.Cb.ih(n, -1 - e, null, i)), + t && (i = men(t, n, 10, i)), + (i = vN(n, t, i)) && i.Fi(); + } else 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 11, t, t)); + } + function Rbn(n, t, e) { + return ( + udn(), + (!s3(n, t) || !s3(n, e)) && + (nkn(new QS(n.c, n.d), new QS(n.c + n.b, n.d), t, e) || + nkn(new QS(n.c + n.b, n.d), new QS(n.c + n.b, n.d + n.a), t, e) || + nkn(new QS(n.c + n.b, n.d + n.a), new QS(n.c, n.d + n.a), t, e) || + nkn(new QS(n.c, n.d + n.a), new QS(n.c, n.d), t, e)) + ); + } + function Kbn(n, t) { + var e, i, r, c; + if (!n.dc()) + for (e = 0, i = n.gc(); e < i; ++e) + if ( + null == (c = lL(n.Xb(e))) + ? null == t + : _N(c.substr(0, 3), "!##") + ? null != t && ((r = t.length), !_N(c.substr(c.length - r, r), t) || c.length != t.length + 3) && !_N(BRn, t) + : (_N(c, HRn) && !_N(BRn, t)) || _N(c, t) + ) + return !0; + return !1; + } + function _bn() { + (_bn = O), + (q2n = new aS(fIn, 0)), + (K2n = new aS("NIKOLOV", 1)), + (B2n = new aS("NIKOLOV_PIXEL", 2)), + (_2n = new aS("NIKOLOV_IMPROVED", 3)), + (F2n = new aS("NIKOLOV_IMPROVED_PIXEL", 4)), + (R2n = new aS("DUMMYNODE_PERCENTAGE", 5)), + (H2n = new aS("NODECOUNT_PERCENTAGE", 6)), + (G2n = new aS("NO_BOUNDARY", 7)); + } + function Fbn(n, t) { + var e, i, r, c, a, u; + for (e = Yx(Aun(t, (Ojn(), uQn)), 21), a = Yx(_V((ljn(), Mzn), e), 21), u = Yx(_V(Azn, e), 21), c = a.Kc(); c.Ob(); ) + if (((i = Yx(c.Pb(), 21)), !Yx(_V(n.b, i), 15).dc())) return !1; + for (r = u.Kc(); r.Ob(); ) if (((i = Yx(r.Pb(), 21)), !Yx(_V(n.b, i), 15).dc())) return !1; + return !0; + } + function Bbn(n, t) { + var i, r, c, a, u, o, s; + if (1 == n.a.c.length) return Don(Yx(TR(n.a, 0), 187), t); + for ( + c = (function (n) { + var t, i, r; + for (r = 0, i = new pb(n.a); i.a < i.c.c.length; ) (t = Yx(Hz(i), 187)), (r = e.Math.max(r, t.g)); + return r; + })(n), + u = 0, + o = n.d, + r = c, + s = n.d, + a = (o - r) / 2 + r; + r + 1 < o; + + ) { + for (u = 0, i = new pb(n.a); i.a < i.c.c.length; ) u += omn(Yx(Hz(i), 187), a, !1).a; + u < t ? ((s = a), (o = a)) : (r = a), (a = (o - r) / 2 + r); + } + return s; + } + function Hbn(n) { + var t, e, i, r, c; + for (e = new pb(n.a.a); e.a < e.c.c.length; ) { + for ((t = Yx(Hz(e), 307)).j = null, c = t.a.a.ec().Kc(); c.Ob(); ) + OI((i = Yx(c.Pb(), 57)).b), (!t.j || i.d.c < t.j.d.c) && (t.j = i); + for (r = t.a.a.ec().Kc(); r.Ob(); ) ((i = Yx(r.Pb(), 57)).b.a = i.d.c - t.j.d.c), (i.b.b = i.d.d - t.j.d.d); + } + return n; + } + function qbn(n) { + var t, e, i, r, c; + for (e = new pb(n.a.a); e.a < e.c.c.length; ) { + for ((t = Yx(Hz(e), 189)).f = null, c = t.a.a.ec().Kc(); c.Ob(); ) + OI((i = Yx(c.Pb(), 81)).e), (!t.f || i.g.c < t.f.g.c) && (t.f = i); + for (r = t.a.a.ec().Kc(); r.Ob(); ) ((i = Yx(r.Pb(), 81)).e.a = i.g.c - t.f.g.c), (i.e.b = i.g.d - t.f.g.d); + } + return n; + } + function Gbn() { + return ( + $jn(), + x4(Gy(kXn, 1), XEn, 77, 0, [ + vUn, + dUn, + mUn, + xUn, + nXn, + _Un, + aXn, + GUn, + JUn, + OUn, + WUn, + qUn, + ZUn, + SUn, + oXn, + sUn, + XUn, + eXn, + DUn, + tXn, + hXn, + QUn, + hUn, + YUn, + fXn, + rXn, + sXn, + RUn, + EUn, + KUn, + NUn, + uXn, + bUn, + kUn, + BUn, + lUn, + HUn, + $Un, + PUn, + zUn, + CUn, + gUn, + wUn, + LUn, + IUn, + UUn, + cXn, + fUn, + VUn, + AUn, + FUn, + TUn, + jUn, + iXn, + yUn, + MUn, + pUn, + ]) + ); + } + function zbn(n, t) { + var e; + n.d && + (t.c != n.e.c || + (function (n, t) { + return _4(), (n == bzn && t == wzn) || (n == bzn && t == dzn) || (n == gzn && t == dzn) || (n == gzn && t == wzn); + })(n.e.b, t.b)) && + (eD(n.f, n.d), (n.a = n.d.c + n.d.b), (n.d = null), (n.e = null)), + (function (n) { + return n == bzn || n == wzn; + })(t.b) + ? (n.c = t) + : (n.b = t), + ((t.b == (_4(), bzn) && !t.a) || (t.b == wzn && t.a) || (t.b == dzn && t.a) || (t.b == gzn && !t.a)) && + n.c && + n.b && + ((e = new mH(n.a, n.c.d, t.c - n.a, n.b.d - n.c.d)), (n.d = e), (n.e = t)); + } + function Ubn(n) { + var t; + if ((hm.call(this), (this.i = new lu()), (this.g = n), (this.f = Yx(n.e && n.e(), 9).length), 0 == this.f)) + throw hp(new Qm("There must be at least one phase in the phase enumeration.")); + (this.c = new cx((t = Yx(Ak(this.g), 9)), Yx(eN(t, t.length), 9), 0)), (this.a = new fX()), (this.b = new rp()); + } + function Xbn(n, t) { + var e, i; + if (t != n.Cb || (n.Db >> 16 != 7 && t)) { + if (ccn(n, t)) throw hp(new Qm(CNn + Qon(n))); + (i = null), + n.Cb && (i = (e = n.Db >> 16) >= 0 ? Jrn(n, i) : n.Cb.ih(n, -1 - e, null, i)), + t && (i = Yx(t, 49).gh(n, 1, Yrt, i)), + (i = kK(n, t, i)) && i.Fi(); + } else 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 7, t, t)); + } + function Wbn(n, t) { + var e, i; + if (t != n.Cb || (n.Db >> 16 != 3 && t)) { + if (ccn(n, t)) throw hp(new Qm(CNn + o9(n))); + (i = null), + n.Cb && (i = (e = n.Db >> 16) >= 0 ? tcn(n, i) : n.Cb.ih(n, -1 - e, null, i)), + t && (i = Yx(t, 49).gh(n, 0, ect, i)), + (i = jK(n, t, i)) && i.Fi(); + } else 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 3, t, t)); + } + function Vbn(n, t) { + var e, i, r, c, a, u, o, s, h; + return ( + jfn(), + t.d > n.d && ((u = n), (n = t), (t = u)), + t.d < 63 + ? (function (n, t) { + var e, i, r, c, a, u, o, s, h; + return ( + (c = (e = n.d) + (i = t.d)), + (a = n.e != t.e ? -1 : 1), + 2 == c + ? ((h = WR((o = e7(Gz(n.a[0], uMn), Gz(t.a[0], uMn))))), + 0 == (s = WR(UK(o, 32))) ? new wQ(a, h) : new C_(a, 2, x4(Gy(Wot, 1), MTn, 25, 15, [h, s]))) + : (Y8(n.a, e, t.a, i, (r = VQ(Wot, MTn, 25, c, 15, 1))), SU((u = new C_(a, c, r))), u) + ); + })(n, t) + : ((s = yV(n, (a = (-2 & n.d) << 4))), + (h = yV(t, a)), + (i = Evn(n, mV(s, a))), + (r = Evn(t, mV(h, a))), + (o = Vbn(s, h)), + (e = Vbn(i, r)), + (c = mV((c = Smn(Smn((c = Vbn(Evn(s, i), Evn(r, h))), o), e)), a)), + Smn(Smn((o = mV(o, a << 1)), c), e)) + ); + } + function Qbn(n, t, e) { + var i, r, c, a, u; + for (a = V8(n, e), u = VQ(Gzn, kIn, 10, t.length, 0, 1), i = 0, c = a.Kc(); c.Ob(); ) + ny(hL(Aun((r = Yx(c.Pb(), 11)), (Ojn(), gQn)))) && (u[i++] = Yx(Aun(r, RQn), 10)); + if (i < t.length) throw hp(new Ym("Expected " + t.length + " hierarchical ports, but found only " + i + ".")); + return u; + } + function Ybn(n, t) { + var e, i, r, c, a; + if (((null == n.i && svn(n), n.i).length, !n.p)) { + for (a = new kE(1 + (((3 * n.g.i) / 2) | 0)), r = new u$(n.g); r.e != r.i.gc(); ) + (i = Yx(fen(r), 170)), + (e = Yx(null == (c = i.ne()) ? Ysn(a.f, null, i) : r7(a.g, c, i), 170)) && (null == c ? Ysn(a.f, null, e) : r7(a.g, c, e)); + n.p = a; + } + return Yx(aG(n.p, t), 170); + } + function Jbn(n, t, e, i, r) { + var c, a, u, o; + for ( + (function (n, t) { + (t || null == console.groupCollapsed ? (null != console.group ? console.group : console.log) : console.groupCollapsed).call( + console, + n, + ); + })(i + Lq(e, e.$d()), r), + tB( + t, + (function (n) { + var t, + e = n.e; + return e && (e.stack || ((t = n[uTn]) && 0 != t.length ? "\t" + t.join("\n\t") : "")); + })(e), + ), + (c = e.f) && Jbn(n, t, c, "Caused by: ", !1), + null == e.k && (e.k = VQ(b_n, TEn, 78, 0, 0, 1)), + u = 0, + o = (a = e.k).length; + u < o; + ++u + ) + Jbn(n, t, a[u], "Suppressed: ", !1); + null != console.groupEnd && console.groupEnd.call(console); + } + function Zbn(n, t, e, i) { + var r, c, a, u; + for ( + a = (u = t.e).length, c = t.q._f(u, e ? 0 : a - 1, e), c |= zdn(n, u[e ? 0 : a - 1], e, i), r = e ? 1 : a - 2; + e ? r < a : r >= 0; + r += e ? 1 : -1 + ) + (c |= t.c.Sf(u, r, e, i && !ny(hL(Aun(t.j, (Ojn(), lQn)))) && !ny(hL(Aun(t.j, (Ojn(), qQn)))))), + (c |= t.q._f(u, r, e)), + (c |= zdn(n, u[r], e, i)); + return __(n.c, t), c; + } + function nwn(n, t, e) { + var i, r, c, a, u, o, s, h; + for (s = 0, h = (o = tX(n.j)).length; s < h; ++s) { + if (((u = o[s]), e == (h0(), e3n) || e == r3n)) + for (c = 0, a = (r = CU(u.g)).length; c < a; ++c) Oon(t, (i = r[c])) && mvn(i, !0); + if (e == i3n || e == r3n) for (c = 0, a = (r = CU(u.e)).length; c < a; ++c) Con(t, (i = r[c])) && mvn(i, !0); + } + } + function twn(n) { + var t, e; + switch ( + ((t = null), + (e = null), + (function (n) { + var t, e, i, r, c; + for (c = FK(n.k), Ikn(), i = 0, r = (e = x4(Gy(trt, 1), lIn, 61, 0, [Hit, Tit, Eit, Bit, qit])).length; i < r; ++i) + if ((t = e[i]) != Hit && !c.Hc(t)) return t; + return null; + })(n).g) + ) { + case 1: + Ikn(), (t = Eit), (e = qit); + break; + case 2: + Ikn(), (t = Bit), (e = Tit); + break; + case 3: + Ikn(), (t = qit), (e = Eit); + break; + case 4: + Ikn(), (t = Tit), (e = Bit); + } + Ll(n, Yx(qA(YK(Yx(_V(n.k, t), 15).Oc(), hWn)), 113)), $l(n, Yx(qA(QK(Yx(_V(n.k, e), 15).Oc(), hWn)), 113)); + } + function ewn(n) { + var t, e, i, r, c, a; + if ((r = Yx(TR(n.j, 0), 11)).e.c.length + r.g.c.length == 0) n.n.a = 0; + else { + for (a = 0, i = W_(n0(x4(Gy(QKn, 1), iEn, 20, 0, [new fw(r), new bw(r)]))); Vfn(i); ) + a += (e = Yx(kV(i), 11)).i.n.a + e.n.a + e.a.a; + (c = (t = Yx(Aun(n, (gjn(), w0n)), 8)) ? t.a : 0), (n.n.a = a / (r.e.c.length + r.g.c.length) - c); + } + } + function iwn(n, t) { + var e, i, r; + for (i = new pb(t.a); i.a < i.c.c.length; ) + (e = Yx(Hz(i), 221)), + sK(Yx(e.b, 65), yN(dO(Yx(t.b, 65).c), Yx(t.b, 65).a)), + (r = Ppn(Yx(t.b, 65).b, Yx(e.b, 65).b)) > 1 && (n.a = !0), + hK(Yx(e.b, 65), mN(dO(Yx(t.b, 65).c), KO(yN(dO(Yx(e.b, 65).a), Yx(t.b, 65).a), r))), + mz(n, t), + iwn(n, e); + } + function rwn(n) { + var t, e, i, r, c, a; + for (r = new pb(n.a.a); r.a < r.c.c.length; ) ((e = Yx(Hz(r), 189)).e = 0), e.d.a.$b(); + for (i = new pb(n.a.a); i.a < i.c.c.length; ) + for (t = (e = Yx(Hz(i), 189)).a.a.ec().Kc(); t.Ob(); ) + for (a = Yx(t.Pb(), 81).f.Kc(); a.Ob(); ) (c = Yx(a.Pb(), 81)).d != e && (__(e.d, c), ++c.d.e); + } + function cwn(n) { + var t, e, i, r, c, a, u, o; + for (e = 0, t = o = n.j.c.length, r = 2 * o, u = new pb(n.j); u.a < u.c.c.length; ) + switch ((a = Yx(Hz(u), 11)).j.g) { + case 2: + case 4: + a.p = -1; + break; + case 1: + case 3: + (i = a.e.c.length), (c = a.g.c.length), (a.p = i > 0 && c > 0 ? t++ : i > 0 ? e++ : c > 0 ? r++ : e++); + } + XH(), JC(n.j, new bi()); + } + function awn(n, t) { + var e, i, r, c, a, u, o, s, h; + for ( + u = t.j, a = t.g, o = Yx(TR(u, u.c.length - 1), 113), $z(0, u.c.length), s = srn(n, a, o, (h = Yx(u.c[0], 113))), c = 1; + c < u.c.length; + c++ + ) + $z(c - 1, u.c.length), + (e = Yx(u.c[c - 1], 113)), + $z(c, u.c.length), + (i = srn(n, a, e, (r = Yx(u.c[c], 113)))) > s && ((o = e), (h = r), (s = i)); + (t.a = h), (t.c = o); + } + function uwn(n) { + if (!n.a.d || !n.a.e) throw hp(new Ym((sL(eHn), eHn.k + " must have a source and target " + (sL(iHn), iHn.k + " specified.")))); + if (n.a.d == n.a.e) throw hp(new Ym("Network simplex does not support self-loops: " + n.a + " " + n.a.d + " " + n.a.e)); + return WA(n.a.d.g, n.a), WA(n.a.e.b, n.a), n.a; + } + function own(n, t, e) { + var i, r, c, a, u, o; + if (((i = 0), 0 != t.b && 0 != e.b)) { + (c = Ztn(t, 0)), (a = Ztn(e, 0)), (u = ty(fL(IX(c)))), (o = ty(fL(IX(a)))), (r = !0); + do { + if (u > o - n.b && u < o + n.b) return -1; + u > o - n.a && u < o + n.a && ++i, + u <= o && c.b != c.d.c ? (u = ty(fL(IX(c)))) : o <= u && a.b != a.d.c ? (o = ty(fL(IX(a)))) : (r = !1); + } while (r); + } + return i; + } + function swn(n) { + var t; + for (t = new $K(bA(o7(n).a.Kc(), new h())); Vfn(t); ) + if (Yx(kV(t), 17).d.i.k != (bon(), Fzn)) + throw hp( + new ly( + HIn + + yrn(n) + + "' has its layer constraint set to LAST, but has at least one outgoing edge that does not go to a LAST_SEPARATE node. That must not happen.", + ), + ); + } + function hwn(n, t, i, r) { + var c, a, u, o, s, f, l; + for (o = 0, s = new pb(n.a); s.a < s.c.c.length; ) { + for (u = 0, a = new $K(bA(u7(Yx(Hz(s), 10)).a.Kc(), new h())); Vfn(a); ) + (f = Dz((c = Yx(kV(a), 17)).c).b), (l = Dz(c.d).b), (u = e.Math.max(u, e.Math.abs(l - f))); + o = e.Math.max(o, u); + } + return r * e.Math.min(1, t / i) * o; + } + function fwn(n) { + var t; + return ( + (t = new Oy()), + 0 != (256 & n) && (t.a += "F"), + 0 != (128 & n) && (t.a += "H"), + 0 != (512 & n) && (t.a += "X"), + 0 != (2 & n) && (t.a += "i"), + 0 != (8 & n) && (t.a += "m"), + 0 != (4 & n) && (t.a += "s"), + 0 != (32 & n) && (t.a += "u"), + 0 != (64 & n) && (t.a += "w"), + 0 != (16 & n) && (t.a += "x"), + 0 != (n & DNn) && (t.a += ","), + iy(t.a) + ); + } + function lwn(n, t) { + var i, r, c; + for (run(t, "Resize child graph to fit parent.", 1), r = new pb(n.b); r.a < r.c.c.length; ) + (i = Yx(Hz(r), 29)), S4(n.a, i.a), (i.a.c = VQ(UKn, iEn, 1, 0, 5, 1)); + for (c = new pb(n.a); c.a < c.c.c.length; ) JG(Yx(Hz(c), 10), null); + (n.b.c = VQ(UKn, iEn, 1, 0, 5, 1)), + (function (n) { + var t, i, r, c, a; + (c = Yx(Aun(n, (gjn(), n0n)), 21)), + (a = Yx(Aun(n, i0n), 21)), + (t = new fC((i = new QS(n.f.a + n.d.b + n.d.c, n.f.b + n.d.d + n.d.a)))), + c.Hc((Ann(), Yit)) && + ((r = Yx(Aun(n, e0n), 8)), + a.Hc((Vgn(), crt)) && (r.a <= 0 && (r.a = 20), r.b <= 0 && (r.b = 20)), + (t.a = e.Math.max(i.a, r.a)), + (t.b = e.Math.max(i.b, r.b))), + (function (n, t, e) { + var i, r, c, a, u; + if ( + ((i = Yx(Aun(n, (gjn(), WZn)), 21)), + e.a > t.a && (i.Hc((dan(), ont)) ? (n.c.a += (e.a - t.a) / 2) : i.Hc(hnt) && (n.c.a += e.a - t.a)), + e.b > t.b && (i.Hc((dan(), lnt)) ? (n.c.b += (e.b - t.b) / 2) : i.Hc(fnt) && (n.c.b += e.b - t.b)), + Yx(Aun(n, (Ojn(), bQn)), 21).Hc((edn(), SVn)) && (e.a > t.a || e.b > t.b)) + ) + for (a = new pb(n.a); a.a < a.c.c.length; ) + (c = Yx(Hz(a), 10)).k == (bon(), _zn) && + ((r = Yx(Aun(c, hQn), 61)) == (Ikn(), Eit) ? (c.n.a += e.a - t.a) : r == Bit && (c.n.b += e.b - t.b)); + (u = n.d), (n.f.a = e.a - u.b - u.c), (n.f.b = e.b - u.d - u.a); + })(n, i, t); + })(n), + n.e && + (function (n, t) { + var e, i, r, c, a, u; + for (r = new pb(t.a); r.a < r.c.c.length; ) + CO((c = Aun((i = Yx(Hz(r), 10)), (Ojn(), CQn))), 11) && + ((u = Xpn(t, i, (a = Yx(c, 11)).o.a, a.o.b)), (a.n.a = u.a), (a.n.b = u.b), whn(a, Yx(Aun(i, hQn), 61))); + (e = new QS(t.f.a + t.d.b + t.d.c, t.f.b + t.d.d + t.d.a)), + Yx(Aun(t, (Ojn(), bQn)), 21).Hc((edn(), SVn)) + ? (b5(n, (gjn(), g0n), (Ran(), oit)), Yx(Aun(dB(n), bQn), 21).Fc(CVn), vyn(n, e, !1)) + : vyn(n, e, !0); + })(n.e, n), + Ron(t); + } + function bwn(n) { + var t, e, i, r, c, a, u; + if ( + ((r = (i = n.b).e), + (c = zN(Yx(Aun(i, (gjn(), g0n)), 98))), + (e = !!r && Yx(Aun(r, (Ojn(), bQn)), 21).Hc((edn(), SVn))), + !c && !e) + ) + for (u = new ub(new Zl(n.e).a.vc().Kc()); u.a.Ob(); ) + (t = Yx(u.a.Pb(), 42)), (a = Yx(t.dd(), 113)).a && (ZG(a.d, null), (a.c = !0), (n.a = !0)); + } + function wwn(n) { + var t, e, i, r, c, a, u, o, s, h, f, l; + for (f = -1, l = 0, s = 0, h = (o = n).length; s < h; ++s) { + for (a = 0, u = (c = o[s]).length; a < u; ++a) + for (r = c[a], t = new xM(-1 == f ? n[0] : n[f], Qrn(r)), e = 0; e < r.j.c.length; e++) + for (i = e + 1; i < r.j.c.length; i++) n_(t, Yx(TR(r.j, e), 11), Yx(TR(r.j, i), 11)) > 0 && ++l; + ++f; + } + return l; + } + function dwn(n, t) { + var e, i, r, c; + return ( + TT(), + t + ? t == (ayn(), Zut) || ((t == xut || t == Lut || t == Nut) && n != $ut) + ? new ykn(n, t) + : ((e = (i = Yx(t, 677)).pk()) || (nH(PJ((wsn(), wut), t)), (e = i.pk())), + !e.i && (e.i = new rp()), + !(r = Yx(eI(Dq((c = e.i).f, n)), 1942)) && xB(c, n, (r = new ykn(n, t))), + r) + : kut + ); + } + function gwn(n, t) { + var e, i, r, c, a, u, o, s; + for ( + u = Yx(Aun(n, (Ojn(), CQn)), 11), + o = $5(x4(Gy(B7n, 1), TEn, 8, 0, [u.i.n, u.n, u.a])).a, + s = n.i.n.b, + r = 0, + c = (i = CU(n.e)).length; + r < c; + ++r + ) + QG((e = i[r]), u), + EI(e.a, new QS(o, s)), + t && ((a = Yx(Aun(e, (gjn(), $1n)), 74)) || ((a = new Nv()), b5(e, $1n, a)), KD(a, new QS(o, s))); + } + function pwn(n, t) { + var e, i, r, c, a, u, o, s; + for ( + i = Yx(Aun(n, (Ojn(), CQn)), 11), + o = $5(x4(Gy(B7n, 1), TEn, 8, 0, [i.i.n, i.n, i.a])).a, + s = n.i.n.b, + a = 0, + u = (c = CU(n.g)).length; + a < u; + ++a + ) + YG((r = c[a]), i), + jI(r.a, new QS(o, s)), + t && ((e = Yx(Aun(r, (gjn(), $1n)), 74)) || ((e = new Nv()), b5(r, $1n, e)), KD(e, new QS(o, s))); + } + function vwn(n, t) { + var e, i, r, c, a; + for ( + n.b = new ip(), + n.d = Yx(Aun(t, (Ojn(), FQn)), 230), + n.e = (function (n) { + return t7(GK(D3(Xln(n, 32)), 32), D3(Xln(n, 32))); + })(n.d), + c = new ME(), + r = DV(x4(Gy(Dzn, 1), bIn, 37, 0, [t])), + a = 0; + a < r.c.length; + + ) + $z(a, r.c.length), ((i = Yx(r.c[a], 37)).p = a++), S4(r, (e = new Cyn(i, n.a, n.b)).b), eD(n.b, e), e.s && oF(Ztn(c, 0), e); + return (n.c = new Qp()), c; + } + function mwn(n) { + var t, e; + (e = Yx(Aun(n, (gjn(), x1n)), 163)), + (t = Yx(Aun(n, (Ojn(), pQn)), 303)), + e == (d7(), nYn) + ? (b5(n, x1n, iYn), b5(n, pQn, (AJ(), HVn))) + : e == eYn + ? (b5(n, x1n, iYn), b5(n, pQn, (AJ(), FVn))) + : t == (AJ(), HVn) + ? (b5(n, x1n, nYn), b5(n, pQn, BVn)) + : t == FVn && (b5(n, x1n, eYn), b5(n, pQn, BVn)); + } + function ywn() { + (ywn = O), + (D4n = new oa()), + ($4n = oR(new fX(), ($un(), ZGn), ($jn(), DUn))), + (x4n = yK(oR(new fX(), ZGn, QUn), tzn, VUn)), + (R4n = ltn(ltn(bT(yK(oR(new fX(), YGn, aXn), tzn, cXn), nzn), rXn), uXn)), + (L4n = yK(oR(oR(oR(new fX(), JGn, _Un), nzn, BUn), nzn, HUn), tzn, FUn)), + (N4n = yK(oR(oR(new fX(), nzn, HUn), nzn, kUn), tzn, yUn)); + } + function kwn() { + (kwn = O), + (H4n = oR(yK(new fX(), ($un(), tzn), ($jn(), TUn)), ZGn, DUn)), + (U4n = ltn(ltn(bT(yK(oR(new fX(), YGn, aXn), tzn, cXn), nzn), rXn), uXn)), + (q4n = yK(oR(oR(oR(new fX(), JGn, _Un), nzn, BUn), nzn, HUn), tzn, FUn)), + (z4n = oR(oR(new fX(), ZGn, QUn), tzn, VUn)), + (G4n = yK(oR(oR(new fX(), nzn, HUn), nzn, kUn), tzn, yUn)); + } + function jwn(n, t, e, i, r) { + var c, a; + ((ZW(t) || t.c.i.c != t.d.i.c) && W0($5(x4(Gy(B7n, 1), TEn, 8, 0, [r.i.n, r.n, r.a])), e)) || + ZW(t) || + (t.c == r ? A$(t.a, 0, new fC(e)) : KD(t.a, new fC(e)), + i && + !gE(n.a, e) && + ((a = Yx(Aun(t, (gjn(), $1n)), 74)) || ((a = new Nv()), b5(t, $1n, a)), VW(a, (c = new fC(e)), a.c.b, a.c), __(n.a, c))); + } + function Ewn(n) { + var t; + for (t = new $K(bA(u7(n).a.Kc(), new h())); Vfn(t); ) + if (Yx(kV(t), 17).c.i.k != (bon(), Fzn)) + throw hp( + new ly( + HIn + + yrn(n) + + "' has its layer constraint set to FIRST, but has at least one incoming edge that does not come from a FIRST_SEPARATE node. That must not happen.", + ), + ); + } + function Twn(n, t, i) { + var r, c, a, u; + for (this.b = new ip(), c = 0, r = 0, u = new pb(n); u.a < u.c.c.length; ) + (a = Yx(Hz(u), 167)), i && Xvn(a), eD(this.b, a), (c += a.o), (r += a.p); + this.b.c.length > 0 && ((c += (a = Yx(TR(this.b, 0), 167)).o), (r += a.p)), + (c *= 2), + (r *= 2), + t > 1 ? (c = oG(e.Math.ceil(c * t))) : (r = oG(e.Math.ceil(r / t))), + (this.a = new hnn(c, r)); + } + function Mwn(n, t, i, r, c, a) { + var u, o, s, h, f, l, b, w, d, g; + for ( + h = r, + t.j && t.o ? ((d = (b = Yx(BF(n.f, t.A), 57)).d.c + b.d.b), --h) : (d = t.a.c + t.a.b), + f = c, + i.q && i.o ? ((s = (b = Yx(BF(n.f, i.C), 57)).d.c), ++f) : (s = i.a.c), + w = d + (o = (s - d) / e.Math.max(2, f - h)), + l = h; + l < f; + ++l + ) + (g = (u = Yx(a.Xb(l), 128)).a.b), (u.a.c = w - g / 2), (w += o); + } + function Swn(n, t, e, i, r, c) { + var a, u, o, s, h, f; + for ( + s = e.c.length, c && (n.c = VQ(Wot, MTn, 25, t.length, 15, 1)), a = r ? 0 : t.length - 1; + r ? a < t.length : a >= 0; + a += r ? 1 : -1 + ) { + for ( + u = t[a], + o = i == (Ikn(), Eit) ? (r ? i7(u, i) : I3(i7(u, i))) : r ? I3(i7(u, i)) : i7(u, i), + c && (n.c[u.p] = o.gc()), + f = o.Kc(); + f.Ob(); + + ) + (h = Yx(f.Pb(), 11)), (n.d[h.p] = s++); + S4(e, o); + } + } + function Pwn(n, t, e) { + var i, r, c, a, u, o, s, h; + for ( + c = ty(fL(n.b.Kc().Pb())), + s = ty( + fL( + (function (n) { + var t; + if (n) { + if ((t = n).dc()) throw hp(new Kp()); + return t.Xb(t.gc() - 1); + } + return Iz(n.Kc()); + })(t.b), + ), + ), + i = KO(dO(n.a), s - e), + r = KO(dO(t.a), e - c), + KO((h = mN(i, r)), 1 / (s - c)), + this.a = h, + this.b = new ip(), + u = !0, + (a = n.b.Kc()).Pb(); + a.Ob(); + + ) + (o = ty(fL(a.Pb()))), u && o - e > YAn && (this.b.Fc(e), (u = !1)), this.b.Fc(o); + u && this.b.Fc(e); + } + function Iwn(n) { + var t, i, r, c; + if ( + ((function (n, t) { + var i, r, c, a, u, o, s; + for (c = VQ(Wot, MTn, 25, n.e.a.c.length, 15, 1), u = new pb(n.e.a); u.a < u.c.c.length; ) + c[(a = Yx(Hz(u), 121)).d] += a.b.a.c.length; + for (o = nD(t); 0 != o.b; ) + for (r = PY(new pb((a = Yx(0 == o.b ? null : (S$(0 != o.b), VZ(o, o.a.a)), 121)).g.a)); r.Ob(); ) + ((s = (i = Yx(r.Pb(), 213)).e).e = e.Math.max(s.e, a.e + i.a)), --c[s.d], 0 == c[s.d] && VW(o, s, o.c.b, o.c); + })(n, n.n), + n.d.c.length > 0) + ) { + for (oy(n.c); Yfn(n, Yx(Hz(new pb(n.e.a)), 121)) < n.e.a.c.length; ) { + for (c = (t = $rn(n)).e.e - t.d.e - t.a, t.e.j && (c = -c), r = new pb(n.e.a); r.a < r.c.c.length; ) + (i = Yx(Hz(r), 121)).j && (i.e += c); + oy(n.c); + } + oy(n.c), $hn(n, Yx(Hz(new pb(n.e.a)), 121)), myn(n); + } + } + function Cwn(n, t) { + if (t instanceof Object) + try { + if (((t.__java$exception = n), -1 != navigator.userAgent.toLowerCase().indexOf("msie") && $doc.documentMode < 9)) return; + var e = n; + Object.defineProperties(t, { + cause: { + get: function () { + var n = e.Zd(); + return n && n.Xd(); + }, + }, + suppressed: { + get: function () { + return e.Yd(); + }, + }, + }); + } catch (n) {} + } + function Own(n, t) { + var e, i, r, c, a; + if (((i = t >> 5), (t &= 31), i >= n.d)) return n.e < 0 ? (bdn(), lFn) : (bdn(), pFn); + if ( + ((c = n.d - i), + (function (n, t, e, i, r) { + var c, a, u; + for (c = !0, a = 0; a < i; a++) c &= 0 == e[a]; + if (0 == r) smn(e, i, n, 0, t), (a = t); + else { + for (u = 32 - r, c &= e[a] << u == 0, a = 0; a < t - 1; a++) n[a] = (e[a + i] >>> r) | (e[a + i + 1] << u); + (n[a] = e[a + i] >>> r), ++a; + } + })((r = VQ(Wot, MTn, 25, c + 1, 15, 1)), c, n.a, i, t), + n.e < 0) + ) { + for (e = 0; e < i && 0 == n.a[e]; e++); + if (e < i || (t > 0 && n.a[e] << (32 - t) != 0)) { + for (e = 0; e < c && -1 == r[e]; e++) r[e] = 0; + e == c && ++c, ++r[e]; + } + } + return SU((a = new C_(n.e, c, r))), a; + } + function Awn(n) { + var t, e, i, r; + return ( + (e = new tw((r = TG(n)))), + (i = new ew(r)), + S4((t = new ip()), (!n.d && (n.d = new AN(nct, n, 8, 5)), n.d)), + S4(t, (!n.e && (n.e = new AN(nct, n, 7, 4)), n.e)), + Yx( + kW( + fH(hH(new SR(null, new Nz(t, 16)), e), i), + kJ(new Q(), new Y(), new cn(), new an(), x4(Gy(wBn, 1), XEn, 132, 0, [(C6(), uBn), aBn])), + ), + 21, + ) + ); + } + function $wn(n, t, e, i) { + var r, c, a, u, o; + if ((TT(), (u = Yx(t, 66).Oj()), Lwn(n.e, t))) { + if (t.hi() && fvn(n, t, i, CO(t, 99) && 0 != (Yx(t, 18).Bb & eMn))) throw hp(new Qm(kxn)); + } else for (o = dwn(n.e.Tg(), t), r = Yx(n.g, 119), a = 0; a < n.i; ++a) if (((c = r[a]), o.rl(c.ak()))) throw hp(new Qm(GRn)); + y9(n, fsn(n, t, e), u ? Yx(i, 72) : VX(t, i)); + } + function Lwn(n, t) { + var e, i, r; + return ( + TT(), + !!t.$j() || + (-2 == t.Zj() && + (t == (dfn(), Put) || + t == Tut || + t == Mut || + t == Sut || + (!(tnn((r = n.Tg()), t) >= 0) && + (!(e = iyn((wsn(), wut), r, t)) || (((i = e.Zj()) > 1 || -1 == i) && 3 != TB(PJ(wut, e))))))) + ); + } + function Nwn(n, t, e, i) { + var r, c, a, u, o; + return ( + (u = iun(Yx(c1((!t.b && (t.b = new AN(Zrt, t, 4, 7)), t.b), 0), 82))), + (o = iun(Yx(c1((!t.c && (t.c = new AN(Zrt, t, 5, 8)), t.c), 0), 82))), + IG(u) == IG(o) || XZ(o, u) ? null : (a = EG(t)) == e ? i : (c = Yx(BF(n.a, a), 10)) && (r = c.e) ? r : null + ); + } + function xwn(n, t, e) { + var i, r, c, a, u; + if ( + (c = + n[ + (function (n, t) { + return n ? t - 1 : 0; + })(e, n.length) + ])[0].k == (bon(), _zn) + ) + for (r = Zy(e, c.length), u = t.j, i = 0; i < u.c.length; i++) + $z(i, u.c.length), + (a = Yx(u.c[i], 11)), + (e ? a.j == (Ikn(), Eit) : a.j == (Ikn(), qit)) && + ny(hL(Aun(a, (Ojn(), gQn)))) && + (QW(u, i, Yx(Aun(c[r], (Ojn(), CQn)), 11)), (r += e ? 1 : -1)); + } + function Dwn(n, t) { + var e, i, r, c, a; + (a = new ip()), (e = t); + do { + ((c = Yx(BF(n.b, e), 128)).B = e.c), (c.D = e.d), (a.c[a.c.length] = c), (e = Yx(BF(n.k, e), 17)); + } while (e); + return ( + $z(0, a.c.length), + ((i = Yx(a.c[0], 128)).j = !0), + (i.A = Yx(i.d.a.ec().Kc().Pb(), 17).c.i), + ((r = Yx(TR(a, a.c.length - 1), 128)).q = !0), + (r.C = Yx(r.d.a.ec().Kc().Pb(), 17).d.i), + a + ); + } + function Rwn(n) { + if (null == n.g) + switch (n.p) { + case 0: + n.g = (function (n) { + if (0 != n.p) throw hp(new Lp()); + return hI(n.f, 0); + })(n) + ? (TA(), L_n) + : (TA(), $_n); + break; + case 1: + n.g = iZ( + (function (n) { + if (1 != n.p) throw hp(new Lp()); + return (WR(n.f) << 24) >> 24; + })(n), + ); + break; + case 2: + n.g = k4( + (function (n) { + if (2 != n.p) throw hp(new Lp()); + return WR(n.f) & fTn; + })(n), + ); + break; + case 3: + n.g = (function (n) { + if (3 != n.p) throw hp(new Lp()); + return n.e; + })(n); + break; + case 4: + n.g = new ib( + (function (n) { + if (4 != n.p) throw hp(new Lp()); + return n.e; + })(n), + ); + break; + case 6: + n.g = ytn( + (function (n) { + if (6 != n.p) throw hp(new Lp()); + return n.f; + })(n), + ); + break; + case 5: + n.g = d9( + (function (n) { + if (5 != n.p) throw hp(new Lp()); + return WR(n.f); + })(n), + ); + break; + case 7: + n.g = g9( + (function (n) { + if (7 != n.p) throw hp(new Lp()); + return (WR(n.f) << 16) >> 16; + })(n), + ); + } + return n.g; + } + function Kwn(n) { + if (null == n.n) + switch (n.p) { + case 0: + n.n = (function (n) { + if (0 != n.p) throw hp(new Lp()); + return hI(n.k, 0); + })(n) + ? (TA(), L_n) + : (TA(), $_n); + break; + case 1: + n.n = iZ( + (function (n) { + if (1 != n.p) throw hp(new Lp()); + return (WR(n.k) << 24) >> 24; + })(n), + ); + break; + case 2: + n.n = k4( + (function (n) { + if (2 != n.p) throw hp(new Lp()); + return WR(n.k) & fTn; + })(n), + ); + break; + case 3: + n.n = (function (n) { + if (3 != n.p) throw hp(new Lp()); + return n.j; + })(n); + break; + case 4: + n.n = new ib( + (function (n) { + if (4 != n.p) throw hp(new Lp()); + return n.j; + })(n), + ); + break; + case 6: + n.n = ytn( + (function (n) { + if (6 != n.p) throw hp(new Lp()); + return n.k; + })(n), + ); + break; + case 5: + n.n = d9( + (function (n) { + if (5 != n.p) throw hp(new Lp()); + return WR(n.k); + })(n), + ); + break; + case 7: + n.n = g9( + (function (n) { + if (7 != n.p) throw hp(new Lp()); + return (WR(n.k) << 16) >> 16; + })(n), + ); + } + return n.n; + } + function _wn(n) { + var t, e, i, r, c, a; + for (r = new pb(n.a.a); r.a < r.c.c.length; ) ((e = Yx(Hz(r), 307)).g = 0), (e.i = 0), e.e.a.$b(); + for (i = new pb(n.a.a); i.a < i.c.c.length; ) + for (t = (e = Yx(Hz(i), 307)).a.a.ec().Kc(); t.Ob(); ) + for (a = Yx(t.Pb(), 57).c.Kc(); a.Ob(); ) (c = Yx(a.Pb(), 57)).a != e && (__(e.e, c), ++c.a.g, ++c.a.i); + } + function Fwn(n, t) { + var e, i, r, c, a, u, o, s; + (r = t ? new pc() : new vc()), (c = !1); + do { + for (c = !1, a = (t ? I3(n.b) : n.b).Kc(); a.Ob(); ) + for (s = Xz(Yx(a.Pb(), 29).a), t || new Tm(s), o = new pb(s); o.a < o.c.c.length; ) + (u = Yx(Hz(o), 10)), r.Mb(u) && ((i = u), (e = Yx(Aun(u, (Ojn(), YVn)), 305)), (c = Ldn(i, t ? e.b : e.k, t, !1))); + } while (c); + } + function Bwn(n, t) { + var i, r, c, a, u, o; + return ( + (a = n.d), + (o = ty(fL(Aun(n, (gjn(), y1n))))) < 0 && b5(n, y1n, (o = 0)), + (t.o.b = o), + (u = e.Math.floor(o / 2)), + whn((r = new Ion()), (Ikn(), qit)), + ZG(r, t), + (r.n.b = u), + whn((c = new Ion()), Eit), + ZG(c, t), + (c.n.b = u), + QG(n, r), + o4((i = new jq()), n), + b5(i, $1n, null), + YG(i, c), + QG(i, a), + (function (n, t, e) { + var i, r; + (i = t.c.i), + (r = e.d.i), + i.k == (bon(), Bzn) + ? (b5(n, (Ojn(), TQn), Yx(Aun(i, TQn), 11)), b5(n, MQn, Yx(Aun(i, MQn), 11)), b5(n, EQn, hL(Aun(i, EQn)))) + : i.k == Fzn + ? (b5(n, (Ojn(), TQn), Yx(Aun(i, TQn), 11)), b5(n, MQn, Yx(Aun(i, MQn), 11)), b5(n, EQn, (TA(), !0))) + : r.k == Fzn + ? (b5(n, (Ojn(), TQn), Yx(Aun(r, TQn), 11)), b5(n, MQn, Yx(Aun(r, MQn), 11)), b5(n, EQn, (TA(), !0))) + : (b5(n, (Ojn(), TQn), t.c), b5(n, MQn, e.d)); + })(t, n, i), + (function (n, t) { + var e, i; + for (i = new JU(n.b, 0); i.b < i.d.gc(); ) + S$(i.b < i.d.gc()), + (e = Yx(i.d.Xb((i.c = i.b++)), 70)), + Yx(Aun(e, (gjn(), f1n)), 272) == (ZZ(), aet) && (hB(i), eD(t.b, e), O$(e, (Ojn(), aQn)) || b5(e, aQn, n)); + })(n, i), + i + ); + } + function Hwn(n, t, e, i) { + var r, c; + return t + ? 0 == (r = n.a.ue(e.d, t.d)) + ? ((i.d = YL(t, e.e)), (i.b = !0), t) + : ((c = r < 0 ? 0 : 1), + (t.a[c] = Hwn(n, t.a[c], e, i)), + cy(t.a[c]) && + (cy(t.a[1 - c]) + ? ((t.b = !0), (t.a[0].b = !1), (t.a[1].b = !1)) + : cy(t.a[c].a[c]) + ? (t = c2(t, 1 - c)) + : cy(t.a[c].a[1 - c]) && (t = LU(t, 1 - c))), + t) + : e; + } + function qwn(n, t, i) { + var r, c, a, u; + (c = n.i), + (r = n.n), + SV(n, (JZ(), rHn), c.c + r.b, i), + SV(n, aHn, c.c + c.b - r.c - i[2], i), + (u = c.b - r.b - r.c), + i[0] > 0 && ((i[0] += n.d), (u -= i[0])), + i[2] > 0 && ((i[2] += n.d), (u -= i[2])), + (a = e.Math.max(0, u)), + (i[1] = e.Math.max(i[1], u)), + SV(n, cHn, c.c + r.b + i[0] - (i[1] - u) / 2, i), + t == cHn && ((n.c.b = a), (n.c.c = c.c + r.b + (a - u) / 2)); + } + function Gwn() { + (this.c = VQ(Jot, rMn, 25, (Ikn(), x4(Gy(trt, 1), lIn, 61, 0, [Hit, Tit, Eit, Bit, qit])).length, 15, 1)), + (this.b = VQ(Jot, rMn, 25, x4(Gy(trt, 1), lIn, 61, 0, [Hit, Tit, Eit, Bit, qit]).length, 15, 1)), + (this.a = VQ(Jot, rMn, 25, x4(Gy(trt, 1), lIn, 61, 0, [Hit, Tit, Eit, Bit, qit]).length, 15, 1)), + HT(this.c, JTn), + HT(this.b, ZTn), + HT(this.a, ZTn); + } + function zwn(n, t, e) { + var i, r, c, a; + if ((t <= e ? ((r = t), (c = e)) : ((r = e), (c = t)), (i = 0), null == n.b)) + (n.b = VQ(Wot, MTn, 25, 2, 15, 1)), (n.b[0] = r), (n.b[1] = c), (n.c = !0); + else { + if (((i = n.b.length), n.b[i - 1] + 1 == r)) return void (n.b[i - 1] = c); + (a = VQ(Wot, MTn, 25, i + 2, 15, 1)), + smn(n.b, 0, a, 0, i), + (n.b = a), + n.b[i - 1] >= r && ((n.c = !1), (n.a = !1)), + (n.b[i++] = r), + (n.b[i] = c), + n.c || xln(n); + } + } + function Uwn(n, t, e) { + var i, r, c, a, u, o; + if (!MX(t)) { + for (run((o = J2(e, ((CO(t, 14) ? Yx(t, 14).gc() : FX(t.Kc())) / n.a) | 0)), a$n, 1), u = new Ca(), a = 0, c = t.Kc(); c.Ob(); ) + (i = Yx(c.Pb(), 86)), (u = n0(x4(Gy(QKn, 1), iEn, 20, 0, [u, new Dd(i)]))), a < i.f.b && (a = i.f.b); + for (r = t.Kc(); r.Ob(); ) b5((i = Yx(r.Pb(), 86)), (ryn(), k5n), a); + Ron(o), Uwn(n, u, e); + } + } + function Xwn(n, t) { + var i, r, c, a, u, o, s; + for (i = ZTn, bon(), o = Hzn, c = new pb(t.a); c.a < c.c.c.length; ) + (a = (r = Yx(Hz(c), 10)).k) != Hzn && + (null == (u = fL(Aun(r, (Ojn(), AQn)))) ? ((i = e.Math.max(i, 0)), (r.n.b = i + JA(n.a, a, o))) : (r.n.b = (vB(u), u))), + (s = JA(n.a, a, o)), + r.n.b < i + s + r.d.d && (r.n.b = i + s + r.d.d), + (i = r.n.b + r.o.b + r.d.a), + (o = a); + } + function Wwn(n, t, e) { + var i, r, c; + for ( + o4((c = new eln(yjn(Kon(Ywn(t, !1, !1)), ty(fL(jln(t, (len(), Aqn)))) + n.a))), t), + xB(n.b, t, c), + e.c[e.c.length] = c, + !t.n && (t.n = new m_(act, t, 1, 7)), + r = new UO(t.n); + r.e != r.i.gc(); + + ) + (i = lgn(n, Yx(hen(r), 137), !0, 0, 0)), (e.c[e.c.length] = i); + return c; + } + function Vwn(n, t, e, i, r) { + var c, a, u; + if ((n.d && n.d.lg(r), oin(n, e, Yx(r.Xb(0), 33), !1))) return !0; + if (oin(n, i, Yx(r.Xb(r.gc() - 1), 33), !0)) return !0; + if (zun(n, r)) return !0; + for (u = r.Kc(); u.Ob(); ) for (a = Yx(u.Pb(), 33), c = t.Kc(); c.Ob(); ) if (jdn(n, a, Yx(c.Pb(), 33))) return !0; + return !1; + } + function Qwn(n, t, e, i) { + var r, c, a, u; + for ( + r = Yx( + $on(t, (Ikn(), qit)) + .Kc() + .Pb(), + 11, + ), + c = Yx($on(t, Eit).Kc().Pb(), 11), + u = new pb(n.j); + u.a < u.c.c.length; + + ) { + for (a = Yx(Hz(u), 11); 0 != a.e.c.length; ) QG(Yx(TR(a.e, 0), 17), r); + for (; 0 != a.g.c.length; ) YG(Yx(TR(a.g, 0), 17), c); + } + e || b5(t, (Ojn(), TQn), null), i || b5(t, (Ojn(), MQn), null); + } + function Ywn(n, t, e) { + var i, r; + if (0 == (!n.a && (n.a = new m_(tct, n, 6, 6)), n.a).i) return V4(n); + if ( + ((i = Yx(c1((!n.a && (n.a = new m_(tct, n, 6, 6)), n.a), 0), 202)), + t && (Hmn((!i.a && (i.a = new XO(Qrt, i, 5)), i.a)), x1(i, 0), R1(i, 0), O1(i, 0), D1(i, 0)), + e) + ) + for (!n.a && (n.a = new m_(tct, n, 6, 6)), r = n.a; r.i > 1; ) tdn(r, r.i - 1); + return i; + } + function Jwn(n, t) { + var e, i, r, c, a, u; + for (e = new ep(), r = new pb(n.b); r.a < r.c.c.length; ) { + for (u = !0, i = 0, a = new pb(Yx(Hz(r), 29).a); a.a < a.c.c.length; ) + switch ((c = Yx(Hz(a), 10)).k.g) { + case 4: + ++i; + case 1: + CX(e, c); + break; + case 0: + Fsn(c, t); + default: + e.b == e.c || cpn(e, i, u, !1, t), (u = !1), (i = 0); + } + e.b == e.c || cpn(e, i, u, !0, t); + } + } + function Zwn(n, t) { + var e, i, r, c, a, u; + for (e = 0, u = new pb(t); u.a < u.c.c.length; ) { + for (a = Yx(Hz(u), 11), R6(n.b, n.d[a.p]), r = new UV(a.b); ZC(r.a) || ZC(r.b); ) + (c = cj(n, a == (i = Yx(ZC(r.a) ? Hz(r.a) : Hz(r.b), 17)).c ? i.d : i.c)) > n.d[a.p] && ((e += zW(n.b, c)), OX(n.a, d9(c))); + for (; !ry(n.a); ) eZ(n.b, Yx($_(n.a), 19).a); + } + return e; + } + function ndn(n, t, e) { + var i, r, c, a; + for ( + c = (!t.a && (t.a = new m_(uct, t, 10, 11)), t.a).i, r = new UO((!t.a && (t.a = new m_(uct, t, 10, 11)), t.a)); + r.e != r.i.gc(); + + ) + 0 == (!(i = Yx(hen(r), 33)).a && (i.a = new m_(uct, i, 10, 11)), i.a).i || (c += ndn(n, i, !1)); + if (e) for (a = IG(t); a; ) (c += (!a.a && (a.a = new m_(uct, a, 10, 11)), a.a).i), (a = IG(a)); + return c; + } + function tdn(n, t) { + var e, i, r, c; + return n.ej() + ? ((i = null), + (r = n.fj()), + n.ij() && (i = n.kj(n.pi(t), null)), + (e = n.Zi(4, (c = Orn(n, t)), null, t, r)), + n.bj() && null != c ? ((i = n.dj(c, i)) ? (i.Ei(e), i.Fi()) : n.$i(e)) : i ? (i.Ei(e), i.Fi()) : n.$i(e), + c) + : ((c = Orn(n, t)), n.bj() && null != c && (i = n.dj(c, null)) && i.Fi(), c); + } + function edn() { + (edn = O), + (TVn = new YM("COMMENTS", 0)), + (SVn = new YM("EXTERNAL_PORTS", 1)), + (PVn = new YM("HYPEREDGES", 2)), + (IVn = new YM("HYPERNODES", 3)), + (CVn = new YM("NON_FREE_PORTS", 4)), + (OVn = new YM("NORTH_SOUTH_PORTS", 5)), + ($Vn = new YM(cCn, 6)), + (EVn = new YM("CENTER_LABELS", 7)), + (MVn = new YM("END_LABELS", 8)), + (AVn = new YM("PARTITIONS", 9)); + } + function idn(n) { + var t, e, i, r, c; + for (r = new ip(), t = new kR((!n.a && (n.a = new m_(uct, n, 10, 11)), n.a)), i = new $K(bA(lbn(n).a.Kc(), new h())); Vfn(i); ) + CO(c1((!(e = Yx(kV(i), 79)).b && (e.b = new AN(Zrt, e, 4, 7)), e.b), 0), 186) || + ((c = iun(Yx(c1((!e.c && (e.c = new AN(Zrt, e, 5, 8)), e.c), 0), 82))), t.a._b(c) || (r.c[r.c.length] = c)); + return r; + } + function rdn(n) { + var t, e, i, r, c; + for (r = new Qp(), t = new kR((!n.a && (n.a = new m_(uct, n, 10, 11)), n.a)), i = new $K(bA(lbn(n).a.Kc(), new h())); Vfn(i); ) + CO(c1((!(e = Yx(kV(i), 79)).b && (e.b = new AN(Zrt, e, 4, 7)), e.b), 0), 186) || + ((c = iun(Yx(c1((!e.c && (e.c = new AN(Zrt, e, 5, 8)), e.c), 0), 82))), t.a._b(c) || r.a.zc(c, r)); + return r; + } + function cdn(n, t) { + var i, r, c; + IG(n) && + ((c = Yx(Aun(t, (gjn(), n0n)), 174)), + iI(jln(n, g0n)) === iI((Ran(), lit)) && Aen(n, g0n, fit), + dT(), + (r = hkn(new Xm(IG(n)), new e$(IG(n) ? new Xm(IG(n)) : null, n), !1, !0)), + n2(c, (Ann(), Yit)), + ((i = Yx(Aun(t, e0n), 8)).a = e.Math.max(r.a, i.a)), + (i.b = e.Math.max(r.b, i.b))); + } + function adn() { + (adn = O), + (tWn = new kH(NSn, 0, (Ikn(), Tit), Tit)), + (rWn = new kH(DSn, 1, Bit, Bit)), + (nWn = new kH(xSn, 2, Eit, Eit)), + (uWn = new kH(RSn, 3, qit, qit)), + (iWn = new kH("NORTH_WEST_CORNER", 4, qit, Tit)), + (eWn = new kH("NORTH_EAST_CORNER", 5, Tit, Eit)), + (aWn = new kH("SOUTH_WEST_CORNER", 6, Bit, qit)), + (cWn = new kH("SOUTH_EAST_CORNER", 7, Eit, Bit)); + } + function udn() { + (udn = O), + (_7n = x4(Gy(Qot, 1), tMn, 25, 14, [ + 1, + 1, + 2, + 6, + 24, + 120, + 720, + 5040, + 40320, + 362880, + 3628800, + 39916800, + 479001600, + 6227020800, + 87178291200, + 1307674368e3, + { l: 3506176, m: 794077, h: 1 }, + { l: 884736, m: 916411, h: 20 }, + { l: 3342336, m: 3912489, h: 363 }, + { l: 589824, m: 3034138, h: 6914 }, + { l: 3407872, m: 1962506, h: 138294 }, + ])), + e.Math.pow(2, -65); + } + function odn(n, t) { + var e, i, r, c, a; + if (0 == n.c.length) return new mP(d9(0), d9(0)); + for (e = ($z(0, n.c.length), Yx(n.c[0], 11)).j, a = 0, c = t.g, i = t.g + 1; a < n.c.length - 1 && e.g < c; ) + e = ($z(++a, n.c.length), Yx(n.c[a], 11)).j; + for (r = a; r < n.c.length - 1 && e.g < i; ) ++r, (e = ($z(a, n.c.length), Yx(n.c[a], 11)).j); + return new mP(d9(a), d9(r)); + } + function sdn(n, t, i) { + var r, c, a, u, o, s, h, f, l, b; + for (a = t.c.length, $z(i, t.c.length), o = (u = Yx(t.c[i], 286)).a.o.a, l = u.c, b = 0, h = u.c; h <= u.f; h++) { + if (o <= n.a[h]) return h; + for (f = n.a[h], s = null, c = i + 1; c < a; c++) $z(c, t.c.length), (r = Yx(t.c[c], 286)).c <= h && r.f >= h && (s = r); + s && (f = e.Math.max(f, s.a.o.a)), f > b && ((l = h), (b = f)); + } + return l; + } + function hdn(n, t) { + var e; + switch (((e = null), t.g)) { + case 1: + n.e.Xe((Cjn(), gtt)) && (e = Yx(n.e.We(gtt), 249)); + break; + case 3: + n.e.Xe((Cjn(), ptt)) && (e = Yx(n.e.We(ptt), 249)); + break; + case 2: + n.e.Xe((Cjn(), dtt)) && (e = Yx(n.e.We(dtt), 249)); + break; + case 4: + n.e.Xe((Cjn(), vtt)) && (e = Yx(n.e.We(vtt), 249)); + } + return !e && (e = Yx(n.e.We((Cjn(), btt)), 249)), e; + } + function fdn(n, t, e) { + var i, r, c, a, u, o; + for (t.p = 1, r = t.c, o = inn(t, (h0(), i3n)).Kc(); o.Ob(); ) + for (i = new pb(Yx(o.Pb(), 11).g); i.a < i.c.c.length; ) + t != (u = Yx(Hz(i), 17).d.i) && + u.c.p <= r.p && + ((c = r.p + 1) == e.b.c.length ? (((a = new qF(e)).p = c), eD(e.b, a), JG(u, a)) : JG(u, (a = Yx(TR(e.b, c), 29))), + fdn(n, u, e)); + } + function ldn(n, t, i) { + var r, c, a, u, o, s; + for (c = i, a = 0, o = new pb(t); o.a < o.c.c.length; ) + Aen((u = Yx(Hz(o), 33)), (_rn(), X6n), d9(c++)), + (s = idn(u)), + (r = e.Math.atan2(u.j + u.f / 2, u.i + u.g / 2)), + (r += r < 0 ? w$n : 0) < 0.7853981633974483 || r > $$n + ? JC(s, n.b) + : r <= $$n && r > L$n + ? JC(s, n.d) + : r <= L$n && r > N$n + ? JC(s, n.c) + : r <= N$n && JC(s, n.a), + (a = ldn(n, s, a)); + return c; + } + function bdn() { + var n; + for ( + bdn = O, + bFn = new wQ(1, 1), + dFn = new wQ(1, 10), + pFn = new wQ(0, 0), + lFn = new wQ(-1, 1), + wFn = x4(Gy(EFn, 1), TEn, 91, 0, [ + pFn, + bFn, + new wQ(1, 2), + new wQ(1, 3), + new wQ(1, 4), + new wQ(1, 5), + new wQ(1, 6), + new wQ(1, 7), + new wQ(1, 8), + new wQ(1, 9), + dFn, + ]), + gFn = VQ(EFn, TEn, 91, 32, 0, 1), + n = 0; + n < gFn.length; + n++ + ) + gFn[n] = Utn(GK(1, n)); + } + function wdn(n, t, e, i, r, c) { + var a, u, o, s; + for ( + u = !ej(hH(n.Oc(), new Cb(new Je()))).sd((HE(), dBn)), + a = n, + c == (t9(), eet) && (a = CO(a, 152) ? RV(Yx(a, 152)) : CO(a, 131) ? Yx(a, 131).a : CO(a, 54) ? new Tm(a) : new rE(a)), + s = a.Kc(); + s.Ob(); + + ) + ((o = Yx(s.Pb(), 70)).n.a = t.a), (o.n.b = u ? t.b + (i.b - o.o.b) / 2 : r ? t.b : t.b + i.b - o.o.b), (t.a += o.o.a + e); + } + function ddn(n, t, e, i) { + var r, c, a, u, o; + for (r = (i.c + i.a) / 2, BH(t.j), KD(t.j, r), BH(e.e), KD(e.e, r), o = new Ik(), a = new pb(n.f); a.a < a.c.c.length; ) + zcn(o, t, (u = Yx(Hz(a), 129).a)), zcn(o, e, u); + for (c = new pb(n.k); c.a < c.c.c.length; ) zcn(o, t, (u = Yx(Hz(c), 129).b)), zcn(o, e, u); + return (o.b += 2), (o.a += YH(t, n.q)), (o.a += YH(n.q, e)), o; + } + function gdn(n, t, e) { + var i, r, c, a, u; + if (!MX(t)) { + for ( + run((u = J2(e, ((CO(t, 14) ? Yx(t, 14).gc() : FX(t.Kc())) / n.a) | 0)), a$n, 1), a = new Aa(), c = null, r = t.Kc(); + r.Ob(); + + ) + (i = Yx(r.Pb(), 86)), + (a = n0(x4(Gy(QKn, 1), iEn, 20, 0, [a, new Dd(i)]))), + c && (b5(c, (ryn(), P5n), i), b5(i, m5n, c), eY(i) == eY(c) && (b5(c, I5n, i), b5(i, y5n, c))), + (c = i); + Ron(u), gdn(n, a, e); + } + } + function pdn(n) { + var t, e, i, r, c, a, u; + for ( + e = n.i, t = n.n, u = e.d, n.f == (OJ(), vHn) ? (u += (e.a - n.e.b) / 2) : n.f == pHn && (u += e.a - n.e.b), r = new pb(n.d); + r.a < r.c.c.length; + + ) { + switch (((a = (i = Yx(Hz(r), 181)).rf()), ((c = new Pk()).b = u), (u += a.b + n.a), n.b.g)) { + case 0: + c.a = e.c + t.b; + break; + case 1: + c.a = e.c + t.b + (e.b - a.a) / 2; + break; + case 2: + c.a = e.c + e.b - t.c - a.a; + } + i.tf(c); + } + } + function vdn(n) { + var t, e, i, r, c, a, u; + for ( + e = n.i, t = n.n, u = e.c, n.b == (BY(), hHn) ? (u += (e.b - n.e.a) / 2) : n.b == lHn && (u += e.b - n.e.a), r = new pb(n.d); + r.a < r.c.c.length; + + ) { + switch (((a = (i = Yx(Hz(r), 181)).rf()), ((c = new Pk()).a = u), (u += a.a + n.a), n.f.g)) { + case 0: + c.b = e.d + t.d; + break; + case 1: + c.b = e.d + t.d + (e.a - a.b) / 2; + break; + case 2: + c.b = e.d + e.a - t.a - a.b; + } + i.tf(c); + } + } + function mdn(n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b; + (s = e.a.c), + (a = e.a.c + e.a.b), + (l = (c = Yx(BF(e.c, t), 459)).f), + (b = c.a), + (u = new QS(s, l)), + (h = new QS(a, b)), + (r = s), + e.p || (r += n.c), + (o = new QS((r += e.F + e.v * n.b), l)), + (f = new QS(r, b)), + r0(t.a, x4(Gy(B7n, 1), TEn, 8, 0, [u, o])), + e.d.a.gc() > 1 && ((i = new QS(r, e.b)), KD(t.a, i)), + r0(t.a, x4(Gy(B7n, 1), TEn, 8, 0, [f, h])); + } + function ydn(n) { + uT( + n, + new tun( + rk( + nk( + ik(ek(new du(), nNn), "ELK Randomizer"), + 'Distributes the nodes randomly on the plane, leading to very obfuscating layouts. Can be useful to demonstrate the power of "real" layout algorithms.', + ), + new Qu(), + ), + ), + ), + DU(n, nNn, fPn, Wit), + DU(n, nNn, LPn, 15), + DU(n, nNn, xPn, d9(0)), + DU(n, nNn, hPn, OPn); + } + function kdn() { + var n, t, e, i, r, c; + for (kdn = O, fot = VQ(Yot, LNn, 25, 255, 15, 1), lot = VQ(Xot, sTn, 25, 16, 15, 1), t = 0; t < 255; t++) fot[t] = -1; + for (e = 57; e >= 48; e--) fot[e] = ((e - 48) << 24) >> 24; + for (i = 70; i >= 65; i--) fot[i] = ((i - 65 + 10) << 24) >> 24; + for (r = 102; r >= 97; r--) fot[r] = ((r - 97 + 10) << 24) >> 24; + for (c = 0; c < 10; c++) lot[c] = (48 + c) & fTn; + for (n = 10; n <= 15; n++) lot[n] = (65 + n - 10) & fTn; + } + function jdn(n, t, e) { + var i, r, c, a, u, o, s, h; + return ( + (u = t.i - n.g / 2), + (o = e.i - n.g / 2), + (s = t.j - n.g / 2), + (h = e.j - n.g / 2), + (c = t.g + n.g / 2), + (a = e.g + n.g / 2), + (i = t.f + n.g / 2), + (r = e.f + n.g / 2), + (u < o + a && o < u && s < h + r && h < s) || + (o < u + c && u < o && h < s + i && s < h) || + (u < o + a && o < u && s < h && h < s + i) || + (o < u + c && u < o && s < h + r && h < s) + ); + } + function Edn(n) { + var t, e, i, r, c; + if (!n.c) { + if (((c = new Eo()), null == (t = Hat).a.zc(n, t))) { + for (i = new UO(tW(n)); i.e != i.i.gc(); ) CO((r = Bpn((e = Yx(hen(i), 87)))), 88) && jF(c, Edn(Yx(r, 26))), fY(c, e); + t.a.Bc(n), t.a.gc(); + } + (function (n) { + var t, e, i, r; + for (e = Yx(n.g, 674), i = n.i - 1; i >= 0; --i) + for (t = e[i], r = 0; r < i; ++r) + if (zpn(n, t, e[r])) { + Orn(n, i); + break; + } + })(c), + B6(c), + (n.c = new HI((Yx(c1(aq((YF(), gat).o), 15), 18), c.i), c.g)), + (bV(n).b &= -33); + } + return n.c; + } + function Tdn(n) { + var t; + if (10 != n.c) throw hp(new wy(Kjn((GC(), Axn)))); + switch ((t = n.a)) { + case 110: + t = 10; + break; + case 114: + t = 13; + break; + case 116: + t = 9; + break; + case 92: + case 124: + case 46: + case 94: + case 45: + case 63: + case 42: + case 43: + case 123: + case 125: + case 40: + case 41: + case 91: + case 93: + break; + default: + throw hp(new wy(Kjn((GC(), uDn)))); + } + return t; + } + function Mdn(n) { + var t, e, i, r; + if (0 == n.l && 0 == n.m && 0 == n.h) return "0"; + if (n.h == qTn && 0 == n.m && 0 == n.l) return "-9223372036854775808"; + if (n.h >> 19 != 0) return "-" + Mdn(h5(n)); + for (e = n, i = ""; 0 != e.l || 0 != e.m || 0 != e.h; ) { + if (((e = Jmn(e, gV(UTn), !0)), (t = "" + rj(P_n)), 0 != e.l || 0 != e.m || 0 != e.h)) + for (r = 9 - t.length; r > 0; r--) t = "0" + t; + i = t + i; + } + return i; + } + function Sdn(n, t, i, r) { + var c, a, u, o; + if (FX((Ax(), new $K(bA(a7(t).a.Kc(), new h())))) >= n.a) return -1; + if (!Ban(t, i)) return -1; + if (MX(Yx(r.Kb(t), 20))) return 1; + for (c = 0, u = Yx(r.Kb(t), 20).Kc(); u.Ob(); ) { + if (-1 == (o = Sdn(n, (a = Yx(u.Pb(), 17)).c.i == t ? a.d.i : a.c.i, i, r))) return -1; + if ((c = e.Math.max(c, o)) > n.c - 1) return -1; + } + return c + 1; + } + function Pdn(n, t) { + var e, i, r, c, a, u; + if (iI(t) === iI(n)) return !0; + if (!CO(t, 15)) return !1; + if (((i = Yx(t, 15)), (u = n.gc()), i.gc() != u)) return !1; + if (((a = i.Kc()), n.ni())) { + for (e = 0; e < u; ++e) if (((r = n.ki(e)), (c = a.Pb()), null == r ? null != c : !Q8(r, c))) return !1; + } else for (e = 0; e < u; ++e) if (((r = n.ki(e)), (c = a.Pb()), iI(r) !== iI(c))) return !1; + return !0; + } + function Idn(n, t) { + var e, i, r, c, a, u; + if (n.f > 0) + if ((n.qj(), null != t)) { + for (c = 0; c < n.d.length; ++c) + if ((e = n.d[c])) for (i = Yx(e.g, 367), u = e.i, a = 0; a < u; ++a) if (Q8(t, (r = i[a]).dd())) return !0; + } else + for (c = 0; c < n.d.length; ++c) + if ((e = n.d[c])) for (i = Yx(e.g, 367), u = e.i, a = 0; a < u; ++a) if (((r = i[a]), iI(t) === iI(r.dd()))) return !0; + return !1; + } + function Cdn(n, t, i) { + var r, c, a, u; + run(i, "Orthogonally routing hierarchical port edges", 1), + (n.a = 0), + (function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g; + for ( + i = Yx(Aun(n, (gjn(), g0n)), 98), + u = n.f, + a = n.d, + o = u.a + a.b + a.c, + s = 0 - a.d - n.c.b, + f = u.b + a.d + a.a - n.c.b, + h = new ip(), + l = new ip(), + c = new pb(t); + c.a < c.c.c.length; + + ) { + switch (((r = Yx(Hz(c), 10)), i.g)) { + case 1: + case 2: + case 3: + ewn(r); + break; + case 4: + (w = (b = Yx(Aun(r, w0n), 8)) ? b.a : 0), (r.n.a = o * ty(fL(Aun(r, (Ojn(), KQn)))) - w), b4(r, !0, !1); + break; + case 5: + (g = (d = Yx(Aun(r, w0n), 8)) ? d.a : 0), + (r.n.a = ty(fL(Aun(r, (Ojn(), KQn)))) - g), + b4(r, !0, !1), + (u.a = e.Math.max(u.a, r.n.a + r.o.a / 2)); + } + switch (Yx(Aun(r, (Ojn(), hQn)), 61).g) { + case 1: + (r.n.b = s), (h.c[h.c.length] = r); + break; + case 3: + (r.n.b = f), (l.c[l.c.length] = r); + } + } + switch (i.g) { + case 1: + case 2: + J8(h, n), J8(l, n); + break; + case 3: + Z8(h, n), Z8(l, n); + } + })( + t, + (r = (function (n) { + var t, e, i, r, c, a, u, o, s, h, f; + if (((o = new ip()), !O$(n, (Ojn(), oQn)))) return o; + for (i = Yx(Aun(n, oQn), 15).Kc(); i.Ob(); ) Xmn((t = Yx(i.Pb(), 10)), n), (o.c[o.c.length] = t); + for (r = new pb(n.b); r.a < r.c.c.length; ) + for (a = new pb(Yx(Hz(r), 29).a); a.a < a.c.c.length; ) + (c = Yx(Hz(a), 10)).k == (bon(), _zn) && + (u = Yx(Aun(c, sQn), 10)) && + (ZG((s = new Ion()), c), whn(s, Yx(Aun(c, hQn), 61)), (h = Yx(TR(u.j, 0), 11)), YG((f = new jq()), s), QG(f, h)); + for (e = new pb(o); e.a < e.c.c.length; ) JG((t = Yx(Hz(e), 10)), Yx(TR(n.b, n.b.c.length - 1), 29)); + return o; + })(t)), + ), + (function (n, t, e) { + var i, r, c, a, u, o, s, f, l, b, w; + for ( + o = new oC(), + s = new oC(), + b = new oC(), + w = new oC(), + u = ty(fL(Aun(t, (gjn(), G0n)))), + r = ty(fL(Aun(t, N0n))), + a = new pb(e); + a.a < a.c.c.length; + + ) + if (((c = Yx(Hz(a), 10)), (f = Yx(Aun(c, (Ojn(), hQn)), 61)) == (Ikn(), Tit))) + for (s.a.zc(c, s), i = new $K(bA(u7(c).a.Kc(), new h())); Vfn(i); ) __(o, Yx(kV(i), 17).c.i); + else if (f == Bit) for (w.a.zc(c, w), i = new $K(bA(u7(c).a.Kc(), new h())); Vfn(i); ) __(b, Yx(kV(i), 17).c.i); + 0 != o.a.gc() && + (l = Ayn(new gF(2, r), t, o, s, -u - t.c.b)) > 0 && + ((n.a = u + (l - 1) * r), (t.c.b += n.a), (t.f.b += n.a)), + 0 != b.a.gc() && (l = Ayn(new gF(1, r), t, b, w, t.f.b + u - t.c.b)) > 0 && (t.f.b += u + (l - 1) * r); + })(n, t, r), + (function (n) { + var t, e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T; + for (m = new ip(), f = new pb(n.b); f.a < f.c.c.length; ) + for (w = new pb(Yx(Hz(f), 29).a); w.a < w.c.c.length; ) + if ((l = Yx(Hz(w), 10)).k == (bon(), _zn) && O$(l, (Ojn(), sQn))) { + for (d = null, p = null, g = null, j = new pb(l.j); j.a < j.c.c.length; ) + switch ((k = Yx(Hz(j), 11)).j.g) { + case 4: + d = k; + break; + case 2: + p = k; + break; + default: + g = k; + } + for ( + s = new kk((v = Yx(TR(g.g, 0), 17)).a), + mN((o = new fC(g.n)), l.n), + oF(Ztn(s, 0), o), + y = U5(v.a), + mN((h = new fC(g.n)), l.n), + VW(y, h, y.c.b, y.c), + E = Yx(Aun(l, sQn), 10), + T = Yx(TR(E.j, 0), 11), + c = 0, + u = (i = Yx(Htn(d.e, VQ(Nzn, yIn, 17, 0, 0, 1)), 474)).length; + c < u; + ++c + ) + QG((t = i[c]), T), N6(t.a, t.a.b, s); + for (r = 0, a = (e = CU(p.g)).length; r < a; ++r) YG((t = e[r]), T), N6(t.a, 0, y); + YG(v, null), QG(v, null), (m.c[m.c.length] = l); + } + for (b = new pb(m); b.a < b.c.c.length; ) JG((l = Yx(Hz(b), 10)), null); + })(t), + (c = Yx(Aun(t, (gjn(), g0n)), 98)), + rkn(($z(0, (a = t.b).c.length), Yx(a.c[0], 29)), c, t), + rkn(Yx(TR(a, a.c.length - 1), 29), c, t), + Rvn(($z(0, (u = t.b).c.length), Yx(u.c[0], 29))), + Rvn(Yx(TR(u, u.c.length - 1), 29)), + Ron(i); + } + function Odn(n) { + switch (n) { + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + return ((n - 48) << 24) >> 24; + case 97: + case 98: + case 99: + case 100: + case 101: + case 102: + return ((n - 97 + 10) << 24) >> 24; + case 65: + case 66: + case 67: + case 68: + case 69: + case 70: + return ((n - 65 + 10) << 24) >> 24; + default: + throw hp(new Iy("Invalid hexadecimal")); + } + } + function Adn(n, t, e) { + var i, r, c, a; + for (run(e, "Processor order nodes", 2), n.a = ty(fL(Aun(t, (cln(), V5n)))), r = new ME(), a = Ztn(t.b, 0); a.b != a.d.c; ) + ny(hL(Aun((c = Yx(IX(a), 86)), (ryn(), C5n)))) && VW(r, c, r.c.b, r.c); + S$(0 != r.b), + Omn(n, (i = Yx(r.a.a.c, 86))), + !e.b && q0(e, 1), + agn(n, i, 0 - ty(fL(Aun(i, (ryn(), k5n)))) / 2, 0), + !e.b && q0(e, 1), + Ron(e); + } + function $dn() { + ($dn = O), + (YBn = new aM("SPIRAL", 0)), + (UBn = new aM("LINE_BY_LINE", 1)), + (XBn = new aM("MANHATTAN", 2)), + (zBn = new aM("JITTER", 3)), + (VBn = new aM("QUADRANTS_LINE_BY_LINE", 4)), + (QBn = new aM("QUADRANTS_MANHATTAN", 5)), + (WBn = new aM("QUADRANTS_JITTER", 6)), + (GBn = new aM("COMBINE_LINE_BY_LINE_MANHATTAN", 7)), + (qBn = new aM("COMBINE_JITTER_MANHATTAN", 8)); + } + function Ldn(n, t, e, i) { + var r, c, a, u, o, s; + for (o = qcn(n, e), s = qcn(t, e), r = !1; o && s && (i || Ern(o, s, e)); ) + (a = qcn(o, e)), + (u = qcn(s, e)), + pJ(t), + pJ(n), + (c = o.c), + lyn(o, !1), + lyn(s, !1), + e + ? (Hrn(t, s.p, c), (t.p = s.p), Hrn(n, o.p + 1, c), (n.p = o.p)) + : (Hrn(n, o.p, c), (n.p = o.p), Hrn(t, s.p + 1, c), (t.p = s.p)), + JG(o, null), + JG(s, null), + (o = a), + (s = u), + (r = !0); + return r; + } + function Ndn(n, t, e, i) { + var r, c, a, u, o; + for (r = !1, c = !1, u = new pb(i.j); u.a < u.c.c.length; ) + iI(Aun((a = Yx(Hz(u), 11)), (Ojn(), CQn))) === iI(e) && (0 == a.g.c.length ? 0 == a.e.c.length || (r = !0) : (c = !0)); + return ( + (o = 0), + r && r ^ c + ? (o = e.j == (Ikn(), Tit) ? -n.e[i.c.p][i.p] : t - n.e[i.c.p][i.p]) + : c && r ^ c + ? (o = n.e[i.c.p][i.p] + 1) + : r && c && (o = e.j == (Ikn(), Tit) ? 0 : t / 2), + o + ); + } + function xdn(n, t, e, i, r, c, a, u) { + var o, s, h; + for ( + o = 0, + null != t && (o ^= Xen(t.toLowerCase())), + null != e && (o ^= Xen(e)), + null != i && (o ^= Xen(i)), + null != a && (o ^= Xen(a)), + null != u && (o ^= Xen(u)), + s = 0, + h = c.length; + s < h; + s++ + ) + o ^= Xen(c[s]); + n ? (o |= 256) : (o &= -257), + r ? (o |= 16) : (o &= -17), + (this.f = o), + (this.i = null == t ? null : (vB(t), t)), + (this.a = e), + (this.d = i), + (this.j = c), + (this.g = a), + (this.e = u); + } + function Ddn(n, t, e) { + var i, r; + switch (((r = null), t.g)) { + case 1: + Q2(), (r = Wzn); + break; + case 2: + Q2(), (r = Qzn); + } + switch (((i = null), e.g)) { + case 1: + Q2(), (i = Vzn); + break; + case 2: + Q2(), (i = Xzn); + break; + case 3: + Q2(), (i = Yzn); + break; + case 4: + Q2(), (i = Jzn); + } + return r && i ? Qx(n.j, new Ff(new ay(x4(Gy(WKn, 1), iEn, 169, 0, [Yx(MF(r), 169), Yx(MF(i), 169)])))) : (XH(), XH(), TFn); + } + function Rdn(n) { + var t, e, i; + switch (((t = Yx(Aun(n, (gjn(), e0n)), 8)), b5(n, e0n, new QS(t.b, t.a)), Yx(Aun(n, xZn), 248).g)) { + case 1: + b5(n, xZn, (qen(), X7n)); + break; + case 2: + b5(n, xZn, (qen(), q7n)); + break; + case 3: + b5(n, xZn, (qen(), z7n)); + break; + case 4: + b5(n, xZn, (qen(), U7n)); + } + (n.q ? n.q : (XH(), XH(), MFn))._b(E0n) && ((i = (e = Yx(Aun(n, E0n), 8)).a), (e.a = e.b), (e.b = i)); + } + function Kdn(n, t, e, i, r, c) { + if (((this.b = e), (this.d = r), n >= t.length)) throw hp(new Hm("Greedy SwitchDecider: Free layer not in graph.")); + (this.c = t[n]), + (this.e = new rx(i)), + h2(this.e, this.c, (Ikn(), qit)), + (this.i = new rx(i)), + h2(this.i, this.c, Eit), + (this.f = new zR(this.c)), + (this.a = !c && r.i && !r.s && this.c[0].k == (bon(), _zn)), + this.a && + (function (n, t, e) { + var i, r, c, a, u, o, s; + (u = (c = n.d.p).e), + (o = c.r), + (n.g = new rx(o)), + (i = (a = n.d.o.c.p) > 0 ? u[a - 1] : VQ(Gzn, kIn, 10, 0, 0, 1)), + (r = u[a]), + (s = a < u.length - 1 ? u[a + 1] : VQ(Gzn, kIn, 10, 0, 0, 1)), + t == e - 1 ? DG(n.g, r, s) : DG(n.g, i, r); + })(this, n, t.length); + } + function _dn(n, t) { + var e, i, r, c, a, u; + (c = !n.B.Hc((Vgn(), irt))), + (a = n.B.Hc(art)), + (n.a = new snn(a, c, n.c)), + n.n && HH(n.a.n, n.n), + Nm(n.g, (JZ(), cHn), n.a), + t || + (((i = new Stn(1, c, n.c)).n.a = n.k), + YR(n.p, (Ikn(), Tit), i), + ((r = new Stn(1, c, n.c)).n.d = n.k), + YR(n.p, Bit, r), + ((u = new Stn(0, c, n.c)).n.c = n.k), + YR(n.p, qit, u), + ((e = new Stn(0, c, n.c)).n.b = n.k), + YR(n.p, Eit, e)); + } + function Fdn(n) { + var t, i, r; + switch ((t = Yx(Aun(n.d, (gjn(), b1n)), 218)).g) { + case 2: + i = (function (n) { + var t, e, i, r, c, a, u, o, s, f, l, b, w, d, g; + for (d = new ip(), l = new pb(n.d.b); l.a < l.c.c.length; ) + for (w = new pb(Yx(Hz(l), 29).a); w.a < w.c.c.length; ) { + for (b = Yx(Hz(w), 10), r = Yx(BF(n.f, b), 57), o = new $K(bA(o7(b).a.Kc(), new h())); Vfn(o); ) + if (((s = !0), (f = null), (i = Ztn((a = Yx(kV(o), 17)).a, 0)).b != i.d.c)) { + for ( + t = Yx(IX(i), 8), + e = null, + a.c.j == (Ikn(), Tit) && + (((g = new _vn(t, new QS(t.a, r.d.d), r, a)).f.a = !0), (g.a = a.c), (d.c[d.c.length] = g)), + a.c.j == Bit && + (((g = new _vn(t, new QS(t.a, r.d.d + r.d.a), r, a)).f.d = !0), (g.a = a.c), (d.c[d.c.length] = g)); + i.b != i.d.c; + + ) + (e = Yx(IX(i), 8)), + w1(t.b, e.b) || + ((f = new _vn(t, e, null, a)), + (d.c[d.c.length] = f), + s && + ((s = !1), e.b < r.d.d ? (f.f.a = !0) : e.b > r.d.d + r.d.a ? (f.f.d = !0) : ((f.f.d = !0), (f.f.a = !0)))), + i.b != i.d.c && (t = e); + f && + ((c = Yx(BF(n.f, a.d.i), 57)), + t.b < c.d.d ? (f.f.a = !0) : t.b > c.d.d + c.d.a ? (f.f.d = !0) : ((f.f.d = !0), (f.f.a = !0))); + } + for (u = new $K(bA(u7(b).a.Kc(), new h())); Vfn(u); ) + 0 != (a = Yx(kV(u), 17)).a.b && + ((t = Yx(p$(a.a), 8)), + a.d.j == (Ikn(), Tit) && + (((g = new _vn(t, new QS(t.a, r.d.d), r, a)).f.a = !0), (g.a = a.d), (d.c[d.c.length] = g)), + a.d.j == Bit && + (((g = new _vn(t, new QS(t.a, r.d.d + r.d.a), r, a)).f.d = !0), (g.a = a.d), (d.c[d.c.length] = g))); + } + return d; + })(n); + break; + case 3: + (r = new ip()), + SE(hH(fH(WJ(WJ(new SR(null, new Nz(n.d.b, 16)), new Or()), new Ar()), new $r()), new pr()), new Yw(r)), + (i = r); + break; + default: + throw hp(new Ym("Compaction not supported for " + t + " edges.")); + } + (function (n, t) { + var i, r, c, a, u, o, s; + if (0 != t.c.length) { + for (XH(), JR(t.c, t.c.length, null), r = Yx(Hz((c = new pb(t))), 145); c.a < c.c.c.length; ) + (i = Yx(Hz(c), 145)), + !w1(r.e.c, i.e.c) || Unn(ML(r.e).b, i.e.d) || Unn(ML(i.e).b, r.e.d) + ? ($pn(n, r), (r = i)) + : (S4(r.k, i.k), + S4(r.b, i.b), + S4(r.c, i.c), + C2(r.i, i.i), + S4(r.d, i.d), + S4(r.j, i.j), + (a = e.Math.min(r.e.c, i.e.c)), + (u = e.Math.min(r.e.d, i.e.d)), + (o = e.Math.max(r.e.c + r.e.b, i.e.c + i.e.b) - a), + (s = e.Math.max(r.e.d + r.e.a, i.e.d + i.e.a) - u), + RD(r.e, a, u, o, s), + qz(r.f, i.f), + !r.a && (r.a = i.a), + S4(r.g, i.g), + eD(r.g, i)); + $pn(n, r); + } + })(n, i), + XW(new Yl(n.g), new Vw(n)); + } + function Bdn() { + (Bdn = O), + (bGn = new DC((Cjn(), Att), d9(1))), + (mGn = new DC(Xtt, 80)), + (vGn = new DC(Ftt, 5)), + (nGn = new DC(mnt, OPn)), + (wGn = new DC($tt, d9(1))), + (pGn = new DC(xtt, (TA(), !0))), + (hGn = new RC(50)), + (sGn = new DC(utt, hGn)), + (eGn = Hnt), + (fGn = ktt), + (tGn = new DC(Cnt, !1)), + (oGn = att), + (uGn = itt), + (aGn = Jnt), + (cGn = Qnt), + (lGn = Mtt), + Eon(), + (rGn = qqn), + (yGn = Wqn), + (iGn = Hqn), + (dGn = zqn), + (gGn = Xqn); + } + function Hdn() { + (Hdn = O), + (Y9n = new Og(Z$n)), + iT(), + (V9n = new FI(rLn, (Q9n = r7n))), + B4(), + (X9n = new FI(nLn, (W9n = o7n))), + Aon(), + (z9n = new FI(tLn, (U9n = v9n))), + (B9n = new FI(eLn, null)), + cQ(), + (q9n = new FI(iLn, (G9n = b9n))), + tT(), + (D9n = new FI(cLn, (R9n = u9n))), + (K9n = new FI(aLn, (TA(), !1))), + (_9n = new FI(uLn, d9(64))), + (F9n = new FI(oLn, !0)), + (H9n = w9n); + } + function qdn(n) { + var t, e, i, r, c; + if (null == n.a) + if (((n.a = VQ(Vot, wSn, 25, n.c.b.c.length, 16, 1)), (n.a[0] = !1), O$(n.c, (gjn(), a2n)))) + for (e = Yx(Aun(n.c, a2n), 15).Kc(); e.Ob(); ) (t = Yx(e.Pb(), 19).a) > 0 && t < n.a.length && (n.a[t] = !1); + else for ((c = new pb(n.c.b)).a < c.c.c.length && Hz(c), i = 1; c.a < c.c.c.length; ) (r = Yx(Hz(c), 29)), (n.a[i++] = Yln(r)); + } + function Gdn(n, t) { + var e, i; + switch (((i = n.b), t)) { + case 1: + (n.b |= 1), (n.b |= 4), (n.b |= 8); + break; + case 2: + (n.b |= 2), (n.b |= 4), (n.b |= 8); + break; + case 4: + (n.b |= 1), (n.b |= 2), (n.b |= 4), (n.b |= 8); + break; + case 3: + (n.b |= 16), (n.b |= 8); + break; + case 0: + (n.b |= 32), (n.b |= 16), (n.b |= 8), (n.b |= 1), (n.b |= 2), (n.b |= 4); + } + if (n.b != i && n.c) for (e = new UO(n.c); e.e != e.i.gc(); ) rhn(bV(Yx(hen(e), 473)), t); + } + function zdn(n, t, e, i) { + var r, c, a, u, o, s, h, f, l, b; + for (r = !1, u = 0, o = (a = t).length; u < o; ++u) + (c = a[u]), + ny((TA(), !!c.e)) && + !Yx(TR(n.b, c.e.p), 214).s && + (r |= + ((s = c.e), + (f = (h = Yx(TR(n.b, s.p), 214)).e)[(l = Zy(e, f.length))][0].k == (bon(), _zn) + ? (f[l] = Qbn(c, f[l], e ? (Ikn(), qit) : (Ikn(), Eit))) + : h.c.Tf(f, e), + (b = Zbn(n, h, e, i)), + xwn(h.e, h.o, e), + b)); + return r; + } + function Udn(n, t) { + var e, i, r, c, a; + for ( + c = (!t.a && (t.a = new m_(uct, t, 10, 11)), t.a).i, r = new UO((!t.a && (t.a = new m_(uct, t, 10, 11)), t.a)); + r.e != r.i.gc(); + + ) + iI(jln((i = Yx(hen(r), 33)), (Cjn(), Rnt))) !== iI((O8(), Net)) && + ((a = Yx(jln(t, Ltt), 149)) == (e = Yx(jln(i, Ltt), 149)) || (a && oV(a, e))) && + 0 != (!i.a && (i.a = new m_(uct, i, 10, 11)), i.a).i && + (c += Udn(n, i)); + return c; + } + function Xdn(n, t) { + var i, r, c, a, u, o, s, h, f, l; + if ( + ((u = Yx(Yx(_V(n.r, t), 21), 84)), + (o = n.u.Hc((Chn(), mit))), + (i = n.u.Hc(git)), + (r = n.u.Hc(dit)), + (h = n.u.Hc(yit)), + (l = n.B.Hc((Vgn(), frt))), + (f = !i && !r && (h || 2 == u.gc())), + (function (n, t) { + var e, i, r, c, a, u; + for (a = Yx(Yx(_V(n.r, t), 21), 84).Kc(); a.Ob(); ) + (e = (c = Yx(a.Pb(), 111)).c ? WD(c.c) : 0) > 0 + ? c.a + ? e > (u = c.b.rf().a) && ((r = (e - u) / 2), (c.d.b = r), (c.d.c = r)) + : (c.d.c = n.s + e) + : c_(n.u) && ((i = oun(c.b)).c < 0 && (c.d.b = -i.c), i.c + i.b > c.b.rf().a && (c.d.c = i.c + i.b - c.b.rf().a)); + })(n, t), + (c = null), + (s = null), + o) + ) { + for (s = c = Yx((a = u.Kc()).Pb(), 111); a.Ob(); ) s = Yx(a.Pb(), 111); + (c.d.b = 0), (s.d.c = 0), f && !c.a && (c.d.c = 0); + } + l && + ((function (n) { + var t, i, r, c, a; + for (t = 0, i = 0, a = n.Kc(); a.Ob(); ) (r = Yx(a.Pb(), 111)), (t = e.Math.max(t, r.d.b)), (i = e.Math.max(i, r.d.c)); + for (c = n.Kc(); c.Ob(); ) ((r = Yx(c.Pb(), 111)).d.b = t), (r.d.c = i); + })(u), + o && ((c.d.b = 0), (s.d.c = 0))); + } + function Wdn(n, t) { + var i, r, c, a, u, o, s, h, f, l; + if ( + ((u = Yx(Yx(_V(n.r, t), 21), 84)), + (o = n.u.Hc((Chn(), mit))), + (i = n.u.Hc(git)), + (r = n.u.Hc(dit)), + (s = n.u.Hc(yit)), + (l = n.B.Hc((Vgn(), frt))), + (h = !i && !r && (s || 2 == u.gc())), + (function (n, t) { + var i, r, c, a, u, o, s; + for (o = Yx(Yx(_V(n.r, t), 21), 84).Kc(); o.Ob(); ) + (r = (u = Yx(o.Pb(), 111)).c ? XD(u.c) : 0) > 0 + ? u.a + ? r > (s = u.b.rf().b) && + (n.v || 1 == u.c.d.c.length + ? ((a = (r - s) / 2), (u.d.d = a), (u.d.a = a)) + : ((i = (Yx(TR(u.c.d, 0), 181).rf().b - s) / 2), (u.d.d = e.Math.max(0, i)), (u.d.a = r - i - s))) + : (u.d.a = n.t + r) + : c_(n.u) && ((c = oun(u.b)).d < 0 && (u.d.d = -c.d), c.d + c.a > u.b.rf().b && (u.d.a = c.d + c.a - u.b.rf().b)); + })(n, t), + (f = null), + (c = null), + o) + ) { + for (c = f = Yx((a = u.Kc()).Pb(), 111); a.Ob(); ) c = Yx(a.Pb(), 111); + (f.d.d = 0), (c.d.a = 0), h && !f.a && (f.d.a = 0); + } + l && + ((function (n) { + var t, i, r, c, a; + for (i = 0, t = 0, a = n.Kc(); a.Ob(); ) (r = Yx(a.Pb(), 111)), (i = e.Math.max(i, r.d.d)), (t = e.Math.max(t, r.d.a)); + for (c = n.Kc(); c.Ob(); ) ((r = Yx(c.Pb(), 111)).d.d = i), (r.d.a = t); + })(u), + o && ((f.d.d = 0), (c.d.a = 0))); + } + function Vdn(n, t, e) { + var i, r, c, a, u; + if (((i = t.k), t.p >= 0)) return !1; + if (((t.p = e.b), eD(e.e, t), i == (bon(), Bzn) || i == qzn)) + for (r = new pb(t.j); r.a < r.c.c.length; ) + for (u = new ww(new pb(new bw(Yx(Hz(r), 11)).a.g)); ZC(u.a); ) + if (((a = (c = Yx(Hz(u.a), 17).d.i).k), t.c != c.c && (a == Bzn || a == qzn) && Vdn(n, c, e))) return !0; + return !0; + } + function Qdn(n) { + var t; + return 0 != (64 & n.Db) + ? Sfn(n) + : (((t = new MA(Sfn(n))).a += " (changeable: "), + nj(t, 0 != (n.Bb & DNn)), + (t.a += ", volatile: "), + nj(t, 0 != (n.Bb & FDn)), + (t.a += ", transient: "), + nj(t, 0 != (n.Bb & nMn)), + (t.a += ", defaultValueLiteral: "), + pI(t, n.j), + (t.a += ", unsettable: "), + nj(t, 0 != (n.Bb & _Dn)), + (t.a += ", derived: "), + nj(t, 0 != (n.Bb & MEn)), + (t.a += ")"), + t.a); + } + function Ydn(n, t, e, i) { + var r, c, a, u, o, s; + if (null == e) for (r = Yx(n.g, 119), u = 0; u < n.i; ++u) if ((a = r[u]).ak() == t) return Ten(n, a, i); + return ( + TT(), + (c = Yx(t, 66).Oj() ? Yx(e, 72) : VX(t, e)), + gC(n.e) + ? ((s = !knn(n, t)), + (i = wnn(n, c, i)), + (o = t.$j() + ? Kq(n, 3, t, null, e, $vn(n, t, e, CO(t, 99) && 0 != (Yx(t, 18).Bb & eMn)), s) + : Kq(n, 1, t, t.zj(), e, -1, s)), + i ? i.Ei(o) : (i = o)) + : (i = wnn(n, c, i)), + i + ); + } + function Jdn() { + (this.b = new bW()), + (this.d = new bW()), + (this.e = new bW()), + (this.c = new bW()), + (this.a = new rp()), + (this.f = new rp()), + wG(B7n, new mu(), new yu()), + wG(W7n, new Au(), new $u()), + wG(Rzn, new Lu(), new Nu()), + wG(Zzn, new Du(), new Ru()), + wG(Mrt, new Ku(), new _u()), + wG(LFn, new ku(), new ju()), + wG(qFn, new Eu(), new Tu()), + wG(DFn, new Mu(), new Su()), + wG(RFn, new Pu(), new Iu()), + wG(tBn, new Cu(), new Ou()); + } + function Zdn(n) { + var t, e, i, r, c, a; + return ( + (c = 0), + (t = fcn(n)).Bj() && (c |= 4), + 0 != (n.Bb & _Dn) && (c |= 2), + CO(n, 99) + ? ((r = nin((e = Yx(n, 18)))), + 0 != (e.Bb & MNn) && (c |= 32), + r && (vF(HG(r)), (c |= 8), ((a = r.t) > 1 || -1 == a) && (c |= 16), 0 != (r.Bb & MNn) && (c |= 64)), + 0 != (e.Bb & eMn) && (c |= FDn), + (c |= DNn)) + : CO(t, 457) + ? (c |= 512) + : (i = t.Bj()) && 0 != (1 & i.i) && (c |= 256), + 0 != (512 & n.Bb) && (c |= 128), + c + ); + } + function ngn(n, t) { + var e, i, r, c, a; + for (n = null == n ? aEn : (vB(n), n), r = 0; r < t.length; r++) t[r] = ibn(t[r]); + for (e = new $y(), a = 0, i = 0; i < t.length && -1 != (c = n.indexOf("%s", a)); ) + (e.a += "" + l$(null == n ? aEn : (vB(n), n), a, c)), mI(e, t[i++]), (a = c + 2); + if ((EU(e, n, a, n.length), i < t.length)) { + for (e.a += " [", mI(e, t[i++]); i < t.length; ) (e.a += tEn), mI(e, t[i++]); + e.a += "]"; + } + return e.a; + } + function tgn(n, t) { + var e, i, r, c, a, u, o; + for (e = 0, o = new pb(t); o.a < o.c.c.length; ) { + for (u = Yx(Hz(o), 11), R6(n.b, n.d[u.p]), a = 0, r = new UV(u.b); ZC(r.a) || ZC(r.b); ) + jB((i = Yx(ZC(r.a) ? Hz(r.a) : Hz(r.b), 17))) + ? (c = cj(n, u == i.c ? i.d : i.c)) > n.d[u.p] && ((e += zW(n.b, c)), OX(n.a, d9(c))) + : ++a; + for (e += n.b.d * a; !ry(n.a); ) eZ(n.b, Yx($_(n.a), 19).a); + } + return e; + } + function egn(n) { + var t, e, i, r, c, a, u; + for (u = new rp(), i = new pb(n.a.b); i.a < i.c.c.length; ) xB(u, (t = Yx(Hz(i), 57)), new ip()); + for (r = new pb(n.a.b); r.a < r.c.c.length; ) + for ((t = Yx(Hz(r), 57)).i = ZTn, a = t.c.Kc(); a.Ob(); ) (c = Yx(a.Pb(), 57)), Yx(eI(Dq(u.f, c)), 15).Fc(t); + for (e = new pb(n.a.b); e.a < e.c.c.length; ) (t = Yx(Hz(e), 57)).c.$b(), (t.c = Yx(eI(Dq(u.f, t)), 15)); + _wn(n); + } + function ign(n) { + var t, e, i, r, c, a, u; + for (u = new rp(), i = new pb(n.a.b); i.a < i.c.c.length; ) xB(u, (t = Yx(Hz(i), 81)), new ip()); + for (r = new pb(n.a.b); r.a < r.c.c.length; ) + for ((t = Yx(Hz(r), 81)).o = ZTn, a = t.f.Kc(); a.Ob(); ) (c = Yx(a.Pb(), 81)), Yx(eI(Dq(u.f, c)), 15).Fc(t); + for (e = new pb(n.a.b); e.a < e.c.c.length; ) (t = Yx(Hz(e), 81)).f.$b(), (t.f = Yx(eI(Dq(u.f, t)), 15)); + rwn(n); + } + function rgn(n, t, e, i) { + var r, c; + for ( + (function (n, t, e, i) { + var r, c, a, u; + for (r = 0; r < t.o; r++) + for (c = r - t.j + e, a = 0; a < t.p; a++) + (u = a - t.k + i), Nin(t, r, a) ? Sin(n, c, u) || rrn(n, c, u) : Din(t, r, a) && (Tin(n, c, u) || crn(n, c, u)); + })(n, t, e, i), + (function (n, t) { + n.g = t; + })(t, n.j - t.j + e), + (function (n, t) { + n.i = t; + })(t, n.k - t.k + i), + c = new pb(t.f); + c.a < c.c.c.length; + + ) + switch ((r = Yx(Hz(c), 324)).a.g) { + case 0: + g5(n, t.g + r.b.a, 0, t.g + r.c.a, t.i - 1); + break; + case 1: + g5(n, t.g + t.o, t.i + r.b.a, n.o - 1, t.i + r.c.a); + break; + case 2: + g5(n, t.g + r.b.a, t.i + t.p, t.g + r.c.a, n.p - 1); + break; + default: + g5(n, 0, t.i + r.b.a, t.g - 1, t.i + r.c.a); + } + } + function cgn(n, t, e, i, r) { + var c, a; + try { + if (t >= n.o) throw hp(new Gp()); + (a = t >> 5), + (c = GK(1, WR(GK(31 & t, 1)))), + (n.n[e][a] = r ? zz(n.n[e][a], c) : Gz(n.n[e][a], wD(c))), + (c = GK(c, 1)), + (n.n[e][a] = i ? zz(n.n[e][a], c) : Gz(n.n[e][a], wD(c))); + } catch (i) { + throw CO((i = j4(i)), 320) ? hp(new Hm(FSn + n.o + "*" + n.p + BSn + t + tEn + e + HSn)) : hp(i); + } + } + function agn(n, t, i, r) { + var c, a; + t && + ((c = ty(fL(Aun(t, (ryn(), M5n)))) + r), + (a = i + ty(fL(Aun(t, k5n))) / 2), + b5(t, O5n, d9(WR(D3(e.Math.round(c))))), + b5(t, A5n, d9(WR(D3(e.Math.round(a))))), + 0 == t.d.b || agn(n, Yx(PO(new Rd(Ztn(new Dd(t).a.d, 0))), 86), i + ty(fL(Aun(t, k5n))) + n.a, r + ty(fL(Aun(t, j5n)))), + null != Aun(t, I5n) && agn(n, Yx(Aun(t, I5n), 86), i, r)); + } + function ugn(n) { + var t, e, i; + return 0 != (64 & n.Db) + ? yon(n) + : ((t = new SA(dNn)), + (e = n.k) + ? yI(yI(((t.a += ' "'), t), e), '"') + : (!n.n && (n.n = new m_(act, n, 1, 7)), + n.n.i > 0 && + (!(i = (!n.n && (n.n = new m_(act, n, 1, 7)), Yx(c1(n.n, 0), 137)).a) || yI(yI(((t.a += ' "'), t), i), '"'))), + yI(tj(yI(tj(yI(tj(yI(tj(((t.a += " ("), t), n.i), ","), n.j), " | "), n.g), ","), n.f), ")"), + t.a); + } + function ogn(n) { + var t, e, i; + return 0 != (64 & n.Db) + ? yon(n) + : ((t = new SA(gNn)), + (e = n.k) + ? yI(yI(((t.a += ' "'), t), e), '"') + : (!n.n && (n.n = new m_(act, n, 1, 7)), + n.n.i > 0 && + (!(i = (!n.n && (n.n = new m_(act, n, 1, 7)), Yx(c1(n.n, 0), 137)).a) || yI(yI(((t.a += ' "'), t), i), '"'))), + yI(tj(yI(tj(yI(tj(yI(tj(((t.a += " ("), t), n.i), ","), n.j), " | "), n.g), ","), n.f), ")"), + t.a); + } + function sgn(n, t) { + var e, i, r, c, a, u; + if (null == t || 0 == t.length) return null; + if (!(r = Yx(aG(n.a, t), 149))) { + for (i = new ub(new Zl(n.b).a.vc().Kc()); i.a.Ob(); ) + if ( + ((c = Yx(i.a.Pb(), 42)), + (a = (e = Yx(c.dd(), 149)).c), + (u = t.length), + _N(a.substr(a.length - u, u), t) && (t.length == a.length || 46 == XB(a, a.length - t.length - 1))) + ) { + if (r) return null; + r = e; + } + r && GG(n.a, t, r); + } + return r; + } + function hgn(n) { + var t, e, i; + O$(n, (gjn(), U1n)) && + ((i = Yx(Aun(n, U1n), 21)).dc() || + ((e = new cx((t = Yx(Ak(cit), 9)), Yx(eN(t, t.length), 9), 0)), + i.Hc((Eln(), Xet)) ? n2(e, Xet) : n2(e, Wet), + i.Hc(zet) || n2(e, zet), + i.Hc(Get) ? n2(e, Yet) : i.Hc(qet) ? n2(e, Qet) : i.Hc(Uet) && n2(e, Vet), + i.Hc(Yet) ? n2(e, Get) : i.Hc(Qet) ? n2(e, qet) : i.Hc(Vet) && n2(e, Uet), + b5(n, U1n, e))); + } + function fgn(n) { + var t, e, i, r, c, a, u; + for (r = Yx(Aun(n, (Ojn(), vQn)), 10), $z(0, (i = n.j).c.length), e = Yx(i.c[0], 11), a = new pb(r.j); a.a < a.c.c.length; ) + if (iI((c = Yx(Hz(a), 11))) === iI(Aun(e, CQn))) { + c.j == (Ikn(), Tit) && n.p > r.p + ? (whn(c, Bit), c.d && ((u = c.o.b), (t = c.a.b), (c.a.b = u - t))) + : c.j == Bit && r.p > n.p && (whn(c, Tit), c.d && ((u = c.o.b), (t = c.a.b), (c.a.b = -(u - t)))); + break; + } + return r; + } + function lgn(n, t, e, i, r) { + var c, a, u, o, s, h, f; + if (!(CO(t, 239) || CO(t, 354) || CO(t, 186))) throw hp(new Qm("Method only works for ElkNode-, ElkLabel and ElkPort-objects.")); + return ( + (a = n.a / 2), + (o = t.i + i - a), + (h = t.j + r - a), + (s = o + t.g + n.a), + (f = h + t.f + n.a), + KD((c = new Nv()), new QS(o, h)), + KD(c, new QS(o, f)), + KD(c, new QS(s, f)), + KD(c, new QS(s, h)), + o4((u = new eln(c)), t), + e && xB(n.b, t, u), + u + ); + } + function bgn(n, t, e) { + var i, r, c, a, u, o, s, h; + for (c = new QS(t, e), s = new pb(n.a); s.a < s.c.c.length; ) + for (mN((o = Yx(Hz(s), 10)).n, c), h = new pb(o.j); h.a < h.c.c.length; ) + for (r = new pb(Yx(Hz(h), 11).g); r.a < r.c.c.length; ) + for (o1((i = Yx(Hz(r), 17)).a, c), (a = Yx(Aun(i, (gjn(), $1n)), 74)) && o1(a, c), u = new pb(i.b); u.a < u.c.c.length; ) + mN(Yx(Hz(u), 70).n, c); + } + function wgn(n, t, e) { + var i, r, c, a, u, o, s, h; + for (c = new QS(t, e), s = new pb(n.a); s.a < s.c.c.length; ) + for (mN((o = Yx(Hz(s), 10)).n, c), h = new pb(o.j); h.a < h.c.c.length; ) + for (r = new pb(Yx(Hz(h), 11).g); r.a < r.c.c.length; ) + for (o1((i = Yx(Hz(r), 17)).a, c), (a = Yx(Aun(i, (gjn(), $1n)), 74)) && o1(a, c), u = new pb(i.b); u.a < u.c.c.length; ) + mN(Yx(Hz(u), 70).n, c); + } + function dgn(n) { + if (0 == (!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b).i) throw hp(new by("Edges must have a source.")); + if (0 == (!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c).i) throw hp(new by("Edges must have a target.")); + if ((!n.b && (n.b = new AN(Zrt, n, 4, 7)), !(n.b.i <= 1 && (!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c.i <= 1)))) + throw hp(new by("Hyperedges are not supported.")); + } + function ggn(n, t) { + var e, i, r, c, a, u, o, s, h, f; + for (f = 0, OX((c = new ep()), t); c.b != c.c; ) + for ( + o = Yx($_(c), 214), + s = 0, + h = Yx(Aun(t.j, (gjn(), XZn)), 339), + a = ty(fL(Aun(t.j, qZn))), + u = ty(fL(Aun(t.j, GZn))), + h != (k5(), W2n) && ((s += a * Rln(o.e, h)), (s += u * wwn(o.e))), + f += drn(o.d, o.e) + s, + r = new pb(o.b); + r.a < r.c.c.length; + + ) + (i = Yx(Hz(r), 37)), (e = Yx(TR(n.b, i.p), 214)).s || (f += Rsn(n, e)); + return f; + } + function pgn(n, t, e, i, r, c, a) { + if (((n.c = i.qf().a), (n.d = i.qf().b), r && ((n.c += r.qf().a), (n.d += r.qf().b)), (n.b = t.rf().a), (n.a = t.rf().b), r)) + switch (r.Hf().g) { + case 0: + case 2: + n.c += r.rf().a + a + c.a + a; + break; + case 4: + n.c -= a + c.a + a + t.rf().a; + break; + case 1: + (n.c += r.rf().a + a), (n.d -= a + c.b + a + t.rf().b); + break; + case 3: + (n.c += r.rf().a + a), (n.d += r.rf().b + a + c.b + a); + } + else e ? (n.c -= a + t.rf().a) : (n.c += i.rf().a + a); + } + function vgn(n, t) { + var e, i; + for ( + this.b = new ip(), + this.e = new ip(), + this.a = n, + this.d = t, + (function (n) { + var t; + t = n.a; + do { + (t = Yx(kV(new $K(bA(u7(t).a.Kc(), new h()))), 17).c.i).k == (bon(), Bzn) && n.b.Fc(t); + } while (t.k == (bon(), Bzn)); + n.b = I3(n.b); + })(this), + (function (n) { + var t; + t = n.a; + do { + (t = Yx(kV(new $K(bA(o7(t).a.Kc(), new h()))), 17).d.i).k == (bon(), Bzn) && eD(n.e, t); + } while (t.k == (bon(), Bzn)); + })(this), + this.b.dc() ? (this.c = n.c.p) : (this.c = Yx(this.b.Xb(0), 10).c.p), + 0 == this.e.c.length ? (this.f = n.c.p) : (this.f = Yx(TR(this.e, this.e.c.length - 1), 10).c.p), + i = Yx(Aun(n, (Ojn(), BQn)), 15).Kc(); + i.Ob(); + + ) + if (O$((e = Yx(i.Pb(), 70)), (gjn(), s1n))) { + this.d = Yx(Aun(e, s1n), 227); + break; + } + } + function mgn(n, t, e) { + var i, r, c, a, u, o, s, h; + for ( + i = Yx(BF(n.a, t), 53), + c = Yx(BF(n.a, e), 53), + r = Yx(BF(n.e, t), 53), + a = Yx(BF(n.e, e), 53), + i.a.zc(e, i), + a.a.zc(t, a), + h = c.a.ec().Kc(); + h.Ob(); + + ) + (s = Yx(h.Pb(), 10)), i.a.zc(s, i), __(Yx(BF(n.e, s), 53), t), C2(Yx(BF(n.e, s), 53), r); + for (o = r.a.ec().Kc(); o.Ob(); ) (u = Yx(o.Pb(), 10)), a.a.zc(u, a), __(Yx(BF(n.a, u), 53), e), C2(Yx(BF(n.a, u), 53), c); + } + function ygn(n, t, e) { + var i, r, c, a, u, o, s, h; + for ( + i = Yx(BF(n.a, t), 53), + c = Yx(BF(n.a, e), 53), + r = Yx(BF(n.b, t), 53), + a = Yx(BF(n.b, e), 53), + i.a.zc(e, i), + a.a.zc(t, a), + h = c.a.ec().Kc(); + h.Ob(); + + ) + (s = Yx(h.Pb(), 10)), i.a.zc(s, i), __(Yx(BF(n.b, s), 53), t), C2(Yx(BF(n.b, s), 53), r); + for (o = r.a.ec().Kc(); o.Ob(); ) (u = Yx(o.Pb(), 10)), a.a.zc(u, a), __(Yx(BF(n.a, u), 53), e), C2(Yx(BF(n.a, u), 53), c); + } + function kgn(n, t) { + var i, r, c; + switch ((run(t, "Breaking Point Insertion", 1), (r = new rln(n)), Yx(Aun(n, (gjn(), t2n)), 337).g)) { + case 2: + c = new Tc(); + case 0: + c = new wc(); + break; + default: + c = new Mc(); + } + if ( + ((i = c.Vf(n, r)), + ny(hL(Aun(n, i2n))) && + (i = (function (n, t) { + var i, r, c, a, u, o, s, f, l, b, w, d, g, p, v, m, y, k; + for (b = new ip(), c = new ip(), g = null, u = t.Kc(); u.Ob(); ) + (a = new fd(Yx(u.Pb(), 19).a)), (c.c[c.c.length] = a), g && ((a.d = g), (g.e = a)), (g = a); + for ( + y = (function (n) { + var t, e, i, r, c, a, u, o, s; + for (s = VQ(Wot, MTn, 25, n.b.c.length + 1, 15, 1), o = new Qp(), i = 0, c = new pb(n.b); c.a < c.c.c.length; ) { + for (r = Yx(Hz(c), 29), s[i++] = o.a.gc(), u = new pb(r.a); u.a < u.c.c.length; ) + for (e = new $K(bA(o7(Yx(Hz(u), 10)).a.Kc(), new h())); Vfn(e); ) (t = Yx(kV(e), 17)), o.a.zc(t, o); + for (a = new pb(r.a); a.a < a.c.c.length; ) + for (e = new $K(bA(u7(Yx(Hz(a), 10)).a.Kc(), new h())); Vfn(e); ) (t = Yx(kV(e), 17)), o.a.Bc(t); + } + return s; + })(n), + f = 0; + f < c.c.length; + ++f + ) { + for (w = null, p = oQ(($z(0, c.c.length), Yx(c.c[0], 652))), i = null, r = JTn, l = 1; l < n.b.c.length; ++l) + (v = p ? e.Math.abs(p.b - l) : e.Math.abs(l - w.b) + 1), + (d = w ? e.Math.abs(l - w.b) : v + 1) < v ? ((s = w), (o = d)) : ((s = p), (o = v)), + (k = ty(fL(Aun(n, (gjn(), e2n))))), + (m = y[l] + e.Math.pow(o, k)) < r && ((r = m), ((i = s).c = l)), + p && l == p.b && ((w = p), (p = t_(p))); + i && (eD(b, d9(i.c)), (i.a = !0), M9(i)); + } + return XH(), JR(b.c, b.c.length, null), b; + })(n, i)), + !c.Wf() && O$(n, u2n)) + ) + switch (Yx(Aun(n, u2n), 338).g) { + case 2: + i = dhn(r, i); + break; + case 1: + i = uun(r, i); + } + i.dc() || + (function (n, t) { + var e, i, r, c, a, u, o, s, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M, S, P, I, C; + for (v = new JU(n.b, 0), d = 0, s = Yx((f = t.Kc()).Pb(), 19).a, k = 0, e = new Qp(), E = new oC(); v.b < v.d.gc(); ) { + for (S$(v.b < v.d.gc()), y = new pb(Yx(v.d.Xb((v.c = v.b++)), 29).a); y.a < y.c.c.length; ) { + for (w = new $K(bA(o7((m = Yx(Hz(y), 10))).a.Kc(), new h())); Vfn(w); ) (l = Yx(kV(w), 17)), E.a.zc(l, E); + for (b = new $K(bA(u7(m).a.Kc(), new h())); Vfn(b); ) (l = Yx(kV(b), 17)), E.a.Bc(l); + } + if (d + 1 == s) { + for (ZL(v, (r = new qF(n))), ZL(v, (c = new qF(n))), M = E.a.ec().Kc(); M.Ob(); ) + (T = Yx(M.Pb(), 17)), + e.a._b(T) || (++k, e.a.zc(T, e)), + b5((a = new rin(n)), (gjn(), g0n), (Ran(), hit)), + JG(a, r), + Al(a, (bon(), Kzn)), + ZG((g = new Ion()), a), + whn(g, (Ikn(), qit)), + ZG((S = new Ion()), a), + whn(S, Eit), + b5((i = new rin(n)), g0n, hit), + JG(i, c), + Al(i, Kzn), + ZG((p = new Ion()), i), + whn(p, qit), + ZG((P = new Ion()), i), + whn(P, Eit), + YG((j = new jq()), T.c), + QG(j, g), + YG((C = new jq()), S), + QG(C, p), + YG(T, P), + (u = new LX(a, i, j, C, T)), + b5(a, (Ojn(), YVn), u), + b5(i, YVn, u), + (I = j.c.i).k == Kzn && (((o = Yx(Aun(I, YVn), 305)).d = u), (u.g = o)); + if (!f.Ob()) break; + s = Yx(f.Pb(), 19).a; + } + ++d; + } + d9(k); + })(n, i), + Ron(t); + } + function jgn(n, t, e) { + var i, r, c, a, u, o, s; + if ( + ((s = t), + $0((o = UX(n, RX(e), s)), oX(s, rxn)), + (a = cX(s, WNn)), + (function (n, t, e) { + var i, r, c; + if (e) + for (r = ((i = new NK(e.a.length)).b - i.a) * i.c < 0 ? (PT(), Fot) : new oA(i); r.Ob(); ) + (c = qin(n, Nhn(VJ(e, Yx(r.Pb(), 19).a)))) && (!t.b && (t.b = new AN(Zrt, t, 4, 7)), fY(t.b, c)); + })((i = new EP(n, o)).a, i.b, a), + (u = cX(s, VNn)), + (function (n, t, e) { + var i, r, c; + if (e) + for (r = ((i = new NK(e.a.length)).b - i.a) * i.c < 0 ? (PT(), Fot) : new oA(i); r.Ob(); ) + (c = qin(n, Nhn(VJ(e, Yx(r.Pb(), 19).a)))) && (!t.c && (t.c = new AN(Zrt, t, 5, 8)), fY(t.c, c)); + })((r = new TP(n, o)).a, r.b, u), + 0 == (!o.b && (o.b = new AN(Zrt, o, 4, 7)), o.b).i || 0 == (!o.c && (o.c = new AN(Zrt, o, 5, 8)), o.c).i) + ) + throw ((c = oX(s, rxn)), hp(new hy(oxn + c + sxn))); + return ( + eun(s, o), + (function (n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v; + for ( + f = t, + h = new Zq(), + l = new Zq(), + c = cX(f, QNn), + (function (n, t, e, i, r) { + var c, a, u, o; + if (r) + for (o = ((c = new NK(r.a.length)).b - c.a) * c.c < 0 ? (PT(), Fot) : new oA(c); o.Ob(); ) + (u = aX(r, Yx(o.Pb(), 19).a)), ppn((a = new AH(n, t, e, i)).a, a.b, a.c, a.d, u); + })((i = new $H(n, e, h, l)).a, i.b, i.c, i.d, c), + d = (h.i || (h.i = new iA(h, h.c))).Kc(); + d.Ob(); + + ) + for (w = Yx(d.Pb(), 202), u = Yx(_V(h, w), 21).Kc(); u.Ob(); ) { + if (((a = u.Pb()), !(b = Yx(g1(n.d, a), 202)))) throw ((r = oX(f, rxn)), hp(new hy(hxn + a + fxn + r + sxn))); + !w.e && (w.e = new AN(tct, w, 10, 9)), fY(w.e, b); + } + for (p = (l.i || (l.i = new iA(l, l.c))).Kc(); p.Ob(); ) + for (g = Yx(p.Pb(), 202), s = Yx(_V(l, g), 21).Kc(); s.Ob(); ) { + if (((o = s.Pb()), !(b = Yx(g1(n.d, o), 202)))) throw ((r = oX(f, rxn)), hp(new hy(hxn + o + fxn + r + sxn))); + !g.g && (g.g = new AN(tct, g, 9, 10)), fY(g.g, b); + } + !e.b && (e.b = new AN(Zrt, e, 4, 7)), + 0 != e.b.i && + (!e.c && (e.c = new AN(Zrt, e, 5, 8)), 0 != e.c.i) && + (!e.b && (e.b = new AN(Zrt, e, 4, 7)), e.b.i <= 1 && (!e.c && (e.c = new AN(Zrt, e, 5, 8)), e.c.i <= 1)) && + 1 == (!e.a && (e.a = new m_(tct, e, 6, 6)), e.a).i && + (Jen((v = Yx(c1((!e.a && (e.a = new m_(tct, e, 6, 6)), e.a), 0), 202))) || + Zen(v) || + (L0(v, Yx(c1((!e.b && (e.b = new AN(Zrt, e, 4, 7)), e.b), 0), 82)), + N0(v, Yx(c1((!e.c && (e.c = new AN(Zrt, e, 5, 8)), e.c), 0), 82)))); + })(n, s, o), + D5(n, s, o) + ); + } + function Egn(n) { + var t, i, r, c, a, u, o, s, h, f, l; + for (i = nTn, c = Yjn, o = new pb(n.e.a); o.a < o.c.c.length; ) + (a = Yx(Hz(o), 121)), (c = e.Math.min(c, a.e)), (i = e.Math.max(i, a.e)); + for (t = VQ(Wot, MTn, 25, i - c + 1, 15, 1), u = new pb(n.e.a); u.a < u.c.c.length; ) ((a = Yx(Hz(u), 121)).e -= c), ++t[a.e]; + if (((r = 0), null != n.k)) for (f = 0, l = (h = n.k).length; f < l && ((s = h[f]), (t[r++] += s), t.length != r); ++f); + return t; + } + function Tgn(n) { + switch (n.d) { + case 9: + case 8: + return !0; + case 3: + case 5: + case 4: + case 6: + return !1; + case 7: + return Yx(Kwn(n), 19).a == n.o; + case 1: + case 2: + if (-2 == n.o) return !1; + switch (n.p) { + case 0: + case 1: + case 2: + case 6: + case 5: + case 7: + return sI(n.k, n.f); + case 3: + case 4: + return n.j == n.e; + default: + return null == n.n ? null == n.g : Q8(n.n, n.g); + } + default: + return !1; + } + } + function Mgn(n) { + uT( + n, + new tun( + rk( + nk( + ik(ek(new du(), ZLn), "ELK Fixed"), + "Keeps the current layout as it is, without any automatic modification. Optional coordinates can be given for nodes and edge bend points.", + ), + new Vu(), + ), + ), + ), + DU(n, ZLn, fPn, Oet), + DU(n, ZLn, AAn, oen(Aet)), + DU(n, ZLn, ALn, oen(Met)), + DU(n, ZLn, HPn, oen(Set)), + DU(n, ZLn, eIn, oen(Iet)), + DU(n, ZLn, lAn, oen(Pet)); + } + function Sgn(n, t, e) { + var i, r, c, a; + if ( + ((i = WR(e7(BEn, HB(WR(e7(null == t ? 0 : W5(t), HEn)), 15)))), + (a = WR(e7(BEn, HB(WR(e7(null == e ? 0 : W5(e), HEn)), 15)))), + (c = K2(n, t, i)) && a == c.f && bB(e, c.i)) + ) + return e; + if (_2(n, e, a)) throw hp(new Qm("value already present: " + e)); + return (r = new CB(t, i, e, a)), c ? (ybn(n, c), phn(n, r, c), (c.e = null), (c.c = null), c.i) : (phn(n, r, null), kcn(n), null); + } + function Pgn(n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b; + (s = e.a.c), + (a = e.a.c + e.a.b), + (l = (c = Yx(BF(e.c, t), 459)).f), + (b = c.a), + (u = c.b ? new QS(a, l) : new QS(s, l)), + (h = c.c ? new QS(s, b) : new QS(a, b)), + (r = s), + e.p || (r += n.c), + (o = new QS((r += e.F + e.v * n.b), l)), + (f = new QS(r, b)), + r0(t.a, x4(Gy(B7n, 1), TEn, 8, 0, [u, o])), + e.d.a.gc() > 1 && ((i = new QS(r, e.b)), KD(t.a, i)), + r0(t.a, x4(Gy(B7n, 1), TEn, 8, 0, [f, h])); + } + function Ign(n, t, e) { + var i, r, c, a, u, o; + if (t) { + if (e <= -1) { + if (CO((i = CZ(t.Tg(), -1 - e)), 99)) return Yx(i, 18); + for (u = 0, o = (a = Yx(t.ah(i), 153)).gc(); u < o; ++u) + if (iI(a.jl(u)) === iI(n) && CO((r = a.il(u)), 99) && 0 != ((c = Yx(r, 18)).Bb & MNn)) return c; + throw hp(new Ym("The containment feature could not be located")); + } + return nin(Yx(CZ(n.Tg(), e), 18)); + } + return null; + } + function Cgn(n, t, e, i) { + var r, c, a; + return ( + (a = new Qj(t, e)), + n.a + ? i + ? (++(r = Yx(BF(n.b, t), 283)).a, + (a.d = i.d), + (a.e = i.e), + (a.b = i), + (a.c = i), + i.e ? (i.e.c = a) : (Yx(BF(n.b, t), 283).b = a), + i.d ? (i.d.b = a) : (n.a = a), + (i.d = a), + (i.e = a)) + : ((n.e.b = a), + (a.d = n.e), + (n.e = a), + (r = Yx(BF(n.b, t), 283)) ? (++r.a, ((c = r.c).c = a), (a.e = c), (r.c = a)) : (xB(n.b, t, (r = new pq(a))), ++n.c)) + : ((n.a = n.e = a), xB(n.b, t, new pq(a)), ++n.c), + ++n.d, + a + ); + } + function Ogn(n, t) { + var e, i, r, c, a, u, o, s; + for (e = new RegExp(t, "g"), o = VQ(fFn, TEn, 2, 0, 6, 1), i = 0, s = n, c = null; ; ) { + if (null == (u = e.exec(s)) || "" == s) { + o[i] = s; + break; + } + (a = u.index), + (o[i] = s.substr(0, a)), + (s = l$(s, a + u[0].length, s.length)), + (e.lastIndex = 0), + c == s && ((o[i] = s.substr(0, 1)), (s = s.substr(1))), + (c = s), + ++i; + } + if (n.length > 0) { + for (r = o.length; r > 0 && "" == o[r - 1]; ) --r; + r < o.length && (o.length = r); + } + return o; + } + function Agn(n, t) { + var e, i, r, c, a, u, o, s; + for (u = null, r = !1, c = 0, o = tW((s = Iq(t)).a).i; c < o; ++c) + (e = Agn(n, Yx(hyn(s, c, CO((a = Yx(c1(tW(s.a), c), 87).c), 88) ? Yx(a, 26) : (xjn(), Oat)), 26))).dc() || + (u ? (r || ((r = !0), (u = new RR(u))), u.Gc(e)) : (u = e)); + return (i = (function (n, t) { + var e, i, r, c, a; + for (!t.s && (t.s = new m_(tat, t, 21, 17)), c = null, r = 0, a = (i = t.s).i; r < a; ++r) + switch (TB(PJ(n, (e = Yx(c1(i, r), 170))))) { + case 2: + case 3: + !c && (c = new ip()), (c.c[c.c.length] = e); + } + return c || (XH(), XH(), TFn); + })(n, t)).dc() + ? u || (XH(), XH(), TFn) + : u + ? (r || (u = new RR(u)), u.Gc(i), u) + : i; + } + function $gn(n, t) { + var e, i, r, c, a, u, o, s; + for (u = null, i = !1, c = 0, o = tW((s = Iq(t)).a).i; c < o; ++c) + (e = $gn(n, Yx(hyn(s, c, CO((a = Yx(c1(tW(s.a), c), 87).c), 88) ? Yx(a, 26) : (xjn(), Oat)), 26))).dc() || + (u ? (i || ((i = !0), (u = new RR(u))), u.Gc(e)) : (u = e)); + return (r = (function (n, t) { + var e, i, r, c, a; + for (!t.s && (t.s = new m_(tat, t, 21, 17)), c = null, r = 0, a = (i = t.s).i; r < a; ++r) + switch (TB(PJ(n, (e = Yx(c1(i, r), 170))))) { + case 4: + case 5: + case 6: + !c && (c = new ip()), (c.c[c.c.length] = e); + } + return c || (XH(), XH(), TFn); + })(n, t)).dc() + ? u || (XH(), XH(), TFn) + : u + ? (i || (u = new RR(u)), u.Gc(r), u) + : r; + } + function Lgn(n, t, e) { + var i, r, c, a, u, o; + if (CO(t, 72)) return Ten(n, t, e); + for (u = null, c = null, i = Yx(n.g, 119), a = 0; a < n.i; ++a) + if (Q8(t, (r = i[a]).dd()) && CO((c = r.ak()), 99) && 0 != (Yx(c, 18).Bb & MNn)) { + u = r; + break; + } + return ( + u && + (gC(n.e) && + ((o = c.$j() + ? Kq(n, 4, c, t, null, $vn(n, c, t, CO(c, 99) && 0 != (Yx(c, 18).Bb & eMn)), !0) + : Kq(n, c.Kj() ? 2 : 1, c, t, c.zj(), -1, !0)), + e ? e.Ei(o) : (e = o)), + (e = Lgn(n, u, e))), + e + ); + } + function Ngn(n, t, e) { + var i, r, c, a, u, o, s, h; + for (run(e, kPn, 1), n.bf(t), c = 0; n.df(c); ) { + for (h = new pb(t.e); h.a < h.c.c.length; ) + for (o = Yx(Hz(h), 144), u = W_(n0(x4(Gy(QKn, 1), iEn, 20, 0, [t.e, t.d, t.b]))); Vfn(u); ) + (a = Yx(kV(u), 357)) != o && (r = n.af(a, o)) && mN(o.a, r); + for (s = new pb(t.e); s.a < s.c.c.length; ) Hon((i = (o = Yx(Hz(s), 144)).a), -n.d, -n.d, n.d, n.d), mN(o.d, i), OI(i); + n.cf(), ++c; + } + Ron(e); + } + function xgn(n) { + uT( + n, + new tun( + rk( + nk( + ik(ek(new du(), fLn), "ELK SPOrE Overlap Removal"), + 'A node overlap removal algorithm proposed by Nachmanson et al. in "Node overlap removal by growing a tree".', + ), + new eu(), + ), + ), + ), + DU(n, fLn, Z$n, oen(i7n)), + DU(n, fLn, fPn, t7n), + DU(n, fLn, LPn, 8), + DU(n, fLn, rLn, oen(e7n)), + DU(n, fLn, uLn, oen(Z9n)), + DU(n, fLn, oLn, oen(n7n)), + DU(n, fLn, oAn, (TA(), !1)); + } + function Dgn(n, t, e, i) { + var r, c, a, u, o, s, h, f; + for (a = $$(t.c, e, i), h = new pb(t.a); h.a < h.c.c.length; ) { + for (mN((s = Yx(Hz(h), 10)).n, a), f = new pb(s.j); f.a < f.c.c.length; ) + for (c = new pb(Yx(Hz(f), 11).g); c.a < c.c.c.length; ) + for (o1((r = Yx(Hz(c), 17)).a, a), (u = Yx(Aun(r, (gjn(), $1n)), 74)) && o1(u, a), o = new pb(r.b); o.a < o.c.c.length; ) + mN(Yx(Hz(o), 70).n, a); + eD(n.a, s), (s.a = n); + } + } + function Rgn(n, t, e) { + var i, r, c, a, u; + if ((TT(), (a = Yx(t, 66).Oj()), Lwn(n.e, t))) { + if (t.hi() && fvn(n, t, e, CO(t, 99) && 0 != (Yx(t, 18).Bb & eMn))) return !1; + } else + for (u = dwn(n.e.Tg(), t), i = Yx(n.g, 119), c = 0; c < n.i; ++c) + if (((r = i[c]), u.rl(r.ak()))) + return !(a ? Q8(r, e) : null == e ? null == r.dd() : Q8(e, r.dd())) && (Yx(Ken(n, c, a ? Yx(e, 72) : VX(t, e)), 72), !0); + return fY(n, a ? Yx(e, 72) : VX(t, e)); + } + function Kgn(n) { + var t, i, r, c, a; + if (n.d) throw hp(new Ym((sL(fzn), UMn + fzn.k + XMn))); + for (n.c == (t9(), tet) && ikn(n, Ztt), t = new pb(n.a.a); t.a < t.c.c.length; ) Yx(Hz(t), 189).e = 0; + for (c = new pb(n.a.b); c.a < c.c.c.length; ) for ((r = Yx(Hz(c), 81)).o = ZTn, i = r.f.Kc(); i.Ob(); ) ++Yx(i.Pb(), 81).d.e; + for ( + (function (n) { + var t, i, r, c, a, u, o, s, h, f, l, b, w, d, g; + for (h = JTn, r = new pb(n.a.b); r.a < r.c.c.length; ) (t = Yx(Hz(r), 81)), (h = e.Math.min(h, t.d.f.g.c + t.e.a)); + for (w = new ME(), u = new pb(n.a.a); u.a < u.c.c.length; ) ((a = Yx(Hz(u), 189)).i = h), 0 == a.e && VW(w, a, w.c.b, w.c); + for (; 0 != w.b; ) { + for (c = (a = Yx(0 == w.b ? null : (S$(0 != w.b), VZ(w, w.a.a)), 189)).f.g.c, b = a.a.a.ec().Kc(); b.Ob(); ) + (f = Yx(b.Pb(), 81)), (g = a.i + f.e.a), f.d.g || f.g.c < g ? (f.o = g) : (f.o = f.g.c); + for (c -= a.f.o, a.b += c, n.c == (t9(), net) || n.c == Jtt ? (a.c += c) : (a.c -= c), l = a.a.a.ec().Kc(); l.Ob(); ) + for (s = (f = Yx(l.Pb(), 81)).f.Kc(); s.Ob(); ) + (o = Yx(s.Pb(), 81)), + (d = lC(n.c) ? n.f.ef(f, o) : n.f.ff(f, o)), + (o.d.i = e.Math.max(o.d.i, f.o + f.g.b + d - o.e.a)), + o.k || (o.d.i = e.Math.max(o.d.i, o.g.c - o.e.a)), + --o.d.e, + 0 == o.d.e && KD(w, o.d); + } + for (i = new pb(n.a.b); i.a < i.c.c.length; ) (t = Yx(Hz(i), 81)).g.c = t.o; + })(n), + a = new pb(n.a.b); + a.a < a.c.c.length; + + ) + Yx(Hz(a), 81).k = !0; + return n; + } + function _gn(n, t) { + var e, i, r, c, a, u, o, s; + for (u = new csn(n), VW((e = new ME()), t, e.c.b, e.c); 0 != e.b; ) { + for ((i = Yx(0 == e.b ? null : (S$(0 != e.b), VZ(e, e.a.a)), 113)).d.p = 1, a = new pb(i.e); a.a < a.c.c.length; ) + Jan(u, (r = Yx(Hz(a), 409))), 0 == (s = r.d).d.p && VW(e, s, e.c.b, e.c); + for (c = new pb(i.b); c.a < c.c.c.length; ) Jan(u, (r = Yx(Hz(c), 409))), 0 == (o = r.c).d.p && VW(e, o, e.c.b, e.c); + } + return u; + } + function Fgn(n) { + var t, e, i, r, c; + if (1 != (i = ty(fL(jln(n, (Cjn(), Ntt)))))) + for ( + kC(n, i * n.g, i * n.f), + e = (function (n) { + return MF(n), new KI(n); + })( + (function (n, t) { + return MF(n), MF(t), new HD(n, t); + })((!n.c && (n.c = new m_(oct, n, 9, 9)), n.c), new Bu()), + ), + c = W_( + n0( + x4(Gy(QKn, 1), iEn, 20, 0, [ + (!n.n && (n.n = new m_(act, n, 1, 7)), n.n), + (!n.c && (n.c = new m_(oct, n, 9, 9)), n.c), + e, + ]), + ), + ); + Vfn(c); + + ) + (r = Yx(kV(c), 470)).Gg(i * r.Dg(), i * r.Eg()), + r.Fg(i * r.Cg(), i * r.Bg()), + (t = Yx(r.We(mtt), 8)) && ((t.a *= i), (t.b *= i)); + } + function Bgn(n, t, e, i) { + (this.e = n), + (this.k = Yx(Aun(n, (Ojn(), zQn)), 304)), + (this.g = VQ(Gzn, kIn, 10, t, 0, 1)), + (this.b = VQ(H_n, TEn, 333, t, 7, 1)), + (this.a = VQ(Gzn, kIn, 10, t, 0, 1)), + (this.d = VQ(H_n, TEn, 333, t, 7, 1)), + (this.j = VQ(Gzn, kIn, 10, t, 0, 1)), + (this.i = VQ(H_n, TEn, 333, t, 7, 1)), + (this.p = VQ(H_n, TEn, 333, t, 7, 1)), + (this.n = VQ(D_n, TEn, 476, t, 8, 1)), + qT(this.n, (TA(), !1)), + (this.f = VQ(D_n, TEn, 476, t, 8, 1)), + qT(this.f, !0), + (this.o = e), + (this.c = i); + } + function Hgn(n, t) { + var e, i, r; + if (!t.dc()) + if (Yx(t.Xb(0), 286).d == (psn(), wWn)) bcn(n, t); + else + for (i = t.Kc(); i.Ob(); ) { + switch ((e = Yx(i.Pb(), 286)).d.g) { + case 5: + nsn(n, e, N7(n, e)); + break; + case 0: + nsn(n, e, ((r = ((e.f - e.c + 1 - 1) / 2) | 0), e.c + r)); + break; + case 4: + nsn(n, e, aZ(n, e)); + break; + case 2: + ann(e), nsn(n, e, Ean(e) ? e.c : e.f); + break; + case 1: + ann(e), nsn(n, e, Ean(e) ? e.f : e.c); + } + Mun(e.a); + } + } + function qgn(n, t, i, r, c, a) { + var u, o, s, h, f, l, b, w, d, g, p, v, m; + for ( + o = (r + c) / 2 + a, + g = i * e.Math.cos(o), + p = i * e.Math.sin(o), + v = g - t.g / 2, + m = p - t.f / 2, + L1(t, v), + N1(t, m), + l = n.a.jg(t), + (d = 2 * e.Math.acos(i / i + n.c)) < c - r ? ((b = d / l), (u = (r + c - d) / 2)) : ((b = (c - r) / l), (u = r)), + w = idn(t), + n.e && (n.e.kg(n.d), n.e.lg(w)), + h = new pb(w); + h.a < h.c.c.length; + + ) + (s = Yx(Hz(h), 33)), (f = n.a.jg(s)), qgn(n, s, i + n.c, u, u + b * f, a), (u += b * f); + } + function Ggn(n, t) { + var e, i, r, c; + if ((run(t, "Network simplex", 1), n.e.a.c.length < 1)) Ron(t); + else { + for (r = new pb(n.e.a); r.a < r.c.c.length; ) Yx(Hz(r), 121).e = 0; + for ( + (c = n.e.a.c.length >= 40) && + (function (n) { + var t, e, i, r, c, a, u; + for (n.o = new ep(), i = new ME(), a = new pb(n.e.a); a.a < a.c.c.length; ) + 1 == b7((c = Yx(Hz(a), 121))).c.length && VW(i, c, i.c.b, i.c); + for (; 0 != i.b; ) + 0 != b7((c = Yx(0 == i.b ? null : (S$(0 != i.b), VZ(i, i.a.a)), 121))).c.length && + ((t = Yx(TR(b7(c), 0), 213)), + (e = c.g.a.c.length > 0), + (u = T7(t, c)), + VA(e ? u.b : u.g, t), + 1 == b7(u).c.length && VW(i, u, i.c.b, i.c), + (r = new mP(c, t)), + OX(n.o, r), + uJ(n.e.a, c)); + })(n), + (function (n) { + var t, e, i, r, c, a, u, o, s, h; + for (s = n.e.a.c.length, c = new pb(n.e.a); c.a < c.c.c.length; ) Yx(Hz(c), 121).j = !1; + for ( + n.i = VQ(Wot, MTn, 25, s, 15, 1), + n.g = VQ(Wot, MTn, 25, s, 15, 1), + n.n = new ip(), + r = 0, + h = new ip(), + u = new pb(n.e.a); + u.a < u.c.c.length; + + ) + ((a = Yx(Hz(u), 121)).d = r++), 0 == a.b.a.c.length && eD(n.n, a), S4(h, a.g); + for (t = 0, i = new pb(h); i.a < i.c.c.length; ) ((e = Yx(Hz(i), 213)).c = t++), (e.f = !1); + (o = h.c.length), + null == n.b || n.b.length < o ? ((n.b = VQ(Jot, rMn, 25, o, 15, 1)), (n.c = VQ(Vot, wSn, 25, o, 16, 1))) : oy(n.c), + (n.d = h), + (n.p = new GA(IZ(n.d.c.length))), + (n.j = 1); + })(n), + Iwn(n), + e = S9(n), + i = 0; + e && i < n.f; + + ) + Ygn(n, e, Tln(n, e)), (e = S9(n)), ++i; + c && + (function (n) { + for (var t, e, i, r; !ry(n.o); ) + (e = Yx($_(n.o), 46)), + (i = Yx(e.a, 121)), + (r = T7((t = Yx(e.b, 213)), i)), + t.e == i ? (WA(r.g, t), (i.e = r.e + t.a)) : (WA(r.b, t), (i.e = r.e - t.a)), + eD(n.e.a, i); + })(n), + n.a + ? (function (n, t) { + var e, i, r, c, a; + for (a = null, c = new pb(n.e.a); c.a < c.c.c.length; ) + if ((r = Yx(Hz(c), 121)).b.a.c.length == r.g.a.c.length) { + for (i = r.e, a = Won(r), e = r.e - Yx(a.a, 19).a + 1; e < r.e + Yx(a.b, 19).a; e++) t[e] < t[i] && (i = e); + t[i] < t[r.e] && (--t[r.e], ++t[i], (r.e = i)); + } + })(n, Egn(n)) + : Egn(n), + (n.b = null), + (n.d = null), + (n.p = null), + (n.c = null), + (n.g = null), + (n.i = null), + (n.n = null), + (n.o = null), + Ron(t); + } + } + function zgn(n, t, e, i) { + var r, c, a, u, o, s, h, f; + for (yN((u = new QS(e, i)), Yx(Aun(t, (d2(), jGn)), 8)), f = new pb(t.e); f.a < f.c.c.length; ) + mN((h = Yx(Hz(f), 144)).d, u), eD(n.e, h); + for (a = new pb(t.c); a.a < a.c.c.length; ) { + for (r = new pb((c = Yx(Hz(a), 282)).a); r.a < r.c.c.length; ) mN(Yx(Hz(r), 559).d, u); + eD(n.c, c); + } + for (s = new pb(t.d); s.a < s.c.c.length; ) mN((o = Yx(Hz(s), 447)).d, u), eD(n.d, o); + } + function Ugn(n, t) { + var e, i, r, c, a, u, o, s; + for (o = new pb(t.j); o.a < o.c.c.length; ) + for (r = new UV((u = Yx(Hz(o), 11)).b); ZC(r.a) || ZC(r.b); ) + t != (c = (e = (i = Yx(ZC(r.a) ? Hz(r.a) : Hz(r.b), 17)).c == u ? i.d : i.c).i) && + ((s = Yx(Aun(i, (gjn(), M0n)), 19).a) < 0 && (s = 0), + (a = c.p), + 0 == n.b[a] && + (i.d == e + ? ((n.a[a] -= s + 1), n.a[a] <= 0 && n.c[a] > 0 && KD(n.f, c)) + : ((n.c[a] -= s + 1), n.c[a] <= 0 && n.a[a] > 0 && KD(n.e, c)))); + } + function Xgn(n, t, e) { + var i, r, c, a, u, o, s, h, f; + for (c = new pQ(t.c.length), s = new pb(t); s.a < s.c.c.length; ) (a = Yx(Hz(s), 10)), eD(c, n.b[a.c.p][a.p]); + for ( + (function (n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b; + for (u = new pb(t); u.a < u.c.c.length; ) ((c = Yx(Hz(u), 233)).e = null), (c.c = 0); + for (o = null, a = new pb(t); a.a < a.c.c.length; ) + if (((f = (c = Yx(Hz(a), 233)).d[0]), !e || f.k == (bon(), Hzn))) { + for (b = Yx(Aun(f, (Ojn(), mQn)), 15).Kc(); b.Ob(); ) + (l = Yx(b.Pb(), 10)), + (e && l.k != (bon(), Hzn)) || ((!c.e && (c.e = new ip()), c.e).Fc(n.b[l.c.p][l.p]), ++n.b[l.c.p][l.p].c); + if (!e && f.k == (bon(), Hzn)) { + if (o) + for (h = Yx(_V(n.d, o), 21).Kc(); h.Ob(); ) + for (s = Yx(h.Pb(), 10), r = Yx(_V(n.d, f), 21).Kc(); r.Ob(); ) + (i = Yx(r.Pb(), 10)), tD(n.b[s.c.p][s.p]).Fc(n.b[i.c.p][i.p]), ++n.b[i.c.p][i.p].c; + o = f; + } + } + })(n, c, e), + f = null; + (f = Hyn(c)); + + ) + yvn(n, Yx(f.a, 233), Yx(f.b, 233), c); + for (t.c = VQ(UKn, iEn, 1, 0, 5, 1), r = new pb(c); r.a < r.c.c.length; ) + for (o = 0, h = (u = (i = Yx(Hz(r), 233)).d).length; o < h; ++o) + (a = u[o]), (t.c[t.c.length] = a), (n.a[a.c.p][a.p].a = NO(i.g, i.d[0]).a); + } + function Wgn(n, t) { + var e, i, r, c; + if (0 < (CO(n, 14) ? Yx(n, 14).gc() : FX(n.Kc()))) { + if (1 < (r = t)) { + for (--r, c = new pa(), i = n.Kc(); i.Ob(); ) (e = Yx(i.Pb(), 86)), (c = n0(x4(Gy(QKn, 1), iEn, 20, 0, [c, new Dd(e)]))); + return Wgn(c, r); + } + if (r < 0) { + for (c = new va(), i = n.Kc(); i.Ob(); ) (e = Yx(i.Pb(), 86)), (c = n0(x4(Gy(QKn, 1), iEn, 20, 0, [c, new Dd(e)]))); + if (0 < (CO(c, 14) ? Yx(c, 14).gc() : FX(c.Kc()))) return Wgn(c, r); + } + } + return Yx(PO(n.Kc()), 86); + } + function Vgn() { + (Vgn = O), + (crt = new fP("DEFAULT_MINIMUM_SIZE", 0)), + (urt = new fP("MINIMUM_SIZE_ACCOUNTS_FOR_PADDING", 1)), + (rrt = new fP("COMPUTE_PADDING", 2)), + (ort = new fP("OUTSIDE_NODE_LABELS_OVERHANG", 3)), + (srt = new fP("PORTS_OVERHANG", 4)), + (frt = new fP("UNIFORM_PORT_SPACING", 5)), + (hrt = new fP("SPACE_EFFICIENT_PORT_LABELS", 6)), + (art = new fP("FORCE_TABULAR_NODE_LABELS", 7)), + (irt = new fP("ASYMMETRICAL", 8)); + } + function Qgn(n, t) { + var e, i, r, c, a, u, o, s; + if (t) { + if ((e = (c = t.Tg()) ? i1(c).Nh().Jh(c) : null)) { + for (Gtn(n, t, e), o = 0, s = (null == (r = t.Tg()).i && svn(r), r.i).length; o < s; ++o) + null == r.i && svn(r), + (i = r.i), + (u = o >= 0 && o < i.length ? i[o] : null).Ij() && + !u.Jj() && + (CO(u, 322) ? Len(n, Yx(u, 34), t, e) : 0 != ((a = Yx(u, 18)).Bb & MNn) && lan(n, a, t, e)); + t.kh() && Yx(e, 49).vh(Yx(t, 49).qh()); + } + return e; + } + return null; + } + function Ygn(n, t, e) { + var i, r, c; + if (!t.f) throw hp(new Qm("Given leave edge is no tree edge.")); + if (e.f) throw hp(new Qm("Given enter edge is a tree edge already.")); + for ( + t.f = !1, SO(n.p, t), e.f = !0, __(n.p, e), i = e.e.e - e.d.e - e.a, fhn(n, e.e, t) || (i = -i), c = new pb(n.e.a); + c.a < c.c.c.length; + + ) + fhn(n, (r = Yx(Hz(c), 121)), t) || (r.e += i); + (n.j = 1), oy(n.c), $hn(n, Yx(Hz(new pb(n.e.a)), 121)), myn(n); + } + function Jgn(n, t) { + var e, i, r, c, a, u; + if ((u = Yx(Aun(t, (gjn(), g0n)), 98)) == (Ran(), sit) || u == oit) + for (r = new QS(t.f.a + t.d.b + t.d.c, t.f.b + t.d.d + t.d.a).b, a = new pb(n.a); a.a < a.c.c.length; ) + (c = Yx(Hz(a), 10)).k == (bon(), _zn) && + (((e = Yx(Aun(c, (Ojn(), hQn)), 61)) != (Ikn(), Eit) && e != qit) || + ((i = ty(fL(Aun(c, KQn)))), u == sit && (i *= r), (c.n.b = i - Yx(Aun(c, w0n), 8).b), b4(c, !1, !0))); + } + function Zgn(n, t, e, i) { + var r, c, a, u, o, s, h, f, l, b; + if ( + ((function (n, t, e) { + var i, r, c; + for (r = t[e], i = 0; i < r.length; i++) (c = r[i]), (n.e[c.c.p][c.p] = i); + })(n, t, e), + (c = t[e]), + (b = i ? (Ikn(), qit) : (Ikn(), Eit)), + (function (n, t, e) { + return e ? 0 != t : t != n - 1; + })(t.length, e, i)) + ) { + for (lQ(n, (r = t[i ? e - 1 : e + 1]), i ? (h0(), i3n) : (h0(), e3n)), h = 0, l = (o = c).length; h < l; ++h) + uin(n, (a = o[h]), b); + for (lQ(n, c, i ? (h0(), e3n) : (h0(), i3n)), s = 0, f = (u = r).length; s < f; ++s) (a = u[s]).e || uin(n, a, O9(b)); + } else for (s = 0, f = (u = c).length; s < f; ++s) uin(n, (a = u[s]), b); + return !1; + } + function npn(n, t, e, i) { + var r, c, a, u, o; + (u = i7(t, e)), + (e == (Ikn(), Bit) || e == qit) && + (u = CO(u, 152) ? RV(Yx(u, 152)) : CO(u, 131) ? Yx(u, 131).a : CO(u, 54) ? new Tm(u) : new rE(u)), + (a = !1); + do { + for (r = !1, c = 0; c < u.gc() - 1; c++) + Jun(n, Yx(u.Xb(c), 11), Yx(u.Xb(c + 1), 11), i) && + ((a = !0), + tU(n.a, Yx(u.Xb(c), 11), Yx(u.Xb(c + 1), 11)), + (o = Yx(u.Xb(c + 1), 11)), + u._c(c + 1, Yx(u.Xb(c), 11)), + u._c(c, o), + (r = !0)); + } while (r); + return a; + } + function tpn(n) { + var t, i, r, c, a, u, o, s; + for (s = new rp(), t = new Zp(), u = n.Kc(); u.Ob(); ) (c = Yx(u.Pb(), 10)), (o = HA(DE(new ev(), c), t)), Ysn(s.f, c, o); + for (a = n.Kc(); a.Ob(); ) + for (r = new $K(bA(o7((c = Yx(a.Pb(), 10))).a.Kc(), new h())); Vfn(r); ) + ZW((i = Yx(kV(r), 17))) || + uwn( + NE(LE($E(xE(new tv(), e.Math.max(1, Yx(Aun(i, (gjn(), S0n)), 19).a)), 1), Yx(BF(s, i.c.i), 121)), Yx(BF(s, i.d.i), 121)), + ); + return t; + } + function epn() { + (epn = O), + (P4n = oR(new fX(), ($un(), nzn), ($jn(), $Un))), + (C4n = oR(new fX(), ZGn, DUn)), + (O4n = yK(oR(new fX(), ZGn, QUn), tzn, VUn)), + (S4n = yK(oR(oR(new fX(), ZGn, SUn), nzn, PUn), tzn, IUn)), + (A4n = ltn(ltn(bT(yK(oR(new fX(), YGn, aXn), tzn, cXn), nzn), rXn), uXn)), + (I4n = yK(new fX(), tzn, LUn)), + (T4n = yK(oR(oR(oR(new fX(), JGn, _Un), nzn, BUn), nzn, HUn), tzn, FUn)), + (M4n = yK(oR(oR(new fX(), nzn, HUn), nzn, kUn), tzn, yUn)); + } + function ipn(n, t, e) { + var i, r, c, a; + if (null == n) throw hp(new Iy(aEn)); + for ( + i = (c = n.length) > 0 && (Lz(0, n.length), 45 == n.charCodeAt(0) || (Lz(0, n.length), 43 == n.charCodeAt(0))) ? 1 : 0; + i < c; + i++ + ) + if (-1 == otn((Lz(i, n.length), n.charCodeAt(i)))) throw hp(new Iy(YTn + n + '"')); + if (((r = (a = parseInt(n, 10)) < t), isNaN(a))) throw hp(new Iy(YTn + n + '"')); + if (r || a > e) throw hp(new Iy(YTn + n + '"')); + return a; + } + function rpn(n) { + switch (n) { + case 100: + return Rjn(TKn, !0); + case 68: + return Rjn(TKn, !1); + case 119: + return Rjn(MKn, !0); + case 87: + return Rjn(MKn, !1); + case 115: + return Rjn(SKn, !0); + case 83: + return Rjn(SKn, !1); + case 99: + return Rjn(PKn, !0); + case 67: + return Rjn(PKn, !1); + case 105: + return Rjn(IKn, !0); + case 73: + return Rjn(IKn, !1); + default: + throw hp(new Im(EKn + n.toString(16))); + } + } + function cpn(n, t, e, i, r) { + e && (!i || ((n.c - n.b) & (n.a.length - 1)) > 1) && 1 == t && Yx(n.a[n.b], 10).k == (bon(), Fzn) + ? _pn(Yx(n.a[n.b], 10), (Frn(), Ret)) + : i && (!e || ((n.c - n.b) & (n.a.length - 1)) > 1) && 1 == t && Yx(n.a[(n.c - 1) & (n.a.length - 1)], 10).k == (bon(), Fzn) + ? _pn(Yx(n.a[(n.c - 1) & (n.a.length - 1)], 10), (Frn(), Ket)) + : 2 == ((n.c - n.b) & (n.a.length - 1)) + ? (_pn(Yx(T5(n), 10), (Frn(), Ret)), _pn(Yx(T5(n), 10), Ket)) + : (function (n, t) { + var e, i, r, c, a, u, o, s, h; + for (o = h$((n.c - n.b) & (n.a.length - 1)), s = null, h = null, c = new VB(n); c.a != c.b; ) + (r = Yx(w8(c), 10)), + (e = (u = Yx(Aun(r, (Ojn(), TQn)), 11)) ? u.i : null), + (i = (a = Yx(Aun(r, MQn), 11)) ? a.i : null), + (s == e && h == i) || (vln(o, t), (s = e), (h = i)), + (o.c[o.c.length] = r); + vln(o, t); + })(n, r), + iW(n); + } + function apn(n, t, e) { + var i, r, c, a; + if (t[0] >= n.length) return (e.o = 0), !0; + switch (XB(n, t[0])) { + case 43: + r = 1; + break; + case 45: + r = -1; + break; + default: + return (e.o = 0), !0; + } + if ((++t[0], (c = t[0]), 0 == (a = Uhn(n, t)) && t[0] == c)) return !1; + if (t[0] < n.length && 58 == XB(n, t[0])) { + if (((i = 60 * a), ++t[0], (c = t[0]), 0 == (a = Uhn(n, t)) && t[0] == c)) return !1; + i += a; + } else (i = a) < 24 && t[0] - c <= 2 ? (i *= 60) : (i = (i % 100) + 60 * ((i / 100) | 0)); + return (i *= r), (e.o = -i), !0; + } + function upn(n) { + var t, e, i, r, c, a, u; + for (r = new ip(), i = new $K(bA(o7(n.b).a.Kc(), new h())); Vfn(i); ) + ZW((e = Yx(kV(i), 17))) && eD(r, new VV(e, vY(n, e.c), vY(n, e.d))); + for (u = new ub(new Zl(n.e).a.vc().Kc()); u.a.Ob(); ) (t = Yx(u.a.Pb(), 42)), ((c = Yx(t.dd(), 113)).d.p = 0); + for (a = new ub(new Zl(n.e).a.vc().Kc()); a.a.Ob(); ) + (t = Yx(a.a.Pb(), 42)), 0 == (c = Yx(t.dd(), 113)).d.p && eD(n.d, _gn(n, c)); + } + function opn(n, t, e, i) { + var r, c, a, u, o; + return ( + (a = n.eh()), + (r = null), + (o = n.Zg()) + ? t && 0 == (Ign(n, t, e).Bb & eMn) + ? ((i = Ten(o.Vk(), n, i)), n.uh(null), (r = t.fh())) + : (o = null) + : (a && (o = a.fh()), t && (r = t.fh())), + o != r && o && o.Zk(n), + (u = n.Vg()), + n.Rg(t, e), + o != r && r && r.Yk(n), + n.Lg() && + n.Mg() && + (a && u >= 0 && u != e && ((c = new p_(n, 1, u, a, null)), i ? i.Ei(c) : (i = c)), + e >= 0 && ((c = new p_(n, 1, e, u == e ? a : null, t)), i ? i.Ei(c) : (i = c))), + i + ); + } + function spn(n) { + var t, e, i; + if (null == n.b) { + if (((i = new Cy()), null != n.i && (pI(i, n.i), (i.a += ":")), 0 != (256 & n.f))) { + for ( + 0 != (256 & n.f) && + null != n.a && + ((function (n) { + return null != n && fE(Rct, n.toLowerCase()); + })(n.i) || (i.a += "//"), + pI(i, n.a)), + null != n.d && ((i.a += "/"), pI(i, n.d)), + 0 != (16 & n.f) && (i.a += "/"), + t = 0, + e = n.j.length; + t < e; + t++ + ) + 0 != t && (i.a += "/"), pI(i, n.j[t]); + null != n.g && ((i.a += "?"), pI(i, n.g)); + } else pI(i, n.a); + null != n.e && ((i.a += "#"), pI(i, n.e)), (n.b = i.a); + } + return n.b; + } + function hpn(n, t, e) { + var i, r, c, a, u; + run(e, "Minimize Crossings " + n.a, 1), + (i = 0 == t.b.c.length || !ej(hH(new SR(null, new Nz(t.b, 16)), new Cb(new Ac()))).sd((HE(), dBn))), + (u = 1 == t.b.c.length && 1 == Yx(TR(t.b, 0), 29).a.c.length), + (c = iI(Aun(t, (gjn(), E1n))) === iI((O8(), $et))), + i || + (u && !c) || + ((function (n, t) { + var e, i; + for (i = Ztn(n, 0); i.b != i.d.c; ) (e = Yx(IX(i), 214)).e.length > 0 && (t.td(e), e.i && T9(e)); + })((r = vwn(n, t)), (a = Yx(ken(r, 0), 214)).c.Rf() ? (a.c.Lf() ? new dd(n) : new gd(n)) : new wd(n)), + (function (n) { + var t, e, i; + for (i = new pb(n.b); i.a < i.c.c.length; ) (t = (e = Yx(Hz(i), 214)).c.Rf() ? e.f : e.a) && Umn(t, e.j); + })(n)), + Ron(e); + } + function fpn(n, t, e) { + var i, r, c, a, u; + for (c = 0; c < t; c++) { + for (i = 0, u = c + 1; u < t; u++) + (i = t7(t7(e7(Gz(n[c], uMn), Gz(n[u], uMn)), Gz(e[c + u], uMn)), Gz(WR(i), uMn))), (e[c + u] = WR(i)), (i = UK(i, 32)); + e[c + t] = WR(i); + } + for ( + (function (n, t, e) { + var i, r, c; + for (i = 0, r = 0; r < e; r++) (c = t[r]), (n[r] = (c << 1) | i), (i = c >>> 31); + 0 != i && (n[e] = i); + })(e, e, t << 1), + i = 0, + r = 0, + a = 0; + r < t; + ++r, a++ + ) + (i = t7(t7(e7(Gz(n[r], uMn), Gz(n[r], uMn)), Gz(e[a], uMn)), Gz(WR(i), uMn))), + (e[a] = WR(i)), + (i = t7((i = UK(i, 32)), Gz(e[++a], uMn))), + (e[a] = WR(i)), + (i = UK(i, 32)); + return e; + } + function lpn(n, t, i) { + var r, c, a, u, o, s, h, f; + if (!MX(t)) { + for ( + s = ty(fL(pnn(i.c, (gjn(), W0n)))), !(h = Yx(pnn(i.c, X0n), 142)) && (h = new Mv()), r = i.a, c = null, o = t.Kc(); + o.Ob(); + + ) + (u = Yx(o.Pb(), 11)), + (f = 0), + c ? ((f = s), (f += c.o.b)) : (f = h.d), + (a = HA(DE(new ev(), u), n.f)), + xB(n.k, u, a), + uwn(NE(LE($E(xE(new tv(), 0), oG(e.Math.ceil(f))), r), a)), + (c = u), + (r = a); + uwn(NE(LE($E(xE(new tv(), 0), oG(e.Math.ceil(h.a + c.o.b))), r), i.d)); + } + } + function bpn(n, t, e, i, r, c, a, u) { + var o, s, h; + return ( + (h = !1), + (s = c - e.s), + (o = e.t - t.f + omn(e, s, !1).a), + !(i.g + u > s) && + (o + u + omn(i, s, !1).a <= t.b && + (pY(e, c - e.s), + (e.c = !0), + pY(i, c - e.s), + Qen(i, e.s, e.t + e.d + u), + (i.k = !0), + o3(e.q, i), + (h = !0), + r && + (c0(t, i), + (i.j = t), + n.c.length > a && + (acn(($z(a, n.c.length), Yx(n.c[a], 200)), i), 0 == ($z(a, n.c.length), Yx(n.c[a], 200)).a.c.length && KV(n, a)))), + h) + ); + } + function wpn(n, t, e) { + var i, r, c, a, u; + if (0 == t.p) { + for ( + t.p = 1, + (r = e) || (r = new mP(new ip(), new cx((i = Yx(Ak(trt), 9)), Yx(eN(i, i.length), 9), 0))), + Yx(r.a, 15).Fc(t), + t.k == (bon(), _zn) && Yx(r.b, 21).Fc(Yx(Aun(t, (Ojn(), hQn)), 61)), + a = new pb(t.j); + a.a < a.c.c.length; + + ) + for (c = Yx(Hz(a), 11), u = W_(n0(x4(Gy(QKn, 1), iEn, 20, 0, [new fw(c), new bw(c)]))); Vfn(u); ) wpn(n, Yx(kV(u), 11).i, r); + return r; + } + return null; + } + function dpn(n, t) { + var e, i, r, c, a; + if (n.Ab) + if (n.Ab) { + if ((a = n.Ab.i) > 0) + if (((r = Yx(n.Ab.g, 1934)), null == t)) { + for (c = 0; c < a; ++c) if (null == (e = r[c]).d) return e; + } else for (c = 0; c < a; ++c) if (_N(t, (e = r[c]).d)) return e; + } else if (null == t) { + for (i = new UO(n.Ab); i.e != i.i.gc(); ) if (null == (e = Yx(hen(i), 590)).d) return e; + } else for (i = new UO(n.Ab); i.e != i.i.gc(); ) if (_N(t, (e = Yx(hen(i), 590)).d)) return e; + return null; + } + function gpn(n, t) { + var e, i, r, c, a, u, o; + if (null == (o = hL(Aun(t, (cln(), W5n)))) || (vB(o), o)) { + for ( + (function (n, t) { + var e, i, r, c, a; + for (r = t.b.b, n.a = VQ(JKn, dPn, 15, r, 0, 1), n.b = VQ(Vot, wSn, 25, r, 16, 1), a = Ztn(t.b, 0); a.b != a.d.c; ) + (c = Yx(IX(a), 86)), (n.a[c.g] = new ME()); + for (i = Ztn(t.a, 0); i.b != i.d.c; ) (e = Yx(IX(i), 188)), n.a[e.b.g].Fc(e), n.a[e.c.g].Fc(e); + })(n, t), + r = new ip(), + u = Ztn(t.b, 0); + u.b != u.d.c; + + ) + (e = msn(n, Yx(IX(u), 86), null)) && (o4(e, t), (r.c[r.c.length] = e)); + if (((n.a = null), (n.b = null), r.c.length > 1)) + for (i = new pb(r); i.a < i.c.c.length; ) + for (c = 0, a = Ztn((e = Yx(Hz(i), 135)).b, 0); a.b != a.d.c; ) Yx(IX(a), 86).g = c++; + return r; + } + return DV(x4(Gy(r5n, 1), gPn, 135, 0, [t])); + } + function ppn(n, t, e, i, r) { + var c, a, u, o, s, h, f, l, b, w, d, g, p; + Y0( + (b = (function (n, t, e) { + var i; + return (i = itn(e)), Sgn(n.d, i, t), xB(n.e, t, e), t; + })(n, V4(t), r)), + oX(r, rxn), + ), + (d = uX((w = r), uxn)), + (function (n, t) { + var e, i; + if (!t) throw hp(new hy("All edge sections need a start point.")); + (e = q1(t, "x")), x1(new rg(n).a, (vB(e), e)), (i = q1(t, "y")), R1(new cg(n).a, (vB(i), i)); + })(new eg(b).a, d), + (g = uX(w, "endPoint")), + (function (n, t) { + var e, i; + if (!t) throw hp(new hy("All edge sections need an end point.")); + (e = q1(t, "x")), O1(new ug(n).a, (vB(e), e)), (i = q1(t, "y")), D1(new og(n).a, (vB(i), i)); + })(new ag(b).a, g), + (p = cX(w, YNn)), + (function (n, t) { + var e, i, r; + if (t) + for (r = ((e = new NK(t.a.length)).b - e.a) * e.c < 0 ? (PT(), Fot) : new oA(e); r.Ob(); ) + (i = aX(t, Yx(r.Pb(), 19).a)), sH(new hg(n).a, i); + })(new sg(b).a, p), + (f = oX(r, ZNn)), + (function (n, t, e) { + null != e && L0(t, qin(n, e)); + })((c = new MP(n, b)).a, c.b, f), + (l = oX(r, JNn)), + (function (n, t, e) { + null != e && N0(t, qin(n, e)); + })((a = new SP(n, b)).a, a.b, l), + (s = cX(r, txn)), + (function (n, t, e) { + var i, r; + if (e) + for (r = ((i = new NK(e.a.length)).b - i.a) * i.c < 0 ? (PT(), Fot) : new oA(i); r.Ob(); ) + Qhn(n, t, Nhn(VJ(e, Yx(r.Pb(), 19).a))); + })((u = new PP(e, b)).b, u.a, s), + (h = cX(r, nxn)), + (function (n, t, e) { + var i, r; + if (e) + for (r = ((i = new NK(e.a.length)).b - i.a) * i.c < 0 ? (PT(), Fot) : new oA(i); r.Ob(); ) + Qhn(n, t, Nhn(VJ(e, Yx(r.Pb(), 19).a))); + })((o = new IP(i, b)).b, o.a, h); + } + function vpn(n, t, e) { + var i, r, c, a, u; + switch (((u = null), t.g)) { + case 1: + for (r = new pb(n.j); r.a < r.c.c.length; ) if (ny(hL(Aun((i = Yx(Hz(r), 11)), (Ojn(), dQn))))) return i; + b5((u = new Ion()), (Ojn(), dQn), (TA(), !0)); + break; + case 2: + for (a = new pb(n.j); a.a < a.c.c.length; ) if (ny(hL(Aun((c = Yx(Hz(a), 11)), (Ojn(), xQn))))) return c; + b5((u = new Ion()), (Ojn(), xQn), (TA(), !0)); + } + return ( + u && + (ZG(u, n), + whn(u, e), + (function (n, t, e) { + switch (e.g) { + case 1: + (n.a = t.a / 2), (n.b = 0); + break; + case 2: + (n.a = t.a), (n.b = t.b / 2); + break; + case 3: + (n.a = t.a / 2), (n.b = t.b); + break; + case 4: + (n.a = 0), (n.b = t.b / 2); + } + })(u.n, n.o, e)), + u + ); + } + function mpn(n, t) { + var i, r, c, a, u, o; + for (o = -1, u = new ME(), r = new UV(n.b); ZC(r.a) || ZC(r.b); ) { + for ( + i = Yx(ZC(r.a) ? Hz(r.a) : Hz(r.b), 17), + o = e.Math.max(o, ty(fL(Aun(i, (gjn(), y1n))))), + i.c == n + ? SE(hH(new SR(null, new Nz(i.b, 16)), new fe()), new Ew(u)) + : SE(hH(new SR(null, new Nz(i.b, 16)), new le()), new Tw(u)), + a = Ztn(u, 0); + a.b != a.d.c; + + ) + O$((c = Yx(IX(a), 70)), (Ojn(), aQn)) || b5(c, aQn, i); + S4(t, u), BH(u); + } + return o; + } + function ypn(n, t, e, i, r) { + var c, a, u, o; + Al((c = new rin(n)), (bon(), qzn)), + b5(c, (gjn(), g0n), (Ran(), oit)), + b5(c, (Ojn(), CQn), t.c.i), + b5((a = new Ion()), CQn, t.c), + whn(a, r), + ZG(a, c), + b5(t.c, RQn, c), + Al((u = new rin(n)), qzn), + b5(u, g0n, oit), + b5(u, CQn, t.d.i), + b5((o = new Ion()), CQn, t.d), + whn(o, r), + ZG(o, u), + b5(t.d, RQn, u), + YG(t, a), + QG(t, o), + iz(0, e.c.length), + GT(e.c, 0, c), + (i.c[i.c.length] = u), + b5(c, tQn, d9(1)), + b5(u, tQn, d9(1)); + } + function kpn(n, t, i, r, c) { + var a, u, o, s, h; + (o = c ? r.b : r.a), + gE(n.a, r) || + ((h = o > i.s && o < i.c), + (s = !1), + 0 != i.e.b && + 0 != i.j.b && + ((s |= e.Math.abs(o - ty(fL(g$(i.e)))) < PPn && e.Math.abs(o - ty(fL(g$(i.j)))) < PPn), + (s |= e.Math.abs(o - ty(fL(p$(i.e)))) < PPn && e.Math.abs(o - ty(fL(p$(i.j)))) < PPn)), + (h || s) && + ((u = Yx(Aun(t, (gjn(), $1n)), 74)) || ((u = new Nv()), b5(t, $1n, u)), VW(u, (a = new fC(r)), u.c.b, u.c), __(n.a, a))); + } + function jpn(n, t, e, i) { + var r, c, a, u, o, s, h; + if ( + (function (n, t, e, i) { + var r, c, a, u, o, s; + for (r = 0; r < t.o; r++) + for (c = r - t.j + e, a = 0; a < t.p; a++) + if ( + ((o = c), + (s = u = a - t.k + i), + (o += n.j), + (s += n.k), + o >= 0 && s >= 0 && o < n.o && s < n.p && ((!xin(t, r, a) && Tin(n, c, u)) || (Nin(t, r, a) && !Min(n, c, u)))) + ) + return !0; + return !1; + })(n, t, e, i) + ) + return !0; + for (a = new pb(t.f); a.a < a.c.c.length; ) { + switch (((c = Yx(Hz(a), 324)), (u = !1), (s = (o = n.j - t.j + e) + t.o), (r = (h = n.k - t.k + i) + t.p), c.a.g)) { + case 0: + u = p6(n, o + c.b.a, 0, o + c.c.a, h - 1); + break; + case 1: + u = p6(n, s, h + c.b.a, n.o - 1, h + c.c.a); + break; + case 2: + u = p6(n, o + c.b.a, r, o + c.c.a, n.p - 1); + break; + default: + u = p6(n, 0, h + c.b.a, o - 1, h + c.c.a); + } + if (u) return !0; + } + return !1; + } + function Epn(n) { + uT( + n, + new tun( + rk(nk(ik(ek(new du(), PLn), "ELK Box"), "Algorithm for packing of unconnected boxes, i.e. graphs without edges."), new xu()), + ), + ), + DU(n, PLn, fPn, cnt), + DU(n, PLn, LPn, 15), + DU(n, PLn, $Pn, d9(0)), + DU(n, PLn, U$n, oen(Z7n)), + DU(n, PLn, HPn, oen(tnt)), + DU(n, PLn, BPn, oen(int)), + DU(n, PLn, hPn, SLn), + DU(n, PLn, RPn, oen(nnt)), + DU(n, PLn, eIn, oen(ent)), + DU(n, PLn, ILn, oen(Y7n)), + DU(n, PLn, jAn, oen(J7n)); + } + function Tpn(n, t) { + var e, i, r, c, a, u, o, s, h; + if (((a = (r = n.i).o.a), (c = r.o.b), a <= 0 && c <= 0)) return Ikn(), Hit; + switch (((s = n.n.a), (h = n.n.b), (u = n.o.a), (e = n.o.b), t.g)) { + case 2: + case 1: + if (s < 0) return Ikn(), qit; + if (s + u > a) return Ikn(), Eit; + break; + case 4: + case 3: + if (h < 0) return Ikn(), Tit; + if (h + e > c) return Ikn(), Bit; + } + return (o = (s + u / 2) / a) + (i = (h + e / 2) / c) <= 1 && o - i <= 0 + ? (Ikn(), qit) + : o + i >= 1 && o - i >= 0 + ? (Ikn(), Eit) + : i < 0.5 + ? (Ikn(), Tit) + : (Ikn(), Bit); + } + function Mpn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b; + for (e = !1, o = ty(fL(Aun(t, (gjn(), G0n)))), l = ZEn * o, r = new pb(t.b); r.a < r.c.c.length; ) + for (i = Yx(Hz(r), 29), c = Yx(Hz((u = new pb(i.a))), 10), s = A_(n.a[c.p]); u.a < u.c.c.length; ) + (a = Yx(Hz(u), 10)), + s != (h = A_(n.a[a.p])) && + ((f = lO(n.b, c, a)), + c.n.b + c.o.b + c.d.a + s.a + f > a.n.b - a.d.d + h.a + l && + ((b = s.g + h.g), (h.a = (h.g * h.a + s.g * s.a) / b), (h.g = b), (s.f = h), (e = !0))), + (c = a), + (s = h); + return e; + } + function Spn(n, t, e, i, r, c, a) { + var u, o, s, h, f; + for (f = new hC(), o = t.Kc(); o.Ob(); ) + for (h = new pb(Yx(o.Pb(), 839).wf()); h.a < h.c.c.length; ) + iI((s = Yx(Hz(h), 181)).We((Cjn(), Ont))) === iI((ZZ(), uet)) && (pgn(f, s, !1, i, r, c, a), bsn(n, f)); + for (u = e.Kc(); u.Ob(); ) + for (h = new pb(Yx(u.Pb(), 839).wf()); h.a < h.c.c.length; ) + iI((s = Yx(Hz(h), 181)).We((Cjn(), Ont))) === iI((ZZ(), aet)) && (pgn(f, s, !0, i, r, c, a), bsn(n, f)); + } + function Ppn(n, t) { + var i, r, c, a; + return ( + (r = e.Math.min(e.Math.abs(n.c - (t.c + t.b)), e.Math.abs(n.c + n.b - t.c))), + (a = e.Math.min(e.Math.abs(n.d - (t.d + t.a)), e.Math.abs(n.d + n.a - t.d))), + (i = e.Math.abs(n.c + n.b / 2 - (t.c + t.b / 2))) > n.b / 2 + t.b / 2 || + (c = e.Math.abs(n.d + n.a / 2 - (t.d + t.a / 2))) > n.a / 2 + t.a / 2 + ? 1 + : 0 == i && 0 == c + ? 0 + : 0 == i + ? a / c + 1 + : 0 == c + ? r / i + 1 + : e.Math.min(r / i, a / c) + 1 + ); + } + function Ipn(n, t) { + var i, r, c, a, u, o; + return (c = u0(n)) == (o = u0(t)) + ? n.e == t.e && n.a < 54 && t.a < 54 + ? n.f < t.f + ? -1 + : n.f > t.f + ? 1 + : 0 + : ((r = n.e - t.e), + (i = (n.d > 0 ? n.d : e.Math.floor((n.a - 1) * aMn) + 1) - (t.d > 0 ? t.d : e.Math.floor((t.a - 1) * aMn) + 1)) > r + 1 + ? c + : i < r - 1 + ? -c + : (!n.c && (n.c = J6(n.f)), + (a = n.c), + !t.c && (t.c = J6(t.f)), + (u = t.c), + r < 0 ? (a = uZ(a, xvn(-r))) : r > 0 && (u = uZ(u, xvn(r))), + utn(a, u))) + : c < o + ? -1 + : 1; + } + function Cpn(n, t) { + var e, i, r, c, a, u, o; + for (c = 0, u = 0, o = 0, r = new pb(n.f.e); r.a < r.c.c.length; ) + t != (i = Yx(Hz(r), 144)) && + ((c += a = n.i[t.b][i.b]), + (e = cY(t.d, i.d)) > 0 && n.d != (CJ(), zGn) && (u += a * (i.d.a + (n.a[t.b][i.b] * (t.d.a - i.d.a)) / e)), + e > 0 && n.d != (CJ(), qGn) && (o += a * (i.d.b + (n.a[t.b][i.b] * (t.d.b - i.d.b)) / e))); + switch (n.d.g) { + case 1: + return new QS(u / c, t.d.b); + case 2: + return new QS(t.d.a, o / c); + default: + return new QS(u / c, o / c); + } + } + function Opn(n, t) { + var e, i, r, c; + if ((A6(), (c = Yx(Aun(n.i, (gjn(), g0n)), 98)), 0 != n.j.g - t.j.g || (c != (Ran(), uit) && c != sit && c != oit))) return 0; + if (c == (Ran(), uit) && ((e = Yx(Aun(n, p0n), 19)), (i = Yx(Aun(t, p0n), 19)), e && i && 0 != (r = e.a - i.a))) return r; + switch (n.j.g) { + case 1: + return $9(n.n.a, t.n.a); + case 2: + return $9(n.n.b, t.n.b); + case 3: + return $9(t.n.a, n.n.a); + case 4: + return $9(t.n.b, n.n.b); + default: + throw hp(new Ym(mIn)); + } + } + function Apn(n) { + var t, e, i, r, c; + for ( + eD((c = new pQ((!n.a && (n.a = new XO(Qrt, n, 5)), n.a).i + 2)), new QS(n.j, n.k)), + SE(new SR(null, (!n.a && (n.a = new XO(Qrt, n, 5)), new Nz(n.a, 16))), new Jd(c)), + eD(c, new QS(n.b, n.c)), + t = 1; + t < c.c.length - 1; + + ) + $z(t - 1, c.c.length), + (e = Yx(c.c[t - 1], 8)), + $z(t, c.c.length), + (i = Yx(c.c[t], 8)), + $z(t + 1, c.c.length), + (r = Yx(c.c[t + 1], 8)), + (e.a == i.a && i.a == r.a) || (e.b == i.b && i.b == r.b) ? KV(c, t) : ++t; + return c; + } + function $pn(n, t) { + var e, i, r, c, a, u, o; + for ( + e = BA(AE(CE(OE(new uv(), t), new Tq(t.e)), OXn), n.a), + 0 == t.j.c.length || KY(Yx(TR(t.j, 0), 57).a, e), + o = new cp(), + xB(n.e, e, o), + a = new Qp(), + u = new Qp(), + c = new pb(t.k); + c.a < c.c.c.length; + + ) + __(a, (r = Yx(Hz(c), 17)).c), __(u, r.d); + (i = a.a.gc() - u.a.gc()) < 0 ? (Y4(o, !0, (t9(), Ztt)), Y4(o, !1, net)) : i > 0 && (Y4(o, !1, (t9(), Ztt)), Y4(o, !0, net)), + WZ(t.g, new PM(n, e)), + xB(n.g, t, e); + } + function Lpn() { + var n; + for ( + Lpn = O, + W_n = x4( + Gy(Wot, 1), + MTn, + 25, + 15, + [-1, -1, 30, 19, 15, 13, 11, 11, 10, 9, 9, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5], + ), + V_n = VQ(Wot, MTn, 25, 37, 15, 1), + Q_n = x4( + Gy(Wot, 1), + MTn, + 25, + 15, + [ + -1, -1, 63, 40, 32, 28, 25, 23, 21, 20, 19, 19, 18, 18, 17, 17, 16, 16, 16, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 13, + 13, 13, 13, 13, 13, 13, 13, + ], + ), + Y_n = VQ(Qot, tMn, 25, 37, 14, 1), + n = 2; + n <= 36; + n++ + ) + (V_n[n] = oG(e.Math.pow(n, W_n[n]))), (Y_n[n] = Bcn(IEn, V_n[n])); + } + function Npn(n) { + var t; + if (1 != (!n.a && (n.a = new m_(tct, n, 6, 6)), n.a).i) throw hp(new Qm(eNn + (!n.a && (n.a = new m_(tct, n, 6, 6)), n.a).i)); + return ( + (t = new Nv()), + E4(Yx(c1((!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b), 0), 82)) && + C2(t, mjn(n, E4(Yx(c1((!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b), 0), 82)), !1)), + E4(Yx(c1((!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c), 0), 82)) && + C2(t, mjn(n, E4(Yx(c1((!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c), 0), 82)), !0)), + t + ); + } + function xpn(n, t) { + var e, i, r; + for ( + r = !1, + i = new $K(bA((t.d ? (n.a.c == (Jq(), d4n) ? u7(t.b) : o7(t.b)) : n.a.c == (Jq(), w4n) ? u7(t.b) : o7(t.b)).a.Kc(), new h())); + Vfn(i); + + ) + if ( + ((e = Yx(kV(i), 17)), + (ny(n.a.f[n.a.g[t.b.p].p]) || ZW(e) || e.c.i.c != e.d.i.c) && + !ny(n.a.n[n.a.g[t.b.p].p]) && + !ny(n.a.n[n.a.g[t.b.p].p]) && + ((r = !0), gE(n.b, n.a.g[zin(e, t.b).p]))) + ) + return (t.c = !0), (t.a = e), t; + return (t.c = r), (t.a = null), t; + } + function Dpn(n, t, e) { + var i, r, c, a, u, o, s; + if (0 == (i = e.gc())) return !1; + if (n.ej()) + if (((o = n.fj()), Q7(n, t, e), (a = 1 == i ? n.Zi(3, null, e.Kc().Pb(), t, o) : n.Zi(5, null, e, t, o)), n.bj())) { + for (u = i < 100 ? null : new Ek(i), c = t + i, r = t; r < c; ++r) (s = n.Oi(r)), (u = n.cj(s, u)); + u ? (u.Ei(a), u.Fi()) : n.$i(a); + } else n.$i(a); + else if ((Q7(n, t, e), n.bj())) { + for (u = i < 100 ? null : new Ek(i), c = t + i, r = t; r < c; ++r) u = n.cj(n.Oi(r), u); + u && u.Fi(); + } + return !0; + } + function Rpn(n, t, e) { + var i, r, c, a; + return n.ej() + ? ((r = null), + (c = n.fj()), + (i = n.Zi(1, (a = n.Ui(t, n.oi(t, e))), e, t, c)), + n.bj() && !(n.ni() && a ? Q8(a, e) : iI(a) === iI(e)) + ? (a && (r = n.dj(a, r)), (r = n.cj(e, r)) ? (r.Ei(i), r.Fi()) : n.$i(i)) + : r + ? (r.Ei(i), r.Fi()) + : n.$i(i), + a) + : ((a = n.Ui(t, n.oi(t, e))), + n.bj() && !(n.ni() && a ? Q8(a, e) : iI(a) === iI(e)) && ((r = null), a && (r = n.dj(a, null)), (r = n.cj(e, r)) && r.Fi()), + a); + } + function Kpn(n, t) { + var i, r, c, a, u, o, s, h; + if ( + ((n.e = t), + (n.f = Yx(Aun(t, (d2(), TGn)), 230)), + (function (n) { + var t, e, i; + for (i = n.e.c.length, n.a = fR(Wot, [TEn, MTn], [48, 25], 15, [i, i], 2), e = new pb(n.c); e.a < e.c.c.length; ) + (t = Yx(Hz(e), 282)), (n.a[t.c.b][t.d.b] += Yx(Aun(t, (Bdn(), bGn)), 19).a); + })(t), + (n.d = e.Math.max(16 * t.e.c.length + t.c.c.length, 256)), + !ny(hL(Aun(t, (Bdn(), eGn))))) + ) + for (h = n.e.e.c.length, o = new pb(t.e); o.a < o.c.c.length; ) ((s = Yx(Hz(o), 144).d).a = aK(n.f) * h), (s.b = aK(n.f) * h); + for (i = t.b, a = new pb(t.c); a.a < a.c.c.length; ) + if (((c = Yx(Hz(a), 282)), (r = Yx(Aun(c, gGn), 19).a) > 0)) { + for (u = 0; u < r; u++) eD(i, new dF(c)); + lhn(c); + } + } + function _pn(n, t) { + var i, r, c, a, u; + if ( + n.k == (bon(), Fzn) && + ((i = ej(hH(Yx(Aun(n, (Ojn(), BQn)), 15).Oc(), new Cb(new ri()))).sd((HE(), dBn)) ? t : (Frn(), _et)), + b5(n, kQn, i), + i != (Frn(), Ket)) + ) + for ( + r = Yx(Aun(n, CQn), 17), + u = ty(fL(Aun(r, (gjn(), y1n)))), + a = 0, + i == Ret + ? (a = n.o.b - e.Math.ceil(u / 2)) + : i == _et && ((n.o.b -= ty(fL(Aun(dB(n), D0n)))), (a = (n.o.b - e.Math.ceil(u)) / 2)), + c = new pb(n.j); + c.a < c.c.c.length; + + ) + Yx(Hz(c), 11).n.b = a; + } + function Fpn() { + (Fpn = O), + ET(), + (_ot = new Rh()), + x4(Gy(Uat, 2), TEn, 368, 0, [x4(Gy(Uat, 1), RKn, 592, 0, [new Tj(aKn)])]), + x4(Gy(Uat, 2), TEn, 368, 0, [x4(Gy(Uat, 1), RKn, 592, 0, [new Tj(uKn)])]), + x4(Gy(Uat, 2), TEn, 368, 0, [x4(Gy(Uat, 1), RKn, 592, 0, [new Tj(oKn)]), x4(Gy(Uat, 1), RKn, 592, 0, [new Tj(uKn)])]), + new IC("-1"), + x4(Gy(Uat, 2), TEn, 368, 0, [x4(Gy(Uat, 1), RKn, 592, 0, [new Tj("\\c+")])]), + new IC("0"), + new IC("0"), + new IC("1"), + new IC("0"), + new IC(vKn); + } + function Bpn(n) { + var t, e; + return ( + n.c && + n.c.kh() && + ((e = Yx(n.c, 49)), + (n.c = Yx(P8(n, e), 138)), + n.c != e && + (0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 9, 2, e, n.c)), + CO(n.Cb, 399) + ? n.Db >> 16 == -15 && n.Cb.nh() && vJ(new kY(n.Cb, 9, 13, e, n.c, Ren(IJ(Yx(n.Cb, 59)), n))) + : CO(n.Cb, 88) && + n.Db >> 16 == -23 && + n.Cb.nh() && + (CO((t = n.c), 88) || (xjn(), (t = Oat)), + CO(e, 88) || (xjn(), (e = Oat)), + vJ(new kY(n.Cb, 9, 10, e, t, Ren(tW(Yx(n.Cb, 26)), n)))))), + n.c + ); + } + function Hpn(n, t, e) { + var i, r, c, a, u, o, s, h; + for ( + run(e, "Hyperedge merging", 1), + (function (n, t) { + var e, i, r, c; + for ( + (c = Yx( + kW( + WJ(WJ(new SR(null, new Nz(t.b, 16)), new Re()), new Ke()), + mY(new H(), new B(), new rn(), x4(Gy(wBn, 1), XEn, 132, 0, [(C6(), aBn)])), + ), + 15, + )).Jc(new _e()), + e = 0, + r = c.Kc(); + r.Ob(); + + ) + -1 == (i = Yx(r.Pb(), 11)).p && wln(n, i, e++); + })(n, t), + u = new JU(t.b, 0); + u.b < u.d.gc(); + + ) + if ((S$(u.b < u.d.gc()), 0 != (s = Yx(u.d.Xb((u.c = u.b++)), 29).a).c.length)) + for (i = null, r = null, c = null, a = null, o = 0; o < s.c.length; o++) + $z(o, s.c.length), + (r = (i = Yx(s.c[o], 10)).k) == (bon(), Bzn) && + a == Bzn && + (h = lmn(i, c)).a && + (Qwn(i, c, h.b, h.c), $z(o, s.c.length), uj(s.c, o, 1), --o, (i = c), (r = a)), + (c = i), + (a = r); + Ron(e); + } + function qpn(n, t) { + var e, i, r; + (i = 0 != Xln(n.d, 1)), + (!ny(hL(Aun(t.j, (Ojn(), lQn)))) && !ny(hL(Aun(t.j, qQn)))) || iI(Aun(t.j, (gjn(), XZn))) === iI((k5(), W2n)) + ? t.c.Tf(t.e, i) + : (i = ny(hL(Aun(t.j, lQn)))), + Zbn(n, t, i, !0), + ny(hL(Aun(t.j, qQn))) && b5(t.j, qQn, (TA(), !1)), + ny(hL(Aun(t.j, lQn))) && (b5(t.j, lQn, (TA(), !1)), b5(t.j, qQn, !0)), + (e = ggn(n, t)); + do { + if ((k2(n), 0 == e)) return 0; + (r = e), Zbn(n, t, (i = !i), !1), (e = ggn(n, t)); + } while (r > e); + return r; + } + function Gpn(n, t) { + var e, i, r; + (i = 0 != Xln(n.d, 1)), + (!ny(hL(Aun(t.j, (Ojn(), lQn)))) && !ny(hL(Aun(t.j, qQn)))) || iI(Aun(t.j, (gjn(), XZn))) === iI((k5(), W2n)) + ? t.c.Tf(t.e, i) + : (i = ny(hL(Aun(t.j, lQn)))), + Zbn(n, t, i, !0), + ny(hL(Aun(t.j, qQn))) && b5(t.j, qQn, (TA(), !1)), + ny(hL(Aun(t.j, lQn))) && (b5(t.j, lQn, (TA(), !1)), b5(t.j, qQn, !0)), + (e = Rsn(n, t)); + do { + if ((k2(n), 0 == e)) return 0; + (r = e), Zbn(n, t, (i = !i), !1), (e = Rsn(n, t)); + } while (r > e); + return r; + } + function zpn(n, t, e) { + var i, r, c, a, u, o, s; + if (t == e) return !0; + if (((t = Xfn(n, t)), (e = Xfn(n, e)), (i = win(t)))) { + if ((o = win(e)) != i) return !!o && (a = i.Dj()) == o.Dj() && null != a; + if ((!t.d && (t.d = new XO(hat, t, 1)), (r = (c = t.d).i), !e.d && (e.d = new XO(hat, e, 1)), r == (s = e.d).i)) + for (u = 0; u < r; ++u) if (!zpn(n, Yx(c1(c, u), 87), Yx(c1(s, u), 87))) return !1; + return !0; + } + return t.e == e.e; + } + function Upn(n, t, e, i) { + var r, c, a, u, o, s, h, f; + if (Lwn(n.e, t)) { + for (f = dwn(n.e.Tg(), t), c = Yx(n.g, 119), h = null, o = -1, u = -1, r = 0, s = 0; s < n.i; ++s) + (a = c[s]), f.rl(a.ak()) && (r == e && (o = s), r == i && ((u = s), (h = a.dd())), ++r); + if (-1 == o) throw hp(new Hm(jxn + e + Exn + r)); + if (-1 == u) throw hp(new Hm(Txn + i + Exn + r)); + return L9(n, o, u), gC(n.e) && Xp(n, Kq(n, 7, t, d9(i), h, e, !0)), h; + } + throw hp(new Qm("The feature must be many-valued to support move")); + } + function Xpn(n, t, e, i) { + var r, c, a, u, o; + switch ( + (((o = new fC(t.n)).a += t.o.a / 2), + (o.b += t.o.b / 2), + (u = ty(fL(Aun(t, (gjn(), d0n))))), + (c = n.f), + (a = n.d), + (r = n.c), + Yx(Aun(t, (Ojn(), hQn)), 61).g) + ) { + case 1: + (o.a += a.b + r.a - e / 2), (o.b = -i - u), (t.n.b = -(a.d + u + r.b)); + break; + case 2: + (o.a = c.a + a.b + a.c + u), (o.b += a.d + r.b - i / 2), (t.n.a = c.a + a.c + u - r.a); + break; + case 3: + (o.a += a.b + r.a - e / 2), (o.b = c.b + a.d + a.a + u), (t.n.b = c.b + a.a + u - r.b); + break; + case 4: + (o.a = -e - u), (o.b += a.d + r.b - i / 2), (t.n.a = -(a.b + u + r.a)); + } + return o; + } + function Wpn(n) { + var t, i, r, c, a, u; + return ( + o4((r = new k0()), n), + iI(Aun(r, (gjn(), a1n))) === iI((t9(), tet)) && b5(r, a1n, X9(r)), + null == Aun(r, (tQ(), K7n)) && ((u = Yx(qun(n), 160)), b5(r, K7n, dI(u.We(K7n)))), + b5(r, (Ojn(), CQn), n), + b5(r, bQn, new cx((t = Yx(Ak(KVn), 9)), Yx(eN(t, t.length), 9), 0)), + (c = (function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m; + for ( + (function (n, t) { + _dn(n, !0), WZ(n.e.wf(), new kx(n, !0, t)); + })((l = new vkn(n)), !(t == (t9(), eet) || t == Jtt)), + f = l.a, + b = new Sv(), + JZ(), + u = 0, + s = (c = x4(Gy(sHn, 1), XEn, 232, 0, [rHn, cHn, aHn])).length; + u < s; + ++u + ) + (i = c[u]), (h = LO(f, rHn, i)) && (b.d = e.Math.max(b.d, h.Re())); + for (a = 0, o = (r = x4(Gy(sHn, 1), XEn, 232, 0, [rHn, cHn, aHn])).length; a < o; ++a) + (i = r[a]), (h = LO(f, aHn, i)) && (b.a = e.Math.max(b.a, h.Re())); + for (p = 0, m = (d = x4(Gy(sHn, 1), XEn, 232, 0, [rHn, cHn, aHn])).length; p < m; ++p) + (h = LO(f, d[p], rHn)) && (b.b = e.Math.max(b.b, h.Se())); + for (g = 0, v = (w = x4(Gy(sHn, 1), XEn, 232, 0, [rHn, cHn, aHn])).length; g < v; ++g) + (h = LO(f, w[g], aHn)) && (b.c = e.Math.max(b.c, h.Se())); + return ( + b.d > 0 && ((b.d += f.n.d), (b.d += f.d)), + b.a > 0 && ((b.a += f.n.a), (b.a += f.d)), + b.b > 0 && ((b.b += f.n.b), (b.b += f.d)), + b.c > 0 && ((b.c += f.n.c), (b.c += f.d)), + b + ); + })((IG(n) && (dT(), new Xm(IG(n))), dT(), new e$(IG(n) ? new Xm(IG(n)) : null, n)), net)), + (a = Yx(Aun(r, c0n), 116)), + $G((i = r.d), a), + $G(i, c), + r + ); + } + function Vpn(n, t) { + var i, r, c, a; + return ( + (r = e.Math.abs(a_(n.b).a - a_(t.b).a)), + (a = e.Math.abs(a_(n.b).b - a_(t.b).b)), + (i = 1), + (c = 1), + r > n.b.b / 2 + t.b.b / 2 && (i = 1 - e.Math.min(e.Math.abs(n.b.c - (t.b.c + t.b.b)), e.Math.abs(n.b.c + n.b.b - t.b.c)) / r), + a > n.b.a / 2 + t.b.a / 2 && (c = 1 - e.Math.min(e.Math.abs(n.b.d - (t.b.d + t.b.a)), e.Math.abs(n.b.d + n.b.a - t.b.d)) / a), + (1 - e.Math.min(i, c)) * e.Math.sqrt(r * r + a * a) + ); + } + function Qpn(n) { + var t, i, r; + for ( + gkn(n, n.e, n.f, (Yq(), X4n), !0, n.c, n.i), + gkn(n, n.e, n.f, X4n, !1, n.c, n.i), + gkn(n, n.e, n.f, W4n, !0, n.c, n.i), + gkn(n, n.e, n.f, W4n, !1, n.c, n.i), + (function (n, t, e, i, r) { + var c, a, u, o, s, h, f; + for (a = new pb(t); a.a < a.c.c.length; ) { + if (((o = (c = Yx(Hz(a), 17)).c), e.a._b(o))) Yq(), (s = X4n); + else { + if (!i.a._b(o)) throw hp(new Qm("Source port must be in one of the port sets.")); + Yq(), (s = W4n); + } + if (((h = c.d), e.a._b(h))) Yq(), (f = X4n); + else { + if (!i.a._b(h)) throw hp(new Qm("Target port must be in one of the port sets.")); + Yq(), (f = W4n); + } + (u = new Ksn(c, s, f)), xB(n.b, c, u), (r.c[r.c.length] = u); + } + })(n, n.c, n.e, n.f, n.i), + i = new JU(n.i, 0); + i.b < i.d.gc(); + + ) + for (S$(i.b < i.d.gc()), t = Yx(i.d.Xb((i.c = i.b++)), 128), r = new JU(n.i, i.b); r.b < r.d.gc(); ) + S$(r.b < r.d.gc()), nyn(t, Yx(r.d.Xb((r.c = r.b++)), 128)); + (function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M, S, P; + for (M = new ME(), j = new ME(), g = -1, o = new pb(n); o.a < o.c.c.length; ) { + for ((a = Yx(Hz(o), 128)).s = g--, h = 0, m = 0, c = new pb(a.t); c.a < c.c.c.length; ) m += (i = Yx(Hz(c), 268)).c; + for (r = new pb(a.i); r.a < r.c.c.length; ) h += (i = Yx(Hz(r), 268)).c; + (a.n = h), (a.u = m), 0 == m ? VW(j, a, j.c.b, j.c) : 0 == h && VW(M, a, M.c.b, M.c); + } + for (P = yW(n), d = (f = n.c.length) + 1, p = f - 1, b = new ip(); 0 != P.a.gc(); ) { + for (; 0 != j.b; ) S$(0 != j.b), (k = Yx(VZ(j, j.a.a), 128)), P.a.Bc(k), (k.s = p--), cbn(k, M, j); + for (; 0 != M.b; ) S$(0 != M.b), (E = Yx(VZ(M, M.a.a), 128)), P.a.Bc(E), (E.s = d++), cbn(E, M, j); + for (w = nTn, s = P.a.ec().Kc(); s.Ob(); ) + (v = (a = Yx(s.Pb(), 128)).u - a.n) >= w && (v > w && ((b.c = VQ(UKn, iEn, 1, 0, 5, 1)), (w = v)), (b.c[b.c.length] = a)); + 0 != b.c.length && + ((l = Yx(TR(b, Uen(t, b.c.length)), 128)), P.a.Bc(l), (l.s = d++), cbn(l, M, j), (b.c = VQ(UKn, iEn, 1, 0, 5, 1))); + } + for (y = n.c.length + 1, u = new pb(n); u.a < u.c.c.length; ) (a = Yx(Hz(u), 128)).s < f && (a.s += y); + for (T = new pb(n); T.a < T.c.c.length; ) + for (e = new JU((E = Yx(Hz(T), 128)).t, 0); e.b < e.d.gc(); ) + S$(e.b < e.d.gc()), + (S = (i = Yx(e.d.Xb((e.c = e.b++)), 268)).b), + E.s > S.s && (hB(e), uJ(S.i, i), i.c > 0 && ((i.a = S), eD(S.t, i), (i.b = E), eD(E.i, i))); + })(n.i, Yx(Aun(n.d, (Ojn(), FQn)), 230)), + (function (n) { + var t, i, r, c, a, u, o, s, h; + for (s = new ME(), u = new ME(), c = new pb(n); c.a < c.c.c.length; ) + ((i = Yx(Hz(c), 128)).v = 0), + (i.n = i.i.c.length), + (i.u = i.t.c.length), + 0 == i.n && VW(s, i, s.c.b, s.c), + 0 == i.u && 0 == i.r.a.gc() && VW(u, i, u.c.b, u.c); + for (a = -1; 0 != s.b; ) + for (t = new pb((i = Yx(Urn(s, 0), 128)).t); t.a < t.c.c.length; ) + ((h = Yx(Hz(t), 268).b).v = e.Math.max(h.v, i.v + 1)), (a = e.Math.max(a, h.v)), --h.n, 0 == h.n && VW(s, h, s.c.b, s.c); + if (a > -1) { + for (r = Ztn(u, 0); r.b != r.d.c; ) (i = Yx(IX(r), 128)).v = a; + for (; 0 != u.b; ) + for (t = new pb((i = Yx(Urn(u, 0), 128)).i); t.a < t.c.c.length; ) + 0 == (o = Yx(Hz(t), 268).a).r.a.gc() && ((o.v = e.Math.min(o.v, i.v - 1)), --o.u, 0 == o.u && VW(u, o, u.c.b, u.c)); + } + })(n.i); + } + function Ypn(n, t) { + var e, i; + if (null != t) + if ((i = frn(n))) { + if (0 == (1 & i.i)) return MT(), !(e = Yx(BF(Nct, i), 55)) || e.wj(t); + if (i == Vot) return rI(t); + if (i == Wot) return CO(t, 19); + if (i == Zot) return CO(t, 155); + if (i == Yot) return CO(t, 217); + if (i == Xot) return CO(t, 172); + if (i == Jot) return cI(t); + if (i == nst) return CO(t, 184); + if (i == Qot) return CO(t, 162); + } else if (CO(t, 56)) return n.uk(Yx(t, 56)); + return !1; + } + function Jpn() { + var n, t, e, i, r, c, a, u, o; + for (Jpn = O, sot = VQ(Yot, LNn, 25, 255, 15, 1), hot = VQ(Xot, sTn, 25, 64, 15, 1), t = 0; t < 255; t++) sot[t] = -1; + for (e = 90; e >= 65; e--) sot[e] = ((e - 65) << 24) >> 24; + for (i = 122; i >= 97; i--) sot[i] = ((i - 97 + 26) << 24) >> 24; + for (r = 57; r >= 48; r--) sot[r] = ((r - 48 + 52) << 24) >> 24; + for (sot[43] = 62, sot[47] = 63, c = 0; c <= 25; c++) hot[c] = (65 + c) & fTn; + for (a = 26, o = 0; a <= 51; ++a, o++) hot[a] = (97 + o) & fTn; + for (n = 52, u = 0; n <= 61; ++n, u++) hot[n] = (48 + u) & fTn; + (hot[62] = 43), (hot[63] = 47); + } + function Zpn(n, t) { + var e, i, r, c, a, u, o; + if (!TG(n)) throw hp(new Ym(tNn)); + if (((c = (i = TG(n)).g), (r = i.f), c <= 0 && r <= 0)) return Ikn(), Hit; + switch (((u = n.i), (o = n.j), t.g)) { + case 2: + case 1: + if (u < 0) return Ikn(), qit; + if (u + n.g > c) return Ikn(), Eit; + break; + case 4: + case 3: + if (o < 0) return Ikn(), Tit; + if (o + n.f > r) return Ikn(), Bit; + } + return (a = (u + n.g / 2) / c) + (e = (o + n.f / 2) / r) <= 1 && a - e <= 0 + ? (Ikn(), qit) + : a + e >= 1 && a - e >= 0 + ? (Ikn(), Eit) + : e < 0.5 + ? (Ikn(), Tit) + : (Ikn(), Bit); + } + function nvn(n) { + var t, e, i, r, c, a; + if ((Ljn(), 4 != n.e && 5 != n.e)) throw hp(new Qm("Token#complementRanges(): must be RANGE: " + n.e)); + for ( + xln((c = n)), + Lmn(c), + i = c.b.length + 2, + 0 == c.b[0] && (i -= 2), + (e = c.b[c.b.length - 1]) == jKn && (i -= 2), + (r = new cU(4)).b = VQ(Wot, MTn, 25, i, 15, 1), + a = 0, + c.b[0] > 0 && ((r.b[a++] = 0), (r.b[a++] = c.b[0] - 1)), + t = 1; + t < c.b.length - 2; + t += 2 + ) + (r.b[a++] = c.b[t] + 1), (r.b[a++] = c.b[t + 1] - 1); + return e != jKn && ((r.b[a++] = e + 1), (r.b[a] = jKn)), (r.a = !0), r; + } + function tvn(n, t, e) { + var i, r, c, a, u, o, s, h; + if (0 == (i = e.gc())) return !1; + if (n.ej()) + if (((s = n.fj()), hun(n, t, e), (a = 1 == i ? n.Zi(3, null, e.Kc().Pb(), t, s) : n.Zi(5, null, e, t, s)), n.bj())) { + for (u = i < 100 ? null : new Ek(i), c = t + i, r = t; r < c; ++r) (h = n.g[r]), (u = n.cj(h, u)), (u = n.jj(h, u)); + u ? (u.Ei(a), u.Fi()) : n.$i(a); + } else n.$i(a); + else if ((hun(n, t, e), n.bj())) { + for (u = i < 100 ? null : new Ek(i), c = t + i, r = t; r < c; ++r) (o = n.g[r]), (u = n.cj(o, u)); + u && u.Fi(); + } + return !0; + } + function evn(n, t, e, i) { + var r, c, a, u, o; + for (a = new pb(n.k); a.a < a.c.c.length; ) + (r = Yx(Hz(a), 129)), + (i && r.c != (iQ(), K4n)) || + ((o = r.b).g < 0 && + r.d > 0 && + (Kl(o, o.d - r.d), r.c == (iQ(), K4n) && Dl(o, o.a - r.d), o.d <= 0 && o.i > 0 && VW(t, o, t.c.b, t.c))); + for (c = new pb(n.f); c.a < c.c.c.length; ) + (r = Yx(Hz(c), 129)), + (i && r.c != (iQ(), K4n)) || + ((u = r.a).g < 0 && + r.d > 0 && + (_l(u, u.i - r.d), r.c == (iQ(), K4n) && Rl(u, u.b - r.d), u.i <= 0 && u.d > 0 && VW(e, u, e.c.b, e.c))); + } + function ivn(n, t, e) { + var i, r, c, a, u, o, s, h; + for (run(e, "Processor compute fanout", 1), U_(n.b), U_(n.a), u = null, c = Ztn(t.b, 0); !u && c.b != c.d.c; ) + ny(hL(Aun((s = Yx(IX(c), 86)), (ryn(), C5n)))) && (u = s); + for (VW((o = new ME()), u, o.c.b, o.c), Ckn(n, o), h = Ztn(t.b, 0); h.b != h.d.c; ) + (a = lL(Aun((s = Yx(IX(h), 86)), (ryn(), v5n)))), + (r = null != aG(n.b, a) ? Yx(aG(n.b, a), 19).a : 0), + b5(s, p5n, d9(r)), + (i = 1 + (null != aG(n.a, a) ? Yx(aG(n.a, a), 19).a : 0)), + b5(s, d5n, d9(i)); + Ron(e); + } + function rvn(n, t, e, i, r) { + var c, a, u, o, s, h, f, l, b; + for ( + f = (function (n, t) { + var e, i, r; + for (r = new JU(n.e, 0), e = 0; r.b < r.d.gc(); ) { + if ((i = ty((S$(r.b < r.d.gc()), fL(r.d.Xb((r.c = r.b++))))) - t) > YAn) return e; + i > -1e-6 && ++e; + } + return e; + })(n, e), + u = 0; + u < t; + u++ + ) { + for (ZL(r, e), l = new ip(), S$(i.b < i.d.gc()), b = Yx(i.d.Xb((i.c = i.b++)), 407), s = f + u; s < n.b; s++) + (a = b), S$(i.b < i.d.gc()), eD(l, new Pwn(a, (b = Yx(i.d.Xb((i.c = i.b++)), 407)), e)); + for (h = f + u; h < n.b; h++) S$(i.b > 0), i.a.Xb((i.c = --i.b)), h > f + u && hB(i); + for (c = new pb(l); c.a < c.c.c.length; ) ZL(i, Yx(Hz(c), 407)); + if (u < t - 1) for (o = f + u; o < n.b; o++) S$(i.b > 0), i.a.Xb((i.c = --i.b)); + } + } + function cvn(n) { + var t, i, r, c, a, u, o, s, h, f, l, b, w; + if (((i = n.i), (t = n.n), 0 == n.b)) + for (w = i.c + t.b, b = i.b - t.b - t.c, s = 0, f = (u = n.a).length; s < f; ++s) vK((c = u[s]), w, b); + else + (r = vin(n, !1)), + vK(n.a[0], i.c + t.b, r[0]), + vK(n.a[2], i.c + i.b - t.c - r[2], r[2]), + (l = i.b - t.b - t.c), + r[0] > 0 && ((l -= r[0] + n.c), (r[0] += n.c)), + r[2] > 0 && (l -= r[2] + n.c), + (r[1] = e.Math.max(r[1], l)), + vK(n.a[1], i.c + t.b + r[0] - (r[1] - l) / 2, r[1]); + for (o = 0, h = (a = n.a).length; o < h; ++o) CO((c = a[o]), 326) && Yx(c, 326).Te(); + } + function avn(n) { + var t, e, i, r, c, a, u, o, s, f, l; + for ((l = new aa()).d = 0, a = new pb(n.b); a.a < a.c.c.length; ) (c = Yx(Hz(a), 29)), (l.d += c.a.c.length); + for ( + i = 0, r = 0, l.a = VQ(Wot, MTn, 25, n.b.c.length, 15, 1), s = 0, f = 0, l.e = VQ(Wot, MTn, 25, l.d, 15, 1), e = new pb(n.b); + e.a < e.c.c.length; + + ) + for ((t = Yx(Hz(e), 29)).p = i++, l.a[t.p] = r++, f = 0, o = new pb(t.a); o.a < o.c.c.length; ) + ((u = Yx(Hz(o), 10)).p = s++), (l.e[u.p] = f++); + return ( + (l.c = new Nd(l)), + (l.b = h$(l.d)), + (function (n, t) { + var e, i, r, c, a, u, o, s; + for (c = new pb(t.b); c.a < c.c.c.length; ) + for (o = new pb(Yx(Hz(c), 29).a); o.a < o.c.c.length; ) { + for (u = Yx(Hz(o), 10), s = new ip(), a = 0, i = new $K(bA(u7(u).a.Kc(), new h())); Vfn(i); ) + ZW((e = Yx(kV(i), 17))) || + (!ZW(e) && e.c.i.c == e.d.i.c) || + ((r = Yx(Aun(e, (gjn(), P0n)), 19).a) > a && ((a = r), (s.c = VQ(UKn, iEn, 1, 0, 5, 1))), + r == a && eD(s, new mP(e.c.i, e))); + XH(), JC(s, n.c), ZR(n.b, u.p, s); + } + })(l, n), + (l.f = h$(l.d)), + (function (n, t) { + var e, i, r, c, a, u, o, s; + for (c = new pb(t.b); c.a < c.c.c.length; ) + for (o = new pb(Yx(Hz(c), 29).a); o.a < o.c.c.length; ) { + for (u = Yx(Hz(o), 10), s = new ip(), a = 0, i = new $K(bA(o7(u).a.Kc(), new h())); Vfn(i); ) + ZW((e = Yx(kV(i), 17))) || + (!ZW(e) && e.c.i.c == e.d.i.c) || + ((r = Yx(Aun(e, (gjn(), P0n)), 19).a) > a && ((a = r), (s.c = VQ(UKn, iEn, 1, 0, 5, 1))), + r == a && eD(s, new mP(e.d.i, e))); + XH(), JC(s, n.c), ZR(n.f, u.p, s); + } + })(l, n), + l + ); + } + function uvn(n, t) { + var i, r, c; + for ( + c = Yx(TR(n.n, n.n.c.length - 1), 211).d, + n.p = e.Math.min(n.p, t.g), + n.r = e.Math.max(n.r, c), + n.g = e.Math.max(n.g, t.g + (1 == n.b.c.length ? 0 : n.i)), + n.o = e.Math.min(n.o, t.f), + n.e += t.f + (1 == n.b.c.length ? 0 : n.i), + n.f = e.Math.max(n.f, t.f), + r = n.n.c.length > 0 ? (n.n.c.length - 1) * n.i : 0, + i = new pb(n.n); + i.a < i.c.c.length; + + ) + r += Yx(Hz(i), 211).a; + (n.d = r), (n.a = n.e / n.b.c.length - n.i * ((n.b.c.length - 1) / n.b.c.length)), Trn(n.j); + } + function ovn(n, t) { + var e, i, r, c, a, u, o, s, h; + if (null == (s = hL(Aun(t, (Bdn(), pGn)))) || (vB(s), s)) { + for ( + h = VQ(Vot, wSn, 25, t.e.c.length, 16, 1), + a = (function (n) { + var t, e, i, r, c; + for (r = n.e.c.length, i = VQ(JKn, dPn, 15, r, 0, 1), c = new pb(n.e); c.a < c.c.c.length; ) + i[Yx(Hz(c), 144).b] = new ME(); + for (e = new pb(n.c); e.a < e.c.c.length; ) i[(t = Yx(Hz(e), 282)).c.b].Fc(t), i[t.d.b].Fc(t); + return i; + })(t), + r = new ME(), + o = new pb(t.e); + o.a < o.c.c.length; + + ) + (e = tbn(n, Yx(Hz(o), 144), null, null, h, a)) && (o4(e, t), VW(r, e, r.c.b, r.c)); + if (r.b > 1) + for (i = Ztn(r, 0); i.b != i.d.c; ) + for (c = 0, u = new pb((e = Yx(IX(i), 231)).e); u.a < u.c.c.length; ) Yx(Hz(u), 144).b = c++; + return r; + } + return DV(x4(Gy(Jqn, 1), gPn, 231, 0, [t])); + } + function svn(n) { + var t, e, i, r, c; + if (!n.g) { + if (((c = new To()), null == (t = Hat).a.zc(n, t))) { + for (e = new UO(Iq(n)); e.e != e.i.gc(); ) jF(c, svn(Yx(hen(e), 26))); + t.a.Bc(n), t.a.gc(); + } + for (i = c.i, !n.s && (n.s = new m_(tat, n, 21, 17)), r = new UO(n.s); r.e != r.i.gc(); ++i) Ul(Yx(hen(r), 449), i); + jF(c, (!n.s && (n.s = new m_(tat, n, 21, 17)), n.s)), + B6(c), + (n.g = new p5(n, c)), + (n.i = Yx(c.g, 247)), + null == n.i && (n.i = Gat), + (n.p = null), + (bV(n).b &= -5); + } + return n.g; + } + function hvn(n) { + var t, i, r, c, a, u, o, s, h, f, l, b, w; + if (((r = n.i), (i = n.n), 0 == n.b)) + (t = pin(n, !1)), + mK(n.a[0], r.d + i.d, t[0]), + mK(n.a[2], r.d + r.a - i.a - t[2], t[2]), + (l = r.a - i.d - i.a), + t[0] > 0 && ((t[0] += n.c), (l -= t[0])), + t[2] > 0 && (l -= t[2] + n.c), + (t[1] = e.Math.max(t[1], l)), + mK(n.a[1], r.d + i.d + t[0] - (t[1] - l) / 2, t[1]); + else for (w = r.d + i.d, b = r.a - i.d - i.a, s = 0, f = (u = n.a).length; s < f; ++s) mK((c = u[s]), w, b); + for (o = 0, h = (a = n.a).length; o < h; ++o) CO((c = a[o]), 326) && Yx(c, 326).Ue(); + } + function fvn(n, t, e, i) { + var r, c, a, u, o; + if (((o = dwn(n.e.Tg(), t)), (r = Yx(n.g, 119)), TT(), Yx(t, 66).Oj())) { + for (a = 0; a < n.i; ++a) if (((c = r[a]), o.rl(c.ak()) && Q8(c, e))) return !0; + } else if (null != e) { + for (u = 0; u < n.i; ++u) if (((c = r[u]), o.rl(c.ak()) && Q8(e, c.dd()))) return !0; + if (i) for (a = 0; a < n.i; ++a) if (((c = r[a]), o.rl(c.ak()) && iI(e) === iI(nL(n, Yx(c.dd(), 56))))) return !0; + } else for (a = 0; a < n.i; ++a) if (((c = r[a]), o.rl(c.ak()) && null == c.dd())) return !1; + return !1; + } + function lvn(n, t, e, i) { + var r, c, a, u, o, s; + if (((s = dwn(n.e.Tg(), t)), (a = Yx(n.g, 119)), Lwn(n.e, t))) { + if (t.hi() && (c = $vn(n, t, i, CO(t, 99) && 0 != (Yx(t, 18).Bb & eMn))) >= 0 && c != e) throw hp(new Qm(kxn)); + for (r = 0, o = 0; o < n.i; ++o) + if (((u = a[o]), s.rl(u.ak()))) { + if (r == e) return Yx(Ken(n, o, (TT(), Yx(t, 66).Oj() ? Yx(i, 72) : VX(t, i))), 72); + ++r; + } + throw hp(new Hm(pDn + e + Exn + r)); + } + for (o = 0; o < n.i; ++o) if (((u = a[o]), s.rl(u.ak()))) return TT(), Yx(t, 66).Oj() ? u : u.dd(); + return null; + } + function bvn(n, t, i, r) { + var c, a, u, o; + for (o = i, u = new pb(t.a); u.a < u.c.c.length; ) { + if ( + ((a = Yx(Hz(u), 221)), + (c = Yx(a.b, 65)), + y7(n.b.c, c.b.c + c.b.b) <= 0 && + y7(c.b.c, n.b.c + n.b.b) <= 0 && + y7(n.b.d, c.b.d + c.b.a) <= 0 && + y7(c.b.d, n.b.d + n.b.a) <= 0) + ) { + if ( + (0 == y7(c.b.c, n.b.c + n.b.b) && r.a < 0) || + (0 == y7(c.b.c + c.b.b, n.b.c) && r.a > 0) || + (0 == y7(c.b.d, n.b.d + n.b.a) && r.b < 0) || + (0 == y7(c.b.d + c.b.a, n.b.d) && r.b > 0) + ) { + o = 0; + break; + } + } else o = e.Math.min(o, bhn(n, c, r)); + o = e.Math.min(o, bvn(n, a, o, r)); + } + return o; + } + function wvn(n, t) { + var e, i, r, c, a, u; + if (n.b < 2) throw hp(new Qm("The vector chain must contain at least a source and a target point.")); + for ( + S$(0 != n.b), TC(t, (i = Yx(n.a.a.c, 8)).a, i.b), u = new a$((!t.a && (t.a = new XO(Qrt, t, 5)), t.a)), c = Ztn(n, 1); + c.a < n.b - 1; + + ) + (a = Yx(IX(c), 8)), u.e != u.i.gc() ? (e = Yx(hen(u), 469)) : (xk(), Enn(u, (e = new ro()))), yC(e, a.a, a.b); + for (; u.e != u.i.gc(); ) hen(u), tan(u); + S$(0 != n.b), EC(t, (r = Yx(n.c.b.c, 8)).a, r.b); + } + function dvn(n, t) { + var e, i, r, c, a, u, o, s; + for (e = 0, i = new pb(($z(0, n.c.length), Yx(n.c[0], 101)).g.b.j); i.a < i.c.c.length; ) Yx(Hz(i), 11).p = e++; + for (t == (Ikn(), Tit) ? JC(n, new nc()) : JC(n, new tc()), a = 0, s = n.c.length - 1; a < s; ) + $z(a, n.c.length), + (c = Yx(n.c[a], 101)), + $z(s, n.c.length), + (o = Yx(n.c[s], 101)), + (r = t == Tit ? c.c : c.a), + (u = t == Tit ? o.a : o.c), + O_(c, t, (K4(), NXn), r), + O_(o, t, LXn, u), + ++a, + --s; + a == s && O_(($z(a, n.c.length), Yx(n.c[a], 101)), t, (K4(), $Xn), null); + } + function gvn(n, t, e) { + var i, r, c, a, u, o, s, h, f, l; + return ( + (h = n.a.i + n.a.g / 2), + (f = n.a.i + n.a.g / 2), + (a = new QS(t.i + t.g / 2, t.j + t.f / 2)), + ((o = Yx(jln(t, (Cjn(), Ott)), 8)).a = o.a + h), + (o.b = o.b + f), + (r = (a.b - o.b) / (a.a - o.a)), + (i = a.b - r * a.a), + (u = new QS(e.i + e.g / 2, e.j + e.f / 2)), + ((s = Yx(jln(e, Ott), 8)).a = s.a + h), + (s.b = s.b + f), + (c = (u.b - s.b) / (u.a - s.a)), + (l = (i - (u.b - c * u.a)) / (c - r)), + !((o.a < l && a.a < l) || (l < o.a && l < a.a) || (s.a < l && u.a < l) || (l < s.a && l < u.a)) + ); + } + function pvn(n, t, e) { + var i, r, c, a, u, o; + (this.a = n), + (this.b = t), + (this.c = e), + (this.e = DV(x4(Gy(kBn, 1), iEn, 168, 0, [new ZT(n, t), new ZT(t, e), new ZT(e, n)]))), + (this.f = DV(x4(Gy(B7n, 1), TEn, 8, 0, [n, t, e]))), + (this.d = + ((i = yN(dO(this.b), this.a)), + (r = yN(dO(this.c), this.a)), + (c = yN(dO(this.c), this.b)), + (a = i.a * (this.a.a + this.b.a) + i.b * (this.a.b + this.b.b)), + (u = r.a * (this.a.a + this.c.a) + r.b * (this.a.b + this.c.b)), + (o = 2 * (i.a * c.b - i.b * c.a)), + new QS((r.b * a - i.b * u) / o, (i.a * u - r.a * a) / o))); + } + function vvn(n, t, e, i) { + var r, c, a, u, o, s, h, f, l; + if (((f = new zF(n.p)), OZ(t, gxn, f), e && !(n.f ? lq(n.f) : null).a.dc())) + for (OZ(t, "logs", (s = new Sl())), u = 0, l = new lb((n.f ? lq(n.f) : null).b.Kc()); l.b.Ob(); ) + (h = new zF(lL(l.b.Pb()))), VJ(s, u), ZX(s, u, h), ++u; + if ((i && OZ(t, "executionTime", new Tl(n.q)), !lq(n.a).a.dc())) + for (a = new Sl(), OZ(t, UNn, a), u = 0, c = new lb(lq(n.a).b.Kc()); c.b.Ob(); ) + (r = Yx(c.b.Pb(), 1949)), (o = new Om()), VJ(a, u), ZX(a, u, o), vvn(r, o, e, i), ++u; + } + function mvn(n, t) { + var e, i, r, c, a, u; + for ( + c = n.c, + a = n.d, + YG(n, null), + QG(n, null), + t && ny(hL(Aun(a, (Ojn(), dQn)))) ? YG(n, vpn(a.i, (h0(), i3n), (Ikn(), Eit))) : YG(n, a), + t && ny(hL(Aun(c, (Ojn(), xQn)))) ? QG(n, vpn(c.i, (h0(), e3n), (Ikn(), qit))) : QG(n, c), + i = new pb(n.b); + i.a < i.c.c.length; + + ) + (e = Yx(Hz(i), 70)), (r = Yx(Aun(e, (gjn(), f1n)), 272)) == (ZZ(), uet) ? b5(e, f1n, aet) : r == aet && b5(e, f1n, uet); + (u = ny(hL(Aun(n, (Ojn(), HQn))))), b5(n, HQn, (TA(), !u)), (n.a = U5(n.a)); + } + function yvn(n, t, e, i) { + var r, c, a, u, o, s; + for (a = new dyn(n, t, e), o = new JU(i, 0), r = !1; o.b < o.d.gc(); ) + S$(o.b < o.d.gc()), + (u = Yx(o.d.Xb((o.c = o.b++)), 233)) == t || u == e + ? hB(o) + : !r && ty(NO(u.g, u.d[0]).a) > ty(NO(a.g, a.d[0]).a) + ? (S$(o.b > 0), o.a.Xb((o.c = --o.b)), ZL(o, a), (r = !0)) + : u.e && + u.e.gc() > 0 && + ((c = (!u.e && (u.e = new ip()), u.e).Mc(t)), + (s = (!u.e && (u.e = new ip()), u.e).Mc(e)), + (c || s) && ((!u.e && (u.e = new ip()), u.e).Fc(a), ++a.c)); + r || (i.c[i.c.length] = a); + } + function kvn(n) { + var t, e, i; + if (dC(Yx(Aun(n, (gjn(), g0n)), 98))) + for (e = new pb(n.j); e.a < e.c.c.length; ) + (t = Yx(Hz(e), 11)).j == (Ikn(), Hit) && + ((i = Yx(Aun(t, (Ojn(), RQn)), 10)) + ? whn(t, Yx(Aun(i, hQn), 61)) + : t.e.c.length - t.g.c.length < 0 + ? whn(t, Eit) + : whn(t, qit)); + else { + for (e = new pb(n.j); e.a < e.c.c.length; ) + (t = Yx(Hz(e), 11)), + (i = Yx(Aun(t, (Ojn(), RQn)), 10)) + ? whn(t, Yx(Aun(i, hQn), 61)) + : t.e.c.length - t.g.c.length < 0 + ? whn(t, (Ikn(), Eit)) + : whn(t, (Ikn(), qit)); + b5(n, g0n, (Ran(), hit)); + } + } + function jvn(n) { + var t, e; + switch (n) { + case 91: + case 93: + case 45: + case 94: + case 44: + case 92: + e = "\\" + String.fromCharCode(n & fTn); + break; + case 12: + e = "\\f"; + break; + case 10: + e = "\\n"; + break; + case 13: + e = "\\r"; + break; + case 9: + e = "\\t"; + break; + case 27: + e = "\\e"; + break; + default: + e = + n < 32 + ? "\\x" + l$((t = "0" + (n >>> 0).toString(16)), t.length - 2, t.length) + : n >= eMn + ? "\\v" + l$((t = "0" + (n >>> 0).toString(16)), t.length - 6, t.length) + : "" + String.fromCharCode(n & fTn); + } + return e; + } + function Evn(n, t) { + var e, i, r, c, a, u, o, s, h, f; + if (((a = n.e), 0 == (o = t.e))) return n; + if (0 == a) return 0 == t.e ? t : new C_(-t.e, t.d, t.a); + if ((c = n.d) + (u = t.d) == 2) + return (e = Gz(n.a[0], uMn)), (i = Gz(t.a[0], uMn)), a < 0 && (e = sJ(e)), o < 0 && (i = sJ(i)), Utn(n7(e, i)); + if (-1 == (r = c != u ? (c > u ? 1 : -1) : w6(n.a, t.a, c))) (f = -o), (h = a == o ? GV(t.a, u, n.a, c) : WQ(t.a, u, n.a, c)); + else if (((f = a), a == o)) { + if (0 == r) return bdn(), pFn; + h = GV(n.a, c, t.a, u); + } else h = WQ(n.a, c, t.a, u); + return SU((s = new C_(f, h.length, h))), s; + } + function Tvn(n) { + var t, e, i, r, c, a; + for (this.e = new ip(), this.a = new ip(), e = n.b - 1; e < 3; e++) A$(n, 0, Yx(ken(n, 0), 8)); + if (n.b < 4) throw hp(new Qm("At (least dimension + 1) control points are necessary!")); + for ( + this.b = 3, + this.d = !0, + this.c = !1, + (function (n, t) { + var e, i, r, c, a; + if (t < 2 * n.b) throw hp(new Qm("The knot vector must have at least two time the dimension elements.")); + for (n.f = 1, r = 0; r < n.b; r++) eD(n.e, 0); + for (e = a = t + 1 - 2 * n.b, c = 1; c < a; c++) eD(n.e, c / e); + if (n.d) for (i = 0; i < n.b; i++) eD(n.e, 1); + })(this, n.b + this.b - 1), + a = new ip(), + c = new pb(this.e), + t = 0; + t < this.b - 1; + t++ + ) + eD(a, fL(Hz(c))); + for (r = Ztn(n, 0); r.b != r.d.c; ) + (i = Yx(IX(r), 8)), eD(a, fL(Hz(c))), eD(this.a, new Qq(i, a)), $z(0, a.c.length), a.c.splice(0, 1); + } + function Mvn(n, t) { + var e, i, r, c, a, u, o; + for (r = new pb(n.b); r.a < r.c.c.length; ) + for (a = new pb(Yx(Hz(r), 29).a); a.a < a.c.c.length; ) + for ( + (c = Yx(Hz(a), 10)).k == (bon(), Fzn) && + ((u = Yx(kV(new $K(bA(u7(c).a.Kc(), new h()))), 17)), + (o = Yx(kV(new $K(bA(o7(c).a.Kc(), new h()))), 17)), + _pn(c, ny(hL(Aun(u, (Ojn(), HQn)))) && ny(hL(Aun(o, HQn))) ? J4(t) : t)), + i = new $K(bA(o7(c).a.Kc(), new h())); + Vfn(i); + + ) + P4((e = Yx(kV(i), 17)), ny(hL(Aun(e, (Ojn(), HQn)))) ? J4(t) : t); + } + function Svn(n, t, e, i, r) { + var c, a; + if ((e.f >= t.o && e.f <= t.f) || (0.5 * t.a <= e.f && 1.5 * t.a >= e.f)) { + if ( + (c = Yx(TR(t.n, t.n.c.length - 1), 211)).e + c.d + e.g + r <= i && + (Yx(TR(t.n, t.n.c.length - 1), 211).f - n.f + e.f <= n.b || 1 == n.a.c.length) + ) + return l7(t, e), !0; + if (t.s + e.g <= i && (t.t + t.d + e.f + r <= n.b || 1 == n.a.c.length)) + return ( + eD(t.b, e), + (a = Yx(TR(t.n, t.n.c.length - 1), 211)), + eD(t.n, new gG(t.s, a.f + a.a + t.i, t.i)), + Cin(Yx(TR(t.n, t.n.c.length - 1), 211), e), + uvn(t, e), + !0 + ); + } + return !1; + } + function Pvn(n, t, e) { + var i, r, c, a; + return n.ej() + ? ((r = null), + (c = n.fj()), + (i = n.Zi(1, (a = HJ(n, t, e)), e, t, c)), + n.bj() && !(n.ni() && null != a ? Q8(a, e) : iI(a) === iI(e)) + ? (null != a && (r = n.dj(a, r)), (r = n.cj(e, r)), n.ij() && (r = n.lj(a, e, r)), r ? (r.Ei(i), r.Fi()) : n.$i(i)) + : (n.ij() && (r = n.lj(a, e, r)), r ? (r.Ei(i), r.Fi()) : n.$i(i)), + a) + : ((a = HJ(n, t, e)), + n.bj() && + !(n.ni() && null != a ? Q8(a, e) : iI(a) === iI(e)) && + ((r = null), null != a && (r = n.dj(a, null)), (r = n.cj(e, r)) && r.Fi()), + a); + } + function Ivn(n, t) { + var i, r, c, a, u, o, s; + (t %= 24), + n.q.getHours() != t && + ((i = new e.Date(n.q.getTime())).setDate(i.getDate() + 1), + (u = n.q.getTimezoneOffset() - i.getTimezoneOffset()) > 0 && + ((o = (u / 60) | 0), + (s = u % 60), + (r = n.q.getDate()), + n.q.getHours() + o >= 24 && ++r, + (c = new e.Date( + n.q.getFullYear(), + n.q.getMonth(), + r, + t + o, + n.q.getMinutes() + s, + n.q.getSeconds(), + n.q.getMilliseconds(), + )), + n.q.setTime(c.getTime()))), + (a = n.q.getTime()), + n.q.setTime(a + 36e5), + n.q.getHours() != t && n.q.setTime(a); + } + function Cvn(n, t) { + var e, i, r, c; + if ((run(t, "Path-Like Graph Wrapping", 1), 0 != n.b.c.length)) + if ( + (null == (r = new rln(n)).i && (r.i = D2(r, new kc())), + (e = (ty(r.i) * r.f) / (null == r.i && (r.i = D2(r, new kc())), ty(r.i))), + r.b > e) + ) + Ron(t); + else { + switch (Yx(Aun(n, (gjn(), t2n)), 337).g) { + case 2: + c = new Tc(); + break; + case 0: + c = new wc(); + break; + default: + c = new Mc(); + } + if (((i = c.Vf(n, r)), !c.Wf())) + switch (Yx(Aun(n, u2n), 338).g) { + case 2: + i = dhn(r, i); + break; + case 1: + i = uun(r, i); + } + (function (n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b; + if (!e.dc()) { + for (a = 0, h = 0, l = Yx((i = e.Kc()).Pb(), 19).a; a < t.f; ) { + if ((a == l && ((h = 0), (l = i.Ob() ? Yx(i.Pb(), 19).a : t.f + 1)), a != h)) + for (b = Yx(TR(n.b, a), 29), f = Yx(TR(n.b, h), 29), s = new pb(Xz(b.a)); s.a < s.c.c.length; ) + if ((Hrn((o = Yx(Hz(s), 10)), f.a.c.length, f), 0 == h)) + for (c = new pb(Xz(u7(o))); c.a < c.c.c.length; ) + mvn((r = Yx(Hz(c), 17)), !0), b5(n, (Ojn(), iQn), (TA(), !0)), fyn(n, r, 1); + ++h, ++a; + } + for (u = new JU(n.b, 0); u.b < u.d.gc(); ) S$(u.b < u.d.gc()), 0 == Yx(u.d.Xb((u.c = u.b++)), 29).a.c.length && hB(u); + } + })(n, r, i), + Ron(t); + } + else Ron(t); + } + function Ovn(n, t) { + var e, i, r, c; + if ( + ((function (n, t) { + $O(n, WR(Gz(zK(t, 24), TMn)), WR(Gz(t, TMn))); + })(n.d, n.e), + n.c.a.$b(), + 0 != ty(fL(Aun(t.j, (gjn(), qZn)))) || 0 != ty(fL(Aun(t.j, qZn)))) + ) + for ( + e = wPn, iI(Aun(t.j, XZn)) !== iI((k5(), W2n)) && b5(t.j, (Ojn(), lQn), (TA(), !0)), c = Yx(Aun(t.j, V0n), 19).a, r = 0; + r < c && !((i = qpn(n, t)) < e && ((e = i), j2(n), 0 == e)); + r++ + ); + else + for ( + e = Yjn, iI(Aun(t.j, XZn)) !== iI((k5(), W2n)) && b5(t.j, (Ojn(), lQn), (TA(), !0)), c = Yx(Aun(t.j, V0n), 19).a, r = 0; + r < c && !((i = Gpn(n, t)) < e && ((e = i), j2(n), 0 == e)); + r++ + ); + } + function Avn(n) { + var t, e, i, r, c; + if (!n.d) { + if (((c = new Po()), null == (t = Hat).a.zc(n, t))) { + for (e = new UO(Iq(n)); e.e != e.i.gc(); ) jF(c, Avn(Yx(hen(e), 26))); + t.a.Bc(n), t.a.gc(); + } + for (r = c.i, !n.q && (n.q = new m_(fat, n, 11, 10)), i = new UO(n.q); i.e != i.i.gc(); ++r) Yx(hen(i), 399); + jF(c, (!n.q && (n.q = new m_(fat, n, 11, 10)), n.q)), + B6(c), + (n.d = new HI((Yx(c1(aq((YF(), gat).o), 9), 18), c.i), c.g)), + (n.e = Yx(c.g, 673)), + null == n.e && (n.e = qat), + (bV(n).b &= -17); + } + return n.d; + } + function $vn(n, t, e, i) { + var r, c, a, u, o, s; + if (((s = dwn(n.e.Tg(), t)), (o = 0), (r = Yx(n.g, 119)), TT(), Yx(t, 66).Oj())) { + for (a = 0; a < n.i; ++a) + if (((c = r[a]), s.rl(c.ak()))) { + if (Q8(c, e)) return o; + ++o; + } + } else if (null != e) { + for (u = 0; u < n.i; ++u) + if (((c = r[u]), s.rl(c.ak()))) { + if (Q8(e, c.dd())) return o; + ++o; + } + if (i) + for (o = 0, a = 0; a < n.i; ++a) + if (((c = r[a]), s.rl(c.ak()))) { + if (iI(e) === iI(nL(n, Yx(c.dd(), 56)))) return o; + ++o; + } + } else + for (a = 0; a < n.i; ++a) + if (((c = r[a]), s.rl(c.ak()))) { + if (null == c.dd()) return o; + ++o; + } + return -1; + } + function Lvn(n, t, e, i) { + var r, c, a, u, o, s, h, f, l, b, w, d; + if (e.mh(t) && (h = (b = t) ? Yx(i, 49).xh(b) : null)) + if (((d = e.bh(t, n.a)), (w = t.t) > 1 || -1 == w)) + if (((f = Yx(d, 69)), (l = Yx(h, 69)), f.dc())) l.$b(); + else + for (a = !!nin(t), c = 0, u = n.a ? f.Kc() : f.Zh(); u.Ob(); ) + (s = Yx(u.Pb(), 56)), + (r = Yx(UJ(n, s), 56)) + ? (a ? (-1 == (o = l.Xc(r)) ? l.Xh(c, r) : c != o && l.ji(c, r)) : l.Xh(c, r), ++c) + : n.b && !a && (l.Xh(c, s), ++c); + else null == d ? h.Wb(null) : null == (r = UJ(n, d)) ? n.b && !nin(t) && h.Wb(d) : h.Wb(r); + } + function Nvn(n, t) { + var i, r, c, a, u, o, s, f; + for (i = new Le(), c = new $K(bA(u7(t).a.Kc(), new h())); Vfn(c); ) + if (!ZW((r = Yx(kV(c), 17))) && Ban((o = r.c.i), uUn)) { + if (-1 == (f = Sdn(n, o, uUn, aUn))) continue; + (i.b = e.Math.max(i.b, f)), !i.a && (i.a = new ip()), eD(i.a, o); + } + for (u = new $K(bA(o7(t).a.Kc(), new h())); Vfn(u); ) + if (!ZW((a = Yx(kV(u), 17))) && Ban((s = a.d.i), aUn)) { + if (-1 == (f = Sdn(n, s, aUn, uUn))) continue; + (i.d = e.Math.max(i.d, f)), !i.c && (i.c = new ip()), eD(i.c, s); + } + return i; + } + function xvn(n) { + var t, e, i, r; + if ((jfn(), (t = oG(n)), n < jFn.length)) return jFn[t]; + if (n <= 50) return ifn((bdn(), dFn), t); + if (n <= hTn) return mV(ifn(kFn[1], t), t); + if (n > 1e6) throw hp(new Bm("power of ten too big")); + if (n <= Yjn) return mV(ifn(kFn[1], t), t); + for (r = i = ifn(kFn[1], Yjn), e = D3(n - Yjn), t = oG(n % Yjn); k8(e, Yjn) > 0; ) (r = uZ(r, i)), (e = n7(e, Yjn)); + for (r = mV((r = uZ(r, ifn(kFn[1], t))), Yjn), e = D3(n - Yjn); k8(e, Yjn) > 0; ) (r = mV(r, Yjn)), (e = n7(e, Yjn)); + return mV(r, t); + } + function Dvn(n, t) { + var e, i, r, c, a; + run(t, "Layer constraint postprocessing", 1), + 0 != (a = n.b).c.length && + ($z(0, a.c.length), + (function (n, t, e, i, r) { + var c, a, u, o, s, h; + for (c = new pb(n.b); c.a < c.c.c.length; ) + for (s = 0, h = (o = OU(Yx(Hz(c), 29).a)).length; s < h; ++s) + switch (Yx(Aun((u = o[s]), (gjn(), x1n)), 163).g) { + case 1: + Ewn(u), JG(u, t), Ben(u, !0, i); + break; + case 3: + swn(u), JG(u, e), Ben(u, !1, r); + } + for (a = new JU(n.b, 0); a.b < a.d.gc(); ) 0 == (S$(a.b < a.d.gc()), Yx(a.d.Xb((a.c = a.b++)), 29)).a.c.length && hB(a); + })(n, Yx(a.c[0], 29), Yx(TR(a, a.c.length - 1), 29), (e = new qF(n)), (r = new qF(n))), + 0 == e.a.c.length || (iz(0, a.c.length), GT(a.c, 0, e)), + 0 == r.a.c.length || (a.c[a.c.length] = r)), + O$(n, (Ojn(), wQn)) && + ((function (n, t, e) { + var i, r, c, a, u, o; + for (a = Yx(Aun(n, (Ojn(), wQn)), 15).Kc(); a.Ob(); ) { + switch (((c = Yx(a.Pb(), 10)), Yx(Aun(c, (gjn(), x1n)), 163).g)) { + case 2: + JG(c, t); + break; + case 4: + JG(c, e); + } + for (r = new $K(bA(a7(c).a.Kc(), new h())); Vfn(r); ) + ((i = Yx(kV(r), 17)).c && i.d) || ((u = !i.d), (o = Yx(Aun(i, LQn), 11)), u ? QG(i, o) : YG(i, o)); + } + })(n, (i = new qF(n)), (c = new qF(n))), + 0 == i.a.c.length || (iz(0, a.c.length), GT(a.c, 0, i)), + 0 == c.a.c.length || (a.c[a.c.length] = c)), + Ron(t); + } + function Rvn(n) { + var t, e, i, r, c, a, u, o; + for (a = new pb(n.a); a.a < a.c.c.length; ) + if ((c = Yx(Hz(a), 10)).k == (bon(), _zn) && ((r = Yx(Aun(c, (Ojn(), hQn)), 61)) == (Ikn(), Eit) || r == qit)) + for (i = new $K(bA(a7(c).a.Kc(), new h())); Vfn(i); ) + 0 != (t = (e = Yx(kV(i), 17)).a).b && + ((u = e.c).i == c && (S$(0 != t.b), (Yx(t.a.a.c, 8).b = $5(x4(Gy(B7n, 1), TEn, 8, 0, [u.i.n, u.n, u.a])).b)), + (o = e.d).i == c && (S$(0 != t.b), (Yx(t.c.b.c, 8).b = $5(x4(Gy(B7n, 1), TEn, 8, 0, [o.i.n, o.n, o.a])).b))); + } + function Kvn(n, t) { + var e, i, r; + if ( + ((r = Wpn(t)), + SE(new SR(null, (!t.c && (t.c = new m_(oct, t, 9, 9)), new Nz(t.c, 16))), new dw(r)), + (function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l; + for ( + a = ny(hL(jln(n, (gjn(), I1n)))), + l = Yx(jln(n, m0n), 21), + o = !1, + s = !1, + f = new UO((!n.c && (n.c = new m_(oct, n, 9, 9)), n.c)); + !(f.e == f.i.gc() || (o && s)); + + ) { + for ( + c = Yx(hen(f), 118), + u = 0, + r = W_( + n0( + x4(Gy(QKn, 1), iEn, 20, 0, [ + (!c.d && (c.d = new AN(nct, c, 8, 5)), c.d), + (!c.e && (c.e = new AN(nct, c, 7, 4)), c.e), + ]), + ), + ); + Vfn(r) && + ((i = Yx(kV(r), 79)), + (h = a && Whn(i) && ny(hL(jln(i, C1n)))), + (e = zmn((!i.b && (i.b = new AN(Zrt, i, 4, 7)), i.b), c) + ? n == IG(iun(Yx(c1((!i.c && (i.c = new AN(Zrt, i, 5, 8)), i.c), 0), 82))) + : n == IG(iun(Yx(c1((!i.b && (i.b = new AN(Zrt, i, 4, 7)), i.b), 0), 82)))), + !((h || e) && ++u > 1)); + + ); + (u > 0 || (l.Hc((Chn(), pit)) && (!c.n && (c.n = new m_(act, c, 1, 7)), c.n).i > 0)) && (o = !0), u > 1 && (s = !0); + } + o && t.Fc((edn(), SVn)), s && t.Fc((edn(), PVn)); + })(t, (i = Yx(Aun(r, (Ojn(), bQn)), 21))), + i.Hc((edn(), SVn))) + ) + for (e = new UO((!t.c && (t.c = new m_(oct, t, 9, 9)), t.c)); e.e != e.i.gc(); ) bkn(n, t, r, Yx(hen(e), 118)); + return ( + 0 != Yx(jln(t, (gjn(), n0n)), 174).gc() && cdn(t, r), + ny(hL(Aun(r, u0n))) && i.Fc(AVn), + O$(r, O0n) && Rm(new B7(ty(fL(Aun(r, O0n)))), r), + iI(jln(t, E1n)) === iI((O8(), $et)) + ? (function (n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T; + for ( + a = new ME(), v = Yx(Aun(e, (gjn(), a1n)), 103), w = 0, C2(a, (!t.a && (t.a = new m_(uct, t, 10, 11)), t.a)); + 0 != a.b; + + ) + (s = Yx(0 == a.b ? null : (S$(0 != a.b), VZ(a, a.a.a)), 33)), + (iI(jln(t, XZn)) !== iI((k5(), W2n)) || + iI(jln(t, r1n)) === iI((min(), RWn)) || + iI(jln(t, r1n)) === iI((min(), xWn)) || + ny(hL(jln(t, VZn))) || + iI(jln(t, HZn)) !== iI((e9(), Izn))) && + !ny(hL(jln(s, UZn))) && + Aen(s, (Ojn(), IQn), d9(w++)), + !ny(hL(jln(s, r0n))) && + ((f = 0 != (!s.a && (s.a = new m_(uct, s, 10, 11)), s.a).i), + (b = Yan(s)), + (l = iI(jln(s, E1n)) === iI((O8(), $et))), + (g = null), + (T = !zQ(s, (Cjn(), gnt)) || _N(lL(jln(s, gnt)), CIn)) && + l && + (f || b) && + (b5((g = Wpn(s)), a1n, v), + O$(g, O0n) && Rm(new B7(ty(fL(Aun(g, O0n)))), g), + 0 != Yx(jln(s, n0n), 174).gc() && + ((h = g), SE(new SR(null, (!s.c && (s.c = new m_(oct, s, 9, 9)), new Nz(s.c, 16))), new gw(h)), cdn(s, g))), + (m = e), + (y = Yx(BF(n.a, IG(s)), 10)) && (m = y.e), + (d = Qyn(n, s, m)), + g && ((d.e = g), (g.e = d), C2(a, (!s.a && (s.a = new m_(uct, s, 10, 11)), s.a)))); + for (w = 0, VW(a, t, a.c.b, a.c); 0 != a.b; ) { + for ( + o = new UO((!(c = Yx(0 == a.b ? null : (S$(0 != a.b), VZ(a, a.a.a)), 33)).b && (c.b = new m_(nct, c, 12, 3)), c.b)); + o.e != o.i.gc(); + + ) + dgn((u = Yx(hen(o), 79))), + (iI(jln(t, XZn)) !== iI((k5(), W2n)) || + iI(jln(t, r1n)) === iI((min(), RWn)) || + iI(jln(t, r1n)) === iI((min(), xWn)) || + ny(hL(jln(t, VZn))) || + iI(jln(t, HZn)) !== iI((e9(), Izn))) && + Aen(u, (Ojn(), IQn), d9(w++)), + (j = iun(Yx(c1((!u.b && (u.b = new AN(Zrt, u, 4, 7)), u.b), 0), 82))), + (E = iun(Yx(c1((!u.c && (u.c = new AN(Zrt, u, 5, 8)), u.c), 0), 82))), + ny(hL(jln(u, r0n))) || + ny(hL(jln(j, r0n))) || + ny(hL(jln(E, r0n))) || + ((p = c), + (Whn(u) && ny(hL(jln(j, I1n))) && ny(hL(jln(u, C1n)))) || XZ(E, j) ? (p = j) : XZ(j, E) && (p = E), + (m = e), + (y = Yx(BF(n.a, p), 10)) && (m = y.e), + b5(Ijn(n, u, p, m), (Ojn(), nQn), Nwn(n, u, t, e))); + if ((l = iI(jln(c, E1n)) === iI((O8(), $et)))) + for (r = new UO((!c.a && (c.a = new m_(uct, c, 10, 11)), c.a)); r.e != r.i.gc(); ) + (T = !zQ((i = Yx(hen(r), 33)), (Cjn(), gnt)) || _N(lL(jln(i, gnt)), CIn)), + (k = iI(jln(i, E1n)) === iI($et)), + T && k && VW(a, i, a.c.b, a.c); + } + })(n, t, r) + : (function (n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b, w, d; + for (f = 0, r = new UO((!t.a && (t.a = new m_(uct, t, 10, 11)), t.a)); r.e != r.i.gc(); ) + ny(hL(jln((i = Yx(hen(r), 33)), (gjn(), r0n)))) || + ((iI(jln(t, XZn)) === iI((k5(), W2n)) && + iI(jln(t, r1n)) !== iI((min(), RWn)) && + iI(jln(t, r1n)) !== iI((min(), xWn)) && + !ny(hL(jln(t, VZn))) && + iI(jln(t, HZn)) === iI((e9(), Izn))) || + ny(hL(jln(i, UZn))) || + (Aen(i, (Ojn(), IQn), d9(f)), ++f), + Qyn(n, i, e)); + for (f = 0, s = new UO((!t.b && (t.b = new m_(nct, t, 12, 3)), t.b)); s.e != s.i.gc(); ) + (u = Yx(hen(s), 79)), + (iI(jln(t, (gjn(), XZn))) !== iI((k5(), W2n)) || + iI(jln(t, r1n)) === iI((min(), RWn)) || + iI(jln(t, r1n)) === iI((min(), xWn)) || + ny(hL(jln(t, VZn))) || + iI(jln(t, HZn)) !== iI((e9(), Izn))) && + (Aen(u, (Ojn(), IQn), d9(f)), ++f), + (w = Kun(u)), + (d = Bun(u)), + (h = ny(hL(jln(w, I1n)))), + (b = !ny(hL(jln(u, r0n)))), + (l = h && Whn(u) && ny(hL(jln(u, C1n)))), + (c = IG(w) == t && IG(w) == IG(d)), + (a = (IG(w) == t && d == t) ^ (IG(d) == t && w == t)), + b && !l && (a || c) && Ijn(n, u, t, e); + if (IG(t)) + for (o = new UO(CH(IG(t))); o.e != o.i.gc(); ) + (w = Kun((u = Yx(hen(o), 79)))) == t && + Whn(u) && + (l = ny(hL(jln(w, (gjn(), I1n)))) && ny(hL(jln(u, C1n)))) && + Ijn(n, u, t, e); + })(n, t, r), + r + ); + } + function _vn(n, t, i, r) { + var c, a, u; + if ( + ((this.j = new ip()), + (this.k = new ip()), + (this.b = new ip()), + (this.c = new ip()), + (this.e = new hC()), + (this.i = new Nv()), + (this.f = new cp()), + (this.d = new ip()), + (this.g = new ip()), + eD(this.b, n), + eD(this.b, t), + (this.e.c = e.Math.min(n.a, t.a)), + (this.e.d = e.Math.min(n.b, t.b)), + (this.e.b = e.Math.abs(n.a - t.a)), + (this.e.a = e.Math.abs(n.b - t.b)), + (c = Yx(Aun(r, (gjn(), $1n)), 74))) + ) + for (u = Ztn(c, 0); u.b != u.d.c; ) w1((a = Yx(IX(u), 8)).a, n.a) && KD(this.i, a); + i && eD(this.j, i), eD(this.k, r); + } + function Fvn(n, t, e) { + var i, r, c, a, u, o, s, h, f, l; + for ( + h = new h_(new rw(e)), x_((u = VQ(Vot, wSn, 25, n.f.e.c.length, 16, 1)), u.length), e[t.b] = 0, s = new pb(n.f.e); + s.a < s.c.c.length; + + ) + (o = Yx(Hz(s), 144)).b != t.b && (e[o.b] = Yjn), JQ(mun(h, o)); + for (; 0 != h.b.c.length; ) + for (u[(f = Yx(YJ(h), 144)).b] = !0, c = $A(new Vj(n.b, f), 0); c.c; ) + u[(l = Gin((r = Yx(WG(c), 282)), f)).b] || + ((a = O$(r, (Wrn(), AGn)) ? ty(fL(Aun(r, AGn))) : n.c), + (i = e[f.b] + a) < e[l.b] && ((e[l.b] = i), t2(h, l), JQ(mun(h, l)))); + } + function Bvn(n, t, e) { + var i, r, c, a, u, o, s, h, f; + for (r = !0, a = new pb(n.b); a.a < a.c.c.length; ) { + for (c = Yx(Hz(a), 29), s = ZTn, h = null, o = new pb(c.a); o.a < o.c.c.length; ) { + if ( + ((u = Yx(Hz(o), 10)), + (f = ty(t.p[u.p]) + ty(t.d[u.p]) - u.d.d), + (i = ty(t.p[u.p]) + ty(t.d[u.p]) + u.o.b + u.d.a), + !(f > s && i > s)) + ) { + (r = !1), e.n && LD(e, "bk node placement breaks on " + u + " which should have been after " + h); + break; + } + (h = u), (s = ty(t.p[u.p]) + ty(t.d[u.p]) + u.o.b + u.d.a); + } + if (!r) break; + } + return e.n && LD(e, t + " is feasible: " + r), r; + } + function Hvn(n, t, e, i) { + var r, c, a, u, o, s, h; + if (e.d.i != t.i) { + for ( + Al((r = new rin(n)), (bon(), Bzn)), + b5(r, (Ojn(), CQn), e), + b5(r, (gjn(), g0n), (Ran(), oit)), + i.c[i.c.length] = r, + ZG((a = new Ion()), r), + whn(a, (Ikn(), qit)), + ZG((u = new Ion()), r), + whn(u, Eit), + h = e.d, + QG(e, a), + o4((c = new jq()), e), + b5(c, $1n, null), + YG(c, u), + QG(c, h), + s = new JU(e.b, 0); + s.b < s.d.gc(); + + ) + S$(s.b < s.d.gc()), + iI(Aun((o = Yx(s.d.Xb((s.c = s.b++)), 70)), f1n)) === iI((ZZ(), aet)) && (b5(o, aQn, e), hB(s), eD(c.b, o)); + Zfn(r, a, u); + } + } + function qvn(n, t, e, i) { + var r, c, a, u, o, s; + if (e.c.i != t.i) + for ( + Al((r = new rin(n)), (bon(), Bzn)), + b5(r, (Ojn(), CQn), e), + b5(r, (gjn(), g0n), (Ran(), oit)), + i.c[i.c.length] = r, + ZG((a = new Ion()), r), + whn(a, (Ikn(), qit)), + ZG((u = new Ion()), r), + whn(u, Eit), + QG(e, a), + o4((c = new jq()), e), + b5(c, $1n, null), + YG(c, u), + QG(c, t), + Zfn(r, a, u), + s = new JU(e.b, 0); + s.b < s.d.gc(); + + ) + S$(s.b < s.d.gc()), + (o = Yx(s.d.Xb((s.c = s.b++)), 70)), + Yx(Aun(o, f1n), 272) == (ZZ(), aet) && (O$(o, aQn) || b5(o, aQn, e), hB(s), eD(c.b, o)); + } + function Gvn(n, t, i, r, c) { + var a, u, o, s, h, f, l, b, w, d, g, p, v, m; + for ( + l = new ip(), p = yW(r), g = t * n.a, w = 0, a = new Qp(), u = new Qp(), o = new ip(), v = 0, m = 0, b = 0, d = 0, h = 0, f = 0; + 0 != p.a.gc(); + + ) + (s = Z9(p, c, u)) && + (p.a.Bc(s), + (o.c[o.c.length] = s), + a.a.zc(s, a), + (w = n.f[s.p]), + (v += n.e[s.p] - w * n.b), + (m += n.c[s.p] * n.b), + (f += w * n.b), + (d += n.e[s.p])), + (!s || 0 == p.a.gc() || (v >= g && n.e[s.p] > w * n.b) || m >= i * g) && + ((l.c[l.c.length] = o), + (o = new ip()), + C2(u, a), + a.a.$b(), + (h -= f), + (b = e.Math.max(b, h * n.b + d)), + (h += m), + (v = m), + (m = 0), + (f = 0), + (d = 0)); + return new mP(b, l); + } + function zvn(n) { + var t, e, i, r, c, a, u, o, s, h, f, l; + for (e = new ub(new Zl(n.c.b).a.vc().Kc()); e.a.Ob(); ) + (u = Yx(e.a.Pb(), 42)), + null == (r = (t = Yx(u.dd(), 149)).a) && (r = ""), + !(i = EL(n.c, r)) && 0 == r.length && (i = F8(n)), + i && !V7(i.c, t, !1) && KD(i.c, t); + for (a = Ztn(n.a, 0); a.b != a.d.c; ) + (c = Yx(IX(a), 478)), (s = hV(n.c, c.a)), (l = hV(n.c, c.b)), s && l && KD(s.c, new mP(l, c.c)); + for (BH(n.a), f = Ztn(n.b, 0); f.b != f.d.c; ) + (h = Yx(IX(f), 478)), (t = jL(n.c, h.a)), (o = hV(n.c, h.b)), t && o && sT(t, o, h.c); + BH(n.b); + } + function Uvn(n) { + var t, e, i, r, c, a; + if (!n.f) { + if (((a = new Mo()), (c = new Mo()), null == (t = Hat).a.zc(n, t))) { + for (r = new UO(Iq(n)); r.e != r.i.gc(); ) jF(a, Uvn(Yx(hen(r), 26))); + t.a.Bc(n), t.a.gc(); + } + for (!n.s && (n.s = new m_(tat, n, 21, 17)), i = new UO(n.s); i.e != i.i.gc(); ) + CO((e = Yx(hen(i), 170)), 99) && fY(c, Yx(e, 18)); + B6(c), + (n.r = new ID(n, (Yx(c1(aq((YF(), gat).o), 6), 18), c.i), c.g)), + jF(a, n.r), + B6(a), + (n.f = new HI((Yx(c1(aq(gat.o), 5), 18), a.i), a.g)), + (bV(n).b &= -3); + } + return n.f; + } + function Xvn(n) { + var t, e, i, r, c, a, u, o, s, h, f, l, b, w; + for ( + a = n.o, + i = VQ(Wot, MTn, 25, a, 15, 1), + r = VQ(Wot, MTn, 25, a, 15, 1), + e = n.p, + t = VQ(Wot, MTn, 25, e, 15, 1), + c = VQ(Wot, MTn, 25, e, 15, 1), + s = 0; + s < a; + s++ + ) { + for (f = 0; f < e && !Nin(n, s, f); ) ++f; + i[s] = f; + } + for (h = 0; h < a; h++) { + for (f = e - 1; f >= 0 && !Nin(n, h, f); ) --f; + r[h] = f; + } + for (b = 0; b < e; b++) { + for (u = 0; u < a && !Nin(n, u, b); ) ++u; + t[b] = u; + } + for (w = 0; w < e; w++) { + for (u = a - 1; u >= 0 && !Nin(n, u, w); ) --u; + c[w] = u; + } + for (o = 0; o < a; o++) for (l = 0; l < e; l++) o < c[l] && o > t[l] && l < r[o] && l > i[o] && cgn(n, o, l, !1, !0); + } + function Wvn(n) { + var t, e, i, r, c, a, u, o; + (e = ny(hL(Aun(n, (Bdn(), tGn))))), + (c = n.a.c.d), + (u = n.a.d.d), + e + ? ((a = KO(yN(new QS(u.a, u.b), c), 0.5)), (o = KO(dO(n.e), 0.5)), (t = yN(mN(new QS(c.a, c.b), a), o)), x$(n.d, t)) + : ((r = ty(fL(Aun(n.a, vGn)))), + (i = n.d), + c.a >= u.a + ? c.b >= u.b + ? ((i.a = u.a + (c.a - u.a) / 2 + r), (i.b = u.b + (c.b - u.b) / 2 - r - n.e.b)) + : ((i.a = u.a + (c.a - u.a) / 2 + r), (i.b = c.b + (u.b - c.b) / 2 + r)) + : c.b >= u.b + ? ((i.a = c.a + (u.a - c.a) / 2 + r), (i.b = u.b + (c.b - u.b) / 2 + r)) + : ((i.a = c.a + (u.a - c.a) / 2 + r), (i.b = c.b + (u.b - c.b) / 2 - r - n.e.b))); + } + function Vvn(n, t) { + var e, i, r, c, a, u, o; + if (null == n) return null; + if (0 == (c = n.length)) return ""; + for ( + o = VQ(Xot, sTn, 25, c, 15, 1), YQ(0, c, n.length), YQ(0, c, o.length), aF(n, 0, c, o, 0), e = null, u = t, r = 0, a = 0; + r < c; + r++ + ) + (i = o[r]), + _jn(), + i <= 32 && 0 != (2 & bot[i]) + ? u + ? (!e && (e = new MA(n)), wq(e, r - a++)) + : ((u = t), 32 != i && (!e && (e = new MA(n)), zB(e, r - a, r - a + 1, String.fromCharCode(32)))) + : (u = !1); + return u ? (e ? ((c = e.a.length) > 0 ? l$(e.a, 0, c - 1) : "") : n.substr(0, c - 1)) : e ? e.a : n; + } + function Qvn(n) { + uT( + n, + new tun( + rk( + nk( + ik(ek(new du(), uPn), "ELK DisCo"), + "Layouter for arranging unconnected subgraphs. The subgraphs themselves are, by default, not laid out.", + ), + new at(), + ), + ), + ), + DU(n, uPn, oPn, oen(Rqn)), + DU(n, uPn, sPn, oen(Aqn)), + DU(n, uPn, hPn, oen(Sqn)), + DU(n, uPn, fPn, oen($qn)), + DU(n, uPn, oSn, oen(xqn)), + DU(n, uPn, sSn, oen(Nqn)), + DU(n, uPn, uSn, oen(Dqn)), + DU(n, uPn, hSn, oen(Lqn)), + DU(n, uPn, ePn, oen(Iqn)), + DU(n, uPn, iPn, oen(Pqn)), + DU(n, uPn, rPn, oen(Cqn)), + DU(n, uPn, cPn, oen(Oqn)); + } + function Yvn(n, t, e, i) { + var r, c, a, u, o, s, h; + if ((Al((c = new rin(n)), (bon(), qzn)), b5(c, (gjn(), g0n), (Ran(), oit)), (r = 0), t)) { + for ( + b5((a = new Ion()), (Ojn(), CQn), t), b5(c, CQn, t.i), whn(a, (Ikn(), qit)), ZG(a, c), s = 0, h = (o = CU(t.e)).length; + s < h; + ++s + ) + QG(o[s], a); + b5(t, RQn, c), ++r; + } + if (e) { + for ( + u = new Ion(), b5(c, (Ojn(), CQn), e.i), b5(u, CQn, e), whn(u, (Ikn(), Eit)), ZG(u, c), s = 0, h = (o = CU(e.g)).length; + s < h; + ++s + ) + YG(o[s], u); + b5(e, RQn, c), ++r; + } + return b5(c, (Ojn(), tQn), d9(r)), (i.c[i.c.length] = c), c; + } + function Jvn() { + (Jvn = O), + (zrt = x4(Gy(Xot, 1), sTn, 25, 15, [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70])), + (Urt = new RegExp("[ \t\n\r\f]+")); + try { + Grt = x4(Gy(Yat, 1), iEn, 2015, 0, [ + new Bg((UC(), Tnn("yyyy-MM-dd'T'HH:mm:ss'.'SSSZ", XL((my(), my(), m_n))))), + new Bg(Tnn("yyyy-MM-dd'T'HH:mm:ss'.'SSS", XL(m_n))), + new Bg(Tnn("yyyy-MM-dd'T'HH:mm:ss", XL(m_n))), + new Bg(Tnn("yyyy-MM-dd'T'HH:mm", XL(m_n))), + new Bg(Tnn("yyyy-MM-dd", XL(m_n))), + ]); + } catch (n) { + if (!CO((n = j4(n)), 78)) throw hp(n); + } + } + function Zvn(n, t, i, r) { + var c, a, u, o, s, h, f, l, b; + return ( + (h = (s = yN(new QS(i.a, i.b), n)).a * t.b - s.b * t.a), + (f = t.a * r.b - t.b * r.a), + (l = (s.a * r.b - s.b * r.a) / f), + (b = h / f), + 0 == f + ? 0 == h + ? ((a = cY(n, (c = mN(new QS(i.a, i.b), KO(new QS(r.a, r.b), 0.5))))), + (u = cY(mN(new QS(n.a, n.b), t), c)), + (o = 0.5 * e.Math.sqrt(r.a * r.a + r.b * r.b)), + a < u && a <= o ? new QS(n.a, n.b) : u <= o ? mN(new QS(n.a, n.b), t) : null) + : null + : l >= 0 && l <= 1 && b >= 0 && b <= 1 + ? mN(new QS(n.a, n.b), KO(new QS(t.a, t.b), l)) + : null + ); + } + function nmn(n) { + var t, i, r, c, a, u, o, s, h, f; + for (s = new Jl(new Yl(Tfn(n)).a.vc().Kc()); s.a.Ob(); ) { + for ( + r = Yx(s.a.Pb(), 42), h = 0, f = 0, h = (o = Yx(r.cd(), 10)).d.d, f = o.o.b + o.d.a, n.d[o.p] = 0, t = o; + (c = n.a[t.p]) != o; + + ) + (i = jtn(t, c)), + 0, + (u = n.c == (Jq(), w4n) ? i.d.n.b + i.d.a.b - i.c.n.b - i.c.a.b : i.c.n.b + i.c.a.b - i.d.n.b - i.d.a.b), + (a = ty(n.d[t.p]) + u), + (n.d[c.p] = a), + (h = e.Math.max(h, c.d.d - a)), + (f = e.Math.max(f, a + c.o.b + c.d.a)), + (t = c); + t = o; + do { + (n.d[t.p] = ty(n.d[t.p]) + h), (t = n.a[t.p]); + } while (t != o); + n.b[o.p] = h + f; + } + } + function tmn(n) { + var t, i, r, c, a, u, o, s, h, f, l; + for (n.b = !1, f = JTn, o = ZTn, l = JTn, s = ZTn, i = n.e.a.ec().Kc(); i.Ob(); ) + for ( + r = (t = Yx(i.Pb(), 266)).a, + f = e.Math.min(f, r.c), + o = e.Math.max(o, r.c + r.b), + l = e.Math.min(l, r.d), + s = e.Math.max(s, r.d + r.a), + a = new pb(t.c); + a.a < a.c.c.length; + + ) + (c = Yx(Hz(a), 395)).a.a + ? ((u = (h = r.d + c.b.b) + c.c), (l = e.Math.min(l, h)), (s = e.Math.max(s, u))) + : ((u = (h = r.c + c.b.a) + c.c), (f = e.Math.min(f, h)), (o = e.Math.max(o, u))); + (n.a = new QS(o - f, s - l)), (n.c = new QS(f + n.d.a, l + n.d.b)); + } + function emn(n) { + var t, e, i, r, c, a; + if (!n.a) { + if (((n.o = null), (a = new _g(n)), (t = new So()), null == (e = Hat).a.zc(n, e))) { + for (c = new UO(Iq(n)); c.e != c.i.gc(); ) jF(a, emn(Yx(hen(c), 26))); + e.a.Bc(n), e.a.gc(); + } + for (!n.s && (n.s = new m_(tat, n, 21, 17)), r = new UO(n.s); r.e != r.i.gc(); ) + CO((i = Yx(hen(r), 170)), 322) && fY(t, Yx(i, 34)); + B6(t), + (n.k = new PD(n, (Yx(c1(aq((YF(), gat).o), 7), 18), t.i), t.g)), + jF(a, n.k), + B6(a), + (n.a = new HI((Yx(c1(aq(gat.o), 4), 18), a.i), a.g)), + (bV(n).b &= -2); + } + return n.a; + } + function imn(n, t, e, i, r, c, a) { + var u, o, s, h, f; + return ( + (h = !1), + (u = Bbn(e.q, t.f + t.b - e.q.f)), + !((f = r - (e.q.e + u - a)) < i.g) && + ((o = c == n.c.length - 1 && f >= ($z(c, n.c.length), Yx(n.c[c], 200)).e), + !((s = omn(i, f, !1).a) > t.b && !o) && + ((o || s <= t.b) && + (o && s > t.b ? ((e.d = s), pY(e, Don(e, s))) : (san(e.q, u), (e.c = !0)), + pY(i, r - (e.s + e.r)), + Qen(i, e.q.e + e.q.d, t.f), + c0(t, i), + n.c.length > c && + (acn(($z(c, n.c.length), Yx(n.c[c], 200)), i), 0 == ($z(c, n.c.length), Yx(n.c[c], 200)).a.c.length && KV(n, c)), + (h = !0)), + h)) + ); + } + function rmn(n, t, e, i) { + var r, c, a, u, o, s, h; + if (((h = dwn(n.e.Tg(), t)), (r = 0), (c = Yx(n.g, 119)), (o = null), TT(), Yx(t, 66).Oj())) { + for (u = 0; u < n.i; ++u) + if (((a = c[u]), h.rl(a.ak()))) { + if (Q8(a, e)) { + o = a; + break; + } + ++r; + } + } else if (null != e) { + for (u = 0; u < n.i; ++u) + if (((a = c[u]), h.rl(a.ak()))) { + if (Q8(e, a.dd())) { + o = a; + break; + } + ++r; + } + } else + for (u = 0; u < n.i; ++u) + if (((a = c[u]), h.rl(a.ak()))) { + if (null == a.dd()) { + o = a; + break; + } + ++r; + } + return ( + o && + (gC(n.e) && + ((s = t.$j() ? new oW(n.e, 4, t, e, null, r, !0) : Kq(n, t.Kj() ? 2 : 1, t, e, t.zj(), -1, !0)), i ? i.Ei(s) : (i = s)), + (i = Lgn(n, o, i))), + i + ); + } + function cmn(n, t, i, r, c, a, u) { + var o, s, h, f, l, b, w, d; + switch (((w = 0), (d = 0), (s = c.c), (o = c.b), (f = i.f), (b = i.g), t.g)) { + case 0: + (w = r.i + r.g + u), + (d = n.c + ? (function (n, t, e, i) { + var r, c, a, u, o; + for (c = null, r = 0, u = new pb(t); u.a < u.c.c.length; ) + (o = (a = Yx(Hz(u), 33)).j + a.f), + n < a.i + a.g + i && (c ? e.j - o < e.j - r && (c = a) : (c = a), (r = c.j + c.f)); + return c ? r + i : 0; + })(w, a, r, u) + : r.j), + (l = e.Math.max(s, w + b)), + (h = e.Math.max(o, d + f)); + break; + case 1: + (d = r.j + r.f + u), + (w = n.c + ? (function (n, t, e, i) { + var r, c, a, u, o; + for (r = null, c = 0, u = new pb(t); u.a < u.c.c.length; ) + (o = (a = Yx(Hz(u), 33)).i + a.g), + n < a.j + a.f + i && (r ? e.i - o < e.i - c && (r = a) : (r = a), (c = r.i + r.g)); + return r ? c + i : 0; + })(d, a, r, u) + : r.i), + (l = e.Math.max(s, w + b)), + (h = e.Math.max(o, d + f)); + break; + case 2: + (w = s + u), (d = 0), (l = s + u + b), (h = e.Math.max(o, f)); + break; + case 3: + (w = 0), (d = o + u), (l = e.Math.max(s, b)), (h = o + u + f); + break; + default: + throw hp(new Qm("IllegalPlacementOption.")); + } + return new F7(n.a, l, h, t, w, d); + } + function amn(n, t, e, i) { + var r, c, a, u, o, s; + if (((o = dwn(n.e.Tg(), t)), (c = Yx(n.g, 119)), Lwn(n.e, t))) { + for (r = 0, u = 0; u < n.i; ++u) + if (((a = c[u]), o.rl(a.ak()))) { + if (r == e) + return ( + TT(), + Yx(t, 66).Oj() + ? a + : (null != (s = a.dd()) && i && CO(t, 99) && 0 != (Yx(t, 18).Bb & eMn) && (s = qhn(n, t, u, r, s)), s) + ); + ++r; + } + throw hp(new Hm(pDn + e + Exn + r)); + } + for (r = 0, u = 0; u < n.i; ++u) { + if (((a = c[u]), o.rl(a.ak()))) + return ( + TT(), + Yx(t, 66).Oj() ? a : (null != (s = a.dd()) && i && CO(t, 99) && 0 != (Yx(t, 18).Bb & eMn) && (s = qhn(n, t, u, r, s)), s) + ); + ++r; + } + return t.zj(); + } + function umn(n, t, e) { + var i, r, c, a, u, o, s, h; + if (((r = Yx(n.g, 119)), Lwn(n.e, t))) return TT(), Yx(t, 66).Oj() ? new cR(t, n) : new VP(t, n); + for (s = dwn(n.e.Tg(), t), i = 0, u = 0; u < n.i; ++u) { + if (((a = (c = r[u]).ak()), s.rl(a))) { + if ((TT(), Yx(t, 66).Oj())) return c; + if (a == (dfn(), Put) || a == Tut) { + for (o = new SA(I7(c.dd())); ++u < n.i; ) ((a = (c = r[u]).ak()) == Put || a == Tut) && yI(o, I7(c.dd())); + return DN(Yx(t.Yj(), 148), o.a); + } + return null != (h = c.dd()) && e && CO(t, 99) && 0 != (Yx(t, 18).Bb & eMn) && (h = qhn(n, t, u, i, h)), h; + } + ++i; + } + return t.zj(); + } + function omn(n, t, i) { + var r, c, a, u, o, s, h, f, l, b; + for ( + a = 0, + u = n.t, + c = 0, + r = 0, + s = 0, + b = 0, + l = 0, + i && ((n.n.c = VQ(UKn, iEn, 1, 0, 5, 1)), eD(n.n, new gG(n.s, n.t, n.i))), + o = 0, + f = new pb(n.b); + f.a < f.c.c.length; + + ) + a + (h = Yx(Hz(f), 33)).g + (o > 0 ? n.i : 0) > t && + s > 0 && + ((a = 0), + (u += s + n.i), + (c = e.Math.max(c, b)), + (r += s + n.i), + (s = 0), + (b = 0), + i && (++l, eD(n.n, new gG(n.s, u, n.i))), + (o = 0)), + (b += h.g + (o > 0 ? n.i : 0)), + (s = e.Math.max(s, h.f)), + i && Cin(Yx(TR(n.n, l), 211), h), + (a += h.g + (o > 0 ? n.i : 0)), + ++o; + return (c = e.Math.max(c, b)), (r += s), i && ((n.r = c), (n.d = r), Trn(n.j)), new mH(n.s, n.t, c, r); + } + function smn(n, t, e, i, r) { + var c, a, u, o, s, h, f, l, b; + if ( + (oE(), + B_(n, "src"), + B_(e, "dest"), + (l = V5(n)), + (o = V5(e)), + kD(0 != (4 & l.i), "srcType is not an array"), + kD(0 != (4 & o.i), "destType is not an array"), + (f = l.c), + (a = o.c), + kD(0 != (1 & f.i) ? f == a : 0 == (1 & a.i), "Array types don't match"), + (b = n.length), + (s = e.length), + t < 0 || i < 0 || r < 0 || t + r > b || i + r > s) + ) + throw hp(new Cp()); + if (0 == (1 & f.i) && l != o) + if (((h = h1(n)), (c = h1(e)), iI(n) === iI(e) && t < i)) for (t += r, u = i + r; u-- > i; ) DF(c, u, h[--t]); + else for (u = i + r; i < u; ) DF(c, i++, h[t++]); + else r > 0 && hhn(n, t, e, i, r, !0); + } + function hmn() { + (hmn = O), + (mFn = x4(Gy(Wot, 1), MTn, 25, 15, [ + nTn, + 1162261467, + zEn, + 1220703125, + 362797056, + 1977326743, + zEn, + 387420489, + UTn, + 214358881, + 429981696, + 815730721, + 1475789056, + 170859375, + 268435456, + 410338673, + 612220032, + 893871739, + 128e7, + 1801088541, + 113379904, + 148035889, + 191102976, + 244140625, + 308915776, + 387420489, + 481890304, + 594823321, + 729e6, + 887503681, + zEn, + 1291467969, + 1544804416, + 1838265625, + 60466176, + ])), + (yFn = x4( + Gy(Wot, 1), + MTn, + 25, + 15, + [-1, -1, 31, 19, 15, 13, 11, 11, 10, 9, 9, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5], + )); + } + function fmn(n, t) { + var e, i, r, c, a; + if (((a = Yx(t, 136)), xln(n), xln(a), null != a.b)) { + if (((n.c = !0), null == n.b)) return (n.b = VQ(Wot, MTn, 25, a.b.length, 15, 1)), void smn(a.b, 0, n.b, 0, a.b.length); + for (c = VQ(Wot, MTn, 25, n.b.length + a.b.length, 15, 1), e = 0, i = 0, r = 0; e < n.b.length || i < a.b.length; ) + e >= n.b.length + ? ((c[r++] = a.b[i++]), (c[r++] = a.b[i++])) + : i >= a.b.length + ? ((c[r++] = n.b[e++]), (c[r++] = n.b[e++])) + : a.b[i] < n.b[e] || (a.b[i] === n.b[e] && a.b[i + 1] < n.b[e + 1]) + ? ((c[r++] = a.b[i++]), (c[r++] = a.b[i++])) + : ((c[r++] = n.b[e++]), (c[r++] = n.b[e++])); + n.b = c; + } + } + function lmn(n, t) { + var e, i, r, c, a, u, o, s, h, f; + return ( + (e = ny(hL(Aun(n, (Ojn(), EQn))))), + (u = ny(hL(Aun(t, EQn)))), + (i = Yx(Aun(n, TQn), 11)), + (o = Yx(Aun(t, TQn), 11)), + (r = Yx(Aun(n, MQn), 11)), + (s = Yx(Aun(t, MQn), 11)), + (h = !!i && i == o), + (f = !!r && r == s), + e || u + ? ((c = (!ny(hL(Aun(n, EQn))) || ny(hL(Aun(n, jQn)))) && (!ny(hL(Aun(t, EQn))) || ny(hL(Aun(t, jQn))))), + (a = !((ny(hL(Aun(n, EQn))) && ny(hL(Aun(n, jQn)))) || (ny(hL(Aun(t, EQn))) && ny(hL(Aun(t, jQn)))))), + new Sx((h && c) || (f && a), h, f)) + : new Sx(Yx(Hz(new pb(n.j)), 11).p == Yx(Hz(new pb(t.j)), 11).p, h, f) + ); + } + function bmn(n) { + var t, e, i, r; + return 0 != (64 & n.Db) + ? V9(n) + : ((t = new SA(hNn)), + (i = n.k) + ? yI(yI(((t.a += ' "'), t), i), '"') + : (!n.n && (n.n = new m_(act, n, 1, 7)), + n.n.i > 0 && + (!(r = (!n.n && (n.n = new m_(act, n, 1, 7)), Yx(c1(n.n, 0), 137)).a) || yI(yI(((t.a += ' "'), t), r), '"'))), + !n.b && (n.b = new AN(Zrt, n, 4, 7)), + (e = !(n.b.i <= 1 && (!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c.i <= 1))), + (t.a += e ? " [" : " "), + yI(t, lA(new Ty(), new UO(n.b))), + e && (t.a += "]"), + (t.a += pIn), + e && (t.a += "["), + yI(t, lA(new Ty(), new UO(n.c))), + e && (t.a += "]"), + t.a); + } + function wmn(n, t) { + var e, i, r, c, a, u, o; + if (n.a) { + if ( + ((o = null), + null != (u = n.a.ne()) + ? (t.a += "" + u) + : null != (a = n.a.Dj()) && + (-1 != (c = VI(a, gun(91))) + ? ((o = a.substr(c)), (t.a += "" + l$(null == a ? aEn : (vB(a), a), 0, c))) + : (t.a += "" + a)), + n.d && 0 != n.d.i) + ) { + for (r = !0, t.a += "<", i = new UO(n.d); i.e != i.i.gc(); ) (e = Yx(hen(i), 87)), r ? (r = !1) : (t.a += tEn), wmn(e, t); + t.a += ">"; + } + null != o && (t.a += "" + o); + } else + n.e + ? null != (u = n.e.zb) && (t.a += "" + u) + : ((t.a += "?"), n.b ? ((t.a += " super "), wmn(n.b, t)) : n.f && ((t.a += " extends "), wmn(n.f, t))); + } + function dmn(n, t, e, i) { + var r, c, a, u, o, s; + if (((c = X9(i)), (!ny(hL(Aun(i, (gjn(), q1n)))) && !ny(hL(Aun(n, P1n)))) || dC(Yx(Aun(n, g0n), 98)))) + switch ( + (ZG((u = new Ion()), n), + t + ? (((s = u.n).a = t.a - n.n.a), (s.b = t.b - n.n.b), Hon(s, 0, 0, n.o.a, n.o.b), whn(u, Tpn(u, c))) + : ((r = G7(c)), whn(u, e == (h0(), i3n) ? r : O9(r))), + (a = Yx(Aun(i, (Ojn(), bQn)), 21)), + (o = u.j), + c.g) + ) { + case 2: + case 1: + (o == (Ikn(), Tit) || o == Bit) && a.Fc((edn(), OVn)); + break; + case 4: + case 3: + (o == (Ikn(), Eit) || o == qit) && a.Fc((edn(), OVn)); + } + else (r = G7(c)), (u = vpn(n, e, e == (h0(), i3n) ? r : O9(r))); + return u; + } + function gmn(n, t, i) { + var r, c, a, u, o, s, h; + return e.Math.abs(t.s - t.c) < PPn || e.Math.abs(i.s - i.c) < PPn + ? 0 + : ((r = own(n, t.j, i.e)), + (c = own(n, i.j, t.e)), + (a = 0), + -1 == r || -1 == c + ? (-1 == r && (new wz((iQ(), K4n), i, t, 1), ++a), -1 == c && (new wz((iQ(), K4n), t, i, 1), ++a)) + : ((u = G8(t.j, i.s, i.c)), + (u += G8(i.e, t.s, t.c)), + (o = G8(i.j, t.s, t.c)), + (s = r + 16 * u) < (h = c + 16 * (o += G8(t.e, i.s, i.c))) + ? new wz((iQ(), _4n), t, i, h - s) + : s > h + ? new wz((iQ(), _4n), i, t, s - h) + : s > 0 && h > 0 && (new wz((iQ(), _4n), t, i, 0), new wz(_4n, i, t, 0))), + a); + } + function pmn(n, t) { + var i, r, c, a, u; + for (u = new t6(new Ql(n.f.b).a); u.b; ) { + if (((c = Yx((a = s1(u)).cd(), 594)), 1 == t)) { + if (c.gf() != (t9(), eet) && c.gf() != Jtt) continue; + } else if (c.gf() != (t9(), Ztt) && c.gf() != net) continue; + switch (((r = Yx(Yx(a.dd(), 46).b, 81)), (i = Yx(Yx(a.dd(), 46).a, 189).c), c.gf().g)) { + case 2: + (r.g.c = n.e.a), (r.g.b = e.Math.max(1, r.g.b + i)); + break; + case 1: + (r.g.c = r.g.c + i), (r.g.b = e.Math.max(1, r.g.b - i)); + break; + case 4: + (r.g.d = n.e.b), (r.g.a = e.Math.max(1, r.g.a + i)); + break; + case 3: + (r.g.d = r.g.d + i), (r.g.a = e.Math.max(1, r.g.a - i)); + } + } + } + function vmn(n, t) { + var e, i, r, c, a, u, o, s, f, l, b; + for (i = new $K(bA(lbn(t).a.Kc(), new h())); Vfn(i); ) + CO(c1((!(e = Yx(kV(i), 79)).b && (e.b = new AN(Zrt, e, 4, 7)), e.b), 0), 186) || + ((o = iun(Yx(c1((!e.c && (e.c = new AN(Zrt, e, 5, 8)), e.c), 0), 82))), + Rfn(e) || + ((a = t.i + t.g / 2), + (u = t.j + t.f / 2), + (f = o.i + o.g / 2), + (l = o.j + o.f / 2), + ((b = new Pk()).a = f - a), + (b.b = l - u), + Ecn((c = new QS(b.a, b.b)), t.g, t.f), + (b.a -= c.a), + (b.b -= c.b), + (a = f - b.a), + (u = l - b.b), + Ecn((s = new QS(b.a, b.b)), o.g, o.f), + (b.a -= s.a), + (b.b -= s.b), + (f = a + b.a), + (l = u + b.b), + x1((r = Ywn(e, !0, !0)), a), + R1(r, u), + O1(r, f), + D1(r, l), + vmn(n, o))); + } + function mmn(n) { + uT( + n, + new tun( + rk( + nk( + ik(ek(new du(), J$n), "ELK SPOrE Compaction"), + "ShrinkTree is a compaction algorithm that maintains the topology of a layout. The relocation of diagram elements is based on contracting a spanning tree.", + ), + new tu(), + ), + ), + ), + DU(n, J$n, Z$n, oen(x9n)), + DU(n, J$n, nLn, oen($9n)), + DU(n, J$n, tLn, oen(A9n)), + DU(n, J$n, eLn, oen(C9n)), + DU(n, J$n, iLn, oen(O9n)), + DU(n, J$n, fPn, I9n), + DU(n, J$n, LPn, 8), + DU(n, J$n, rLn, oen(N9n)), + DU(n, J$n, cLn, oen(T9n)), + DU(n, J$n, aLn, oen(M9n)), + DU(n, J$n, oAn, (TA(), !1)); + } + function ymn(n, t, e) { + var i, r, c, a, u, o, s, h; + return ( + (i = n.a.o == (RG(), m4n) ? JTn : ZTn), + !(u = xpn(n, new TS(t, e))).a && u.c + ? (KD(n.d, u), i) + : u.a + ? ((r = u.a.c), + (o = u.a.d), + e + ? ((s = n.a.c == (Jq(), d4n) ? o : r), + (c = n.a.c == d4n ? r : o), + (a = n.a.g[c.i.p]), + (h = ty(n.a.p[a.p]) + ty(n.a.d[c.i.p]) + c.n.b + c.a.b - ty(n.a.d[s.i.p]) - s.n.b - s.a.b)) + : ((s = n.a.c == (Jq(), w4n) ? o : r), + (c = n.a.c == w4n ? r : o), + (h = ty(n.a.p[n.a.g[c.i.p].p]) + ty(n.a.d[c.i.p]) + c.n.b + c.a.b - ty(n.a.d[s.i.p]) - s.n.b - s.a.b)), + (n.a.n[n.a.g[r.i.p].p] = (TA(), !0)), + (n.a.n[n.a.g[o.i.p].p] = !0), + h) + : i + ); + } + function kmn(n, t, e) { + var i, r, c, a, u, o, s; + if (Lwn(n.e, t)) TT(), kfn((u = Yx(t, 66).Oj() ? new cR(t, n) : new VP(t, n)).c, u.b), TO(u, Yx(e, 14)); + else { + for (s = dwn(n.e.Tg(), t), i = Yx(n.g, 119), c = 0; c < n.i; ++c) + if (((r = i[c].ak()), s.rl(r))) { + if (r == (dfn(), Put) || r == Tut) { + for (a = c, (o = ein(n, t, e)) ? tdn(n, c) : ++c; c < n.i; ) (r = i[c].ak()) == Put || r == Tut ? tdn(n, c) : ++c; + o || Yx(Ken(n, a, VX(t, e)), 72); + } else ein(n, t, e) ? tdn(n, c) : Yx(Ken(n, c, (TT(), Yx(t, 66).Oj() ? Yx(e, 72) : VX(t, e))), 72); + return; + } + ein(n, t, e) || fY(n, (TT(), Yx(t, 66).Oj() ? Yx(e, 72) : VX(t, e))); + } + } + function jmn(n, t, e) { + var i, r, c, a, u, o, s, h; + return ( + Q8(e, n.b) || + ((n.b = e), + (c = new Jn()), + (a = Yx( + kW( + fH(new SR(null, new Nz(e.f, 16)), c), + kJ(new Q(), new Y(), new cn(), new an(), x4(Gy(wBn, 1), XEn, 132, 0, [(C6(), uBn), aBn])), + ), + 21, + )), + (n.e = !0), + (n.f = !0), + (n.c = !0), + (n.d = !0), + (r = a.Hc((Sen(), tqn))), + (i = a.Hc(eqn)), + r && !i && (n.f = !1), + !r && i && (n.d = !1), + (r = a.Hc(nqn)), + (i = a.Hc(iqn)), + r && !i && (n.c = !1), + !r && i && (n.e = !1)), + (h = Yx(n.a.Ce(t, e), 46)), + (o = Yx(h.a, 19).a), + (s = Yx(h.b, 19).a), + (u = !1), + o < 0 ? n.c || (u = !0) : n.e || (u = !0), + s < 0 ? n.d || (u = !0) : n.f || (u = !0), + u ? jmn(n, h, e) : h + ); + } + function Emn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b; + for (h = 0; h < t.length; h++) { + for (a = n.Kc(); a.Ob(); ) Yx(a.Pb(), 225).Of(h, t); + for (f = 0; f < t[h].length; f++) { + for (u = n.Kc(); u.Ob(); ) Yx(u.Pb(), 225).Pf(h, f, t); + for (b = t[h][f].j, l = 0; l < b.c.length; l++) { + for (o = n.Kc(); o.Ob(); ) Yx(o.Pb(), 225).Qf(h, f, l, t); + for ($z(l, b.c.length), e = 0, r = new UV(Yx(b.c[l], 11).b); ZC(r.a) || ZC(r.b); ) + for (i = Yx(ZC(r.a) ? Hz(r.a) : Hz(r.b), 17), s = n.Kc(); s.Ob(); ) Yx(s.Pb(), 225).Nf(h, f, l, e++, i, t); + } + } + } + for (c = n.Kc(); c.Ob(); ) Yx(c.Pb(), 225).Mf(); + } + function Tmn(n, t) { + var e, i, r, c, a; + for ( + n.b = ty(fL(Aun(t, (gjn(), x0n)))), + n.c = ty(fL(Aun(t, K0n))), + n.d = Yx(Aun(t, v1n), 336), + n.a = Yx(Aun(t, BZn), 275), + (function (n) { + var t, e, i; + for (e = new pb(n.b); e.a < e.c.c.length; ) + for (t = 0, i = new pb(Yx(Hz(e), 29).a); i.a < i.c.c.length; ) Yx(Hz(i), 10).p = t++; + })(t), + r = (c = Yx( + kW( + hH(hH(WJ(WJ(new SR(null, new Nz(t.b, 16)), new ye()), new ke()), new je()), new Ee()), + mY(new H(), new B(), new rn(), x4(Gy(wBn, 1), XEn, 132, 0, [(C6(), aBn)])), + ), + 15, + )).Kc(); + r.Ob(); + + ) + (e = Yx(r.Pb(), 17)), Yx(Aun(e, (Ojn(), WQn)), 15).Jc(new Mw(n)), b5(e, WQn, null); + for (i = c.Kc(); i.Ob(); ) + (e = Yx(i.Pb(), 17)), (a = Yx(Aun(e, (Ojn(), VQn)), 17)), wjn(n, Yx(Aun(e, UQn), 15), a), b5(e, UQn, null); + } + function Mmn(n) { + var t, e, i, r, c; + if (n.k != (bon(), Hzn)) return !1; + if (n.j.c.length <= 1) return !1; + if (Yx(Aun(n, (gjn(), g0n)), 98) == (Ran(), oit)) return !1; + if ((Hen(), (i = (n.q ? n.q : (XH(), XH(), MFn))._b(Y1n) ? Yx(Aun(n, Y1n), 197) : Yx(Aun(dB(n), J1n), 197)) == S2n)) return !1; + if (i != M2n && i != T2n) { + if ( + ((r = ty(fL(pnn(n, W0n)))), + !(t = Yx(Aun(n, X0n), 142)) && (t = new pN(r, r, r, r)), + (c = i7(n, (Ikn(), qit))), + t.d + t.a + (c.gc() - 1) * r > n.o.b) + ) + return !1; + if (((e = i7(n, Eit)), t.d + t.a + (e.gc() - 1) * r > n.o.b)) return !1; + } + return !0; + } + function Smn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w; + if (((a = n.e), (o = t.e), 0 == a)) return t; + if (0 == o) return n; + if ((c = n.d) + (u = t.d) == 2) + return ( + (e = Gz(n.a[0], uMn)), + (i = Gz(t.a[0], uMn)), + a == o + ? ((w = WR((h = t7(e, i)))), 0 == (b = WR(UK(h, 32))) ? new wQ(a, w) : new C_(a, 2, x4(Gy(Wot, 1), MTn, 25, 15, [w, b]))) + : Utn(a < 0 ? n7(i, e) : n7(e, i)) + ); + if (a == o) (l = a), (f = c >= u ? WQ(n.a, c, t.a, u) : WQ(t.a, u, n.a, c)); + else { + if (0 == (r = c != u ? (c > u ? 1 : -1) : w6(n.a, t.a, c))) return bdn(), pFn; + 1 == r ? ((l = a), (f = GV(n.a, c, t.a, u))) : ((l = o), (f = GV(t.a, u, n.a, c))); + } + return SU((s = new C_(l, f.length, f))), s; + } + function Pmn(n, t, i, r, c, a, u) { + var o, s, h, f, l, b, w; + return ( + (l = ny(hL(Aun(t, (gjn(), G1n))))), + (b = null), + a == (h0(), e3n) && r.c.i == i ? (b = r.c) : a == i3n && r.d.i == i && (b = r.d), + (h = u) && l && !b + ? (eD(h.e, r), (w = e.Math.max(ty(fL(Aun(h.d, y1n))), ty(fL(Aun(r, y1n))))), b5(h.d, y1n, w)) + : (Ikn(), + (f = Hit), + b ? (f = b.j) : dC(Yx(Aun(i, g0n), 98)) && (f = a == e3n ? qit : Eit), + (s = (function (n, t, e, i, r, c) { + var a, u, o, s, h, f; + return ( + (a = null), + (s = i == (h0(), e3n) ? c.c : c.d), + (o = X9(t)), + s.i == e + ? (a = Yx(BF(n.b, s), 10)) || + (b5( + (a = Jkn( + s, + Yx(Aun(e, (gjn(), g0n)), 98), + r, + (function (n) { + var t, e, i, r, c, a, u, o, s, h, f, l; + for (r = ny(hL(Aun((u = n.i), (gjn(), I1n)))), h = 0, i = 0, s = new pb(n.g); s.a < s.c.c.length; ) + (c = (a = ZW((o = Yx(Hz(s), 17)))) && r && ny(hL(Aun(o, C1n)))), + (l = o.d.i), + a && c ? ++i : a && !c ? ++h : dB(l).e == u ? ++i : ++h; + for (e = new pb(n.e); e.a < e.c.c.length; ) + (c = (a = ZW((t = Yx(Hz(e), 17)))) && r && ny(hL(Aun(t, C1n)))), + (f = t.c.i), + a && c ? ++h : a && !c ? ++i : dB(f).e == u ? ++h : ++i; + return h - i; + })(s), + null, + s.n, + s.o, + o, + t, + )), + (Ojn(), CQn), + s, + ), + xB(n.b, s, a)) + : ((u = (function (n, t, e) { + var i, r; + switch (((i = X9(dB(t))), ZG((r = new Ion()), t), e.g)) { + case 1: + whn(r, O9(G7(i))); + break; + case 2: + whn(r, G7(i)); + } + return b5(r, (gjn(), d0n), fL(Aun(n, d0n))), r; + })( + (a = Jkn( + ((h = new Zn()), (f = ty(fL(Aun(t, (gjn(), N0n)))) / 2), l5(h, d0n, f), h), + Yx(Aun(e, g0n), 98), + r, + i == e3n ? -1 : 1, + null, + new Pk(), + new QS(0, 0), + o, + t, + )), + e, + i, + )), + b5(a, (Ojn(), CQn), u), + xB(n.b, u, a)), + Yx(Aun(t, (Ojn(), bQn)), 21).Fc((edn(), SVn)), + dC(Yx(Aun(t, (gjn(), g0n)), 98)) ? b5(t, g0n, (Ran(), hit)) : b5(t, g0n, (Ran(), fit)), + a + ); + })(n, t, i, a, f, r)), + (o = EV((dB(i), r))), + a == e3n ? (YG(o, Yx(TR(s.j, 0), 11)), QG(o, c)) : (YG(o, c), QG(o, Yx(TR(s.j, 0), 11))), + (h = new c9(r, o, s, Yx(Aun(s, (Ojn(), CQn)), 11), a, !b))), + Qhn(n.a, r, new jx(h.d, t, a)), + h + ); + } + function Imn(n, t) { + var e, i, r, c, a, u, o, s, h, f; + if (((h = null), n.d && (h = Yx(aG(n.d, t), 138)), !h)) { + if (((f = (c = n.a.Mh()).i), !n.d || hE(n.d) != f)) { + for (o = new rp(), n.d && i3(o, n.d), u = s = o.f.c + o.g.c; u < f; ++u) + (i = Yx(c1(c, u), 138)), + (e = Yx(null == (r = U8(n.e, i).ne()) ? Ysn(o.f, null, i) : r7(o.g, r, i), 138)) && + e != i && + (null == r ? Ysn(o.f, null, e) : r7(o.g, r, e)); + if (o.f.c + o.g.c != f) + for (a = 0; a < s; ++a) + (i = Yx(c1(c, a), 138)), + (e = Yx(null == (r = U8(n.e, i).ne()) ? Ysn(o.f, null, i) : r7(o.g, r, i), 138)) && + e != i && + (null == r ? Ysn(o.f, null, e) : r7(o.g, r, e)); + n.d = o; + } + h = Yx(aG(n.d, t), 138); + } + return h; + } + function Cmn() { + var n; + (Cmn = O), + (Kct = new _v()), + (Dct = VQ(fFn, TEn, 2, 0, 6, 1)), + (Bct = zz(X4(33, 58), X4(1, 26))), + (Hct = zz(X4(97, 122), X4(65, 90))), + (qct = X4(48, 57)), + (_ct = zz(Bct, 0)), + (Fct = zz(Hct, qct)), + (Gct = zz(zz(0, X4(1, 6)), X4(33, 38))), + (zct = zz(zz(qct, X4(65, 70)), X4(97, 102))), + (Qct = zz(_ct, ren("-_.!~*'()"))), + (Yct = zz(Fct, lnn("-_.!~*'()"))), + ren(jDn), + lnn(jDn), + zz(Qct, ren(";:@&=+$,")), + zz(Yct, lnn(";:@&=+$,")), + (Uct = ren(":/?#")), + (Xct = lnn(":/?#")), + (Wct = ren("/?#")), + (Vct = lnn("/?#")), + (n = new Qp()).a.zc("jar", n), + n.a.zc("zip", n), + n.a.zc("archive", n), + XH(), + (Rct = new Ny(n)); + } + function Omn(n, t) { + var e, i, r, c, a; + if ((b5(t, (ryn(), j5n), 0), (r = Yx(Aun(t, y5n), 86)), 0 == t.d.b)) + r ? ((a = ty(fL(Aun(r, M5n))) + n.a + sV(r, t)), b5(t, M5n, a)) : b5(t, M5n, 0); + else { + for (e = new Rd(Ztn(new Dd(t).a.d, 0)); ij(e.a); ) Omn(n, Yx(IX(e.a), 188).c); + (i = Yx(PO(new Rd(Ztn(new Dd(t).a.d, 0))), 86)), + (c = + (ty( + fL( + Aun( + Yx( + (function (n) { + return ij(n.a) ? Iz(n) : null; + })(new Rd(Ztn(new Dd(t).a.d, 0))), + 86, + ), + M5n, + ), + ), + ) + + ty(fL(Aun(i, M5n)))) / + 2), + r + ? ((a = ty(fL(Aun(r, M5n))) + n.a + sV(r, t)), + b5(t, M5n, a), + b5(t, j5n, ty(fL(Aun(t, M5n))) - c), + (function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v; + for (l = (s = Yx(PO(new Rd(Ztn(new Dd(t).a.d, 0))), 86)) ? Yx(Aun(s, (ryn(), m5n)), 86) : null, r = 1; s && l; ) { + for (a = 0, v = 0, e = s, i = l, c = 0; c < r; c++) + (e = eY(e)), (i = eY(i)), (v += ty(fL(Aun(e, (ryn(), j5n))))), (a += ty(fL(Aun(i, j5n)))); + if ( + ((p = ty(fL(Aun(l, (ryn(), M5n))))), (g = ty(fL(Aun(s, M5n)))), (h = sV(s, l)), 0 < (f = p + a + n.a + h - g - v)) + ) { + for (u = t, o = 0; u && u != i; ) ++o, (u = Yx(Aun(u, y5n), 86)); + if (!u) return; + for (d = f / o, u = t; u != i; ) + (w = ty(fL(Aun(u, M5n))) + f), + b5(u, M5n, w), + (b = ty(fL(Aun(u, j5n))) + f), + b5(u, j5n, b), + (f -= d), + (u = Yx(Aun(u, y5n), 86)); + } + ++r, + (l = (s = 0 == s.d.b ? Wgn(new Dd(t), r) : Yx(PO(new Rd(Ztn(new Dd(s).a.d, 0))), 86)) ? Yx(Aun(s, m5n), 86) : null); + } + })(n, t)) + : b5(t, M5n, c); + } + } + function Amn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b; + (u = 0), (b = 0), (o = cG(n.f, n.f.length)), (c = n.d), (a = n.i), (i = n.a), (r = n.b); + do { + for (l = 0, s = new pb(n.p); s.a < s.c.c.length; ) + (f = Oyn(n, Yx(Hz(s), 10))), + (e = !0), + (n.q == (_bn(), K2n) || n.q == B2n) && (e = ny(hL(f.b))), + Yx(f.a, 19).a < 0 && e + ? (++l, + (o = cG(n.f, n.f.length)), + (n.d = n.d + Yx(f.a, 19).a), + (b += c - n.d), + (c = n.d + Yx(f.a, 19).a), + (a = n.i), + (i = Xz(n.a)), + (r = Xz(n.b))) + : ((n.f = cG(o, o.length)), + (n.d = c), + (n.a = (MF(i), i ? new sx(i) : Jx(new pb(i)))), + (n.b = (MF(r), r ? new sx(r) : Jx(new pb(r)))), + (n.i = a)); + ++u, (h = 0 != l && ny(hL(t.Kb(new mP(d9(b), d9(u)))))); + } while (h); + } + function $mn(n, t) { + var e, i, r, c, a, u, o, s, h; + if (!(t.e.c.length <= 1)) { + for ( + n.f = t, + n.d = Yx(Aun(n.f, (Wrn(), $Gn)), 379), + n.g = Yx(Aun(n.f, DGn), 19).a, + n.e = ty(fL(Aun(n.f, LGn))), + n.c = ty(fL(Aun(n.f, AGn))), + bF(n.b), + r = new pb(n.f.c); + r.a < r.c.c.length; + + ) + (i = Yx(Hz(r), 282)), Cgn(n.b, i.c, i, null), Cgn(n.b, i.d, i, null); + for (u = n.f.e.c.length, n.a = fR(Jot, [TEn, rMn], [104, 25], 15, [u, u], 2), s = new pb(n.f.e); s.a < s.c.c.length; ) + Fvn(n, (o = Yx(Hz(s), 144)), n.a[o.b]); + for (n.i = fR(Jot, [TEn, rMn], [104, 25], 15, [u, u], 2), c = 0; c < u; ++c) + for (a = 0; a < u; ++a) (h = 1 / ((e = n.a[c][a]) * e)), (n.i[c][a] = h); + } + } + function Lmn(n) { + var t, e, i, r; + if (!(null == n.b || n.b.length <= 2 || n.a)) { + for (t = 0, r = 0; r < n.b.length; ) { + for ( + t != r ? ((n.b[t] = n.b[r++]), (n.b[t + 1] = n.b[r++])) : (r += 2), e = n.b[t + 1]; + r < n.b.length && !(e + 1 < n.b[r]); + + ) + if (e + 1 == n.b[r]) (n.b[t + 1] = n.b[r + 1]), (e = n.b[t + 1]), (r += 2); + else if (e >= n.b[r + 1]) r += 2; + else { + if (!(e < n.b[r + 1])) + throw hp( + new Im( + "Token#compactRanges(): Internel Error: [" + n.b[t] + "," + n.b[t + 1] + "] [" + n.b[r] + "," + n.b[r + 1] + "]", + ), + ); + (n.b[t + 1] = n.b[r + 1]), (e = n.b[t + 1]), (r += 2); + } + t += 2; + } + t != n.b.length && ((i = VQ(Wot, MTn, 25, t, 15, 1)), smn(n.b, 0, i, 0, t), (n.b = i)), (n.a = !0); + } + } + function Nmn(n) { + var t, e, i, r, c, a, u, o, s, h, f, l; + for ( + c = ny(hL(jln((t = TG(n)), (gjn(), I1n)))), h = 0, r = 0, s = new UO((!n.e && (n.e = new AN(nct, n, 7, 4)), n.e)); + s.e != s.i.gc(); + + ) + (a = (u = Whn((o = Yx(hen(s), 79)))) && c && ny(hL(jln(o, C1n)))), + (l = iun(Yx(c1((!o.c && (o.c = new AN(Zrt, o, 5, 8)), o.c), 0), 82))), + u && a ? ++r : u && !a ? ++h : IG(l) == t || l == t ? ++r : ++h; + for (i = new UO((!n.d && (n.d = new AN(nct, n, 8, 5)), n.d)); i.e != i.i.gc(); ) + (a = (u = Whn((e = Yx(hen(i), 79)))) && c && ny(hL(jln(e, C1n)))), + (f = iun(Yx(c1((!e.b && (e.b = new AN(Zrt, e, 4, 7)), e.b), 0), 82))), + u && a ? ++h : u && !a ? ++r : IG(f) == t || f == t ? ++h : ++r; + return h - r; + } + function xmn(n, t) { + var e, i, r, c, a, u, o, s, h; + if (((a = null != t.p && !t.b) || run(t, kPn, 1), (c = 1 / (e = Yx(Aun(n, (Ojn(), _Qn)), 15)).gc()), t.n)) + for (LD(t, "ELK Layered uses the following " + e.gc() + " modules:"), h = 0, s = e.Kc(); s.Ob(); ) + LD(t, " Slot " + (h < 10 ? "0" : "") + h++ + ": " + Nk(V5(Yx(s.Pb(), 51)))); + for (o = e.Kc(); o.Ob(); ) Yx(o.Pb(), 51).pf(n, J2(t, c)); + for (r = new pb(n.b); r.a < r.c.c.length; ) (i = Yx(Hz(r), 29)), S4(n.a, i.a), (i.a.c = VQ(UKn, iEn, 1, 0, 5, 1)); + for (u = new pb(n.a); u.a < u.c.c.length; ) JG(Yx(Hz(u), 10), null); + (n.b.c = VQ(UKn, iEn, 1, 0, 5, 1)), a || Ron(t); + } + function Dmn(n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b, w; + for (w = new rp(), c = n.a.ec().Kc(); c.Ob(); ) xB(w, (i = Yx(c.Pb(), 168)), e.Je(i)); + for ( + MF(n), JC((a = n ? new sx(n) : Jx(n.a.ec().Kc())), new Ub(w)), u = yW(a), o = new uO(t), Ysn((b = new rp()).f, t, o); + 0 != u.a.gc(); + + ) { + for (s = null, h = null, f = null, r = u.a.ec().Kc(); r.Ob(); ) + if (((i = Yx(r.Pb(), 168)), ty(fL(eI(Dq(w.f, i)))) <= JTn)) { + if (P_(b, i.a) && !P_(b, i.b)) { + (h = i.b), (f = i.a), (s = i); + break; + } + if (P_(b, i.b) && !P_(b, i.a)) { + (h = i.a), (f = i.b), (s = i); + break; + } + } + if (!s) break; + (l = new uO(h)), eD(Yx(eI(Dq(b.f, f)), 221).a, l), Ysn(b.f, h, l), u.a.Bc(s); + } + return o; + } + function Rmn(n, t) { + var e, i, r, c, a; + if (t) + if ((!n.a && (n.a = new Jp()), 2 != n.e)) + if (1 != t.e) + 0 != (a = n.a.a.c.length) + ? (0 != (c = Yx(lB(n.a, a - 1), 117)).e && 10 != c.e) || (0 != t.e && 10 != t.e) + ? Up(n.a, t) + : (0 == t.e || t.bm().length, + 0 == c.e + ? ((e = new Oy()), + (i = c._l()) >= eMn ? pI(e, U9(i)) : KF(e, i & fTn), + (c = new nG(10, null, 0)), + (function (n, t, e) { + i_(e, n.a.c.length), QW(n.a, e, t); + })(n.a, c, a - 1)) + : (c.bm().length, pI((e = new Oy()), c.bm())), + 0 == t.e ? ((i = t._l()) >= eMn ? pI(e, U9(i)) : KF(e, i & fTn)) : pI(e, t.bm()), + (Yx(c, 521).b = e.a)) + : Up(n.a, t); + else for (r = 0; r < t.em(); r++) Rmn(n, t.am(r)); + else Up(n.a, t); + } + function Kmn(n) { + var t, e, i, r, c; + return null != n.g + ? n.g + : n.a < 32 + ? ((n.g = (function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d; + if ((hmn(), (o = k8(n, 0) < 0) && (n = sJ(n)), 0 == k8(n, 0))) + switch (t) { + case 0: + return "0"; + case 1: + return sMn; + case 2: + return "0.00"; + case 3: + return "0.000"; + case 4: + return "0.0000"; + case 5: + return "0.00000"; + case 6: + return "0.000000"; + default: + return ((b = new Ay()).a += t < 0 ? "0E+" : "0E"), (b.a += t == nTn ? "2147483648" : "" + -t), b.a; + } + (f = VQ(Xot, sTn, 25, 1 + (h = 18), 15, 1)), (e = h), (d = n); + do { + (s = d), (d = Bcn(d, 10)), (f[--e] = WR(t7(48, n7(s, e7(d, 10)))) & fTn); + } while (0 != k8(d, 0)); + if (((r = n7(n7(n7(h, e), t), 1)), 0 == t)) return o && (f[--e] = 45), Vnn(f, e, h - e); + if (t > 0 && k8(r, -6) >= 0) { + if (k8(r, 0) >= 0) { + for (c = e + WR(r), u = h - 1; u >= c; u--) f[u + 1] = f[u]; + return (f[++c] = 46), o && (f[--e] = 45), Vnn(f, e, h - e + 1); + } + for (a = 2; LT(a, t7(sJ(r), 1)); a++) f[--e] = 48; + return (f[--e] = 46), (f[--e] = 48), o && (f[--e] = 45), Vnn(f, e, h - e); + } + return ( + (w = e + 1), + (i = h), + (l = new $y()), + o && (l.a += "-"), + i - w >= 1 ? (_F(l, f[e]), (l.a += "."), (l.a += Vnn(f, e + 1, h - e - 1))) : (l.a += Vnn(f, e, h - e)), + (l.a += "E"), + k8(r, 0) > 0 && (l.a += "+"), + (l.a += "" + HK(r)), + l.a + ); + })(D3(n.f), oG(n.e))), + n.g) + : ((r = pjn((!n.c && (n.c = J6(n.f)), n.c), 0)), + 0 == n.e + ? r + : ((t = (!n.c && (n.c = J6(n.f)), n.c).e < 0 ? 2 : 1), + (e = r.length), + (i = -n.e + e - t), + ((c = new Ay()).a += "" + r), + n.e > 0 && i >= -6 + ? i >= 0 + ? UG(c, e - oG(n.e), String.fromCharCode(46)) + : ((c.a = l$(c.a, 0, t - 1) + "0." + lI(c.a, t - 1)), UG(c, t + 1, Vnn(rFn, 0, -oG(i) - 1))) + : (e - t >= 1 && (UG(c, t, String.fromCharCode(46)), ++e), + UG(c, e, String.fromCharCode(69)), + i > 0 && UG(c, ++e, String.fromCharCode(43)), + UG(c, ++e, "" + HK(D3(i)))), + (n.g = c.a), + n.g)); + } + function _mn(n, t, i) { + var r, c, a; + if ((c = Yx(Aun(t, (gjn(), BZn)), 275)) != (uon(), mVn)) { + switch ( + (run(i, "Horizontal Compaction", 1), + (n.a = t), + (function (n, t) { + n.g = t; + })( + (r = new wfn( + (((a = new dJ()).d = t), + (a.c = Yx(Aun(a.d, b1n), 218)), + (function (n) { + var t, e, i, r, c, a, u; + for (t = !1, e = 0, r = new pb(n.d.b); r.a < r.c.c.length; ) + for ((i = Yx(Hz(r), 29)).p = e++, a = new pb(i.a); a.a < a.c.c.length; ) + (c = Yx(Hz(a), 10)), !t && !MX(a7(c)) && (t = !0); + (u = tK((t9(), tet), x4(Gy(oet, 1), XEn, 103, 0, [Ztt, net]))), + t || (n2(u, eet), n2(u, Jtt)), + (n.a = new DZ(u)), + U_(n.f), + U_(n.b), + U_(n.e), + U_(n.g); + })(a), + (function (n) { + var t, e, i, r, c, a, u, o, s, f; + for (c = new pb(n.d.b); c.a < c.c.c.length; ) + for (u = new pb(Yx(Hz(c), 29).a); u.a < u.c.c.length; ) + !ny(hL(Aun((a = Yx(Hz(u), 10)), (gjn(), KZn)))) || MX(a7(a)) + ? ((r = new mH(a.n.a - a.d.b, a.n.b - a.d.d, a.o.a + a.d.b + a.d.c, a.o.b + a.d.d + a.d.a)), + (t = BA(AE(CE(OE(new uv(), a), r), CXn), n.a)), + FA(IE(Z1(new av(), x4(Gy(PBn, 1), iEn, 57, 0, [t])), t), n.a), + (o = new cp()), + xB(n.e, t, o), + (e = FX(new $K(bA(u7(a).a.Kc(), new h()))) - FX(new $K(bA(o7(a).a.Kc(), new h())))) < 0 + ? Y4(o, !0, (t9(), Ztt)) + : e > 0 && Y4(o, !0, (t9(), net)), + a.k == (bon(), _zn) && QB(o), + xB(n.f, a, t)) + : ((s = (i = Yx(fq(a7(a)), 17)).c.i) == a && (s = i.d.i), (f = new mP(s, yN(dO(a.n), s.n))), xB(n.b, a, f)); + })(a), + Fdn(a), + a.a), + )), + n.b, + ), + 1 === Yx(Aun(t, FZn), 422).g ? Uy(r, new a2(n.a)) : Uy(r, (VH(), MBn)), + c.g) + ) { + case 1: + _ln(r); + break; + case 2: + _ln(ekn(r, (t9(), net))); + break; + case 3: + _ln(zy(ekn(_ln(r), (t9(), net)), new gr())); + break; + case 4: + _ln(zy(ekn(_ln(r), (t9(), net)), new Gw(a))); + break; + case 5: + _ln( + (function (n, t) { + return (n.b = t), n; + })(r, IXn), + ); + } + ekn(r, (t9(), Ztt)), + (r.e = !0), + (function (n) { + var t, i, r, c; + for ( + SE(hH(new SR(null, new Nz(n.a.b, 16)), new yr()), new kr()), + (function (n) { + var t, e, i, r, c; + for (i = new t6(new Ql(n.b).a); i.b; ) + (t = Yx((e = s1(i)).cd(), 10)), + (c = Yx(Yx(e.dd(), 46).a, 10)), + (r = Yx(Yx(e.dd(), 46).b, 8)), + mN(OI(t.n), mN(dO(c.n), r)); + })(n), + SE(hH(new SR(null, new Nz(n.a.b, 16)), new jr()), new Er()), + n.c == (g7(), bet) && + (SE(hH(WJ(new SR(null, new Nz(new Yl(n.f), 1)), new Tr()), new Mr()), new Ww(n)), + SE(hH(fH(WJ(WJ(new SR(null, new Nz(n.d.b, 16)), new Sr()), new Pr()), new Ir()), new Cr()), new Qw(n))), + c = new QS(JTn, JTn), + t = new QS(ZTn, ZTn), + r = new pb(n.a.b); + r.a < r.c.c.length; + + ) + (i = Yx(Hz(r), 57)), + (c.a = e.Math.min(c.a, i.d.c)), + (c.b = e.Math.min(c.b, i.d.d)), + (t.a = e.Math.max(t.a, i.d.c + i.d.b)), + (t.b = e.Math.max(t.b, i.d.d + i.d.a)); + mN(OI(n.d.c), D$(new QS(c.a, c.b))), + mN(OI(n.d.f), yN(new QS(t.a, t.b), c)), + (function (n, t, e) { + var i, r; + for (i = new pb(n.a.b); i.a < i.c.c.length; ) + if ((r = FU(Yx(Hz(i), 57))) && r.k == (bon(), _zn)) + switch (Yx(Aun(r, (Ojn(), hQn)), 61).g) { + case 4: + r.n.a = t.a; + break; + case 2: + r.n.a = e.a - (r.o.a + r.d.c); + break; + case 1: + r.n.b = t.b; + break; + case 3: + r.n.b = e.b - (r.o.b + r.d.a); + } + })(n, c, t), + U_(n.f), + U_(n.b), + U_(n.g), + U_(n.e), + (n.a.a.c = VQ(UKn, iEn, 1, 0, 5, 1)), + (n.a.b.c = VQ(UKn, iEn, 1, 0, 5, 1)), + (n.a = null), + (n.d = null); + })(a), + Ron(i); + } + } + function Fmn(n, t, i, r, c, a, u, o) { + var s, h, f, l; + switch (((s = DV(x4(Gy(n9n, 1), iEn, 220, 0, [t, i, r, c]))), (l = null), n.b.g)) { + case 1: + l = DV(x4(Gy(d8n, 1), iEn, 526, 0, [new Ja(), new Qa(), new Ya()])); + break; + case 0: + l = DV(x4(Gy(d8n, 1), iEn, 526, 0, [new Ya(), new Qa(), new Ja()])); + break; + case 2: + l = DV(x4(Gy(d8n, 1), iEn, 526, 0, [new Qa(), new Ja(), new Ya()])); + } + for (f = new pb(l); f.a < f.c.c.length; ) (h = Yx(Hz(f), 526)), s.c.length > 1 && (s = h.mg(s, n.a, o)); + return 1 == s.c.length + ? Yx(TR(s, s.c.length - 1), 220) + : 2 == s.c.length + ? (function (n, t, i, r) { + var c, a, u, o, s, h, f, l, b, w, d, g, p; + return ( + (a = n.f), + (f = t.f), + (u = a == (xbn(), V8n) || a == Y8n), + (o = a == Q8n || a == V8n), + (l = f == Q8n || f == V8n), + !u || (f != V8n && f != Y8n) + ? (a != Q8n && a != J8n) || (f != Q8n && f != J8n) + ? o && l + ? (a == Q8n ? ((h = n), (s = t)) : ((h = t), (s = n)), + (b = i.j + i.f), + (w = h.e + r.f), + (d = e.Math.max(b, w) - e.Math.min(i.j, h.e)), + (c = (h.d + r.g - i.i) * d), + (g = i.i + i.g), + (p = s.d + r.g), + c <= (e.Math.max(g, p) - e.Math.min(i.i, s.d)) * (s.e + r.f - i.j) ? (n.f == Q8n ? n : t) : n.f == V8n ? n : t) + : n + : n.f == J8n + ? n + : t + : n.f == Y8n + ? n + : t + ); + })(($z(0, s.c.length), Yx(s.c[0], 220)), ($z(1, s.c.length), Yx(s.c[1], 220)), u, a) + : null; + } + function Bmn(n) { + var t, i, r, c, a, u; + for (WZ(n.a, new nt()), i = new pb(n.a); i.a < i.c.c.length; ) + (t = Yx(Hz(i), 221)), + (r = yN(dO(Yx(n.b, 65).c), Yx(t.b, 65).c)), + gqn + ? ((u = Yx(n.b, 65).b), + (a = Yx(t.b, 65).b), + e.Math.abs(r.a) >= e.Math.abs(r.b) + ? ((r.b = 0), a.d + a.a > u.d && a.d < u.d + u.a && DD(r, e.Math.max(u.c - (a.c + a.b), a.c - (u.c + u.b)))) + : ((r.a = 0), a.c + a.b > u.c && a.c < u.c + u.b && DD(r, e.Math.max(u.d - (a.d + a.a), a.d - (u.d + u.a))))) + : DD(r, Vpn(Yx(n.b, 65), Yx(t.b, 65))), + (c = e.Math.sqrt(r.a * r.a + r.b * r.b)), + DD(r, (c = Can(oqn, t, c, r))), + sK(Yx(t.b, 65), r), + WZ(t.a, new nw(r)), + Yx(oqn.b, 65), + QQ(oqn, sqn, t); + } + function Hmn(n) { + var t, e, i, r, c, a, u, o, s; + if (n.ej()) + if (((o = n.fj()), n.i > 0)) { + if (((t = new QP(n.i, n.g)), (c = (e = n.i) < 100 ? null : new Ek(e)), n.ij())) + for (i = 0; i < n.i; ++i) (a = n.g[i]), (c = n.kj(a, c)); + if ((xV(n), (r = 1 == e ? n.Zi(4, c1(t, 0), null, 0, o) : n.Zi(6, t, null, -1, o)), n.bj())) { + for (i = new u$(t); i.e != i.i.gc(); ) c = n.dj(fen(i), c); + c ? (c.Ei(r), c.Fi()) : n.$i(r); + } else c ? (c.Ei(r), c.Fi()) : n.$i(r); + } else xV(n), n.$i(n.Zi(6, (XH(), TFn), null, -1, o)); + else if (n.bj()) + if (n.i > 0) { + for (u = n.g, s = n.i, xV(n), c = s < 100 ? null : new Ek(s), i = 0; i < s; ++i) (a = u[i]), (c = n.dj(a, c)); + c && c.Fi(); + } else xV(n); + else xV(n); + } + function qmn(n, t, i) { + var r, c, a, u, o, s, h, f, l; + for (c4(this), i == (Yq(), X4n) ? __(this.r, n) : __(this.w, n), f = JTn, h = ZTn, u = t.a.ec().Kc(); u.Ob(); ) + (c = Yx(u.Pb(), 46)), + (o = Yx(c.a, 455)), + (s = (r = Yx(c.b, 17)).c) == n && (s = r.d), + __(o == X4n ? this.r : this.w, s), + (l = (Ikn(), xit).Hc(s.j) ? ty(fL(Aun(s, (Ojn(), XQn)))) : $5(x4(Gy(B7n, 1), TEn, 8, 0, [s.i.n, s.n, s.a])).b), + (f = e.Math.min(f, l)), + (h = e.Math.max(h, l)); + for ( + ion(this, (Ikn(), xit).Hc(n.j) ? ty(fL(Aun(n, (Ojn(), XQn)))) : $5(x4(Gy(B7n, 1), TEn, 8, 0, [n.i.n, n.n, n.a])).b, f, h), + a = t.a.ec().Kc(); + a.Ob(); + + ) + (c = Yx(a.Pb(), 46)), Xon(this, Yx(c.b, 17)); + this.o = !1; + } + function Gmn(n) { + var t, i, r, c, a, u, o; + if (0 != (o = Yx(TR(n.j, 0), 11)).g.c.length && 0 != o.e.c.length) + throw hp(new Ym("Interactive layout does not support NORTH/SOUTH ports with incoming _and_ outgoing edges.")); + if (0 != o.g.c.length) { + for (a = JTn, i = new pb(o.g); i.a < i.c.c.length; ) + (t = Yx(Hz(i), 17)), (r = Yx(Aun((u = t.d.i), (gjn(), H1n)), 142)), (a = e.Math.min(a, u.n.a - r.b)); + return new Bf(MF(a)); + } + if (0 != o.e.c.length) { + for (c = ZTn, i = new pb(o.e); i.a < i.c.c.length; ) + (t = Yx(Hz(i), 17)), (r = Yx(Aun((u = t.c.i), (gjn(), H1n)), 142)), (c = e.Math.max(c, u.n.a + u.o.a + r.c)); + return new Bf(MF(c)); + } + return gm(), gm(), zKn; + } + function zmn(n, t) { + var e, i, r, c, a, u; + if (n.Fk()) { + if (n.i > 4) { + if (!n.wj(t)) return !1; + if (n.rk()) { + if ( + ((u = (e = (i = Yx(t, 49)).Ug()) == n.e && (n.Dk() ? i.Og(i.Vg(), n.zk()) == n.Ak() : -1 - i.Vg() == n.aj())), + n.Ek() && !u && !e && i.Zg()) + ) + for (r = 0; r < n.i; ++r) if (iI(n.Gk(Yx(n.g[r], 56))) === iI(t)) return !0; + return u; + } + if (n.Dk() && !n.Ck()) { + if (iI((c = Yx(t, 56).ah(nin(Yx(n.ak(), 18))))) === iI(n.e)) return !0; + if (null == c || !Yx(c, 56).kh()) return !1; + } + } + if (((a = Fcn(n, t)), n.Ek() && !a)) for (r = 0; r < n.i; ++r) if (iI((i = n.Gk(Yx(n.g[r], 56)))) === iI(t)) return !0; + return a; + } + return Fcn(n, t); + } + function Umn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l; + for (h = new ip(), l = new Qp(), a = t.b, r = 0; r < a.c.length; r++) { + for (s = ($z(r, a.c.length), Yx(a.c[r], 29)).a, h.c = VQ(UKn, iEn, 1, 0, 5, 1), c = 0; c < s.c.length; c++) + ((u = n.a[r][c]).p = c), + u.k == (bon(), qzn) && (h.c[h.c.length] = u), + QW(Yx(TR(t.b, r), 29).a, c, u), + (u.j.c = VQ(UKn, iEn, 1, 0, 5, 1)), + S4(u.j, Yx(Yx(TR(n.b, r), 15).Xb(c), 14)), + zN(Yx(Aun(u, (gjn(), g0n)), 98)) || b5(u, g0n, (Ran(), uit)); + for (i = new pb(h); i.a < i.c.c.length; ) (f = fgn((e = Yx(Hz(i), 10)))), l.a.zc(f, l), l.a.zc(e, l); + } + for (o = l.a.ec().Kc(); o.Ob(); ) (u = Yx(o.Pb(), 10)), XH(), JC(u.j, (A6(), EXn)), (u.i = !0), yhn(u); + } + function Xmn(n, t) { + var e, i, r, c, a, u, o, s, h, f; + if ( + ((h = Yx(Aun(n, (Ojn(), hQn)), 61)), + (i = Yx(TR(n.j, 0), 11)), + h == (Ikn(), Tit) ? whn(i, Bit) : h == Bit && whn(i, Tit), + Yx(Aun(t, (gjn(), n0n)), 174).Hc((Ann(), nrt))) + ) { + if ( + ((o = ty(fL(Aun(n, H0n)))), (s = ty(fL(Aun(n, q0n)))), (a = ty(fL(Aun(n, F0n)))), (u = Yx(Aun(t, m0n), 21)).Hc((Chn(), pit))) + ) + for (e = s, f = n.o.a / 2 - i.n.a, c = new pb(i.f); c.a < c.c.c.length; ) + ((r = Yx(Hz(c), 70)).n.b = e), (r.n.a = f - r.o.a / 2), (e += r.o.b + a); + else if (u.Hc(mit)) for (c = new pb(i.f); c.a < c.c.c.length; ) (r = Yx(Hz(c), 70)).n.a = o + n.o.a - i.n.a; + !(function (n, t) { + var e; + (e = ty(fL(n.a.We((Cjn(), Gtt))))), Hkn(n, t, e); + })(new Qb((qE(), new dH(t, !1, !1, new Ft()))), new Ix(null, n, !1)); + } + } + function Wmn(n) { + var t, e, i, r, c, a, u, o, s, h; + if (n.ej()) + if (((h = n.Vi()), (o = n.fj()), h > 0)) + if ( + ((t = new t3(n.Gi())), + (c = (e = h) < 100 ? null : new Ek(e)), + NL(n, e, t.g), + (r = 1 == e ? n.Zi(4, c1(t, 0), null, 0, o) : n.Zi(6, t, null, -1, o)), + n.bj()) + ) { + for (i = new UO(t); i.e != i.i.gc(); ) c = n.dj(hen(i), c); + c ? (c.Ei(r), c.Fi()) : n.$i(r); + } else c ? (c.Ei(r), c.Fi()) : n.$i(r); + else NL(n, n.Vi(), n.Wi()), n.$i(n.Zi(6, (XH(), TFn), null, -1, o)); + else if (n.bj()) + if ((h = n.Vi()) > 0) { + for (u = n.Wi(), s = h, NL(n, h, u), c = s < 100 ? null : new Ek(s), i = 0; i < s; ++i) (a = u[i]), (c = n.dj(a, c)); + c && c.Fi(); + } else NL(n, n.Vi(), n.Wi()); + else NL(n, n.Vi(), n.Wi()); + } + function Vmn(n, t, i, r) { + var c, a, u, o, s, h, f, l, b, w; + for ( + (f = new fC(Yx(jln(n, (Run(), ent)), 8))).a = e.Math.max(f.a - i.b - i.c, 0), + f.b = e.Math.max(f.b - i.d - i.a, 0), + (null == (c = fL(jln(n, Q7n))) || (vB(c), c <= 0)) && (c = 1.3), + u = new ip(), + l = new UO((!n.a && (n.a = new m_(uct, n, 10, 11)), n.a)); + l.e != l.i.gc(); + + ) + (a = new K$(Yx(hen(l), 33))), (u.c[u.c.length] = a); + switch (Yx(jln(n, Y7n), 311).g) { + case 3: + w = (function (n, t, e, i, r) { + var c, a, u, o, s, h, f; + for (XH(), JC(n, new Xu()), u = new JU(n, 0), f = new ip(), c = 0; u.b < u.d.gc(); ) + S$(u.b < u.d.gc()), + (a = Yx(u.d.Xb((u.c = u.b++)), 157)), + 0 != f.c.length && DR(a) * xR(a) > 2 * c + ? ((h = new e1(f)), + (s = DR(a) / xR(a)), + (o = njn(h, t, new Sv(), e, i, r, s)), + mN(OI(h.e), o), + (f.c = VQ(UKn, iEn, 1, 0, 5, 1)), + (c = 0), + (f.c[f.c.length] = h), + (f.c[f.c.length] = a), + (c = DR(h) * xR(h) + DR(a) * xR(a))) + : ((f.c[f.c.length] = a), (c += DR(a) * xR(a))); + return f; + })(u, t, f.a, f.b, ((s = r), vB(c), s)); + break; + case 1: + w = (function (n, t, e, i, r) { + var c, a, u, o, s, h, f, l, b; + for (XH(), JC(n, new zu()), a = nD(n), b = new ip(), l = new ip(), u = null, o = 0; 0 != a.b; ) + (c = Yx(0 == a.b ? null : (S$(0 != a.b), VZ(a, a.a.a)), 157)), + !u || (DR(u) * xR(u)) / 2 < DR(c) * xR(c) + ? ((u = c), (b.c[b.c.length] = c)) + : ((o += DR(c) * xR(c)), + (l.c[l.c.length] = c), + l.c.length > 1 && + (o > (DR(u) * xR(u)) / 2 || 0 == a.b) && + ((f = new e1(l)), + (h = DR(u) / xR(u)), + (s = njn(f, t, new Sv(), e, i, r, h)), + mN(OI(f.e), s), + (u = f), + (b.c[b.c.length] = f), + (o = 0), + (l.c = VQ(UKn, iEn, 1, 0, 5, 1)))); + return S4(b, l), b; + })(u, t, f.a, f.b, ((h = r), vB(c), h)); + break; + default: + w = (function (n, t, e, i, r) { + var c, a, u, o, s, h, f, l, b; + for (u = VQ(Jot, rMn, 25, n.c.length, 15, 1), Xrn((l = new h_(new Uu())), n), s = 0, b = new ip(); 0 != l.b.c.length; ) + if (((a = Yx(0 == l.b.c.length ? null : TR(l.b, 0), 157)), s > 1 && (DR(a) * xR(a)) / 2 > u[0])) { + for (c = 0; c < b.c.length - 1 && (DR(a) * xR(a)) / 2 > u[c]; ) ++c; + (f = new e1(new Oz(b, 0, c + 1))), + (h = DR(a) / xR(a)), + (o = njn(f, t, new Sv(), e, i, r, h)), + mN(OI(f.e), o), + JQ(mun(l, f)), + Xrn(l, new Oz(b, c + 1, b.c.length)), + (b.c = VQ(UKn, iEn, 1, 0, 5, 1)), + (s = 0), + nK(u, u.length, 0); + } else + null != (0 == l.b.c.length ? null : TR(l.b, 0)) && e2(l, 0), + s > 0 && (u[s] = u[s - 1]), + (u[s] += DR(a) * xR(a)), + ++s, + (b.c[b.c.length] = a); + return b; + })(u, t, f.a, f.b, ((o = r), vB(c), o)); + } + xkn(n, (b = njn(new e1(w), t, i, f.a, f.b, r, (vB(c), c))).a, b.b, !1, !0); + } + function Qmn(n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p; + for (c = 0, a = 0, s = new pb(n.a); s.a < s.c.c.length; ) + (u = Yx(Hz(s), 10)), (c = e.Math.max(c, u.d.b)), (a = e.Math.max(a, u.d.c)); + for (o = new pb(n.a); o.a < o.c.c.length; ) { + switch (((u = Yx(Hz(o), 10)), Yx(Aun(u, (gjn(), xZn)), 248).g)) { + case 1: + w = 0; + break; + case 2: + w = 1; + break; + case 5: + w = 0.5; + break; + default: + for (i = 0, f = 0, b = new pb(u.j); b.a < b.c.c.length; ) + 0 == (l = Yx(Hz(b), 11)).e.c.length || ++i, 0 == l.g.c.length || ++f; + w = i + f == 0 ? 0.5 : f / (i + f); + } + (g = n.c), + (h = u.o.a), + (p = (g.a - h) * w), + w > 0.5 ? (p -= 2 * a * (w - 0.5)) : w < 0.5 && (p += 2 * c * (0.5 - w)), + p < (r = u.d.b) && (p = r), + (d = u.d.c), + p > g.a - d - h && (p = g.a - d - h), + (u.n.a = t + p); + } + } + function Ymn(n, t) { + var e, i, r, c, a, u, o, s, h; + return ( + (s = ""), + 0 == t.length + ? n.de(oTn, aTn, -1, -1) + : (_N((h = Wun(t)).substr(0, 3), "at ") && (h = h.substr(3)), + -1 == (a = (h = h.replace(/\[.*?\]/g, "")).indexOf("(")) + ? -1 == (a = h.indexOf("@")) + ? ((s = h), (h = "")) + : ((s = Wun(h.substr(a + 1))), (h = Wun(h.substr(0, a)))) + : ((e = h.indexOf(")", a)), (s = h.substr(a + 1, e - (a + 1))), (h = Wun(h.substr(0, a)))), + -1 != (a = VI(h, gun(46))) && (h = h.substr(a + 1)), + (0 == h.length || _N(h, "Anonymous function")) && (h = aTn), + (u = LA(s, gun(58))), + (r = qN(s, gun(58), u - 1)), + (o = -1), + (i = -1), + (c = oTn), + -1 != u && -1 != r && ((c = s.substr(0, r)), (o = f$(s.substr(r + 1, u - (r + 1)))), (i = f$(s.substr(u + 1)))), + n.de(c, h, o, i)) + ); + } + function Jmn(n, t, e) { + var i, r, c, a, u, o; + if (0 == t.l && 0 == t.m && 0 == t.h) throw hp(new Bm("divide by zero")); + if (0 == n.l && 0 == n.m && 0 == n.h) return e && (P_n = rO(0, 0, 0)), rO(0, 0, 0); + if (t.h == qTn && 0 == t.m && 0 == t.l) + return (function (n, t) { + return n.h == qTn && 0 == n.m && 0 == n.l + ? (t && (P_n = rO(0, 0, 0)), JI((LJ(), O_n))) + : (t && (P_n = rO(n.l, n.m, n.h)), rO(0, 0, 0)); + })(n, e); + if ( + ((o = !1), + t.h >> 19 != 0 && ((t = h5(t)), (o = !o)), + (a = (function (n) { + var t, e, i; + return 0 != ((e = n.l) & (e - 1)) || 0 != ((i = n.m) & (i - 1)) || 0 != ((t = n.h) & (t - 1)) || (0 == t && 0 == i && 0 == e) + ? -1 + : 0 == t && 0 == i && 0 != e + ? m0(e) + : 0 == t && 0 != i && 0 == e + ? m0(i) + 22 + : 0 != t && 0 == i && 0 == e + ? m0(t) + 44 + : -1; + })(t)), + (c = !1), + (r = !1), + (i = !1), + n.h == qTn && 0 == n.m && 0 == n.l) + ) { + if (((r = !0), (c = !0), -1 != a)) return (u = tln(n, a)), o && A5(u), e && (P_n = rO(0, 0, 0)), u; + (n = JI((LJ(), I_n))), (i = !0), (o = !o); + } else n.h >> 19 != 0 && ((c = !0), (n = h5(n)), (i = !0), (o = !o)); + return -1 != a + ? _5(n, a, o, c, e) + : gcn(n, t) < 0 + ? (e && (P_n = c ? h5(n) : rO(n.l, n.m, n.h)), rO(0, 0, 0)) + : (function (n, t, e, i, r, c) { + var a, u, o, s, h, f; + for ( + a = don(t, (o = E5(t) - E5(n))), u = rO(0, 0, 0); + o >= 0 && + (!Irn(n, a) || + (o < 22 ? (u.l |= 1 << o) : o < 44 ? (u.m |= 1 << (o - 22)) : (u.h |= 1 << (o - 44)), + 0 != n.l || 0 != n.m || 0 != n.h)); + + ) + (s = a.m), + (h = a.h), + (f = a.l), + (a.h = h >>> 1), + (a.m = (s >>> 1) | ((1 & h) << 21)), + (a.l = (f >>> 1) | ((1 & s) << 21)), + --o; + return e && A5(u), c && (i ? ((P_n = h5(n)), r && (P_n = y4(P_n, (LJ(), O_n)))) : (P_n = rO(n.l, n.m, n.h))), u; + })(i ? n : rO(n.l, n.m, n.h), t, o, c, r, e); + } + function Zmn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w; + if (n.e && n.c.c < n.f) throw hp(new Ym("Expected " + n.f + " phases to be configured; only found " + n.c.c)); + for (h = Yx(Ak(n.g), 9), b = h$(n.f), u = 0, s = (c = h).length; u < s; ++u) + (f = Yx(jJ(n, (i = c[u]).g), 246)) ? eD(b, Yx(H7(n, f), 123)) : (b.c[b.c.length] = null); + for ( + w = new fX(), + SE(hH(fH(hH(new SR(null, new Nz(b, 16)), new hu()), new Ud(t)), new fu()), new Xd(w)), + T3(w, n.a), + e = new ip(), + a = 0, + o = (r = h).length; + a < o; + ++a + ) + S4(e, A4(n, oq(Yx(jJ(w, (i = r[a]).g), 20)))), (l = Yx(TR(b, i.g), 123)) && (e.c[e.c.length] = l); + return S4(e, A4(n, oq(Yx(jJ(w, h[h.length - 1].g + 1), 20)))), e; + } + function nyn(n, t) { + var e, i, r, c, a, u, o; + if (!(n.g > t.f || t.g > n.f)) { + for (e = 0, i = 0, a = n.w.a.ec().Kc(); a.Ob(); ) + (r = Yx(a.Pb(), 11)), V6($5(x4(Gy(B7n, 1), TEn, 8, 0, [r.i.n, r.n, r.a])).b, t.g, t.f) && ++e; + for (u = n.r.a.ec().Kc(); u.Ob(); ) + (r = Yx(u.Pb(), 11)), V6($5(x4(Gy(B7n, 1), TEn, 8, 0, [r.i.n, r.n, r.a])).b, t.g, t.f) && --e; + for (o = t.w.a.ec().Kc(); o.Ob(); ) + (r = Yx(o.Pb(), 11)), V6($5(x4(Gy(B7n, 1), TEn, 8, 0, [r.i.n, r.n, r.a])).b, n.g, n.f) && ++i; + for (c = t.r.a.ec().Kc(); c.Ob(); ) + (r = Yx(c.Pb(), 11)), V6($5(x4(Gy(B7n, 1), TEn, 8, 0, [r.i.n, r.n, r.a])).b, n.g, n.f) && --i; + e < i ? new ZV(n, t, i - e) : i < e ? new ZV(t, n, e - i) : (new ZV(t, n, 0), new ZV(n, t, 0)); + } + } + function tyn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v; + for ( + s = t.c, + r = _C(n.e), + f = KO(N$(dO(KC(n.e)), n.d * n.a, n.c * n.b), -0.5), + e = r.a - f.a, + i = r.b - f.b, + e = (a = t.a).c - e, + i = a.d - i, + o = new pb(s); + o.a < o.c.c.length; + + ) { + switch (((b = e + (l = (u = Yx(Hz(o), 395)).b).a), (g = i + l.b), (w = oG(b / n.a)), (p = oG(g / n.b)), (c = u.a).g)) { + case 0: + Sen(), (h = tqn); + break; + case 1: + Sen(), (h = nqn); + break; + case 2: + Sen(), (h = eqn); + break; + default: + Sen(), (h = iqn); + } + c.a + ? ((v = oG((g + u.c) / n.b)), + eD(n.f, new Tx(h, d9(p), d9(v))), + c == (Pen(), dqn) ? g5(n, 0, p, w, v) : g5(n, w, p, n.d - 1, v)) + : ((d = oG((b + u.c) / n.a)), + eD(n.f, new Tx(h, d9(w), d9(d))), + c == (Pen(), bqn) ? g5(n, w, 0, d, p) : g5(n, w, p, d, n.c - 1)); + } + } + function eyn(n, t) { + var e, i, r, c, a, u, o, s; + if ((Lz((u = t.length - 1), t.length), 93 == (a = t.charCodeAt(u)))) { + if ((c = VI(t, gun(91))) >= 0) + return ( + (r = (function (n, t) { + var e; + if (CO((e = Ybn(n.Tg(), t)), 99)) return Yx(e, 18); + throw hp(new Qm(mNn + t + "' is not a valid reference")); + })(n, t.substr(1, c - 1))), + (function (n, t, e) { + var i, r, c, a, u, o, s, h, f, l; + for (o = new ip(), f = t.length, a = O5(e), s = 0; s < f; ++s) { + switch (((h = NA(t, gun(61), s)), (c = (r = v4((i = k9(a, t.substr(s, h - s))))).Aj().Nh()), XB(t, ++h))) { + case 39: + (u = b$(t, 39, ++h)), eD(o, new HP(i, TH(t.substr(h, u - h), c, r))), (s = u + 1); + break; + case 34: + (u = b$(t, 34, ++h)), eD(o, new HP(i, TH(t.substr(h, u - h), c, r))), (s = u + 1); + break; + case 91: + eD(o, new HP(i, (l = new ip()))); + n: for (;;) { + switch (XB(t, ++h)) { + case 39: + (u = b$(t, 39, ++h)), eD(l, TH(t.substr(h, u - h), c, r)), (h = u + 1); + break; + case 34: + (u = b$(t, 34, ++h)), eD(l, TH(t.substr(h, u - h), c, r)), (h = u + 1); + break; + case 110: + if ((++h, t.indexOf("ull", h) != h)) throw hp(new Im(kNn)); + (l.c[l.c.length] = null), (h += 3); + } + if (!(h < f)) break; + switch ((Lz(h, t.length), t.charCodeAt(h))) { + case 44: + break; + case 93: + break n; + default: + throw hp(new Im("Expecting , or ]")); + } + } + s = h + 1; + break; + case 110: + if ((++h, t.indexOf("ull", h) != h)) throw hp(new Im(kNn)); + eD(o, new HP(i, null)), (s = h + 3); + } + if (!(s < f)) break; + if ((Lz(s, t.length), 44 != t.charCodeAt(s))) throw hp(new Im("Expecting ,")); + } + return (function (n, t, e) { + var i, r, c, a, u, o, s, h, f; + f = t.c.length; + n: for (c = Yx((s = n.Yg(e)) >= 0 ? n._g(s, !1, !0) : tfn(n, e, !1), 58).Kc(); c.Ob(); ) { + for (r = Yx(c.Pb(), 56), h = 0; h < f; ++h) + if ( + ($z(h, t.c.length), + (o = (a = Yx(t.c[h], 72)).dd()), + (u = a.ak()), + (i = r.bh(u, !1)), + null == o ? null != i : !Q8(o, i)) + ) + continue n; + return r; + } + return null; + })(n, o, e); + })(n, t.substr(c + 1, u - (c + 1)), r) + ); + } else { + if ( + ((e = -1), null == K_n && (K_n = new RegExp("\\d")), K_n.test(String.fromCharCode(a)) && (e = qN(t, gun(46), u - 1)) >= 0) + ) { + (i = Yx(TV(n, UZ(n, t.substr(1, e - 1)), !1), 58)), (o = 0); + try { + o = ipn(t.substr(e + 1), nTn, Yjn); + } catch (n) { + throw CO((n = j4(n)), 127) ? hp(new mJ(n)) : hp(n); + } + if (o < i.gc()) return CO((s = i.Xb(o)), 72) && (s = Yx(s, 72).dd()), Yx(s, 56); + } + if (e < 0) return Yx(TV(n, UZ(n, t.substr(1)), !1), 56); + } + return null; + } + function iyn(n, t, e) { + var i, r, c, a, u, o, s; + if (tnn(t, e) >= 0) return e; + switch (TB(PJ(n, e))) { + case 2: + if (_N("", U8(n, e.Hj()).ne())) { + if ((o = $ln(n, t, (u = tH(PJ(n, e))), nH(PJ(n, e))))) return o; + for (a = 0, s = (r = Agn(n, t)).gc(); a < s; ++a) if (Kbn(G_(PJ(n, (o = Yx(r.Xb(a), 170)))), u)) return o; + } + return null; + case 4: + if (_N("", U8(n, e.Hj()).ne())) { + for (i = e; i; i = Fz(PJ(n, i))) if ((o = Lln(n, t, tH(PJ(n, i)), nH(PJ(n, i))))) return o; + if (((u = tH(PJ(n, e))), _N(BRn, u))) return Dcn(n, t); + for (a = 0, s = (c = $gn(n, t)).gc(); a < s; ++a) if (Kbn(G_(PJ(n, (o = Yx(c.Xb(a), 170)))), u)) return o; + } + return null; + default: + return null; + } + } + function ryn() { + (ryn = O), + (E5n = new Og(zPn)), + new Og(UPn), + new _L("DEPTH", d9(0)), + (p5n = new _L("FAN", d9(0))), + (d5n = new _L(u$n, d9(0))), + (C5n = new _L("ROOT", (TA(), !1))), + (m5n = new _L("LEFTNEIGHBOR", null)), + (P5n = new _L("RIGHTNEIGHBOR", null)), + (y5n = new _L("LEFTSIBLING", null)), + (I5n = new _L("RIGHTSIBLING", null)), + (g5n = new _L("DUMMY", !1)), + new _L("LEVEL", d9(0)), + (S5n = new _L("REMOVABLE_EDGES", new ME())), + (O5n = new _L("XCOOR", d9(0))), + (A5n = new _L("YCOOR", d9(0))), + (k5n = new _L("LEVELHEIGHT", 0)), + (v5n = new _L("ID", "")), + (T5n = new _L("POSITION", d9(0))), + (M5n = new _L("PRELIM", 0)), + (j5n = new _L("MODIFIER", 0)), + (w5n = new Og(XPn)), + (b5n = new Og(WPn)); + } + function cyn(n, t, i, r) { + var c, a, u, o, s, h, f, l, b, w; + for (f = i + t.c.c.a, w = new pb(t.j); w.a < w.c.c.length; ) { + if ( + ((b = Yx(Hz(w), 11)), + (c = $5(x4(Gy(B7n, 1), TEn, 8, 0, [b.i.n, b.n, b.a]))), + t.k == (bon(), qzn) && + ((o = Yx(Aun(b, (Ojn(), CQn)), 11)), (c.a = $5(x4(Gy(B7n, 1), TEn, 8, 0, [o.i.n, o.n, o.a])).a), (t.n.a = c.a)), + (u = new QS(0, c.b)), + b.j == (Ikn(), Eit)) + ) + u.a = f; + else { + if (b.j != qit) continue; + u.a = i; + } + if (!(e.Math.abs(c.a - u.a) <= r) || dcn(t)) + for (a = b.g.c.length + b.e.c.length > 1, h = new UV(b.b); ZC(h.a) || ZC(h.b); ) + (l = (s = Yx(ZC(h.a) ? Hz(h.a) : Hz(h.b), 17)).c == b ? s.d : s.c), + e.Math.abs($5(x4(Gy(B7n, 1), TEn, 8, 0, [l.i.n, l.n, l.a])).b - u.b) > 1 && jwn(n, s, u, a, b); + } + } + function ayn() { + (ayn = O), + ($ut = (_k(), Aut).b), + (xut = Yx(c1(aq(Aut.b), 0), 34)), + (Lut = Yx(c1(aq(Aut.b), 1), 34)), + (Nut = Yx(c1(aq(Aut.b), 2), 34)), + (zut = Aut.bb), + Yx(c1(aq(Aut.bb), 0), 34), + Yx(c1(aq(Aut.bb), 1), 34), + (Xut = Aut.fb), + (Wut = Yx(c1(aq(Aut.fb), 0), 34)), + Yx(c1(aq(Aut.fb), 1), 34), + Yx(c1(aq(Aut.fb), 2), 18), + (Qut = Aut.qb), + (Zut = Yx(c1(aq(Aut.qb), 0), 34)), + Yx(c1(aq(Aut.qb), 1), 18), + Yx(c1(aq(Aut.qb), 2), 18), + (Yut = Yx(c1(aq(Aut.qb), 3), 34)), + (Jut = Yx(c1(aq(Aut.qb), 4), 34)), + (tot = Yx(c1(aq(Aut.qb), 6), 34)), + (not = Yx(c1(aq(Aut.qb), 5), 18)), + (Dut = Aut.j), + (Rut = Aut.k), + (Kut = Aut.q), + (_ut = Aut.w), + (Fut = Aut.B), + (But = Aut.A), + (Hut = Aut.C), + (qut = Aut.D), + (Gut = Aut._), + (Uut = Aut.cb), + (Vut = Aut.hb); + } + function uyn(n, t) { + var e, i, r, c; + (c = n.F), + null == t + ? ((n.F = null), j6(n, null)) + : ((n.F = (vB(t), t)), + -1 != (i = VI(t, gun(60))) + ? ((r = t.substr(0, i)), + -1 == VI(t, gun(46)) && + !_N(r, Xjn) && + !_N(r, BDn) && + !_N(r, HDn) && + !_N(r, qDn) && + !_N(r, GDn) && + !_N(r, zDn) && + !_N(r, UDn) && + !_N(r, XDn) && + (r = WDn), + -1 != (e = LA(t, gun(62))) && (r += "" + t.substr(e + 1)), + j6(n, r)) + : ((r = t), + -1 == VI(t, gun(46)) && + (-1 != (i = VI(t, gun(91))) && (r = t.substr(0, i)), + _N(r, Xjn) || _N(r, BDn) || _N(r, HDn) || _N(r, qDn) || _N(r, GDn) || _N(r, zDn) || _N(r, UDn) || _N(r, XDn) + ? (r = t) + : ((r = WDn), -1 != i && (r += "" + t.substr(i)))), + j6(n, r), + r == t && (n.F = n.D))), + 0 != (4 & n.Db) && 0 == (1 & n.Db) && K3(n, new p_(n, 1, 5, c, t)); + } + function oyn(n, t) { + var e; + if (null == t || _N(t, aEn)) return null; + if (0 == t.length && n.k != (lsn(), A7n)) return null; + switch (n.k.g) { + case 1: + return vtn(t, kLn) ? (TA(), L_n) : vtn(t, jLn) ? (TA(), $_n) : null; + case 2: + try { + return d9(ipn(t, nTn, Yjn)); + } catch (n) { + if (CO((n = j4(n)), 127)) return null; + throw hp(n); + } + case 4: + try { + return gon(t); + } catch (n) { + if (CO((n = j4(n)), 127)) return null; + throw hp(n); + } + case 3: + return t; + case 5: + return F6(n), Ghn(n, t); + case 6: + return ( + F6(n), + (function (n, t, e) { + var i, r, c, a, u, o, s; + for ( + s = new cx((i = Yx(t.e && t.e(), 9)), Yx(eN(i, i.length), 9), 0), a = 0, u = (c = Ogn(e, "[\\[\\]\\s,]+")).length; + a < u; + ++a + ) + if (0 != Wun((r = c[a])).length) { + if (null == (o = Ghn(n, r))) return null; + n2(s, Yx(o, 22)); + } + return s; + })(n, n.a, t) + ); + case 7: + try { + return (e = Ffn(n)).Jf(t), e; + } catch (n) { + if (CO((n = j4(n)), 32)) return null; + throw hp(n); + } + default: + throw hp(new Ym("Invalid type set for this layout option.")); + } + } + function syn(n) { + var t; + switch (n.d) { + case 1: + if (n.hj()) return -2 != n.o; + break; + case 2: + if (n.hj()) return -2 == n.o; + break; + case 3: + case 5: + case 4: + case 6: + case 7: + return n.o > -2; + default: + return !1; + } + switch (((t = n.gj()), n.p)) { + case 0: + return null != t && ny(hL(t)) != hI(n.k, 0); + case 1: + return null != t && Yx(t, 217).a != (WR(n.k) << 24) >> 24; + case 2: + return null != t && Yx(t, 172).a != (WR(n.k) & fTn); + case 6: + return null != t && hI(Yx(t, 162).a, n.k); + case 5: + return null != t && Yx(t, 19).a != WR(n.k); + case 7: + return null != t && Yx(t, 184).a != (WR(n.k) << 16) >> 16; + case 3: + return null != t && ty(fL(t)) != n.j; + case 4: + return null != t && Yx(t, 155).a != n.j; + default: + return null == t ? null != n.n : !Q8(t, n.n); + } + } + function hyn(n, t, e) { + var i, r, c, a; + return n.Fk() && n.Ek() && iI((a = u_(n, Yx(e, 56)))) !== iI(e) + ? (n.Oi(t), + n.Ui(t, $Y(n, 0, a)), + n.rk() && + ((r = Yx(e, 49)), + (c = n.Dk() + ? n.Bk() + ? r.ih(n.b, nin(Yx(CZ(Cq(n.b), n.aj()), 18)).n, Yx(CZ(Cq(n.b), n.aj()).Yj(), 26).Bj(), null) + : r.ih(n.b, tnn(r.Tg(), nin(Yx(CZ(Cq(n.b), n.aj()), 18))), null, null) + : r.ih(n.b, -1 - n.aj(), null, null)), + !Yx(a, 49).eh() && + ((i = Yx(a, 49)), + (c = n.Dk() + ? n.Bk() + ? i.gh(n.b, nin(Yx(CZ(Cq(n.b), n.aj()), 18)).n, Yx(CZ(Cq(n.b), n.aj()).Yj(), 26).Bj(), c) + : i.gh(n.b, tnn(i.Tg(), nin(Yx(CZ(Cq(n.b), n.aj()), 18))), null, c) + : i.gh(n.b, -1 - n.aj(), null, c))), + c && c.Fi()), + gC(n.b) && n.$i(n.Zi(9, e, a, t, !1)), + a) + : e; + } + function fyn(n, t, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k; + for ( + f = ty(fL(Aun(n, (gjn(), R0n)))), + r = ty(fL(Aun(n, Y0n))), + b5((b = new Yu()), R0n, f + r), + v = (h = t).d, + g = h.c.i, + m = h.d.i, + p = eC(g.c), + y = eC(m.c), + c = new ip(), + l = p; + l <= y; + l++ + ) + Al((o = new rin(n)), (bon(), Bzn)), + b5(o, (Ojn(), CQn), h), + b5(o, g0n, (Ran(), oit)), + b5(o, _0n, b), + (w = Yx(TR(n.b, l), 29)), + l == p ? Hrn(o, w.a.c.length - i, w) : JG(o, w), + (k = ty(fL(Aun(h, y1n)))) < 0 && b5(h, y1n, (k = 0)), + (o.o.b = k), + (d = e.Math.floor(k / 2)), + whn((u = new Ion()), (Ikn(), qit)), + ZG(u, o), + (u.n.b = d), + whn((s = new Ion()), Eit), + ZG(s, o), + (s.n.b = d), + QG(h, u), + o4((a = new jq()), h), + b5(a, $1n, null), + YG(a, s), + QG(a, v), + jcn(o, h, a), + (c.c[c.c.length] = a), + (h = a); + return c; + } + function lyn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g; + for ( + u = Yx( + $on(n, (Ikn(), qit)) + .Kc() + .Pb(), + 11, + ).e, + f = Yx($on(n, Eit).Kc().Pb(), 11).g, + a = u.c.length, + g = Dz(Yx(TR(n.j, 0), 11)); + a-- > 0; + + ) { + for ( + $z(0, u.c.length), + b = Yx(u.c[0], 17), + $z(0, f.c.length), + r = hJ((i = Yx(f.c[0], 17)).d.e, i, 0), + eX(b, i.d, r), + YG(i, null), + QG(i, null), + l = b.a, + t && KD(l, new fC(g)), + e = Ztn(i.a, 0); + e.b != e.d.c; + + ) + KD(l, new fC(Yx(IX(e), 8))); + for (d = b.b, h = new pb(i.b); h.a < h.c.c.length; ) (s = Yx(Hz(h), 70)), (d.c[d.c.length] = s); + if (((w = Yx(Aun(b, (gjn(), $1n)), 74)), (c = Yx(Aun(i, $1n), 74)))) + for (w || ((w = new Nv()), b5(b, $1n, w)), o = Ztn(c, 0); o.b != o.d.c; ) KD(w, new fC(Yx(IX(o), 8))); + } + } + function byn(n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w; + if (((i = Yx(GB(n.b, t), 124)), (s = Yx(Yx(_V(n.r, t), 21), 84)).dc())) return (i.n.b = 0), void (i.n.c = 0); + for (h = n.u.Hc((Chn(), pit)), u = 0, o = s.Kc(), f = null, l = 0, b = 0; o.Ob(); ) + (c = ty(fL((r = Yx(o.Pb(), 111)).b.We((XA(), XHn))))), + (a = r.b.rf().a), + n.A.Hc((Ann(), nrt)) && Xdn(n, t), + f + ? ((w = b + f.d.c + n.w + r.d.b), + (u = e.Math.max(u, (XC(), o0(SSn), e.Math.abs(l - c) <= SSn || l == c || (isNaN(l) && isNaN(c)) ? 0 : w / (c - l))))) + : n.C && n.C.b > 0 && (u = e.Math.max(u, X2(n.C.b + r.d.b, c))), + (f = r), + (l = c), + (b = a); + n.C && + n.C.c > 0 && + ((w = b + n.C.c), + h && (w += f.d.c), + (u = e.Math.max(u, (XC(), o0(SSn), e.Math.abs(l - 1) <= SSn || 1 == l || (isNaN(l) && isNaN(1)) ? 0 : w / (1 - l))))), + (i.n.b = 0), + (i.a.a = u); + } + function wyn(n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w; + if (((i = Yx(GB(n.b, t), 124)), (s = Yx(Yx(_V(n.r, t), 21), 84)).dc())) return (i.n.d = 0), void (i.n.a = 0); + for (h = n.u.Hc((Chn(), pit)), u = 0, n.A.Hc((Ann(), nrt)) && Wdn(n, t), o = s.Kc(), f = null, b = 0, l = 0; o.Ob(); ) + (a = ty(fL((r = Yx(o.Pb(), 111)).b.We((XA(), XHn))))), + (c = r.b.rf().b), + f + ? ((w = l + f.d.a + n.w + r.d.d), + (u = e.Math.max(u, (XC(), o0(SSn), e.Math.abs(b - a) <= SSn || b == a || (isNaN(b) && isNaN(a)) ? 0 : w / (a - b))))) + : n.C && n.C.d > 0 && (u = e.Math.max(u, X2(n.C.d + r.d.d, a))), + (f = r), + (b = a), + (l = c); + n.C && + n.C.a > 0 && + ((w = l + n.C.a), + h && (w += f.d.a), + (u = e.Math.max(u, (XC(), o0(SSn), e.Math.abs(b - 1) <= SSn || 1 == b || (isNaN(b) && isNaN(1)) ? 0 : w / (1 - b))))), + (i.n.d = 0), + (i.a.b = u); + } + function dyn(n, t, e) { + var i, r, c, a, u, o; + for (this.g = n, u = t.d.length, o = e.d.length, this.d = VQ(Gzn, kIn, 10, u + o, 0, 1), a = 0; a < u; a++) this.d[a] = t.d[a]; + for (c = 0; c < o; c++) this.d[u + c] = e.d[c]; + if (t.e) { + if (((this.e = nD(t.e)), this.e.Mc(e), e.e)) + for (r = e.e.Kc(); r.Ob(); ) (i = Yx(r.Pb(), 233)) != t && (this.e.Hc(i) ? --i.c : this.e.Fc(i)); + } else e.e && ((this.e = nD(e.e)), this.e.Mc(t)); + (this.f = t.f + e.f), + (this.a = t.a + e.a), + this.a > 0 + ? u1(this, this.f / this.a) + : null != NO(t.g, t.d[0]).a && null != NO(e.g, e.d[0]).a + ? u1(this, (ty(NO(t.g, t.d[0]).a) + ty(NO(e.g, e.d[0]).a)) / 2) + : null != NO(t.g, t.d[0]).a + ? u1(this, NO(t.g, t.d[0]).a) + : null != NO(e.g, e.d[0]).a && u1(this, NO(e.g, e.d[0]).a); + } + function gyn(n, t) { + var e, i, r, c, a, u, o, s, h; + for ( + n.a = new HF( + (function (n) { + var t; + return new cx((t = Yx(n.e && n.e(), 9)), Yx(rF(t, t.length), 9), t.length); + })(oet), + ), + i = new pb(t.a); + i.a < i.c.c.length; + + ) { + for (e = Yx(Hz(i), 841), a = new Ttn(x4(Gy(hzn, 1), iEn, 81, 0, [])), eD(n.a.a, a), o = new pb(e.d); o.a < o.c.c.length; ) + xyn((s = new zA(n, (u = Yx(Hz(o), 110)))), Yx(Aun(e.c, (Ojn(), uQn)), 21)), + P_(n.g, e) || (xB(n.g, e, new QS(u.c, u.d)), xB(n.f, e, s)), + eD(n.a.b, s), + GU(a, s); + for (c = new pb(e.b); c.a < c.c.c.length; ) + (s = new zA(n, (r = Yx(Hz(c), 594)).kf())), + xB(n.b, r, new mP(a, s)), + xyn(s, Yx(Aun(e.c, (Ojn(), uQn)), 21)), + r.hf() && + (xyn((h = new Etn(n, r.hf(), 1)), Yx(Aun(e.c, uQn), 21)), + GU(new Ttn(x4(Gy(hzn, 1), iEn, 81, 0, [])), h), + Qhn(n.c, r.gf(), new mP(a, h))); + } + return n.a; + } + function pyn(n) { + var t; + (this.a = n), + (t = (bon(), x4(Gy(Uzn, 1), XEn, 267, 0, [Hzn, Bzn, _zn, qzn, Fzn, Kzn])).length), + (this.b = fR(S7n, [TEn, DAn], [593, 146], 0, [t, t], 2)), + (this.c = fR(S7n, [TEn, DAn], [593, 146], 0, [t, t], 2)), + zq(this, Hzn, (gjn(), G0n), z0n), + w4(this, Hzn, Bzn, R0n, K0n), + Gq(this, Hzn, qzn, R0n), + Gq(this, Hzn, _zn, R0n), + w4(this, Hzn, Fzn, G0n, z0n), + zq(this, Bzn, N0n, x0n), + Gq(this, Bzn, qzn, N0n), + Gq(this, Bzn, _zn, N0n), + w4(this, Bzn, Fzn, R0n, K0n), + BC(this, qzn, N0n), + Gq(this, qzn, _zn, N0n), + Gq(this, qzn, Fzn, B0n), + BC(this, _zn, W0n), + w4(this, _zn, Fzn, q0n, H0n), + zq(this, Fzn, N0n, N0n), + zq(this, Kzn, N0n, x0n), + w4(this, Kzn, Hzn, R0n, K0n), + w4(this, Kzn, Fzn, R0n, K0n), + w4(this, Kzn, Bzn, R0n, K0n); + } + function vyn(n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p; + if (((l = new fC(n.o)), (p = t.a / l.a), (u = t.b / l.b), (d = t.a - l.a), (c = t.b - l.b), e)) + for (r = iI(Aun(n, (gjn(), g0n))) === iI((Ran(), oit)), w = new pb(n.j); w.a < w.c.c.length; ) + switch ((b = Yx(Hz(w), 11)).j.g) { + case 1: + r || (b.n.a *= p); + break; + case 2: + (b.n.a += d), r || (b.n.b *= u); + break; + case 3: + r || (b.n.a *= p), (b.n.b += c); + break; + case 4: + r || (b.n.b *= u); + } + for (s = new pb(n.b); s.a < s.c.c.length; ) + (h = (o = Yx(Hz(s), 70)).n.a + o.o.a / 2), + (f = o.n.b + o.o.b / 2), + (g = h / l.a) + (a = f / l.b) >= 1 && + (g - a > 0 && f >= 0 ? ((o.n.a += d), (o.n.b += c * a)) : g - a < 0 && h >= 0 && ((o.n.a += d * g), (o.n.b += c))); + (n.o.a = t.a), (n.o.b = t.b), b5(n, (gjn(), n0n), (Ann(), new cx((i = Yx(Ak(lrt), 9)), Yx(eN(i, i.length), 9), 0))); + } + function myn(n) { + var t, e, i, r, c, a, u, o, s, h; + for (i = new ip(), a = new pb(n.e.a); a.a < a.c.c.length; ) { + for (h = 0, (r = Yx(Hz(a), 121)).k.c = VQ(UKn, iEn, 1, 0, 5, 1), e = new pb(b7(r)); e.a < e.c.c.length; ) + (t = Yx(Hz(e), 213)).f && (eD(r.k, t), ++h); + 1 == h && (i.c[i.c.length] = r); + } + for (c = new pb(i); c.a < c.c.c.length; ) + for (r = Yx(Hz(c), 121); 1 == r.k.c.length; ) { + for (s = Yx(Hz(new pb(r.k)), 213), n.b[s.c] = s.g, u = s.d, o = s.e, e = new pb(b7(r)); e.a < e.c.c.length; ) + Q8((t = Yx(Hz(e), 213)), s) || + (t.f + ? u == t.d || o == t.e + ? (n.b[s.c] -= n.b[t.c] - t.g) + : (n.b[s.c] += n.b[t.c] - t.g) + : r == u + ? t.d == r + ? (n.b[s.c] += t.g) + : (n.b[s.c] -= t.g) + : t.d == r + ? (n.b[s.c] -= t.g) + : (n.b[s.c] += t.g)); + uJ(u.k, s), uJ(o.k, s), (r = u == r ? s.e : s.d); + } + } + function yyn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l; + if (null == t || 0 == t.length) return null; + if (!(c = Yx(aG(n.f, t), 23))) { + for (r = new ub(new Zl(n.d).a.vc().Kc()); r.a.Ob(); ) + if ( + ((a = Yx(r.a.Pb(), 42)), + (u = (e = Yx(a.dd(), 23)).f), + (l = t.length), + _N(u.substr(u.length - l, l), t) && (t.length == u.length || 46 == XB(u, u.length - t.length - 1))) + ) { + if (c) return null; + c = e; + } + if (!c) + for (i = new ub(new Zl(n.d).a.vc().Kc()); i.a.Ob(); ) + if (((a = Yx(i.a.Pb(), 42)), null != (f = (e = Yx(a.dd(), 23)).g))) + for (s = 0, h = (o = f).length; s < h; ++s) + if ( + ((u = o[s]), + (l = t.length), + _N(u.substr(u.length - l, l), t) && (t.length == u.length || 46 == XB(u, u.length - t.length - 1))) + ) { + if (c) return null; + c = e; + } + c && GG(n.f, t, c); + } + return c; + } + function kyn(n, t, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g, p; + if ((run(i, "Network simplex layering", 1), (n.b = t), (p = 4 * Yx(Aun(t, (gjn(), V0n)), 19).a), (g = n.b.a).c.length < 1)) + Ron(i); + else { + for ( + d = null, + c = Ztn( + (a = (function (n, t) { + var e, i, r, c, a; + for ( + null == n.c || n.c.length < t.c.length ? (n.c = VQ(Vot, wSn, 25, t.c.length, 16, 1)) : oy(n.c), + n.a = new ip(), + i = 0, + a = new pb(t); + a.a < a.c.c.length; + + ) + (r = Yx(Hz(a), 10)).p = i++; + for (e = new ME(), c = new pb(t); c.a < c.c.c.length; ) + (r = Yx(Hz(c), 10)), + n.c[r.p] || + (Phn(n, r), + 0 == e.b || (S$(0 != e.b), Yx(e.a.a.c, 15)).gc() < n.a.c.length ? jI(e, n.a) : EI(e, n.a), + (n.a = new ip())); + return e; + })(n, g)), + 0, + ); + c.b != c.d.c; + + ) { + for ( + r = Yx(IX(c), 15), + o = p * oG(e.Math.sqrt(r.gc())), + Ggn(Xy(Vy(Wy(Cx((u = tpn(r))), o), d), !0), J2(i, 1)), + l = n.b.b, + w = new pb(u.a); + w.a < w.c.c.length; + + ) { + for (b = Yx(Hz(w), 121); l.c.length <= b.e; ) ZR(l, l.c.length, new qF(n.b)); + JG(Yx(b.f, 10), Yx(TR(l, b.e), 29)); + } + if (a.b > 1) + for (d = VQ(Wot, MTn, 25, n.b.b.c.length, 15, 1), f = 0, h = new pb(n.b.b); h.a < h.c.c.length; ) + (s = Yx(Hz(h), 29)), (d[f++] = s.a.c.length); + } + (g.c = VQ(UKn, iEn, 1, 0, 5, 1)), (n.a = null), (n.b = null), (n.c = null), Ron(i); + } + } + function jyn(n) { + var t, i, r, c, a, u, o; + for (t = 0, a = new pb(n.b.a); a.a < a.c.c.length; ) ((r = Yx(Hz(a), 189)).b = 0), (r.c = 0); + for ( + Ton(n, 0), + K7(n, n.g), + qbn(n.c), + uy(n.c), + t9(), + i = Ztt, + Kgn(wI(ikn(Kgn(wI(ikn(Kgn(ikn(n.c, i)), I9(i)))), i))), + ikn(n.c, Ztt), + B9(n, n.g), + Lun(n, 0), + pmn(n, 0), + Dln(n, 1), + Ton(n, 1), + K7(n, n.d), + qbn(n.c), + u = new pb(n.b.a); + u.a < u.c.c.length; + + ) + (r = Yx(Hz(u), 189)), (t += e.Math.abs(r.c)); + for (o = new pb(n.b.a); o.a < o.c.c.length; ) ((r = Yx(Hz(o), 189)).b = 0), (r.c = 0); + for ( + i = eet, + Kgn(wI(ikn(Kgn(wI(ikn(Kgn(uy(ikn(n.c, i))), I9(i)))), i))), + ikn(n.c, Ztt), + B9(n, n.d), + Lun(n, 1), + pmn(n, 1), + Dln(n, 0), + uy(n.c), + c = new pb(n.b.a); + c.a < c.c.c.length; + + ) + (r = Yx(Hz(c), 189)), (t += e.Math.abs(r.c)); + return t; + } + function Eyn(n, t) { + var e, i, r, c, a, u, o, s, h; + if (null != (s = t).b && null != n.b) { + for ( + xln(n), Lmn(n), xln(s), Lmn(s), e = VQ(Wot, MTn, 25, n.b.length + s.b.length, 15, 1), h = 0, i = 0, a = 0; + i < n.b.length && a < s.b.length; + + ) + if (((r = n.b[i]), (c = n.b[i + 1]), (u = s.b[a]), (o = s.b[a + 1]), c < u)) i += 2; + else if (c >= u && r <= o) + u <= r && c <= o + ? ((e[h++] = r), (e[h++] = c), (i += 2)) + : u <= r + ? ((e[h++] = r), (e[h++] = o), (n.b[i] = o + 1), (a += 2)) + : c <= o + ? ((e[h++] = u), (e[h++] = c), (i += 2)) + : ((e[h++] = u), (e[h++] = o), (n.b[i] = o + 1)); + else { + if (!(o < r)) + throw hp( + new Im( + "Token#intersectRanges(): Internal Error: [" + n.b[i] + "," + n.b[i + 1] + "] & [" + s.b[a] + "," + s.b[a + 1] + "]", + ), + ); + a += 2; + } + for (; i < n.b.length; ) (e[h++] = n.b[i++]), (e[h++] = n.b[i++]); + (n.b = VQ(Wot, MTn, 25, h, 15, 1)), smn(e, 0, n.b, 0, h); + } + } + function Tyn(n) { + var t, i, r, c, a, u, o; + for (t = new ip(), n.g = new ip(), n.d = new ip(), u = new t6(new Ql(n.f.b).a); u.b; ) + eD(t, Yx(Yx((a = s1(u)).dd(), 46).b, 81)), lC(Yx(a.cd(), 594).gf()) ? eD(n.d, Yx(a.dd(), 46)) : eD(n.g, Yx(a.dd(), 46)); + for ( + K7(n, n.d), + K7(n, n.g), + n.c = new rfn(n.b), + (function (n, t) { + n.f = t; + })(n.c, (zE(), rzn)), + B9(n, n.d), + B9(n, n.g), + S4(t, n.c.a.b), + n.e = new QS(JTn, JTn), + n.a = new QS(ZTn, ZTn), + r = new pb(t); + r.a < r.c.c.length; + + ) + (i = Yx(Hz(r), 81)), + (n.e.a = e.Math.min(n.e.a, i.g.c)), + (n.e.b = e.Math.min(n.e.b, i.g.d)), + (n.a.a = e.Math.max(n.a.a, i.g.c + i.g.b)), + (n.a.b = e.Math.max(n.a.b, i.g.d + i.g.a)); + Yy(n.c, new jt()), (o = 0); + do { + (c = jyn(n)), ++o; + } while ((o < 2 || c > ZEn) && o < 10); + Yy(n.c, new Et()), + jyn(n), + (function (n) { + ikn(n, (t9(), Ztt)), (n.d = !0); + })(n.c), + (function (n) { + var t, i, r, c, a, u, o, s; + for (a = new pb(n.a.b); a.a < a.c.c.length; ) ((c = Yx(Hz(a), 81)).b.c = c.g.c), (c.b.d = c.g.d); + for (s = new QS(JTn, JTn), t = new QS(ZTn, ZTn), r = new pb(n.a.b); r.a < r.c.c.length; ) + (i = Yx(Hz(r), 81)), + (s.a = e.Math.min(s.a, i.g.c)), + (s.b = e.Math.min(s.b, i.g.d)), + (t.a = e.Math.max(t.a, i.g.c + i.g.b)), + (t.b = e.Math.max(t.b, i.g.d + i.g.a)); + for (o = CF(n.c).a.nc(); o.Ob(); ) + (u = Yx(o.Pb(), 46)), + (i = Yx(u.b, 81)), + (s.a = e.Math.min(s.a, i.g.c)), + (s.b = e.Math.min(s.b, i.g.d)), + (t.a = e.Math.max(t.a, i.g.c + i.g.b)), + (t.b = e.Math.max(t.b, i.g.d + i.g.a)); + (n.d = D$(new QS(s.a, s.b))), + (n.e = yN(new QS(t.a, t.b), s)), + (n.a.a.c = VQ(UKn, iEn, 1, 0, 5, 1)), + (n.a.b.c = VQ(UKn, iEn, 1, 0, 5, 1)); + })(n.f); + } + function Myn(n, t, e) { + var i, r, c, a, u, o, s, h, f, l; + if (ny(hL(Aun(e, (gjn(), I1n))))) + for (r = new pb(e.j); r.a < r.c.c.length; ) + for (u = 0, o = (a = CU(Yx(Hz(r), 11).g)).length; u < o; ++u) + (c = a[u]).d.i == e && + ny(hL(Aun(c, C1n))) && + ((h = c.c), + (s = Yx(BF(n.b, h), 10)) || + (b5((s = Jkn(h, (Ran(), fit), h.j, -1, null, null, h.o, Yx(Aun(t, a1n), 103), t)), (Ojn(), CQn), h), + xB(n.b, h, s), + eD(t.a, s)), + (l = c.d), + (f = Yx(BF(n.b, l), 10)) || + (b5((f = Jkn(l, (Ran(), fit), l.j, 1, null, null, l.o, Yx(Aun(t, a1n), 103), t)), (Ojn(), CQn), l), + xB(n.b, l, f), + eD(t.a, f)), + YG((i = EV(c)), Yx(TR(s.j, 0), 11)), + QG(i, Yx(TR(f.j, 0), 11)), + Qhn(n.a, c, new jx(i, t, (h0(), i3n))), + Yx(Aun(t, (Ojn(), bQn)), 21).Fc((edn(), SVn))); + } + function Syn(n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b, w; + for ( + run(e, "Label dummy switching", 1), + i = Yx(Aun(t, (gjn(), s1n)), 227), + (function (n) { + var t, e; + for (e = 0, t = new pb(n.b); t.a < t.c.c.length; ) (Yx(Hz(t), 29).p = e), ++e; + })(t), + r = (function (n, t) { + var e, i, r, c; + for ( + e = new C7(kWn), psn(), r = 0, c = (i = x4(Gy(kWn, 1), XEn, 227, 0, [bWn, dWn, lWn, wWn, gWn, fWn])).length; + r < c; + ++r + ) + VL(e, i[r], new ip()); + return SE(fH(hH(WJ(new SR(null, new Nz(n.b, 16)), new Ze()), new ni()), new Lw(t)), new Nw(e)), e; + })(t, i), + n.a = VQ(Jot, rMn, 25, t.b.c.length, 15, 1), + psn(), + h = 0, + b = (u = x4(Gy(kWn, 1), XEn, 227, 0, [bWn, dWn, lWn, wWn, gWn, fWn])).length; + h < b; + ++h + ) + if (((c = u[h]) == gWn || c == fWn || c == wWn) && !Yx(KA(r.a, c) ? r.b[c.g] : null, 15).dc()) { + M3(n, t); + break; + } + for (f = 0, w = (o = x4(Gy(kWn, 1), XEn, 227, 0, [bWn, dWn, lWn, wWn, gWn, fWn])).length; f < w; ++f) + (c = o[f]) == gWn || c == fWn || c == wWn || Hgn(n, Yx(KA(r.a, c) ? r.b[c.g] : null, 15)); + for (s = 0, l = (a = x4(Gy(kWn, 1), XEn, 227, 0, [bWn, dWn, lWn, wWn, gWn, fWn])).length; s < l; ++s) + ((c = a[s]) == gWn || c == fWn || c == wWn) && Hgn(n, Yx(KA(r.a, c) ? r.b[c.g] : null, 15)); + (n.a = null), Ron(e); + } + function Pyn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l; + switch (n.k.g) { + case 1: + if ( + ((i = Yx(Aun(n, (Ojn(), CQn)), 17)), + (e = Yx(Aun(i, OQn), 74)) ? ny(hL(Aun(i, HQn))) && (e = U5(e)) : (e = new Nv()), + (s = Yx(Aun(n, TQn), 11))) + ) { + if (t <= (h = $5(x4(Gy(B7n, 1), TEn, 8, 0, [s.i.n, s.n, s.a]))).a) return h.b; + VW(e, h, e.a, e.a.a); + } + if ((f = Yx(Aun(n, MQn), 11))) { + if ((l = $5(x4(Gy(B7n, 1), TEn, 8, 0, [f.i.n, f.n, f.a]))).a <= t) return l.b; + VW(e, l, e.c.b, e.c); + } + if (e.b >= 2) { + for (a = Yx(IX((o = Ztn(e, 0))), 8), u = Yx(IX(o), 8); u.a < t && o.b != o.d.c; ) (a = u), (u = Yx(IX(o), 8)); + return a.b + ((t - a.a) / (u.a - a.a)) * (u.b - a.b); + } + break; + case 3: + switch (((r = (c = Yx(Aun(Yx(TR(n.j, 0), 11), (Ojn(), CQn)), 11)).i), c.j.g)) { + case 1: + return r.n.b; + case 3: + return r.n.b + r.o.b; + } + } + return Xcn(n).b; + } + function Iyn(n, t, i) { + var r, c, a, u, o, s, f, l; + switch ( + (run(i, "Node promotion heuristic", 1), + (n.g = t), + (function (n) { + var t, i, r, c, a, u, o, s, f, l, b, w, d, g, p; + for ( + n.n = ty(fL(Aun(n.g, (gjn(), G0n)))), + n.e = ty(fL(Aun(n.g, K0n))), + n.i = n.g.b.c.length, + o = n.i - 1, + w = 0, + n.j = 0, + n.k = 0, + n.a = DV(VQ(U_n, TEn, 19, n.i, 0, 1)), + n.b = DV(VQ(H_n, TEn, 333, n.i, 7, 1)), + u = new pb(n.g.b); + u.a < u.c.c.length; + + ) { + for ((c = Yx(Hz(u), 29)).p = o, b = new pb(c.a); b.a < b.c.c.length; ) ((l = Yx(Hz(b), 10)).p = w), ++w; + --o; + } + for ( + n.f = VQ(Wot, MTn, 25, w, 15, 1), + n.c = fR(Wot, [TEn, MTn], [48, 25], 15, [w, 3], 2), + n.o = new ip(), + n.p = new ip(), + t = 0, + n.d = 0, + a = new pb(n.g.b); + a.a < a.c.c.length; + + ) { + for (o = (c = Yx(Hz(a), 29)).p, r = 0, p = 0, s = c.a.c.length, f = 0, b = new pb(c.a); b.a < b.c.c.length; ) + (w = (l = Yx(Hz(b), 10)).p), + (n.f[w] = l.c.p), + (f += l.o.b + n.n), + (i = FX(new $K(bA(u7(l).a.Kc(), new h())))), + (g = FX(new $K(bA(o7(l).a.Kc(), new h())))), + (n.c[w][0] = g - i), + (n.c[w][1] = i), + (n.c[w][2] = g), + (r += i), + (p += g), + i > 0 && eD(n.p, l), + eD(n.o, l); + (d = s + (t -= r)), + (f += t * n.e), + QW(n.a, o, d9(d)), + QW(n.b, o, f), + (n.j = e.Math.max(n.j, d)), + (n.k = e.Math.max(n.k, f)), + (n.d += t), + (t += p); + } + })(n), + (n.q = Yx(Aun(t, (gjn(), F1n)), 260)), + (l = Yx(Aun(n.g, _1n), 19).a), + (a = new hi()), + n.q.g) + ) { + case 2: + case 1: + default: + Amn(n, a); + break; + case 3: + for (n.q = (_bn(), G2n), Amn(n, a), s = 0, o = new pb(n.a); o.a < o.c.c.length; ) + (u = Yx(Hz(o), 19)), (s = e.Math.max(s, u.a)); + s > n.j && ((n.q = K2n), Amn(n, a)); + break; + case 4: + for (n.q = (_bn(), G2n), Amn(n, a), f = 0, c = new pb(n.b); c.a < c.c.c.length; ) + (r = fL(Hz(c))), (f = e.Math.max(f, (vB(r), r))); + f > n.k && ((n.q = B2n), Amn(n, a)); + break; + case 6: + Amn(n, new Aw(oG(e.Math.ceil((n.f.length * l) / 100)))); + break; + case 5: + Amn(n, new $w(oG(e.Math.ceil((n.d * l) / 100)))); + } + (function (n, t) { + var e, i, r, c, a, u; + for (r = new ip(), e = 0; e <= n.i; e++) ((i = new qF(t)).p = n.i - e), (r.c[r.c.length] = i); + for (u = new pb(n.o); u.a < u.c.c.length; ) JG((a = Yx(Hz(u), 10)), Yx(TR(r, n.i - n.f[a.p]), 29)); + for (c = new pb(r); c.a < c.c.c.length; ) 0 == Yx(Hz(c), 29).a.c.length && z_(c); + (t.b.c = VQ(UKn, iEn, 1, 0, 5, 1)), S4(t.b, r); + })(n, t), + Ron(i); + } + function Cyn(n, t, e) { + var i, r, c, a; + (this.j = n), + (this.e = Oan(n)), + (this.o = this.j.e), + (this.i = !!this.o), + (this.p = this.i ? Yx(TR(e, dB(this.o).p), 214) : null), + (r = Yx(Aun(n, (Ojn(), bQn)), 21)), + (this.g = r.Hc((edn(), SVn))), + (this.b = new ip()), + (this.d = new Inn(this.e)), + (a = Yx(Aun(this.j, FQn), 230)), + (this.q = (function (n, t, e) { + return n == (l0(), U3n) ? new Pc() : 0 != Xln(t, 1) ? new yk(e.length) : new mk(e.length); + })(t, a, this.e)), + (this.k = new xG(this)), + (c = DV(x4(Gy(DXn, 1), iEn, 225, 0, [this, this.d, this.k, this.q]))), + t != (l0(), G3n) || ny(hL(Aun(n, (gjn(), VZn)))) + ? t == G3n && ny(hL(Aun(n, (gjn(), VZn)))) + ? ((i = new Lan(this.e)), (c.c[c.c.length] = i), (this.c = new u2(i, a, Yx(this.q, 402)))) + : (this.c = new DM(t, this)) + : ((i = new Lan(this.e)), (c.c[c.c.length] = i), (this.c = new wX(i, a, Yx(this.q, 402)))), + eD(c, this.c), + Emn(c, this.e), + (this.s = (function (n) { + var t, e, i, r, c, a, u, o, s, f, l, b, w, d, g, p, v, m, y, k, j, E; + if ( + (e = ty(fL(Aun(n.a.j, (gjn(), ZZn))))) < -1 || + !n.a.i || + zN(Yx(Aun(n.a.o, g0n), 98)) || + (i7(n.a.o, (Ikn(), Eit)).gc() < 2 && i7(n.a.o, qit).gc() < 2) + ) + return !0; + if (n.a.c.Rf()) return !1; + for (y = 0, m = 0, v = new ip(), o = 0, s = (u = n.a.e).length; o < s; ++o) { + for (b = 0, d = (l = u[o]).length; b < d; ++b) + if ((f = l[b]).k != (bon(), qzn)) { + for ( + i = n.b[f.c.p][f.p], + f.k == _zn + ? ((i.b = 1), Yx(Aun(f, (Ojn(), CQn)), 11).j == (Ikn(), Eit) && (m += i.a)) + : (E = i7(f, (Ikn(), qit))).dc() || !MO(E, new Nc()) + ? (i.c = 1) + : ((r = i7(f, Eit)).dc() || !MO(r, new Lc())) && (y += i.a), + a = new $K(bA(o7(f).a.Kc(), new h())); + Vfn(a); + + ) + (c = Yx(kV(a), 17)), (y += i.c), (m += i.b), rY(n, i, c.d.i); + for ( + j = new $K(new sA((g = n0(x4(Gy(QKn, 1), iEn, 20, 0, [i7(f, (Ikn(), Tit)), i7(f, Bit)]))).a.length, g.a)); + Vfn(j); + + ) + (k = Yx(kV(j), 11)), (p = Yx(Aun(k, (Ojn(), RQn)), 10)) && ((y += i.c), (m += i.b), rY(n, i, p)); + } else v.c[v.c.length] = f; + for (w = new pb(v); w.a < w.c.c.length; ) + for (f = Yx(Hz(w), 10), i = n.b[f.c.p][f.p], a = new $K(bA(o7(f).a.Kc(), new h())); Vfn(a); ) + (c = Yx(kV(a), 17)), (y += i.c), (m += i.b), rY(n, i, c.d.i); + v.c = VQ(UKn, iEn, 1, 0, 5, 1); + } + return (0 == (t = y + m) ? JTn : (y - m) / t) >= e; + })(this.k)); + } + function Oyn(n, t) { + var e, i, r, c, a, u, o, s, f; + for ( + u = !0, + r = 0, + o = n.f[t.p], + s = t.o.b + n.n, + e = n.c[t.p][2], + QW(n.a, o, d9(Yx(TR(n.a, o), 19).a - 1 + e)), + QW(n.b, o, ty(fL(TR(n.b, o))) - s + e * n.e), + ++o >= n.i + ? (++n.i, eD(n.a, d9(1)), eD(n.b, s)) + : ((i = n.c[t.p][1]), QW(n.a, o, d9(Yx(TR(n.a, o), 19).a + 1 - i)), QW(n.b, o, ty(fL(TR(n.b, o))) + s - i * n.e)), + ((n.q == (_bn(), K2n) && (Yx(TR(n.a, o), 19).a > n.j || Yx(TR(n.a, o - 1), 19).a > n.j)) || + (n.q == B2n && (ty(fL(TR(n.b, o))) > n.k || ty(fL(TR(n.b, o - 1))) > n.k))) && + (u = !1), + c = new $K(bA(u7(t).a.Kc(), new h())); + Vfn(c); + + ) + (a = Yx(kV(c), 17).c.i), n.f[a.p] == o && ((r += Yx((f = Oyn(n, a)).a, 19).a), (u = u && ny(hL(f.b)))); + return (n.f[t.p] = o), new mP(d9((r += n.c[t.p][0])), (TA(), !!u)); + } + function Ayn(n, t, i, r, c) { + var a, u, o, s, h, f, l, b, w, d, g, p, v; + for ( + l = new rp(), + u = new ip(), + jhn(n, i, n.d.fg(), u, l), + jhn(n, r, n.d.gg(), u, l), + n.b = + 0.2 * + ((g = dln(WJ(new SR(null, new Nz(u, 16)), new Sa()))), + (p = dln(WJ(new SR(null, new Nz(u, 16)), new Pa()))), + e.Math.min(g, p)), + a = 0, + o = 0; + o < u.c.length - 1; + o++ + ) + for ($z(o, u.c.length), s = Yx(u.c[o], 112), d = o + 1; d < u.c.length; d++) + a += gmn(n, s, ($z(d, u.c.length), Yx(u.c[d], 112))); + for ( + b = Yx(Aun(t, (Ojn(), FQn)), 230), + a >= 2 && ((v = Nbn(u, !0, b)), !n.e && (n.e = new xd(n)), btn(n.e, v, u, n.b)), + Han(u, b), + (function (n) { + var t, i, r, c, a, u, o, s, h; + for (s = new ip(), u = new ip(), a = new pb(n); a.a < a.c.c.length; ) + Kl((r = Yx(Hz(a), 112)), r.f.c.length), + _l(r, r.k.c.length), + 0 == r.d && (s.c[s.c.length] = r), + 0 == r.i && 0 == r.e.b && (u.c[u.c.length] = r); + for (i = -1; 0 != s.c.length; ) + for (t = new pb((r = Yx(KV(s, 0), 112)).k); t.a < t.c.c.length; ) + Fl((h = Yx(Hz(t), 129).b), e.Math.max(h.o, r.o + 1)), + (i = e.Math.max(i, h.o)), + Kl(h, h.d - 1), + 0 == h.d && (s.c[s.c.length] = h); + if (i > -1) { + for (c = new pb(u); c.a < c.c.c.length; ) (r = Yx(Hz(c), 112)).o = i; + for (; 0 != u.c.length; ) + for (t = new pb((r = Yx(KV(u, 0), 112)).f); t.a < t.c.c.length; ) + (o = Yx(Hz(t), 129).a).e.b > 0 || + (Fl(o, e.Math.min(o.o, r.o - 1)), _l(o, o.i - 1), 0 == o.i && (u.c[u.c.length] = o)); + } + })(u), + w = -1, + f = new pb(u); + f.a < f.c.c.length; + + ) + (h = Yx(Hz(f), 112)), e.Math.abs(h.s - h.c) < PPn || ((w = e.Math.max(w, h.o)), n.d.dg(h, c, n.c)); + return n.d.a.a.$b(), w + 1; + } + function $yn(n, t) { + var e, i; + ty(fL(Aun(t, (gjn(), N0n)))) < 2 && b5(t, N0n, 2), + Yx(Aun(t, a1n), 103) == (t9(), tet) && b5(t, a1n, X9(t)), + 0 == (e = Yx(Aun(t, I0n), 19)).a ? b5(t, (Ojn(), FQn), new c7()) : b5(t, (Ojn(), FQn), new jW(e.a)), + null == hL(Aun(t, V1n)) && b5(t, V1n, (TA(), iI(Aun(t, b1n)) === iI((g7(), het)))), + SE(new SR(null, new Nz(t.a, 16)), new aw(n)), + SE(WJ(new SR(null, new Nz(t.b, 16)), new mt()), new uw(n)), + (i = new pyn(t)), + b5(t, (Ojn(), zQn), i), + _U(n.a), + q_(n.a, ($un(), YGn), Yx(Aun(t, r1n), 246)), + q_(n.a, JGn, Yx(Aun(t, B1n), 246)), + q_(n.a, ZGn, Yx(Aun(t, i1n), 246)), + q_(n.a, nzn, Yx(Aun(t, Z1n), 246)), + q_( + n.a, + tzn, + (function (n) { + var t; + return qC(), AT(E4n, n) || (((t = new ua()).a = n), VL(E4n, n, t)), Yx(GB(E4n, n), 635); + })(Yx(Aun(t, b1n), 218)), + ), + aC( + n.a, + (function (n) { + var t, e, i; + switch ( + ((e = Yx(Aun(n, (Ojn(), bQn)), 21)), + (t = vC(WGn)), + Yx(Aun(n, (gjn(), E1n)), 334) == (O8(), $et) && T3(t, VGn), + ny(hL(Aun(n, k1n))) ? oR(t, ($un(), YGn), ($jn(), eXn)) : oR(t, ($un(), ZGn), ($jn(), eXn)), + null != Aun(n, (tQ(), K7n)) && T3(t, QGn), + (ny(hL(Aun(n, O1n))) || ny(hL(Aun(n, j1n)))) && yK(t, ($un(), tzn), ($jn(), gUn)), + Yx(Aun(n, a1n), 103).g) + ) { + case 2: + case 3: + case 4: + yK(oR(t, ($un(), YGn), ($jn(), vUn)), tzn, pUn); + } + switch ( + (e.Hc((edn(), TVn)) && yK(oR(oR(t, ($un(), YGn), ($jn(), dUn)), nzn, bUn), tzn, wUn), + iI(Aun(n, F1n)) !== iI((_bn(), q2n)) && oR(t, ($un(), ZGn), ($jn(), WUn)), + e.Hc(AVn) && (oR(t, ($un(), YGn), ($jn(), nXn)), oR(t, JGn, JUn), oR(t, ZGn, ZUn)), + iI(Aun(n, BZn)) !== iI((uon(), mVn)) && iI(Aun(n, b1n)) !== iI((g7(), fet)) && yK(t, ($un(), tzn), ($jn(), AUn)), + ny(hL(Aun(n, M1n))) && oR(t, ($un(), ZGn), ($jn(), OUn)), + ny(hL(Aun(n, e1n))) && oR(t, ($un(), ZGn), ($jn(), oXn)), + (function (n) { + var t, e, i, r; + return iI(Aun(n, (gjn(), E1n))) === iI((O8(), $et)) + ? !n.e && iI(Aun(n, YZn)) !== iI((r4(), xVn)) + : ((i = Yx(Aun(n, JZn), 292)), + (r = ny(hL(Aun(n, e1n))) || iI(Aun(n, i1n)) === iI((O0(), EWn))), + (t = Yx(Aun(n, QZn), 19).a), + (e = n.a.c.length), + !r && i != (r4(), xVn) && (0 == t || t > e)); + })(n) && + ((i = + (iI(Aun(n, E1n)) === iI($et) ? Yx(Aun(n, YZn), 292) : Yx(Aun(n, JZn), 292)) == (r4(), DVn) + ? ($jn(), YUn) + : ($jn(), fXn)), + oR(t, ($un(), nzn), i)), + Yx(Aun(n, c2n), 377).g) + ) { + case 1: + oR(t, ($un(), nzn), ($jn(), sXn)); + break; + case 2: + yK(oR(oR(t, ($un(), ZGn), ($jn(), sUn)), nzn, hUn), tzn, fUn); + } + return iI(Aun(n, XZn)) !== iI((k5(), W2n)) && oR(t, ($un(), ZGn), ($jn(), hXn)), t; + })(t), + ), + b5(t, _Qn, Zmn(n.a, t)); + } + function Lyn(n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m; + for (h = JTn, f = JTn, o = ZTn, s = ZTn, b = new pb(t.i); b.a < b.c.c.length; ) + (l = Yx(Hz(b), 65)), + jC((c = Yx(Yx(BF(n.g, l.a), 46).b, 33)), l.b.c, l.b.d), + (h = e.Math.min(h, c.i)), + (f = e.Math.min(f, c.j)), + (o = e.Math.max(o, c.i + c.g)), + (s = e.Math.max(s, c.j + c.f)); + for ( + w = Yx(jln(n.c, (Dun(), P9n)), 116), + xkn(n.c, o - h + (w.b + w.c), s - f + (w.d + w.a), !0, !0), + Pun(n.c, -h + w.b, -f + w.d), + r = new UO(CH(n.c)); + r.e != r.i.gc(); + + ) + (u = Ywn((i = Yx(hen(r), 79)), !0, !0)), + (d = Kun(i)), + (p = Bun(i)), + (g = new QS(d.i + d.g / 2, d.j + d.f / 2)), + (a = new QS(p.i + p.g / 2, p.j + p.f / 2)), + Ecn((v = yN(new QS(a.a, a.b), g)), d.g, d.f), + mN(g, v), + Ecn((m = yN(new QS(g.a, g.b), a)), p.g, p.f), + mN(a, m), + TC(u, g.a, g.b), + EC(u, a.a, a.b); + } + function Nyn(n) { + uT( + n, + new tun( + ck( + tk( + rk( + nk( + ik(ek(new du(), f$n), "ELK Mr. Tree"), + "Tree-based algorithm provided by the Eclipse Layout Kernel. Computes a spanning tree of the input graph and arranges all nodes according to the resulting parent-children hierarchy. I pity the fool who doesn't use Mr. Tree Layout.", + ), + new Na(), + ), + l$n, + ), + J9((zfn(), bct)), + ), + ), + ), + DU(n, f$n, fPn, G5n), + DU(n, f$n, LPn, 20), + DU(n, f$n, hPn, OPn), + DU(n, f$n, $Pn, d9(1)), + DU(n, f$n, DPn, (TA(), !0)), + DU(n, f$n, oAn, oen(R5n)), + DU(n, f$n, HPn, oen(_5n)), + DU(n, f$n, eIn, oen(F5n)), + DU(n, f$n, BPn, oen(B5n)), + DU(n, f$n, qPn, oen(K5n)), + DU(n, f$n, FPn, oen(H5n)), + DU(n, f$n, GPn, oen(z5n)), + DU(n, f$n, o$n, oen(Q5n)), + DU(n, f$n, s$n, oen(X5n)); + } + function xyn(n, t) { + t.dc() && hD(n.j, !0, !0, !0, !0), + Q8(t, (Ikn(), Oit)) && hD(n.j, !0, !0, !0, !1), + Q8(t, Mit) && hD(n.j, !1, !0, !0, !0), + Q8(t, Kit) && hD(n.j, !0, !0, !1, !0), + Q8(t, Fit) && hD(n.j, !0, !1, !0, !0), + Q8(t, Ait) && hD(n.j, !1, !0, !0, !1), + Q8(t, Sit) && hD(n.j, !1, !0, !1, !0), + Q8(t, _it) && hD(n.j, !0, !1, !1, !0), + Q8(t, Rit) && hD(n.j, !0, !1, !0, !1), + Q8(t, xit) && hD(n.j, !0, !0, !0, !0), + Q8(t, Iit) && hD(n.j, !0, !0, !0, !0), + Q8(t, xit) && hD(n.j, !0, !0, !0, !0), + Q8(t, Pit) && hD(n.j, !0, !0, !0, !0), + Q8(t, Dit) && hD(n.j, !0, !0, !0, !0), + Q8(t, Nit) && hD(n.j, !0, !0, !0, !0), + Q8(t, Lit) && hD(n.j, !0, !0, !0, !0); + } + function Dyn(n, t, e) { + var i, r, c, a, u, o, s, h, f; + if (n.a != t.Aj()) throw hp(new Qm(ONn + t.ne() + ANn)); + if ((i = U8((wsn(), wut), t).$k())) return i.Aj().Nh().Ih(i, e); + if ((a = U8(wut, t).al())) { + if (null == e) return null; + if ((u = Yx(e, 15)).dc()) return ""; + for (f = new Cy(), c = u.Kc(); c.Ob(); ) (r = c.Pb()), pI(f, a.Aj().Nh().Ih(a, r)), (f.a += " "); + return UI(f, f.a.length - 1); + } + if (!(h = U8(wut, t).bl()).dc()) { + for (s = h.Kc(); s.Ob(); ) + if ((o = Yx(s.Pb(), 148)).wj(e)) + try { + if (null != (f = o.Aj().Nh().Ih(o, e))) return f; + } catch (n) { + if (!CO((n = j4(n)), 102)) throw hp(n); + } + throw hp(new Qm("Invalid value: '" + e + "' for datatype :" + t.ne())); + } + return Yx(t, 834).Fj(), null == e ? null : CO(e, 172) ? "" + Yx(e, 172).a : V5(e) == N_n ? gO(Grt[0], Yx(e, 199)) : I7(e); + } + function Ryn(n, t, i, r, c) { + var a, u, o, s; + return ( + (s = JTn), + (u = !1), + (a = + !!(o = Zvn(n, yN(new QS(t.a, t.b), n), mN(new QS(i.a, i.b), c), yN(new QS(r.a, r.b), i))) && + !( + (e.Math.abs(o.a - n.a) <= TLn && e.Math.abs(o.b - n.b) <= TLn) || + (e.Math.abs(o.a - t.a) <= TLn && e.Math.abs(o.b - t.b) <= TLn) + )), + (o = Zvn(n, yN(new QS(t.a, t.b), n), i, c)) && + ((e.Math.abs(o.a - n.a) <= TLn && e.Math.abs(o.b - n.b) <= TLn) == + (e.Math.abs(o.a - t.a) <= TLn && e.Math.abs(o.b - t.b) <= TLn) || a + ? (s = e.Math.min(s, fB(yN(o, i)))) + : (u = !0)), + (o = Zvn(n, yN(new QS(t.a, t.b), n), r, c)) && + (u || + (e.Math.abs(o.a - n.a) <= TLn && e.Math.abs(o.b - n.b) <= TLn) == + (e.Math.abs(o.a - t.a) <= TLn && e.Math.abs(o.b - t.b) <= TLn) || + a) && + (s = e.Math.min(s, fB(yN(o, r)))), + s + ); + } + function Kyn(n) { + uT( + n, + new tun( + tk( + rk( + nk( + ik(ek(new du(), nIn), tIn), + "Minimizes the stress within a layout using stress majorization. Stress exists if the euclidean distance between a pair of nodes doesn't match their graph theoretic distance, that is, the shortest path between the two nodes. The method allows to specify individual edge lengths.", + ), + new gt(), + ), + APn, + ), + ), + ), + DU(n, nIn, RPn, oen(xGn)), + DU(n, nIn, _Pn, (TA(), !0)), + DU(n, nIn, HPn, oen(KGn)), + DU(n, nIn, eIn, oen(_Gn)), + DU(n, nIn, BPn, oen(FGn)), + DU(n, nIn, qPn, oen(RGn)), + DU(n, nIn, FPn, oen(BGn)), + DU(n, nIn, GPn, oen(HGn)), + DU(n, nIn, VPn, oen(NGn)), + DU(n, nIn, YPn, oen($Gn)), + DU(n, nIn, JPn, oen(LGn)), + DU(n, nIn, ZPn, oen(DGn)), + DU(n, nIn, QPn, oen(AGn)); + } + function _yn(n, t) { + var e, i, r, c, a, u, o, s, h; + if (5 != t.e) { + if (null != (s = t).b && null != n.b) { + for ( + xln(n), Lmn(n), xln(s), Lmn(s), e = VQ(Wot, MTn, 25, n.b.length + s.b.length, 15, 1), h = 0, i = 0, a = 0; + i < n.b.length && a < s.b.length; + + ) + if (((r = n.b[i]), (c = n.b[i + 1]), (u = s.b[a]), (o = s.b[a + 1]), c < u)) (e[h++] = n.b[i++]), (e[h++] = n.b[i++]); + else if (c >= u && r <= o) + u <= r && c <= o + ? (i += 2) + : u <= r + ? ((n.b[i] = o + 1), (a += 2)) + : c <= o + ? ((e[h++] = r), (e[h++] = u - 1), (i += 2)) + : ((e[h++] = r), (e[h++] = u - 1), (n.b[i] = o + 1), (a += 2)); + else { + if (!(o < r)) + throw hp( + new Im( + "Token#subtractRanges(): Internal Error: [" + n.b[i] + "," + n.b[i + 1] + "] - [" + s.b[a] + "," + s.b[a + 1] + "]", + ), + ); + a += 2; + } + for (; i < n.b.length; ) (e[h++] = n.b[i++]), (e[h++] = n.b[i++]); + (n.b = VQ(Wot, MTn, 25, h, 15, 1)), smn(e, 0, n.b, 0, h); + } + } else Eyn(n, t); + } + function Fyn(n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b; + if (!n.b) return !1; + for (a = null, l = null, r = 1, (o = new nY(null, null)).a[1] = n.b, f = o; f.a[r]; ) + (s = r), + (u = l), + (l = f), + (f = f.a[r]), + (r = (i = n.a.ue(t, f.d)) < 0 ? 0 : 1), + 0 == i && (!e.c || qB(f.e, e.d)) && (a = f), + (f && f.b) || + cy(f.a[r]) || + (cy(f.a[1 - r]) + ? (l = l.a[s] = c2(f, r)) + : cy(f.a[1 - r]) || + ((b = l.a[1 - s]) && + (cy(b.a[1 - s]) || cy(b.a[s]) + ? ((c = u.a[1] == l ? 1 : 0), + cy(b.a[s]) ? (u.a[c] = LU(l, s)) : cy(b.a[1 - s]) && (u.a[c] = c2(l, s)), + (f.b = u.a[c].b = !0), + (u.a[c].a[0].b = !1), + (u.a[c].a[1].b = !1)) + : ((l.b = !1), (b.b = !0), (f.b = !0))))); + return ( + a && + ((e.b = !0), + (e.d = a.e), + f != a && + ((function (n, t, e, i) { + var r, c; + for (r = null == (c = t).d || n.a.ue(e.d, c.d) > 0 ? 1 : 0; c.a[r] != e; ) + (c = c.a[r]), (r = n.a.ue(e.d, c.d) > 0 ? 1 : 0); + (c.a[r] = i), (i.b = e.b), (i.a[0] = e.a[0]), (i.a[1] = e.a[1]), (e.a[0] = null), (e.a[1] = null); + })(n, o, a, (h = new nY(f.d, f.e))), + l == a && (l = h)), + (l.a[l.a[1] == f ? 1 : 0] = f.a[f.a[0] ? 0 : 1]), + --n.c), + (n.b = o.a[1]), + n.b && (n.b.b = !1), + e.b + ); + } + function Byn(n, t, i) { + var r, c, a, u, o, s, h, f, l, b; + if (i) + for (r = -1, f = new JU(t, 0); f.b < f.d.gc(); ) { + if ((S$(f.b < f.d.gc()), (o = Yx(f.d.Xb((f.c = f.b++)), 10)), null == (l = n.c[o.c.p][o.p].a))) { + for (u = r + 1, a = new JU(t, f.b); a.b < a.d.gc(); ) + if (null != (b = DO(n, (S$(a.b < a.d.gc()), Yx(a.d.Xb((a.c = a.b++)), 10))).a)) { + vB(b), (u = b); + break; + } + (l = (r + u) / 2), (n.c[o.c.p][o.p].a = l), (n.c[o.c.p][o.p].d = (vB(l), l)), (n.c[o.c.p][o.p].b = 1); + } + vB(l), (r = l); + } + else { + for (c = 0, h = new pb(t); h.a < h.c.c.length; ) + (o = Yx(Hz(h), 10)), null != n.c[o.c.p][o.p].a && (c = e.Math.max(c, ty(n.c[o.c.p][o.p].a))); + for (c += 2, s = new pb(t); s.a < s.c.c.length; ) + (o = Yx(Hz(s), 10)), + null == n.c[o.c.p][o.p].a && + ((l = Xln(n.i, 24) * jMn * c - 1), (n.c[o.c.p][o.p].a = l), (n.c[o.c.p][o.p].d = l), (n.c[o.c.p][o.p].b = 1)); + } + } + function Hyn(n) { + var t, e, i, r, c, a, u, o; + for (t = null, i = new pb(n); i.a < i.c.c.length; ) + ty(NO((e = Yx(Hz(i), 233)).g, e.d[0]).a), + (e.b = null), + e.e && e.e.gc() > 0 && 0 == e.c && (!t && (t = new ip()), (t.c[t.c.length] = e)); + if (t) + for (; 0 != t.c.length; ) { + if ((e = Yx(KV(t, 0), 233)).b && e.b.c.length > 0) + for (!e.b && (e.b = new ip()), c = new pb(e.b); c.a < c.c.c.length; ) + if (ey(NO((r = Yx(Hz(c), 233)).g, r.d[0]).a) == ey(NO(e.g, e.d[0]).a)) { + if (hJ(n, r, 0) > hJ(n, e, 0)) return new mP(r, e); + } else if (ty(NO(r.g, r.d[0]).a) > ty(NO(e.g, e.d[0]).a)) return new mP(r, e); + for (u = (!e.e && (e.e = new ip()), e.e).Kc(); u.Ob(); ) + !(a = Yx(u.Pb(), 233)).b && (a.b = new ip()), + iz(0, (o = a.b).c.length), + GT(o.c, 0, e), + a.c == o.c.length && (t.c[t.c.length] = a); + } + return null; + } + function qyn(n, t) { + var e, i, r, c, a, u; + if (null == n) return aEn; + if (null != t.a.zc(n, t)) return "[...]"; + for (e = new J3(tEn, "[", "]"), c = 0, a = (r = n).length; c < a; ++c) + null != (i = r[c]) && 0 != (4 & V5(i).i) + ? !Array.isArray(i) || ((u = QJ(i)) >= 14 && u <= 16) + ? CO(i, 177) + ? HV(e, ohn(Yx(i, 177))) + : CO(i, 190) + ? HV(e, Kan(Yx(i, 190))) + : CO(i, 195) + ? HV(e, jon(Yx(i, 195))) + : CO(i, 2012) + ? HV(e, _an(Yx(i, 2012))) + : CO(i, 48) + ? HV(e, uhn(Yx(i, 48))) + : CO(i, 364) + ? HV(e, Ahn(Yx(i, 364))) + : CO(i, 832) + ? HV(e, ahn(Yx(i, 832))) + : CO(i, 104) && HV(e, chn(Yx(i, 104))) + : t.a._b(i) + ? (e.a ? yI(e.a, e.b) : (e.a = new SA(e.d)), vI(e.a, "[...]")) + : HV(e, qyn(h1(i), new kR(t))) + : HV(e, null == i ? aEn : I7(i)); + return e.a ? (0 == e.e.length ? e.a.a : e.a.a + "" + e.e) : e.c; + } + function Gyn(n, t, i, r) { + var c, a, u, o, s, h, f, l, b, w, d, g; + for ( + w = Kon(Ywn(t, !1, !1)), + r && (w = U5(w)), + g = ty(fL(jln(t, (len(), Aqn)))), + S$(0 != w.b), + b = Yx(w.a.a.c, 8), + h = Yx(ken(w, 1), 8), + w.b > 2 + ? (S4((s = new ip()), new Oz(w, 1, w.b)), o4((d = new eln(yjn(s, g + n.a))), t), (i.c[i.c.length] = d)) + : (d = Yx(BF(n.b, r ? Kun(t) : Bun(t)), 266)), + u = Kun(t), + r && (u = Bun(t)), + a = (function (n, t) { + var i, r, c; + return ( + (c = wPn), + Pen(), + (r = bqn), + (c = e.Math.abs(n.b)), + (i = e.Math.abs(t.f - n.b)) < c && ((c = i), (r = wqn)), + (i = e.Math.abs(n.a)) < c && ((c = i), (r = dqn)), + (i = e.Math.abs(t.g - n.a)) < c && ((c = i), (r = lqn)), + r + ); + })(b, u), + o = g + n.a, + a.a + ? ((o += e.Math.abs(b.b - h.b)), (l = new QS(h.a, (h.b + b.b) / 2))) + : ((o += e.Math.abs(b.a - h.a)), (l = new QS((h.a + b.a) / 2, h.b))), + xB(r ? n.d : n.c, t, new Bin(d, a, l, o)), + xB(n.b, t, d), + !t.n && (t.n = new m_(act, t, 1, 7)), + f = new UO(t.n); + f.e != f.i.gc(); + + ) + (c = lgn(n, Yx(hen(f), 137), !0, 0, 0)), (i.c[i.c.length] = c); + } + function zyn(n, t, e) { + var i, r, c, a, u; + if ( + ((u = n.c), + !t && (t = Wat), + (n.c = t), + 0 != (4 & n.Db) && 0 == (1 & n.Db) && ((a = new p_(n, 1, 2, u, n.c)), e ? e.Ei(a) : (e = a)), + u != t) + ) + if (CO(n.Cb, 284)) + n.Db >> 16 == -10 + ? (e = Yx(n.Cb, 284).nk(t, e)) + : n.Db >> 16 == -15 && + (!t && (xjn(), (t = Pat)), + !u && (xjn(), (u = Pat)), + n.Cb.nh() && ((a = new yJ(n.Cb, 1, 13, u, t, Ren(IJ(Yx(n.Cb, 59)), n), !1)), e ? e.Ei(a) : (e = a))); + else if (CO(n.Cb, 88)) + n.Db >> 16 == -23 && + (CO(t, 88) || (xjn(), (t = Oat)), + CO(u, 88) || (xjn(), (u = Oat)), + n.Cb.nh() && ((a = new yJ(n.Cb, 1, 10, u, t, Ren(tW(Yx(n.Cb, 26)), n), !1)), e ? e.Ei(a) : (e = a))); + else if (CO(n.Cb, 444)) + for (!(c = Yx(n.Cb, 836)).b && (c.b = new Xg(new Wv())), r = new Wg(new t6(new Ql(c.b.a).a)); r.a.b; ) + e = zyn((i = Yx(s1(r.a).cd(), 87)), dbn(i, c), e); + return e; + } + function Uyn(n) { + var t, i, r, c, a, u, o, s, h, f, l, b; + if ((b = Yx(jln(n, (Cjn(), Jnt)), 21)).dc()) return null; + if (((o = 0), (u = 0), b.Hc((Ann(), Zit)))) { + for ( + f = Yx(jln(n, ktt), 98), + r = 2, + i = 2, + c = 2, + a = 2, + t = IG(n) ? Yx(jln(IG(n), Pnt), 103) : Yx(jln(n, Pnt), 103), + h = new UO((!n.c && (n.c = new m_(oct, n, 9, 9)), n.c)); + h.e != h.i.gc(); + + ) + if ( + ((s = Yx(hen(h), 118)), (l = Yx(jln(s, Itt), 61)) == (Ikn(), Hit) && ((l = Zpn(s, t)), Aen(s, Itt, l)), f == (Ran(), oit)) + ) + switch (l.g) { + case 1: + r = e.Math.max(r, s.i + s.g); + break; + case 2: + i = e.Math.max(i, s.j + s.f); + break; + case 3: + c = e.Math.max(c, s.i + s.g); + break; + case 4: + a = e.Math.max(a, s.j + s.f); + } + else + switch (l.g) { + case 1: + r += s.g + 2; + break; + case 2: + i += s.f + 2; + break; + case 3: + c += s.g + 2; + break; + case 4: + a += s.f + 2; + } + (o = e.Math.max(r, c)), (u = e.Math.max(i, a)); + } + return xkn(n, o, u, !0, !0); + } + function Xyn(n, t, i, r, c) { + var a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k; + for ( + m = Yx( + kW( + HZ(hH(new SR(null, new Nz(t.d, 16)), new td(i)), new ed(i)), + mY(new H(), new B(), new rn(), x4(Gy(wBn, 1), XEn, 132, 0, [(C6(), aBn)])), + ), + 15, + ), + l = Yjn, + f = nTn, + s = new pb(t.b.j); + s.a < s.c.c.length; + + ) + (o = Yx(Hz(s), 11)).j == i && ((l = e.Math.min(l, o.p)), (f = e.Math.max(f, o.p))); + if (l == Yjn) for (u = 0; u < m.gc(); u++) gY(Yx(m.Xb(u), 101), i, u); + else + for ( + (function (n, t) { + var e; + for (e = 0; e < t; ++e) n[e] = -1; + })((y = VQ(Wot, MTn, 25, c.length, 15, 1)), y.length), + v = m.Kc(); + v.Ob(); + + ) { + for (p = Yx(v.Pb(), 101), a = Yx(BF(n.b, p), 177), h = 0, g = l; g <= f; g++) a[g] && (h = e.Math.max(h, r[g])); + if (p.i) { + for (w = p.i.c, k = new Qp(), b = 0; b < c.length; b++) c[w][b] && __(k, d9(y[b])); + for (; gE(k, d9(h)); ) ++h; + } + for (gY(p, i, h), d = l; d <= f; d++) a[d] && (r[d] = h + 1); + p.i && (y[p.i.c] = h); + } + } + function Wyn(n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d; + for (c = null, r = new pb(t.a); r.a < r.c.c.length; ) + Mmn((i = Yx(Hz(r), 10))) + ? ((h = new pH(i, !0, (o = HA(DE(new ev(), i), n.f)), (s = HA(DE(new ev(), i), n.f)))), + (f = i.o.b), + Hen(), + (b = 1e4), + (l = (i.q ? i.q : (XH(), XH(), MFn))._b((gjn(), Y1n)) ? Yx(Aun(i, Y1n), 197) : Yx(Aun(dB(i), J1n), 197)) == T2n && (b = 1), + (w = uwn(NE(LE($E(xE(new tv(), b), oG(e.Math.ceil(f))), o), s))), + l == M2n && __(n.d, w), + lpn(n, I3(i7(i, (Ikn(), qit))), h), + lpn(n, i7(i, Eit), h), + (a = h)) + : ((d = HA(DE(new ev(), i), n.f)), SE(hH(new SR(null, new Nz(i.j, 16)), new Bc()), new mS(n, d)), (a = new pH(i, !1, d, d))), + (n.i[i.p] = a), + c && + ((u = c.c.d.a + lO(n.n, c.c, i) + i.d.d), + c.b || (u += c.c.o.b), + uwn(NE(LE(xE($E(new tv(), oG(e.Math.ceil(u))), 0), c.d), a.a))), + (c = a); + } + function Vyn(n, t, i, r) { + var c, a, u, o, s, h, f, l, b, w; + for ( + l = (function (n, t, e) { + var i, r, c, a, u, o, s, h, f; + for ( + i = e.c, + r = e.d, + u = Dz(t.c), + o = Dz(t.d), + i == t.c ? ((u = hbn(n, u, r)), (o = Tun(t.d))) : ((u = Tun(t.c)), (o = hbn(n, o, r))), + VW((s = new kk(t.a)), u, s.a, s.a.a), + VW(s, o, s.c.b, s.c), + a = t.c == i, + f = new fv(), + c = 0; + c < s.b - 1; + ++c + ) + (h = new mP(Yx(ken(s, c), 8), Yx(ken(s, c + 1), 8))), (a && 0 == c) || (!a && c == s.b - 2) ? (f.b = h) : eD(f.a, h); + return f; + })(n, t, (a = new sfn(t))), + w = e.Math.max(ty(fL(Aun(t, (gjn(), y1n)))), 1), + f = new pb(l.a); + f.a < f.c.c.length; + + ) + (h = Yx(Hz(f), 46)), + zD(i, new QS((s = Dtn(Yx(h.a, 8), Yx(h.b, 8), w)).c, s.d)), + zD(i, $$(new QS(s.c, s.d), s.b, 0)), + zD(i, $$(new QS(s.c, s.d), 0, s.a)), + zD(i, $$(new QS(s.c, s.d), s.b, s.a)); + switch ( + ((b = a.d), + (o = Dtn(Yx(l.b.a, 8), Yx(l.b.b, 8), w)), + b == (Ikn(), qit) || b == Eit + ? ((r.c[b.g] = e.Math.min(r.c[b.g], o.d)), (r.b[b.g] = e.Math.max(r.b[b.g], o.d + o.a))) + : ((r.c[b.g] = e.Math.min(r.c[b.g], o.c)), (r.b[b.g] = e.Math.max(r.b[b.g], o.c + o.b))), + (c = ZTn), + (u = a.c.i.d), + b.g) + ) { + case 4: + c = u.c; + break; + case 2: + c = u.b; + break; + case 1: + c = u.a; + break; + case 3: + c = u.d; + } + return (r.a[b.g] = e.Math.max(r.a[b.g], c)), a; + } + function Qyn(n, t, e) { + var i, r, c, a, u, o, s, h; + for ( + o4((s = new rin(e)), t), + b5(s, (Ojn(), CQn), t), + s.o.a = t.g, + s.o.b = t.f, + s.n.a = t.i, + s.n.b = t.j, + eD(e.a, s), + xB(n.a, t, s), + (0 != (!t.a && (t.a = new m_(uct, t, 10, 11)), t.a).i || ny(hL(jln(t, (gjn(), I1n))))) && b5(s, ZVn, (TA(), !0)), + o = Yx(Aun(e, bQn), 21), + (h = Yx(Aun(s, (gjn(), g0n)), 98)) == (Ran(), lit) ? b5(s, g0n, fit) : h != fit && o.Fc((edn(), CVn)), + i = Yx(Aun(e, a1n), 103), + u = new UO((!t.c && (t.c = new m_(oct, t, 9, 9)), t.c)); + u.e != u.i.gc(); + + ) + ny(hL(jln((a = Yx(hen(u), 118)), r0n))) || dkn(n, a, s, o, i, h); + for (c = new UO((!t.n && (t.n = new m_(act, t, 1, 7)), t.n)); c.e != c.i.gc(); ) + !ny(hL(jln((r = Yx(hen(c), 137)), r0n))) && r.a && eD(s.b, d8(r)); + return ny(hL(Aun(s, KZn))) && o.Fc((edn(), TVn)), ny(hL(Aun(s, P1n))) && (o.Fc((edn(), IVn)), o.Fc(PVn), b5(s, g0n, fit)), s; + } + function Yyn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T; + (u = Yx(BF(t.c, n), 459)), + (g = t.a.c), + (o = t.a.c + t.a.b), + (a = (E = u.f) < (T = u.a)), + (b = new QS(g, E)), + (p = new QS(o, T)), + (w = new QS((r = (g + o) / 2), E)), + (v = new QS(r, T)), + (c = (function (n, t, e) { + var i, r, c; + if (((i = 0), (r = 0), n.c)) for (c = new pb(n.d.i.j); c.a < c.c.c.length; ) i += Yx(Hz(c), 11).e.c.length; + else i = 1; + if (n.d) for (c = new pb(n.c.i.j); c.a < c.c.c.length; ) r += Yx(Hz(c), 11).g.c.length; + else r = 1; + return (e + t) / 2 + 0.4 * oG(GD(r - i)) * (e - t); + })(n, E, T)), + (y = Dz(t.B)), + (k = new QS(r, c)), + (j = Dz(t.D)), + (e = (function (n) { + var t, e, i; + for (udn(), e = VQ(B7n, TEn, 8, 2, 0, 1), i = 0, t = 0; t < 2; t++) (i += 0.5), (e[t] = Ain(i, n)); + return e; + })(x4(Gy(B7n, 1), TEn, 8, 0, [y, k, j]))), + (f = !1), + (d = t.B.i) && + d.c && + u.d && + ((s = (a && d.p < d.c.a.c.length - 1) || (!a && d.p > 0)) + ? s && ((h = d.p), a ? ++h : --h, (f = !(Rbn((i = o5(Yx(TR(d.c.a, h), 10))), y, e[0]) || r_(i, y, e[0])))) + : (f = !0)), + (l = !1), + (m = t.D.i) && + m.c && + u.e && + ((a && m.p > 0) || (!a && m.p < m.c.a.c.length - 1) + ? ((h = m.p), a ? --h : ++h, (l = !(Rbn((i = o5(Yx(TR(m.c.a, h), 10))), e[0], j) || r_(i, e[0], j)))) + : (l = !0)), + f && l && KD(n.a, k), + f || r0(n.a, x4(Gy(B7n, 1), TEn, 8, 0, [b, w])), + l || r0(n.a, x4(Gy(B7n, 1), TEn, 8, 0, [v, p])); + } + function Jyn(n, t) { + var e, i, r, c, a, u, o; + if ( + (CO(n.Ug(), 160) ? (Jyn(Yx(n.Ug(), 160), t), (t.a += " > ")) : (t.a += "Root "), + _N((e = n.Tg().zb).substr(0, 3), "Elk") ? yI(t, e.substr(3)) : (t.a += "" + e), + (r = n.zg())) + ) + yI(((t.a += " "), t), r); + else if (CO(n, 354) && (o = Yx(n, 137).a)) yI(((t.a += " "), t), o); + else { + for (c = new UO(n.Ag()); c.e != c.i.gc(); ) if ((o = Yx(hen(c), 137).a)) return void yI(((t.a += " "), t), o); + if ( + CO(n, 352) && + (!(i = Yx(n, 79)).b && (i.b = new AN(Zrt, i, 4, 7)), 0 != i.b.i && (!i.c && (i.c = new AN(Zrt, i, 5, 8)), 0 != i.c.i)) + ) { + for (t.a += " (", a = new a$((!i.b && (i.b = new AN(Zrt, i, 4, 7)), i.b)); a.e != a.i.gc(); ) + a.e > 0 && (t.a += tEn), Jyn(Yx(hen(a), 160), t); + for (t.a += pIn, u = new a$((!i.c && (i.c = new AN(Zrt, i, 5, 8)), i.c)); u.e != u.i.gc(); ) + u.e > 0 && (t.a += tEn), Jyn(Yx(hen(u), 160), t); + t.a += ")"; + } + } + } + function Zyn(n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b; + if ((c = Yx(Aun(n, (Ojn(), CQn)), 79))) { + for ( + i = n.a, + mN( + (r = new fC(e)), + (function (n) { + var t, e, i, r; + if ((r = Yx(Aun(n, (Ojn(), nQn)), 37))) { + for (i = new Pk(), t = dB(n.c.i); t != r; ) (t = dB((e = t.e))), $$(mN(mN(i, e.n), t.c), t.d.b, t.d.d); + return i; + } + return nUn; + })(n), + ), + _3(n.d.i, n.c.i) ? ((l = n.c), yN((f = $5(x4(Gy(B7n, 1), TEn, 8, 0, [l.n, l.a]))), e)) : (f = Dz(n.c)), + VW(i, f, i.a, i.a.a), + b = Dz(n.d), + null != Aun(n, YQn) && mN(b, Yx(Aun(n, YQn), 8)), + VW(i, b, i.c.b, i.c), + o1(i, r), + L0((a = Ywn(c, !0, !0)), Yx(c1((!c.b && (c.b = new AN(Zrt, c, 4, 7)), c.b), 0), 82)), + N0(a, Yx(c1((!c.c && (c.c = new AN(Zrt, c, 5, 8)), c.c), 0), 82)), + wvn(i, a), + h = new pb(n.b); + h.a < h.c.c.length; + + ) + (s = Yx(Hz(h), 70)), + $1((u = Yx(Aun(s, CQn), 137)), s.o.a), + A1(u, s.o.b), + jC(u, s.n.a + r.a, s.n.b + r.b), + Aen(u, (m2(), dXn), hL(Aun(s, dXn))); + (o = Yx(Aun(n, (gjn(), $1n)), 74)) ? (o1(o, r), Aen(c, $1n, o)) : Aen(c, $1n, null), + t == (g7(), bet) ? Aen(c, b1n, bet) : Aen(c, b1n, null); + } + } + function nkn(n, t, i, r) { + var c, a, u, o, s, h, f, l, b, w, d, g, p, v, m; + return ( + (o = n), + (h = yN(new QS(t.a, t.b), n)), + (s = i), + (f = yN(new QS(r.a, r.b), i)), + (l = o.a), + (g = o.b), + (w = s.a), + (v = s.b), + (b = h.a), + (p = h.b), + (c = (d = f.a) * p - b * (m = f.b)), + XC(), + o0(UAn), + !(e.Math.abs(0 - c) <= UAn || 0 == c || (isNaN(0) && isNaN(c))) && + ((a = (1 / c) * ((l - w) * p - (g - v) * b)), + (u = (1 / c) * -(-(l - w) * m + (g - v) * d)), + o0(UAn), + (e.Math.abs(0 - a) <= UAn || 0 == a || (isNaN(0) && isNaN(a)) ? 0 : 0 < a ? -1 : 0 > a ? 1 : QI(isNaN(0), isNaN(a))) < 0 && + (o0(UAn), + (e.Math.abs(a - 1) <= UAn || 1 == a || (isNaN(a) && isNaN(1)) ? 0 : a < 1 ? -1 : a > 1 ? 1 : QI(isNaN(a), isNaN(1))) < 0) && + (o0(UAn), + (e.Math.abs(0 - u) <= UAn || 0 == u || (isNaN(0) && isNaN(u)) ? 0 : 0 < u ? -1 : 0 > u ? 1 : QI(isNaN(0), isNaN(u))) < 0) && + (o0(UAn), + (e.Math.abs(u - 1) <= UAn || 1 == u || (isNaN(u) && isNaN(1)) ? 0 : u < 1 ? -1 : u > 1 ? 1 : QI(isNaN(u), isNaN(1))) < 0)) + ); + } + function tkn(n, t, i, r, c, a, u) { + var o, s, h, f, l, b, w, d, g, p, v, m; + if ( + ((p = (function (n, t, e) { + var i, r, c, a, u, o, s, h; + for (h = new ip(), c = 0, c0((s = new dU(0, e)), new n6(0, 0, s, e)), r = 0, o = new UO(n); o.e != o.i.gc(); ) + (u = Yx(hen(o), 33)), + (i = Yx(TR(s.a, s.a.c.length - 1), 187)), + r + u.g + (0 == Yx(TR(s.a, 0), 187).b.c.length ? 0 : e) > t && + ((r = 0), (c += s.b + e), (h.c[h.c.length] = s), c0((s = new dU(c, e)), (i = new n6(0, s.f, s, e))), (r = 0)), + 0 == i.b.c.length || (u.f >= i.o && u.f <= i.f) || (0.5 * i.a <= u.f && 1.5 * i.a >= u.f) + ? l7(i, u) + : (c0(s, (a = new n6(i.s + i.r + e, s.f, s, e))), l7(a, u)), + (r = u.i + u.g); + return (h.c[h.c.length] = s), h; + })(t, i, n.g)), + c.n && c.n && a && nU(c, RU(a), (P6(), jrt)), + n.b) + ) + for (g = 0; g < p.c.length; g++) + $z(g, p.c.length), + (f = Yx(p.c[g], 200)), + 0 != g && ($z(g - 1, p.c.length), W6(f, (b = Yx(p.c[g - 1], 200)).f + b.b + n.g)), + Zkn(g, p, i, n.g), + ycn(n, f), + c.n && a && nU(c, RU(a), (P6(), jrt)); + else + for (d = new pb(p); d.a < d.c.c.length; ) + for (h = new pb((w = Yx(Hz(d), 200)).a); h.a < h.c.c.length; ) + o3((v = new pG((s = Yx(Hz(h), 187)).s, s.t, n.g)), s), eD(w.d, v); + return ( + (function (n, t) { + var i, r, c, a, u; + for (r = 0, c = 0, i = 0, u = new pb(t); u.a < u.c.c.length; ) + (a = Yx(Hz(u), 200)), (r = e.Math.max(r, a.e)), (c += a.b + (i > 0 ? n.g : 0)), ++i; + (n.c = c), (n.d = r); + })(n, p), + c.n && c.n && a && nU(c, RU(a), (P6(), jrt)), + (m = e.Math.max(n.d, r.a - (u.b + u.c))), + (o = (l = e.Math.max(n.c, r.b - (u.d + u.a))) - n.c), + n.e && n.f && (m / l < n.a ? (m = l * n.a) : (o += m / n.a - l)), + n.e && + (function (n, t, e) { + var i, r, c, a; + for (i = e / n.c.length, r = 0, a = new pb(n); a.a < a.c.c.length; ) + W6((c = Yx(Hz(a), 200)), c.f + i * r), Pcn(c, t, i), ++r; + })(p, m, o), + c.n && c.n && a && nU(c, RU(a), (P6(), jrt)), + new nR(n.a, m, n.c + o, (xbn(), Z8n)) + ); + } + function ekn(n, t) { + var e; + if (n.e) throw hp(new Ym((sL(OBn), UMn + OBn.k + XMn))); + if ( + !(function (n, t) { + return KA(n.e, t); + })(n.a, t) + ) + throw hp(new Im(WMn + t + VMn)); + if (t == n.d) return n; + switch (((e = n.d), (n.d = t), e.g)) { + case 0: + switch (t.g) { + case 2: + nrn(n); + break; + case 1: + C5(n), nrn(n); + break; + case 4: + can(n), nrn(n); + break; + case 3: + can(n), C5(n), nrn(n); + } + break; + case 2: + switch (t.g) { + case 1: + C5(n), egn(n); + break; + case 4: + can(n), nrn(n); + break; + case 3: + can(n), C5(n), nrn(n); + } + break; + case 1: + switch (t.g) { + case 2: + C5(n), egn(n); + break; + case 4: + C5(n), can(n), nrn(n); + break; + case 3: + C5(n), can(n), C5(n), nrn(n); + } + break; + case 4: + switch (t.g) { + case 2: + can(n), nrn(n); + break; + case 1: + can(n), C5(n), nrn(n); + break; + case 3: + C5(n), egn(n); + } + break; + case 3: + switch (t.g) { + case 2: + C5(n), can(n), nrn(n); + break; + case 1: + C5(n), can(n), C5(n), nrn(n); + break; + case 4: + C5(n), egn(n); + } + } + return n; + } + function ikn(n, t) { + var e; + if (n.d) throw hp(new Ym((sL(fzn), UMn + fzn.k + XMn))); + if ( + !(function (n, t) { + return KA(n.c, t); + })(n.a, t) + ) + throw hp(new Im(WMn + t + VMn)); + if (t == n.c) return n; + switch (((e = n.c), (n.c = t), e.g)) { + case 0: + switch (t.g) { + case 2: + X5(n); + break; + case 1: + I5(n), X5(n); + break; + case 4: + aan(n), X5(n); + break; + case 3: + aan(n), I5(n), X5(n); + } + break; + case 2: + switch (t.g) { + case 1: + I5(n), ign(n); + break; + case 4: + aan(n), X5(n); + break; + case 3: + aan(n), I5(n), X5(n); + } + break; + case 1: + switch (t.g) { + case 2: + I5(n), ign(n); + break; + case 4: + I5(n), aan(n), X5(n); + break; + case 3: + I5(n), aan(n), I5(n), X5(n); + } + break; + case 4: + switch (t.g) { + case 2: + aan(n), X5(n); + break; + case 1: + aan(n), I5(n), X5(n); + break; + case 3: + I5(n), ign(n); + } + break; + case 3: + switch (t.g) { + case 2: + I5(n), aan(n), X5(n); + break; + case 1: + I5(n), aan(n), I5(n), X5(n); + break; + case 4: + I5(n), ign(n); + } + } + return n; + } + function rkn(n, t, i) { + var r, c, a, u, o, s, h, f, l, b, w, d; + for (b = i.d, l = i.c, u = (a = new QS(i.f.a + i.d.b + i.d.c, i.f.b + i.d.d + i.d.a)).b, h = new pb(n.a); h.a < h.c.c.length; ) + if ((o = Yx(Hz(h), 10)).k == (bon(), _zn)) { + switch (((r = Yx(Aun(o, (Ojn(), hQn)), 61)), (c = Yx(Aun(o, fQn), 8)), (f = o.n), r.g)) { + case 2: + f.a = i.f.a + b.c - l.a; + break; + case 4: + f.a = -l.a - b.b; + } + switch (((d = 0), r.g)) { + case 2: + case 4: + t == (Ran(), sit) + ? ((w = ty(fL(Aun(o, KQn)))), (f.b = a.b * w - Yx(Aun(o, (gjn(), w0n)), 8).b), (d = f.b + c.b), b4(o, !1, !0)) + : t == oit && ((f.b = ty(fL(Aun(o, KQn))) - Yx(Aun(o, (gjn(), w0n)), 8).b), (d = f.b + c.b), b4(o, !1, !0)); + } + u = e.Math.max(u, d); + } + for (i.f.b += u - a.b, s = new pb(n.a); s.a < s.c.c.length; ) + if ((o = Yx(Hz(s), 10)).k == (bon(), _zn)) + switch (((r = Yx(Aun(o, (Ojn(), hQn)), 61)), (f = o.n), r.g)) { + case 1: + f.b = -l.b - b.d; + break; + case 3: + f.b = i.f.b + b.a - l.b; + } + } + function ckn(n, t, i) { + var r; + if ((run(i, "StretchWidth layering", 1), 0 != t.a.c.length)) { + for ( + n.c = t, + n.t = 0, + n.u = 0, + n.i = JTn, + n.g = ZTn, + n.d = ty(fL(Aun(t, (gjn(), N0n)))), + (function (n) { + var t, e, i; + for (i = n.c.a, n.p = (MF(i), new sx(i)), e = new pb(i); e.a < e.c.c.length; ) (t = Yx(Hz(e), 10)).p = Bsn(t).a; + XH(), JC(n.p, new Oc()); + })(n), + (function (n) { + var t, e, i, r, c; + for (i = 0, n.q = new ip(), t = new Qp(), c = new pb(n.p); c.a < c.c.c.length; ) { + for ((r = Yx(Hz(c), 10)).p = i, e = new $K(bA(o7(r).a.Kc(), new h())); Vfn(e); ) __(t, Yx(kV(e), 17).d.i); + t.a.Bc(r), eD(n.q, new kR(t)), t.a.$b(), ++i; + } + })(n), + (function (n) { + var t, e; + for ( + n.e = VQ(Wot, MTn, 25, n.p.c.length, 15, 1), n.k = VQ(Wot, MTn, 25, n.p.c.length, 15, 1), e = new pb(n.p); + e.a < e.c.c.length; + + ) + (t = Yx(Hz(e), 10)), + (n.e[t.p] = FX(new $K(bA(u7(t).a.Kc(), new h())))), + (n.k[t.p] = FX(new $K(bA(o7(t).a.Kc(), new h())))); + })(n), + (function (n) { + var t, i, r; + for (i = new pb(n.p); i.a < i.c.c.length; ) + (t = Yx(Hz(i), 10)).k == (bon(), Hzn) && ((r = t.o.b), (n.i = e.Math.min(n.i, r)), (n.g = e.Math.max(n.g, r))); + })(n), + (function (n) { + var t, e; + for (n.j = VQ(Jot, rMn, 25, n.p.c.length, 15, 1), e = new pb(n.p); e.a < e.c.c.length; ) + (t = Yx(Hz(e), 10)), (n.j[t.p] = t.o.b / n.i); + })(n), + n.i = e.Math.max(1, n.i), + n.g = e.Math.max(1, n.g), + n.d = n.d / n.i, + n.f = n.g / n.i, + n.s = (function (n) { + var t, e; + for (t = 0, e = new pb(n.c.a); e.a < e.c.c.length; ) t += FX(new $K(bA(o7(Yx(Hz(e), 10)).a.Kc(), new h()))); + return t / n.c.a.c.length; + })(n), + r = new qF(n.c), + eD(n.c.b, r), + n.r = Xz(n.p), + n.n = cG(n.k, n.k.length); + 0 != n.r.c.length; + + ) + (n.o = v8(n)), + !n.o || (M5(n) && 0 != n.b.a.gc()) + ? (San(n, r), (r = new qF(n.c)), eD(n.c.b, r), C2(n.a, n.b), n.b.a.$b(), (n.t = n.u), (n.u = 0)) + : M5(n) + ? ((n.c.b.c = VQ(UKn, iEn, 1, 0, 5, 1)), + (r = new qF(n.c)), + eD(n.c.b, r), + (n.t = 0), + (n.u = 0), + n.b.a.$b(), + n.a.a.$b(), + ++n.f, + (n.r = Xz(n.p)), + (n.n = cG(n.k, n.k.length))) + : (JG(n.o, r), uJ(n.r, n.o), __(n.b, n.o), (n.t = n.t - n.k[n.o.p] * n.d + n.j[n.o.p]), (n.u += n.e[n.o.p] * n.d)); + (t.a.c = VQ(UKn, iEn, 1, 0, 5, 1)), Dsn(t.b), Ron(i); + } else Ron(i); + } + function akn(n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v; + for (i = new ip(), w = new pb(t.a); w.a < w.c.c.length; ) + if ((l = (b = Yx(Hz(w), 10)).e) && (S4(i, akn(n, l, b)), Myn(n, l, b), Yx(Aun(l, (Ojn(), bQn)), 21).Hc((edn(), SVn)))) + for (p = Yx(Aun(b, (gjn(), g0n)), 98), f = Yx(Aun(b, m0n), 174).Hc((Chn(), pit)), g = new pb(b.j); g.a < g.c.c.length; ) + for ( + d = Yx(Hz(g), 11), + (r = Yx(BF(n.b, d), 10)) || + (b5((r = Jkn(d, p, d.j, -(d.e.c.length - d.g.c.length), null, new Pk(), d.o, Yx(Aun(l, a1n), 103), l)), CQn, d), + xB(n.b, d, r), + eD(l.a, r)), + c = Yx(TR(r.j, 0), 11), + s = new pb(d.f); + s.a < s.c.c.length; + + ) + (o = Yx(Hz(s), 70)), + ((a = new Sk()).o.a = o.o.a), + (a.o.b = o.o.b), + eD(c.f, a), + f || + ((v = d.j), + (h = 0), + c_(Yx(Aun(b, m0n), 21)) && (h = Fhn(o.n, o.o, d.o, 0, v)), + p == (Ran(), fit) || (Ikn(), Iit).Hc(v) ? (a.o.a = h) : (a.o.b = h)); + return ( + (function (n, t, e, i, r) { + var c, a, u, o, s, h, f, l, b, w, d, g; + for (c = new ip(), s = new pb(i); s.a < s.c.c.length; ) + if (((a = null), (u = Yx(Hz(s), 441)).f == (h0(), i3n))) + for (w = new pb(u.e); w.a < w.c.c.length; ) + dB((g = (b = Yx(Hz(w), 17)).d.i)) == t + ? zZ(n, t, u, b, u.b, b.d) + : !e || _3(g, e) + ? ton(n, t, u, i, b) + : ((l = Pmn(n, t, e, b, u.b, i3n, a)) != a && (c.c[c.c.length] = l), l.c && (a = l)); + else + for (f = new pb(u.e); f.a < f.c.c.length; ) + if (dB((d = (h = Yx(Hz(f), 17)).c.i)) == t) zZ(n, t, u, h, h.c, u.b); + else { + if (!e || _3(d, e)) continue; + (l = Pmn(n, t, e, h, u.b, e3n, a)) != a && (c.c[c.c.length] = l), l.c && (a = l); + } + for (o = new pb(c); o.a < o.c.c.length; ) + (u = Yx(Hz(o), 441)), -1 != hJ(t.a, u.a, 0) || eD(t.a, u.a), u.c && (r.c[r.c.length] = u); + })(n, t, e, i, (u = new ip())), + e && + (function (n, t, e, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y; + for (u = new ip(), r = new pb(t.a); r.a < r.c.c.length; ) + for (a = new pb(Yx(Hz(r), 10).j); a.a < a.c.c.length; ) { + for (s = null, m = 0, y = (v = CU((c = Yx(Hz(a), 11)).g)).length; m < y; ++m) + _3((p = v[m]).d.i, e) || ((g = Pmn(n, t, e, p, p.c, (h0(), i3n), s)) != s && (u.c[u.c.length] = g), g.c && (s = g)); + for (o = null, w = 0, d = (b = CU(c.e)).length; w < d; ++w) + _3((l = b[w]).c.i, e) || ((g = Pmn(n, t, e, l, l.d, (h0(), e3n), o)) != o && (u.c[u.c.length] = g), g.c && (o = g)); + } + for (f = new pb(u); f.a < f.c.c.length; ) + (h = Yx(Hz(f), 441)), -1 != hJ(t.a, h.a, 0) || eD(t.a, h.a), h.c && (i.c[i.c.length] = h); + })(n, t, e, u), + u + ); + } + function ukn(n, t, e) { + var i, r, c, a, u, o, s, h; + if (!n.c[t.c.p][t.p].e) { + for ( + n.c[t.c.p][t.p].e = !0, n.c[t.c.p][t.p].b = 0, n.c[t.c.p][t.p].d = 0, n.c[t.c.p][t.p].a = null, h = new pb(t.j); + h.a < h.c.c.length; + + ) + for (s = Yx(Hz(h), 11), o = (e ? new fw(s) : new bw(s)).Kc(); o.Ob(); ) + (a = (u = Yx(o.Pb(), 11)).i).c == t.c + ? a != t && (ukn(n, a, e), (n.c[t.c.p][t.p].b += n.c[a.c.p][a.p].b), (n.c[t.c.p][t.p].d += n.c[a.c.p][a.p].d)) + : ((n.c[t.c.p][t.p].d += n.g[u.p]), ++n.c[t.c.p][t.p].b); + if ((c = Yx(Aun(t, (Ojn(), VVn)), 15))) + for (r = c.Kc(); r.Ob(); ) + (i = Yx(r.Pb(), 10)), + t.c == i.c && (ukn(n, i, e), (n.c[t.c.p][t.p].b += n.c[i.c.p][i.p].b), (n.c[t.c.p][t.p].d += n.c[i.c.p][i.p].d)); + n.c[t.c.p][t.p].b > 0 && + ((n.c[t.c.p][t.p].d += Xln(n.i, 24) * jMn * 0.07000000029802322 - 0.03500000014901161), + (n.c[t.c.p][t.p].a = n.c[t.c.p][t.p].d / n.c[t.c.p][t.p].b)); + } + } + function okn(n, t, i, r, c) { + var a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E; + for (E = 0, w = 0, l = new pb(t.e); l.a < l.c.c.length; ) { + for ( + f = Yx(Hz(l), 10), + b = 0, + o = 0, + s = i ? Yx(Aun(f, u4n), 19).a : nTn, + v = r ? Yx(Aun(f, o4n), 19).a : nTn, + h = e.Math.max(s, v), + y = new pb(f.j); + y.a < y.c.c.length; + + ) { + if (((m = Yx(Hz(y), 11)), (k = f.n.b + m.n.b + m.a.b), r)) + for (u = new pb(m.g); u.a < u.c.c.length; ) + (d = (g = (a = Yx(Hz(u), 17)).d).i), + t != n.a[d.p] && + ((p = e.Math.max(Yx(Aun(d, u4n), 19).a, Yx(Aun(d, o4n), 19).a)), + (j = Yx(Aun(a, (gjn(), P0n)), 19).a) >= h && j >= p && ((b += d.n.b + g.n.b + g.a.b - k), ++o)); + if (i) + for (u = new pb(m.e); u.a < u.c.c.length; ) + (d = (g = (a = Yx(Hz(u), 17)).c).i), + t != n.a[d.p] && + ((p = e.Math.max(Yx(Aun(d, u4n), 19).a, Yx(Aun(d, o4n), 19).a)), + (j = Yx(Aun(a, (gjn(), P0n)), 19).a) >= h && j >= p && ((b += d.n.b + g.n.b + g.a.b - k), ++o)); + } + o > 0 && ((E += b / o), ++w); + } + w > 0 ? ((t.a = (c * E) / w), (t.g = w)) : ((t.a = 0), (t.g = 0)); + } + function skn(n, t) { + var i, r, c, a, u, o, s, h, f, l; + for (r = new pb(n.a.b); r.a < r.c.c.length; ) + for (o = new pb(Yx(Hz(r), 29).a); o.a < o.c.c.length; ) + (u = Yx(Hz(o), 10)), (t.j[u.p] = u), (t.i[u.p] = t.o == (RG(), m4n) ? ZTn : JTn); + for ( + U_(n.c), + a = n.a.b, + t.c == (Jq(), w4n) && (a = CO(a, 152) ? RV(Yx(a, 152)) : CO(a, 131) ? Yx(a, 131).a : CO(a, 54) ? new Tm(a) : new rE(a)), + (function (n, t, e) { + (n.a = t), (n.c = e), n.b.a.$b(), BH(n.d), (n.e.a.c = VQ(UKn, iEn, 1, 0, 5, 1)); + })(n.e, t, n.b), + qT(t.p, null), + c = a.Kc(); + c.Ob(); + + ) + for ( + s = Yx(c.Pb(), 29).a, + t.o == (RG(), m4n) && (s = CO(s, 152) ? RV(Yx(s, 152)) : CO(s, 131) ? Yx(s, 131).a : CO(s, 54) ? new Tm(s) : new rE(s)), + l = s.Kc(); + l.Ob(); + + ) + (f = Yx(l.Pb(), 10)), t.g[f.p] == f && Vkn(n, f, t); + for ( + (function (n, t) { + var i, r, c, a, u, o, s; + for (s = new ME(), o = new ub(new Zl(n.c).a.vc().Kc()); o.a.Ob(); ) + (c = Yx(o.a.Pb(), 42)), 0 == (a = Yx(c.dd(), 458)).b && VW(s, a, s.c.b, s.c); + for (; 0 != s.b; ) + for ( + null == (a = Yx(0 == s.b ? null : (S$(0 != s.b), VZ(s, s.a.a)), 458)).a && (a.a = 0), r = new pb(a.d); + r.a < r.c.c.length; + + ) + null == (i = Yx(Hz(r), 654)).b.a + ? (i.b.a = ty(a.a) + i.a) + : t.o == (RG(), v4n) + ? (i.b.a = e.Math.min(ty(i.b.a), ty(a.a) + i.a)) + : (i.b.a = e.Math.max(ty(i.b.a), ty(a.a) + i.a)), + --i.b.b, + 0 == i.b.b && KD(s, i.b); + for (u = new ub(new Zl(n.c).a.vc().Kc()); u.a.Ob(); ) (c = Yx(u.a.Pb(), 42)), (a = Yx(c.dd(), 458)), (t.i[a.c.p] = a.a); + })(n, t), + i = a.Kc(); + i.Ob(); + + ) + for (l = new pb(Yx(i.Pb(), 29).a); l.a < l.c.c.length; ) + (f = Yx(Hz(l), 10)), + (t.p[f.p] = t.p[t.g[f.p].p]), + f == t.g[f.p] && + ((h = ty(t.i[t.j[f.p].p])), + ((t.o == (RG(), m4n) && h > ZTn) || (t.o == v4n && h < JTn)) && (t.p[f.p] = ty(t.p[f.p]) + h)); + n.e.cg(); + } + function hkn(n, t, i, r) { + var c, a, u, o, s; + return ( + (function (n, t) { + var e, i, r, c; + for (e = !t || !n.u.Hc((Chn(), pit)), c = 0, r = new pb(n.e.Cf()); r.a < r.c.c.length; ) { + if ((i = Yx(Hz(r), 838)).Hf() == (Ikn(), Hit)) + throw hp(new Qm("Label and node size calculator can only be used with ports that have port sides assigned.")); + i.vf(c++), y8(n, i, e); + } + })((o = new vkn(t)), r), + (c = !0), + n && n.Xe((Cjn(), Pnt)) && (c = (a = Yx(n.We((Cjn(), Pnt)), 103)) == (t9(), tet) || a == Ztt || a == net), + _dn(o, !1), + WZ(o.e.wf(), new kx(o, !1, c)), + lG(o, o.f, (JZ(), rHn), (Ikn(), Tit)), + lG(o, o.f, aHn, Bit), + lG(o, o.g, rHn, qit), + lG(o, o.g, aHn, Eit), + Men(o, Tit), + Men(o, Bit), + UB(o, Eit), + UB(o, qit), + PL(), + (u = o.A.Hc((Ann(), Yit)) && o.B.Hc((Vgn(), urt)) ? dnn(o) : null) && + (function (n, t) { + n.b = new fC(t); + })(o.a, u), + (function (n) { + var t, i, r, c, a, u, o; + for (PL(), r = n.f.n, u = IF(n.r).a.nc(); u.Ob(); ) { + if (((c = 0), (a = Yx(u.Pb(), 111)).b.Xe((Cjn(), ytt)) && (c = ty(fL(a.b.We(ytt)))) < 0)) + switch (a.b.Hf().g) { + case 1: + r.d = e.Math.max(r.d, -c); + break; + case 3: + r.a = e.Math.max(r.a, -c); + break; + case 2: + r.c = e.Math.max(r.c, -c); + break; + case 4: + r.b = e.Math.max(r.b, -c); + } + if (c_(n.u)) + switch (((t = Y2(a.b, c)), (o = !Yx(n.e.We(itt), 174).Hc((Vgn(), irt))), (i = !1), a.b.Hf().g)) { + case 1: + (i = t > r.d), (r.d = e.Math.max(r.d, t)), o && i && ((r.d = e.Math.max(r.d, r.a)), (r.a = r.d + c)); + break; + case 3: + (i = t > r.a), (r.a = e.Math.max(r.a, t)), o && i && ((r.a = e.Math.max(r.a, r.d)), (r.d = r.a + c)); + break; + case 2: + (i = t > r.c), (r.c = e.Math.max(r.c, t)), o && i && ((r.c = e.Math.max(r.b, r.c)), (r.b = r.c + c)); + break; + case 4: + (i = t > r.b), (r.b = e.Math.max(r.b, t)), o && i && ((r.b = e.Math.max(r.b, r.c)), (r.c = r.b + c)); + } + } + })(o), + (function (n) { + switch (n.q.g) { + case 5: + Rcn(n, (Ikn(), Tit)), Rcn(n, Bit); + break; + case 4: + byn(n, (Ikn(), Tit)), byn(n, Bit); + break; + default: + Tsn(n, (Ikn(), Tit)), Tsn(n, Bit); + } + })(o), + (function (n) { + switch (n.q.g) { + case 5: + Kcn(n, (Ikn(), Eit)), Kcn(n, qit); + break; + case 4: + wyn(n, (Ikn(), Eit)), wyn(n, qit); + break; + default: + Msn(n, (Ikn(), Eit)), Msn(n, qit); + } + })(o), + (function (n) { + var t, e, i, r, c, a, u; + if (!n.A.dc()) { + if ( + (n.A.Hc((Ann(), Zit)) && + ((Yx(GB(n.b, (Ikn(), Tit)), 124).k = !0), + (Yx(GB(n.b, Bit), 124).k = !0), + (t = n.q != (Ran(), sit) && n.q != oit), + Il(Yx(GB(n.b, Eit), 124), t), + Il(Yx(GB(n.b, qit), 124), t), + Il(n.g, t), + n.A.Hc(nrt) && + ((Yx(GB(n.b, Tit), 124).j = !0), + (Yx(GB(n.b, Bit), 124).j = !0), + (Yx(GB(n.b, Eit), 124).k = !0), + (Yx(GB(n.b, qit), 124).k = !0), + (n.g.k = !0))), + n.A.Hc(Jit)) + ) + for (n.a.j = !0, n.a.k = !0, n.g.j = !0, n.g.k = !0, u = n.B.Hc((Vgn(), ort)), c = 0, a = (r = Xtn()).length; c < a; ++c) + (i = r[c]), (e = Yx(GB(n.i, i), 306)) && (ftn(i) ? ((e.j = !0), (e.k = !0)) : ((e.j = !u), (e.k = !u))); + n.A.Hc(Yit) && n.B.Hc((Vgn(), urt)) && ((n.g.j = !0), (n.g.j = !0), n.a.j || ((n.a.j = !0), (n.a.k = !0), (n.a.e = !0))); + } + })(o), + (function (n) { + var t, i, r, c; + (r = n.o), + PL(), + n.A.dc() || Q8(n.A, UHn) + ? (c = r.a) + : ((c = Rhn(n.f)), + n.A.Hc((Ann(), Jit)) && + !n.B.Hc((Vgn(), ort)) && + ((c = e.Math.max(c, Rhn(Yx(GB(n.p, (Ikn(), Tit)), 244)))), (c = e.Math.max(c, Rhn(Yx(GB(n.p, Bit), 244))))), + (t = L3(n)) && (c = e.Math.max(c, t.a))), + ny(hL(n.e.yf().We((Cjn(), ntt)))) ? (r.a = e.Math.max(r.a, c)) : (r.a = c), + ((i = n.f.i).c = 0), + (i.b = c), + cvn(n.f); + })(o), + (function (n) { + switch ((XA(), n.q.g)) { + case 5: + Lhn(n, (Ikn(), Tit)), Lhn(n, Bit); + break; + case 4: + Qln(n, (Ikn(), Tit)), Qln(n, Bit); + break; + default: + Skn(n, (Ikn(), Tit)), Skn(n, Bit); + } + })(o), + Ntn(o, Tit), + Ntn(o, Bit), + (function (n) { + var t, i, r, c, a, u; + n.q != (Ran(), sit) && + n.q != oit && + ((c = n.f.n.d + UD(Yx(GB(n.b, (Ikn(), Tit)), 124)) + n.c), + (t = n.f.n.a + UD(Yx(GB(n.b, Bit), 124)) + n.c), + (r = Yx(GB(n.b, Eit), 124)), + (u = Yx(GB(n.b, qit), 124)), + (a = e.Math.max(0, r.n.d - c)), + (a = e.Math.max(a, u.n.d - c)), + (i = e.Math.max(0, r.n.a - t)), + (i = e.Math.max(i, u.n.a - t)), + (r.n.d = a), + (u.n.d = a), + (r.n.a = i), + (u.n.a = i)); + })(o), + (function (n) { + var t, i, r, c; + (c = n.o), + PL(), + n.A.dc() || Q8(n.A, UHn) + ? (t = c.b) + : ((t = Dhn(n.f)), + n.A.Hc((Ann(), Jit)) && + !n.B.Hc((Vgn(), ort)) && + ((t = e.Math.max(t, Dhn(Yx(GB(n.p, (Ikn(), Eit)), 244)))), (t = e.Math.max(t, Dhn(Yx(GB(n.p, qit), 244))))), + (i = L3(n)) && (t = e.Math.max(t, i.b)), + n.A.Hc(Zit) && + ((n.q != (Ran(), sit) && n.q != oit) || + ((t = e.Math.max(t, UD(Yx(GB(n.b, (Ikn(), Eit)), 124)))), (t = e.Math.max(t, UD(Yx(GB(n.b, qit), 124))))))), + ny(hL(n.e.yf().We((Cjn(), ntt)))) ? (c.b = e.Math.max(c.b, t)) : (c.b = t), + ((r = n.f.i).d = 0), + (r.a = t), + hvn(n.f); + })(o), + i + ? ((function (n) { + var t, e; + for (PL(), t = n.o.b, e = Yx(Yx(_V(n.r, (Ikn(), Bit)), 21), 84).Kc(); e.Ob(); ) Yx(e.Pb(), 111).e.b += t; + })(o), + (function (n) { + switch ((XA(), n.q.g)) { + case 5: + pfn(n, (Ikn(), Eit)), pfn(n, qit); + break; + case 4: + gen(n, (Ikn(), Eit)), gen(n, qit); + break; + default: + Pkn(n, (Ikn(), Eit)), Pkn(n, qit); + } + })(o), + Ntn(o, Eit), + Ntn(o, qit), + (s = o.B.Hc((Vgn(), ort))), + nhn(o, s, Tit), + nhn(o, s, Bit), + thn(o, s, Eit), + thn(o, s, qit), + SE(new SR(null, new Nz(new Zl(o.i), 0)), new Cn()), + SE(hH(new SR(null, IF(o.r).a.oc()), new On()), new An()), + (function (n) { + var t, e, i; + PL(), + n.B.Hc((Vgn(), rrt)) && + ((i = n.f.i), + (t = new Tq(n.a.c)), + ((e = new Sv()).b = t.c - i.c), + (e.d = t.d - i.d), + (e.c = i.c + i.b - (t.c + t.b)), + (e.a = i.d + i.a - (t.d + t.a)), + n.e.Ff(e)); + })(o), + o.e.uf(o.o), + SE(new SR(null, IF(o.r).a.oc()), new Ln()), + o.o) + : o.o + ); + } + function fkn(n, t, i, r) { + var c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E; + if (0 != i.c.length) { + for (w = new ip(), b = new pb(i); b.a < b.c.c.length; ) eD(w, new QS((l = Yx(Hz(b), 33)).i, l.j)); + for (r.n && t && nU(r, RU(t), (P6(), jrt)); zun(n, i); ) Nln(n, i, !1); + for ( + r.n && t && nU(r, RU(t), (P6(), jrt)), + u = 0, + o = 0, + c = null, + 0 != i.c.length && + ($z(0, i.c.length), + (u = (c = Yx(i.c[0], 33)).i - ($z(0, w.c.length), Yx(w.c[0], 8)).a), + (o = c.j - ($z(0, w.c.length), Yx(w.c[0], 8)).b)), + a = e.Math.sqrt(u * u + o * o), + f = m8(i); + 0 != f.a.gc(); + + ) { + for (h = f.a.ec().Kc(); h.Ob(); ) + (s = Yx(h.Pb(), 33)), + (g = (d = n.f).i + d.g / 2), + (p = d.j + d.f / 2), + (v = s.i + s.g / 2), + (y = s.j + s.f / 2 - p), + (j = (m = v - g) / (k = e.Math.sqrt(m * m + y * y))), + (E = y / k), + L1(s, s.i + j * a), + N1(s, s.j + E * a); + r.n && t && nU(r, RU(t), (P6(), jrt)), (f = m8(new sx(f))); + } + n.a && n.a.lg(new sx(f)), r.n && t && nU(r, RU(t), (P6(), jrt)), fkn(n, t, new sx(f), r); + } + } + function lkn(n, t, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g, p, v; + if (((g = n.n), (p = n.o), (b = n.d), (l = ty(fL(pnn(n, (gjn(), A0n))))), t)) { + for (f = l * (t.gc() - 1), w = 0, s = t.Kc(); s.Ob(); ) (f += (u = Yx(s.Pb(), 10)).o.a), (w = e.Math.max(w, u.o.b)); + for (v = g.a - (f - p.a) / 2, a = g.b - b.d + w, c = r = p.a / (t.gc() + 1), o = t.Kc(); o.Ob(); ) + ((u = Yx(o.Pb(), 10)).n.a = v), + (u.n.b = a - u.o.b), + (v += u.o.a + l), + ((h = jbn(u)).n.a = u.o.a / 2 - h.a.a), + (h.n.b = u.o.b), + (d = Yx(Aun(u, (Ojn(), JVn)), 11)).e.c.length + d.g.c.length == 1 && ((d.n.a = c - d.a.a), (d.n.b = 0), ZG(d, n)), + (c += r); + } + if (i) { + for (f = l * (i.gc() - 1), w = 0, s = i.Kc(); s.Ob(); ) (f += (u = Yx(s.Pb(), 10)).o.a), (w = e.Math.max(w, u.o.b)); + for (v = g.a - (f - p.a) / 2, a = g.b + p.b + b.a - w, c = r = p.a / (i.gc() + 1), o = i.Kc(); o.Ob(); ) + ((u = Yx(o.Pb(), 10)).n.a = v), + (u.n.b = a), + (v += u.o.a + l), + ((h = jbn(u)).n.a = u.o.a / 2 - h.a.a), + (h.n.b = 0), + (d = Yx(Aun(u, (Ojn(), JVn)), 11)).e.c.length + d.g.c.length == 1 && ((d.n.a = c - d.a.a), (d.n.b = p.b), ZG(d, n)), + (c += r); + } + } + function bkn(n, t, e, i) { + var r, c, a, u, o, s, h, f, l, b, w, d; + for ( + o = new QS(i.i + i.g / 2, i.j + i.f / 2), + l = Nmn(i), + b = Yx(jln(t, (gjn(), g0n)), 98), + d = Yx(jln(i, k0n), 61), + nI(een(i), d0n) || + ((w = + 0 == i.i && 0 == i.j + ? 0 + : (function (n, t) { + var e; + if (!TG(n)) throw hp(new Ym(tNn)); + switch (((e = TG(n)), t.g)) { + case 1: + return -(n.j + n.f); + case 2: + return n.i - e.g; + case 3: + return n.j - e.f; + case 4: + return -(n.i + n.g); + } + return 0; + })(i, d)), + Aen(i, d0n, w)), + b5((r = Jkn(i, b, d, l, new QS(t.g, t.f), o, new QS(i.g, i.f), Yx(Aun(e, a1n), 103), e)), (Ojn(), CQn), i), + (function (n, t) { + n.c = t; + })( + (c = Yx(TR(r.j, 0), 11)), + (function (n) { + var t, e, i, r, c; + for (c = TG(n), r = new UO((!n.e && (n.e = new AN(nct, n, 7, 4)), n.e)); r.e != r.i.gc(); ) + if (((i = Yx(hen(r), 79)), !XZ(iun(Yx(c1((!i.c && (i.c = new AN(Zrt, i, 5, 8)), i.c), 0), 82)), c))) return !0; + for (e = new UO((!n.d && (n.d = new AN(nct, n, 8, 5)), n.d)); e.e != e.i.gc(); ) + if (((t = Yx(hen(e), 79)), !XZ(iun(Yx(c1((!t.b && (t.b = new AN(Zrt, t, 4, 7)), t.b), 0), 82)), c))) return !0; + return !1; + })(i), + ), + b5(r, m0n, (Chn(), J9(mit))), + h = Yx(jln(t, m0n), 174).Hc(pit), + u = new UO((!i.n && (i.n = new m_(act, i, 1, 7)), i.n)); + u.e != u.i.gc(); + + ) + if (!ny(hL(jln((a = Yx(hen(u), 137)), r0n))) && a.a && ((f = d8(a)), eD(c.f, f), !h)) + switch (((s = 0), c_(Yx(jln(t, m0n), 21)) && (s = Fhn(new QS(a.i, a.j), new QS(a.g, a.f), new QS(i.g, i.f), 0, d)), d.g)) { + case 2: + case 4: + f.o.a = s; + break; + case 1: + case 3: + f.o.b = s; + } + b5(r, H0n, fL(jln(IG(t), H0n))), b5(r, q0n, fL(jln(IG(t), q0n))), b5(r, F0n, fL(jln(IG(t), F0n))), eD(e.a, r), xB(n.a, i, r); + } + function wkn(n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m; + for ( + run(e, "Processor arrange level", 1), h = 0, XH(), I2(t, new Cg((ryn(), p5n))), c = t.b, u = Ztn(t, t.b), s = !0; + s && u.b.b != u.d.a; + + ) + (g = Yx(MU(u), 86)), 0 == Yx(Aun(g, p5n), 19).a ? --c : (s = !1); + if (((a = new ox(new Oz(t, 0, c))), (o = new ox(new Oz(t, c, t.b))), 0 == a.b)) + for (b = Ztn(o, 0); b.b != b.d.c; ) b5(Yx(IX(b), 86), T5n, d9(h++)); + else + for (f = a.b, m = Ztn(a, 0); m.b != m.d.c; ) { + for ( + b5((v = Yx(IX(m), 86)), T5n, d9(h++)), + wkn(n, (i = q4(v)), J2(e, (1 / f) | 0)), + I2(i, DB(new Cg(T5n))), + l = new ME(), + p = Ztn(i, 0); + p.b != p.d.c; + + ) + for (g = Yx(IX(p), 86), d = Ztn(v.d, 0); d.b != d.d.c; ) (w = Yx(IX(d), 188)).c == g && VW(l, w, l.c.b, l.c); + for (BH(v.d), C2(v.d, l), u = Ztn(o, o.b), r = v.d.b, s = !0; 0 < r && s && u.b.b != u.d.a; ) + (g = Yx(MU(u), 86)), 0 == Yx(Aun(g, p5n), 19).a ? (b5(g, T5n, d9(h++)), --r, BZ(u)) : (s = !1); + } + Ron(e); + } + function dkn(n, t, e, i, r, c) { + var a, u, o, s, h, f; + for ( + o4((s = new Ion()), t), + whn(s, Yx(jln(t, (gjn(), k0n)), 61)), + b5(s, (Ojn(), CQn), t), + ZG(s, e), + (f = s.o).a = t.g, + f.b = t.f, + (h = s.n).a = t.i, + h.b = t.j, + xB(n.a, t, s), + (a = JW(fH(WJ(new SR(null, (!t.e && (t.e = new AN(nct, t, 7, 4)), new Nz(t.e, 16))), new Vt()), new Xt()), new pw(t))) || + (a = JW(fH(WJ(new SR(null, (!t.d && (t.d = new AN(nct, t, 8, 5)), new Nz(t.d, 16))), new Qt()), new Wt()), new vw(t))), + a || (a = JW(new SR(null, (!t.e && (t.e = new AN(nct, t, 7, 4)), new Nz(t.e, 16))), new Yt())), + b5(s, gQn, (TA(), !!a)), + (function (n, t, e, i) { + var r, c, a, u, o, s; + if ( + ((u = n.j) == (Ikn(), Hit) && + t != (Ran(), fit) && + t != (Ran(), lit) && + (whn(n, (u = Tpn(n, e))), + !(n.q ? n.q : (XH(), XH(), MFn))._b((gjn(), d0n)) && + u != Hit && + (0 != n.n.a || 0 != n.n.b) && + b5( + n, + d0n, + (function (n, t) { + var e; + switch (((e = n.i), t.g)) { + case 1: + return -(n.n.b + n.o.b); + case 2: + return n.n.a - e.o.a; + case 3: + return n.n.b - e.o.b; + case 4: + return -(n.n.a + n.o.a); + } + return 0; + })(n, u), + )), + t == (Ran(), sit)) + ) { + switch (((s = 0), u.g)) { + case 1: + case 3: + (c = n.i.o.a) > 0 && (s = n.n.a / c); + break; + case 2: + case 4: + (r = n.i.o.b) > 0 && (s = n.n.b / r); + } + b5(n, (Ojn(), KQn), s); + } + if (((o = n.o), (a = n.a), i)) (a.a = i.a), (a.b = i.b), (n.d = !0); + else if (t != fit && t != lit && u != Hit) + switch (u.g) { + case 1: + a.a = o.a / 2; + break; + case 2: + (a.a = o.a), (a.b = o.b / 2); + break; + case 3: + (a.a = o.a / 2), (a.b = o.b); + break; + case 4: + a.b = o.b / 2; + } + else (a.a = o.a / 2), (a.b = o.b / 2); + })(s, c, r, Yx(jln(t, w0n), 8)), + o = new UO((!t.n && (t.n = new m_(act, t, 1, 7)), t.n)); + o.e != o.i.gc(); + + ) + !ny(hL(jln((u = Yx(hen(o), 137)), r0n))) && u.a && eD(s.f, d8(u)); + switch (r.g) { + case 2: + case 1: + (s.j == (Ikn(), Tit) || s.j == Bit) && i.Fc((edn(), OVn)); + break; + case 4: + case 3: + (s.j == (Ikn(), Eit) || s.j == qit) && i.Fc((edn(), OVn)); + } + return s; + } + function gkn(n, t, i, r, c, a, u) { + var o, s, h, f, l, b, w, d, g, p, v, m; + for (l = null, r == (Yq(), X4n) ? (l = t) : r == W4n && (l = i), d = l.a.ec().Kc(); d.Ob(); ) { + for ( + w = Yx(d.Pb(), 11), g = $5(x4(Gy(B7n, 1), TEn, 8, 0, [w.i.n, w.n, w.a])).b, m = new Qp(), o = new Qp(), h = new UV(w.b); + ZC(h.a) || ZC(h.b); + + ) + if (ny(hL(Aun((s = Yx(ZC(h.a) ? Hz(h.a) : Hz(h.b), 17)), (Ojn(), HQn)))) == c && -1 != hJ(a, s, 0)) { + if (((p = s.d == w ? s.c : s.d), (v = $5(x4(Gy(B7n, 1), TEn, 8, 0, [p.i.n, p.n, p.a])).b), e.Math.abs(v - g) < 0.2)) + continue; + v < g + ? t.a._b(p) + ? __(m, new mP(X4n, s)) + : __(m, new mP(W4n, s)) + : t.a._b(p) + ? __(o, new mP(X4n, s)) + : __(o, new mP(W4n, s)); + } + if (m.a.gc() > 1) + for (XW(m, new PS(n, (b = new qmn(w, m, r)))), u.c[u.c.length] = b, f = m.a.ec().Kc(); f.Ob(); ) uJ(a, Yx(f.Pb(), 46).b); + if (o.a.gc() > 1) + for (XW(o, new IS(n, (b = new qmn(w, o, r)))), u.c[u.c.length] = b, f = o.a.ec().Kc(); f.Ob(); ) uJ(a, Yx(f.Pb(), 46).b); + } + } + function pkn(n) { + uT( + n, + new tun( + tk( + rk( + nk( + ik(ek(new du(), C$n), "ELK Radial"), + 'A radial layout provider which is based on the algorithm of Peter Eades published in "Drawing free trees.", published by International Institute for Advanced Study of Social Information Science, Fujitsu Limited in 1991. The radial layouter takes a tree and places the nodes in radial order around the root. The nodes of the same tree level are placed on the same radius.', + ), + new Ha(), + ), + C$n, + ), + ), + ), + DU(n, C$n, AAn, oen(V6n)), + DU(n, C$n, LPn, oen(J6n)), + DU(n, C$n, HPn, oen(H6n)), + DU(n, C$n, eIn, oen(q6n)), + DU(n, C$n, BPn, oen(G6n)), + DU(n, C$n, qPn, oen(B6n)), + DU(n, C$n, FPn, oen(z6n)), + DU(n, C$n, GPn, oen(W6n)), + DU(n, C$n, M$n, oen(_6n)), + DU(n, C$n, T$n, oen(F6n)), + DU(n, C$n, I$n, oen(U6n)), + DU(n, C$n, j$n, oen(X6n)), + DU(n, C$n, E$n, oen(Q6n)), + DU(n, C$n, S$n, oen(Y6n)), + DU(n, C$n, P$n, oen(Z6n)); + } + function vkn(n) { + var t; + if ( + ((this.r = (function (n, t) { + return new Mq(Yx(MF(n), 62), Yx(MF(t), 62)); + })(new Pn(), new In())), + (this.b = new C7(Yx(MF(trt), 290))), + (this.p = new C7(Yx(MF(trt), 290))), + (this.i = new C7(Yx(MF(JHn), 290))), + (this.e = n), + (this.o = new fC(n.rf())), + (this.D = n.Df() || ny(hL(n.We((Cjn(), Fnt))))), + (this.A = Yx(n.We((Cjn(), Jnt)), 21)), + (this.B = Yx(n.We(itt), 21)), + (this.q = Yx(n.We(ktt), 98)), + (this.u = Yx(n.We(Mtt), 21)), + !(function (n) { + return ( + Chn(), + !( + V3(sG(tK(pit, x4(Gy(Git, 1), XEn, 273, 0, [mit])), n)) > 1 || + V3(sG(tK(git, x4(Gy(Git, 1), XEn, 273, 0, [dit, yit])), n)) > 1 + ) + ); + })(this.u)) + ) + throw hp(new ly("Invalid port label placement: " + this.u)); + if ( + ((this.v = ny(hL(n.We(Ptt)))), + (this.j = Yx(n.We(Qnt), 21)), + !(function (n) { + return ( + Eln(), + !( + V3(sG(tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Wet])), n)) > 1 || + V3(sG(tK(Get, x4(Gy(cit, 1), XEn, 93, 0, [qet, Uet])), n)) > 1 || + V3(sG(tK(Yet, x4(Gy(cit, 1), XEn, 93, 0, [Qet, Vet])), n)) > 1 + ) + ); + })(this.j)) + ) + throw hp(new ly("Invalid node label placement: " + this.j)); + (this.n = Yx(zrn(n, Wnt), 116)), + (this.k = ty(fL(zrn(n, Gtt)))), + (this.d = ty(fL(zrn(n, qtt)))), + (this.w = ty(fL(zrn(n, Ytt)))), + (this.s = ty(fL(zrn(n, ztt)))), + (this.t = ty(fL(zrn(n, Utt)))), + (this.C = Yx(zrn(n, Vtt), 142)), + (this.c = 2 * this.d), + (t = !this.B.Hc((Vgn(), irt))), + (this.f = new Stn(0, t, 0)), + (this.g = new Stn(1, t, 0)), + Nm(this.f, (JZ(), cHn), this.g); + } + function mkn(n) { + var t, e, i, r, c, a, u, o, s, h, f; + if (null == n) throw hp(new Iy(aEn)); + if ( + ((s = n), + (o = !1), + (c = n.length) > 0 && (Lz(0, n.length), (45 != (t = n.charCodeAt(0)) && 43 != t) || ((n = n.substr(1)), --c, (o = 45 == t))), + 0 == c) + ) + throw hp(new Iy(YTn + s + '"')); + for (; n.length > 0 && (Lz(0, n.length), 48 == n.charCodeAt(0)); ) (n = n.substr(1)), --c; + if (c > (Lpn(), Q_n)[10]) throw hp(new Iy(YTn + s + '"')); + for (r = 0; r < c; r++) if (-1 == otn((Lz(r, n.length), n.charCodeAt(r)))) throw hp(new Iy(YTn + s + '"')); + for ( + f = 0, + a = W_n[10], + h = V_n[10], + u = sJ(Y_n[10]), + e = !0, + (i = c % a) > 0 && ((f = -parseInt(n.substr(0, i), 10)), (n = n.substr(i)), (c -= i), (e = !1)); + c >= a; + + ) { + if (((i = parseInt(n.substr(0, a), 10)), (n = n.substr(a)), (c -= a), e)) e = !1; + else { + if (k8(f, u) < 0) throw hp(new Iy(YTn + s + '"')); + f = e7(f, h); + } + f = n7(f, i); + } + if (k8(f, 0) > 0) throw hp(new Iy(YTn + s + '"')); + if (!o && k8((f = sJ(f)), 0) < 0) throw hp(new Iy(YTn + s + '"')); + return f; + } + function ykn(n, t) { + var e, i, r, c, a, u, o; + if ((YD(), (this.a = new yO(this)), (this.b = n), (this.c = t), (this.f = G_(PJ((wsn(), wut), t))), this.f.dc())) + if ((u = Dcn(wut, n)) == t) + for ( + this.e = !0, + this.d = new ip(), + this.f = new fo(), + this.f.Fc(BRn), + Yx(Imn(SJ(wut, i1(n)), ""), 26) == n && this.f.Fc(OK(wut, i1(n))), + r = $gn(wut, n).Kc(); + r.Ob(); + + ) + switch (((i = Yx(r.Pb(), 170)), TB(PJ(wut, i)))) { + case 4: + this.d.Fc(i); + break; + case 5: + this.f.Gc(G_(PJ(wut, i))); + } + else if ((TT(), Yx(t, 66).Oj())) + for (this.e = !0, this.f = null, this.d = new ip(), a = 0, o = (null == n.i && svn(n), n.i).length; a < o; ++a) + for (null == n.i && svn(n), e = n.i, i = a >= 0 && a < e.length ? e[a] : null, c = Bz(PJ(wut, i)); c; c = Bz(PJ(wut, c))) + c == t && this.d.Fc(i); + else + 1 == TB(PJ(wut, t)) && u + ? ((this.f = null), (this.d = (dfn(), Iut))) + : ((this.f = null), (this.e = !0), (this.d = (XH(), new bb(t)))); + else (this.e = 5 == TB(PJ(wut, t))), this.f.Fb(jut) && (this.f = jut); + } + function kkn(n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d; + for ( + i = 0, + r = (function (n, t) { + switch (t.g) { + case 1: + return n.f.n.d + n.t; + case 3: + return n.f.n.a + n.t; + case 2: + return n.f.n.c + n.s; + case 4: + return n.f.n.b + n.s; + default: + return 0; + } + })(n, t), + b = n.s, + w = n.t, + h = Yx(Yx(_V(n.r, t), 21), 84).Kc(); + h.Ob(); + + ) + if ((s = Yx(h.Pb(), 111)).c && !(s.c.d.c.length <= 0)) { + switch ( + ((d = s.b.rf()), + (o = s.b.Xe((Cjn(), ytt)) ? ty(fL(s.b.We(ytt))) : 0), + ((l = (f = s.c).i).b = ((u = f.n), f.e.a + u.b + u.c)), + (l.a = ((a = f.n), f.e.b + a.d + a.a)), + t.g) + ) { + case 1: + (l.c = s.a ? (d.a - l.b) / 2 : d.a + b), (l.d = d.b + o + r), lY(f, (BY(), hHn)), OL(f, (OJ(), mHn)); + break; + case 3: + (l.c = s.a ? (d.a - l.b) / 2 : d.a + b), (l.d = -o - r - l.a), lY(f, (BY(), hHn)), OL(f, (OJ(), pHn)); + break; + case 2: + (l.c = -o - r - l.b), + s.a ? ((c = n.v ? l.a : Yx(TR(f.d, 0), 181).rf().b), (l.d = (d.b - c) / 2)) : (l.d = d.b + w), + lY(f, (BY(), lHn)), + OL(f, (OJ(), vHn)); + break; + case 4: + (l.c = d.a + o + r), + s.a ? ((c = n.v ? l.a : Yx(TR(f.d, 0), 181).rf().b), (l.d = (d.b - c) / 2)) : (l.d = d.b + w), + lY(f, (BY(), fHn)), + OL(f, (OJ(), vHn)); + } + (t == (Ikn(), Tit) || t == Bit) && (i = e.Math.max(i, l.a)); + } + i > 0 && (Yx(GB(n.b, t), 124).a.b = i); + } + function jkn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v; + if ((f = t.length) > 0 && (Lz(0, t.length), 64 != (u = t.charCodeAt(0)))) { + if ( + 37 == u && + ((o = !1), 0 != (h = t.lastIndexOf("%")) && (h == f - 1 || (Lz(h + 1, t.length), (o = 46 == t.charCodeAt(h + 1))))) + ) { + if (((v = _N("%", (a = t.substr(1, h - 1))) ? null : $kn(a)), (i = 0), o)) + try { + i = ipn(t.substr(h + 2), nTn, Yjn); + } catch (n) { + throw CO((n = j4(n)), 127) ? hp(new mJ(n)) : hp(n); + } + for (d = b2(n.Wg()); d.Ob(); ) + if (CO((b = X3(d)), 510) && ((p = (r = Yx(b, 590)).d), (null == v ? null == p : _N(v, p)) && 0 == i--)) return r; + return null; + } + if (((l = -1 == (s = t.lastIndexOf(".")) ? t : t.substr(0, s)), (e = 0), -1 != s)) + try { + e = ipn(t.substr(s + 1), nTn, Yjn); + } catch (n) { + if (!CO((n = j4(n)), 127)) throw hp(n); + l = t; + } + for (l = _N("%", l) ? null : $kn(l), w = b2(n.Wg()); w.Ob(); ) + if (CO((b = X3(w)), 191) && ((g = (c = Yx(b, 191)).ne()), (null == l ? null == g : _N(l, g)) && 0 == e--)) return c; + return null; + } + return eyn(n, t); + } + function Ekn() { + var n, t, e; + for ( + Ekn = O, + new ZJ(1, 0), + new ZJ(10, 0), + new ZJ(0, 0), + iFn = VQ(vFn, TEn, 240, 11, 0, 1), + rFn = VQ(Xot, sTn, 25, 100, 15, 1), + cFn = x4( + Gy(Jot, 1), + rMn, + 25, + 15, + [ + 1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625, 48828125, 244140625, 1220703125, 6103515625, + 30517578125, 152587890625, 762939453125, 3814697265625, 19073486328125, 95367431640625, 476837158203125, 0x878678326eac9, + ], + ), + aFn = VQ(Wot, MTn, 25, cFn.length, 15, 1), + uFn = x4(Gy(Jot, 1), rMn, 25, 15, [1, 10, 100, hTn, 1e4, cMn, 1e6, 1e7, 1e8, UTn, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16]), + oFn = VQ(Wot, MTn, 25, uFn.length, 15, 1), + sFn = VQ(vFn, TEn, 240, 11, 0, 1), + n = 0; + n < sFn.length; + n++ + ) + (iFn[n] = new ZJ(n, 0)), (sFn[n] = new ZJ(0, n)), (rFn[n] = 48); + for (; n < rFn.length; n++) rFn[n] = 48; + for (e = 0; e < aFn.length; e++) aFn[e] = Thn(cFn[e]); + for (t = 0; t < oFn.length; t++) oFn[t] = Thn(uFn[t]); + jfn(); + } + function Tkn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p; + if (CO((r = Aun(t, (Ojn(), CQn))), 239)) { + for ( + b = Yx(r, 33), + w = t.e, + f = new fC(t.c), + c = t.d, + f.a += c.b, + f.b += c.d, + KA(Yx(jln(b, (gjn(), i0n)), 174), (Vgn(), rrt)) && + ((function (n, t) { + n.a = t; + })((l = Yx(jln(b, c0n), 116)), c.a), + (function (n, t) { + n.d = t; + })(l, c.d), + (function (n, t) { + n.b = t; + })(l, c.b), + (function (n, t) { + n.c = t; + })(l, c.c)), + e = new ip(), + s = new pb(t.a); + s.a < s.c.c.length; + + ) + for ( + CO(Aun((u = Yx(Hz(s), 10)), CQn), 239) + ? Akn(u, f) + : CO(Aun(u, CQn), 186) && !w && jC((i = Yx(Aun(u, CQn), 118)), (g = Xpn(t, u, i.g, i.f)).a, g.b), + d = new pb(u.j); + d.a < d.c.c.length; + + ) + SE(hH(new SR(null, new Nz(Yx(Hz(d), 11).g, 16)), new mw(u)), new yw(e)); + if (w) for (d = new pb(w.j); d.a < d.c.c.length; ) SE(hH(new SR(null, new Nz(Yx(Hz(d), 11).g, 16)), new kw(w)), new jw(e)); + for (p = Yx(jln(b, b1n), 218), a = new pb(e); a.a < a.c.c.length; ) Zyn(Yx(Hz(a), 17), p, f); + for ( + (function (n) { + var t, e, i, r, c; + (i = Yx(Aun(n, (Ojn(), CQn)), 33)), + (c = Yx(jln(i, (gjn(), n0n)), 174).Hc((Ann(), nrt))), + n.e || + ((r = Yx(Aun(n, bQn), 21)), + (t = new QS(n.f.a + n.d.b + n.d.c, n.f.b + n.d.d + n.d.a)), + r.Hc((edn(), SVn)) + ? (Aen(i, g0n, (Ran(), oit)), xkn(i, t.a, t.b, !1, !0)) + : ny(hL(jln(i, t0n))) || xkn(i, t.a, t.b, !0, !0)), + Aen(i, n0n, c ? J9(nrt) : new cx((e = Yx(Ak(lrt), 9)), Yx(eN(e, e.length), 9), 0)); + })(t), + o = new pb(t.a); + o.a < o.c.c.length; + + ) + (h = (u = Yx(Hz(o), 10)).e) && Tkn(n, h); + } + } + function Mkn(n) { + uT( + n, + new tun( + ck( + tk( + rk( + nk( + ik(ek(new du(), APn), "ELK Force"), + "Force-based algorithm provided by the Eclipse Layout Kernel. Implements methods that follow physical analogies by simulating forces that move the nodes into a balanced distribution. Currently the original Eades model and the Fruchterman - Reingold model are supported.", + ), + new dt(), + ), + APn, + ), + tK((zfn(), gct), x4(Gy(kct, 1), XEn, 237, 0, [wct])), + ), + ), + ), + DU(n, APn, $Pn, d9(1)), + DU(n, APn, LPn, 80), + DU(n, APn, NPn, 5), + DU(n, APn, hPn, OPn), + DU(n, APn, xPn, d9(1)), + DU(n, APn, DPn, (TA(), !0)), + DU(n, APn, fPn, hGn), + DU(n, APn, RPn, oen(eGn)), + DU(n, APn, KPn, oen(fGn)), + DU(n, APn, _Pn, !1), + DU(n, APn, FPn, oen(oGn)), + DU(n, APn, BPn, oen(uGn)), + DU(n, APn, HPn, oen(aGn)), + DU(n, APn, qPn, oen(cGn)), + DU(n, APn, GPn, oen(lGn)), + DU(n, APn, EPn, oen(rGn)), + DU(n, APn, SPn, oen(yGn)), + DU(n, APn, TPn, oen(iGn)), + DU(n, APn, IPn, oen(dGn)), + DU(n, APn, MPn, oen(gGn)); + } + function Skn(n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w; + if (!Yx(Yx(_V(n.r, t), 21), 84).dc()) { + if ( + ((s = (u = Yx(GB(n.b, t), 124)).i), + (o = u.n), + (f = hdn(n, t)), + (r = s.b - o.b - o.c), + (c = u.a.a), + (a = s.c + o.b), + (w = n.w), + (f != (Ytn(), eit) && f != rit) || 1 != Yx(Yx(_V(n.r, t), 21), 84).gc() || ((c = f == eit ? c - 2 * n.w : c), (f = tit)), + r < c && !n.B.Hc((Vgn(), srt))) + ) + f == eit + ? (a += w += (r - c) / (Yx(Yx(_V(n.r, t), 21), 84).gc() + 1)) + : (w += (r - c) / (Yx(Yx(_V(n.r, t), 21), 84).gc() - 1)); + else + switch ((r < c && ((c = f == eit ? c - 2 * n.w : c), (f = tit)), f.g)) { + case 3: + a += (r - c) / 2; + break; + case 4: + a += r - c; + break; + case 0: + (i = (r - c) / (Yx(Yx(_V(n.r, t), 21), 84).gc() + 1)), (a += w += e.Math.max(0, i)); + break; + case 1: + (i = (r - c) / (Yx(Yx(_V(n.r, t), 21), 84).gc() - 1)), (w += e.Math.max(0, i)); + } + for (b = Yx(Yx(_V(n.r, t), 21), 84).Kc(); b.Ob(); ) + ((l = Yx(b.Pb(), 111)).e.a = a + l.d.b), + (l.e.b = (h = l.b).Xe((Cjn(), ytt)) + ? h.Hf() == (Ikn(), Tit) + ? -h.rf().b - ty(fL(h.We(ytt))) + : ty(fL(h.We(ytt))) + : h.Hf() == (Ikn(), Tit) + ? -h.rf().b + : 0), + (a += l.d.b + l.b.rf().a + l.d.c + w); + } + } + function Pkn(n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d; + if (!Yx(Yx(_V(n.r, t), 21), 84).dc()) { + if ( + ((s = (u = Yx(GB(n.b, t), 124)).i), + (o = u.n), + (l = hdn(n, t)), + (r = s.a - o.d - o.a), + (c = u.a.b), + (a = s.d + o.d), + (d = n.w), + (h = n.o.a), + (l != (Ytn(), eit) && l != rit) || 1 != Yx(Yx(_V(n.r, t), 21), 84).gc() || ((c = l == eit ? c - 2 * n.w : c), (l = tit)), + r < c && !n.B.Hc((Vgn(), srt))) + ) + l == eit + ? (a += d += (r - c) / (Yx(Yx(_V(n.r, t), 21), 84).gc() + 1)) + : (d += (r - c) / (Yx(Yx(_V(n.r, t), 21), 84).gc() - 1)); + else + switch ((r < c && ((c = l == eit ? c - 2 * n.w : c), (l = tit)), l.g)) { + case 3: + a += (r - c) / 2; + break; + case 4: + a += r - c; + break; + case 0: + (i = (r - c) / (Yx(Yx(_V(n.r, t), 21), 84).gc() + 1)), (a += d += e.Math.max(0, i)); + break; + case 1: + (i = (r - c) / (Yx(Yx(_V(n.r, t), 21), 84).gc() - 1)), (d += e.Math.max(0, i)); + } + for (w = Yx(Yx(_V(n.r, t), 21), 84).Kc(); w.Ob(); ) + ((b = Yx(w.Pb(), 111)).e.a = (f = b.b).Xe((Cjn(), ytt)) + ? f.Hf() == (Ikn(), qit) + ? -f.rf().a - ty(fL(f.We(ytt))) + : h + ty(fL(f.We(ytt))) + : f.Hf() == (Ikn(), qit) + ? -f.rf().a + : h), + (b.e.b = a + b.d.d), + (a += b.d.d + b.b.rf().b + b.d.a + d); + } + } + function Ikn() { + var n; + (Ikn = O), + (Hit = new sP(MSn, 0)), + (Tit = new sP(NSn, 1)), + (Eit = new sP(xSn, 2)), + (Bit = new sP(DSn, 3)), + (qit = new sP(RSn, 4)), + XH(), + (Cit = new Ny(new cx((n = Yx(Ak(trt), 9)), Yx(eN(n, n.length), 9), 0))), + (Oit = N8(tK(Tit, x4(Gy(trt, 1), lIn, 61, 0, [])))), + (Mit = N8(tK(Eit, x4(Gy(trt, 1), lIn, 61, 0, [])))), + (Kit = N8(tK(Bit, x4(Gy(trt, 1), lIn, 61, 0, [])))), + (Fit = N8(tK(qit, x4(Gy(trt, 1), lIn, 61, 0, [])))), + (xit = N8(tK(Tit, x4(Gy(trt, 1), lIn, 61, 0, [Bit])))), + (Iit = N8(tK(Eit, x4(Gy(trt, 1), lIn, 61, 0, [qit])))), + (Rit = N8(tK(Tit, x4(Gy(trt, 1), lIn, 61, 0, [qit])))), + (Ait = N8(tK(Tit, x4(Gy(trt, 1), lIn, 61, 0, [Eit])))), + (_it = N8(tK(Bit, x4(Gy(trt, 1), lIn, 61, 0, [qit])))), + (Sit = N8(tK(Eit, x4(Gy(trt, 1), lIn, 61, 0, [Bit])))), + (Nit = N8(tK(Tit, x4(Gy(trt, 1), lIn, 61, 0, [Eit, qit])))), + (Pit = N8(tK(Eit, x4(Gy(trt, 1), lIn, 61, 0, [Bit, qit])))), + (Dit = N8(tK(Tit, x4(Gy(trt, 1), lIn, 61, 0, [Bit, qit])))), + ($it = N8(tK(Tit, x4(Gy(trt, 1), lIn, 61, 0, [Eit, Bit])))), + (Lit = N8(tK(Tit, x4(Gy(trt, 1), lIn, 61, 0, [Eit, Bit, qit])))); + } + function Ckn(n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v; + if (0 != t.b) { + for ( + l = new ME(), a = null, b = null, i = oG(e.Math.floor(e.Math.log(t.b) * e.Math.LOG10E) + 1), u = 0, v = Ztn(t, 0); + v.b != v.d.c; + + ) + for ( + g = Yx(IX(v), 86), + iI(b) !== iI(Aun(g, (ryn(), v5n))) && ((b = lL(Aun(g, v5n))), (u = 0)), + a = null != b ? b + Vz(u++, i) : Vz(u++, i), + b5(g, v5n, a), + d = new Rd(Ztn(new Dd(g).a.d, 0)); + ij(d.a); + + ) + VW(l, (w = Yx(IX(d.a), 188).c), l.c.b, l.c), b5(w, v5n, a); + for (f = new rp(), c = 0; c < a.length - i; c++) + for (p = Ztn(t, 0); p.b != p.d.c; ) + GG( + f, + (o = l$(lL(Aun((g = Yx(IX(p), 86)), (ryn(), v5n))), 0, c + 1)), + d9(null != (null == o ? eI(Dq(f.f, null)) : NT(f.g, o)) ? Yx(null == o ? eI(Dq(f.f, null)) : NT(f.g, o), 19).a + 1 : 1), + ); + for (h = new t6(new Ql(f).a); h.b; ) + (s = s1(h)), + (r = d9(null != BF(n.a, s.cd()) ? Yx(BF(n.a, s.cd()), 19).a : 0)), + GG(n.a, lL(s.cd()), d9(Yx(s.dd(), 19).a + r.a)), + (!(r = Yx(BF(n.b, s.cd()), 19)) || r.a < Yx(s.dd(), 19).a) && GG(n.b, lL(s.cd()), Yx(s.dd(), 19)); + Ckn(n, l); + } + } + function Okn(n) { + var t, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M, S, P; + for (h = Yx(Aun(n, (d2(), EGn)), 33), d = Yjn, g = Yjn, b = nTn, w = nTn, v = new pb(n.e); v.a < v.c.c.length; ) + (E = (p = Yx(Hz(v), 144)).d), + (T = p.e), + (d = e.Math.min(d, E.a - T.a / 2)), + (g = e.Math.min(g, E.b - T.b / 2)), + (b = e.Math.max(b, E.a + T.a / 2)), + (w = e.Math.max(w, E.b + T.b / 2)); + for (k = new QS((j = Yx(jln(h, (Bdn(), sGn)), 116)).b - d, j.d - g), o = new pb(n.e); o.a < o.c.c.length; ) + CO((y = Aun((u = Yx(Hz(o), 144)), EGn)), 239) && jC((f = Yx(y, 33)), (m = mN(u.d, k)).a - f.g / 2, m.b - f.f / 2); + for (r = new pb(n.c); r.a < r.c.c.length; ) + (i = Yx(Hz(r), 282)), + (s = Ywn(Yx(Aun(i, EGn), 79), !0, !0)), + Ecn((S = yN(dO(i.d.d), i.c.d)), i.c.e.a, i.c.e.b), + TC(s, (M = mN(S, i.c.d)).a, M.b), + Ecn((P = yN(dO(i.c.d), i.d.d)), i.d.e.a, i.d.e.b), + EC(s, (t = mN(P, i.d.d)).a, t.b); + for (a = new pb(n.d); a.a < a.c.c.length; ) (c = Yx(Hz(a), 447)), jC(Yx(Aun(c, EGn), 137), (l = mN(c.d, k)).a, l.b); + xkn(h, b - d + (j.b + j.c), w - g + (j.d + j.a), !1, !0); + } + function Akn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w; + for ( + i = Yx(Aun(n, (Ojn(), CQn)), 33), + b = Yx(Aun(n, (gjn(), t1n)), 19).a, + c = Yx(Aun(n, D1n), 19).a, + Aen(i, t1n, d9(b)), + Aen(i, D1n, d9(c)), + L1(i, n.n.a + t.a), + N1(i, n.n.b + t.b), + (0 != Yx(jln(i, n0n), 174).gc() || + n.e || + (iI(Aun(dB(n), Z1n)) === iI((ain(), L2n)) && + wC((Hen(), (n.q ? n.q : (XH(), XH(), MFn))._b(Y1n) ? Yx(Aun(n, Y1n), 197) : Yx(Aun(dB(n), J1n), 197))))) && + ($1(i, n.o.a), A1(i, n.o.b)), + f = new pb(n.j); + f.a < f.c.c.length; + + ) + CO((w = Aun((s = Yx(Hz(f), 11)), CQn)), 186) && (jC((r = Yx(w, 118)), s.n.a, s.n.b), Aen(r, k0n, s.j)); + for (l = 0 != Yx(Aun(n, U1n), 174).gc(), o = new pb(n.b); o.a < o.c.c.length; ) + (a = Yx(Hz(o), 70)), + (l || 0 != Yx(Aun(a, U1n), 174).gc()) && (kC((e = Yx(Aun(a, CQn), 137)), a.o.a, a.o.b), jC(e, a.n.a, a.n.b)); + if (!c_(Yx(Aun(n, m0n), 21))) + for (h = new pb(n.j); h.a < h.c.c.length; ) + for (u = new pb((s = Yx(Hz(h), 11)).f); u.a < u.c.c.length; ) + (a = Yx(Hz(u), 70)), $1((e = Yx(Aun(a, CQn), 137)), a.o.a), A1(e, a.o.b), jC(e, a.n.a, a.n.b); + } + function $kn(n) { + var t, e, i, r, c, a, u, o; + if ((Cmn(), null == n)) return null; + if ((r = VI(n, gun(37))) < 0) return n; + for (o = new SA(n.substr(0, r)), t = VQ(Yot, LNn, 25, 4, 15, 1), u = 0, i = 0, a = n.length; r < a; r++) + if ( + (Lz(r, n.length), + 37 == n.charCodeAt(r) && + n.length > r + 2 && + a5((Lz(r + 1, n.length), n.charCodeAt(r + 1)), Gct, zct) && + a5((Lz(r + 2, n.length), n.charCodeAt(r + 2)), Gct, zct)) + ) + if ( + ((e = $D((Lz(r + 1, n.length), n.charCodeAt(r + 1)), (Lz(r + 2, n.length), n.charCodeAt(r + 2)))), + (r += 2), + i > 0 + ? 128 == (192 & e) + ? (t[u++] = (e << 24) >> 24) + : (i = 0) + : e >= 128 && + (192 == (224 & e) + ? ((t[u++] = (e << 24) >> 24), (i = 2)) + : 224 == (240 & e) + ? ((t[u++] = (e << 24) >> 24), (i = 3)) + : 240 == (248 & e) && ((t[u++] = (e << 24) >> 24), (i = 4))), + i > 0) + ) { + if (u == i) { + switch (u) { + case 2: + _F(o, (((31 & t[0]) << 6) | (63 & t[1])) & fTn); + break; + case 3: + _F(o, (((15 & t[0]) << 12) | ((63 & t[1]) << 6) | (63 & t[2])) & fTn); + } + (u = 0), (i = 0); + } + } else { + for (c = 0; c < u; ++c) _F(o, t[c] & fTn); + (u = 0), (o.a += String.fromCharCode(e)); + } + else { + for (c = 0; c < u; ++c) _F(o, t[c] & fTn); + (u = 0), _F(o, (Lz(r, n.length), n.charCodeAt(r))); + } + return o.a; + } + function Lkn(n, t, e, i, r) { + var c, a, u; + if ((JJ(n, t), (a = t[0]), (c = XB(e.c, 0)), (u = -1), z5(e))) + if (i > 0) { + if (a + i > n.length) return !1; + u = Uhn(n.substr(0, a + i), t); + } else u = Uhn(n, t); + switch (c) { + case 71: + return (u = wun(n, a, x4(Gy(fFn, 1), TEn, 2, 6, [STn, PTn]), t)), (r.e = u), !0; + case 77: + case 76: + return (function (n, t, e, i, r) { + return i < 0 + ? ((i = wun(n, r, x4(Gy(fFn, 1), TEn, 2, 6, [lTn, bTn, wTn, dTn, gTn, pTn, vTn, mTn, yTn, kTn, jTn, ETn]), t)) < 0 && + (i = wun( + n, + r, + x4(Gy(fFn, 1), TEn, 2, 6, ["Jan", "Feb", "Mar", "Apr", gTn, "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]), + t, + )), + !(i < 0 || ((e.k = i), 0))) + : i > 0 && ((e.k = i - 1), !0); + })(n, t, r, u, a); + case 69: + case 99: + return (function (n, t, e, i) { + var r; + return ( + (r = wun(n, e, x4(Gy(fFn, 1), TEn, 2, 6, [ITn, CTn, OTn, ATn, $Tn, LTn, NTn]), t)) < 0 && + (r = wun(n, e, x4(Gy(fFn, 1), TEn, 2, 6, ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]), t)), + !(r < 0 || ((i.d = r), 0)) + ); + })(n, t, a, r); + case 97: + return (u = wun(n, a, x4(Gy(fFn, 1), TEn, 2, 6, ["AM", "PM"]), t)), (r.b = u), !0; + case 121: + return (function (n, t, e, i, r, c) { + var a, u, o; + if (((u = 32), i < 0)) { + if (t[0] >= n.length) return !1; + if (43 != (u = XB(n, t[0])) && 45 != u) return !1; + if ((++t[0], (i = Uhn(n, t)) < 0)) return !1; + 45 == u && (i = -i); + } + return ( + 32 == u && + t[0] - e == 2 && + 2 == r.b && + ((a = (o = new uE().q.getFullYear() - TTn + TTn - 80) % 100), + (c.a = i == a), + (i += 100 * ((o / 100) | 0) + (i < a ? 100 : 0))), + (c.p = i), + !0 + ); + })(n, t, a, u, e, r); + case 100: + return !(u <= 0 || ((r.c = u), 0)); + case 83: + return ( + !(u < 0) && + (function (n, t, e, i) { + var r, c; + if ((c = e - t) < 3) for (; c < 3; ) (n *= 10), ++c; + else { + for (r = 1; c > 3; ) (r *= 10), --c; + n = ((n + (r >> 1)) / r) | 0; + } + return (i.i = n), !0; + })(u, a, t[0], r) + ); + case 104: + 12 == u && (u = 0); + case 75: + case 72: + return !(u < 0 || ((r.f = u), (r.g = !1), 0)); + case 107: + return !(u < 0 || ((r.f = u), (r.g = !0), 0)); + case 109: + return !(u < 0 || ((r.j = u), 0)); + case 115: + return !(u < 0 || ((r.n = u), 0)); + case 90: + if (a < n.length && (Lz(a, n.length), 90 == n.charCodeAt(a))) return ++t[0], (r.o = 0), !0; + case 122: + case 118: + return (function (n, t, e, i) { + return (t >= 0 && _N(n.substr(t, 3), "GMT")) || (t >= 0 && _N(n.substr(t, 3), "UTC")) + ? ((e[0] = t + 3), apn(n, e, i)) + : apn(n, e, i); + })(n, a, t, r); + default: + return !1; + } + } + function Nkn(n, t, e) { + var i, r, c, a, u, o, s, h, f, l; + if ((n.e.a.$b(), n.f.a.$b(), (n.c.c = VQ(UKn, iEn, 1, 0, 5, 1)), (n.i.c = VQ(UKn, iEn, 1, 0, 5, 1)), n.g.a.$b(), t)) + for (a = new pb(t.a); a.a < a.c.c.length; ) + for (h = $on((c = Yx(Hz(a), 10)), (Ikn(), Eit)).Kc(); h.Ob(); ) + for (s = Yx(h.Pb(), 11), __(n.e, s), r = new pb(s.g); r.a < r.c.c.length; ) + ZW((i = Yx(Hz(r), 17))) || + (eD(n.c, i), + aen(n, i), + ((u = i.c.i.k) == (bon(), Hzn) || u == qzn || u == _zn || u == Kzn) && eD(n.j, i), + (f = (l = i.d).i.c) == e ? __(n.f, l) : f == t ? __(n.e, l) : uJ(n.c, i)); + if (e) + for (a = new pb(e.a); a.a < a.c.c.length; ) { + for (o = new pb((c = Yx(Hz(a), 10)).j); o.a < o.c.c.length; ) + for (r = new pb(Yx(Hz(o), 11).g); r.a < r.c.c.length; ) ZW((i = Yx(Hz(r), 17))) && __(n.g, i); + for (h = $on(c, (Ikn(), qit)).Kc(); h.Ob(); ) + for (s = Yx(h.Pb(), 11), __(n.f, s), r = new pb(s.g); r.a < r.c.c.length; ) + ZW((i = Yx(Hz(r), 17))) || + (eD(n.c, i), + aen(n, i), + ((u = i.c.i.k) == (bon(), Hzn) || u == qzn || u == _zn || u == Kzn) && eD(n.j, i), + (f = (l = i.d).i.c) == e ? __(n.f, l) : f == t ? __(n.e, l) : uJ(n.c, i)); + } + } + function xkn(n, t, i, r, c) { + var a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E; + if ( + ((p = new QS(n.g, n.f)), + ((g = Asn(n)).a = e.Math.max(g.a, t)), + (g.b = e.Math.max(g.b, i)), + (E = g.a / p.a), + (f = g.b / p.b), + (k = g.a - p.a), + (s = g.b - p.b), + r) + ) + for ( + u = IG(n) ? Yx(jln(IG(n), (Cjn(), Pnt)), 103) : Yx(jln(n, (Cjn(), Pnt)), 103), + o = iI(jln(n, (Cjn(), ktt))) === iI((Ran(), oit)), + m = new UO((!n.c && (n.c = new m_(oct, n, 9, 9)), n.c)); + m.e != m.i.gc(); + + ) + switch (((v = Yx(hen(m), 118)), (y = Yx(jln(v, Itt), 61)) == (Ikn(), Hit) && ((y = Zpn(v, u)), Aen(v, Itt, y)), y.g)) { + case 1: + o || L1(v, v.i * E); + break; + case 2: + L1(v, v.i + k), o || N1(v, v.j * f); + break; + case 3: + o || L1(v, v.i * E), N1(v, v.j + s); + break; + case 4: + o || N1(v, v.j * f); + } + if ((kC(n, g.a, g.b), c)) + for (b = new UO((!n.n && (n.n = new m_(act, n, 1, 7)), n.n)); b.e != b.i.gc(); ) + (w = (l = Yx(hen(b), 137)).i + l.g / 2), + (d = l.j + l.f / 2), + (j = w / p.a) + (h = d / p.b) >= 1 && + (j - h > 0 && d >= 0 + ? (L1(l, l.i + k), N1(l, l.j + s * h)) + : j - h < 0 && w >= 0 && (L1(l, l.i + k * j), N1(l, l.j + s))); + return Aen(n, (Cjn(), Jnt), (Ann(), new cx((a = Yx(Ak(lrt), 9)), Yx(eN(a, a.length), 9), 0))), new QS(E, f); + } + function Dkn(n) { + var t, i, r, c, a, u, o, s, h, f, l; + if ( + ((f = + IG(iun(Yx(c1((!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b), 0), 82))) == + IG(iun(Yx(c1((!n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c), 0), 82)))), + (u = new Pk()), + (t = Yx(jln(n, (L6(), Met)), 74)) && t.b >= 2) + ) { + if (0 == (!n.a && (n.a = new m_(tct, n, 6, 6)), n.a).i) + xk(), (i = new co()), fY((!n.a && (n.a = new m_(tct, n, 6, 6)), n.a), i); + else if ((!n.a && (n.a = new m_(tct, n, 6, 6)), n.a).i > 1) + for (l = new a$((!n.a && (n.a = new m_(tct, n, 6, 6)), n.a)); l.e != l.i.gc(); ) tan(l); + wvn(t, Yx(c1((!n.a && (n.a = new m_(tct, n, 6, 6)), n.a), 0), 202)); + } + if (f) + for (r = new UO((!n.a && (n.a = new m_(tct, n, 6, 6)), n.a)); r.e != r.i.gc(); ) + for (s = new UO((!(i = Yx(hen(r), 202)).a && (i.a = new XO(Qrt, i, 5)), i.a)); s.e != s.i.gc(); ) + (o = Yx(hen(s), 469)), (u.a = e.Math.max(u.a, o.a)), (u.b = e.Math.max(u.b, o.b)); + for (a = new UO((!n.n && (n.n = new m_(act, n, 1, 7)), n.n)); a.e != a.i.gc(); ) + (c = Yx(hen(a), 137)), + (h = Yx(jln(c, Aet), 8)) && jC(c, h.a, h.b), + f && ((u.a = e.Math.max(u.a, c.i + c.g)), (u.b = e.Math.max(u.b, c.j + c.f))); + return u; + } + function Rkn(n, t, e) { + var i, r, c, a, u; + switch (((i = t.i), (c = n.i.o), (r = n.i.d), (u = n.n), (a = $5(x4(Gy(B7n, 1), TEn, 8, 0, [u, n.a]))), n.j.g)) { + case 1: + OL(t, (OJ(), pHn)), + (i.d = -r.d - e - i.a), + Yx(Yx(TR(t.d, 0), 181).We((Ojn(), kQn)), 285) == (Frn(), Ret) + ? (lY(t, (BY(), lHn)), (i.c = a.a - ty(fL(Aun(n, PQn))) - e - i.b)) + : (lY(t, (BY(), fHn)), (i.c = a.a + ty(fL(Aun(n, PQn))) + e)); + break; + case 2: + lY(t, (BY(), fHn)), + (i.c = c.a + r.c + e), + Yx(Yx(TR(t.d, 0), 181).We((Ojn(), kQn)), 285) == (Frn(), Ret) + ? (OL(t, (OJ(), pHn)), (i.d = a.b - ty(fL(Aun(n, PQn))) - e - i.a)) + : (OL(t, (OJ(), mHn)), (i.d = a.b + ty(fL(Aun(n, PQn))) + e)); + break; + case 3: + OL(t, (OJ(), mHn)), + (i.d = c.b + r.a + e), + Yx(Yx(TR(t.d, 0), 181).We((Ojn(), kQn)), 285) == (Frn(), Ret) + ? (lY(t, (BY(), lHn)), (i.c = a.a - ty(fL(Aun(n, PQn))) - e - i.b)) + : (lY(t, (BY(), fHn)), (i.c = a.a + ty(fL(Aun(n, PQn))) + e)); + break; + case 4: + lY(t, (BY(), lHn)), + (i.c = -r.b - e - i.b), + Yx(Yx(TR(t.d, 0), 181).We((Ojn(), kQn)), 285) == (Frn(), Ret) + ? (OL(t, (OJ(), pHn)), (i.d = a.b - ty(fL(Aun(n, PQn))) - e - i.a)) + : (OL(t, (OJ(), mHn)), (i.d = a.b + ty(fL(Aun(n, PQn))) + e)); + } + } + function Kkn(n, t, i, r, c, a, u) { + var o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M, S, P, I, C, O; + for (w = 0, S = 0, s = new pb(n); s.a < s.c.c.length; ) Uyn((o = Yx(Hz(s), 33))), (w = e.Math.max(w, o.g)), (S += o.g * o.f); + for ( + M = (function (n, t) { + var i, r, c; + for (c = 0, r = new pb(n); r.a < r.c.c.length; ) (i = Yx(Hz(r), 33)), (c += e.Math.pow(i.g * i.f - t, 2)); + return e.Math.sqrt(c / (n.c.length - 1)); + })(n, S / n.c.length), + S += n.c.length * M, + w = e.Math.max(w, e.Math.sqrt(S * u)) + i.b, + C = i.b, + O = i.d, + b = 0, + f = i.b + i.c, + KD((T = new ME()), d9(0)), + j = new ME(), + h = new JU(n, 0); + h.b < h.d.gc(); + + ) + S$(h.b < h.d.gc()), + (I = (o = Yx(h.d.Xb((h.c = h.b++)), 33)).g), + (l = o.f), + C + I > w && (a && (EI(j, b), EI(T, d9(h.b - 1))), (C = i.b), (O += b + t), (b = 0), (f = e.Math.max(f, i.b + i.c + I))), + L1(o, C), + N1(o, O), + (f = e.Math.max(f, C + I + i.c)), + (b = e.Math.max(b, l)), + (C += I + t); + if (((f = e.Math.max(f, r)), (P = O + b + i.a) < c && ((b += c - P), (P = c)), a)) + for ( + C = i.b, h = new JU(n, 0), EI(T, d9(n.c.length)), p = Yx(IX((E = Ztn(T, 0))), 19).a, EI(j, b), k = Ztn(j, 0), y = 0; + h.b < h.d.gc(); + + ) + h.b == p && ((C = i.b), (y = ty(fL(IX(k)))), (p = Yx(IX(E), 19).a)), + S$(h.b < h.d.gc()), + (v = (o = Yx(h.d.Xb((h.c = h.b++)), 33)).f), + A1(o, y), + (d = y), + h.b == p && ((g = f - C - i.c), (m = o.g), $1(o, g), qsn(o, new QS(g, d), new QS(m, v))), + (C += o.g + t); + return new QS(f, P); + } + function _kn(n) { + var t, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k; + if (1 == n.gc()) return Yx(n.Xb(0), 231); + if (n.gc() <= 0) return new XV(); + for (c = n.Kc(); c.Ob(); ) { + for (i = Yx(c.Pb(), 231), d = 0, f = Yjn, l = Yjn, s = nTn, h = nTn, w = new pb(i.e); w.a < w.c.c.length; ) + (b = Yx(Hz(w), 144)), + (d += Yx(Aun(b, (Bdn(), bGn)), 19).a), + (f = e.Math.min(f, b.d.a - b.e.a / 2)), + (l = e.Math.min(l, b.d.b - b.e.b / 2)), + (s = e.Math.max(s, b.d.a + b.e.a / 2)), + (h = e.Math.max(h, b.d.b + b.e.b / 2)); + b5(i, (Bdn(), bGn), d9(d)), b5(i, (d2(), jGn), new QS(f, l)), b5(i, kGn, new QS(s, h)); + } + for (XH(), n.ad(new wt()), o4((g = new XV()), Yx(n.Xb(0), 94)), o = 0, m = 0, a = n.Kc(); a.Ob(); ) + (i = Yx(a.Pb(), 231)), (p = yN(dO(Yx(Aun(i, (d2(), kGn)), 8)), Yx(Aun(i, jGn), 8))), (o = e.Math.max(o, p.a)), (m += p.a * p.b); + for ( + o = e.Math.max(o, e.Math.sqrt(m) * ty(fL(Aun(g, (Bdn(), nGn))))), y = 0, k = 0, u = 0, t = v = ty(fL(Aun(g, mGn))), r = n.Kc(); + r.Ob(); + + ) + (i = Yx(r.Pb(), 231)), + y + (p = yN(dO(Yx(Aun(i, (d2(), kGn)), 8)), Yx(Aun(i, jGn), 8))).a > o && ((y = 0), (k += u + v), (u = 0)), + zgn(g, i, y, k), + (t = e.Math.max(t, y + p.a)), + (u = e.Math.max(u, p.b)), + (y += p.a + v); + return g; + } + function Fkn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w; + switch (((h = new Nv()), n.a.g)) { + case 3: + (l = Yx(Aun(t.e, (Ojn(), WQn)), 15)), + (b = Yx(Aun(t.j, WQn), 15)), + (w = Yx(Aun(t.f, WQn), 15)), + (e = Yx(Aun(t.e, UQn), 15)), + (i = Yx(Aun(t.j, UQn), 15)), + (r = Yx(Aun(t.f, UQn), 15)), + S4((a = new ip()), l), + b.Jc(new yc()), + S4(a, CO(b, 152) ? RV(Yx(b, 152)) : CO(b, 131) ? Yx(b, 131).a : CO(b, 54) ? new Tm(b) : new rE(b)), + S4(a, w), + S4((c = new ip()), e), + S4(c, CO(i, 152) ? RV(Yx(i, 152)) : CO(i, 131) ? Yx(i, 131).a : CO(i, 54) ? new Tm(i) : new rE(i)), + S4(c, r), + b5(t.f, WQn, a), + b5(t.f, UQn, c), + b5(t.f, VQn, t.f), + b5(t.e, WQn, null), + b5(t.e, UQn, null), + b5(t.j, WQn, null), + b5(t.j, UQn, null); + break; + case 1: + C2(h, t.e.a), KD(h, t.i.n), C2(h, I3(t.j.a)), KD(h, t.a.n), C2(h, t.f.a); + break; + default: + C2(h, t.e.a), C2(h, I3(t.j.a)), C2(h, t.f.a); + } + BH(t.f.a), + C2(t.f.a, h), + YG(t.f, t.e.c), + (u = Yx(Aun(t.e, (gjn(), $1n)), 74)), + (s = Yx(Aun(t.j, $1n), 74)), + (o = Yx(Aun(t.f, $1n), 74)), + (u || s || o) && (H_((f = new Nv()), o), H_(f, s), H_(f, u), b5(t.f, $1n, f)), + YG(t.j, null), + QG(t.j, null), + YG(t.e, null), + QG(t.e, null), + JG(t.a, null), + JG(t.i, null), + t.g && Fkn(n, t.g); + } + function Bkn(n, t, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M; + return ( + (y = n.c[($z(0, t.c.length), Yx(t.c[0], 17)).p]), + (T = n.c[($z(1, t.c.length), Yx(t.c[1], 17)).p]), + !( + (y.a.e.e - y.a.a - (y.b.e.e - y.b.a) == 0 && T.a.e.e - T.a.a - (T.b.e.e - T.b.a) == 0) || + !CO((v = y.b.e.f), 10) || + ((p = Yx(v, 10)), + (j = n.i[p.p]), + (E = p.c ? hJ(p.c.a, p, 0) : -1), + (a = JTn), + E > 0 && + ((c = Yx(TR(p.c.a, E - 1), 10)), + (u = n.i[c.p]), + (M = e.Math.ceil(lO(n.n, c, p))), + (a = j.a.e - p.d.d - (u.a.e + c.o.b + c.d.a) - M)), + (h = JTn), + E < p.c.a.c.length - 1 && + ((s = Yx(TR(p.c.a, E + 1), 10)), + (f = n.i[s.p]), + (M = e.Math.ceil(lO(n.n, s, p))), + (h = f.a.e - s.d.d - (j.a.e + p.o.b + p.d.a) - M)), + !(i && (XC(), o0(UAn), e.Math.abs(a - h) <= UAn || a == h || (isNaN(a) && isNaN(h)))) && + ((r = wF(y.a)), + (o = -wF(y.b)), + (l = -wF(T.a)), + (m = wF(T.b)), + (g = y.a.e.e - y.a.a - (y.b.e.e - y.b.a) > 0 && T.a.e.e - T.a.a - (T.b.e.e - T.b.a) < 0), + (d = y.a.e.e - y.a.a - (y.b.e.e - y.b.a) < 0 && T.a.e.e - T.a.a - (T.b.e.e - T.b.a) > 0), + (w = y.a.e.e + y.b.a < T.b.e.e + T.a.a), + (b = y.a.e.e + y.b.a > T.b.e.e + T.a.a), + (k = 0), + !g && !d && (b ? (a + l > 0 ? (k = l) : h - r > 0 && (k = r)) : w && (a + o > 0 ? (k = o) : h - m > 0 && (k = m))), + (j.a.e += k), + j.b && (j.d.e += k), + 1)) + ) + ); + } + function Hkn(n, t, i) { + var r, c, a, u, o, s, h, f, l, b; + if (((r = new mH(t.qf().a, t.qf().b, t.rf().a, t.rf().b)), (c = new hC()), n.c)) + for (u = new pb(t.wf()); u.a < u.c.c.length; ) + (a = Yx(Hz(u), 181)), (c.c = a.qf().a + t.qf().a), (c.d = a.qf().b + t.qf().b), (c.b = a.rf().a), (c.a = a.rf().b), bsn(r, c); + for (h = new pb(t.Cf()); h.a < h.c.c.length; ) { + if ( + ((f = (s = Yx(Hz(h), 838)).qf().a + t.qf().a), + (l = s.qf().b + t.qf().b), + n.e && ((c.c = f), (c.d = l), (c.b = s.rf().a), (c.a = s.rf().b), bsn(r, c)), + n.d) + ) + for (u = new pb(s.wf()); u.a < u.c.c.length; ) + (a = Yx(Hz(u), 181)), (c.c = a.qf().a + f), (c.d = a.qf().b + l), (c.b = a.rf().a), (c.a = a.rf().b), bsn(r, c); + if (n.b) { + if (((b = new QS(-i, -i)), Yx(t.We((Cjn(), Mtt)), 174).Hc((Chn(), mit)))) + for (u = new pb(s.wf()); u.a < u.c.c.length; ) (a = Yx(Hz(u), 181)), (b.a += a.rf().a + i), (b.b += a.rf().b + i); + (b.a = e.Math.max(b.a, 0)), (b.b = e.Math.max(b.b, 0)), Spn(r, s.Bf(), s.zf(), t, s, b, i); + } + } + n.b && Spn(r, t.Bf(), t.zf(), t, null, null, i), + ((o = new yx(t.Af())).d = e.Math.max(0, t.qf().b - r.d)), + (o.a = e.Math.max(0, r.d + r.a - (t.qf().b + t.rf().b))), + (o.b = e.Math.max(0, t.qf().a - r.c)), + (o.c = e.Math.max(0, r.c + r.b - (t.qf().a + t.rf().a))), + t.Ef(o); + } + function qkn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l; + for ( + s = Yx(Yx(_V(n.r, t), 21), 84), + a = (function (n, t) { + var e, i, r, c; + return ( + PL(), + (r = Yx(Yx(_V(n.r, t), 21), 84)).gc() >= 2 && + ((i = Yx(r.Kc().Pb(), 111)), (e = n.u.Hc((Chn(), git))), (c = n.u.Hc(yit)), !i.a && !e && (2 == r.gc() || c)) + ); + })(n, t), + e = n.u.Hc((Chn(), dit)), + o = s.Kc(); + o.Ob(); + + ) + if ((u = Yx(o.Pb(), 111)).c && !(u.c.d.c.length <= 0)) { + switch ( + ((l = u.b.rf()), ((f = (h = u.c).i).b = ((c = h.n), h.e.a + c.b + c.c)), (f.a = ((r = h.n), h.e.b + r.d + r.a)), t.g) + ) { + case 1: + u.a + ? ((f.c = (l.a - f.b) / 2), lY(h, (BY(), hHn))) + : a || e + ? ((f.c = -f.b - n.s), lY(h, (BY(), lHn))) + : ((f.c = l.a + n.s), lY(h, (BY(), fHn))), + (f.d = -f.a - n.t), + OL(h, (OJ(), pHn)); + break; + case 3: + u.a + ? ((f.c = (l.a - f.b) / 2), lY(h, (BY(), hHn))) + : a || e + ? ((f.c = -f.b - n.s), lY(h, (BY(), lHn))) + : ((f.c = l.a + n.s), lY(h, (BY(), fHn))), + (f.d = l.b + n.t), + OL(h, (OJ(), mHn)); + break; + case 2: + u.a + ? ((i = n.v ? f.a : Yx(TR(h.d, 0), 181).rf().b), (f.d = (l.b - i) / 2), OL(h, (OJ(), vHn))) + : a || e + ? ((f.d = -f.a - n.t), OL(h, (OJ(), pHn))) + : ((f.d = l.b + n.t), OL(h, (OJ(), mHn))), + (f.c = l.a + n.s), + lY(h, (BY(), fHn)); + break; + case 4: + u.a + ? ((i = n.v ? f.a : Yx(TR(h.d, 0), 181).rf().b), (f.d = (l.b - i) / 2), OL(h, (OJ(), vHn))) + : a || e + ? ((f.d = -f.a - n.t), OL(h, (OJ(), pHn))) + : ((f.d = l.b + n.t), OL(h, (OJ(), mHn))), + (f.c = -f.b - n.s), + lY(h, (BY(), lHn)); + } + a = !1; + } + } + function Gkn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l; + if ((Ljn(), 0 == hE(vot))) { + for (f = VQ(Got, TEn, 117, yot.length, 0, 1), a = 0; a < f.length; a++) f[a] = new cU(4); + for (i = new Oy(), c = 0; c < pot.length; c++) { + if ( + ((h = new cU(4)), + c < 84 + ? (Lz((u = 2 * c), LKn.length), (l = LKn.charCodeAt(u)), Lz(u + 1, LKn.length), zwn(h, l, LKn.charCodeAt(u + 1))) + : zwn(h, kot[(u = 2 * (c - 84))], kot[u + 1]), + _N((o = pot[c]), "Specials") && zwn(h, 65520, 65533), + _N(o, AKn) && (zwn(h, 983040, 1048573), zwn(h, 1048576, 1114109)), + GG(vot, o, h), + GG(mot, o, nvn(h)), + 0 < (s = i.a.length) ? (i.a = i.a.substr(0, 0)) : 0 > s && (i.a += IO(VQ(Xot, sTn, 25, -s, 15, 1))), + (i.a += "Is"), + VI(o, gun(32)) >= 0) + ) + for (r = 0; r < o.length; r++) Lz(r, o.length), 32 != o.charCodeAt(r) && KF(i, (Lz(r, o.length), o.charCodeAt(r))); + else i.a += "" + o; + xnn(i.a, o, !0); + } + xnn($Kn, "Cn", !1), + xnn(NKn, "Cn", !0), + zwn((e = new cU(4)), 0, jKn), + GG(vot, "ALL", e), + GG(mot, "ALL", nvn(e)), + !Bot && (Bot = new rp()), + GG(Bot, $Kn, $Kn), + !Bot && (Bot = new rp()), + GG(Bot, NKn, NKn), + !Bot && (Bot = new rp()), + GG(Bot, "ALL", "ALL"); + } + return Yx(aG(t ? vot : mot, n), 136); + } + function zkn(n, t, e, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g, p; + if (((l = !1), (f = !1), dC(Yx(Aun(i, (gjn(), g0n)), 98)))) { + (a = !1), (u = !1); + n: for (w = new pb(i.j); w.a < w.c.c.length; ) + for (b = Yx(Hz(w), 11), d = W_(n0(x4(Gy(QKn, 1), iEn, 20, 0, [new fw(b), new bw(b)]))); Vfn(d); ) + if (!ny(hL(Aun(Yx(kV(d), 11).i, KZn)))) { + if (b.j == (Ikn(), Tit)) { + a = !0; + break n; + } + if (b.j == Bit) { + u = !0; + break n; + } + } + (l = u && !a), (f = a && !u); + } + if (l || f || 0 == i.b.c.length) p = !f; + else { + for (h = 0, s = new pb(i.b); s.a < s.c.c.length; ) h += (o = Yx(Hz(s), 70)).n.b + o.o.b / 2; + p = (h /= i.b.c.length) >= i.o.b / 2; + } + p + ? (g = Yx(Aun(i, (Ojn(), JQn)), 15)) + ? l + ? (c = g) + : (r = Yx(Aun(i, QVn), 15)) + ? (c = g.gc() <= r.gc() ? g : r) + : ((c = new ip()), b5(i, QVn, c)) + : ((c = new ip()), b5(i, JQn, c)) + : (r = Yx(Aun(i, (Ojn(), QVn)), 15)) + ? f + ? (c = r) + : (g = Yx(Aun(i, JQn), 15)) + ? (c = r.gc() <= g.gc() ? r : g) + : ((c = new ip()), b5(i, JQn, c)) + : ((c = new ip()), b5(i, QVn, c)), + c.Fc(n), + b5(n, (Ojn(), JVn), e), + t.d == e + ? (QG(t, null), + e.e.c.length + e.g.c.length == 0 && ZG(e, null), + (function (n) { + var t, e; + (t = Yx(Aun(n, (Ojn(), RQn)), 10)) && (uJ((e = t.c).a, t), 0 == e.a.c.length && uJ(dB(t).b, e)); + })(e)) + : (YG(t, null), e.e.c.length + e.g.c.length == 0 && ZG(e, null)), + BH(t.a); + } + function Ukn(n, t, i) { + var r, c, a, u, o, s, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M, S, P, I, C, O, A, $; + for ( + run(i, "MinWidth layering", 1), + d = t.b, + M = t.a, + $ = Yx(Aun(t, (gjn(), R1n)), 19).a, + o = Yx(Aun(t, K1n), 19).a, + n.b = ty(fL(Aun(t, N0n))), + n.d = JTn, + j = new pb(M); + j.a < j.c.c.length; + + ) + (y = Yx(Hz(j), 10)).k == (bon(), Hzn) && ((I = y.o.b), (n.d = e.Math.min(n.d, I))); + for ( + n.d = e.Math.max(1, n.d), + S = M.c.length, + n.c = VQ(Wot, MTn, 25, S, 15, 1), + n.f = VQ(Wot, MTn, 25, S, 15, 1), + n.e = VQ(Jot, rMn, 25, S, 15, 1), + f = 0, + n.a = 0, + E = new pb(M); + E.a < E.c.c.length; + + ) + ((y = Yx(Hz(E), 10)).p = f++), (n.c[y.p] = U6(u7(y))), (n.f[y.p] = U6(o7(y))), (n.e[y.p] = y.o.b / n.d), (n.a += n.e[y.p]); + for ( + n.b /= n.d, + n.a /= S, + T = (function (n) { + var t, e, i, r, c, a; + for (a = h$(n.c.length), r = new pb(n); r.a < r.c.c.length; ) { + for (i = Yx(Hz(r), 10), c = new Qp(), e = new $K(bA(o7(i).a.Kc(), new h())); Vfn(e); ) + (t = Yx(kV(e), 17)).c.i == t.d.i || __(c, t.d.i); + a.c[a.c.length] = c; + } + return a; + })(M), + JC(M, DB(new ud(n))), + p = JTn, + g = Yjn, + u = null, + A = $, + O = $, + a = o, + c = o, + $ < 0 && ((A = Yx(K3n.a.zd(), 19).a), (O = Yx(K3n.b.zd(), 19).a)), + o < 0 && ((a = Yx(R3n.a.zd(), 19).a), (c = Yx(R3n.b.zd(), 19).a)), + C = A; + C <= O; + C++ + ) + for (r = a; r <= c; r++) + (m = ty(fL((P = Gvn(n, C, r, M, T)).a))), + (v = (w = Yx(P.b, 15)).gc()), + (m < p || (m == p && v < g)) && ((p = m), (g = v), (u = w)); + for (b = u.Kc(); b.Ob(); ) { + for (l = Yx(b.Pb(), 15), s = new qF(t), k = l.Kc(); k.Ob(); ) JG((y = Yx(k.Pb(), 10)), s); + d.c[d.c.length] = s; + } + Dsn(d), (M.c = VQ(UKn, iEn, 1, 0, 5, 1)), Ron(i); + } + function Xkn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m; + if (((d = 0 != n.i), (v = !1), (g = null), gC(n.e))) { + if ((h = t.gc()) > 0) { + for ( + l = h < 100 ? null : new Ek(h), w = new t3(t).g, g = VQ(Wot, MTn, 25, h, 15, 1), i = 0, m = new FZ(h), r = 0; + r < n.i; + ++r + ) { + b = u = n.g[r]; + n: for (p = 0; p < 2; ++p) { + for (o = h; --o >= 0; ) + if (null != b ? Q8(b, w[o]) : iI(b) === iI(w[o])) { + g.length <= i && smn(g, 0, (g = VQ(Wot, MTn, 25, 2 * g.length, 15, 1)), 0, i), (g[i++] = r), fY(m, w[o]); + break n; + } + if (iI(b) === iI(u)) break; + } + } + if (((s = m), (w = m.g), (h = i), i > g.length && smn(g, 0, (g = VQ(Wot, MTn, 25, i, 15, 1)), 0, i), i > 0)) { + for (v = !0, c = 0; c < i; ++c) l = ZN(n, Yx((b = w[c]), 72), l); + for (a = i; --a >= 0; ) Orn(n, g[a]); + if (i != h) { + for (r = h; --r >= i; ) Orn(s, r); + smn(g, 0, (g = VQ(Wot, MTn, 25, i, 15, 1)), 0, i); + } + t = s; + } + } + } else + for ( + t = (function (n, t) { + var e, i, r; + if (t.dc()) return iL(), iL(), $ct; + for (e = new HL(n, t.gc()), r = new UO(n); r.e != r.i.gc(); ) (i = hen(r)), t.Hc(i) && fY(e, i); + return e; + })(n, t), + r = n.i; + --r >= 0; + + ) + t.Hc(n.g[r]) && (Orn(n, r), (v = !0)); + if (v) { + if (null != g) { + for ( + f = 1 == (e = t.gc()) ? zG(n, 4, t.Kc().Pb(), null, g[0], d) : zG(n, 6, t, g, g[0], d), + l = e < 100 ? null : new Ek(e), + r = t.Kc(); + r.Ob(); + + ) + l = JN(n, Yx((b = r.Pb()), 72), l); + l ? (l.Ei(f), l.Fi()) : K3(n.e, f); + } else { + for ( + l = (function (n) { + return n < 100 ? null : new Ek(n); + })(t.gc()), + r = t.Kc(); + r.Ob(); + + ) + l = JN(n, Yx((b = r.Pb()), 72), l); + l && l.Fi(); + } + return !0; + } + return !1; + } + function Wkn(n, t) { + var i, r, c, a, u, o, s, f, l, b, w, d, g, p, v, m, y; + for ( + (i = new Fen(t)).a || + (function (n) { + var t, i, r, c, a; + switch ( + ((c = Yx(TR(n.a, 0), 10)), + (t = new rin(n)), + eD(n.a, t), + (t.o.a = e.Math.max(1, c.o.a)), + (t.o.b = e.Math.max(1, c.o.b)), + (t.n.a = c.n.a), + (t.n.b = c.n.b), + Yx(Aun(c, (Ojn(), hQn)), 61).g) + ) { + case 4: + t.n.a += 2; + break; + case 1: + t.n.b += 2; + break; + case 2: + t.n.a -= 2; + break; + case 3: + t.n.b -= 2; + } + ZG((r = new Ion()), t), YG((i = new jq()), (a = Yx(TR(c.j, 0), 11))), QG(i, r), mN(OI(r.n), a.n), mN(OI(r.a), a.a); + })(t), + f = (function (n) { + var t, e, i, r, c, a, u; + for (u = new rV(), a = new pb(n.a); a.a < a.c.c.length; ) + if ((c = Yx(Hz(a), 10)).k != (bon(), _zn)) + for (bln(u, c, new Pk()), r = new $K(bA(o7(c).a.Kc(), new h())); Vfn(r); ) + if ((i = Yx(kV(r), 17)).c.i.k != _zn && i.d.i.k != _zn) + for (e = Ztn(i.a, 0); e.b != e.d.c; ) ean(u, new LM((t = Yx(IX(e), 8)).a, t.b)); + return u; + })(t), + s = new Zq(), + p = new Gwn(), + g = new pb(t.a); + g.a < g.c.c.length; + + ) + for (c = new $K(bA(o7(Yx(Hz(g), 10)).a.Kc(), new h())); Vfn(c); ) + ((r = Yx(kV(c), 17)).c.i.k != (bon(), _zn) && r.d.i.k != _zn) || Qhn(s, Jtn((l = Vyn(n, r, f, p)).d), l.a); + for (u = new ip(), y = Yx(Aun(i.c, (Ojn(), uQn)), 21).Kc(); y.Ob(); ) { + switch (((m = Yx(y.Pb(), 61)), (d = p.c[m.g]), (w = p.b[m.g]), (o = p.a[m.g]), (a = null), (v = null), m.g)) { + case 4: + (a = new mH(n.d.a, d, f.b.a - n.d.a, w - d)), + (v = new mH(n.d.a, d, o, w - d)), + zD(f, new QS(a.c + a.b, a.d)), + zD(f, new QS(a.c + a.b, a.d + a.a)); + break; + case 2: + (a = new mH(f.a.a, d, n.c.a - f.a.a, w - d)), + (v = new mH(n.c.a - o, d, o, w - d)), + zD(f, new QS(a.c, a.d)), + zD(f, new QS(a.c, a.d + a.a)); + break; + case 1: + (a = new mH(d, n.d.b, w - d, f.b.b - n.d.b)), + (v = new mH(d, n.d.b, w - d, o)), + zD(f, new QS(a.c, a.d + a.a)), + zD(f, new QS(a.c + a.b, a.d + a.a)); + break; + case 3: + (a = new mH(d, f.a.b, w - d, n.c.b - f.a.b)), + (v = new mH(d, n.c.b - o, w - d, o)), + zD(f, new QS(a.c, a.d)), + zD(f, new QS(a.c + a.b, a.d)); + } + a && (((b = new bv()).d = m), (b.b = a), (b.c = v), (b.a = oq(Yx(_V(s, Jtn(m)), 21))), (u.c[u.c.length] = b)); + } + return ( + S4(i.b, u), + (i.d = (function (n) { + var t; + return (t = new xZ(n)), $U(n.a, Ezn, new ay(x4(Gy(lzn, 1), iEn, 369, 0, [t]))), t.d && eD(t.f, t.d), t.f; + })( + (function (n) { + var t, e, i, r, c, a, u; + for (oZ(), u = new ov(), e = new pb(n); e.a < e.c.c.length; ) + (t = Yx(Hz(e), 140)), + (!u.b || t.c >= u.b.c) && (u.b = t), + (!u.c || t.c <= u.c.c) && ((u.d = u.c), (u.c = t)), + (!u.e || t.d >= u.e.d) && (u.e = t), + (!u.f || t.d <= u.f.d) && (u.f = t); + return ( + (i = new ben((_4(), bzn))), + $U(n, jzn, new ay(x4(Gy(lzn, 1), iEn, 369, 0, [i]))), + (a = new ben(gzn)), + $U(n, kzn, new ay(x4(Gy(lzn, 1), iEn, 369, 0, [a]))), + (r = new ben(wzn)), + $U(n, yzn, new ay(x4(Gy(lzn, 1), iEn, 369, 0, [r]))), + (c = new ben(dzn)), + $U(n, mzn, new ay(x4(Gy(lzn, 1), iEn, 369, 0, [c]))), + kbn(i.c, bzn), + kbn(r.c, wzn), + kbn(c.c, dzn), + kbn(a.c, gzn), + (u.a.c = VQ(UKn, iEn, 1, 0, 5, 1)), + S4(u.a, i.c), + S4(u.a, I3(r.c)), + S4(u.a, c.c), + S4(u.a, I3(a.c)), + u + ); + })(f), + )), + i + ); + } + function Vkn(n, t, i) { + var r, c, a, u, o, s, h, f, l, b, w, d; + if (null == i.p[t.p]) { + (o = !0), (i.p[t.p] = 0), (u = t), (d = i.o == (RG(), v4n) ? ZTn : JTn); + do { + (c = n.b.e[u.p]), + (a = u.c.a.c.length), + (i.o == v4n && c > 0) || (i.o == m4n && c < a - 1) + ? (null, + null, + (s = i.o == m4n ? Yx(TR(u.c.a, c + 1), 10) : Yx(TR(u.c.a, c - 1), 10)), + Vkn(n, (h = i.g[s.p]), i), + (d = n.e.bg(d, t, u)), + i.j[t.p] == t && (i.j[t.p] = i.j[h.p]), + i.j[t.p] == i.j[h.p] + ? ((w = lO(n.d, u, s)), + i.o == m4n + ? ((r = ty(i.p[t.p])), + (l = ty(i.p[h.p]) + ty(i.d[s.p]) - s.d.d - w - u.d.a - u.o.b - ty(i.d[u.p])), + o ? ((o = !1), (i.p[t.p] = e.Math.min(l, d))) : (i.p[t.p] = e.Math.min(r, e.Math.min(l, d)))) + : ((r = ty(i.p[t.p])), + (l = ty(i.p[h.p]) + ty(i.d[s.p]) + s.o.b + s.d.a + w + u.d.d - ty(i.d[u.p])), + o ? ((o = !1), (i.p[t.p] = e.Math.max(l, d))) : (i.p[t.p] = e.Math.max(r, e.Math.max(l, d))))) + : ((w = ty(fL(Aun(n.a, (gjn(), G0n))))), + (b = f2(n, i.j[t.p])), + (f = f2(n, i.j[h.p])), + i.o == m4n + ? Kz(b, f, ty(i.p[t.p]) + ty(i.d[u.p]) + u.o.b + u.d.a + w - (ty(i.p[h.p]) + ty(i.d[s.p]) - s.d.d)) + : Kz(b, f, ty(i.p[t.p]) + ty(i.d[u.p]) - u.d.d - ty(i.p[h.p]) - ty(i.d[s.p]) - s.o.b - s.d.a - w))) + : (d = n.e.bg(d, t, u)), + (u = i.a[u.p]); + } while (u != t); + !(function (n, t) { + __(n.b, t); + })(n.e, t); + } + } + function Qkn(n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g; + if (P_(n.a, t)) { + if (gE(Yx(BF(n.a, t), 53), e)) return 1; + } else xB(n.a, t, new Qp()); + if (P_(n.a, e)) { + if (gE(Yx(BF(n.a, e), 53), t)) return -1; + } else xB(n.a, e, new Qp()); + if (P_(n.e, t)) { + if (gE(Yx(BF(n.e, t), 53), e)) return -1; + } else xB(n.e, t, new Qp()); + if (P_(n.e, e)) { + if (gE(Yx(BF(n.a, e), 53), t)) return 1; + } else xB(n.e, e, new Qp()); + if (n.c == (k5(), V2n) || !O$(t, (Ojn(), IQn)) || !O$(e, (Ojn(), IQn))) { + if ( + ((o = Yx(DA(mW(G5(hH(new SR(null, new Nz(t.j, 16)), new sc())), new hc())), 11)), + (h = Yx(DA(mW(G5(hH(new SR(null, new Nz(e.j, 16)), new fc())), new lc())), 11)), + o && h) + ) { + if (((u = o.i), (s = h.i), u && u == s)) { + for (l = new pb(u.j); l.a < l.c.c.length; ) { + if ((f = Yx(Hz(l), 11)) == o) return mgn(n, e, t), -1; + if (f == h) return mgn(n, t, e), 1; + } + return eO(uan(n, t), uan(n, e)); + } + for (d = 0, g = (w = n.d).length; d < g; ++d) { + if ((b = w[d]) == u) return mgn(n, e, t), -1; + if (b == s) return mgn(n, t, e), 1; + } + } + if (!O$(t, (Ojn(), IQn)) || !O$(e, IQn)) + return (r = uan(n, t)) > (a = uan(n, e)) ? mgn(n, t, e) : mgn(n, e, t), r < a ? -1 : r > a ? 1 : 0; + } + return ( + (i = Yx(Aun(t, (Ojn(), IQn)), 19).a) > (c = Yx(Aun(e, IQn), 19).a) ? mgn(n, t, e) : mgn(n, e, t), i < c ? -1 : i > c ? 1 : 0 + ); + } + function Ykn(n, t, e, i) { + var r, c, a, u, o, s, f, l, b, w, d, g; + if (ny(hL(jln(t, (Cjn(), ctt))))) return XH(), XH(), TFn; + if ( + ((o = 0 != (!t.a && (t.a = new m_(uct, t, 10, 11)), t.a).i), + (s = !(f = (function (n) { + var t, e, i; + if (ny(hL(jln(n, (Cjn(), Fnt))))) { + for (i = new ip(), e = new $K(bA(lbn(n).a.Kc(), new h())); Vfn(e); ) + Whn((t = Yx(kV(e), 79))) && ny(hL(jln(t, Bnt))) && (i.c[i.c.length] = t); + return i; + } + return XH(), XH(), TFn; + })(t)).dc()), + o || s) + ) { + if (!(r = Yx(jln(t, Ltt), 149))) + throw hp(new ly("Resolved algorithm is not set; apply a LayoutAlgorithmResolver before computing layout.")); + if (((g = zS(r, (zfn(), dct))), Otn(t), !o && s && !g)) return XH(), XH(), TFn; + if (((u = new ip()), iI(jln(t, Rnt)) === iI((O8(), $et)) && (zS(r, lct) || zS(r, fct)))) + for (b = Udn(n, t), C2((w = new ME()), (!t.a && (t.a = new m_(uct, t, 10, 11)), t.a)); 0 != w.b; ) + Otn((l = Yx(0 == w.b ? null : (S$(0 != w.b), VZ(w, w.a.a)), 33))), + iI(jln(l, Rnt)) === iI(Net) || (zQ(l, gnt) && !oV(r, jln(l, Ltt))) + ? (S4(u, Ykn(n, l, e, i)), Aen(l, Rnt, Net), Fgn(l)) + : C2(w, (!l.a && (l.a = new m_(uct, l, 10, 11)), l.a)); + else + for ( + b = (!t.a && (t.a = new m_(uct, t, 10, 11)), t.a).i, a = new UO((!t.a && (t.a = new m_(uct, t, 10, 11)), t.a)); + a.e != a.i.gc(); + + ) + S4(u, Ykn(n, (c = Yx(hen(a), 33)), e, i)), Fgn(c); + for (d = new pb(u); d.a < d.c.c.length; ) Aen(Yx(Hz(d), 79), ctt, (TA(), !0)); + return ( + _tn(t, r, J2(i, b)), + (function (n) { + var t, e, i, r, c, a, u, o; + for (a = new pb(n); a.a < a.c.c.length; ) { + for ( + c = Yx(Hz(a), 79), + u = (i = iun(Yx(c1((!c.b && (c.b = new AN(Zrt, c, 4, 7)), c.b), 0), 82))).i, + o = i.j, + TC((r = Yx(c1((!c.a && (c.a = new m_(tct, c, 6, 6)), c.a), 0), 202)), r.j + u, r.k + o), + EC(r, r.b + u, r.c + o), + e = new UO((!r.a && (r.a = new XO(Qrt, r, 5)), r.a)); + e.e != e.i.gc(); + + ) + yC((t = Yx(hen(e), 469)), t.a + u, t.b + o); + R2(Yx(jln(c, (Cjn(), Gnt)), 74), u, o); + } + })(u), + s && g ? f : (XH(), XH(), TFn) + ); + } + return XH(), XH(), TFn; + } + function Jkn(n, t, e, i, r, c, a, u, o) { + var s, h, f, l, b, w, d; + switch ( + ((b = e), + Al((h = new rin(o)), (bon(), _zn)), + b5(h, (Ojn(), fQn), a), + b5(h, (gjn(), g0n), (Ran(), oit)), + (d = ty(fL(n.We(d0n)))), + b5(h, d0n, d), + ZG((f = new Ion()), h), + (t != fit && t != lit) || ((b = i >= 0 ? G7(u) : O9(G7(u))), n.Ye(k0n, b)), + (s = new Pk()), + (l = !1), + n.Xe(w0n) + ? (x$(s, Yx(n.We(w0n), 8)), (l = !0)) + : (function (n, t, e) { + (n.a = t), (n.b = e); + })(s, a.a / 2, a.b / 2), + b.g) + ) { + case 4: + b5(h, x1n, (d7(), nYn)), + b5(h, rQn, (i5(), UWn)), + (h.o.b = a.b), + d < 0 && (h.o.a = -d), + whn(f, (Ikn(), Eit)), + l || (s.a = a.a), + (s.a -= a.a); + break; + case 2: + b5(h, x1n, (d7(), eYn)), b5(h, rQn, (i5(), GWn)), (h.o.b = a.b), d < 0 && (h.o.a = -d), whn(f, (Ikn(), qit)), l || (s.a = 0); + break; + case 1: + b5(h, pQn, (AJ(), HVn)), (h.o.a = a.a), d < 0 && (h.o.b = -d), whn(f, (Ikn(), Bit)), l || (s.b = a.b), (s.b -= a.b); + break; + case 3: + b5(h, pQn, (AJ(), FVn)), (h.o.a = a.a), d < 0 && (h.o.b = -d), whn(f, (Ikn(), Tit)), l || (s.b = 0); + } + if ((x$(f.n, s), b5(h, w0n, s), t == uit || t == sit || t == oit)) { + if (((w = 0), t == uit && n.Xe(p0n))) + switch (b.g) { + case 1: + case 2: + w = Yx(n.We(p0n), 19).a; + break; + case 3: + case 4: + w = -Yx(n.We(p0n), 19).a; + } + else + switch (b.g) { + case 4: + case 2: + (w = c.b), t == sit && (w /= r.b); + break; + case 1: + case 3: + (w = c.a), t == sit && (w /= r.a); + } + b5(h, KQn, w); + } + return b5(h, hQn, b), h; + } + function Zkn(n, t, e, i) { + var r, c, a, u, o, s, h, f, l, b; + for (f = !1, s = n + 1, $z(n, t.c.length), a = (h = Yx(t.c[n], 200)).a, u = null, c = 0; c < h.a.c.length; c++) + if (($z(c, a.c.length), !(r = Yx(a.c[c], 187)).c)) + if (0 != r.b.c.length) { + if ( + (r.k || (u && ern(u), Qen(r, (u = new pG(u ? u.e + u.d + i : 0, h.f, i)).e + u.d, h.f), eD(h.d, u), o3(u, r), (r.k = !0)), + (o = null), + (b = null), + c < h.a.c.length - 1 + ? (b = Yx(TR(h.a, c + 1), 187)) + : s < t.c.length && + 0 != ($z(s, t.c.length), Yx(t.c[s], 200)).a.c.length && + (b = Yx(TR(($z(s, t.c.length), Yx(t.c[s], 200)).a, 0), 187)), + (l = !1), + (o = b) && (l = !Q8(o.j, h)), + o) + ) { + if (0 == o.b.c.length) { + acn(h, o); + break; + } + if ((pY(r, e - r.s), ern(r.q), (f |= son(h, r, o, e, i)), 0 == o.b.c.length)) + for ( + acn(($z(s, t.c.length), Yx(t.c[s], 200)), o), o = null; + t.c.length > s && 0 == ($z(s, t.c.length), Yx(t.c[s], 200)).a.c.length; + + ) + uJ(t, ($z(s, t.c.length), t.c[s])); + if (!o) { + --c; + continue; + } + if (bpn(t, h, r, o, l, e, s, i)) { + f = !0; + continue; + } + if (l) { + if (imn(t, h, r, o, e, s, i)) { + f = !0; + continue; + } + if (u8(h, r)) { + (r.c = !0), (f = !0); + continue; + } + } else if (u8(h, r)) { + (r.c = !0), (f = !0); + continue; + } + if (f) continue; + } + u8(h, r) ? ((r.c = !0), (f = !0), o && (o.k = !1)) : ern(r.q); + } else oE(), acn(h, r), --c, (f = !0); + return f; + } + function njn(n, t, i, r, c, a, u) { + var o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M, S, P, I, C, O, A; + for (g = 0, P = 0, h = new pb(n.b); h.a < h.c.c.length; ) + (s = Yx(Hz(h), 157)).c && Uyn(s.c), (g = e.Math.max(g, DR(s))), (P += DR(s) * xR(s)); + for ( + p = P / n.b.c.length, + S = (function (n, t) { + var i, r, c; + for (c = 0, r = new pb(n); r.a < r.c.c.length; ) (i = Yx(Hz(r), 157)), (c += e.Math.pow(DR(i) * xR(i) - t, 2)); + return e.Math.sqrt(c / (n.c.length - 1)); + })(n.b, p), + P += n.b.c.length * S, + g = e.Math.max(g, e.Math.sqrt(P * u)) + i.b, + O = i.b, + A = i.d, + w = 0, + l = i.b + i.c, + KD((M = new ME()), d9(0)), + E = new ME(), + f = new JU(n.b, 0), + d = null, + o = new ip(); + f.b < f.d.gc(); + + ) + S$(f.b < f.d.gc()), + (C = DR((s = Yx(f.d.Xb((f.c = f.b++)), 157)))), + (b = xR(s)), + O + C > g && + (a && (EI(E, w), EI(M, d9(f.b - 1)), eD(n.d, d), (o.c = VQ(UKn, iEn, 1, 0, 5, 1))), + (O = i.b), + (A += w + t), + (w = 0), + (l = e.Math.max(l, i.b + i.c + C))), + (o.c[o.c.length] = s), + wen(s, O, A), + (l = e.Math.max(l, O + C + i.c)), + (w = e.Math.max(w, b)), + (O += C + t), + (d = s); + if ( + (S4(n.a, o), + eD(n.d, Yx(TR(o, o.c.length - 1), 157)), + (l = e.Math.max(l, r)), + (I = A + w + i.a) < c && ((w += c - I), (I = c)), + a) + ) + for ( + O = i.b, f = new JU(n.b, 0), EI(M, d9(n.b.c.length)), m = Yx(IX((T = Ztn(M, 0))), 19).a, EI(E, w), j = Ztn(E, 0), k = 0; + f.b < f.d.gc(); + + ) + f.b == m && ((O = i.b), (k = ty(fL(IX(j)))), (m = Yx(IX(T), 19).a)), + S$(f.b < f.d.gc()), + ntn((s = Yx(f.d.Xb((f.c = f.b++)), 157)), k), + f.b == m && ((v = l - O - i.c), (y = DR(s)), Znn(s, v), F9(s, (v - y) / 2, 0)), + (O += DR(s) + t); + return new QS(l, I); + } + function tjn(n, t, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g; + if (((r = new ip()), (c = Yjn), (a = Yjn), (u = Yjn), i)) + for (c = n.f.a, d = new pb(t.j); d.a < d.c.c.length; ) + for (s = new pb(Yx(Hz(d), 11).g); s.a < s.c.c.length; ) + 0 != (o = Yx(Hz(s), 17)).a.b && + ((f = Yx(g$(o.a), 8)).a < c && ((a = c - f.a), (u = Yjn), (r.c = VQ(UKn, iEn, 1, 0, 5, 1)), (c = f.a)), + f.a <= c && ((r.c[r.c.length] = o), o.a.b > 1 && (u = e.Math.min(u, e.Math.abs(Yx(ken(o.a, 1), 8).b - f.b))))); + else + for (d = new pb(t.j); d.a < d.c.c.length; ) + for (s = new pb(Yx(Hz(d), 11).e); s.a < s.c.c.length; ) + 0 != (o = Yx(Hz(s), 17)).a.b && + ((b = Yx(p$(o.a), 8)).a > c && ((a = b.a - c), (u = Yjn), (r.c = VQ(UKn, iEn, 1, 0, 5, 1)), (c = b.a)), + b.a >= c && ((r.c[r.c.length] = o), o.a.b > 1 && (u = e.Math.min(u, e.Math.abs(Yx(ken(o.a, o.a.b - 2), 8).b - b.b))))); + if (0 != r.c.length && a > t.o.a / 2 && u > t.o.b / 2) { + for ( + ZG((w = new Ion()), t), + whn(w, (Ikn(), Tit)), + w.n.a = t.o.a / 2, + ZG((g = new Ion()), t), + whn(g, Bit), + g.n.a = t.o.a / 2, + g.n.b = t.o.b, + s = new pb(r); + s.a < s.c.c.length; + + ) + (o = Yx(Hz(s), 17)), + i + ? ((h = Yx(mD(o.a), 8)), (0 == o.a.b ? Dz(o.d) : Yx(g$(o.a), 8)).b >= h.b ? YG(o, g) : YG(o, w)) + : ((h = Yx(yD(o.a), 8)), (0 == o.a.b ? Dz(o.c) : Yx(p$(o.a), 8)).b >= h.b ? QG(o, g) : QG(o, w)), + (l = Yx(Aun(o, (gjn(), $1n)), 74)) && V7(l, h, !0); + t.n.a = c - t.o.a / 2; + } + } + function ejn(n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b; + if ( + ((s = t), + $0((o = UX(n, RX(e), s)), oX(s, rxn)), + (h = Yx(g1(n.g, Nhn(jG(s, _Nn))), 33)), + (i = null), + (a = jG(s, "sourcePort")) && (i = Nhn(a)), + (f = Yx(g1(n.j, i), 118)), + !h) + ) + throw hp(new hy("An edge must have a source node (edge id: '" + itn(s) + sxn)); + if (f && !bB(TG(f), h)) + throw hp(new hy("The source port of an edge must be a port of the edge's source node (edge id: '" + oX(s, rxn) + sxn)); + if ( + (!o.b && (o.b = new AN(Zrt, o, 4, 7)), + fY(o.b, f || h), + (l = Yx(g1(n.g, Nhn(jG(s, lxn))), 33)), + (r = null), + (u = jG(s, "targetPort")) && (r = Nhn(u)), + (b = Yx(g1(n.j, r), 118)), + !l) + ) + throw hp(new hy("An edge must have a target node (edge id: '" + itn(s) + sxn)); + if (b && !bB(TG(b), l)) + throw hp(new hy("The target port of an edge must be a port of the edge's target node (edge id: '" + oX(s, rxn) + sxn)); + if ( + (!o.c && (o.c = new AN(Zrt, o, 5, 8)), + fY(o.c, b || l), + 0 == (!o.b && (o.b = new AN(Zrt, o, 4, 7)), o.b).i || 0 == (!o.c && (o.c = new AN(Zrt, o, 5, 8)), o.c).i) + ) + throw ((c = oX(s, rxn)), hp(new hy(oxn + c + sxn))); + return eun(s, o), Iln(s, o), D5(n, s, o); + } + function ijn(n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M, S, P; + return ( + (l = (function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b; + if (n.dc()) return new Pk(); + for (s = 0, f = 0, r = n.Kc(); r.Ob(); ) (c = Yx(r.Pb(), 37).f), (s = e.Math.max(s, c.a)), (f += c.a * c.b); + for ( + s = e.Math.max(s, e.Math.sqrt(f) * ty(fL(Aun(Yx(n.Kc().Pb(), 37), (gjn(), RZn))))), l = 0, b = 0, o = 0, i = t, u = n.Kc(); + u.Ob(); + + ) + l + (h = (a = Yx(u.Pb(), 37)).f).a > s && ((l = 0), (b += o + t), (o = 0)), + bgn(a, l, b), + (i = e.Math.max(i, l + h.a)), + (o = e.Math.max(o, h.b)), + (l += h.a + t); + return new QS(i + t, b + o + t); + })(QA(n, (Ikn(), Cit)), t)), + (d = lrn(QA(n, Oit), t)), + (k = lrn(QA(n, Kit), t)), + (M = brn(QA(n, Fit), t)), + (b = brn(QA(n, Mit), t)), + (m = lrn(QA(n, Rit), t)), + (g = lrn(QA(n, Ait), t)), + (E = lrn(QA(n, _it), t)), + (j = lrn(QA(n, Sit), t)), + (S = brn(QA(n, Iit), t)), + (v = lrn(QA(n, xit), t)), + (y = lrn(QA(n, Nit), t)), + (T = lrn(QA(n, Pit), t)), + (P = brn(QA(n, Dit), t)), + (w = brn(QA(n, $it), t)), + (p = lrn(QA(n, Lit), t)), + (i = N5(x4(Gy(Jot, 1), rMn, 25, 15, [m.a, M.a, E.a, P.a]))), + (r = N5(x4(Gy(Jot, 1), rMn, 25, 15, [d.a, l.a, k.a, p.a]))), + (c = v.a), + (a = N5(x4(Gy(Jot, 1), rMn, 25, 15, [g.a, b.a, j.a, w.a]))), + (h = N5(x4(Gy(Jot, 1), rMn, 25, 15, [m.b, d.b, g.b, y.b]))), + (s = N5(x4(Gy(Jot, 1), rMn, 25, 15, [M.b, l.b, b.b, p.b]))), + (f = S.b), + (o = N5(x4(Gy(Jot, 1), rMn, 25, 15, [E.b, k.b, j.b, T.b]))), + wY(QA(n, Cit), i + c, h + f), + wY(QA(n, Lit), i + c, h + f), + wY(QA(n, Oit), i + c, 0), + wY(QA(n, Kit), i + c, h + f + s), + wY(QA(n, Fit), 0, h + f), + wY(QA(n, Mit), i + c + r, h + f), + wY(QA(n, Ait), i + c + r, 0), + wY(QA(n, _it), 0, h + f + s), + wY(QA(n, Sit), i + c + r, h + f + s), + wY(QA(n, Iit), 0, h), + wY(QA(n, xit), i, 0), + wY(QA(n, Pit), 0, h + f + s), + wY(QA(n, $it), i + c + r, 0), + ((u = new Pk()).a = N5(x4(Gy(Jot, 1), rMn, 25, 15, [i + r + c + a, S.a, y.a, T.a]))), + (u.b = N5(x4(Gy(Jot, 1), rMn, 25, 15, [h + s + f + o, v.b, P.b, w.b]))), + u + ); + } + function rjn(n, t, i) { + var r, c, a, u, o, s, f; + if ( + (run(i, "Network simplex node placement", 1), + (n.e = t), + (n.n = Yx(Aun(t, (Ojn(), zQn)), 304)), + (function (n) { + var t, i, r, c, a, u, o, s, f, l, b, w; + for (n.f = new Zp(), o = 0, r = 0, c = new pb(n.e.b); c.a < c.c.c.length; ) + for (u = new pb(Yx(Hz(c), 29).a); u.a < u.c.c.length; ) { + for ((a = Yx(Hz(u), 10)).p = o++, i = new $K(bA(o7(a).a.Kc(), new h())); Vfn(i); ) Yx(kV(i), 17).p = r++; + for (t = Mmn(a), l = new pb(a.j); l.a < l.c.c.length; ) + (f = Yx(Hz(l), 11)), + t && (w = f.a.b) != e.Math.floor(w) && ((s = w - VU(D3(e.Math.round(w)))), (f.a.b -= s)), + (b = f.n.b + f.a.b) != e.Math.floor(b) && ((s = b - VU(D3(e.Math.round(b)))), (f.n.b -= s)); + } + (n.g = o), (n.b = r), (n.i = VQ(g4n, iEn, 401, o, 0, 1)), (n.c = VQ(l4n, iEn, 649, r, 0, 1)), n.d.a.$b(); + })(n), + (function (n) { + var t; + for (t = new pb(n.e.b); t.a < t.c.c.length; ) Wyn(n, Yx(Hz(t), 29)); + SE(hH(WJ(WJ(new SR(null, new Nz(n.e.b, 16)), new Xc()), new Zc()), new na()), new Ld(n)); + })(n), + SE(WJ(new SR(null, new Nz(n.e.b, 16)), new Hc()), new Id(n)), + SE(hH(WJ(hH(WJ(new SR(null, new Nz(n.e.b, 16)), new ta()), new ea()), new ia()), new ra()), new Pd(n)), + ny(hL(Aun(n.e, (gjn(), V1n)))) && + (run((a = J2(i, 1)), "Straight Edges Pre-Processing", 1), + (function (n) { + var t, i, r, c, a, u, o, s, h, f; + for ( + n.j = VQ(Wot, MTn, 25, n.g, 15, 1), + n.o = new ip(), + SE(WJ(new SR(null, new Nz(n.e.b, 16)), new Wc()), new Od(n)), + n.a = VQ(Vot, wSn, 25, n.b, 16, 1), + W8(new SR(null, new Nz(n.e.b, 16)), new $d(n)), + f = new ip(), + SE(hH(WJ(new SR(null, new Nz(n.e.b, 16)), new Qc()), new Ad(n)), new yS(n, f)), + o = new pb(f); + o.a < o.c.c.length; + + ) + if (!((u = Yx(Hz(o), 508)).c.length <= 1)) + if (2 != u.c.length) { + if (!Nan(u) && !vsn(u, new Vc())) + for (s = new pb(u), r = null; s.a < s.c.c.length; ) + (t = Yx(Hz(s), 17)), + (i = n.c[t.p]), + (h = !r || s.a >= s.c.c.length ? GX((bon(), Hzn), Bzn) : GX((bon(), Bzn), Bzn)), + (h *= 2), + (c = i.a.g), + (i.a.g = e.Math.max(c, c + (h - c))), + (a = i.b.g), + (i.b.g = e.Math.max(a, a + (h - a))), + (r = t); + } else mln(u), Mmn(($z(0, u.c.length), Yx(u.c[0], 17)).d.i) || eD(n.o, u); + })(n), + Ron(a)), + Yen(n.f), + (c = Yx(Aun(t, V0n), 19).a * n.f.a.c.length), + Ggn(Xy(Wy(Cx(n.f), c), !1), J2(i, 1)), + 0 != n.d.a.gc()) + ) { + for ( + run((a = J2(i, 1)), "Flexible Where Space Processing", 1), + u = Yx(qA(YK(fH(new SR(null, new Nz(n.f.a, 16)), new qc()), new Dc())), 19).a, + o = Yx(qA(QK(fH(new SR(null, new Nz(n.f.a, 16)), new Gc()), new Rc())), 19).a - u, + s = HA(new ev(), n.f), + f = HA(new ev(), n.f), + uwn(NE(LE($E(xE(new tv(), 2e4), o), s), f)), + SE(hH(hH(X_(n.i), new zc()), new Uc()), new vH(u, s, o, f)), + r = n.d.a.ec().Kc(); + r.Ob(); + + ) + Yx(r.Pb(), 213).g = 1; + Ggn(Xy(Wy(Cx(n.f), c), !1), J2(a, 1)), Ron(a); + } + ny(hL(Aun(t, V1n))) && + (run((a = J2(i, 1)), "Straight Edges Post-Processing", 1), + (function (n) { + var t, e, i; + for (C2((e = new ME()), n.o), i = new kv(); 0 != e.b; ) + Bkn(n, (t = Yx(0 == e.b ? null : (S$(0 != e.b), VZ(e, e.a.a)), 508)), !0) && eD(i.a, t); + for (; 0 != i.a.c.length; ) Bkn(n, (t = Yx(K6(i), 508)), !1); + })(n), + Ron(a)), + (function (n) { + var t, e, i, r, c, a, u, o, s, h, f, l, b, w, d; + for (e = new pb(n.e.b); e.a < e.c.c.length; ) + for (r = new pb(Yx(Hz(e), 29).a); r.a < r.c.c.length; ) + if ( + ((i = Yx(Hz(r), 10)), + (o = (f = n.i[i.p]).a.e), + (u = f.d.e), + (i.n.b = o), + (d = u - o - i.o.b), + (t = Mmn(i)), + Hen(), + (h = (i.q ? i.q : (XH(), XH(), MFn))._b((gjn(), Y1n)) ? Yx(Aun(i, Y1n), 197) : Yx(Aun(dB(i), J1n), 197)), + t && (h == M2n || h == T2n) && (i.o.b += d), + t && (h == P2n || h == M2n || h == T2n)) + ) { + for (b = new pb(i.j); b.a < b.c.c.length; ) + (l = Yx(Hz(b), 11)), (Ikn(), Iit).Hc(l.j) && ((s = Yx(BF(n.k, l), 121)), (l.n.b = s.e - o)); + for (a = new pb(i.b); a.a < a.c.c.length; ) + (c = Yx(Hz(a), 70)), (w = Yx(Aun(i, U1n), 21)).Hc((Eln(), Vet)) ? (c.n.b += d) : w.Hc(Qet) && (c.n.b += d / 2); + (h == M2n || h == T2n) && i7(i, (Ikn(), Bit)).Jc(new Cd(d)); + } + })(n), + (n.e = null), + (n.f = null), + (n.i = null), + (n.c = null), + U_(n.k), + (n.j = null), + (n.a = null), + (n.o = null), + n.d.a.$b(), + Ron(i); + } + function cjn(n, t, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k; + for (u = new pb(n.a.b); u.a < u.c.c.length; ) + for (m = new pb(Yx(Hz(u), 29).a); m.a < m.c.c.length; ) (v = Yx(Hz(m), 10)), (t.g[v.p] = v), (t.a[v.p] = v), (t.d[v.p] = 0); + for ( + o = n.a.b, + t.c == (Jq(), w4n) && (o = CO(o, 152) ? RV(Yx(o, 152)) : CO(o, 131) ? Yx(o, 131).a : CO(o, 54) ? new Tm(o) : new rE(o)), + a = o.Kc(); + a.Ob(); + + ) + for ( + b = -1, + l = Yx(a.Pb(), 29).a, + t.o == (RG(), m4n) && + ((b = Yjn), (l = CO(l, 152) ? RV(Yx(l, 152)) : CO(l, 131) ? Yx(l, 131).a : CO(l, 54) ? new Tm(l) : new rE(l))), + k = l.Kc(); + k.Ob(); + + ) + if (((y = Yx(k.Pb(), 10)), (f = null), (f = t.c == w4n ? Yx(TR(n.b.f, y.p), 15) : Yx(TR(n.b.b, y.p), 15)).gc() > 0)) + if (((r = f.gc()), (s = oG(e.Math.floor((r + 1) / 2)) - 1), (c = oG(e.Math.ceil((r + 1) / 2)) - 1), t.o == m4n)) + for (h = c; h >= s; h--) + t.a[y.p] == y && + ((d = Yx(f.Xb(h), 46)), + (w = Yx(d.a, 10)), + !gE(i, d.b) && + b > n.b.e[w.p] && + ((t.a[w.p] = y), + (t.g[y.p] = t.g[w.p]), + (t.a[y.p] = t.g[y.p]), + (t.f[t.g[y.p].p] = (TA(), !!(ny(t.f[t.g[y.p].p]) & (y.k == (bon(), Bzn))))), + (b = n.b.e[w.p]))); + else + for (h = s; h <= c; h++) + t.a[y.p] == y && + ((p = Yx(f.Xb(h), 46)), + (g = Yx(p.a, 10)), + !gE(i, p.b) && + b < n.b.e[g.p] && + ((t.a[g.p] = y), + (t.g[y.p] = t.g[g.p]), + (t.a[y.p] = t.g[y.p]), + (t.f[t.g[y.p].p] = (TA(), !!(ny(t.f[t.g[y.p].p]) & (y.k == (bon(), Bzn))))), + (b = n.b.e[g.p]))); + } + function ajn() { + (ajn = O), + Dk(), + (Hrt = Art.a), + Yx(c1(aq(Art.a), 0), 18), + (Drt = Art.f), + Yx(c1(aq(Art.f), 0), 18), + Yx(c1(aq(Art.f), 1), 34), + (Brt = Art.n), + Yx(c1(aq(Art.n), 0), 34), + Yx(c1(aq(Art.n), 1), 34), + Yx(c1(aq(Art.n), 2), 34), + Yx(c1(aq(Art.n), 3), 34), + (Rrt = Art.g), + Yx(c1(aq(Art.g), 0), 18), + Yx(c1(aq(Art.g), 1), 34), + (Lrt = Art.c), + Yx(c1(aq(Art.c), 0), 18), + Yx(c1(aq(Art.c), 1), 18), + (Krt = Art.i), + Yx(c1(aq(Art.i), 0), 18), + Yx(c1(aq(Art.i), 1), 18), + Yx(c1(aq(Art.i), 2), 18), + Yx(c1(aq(Art.i), 3), 18), + Yx(c1(aq(Art.i), 4), 34), + (_rt = Art.j), + Yx(c1(aq(Art.j), 0), 18), + (Nrt = Art.d), + Yx(c1(aq(Art.d), 0), 18), + Yx(c1(aq(Art.d), 1), 18), + Yx(c1(aq(Art.d), 2), 18), + Yx(c1(aq(Art.d), 3), 18), + Yx(c1(aq(Art.d), 4), 34), + Yx(c1(aq(Art.d), 5), 34), + Yx(c1(aq(Art.d), 6), 34), + Yx(c1(aq(Art.d), 7), 34), + ($rt = Art.b), + Yx(c1(aq(Art.b), 0), 34), + Yx(c1(aq(Art.b), 1), 34), + (xrt = Art.e), + Yx(c1(aq(Art.e), 0), 34), + Yx(c1(aq(Art.e), 1), 34), + Yx(c1(aq(Art.e), 2), 34), + Yx(c1(aq(Art.e), 3), 34), + Yx(c1(aq(Art.e), 4), 18), + Yx(c1(aq(Art.e), 5), 18), + Yx(c1(aq(Art.e), 6), 18), + Yx(c1(aq(Art.e), 7), 18), + Yx(c1(aq(Art.e), 8), 18), + Yx(c1(aq(Art.e), 9), 18), + Yx(c1(aq(Art.e), 10), 34), + (Frt = Art.k), + Yx(c1(aq(Art.k), 0), 34), + Yx(c1(aq(Art.k), 1), 34); + } + function ujn(n) { + var t, e, i, r, c; + switch ((t = n.c)) { + case 11: + return n.Ml(); + case 12: + return n.Ol(); + case 14: + return n.Ql(); + case 15: + return n.Tl(); + case 16: + return n.Rl(); + case 17: + return n.Ul(); + case 21: + return kjn(n), Ljn(), Ljn(), Tot; + case 10: + switch (n.a) { + case 65: + return n.yl(); + case 90: + return n.Dl(); + case 122: + return n.Kl(); + case 98: + return n.El(); + case 66: + return n.zl(); + case 60: + return n.Jl(); + case 62: + return n.Hl(); + } + } + switch ( + ((c = (function (n) { + var t, e, i, r; + switch (((r = null), n.c)) { + case 6: + return n.Vl(); + case 13: + return n.Wl(); + case 23: + return n.Nl(); + case 22: + return n.Sl(); + case 18: + return n.Pl(); + case 8: + kjn(n), Ljn(), (r = Eot); + break; + case 9: + return n.vl(!0); + case 19: + return n.wl(); + case 10: + switch (n.a) { + case 100: + case 68: + case 119: + case 87: + case 115: + case 83: + return (r = n.ul(n.a)), kjn(n), r; + case 101: + case 102: + case 110: + case 114: + case 116: + case 117: + case 118: + case 120: + (t = n.tl()) < eMn ? (Ljn(), Ljn(), (r = new BR(0, t))) : (r = BK(U9(t))); + break; + case 99: + return n.Fl(); + case 67: + return n.Al(); + case 105: + return n.Il(); + case 73: + return n.Bl(); + case 103: + return n.Gl(); + case 88: + return n.Cl(); + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + return n.xl(); + case 80: + case 112: + if (!(r = Hhn(n, n.a))) throw hp(new wy(Kjn((GC(), zxn)))); + break; + default: + r = VD(n.a); + } + kjn(n); + break; + case 0: + if (93 == n.a || 123 == n.a || 125 == n.a) throw hp(new wy(Kjn((GC(), Gxn)))); + (r = VD(n.a)), + (e = n.a), + kjn(n), + (64512 & e) == iMn && + 0 == n.c && + 56320 == (64512 & n.a) && + (((i = VQ(Xot, sTn, 25, 2, 15, 1))[0] = e & fTn), (i[1] = n.a & fTn), (r = M_(BK(Vnn(i, 0, i.length)), 0)), kjn(n)); + break; + default: + throw hp(new wy(Kjn((GC(), Gxn)))); + } + return r; + })(n)), + (t = n.c)) + ) { + case 3: + return n.Zl(c); + case 4: + return n.Xl(c); + case 5: + return n.Yl(c); + case 0: + if (123 == n.a && n.d < n.j) { + if (((r = n.d), (i = 0), (e = -1), !((t = XB(n.i, r++)) >= 48 && t <= 57))) throw hp(new wy(Kjn((GC(), oDn)))); + for (i = t - 48; r < n.j && (t = XB(n.i, r++)) >= 48 && t <= 57; ) + if ((i = 10 * i + t - 48) < 0) throw hp(new wy(Kjn((GC(), lDn)))); + if (((e = i), 44 == t)) { + if (r >= n.j) throw hp(new wy(Kjn((GC(), hDn)))); + if ((t = XB(n.i, r++)) >= 48 && t <= 57) { + for (e = t - 48; r < n.j && (t = XB(n.i, r++)) >= 48 && t <= 57; ) + if ((e = 10 * e + t - 48) < 0) throw hp(new wy(Kjn((GC(), lDn)))); + if (i > e) throw hp(new wy(Kjn((GC(), fDn)))); + } else e = -1; + } + if (125 != t) throw hp(new wy(Kjn((GC(), sDn)))); + n.sl(r) ? (Ljn(), Ljn(), (c = new cW(9, c)), (n.d = r + 1)) : (Ljn(), Ljn(), (c = new cW(3, c)), (n.d = r)), + c.dm(i), + c.cm(e), + kjn(n); + } + } + return c; + } + function ojn(n, t, e, i, r) { + var c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M; + for (w = new pQ(t.b), v = new pQ(t.b), l = new pQ(t.b), j = new pQ(t.b), d = new pQ(t.b), k = Ztn(t, 0); k.b != k.d.c; ) + for (u = new pb((m = Yx(IX(k), 11)).g); u.a < u.c.c.length; ) + if ((c = Yx(Hz(u), 17)).c.i == c.d.i) { + if (m.j == c.d.j) { + j.c[j.c.length] = c; + continue; + } + if (m.j == (Ikn(), Tit) && c.d.j == Bit) { + d.c[d.c.length] = c; + continue; + } + } + for (o = new pb(d); o.a < o.c.c.length; ) ypn(n, (c = Yx(Hz(o), 17)), e, i, (Ikn(), Eit)); + for (a = new pb(j); a.a < a.c.c.length; ) + (c = Yx(Hz(a), 17)), + Al((E = new rin(n)), (bon(), qzn)), + b5(E, (gjn(), g0n), (Ran(), oit)), + b5(E, (Ojn(), CQn), c), + b5((T = new Ion()), CQn, c.d), + whn(T, (Ikn(), qit)), + ZG(T, E), + b5((M = new Ion()), CQn, c.c), + whn(M, Eit), + ZG(M, E), + b5(c.c, RQn, E), + b5(c.d, RQn, E), + YG(c, null), + QG(c, null), + (e.c[e.c.length] = E), + b5(E, tQn, d9(2)); + for (y = Ztn(t, 0); y.b != y.d.c; ) + (s = (m = Yx(IX(y), 11)).e.c.length > 0), + (g = m.g.c.length > 0), + s && g ? (l.c[l.c.length] = m) : s ? (w.c[w.c.length] = m) : g && (v.c[v.c.length] = m); + for (b = new pb(w); b.a < b.c.c.length; ) eD(r, Yvn(n, Yx(Hz(b), 11), null, e)); + for (p = new pb(v); p.a < p.c.c.length; ) eD(r, Yvn(n, null, Yx(Hz(p), 11), e)); + for (f = new pb(l); f.a < f.c.c.length; ) eD(r, Yvn(n, (h = Yx(Hz(f), 11)), h, e)); + } + function sjn(n) { + var t, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E; + for (d = new QS(JTn, JTn), t = new QS(ZTn, ZTn), k = new pb(n); k.a < k.c.c.length; ) + (y = Yx(Hz(k), 8)), + (d.a = e.Math.min(d.a, y.a)), + (d.b = e.Math.min(d.b, y.b)), + (t.a = e.Math.max(t.a, y.a)), + (t.b = e.Math.max(t.b, y.b)); + for ( + s = new QS(t.a - d.a, t.b - d.b), + h = new pvn(new QS(d.a - 50, d.b - s.a - 50), new QS(d.a - 50, t.b + s.a + 50), new QS(t.a + s.b / 2 + 50, d.b + s.b / 2)), + m = new Qp(), + c = new ip(), + i = new ip(), + m.a.zc(h, m), + E = new pb(n); + E.a < E.c.c.length; + + ) { + for (j = Yx(Hz(E), 8), c.c = VQ(UKn, iEn, 1, 0, 5, 1), v = m.a.ec().Kc(); v.Ob(); ) + cY((g = Yx(v.Pb(), 308)).d, g.a), y7(cY(g.d, j), cY(g.d, g.a)) < 0 && (c.c[c.c.length] = g); + for (i.c = VQ(UKn, iEn, 1, 0, 5, 1), p = new pb(c); p.a < p.c.c.length; ) + for (b = new pb((g = Yx(Hz(p), 308)).e); b.a < b.c.c.length; ) { + for (f = Yx(Hz(b), 168), a = !0, o = new pb(c); o.a < o.c.c.length; ) + (u = Yx(Hz(o), 308)) != g && (qB(f, TR(u.e, 0)) || qB(f, TR(u.e, 1)) || qB(f, TR(u.e, 2))) && (a = !1); + a && (i.c[i.c.length] = f); + } + for (Eun(m, c), XW(m, new bn()), l = new pb(i); l.a < l.c.c.length; ) __(m, new pvn(j, (f = Yx(Hz(l), 168)).a, f.b)); + } + for (XW(m, new zb((w = new Qp()))), r = w.a.ec().Kc(); r.Ob(); ) (TJ(h, (f = Yx(r.Pb(), 168)).a) || TJ(h, f.b)) && r.Qb(); + return XW(w, new wn()), w; + } + function hjn(n) { + uT( + n, + new tun( + rk( + nk( + ik(ek(new du(), X$n), "ELK Rectangle Packing"), + "Algorithm for packing of unconnected boxes, i.e. graphs without edges. The given order of the boxes is always preserved and the main reading direction of the boxes is left to right. The algorithm is divided into two phases. One phase approximates the width in which the rectangles can be placed. The next phase places the rectangles in rows using the previously calculated width as bounding width and bundles rectangles with a similar height in blocks. A compaction step reduces the size of the drawing. Finally, the rectangles are expanded to fill their bounding box and eliminate empty unused spaces.", + ), + new Za(), + ), + ), + ), + DU(n, X$n, hPn, 1.3), + DU(n, X$n, U$n, oen(O8n)), + DU(n, X$n, fPn, q8n), + DU(n, X$n, LPn, 15), + DU(n, X$n, jAn, oen(P8n)), + DU(n, X$n, HPn, oen(D8n)), + DU(n, X$n, eIn, oen(R8n)), + DU(n, X$n, BPn, oen(K8n)), + DU(n, X$n, qPn, oen(x8n)), + DU(n, X$n, FPn, oen(_8n)), + DU(n, X$n, GPn, oen(G8n)), + DU(n, X$n, K$n, oen(B8n)), + DU(n, X$n, _$n, oen(N8n)), + DU(n, X$n, H$n, oen(F8n)), + DU(n, X$n, q$n, oen(z8n)), + DU(n, X$n, G$n, oen(A8n)), + DU(n, X$n, RPn, oen($8n)), + DU(n, X$n, NAn, oen(L8n)), + DU(n, X$n, B$n, oen(C8n)), + DU(n, X$n, F$n, oen(I8n)), + DU(n, X$n, z$n, oen(X8n)); + } + function fjn(n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g; + if (null == e) return null; + if (n.a != t.Aj()) throw hp(new Qm(ONn + t.ne() + ANn)); + if (CO(t, 457)) { + if ( + !(d = (function (n, t) { + var e, i, r; + if (null == t) { + for (!n.a && (n.a = new m_(sat, n, 9, 5)), i = new UO(n.a); i.e != i.i.gc(); ) + if (null == (null == (r = (e = Yx(hen(i), 678)).c) ? e.zb : r)) return e; + } else + for (!n.a && (n.a = new m_(sat, n, 9, 5)), i = new UO(n.a); i.e != i.i.gc(); ) + if (_N(t, null == (r = (e = Yx(hen(i), 678)).c) ? e.zb : r)) return e; + return null; + })(Yx(t, 671), e)) + ) + throw hp(new Qm($Nn + e + "' is not a valid enumerator of '" + t.ne() + "'")); + return d; + } + switch (U8((wsn(), wut), t).cl()) { + case 2: + e = Vvn(e, !1); + break; + case 3: + e = Vvn(e, !0); + } + if ((i = U8(wut, t).$k())) return i.Aj().Nh().Kh(i, e); + if ((f = U8(wut, t).al())) { + for (d = new ip(), s = 0, h = (o = s6(e)).length; s < h; ++s) (u = o[s]), eD(d, f.Aj().Nh().Kh(f, u)); + return d; + } + if (!(w = U8(wut, t).bl()).dc()) { + for (b = w.Kc(); b.Ob(); ) { + l = Yx(b.Pb(), 148); + try { + if (null != (d = l.Aj().Nh().Kh(l, e))) return d; + } catch (g) { + if (!CO((g = j4(g)), 60)) throw hp(g); + } + } + throw hp(new Qm($Nn + e + "' does not match any member types of the union datatype '" + t.ne() + "'")); + } + if ( + (Yx(t, 834).Fj(), + !(r = (g = t.Bj()) + ? 0 != (1 & g.i) + ? g == Vot + ? D_n + : g == Wot + ? U_n + : g == Zot + ? q_n + : g == Jot + ? H_n + : g == Qot + ? J_n + : g == nst + ? nFn + : g == Yot + ? __n + : B_n + : g + : null)) + ) + return null; + if (r == B_n) { + c = 0; + try { + c = ipn(e, nTn, Yjn) & fTn; + } catch (g) { + if (!CO((g = j4(g)), 127)) throw hp(g); + c = xJ(e)[0]; + } + return k4(c); + } + if (r == N_n) { + for (a = 0; a < Grt.length; ++a) + try { + return wT(Grt[a], e); + } catch (g) { + if (!CO((g = j4(g)), 32)) throw hp(g); + } + throw hp( + new Qm($Nn + e + "' is not a date formatted string of the form yyyy-MM-dd'T'HH:mm:ss'.'SSSZ or a valid subset thereof"), + ); + } + throw hp(new Qm($Nn + e + "' is invalid. ")); + } + function ljn() { + (ljn = O), + Qhn((Mzn = new Zq()), (Ikn(), Cit), Lit), + Qhn(Mzn, Fit, Lit), + Qhn(Mzn, Fit, Dit), + Qhn(Mzn, Mit, $it), + Qhn(Mzn, Mit, Lit), + Qhn(Mzn, Oit, Lit), + Qhn(Mzn, Oit, Nit), + Qhn(Mzn, Kit, Pit), + Qhn(Mzn, Kit, Lit), + Qhn(Mzn, xit, Iit), + Qhn(Mzn, xit, Lit), + Qhn(Mzn, xit, Nit), + Qhn(Mzn, xit, Pit), + Qhn(Mzn, Iit, xit), + Qhn(Mzn, Iit, Dit), + Qhn(Mzn, Iit, $it), + Qhn(Mzn, Iit, Lit), + Qhn(Mzn, Rit, Rit), + Qhn(Mzn, Rit, Nit), + Qhn(Mzn, Rit, Dit), + Qhn(Mzn, Ait, Ait), + Qhn(Mzn, Ait, Nit), + Qhn(Mzn, Ait, $it), + Qhn(Mzn, _it, _it), + Qhn(Mzn, _it, Pit), + Qhn(Mzn, _it, Dit), + Qhn(Mzn, Sit, Sit), + Qhn(Mzn, Sit, Pit), + Qhn(Mzn, Sit, $it), + Qhn(Mzn, Nit, Oit), + Qhn(Mzn, Nit, xit), + Qhn(Mzn, Nit, Rit), + Qhn(Mzn, Nit, Ait), + Qhn(Mzn, Nit, Lit), + Qhn(Mzn, Nit, Nit), + Qhn(Mzn, Nit, Dit), + Qhn(Mzn, Nit, $it), + Qhn(Mzn, Pit, Kit), + Qhn(Mzn, Pit, xit), + Qhn(Mzn, Pit, _it), + Qhn(Mzn, Pit, Sit), + Qhn(Mzn, Pit, Pit), + Qhn(Mzn, Pit, Dit), + Qhn(Mzn, Pit, $it), + Qhn(Mzn, Pit, Lit), + Qhn(Mzn, Dit, Fit), + Qhn(Mzn, Dit, Iit), + Qhn(Mzn, Dit, Rit), + Qhn(Mzn, Dit, _it), + Qhn(Mzn, Dit, Nit), + Qhn(Mzn, Dit, Pit), + Qhn(Mzn, Dit, Dit), + Qhn(Mzn, Dit, Lit), + Qhn(Mzn, $it, Mit), + Qhn(Mzn, $it, Iit), + Qhn(Mzn, $it, Ait), + Qhn(Mzn, $it, Sit), + Qhn(Mzn, $it, Nit), + Qhn(Mzn, $it, Pit), + Qhn(Mzn, $it, $it), + Qhn(Mzn, $it, Lit), + Qhn(Mzn, Lit, Cit), + Qhn(Mzn, Lit, Fit), + Qhn(Mzn, Lit, Mit), + Qhn(Mzn, Lit, Oit), + Qhn(Mzn, Lit, Kit), + Qhn(Mzn, Lit, xit), + Qhn(Mzn, Lit, Iit), + Qhn(Mzn, Lit, Nit), + Qhn(Mzn, Lit, Pit), + Qhn(Mzn, Lit, Dit), + Qhn(Mzn, Lit, $it), + Qhn(Mzn, Lit, Lit); + } + function bjn(n, t, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T; + for (n.d = new QS(JTn, JTn), n.c = new QS(ZTn, ZTn), l = t.Kc(); l.Ob(); ) + for (m = new pb(Yx(l.Pb(), 37).a); m.a < m.c.c.length; ) + (v = Yx(Hz(m), 10)), + (n.d.a = e.Math.min(n.d.a, v.n.a - v.d.b)), + (n.d.b = e.Math.min(n.d.b, v.n.b - v.d.d)), + (n.c.a = e.Math.max(n.c.a, v.n.a + v.o.a + v.d.c)), + (n.c.b = e.Math.max(n.c.b, v.n.b + v.o.b + v.d.a)); + for (o = new hv(), f = t.Kc(); f.Ob(); ) + (r = Wkn(n, Yx(f.Pb(), 37))), eD(o.a, r), (r.a = r.a | !Yx(Aun(r.c, (Ojn(), uQn)), 21).dc()); + for ( + n.b = (r8(), ((T = new kt()).f = new y0(i)), (T.b = gyn(T.f, o)), T), + Tyn(((w = n.b), new am(), w)), + n.e = new Pk(), + n.a = n.b.f.e, + u = new pb(o.a); + u.a < u.c.c.length; + + ) + for (c = Yx(Hz(u), 841), y = hG(n.b, c), wgn(c.c, y.a, y.b), g = new pb(c.c.a); g.a < g.c.c.length; ) + (d = Yx(Hz(g), 10)).k == (bon(), _zn) && ((p = hbn(n, d.n, Yx(Aun(d, (Ojn(), hQn)), 61))), mN(OI(d.n), p)); + for (a = new pb(o.a); a.a < a.c.c.length; ) + for (h = new pb(j9((c = Yx(Hz(a), 841)))); h.a < h.c.c.length; ) + for (A$((E = new kk((s = Yx(Hz(h), 17)).a)), 0, Dz(s.c)), KD(E, Dz(s.d)), b = null, j = Ztn(E, 0); j.b != j.d.c; ) + (k = Yx(IX(j), 8)), + b + ? (d1(b.a, k.a) + ? ((n.e.a = e.Math.min(n.e.a, b.a)), (n.a.a = e.Math.max(n.a.a, b.a))) + : d1(b.b, k.b) && ((n.e.b = e.Math.min(n.e.b, b.b)), (n.a.b = e.Math.max(n.a.b, b.b))), + (b = k)) + : (b = k); + D$(n.e), mN(n.a, n.e); + } + function wjn(n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k; + if (!t.dc()) { + if ( + ((r = new Nv()), (f = (a = e || Yx(t.Xb(0), 17)).c), kwn(), (s = f.i.k) != (bon(), Hzn) && s != qzn && s != _zn && s != Kzn) + ) + throw hp(new Qm("The target node of the edge must be a normal node or a northSouthPort.")); + for ( + EI(r, $5(x4(Gy(B7n, 1), TEn, 8, 0, [f.i.n, f.n, f.a]))), + (Ikn(), xit).Hc(f.j) && + ((b = ty(fL(Aun(f, (Ojn(), XQn))))), VW(r, new QS($5(x4(Gy(B7n, 1), TEn, 8, 0, [f.i.n, f.n, f.a])).a, b), r.c.b, r.c)), + o = null, + i = !1, + u = t.Kc(); + u.Ob(); + + ) + 0 != (c = Yx(u.Pb(), 17).a).b && + (i ? (VW(r, KO(mN(o, (S$(0 != c.b), Yx(c.a.a.c, 8))), 0.5), r.c.b, r.c), (i = !1)) : (i = !0), + (o = dO((S$(0 != c.b), Yx(c.c.b.c, 8)))), + C2(r, c), + BH(c)); + (l = a.d), + xit.Hc(l.j) && + ((b = ty(fL(Aun(l, (Ojn(), XQn))))), VW(r, new QS($5(x4(Gy(B7n, 1), TEn, 8, 0, [l.i.n, l.n, l.a])).a, b), r.c.b, r.c)), + EI(r, $5(x4(Gy(B7n, 1), TEn, 8, 0, [l.i.n, l.n, l.a]))), + n.d == ($6(), g3n) && + (S$(0 != r.b), + (w = Yx(r.a.a.c, 8)), + (d = Yx(ken(r, 1), 8)), + ((g = new gz(i6(f.j))).a *= 5), + (g.b *= 5), + (p = yN(new QS(d.a, d.b), w)), + mN((v = new QS(LG(g.a, p.a), LG(g.b, p.b))), w), + oF(Ztn(r, 1), v), + S$(0 != r.b), + (m = Yx(r.c.b.c, 8)), + (y = Yx(ken(r, r.b - 2), 8)), + ((g = new gz(i6(l.j))).a *= 5), + (g.b *= 5), + (p = yN(new QS(y.a, y.b), m)), + mN((k = new QS(LG(g.a, p.a), LG(g.b, p.b))), m), + A$(r, r.b - 1, k)), + (h = new Tvn(r)), + C2(a.a, fin(h)); + } + } + function djn(n, t, i, r) { + var c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M, S, P, I, C, O, A, $, L, N, x; + if ( + ((y = (v = Yx(c1((!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b), 0), 82)).Dg()), + (k = v.Eg()), + (m = v.Cg() / 2), + (w = v.Bg() / 2), + CO(v, 186) && ((y += TG((p = Yx(v, 118))).i), (y += TG(p).i)), + (y += m), + (k += w), + (I = (S = Yx(c1((!n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b), 0), 82)).Dg()), + (C = S.Eg()), + (P = S.Cg() / 2), + (j = S.Bg() / 2), + CO(S, 186) && ((I += TG((M = Yx(S, 118))).i), (I += TG(M).i)), + (I += P), + (C += j), + 0 == (!n.a && (n.a = new m_(tct, n, 6, 6)), n.a).i) + ) + xk(), (o = new co()), fY((!n.a && (n.a = new m_(tct, n, 6, 6)), n.a), o); + else if ((!n.a && (n.a = new m_(tct, n, 6, 6)), n.a).i > 1) + for (b = new a$((!n.a && (n.a = new m_(tct, n, 6, 6)), n.a)); b.e != b.i.gc(); ) tan(b); + for ( + d = I, + I > y + m ? (d = y + m) : I < y - m && (d = y - m), + g = C, + C > k + w ? (g = k + w) : C < k - w && (g = k - w), + d > y - m && d < y + m && g > k - w && g < k + w && (d = y + m), + x1((u = Yx(c1((!n.a && (n.a = new m_(tct, n, 6, 6)), n.a), 0), 202)), d), + R1(u, g), + E = y, + y > I + P ? (E = I + P) : y < I - P && (E = I - P), + T = k, + k > C + j ? (T = C + j) : k < C - j && (T = C - j), + E > I - P && E < I + P && T > C - j && T < C + j && (T = C + j), + O1(u, E), + D1(u, T), + Hmn((!u.a && (u.a = new XO(Qrt, u, 5)), u.a)), + a = Uen(t, 5), + v == S && ++a, + A = E - d, + N = T - g, + h = 0.20000000298023224 * e.Math.sqrt(A * A + N * N), + $ = A / (a + 1), + x = N / (a + 1), + O = d, + L = g, + s = 0; + s < a; + s++ + ) + (L += x), + (f = (O += $) + Xln(t, 24) * jMn * h - h / 2) < 0 ? (f = 1) : f > i && (f = i - 1), + (l = L + Xln(t, 24) * jMn * h - h / 2) < 0 ? (l = 1) : l > r && (l = r - 1), + xk(), + I1((c = new ro()), f), + C1(c, l), + fY((!u.a && (u.a = new XO(Qrt, u, 5)), u.a), c); + } + function gjn() { + (gjn = O), + Cjn(), + (A0n = Dtt), + ($0n = Rtt), + (L0n = Ktt), + (N0n = _tt), + (D0n = Ftt), + (R0n = Btt), + (F0n = qtt), + (H0n = ztt), + (q0n = Utt), + (B0n = Gtt), + (G0n = Xtt), + (U0n = Wtt), + (W0n = Ytt), + (_0n = Htt), + Ajn(), + (O0n = ZJn), + (x0n = nZn), + (K0n = tZn), + (z0n = eZn), + (T0n = new DC(Att, d9(0))), + (M0n = QJn), + (S0n = YJn), + (P0n = JJn), + (c2n = SZn), + (Y0n = cZn), + (J0n = oZn), + (t2n = gZn), + (Z0n = fZn), + (n2n = bZn), + (u2n = AZn), + (a2n = IZn), + (i2n = jZn), + (e2n = yZn), + (r2n = TZn), + (Y1n = BJn), + (J1n = HJn), + (v1n = JYn), + (m1n = tJn), + (a0n = new RC(12)), + (c0n = new DC(utt, a0n)), + g7(), + (b1n = new DC($nt, (w1n = het))), + (d0n = new DC(ytt, 0)), + (I0n = new DC($tt, d9(1))), + (RZn = new DC(mnt, OPn)), + (r0n = ctt), + (g0n = ktt), + (k0n = Itt), + (c1n = Snt), + (xZn = pnt), + (E1n = Rnt), + (C0n = new DC(xtt, (TA(), !0))), + (I1n = Fnt), + (C1n = Bnt), + (n0n = Jnt), + (i0n = itt), + (t0n = ntt), + t9(), + (a1n = new DC(Pnt, (o1n = tet))), + (U1n = Qnt), + (z1n = Wnt), + (m0n = Mtt), + (v0n = Ttt), + (y0n = Ptt), + Ytn(), + new DC(btt, (s0n = rit)), + (f0n = gtt), + (l0n = ptt), + (b0n = vtt), + (h0n = dtt), + (Q0n = rZn), + (B1n = SJn), + (F1n = TJn), + (V0n = iZn), + (x1n = gJn), + (r1n = KYn), + (i1n = DYn), + (VZn = kYn), + (QZn = jYn), + (JZn = PYn), + (YZn = EYn), + (e1n = NYn), + (q1n = IJn), + (G1n = CJn), + (A1n = sJn), + (Z1n = UJn), + (W1n = LJn), + (k1n = rJn), + (Q1n = _Jn), + (g1n = WYn), + (p1n = QYn), + (WZn = Tnt), + (X1n = OJn), + (BZn = hYn), + (FZn = oYn), + (_Zn = uYn), + (M1n = uJn), + (T1n = aJn), + (S1n = oJn), + (e0n = ttt), + ($1n = Gnt), + (y1n = Nnt), + (f1n = Ont), + (h1n = Cnt), + (ZZn = OYn), + (p0n = Ett), + (KZn = Ent), + (P1n = _nt), + (w0n = mtt), + (u0n = stt), + (o0n = ftt), + (R1n = mJn), + (K1n = kJn), + (E0n = Ott), + (DZn = aYn), + (_1n = EJn), + (l1n = GYn), + (s1n = HYn), + (H1n = Unt), + (L1n = bJn), + (V1n = DJn), + (X0n = Vtt), + (u1n = FYn), + (j0n = WJn), + (d1n = UYn), + (N1n = dJn), + (n1n = $Yn), + (O1n = qnt), + (D1n = vJn), + (t1n = LYn), + (XZn = mYn), + (zZn = gYn), + (qZn = wYn), + (GZn = dYn), + (UZn = vYn), + (HZn = lYn), + (j1n = cJn); + } + function pjn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M, S, P, I; + if ((hmn(), (T = n.e), (w = n.d), (r = n.a), 0 == T)) + switch (t) { + case 0: + return "0"; + case 1: + return sMn; + case 2: + return "0.00"; + case 3: + return "0.000"; + case 4: + return "0.0000"; + case 5: + return "0.00000"; + case 6: + return "0.000000"; + default: + return ((j = new Ay()).a += t < 0 ? "0E+" : "0E"), (j.a += -t), j.a; + } + if (((y = VQ(Xot, sTn, 25, 1 + (m = 10 * w + 1 + 7), 15, 1)), (e = m), 1 == w)) + if ((u = r[0]) < 0) { + I = Gz(u, uMn); + do { + (d = I), (I = Bcn(I, 10)), (y[--e] = (48 + WR(n7(d, e7(I, 10)))) & fTn); + } while (0 != k8(I, 0)); + } else { + I = u; + do { + (d = I), (I = (I / 10) | 0), (y[--e] = (d - 10 * I + 48) & fTn); + } while (0 != I); + } + else { + smn(r, 0, (S = VQ(Wot, MTn, 25, w, 15, 1)), 0, (P = w)); + n: for (;;) { + for (E = 0, s = P - 1; s >= 0; s--) (p = Uan(t7(GK(E, 32), Gz(S[s], uMn)))), (S[s] = WR(p)), (E = WR(zK(p, 32))); + (v = WR(E)), (g = e); + do { + y[--e] = (48 + (v % 10)) & fTn; + } while (0 != (v = (v / 10) | 0) && 0 != e); + for (i = 9 - g + e, o = 0; o < i && e > 0; o++) y[--e] = 48; + for (f = P - 1; 0 == S[f]; f--) if (0 == f) break n; + P = f + 1; + } + for (; 48 == y[e]; ) ++e; + } + if (((b = T < 0), (a = m - e - t - 1), 0 == t)) return b && (y[--e] = 45), Vnn(y, e, m - e); + if (t > 0 && a >= -6) { + if (a >= 0) { + for (h = e + a, l = m - 1; l >= h; l--) y[l + 1] = y[l]; + return (y[++h] = 46), b && (y[--e] = 45), Vnn(y, e, m - e + 1); + } + for (f = 2; f < 1 - a; f++) y[--e] = 48; + return (y[--e] = 46), (y[--e] = 48), b && (y[--e] = 45), Vnn(y, e, m - e); + } + return ( + (M = e + 1), + (c = m), + (k = new $y()), + b && (k.a += "-"), + c - M >= 1 ? (_F(k, y[e]), (k.a += "."), (k.a += Vnn(y, e + 1, m - e - 1))) : (k.a += Vnn(y, e, m - e)), + (k.a += "E"), + a > 0 && (k.a += "+"), + (k.a += "" + a), + k.a + ); + } + function vjn(n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k; + switch ( + ((n.c = t), + (n.g = new rp()), + dT(), + R7(new Qb(new Xm(n.c))), + (v = lL(jln(n.c, (Dun(), C9n)))), + (u = Yx(jln(n.c, A9n), 316)), + (y = Yx(jln(n.c, $9n), 429)), + (c = Yx(jln(n.c, T9n), 482)), + (m = Yx(jln(n.c, O9n), 430)), + (n.j = ty(fL(jln(n.c, L9n)))), + (a = n.a), + u.g) + ) { + case 0: + a = n.a; + break; + case 1: + a = n.b; + break; + case 2: + a = n.i; + break; + case 3: + a = n.e; + break; + case 4: + a = n.f; + break; + default: + throw hp(new Qm(V$n + (null != u.f ? u.f : "" + u.g))); + } + if (((n.d = new dG(a, y, c)), b5(n.d, (y3(), hqn), hL(jln(n.c, S9n))), (n.d.c = ny(hL(jln(n.c, M9n)))), 0 == uq(n.c).i)) + return n.d; + for (h = new UO(uq(n.c)); h.e != h.i.gc(); ) { + for (l = (s = Yx(hen(h), 33)).g / 2, f = s.f / 2, k = new QS(s.i + l, s.j + f); P_(n.g, k); ) + $$(k, (e.Math.random() - 0.5) * PPn, (e.Math.random() - 0.5) * PPn); + (w = Yx(jln(s, (Cjn(), Unt)), 142)), + (d = new ez(k, new mH(k.a - l - n.j / 2 - w.b, k.b - f - n.j / 2 - w.d, s.g + n.j + (w.b + w.c), s.f + n.j + (w.d + w.a)))), + eD(n.d.i, d), + xB(n.g, k, new mP(d, s)); + } + switch (m.g) { + case 0: + if (null == v) n.d.d = Yx(TR(n.d.i, 0), 65); + else + for (p = new pb(n.d.i); p.a < p.c.c.length; ) + (d = Yx(Hz(p), 65)), null != (b = Yx(Yx(BF(n.g, d.a), 46).b, 33).zg()) && _N(b, v) && (n.d.d = d); + break; + case 1: + for ((i = new QS(n.c.g, n.c.f)).a *= 0.5, i.b *= 0.5, $$(i, n.c.i, n.c.j), r = JTn, g = new pb(n.d.i); g.a < g.c.c.length; ) + (o = cY((d = Yx(Hz(g), 65)).a, i)) < r && ((r = o), (n.d.d = d)); + break; + default: + throw hp(new Qm(V$n + (null != m.f ? m.f : "" + m.g))); + } + return n.d; + } + function mjn(n, t, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E; + for ( + j = Yx(c1((!n.a && (n.a = new m_(tct, n, 6, 6)), n.a), 0), 202), + f = new Nv(), + k = new rp(), + E = Apn(j), + Ysn(k.f, j, E), + b = new rp(), + r = new ME(), + d = W_( + n0(x4(Gy(QKn, 1), iEn, 20, 0, [(!t.d && (t.d = new AN(nct, t, 8, 5)), t.d), (!t.e && (t.e = new AN(nct, t, 7, 4)), t.e)])), + ); + Vfn(d); + + ) { + if (((w = Yx(kV(d), 79)), 1 != (!n.a && (n.a = new m_(tct, n, 6, 6)), n.a).i)) + throw hp(new Qm(eNn + (!n.a && (n.a = new m_(tct, n, 6, 6)), n.a).i)); + w != n && + (VW(r, (p = Yx(c1((!w.a && (w.a = new m_(tct, w, 6, 6)), w.a), 0), 202)), r.c.b, r.c), + (g = Yx(eI(Dq(k.f, p)), 12)) || ((g = Apn(p)), Ysn(k.f, p, g)), + (l = i + ? yN(new fC(Yx(TR(E, E.c.length - 1), 8)), Yx(TR(g, g.c.length - 1), 8)) + : yN(new fC(($z(0, E.c.length), Yx(E.c[0], 8))), ($z(0, g.c.length), Yx(g.c[0], 8)))), + Ysn(b.f, p, l)); + } + if (0 != r.b) + for (v = Yx(TR(E, i ? E.c.length - 1 : 0), 8), h = 1; h < E.c.length; h++) { + for (m = Yx(TR(E, i ? E.c.length - 1 - h : h), 8), c = Ztn(r, 0); c.b != c.d.c; ) + (p = Yx(IX(c), 202)), + (g = Yx(eI(Dq(k.f, p)), 12)).c.length <= h + ? BZ(c) + : ((y = mN(new fC(Yx(TR(g, i ? g.c.length - 1 - h : h), 8)), Yx(eI(Dq(b.f, p)), 8))), + (m.a == y.a && m.b == y.b) || + ((a = m.a - v.a), + (o = m.b - v.b), + (u = y.a - v.a) * o == (s = y.b - v.b) * a && + (0 == a || isNaN(a) ? a : a < 0 ? -1 : 1) == (0 == u || isNaN(u) ? u : u < 0 ? -1 : 1) && + (0 == o || isNaN(o) ? o : o < 0 ? -1 : 1) == (0 == s || isNaN(s) ? s : s < 0 ? -1 : 1) + ? (e.Math.abs(a) < e.Math.abs(u) || e.Math.abs(o) < e.Math.abs(s)) && VW(f, m, f.c.b, f.c) + : h > 1 && VW(f, v, f.c.b, f.c), + BZ(c))); + v = m; + } + return f; + } + function yjn(n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p; + for ( + i = new ip(), + u = new ip(), + g = t / 2, + b = n.gc(), + r = Yx(n.Xb(0), 8), + p = Yx(n.Xb(1), 8), + eD(i, ($z(0, (w = kln(r.a, r.b, p.a, p.b, g)).c.length), Yx(w.c[0], 8))), + eD(u, ($z(1, w.c.length), Yx(w.c[1], 8))), + s = 2; + s < b; + s++ + ) + (d = r), + (r = p), + (p = Yx(n.Xb(s), 8)), + eD(i, ($z(1, (w = kln(r.a, r.b, d.a, d.b, g)).c.length), Yx(w.c[1], 8))), + eD(u, ($z(0, w.c.length), Yx(w.c[0], 8))), + eD(i, ($z(0, (w = kln(r.a, r.b, p.a, p.b, g)).c.length), Yx(w.c[0], 8))), + eD(u, ($z(1, w.c.length), Yx(w.c[1], 8))); + for ( + eD(i, ($z(1, (w = kln(p.a, p.b, r.a, r.b, g)).c.length), Yx(w.c[1], 8))), + eD(u, ($z(0, w.c.length), Yx(w.c[0], 8))), + e = new Nv(), + a = new ip(), + KD(e, ($z(0, i.c.length), Yx(i.c[0], 8))), + h = 1; + h < i.c.length - 2; + h += 2 + ) + $z(h, i.c.length), + (c = Yx(i.c[h], 8)), + (l = Psn( + ($z(h - 1, i.c.length), Yx(i.c[h - 1], 8)), + c, + ($z(h + 1, i.c.length), Yx(i.c[h + 1], 8)), + ($z(h + 2, i.c.length), Yx(i.c[h + 2], 8)), + )), + isFinite(l.a) && isFinite(l.b) ? VW(e, l, e.c.b, e.c) : VW(e, c, e.c.b, e.c); + for (KD(e, Yx(TR(i, i.c.length - 1), 8)), eD(a, ($z(0, u.c.length), Yx(u.c[0], 8))), f = 1; f < u.c.length - 2; f += 2) + $z(f, u.c.length), + (c = Yx(u.c[f], 8)), + (l = Psn( + ($z(f - 1, u.c.length), Yx(u.c[f - 1], 8)), + c, + ($z(f + 1, u.c.length), Yx(u.c[f + 1], 8)), + ($z(f + 2, u.c.length), Yx(u.c[f + 2], 8)), + )), + isFinite(l.a) && isFinite(l.b) ? (a.c[a.c.length] = l) : (a.c[a.c.length] = c); + for (eD(a, Yx(TR(u, u.c.length - 1), 8)), o = a.c.length - 1; o >= 0; o--) KD(e, ($z(o, a.c.length), Yx(a.c[o], 8))); + return e; + } + function kjn(n) { + var t, e, i; + if (n.d >= n.j) return (n.a = -1), void (n.c = 1); + if (((t = XB(n.i, n.d++)), (n.a = t), 1 != n.b)) { + switch (t) { + case 124: + i = 2; + break; + case 42: + i = 3; + break; + case 43: + i = 4; + break; + case 63: + i = 5; + break; + case 41: + i = 7; + break; + case 46: + i = 8; + break; + case 91: + i = 9; + break; + case 94: + i = 11; + break; + case 36: + i = 12; + break; + case 40: + if (((i = 6), n.d >= n.j)) break; + if (63 != XB(n.i, n.d)) break; + if (++n.d >= n.j) throw hp(new wy(Kjn((GC(), $xn)))); + switch ((t = XB(n.i, n.d++))) { + case 58: + i = 13; + break; + case 61: + i = 14; + break; + case 33: + i = 15; + break; + case 91: + i = 19; + break; + case 62: + i = 18; + break; + case 60: + if (n.d >= n.j) throw hp(new wy(Kjn((GC(), $xn)))); + if (61 == (t = XB(n.i, n.d++))) i = 16; + else { + if (33 != t) throw hp(new wy(Kjn((GC(), Lxn)))); + i = 17; + } + break; + case 35: + for (; n.d < n.j && 41 != (t = XB(n.i, n.d++)); ); + if (41 != t) throw hp(new wy(Kjn((GC(), Nxn)))); + i = 21; + break; + default: + if (45 == t || (97 <= t && t <= 122) || (65 <= t && t <= 90)) { + --n.d, (i = 22); + break; + } + if (40 == t) { + i = 23; + break; + } + throw hp(new wy(Kjn((GC(), $xn)))); + } + break; + case 92: + if (((i = 10), n.d >= n.j)) throw hp(new wy(Kjn((GC(), Axn)))); + n.a = XB(n.i, n.d++); + break; + default: + i = 0; + } + n.c = i; + } else { + switch (t) { + case 92: + if (((i = 10), n.d >= n.j)) throw hp(new wy(Kjn((GC(), Axn)))); + n.a = XB(n.i, n.d++); + break; + case 45: + 512 == (512 & n.e) && n.d < n.j && 91 == XB(n.i, n.d) ? (++n.d, (i = 24)) : (i = 0); + break; + case 91: + if (512 != (512 & n.e) && n.d < n.j && 58 == XB(n.i, n.d)) { + ++n.d, (i = 20); + break; + } + default: + (64512 & t) == iMn && + n.d < n.j && + 56320 == (64512 & (e = XB(n.i, n.d))) && + ((n.a = eMn + ((t - iMn) << 10) + e - 56320), ++n.d), + (i = 0); + } + n.c = i; + } + } + function jjn(n, t, e) { + var i, r, c, a, u, o, s, f, l, b, w, d, g, p, v, m, y, k, j; + if ((run(e, "Coffman-Graham Layering", 1), 0 != t.a.c.length)) { + for (j = Yx(Aun(t, (gjn(), L1n)), 19).a, o = 0, a = 0, b = new pb(t.a); b.a < b.c.c.length; ) + for ((l = Yx(Hz(b), 10)).p = o++, c = new $K(bA(o7(l).a.Kc(), new h())); Vfn(c); ) (r = Yx(kV(c), 17)).p = a++; + for ( + n.d = VQ(Vot, wSn, 25, o, 16, 1), + n.a = VQ(Vot, wSn, 25, a, 16, 1), + n.b = VQ(Wot, MTn, 25, o, 15, 1), + n.e = VQ(Wot, MTn, 25, o, 15, 1), + n.f = VQ(Wot, MTn, 25, o, 15, 1), + v0(n.c), + (function (n, t) { + var e, i, r; + for (r = new pb(t.a); r.a < r.c.c.length; ) + for (i = Yx(Hz(r), 10), oy(n.d), e = new $K(bA(o7(i).a.Kc(), new h())); Vfn(e); ) Nfn(n, i, Yx(kV(e), 17).d.i); + })(n, t), + d = new h_(new cd(n)), + k = new pb(t.a); + k.a < k.c.c.length; + + ) { + for (c = new $K(bA(u7((m = Yx(Hz(k), 10))).a.Kc(), new h())); Vfn(c); ) (r = Yx(kV(c), 17)), n.a[r.p] || ++n.b[m.p]; + 0 == n.b[m.p] && JQ(mun(d, m)); + } + for (u = 0; 0 != d.b.c.length; ) + for (m = Yx(YJ(d), 10), n.f[m.p] = u++, c = new $K(bA(o7(m).a.Kc(), new h())); Vfn(c); ) + (r = Yx(kV(c), 17)), n.a[r.p] || ((p = r.d.i), --n.b[p.p], Qhn(n.c, p, d9(n.f[m.p])), 0 == n.b[p.p] && JQ(mun(d, p))); + for (w = new h_(new ad(n)), y = new pb(t.a); y.a < y.c.c.length; ) { + for (c = new $K(bA(o7((m = Yx(Hz(y), 10))).a.Kc(), new h())); Vfn(c); ) (r = Yx(kV(c), 17)), n.a[r.p] || ++n.e[m.p]; + 0 == n.e[m.p] && JQ(mun(w, m)); + } + for (i = Mz(t, (f = new ip())); 0 != w.b.c.length; ) + for ( + v = Yx(YJ(w), 10), (i.a.c.length >= j || !qnn(v, i)) && (i = Mz(t, f)), JG(v, i), c = new $K(bA(u7(v).a.Kc(), new h())); + Vfn(c); + + ) + (r = Yx(kV(c), 17)), n.a[r.p] || ((g = r.c.i), --n.e[g.p], 0 == n.e[g.p] && JQ(mun(w, g))); + for (s = f.c.length - 1; s >= 0; --s) eD(t.b, ($z(s, f.c.length), Yx(f.c[s], 29))); + (t.a.c = VQ(UKn, iEn, 1, 0, 5, 1)), Ron(e); + } else Ron(e); + } + function Ejn(n) { + var t, e, i, r, c, a, u, o; + for ( + n.b = 1, + kjn(n), + t = null, + 0 == n.c && 94 == n.a + ? (kjn(n), Ljn(), Ljn(), zwn((t = new cU(4)), 0, jKn), (a = new cU(4))) + : (Ljn(), Ljn(), (a = new cU(4))), + r = !0; + 1 != (o = n.c); + + ) { + if (0 == o && 93 == n.a && !r) { + t && (_yn(t, a), (a = t)); + break; + } + if (((e = n.a), (i = !1), 10 == o)) + switch (e) { + case 100: + case 68: + case 119: + case 87: + case 115: + case 83: + fmn(a, rpn(e)), (i = !0); + break; + case 105: + case 73: + case 99: + case 67: + fmn(a, rpn(e)), (e = -1) < 0 && (i = !0); + break; + case 112: + case 80: + if (!(u = Hhn(n, e))) throw hp(new wy(Kjn((GC(), zxn)))); + fmn(a, u), (i = !0); + break; + default: + e = Tdn(n); + } + else if (24 == o && !r) { + if ((t && (_yn(t, a), (a = t)), _yn(a, Ejn(n)), 0 != n.c || 93 != n.a)) throw hp(new wy(Kjn((GC(), Vxn)))); + break; + } + if ((kjn(n), !i)) { + if (0 == o) { + if (91 == e) throw hp(new wy(Kjn((GC(), Qxn)))); + if (93 == e) throw hp(new wy(Kjn((GC(), Yxn)))); + if (45 == e && !r && 93 != n.a) throw hp(new wy(Kjn((GC(), Jxn)))); + } + if (0 != n.c || 45 != n.a || (45 == e && r)) zwn(a, e, e); + else { + if ((kjn(n), 1 == (o = n.c))) throw hp(new wy(Kjn((GC(), Xxn)))); + if (0 == o && 93 == n.a) zwn(a, e, e), zwn(a, 45, 45); + else { + if ((0 == o && 93 == n.a) || 24 == o) throw hp(new wy(Kjn((GC(), Jxn)))); + if (((c = n.a), 0 == o)) { + if (91 == c) throw hp(new wy(Kjn((GC(), Qxn)))); + if (93 == c) throw hp(new wy(Kjn((GC(), Yxn)))); + if (45 == c) throw hp(new wy(Kjn((GC(), Jxn)))); + } else 10 == o && (c = Tdn(n)); + if ((kjn(n), e > c)) throw hp(new wy(Kjn((GC(), tDn)))); + zwn(a, e, c); + } + } + } + r = !1; + } + if (1 == n.c) throw hp(new wy(Kjn((GC(), Xxn)))); + return xln(a), Lmn(a), (n.b = 0), kjn(n), a; + } + function Tjn() { + (Tjn = O), + ljn(), + Qhn((Azn = new Zq()), (Ikn(), Oit), Cit), + Qhn(Azn, Fit, Cit), + Qhn(Azn, Ait, Cit), + Qhn(Azn, Rit, Cit), + Qhn(Azn, Dit, Cit), + Qhn(Azn, Nit, Cit), + Qhn(Azn, Rit, Oit), + Qhn(Azn, Cit, Mit), + Qhn(Azn, Oit, Mit), + Qhn(Azn, Fit, Mit), + Qhn(Azn, Ait, Mit), + Qhn(Azn, xit, Mit), + Qhn(Azn, Rit, Mit), + Qhn(Azn, Dit, Mit), + Qhn(Azn, Nit, Mit), + Qhn(Azn, Iit, Mit), + Qhn(Azn, Cit, Kit), + Qhn(Azn, Oit, Kit), + Qhn(Azn, Mit, Kit), + Qhn(Azn, Fit, Kit), + Qhn(Azn, Ait, Kit), + Qhn(Azn, xit, Kit), + Qhn(Azn, Rit, Kit), + Qhn(Azn, Iit, Kit), + Qhn(Azn, _it, Kit), + Qhn(Azn, Dit, Kit), + Qhn(Azn, $it, Kit), + Qhn(Azn, Nit, Kit), + Qhn(Azn, Oit, Fit), + Qhn(Azn, Ait, Fit), + Qhn(Azn, Rit, Fit), + Qhn(Azn, Nit, Fit), + Qhn(Azn, Oit, Ait), + Qhn(Azn, Fit, Ait), + Qhn(Azn, Rit, Ait), + Qhn(Azn, Ait, Ait), + Qhn(Azn, Dit, Ait), + Qhn(Azn, Cit, Sit), + Qhn(Azn, Oit, Sit), + Qhn(Azn, Mit, Sit), + Qhn(Azn, Kit, Sit), + Qhn(Azn, Fit, Sit), + Qhn(Azn, Ait, Sit), + Qhn(Azn, xit, Sit), + Qhn(Azn, Rit, Sit), + Qhn(Azn, _it, Sit), + Qhn(Azn, Iit, Sit), + Qhn(Azn, Nit, Sit), + Qhn(Azn, Dit, Sit), + Qhn(Azn, Lit, Sit), + Qhn(Azn, Cit, _it), + Qhn(Azn, Oit, _it), + Qhn(Azn, Mit, _it), + Qhn(Azn, Fit, _it), + Qhn(Azn, Ait, _it), + Qhn(Azn, xit, _it), + Qhn(Azn, Rit, _it), + Qhn(Azn, Iit, _it), + Qhn(Azn, Nit, _it), + Qhn(Azn, $it, _it), + Qhn(Azn, Lit, _it), + Qhn(Azn, Oit, Iit), + Qhn(Azn, Fit, Iit), + Qhn(Azn, Ait, Iit), + Qhn(Azn, Rit, Iit), + Qhn(Azn, _it, Iit), + Qhn(Azn, Nit, Iit), + Qhn(Azn, Dit, Iit), + Qhn(Azn, Cit, Pit), + Qhn(Azn, Oit, Pit), + Qhn(Azn, Mit, Pit), + Qhn(Azn, Fit, Pit), + Qhn(Azn, Ait, Pit), + Qhn(Azn, xit, Pit), + Qhn(Azn, Rit, Pit), + Qhn(Azn, Iit, Pit), + Qhn(Azn, Nit, Pit), + Qhn(Azn, Oit, Dit), + Qhn(Azn, Mit, Dit), + Qhn(Azn, Kit, Dit), + Qhn(Azn, Ait, Dit), + Qhn(Azn, Cit, $it), + Qhn(Azn, Oit, $it), + Qhn(Azn, Kit, $it), + Qhn(Azn, Fit, $it), + Qhn(Azn, Ait, $it), + Qhn(Azn, xit, $it), + Qhn(Azn, Rit, $it), + Qhn(Azn, Rit, Lit), + Qhn(Azn, Ait, Lit), + Qhn(Azn, Iit, Cit), + Qhn(Azn, Iit, Fit), + Qhn(Azn, Iit, Mit), + Qhn(Azn, xit, Cit), + Qhn(Azn, xit, Oit), + Qhn(Azn, xit, Kit); + } + function Mjn(n, t) { + switch (n.e) { + case 0: + case 2: + case 4: + case 6: + case 42: + case 44: + case 46: + case 48: + case 8: + case 10: + case 12: + case 14: + case 16: + case 18: + case 20: + case 22: + case 24: + case 26: + case 28: + case 30: + case 32: + case 34: + case 36: + case 38: + return new eq(n.b, n.a, t, n.c); + case 1: + return new WO(n.a, t, tnn(t.Tg(), n.c)); + case 43: + return new QO(n.a, t, tnn(t.Tg(), n.c)); + case 3: + return new XO(n.a, t, tnn(t.Tg(), n.c)); + case 45: + return new VO(n.a, t, tnn(t.Tg(), n.c)); + case 41: + return new yY(Yx(fcn(n.c), 26), n.a, t, tnn(t.Tg(), n.c)); + case 50: + return new j0(Yx(fcn(n.c), 26), n.a, t, tnn(t.Tg(), n.c)); + case 5: + return new TN(n.a, t, tnn(t.Tg(), n.c), n.d.n); + case 47: + return new MN(n.a, t, tnn(t.Tg(), n.c), n.d.n); + case 7: + return new m_(n.a, t, tnn(t.Tg(), n.c), n.d.n); + case 49: + return new EN(n.a, t, tnn(t.Tg(), n.c), n.d.n); + case 9: + return new tA(n.a, t, tnn(t.Tg(), n.c)); + case 11: + return new nA(n.a, t, tnn(t.Tg(), n.c)); + case 13: + return new ZO(n.a, t, tnn(t.Tg(), n.c)); + case 15: + return new CD(n.a, t, tnn(t.Tg(), n.c)); + case 17: + return new eA(n.a, t, tnn(t.Tg(), n.c)); + case 19: + return new JO(n.a, t, tnn(t.Tg(), n.c)); + case 21: + return new YO(n.a, t, tnn(t.Tg(), n.c)); + case 23: + return new TD(n.a, t, tnn(t.Tg(), n.c)); + case 25: + return new $N(n.a, t, tnn(t.Tg(), n.c), n.d.n); + case 27: + return new AN(n.a, t, tnn(t.Tg(), n.c), n.d.n); + case 29: + return new CN(n.a, t, tnn(t.Tg(), n.c), n.d.n); + case 31: + return new SN(n.a, t, tnn(t.Tg(), n.c), n.d.n); + case 33: + return new ON(n.a, t, tnn(t.Tg(), n.c), n.d.n); + case 35: + return new IN(n.a, t, tnn(t.Tg(), n.c), n.d.n); + case 37: + return new PN(n.a, t, tnn(t.Tg(), n.c), n.d.n); + case 39: + return new y_(n.a, t, tnn(t.Tg(), n.c), n.d.n); + case 40: + return new e3(t, tnn(t.Tg(), n.c)); + default: + throw hp(new Im("Unknown feature style: " + n.e)); + } + } + function Sjn(n, t, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j; + switch ( + (run(i, "Brandes & Koepf node placement", 1), + (n.a = t), + (n.c = avn(t)), + (r = Yx(Aun(t, (gjn(), W1n)), 274)), + (w = ny(hL(Aun(t, V1n)))), + (n.d = (r == (Wcn(), hVn) && !w) || r == uVn), + (function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m; + if (!((d = t.b.c.length) < 3)) { + for (b = VQ(Wot, MTn, 25, d, 15, 1), f = 0, h = new pb(t.b); h.a < h.c.c.length; ) + (s = Yx(Hz(h), 29)), (b[f++] = s.a.c.length); + for (l = new JU(t.b, 2), i = 1; i < d - 1; i++) + for (S$(l.b < l.d.gc()), w = new pb((e = Yx(l.d.Xb((l.c = l.b++)), 29)).a), c = 0, u = 0, o = 0; o < b[i + 1]; o++) + if (((m = Yx(Hz(w), 10)), o == b[i + 1] - 1 || Gon(n, m, i + 1, i))) { + for (a = b[i] - 1, Gon(n, m, i + 1, i) && (a = n.c.e[Yx(Yx(Yx(TR(n.c.b, m.p), 15).Xb(0), 46).a, 10).p]); u <= o; ) { + if (!Gon(n, (v = Yx(TR(e.a, u), 10)), i + 1, i)) + for (p = Yx(TR(n.c.b, v.p), 15).Kc(); p.Ob(); ) + (g = Yx(p.Pb(), 46)), ((r = n.c.e[Yx(g.a, 10).p]) < c || r > a) && __(n.b, Yx(g.b, 17)); + ++u; + } + c = a; + } + } + })(n, t), + (k = null), + (j = null), + (p = null), + (v = null), + g0(4, UEn), + (g = new pQ(4)), + Yx(Aun(t, W1n), 274).g) + ) { + case 3: + (p = new Bgn(t, n.c.d, (RG(), v4n), (Jq(), w4n))), (g.c[g.c.length] = p); + break; + case 1: + (v = new Bgn(t, n.c.d, (RG(), m4n), (Jq(), w4n))), (g.c[g.c.length] = v); + break; + case 4: + (k = new Bgn(t, n.c.d, (RG(), v4n), (Jq(), d4n))), (g.c[g.c.length] = k); + break; + case 2: + (j = new Bgn(t, n.c.d, (RG(), m4n), (Jq(), d4n))), (g.c[g.c.length] = j); + break; + default: + (p = new Bgn(t, n.c.d, (RG(), v4n), (Jq(), w4n))), + (v = new Bgn(t, n.c.d, m4n, w4n)), + (k = new Bgn(t, n.c.d, v4n, d4n)), + (j = new Bgn(t, n.c.d, m4n, d4n)), + (g.c[g.c.length] = k), + (g.c[g.c.length] = j), + (g.c[g.c.length] = p), + (g.c[g.c.length] = v); + } + for (c = new kS(t, n.c), o = new pb(g); o.a < o.c.c.length; ) cjn(c, (a = Yx(Hz(o), 180)), n.b), nmn(a); + for (b = new Grn(t, n.c), s = new pb(g); s.a < s.c.c.length; ) skn(b, (a = Yx(Hz(s), 180))); + if (i.n) for (h = new pb(g); h.a < h.c.c.length; ) LD(i, (a = Yx(Hz(h), 180)) + " size is " + Aln(a)); + if ( + ((l = null), + n.d && + Bvn( + t, + (f = (function (n, t, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E; + for ( + v = t.c.length, + c = new Bgn(n.a, i, null, null), + E = VQ(Jot, rMn, 25, v, 15, 1), + w = VQ(Jot, rMn, 25, v, 15, 1), + b = VQ(Jot, rMn, 25, v, 15, 1), + d = 0, + o = 0; + o < v; + o++ + ) + (w[o] = Yjn), (b[o] = nTn); + for (s = 0; s < v; s++) + for ( + $z(s, t.c.length), r = Yx(t.c[s], 180), E[s] = Aln(r), E[d] > E[s] && (d = s), f = new pb(n.a.b); + f.a < f.c.c.length; + + ) + for (p = new pb(Yx(Hz(f), 29).a); p.a < p.c.c.length; ) + (g = Yx(Hz(p), 10)), + (k = ty(r.p[g.p]) + ty(r.d[g.p])), + (w[s] = e.Math.min(w[s], k)), + (b[s] = e.Math.max(b[s], k + g.o.b)); + for (j = VQ(Jot, rMn, 25, v, 15, 1), h = 0; h < v; h++) + ($z(h, t.c.length), Yx(t.c[h], 180)).o == (RG(), v4n) ? (j[h] = w[d] - w[h]) : (j[h] = b[d] - b[h]); + for (a = VQ(Jot, rMn, 25, v, 15, 1), l = new pb(n.a.b); l.a < l.c.c.length; ) + for (y = new pb(Yx(Hz(l), 29).a); y.a < y.c.c.length; ) { + for (m = Yx(Hz(y), 10), u = 0; u < v; u++) + a[u] = ty(($z(u, t.c.length), Yx(t.c[u], 180)).p[m.p]) + ty(($z(u, t.c.length), Yx(t.c[u], 180)).d[m.p]) + j[u]; + a.sort(f1(T.prototype.te, T, [])), (c.p[m.p] = (a[1] + a[2]) / 2), (c.d[m.p] = 0); + } + return c; + })(n, g, n.c.d)), + i, + ) && + (l = f), + !l) + ) + for (h = new pb(g); h.a < h.c.c.length; ) Bvn(t, (a = Yx(Hz(h), 180)), i) && (!l || Aln(l) > Aln(a)) && (l = a); + for (!l && ($z(0, g.c.length), (l = Yx(g.c[0], 180))), d = new pb(t.b); d.a < d.c.c.length; ) + for (y = new pb(Yx(Hz(d), 29).a); y.a < y.c.c.length; ) (m = Yx(Hz(y), 10)).n.b = ty(l.p[m.p]) + ty(l.d[m.p]); + for ( + i.n && + (LD(i, "Chosen node placement: " + l), + LD(i, "Blocks: " + Tfn(l)), + LD( + i, + "Classes: " + + (function (n, t) { + var e, i, r, c, a; + for (i = new bW(), c = yW(new ay(n.g)).a.ec().Kc(); c.Ob(); ) { + if (!(r = Yx(c.Pb(), 10))) { + LD(t, "There are no classes in a balanced layout."); + break; + } + (e = Yx(UJ(i, (a = n.j[r.p])), 15)) || Gtn(i, a, (e = new ip())), e.Fc(r); + } + return i; + })(l, i), + ), + LD(i, "Marked edges: " + n.b)), + u = new pb(g); + u.a < u.c.c.length; + + ) + ((a = Yx(Hz(u), 180)).g = null), (a.b = null), (a.a = null), (a.d = null), (a.j = null), (a.i = null), (a.p = null); + (function (n) { + (n.a = null), (n.e = null), (n.b.c = VQ(UKn, iEn, 1, 0, 5, 1)), (n.f.c = VQ(UKn, iEn, 1, 0, 5, 1)), (n.c = null); + })(n.c), + n.b.a.$b(), + Ron(i); + } + function Pjn(n, t, i, r, c, a) { + var u, o, s, h, f, l, b; + switch (t) { + case 71: + (u = r.q.getFullYear() - TTn >= -1900 ? 1 : 0), + yI(n, i >= 4 ? x4(Gy(fFn, 1), TEn, 2, 6, [STn, PTn])[u] : x4(Gy(fFn, 1), TEn, 2, 6, ["BC", "AD"])[u]); + break; + case 121: + !(function (n, t, e) { + var i; + switch (((i = e.q.getFullYear() - TTn + TTn) < 0 && (i = -i), t)) { + case 1: + n.a += i; + break; + case 2: + tZ(n, i % 100, 2); + break; + default: + tZ(n, i, t); + } + })(n, i, r); + break; + case 77: + !(function (n, t, e) { + var i; + switch (((i = e.q.getMonth()), t)) { + case 5: + yI(n, x4(Gy(fFn, 1), TEn, 2, 6, ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"])[i]); + break; + case 4: + yI(n, x4(Gy(fFn, 1), TEn, 2, 6, [lTn, bTn, wTn, dTn, gTn, pTn, vTn, mTn, yTn, kTn, jTn, ETn])[i]); + break; + case 3: + yI(n, x4(Gy(fFn, 1), TEn, 2, 6, ["Jan", "Feb", "Mar", "Apr", gTn, "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"])[i]); + break; + default: + tZ(n, i + 1, t); + } + })(n, i, r); + break; + case 107: + tZ(n, 0 == (o = c.q.getHours()) ? 24 : o, i); + break; + case 83: + !(function (n, t, i) { + var r, c; + k8((r = D3(i.q.getTime())), 0) < 0 ? (c = hTn - WR(Snn(sJ(r), hTn))) == hTn && (c = 0) : (c = WR(Snn(r, hTn))), + 1 == t + ? _F(n, (48 + (c = e.Math.min(((c + 50) / 100) | 0, 9))) & fTn) + : 2 == t + ? tZ(n, (c = e.Math.min(((c + 5) / 10) | 0, 99)), 2) + : (tZ(n, c, 3), t > 3 && tZ(n, 0, t - 3)); + })(n, i, c); + break; + case 69: + (s = r.q.getDay()), + yI( + n, + 5 == i + ? x4(Gy(fFn, 1), TEn, 2, 6, ["S", "M", "T", "W", "T", "F", "S"])[s] + : 4 == i + ? x4(Gy(fFn, 1), TEn, 2, 6, [ITn, CTn, OTn, ATn, $Tn, LTn, NTn])[s] + : x4(Gy(fFn, 1), TEn, 2, 6, ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"])[s], + ); + break; + case 97: + c.q.getHours() >= 12 && c.q.getHours() < 24 + ? yI(n, x4(Gy(fFn, 1), TEn, 2, 6, ["AM", "PM"])[1]) + : yI(n, x4(Gy(fFn, 1), TEn, 2, 6, ["AM", "PM"])[0]); + break; + case 104: + tZ(n, 0 == (h = c.q.getHours() % 12) ? 12 : h, i); + break; + case 75: + tZ(n, c.q.getHours() % 12, i); + break; + case 72: + tZ(n, c.q.getHours(), i); + break; + case 99: + (f = r.q.getDay()), + 5 == i + ? yI(n, x4(Gy(fFn, 1), TEn, 2, 6, ["S", "M", "T", "W", "T", "F", "S"])[f]) + : 4 == i + ? yI(n, x4(Gy(fFn, 1), TEn, 2, 6, [ITn, CTn, OTn, ATn, $Tn, LTn, NTn])[f]) + : 3 == i + ? yI(n, x4(Gy(fFn, 1), TEn, 2, 6, ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"])[f]) + : tZ(n, f, 1); + break; + case 76: + (l = r.q.getMonth()), + 5 == i + ? yI(n, x4(Gy(fFn, 1), TEn, 2, 6, ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"])[l]) + : 4 == i + ? yI(n, x4(Gy(fFn, 1), TEn, 2, 6, [lTn, bTn, wTn, dTn, gTn, pTn, vTn, mTn, yTn, kTn, jTn, ETn])[l]) + : 3 == i + ? yI( + n, + x4(Gy(fFn, 1), TEn, 2, 6, ["Jan", "Feb", "Mar", "Apr", gTn, "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"])[l], + ) + : tZ(n, l + 1, i); + break; + case 81: + (b = (r.q.getMonth() / 3) | 0), + yI( + n, + i < 4 + ? x4(Gy(fFn, 1), TEn, 2, 6, ["Q1", "Q2", "Q3", "Q4"])[b] + : x4(Gy(fFn, 1), TEn, 2, 6, ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"])[b], + ); + break; + case 100: + tZ(n, r.q.getDate(), i); + break; + case 109: + tZ(n, c.q.getMinutes(), i); + break; + case 115: + tZ(n, c.q.getSeconds(), i); + break; + case 122: + yI(n, i < 4 ? a.c[0] : a.c[1]); + break; + case 118: + yI(n, a.b); + break; + case 90: + yI( + n, + i < 3 + ? (function (n) { + var t, e; + return ( + (e = -n.a), + (t = x4(Gy(Xot, 1), sTn, 25, 15, [43, 48, 48, 48, 48])), + e < 0 && ((t[0] = 45), (e = -e)), + (t[1] = (t[1] + ((((e / 60) | 0) / 10) | 0)) & fTn), + (t[2] = (t[2] + (((e / 60) | 0) % 10)) & fTn), + (t[3] = (t[3] + (((e % 60) / 10) | 0)) & fTn), + (t[4] = (t[4] + (e % 10)) & fTn), + Vnn(t, 0, t.length) + ); + })(a) + : 3 == i + ? (function (n) { + var t, e; + return ( + (e = -n.a), + (t = x4(Gy(Xot, 1), sTn, 25, 15, [43, 48, 48, 58, 48, 48])), + e < 0 && ((t[0] = 45), (e = -e)), + (t[1] = (t[1] + ((((e / 60) | 0) / 10) | 0)) & fTn), + (t[2] = (t[2] + (((e / 60) | 0) % 10)) & fTn), + (t[4] = (t[4] + (((e % 60) / 10) | 0)) & fTn), + (t[5] = (t[5] + (e % 10)) & fTn), + Vnn(t, 0, t.length) + ); + })(a) + : (function (n) { + var t; + return ( + (t = x4(Gy(Xot, 1), sTn, 25, 15, [71, 77, 84, 45, 48, 48, 58, 48, 48])), + n <= 0 && ((t[3] = 43), (n = -n)), + (t[4] = (t[4] + ((((n / 60) | 0) / 10) | 0)) & fTn), + (t[5] = (t[5] + (((n / 60) | 0) % 10)) & fTn), + (t[7] = (t[7] + (((n % 60) / 10) | 0)) & fTn), + (t[8] = (t[8] + (n % 10)) & fTn), + Vnn(t, 0, t.length) + ); + })(a.a), + ); + break; + default: + return !1; + } + return !0; + } + function Ijn(n, t, e, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M, S, P, I; + if ( + (dgn(t), + (o = Yx(c1((!t.b && (t.b = new AN(Zrt, t, 4, 7)), t.b), 0), 82)), + (h = Yx(c1((!t.c && (t.c = new AN(Zrt, t, 5, 8)), t.c), 0), 82)), + (u = iun(o)), + (s = iun(h)), + (a = 0 == (!t.a && (t.a = new m_(tct, t, 6, 6)), t.a).i ? null : Yx(c1((!t.a && (t.a = new m_(tct, t, 6, 6)), t.a), 0), 202)), + (j = Yx(BF(n.a, u), 10)), + (S = Yx(BF(n.a, s), 10)), + (E = null), + (P = null), + CO(o, 186) && (CO((k = Yx(BF(n.a, o), 299)), 11) ? (E = Yx(k, 11)) : CO(k, 10) && ((j = Yx(k, 10)), (E = Yx(TR(j.j, 0), 11)))), + CO(h, 186) && (CO((M = Yx(BF(n.a, h), 299)), 11) ? (P = Yx(M, 11)) : CO(M, 10) && ((S = Yx(M, 10)), (P = Yx(TR(S.j, 0), 11)))), + !j || !S) + ) + throw hp( + new by( + "The source or the target of edge " + + t + + " could not be found. This usually happens when an edge connects a node laid out by ELK Layered to a node in another level of hierarchy laid out by either another instance of ELK Layered or another layout algorithm alltogether. The former can be solved by setting the hierarchyHandling option to INCLUDE_CHILDREN.", + ), + ); + for ( + o4((d = new jq()), t), + b5(d, (Ojn(), CQn), t), + b5(d, (gjn(), $1n), null), + b = Yx(Aun(i, bQn), 21), + j == S && b.Fc((edn(), $Vn)), + E || + (h0(), + (y = i3n), + (T = null), + a && dC(Yx(Aun(j, g0n), 98)) && (XX((T = new QS(a.j, a.k)), EG(t)), UW(T, e), XZ(s, u) && ((y = e3n), mN(T, j.n))), + (E = dmn(j, T, y, i))), + P || + (h0(), + (y = e3n), + (I = null), + a && dC(Yx(Aun(S, g0n), 98)) && (XX((I = new QS(a.b, a.c)), EG(t)), UW(I, e)), + (P = dmn(S, I, y, dB(S)))), + YG(d, E), + QG(d, P), + (E.e.c.length > 1 || E.g.c.length > 1 || P.e.c.length > 1 || P.g.c.length > 1) && b.Fc((edn(), PVn)), + l = new UO((!t.n && (t.n = new m_(act, t, 1, 7)), t.n)); + l.e != l.i.gc(); + + ) + if (!ny(hL(jln((f = Yx(hen(l), 137)), r0n))) && f.a) + switch (((g = d8(f)), eD(d.b, g), Yx(Aun(g, f1n), 272).g)) { + case 1: + case 2: + b.Fc((edn(), MVn)); + break; + case 0: + b.Fc((edn(), EVn)), b5(g, f1n, (ZZ(), cet)); + } + if ( + ((c = Yx(Aun(i, i1n), 314)), + (p = Yx(Aun(i, Z1n), 315)), + (r = c == (O0(), EWn) || p == (ain(), A2n)), + a && 0 != (!a.a && (a.a = new XO(Qrt, a, 5)), a.a).i && r) + ) { + for (v = Kon(a), w = new Nv(), m = Ztn(v, 0); m.b != m.d.c; ) KD(w, new fC(Yx(IX(m), 8))); + b5(d, OQn, w); + } + return d; + } + function Cjn() { + var n, t; + (Cjn = O), + (gnt = new Og(CLn)), + (Ltt = new Og(OLn)), + qen(), + (pnt = new FI(sAn, (vnt = H7n))), + new tp(), + (mnt = new FI(hPn, null)), + (ynt = new Og(ALn)), + dan(), + (Mnt = tK(bnt, x4(Gy(iet, 1), XEn, 291, 0, [snt]))), + (Tnt = new FI(jAn, Mnt)), + (Snt = new FI(oAn, (TA(), !1))), + t9(), + (Pnt = new FI(bAn, (Int = tet))), + g7(), + ($nt = new FI(xOn, (Lnt = wet))), + (Dnt = new FI(U$n, !1)), + O8(), + (Rnt = new FI(OOn, (Knt = Let))), + (ott = new RC(12)), + (utt = new FI(fPn, ott)), + (Hnt = new FI(RPn, !1)), + (qnt = new FI(NAn, !1)), + (att = new FI(FPn, !1)), + Ran(), + (ktt = new FI(KPn, (jtt = lit))), + (Ott = new Og(AAn)), + (Att = new Og($Pn)), + ($tt = new Og(xPn)), + (xtt = new Og(DPn)), + (znt = new Nv()), + (Gnt = new FI(EAn, znt)), + (Ent = new FI(SAn, !1)), + (_nt = new FI(PAn, !1)), + new Og($Ln), + (Xnt = new Mv()), + (Unt = new FI($An, Xnt)), + (ctt = new FI(aAn, !1)), + new tp(), + (Ntt = new FI(LLn, 1)), + new FI(NLn, !0), + d9(0), + new FI(xLn, d9(100)), + new FI(DLn, !1), + d9(0), + new FI(RLn, d9(4e3)), + d9(0), + new FI(KLn, d9(400)), + new FI(_Ln, !1), + new FI(FLn, !1), + new FI(BLn, !0), + new FI(HLn, !1), + unn(), + (knt = new FI(ILn, (jnt = prt))), + (Dtt = new FI(WOn, 10)), + (Rtt = new FI(VOn, 10)), + (Ktt = new FI(oPn, 20)), + (_tt = new FI(QOn, 10)), + (Ftt = new FI(NPn, 2)), + (Btt = new FI(YOn, 10)), + (qtt = new FI(JOn, 0)), + (Gtt = new FI(tAn, 5)), + (ztt = new FI(ZOn, 1)), + (Utt = new FI(nAn, 1)), + (Xtt = new FI(LPn, 20)), + (Wtt = new FI(eAn, 10)), + (Ytt = new FI(iAn, 10)), + (Htt = new Og(rAn)), + (Qtt = new sC()), + (Vtt = new FI(LAn, Qtt)), + (ftt = new Og(OAn)), + (stt = new FI(CAn, (htt = !1))), + (Vnt = new RC(5)), + (Wnt = new FI(wAn, Vnt)), + Eln(), + (t = Yx(Ak(cit), 9)), + (Ynt = new cx(t, Yx(eN(t, t.length), 9), 0)), + (Qnt = new FI(qPn, Ynt)), + Ytn(), + (btt = new FI(pAn, (wtt = eit))), + (gtt = new Og(vAn)), + (ptt = new Og(mAn)), + (vtt = new Og(yAn)), + (dtt = new Og(kAn)), + (n = Yx(Ak(lrt), 9)), + (Znt = new cx(n, Yx(eN(n, n.length), 9), 0)), + (Jnt = new FI(HPn, Znt)), + (rtt = J9((Vgn(), crt))), + (itt = new FI(BPn, rtt)), + (ett = new QS(0, 0)), + (ttt = new FI(eIn, ett)), + (ntt = new FI(lAn, !1)), + ZZ(), + (Ont = new FI(TAn, (Ant = cet))), + (Cnt = new FI(_Pn, !1)), + new Og(qLn), + d9(1), + new FI(GLn, null), + (mtt = new Og(IAn)), + (Ett = new Og(MAn)), + Ikn(), + (Itt = new FI(uAn, (Ctt = Hit))), + (ytt = new Og(cAn)), + Chn(), + (Stt = J9(mit)), + (Mtt = new FI(GPn, Stt)), + (Ttt = new FI(dAn, !1)), + (Ptt = new FI(gAn, !0)), + (Fnt = new FI(hAn, !1)), + (Bnt = new FI(fAn, !1)), + (Nnt = new FI(sPn, 1)), + vun(), + new FI(zLn, (xnt = ket)), + (ltt = !0); + } + function Ojn() { + var n, t; + (Ojn = O), + (CQn = new Og(zPn)), + (nQn = new Og("coordinateOrigin")), + (_Qn = new Og("processors")), + (ZVn = new _L("compoundNode", (TA(), !1))), + (gQn = new _L("insideConnections", !1)), + (OQn = new Og("originalBendpoints")), + (AQn = new Og("originalDummyNodePosition")), + ($Qn = new Og("originalLabelEdge")), + (BQn = new Og("representedLabels")), + (cQn = new Og("endLabels")), + (aQn = new Og("endLabel.origin")), + (kQn = new _L("labelSide", (Frn(), Fet))), + (PQn = new _L("maxEdgeThickness", 0)), + (HQn = new _L("reversed", !1)), + (FQn = new Og(UPn)), + (TQn = new _L("longEdgeSource", null)), + (MQn = new _L("longEdgeTarget", null)), + (EQn = new _L("longEdgeHasLabelDummies", !1)), + (jQn = new _L("longEdgeBeforeLabelDummy", !1)), + (rQn = new _L("edgeConstraint", (i5(), zWn))), + (vQn = new Og("inLayerLayoutUnit")), + (pQn = new _L("inLayerConstraint", (AJ(), BVn))), + (mQn = new _L("inLayerSuccessorConstraint", new ip())), + (yQn = new _L("inLayerSuccessorConstraintBetweenNonDummies", !1)), + (RQn = new Og("portDummy")), + (tQn = new _L("crossingHint", d9(0))), + (bQn = new _L("graphProperties", new cx((t = Yx(Ak(KVn), 9)), Yx(eN(t, t.length), 9), 0))), + (hQn = new _L("externalPortSide", (Ikn(), Hit))), + (fQn = new _L("externalPortSize", new Pk())), + (oQn = new Og("externalPortReplacedDummies")), + (sQn = new Og("externalPortReplacedDummy")), + (uQn = new _L("externalPortConnections", new cx((n = Yx(Ak(trt), 9)), Yx(eN(n, n.length), 9), 0))), + (KQn = new _L(OSn, 0)), + (VVn = new Og("barycenterAssociates")), + (JQn = new Og("TopSideComments")), + (QVn = new Og("BottomSideComments")), + (JVn = new Og("CommentConnectionPort")), + (dQn = new _L("inputCollect", !1)), + (xQn = new _L("outputCollect", !1)), + (iQn = new _L("cyclic", !1)), + (eQn = new Og("crossHierarchyMap")), + (YQn = new Og("targetOffset")), + new _L("splineLabelSize", new Pk()), + (zQn = new Og("spacings")), + (DQn = new _L("partitionConstraint", !1)), + (YVn = new Og("breakingPoint.info")), + (VQn = new Og("splines.survivingEdge")), + (WQn = new Og("splines.route.start")), + (UQn = new Og("splines.edgeChain")), + (NQn = new Og("originalPortConstraints")), + (GQn = new Og("selfLoopHolder")), + (XQn = new Og("splines.nsPortY")), + (IQn = new Og("modelOrder")), + (SQn = new Og("longEdgeTargetNode")), + (lQn = new _L(aCn, !1)), + (qQn = new _L(aCn, !1)), + (wQn = new Og("layerConstraints.hiddenNodes")), + (LQn = new Og("layerConstraints.opposidePort")), + (QQn = new Og("targetNode.modelOrder")); + } + function Ajn() { + (Ajn = O), + fZ(), + (FYn = new FI(uCn, (BYn = FWn))), + (rJn = new FI(oCn, (TA(), !1))), + dX(), + (sJn = new FI(sCn, (hJn = zVn))), + (IJn = new FI(hCn, !1)), + (CJn = new FI(fCn, !0)), + (aYn = new FI(lCn, !1)), + $J(), + (WJn = new FI(bCn, (VJn = J2n))), + d9(1), + (iZn = new FI(wCn, d9(7))), + (rZn = new FI(dCn, !1)), + (cJn = new FI(gCn, !1)), + min(), + (KYn = new FI(pCn, (_Yn = NWn))), + nun(), + (SJn = new FI(vCn, (PJn = d2n))), + d7(), + (gJn = new FI(mCn, (pJn = iYn))), + d9(-1), + (dJn = new FI(yCn, d9(-1))), + d9(-1), + (vJn = new FI(kCn, d9(-1))), + d9(-1), + (mJn = new FI(jCn, d9(4))), + d9(-1), + (kJn = new FI(ECn, d9(2))), + _bn(), + (TJn = new FI(TCn, (MJn = q2n))), + d9(0), + (EJn = new FI(MCn, d9(0))), + (bJn = new FI(SCn, d9(Yjn))), + O0(), + (DYn = new FI(PCn, (RYn = TWn))), + (kYn = new FI(ICn, !1)), + (OYn = new FI(CCn, 0.1)), + (NYn = new FI(OCn, !1)), + d9(-1), + ($Yn = new FI(ACn, d9(-1))), + d9(-1), + (LYn = new FI($Cn, d9(-1))), + d9(0), + (jYn = new FI(LCn, d9(40))), + r4(), + (PYn = new FI(NCn, (IYn = RVn))), + (EYn = new FI(xCn, (TYn = xVn))), + ain(), + (UJn = new FI(DCn, (XJn = O2n))), + (DJn = new Og(RCn)), + cJ(), + (OJn = new FI(KCn, (AJn = iVn))), + Wcn(), + (LJn = new FI(_Cn, (NJn = hVn))), + new tp(), + (_Jn = new FI(FCn, 0.3)), + (BJn = new Og(BCn)), + Hen(), + (HJn = new FI(HCn, (qJn = S2n))), + d3(), + (WYn = new FI(qCn, (VYn = o3n))), + rQ(), + (QYn = new FI(GCn, (YYn = b3n))), + $6(), + (JYn = new FI(zCn, (ZYn = v3n))), + (tJn = new FI(UCn, 0.2)), + (UYn = new FI(XCn, 2)), + (ZJn = new FI(WCn, null)), + (tZn = new FI(VCn, 10)), + (nZn = new FI(QCn, 10)), + (eZn = new FI(YCn, 20)), + d9(0), + (QJn = new FI(JCn, d9(0))), + d9(0), + (YJn = new FI(ZCn, d9(0))), + d9(0), + (JJn = new FI(nOn, d9(0))), + (uYn = new FI(tOn, !1)), + uon(), + (hYn = new FI(eOn, (fYn = mVn))), + aY(), + (oYn = new FI(iOn, (sYn = yWn))), + (uJn = new FI(rOn, !1)), + d9(0), + (aJn = new FI(cOn, d9(16))), + d9(0), + (oJn = new FI(aOn, d9(5))), + F4(), + (SZn = new FI(uOn, (PZn = P3n))), + (cZn = new FI(oOn, 10)), + (oZn = new FI(sOn, 1)), + f0(), + (gZn = new FI(hOn, (pZn = OWn))), + (fZn = new Og(fOn)), + (wZn = d9(1)), + d9(0), + (bZn = new FI(lOn, wZn)), + V2(), + (AZn = new FI(bOn, ($Zn = k3n))), + (IZn = new Og(wOn)), + (jZn = new FI(dOn, !0)), + (yZn = new FI(gOn, 2)), + (TZn = new FI(pOn, !0)), + pon(), + (GYn = new FI(vOn, (zYn = ZWn))), + psn(), + (HYn = new FI(mOn, (qYn = bWn))), + k5(), + (mYn = new FI(yOn, (yYn = W2n))), + (vYn = new FI(kOn, !1)), + e9(), + (lYn = new FI(jOn, (bYn = Izn))), + i8(), + (gYn = new FI(EOn, (pYn = m2n))), + (wYn = new FI(TOn, 0)), + (dYn = new FI(MOn, 0)), + (lJn = DWn), + (fJn = EWn), + (yJn = w2n), + (jJn = w2n), + (wJn = f2n), + O8(), + (AYn = $et), + (xYn = TWn), + (CYn = TWn), + (MYn = TWn), + (SYn = $et), + (RJn = L2n), + (KJn = O2n), + ($Jn = O2n), + (xJn = O2n), + (FJn = $2n), + (zJn = L2n), + (GJn = L2n), + g7(), + (nJn = bet), + (eJn = bet), + (iJn = v3n), + (XYn = fet), + (aZn = I3n), + (uZn = S3n), + (sZn = I3n), + (hZn = S3n), + (vZn = I3n), + (mZn = S3n), + (lZn = CWn), + (dZn = OWn), + (LZn = I3n), + (NZn = S3n), + (CZn = I3n), + (OZn = S3n), + (EZn = S3n), + (kZn = S3n), + (MZn = S3n); + } + function $jn() { + ($jn = O), + (vUn = new vM("DIRECTION_PREPROCESSOR", 0)), + (dUn = new vM("COMMENT_PREPROCESSOR", 1)), + (mUn = new vM("EDGE_AND_LAYER_CONSTRAINT_EDGE_REVERSER", 2)), + (xUn = new vM("INTERACTIVE_EXTERNAL_PORT_POSITIONER", 3)), + (nXn = new vM("PARTITION_PREPROCESSOR", 4)), + (_Un = new vM("LABEL_DUMMY_INSERTER", 5)), + (aXn = new vM("SELF_LOOP_PREPROCESSOR", 6)), + (GUn = new vM("LAYER_CONSTRAINT_PREPROCESSOR", 7)), + (JUn = new vM("PARTITION_MIDPROCESSOR", 8)), + (OUn = new vM("HIGH_DEGREE_NODE_LAYER_PROCESSOR", 9)), + (WUn = new vM("NODE_PROMOTION", 10)), + (qUn = new vM("LAYER_CONSTRAINT_POSTPROCESSOR", 11)), + (ZUn = new vM("PARTITION_POSTPROCESSOR", 12)), + (SUn = new vM("HIERARCHICAL_PORT_CONSTRAINT_PROCESSOR", 13)), + (oXn = new vM("SEMI_INTERACTIVE_CROSSMIN_PROCESSOR", 14)), + (sUn = new vM("BREAKING_POINT_INSERTER", 15)), + (XUn = new vM("LONG_EDGE_SPLITTER", 16)), + (eXn = new vM("PORT_SIDE_PROCESSOR", 17)), + (DUn = new vM("INVERTED_PORT_PROCESSOR", 18)), + (tXn = new vM("PORT_LIST_SORTER", 19)), + (hXn = new vM("SORT_BY_INPUT_ORDER_OF_MODEL", 20)), + (QUn = new vM("NORTH_SOUTH_PORT_PREPROCESSOR", 21)), + (hUn = new vM("BREAKING_POINT_PROCESSOR", 22)), + (YUn = new vM(KIn, 23)), + (fXn = new vM(_In, 24)), + (rXn = new vM("SELF_LOOP_PORT_RESTORER", 25)), + (sXn = new vM("SINGLE_EDGE_GRAPH_WRAPPER", 26)), + (RUn = new vM("IN_LAYER_CONSTRAINT_PROCESSOR", 27)), + (EUn = new vM("END_NODE_PORT_LABEL_MANAGEMENT_PROCESSOR", 28)), + (KUn = new vM("LABEL_AND_NODE_SIZE_PROCESSOR", 29)), + (NUn = new vM("INNERMOST_NODE_MARGIN_CALCULATOR", 30)), + (uXn = new vM("SELF_LOOP_ROUTER", 31)), + (bUn = new vM("COMMENT_NODE_MARGIN_CALCULATOR", 32)), + (kUn = new vM("END_LABEL_PREPROCESSOR", 33)), + (BUn = new vM("LABEL_DUMMY_SWITCHER", 34)), + (lUn = new vM("CENTER_LABEL_MANAGEMENT_PROCESSOR", 35)), + (HUn = new vM("LABEL_SIDE_SELECTOR", 36)), + ($Un = new vM("HYPEREDGE_DUMMY_MERGER", 37)), + (PUn = new vM("HIERARCHICAL_PORT_DUMMY_SIZE_PROCESSOR", 38)), + (zUn = new vM("LAYER_SIZE_AND_GRAPH_HEIGHT_CALCULATOR", 39)), + (CUn = new vM("HIERARCHICAL_PORT_POSITION_PROCESSOR", 40)), + (gUn = new vM("CONSTRAINTS_POSTPROCESSOR", 41)), + (wUn = new vM("COMMENT_POSTPROCESSOR", 42)), + (LUn = new vM("HYPERNODE_PROCESSOR", 43)), + (IUn = new vM("HIERARCHICAL_PORT_ORTHOGONAL_EDGE_ROUTER", 44)), + (UUn = new vM("LONG_EDGE_JOINER", 45)), + (cXn = new vM("SELF_LOOP_POSTPROCESSOR", 46)), + (fUn = new vM("BREAKING_POINT_REMOVER", 47)), + (VUn = new vM("NORTH_SOUTH_PORT_POSTPROCESSOR", 48)), + (AUn = new vM("HORIZONTAL_COMPACTOR", 49)), + (FUn = new vM("LABEL_DUMMY_REMOVER", 50)), + (TUn = new vM("FINAL_SPLINE_BENDPOINTS_CALCULATOR", 51)), + (jUn = new vM("END_LABEL_SORTER", 52)), + (iXn = new vM("REVERSED_EDGE_RESTORER", 53)), + (yUn = new vM("END_LABEL_POSTPROCESSOR", 54)), + (MUn = new vM("HIERARCHICAL_NODE_RESIZER", 55)), + (pUn = new vM("DIRECTION_POSTPROCESSOR", 56)); + } + function Ljn() { + (Ljn = O), + (Tot = new np(7)), + (Mot = new BR(8, 94)), + new BR(8, 64), + (Sot = new BR(8, 36)), + ($ot = new BR(8, 65)), + (Lot = new BR(8, 122)), + (Not = new BR(8, 90)), + (Rot = new BR(8, 98)), + (Oot = new BR(8, 66)), + (xot = new BR(8, 60)), + (Kot = new BR(8, 62)), + (Eot = new np(11)), + zwn((jot = new cU(4)), 48, 57), + zwn((Dot = new cU(4)), 48, 57), + zwn(Dot, 65, 90), + zwn(Dot, 95, 95), + zwn(Dot, 97, 122), + zwn((Aot = new cU(4)), 9, 9), + zwn(Aot, 10, 10), + zwn(Aot, 12, 12), + zwn(Aot, 13, 13), + zwn(Aot, 32, 32), + (Pot = nvn(jot)), + (Cot = nvn(Dot)), + (Iot = nvn(Aot)), + (vot = new rp()), + (mot = new rp()), + (yot = x4(Gy(fFn, 1), TEn, 2, 6, [ + "Cn", + "Lu", + "Ll", + "Lt", + "Lm", + "Lo", + "Mn", + "Me", + "Mc", + "Nd", + "Nl", + "No", + "Zs", + "Zl", + "Zp", + "Cc", + "Cf", + null, + "Co", + "Cs", + "Pd", + "Ps", + "Pe", + "Pc", + "Po", + "Sm", + "Sc", + "Sk", + "So", + "Pi", + "Pf", + "L", + "M", + "N", + "Z", + "C", + "P", + "S", + ])), + (pot = x4(Gy(fFn, 1), TEn, 2, 6, [ + "Basic Latin", + "Latin-1 Supplement", + "Latin Extended-A", + "Latin Extended-B", + "IPA Extensions", + "Spacing Modifier Letters", + "Combining Diacritical Marks", + "Greek", + "Cyrillic", + "Armenian", + "Hebrew", + "Arabic", + "Syriac", + "Thaana", + "Devanagari", + "Bengali", + "Gurmukhi", + "Gujarati", + "Oriya", + "Tamil", + "Telugu", + "Kannada", + "Malayalam", + "Sinhala", + "Thai", + "Lao", + "Tibetan", + "Myanmar", + "Georgian", + "Hangul Jamo", + "Ethiopic", + "Cherokee", + "Unified Canadian Aboriginal Syllabics", + "Ogham", + "Runic", + "Khmer", + "Mongolian", + "Latin Extended Additional", + "Greek Extended", + "General Punctuation", + "Superscripts and Subscripts", + "Currency Symbols", + "Combining Marks for Symbols", + "Letterlike Symbols", + "Number Forms", + "Arrows", + "Mathematical Operators", + "Miscellaneous Technical", + "Control Pictures", + "Optical Character Recognition", + "Enclosed Alphanumerics", + "Box Drawing", + "Block Elements", + "Geometric Shapes", + "Miscellaneous Symbols", + "Dingbats", + "Braille Patterns", + "CJK Radicals Supplement", + "Kangxi Radicals", + "Ideographic Description Characters", + "CJK Symbols and Punctuation", + "Hiragana", + "Katakana", + "Bopomofo", + "Hangul Compatibility Jamo", + "Kanbun", + "Bopomofo Extended", + "Enclosed CJK Letters and Months", + "CJK Compatibility", + "CJK Unified Ideographs Extension A", + "CJK Unified Ideographs", + "Yi Syllables", + "Yi Radicals", + "Hangul Syllables", + AKn, + "CJK Compatibility Ideographs", + "Alphabetic Presentation Forms", + "Arabic Presentation Forms-A", + "Combining Half Marks", + "CJK Compatibility Forms", + "Small Form Variants", + "Arabic Presentation Forms-B", + "Specials", + "Halfwidth and Fullwidth Forms", + "Old Italic", + "Gothic", + "Deseret", + "Byzantine Musical Symbols", + "Musical Symbols", + "Mathematical Alphanumeric Symbols", + "CJK Unified Ideographs Extension B", + "CJK Compatibility Ideographs Supplement", + "Tags", + ])), + (kot = x4( + Gy(Wot, 1), + MTn, + 25, + 15, + [ + 66304, 66351, 66352, 66383, 66560, 66639, 118784, 119039, 119040, 119295, 119808, 120831, 131072, 173782, 194560, 195103, + 917504, 917631, + ], + )); + } + function Njn() { + (Njn = O), + (BHn = new U2( + "OUT_T_L", + 0, + (BY(), fHn), + (OJ(), pHn), + (JZ(), rHn), + rHn, + x4(Gy(YKn, 1), iEn, 21, 0, [tK((Eln(), Wet), x4(Gy(cit, 1), XEn, 93, 0, [Yet, Get]))]), + )), + (FHn = new U2( + "OUT_T_C", + 1, + hHn, + pHn, + rHn, + cHn, + x4(Gy(YKn, 1), iEn, 21, 0, [ + tK(Wet, x4(Gy(cit, 1), XEn, 93, 0, [Yet, qet])), + tK(Wet, x4(Gy(cit, 1), XEn, 93, 0, [Yet, qet, zet])), + ]), + )), + (HHn = new U2("OUT_T_R", 2, lHn, pHn, rHn, aHn, x4(Gy(YKn, 1), iEn, 21, 0, [tK(Wet, x4(Gy(cit, 1), XEn, 93, 0, [Yet, Uet]))]))), + ($Hn = new U2("OUT_B_L", 3, fHn, mHn, aHn, rHn, x4(Gy(YKn, 1), iEn, 21, 0, [tK(Wet, x4(Gy(cit, 1), XEn, 93, 0, [Vet, Get]))]))), + (AHn = new U2( + "OUT_B_C", + 4, + hHn, + mHn, + aHn, + cHn, + x4(Gy(YKn, 1), iEn, 21, 0, [ + tK(Wet, x4(Gy(cit, 1), XEn, 93, 0, [Vet, qet])), + tK(Wet, x4(Gy(cit, 1), XEn, 93, 0, [Vet, qet, zet])), + ]), + )), + (LHn = new U2("OUT_B_R", 5, lHn, mHn, aHn, aHn, x4(Gy(YKn, 1), iEn, 21, 0, [tK(Wet, x4(Gy(cit, 1), XEn, 93, 0, [Vet, Uet]))]))), + (DHn = new U2( + "OUT_L_T", + 6, + lHn, + mHn, + rHn, + rHn, + x4(Gy(YKn, 1), iEn, 21, 0, [tK(Wet, x4(Gy(cit, 1), XEn, 93, 0, [Get, Yet, zet]))]), + )), + (xHn = new U2( + "OUT_L_C", + 7, + lHn, + vHn, + cHn, + rHn, + x4(Gy(YKn, 1), iEn, 21, 0, [ + tK(Wet, x4(Gy(cit, 1), XEn, 93, 0, [Get, Qet])), + tK(Wet, x4(Gy(cit, 1), XEn, 93, 0, [Get, Qet, zet])), + ]), + )), + (NHn = new U2( + "OUT_L_B", + 8, + lHn, + pHn, + aHn, + rHn, + x4(Gy(YKn, 1), iEn, 21, 0, [tK(Wet, x4(Gy(cit, 1), XEn, 93, 0, [Get, Vet, zet]))]), + )), + (_Hn = new U2( + "OUT_R_T", + 9, + fHn, + mHn, + rHn, + aHn, + x4(Gy(YKn, 1), iEn, 21, 0, [tK(Wet, x4(Gy(cit, 1), XEn, 93, 0, [Uet, Yet, zet]))]), + )), + (KHn = new U2( + "OUT_R_C", + 10, + fHn, + vHn, + cHn, + aHn, + x4(Gy(YKn, 1), iEn, 21, 0, [ + tK(Wet, x4(Gy(cit, 1), XEn, 93, 0, [Uet, Qet])), + tK(Wet, x4(Gy(cit, 1), XEn, 93, 0, [Uet, Qet, zet])), + ]), + )), + (RHn = new U2( + "OUT_R_B", + 11, + fHn, + pHn, + aHn, + aHn, + x4(Gy(YKn, 1), iEn, 21, 0, [tK(Wet, x4(Gy(cit, 1), XEn, 93, 0, [Uet, Vet, zet]))]), + )), + (CHn = new U2( + "IN_T_L", + 12, + fHn, + mHn, + rHn, + rHn, + x4(Gy(YKn, 1), iEn, 21, 0, [ + tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Yet, Get])), + tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Yet, Get, zet])), + ]), + )), + (IHn = new U2( + "IN_T_C", + 13, + hHn, + mHn, + rHn, + cHn, + x4(Gy(YKn, 1), iEn, 21, 0, [ + tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Yet, qet])), + tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Yet, qet, zet])), + ]), + )), + (OHn = new U2( + "IN_T_R", + 14, + lHn, + mHn, + rHn, + aHn, + x4(Gy(YKn, 1), iEn, 21, 0, [ + tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Yet, Uet])), + tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Yet, Uet, zet])), + ]), + )), + (SHn = new U2( + "IN_C_L", + 15, + fHn, + vHn, + cHn, + rHn, + x4(Gy(YKn, 1), iEn, 21, 0, [ + tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Qet, Get])), + tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Qet, Get, zet])), + ]), + )), + (MHn = new U2( + "IN_C_C", + 16, + hHn, + vHn, + cHn, + cHn, + x4(Gy(YKn, 1), iEn, 21, 0, [ + tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Qet, qet])), + tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Qet, qet, zet])), + ]), + )), + (PHn = new U2( + "IN_C_R", + 17, + lHn, + vHn, + cHn, + aHn, + x4(Gy(YKn, 1), iEn, 21, 0, [ + tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Qet, Uet])), + tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Qet, Uet, zet])), + ]), + )), + (EHn = new U2( + "IN_B_L", + 18, + fHn, + pHn, + aHn, + rHn, + x4(Gy(YKn, 1), iEn, 21, 0, [ + tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Vet, Get])), + tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Vet, Get, zet])), + ]), + )), + (jHn = new U2( + "IN_B_C", + 19, + hHn, + pHn, + aHn, + cHn, + x4(Gy(YKn, 1), iEn, 21, 0, [ + tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Vet, qet])), + tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Vet, qet, zet])), + ]), + )), + (THn = new U2( + "IN_B_R", + 20, + lHn, + pHn, + aHn, + aHn, + x4(Gy(YKn, 1), iEn, 21, 0, [ + tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Vet, Uet])), + tK(Xet, x4(Gy(cit, 1), XEn, 93, 0, [Vet, Uet, zet])), + ]), + )), + (qHn = new U2(MSn, 21, null, null, null, null, x4(Gy(YKn, 1), iEn, 21, 0, []))); + } + function xjn() { + (xjn = O), + (vat = (YF(), gat).b), + Yx(c1(aq(gat.b), 0), 34), + Yx(c1(aq(gat.b), 1), 18), + (pat = gat.a), + Yx(c1(aq(gat.a), 0), 34), + Yx(c1(aq(gat.a), 1), 18), + Yx(c1(aq(gat.a), 2), 18), + Yx(c1(aq(gat.a), 3), 18), + Yx(c1(aq(gat.a), 4), 18), + (mat = gat.o), + Yx(c1(aq(gat.o), 0), 34), + Yx(c1(aq(gat.o), 1), 34), + (kat = Yx(c1(aq(gat.o), 2), 18)), + Yx(c1(aq(gat.o), 3), 18), + Yx(c1(aq(gat.o), 4), 18), + Yx(c1(aq(gat.o), 5), 18), + Yx(c1(aq(gat.o), 6), 18), + Yx(c1(aq(gat.o), 7), 18), + Yx(c1(aq(gat.o), 8), 18), + Yx(c1(aq(gat.o), 9), 18), + Yx(c1(aq(gat.o), 10), 18), + Yx(c1(aq(gat.o), 11), 18), + Yx(c1(aq(gat.o), 12), 18), + Yx(c1(aq(gat.o), 13), 18), + Yx(c1(aq(gat.o), 14), 18), + Yx(c1(aq(gat.o), 15), 18), + Yx(c1(cq(gat.o), 0), 59), + Yx(c1(cq(gat.o), 1), 59), + Yx(c1(cq(gat.o), 2), 59), + Yx(c1(cq(gat.o), 3), 59), + Yx(c1(cq(gat.o), 4), 59), + Yx(c1(cq(gat.o), 5), 59), + Yx(c1(cq(gat.o), 6), 59), + Yx(c1(cq(gat.o), 7), 59), + Yx(c1(cq(gat.o), 8), 59), + Yx(c1(cq(gat.o), 9), 59), + (yat = gat.p), + Yx(c1(aq(gat.p), 0), 34), + Yx(c1(aq(gat.p), 1), 34), + Yx(c1(aq(gat.p), 2), 34), + Yx(c1(aq(gat.p), 3), 34), + Yx(c1(aq(gat.p), 4), 18), + Yx(c1(aq(gat.p), 5), 18), + Yx(c1(cq(gat.p), 0), 59), + Yx(c1(cq(gat.p), 1), 59), + (jat = gat.q), + Yx(c1(aq(gat.q), 0), 34), + (Eat = gat.v), + Yx(c1(aq(gat.v), 0), 18), + Yx(c1(cq(gat.v), 0), 59), + Yx(c1(cq(gat.v), 1), 59), + Yx(c1(cq(gat.v), 2), 59), + (Tat = gat.w), + Yx(c1(aq(gat.w), 0), 34), + Yx(c1(aq(gat.w), 1), 34), + Yx(c1(aq(gat.w), 2), 34), + Yx(c1(aq(gat.w), 3), 18), + (Mat = gat.B), + Yx(c1(aq(gat.B), 0), 18), + Yx(c1(cq(gat.B), 0), 59), + Yx(c1(cq(gat.B), 1), 59), + Yx(c1(cq(gat.B), 2), 59), + (Iat = gat.Q), + Yx(c1(aq(gat.Q), 0), 18), + Yx(c1(cq(gat.Q), 0), 59), + (Cat = gat.R), + Yx(c1(aq(gat.R), 0), 34), + (Oat = gat.S), + Yx(c1(cq(gat.S), 0), 59), + Yx(c1(cq(gat.S), 1), 59), + Yx(c1(cq(gat.S), 2), 59), + Yx(c1(cq(gat.S), 3), 59), + Yx(c1(cq(gat.S), 4), 59), + Yx(c1(cq(gat.S), 5), 59), + Yx(c1(cq(gat.S), 6), 59), + Yx(c1(cq(gat.S), 7), 59), + Yx(c1(cq(gat.S), 8), 59), + Yx(c1(cq(gat.S), 9), 59), + Yx(c1(cq(gat.S), 10), 59), + Yx(c1(cq(gat.S), 11), 59), + Yx(c1(cq(gat.S), 12), 59), + Yx(c1(cq(gat.S), 13), 59), + Yx(c1(cq(gat.S), 14), 59), + (Aat = gat.T), + Yx(c1(aq(gat.T), 0), 18), + Yx(c1(aq(gat.T), 2), 18), + ($at = Yx(c1(aq(gat.T), 3), 18)), + Yx(c1(aq(gat.T), 4), 18), + Yx(c1(cq(gat.T), 0), 59), + Yx(c1(cq(gat.T), 1), 59), + Yx(c1(aq(gat.T), 1), 18), + (Lat = gat.U), + Yx(c1(aq(gat.U), 0), 34), + Yx(c1(aq(gat.U), 1), 34), + Yx(c1(aq(gat.U), 2), 18), + Yx(c1(aq(gat.U), 3), 18), + Yx(c1(aq(gat.U), 4), 18), + Yx(c1(aq(gat.U), 5), 18), + Yx(c1(cq(gat.U), 0), 59), + (Nat = gat.V), + Yx(c1(aq(gat.V), 0), 18), + (xat = gat.W), + Yx(c1(aq(gat.W), 0), 34), + Yx(c1(aq(gat.W), 1), 34), + Yx(c1(aq(gat.W), 2), 34), + Yx(c1(aq(gat.W), 3), 18), + Yx(c1(aq(gat.W), 4), 18), + Yx(c1(aq(gat.W), 5), 18), + (Rat = gat.bb), + Yx(c1(aq(gat.bb), 0), 34), + Yx(c1(aq(gat.bb), 1), 34), + Yx(c1(aq(gat.bb), 2), 34), + Yx(c1(aq(gat.bb), 3), 34), + Yx(c1(aq(gat.bb), 4), 34), + Yx(c1(aq(gat.bb), 5), 34), + Yx(c1(aq(gat.bb), 6), 34), + Yx(c1(aq(gat.bb), 7), 18), + Yx(c1(cq(gat.bb), 0), 59), + Yx(c1(cq(gat.bb), 1), 59), + (Kat = gat.eb), + Yx(c1(aq(gat.eb), 0), 34), + Yx(c1(aq(gat.eb), 1), 34), + Yx(c1(aq(gat.eb), 2), 34), + Yx(c1(aq(gat.eb), 3), 34), + Yx(c1(aq(gat.eb), 4), 34), + Yx(c1(aq(gat.eb), 5), 34), + Yx(c1(aq(gat.eb), 6), 18), + Yx(c1(aq(gat.eb), 7), 18), + (Dat = gat.ab), + Yx(c1(aq(gat.ab), 0), 34), + Yx(c1(aq(gat.ab), 1), 34), + (Sat = gat.H), + Yx(c1(aq(gat.H), 0), 18), + Yx(c1(aq(gat.H), 1), 18), + Yx(c1(aq(gat.H), 2), 18), + Yx(c1(aq(gat.H), 3), 18), + Yx(c1(aq(gat.H), 4), 18), + Yx(c1(aq(gat.H), 5), 18), + Yx(c1(cq(gat.H), 0), 59), + (_at = gat.db), + Yx(c1(aq(gat.db), 0), 18), + (Pat = gat.M); + } + function Djn(n) { + uT( + n, + new tun( + ck( + tk( + rk( + nk( + ik(ek(new du(), CIn), "ELK Layered"), + "Layer-based algorithm provided by the Eclipse Layout Kernel. Arranges as many edges as possible into one direction by placing nodes into subsequent layers. This implementation supports different routing styles (straight, orthogonal, splines); if orthogonal routing is selected, arbitrary port constraints are respected, thus enabling the layout of block diagrams such as actor-oriented models or circuit schematics. Furthermore, full layout of compound graphs with cross-hierarchy edges is supported when the respective option is activated on the top level.", + ), + new Ic(), + ), + CIn, + ), + tK((zfn(), vct), x4(Gy(kct, 1), XEn, 237, 0, [dct, gct, wct, pct, lct, fct])), + ), + ), + ), + DU(n, CIn, WOn, oen(A0n)), + DU(n, CIn, VOn, oen($0n)), + DU(n, CIn, oPn, oen(L0n)), + DU(n, CIn, QOn, oen(N0n)), + DU(n, CIn, NPn, oen(D0n)), + DU(n, CIn, YOn, oen(R0n)), + DU(n, CIn, JOn, oen(F0n)), + DU(n, CIn, ZOn, oen(H0n)), + DU(n, CIn, nAn, oen(q0n)), + DU(n, CIn, tAn, oen(B0n)), + DU(n, CIn, LPn, oen(G0n)), + DU(n, CIn, eAn, oen(U0n)), + DU(n, CIn, iAn, oen(W0n)), + DU(n, CIn, rAn, oen(_0n)), + DU(n, CIn, WCn, oen(O0n)), + DU(n, CIn, QCn, oen(x0n)), + DU(n, CIn, VCn, oen(K0n)), + DU(n, CIn, YCn, oen(z0n)), + DU(n, CIn, $Pn, d9(0)), + DU(n, CIn, JCn, oen(M0n)), + DU(n, CIn, ZCn, oen(S0n)), + DU(n, CIn, nOn, oen(P0n)), + DU(n, CIn, uOn, oen(c2n)), + DU(n, CIn, oOn, oen(Y0n)), + DU(n, CIn, sOn, oen(J0n)), + DU(n, CIn, hOn, oen(t2n)), + DU(n, CIn, fOn, oen(Z0n)), + DU(n, CIn, lOn, oen(n2n)), + DU(n, CIn, bOn, oen(u2n)), + DU(n, CIn, wOn, oen(a2n)), + DU(n, CIn, dOn, oen(i2n)), + DU(n, CIn, gOn, oen(e2n)), + DU(n, CIn, pOn, oen(r2n)), + DU(n, CIn, BCn, oen(Y1n)), + DU(n, CIn, HCn, oen(J1n)), + DU(n, CIn, zCn, oen(v1n)), + DU(n, CIn, UCn, oen(m1n)), + DU(n, CIn, fPn, a0n), + DU(n, CIn, xOn, w1n), + DU(n, CIn, cAn, 0), + DU(n, CIn, xPn, d9(1)), + DU(n, CIn, hPn, OPn), + DU(n, CIn, aAn, oen(r0n)), + DU(n, CIn, KPn, oen(g0n)), + DU(n, CIn, uAn, oen(k0n)), + DU(n, CIn, oAn, oen(c1n)), + DU(n, CIn, sAn, oen(xZn)), + DU(n, CIn, OOn, oen(E1n)), + DU(n, CIn, DPn, (TA(), !0)), + DU(n, CIn, hAn, oen(I1n)), + DU(n, CIn, fAn, oen(C1n)), + DU(n, CIn, HPn, oen(n0n)), + DU(n, CIn, BPn, oen(i0n)), + DU(n, CIn, lAn, oen(t0n)), + DU(n, CIn, bAn, o1n), + DU(n, CIn, qPn, oen(U1n)), + DU(n, CIn, wAn, oen(z1n)), + DU(n, CIn, GPn, oen(m0n)), + DU(n, CIn, dAn, oen(v0n)), + DU(n, CIn, gAn, oen(y0n)), + DU(n, CIn, pAn, s0n), + DU(n, CIn, vAn, oen(f0n)), + DU(n, CIn, mAn, oen(l0n)), + DU(n, CIn, yAn, oen(b0n)), + DU(n, CIn, kAn, oen(h0n)), + DU(n, CIn, dCn, oen(Q0n)), + DU(n, CIn, vCn, oen(B1n)), + DU(n, CIn, TCn, oen(F1n)), + DU(n, CIn, wCn, oen(V0n)), + DU(n, CIn, mCn, oen(x1n)), + DU(n, CIn, pCn, oen(r1n)), + DU(n, CIn, PCn, oen(i1n)), + DU(n, CIn, ICn, oen(VZn)), + DU(n, CIn, LCn, oen(QZn)), + DU(n, CIn, NCn, oen(JZn)), + DU(n, CIn, xCn, oen(YZn)), + DU(n, CIn, OCn, oen(e1n)), + DU(n, CIn, hCn, oen(q1n)), + DU(n, CIn, fCn, oen(G1n)), + DU(n, CIn, sCn, oen(A1n)), + DU(n, CIn, DCn, oen(Z1n)), + DU(n, CIn, _Cn, oen(W1n)), + DU(n, CIn, oCn, oen(k1n)), + DU(n, CIn, FCn, oen(Q1n)), + DU(n, CIn, qCn, oen(g1n)), + DU(n, CIn, GCn, oen(p1n)), + DU(n, CIn, jAn, oen(WZn)), + DU(n, CIn, KCn, oen(X1n)), + DU(n, CIn, eOn, oen(BZn)), + DU(n, CIn, iOn, oen(FZn)), + DU(n, CIn, tOn, oen(_Zn)), + DU(n, CIn, rOn, oen(M1n)), + DU(n, CIn, cOn, oen(T1n)), + DU(n, CIn, aOn, oen(S1n)), + DU(n, CIn, eIn, oen(e0n)), + DU(n, CIn, EAn, oen($1n)), + DU(n, CIn, sPn, oen(y1n)), + DU(n, CIn, TAn, oen(f1n)), + DU(n, CIn, _Pn, oen(h1n)), + DU(n, CIn, CCn, oen(ZZn)), + DU(n, CIn, MAn, oen(p0n)), + DU(n, CIn, SAn, oen(KZn)), + DU(n, CIn, PAn, oen(P1n)), + DU(n, CIn, IAn, oen(w0n)), + DU(n, CIn, CAn, oen(u0n)), + DU(n, CIn, OAn, oen(o0n)), + DU(n, CIn, jCn, oen(R1n)), + DU(n, CIn, ECn, oen(K1n)), + DU(n, CIn, AAn, oen(E0n)), + DU(n, CIn, lCn, oen(DZn)), + DU(n, CIn, MCn, oen(_1n)), + DU(n, CIn, vOn, oen(l1n)), + DU(n, CIn, mOn, oen(s1n)), + DU(n, CIn, $An, oen(H1n)), + DU(n, CIn, SCn, oen(L1n)), + DU(n, CIn, RCn, oen(V1n)), + DU(n, CIn, LAn, oen(X0n)), + DU(n, CIn, uCn, oen(u1n)), + DU(n, CIn, bCn, oen(j0n)), + DU(n, CIn, XCn, oen(d1n)), + DU(n, CIn, yCn, oen(N1n)), + DU(n, CIn, ACn, oen(n1n)), + DU(n, CIn, NAn, oen(O1n)), + DU(n, CIn, kCn, oen(D1n)), + DU(n, CIn, $Cn, oen(t1n)), + DU(n, CIn, yOn, oen(XZn)), + DU(n, CIn, EOn, oen(zZn)), + DU(n, CIn, TOn, oen(qZn)), + DU(n, CIn, MOn, oen(GZn)), + DU(n, CIn, kOn, oen(UZn)), + DU(n, CIn, jOn, oen(HZn)), + DU(n, CIn, gCn, oen(j1n)); + } + function Rjn(n, t) { + var e; + return ( + dot || + ((dot = new rp()), + (got = new rp()), + Ljn(), + Ljn(), + $nn((e = new cU(4)), "\t\n\r\r "), + GG(dot, SKn, e), + GG(got, SKn, nvn(e)), + $nn((e = new cU(4)), CKn), + GG(dot, TKn, e), + GG(got, TKn, nvn(e)), + $nn((e = new cU(4)), CKn), + GG(dot, TKn, e), + GG(got, TKn, nvn(e)), + $nn((e = new cU(4)), OKn), + fmn(e, Yx(aG(dot, TKn), 117)), + GG(dot, MKn, e), + GG(got, MKn, nvn(e)), + $nn( + (e = new cU(4)), + "-.0:AZ__az··ÀÖØöøıĴľŁňŊžƀǃǍǰǴǵǺȗɐʨʻˁːˑ̀͠͡ͅΆΊΌΌΎΡΣώϐϖϚϚϜϜϞϞϠϠϢϳЁЌЎяёќўҁ҃҆ҐӄӇӈӋӌӐӫӮӵӸӹԱՖՙՙաֆֹֻֽֿֿׁׂ֑֣֡ׄׄאתװײءغـْ٠٩ٰڷںھۀێېۓە۪ۭۨ۰۹ँःअह़्॑॔क़ॣ०९ঁঃঅঌএঐওনপরললশহ়়াৄেৈো্ৗৗড়ঢ়য়ৣ০ৱਂਂਅਊਏਐਓਨਪਰਲਲ਼ਵਸ਼ਸਹ਼਼ਾੂੇੈੋ੍ਖ਼ੜਫ਼ਫ਼੦ੴઁઃઅઋઍઍએઑઓનપરલળવહ઼ૅેૉો્ૠૠ૦૯ଁଃଅଌଏଐଓନପରଲଳଶହ଼ୃେୈୋ୍ୖୗଡ଼ଢ଼ୟୡ୦୯ஂஃஅஊஎஐஒகஙசஜஜஞடணதநபமவஷஹாூெைொ்ௗௗ௧௯ఁఃఅఌఎఐఒనపళవహాౄెైొ్ౕౖౠౡ౦౯ಂಃಅಌಎಐಒನಪಳವಹಾೄೆೈೊ್ೕೖೞೞೠೡ೦೯ംഃഅഌഎഐഒനപഹാൃെൈൊ്ൗൗൠൡ൦൯กฮะฺเ๎๐๙ກຂຄຄງຈຊຊຍຍດທນຟມຣລລວວສຫອຮະູົຽເໄໆໆ່ໍ໐໙༘༙༠༩༹༹༵༵༷༷༾ཇཉཀྵ྄ཱ྆ྋྐྕྗྗྙྭྱྷྐྵྐྵႠჅაჶᄀᄀᄂᄃᄅᄇᄉᄉᄋᄌᄎᄒᄼᄼᄾᄾᅀᅀᅌᅌᅎᅎᅐᅐᅔᅕᅙᅙᅟᅡᅣᅣᅥᅥᅧᅧᅩᅩᅭᅮᅲᅳᅵᅵᆞᆞᆨᆨᆫᆫᆮᆯᆷᆸᆺᆺᆼᇂᇫᇫᇰᇰᇹᇹḀẛẠỹἀἕἘἝἠὅὈὍὐὗὙὙὛὛὝὝὟώᾀᾴᾶᾼιιῂῄῆῌῐΐῖΊῠῬῲῴῶῼ⃐⃜⃡⃡ΩΩKÅ℮℮ↀↂ々々〇〇〡〯〱〵ぁゔ゙゚ゝゞァヺーヾㄅㄬ一龥가힣", + ), + GG(dot, PKn, e), + GG(got, PKn, nvn(e)), + $nn((e = new cU(4)), OKn), + zwn(e, 95, 95), + zwn(e, 58, 58), + GG(dot, IKn, e), + GG(got, IKn, nvn(e))), + Yx(aG(t ? dot : got, n), 136) + ); + } + function Kjn(n) { + return _N("_UI_EMFDiagnostic_marker", n) + ? "EMF Problem" + : _N("_UI_CircularContainment_diagnostic", n) + ? "An object may not circularly contain itself" + : _N(Cxn, n) + ? "Wrong character." + : _N(Oxn, n) + ? "Invalid reference number." + : _N(Axn, n) + ? "A character is required after \\." + : _N($xn, n) + ? "'?' is not expected. '(?:' or '(?=' or '(?!' or '(?<' or '(?#' or '(?>'?" + : _N(Lxn, n) + ? "'(?<' or '(? toIndex: ", + DMn = ", toIndex: ", + RMn = "Index: ", + KMn = ", Size: ", + _Mn = "org.eclipse.elk.alg.common", + FMn = { 62: 1 }, + BMn = "org.eclipse.elk.alg.common.compaction", + HMn = "Scanline/EventHandler", + qMn = "org.eclipse.elk.alg.common.compaction.oned", + GMn = "CNode belongs to another CGroup.", + zMn = "ISpacingsHandler/1", + UMn = "The ", + XMn = " instance has been finished already.", + WMn = "The direction ", + VMn = " is not supported by the CGraph instance.", + QMn = "OneDimensionalCompactor", + YMn = "OneDimensionalCompactor/lambda$0$Type", + JMn = "Quadruplet", + ZMn = "ScanlineConstraintCalculator", + nSn = "ScanlineConstraintCalculator/ConstraintsScanlineHandler", + tSn = "ScanlineConstraintCalculator/ConstraintsScanlineHandler/lambda$0$Type", + eSn = "ScanlineConstraintCalculator/Timestamp", + iSn = "ScanlineConstraintCalculator/lambda$0$Type", + rSn = { 169: 1, 45: 1 }, + cSn = "org.eclipse.elk.alg.common.compaction.options", + aSn = "org.eclipse.elk.core.data", + uSn = "org.eclipse.elk.polyomino.traversalStrategy", + oSn = "org.eclipse.elk.polyomino.lowLevelSort", + sSn = "org.eclipse.elk.polyomino.highLevelSort", + hSn = "org.eclipse.elk.polyomino.fill", + fSn = { 130: 1 }, + lSn = "polyomino", + bSn = "org.eclipse.elk.alg.common.networksimplex", + wSn = { 177: 1, 3: 1, 4: 1 }, + dSn = "org.eclipse.elk.alg.common.nodespacing", + gSn = "org.eclipse.elk.alg.common.nodespacing.cellsystem", + pSn = "CENTER", + vSn = { 212: 1, 326: 1 }, + mSn = { 3: 1, 4: 1, 5: 1, 595: 1 }, + ySn = "LEFT", + kSn = "RIGHT", + jSn = "Vertical alignment cannot be null", + ESn = "BOTTOM", + TSn = "org.eclipse.elk.alg.common.nodespacing.internal", + MSn = "UNDEFINED", + SSn = 0.01, + PSn = "org.eclipse.elk.alg.common.nodespacing.internal.algorithm", + ISn = "LabelPlacer/lambda$0$Type", + CSn = "LabelPlacer/lambda$1$Type", + OSn = "portRatioOrPosition", + ASn = "org.eclipse.elk.alg.common.overlaps", + $Sn = "DOWN", + LSn = "org.eclipse.elk.alg.common.polyomino", + NSn = "NORTH", + xSn = "EAST", + DSn = "SOUTH", + RSn = "WEST", + KSn = "org.eclipse.elk.alg.common.polyomino.structures", + _Sn = "Direction", + FSn = "Grid is only of size ", + BSn = ". Requested point (", + HSn = ") is out of bounds.", + qSn = " Given center based coordinates were (", + GSn = "org.eclipse.elk.graph.properties", + zSn = "IPropertyHolder", + USn = { 3: 1, 94: 1, 134: 1 }, + XSn = "org.eclipse.elk.alg.common.spore", + WSn = "org.eclipse.elk.alg.common.utils", + VSn = { 209: 1 }, + QSn = "org.eclipse.elk.core", + YSn = "Connected Components Compaction", + JSn = "org.eclipse.elk.alg.disco", + ZSn = "org.eclipse.elk.alg.disco.graph", + nPn = "org.eclipse.elk.alg.disco.options", + tPn = "CompactionStrategy", + ePn = "org.eclipse.elk.disco.componentCompaction.strategy", + iPn = "org.eclipse.elk.disco.componentCompaction.componentLayoutAlgorithm", + rPn = "org.eclipse.elk.disco.debug.discoGraph", + cPn = "org.eclipse.elk.disco.debug.discoPolys", + aPn = "componentCompaction", + uPn = "org.eclipse.elk.disco", + oPn = "org.eclipse.elk.spacing.componentComponent", + sPn = "org.eclipse.elk.edge.thickness", + hPn = "org.eclipse.elk.aspectRatio", + fPn = "org.eclipse.elk.padding", + lPn = "org.eclipse.elk.alg.disco.transform", + bPn = 1.5707963267948966, + wPn = 17976931348623157e292, + dPn = { 3: 1, 4: 1, 5: 1, 192: 1 }, + gPn = { 3: 1, 6: 1, 4: 1, 5: 1, 106: 1, 120: 1 }, + pPn = "org.eclipse.elk.alg.force", + vPn = "ComponentsProcessor", + mPn = "ComponentsProcessor/1", + yPn = "org.eclipse.elk.alg.force.graph", + kPn = "Component Layout", + jPn = "org.eclipse.elk.alg.force.model", + EPn = "org.eclipse.elk.force.model", + TPn = "org.eclipse.elk.force.iterations", + MPn = "org.eclipse.elk.force.repulsivePower", + SPn = "org.eclipse.elk.force.temperature", + PPn = 0.001, + IPn = "org.eclipse.elk.force.repulsion", + CPn = "org.eclipse.elk.alg.force.options", + OPn = 1.600000023841858, + APn = "org.eclipse.elk.force", + $Pn = "org.eclipse.elk.priority", + LPn = "org.eclipse.elk.spacing.nodeNode", + NPn = "org.eclipse.elk.spacing.edgeLabel", + xPn = "org.eclipse.elk.randomSeed", + DPn = "org.eclipse.elk.separateConnectedComponents", + RPn = "org.eclipse.elk.interactive", + KPn = "org.eclipse.elk.portConstraints", + _Pn = "org.eclipse.elk.edgeLabels.inline", + FPn = "org.eclipse.elk.omitNodeMicroLayout", + BPn = "org.eclipse.elk.nodeSize.options", + HPn = "org.eclipse.elk.nodeSize.constraints", + qPn = "org.eclipse.elk.nodeLabels.placement", + GPn = "org.eclipse.elk.portLabels.placement", + zPn = "origin", + UPn = "random", + XPn = "boundingBox.upLeft", + WPn = "boundingBox.lowRight", + VPn = "org.eclipse.elk.stress.fixed", + QPn = "org.eclipse.elk.stress.desiredEdgeLength", + YPn = "org.eclipse.elk.stress.dimension", + JPn = "org.eclipse.elk.stress.epsilon", + ZPn = "org.eclipse.elk.stress.iterationLimit", + nIn = "org.eclipse.elk.stress", + tIn = "ELK Stress", + eIn = "org.eclipse.elk.nodeSize.minimum", + iIn = "org.eclipse.elk.alg.force.stress", + rIn = "Layered layout", + cIn = "org.eclipse.elk.alg.layered", + aIn = "org.eclipse.elk.alg.layered.compaction.components", + uIn = "org.eclipse.elk.alg.layered.compaction.oned", + oIn = "org.eclipse.elk.alg.layered.compaction.oned.algs", + sIn = "org.eclipse.elk.alg.layered.compaction.recthull", + hIn = "org.eclipse.elk.alg.layered.components", + fIn = "NONE", + lIn = { 3: 1, 6: 1, 4: 1, 9: 1, 5: 1, 122: 1 }, + bIn = { 3: 1, 6: 1, 4: 1, 5: 1, 141: 1, 106: 1, 120: 1 }, + wIn = "org.eclipse.elk.alg.layered.compound", + dIn = { 51: 1 }, + gIn = "org.eclipse.elk.alg.layered.graph", + pIn = " -> ", + vIn = "Not supported by LGraph", + mIn = "Port side is undefined", + yIn = { 3: 1, 6: 1, 4: 1, 5: 1, 474: 1, 141: 1, 106: 1, 120: 1 }, + kIn = { 3: 1, 6: 1, 4: 1, 5: 1, 141: 1, 193: 1, 203: 1, 106: 1, 120: 1 }, + jIn = { 3: 1, 6: 1, 4: 1, 5: 1, 141: 1, 1943: 1, 203: 1, 106: 1, 120: 1 }, + EIn = "([{\"' \t\r\n", + TIn = ")]}\"' \t\r\n", + MIn = "The given string contains parts that cannot be parsed as numbers.", + SIn = "org.eclipse.elk.core.math", + PIn = { 3: 1, 4: 1, 142: 1, 207: 1, 414: 1 }, + IIn = { 3: 1, 4: 1, 116: 1, 207: 1, 414: 1 }, + CIn = "org.eclipse.elk.layered", + OIn = "org.eclipse.elk.alg.layered.graph.transform", + AIn = "ElkGraphImporter", + $In = "ElkGraphImporter/lambda$0$Type", + LIn = "ElkGraphImporter/lambda$1$Type", + NIn = "ElkGraphImporter/lambda$2$Type", + xIn = "ElkGraphImporter/lambda$4$Type", + DIn = "Node margin calculation", + RIn = "org.eclipse.elk.alg.layered.intermediate", + KIn = "ONE_SIDED_GREEDY_SWITCH", + _In = "TWO_SIDED_GREEDY_SWITCH", + FIn = "No implementation is available for the layout processor ", + BIn = "IntermediateProcessorStrategy", + HIn = "Node '", + qIn = "FIRST_SEPARATE", + GIn = "LAST_SEPARATE", + zIn = "Odd port side processing", + UIn = "org.eclipse.elk.alg.layered.intermediate.compaction", + XIn = "org.eclipse.elk.alg.layered.intermediate.greedyswitch", + WIn = "org.eclipse.elk.alg.layered.p3order.counting", + VIn = { 225: 1 }, + QIn = "org.eclipse.elk.alg.layered.intermediate.loops", + YIn = "org.eclipse.elk.alg.layered.intermediate.loops.ordering", + JIn = "org.eclipse.elk.alg.layered.intermediate.loops.routing", + ZIn = "org.eclipse.elk.alg.layered.intermediate.preserveorder", + nCn = "org.eclipse.elk.alg.layered.intermediate.wrapping", + tCn = "org.eclipse.elk.alg.layered.options", + eCn = "INTERACTIVE", + iCn = "DEPTH_FIRST", + rCn = "EDGE_LENGTH", + cCn = "SELF_LOOPS", + aCn = "firstTryWithInitialOrder", + uCn = "org.eclipse.elk.layered.directionCongruency", + oCn = "org.eclipse.elk.layered.feedbackEdges", + sCn = "org.eclipse.elk.layered.interactiveReferencePoint", + hCn = "org.eclipse.elk.layered.mergeEdges", + fCn = "org.eclipse.elk.layered.mergeHierarchyEdges", + lCn = "org.eclipse.elk.layered.allowNonFlowPortsToSwitchSides", + bCn = "org.eclipse.elk.layered.portSortingStrategy", + wCn = "org.eclipse.elk.layered.thoroughness", + dCn = "org.eclipse.elk.layered.unnecessaryBendpoints", + gCn = "org.eclipse.elk.layered.generatePositionAndLayerIds", + pCn = "org.eclipse.elk.layered.cycleBreaking.strategy", + vCn = "org.eclipse.elk.layered.layering.strategy", + mCn = "org.eclipse.elk.layered.layering.layerConstraint", + yCn = "org.eclipse.elk.layered.layering.layerChoiceConstraint", + kCn = "org.eclipse.elk.layered.layering.layerId", + jCn = "org.eclipse.elk.layered.layering.minWidth.upperBoundOnWidth", + ECn = "org.eclipse.elk.layered.layering.minWidth.upperLayerEstimationScalingFactor", + TCn = "org.eclipse.elk.layered.layering.nodePromotion.strategy", + MCn = "org.eclipse.elk.layered.layering.nodePromotion.maxIterations", + SCn = "org.eclipse.elk.layered.layering.coffmanGraham.layerBound", + PCn = "org.eclipse.elk.layered.crossingMinimization.strategy", + ICn = "org.eclipse.elk.layered.crossingMinimization.forceNodeModelOrder", + CCn = "org.eclipse.elk.layered.crossingMinimization.hierarchicalSweepiness", + OCn = "org.eclipse.elk.layered.crossingMinimization.semiInteractive", + ACn = "org.eclipse.elk.layered.crossingMinimization.positionChoiceConstraint", + $Cn = "org.eclipse.elk.layered.crossingMinimization.positionId", + LCn = "org.eclipse.elk.layered.crossingMinimization.greedySwitch.activationThreshold", + NCn = "org.eclipse.elk.layered.crossingMinimization.greedySwitch.type", + xCn = "org.eclipse.elk.layered.crossingMinimization.greedySwitchHierarchical.type", + DCn = "org.eclipse.elk.layered.nodePlacement.strategy", + RCn = "org.eclipse.elk.layered.nodePlacement.favorStraightEdges", + KCn = "org.eclipse.elk.layered.nodePlacement.bk.edgeStraightening", + _Cn = "org.eclipse.elk.layered.nodePlacement.bk.fixedAlignment", + FCn = "org.eclipse.elk.layered.nodePlacement.linearSegments.deflectionDampening", + BCn = "org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility", + HCn = "org.eclipse.elk.layered.nodePlacement.networkSimplex.nodeFlexibility.default", + qCn = "org.eclipse.elk.layered.edgeRouting.selfLoopDistribution", + GCn = "org.eclipse.elk.layered.edgeRouting.selfLoopOrdering", + zCn = "org.eclipse.elk.layered.edgeRouting.splines.mode", + UCn = "org.eclipse.elk.layered.edgeRouting.splines.sloppy.layerSpacingFactor", + XCn = "org.eclipse.elk.layered.edgeRouting.polyline.slopedEdgeZoneWidth", + WCn = "org.eclipse.elk.layered.spacing.baseValue", + VCn = "org.eclipse.elk.layered.spacing.edgeNodeBetweenLayers", + QCn = "org.eclipse.elk.layered.spacing.edgeEdgeBetweenLayers", + YCn = "org.eclipse.elk.layered.spacing.nodeNodeBetweenLayers", + JCn = "org.eclipse.elk.layered.priority.direction", + ZCn = "org.eclipse.elk.layered.priority.shortness", + nOn = "org.eclipse.elk.layered.priority.straightness", + tOn = "org.eclipse.elk.layered.compaction.connectedComponents", + eOn = "org.eclipse.elk.layered.compaction.postCompaction.strategy", + iOn = "org.eclipse.elk.layered.compaction.postCompaction.constraints", + rOn = "org.eclipse.elk.layered.highDegreeNodes.treatment", + cOn = "org.eclipse.elk.layered.highDegreeNodes.threshold", + aOn = "org.eclipse.elk.layered.highDegreeNodes.treeHeight", + uOn = "org.eclipse.elk.layered.wrapping.strategy", + oOn = "org.eclipse.elk.layered.wrapping.additionalEdgeSpacing", + sOn = "org.eclipse.elk.layered.wrapping.correctionFactor", + hOn = "org.eclipse.elk.layered.wrapping.cutting.strategy", + fOn = "org.eclipse.elk.layered.wrapping.cutting.cuts", + lOn = "org.eclipse.elk.layered.wrapping.cutting.msd.freedom", + bOn = "org.eclipse.elk.layered.wrapping.validify.strategy", + wOn = "org.eclipse.elk.layered.wrapping.validify.forbiddenIndices", + dOn = "org.eclipse.elk.layered.wrapping.multiEdge.improveCuts", + gOn = "org.eclipse.elk.layered.wrapping.multiEdge.distancePenalty", + pOn = "org.eclipse.elk.layered.wrapping.multiEdge.improveWrappedEdges", + vOn = "org.eclipse.elk.layered.edgeLabels.sideSelection", + mOn = "org.eclipse.elk.layered.edgeLabels.centerLabelPlacementStrategy", + yOn = "org.eclipse.elk.layered.considerModelOrder.strategy", + kOn = "org.eclipse.elk.layered.considerModelOrder.noModelOrder", + jOn = "org.eclipse.elk.layered.considerModelOrder.components", + EOn = "org.eclipse.elk.layered.considerModelOrder.longEdgeStrategy", + TOn = "org.eclipse.elk.layered.considerModelOrder.crossingCounterNodeInfluence", + MOn = "org.eclipse.elk.layered.considerModelOrder.crossingCounterPortInfluence", + SOn = "layering", + POn = "layering.minWidth", + IOn = "layering.nodePromotion", + COn = "crossingMinimization", + OOn = "org.eclipse.elk.hierarchyHandling", + AOn = "crossingMinimization.greedySwitch", + $On = "nodePlacement", + LOn = "nodePlacement.bk", + NOn = "edgeRouting", + xOn = "org.eclipse.elk.edgeRouting", + DOn = "spacing", + ROn = "priority", + KOn = "compaction", + _On = "compaction.postCompaction", + FOn = "Specifies whether and how post-process compaction is applied.", + BOn = "highDegreeNodes", + HOn = "wrapping", + qOn = "wrapping.cutting", + GOn = "wrapping.validify", + zOn = "wrapping.multiEdge", + UOn = "edgeLabels", + XOn = "considerModelOrder", + WOn = "org.eclipse.elk.spacing.commentComment", + VOn = "org.eclipse.elk.spacing.commentNode", + QOn = "org.eclipse.elk.spacing.edgeEdge", + YOn = "org.eclipse.elk.spacing.edgeNode", + JOn = "org.eclipse.elk.spacing.labelLabel", + ZOn = "org.eclipse.elk.spacing.labelPortHorizontal", + nAn = "org.eclipse.elk.spacing.labelPortVertical", + tAn = "org.eclipse.elk.spacing.labelNode", + eAn = "org.eclipse.elk.spacing.nodeSelfLoop", + iAn = "org.eclipse.elk.spacing.portPort", + rAn = "org.eclipse.elk.spacing.individual", + cAn = "org.eclipse.elk.port.borderOffset", + aAn = "org.eclipse.elk.noLayout", + uAn = "org.eclipse.elk.port.side", + oAn = "org.eclipse.elk.debugMode", + sAn = "org.eclipse.elk.alignment", + hAn = "org.eclipse.elk.insideSelfLoops.activate", + fAn = "org.eclipse.elk.insideSelfLoops.yo", + lAn = "org.eclipse.elk.nodeSize.fixedGraphSize", + bAn = "org.eclipse.elk.direction", + wAn = "org.eclipse.elk.nodeLabels.padding", + dAn = "org.eclipse.elk.portLabels.nextToPortIfPossible", + gAn = "org.eclipse.elk.portLabels.treatAsGroup", + pAn = "org.eclipse.elk.portAlignment.default", + vAn = "org.eclipse.elk.portAlignment.north", + mAn = "org.eclipse.elk.portAlignment.south", + yAn = "org.eclipse.elk.portAlignment.west", + kAn = "org.eclipse.elk.portAlignment.east", + jAn = "org.eclipse.elk.contentAlignment", + EAn = "org.eclipse.elk.junctionPoints", + TAn = "org.eclipse.elk.edgeLabels.placement", + MAn = "org.eclipse.elk.port.index", + SAn = "org.eclipse.elk.commentBox", + PAn = "org.eclipse.elk.hypernode", + IAn = "org.eclipse.elk.port.anchor", + CAn = "org.eclipse.elk.partitioning.activate", + OAn = "org.eclipse.elk.partitioning.partition", + AAn = "org.eclipse.elk.position", + $An = "org.eclipse.elk.margins", + LAn = "org.eclipse.elk.spacing.portsSurrounding", + NAn = "org.eclipse.elk.interactiveLayout", + xAn = "org.eclipse.elk.core.util", + DAn = { 3: 1, 4: 1, 5: 1, 593: 1 }, + RAn = "NETWORK_SIMPLEX", + KAn = { 123: 1, 51: 1 }, + _An = "org.eclipse.elk.alg.layered.p1cycles", + FAn = "org.eclipse.elk.alg.layered.p2layers", + BAn = { 402: 1, 225: 1 }, + HAn = { 832: 1, 3: 1, 4: 1 }, + qAn = "org.eclipse.elk.alg.layered.p3order", + GAn = "org.eclipse.elk.alg.layered.p4nodes", + zAn = { 3: 1, 4: 1, 5: 1, 840: 1 }, + UAn = 1e-5, + XAn = "org.eclipse.elk.alg.layered.p4nodes.bk", + WAn = "org.eclipse.elk.alg.layered.p5edges", + VAn = "org.eclipse.elk.alg.layered.p5edges.orthogonal", + QAn = "org.eclipse.elk.alg.layered.p5edges.orthogonal.direction", + YAn = 1e-6, + JAn = "org.eclipse.elk.alg.layered.p5edges.splines", + ZAn = 0.09999999999999998, + n$n = 1e-8, + t$n = 4.71238898038469, + e$n = 3.141592653589793, + i$n = "org.eclipse.elk.alg.mrtree", + r$n = "org.eclipse.elk.alg.mrtree.graph", + c$n = "org.eclipse.elk.alg.mrtree.intermediate", + a$n = "Set neighbors in level", + u$n = "DESCENDANTS", + o$n = "org.eclipse.elk.mrtree.weighting", + s$n = "org.eclipse.elk.mrtree.searchOrder", + h$n = "org.eclipse.elk.alg.mrtree.options", + f$n = "org.eclipse.elk.mrtree", + l$n = "org.eclipse.elk.tree", + b$n = "org.eclipse.elk.alg.radial", + w$n = 6.283185307179586, + d$n = 5e-324, + g$n = "org.eclipse.elk.alg.radial.intermediate", + p$n = "org.eclipse.elk.alg.radial.intermediate.compaction", + v$n = { 3: 1, 4: 1, 5: 1, 106: 1 }, + m$n = "org.eclipse.elk.alg.radial.intermediate.optimization", + y$n = "No implementation is available for the layout option ", + k$n = "org.eclipse.elk.alg.radial.options", + j$n = "org.eclipse.elk.radial.orderId", + E$n = "org.eclipse.elk.radial.radius", + T$n = "org.eclipse.elk.radial.compactor", + M$n = "org.eclipse.elk.radial.compactionStepSize", + S$n = "org.eclipse.elk.radial.sorter", + P$n = "org.eclipse.elk.radial.wedgeCriteria", + I$n = "org.eclipse.elk.radial.optimizationCriteria", + C$n = "org.eclipse.elk.radial", + O$n = "org.eclipse.elk.alg.radial.p1position.wedge", + A$n = "org.eclipse.elk.alg.radial.sorting", + $$n = 5.497787143782138, + L$n = 3.9269908169872414, + N$n = 2.356194490192345, + x$n = "org.eclipse.elk.alg.rectpacking", + D$n = "org.eclipse.elk.alg.rectpacking.firstiteration", + R$n = "org.eclipse.elk.alg.rectpacking.options", + K$n = "org.eclipse.elk.rectpacking.optimizationGoal", + _$n = "org.eclipse.elk.rectpacking.lastPlaceShift", + F$n = "org.eclipse.elk.rectpacking.currentPosition", + B$n = "org.eclipse.elk.rectpacking.desiredPosition", + H$n = "org.eclipse.elk.rectpacking.onlyFirstIteration", + q$n = "org.eclipse.elk.rectpacking.rowCompaction", + G$n = "org.eclipse.elk.rectpacking.expandToAspectRatio", + z$n = "org.eclipse.elk.rectpacking.targetWidth", + U$n = "org.eclipse.elk.expandNodes", + X$n = "org.eclipse.elk.rectpacking", + W$n = "org.eclipse.elk.alg.rectpacking.util", + V$n = "No implementation available for ", + Q$n = "org.eclipse.elk.alg.spore", + Y$n = "org.eclipse.elk.alg.spore.options", + J$n = "org.eclipse.elk.sporeCompaction", + Z$n = "org.eclipse.elk.underlyingLayoutAlgorithm", + nLn = "org.eclipse.elk.processingOrder.treeConstruction", + tLn = "org.eclipse.elk.processingOrder.spanningTreeCostFunction", + eLn = "org.eclipse.elk.processingOrder.preferredRoot", + iLn = "org.eclipse.elk.processingOrder.rootSelection", + rLn = "org.eclipse.elk.structure.structureExtractionStrategy", + cLn = "org.eclipse.elk.compaction.compactionStrategy", + aLn = "org.eclipse.elk.compaction.orthogonal", + uLn = "org.eclipse.elk.overlapRemoval.maxIterations", + oLn = "org.eclipse.elk.overlapRemoval.runScanline", + sLn = "processingOrder", + hLn = "overlapRemoval", + fLn = "org.eclipse.elk.sporeOverlap", + lLn = "org.eclipse.elk.alg.spore.p1structure", + bLn = "org.eclipse.elk.alg.spore.p2processingorder", + wLn = "org.eclipse.elk.alg.spore.p3execution", + dLn = "Invalid index: ", + gLn = "org.eclipse.elk.core.alg", + pLn = { 331: 1 }, + vLn = { 288: 1 }, + mLn = "Make sure its type is registered with the ", + yLn = " utility class.", + kLn = "true", + jLn = "false", + ELn = "Couldn't clone property '", + TLn = 0.05, + MLn = "org.eclipse.elk.core.options", + SLn = 1.2999999523162842, + PLn = "org.eclipse.elk.box", + ILn = "org.eclipse.elk.box.packingMode", + CLn = "org.eclipse.elk.algorithm", + OLn = "org.eclipse.elk.resolvedAlgorithm", + ALn = "org.eclipse.elk.bendPoints", + $Ln = "org.eclipse.elk.labelManager", + LLn = "org.eclipse.elk.scaleFactor", + NLn = "org.eclipse.elk.animate", + xLn = "org.eclipse.elk.animTimeFactor", + DLn = "org.eclipse.elk.layoutAncestors", + RLn = "org.eclipse.elk.maxAnimTime", + KLn = "org.eclipse.elk.minAnimTime", + _Ln = "org.eclipse.elk.progressBar", + FLn = "org.eclipse.elk.validateGraph", + BLn = "org.eclipse.elk.validateOptions", + HLn = "org.eclipse.elk.zoomToFit", + qLn = "org.eclipse.elk.font.name", + GLn = "org.eclipse.elk.font.size", + zLn = "org.eclipse.elk.edge.type", + ULn = "partitioning", + XLn = "nodeLabels", + WLn = "portAlignment", + VLn = "nodeSize", + QLn = "port", + YLn = "portLabels", + JLn = "insideSelfLoops", + ZLn = "org.eclipse.elk.fixed", + nNn = "org.eclipse.elk.random", + tNn = "port must have a parent node to calculate the port side", + eNn = "The edge needs to have exactly one edge section. Found: ", + iNn = "org.eclipse.elk.core.util.adapters", + rNn = "org.eclipse.emf.ecore", + cNn = "org.eclipse.elk.graph", + aNn = "EMapPropertyHolder", + uNn = "ElkBendPoint", + oNn = "ElkGraphElement", + sNn = "ElkConnectableShape", + hNn = "ElkEdge", + fNn = "ElkEdgeSection", + lNn = "EModelElement", + bNn = "ENamedElement", + wNn = "ElkLabel", + dNn = "ElkNode", + gNn = "ElkPort", + pNn = { 92: 1, 90: 1 }, + vNn = "org.eclipse.emf.common.notify.impl", + mNn = "The feature '", + yNn = "' is not a valid changeable feature", + kNn = "Expecting null", + jNn = "' is not a valid feature", + ENn = "The feature ID", + TNn = " is not a valid feature ID", + MNn = 32768, + SNn = { 105: 1, 92: 1, 90: 1, 56: 1, 49: 1, 97: 1 }, + PNn = "org.eclipse.emf.ecore.impl", + INn = "org.eclipse.elk.graph.impl", + CNn = "Recursive containment not allowed for ", + ONn = "The datatype '", + ANn = "' is not a valid classifier", + $Nn = "The value '", + LNn = { 190: 1, 3: 1, 4: 1 }, + NNn = "The class '", + xNn = "http://www.eclipse.org/elk/ElkGraph", + DNn = 1024, + RNn = "property", + KNn = "value", + _Nn = "source", + FNn = "properties", + BNn = "identifier", + HNn = "height", + qNn = "width", + GNn = "parent", + zNn = "text", + UNn = "children", + XNn = "hierarchical", + WNn = "sources", + VNn = "targets", + QNn = "sections", + YNn = "bendPoints", + JNn = "outgoingShape", + ZNn = "incomingShape", + nxn = "outgoingSections", + txn = "incomingSections", + exn = "org.eclipse.emf.common.util", + ixn = "Severe implementation error in the Json to ElkGraph importer.", + rxn = "id", + cxn = "org.eclipse.elk.graph.json", + axn = "Unhandled parameter types: ", + uxn = "startPoint", + oxn = "An edge must have at least one source and one target (edge id: '", + sxn = "').", + hxn = "Referenced edge section does not exist: ", + fxn = " (edge id: '", + lxn = "target", + bxn = "sourcePoint", + wxn = "targetPoint", + dxn = "group", + gxn = "name", + pxn = "connectableShape cannot be null", + vxn = "edge cannot be null", + mxn = "Passed edge is not 'simple'.", + yxn = "org.eclipse.elk.graph.util", + kxn = "The 'no duplicates' constraint is violated", + jxn = "targetIndex=", + Exn = ", size=", + Txn = "sourceIndex=", + Mxn = { + 3: 1, + 4: 1, + 20: 1, + 28: 1, + 52: 1, + 14: 1, + 15: 1, + 54: 1, + 67: 1, + 63: 1, + 58: 1, + }, + Sxn = { + 3: 1, + 4: 1, + 20: 1, + 28: 1, + 52: 1, + 14: 1, + 47: 1, + 15: 1, + 54: 1, + 67: 1, + 63: 1, + 58: 1, + 588: 1, + }, + Pxn = "logging", + Ixn = "measureExecutionTime", + Cxn = "parser.parse.1", + Oxn = "parser.parse.2", + Axn = "parser.next.1", + $xn = "parser.next.2", + Lxn = "parser.next.3", + Nxn = "parser.next.4", + xxn = "parser.factor.1", + Dxn = "parser.factor.2", + Rxn = "parser.factor.3", + Kxn = "parser.factor.4", + _xn = "parser.factor.5", + Fxn = "parser.factor.6", + Bxn = "parser.atom.1", + Hxn = "parser.atom.2", + qxn = "parser.atom.3", + Gxn = "parser.atom.4", + zxn = "parser.atom.5", + Uxn = "parser.cc.1", + Xxn = "parser.cc.2", + Wxn = "parser.cc.3", + Vxn = "parser.cc.5", + Qxn = "parser.cc.6", + Yxn = "parser.cc.7", + Jxn = "parser.cc.8", + Zxn = "parser.ope.1", + nDn = "parser.ope.2", + tDn = "parser.ope.3", + eDn = "parser.descape.1", + iDn = "parser.descape.2", + rDn = "parser.descape.3", + cDn = "parser.descape.4", + aDn = "parser.descape.5", + uDn = "parser.process.1", + oDn = "parser.quantifier.1", + sDn = "parser.quantifier.2", + hDn = "parser.quantifier.3", + fDn = "parser.quantifier.4", + lDn = "parser.quantifier.5", + bDn = "org.eclipse.emf.common.notify", + wDn = { 415: 1, 672: 1 }, + dDn = { 3: 1, 4: 1, 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 67: 1, 58: 1 }, + gDn = { 366: 1, 143: 1 }, + pDn = "index=", + vDn = { 3: 1, 4: 1, 5: 1, 126: 1 }, + mDn = { 3: 1, 4: 1, 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 54: 1, 67: 1, 58: 1 }, + yDn = { 3: 1, 6: 1, 4: 1, 5: 1, 192: 1 }, + kDn = { 3: 1, 4: 1, 5: 1, 165: 1, 367: 1 }, + jDn = ";/?:@&=+$,", + EDn = "invalid authority: ", + TDn = "EAnnotation", + MDn = "ETypedElement", + SDn = "EStructuralFeature", + PDn = "EAttribute", + IDn = "EClassifier", + CDn = "EEnumLiteral", + ODn = "EGenericType", + ADn = "EOperation", + $Dn = "EParameter", + LDn = "EReference", + NDn = "ETypeParameter", + xDn = "org.eclipse.emf.ecore.util", + DDn = { 76: 1 }, + RDn = { 3: 1, 20: 1, 14: 1, 15: 1, 58: 1, 589: 1, 76: 1, 69: 1, 95: 1 }, + KDn = "org.eclipse.emf.ecore.util.FeatureMap$Entry", + _Dn = 8192, + FDn = 2048, + BDn = "byte", + HDn = "char", + qDn = "double", + GDn = "float", + zDn = "int", + UDn = "long", + XDn = "short", + WDn = "java.lang.Object", + VDn = { 3: 1, 4: 1, 5: 1, 247: 1 }, + QDn = { 3: 1, 4: 1, 5: 1, 673: 1 }, + YDn = { + 3: 1, + 4: 1, + 20: 1, + 28: 1, + 52: 1, + 14: 1, + 15: 1, + 54: 1, + 67: 1, + 63: 1, + 58: 1, + 69: 1, + }, + JDn = { + 3: 1, + 4: 1, + 20: 1, + 28: 1, + 52: 1, + 14: 1, + 15: 1, + 54: 1, + 67: 1, + 63: 1, + 58: 1, + 76: 1, + 69: 1, + 95: 1, + }, + ZDn = "mixed", + nRn = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData", + tRn = "kind", + eRn = { 3: 1, 4: 1, 5: 1, 674: 1 }, + iRn = { + 3: 1, + 4: 1, + 20: 1, + 28: 1, + 52: 1, + 14: 1, + 15: 1, + 67: 1, + 58: 1, + 76: 1, + 69: 1, + 95: 1, + }, + rRn = { 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 58: 1, 69: 1 }, + cRn = { 47: 1, 125: 1, 279: 1 }, + aRn = { 72: 1, 332: 1 }, + uRn = "The value of type '", + oRn = "' must be of type '", + sRn = 1316, + hRn = "http://www.eclipse.org/emf/2002/Ecore", + fRn = -32768, + lRn = "constraints", + bRn = "baseType", + wRn = "getEStructuralFeature", + dRn = "getFeatureID", + gRn = "feature", + pRn = "getOperationID", + vRn = "operation", + mRn = "defaultValue", + yRn = "eTypeParameters", + kRn = "isInstance", + jRn = "getEEnumLiteral", + ERn = "eContainingClass", + TRn = { 55: 1 }, + MRn = { 3: 1, 4: 1, 5: 1, 119: 1 }, + SRn = "org.eclipse.emf.ecore.resource", + PRn = { 92: 1, 90: 1, 591: 1, 1935: 1 }, + IRn = "org.eclipse.emf.ecore.resource.impl", + CRn = "unspecified", + ORn = "simple", + ARn = "attribute", + $Rn = "attributeWildcard", + LRn = "element", + NRn = "elementWildcard", + xRn = "collapse", + DRn = "itemType", + RRn = "namespace", + KRn = "##targetNamespace", + _Rn = "whiteSpace", + FRn = "wildcards", + BRn = "http://www.eclipse.org/emf/2003/XMLType", + HRn = "##any", + qRn = "uninitialized", + GRn = "The multiplicity constraint is violated", + zRn = "org.eclipse.emf.ecore.xml.type", + URn = "ProcessingInstruction", + XRn = "SimpleAnyType", + WRn = "XMLTypeDocumentRoot", + VRn = "org.eclipse.emf.ecore.xml.type.impl", + QRn = "INF", + YRn = "processing", + JRn = "ENTITIES_._base", + ZRn = "minLength", + nKn = "ENTITY", + tKn = "NCName", + eKn = "IDREFS_._base", + iKn = "integer", + rKn = "token", + cKn = "pattern", + aKn = "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*", + uKn = "\\i\\c*", + oKn = "[\\i-[:]][\\c-[:]]*", + sKn = "nonPositiveInteger", + hKn = "maxInclusive", + fKn = "NMTOKEN", + lKn = "NMTOKENS_._base", + bKn = "nonNegativeInteger", + wKn = "minInclusive", + dKn = "normalizedString", + gKn = "unsignedByte", + pKn = "unsignedInt", + vKn = "18446744073709551615", + mKn = "unsignedShort", + yKn = "processingInstruction", + kKn = "org.eclipse.emf.ecore.xml.type.internal", + jKn = 1114111, + EKn = "Internal Error: shorthands: \\u", + TKn = "xml:isDigit", + MKn = "xml:isWord", + SKn = "xml:isSpace", + PKn = "xml:isNameChar", + IKn = "xml:isInitialNameChar", + CKn = "09٠٩۰۹०९০৯੦੯૦૯୦୯௧௯౦౯೦೯൦൯๐๙໐໙༠༩", + OKn = + "AZazÀÖØöøıĴľŁňŊžƀǃǍǰǴǵǺȗɐʨʻˁΆΆΈΊΌΌΎΡΣώϐϖϚϚϜϜϞϞϠϠϢϳЁЌЎяёќўҁҐӄӇӈӋӌӐӫӮӵӸӹԱՖՙՙաֆאתװײءغفيٱڷںھۀێېۓەەۥۦअहऽऽक़ॡঅঌএঐওনপরললশহড়ঢ়য়ৡৰৱਅਊਏਐਓਨਪਰਲਲ਼ਵਸ਼ਸਹਖ਼ੜਫ਼ਫ਼ੲੴઅઋઍઍએઑઓનપરલળવહઽઽૠૠଅଌଏଐଓନପରଲଳଶହଽଽଡ଼ଢ଼ୟୡஅஊஎஐஒகஙசஜஜஞடணதநபமவஷஹఅఌఎఐఒనపళవహౠౡಅಌಎಐಒನಪಳವಹೞೞೠೡഅഌഎഐഒനപഹൠൡกฮะะาำเๅກຂຄຄງຈຊຊຍຍດທນຟມຣລລວວສຫອຮະະາຳຽຽເໄཀཇཉཀྵႠჅაჶᄀᄀᄂᄃᄅᄇᄉᄉᄋᄌᄎᄒᄼᄼᄾᄾᅀᅀᅌᅌᅎᅎᅐᅐᅔᅕᅙᅙᅟᅡᅣᅣᅥᅥᅧᅧᅩᅩᅭᅮᅲᅳᅵᅵᆞᆞᆨᆨᆫᆫᆮᆯᆷᆸᆺᆺᆼᇂᇫᇫᇰᇰᇹᇹḀẛẠỹἀἕἘἝἠὅὈὍὐὗὙὙὛὛὝὝὟώᾀᾴᾶᾼιιῂῄῆῌῐΐῖΊῠῬῲῴῶῼΩΩKÅ℮℮ↀↂ〇〇〡〩ぁゔァヺㄅㄬ一龥가힣", + AKn = "Private Use", + $Kn = "ASSIGNED", + LKn = + "\0€ÿĀſƀɏɐʯʰ˿̀ͯͰϿЀӿ԰֏֐׿؀ۿ܀ݏހ޿ऀॿঀ৿਀੿઀૿଀୿஀௿ఀ౿ಀ೿ഀൿ඀෿฀๿຀໿ༀ࿿က႟Ⴀჿᄀᇿሀ፿Ꭰ᏿᐀ᙿ ᚟ᚠ᛿ក៿᠀᢯Ḁỿἀ῿ ⁰₟₠⃏⃐⃿℀⅏⅐↏←⇿∀⋿⌀⏿␀␿⑀⑟①⓿─╿▀▟■◿☀⛿✀➿⠀⣿⺀⻿⼀⿟⿰⿿ 〿぀ゟ゠ヿ㄀ㄯ㄰㆏㆐㆟ㆠㆿ㈀㋿㌀㏿㐀䶵一鿿ꀀ꒏꒐꓏가힣豈﫿ffﭏﭐ﷿︠︯︰﹏﹐﹯ﹰ﻾\ufeff\ufeff＀￯", + NKn = "UNASSIGNED", + xKn = { 3: 1, 117: 1 }, + DKn = "org.eclipse.emf.ecore.xml.type.util", + RKn = { 3: 1, 4: 1, 5: 1, 368: 1 }, + KKn = "org.eclipse.xtext.xbase.lib", + _Kn = "Cannot add elements to a Range", + FKn = "Cannot set elements in a Range", + BKn = "Cannot remove elements from a Range", + HKn = "locale", + qKn = "default", + GKn = "user.agent"; + (e.goog = e.goog || {}), + (e.goog.global = e.goog.global || e), + (Bjn = {}), + !Array.isArray && + (Array.isArray = function (n) { + return "[object Array]" === Object.prototype.toString.call(n); + }), + !Date.now && + (Date.now = function () { + return new Date().getTime(); + }), + Wfn(1, null, {}, r), + (Fjn.Fb = function (n) { + return WI(this, n); + }), + (Fjn.Gb = function () { + return this.gm; + }), + (Fjn.Hb = function () { + return _A(this); + }), + (Fjn.Ib = function () { + return Nk(V5(this)) + "@" + (W5(this) >>> 0).toString(16); + }), + (Fjn.equals = function (n) { + return this.Fb(n); + }), + (Fjn.hashCode = function () { + return this.Hb(); + }), + (Fjn.toString = function () { + return this.Ib(); + }), + Wfn(290, 1, { 290: 1, 2026: 1 }, m5), + (Fjn.le = function (n) { + var t; + return ((t = new m5()).i = 4), (t.c = n > 1 ? qG(this, n - 1) : this), t; + }), + (Fjn.me = function () { + return sL(this), this.b; + }), + (Fjn.ne = function () { + return Nk(this); + }), + (Fjn.oe = function () { + return sL(this), this.k; + }), + (Fjn.pe = function () { + return 0 != (4 & this.i); + }), + (Fjn.qe = function () { + return 0 != (1 & this.i); + }), + (Fjn.Ib = function () { + return LZ(this); + }), + (Fjn.i = 0); + var zKn, + UKn = EF(Jjn, "Object", 1), + XKn = EF(Jjn, "Class", 290); + Wfn(1998, 1, Zjn), + EF(nEn, "Optional", 1998), + Wfn(1170, 1998, Zjn, c), + (Fjn.Fb = function (n) { + return n === this; + }), + (Fjn.Hb = function () { + return 2040732332; + }), + (Fjn.Ib = function () { + return "Optional.absent()"; + }), + (Fjn.Jb = function (n) { + return MF(n), gm(), zKn; + }), + EF(nEn, "Absent", 1170), + Wfn(628, 1, {}, Ty), + EF(nEn, "Joiner", 628); + var WKn = aR(nEn, "Predicate"); + Wfn(582, 1, { 169: 1, 582: 1, 3: 1, 45: 1 }, Ff), + (Fjn.Mb = function (n) { + return R5(this, n); + }), + (Fjn.Lb = function (n) { + return R5(this, n); + }), + (Fjn.Fb = function (n) { + var t; + return !!CO(n, 582) && ((t = Yx(n, 582)), sln(this.a, t.a)); + }), + (Fjn.Hb = function () { + return K5(this.a) + 306654252; + }), + (Fjn.Ib = function () { + return (function (n) { + var t, e, i, r; + for (t = _F(yI(new SA("Predicates."), "and"), 40), e = !0, r = new Vl(n); r.b < r.d.gc(); ) + S$(r.b < r.d.gc()), (i = r.d.Xb((r.c = r.b++))), e || (t.a += ","), (t.a += "" + i), (e = !1); + return ((t.a += ")"), t).a; + })(this.a); + }), + EF(nEn, "Predicates/AndPredicate", 582), + Wfn(408, 1998, { 408: 1, 3: 1 }, Bf), + (Fjn.Fb = function (n) { + var t; + return !!CO(n, 408) && ((t = Yx(n, 408)), Q8(this.a, t.a)); + }), + (Fjn.Hb = function () { + return 1502476572 + W5(this.a); + }), + (Fjn.Ib = function () { + return cEn + this.a + ")"; + }), + (Fjn.Jb = function (n) { + return new Bf(rq(n.Kb(this.a), "the Function passed to Optional.transform() must not return null.")); + }), + EF(nEn, "Present", 408), + Wfn(198, 1, uEn), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Qb = function () { + ky(); + }), + EF(oEn, "UnmodifiableIterator", 198), + Wfn(1978, 198, sEn), + (Fjn.Qb = function () { + ky(); + }), + (Fjn.Rb = function (n) { + throw hp(new xp()); + }), + (Fjn.Wb = function (n) { + throw hp(new xp()); + }), + EF(oEn, "UnmodifiableListIterator", 1978), + Wfn(386, 1978, sEn), + (Fjn.Ob = function () { + return this.c < this.d; + }), + (Fjn.Sb = function () { + return this.c > 0; + }), + (Fjn.Pb = function () { + if (this.c >= this.d) throw hp(new Kp()); + return this.Xb(this.c++); + }), + (Fjn.Tb = function () { + return this.c; + }), + (Fjn.Ub = function () { + if (this.c <= 0) throw hp(new Kp()); + return this.Xb(--this.c); + }), + (Fjn.Vb = function () { + return this.c - 1; + }), + (Fjn.c = 0), + (Fjn.d = 0), + EF(oEn, "AbstractIndexedListIterator", 386), + Wfn(699, 198, uEn), + (Fjn.Ob = function () { + return X0(this); + }), + (Fjn.Pb = function () { + return bJ(this); + }), + (Fjn.e = 1), + EF(oEn, "AbstractIterator", 699), + Wfn(1986, 1, { 224: 1 }), + (Fjn.Zb = function () { + return this.f || (this.f = this.ac()); + }), + (Fjn.Fb = function (n) { + return f6(this, n); + }), + (Fjn.Hb = function () { + return W5(this.Zb()); + }), + (Fjn.dc = function () { + return 0 == this.gc(); + }), + (Fjn.ec = function () { + return FK(this); + }), + (Fjn.Ib = function () { + return I7(this.Zb()); + }), + EF(oEn, "AbstractMultimap", 1986), + Wfn(726, 1986, hEn), + (Fjn.$b = function () { + v0(this); + }), + (Fjn._b = function (n) { + return Ok(this, n); + }), + (Fjn.ac = function () { + return new Xj(this, this.c); + }), + (Fjn.ic = function (n) { + return this.hc(); + }), + (Fjn.bc = function () { + return new iA(this, this.c); + }), + (Fjn.jc = function () { + return this.mc(this.hc()); + }), + (Fjn.kc = function () { + return new tm(this); + }), + (Fjn.lc = function () { + return lun(this.c.vc().Nc(), new u(), 64, this.d); + }), + (Fjn.cc = function (n) { + return _V(this, n); + }), + (Fjn.fc = function (n) { + return h8(this, n); + }), + (Fjn.gc = function () { + return this.d; + }), + (Fjn.mc = function (n) { + return XH(), new fb(n); + }), + (Fjn.nc = function () { + return new nm(this); + }), + (Fjn.oc = function () { + return lun(this.c.Cc().Nc(), new a(), 64, this.d); + }), + (Fjn.pc = function (n, t) { + return new dQ(this, n, t, null); + }), + (Fjn.d = 0), + EF(oEn, "AbstractMapBasedMultimap", 726), + Wfn(1631, 726, hEn), + (Fjn.hc = function () { + return new pQ(this.a); + }), + (Fjn.jc = function () { + return XH(), XH(), TFn; + }), + (Fjn.cc = function (n) { + return Yx(_V(this, n), 15); + }), + (Fjn.fc = function (n) { + return Yx(h8(this, n), 15); + }), + (Fjn.Zb = function () { + return QH(this); + }), + (Fjn.Fb = function (n) { + return f6(this, n); + }), + (Fjn.qc = function (n) { + return Yx(_V(this, n), 15); + }), + (Fjn.rc = function (n) { + return Yx(h8(this, n), 15); + }), + (Fjn.mc = function (n) { + return lq(Yx(n, 15)); + }), + (Fjn.pc = function (n, t) { + return kX(this, n, Yx(t, 15), null); + }), + EF(oEn, "AbstractListMultimap", 1631), + Wfn(732, 1, fEn), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return this.c.Ob() || this.e.Ob(); + }), + (Fjn.Pb = function () { + var n; + return ( + this.e.Ob() || ((n = Yx(this.c.Pb(), 42)), (this.b = n.cd()), (this.a = Yx(n.dd(), 14)), (this.e = this.a.Kc())), + this.sc(this.b, this.e.Pb()) + ); + }), + (Fjn.Qb = function () { + this.e.Qb(), this.a.dc() && this.c.Qb(), --this.d.d; + }), + EF(oEn, "AbstractMapBasedMultimap/Itr", 732), + Wfn(1099, 732, fEn, nm), + (Fjn.sc = function (n, t) { + return t; + }), + EF(oEn, "AbstractMapBasedMultimap/1", 1099), + Wfn(1100, 1, {}, a), + (Fjn.Kb = function (n) { + return Yx(n, 14).Nc(); + }), + EF(oEn, "AbstractMapBasedMultimap/1methodref$spliterator$Type", 1100), + Wfn(1101, 732, fEn, tm), + (Fjn.sc = function (n, t) { + return new Wj(n, t); + }), + EF(oEn, "AbstractMapBasedMultimap/2", 1101); + var VKn = aR(lEn, "Map"); + Wfn(1967, 1, bEn), + (Fjn.wc = function (n) { + S3(this, n); + }), + (Fjn.yc = function (n, t, e) { + return Y9(this, n, t, e); + }), + (Fjn.$b = function () { + this.vc().$b(); + }), + (Fjn.tc = function (n) { + return Fin(this, n); + }), + (Fjn._b = function (n) { + return !!Ian(this, n, !1); + }), + (Fjn.uc = function (n) { + var t, e; + for (t = this.vc().Kc(); t.Ob(); ) if (((e = Yx(t.Pb(), 42).dd()), iI(n) === iI(e) || (null != n && Q8(n, e)))) return !0; + return !1; + }), + (Fjn.Fb = function (n) { + var t, e, i; + if (n === this) return !0; + if (!CO(n, 83)) return !1; + if (((i = Yx(n, 83)), this.gc() != i.gc())) return !1; + for (e = i.vc().Kc(); e.Ob(); ) if (((t = Yx(e.Pb(), 42)), !this.tc(t))) return !1; + return !0; + }), + (Fjn.xc = function (n) { + return eI(Ian(this, n, !1)); + }), + (Fjn.Hb = function () { + return W4(this.vc()); + }), + (Fjn.dc = function () { + return 0 == this.gc(); + }), + (Fjn.ec = function () { + return new Yl(this); + }), + (Fjn.zc = function (n, t) { + throw hp(new sy("Put not supported on this map")); + }), + (Fjn.Ac = function (n) { + i3(this, n); + }), + (Fjn.Bc = function (n) { + return eI(Ian(this, n, !0)); + }), + (Fjn.gc = function () { + return this.vc().gc(); + }), + (Fjn.Ib = function () { + return Fan(this); + }), + (Fjn.Cc = function () { + return new Zl(this); + }), + EF(lEn, "AbstractMap", 1967), + Wfn(1987, 1967, bEn), + (Fjn.bc = function () { + return new eE(this); + }), + (Fjn.vc = function () { + return _K(this); + }), + (Fjn.ec = function () { + return this.g || (this.g = this.bc()); + }), + (Fjn.Cc = function () { + return this.i || (this.i = new iE(this)); + }), + EF(oEn, "Maps/ViewCachingAbstractMap", 1987), + Wfn(389, 1987, bEn, Xj), + (Fjn.xc = function (n) { + return (function (n, t) { + var e, i; + return (e = Yx(x8(n.d, t), 14)) ? ((i = t), n.e.pc(i, e)) : null; + })(this, n); + }), + (Fjn.Bc = function (n) { + return (function (n, t) { + var e, i; + return (e = Yx(n.d.Bc(t), 14)) ? ((i = n.e.hc()).Gc(e), (n.e.d -= e.gc()), e.$b(), i) : null; + })(this, n); + }), + (Fjn.$b = function () { + this.d == this.e.c ? this.e.$b() : vR(new mR(this)); + }), + (Fjn._b = function (n) { + return R8(this.d, n); + }), + (Fjn.Ec = function () { + return new zf(this); + }), + (Fjn.Dc = function () { + return this.Ec(); + }), + (Fjn.Fb = function (n) { + return this === n || Q8(this.d, n); + }), + (Fjn.Hb = function () { + return W5(this.d); + }), + (Fjn.ec = function () { + return this.e.ec(); + }), + (Fjn.gc = function () { + return this.d.gc(); + }), + (Fjn.Ib = function () { + return I7(this.d); + }), + EF(oEn, "AbstractMapBasedMultimap/AsMap", 389); + var QKn = aR(Jjn, "Iterable"); + Wfn(28, 1, wEn), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Lc = function () { + return this.Oc(); + }), + (Fjn.Nc = function () { + return new Nz(this, 0); + }), + (Fjn.Oc = function () { + return new SR(null, this.Nc()); + }), + (Fjn.Fc = function (n) { + throw hp(new sy("Add not supported on this collection")); + }), + (Fjn.Gc = function (n) { + return C2(this, n); + }), + (Fjn.$b = function () { + iH(this); + }), + (Fjn.Hc = function (n) { + return V7(this, n, !1); + }), + (Fjn.Ic = function (n) { + return m4(this, n); + }), + (Fjn.dc = function () { + return 0 == this.gc(); + }), + (Fjn.Mc = function (n) { + return V7(this, n, !0); + }), + (Fjn.Pc = function () { + return CK(this); + }), + (Fjn.Qc = function (n) { + return _in(this, n); + }), + (Fjn.Ib = function () { + return Gun(this); + }), + EF(lEn, "AbstractCollection", 28); + var YKn = aR(lEn, "Set"); + Wfn(dEn, 28, gEn), + (Fjn.Nc = function () { + return new Nz(this, 1); + }), + (Fjn.Fb = function (n) { + return stn(this, n); + }), + (Fjn.Hb = function () { + return W4(this); + }), + EF(lEn, "AbstractSet", dEn), + Wfn(1970, dEn, gEn), + EF(oEn, "Sets/ImprovedAbstractSet", 1970), + Wfn(1971, 1970, gEn), + (Fjn.$b = function () { + this.Rc().$b(); + }), + (Fjn.Hc = function (n) { + return vnn(this, n); + }), + (Fjn.dc = function () { + return this.Rc().dc(); + }), + (Fjn.Mc = function (n) { + var t; + return !!this.Hc(n) && ((t = Yx(n, 42)), this.Rc().ec().Mc(t.cd())); + }), + (Fjn.gc = function () { + return this.Rc().gc(); + }), + EF(oEn, "Maps/EntrySet", 1971), + Wfn(1097, 1971, gEn, zf), + (Fjn.Hc = function (n) { + return D8(this.a.d.vc(), n); + }), + (Fjn.Kc = function () { + return new mR(this.a); + }), + (Fjn.Rc = function () { + return this.a; + }), + (Fjn.Mc = function (n) { + var t; + return !!D8(this.a.d.vc(), n) && ((t = Yx(n, 42)), pV(this.a.e, t.cd()), !0); + }), + (Fjn.Nc = function () { + return Vx(this.a.d.vc().Nc(), new Uf(this.a)); + }), + EF(oEn, "AbstractMapBasedMultimap/AsMap/AsMapEntries", 1097), + Wfn(1098, 1, {}, Uf), + (Fjn.Kb = function (n) { + return WW(this.a, Yx(n, 42)); + }), + EF(oEn, "AbstractMapBasedMultimap/AsMap/AsMapEntries/0methodref$wrapEntry$Type", 1098), + Wfn(730, 1, fEn, mR), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Pb = function () { + var n; + return (n = Yx(this.b.Pb(), 42)), (this.a = Yx(n.dd(), 14)), WW(this.c, n); + }), + (Fjn.Ob = function () { + return this.b.Ob(); + }), + (Fjn.Qb = function () { + x3(!!this.a), this.b.Qb(), (this.c.e.d -= this.a.gc()), this.a.$b(), (this.a = null); + }), + EF(oEn, "AbstractMapBasedMultimap/AsMap/AsMapIterator", 730), + Wfn(532, 1970, gEn, eE), + (Fjn.$b = function () { + this.b.$b(); + }), + (Fjn.Hc = function (n) { + return this.b._b(n); + }), + (Fjn.Jc = function (n) { + MF(n), this.b.wc(new gl(n)); + }), + (Fjn.dc = function () { + return this.b.dc(); + }), + (Fjn.Kc = function () { + return new Mm(this.b.vc().Kc()); + }), + (Fjn.Mc = function (n) { + return !!this.b._b(n) && (this.b.Bc(n), !0); + }), + (Fjn.gc = function () { + return this.b.gc(); + }), + EF(oEn, "Maps/KeySet", 532), + Wfn(318, 532, gEn, iA), + (Fjn.$b = function () { + vR(new $j(this, this.b.vc().Kc())); + }), + (Fjn.Ic = function (n) { + return this.b.ec().Ic(n); + }), + (Fjn.Fb = function (n) { + return this === n || Q8(this.b.ec(), n); + }), + (Fjn.Hb = function () { + return W5(this.b.ec()); + }), + (Fjn.Kc = function () { + return new $j(this, this.b.vc().Kc()); + }), + (Fjn.Mc = function (n) { + var t, e; + return (e = 0), (t = Yx(this.b.Bc(n), 14)) && ((e = t.gc()), t.$b(), (this.a.d -= e)), e > 0; + }), + (Fjn.Nc = function () { + return this.b.ec().Nc(); + }), + EF(oEn, "AbstractMapBasedMultimap/KeySet", 318), + Wfn(731, 1, fEn, $j), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return this.c.Ob(); + }), + (Fjn.Pb = function () { + return (this.a = Yx(this.c.Pb(), 42)), this.a.cd(); + }), + (Fjn.Qb = function () { + var n; + x3(!!this.a), (n = Yx(this.a.dd(), 14)), this.c.Qb(), (this.b.a.d -= n.gc()), n.$b(), (this.a = null); + }), + EF(oEn, "AbstractMapBasedMultimap/KeySet/1", 731), + Wfn(491, 389, { 83: 1, 161: 1 }, wL), + (Fjn.bc = function () { + return this.Sc(); + }), + (Fjn.ec = function () { + return this.Tc(); + }), + (Fjn.Sc = function () { + return new Oj(this.c, this.Uc()); + }), + (Fjn.Tc = function () { + return this.b || (this.b = this.Sc()); + }), + (Fjn.Uc = function () { + return Yx(this.d, 161); + }), + EF(oEn, "AbstractMapBasedMultimap/SortedAsMap", 491), + Wfn(542, 491, pEn, dL), + (Fjn.bc = function () { + return new Aj(this.a, Yx(Yx(this.d, 161), 171)); + }), + (Fjn.Sc = function () { + return new Aj(this.a, Yx(Yx(this.d, 161), 171)); + }), + (Fjn.ec = function () { + return Yx(this.b || (this.b = new Aj(this.a, Yx(Yx(this.d, 161), 171))), 271); + }), + (Fjn.Tc = function () { + return Yx(this.b || (this.b = new Aj(this.a, Yx(Yx(this.d, 161), 171))), 271); + }), + (Fjn.Uc = function () { + return Yx(Yx(this.d, 161), 171); + }), + EF(oEn, "AbstractMapBasedMultimap/NavigableAsMap", 542), + Wfn(490, 318, vEn, Oj), + (Fjn.Nc = function () { + return this.b.ec().Nc(); + }), + EF(oEn, "AbstractMapBasedMultimap/SortedKeySet", 490), + Wfn(388, 490, mEn, Aj), + EF(oEn, "AbstractMapBasedMultimap/NavigableKeySet", 388), + Wfn(541, 28, wEn, dQ), + (Fjn.Fc = function (n) { + var t, e; + return A7(this), (e = this.d.dc()), (t = this.d.Fc(n)) && (++this.f.d, e && tN(this)), t; + }), + (Fjn.Gc = function (n) { + var t, e, i; + return ( + !n.dc() && + (A7(this), (i = this.d.gc()), (t = this.d.Gc(n)) && ((e = this.d.gc()), (this.f.d += e - i), 0 == i && tN(this)), t) + ); + }), + (Fjn.$b = function () { + var n; + A7(this), 0 != (n = this.d.gc()) && (this.d.$b(), (this.f.d -= n), oK(this)); + }), + (Fjn.Hc = function (n) { + return A7(this), this.d.Hc(n); + }), + (Fjn.Ic = function (n) { + return A7(this), this.d.Ic(n); + }), + (Fjn.Fb = function (n) { + return n === this || (A7(this), Q8(this.d, n)); + }), + (Fjn.Hb = function () { + return A7(this), W5(this.d); + }), + (Fjn.Kc = function () { + return A7(this), new rD(this); + }), + (Fjn.Mc = function (n) { + var t; + return A7(this), (t = this.d.Mc(n)) && (--this.f.d, oK(this)), t; + }), + (Fjn.gc = function () { + return bI(this); + }), + (Fjn.Nc = function () { + return A7(this), this.d.Nc(); + }), + (Fjn.Ib = function () { + return A7(this), I7(this.d); + }), + EF(oEn, "AbstractMapBasedMultimap/WrappedCollection", 541); + var JKn = aR(lEn, "List"); + Wfn(728, 541, { 20: 1, 28: 1, 14: 1, 15: 1 }, LK), + (Fjn.ad = function (n) { + I2(this, n); + }), + (Fjn.Nc = function () { + return A7(this), this.d.Nc(); + }), + (Fjn.Vc = function (n, t) { + var e; + A7(this), (e = this.d.dc()), Yx(this.d, 15).Vc(n, t), ++this.a.d, e && tN(this); + }), + (Fjn.Wc = function (n, t) { + var e, i, r; + return ( + !t.dc() && + (A7(this), + (r = this.d.gc()), + (e = Yx(this.d, 15).Wc(n, t)) && ((i = this.d.gc()), (this.a.d += i - r), 0 == r && tN(this)), + e) + ); + }), + (Fjn.Xb = function (n) { + return A7(this), Yx(this.d, 15).Xb(n); + }), + (Fjn.Xc = function (n) { + return A7(this), Yx(this.d, 15).Xc(n); + }), + (Fjn.Yc = function () { + return A7(this), new VC(this); + }), + (Fjn.Zc = function (n) { + return A7(this), new RH(this, n); + }), + (Fjn.$c = function (n) { + var t; + return A7(this), (t = Yx(this.d, 15).$c(n)), --this.a.d, oK(this), t; + }), + (Fjn._c = function (n, t) { + return A7(this), Yx(this.d, 15)._c(n, t); + }), + (Fjn.bd = function (n, t) { + return A7(this), kX(this.a, this.e, Yx(this.d, 15).bd(n, t), this.b ? this.b : this); + }), + EF(oEn, "AbstractMapBasedMultimap/WrappedList", 728), + Wfn(1096, 728, { 20: 1, 28: 1, 14: 1, 15: 1, 54: 1 }, C$), + EF(oEn, "AbstractMapBasedMultimap/RandomAccessWrappedList", 1096), + Wfn(620, 1, fEn, rD), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return rH(this), this.b.Ob(); + }), + (Fjn.Pb = function () { + return rH(this), this.b.Pb(); + }), + (Fjn.Qb = function () { + gA(this); + }), + EF(oEn, "AbstractMapBasedMultimap/WrappedCollection/WrappedIterator", 620), + Wfn(729, 620, yEn, VC, RH), + (Fjn.Qb = function () { + gA(this); + }), + (Fjn.Rb = function (n) { + var t; + (t = 0 == bI(this.a)), (rH(this), Yx(this.b, 125)).Rb(n), ++this.a.a.d, t && tN(this.a); + }), + (Fjn.Sb = function () { + return (rH(this), Yx(this.b, 125)).Sb(); + }), + (Fjn.Tb = function () { + return (rH(this), Yx(this.b, 125)).Tb(); + }), + (Fjn.Ub = function () { + return (rH(this), Yx(this.b, 125)).Ub(); + }), + (Fjn.Vb = function () { + return (rH(this), Yx(this.b, 125)).Vb(); + }), + (Fjn.Wb = function (n) { + (rH(this), Yx(this.b, 125)).Wb(n); + }), + EF(oEn, "AbstractMapBasedMultimap/WrappedList/WrappedListIterator", 729), + Wfn(727, 541, vEn, yL), + (Fjn.Nc = function () { + return A7(this), this.d.Nc(); + }), + EF(oEn, "AbstractMapBasedMultimap/WrappedSortedSet", 727), + Wfn(1095, 727, mEn, PC), + EF(oEn, "AbstractMapBasedMultimap/WrappedNavigableSet", 1095), + Wfn(1094, 541, gEn, kL), + (Fjn.Nc = function () { + return A7(this), this.d.Nc(); + }), + EF(oEn, "AbstractMapBasedMultimap/WrappedSet", 1094), + Wfn(1103, 1, {}, u), + (Fjn.Kb = function (n) { + return (function (n) { + var t; + return (t = n.cd()), Vx(Yx(n.dd(), 14).Nc(), new Xf(t)); + })(Yx(n, 42)); + }), + EF(oEn, "AbstractMapBasedMultimap/lambda$1$Type", 1103), + Wfn(1102, 1, {}, Xf), + (Fjn.Kb = function (n) { + return new Wj(this.a, n); + }), + EF(oEn, "AbstractMapBasedMultimap/lambda$2$Type", 1102); + var ZKn, + n_n, + t_n, + e_n, + i_n = aR(lEn, "Map/Entry"); + Wfn(345, 1, kEn), + (Fjn.Fb = function (n) { + var t; + return !!CO(n, 42) && ((t = Yx(n, 42)), bB(this.cd(), t.cd()) && bB(this.dd(), t.dd())); + }), + (Fjn.Hb = function () { + var n, t; + return (n = this.cd()), (t = this.dd()), (null == n ? 0 : W5(n)) ^ (null == t ? 0 : W5(t)); + }), + (Fjn.ed = function (n) { + throw hp(new xp()); + }), + (Fjn.Ib = function () { + return this.cd() + "=" + this.dd(); + }), + EF(oEn, jEn, 345), + Wfn(1988, 28, wEn), + (Fjn.$b = function () { + this.fd().$b(); + }), + (Fjn.Hc = function (n) { + var t; + return ( + !!CO(n, 42) && + ((t = Yx(n, 42)), + (function (n, t, e) { + var i; + return !!(i = Yx(n.Zb().xc(t), 14)) && i.Hc(e); + })(this.fd(), t.cd(), t.dd())) + ); + }), + (Fjn.Mc = function (n) { + var t; + return !!CO(n, 42) && ((t = Yx(n, 42)), jU(this.fd(), t.cd(), t.dd())); + }), + (Fjn.gc = function () { + return this.fd().d; + }), + EF(oEn, "Multimaps/Entries", 1988), + Wfn(733, 1988, wEn, Wf), + (Fjn.Kc = function () { + return this.a.kc(); + }), + (Fjn.fd = function () { + return this.a; + }), + (Fjn.Nc = function () { + return this.a.lc(); + }), + EF(oEn, "AbstractMultimap/Entries", 733), + Wfn(734, 733, gEn, em), + (Fjn.Nc = function () { + return this.a.lc(); + }), + (Fjn.Fb = function (n) { + return _on(this, n); + }), + (Fjn.Hb = function () { + return O2(this); + }), + EF(oEn, "AbstractMultimap/EntrySet", 734), + Wfn(735, 28, wEn, Vf), + (Fjn.$b = function () { + this.a.$b(); + }), + (Fjn.Hc = function (n) { + return (function (n, t) { + var e; + for (e = n.Zb().Cc().Kc(); e.Ob(); ) if (Yx(e.Pb(), 14).Hc(t)) return !0; + return !1; + })(this.a, n); + }), + (Fjn.Kc = function () { + return this.a.nc(); + }), + (Fjn.gc = function () { + return this.a.d; + }), + (Fjn.Nc = function () { + return this.a.oc(); + }), + EF(oEn, "AbstractMultimap/Values", 735), + Wfn(1989, 28, { 835: 1, 20: 1, 28: 1, 14: 1 }), + (Fjn.Jc = function (n) { + MF(n), eH(this).Jc(new dl(n)); + }), + (Fjn.Nc = function () { + var n; + return lun((n = eH(this).Nc()), new y(), 64 | (1296 & n.qd()), this.a.d); + }), + (Fjn.Fc = function (n) { + return jy(), !0; + }), + (Fjn.Gc = function (n) { + return MF(this), MF(n), CO(n, 543) ? BU(Yx(n, 835)) : !n.dc() && zJ(this, n.Kc()); + }), + (Fjn.Hc = function (n) { + var t; + return ((t = Yx(x8(QH(this.a), n), 14)) ? t.gc() : 0) > 0; + }), + (Fjn.Fb = function (n) { + return (function (n, t) { + var e, i, r; + if (t === n) return !0; + if (CO(t, 543)) { + if (((r = Yx(t, 835)), n.a.d != r.a.d || eH(n).gc() != eH(r).gc())) return !1; + for (i = eH(r).Kc(); i.Ob(); ) if (Sz(n, (e = Yx(i.Pb(), 416)).a.cd()) != Yx(e.a.dd(), 14).gc()) return !1; + return !0; + } + return !1; + })(this, n); + }), + (Fjn.Hb = function () { + return W5(eH(this)); + }), + (Fjn.dc = function () { + return eH(this).dc(); + }), + (Fjn.Mc = function (n) { + return xhn(this, n, 1) > 0; + }), + (Fjn.Ib = function () { + return I7(eH(this)); + }), + EF(oEn, "AbstractMultiset", 1989), + Wfn(1991, 1970, gEn), + (Fjn.$b = function () { + v0(this.a.a); + }), + (Fjn.Hc = function (n) { + var t; + return !(!CO(n, 492) || ((t = Yx(n, 416)), Yx(t.a.dd(), 14).gc() <= 0 || Sz(this.a, t.a.cd()) != Yx(t.a.dd(), 14).gc())); + }), + (Fjn.Mc = function (n) { + var t, e, i; + return ( + !(!CO(n, 492) || ((t = (e = Yx(n, 416)).a.cd()), 0 == (i = Yx(e.a.dd(), 14).gc()))) && + (function (n, t, e) { + var i, r, c; + return ( + g0(e, "oldCount"), + g0(0, "newCount"), + ((i = Yx(x8(QH(n.a), t), 14)) ? i.gc() : 0) == e && + (g0(0, "count"), (c = -((r = Yx(x8(QH(n.a), t), 14)) ? r.gc() : 0)) > 0 ? jy() : c < 0 && xhn(n, t, -c), !0) + ); + })(this.a, t, i) + ); + }), + EF(oEn, "Multisets/EntrySet", 1991), + Wfn(1109, 1991, gEn, Qf), + (Fjn.Kc = function () { + return new Pm(_K(QH(this.a.a)).Kc()); + }), + (Fjn.gc = function () { + return QH(this.a.a).gc(); + }), + EF(oEn, "AbstractMultiset/EntrySet", 1109), + Wfn(619, 726, hEn), + (Fjn.hc = function () { + return this.gd(); + }), + (Fjn.jc = function () { + return this.hd(); + }), + (Fjn.cc = function (n) { + return this.jd(n); + }), + (Fjn.fc = function (n) { + return this.kd(n); + }), + (Fjn.Zb = function () { + return this.f || (this.f = this.ac()); + }), + (Fjn.hd = function () { + return XH(), XH(), SFn; + }), + (Fjn.Fb = function (n) { + return f6(this, n); + }), + (Fjn.jd = function (n) { + return Yx(_V(this, n), 21); + }), + (Fjn.kd = function (n) { + return Yx(h8(this, n), 21); + }), + (Fjn.mc = function (n) { + return XH(), new Ny(Yx(n, 21)); + }), + (Fjn.pc = function (n, t) { + return new kL(this, n, Yx(t, 21)); + }), + EF(oEn, "AbstractSetMultimap", 619), + Wfn(1657, 619, hEn), + (Fjn.hc = function () { + return new Vk(this.b); + }), + (Fjn.gd = function () { + return new Vk(this.b); + }), + (Fjn.jc = function () { + return LF(new Vk(this.b)); + }), + (Fjn.hd = function () { + return LF(new Vk(this.b)); + }), + (Fjn.cc = function (n) { + return Yx(Yx(_V(this, n), 21), 84); + }), + (Fjn.jd = function (n) { + return Yx(Yx(_V(this, n), 21), 84); + }), + (Fjn.fc = function (n) { + return Yx(Yx(h8(this, n), 21), 84); + }), + (Fjn.kd = function (n) { + return Yx(Yx(h8(this, n), 21), 84); + }), + (Fjn.mc = function (n) { + return CO(n, 271) ? LF(Yx(n, 271)) : (XH(), new CA(Yx(n, 84))); + }), + (Fjn.Zb = function () { + return ( + this.f || + (this.f = CO(this.c, 171) + ? new dL(this, Yx(this.c, 171)) + : CO(this.c, 161) + ? new wL(this, Yx(this.c, 161)) + : new Xj(this, this.c)) + ); + }), + (Fjn.pc = function (n, t) { + return CO(t, 271) ? new PC(this, n, Yx(t, 271)) : new yL(this, n, Yx(t, 84)); + }), + EF(oEn, "AbstractSortedSetMultimap", 1657), + Wfn(1658, 1657, hEn), + (Fjn.Zb = function () { + return Yx( + Yx( + this.f || + (this.f = CO(this.c, 171) + ? new dL(this, Yx(this.c, 171)) + : CO(this.c, 161) + ? new wL(this, Yx(this.c, 161)) + : new Xj(this, this.c)), + 161, + ), + 171, + ); + }), + (Fjn.ec = function () { + return Yx( + Yx( + this.i || + (this.i = CO(this.c, 171) + ? new Aj(this, Yx(this.c, 171)) + : CO(this.c, 161) + ? new Oj(this, Yx(this.c, 161)) + : new iA(this, this.c)), + 84, + ), + 271, + ); + }), + (Fjn.bc = function () { + return CO(this.c, 171) ? new Aj(this, Yx(this.c, 171)) : CO(this.c, 161) ? new Oj(this, Yx(this.c, 161)) : new iA(this, this.c); + }), + EF(oEn, "AbstractSortedKeySortedSetMultimap", 1658), + Wfn(2010, 1, { 1947: 1 }), + (Fjn.Fb = function (n) { + return (function (n, t) { + var e; + return t === n || (!!CO(t, 664) && ((e = Yx(t, 1947)), stn(n.g || (n.g = new Yf(n)), e.g || (e.g = new Yf(e))))); + })(this, n); + }), + (Fjn.Hb = function () { + return W4(this.g || (this.g = new Yf(this))); + }), + (Fjn.Ib = function () { + return Fan(this.f || (this.f = new uA(this))); + }), + EF(oEn, "AbstractTable", 2010), + Wfn(665, dEn, gEn, Yf), + (Fjn.$b = function () { + Ey(); + }), + (Fjn.Hc = function (n) { + var t, e; + return ( + !!CO(n, 468) && + ((t = Yx(n, 682)), !!(e = Yx(x8(PF(this.a), uI(t.c.e, t.b)), 83)) && D8(e.vc(), new Wj(uI(t.c.c, t.a), bQ(t.c, t.b, t.a)))) + ); + }), + (Fjn.Kc = function () { + return new rA((n = this.a), n.e.Hd().gc() * n.c.Hd().gc()); + var n; + }), + (Fjn.Mc = function (n) { + var t, e; + return ( + !!CO(n, 468) && + ((t = Yx(n, 682)), + !!(e = Yx(x8(PF(this.a), uI(t.c.e, t.b)), 83)) && + (function (n, t) { + MF(n); + try { + return n.Mc(t); + } catch (n) { + if (CO((n = j4(n)), 205) || CO(n, 173)) return !1; + throw hp(n); + } + })(e.vc(), new Wj(uI(t.c.c, t.a), bQ(t.c, t.b, t.a)))) + ); + }), + (Fjn.gc = function () { + return OR(this.a); + }), + (Fjn.Nc = function () { + return hR((n = this.a).e.Hd().gc() * n.c.Hd().gc(), 273, new Hf(n)); + var n; + }), + EF(oEn, "AbstractTable/CellSet", 665), + Wfn(1928, 28, wEn, Jf), + (Fjn.$b = function () { + Ey(); + }), + (Fjn.Hc = function (n) { + return (function (n, t) { + var e, i, r, c, a, u, o; + for (u = 0, o = (a = n.a).length; u < o; ++u) + for (r = 0, c = (i = a[u]).length; r < c; ++r) if (((e = i[r]), iI(t) === iI(e) || (null != t && Q8(t, e)))) return !0; + return !1; + })(this.a, n); + }), + (Fjn.Kc = function () { + return new cA((n = this.a), n.e.Hd().gc() * n.c.Hd().gc()); + var n; + }), + (Fjn.gc = function () { + return OR(this.a); + }), + (Fjn.Nc = function () { + return IU(this.a); + }), + EF(oEn, "AbstractTable/Values", 1928), + Wfn(1632, 1631, hEn), + EF(oEn, "ArrayListMultimapGwtSerializationDependencies", 1632), + Wfn(513, 1632, hEn, gy, Cz), + (Fjn.hc = function () { + return new pQ(this.a); + }), + (Fjn.a = 0), + EF(oEn, "ArrayListMultimap", 513), + Wfn(664, 2010, { 664: 1, 1947: 1, 3: 1 }, lfn), + EF(oEn, "ArrayTable", 664), + Wfn(1924, 386, sEn, rA), + (Fjn.Xb = function (n) { + return new v5(this.a, n); + }), + EF(oEn, "ArrayTable/1", 1924), + Wfn(1925, 1, {}, Hf), + (Fjn.ld = function (n) { + return new v5(this.a, n); + }), + EF(oEn, "ArrayTable/1methodref$getCell$Type", 1925), + Wfn(2011, 1, { 682: 1 }), + (Fjn.Fb = function (n) { + var t; + return ( + n === this || + (!!CO(n, 468) && + ((t = Yx(n, 682)), + bB(uI(this.c.e, this.b), uI(t.c.e, t.b)) && + bB(uI(this.c.c, this.a), uI(t.c.c, t.a)) && + bB(bQ(this.c, this.b, this.a), bQ(t.c, t.b, t.a)))) + ); + }), + (Fjn.Hb = function () { + return G6(x4(Gy(UKn, 1), iEn, 1, 5, [uI(this.c.e, this.b), uI(this.c.c, this.a), bQ(this.c, this.b, this.a)])); + }), + (Fjn.Ib = function () { + return "(" + uI(this.c.e, this.b) + "," + uI(this.c.c, this.a) + ")=" + bQ(this.c, this.b, this.a); + }), + EF(oEn, "Tables/AbstractCell", 2011), + Wfn(468, 2011, { 468: 1, 682: 1 }, v5), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.d = 0), + EF(oEn, "ArrayTable/2", 468), + Wfn(1927, 1, {}, qf), + (Fjn.ld = function (n) { + return FY(this.a, n); + }), + EF(oEn, "ArrayTable/2methodref$getValue$Type", 1927), + Wfn(1926, 386, sEn, cA), + (Fjn.Xb = function (n) { + return FY(this.a, n); + }), + EF(oEn, "ArrayTable/3", 1926), + Wfn(1979, 1967, bEn), + (Fjn.$b = function () { + vR(this.kc()); + }), + (Fjn.vc = function () { + return new pl(this); + }), + (Fjn.lc = function () { + return new uH(this.kc(), this.gc()); + }), + EF(oEn, "Maps/IteratorBasedAbstractMap", 1979), + Wfn(828, 1979, bEn), + (Fjn.$b = function () { + throw hp(new xp()); + }), + (Fjn._b = function (n) { + return Lk(this.c, n); + }), + (Fjn.kc = function () { + return new aA(this, this.c.b.c.gc()); + }), + (Fjn.lc = function () { + return hR(this.c.b.c.gc(), 16, new Gf(this)); + }), + (Fjn.xc = function (n) { + var t; + return (t = Yx(nx(this.c, n), 19)) ? this.nd(t.a) : null; + }), + (Fjn.dc = function () { + return this.c.b.c.dc(); + }), + (Fjn.ec = function () { + return RK(this.c); + }), + (Fjn.zc = function (n, t) { + var e; + if (!(e = Yx(nx(this.c, n), 19))) throw hp(new Qm(this.md() + " " + n + " not in " + RK(this.c))); + return this.od(e.a, t); + }), + (Fjn.Bc = function (n) { + throw hp(new xp()); + }), + (Fjn.gc = function () { + return this.c.b.c.gc(); + }), + EF(oEn, "ArrayTable/ArrayMap", 828), + Wfn(1923, 1, {}, Gf), + (Fjn.ld = function (n) { + return NF(this.a, n); + }), + EF(oEn, "ArrayTable/ArrayMap/0methodref$getEntry$Type", 1923), + Wfn(1921, 345, kEn, _j), + (Fjn.cd = function () { + return (n = this.a), (t = this.b), KK(RK(n.c)).Xb(t); + var n, t; + }), + (Fjn.dd = function () { + return this.a.nd(this.b); + }), + (Fjn.ed = function (n) { + return this.a.od(this.b, n); + }), + (Fjn.b = 0), + EF(oEn, "ArrayTable/ArrayMap/1", 1921), + Wfn(1922, 386, sEn, aA), + (Fjn.Xb = function (n) { + return NF(this.a, n); + }), + EF(oEn, "ArrayTable/ArrayMap/2", 1922), + Wfn(1920, 828, bEn, j_), + (Fjn.md = function () { + return "Column"; + }), + (Fjn.nd = function (n) { + return bQ(this.b, this.a, n); + }), + (Fjn.od = function (n, t) { + return N4(this.b, this.a, n, t); + }), + (Fjn.a = 0), + EF(oEn, "ArrayTable/Row", 1920), + Wfn(829, 828, bEn, uA), + (Fjn.nd = function (n) { + return new j_(this.a, n); + }), + (Fjn.zc = function (n, t) { + return ( + Yx(t, 83), + (function () { + throw hp(new xp()); + })() + ); + }), + (Fjn.od = function (n, t) { + return ( + Yx(t, 83), + (function () { + throw hp(new xp()); + })() + ); + }), + (Fjn.md = function () { + return "Row"; + }), + EF(oEn, "ArrayTable/RowMap", 829), + Wfn(1120, 1, SEn, Fj), + (Fjn.qd = function () { + return -262 & this.a.qd(); + }), + (Fjn.rd = function () { + return this.a.rd(); + }), + (Fjn.Nb = function (n) { + this.a.Nb(new xj(n, this.b)); + }), + (Fjn.sd = function (n) { + return this.a.sd(new Nj(n, this.b)); + }), + EF(oEn, "CollectSpliterators/1", 1120), + Wfn(1121, 1, PEn, Nj), + (Fjn.td = function (n) { + this.a.td(this.b.Kb(n)); + }), + EF(oEn, "CollectSpliterators/1/lambda$0$Type", 1121), + Wfn(1122, 1, PEn, xj), + (Fjn.td = function (n) { + this.a.td(this.b.Kb(n)); + }), + EF(oEn, "CollectSpliterators/1/lambda$1$Type", 1122), + Wfn(1123, 1, SEn, bX), + (Fjn.qd = function () { + return this.a; + }), + (Fjn.rd = function () { + return this.d && (this.b = iO(this.b, this.d.rd())), iO(this.b, 0); + }), + (Fjn.Nb = function (n) { + this.d && (this.d.Nb(n), (this.d = null)), this.c.Nb(new Lj(this.e, n)), (this.b = 0); + }), + (Fjn.sd = function (n) { + for (;;) { + if (this.d && this.d.sd(n)) return hI(this.b, IEn) && (this.b = n7(this.b, 1)), !0; + if (((this.d = null), !this.c.sd(new Dj(this, this.e)))) return !1; + } + }), + (Fjn.a = 0), + (Fjn.b = 0), + EF(oEn, "CollectSpliterators/1FlatMapSpliterator", 1123), + Wfn(1124, 1, PEn, Dj), + (Fjn.td = function (n) { + !(function (n, t, e) { + n.d = Yx(t.Kb(e), 164); + })(this.a, this.b, n); + }), + EF(oEn, "CollectSpliterators/1FlatMapSpliterator/lambda$0$Type", 1124), + Wfn(1125, 1, PEn, Lj), + (Fjn.td = function (n) { + !(function (n, t, e) { + Yx(n.Kb(e), 164).Nb(t); + })(this.b, this.a, n); + }), + EF(oEn, "CollectSpliterators/1FlatMapSpliterator/lambda$1$Type", 1125), + Wfn(1117, 1, SEn, xN), + (Fjn.qd = function () { + return 16464 | this.b; + }), + (Fjn.rd = function () { + return this.a.rd(); + }), + (Fjn.Nb = function (n) { + this.a.xe(new Kj(n, this.c)); + }), + (Fjn.sd = function (n) { + return this.a.ye(new Rj(n, this.c)); + }), + (Fjn.b = 0), + EF(oEn, "CollectSpliterators/1WithCharacteristics", 1117), + Wfn(1118, 1, CEn, Rj), + (Fjn.ud = function (n) { + this.a.td(this.b.ld(n)); + }), + EF(oEn, "CollectSpliterators/1WithCharacteristics/lambda$0$Type", 1118), + Wfn(1119, 1, CEn, Kj), + (Fjn.ud = function (n) { + this.a.td(this.b.ld(n)); + }), + EF(oEn, "CollectSpliterators/1WithCharacteristics/lambda$1$Type", 1119), + Wfn(245, 1, OEn), + (Fjn.wd = function (n) { + return this.vd(Yx(n, 245)); + }), + (Fjn.vd = function (n) { + var t; + return n == (wm(), n_n) + ? 1 + : n == (dm(), ZKn) + ? -1 + : (JD(), 0 != (t = u3(this.a, n.a)) ? t : CO(this, 519) == CO(n, 519) ? 0 : CO(this, 519) ? 1 : -1); + }), + (Fjn.zd = function () { + return this.a; + }), + (Fjn.Fb = function (n) { + return Gnn(this, n); + }), + EF(oEn, "Cut", 245), + Wfn(1761, 245, OEn, Ry), + (Fjn.vd = function (n) { + return n == this ? 0 : 1; + }), + (Fjn.xd = function (n) { + throw hp(new Ip()); + }), + (Fjn.yd = function (n) { + n.a += "+∞)"; + }), + (Fjn.zd = function () { + throw hp(new Ym(AEn)); + }), + (Fjn.Hb = function () { + return oE(), Nen(this); + }), + (Fjn.Ad = function (n) { + return !1; + }), + (Fjn.Ib = function () { + return "+∞"; + }), + EF(oEn, "Cut/AboveAll", 1761), + Wfn(519, 245, { 245: 1, 519: 1, 3: 1, 35: 1 }, pA), + (Fjn.xd = function (n) { + mI(((n.a += "("), n), this.a); + }), + (Fjn.yd = function (n) { + _F(mI(n, this.a), 93); + }), + (Fjn.Hb = function () { + return ~W5(this.a); + }), + (Fjn.Ad = function (n) { + return JD(), u3(this.a, n) < 0; + }), + (Fjn.Ib = function () { + return "/" + this.a + "\\"; + }), + EF(oEn, "Cut/AboveValue", 519), + Wfn(1760, 245, OEn, Ky), + (Fjn.vd = function (n) { + return n == this ? 0 : -1; + }), + (Fjn.xd = function (n) { + n.a += "(-∞"; + }), + (Fjn.yd = function (n) { + throw hp(new Ip()); + }), + (Fjn.zd = function () { + throw hp(new Ym(AEn)); + }), + (Fjn.Hb = function () { + return oE(), Nen(this); + }), + (Fjn.Ad = function (n) { + return !0; + }), + (Fjn.Ib = function () { + return "-∞"; + }), + EF(oEn, "Cut/BelowAll", 1760), + Wfn(1762, 245, OEn, vA), + (Fjn.xd = function (n) { + mI(((n.a += "["), n), this.a); + }), + (Fjn.yd = function (n) { + _F(mI(n, this.a), 41); + }), + (Fjn.Hb = function () { + return W5(this.a); + }), + (Fjn.Ad = function (n) { + return JD(), u3(this.a, n) <= 0; + }), + (Fjn.Ib = function () { + return "\\" + this.a + "/"; + }), + EF(oEn, "Cut/BelowValue", 1762), + Wfn(537, 1, $En), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Ib = function () { + return (function (n) { + var t, e; + for (e = _F(new Ay(), 91), t = !0; n.Ob(); ) t || (e.a += tEn), (t = !1), mI(e, n.Pb()); + return ((e.a += "]"), e).a; + })(Yx(rq(this, "use Optional.orNull() instead of Optional.or(null)"), 20).Kc()); + }), + EF(oEn, "FluentIterable", 537), + Wfn(433, 537, $En, KI), + (Fjn.Kc = function () { + return new $K(bA(this.a.Kc(), new h())); + }), + EF(oEn, "FluentIterable/2", 433), + Wfn(1046, 537, $En, _I), + (Fjn.Kc = function () { + return W_(this); + }), + EF(oEn, "FluentIterable/3", 1046), + Wfn(708, 386, sEn, sA), + (Fjn.Xb = function (n) { + return this.a[n].Kc(); + }), + EF(oEn, "FluentIterable/3/1", 708), + Wfn(1972, 1, {}), + (Fjn.Ib = function () { + return I7(this.Bd().b); + }), + EF(oEn, "ForwardingObject", 1972), + Wfn(1973, 1972, LEn), + (Fjn.Bd = function () { + return this.Cd(); + }), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Lc = function () { + return this.Oc(); + }), + (Fjn.Nc = function () { + return new Nz(this, 0); + }), + (Fjn.Oc = function () { + return new SR(null, this.Nc()); + }), + (Fjn.Fc = function (n) { + return this.Cd(), Hk(); + }), + (Fjn.Gc = function (n) { + return this.Cd(), qk(); + }), + (Fjn.$b = function () { + this.Cd(), Gk(); + }), + (Fjn.Hc = function (n) { + return this.Cd().Hc(n); + }), + (Fjn.Ic = function (n) { + return this.Cd().Ic(n); + }), + (Fjn.dc = function () { + return this.Cd().b.dc(); + }), + (Fjn.Kc = function () { + return this.Cd().Kc(); + }), + (Fjn.Mc = function (n) { + return this.Cd(), zk(); + }), + (Fjn.gc = function () { + return this.Cd().b.gc(); + }), + (Fjn.Pc = function () { + return this.Cd().Pc(); + }), + (Fjn.Qc = function (n) { + return this.Cd().Qc(n); + }), + EF(oEn, "ForwardingCollection", 1973), + Wfn(1980, 28, NEn), + (Fjn.Kc = function () { + return this.Ed(); + }), + (Fjn.Fc = function (n) { + throw hp(new xp()); + }), + (Fjn.Gc = function (n) { + throw hp(new xp()); + }), + (Fjn.$b = function () { + throw hp(new xp()); + }), + (Fjn.Hc = function (n) { + return null != n && V7(this, n, !1); + }), + (Fjn.Dd = function () { + switch (this.gc()) { + case 0: + return VF(), VF(), t_n; + case 1: + return VF(), new pR(MF(this.Ed().Pb())); + default: + return new E_(this, this.Pc()); + } + }), + (Fjn.Mc = function (n) { + throw hp(new xp()); + }), + EF(oEn, "ImmutableCollection", 1980), + Wfn(712, 1980, NEn, jp), + (Fjn.Kc = function () { + return PY(this.a.Kc()); + }), + (Fjn.Hc = function (n) { + return null != n && this.a.Hc(n); + }), + (Fjn.Ic = function (n) { + return this.a.Ic(n); + }), + (Fjn.dc = function () { + return this.a.dc(); + }), + (Fjn.Ed = function () { + return PY(this.a.Kc()); + }), + (Fjn.gc = function () { + return this.a.gc(); + }), + (Fjn.Pc = function () { + return this.a.Pc(); + }), + (Fjn.Qc = function (n) { + return this.a.Qc(n); + }), + (Fjn.Ib = function () { + return I7(this.a); + }), + EF(oEn, "ForwardingImmutableCollection", 712), + Wfn(152, 1980, xEn), + (Fjn.Kc = function () { + return this.Ed(); + }), + (Fjn.Yc = function () { + return this.Fd(0); + }), + (Fjn.Zc = function (n) { + return this.Fd(n); + }), + (Fjn.ad = function (n) { + I2(this, n); + }), + (Fjn.Nc = function () { + return new Nz(this, 16); + }), + (Fjn.bd = function (n, t) { + return this.Gd(n, t); + }), + (Fjn.Vc = function (n, t) { + throw hp(new xp()); + }), + (Fjn.Wc = function (n, t) { + throw hp(new xp()); + }), + (Fjn.Fb = function (n) { + return pln(this, n); + }), + (Fjn.Hb = function () { + return (function (n) { + var t, e, i; + for (t = 1, i = n.Kc(); i.Ob(); ) t = ~~(t = 31 * t + (null == (e = i.Pb()) ? 0 : W5(e))); + return t; + })(this); + }), + (Fjn.Xc = function (n) { + return null == n + ? -1 + : (function (n, t) { + var e, i; + if (((i = n.gc()), null == t)) { + for (e = 0; e < i; e++) if (null == n.Xb(e)) return e; + } else for (e = 0; e < i; e++) if (Q8(t, n.Xb(e))) return e; + return -1; + })(this, n); + }), + (Fjn.Ed = function () { + return this.Fd(0); + }), + (Fjn.Fd = function (n) { + return c$(this, n); + }), + (Fjn.$c = function (n) { + throw hp(new xp()); + }), + (Fjn._c = function (n, t) { + throw hp(new xp()); + }), + (Fjn.Gd = function (n, t) { + return $8(new Oz(new cE(this), n, t)); + }), + EF(oEn, "ImmutableList", 152), + Wfn(2006, 152, xEn), + (Fjn.Kc = function () { + return PY(this.Hd().Kc()); + }), + (Fjn.bd = function (n, t) { + return $8(this.Hd().bd(n, t)); + }), + (Fjn.Hc = function (n) { + return null != n && this.Hd().Hc(n); + }), + (Fjn.Ic = function (n) { + return this.Hd().Ic(n); + }), + (Fjn.Fb = function (n) { + return Q8(this.Hd(), n); + }), + (Fjn.Xb = function (n) { + return uI(this, n); + }), + (Fjn.Hb = function () { + return W5(this.Hd()); + }), + (Fjn.Xc = function (n) { + return this.Hd().Xc(n); + }), + (Fjn.dc = function () { + return this.Hd().dc(); + }), + (Fjn.Ed = function () { + return PY(this.Hd().Kc()); + }), + (Fjn.gc = function () { + return this.Hd().gc(); + }), + (Fjn.Gd = function (n, t) { + return $8(this.Hd().bd(n, t)); + }), + (Fjn.Pc = function () { + return this.Hd().Qc(VQ(UKn, iEn, 1, this.Hd().gc(), 5, 1)); + }), + (Fjn.Qc = function (n) { + return this.Hd().Qc(n); + }), + (Fjn.Ib = function () { + return I7(this.Hd()); + }), + EF(oEn, "ForwardingImmutableList", 2006), + Wfn(714, 1, REn), + (Fjn.vc = function () { + return DK(this); + }), + (Fjn.wc = function (n) { + S3(this, n); + }), + (Fjn.ec = function () { + return RK(this); + }), + (Fjn.yc = function (n, t, e) { + return Y9(this, n, t, e); + }), + (Fjn.Cc = function () { + return this.Ld(); + }), + (Fjn.$b = function () { + throw hp(new xp()); + }), + (Fjn._b = function (n) { + return null != this.xc(n); + }), + (Fjn.uc = function (n) { + return this.Ld().Hc(n); + }), + (Fjn.Jd = function () { + return new Ep(this); + }), + (Fjn.Kd = function () { + return new Tp(this); + }), + (Fjn.Fb = function (n) { + return (function (n, t) { + var e; + return n === t || (!!CO(t, 83) && ((e = Yx(t, 83)), _on(DK(n), e.vc()))); + })(this, n); + }), + (Fjn.Hb = function () { + return DK(this).Hb(); + }), + (Fjn.dc = function () { + return 0 == this.gc(); + }), + (Fjn.zc = function (n, t) { + return (function () { + throw hp(new xp()); + })(); + }), + (Fjn.Bc = function (n) { + throw hp(new xp()); + }), + (Fjn.Ib = function () { + return (function (n) { + var t, e, i, r; + for (r = _F((g0(n.gc(), "size"), new $y()), 123), i = !0, e = DK(n).Kc(); e.Ob(); ) + (t = Yx(e.Pb(), 42)), i || (r.a += tEn), (i = !1), mI(_F(mI(r, t.cd()), 61), t.dd()); + return ((r.a += "}"), r).a; + })(this); + }), + (Fjn.Ld = function () { + return this.e ? this.e : (this.e = this.Kd()); + }), + (Fjn.c = null), + (Fjn.d = null), + (Fjn.e = null), + EF(oEn, "ImmutableMap", 714), + Wfn(715, 714, REn), + (Fjn._b = function (n) { + return Lk(this, n); + }), + (Fjn.uc = function (n) { + return dE(this.b, n); + }), + (Fjn.Id = function () { + return L8(new nl(this)); + }), + (Fjn.Jd = function () { + return L8(BB(this.b)); + }), + (Fjn.Kd = function () { + return px(), new jp(_B(this.b)); + }), + (Fjn.Fb = function (n) { + return pE(this.b, n); + }), + (Fjn.xc = function (n) { + return nx(this, n); + }), + (Fjn.Hb = function () { + return W5(this.b.c); + }), + (Fjn.dc = function () { + return this.b.c.dc(); + }), + (Fjn.gc = function () { + return this.b.c.gc(); + }), + (Fjn.Ib = function () { + return I7(this.b.c); + }), + EF(oEn, "ForwardingImmutableMap", 715), + Wfn(1974, 1973, KEn), + (Fjn.Bd = function () { + return this.Md(); + }), + (Fjn.Cd = function () { + return this.Md(); + }), + (Fjn.Nc = function () { + return new Nz(this, 1); + }), + (Fjn.Fb = function (n) { + return n === this || this.Md().Fb(n); + }), + (Fjn.Hb = function () { + return this.Md().Hb(); + }), + EF(oEn, "ForwardingSet", 1974), + Wfn(1069, 1974, KEn, nl), + (Fjn.Bd = function () { + return FB(this.a.b); + }), + (Fjn.Cd = function () { + return FB(this.a.b); + }), + (Fjn.Hc = function (n) { + if (CO(n, 42) && null == Yx(n, 42).cd()) return !1; + try { + return wE(FB(this.a.b), n); + } catch (n) { + if (CO((n = j4(n)), 205)) return !1; + throw hp(n); + } + }), + (Fjn.Md = function () { + return FB(this.a.b); + }), + (Fjn.Qc = function (n) { + var t; + return (t = Nq(FB(this.a.b), n)), FB(this.a.b).b.gc() < t.length && DF(t, FB(this.a.b).b.gc(), null), t; + }), + EF(oEn, "ForwardingImmutableMap/1", 1069), + Wfn(1981, 1980, _En), + (Fjn.Kc = function () { + return this.Ed(); + }), + (Fjn.Nc = function () { + return new Nz(this, 1); + }), + (Fjn.Fb = function (n) { + return _on(this, n); + }), + (Fjn.Hb = function () { + return O2(this); + }), + EF(oEn, "ImmutableSet", 1981), + Wfn(703, 1981, _En), + (Fjn.Kc = function () { + return PY(new lb(this.a.b.Kc())); + }), + (Fjn.Hc = function (n) { + return null != n && fE(this.a, n); + }), + (Fjn.Ic = function (n) { + return lE(this.a, n); + }), + (Fjn.Hb = function () { + return W5(this.a.b); + }), + (Fjn.dc = function () { + return this.a.b.dc(); + }), + (Fjn.Ed = function () { + return PY(new lb(this.a.b.Kc())); + }), + (Fjn.gc = function () { + return this.a.b.gc(); + }), + (Fjn.Pc = function () { + return this.a.b.Pc(); + }), + (Fjn.Qc = function (n) { + return bE(this.a, n); + }), + (Fjn.Ib = function () { + return I7(this.a.b); + }), + EF(oEn, "ForwardingImmutableSet", 703), + Wfn(1975, 1974, FEn), + (Fjn.Bd = function () { + return this.b; + }), + (Fjn.Cd = function () { + return this.b; + }), + (Fjn.Md = function () { + return this.b; + }), + (Fjn.Nc = function () { + return new RT(this); + }), + EF(oEn, "ForwardingSortedSet", 1975), + Wfn(533, 1979, REn, iin), + (Fjn.Ac = function (n) { + i3(this, n); + }), + (Fjn.Cc = function () { + return new QC(this.d || (this.d = new tl(this))); + }), + (Fjn.$b = function () { + tV(this); + }), + (Fjn._b = function (n) { + return !!K2(this, n, WR(e7(BEn, HB(WR(e7(null == n ? 0 : W5(n), HEn)), 15)))); + }), + (Fjn.uc = function (n) { + return QZ(this, n); + }), + (Fjn.kc = function () { + return new hA(this, this); + }), + (Fjn.wc = function (n) { + yG(this, n); + }), + (Fjn.xc = function (n) { + return g1(this, n); + }), + (Fjn.ec = function () { + return new YC(this); + }), + (Fjn.zc = function (n, t) { + return Sgn(this, n, t); + }), + (Fjn.Bc = function (n) { + var t; + return (t = K2(this, n, WR(e7(BEn, HB(WR(e7(null == n ? 0 : W5(n), HEn)), 15))))) + ? (ybn(this, t), (t.e = null), (t.c = null), t.i) + : null; + }), + (Fjn.gc = function () { + return this.i; + }), + (Fjn.pd = function () { + return new QC(this.d || (this.d = new tl(this))); + }), + (Fjn.f = 0), + (Fjn.g = 0), + (Fjn.i = 0), + EF(oEn, "HashBiMap", 533), + Wfn(534, 1, fEn), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return PX(this); + }), + (Fjn.Pb = function () { + var n; + if (!PX(this)) throw hp(new Kp()); + return (n = this.c), (this.c = n.c), (this.f = n), --this.d, this.Nd(n); + }), + (Fjn.Qb = function () { + if (this.e.g != this.b) throw hp(new Dp()); + x3(!!this.f), ybn(this.e, this.f), (this.b = this.e.g), (this.f = null); + }), + (Fjn.b = 0), + (Fjn.d = 0), + (Fjn.f = null), + EF(oEn, "HashBiMap/Itr", 534), + Wfn(1011, 534, fEn, hA), + (Fjn.Nd = function (n) { + return new qj(this, n); + }), + EF(oEn, "HashBiMap/1", 1011), + Wfn(1012, 345, kEn, qj), + (Fjn.cd = function () { + return this.a.g; + }), + (Fjn.dd = function () { + return this.a.i; + }), + (Fjn.ed = function (n) { + var t, e, i; + return ( + (e = this.a.i), + (i = WR(e7(BEn, HB(WR(e7(null == n ? 0 : W5(n), HEn)), 15)))) == this.a.f && (iI(n) === iI(e) || (null != n && Q8(n, e))) + ? n + : (I4(!_2(this.b.a, n, i), n), + ybn(this.b.a, this.a), + (t = new CB(this.a.g, this.a.a, n, i)), + phn(this.b.a, t, this.a), + (this.a.e = null), + (this.a.c = null), + (this.b.b = this.b.a.g), + this.b.f == this.a && (this.b.f = t), + (this.a = t), + e) + ); + }), + EF(oEn, "HashBiMap/1/MapEntry", 1012), + Wfn(238, 345, { 345: 1, 238: 1, 3: 1, 42: 1 }, Wj), + (Fjn.cd = function () { + return this.g; + }), + (Fjn.dd = function () { + return this.i; + }), + (Fjn.ed = function (n) { + throw hp(new xp()); + }), + EF(oEn, "ImmutableEntry", 238), + Wfn(317, 238, { 345: 1, 317: 1, 238: 1, 3: 1, 42: 1 }, CB), + (Fjn.a = 0), + (Fjn.f = 0); + var r_n, + c_n = EF(oEn, "HashBiMap/BiEntry", 317); + Wfn(610, 1979, REn, tl), + (Fjn.Ac = function (n) { + i3(this, n); + }), + (Fjn.Cc = function () { + return new YC(this.a); + }), + (Fjn.$b = function () { + tV(this.a); + }), + (Fjn._b = function (n) { + return QZ(this.a, n); + }), + (Fjn.kc = function () { + return new fA(this, this.a); + }), + (Fjn.wc = function (n) { + MF(n), yG(this.a, new el(n)); + }), + (Fjn.xc = function (n) { + return z0(this, n); + }), + (Fjn.ec = function () { + return new QC(this); + }), + (Fjn.zc = function (n, t) { + return (function (n, t, e, i) { + var r, c, a, u; + if ( + ((u = WR(e7(BEn, HB(WR(e7(null == t ? 0 : W5(t), HEn)), 15)))), + (r = WR(e7(BEn, HB(WR(e7(null == e ? 0 : W5(e), HEn)), 15)))), + (a = _2(n, t, u)), + (c = K2(n, e, r)), + a && r == a.a && bB(e, a.g)) + ) + return e; + if (c && !i) throw hp(new Qm("key already present: " + e)); + return ( + a && ybn(n, a), + c && ybn(n, c), + phn(n, new CB(e, r, t, u), c), + c && ((c.e = null), (c.c = null)), + a && ((a.e = null), (a.c = null)), + kcn(n), + a ? a.g : null + ); + })(this.a, n, t, !1); + }), + (Fjn.Bc = function (n) { + var t; + return (t = _2(this.a, n, WR(e7(BEn, HB(WR(e7(null == n ? 0 : W5(n), HEn)), 15))))) + ? (ybn(this.a, t), (t.e = null), (t.c = null), t.g) + : null; + }), + (Fjn.gc = function () { + return this.a.i; + }), + (Fjn.pd = function () { + return new YC(this.a); + }), + EF(oEn, "HashBiMap/Inverse", 610), + Wfn(1008, 534, fEn, fA), + (Fjn.Nd = function (n) { + return new Gj(this, n); + }), + EF(oEn, "HashBiMap/Inverse/1", 1008), + Wfn(1009, 345, kEn, Gj), + (Fjn.cd = function () { + return this.a.i; + }), + (Fjn.dd = function () { + return this.a.g; + }), + (Fjn.ed = function (n) { + var t, e, i; + return ( + (i = this.a.g), + (t = WR(e7(BEn, HB(WR(e7(null == n ? 0 : W5(n), HEn)), 15)))) == this.a.a && (iI(n) === iI(i) || (null != n && Q8(n, i))) + ? n + : (I4(!K2(this.b.a.a, n, t), n), + ybn(this.b.a.a, this.a), + (e = new CB(n, t, this.a.i, this.a.f)), + (this.a = e), + phn(this.b.a.a, e, null), + (this.b.b = this.b.a.a.g), + i) + ); + }), + EF(oEn, "HashBiMap/Inverse/1/InverseEntry", 1009), + Wfn(611, 532, gEn, QC), + (Fjn.Kc = function () { + return new ym(this.a.a); + }), + (Fjn.Mc = function (n) { + var t; + return !!(t = _2(this.a.a, n, WR(e7(BEn, HB(WR(e7(null == n ? 0 : W5(n), HEn)), 15))))) && (ybn(this.a.a, t), !0); + }), + EF(oEn, "HashBiMap/Inverse/InverseKeySet", 611), + Wfn(1007, 534, fEn, ym), + (Fjn.Nd = function (n) { + return n.i; + }), + EF(oEn, "HashBiMap/Inverse/InverseKeySet/1", 1007), + Wfn(1010, 1, {}, el), + (Fjn.Od = function (n, t) { + !(function (n, t, e) { + n.Od(e, t); + })(this.a, n, t); + }), + EF(oEn, "HashBiMap/Inverse/lambda$0$Type", 1010), + Wfn(609, 532, gEn, YC), + (Fjn.Kc = function () { + return new km(this.a); + }), + (Fjn.Mc = function (n) { + var t; + return ( + !!(t = K2(this.a, n, WR(e7(BEn, HB(WR(e7(null == n ? 0 : W5(n), HEn)), 15))))) && + (ybn(this.a, t), (t.e = null), (t.c = null), !0) + ); + }), + EF(oEn, "HashBiMap/KeySet", 609), + Wfn(1006, 534, fEn, km), + (Fjn.Nd = function (n) { + return n.g; + }), + EF(oEn, "HashBiMap/KeySet/1", 1006), + Wfn(1093, 619, hEn), + EF(oEn, "HashMultimapGwtSerializationDependencies", 1093), + Wfn(265, 1093, hEn, Zq), + (Fjn.hc = function () { + return new Xk(IZ(this.a)); + }), + (Fjn.gd = function () { + return new Xk(IZ(this.a)); + }), + (Fjn.a = 2), + EF(oEn, "HashMultimap", 265), + Wfn(1999, 152, xEn), + (Fjn.Hc = function (n) { + return this.Pd().Hc(n); + }), + (Fjn.dc = function () { + return this.Pd().dc(); + }), + (Fjn.gc = function () { + return this.Pd().gc(); + }), + EF(oEn, "ImmutableAsList", 1999), + Wfn(1931, 715, REn), + (Fjn.Ld = function () { + return px(), new My(this.a); + }), + (Fjn.Cc = function () { + return px(), new My(this.a); + }), + (Fjn.pd = function () { + return px(), new My(this.a); + }), + EF(oEn, "ImmutableBiMap", 1931), + Wfn(1977, 1, {}), + EF(oEn, "ImmutableCollection/Builder", 1977), + Wfn(1022, 703, _En, jm), + EF(oEn, "ImmutableEnumSet", 1022), + Wfn(969, 386, sEn, NN), + (Fjn.Xb = function (n) { + return this.a.Xb(n); + }), + EF(oEn, "ImmutableList/1", 969), + Wfn(968, 1977, {}, zL), + EF(oEn, "ImmutableList/Builder", 968), + Wfn(614, 198, uEn, il), + (Fjn.Ob = function () { + return this.a.Ob(); + }), + (Fjn.Pb = function () { + return Yx(this.a.Pb(), 42).cd(); + }), + EF(oEn, "ImmutableMap/1", 614), + Wfn(1041, 1, {}, o), + (Fjn.Kb = function (n) { + return Yx(n, 42).cd(); + }), + EF(oEn, "ImmutableMap/2methodref$getKey$Type", 1041), + Wfn(1040, 1, {}, UL), + EF(oEn, "ImmutableMap/Builder", 1040), + Wfn(2e3, 1981, _En), + (Fjn.Kc = function () { + return new il(DK(this.a).Ed()); + }), + (Fjn.Dd = function () { + return new Mp(this); + }), + (Fjn.Jc = function (n) { + var t, e; + for (MF(n), e = this.gc(), t = 0; t < e; t++) n.td(Yx(KK(DK(this.a)).Xb(t), 42).cd()); + }), + (Fjn.Ed = function () { + var n; + return ((n = this.c), n || (this.c = new Mp(this))).Ed(); + }), + (Fjn.Nc = function () { + return hR(this.gc(), 1296, new cl(this)); + }), + EF(oEn, "IndexedImmutableSet", 2e3), + Wfn(1180, 2e3, _En, Ep), + (Fjn.Kc = function () { + return new il(DK(this.a).Ed()); + }), + (Fjn.Hc = function (n) { + return this.a._b(n); + }), + (Fjn.Jc = function (n) { + MF(n), S3(this.a, new rl(n)); + }), + (Fjn.Ed = function () { + return new il(DK(this.a).Ed()); + }), + (Fjn.gc = function () { + return this.a.gc(); + }), + (Fjn.Nc = function () { + return Vx(DK(this.a).Nc(), new o()); + }), + EF(oEn, "ImmutableMapKeySet", 1180), + Wfn(1181, 1, {}, rl), + (Fjn.Od = function (n, t) { + px(), this.a.td(n); + }), + EF(oEn, "ImmutableMapKeySet/lambda$0$Type", 1181), + Wfn(1178, 1980, NEn, Tp), + (Fjn.Kc = function () { + return new FD(this); + }), + (Fjn.Hc = function (n) { + return ( + null != n && + (function (n, t) { + if (null == t) { + for (; n.a.Ob(); ) if (null == Yx(n.a.Pb(), 42).dd()) return !0; + } else for (; n.a.Ob(); ) if (Q8(t, Yx(n.a.Pb(), 42).dd())) return !0; + return !1; + })(new FD(this), n) + ); + }), + (Fjn.Ed = function () { + return new FD(this); + }), + (Fjn.gc = function () { + return this.a.gc(); + }), + (Fjn.Nc = function () { + return Vx(DK(this.a).Nc(), new s()); + }), + EF(oEn, "ImmutableMapValues", 1178), + Wfn(1179, 1, {}, s), + (Fjn.Kb = function (n) { + return Yx(n, 42).dd(); + }), + EF(oEn, "ImmutableMapValues/0methodref$getValue$Type", 1179), + Wfn(626, 198, uEn, FD), + (Fjn.Ob = function () { + return this.a.Ob(); + }), + (Fjn.Pb = function () { + return Yx(this.a.Pb(), 42).dd(); + }), + EF(oEn, "ImmutableMapValues/1", 626), + Wfn(1182, 1, {}, cl), + (Fjn.ld = function (n) { + return J_(this.a, n); + }), + EF(oEn, "IndexedImmutableSet/0methodref$get$Type", 1182), + Wfn(752, 1999, xEn, Mp), + (Fjn.Pd = function () { + return this.a; + }), + (Fjn.Xb = function (n) { + return J_(this.a, n); + }), + (Fjn.gc = function () { + return this.a.a.gc(); + }), + EF(oEn, "IndexedImmutableSet/1", 752), + Wfn(44, 1, {}, h), + (Fjn.Kb = function (n) { + return Yx(n, 20).Kc(); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + EF(oEn, "Iterables/10", 44), + Wfn(1042, 537, $En, BD), + (Fjn.Jc = function (n) { + MF(n), this.b.Jc(new zj(this.a, n)); + }), + (Fjn.Kc = function () { + return xC(this); + }), + EF(oEn, "Iterables/4", 1042), + Wfn(1043, 1, PEn, zj), + (Fjn.td = function (n) { + !(function (n, t, e) { + n.Mb(e) && t.td(e); + })(this.b, this.a, n); + }), + EF(oEn, "Iterables/4/lambda$0$Type", 1043), + Wfn(1044, 537, $En, HD), + (Fjn.Jc = function (n) { + MF(n), XW(this.a, new Bj(n, this.b)); + }), + (Fjn.Kc = function () { + return bA(new UO(this.a), this.b); + }), + EF(oEn, "Iterables/5", 1044), + Wfn(1045, 1, PEn, Bj), + (Fjn.td = function (n) { + this.a.td(pC(n)); + }), + EF(oEn, "Iterables/5/lambda$0$Type", 1045), + Wfn(1071, 198, uEn, al), + (Fjn.Ob = function () { + return this.a.Ob(); + }), + (Fjn.Pb = function () { + return this.a.Pb(); + }), + EF(oEn, "Iterators/1", 1071), + Wfn(1072, 699, uEn, Hj), + (Fjn.Yb = function () { + for (var n; this.b.Ob(); ) if (((n = this.b.Pb()), this.a.Lb(n))) return n; + return (this.e = 2), null; + }), + EF(oEn, "Iterators/5", 1072), + Wfn(487, 1, fEn), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return this.b.Ob(); + }), + (Fjn.Pb = function () { + return this.Qd(this.b.Pb()); + }), + (Fjn.Qb = function () { + this.b.Qb(); + }), + EF(oEn, "TransformedIterator", 487), + Wfn(1073, 487, fEn, wA), + (Fjn.Qd = function (n) { + return this.a.Kb(n); + }), + EF(oEn, "Iterators/6", 1073), + Wfn(717, 198, uEn, ul), + (Fjn.Ob = function () { + return !this.a; + }), + (Fjn.Pb = function () { + if (this.a) throw hp(new Kp()); + return (this.a = !0), this.b; + }), + (Fjn.a = !1), + EF(oEn, "Iterators/9", 717), + Wfn(1070, 386, sEn, GR), + (Fjn.Xb = function (n) { + return this.a[this.b + n]; + }), + (Fjn.b = 0), + EF(oEn, "Iterators/ArrayItr", 1070), + Wfn(39, 1, { 39: 1, 47: 1 }, $K), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return Vfn(this); + }), + (Fjn.Pb = function () { + return kV(this); + }), + (Fjn.Qb = function () { + x3(!!this.c), this.c.Qb(), (this.c = null); + }), + EF(oEn, "Iterators/ConcatenatedIterator", 39), + Wfn(22, 1, { 3: 1, 35: 1, 22: 1 }), + (Fjn.wd = function (n) { + return Km(this, Yx(n, 22)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Hb = function () { + return _A(this); + }), + (Fjn.Ib = function () { + return d$(this); + }), + (Fjn.g = 0); + var a_n, + u_n = EF(Jjn, "Enum", 22); + Wfn(538, 22, { 538: 1, 3: 1, 35: 1, 22: 1, 47: 1 }, mA), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return !1; + }), + (Fjn.Pb = function () { + throw hp(new Kp()); + }), + (Fjn.Qb = function () { + x3(!1); + }); + var o_n, + s_n = X1( + oEn, + "Iterators/EmptyModifiableIterator", + 538, + u_n, + function () { + return pm(), x4(Gy(s_n, 1), XEn, 538, 0, [a_n]); + }, + function (n) { + return pm(), rZ((cz(), o_n), n); + }, + ); + Wfn(1834, 619, hEn), + EF(oEn, "LinkedHashMultimapGwtSerializationDependencies", 1834), + Wfn(1835, 1834, hEn, e8), + (Fjn.hc = function () { + return new GA(IZ(this.b)); + }), + (Fjn.$b = function () { + v0(this), kp(this.a, this.a); + }), + (Fjn.gd = function () { + return new GA(IZ(this.b)); + }), + (Fjn.ic = function (n) { + return new b6(this, n, this.b); + }), + (Fjn.kc = function () { + return new dA(this); + }), + (Fjn.lc = function () { + return new Nz(Yx(this.g || (this.g = new em(this)), 21), 17); + }), + (Fjn.ec = function () { + return this.i || (this.i = new iA(this, this.c)); + }), + (Fjn.nc = function () { + return new Sm(new dA(this)); + }), + (Fjn.oc = function () { + return Vx(new Nz(Yx(this.g || (this.g = new em(this)), 21), 17), new f()); + }), + (Fjn.b = 2), + EF(oEn, "LinkedHashMultimap", 1835), + Wfn(1838, 1, {}, f), + (Fjn.Kb = function (n) { + return Yx(n, 42).dd(); + }), + EF(oEn, "LinkedHashMultimap/0methodref$getValue$Type", 1838), + Wfn(824, 1, fEn, dA), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Pb = function () { + return (function (n) { + var t; + if (n.a == n.b.a) throw hp(new Kp()); + return (t = n.a), (n.c = t), (n.a = n.a.e), t; + })(this); + }), + (Fjn.Ob = function () { + return this.a != this.b.a; + }), + (Fjn.Qb = function () { + x3(!!this.c), jU(this.b, this.c.g, this.c.i), (this.c = null); + }), + EF(oEn, "LinkedHashMultimap/1", 824), + Wfn(330, 238, { 345: 1, 238: 1, 330: 1, 2020: 1, 3: 1, 42: 1 }, IB), + (Fjn.Rd = function () { + return this.f; + }), + (Fjn.Sd = function (n) { + this.c = n; + }), + (Fjn.Td = function (n) { + this.f = n; + }), + (Fjn.d = 0); + var h_n, + f_n = EF(oEn, "LinkedHashMultimap/ValueEntry", 330); + Wfn(1836, 1970, { 2020: 1, 20: 1, 28: 1, 14: 1, 21: 1 }, b6), + (Fjn.Fc = function (n) { + var t, e, i, r, c; + for (t = (c = WR(e7(BEn, HB(WR(e7(null == n ? 0 : W5(n), HEn)), 15)))) & (this.b.length - 1), e = r = this.b[t]; e; e = e.a) + if (e.d == c && bB(e.i, n)) return !1; + return ( + (i = new IB(this.c, n, c, r)), + Sy(this.d, i), + (i.f = this), + (this.d = i), + kp(this.g.a.b, i), + kp(i, this.g.a), + (this.b[t] = i), + ++this.f, + ++this.e, + (function (n) { + var t, e, i, r, c; + if (mE(n.f, n.b.length)) + for (i = VQ(f_n, qEn, 330, 2 * n.b.length, 0, 1), n.b = i, r = i.length - 1, e = n.a; e != n; e = e.Rd()) + (t = (c = Yx(e, 330)).d & r), (c.a = i[t]), (i[t] = c); + })(this), + !0 + ); + }), + (Fjn.$b = function () { + var n, t; + for (qT(this.b, null), this.f = 0, n = this.a; n != this; n = n.Rd()) kp((t = Yx(n, 330)).b, t.e); + (this.a = this), (this.d = this), ++this.e; + }), + (Fjn.Hc = function (n) { + var t, e; + for (e = WR(e7(BEn, HB(WR(e7(null == n ? 0 : W5(n), HEn)), 15))), t = this.b[e & (this.b.length - 1)]; t; t = t.a) + if (t.d == e && bB(t.i, n)) return !0; + return !1; + }), + (Fjn.Jc = function (n) { + var t; + for (MF(n), t = this.a; t != this; t = t.Rd()) n.td(Yx(t, 330).i); + }), + (Fjn.Rd = function () { + return this.a; + }), + (Fjn.Kc = function () { + return new oB(this); + }), + (Fjn.Mc = function (n) { + return nln(this, n); + }), + (Fjn.Sd = function (n) { + this.d = n; + }), + (Fjn.Td = function (n) { + this.a = n; + }), + (Fjn.gc = function () { + return this.f; + }), + (Fjn.e = 0), + (Fjn.f = 0), + EF(oEn, "LinkedHashMultimap/ValueSet", 1836), + Wfn(1837, 1, fEn, oB), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return XR(this), this.b != this.c; + }), + (Fjn.Pb = function () { + var n, t; + if ((XR(this), this.b == this.c)) throw hp(new Kp()); + return (t = (n = Yx(this.b, 330)).i), (this.d = n), (this.b = n.f), t; + }), + (Fjn.Qb = function () { + XR(this), x3(!!this.d), nln(this.c, this.d.i), (this.a = this.c.e), (this.d = null); + }), + (Fjn.a = 0), + EF(oEn, "LinkedHashMultimap/ValueSet/1", 1837), + Wfn(766, 1986, hEn, xI), + (Fjn.Zb = function () { + return this.f || (this.f = new IT(this)); + }), + (Fjn.Fb = function (n) { + return f6(this, n); + }), + (Fjn.cc = function (n) { + return new Vj(this, n); + }), + (Fjn.fc = function (n) { + return WX(this, n); + }), + (Fjn.$b = function () { + bF(this); + }), + (Fjn._b = function (n) { + return vE(this, n); + }), + (Fjn.ac = function () { + return new IT(this); + }), + (Fjn.bc = function () { + return new vl(this); + }), + (Fjn.qc = function (n) { + return new Vj(this, n); + }), + (Fjn.dc = function () { + return !this.a; + }), + (Fjn.rc = function (n) { + return WX(this, n); + }), + (Fjn.gc = function () { + return this.d; + }), + (Fjn.c = 0), + (Fjn.d = 0), + EF(oEn, "LinkedListMultimap", 766), + Wfn(52, 28, WEn), + (Fjn.ad = function (n) { + I2(this, n); + }), + (Fjn.Nc = function () { + return new Nz(this, 16); + }), + (Fjn.Vc = function (n, t) { + throw hp(new sy("Add not supported on this list")); + }), + (Fjn.Fc = function (n) { + return this.Vc(this.gc(), n), !0; + }), + (Fjn.Wc = function (n, t) { + var e, i, r; + for (vB(t), e = !1, r = t.Kc(); r.Ob(); ) (i = r.Pb()), this.Vc(n++, i), (e = !0); + return e; + }), + (Fjn.$b = function () { + this.Ud(0, this.gc()); + }), + (Fjn.Fb = function (n) { + return sln(this, n); + }), + (Fjn.Hb = function () { + return K5(this); + }), + (Fjn.Xc = function (n) { + return p0(this, n); + }), + (Fjn.Kc = function () { + return new Vl(this); + }), + (Fjn.Yc = function () { + return this.Zc(0); + }), + (Fjn.Zc = function (n) { + return new JU(this, n); + }), + (Fjn.$c = function (n) { + throw hp(new sy("Remove not supported on this list")); + }), + (Fjn.Ud = function (n, t) { + var e, i; + for (i = this.Zc(n), e = n; e < t; ++e) i.Pb(), i.Qb(); + }), + (Fjn._c = function (n, t) { + throw hp(new sy("Set not supported on this list")); + }), + (Fjn.bd = function (n, t) { + return new Oz(this, n, t); + }), + (Fjn.j = 0), + EF(lEn, "AbstractList", 52), + Wfn(1964, 52, WEn), + (Fjn.Vc = function (n, t) { + A$(this, n, t); + }), + (Fjn.Wc = function (n, t) { + return v6(this, n, t); + }), + (Fjn.Xb = function (n) { + return ken(this, n); + }), + (Fjn.Kc = function () { + return this.Zc(0); + }), + (Fjn.$c = function (n) { + return Urn(this, n); + }), + (Fjn._c = function (n, t) { + var e, i; + e = this.Zc(n); + try { + return (i = e.Pb()), e.Wb(t), i; + } catch (t) { + throw CO((t = j4(t)), 109) ? hp(new Hm("Can't set element " + n)) : hp(t); + } + }), + EF(lEn, "AbstractSequentialList", 1964), + Wfn(636, 1964, WEn, Vj), + (Fjn.Zc = function (n) { + return $A(this, n); + }), + (Fjn.gc = function () { + var n; + return (n = Yx(BF(this.a.b, this.b), 283)) ? n.a : 0; + }), + EF(oEn, "LinkedListMultimap/1", 636), + Wfn(1297, 1970, gEn, vl), + (Fjn.Hc = function (n) { + return vE(this.a, n); + }), + (Fjn.Kc = function () { + return new o2(this.a); + }), + (Fjn.Mc = function (n) { + return !WX(this.a, n).a.dc(); + }), + (Fjn.gc = function () { + return hE(this.a.b); + }), + EF(oEn, "LinkedListMultimap/1KeySetImpl", 1297), + Wfn(1296, 1, fEn, o2), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return UR(this), !!this.c; + }), + (Fjn.Pb = function () { + UR(this), jA(this.c), (this.a = this.c), __(this.d, this.a.a); + do { + this.c = this.c.b; + } while (this.c && !__(this.d, this.c.a)); + return this.a.a; + }), + (Fjn.Qb = function () { + UR(this), x3(!!this.a), vR(new wJ(this.e, this.a.a)), (this.a = null), (this.b = this.e.c); + }), + (Fjn.b = 0), + EF(oEn, "LinkedListMultimap/DistinctKeyIterator", 1296), + Wfn(283, 1, { 283: 1 }, pq), + (Fjn.a = 0), + EF(oEn, "LinkedListMultimap/KeyList", 283), + Wfn(1295, 345, kEn, Qj), + (Fjn.cd = function () { + return this.a; + }), + (Fjn.dd = function () { + return this.f; + }), + (Fjn.ed = function (n) { + var t; + return (t = this.f), (this.f = n), t; + }), + EF(oEn, "LinkedListMultimap/Node", 1295), + Wfn(560, 1, yEn, wJ, jsn), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Rb = function (n) { + (this.e = Cgn(this.f, this.b, n, this.c)), ++this.d, (this.a = null); + }), + (Fjn.Ob = function () { + return !!this.c; + }), + (Fjn.Sb = function () { + return !!this.e; + }), + (Fjn.Pb = function () { + return WG(this); + }), + (Fjn.Tb = function () { + return this.d; + }), + (Fjn.Ub = function () { + return VG(this); + }), + (Fjn.Vb = function () { + return this.d - 1; + }), + (Fjn.Qb = function () { + var n, t, e; + x3(!!this.a), + this.a != this.c ? ((this.e = this.a.e), --this.d) : (this.c = this.a.c), + (n = this.f), + (t = this.a).d ? (t.d.b = t.b) : (n.a = t.b), + t.b ? (t.b.d = t.d) : (n.e = t.d), + t.e || t.c + ? (--(e = Yx(BF(n.b, t.a), 283)).a, t.e ? (t.e.c = t.c) : (e.b = t.c), t.c ? (t.c.e = t.e) : (e.c = t.e)) + : (((e = Yx(zV(n.b, t.a), 283)).a = 0), ++n.c), + --n.d, + (this.a = null); + }), + (Fjn.Wb = function (n) { + kA(!!this.a), (this.a.f = n); + }), + (Fjn.d = 0), + EF(oEn, "LinkedListMultimap/ValueForKeyIterator", 560), + Wfn(1018, 52, WEn), + (Fjn.Vc = function (n, t) { + this.a.Vc(n, t); + }), + (Fjn.Wc = function (n, t) { + return this.a.Wc(n, t); + }), + (Fjn.Hc = function (n) { + return this.a.Hc(n); + }), + (Fjn.Xb = function (n) { + return this.a.Xb(n); + }), + (Fjn.$c = function (n) { + return this.a.$c(n); + }), + (Fjn._c = function (n, t) { + return this.a._c(n, t); + }), + (Fjn.gc = function () { + return this.a.gc(); + }), + EF(oEn, "Lists/AbstractListWrapper", 1018), + Wfn(1019, 1018, QEn), + EF(oEn, "Lists/RandomAccessListWrapper", 1019), + Wfn(1021, 1019, QEn, cE), + (Fjn.Zc = function (n) { + return this.a.Zc(n); + }), + EF(oEn, "Lists/1", 1021), + Wfn(131, 52, { 131: 1, 20: 1, 28: 1, 52: 1, 14: 1, 15: 1 }, rE), + (Fjn.Vc = function (n, t) { + this.a.Vc(N_(this, n), t); + }), + (Fjn.$b = function () { + this.a.$b(); + }), + (Fjn.Xb = function (n) { + return this.a.Xb(RF(this, n)); + }), + (Fjn.Kc = function () { + return _z(this, 0); + }), + (Fjn.Zc = function (n) { + return _z(this, n); + }), + (Fjn.$c = function (n) { + return this.a.$c(RF(this, n)); + }), + (Fjn.Ud = function (n, t) { + (qU(n, t, this.a.gc()), I3(this.a.bd(N_(this, t), N_(this, n)))).$b(); + }), + (Fjn._c = function (n, t) { + return this.a._c(RF(this, n), t); + }), + (Fjn.gc = function () { + return this.a.gc(); + }), + (Fjn.bd = function (n, t) { + return qU(n, t, this.a.gc()), I3(this.a.bd(N_(this, t), N_(this, n))); + }), + EF(oEn, "Lists/ReverseList", 131), + Wfn(280, 131, { 131: 1, 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 54: 1 }, Tm), + EF(oEn, "Lists/RandomAccessReverseList", 280), + Wfn(1020, 1, yEn, Yj), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Rb = function (n) { + this.c.Rb(n), this.c.Ub(), (this.a = !1); + }), + (Fjn.Ob = function () { + return this.c.Sb(); + }), + (Fjn.Sb = function () { + return this.c.Ob(); + }), + (Fjn.Pb = function () { + return nV(this); + }), + (Fjn.Tb = function () { + return N_(this.b, this.c.Tb()); + }), + (Fjn.Ub = function () { + if (!this.c.Ob()) throw hp(new Kp()); + return (this.a = !0), this.c.Pb(); + }), + (Fjn.Vb = function () { + return N_(this.b, this.c.Tb()) - 1; + }), + (Fjn.Qb = function () { + x3(this.a), this.c.Qb(), (this.a = !1); + }), + (Fjn.Wb = function (n) { + kA(this.a), this.c.Wb(n); + }), + (Fjn.a = !1), + EF(oEn, "Lists/ReverseList/1", 1020), + Wfn(432, 487, fEn, Mm), + (Fjn.Qd = function (n) { + return CT(n); + }), + EF(oEn, "Maps/1", 432), + Wfn(698, 487, fEn, Sm), + (Fjn.Qd = function (n) { + return Yx(n, 42).dd(); + }), + EF(oEn, "Maps/2", 698), + Wfn(962, 487, fEn, AA), + (Fjn.Qd = function (n) { + return new Wj(n, XI(this.a, n)); + }), + EF(oEn, "Maps/3", 962), + Wfn(959, 1971, gEn, pl), + (Fjn.Jc = function (n) { + !(function (n, t) { + n.kc().Nb(t); + })(this.a, n); + }), + (Fjn.Kc = function () { + return this.a.kc(); + }), + (Fjn.Rc = function () { + return this.a; + }), + (Fjn.Nc = function () { + return this.a.lc(); + }), + EF(oEn, "Maps/IteratorBasedAbstractMap/1", 959), + Wfn(960, 1, {}, gl), + (Fjn.Od = function (n, t) { + this.a.td(n); + }), + EF(oEn, "Maps/KeySet/lambda$0$Type", 960), + Wfn(958, 28, wEn, iE), + (Fjn.$b = function () { + this.a.$b(); + }), + (Fjn.Hc = function (n) { + return this.a.uc(n); + }), + (Fjn.Jc = function (n) { + MF(n), this.a.wc(new hl(n)); + }), + (Fjn.dc = function () { + return this.a.dc(); + }), + (Fjn.Kc = function () { + return new Sm(this.a.vc().Kc()); + }), + (Fjn.Mc = function (n) { + var t, e; + try { + return V7(this, n, !0); + } catch (i) { + if (CO((i = j4(i)), 41)) { + for (e = this.a.vc().Kc(); e.Ob(); ) if (bB(n, (t = Yx(e.Pb(), 42)).dd())) return this.a.Bc(t.cd()), !0; + return !1; + } + throw hp(i); + } + }), + (Fjn.gc = function () { + return this.a.gc(); + }), + EF(oEn, "Maps/Values", 958), + Wfn(961, 1, {}, hl), + (Fjn.Od = function (n, t) { + this.a.td(t); + }), + EF(oEn, "Maps/Values/lambda$0$Type", 961), + Wfn(736, 1987, bEn, IT), + (Fjn.xc = function (n) { + return this.a._b(n) ? this.a.cc(n) : null; + }), + (Fjn.Bc = function (n) { + return this.a._b(n) ? this.a.fc(n) : null; + }), + (Fjn.$b = function () { + this.a.$b(); + }), + (Fjn._b = function (n) { + return this.a._b(n); + }), + (Fjn.Ec = function () { + return new sl(this); + }), + (Fjn.Dc = function () { + return this.Ec(); + }), + (Fjn.dc = function () { + return this.a.dc(); + }), + (Fjn.ec = function () { + return this.a.ec(); + }), + (Fjn.gc = function () { + return this.a.ec().gc(); + }), + EF(oEn, "Multimaps/AsMap", 736), + Wfn(1104, 1971, gEn, sl), + (Fjn.Kc = function () { + return (n = this.a.a.ec()), (t = new fl(this)), new AA(n.Kc(), t); + var n, t; + }), + (Fjn.Rc = function () { + return this.a; + }), + (Fjn.Mc = function (n) { + var t; + return ( + !!vnn(this, n) && + ((t = Yx(n, 42)), + (function (n, t) { + n.a.ec().Mc(t); + })(this.a, t.cd()), + !0) + ); + }), + EF(oEn, "Multimaps/AsMap/EntrySet", 1104), + Wfn(1108, 1, {}, fl), + (Fjn.Kb = function (n) { + return XI(this, n); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + EF(oEn, "Multimaps/AsMap/EntrySet/1", 1108), + Wfn(543, 1989, { 543: 1, 835: 1, 20: 1, 28: 1, 14: 1 }, ll), + (Fjn.$b = function () { + v0(this.a); + }), + (Fjn.Hc = function (n) { + return Ok(this.a, n); + }), + (Fjn.Jc = function (n) { + MF(n), XW(OF(this.a), new wl(n)); + }), + (Fjn.Kc = function () { + return new Mm(OF(this.a).a.kc()); + }), + (Fjn.gc = function () { + return this.a.d; + }), + (Fjn.Nc = function () { + return Vx(OF(this.a).Nc(), new l()); + }), + EF(oEn, "Multimaps/Keys", 543), + Wfn(1106, 1, {}, l), + (Fjn.Kb = function (n) { + return Yx(n, 42).cd(); + }), + EF(oEn, "Multimaps/Keys/0methodref$getKey$Type", 1106), + Wfn(1105, 487, fEn, Pm), + (Fjn.Qd = function (n) { + return new bl(Yx(n, 42)); + }), + EF(oEn, "Multimaps/Keys/1", 1105), + Wfn(1990, 1, { 416: 1 }), + (Fjn.Fb = function (n) { + var t; + return !!CO(n, 492) && ((t = Yx(n, 416)), Yx(this.a.dd(), 14).gc() == Yx(t.a.dd(), 14).gc() && bB(this.a.cd(), t.a.cd())); + }), + (Fjn.Hb = function () { + var n; + return (null == (n = this.a.cd()) ? 0 : W5(n)) ^ Yx(this.a.dd(), 14).gc(); + }), + (Fjn.Ib = function () { + var n, t; + return (t = xA(this.a.cd())), 1 == (n = Yx(this.a.dd(), 14).gc()) ? t : t + " x " + n; + }), + EF(oEn, "Multisets/AbstractEntry", 1990), + Wfn(492, 1990, { 492: 1, 416: 1 }, bl), + EF(oEn, "Multimaps/Keys/1/1", 492), + Wfn(1107, 1, PEn, wl), + (Fjn.td = function (n) { + this.a.td(Yx(n, 42).cd()); + }), + EF(oEn, "Multimaps/Keys/lambda$1$Type", 1107), + Wfn(1110, 1, PEn, b), + (Fjn.td = function (n) { + !(function (n) { + n.a.cd(), Yx(n.a.dd(), 14).gc(), jy(); + })(Yx(n, 416)); + }), + EF(oEn, "Multiset/lambda$0$Type", 1110), + Wfn(737, 1, PEn, dl), + (Fjn.td = function (n) { + !(function (n, t) { + var e, i, r; + for (i = t.a.cd(), e = Yx(t.a.dd(), 14).gc(), r = 0; r < e; r++) n.td(i); + })(this.a, Yx(n, 416)); + }), + EF(oEn, "Multiset/lambda$1$Type", 737), + Wfn(1111, 1, {}, m), + EF(oEn, "Multisets/0methodref$add$Type", 1111), + Wfn(738, 1, {}, y), + (Fjn.Kb = function (n) { + return TX(Yx(n, 416)); + }), + EF(oEn, "Multisets/lambda$3$Type", 738), + Wfn(2008, 1, Zjn), + EF(oEn, "RangeGwtSerializationDependencies", 2008), + Wfn(514, 2008, { 169: 1, 514: 1, 3: 1, 45: 1 }, _en), + (Fjn.Lb = function (n) { + return VK(this, Yx(n, 35)); + }), + (Fjn.Mb = function (n) { + return VK(this, Yx(n, 35)); + }), + (Fjn.Fb = function (n) { + var t; + return !!CO(n, 514) && ((t = Yx(n, 514)), Gnn(this.a, t.a) && Gnn(this.b, t.b)); + }), + (Fjn.Hb = function () { + return 31 * this.a.Hb() + this.b.Hb(); + }), + (Fjn.Ib = function () { + return BX(this.a, this.b); + }), + EF(oEn, "Range", 514), + Wfn(778, 1999, xEn, E_), + (Fjn.Zc = function (n) { + return c$(this.b, n); + }), + (Fjn.Pd = function () { + return this.a; + }), + (Fjn.Xb = function (n) { + return uI(this.b, n); + }), + (Fjn.Fd = function (n) { + return c$(this.b, n); + }), + EF(oEn, "RegularImmutableAsList", 778), + Wfn(646, 2006, xEn, Aq), + (Fjn.Hd = function () { + return this.a; + }), + EF(oEn, "RegularImmutableList", 646), + Wfn(616, 715, REn, Em), + EF(oEn, "RegularImmutableMap", 616), + Wfn(716, 703, _En, BT), + EF(oEn, "RegularImmutableSet", 716), + Wfn(1976, dEn, gEn), + (Fjn.Kc = function () { + return new cH(this.a, this.b); + }), + (Fjn.Fc = function (n) { + throw hp(new xp()); + }), + (Fjn.Gc = function (n) { + throw hp(new xp()); + }), + (Fjn.$b = function () { + throw hp(new xp()); + }), + (Fjn.Mc = function (n) { + throw hp(new xp()); + }), + EF(oEn, "Sets/SetView", 1976), + Wfn(963, 1976, gEn, Zj), + (Fjn.Kc = function () { + return new cH(this.a, this.b); + }), + (Fjn.Hc = function (n) { + return rK(this.a, n) && this.b.Hc(n); + }), + (Fjn.Ic = function (n) { + return m4(this.a, n) && this.b.Ic(n); + }), + (Fjn.dc = function () { + return Een(this.b, this.a); + }), + (Fjn.Lc = function () { + return hH(new SR(null, new Nz(this.a, 1)), new yl(this.b)); + }), + (Fjn.gc = function () { + return V3(this); + }), + (Fjn.Oc = function () { + return hH(new SR(null, new Nz(this.a, 1)), new ml(this.b)); + }), + EF(oEn, "Sets/2", 963), + Wfn(700, 699, uEn, cH), + (Fjn.Yb = function () { + for (var n; nO(this.a); ) if (((n = eW(this.a)), this.c.Hc(n))) return n; + return (this.e = 2), null; + }), + EF(oEn, "Sets/2/1", 700), + Wfn(964, 1, YEn, ml), + (Fjn.Mb = function (n) { + return this.a.Hc(n); + }), + EF(oEn, "Sets/2/4methodref$contains$Type", 964), + Wfn(965, 1, YEn, yl), + (Fjn.Mb = function (n) { + return this.a.Hc(n); + }), + EF(oEn, "Sets/2/5methodref$contains$Type", 965), + Wfn(607, 1975, { 607: 1, 3: 1, 20: 1, 14: 1, 271: 1, 21: 1, 84: 1 }, Vq), + (Fjn.Bd = function () { + return this.b; + }), + (Fjn.Cd = function () { + return this.b; + }), + (Fjn.Md = function () { + return this.b; + }), + (Fjn.Jc = function (n) { + this.a.Jc(n); + }), + (Fjn.Lc = function () { + return this.a.Lc(); + }), + (Fjn.Oc = function () { + return this.a.Oc(); + }), + EF(oEn, "Sets/UnmodifiableNavigableSet", 607), + Wfn(1932, 1931, REn, OB), + (Fjn.Ld = function () { + return px(), new My(this.a); + }), + (Fjn.Cc = function () { + return px(), new My(this.a); + }), + (Fjn.pd = function () { + return px(), new My(this.a); + }), + EF(oEn, "SingletonImmutableBiMap", 1932), + Wfn(647, 2006, xEn, pR), + (Fjn.Hd = function () { + return this.a; + }), + EF(oEn, "SingletonImmutableList", 647), + Wfn(350, 1981, _En, My), + (Fjn.Kc = function () { + return new ul(this.a); + }), + (Fjn.Hc = function (n) { + return Q8(this.a, n); + }), + (Fjn.Ed = function () { + return new ul(this.a); + }), + (Fjn.gc = function () { + return 1; + }), + EF(oEn, "SingletonImmutableSet", 350), + Wfn(1115, 1, {}, k), + (Fjn.Kb = function (n) { + return Yx(n, 164); + }), + EF(oEn, "Streams/lambda$0$Type", 1115), + Wfn(1116, 1, JEn, kl), + (Fjn.Vd = function () { + !(function (n) { + var t, e, i; + for (e = 0, i = (t = n).length; e < i; ++e) mB(t[e]); + })(this.a); + }), + EF(oEn, "Streams/lambda$1$Type", 1116), + Wfn(1659, 1658, hEn, Mq), + (Fjn.Zb = function () { + return Yx( + Yx( + this.f || + (this.f = CO(this.c, 171) + ? new dL(this, Yx(this.c, 171)) + : CO(this.c, 161) + ? new wL(this, Yx(this.c, 161)) + : new Xj(this, this.c)), + 161, + ), + 171, + ); + }), + (Fjn.hc = function () { + return new Vk(this.b); + }), + (Fjn.gd = function () { + return new Vk(this.b); + }), + (Fjn.ec = function () { + return Yx( + Yx( + this.i || + (this.i = CO(this.c, 171) + ? new Aj(this, Yx(this.c, 171)) + : CO(this.c, 161) + ? new Oj(this, Yx(this.c, 161)) + : new iA(this, this.c)), + 84, + ), + 271, + ); + }), + (Fjn.ac = function () { + return CO(this.c, 171) ? new dL(this, Yx(this.c, 171)) : CO(this.c, 161) ? new wL(this, Yx(this.c, 161)) : new Xj(this, this.c); + }), + (Fjn.ic = function (n) { + return null == n && this.a.ue(n, n), new Vk(this.b); + }), + EF(oEn, "TreeMultimap", 1659), + Wfn(78, 1, { 3: 1, 78: 1 }), + (Fjn.Wd = function (n) { + return new Error(n); + }), + (Fjn.Xd = function () { + return this.e; + }), + (Fjn.Yd = function () { + return ( + (n = fH(X_((null == this.k && (this.k = VQ(b_n, TEn, 78, 0, 0, 1)), this.k)), new x())), + new on(), + (t = Yx(kW(n, mY(new H(), new B(), new rn(), x4(Gy(wBn, 1), XEn, 132, 0, [(C6(), aBn)]))), 15)).Qc(pD(t.gc())) + ); + var n, t; + }), + (Fjn.Zd = function () { + return this.f; + }), + (Fjn.$d = function () { + return this.g; + }), + (Fjn._d = function () { + var n, t; + (n = this), + (t = (function (n) { + if (!("stack" in n)) + try { + throw n; + } catch (n) {} + return n; + })(this.Wd(Lq(this, this.g)))), + (n.e = t), + Cwn(n, t), + Sp(this); + }), + (Fjn.Ib = function () { + return Lq(this, this.$d()); + }), + (Fjn.e = tTn), + (Fjn.i = !1), + (Fjn.n = !0); + var l_n, + b_n = EF(Jjn, "Throwable", 78); + Wfn(102, 78, { 3: 1, 102: 1, 78: 1 }), + EF(Jjn, "Exception", 102), + Wfn(60, 102, eTn, Pp, Im), + EF(Jjn, "RuntimeException", 60), + Wfn(598, 60, eTn), + EF(Jjn, "JsException", 598), + Wfn(863, 598, eTn), + EF(iTn, "JavaScriptExceptionBase", 863), + Wfn(477, 863, { 477: 1, 3: 1, 102: 1, 60: 1, 78: 1 }, n8), + (Fjn.$d = function () { + return ( + null == (n = this).c && + ((t = iI(n.b) === iI(l_n) ? null : n.b), + (n.d = + null == t + ? aEn + : PK(t) + ? (function (n) { + return null == n ? null : n.name; + })(GH(t)) + : aI(t) + ? rTn + : Nk(V5(t))), + (n.a = + n.a + + ": " + + (PK(t) + ? (function (n) { + return null == n ? null : n.message; + })(GH(t)) + : t + "")), + (n.c = "(" + n.d + ") " + n.a)), + this.c + ); + var n, t; + }), + (Fjn.ae = function () { + return iI(this.b) === iI(l_n) ? null : this.b; + }), + EF(cTn, "JavaScriptException", 477); + var w_n, + d_n = EF(cTn, "JavaScriptObject$", 0); + Wfn(1948, 1, {}), EF(cTn, "Scheduler", 1948); + var g_n, + p_n, + v_n, + m_n, + y_n = 0, + k_n = 0, + j_n = -1; + Wfn(890, 1948, {}, j), + EF(iTn, "SchedulerImpl", 890), + Wfn(1960, 1, {}), + EF(iTn, "StackTraceCreator/Collector", 1960), + Wfn(864, 1960, {}, E), + (Fjn.be = function (n) { + var t = {}, + e = []; + n[uTn] = e; + for (var i = arguments.callee.caller; i; ) { + var r = ($q(), i.name || (i.name = t0(i.toString()))); + e.push(r); + var c, + a, + u = ":" + r, + o = t[u]; + if (o) for (c = 0, a = o.length; c < a; c++) if (o[c] === i) return; + (o || (t[u] = [])).push(i), (i = i.caller); + } + }), + (Fjn.ce = function (n) { + var t, e, i, r; + for ($q(), e = (i = n && n[uTn] ? n[uTn] : []).length, r = VQ(tFn, TEn, 310, e, 0, 1), t = 0; t < e; t++) + r[t] = new aH(i[t], null, -1); + return r; + }), + EF(iTn, "StackTraceCreator/CollectorLegacy", 864), + Wfn(1961, 1960, {}), + (Fjn.be = function (n) {}), + (Fjn.de = function (n, t, e, i) { + return new aH(t, n + "@" + i, e < 0 ? -1 : e); + }), + (Fjn.ce = function (n) { + var t, e, i, r, c, a; + if ( + ((r = (function (n) { + $q(); + var t = n.e; + if (t && t.stack) { + var e = t.stack, + i = t + "\n"; + return e.substring(0, i.length) == i && (e = e.substring(i.length)), e.split("\n"); + } + return []; + })(n)), + (c = VQ(tFn, TEn, 310, 0, 0, 1)), + (t = 0), + 0 == (i = r.length)) + ) + return c; + for (_N((a = Ymn(this, r[0])).d, aTn) || (c[t++] = a), e = 1; e < i; e++) c[t++] = Ymn(this, r[e]); + return c; + }), + EF(iTn, "StackTraceCreator/CollectorModern", 1961), + Wfn(865, 1961, {}, d), + (Fjn.de = function (n, t, e, i) { + return new aH(t, n, -1); + }), + EF(iTn, "StackTraceCreator/CollectorModernNoSourceMap", 865), + Wfn(1050, 1, {}), + EF(xTn, DTn, 1050), + Wfn(615, 1050, { 615: 1 }, UF), + EF(RTn, DTn, 615), + Wfn(2001, 1, {}), + EF(xTn, KTn, 2001), + Wfn(2002, 2001, {}), + EF(RTn, KTn, 2002), + Wfn(1090, 1, {}, g), + EF(RTn, "LocaleInfo", 1090), + Wfn(1918, 1, {}, p), + (Fjn.a = 0), + EF(RTn, "TimeZone", 1918), + Wfn(1258, 2002, {}, w), + EF("com.google.gwt.i18n.client.impl.cldr", "DateTimeFormatInfoImpl", 1258), + Wfn(434, 1, { 434: 1 }, iD), + (Fjn.a = !1), + (Fjn.b = 0), + EF(xTn, "DateTimeFormat/PatternPart", 434), + Wfn(199, 1, _Tn, uE, y5, bL), + (Fjn.wd = function (n) { + return (function (n, t) { + return Q_(D3(n.q.getTime()), D3(t.q.getTime())); + })(this, Yx(n, 199)); + }), + (Fjn.Fb = function (n) { + return CO(n, 199) && sI(D3(this.q.getTime()), D3(Yx(n, 199).q.getTime())); + }), + (Fjn.Hb = function () { + var n; + return WR(Uz((n = D3(this.q.getTime())), UK(n, 32))); + }), + (Fjn.Ib = function () { + var n, t, i; + return ( + (n = ((i = -this.q.getTimezoneOffset()) >= 0 ? "+" : "") + ((i / 60) | 0)), + (t = YI(e.Math.abs(i) % 60)), + (Cun(), AFn)[this.q.getDay()] + + " " + + $Fn[this.q.getMonth()] + + " " + + YI(this.q.getDate()) + + " " + + YI(this.q.getHours()) + + ":" + + YI(this.q.getMinutes()) + + ":" + + YI(this.q.getSeconds()) + + " GMT" + + n + + t + + " " + + this.q.getFullYear() + ); + }); + var E_n, + T_n, + M_n, + S_n, + P_n, + I_n, + C_n, + O_n, + A_n, + $_n, + L_n, + N_n = EF(lEn, "Date", 199); + Wfn(1915, 199, _Tn, Tcn), + (Fjn.a = !1), + (Fjn.b = 0), + (Fjn.c = 0), + (Fjn.d = 0), + (Fjn.e = 0), + (Fjn.f = 0), + (Fjn.g = !1), + (Fjn.i = 0), + (Fjn.j = 0), + (Fjn.k = 0), + (Fjn.n = 0), + (Fjn.o = 0), + (Fjn.p = 0), + EF("com.google.gwt.i18n.shared.impl", "DateRecord", 1915), + Wfn(1966, 1, {}), + (Fjn.fe = function () { + return null; + }), + (Fjn.ge = function () { + return null; + }), + (Fjn.he = function () { + return null; + }), + (Fjn.ie = function () { + return null; + }), + (Fjn.je = function () { + return null; + }), + EF(FTn, "JSONValue", 1966), + Wfn(216, 1966, { 216: 1 }, Sl, jl), + (Fjn.Fb = function (n) { + return !!CO(n, 216) && Jz(this.a, Yx(n, 216).a); + }), + (Fjn.ee = function () { + return fp; + }), + (Fjn.Hb = function () { + return sq(this.a); + }), + (Fjn.fe = function () { + return this; + }), + (Fjn.Ib = function () { + var n, t, e; + for (e = new SA("["), t = 0, n = this.a.length; t < n; t++) t > 0 && (e.a += ","), mI(e, VJ(this, t)); + return (e.a += "]"), e.a; + }), + EF(FTn, "JSONArray", 216), + Wfn(483, 1966, { 483: 1 }, El), + (Fjn.ee = function () { + return lp; + }), + (Fjn.ge = function () { + return this; + }), + (Fjn.Ib = function () { + return TA(), "" + this.a; + }), + (Fjn.a = !1), + EF(FTn, "JSONBoolean", 483), + Wfn(985, 60, eTn, Cm), + EF(FTn, "JSONException", 985), + Wfn(1023, 1966, {}, v), + (Fjn.ee = function () { + return pp; + }), + (Fjn.Ib = function () { + return aEn; + }), + EF(FTn, "JSONNull", 1023), + Wfn(258, 1966, { 258: 1 }, Tl), + (Fjn.Fb = function (n) { + return !!CO(n, 258) && this.a == Yx(n, 258).a; + }), + (Fjn.ee = function () { + return bp; + }), + (Fjn.Hb = function () { + return ZI(this.a); + }), + (Fjn.he = function () { + return this; + }), + (Fjn.Ib = function () { + return this.a + ""; + }), + (Fjn.a = 0), + EF(FTn, "JSONNumber", 258), + Wfn(183, 1966, { 183: 1 }, Om, Ml), + (Fjn.Fb = function (n) { + return !!CO(n, 183) && Jz(this.a, Yx(n, 183).a); + }), + (Fjn.ee = function () { + return wp; + }), + (Fjn.Hb = function () { + return sq(this.a); + }), + (Fjn.ie = function () { + return this; + }), + (Fjn.Ib = function () { + var n, t, e, i, r, c; + for (c = new SA("{"), n = !0, i = 0, r = (e = l2(this, VQ(fFn, TEn, 2, 0, 6, 1))).length; i < r; ++i) + (t = e[i]), n ? (n = !1) : (c.a += tEn), yI(c, bfn(t)), (c.a += ":"), mI(c, jG(this, t)); + return (c.a += "}"), c.a; + }), + EF(FTn, "JSONObject", 183), + Wfn(596, dEn, gEn, nE), + (Fjn.Hc = function (n) { + return ( + aI(n) && + (function (n, t) { + return t in n.a; + })(this.a, lL(n)) + ); + }), + (Fjn.Kc = function () { + return new Vl(new ay(this.b)); + }), + (Fjn.gc = function () { + return this.b.length; + }), + EF(FTn, "JSONObject/1", 596), + Wfn(204, 1966, { 204: 1 }, zF), + (Fjn.Fb = function (n) { + return !!CO(n, 204) && _N(this.a, Yx(n, 204).a); + }), + (Fjn.ee = function () { + return dp; + }), + (Fjn.Hb = function () { + return Xen(this.a); + }), + (Fjn.je = function () { + return this; + }), + (Fjn.Ib = function () { + return bfn(this.a); + }), + EF(FTn, "JSONString", 204), + Wfn(1962, 1, { 525: 1 }), + EF(WTn, "OutputStream", 1962), + Wfn(1963, 1962, { 525: 1 }), + EF(WTn, "FilterOutputStream", 1963), + Wfn(866, 1963, { 525: 1 }, A), + EF(WTn, "PrintStream", 866), + Wfn(418, 1, { 475: 1 }), + (Fjn.Ib = function () { + return this.a; + }), + EF(Jjn, "AbstractStringBuilder", 418), + Wfn(529, 60, eTn, Bm), + EF(Jjn, "ArithmeticException", 529), + Wfn(73, 60, VTn, Cp, Hm), + EF(Jjn, "IndexOutOfBoundsException", 73), + Wfn(320, 73, { 3: 1, 320: 1, 102: 1, 73: 1, 60: 1, 78: 1 }, Gp, Py), + EF(Jjn, "ArrayIndexOutOfBoundsException", 320), + Wfn(528, 60, eTn, Op, qm), + EF(Jjn, "ArrayStoreException", 528), + Wfn(289, 78, QTn, Gm), + EF(Jjn, "Error", 289), + Wfn(194, 289, QTn, Ip, eV), + EF(Jjn, "AssertionError", 194), + (qjn = { 3: 1, 476: 1, 35: 1 }); + var x_n, + D_n = EF(Jjn, "Boolean", 476); + Wfn(236, 1, { 3: 1, 236: 1 }), + EF(Jjn, "Number", 236), + Wfn(217, 236, { 3: 1, 217: 1, 35: 1, 236: 1 }, tb), + (Fjn.wd = function (n) { + return (function (n, t) { + return n.a - t.a; + })(this, Yx(n, 217)); + }), + (Fjn.ke = function () { + return this.a; + }), + (Fjn.Fb = function (n) { + return CO(n, 217) && Yx(n, 217).a == this.a; + }), + (Fjn.Hb = function () { + return this.a; + }), + (Fjn.Ib = function () { + return "" + this.a; + }), + (Fjn.a = 0); + var R_n, + K_n, + __n = EF(Jjn, "Byte", 217); + Wfn(172, 1, { 3: 1, 172: 1, 35: 1 }, eb), + (Fjn.wd = function (n) { + return (function (n, t) { + return n.a - t.a; + })(this, Yx(n, 172)); + }), + (Fjn.Fb = function (n) { + return CO(n, 172) && Yx(n, 172).a == this.a; + }), + (Fjn.Hb = function () { + return this.a; + }), + (Fjn.Ib = function () { + return String.fromCharCode(this.a); + }), + (Fjn.a = 0); + var F_n, + B_n = EF(Jjn, "Character", 172); + Wfn(205, 60, { 3: 1, 205: 1, 102: 1, 60: 1, 78: 1 }, Ap, Vm), + EF(Jjn, "ClassCastException", 205), + (Gjn = { 3: 1, 35: 1, 333: 1, 236: 1 }); + var H_n = EF(Jjn, "Double", 333); + Wfn(155, 236, { 3: 1, 35: 1, 155: 1, 236: 1 }, ib, Vp), + (Fjn.wd = function (n) { + return (function (n, t) { + return $9(n.a, t.a); + })(this, Yx(n, 155)); + }), + (Fjn.ke = function () { + return this.a; + }), + (Fjn.Fb = function (n) { + return CO(n, 155) && KN(this.a, Yx(n, 155).a); + }), + (Fjn.Hb = function () { + return oG(this.a); + }), + (Fjn.Ib = function () { + return "" + this.a; + }), + (Fjn.a = 0); + var q_n = EF(Jjn, "Float", 155); + Wfn(32, 60, { 3: 1, 102: 1, 32: 1, 60: 1, 78: 1 }, $p, Qm, S6), + EF(Jjn, "IllegalArgumentException", 32), + Wfn(71, 60, eTn, Lp, Ym), + EF(Jjn, "IllegalStateException", 71), + Wfn(19, 236, { 3: 1, 35: 1, 19: 1, 236: 1 }, rb), + (Fjn.wd = function (n) { + return (function (n, t) { + return eO(n.a, t.a); + })(this, Yx(n, 19)); + }), + (Fjn.ke = function () { + return this.a; + }), + (Fjn.Fb = function (n) { + return CO(n, 19) && Yx(n, 19).a == this.a; + }), + (Fjn.Hb = function () { + return this.a; + }), + (Fjn.Ib = function () { + return "" + this.a; + }), + (Fjn.a = 0); + var G_n, + z_n, + U_n = EF(Jjn, "Integer", 19); + Wfn(162, 236, { 3: 1, 35: 1, 162: 1, 236: 1 }, cb), + (Fjn.wd = function (n) { + return (function (n, t) { + return Q_(n.a, t.a); + })(this, Yx(n, 162)); + }), + (Fjn.ke = function () { + return VU(this.a); + }), + (Fjn.Fb = function (n) { + return CO(n, 162) && sI(Yx(n, 162).a, this.a); + }), + (Fjn.Hb = function () { + return WR(this.a); + }), + (Fjn.Ib = function () { + return "" + HK(this.a); + }), + (Fjn.a = 0); + var X_n, + W_n, + V_n, + Q_n, + Y_n, + J_n = EF(Jjn, "Long", 162); + Wfn(2039, 1, {}), + Wfn(1831, 60, eTn, Jm), + EF(Jjn, "NegativeArraySizeException", 1831), + Wfn(173, 598, { 3: 1, 102: 1, 173: 1, 60: 1, 78: 1 }, Np, Zm), + (Fjn.Wd = function (n) { + return new TypeError(n); + }), + EF(Jjn, "NullPointerException", 173), + Wfn(127, 32, { 3: 1, 102: 1, 32: 1, 127: 1, 60: 1, 78: 1 }, Iy), + EF(Jjn, "NumberFormatException", 127), + Wfn(184, 236, { 3: 1, 35: 1, 236: 1, 184: 1 }, ab), + (Fjn.wd = function (n) { + return (function (n, t) { + return n.a - t.a; + })(this, Yx(n, 184)); + }), + (Fjn.ke = function () { + return this.a; + }), + (Fjn.Fb = function (n) { + return CO(n, 184) && Yx(n, 184).a == this.a; + }), + (Fjn.Hb = function () { + return this.a; + }), + (Fjn.Ib = function () { + return "" + this.a; + }), + (Fjn.a = 0); + var Z_n, + nFn = EF(Jjn, "Short", 184); + Wfn(310, 1, { 3: 1, 310: 1 }, aH), + (Fjn.Fb = function (n) { + var t; + return !!CO(n, 310) && ((t = Yx(n, 310)), this.c == t.c && this.d == t.d && this.a == t.a && this.b == t.b); + }), + (Fjn.Hb = function () { + return G6(x4(Gy(UKn, 1), iEn, 1, 5, [d9(this.c), this.a, this.d, this.b])); + }), + (Fjn.Ib = function () { + return this.a + "." + this.d + "(" + (null != this.b ? this.b : "Unknown Source") + (this.c >= 0 ? ":" + this.c : "") + ")"; + }), + (Fjn.c = 0); + var tFn = EF(Jjn, "StackTraceElement", 310); + zjn = { 3: 1, 475: 1, 35: 1, 2: 1 }; + var eFn, + iFn, + rFn, + cFn, + aFn, + uFn, + oFn, + sFn, + hFn, + fFn = EF(Jjn, rTn, 2); + Wfn(107, 418, { 475: 1 }, Cy, Oy, MA), + EF(Jjn, "StringBuffer", 107), + Wfn(100, 418, { 475: 1 }, Ay, $y, SA), + EF(Jjn, "StringBuilder", 100), + Wfn(687, 73, VTn, Ly), + EF(Jjn, "StringIndexOutOfBoundsException", 687), + Wfn(2043, 1, {}), + Wfn(844, 1, {}, x), + (Fjn.Kb = function (n) { + return Yx(n, 78).e; + }), + EF(Jjn, "Throwable/lambda$0$Type", 844), + Wfn(41, 60, { 3: 1, 102: 1, 60: 1, 78: 1, 41: 1 }, xp, sy), + EF(Jjn, "UnsupportedOperationException", 41), + Wfn(240, 236, { 3: 1, 35: 1, 236: 1, 240: 1 }, ZJ, Wk), + (Fjn.wd = function (n) { + return Ipn(this, Yx(n, 240)); + }), + (Fjn.ke = function () { + return gon(Kmn(this)); + }), + (Fjn.Fb = function (n) { + var t; + return this === n || (!!CO(n, 240) && ((t = Yx(n, 240)), this.e == t.e && 0 == Ipn(this, t))); + }), + (Fjn.Hb = function () { + var n; + return 0 != this.b + ? this.b + : this.a < 54 + ? ((n = D3(this.f)), + (this.b = WR(Gz(n, -1))), + (this.b = 33 * this.b + WR(Gz(zK(n, 32), -1))), + (this.b = 17 * this.b + oG(this.e)), + this.b) + : ((this.b = 17 * b8(this.c) + oG(this.e)), this.b); + }), + (Fjn.Ib = function () { + return Kmn(this); + }), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.d = 0), + (Fjn.e = 0), + (Fjn.f = 0); + var lFn, + bFn, + wFn, + dFn, + gFn, + pFn, + vFn = EF("java.math", "BigDecimal", 240); + Wfn(91, 236, { 3: 1, 35: 1, 236: 1, 91: 1 }, jen, wQ, C_, pan, Mtn, IC), + (Fjn.wd = function (n) { + return utn(this, Yx(n, 91)); + }), + (Fjn.ke = function () { + return gon(pjn(this, 0)); + }), + (Fjn.Fb = function (n) { + return q7(this, n); + }), + (Fjn.Hb = function () { + return b8(this); + }), + (Fjn.Ib = function () { + return pjn(this, 0); + }), + (Fjn.b = -2), + (Fjn.c = 0), + (Fjn.d = 0), + (Fjn.e = 0); + var mFn, + yFn, + kFn, + jFn, + EFn = EF("java.math", "BigInteger", 91); + Wfn(488, 1967, bEn), + (Fjn.$b = function () { + U_(this); + }), + (Fjn._b = function (n) { + return P_(this, n); + }), + (Fjn.uc = function (n) { + return m6(this, n, this.g) || m6(this, n, this.f); + }), + (Fjn.vc = function () { + return new Ql(this); + }), + (Fjn.xc = function (n) { + return BF(this, n); + }), + (Fjn.zc = function (n, t) { + return xB(this, n, t); + }), + (Fjn.Bc = function (n) { + return zV(this, n); + }), + (Fjn.gc = function () { + return hE(this); + }), + EF(lEn, "AbstractHashMap", 488), + Wfn(261, dEn, gEn, Ql), + (Fjn.$b = function () { + this.a.$b(); + }), + (Fjn.Hc = function (n) { + return XU(this, n); + }), + (Fjn.Kc = function () { + return new t6(this.a); + }), + (Fjn.Mc = function (n) { + var t; + return !!XU(this, n) && ((t = Yx(n, 42).cd()), this.a.Bc(t), !0); + }), + (Fjn.gc = function () { + return this.a.gc(); + }), + EF(lEn, "AbstractHashMap/EntrySet", 261), + Wfn(262, 1, fEn, t6), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Pb = function () { + return s1(this); + }), + (Fjn.Ob = function () { + return this.b; + }), + (Fjn.Qb = function () { + oY(this); + }), + (Fjn.b = !1), + EF(lEn, "AbstractHashMap/EntrySetIterator", 262), + Wfn(417, 1, fEn, Vl), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return OT(this); + }), + (Fjn.Pb = function () { + return FH(this); + }), + (Fjn.Qb = function () { + hB(this); + }), + (Fjn.b = 0), + (Fjn.c = -1), + EF(lEn, "AbstractList/IteratorImpl", 417), + Wfn(96, 417, yEn, JU), + (Fjn.Qb = function () { + hB(this); + }), + (Fjn.Rb = function (n) { + ZL(this, n); + }), + (Fjn.Sb = function () { + return this.b > 0; + }), + (Fjn.Tb = function () { + return this.b; + }), + (Fjn.Ub = function () { + return S$(this.b > 0), this.a.Xb((this.c = --this.b)); + }), + (Fjn.Vb = function () { + return this.b - 1; + }), + (Fjn.Wb = function (n) { + M$(-1 != this.c), this.a._c(this.c, n); + }), + EF(lEn, "AbstractList/ListIteratorImpl", 96), + Wfn(219, 52, WEn, Oz), + (Fjn.Vc = function (n, t) { + iz(n, this.b), this.c.Vc(this.a + n, t), ++this.b; + }), + (Fjn.Xb = function (n) { + return $z(n, this.b), this.c.Xb(this.a + n); + }), + (Fjn.$c = function (n) { + var t; + return $z(n, this.b), (t = this.c.$c(this.a + n)), --this.b, t; + }), + (Fjn._c = function (n, t) { + return $z(n, this.b), this.c._c(this.a + n, t); + }), + (Fjn.gc = function () { + return this.b; + }), + (Fjn.a = 0), + (Fjn.b = 0), + EF(lEn, "AbstractList/SubList", 219), + Wfn(384, dEn, gEn, Yl), + (Fjn.$b = function () { + this.a.$b(); + }), + (Fjn.Hc = function (n) { + return this.a._b(n); + }), + (Fjn.Kc = function () { + return new Jl(this.a.vc().Kc()); + }), + (Fjn.Mc = function (n) { + return !!this.a._b(n) && (this.a.Bc(n), !0); + }), + (Fjn.gc = function () { + return this.a.gc(); + }), + EF(lEn, "AbstractMap/1", 384), + Wfn(691, 1, fEn, Jl), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return this.a.Ob(); + }), + (Fjn.Pb = function () { + return Yx(this.a.Pb(), 42).cd(); + }), + (Fjn.Qb = function () { + this.a.Qb(); + }), + EF(lEn, "AbstractMap/1/1", 691), + Wfn(226, 28, wEn, Zl), + (Fjn.$b = function () { + this.a.$b(); + }), + (Fjn.Hc = function (n) { + return this.a.uc(n); + }), + (Fjn.Kc = function () { + return new ub(this.a.vc().Kc()); + }), + (Fjn.gc = function () { + return this.a.gc(); + }), + EF(lEn, "AbstractMap/2", 226), + Wfn(294, 1, fEn, ub), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return this.a.Ob(); + }), + (Fjn.Pb = function () { + return Yx(this.a.Pb(), 42).dd(); + }), + (Fjn.Qb = function () { + this.a.Qb(); + }), + EF(lEn, "AbstractMap/2/1", 294), + Wfn(484, 1, { 484: 1, 42: 1 }), + (Fjn.Fb = function (n) { + var t; + return !!CO(n, 42) && ((t = Yx(n, 42)), qB(this.d, t.cd()) && qB(this.e, t.dd())); + }), + (Fjn.cd = function () { + return this.d; + }), + (Fjn.dd = function () { + return this.e; + }), + (Fjn.Hb = function () { + return NC(this.d) ^ NC(this.e); + }), + (Fjn.ed = function (n) { + return YL(this, n); + }), + (Fjn.Ib = function () { + return this.d + "=" + this.e; + }), + EF(lEn, "AbstractMap/AbstractEntry", 484), + Wfn(383, 484, { 484: 1, 383: 1, 42: 1 }, zT), + EF(lEn, "AbstractMap/SimpleEntry", 383), + Wfn(1984, 1, hMn), + (Fjn.Fb = function (n) { + var t; + return !!CO(n, 42) && ((t = Yx(n, 42)), qB(this.cd(), t.cd()) && qB(this.dd(), t.dd())); + }), + (Fjn.Hb = function () { + return NC(this.cd()) ^ NC(this.dd()); + }), + (Fjn.Ib = function () { + return this.cd() + "=" + this.dd(); + }), + EF(lEn, jEn, 1984), + Wfn(1992, 1967, pEn), + (Fjn.tc = function (n) { + return vV(this, n); + }), + (Fjn._b = function (n) { + return XN(this, n); + }), + (Fjn.vc = function () { + return new hb(this); + }), + (Fjn.xc = function (n) { + return eI(c6(this, n)); + }), + (Fjn.ec = function () { + return new ob(this); + }), + EF(lEn, "AbstractNavigableMap", 1992), + Wfn(739, dEn, gEn, hb), + (Fjn.Hc = function (n) { + return CO(n, 42) && vV(this.b, Yx(n, 42)); + }), + (Fjn.Kc = function () { + return new gN(this.b); + }), + (Fjn.Mc = function (n) { + var t; + return !!CO(n, 42) && ((t = Yx(n, 42)), iY(this.b, t)); + }), + (Fjn.gc = function () { + return this.b.c; + }), + EF(lEn, "AbstractNavigableMap/EntrySet", 739), + Wfn(493, dEn, mEn, ob), + (Fjn.Nc = function () { + return new RT(this); + }), + (Fjn.$b = function () { + $m(this.a); + }), + (Fjn.Hc = function (n) { + return XN(this.a, n); + }), + (Fjn.Kc = function () { + return new sb(new gN(new UA(this.a).b)); + }), + (Fjn.Mc = function (n) { + return !!XN(this.a, n) && (fG(this.a, n), !0); + }), + (Fjn.gc = function () { + return this.a.c; + }), + EF(lEn, "AbstractNavigableMap/NavigableKeySet", 493), + Wfn(494, 1, fEn, sb), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return OT(this.a.a); + }), + (Fjn.Pb = function () { + return m$(this.a).cd(); + }), + (Fjn.Qb = function () { + hx(this.a); + }), + EF(lEn, "AbstractNavigableMap/NavigableKeySet/1", 494), + Wfn(2004, 28, wEn), + (Fjn.Fc = function (n) { + return JQ(mun(this, n)), !0; + }), + (Fjn.Gc = function (n) { + return vB(n), jD(n != this, "Can't add a queue to itself"), C2(this, n); + }), + (Fjn.$b = function () { + for (; null != YJ(this); ); + }), + EF(lEn, "AbstractQueue", 2004), + Wfn(302, 28, { 4: 1, 20: 1, 28: 1, 14: 1 }, ep, xz), + (Fjn.Fc = function (n) { + return CX(this, n), !0; + }), + (Fjn.$b = function () { + iW(this); + }), + (Fjn.Hc = function (n) { + return T4(new VB(this), n); + }), + (Fjn.dc = function () { + return ry(this); + }), + (Fjn.Kc = function () { + return new VB(this); + }), + (Fjn.Mc = function (n) { + return (function (n, t) { + return !!T4(n, t) && (a0(n), !0); + })(new VB(this), n); + }), + (Fjn.gc = function () { + return (this.c - this.b) & (this.a.length - 1); + }), + (Fjn.Nc = function () { + return new Nz(this, 272); + }), + (Fjn.Qc = function (n) { + var t; + return ( + (t = (this.c - this.b) & (this.a.length - 1)), + n.length < t && (n = qy(new Array(t), n)), + Z0(this, n, t), + n.length > t && DF(n, t, null), + n + ); + }), + (Fjn.b = 0), + (Fjn.c = 0), + EF(lEn, "ArrayDeque", 302), + Wfn(446, 1, fEn, VB), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return this.a != this.b; + }), + (Fjn.Pb = function () { + return w8(this); + }), + (Fjn.Qb = function () { + a0(this); + }), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.c = -1), + EF(lEn, "ArrayDeque/IteratorImpl", 446), + Wfn(12, 52, fMn, ip, pQ, sx), + (Fjn.Vc = function (n, t) { + ZR(this, n, t); + }), + (Fjn.Fc = function (n) { + return eD(this, n); + }), + (Fjn.Wc = function (n, t) { + return H6(this, n, t); + }), + (Fjn.Gc = function (n) { + return S4(this, n); + }), + (Fjn.$b = function () { + this.c = VQ(UKn, iEn, 1, 0, 5, 1); + }), + (Fjn.Hc = function (n) { + return -1 != hJ(this, n, 0); + }), + (Fjn.Jc = function (n) { + WZ(this, n); + }), + (Fjn.Xb = function (n) { + return TR(this, n); + }), + (Fjn.Xc = function (n) { + return hJ(this, n, 0); + }), + (Fjn.dc = function () { + return 0 == this.c.length; + }), + (Fjn.Kc = function () { + return new pb(this); + }), + (Fjn.$c = function (n) { + return KV(this, n); + }), + (Fjn.Mc = function (n) { + return uJ(this, n); + }), + (Fjn.Ud = function (n, t) { + Az(this, n, t); + }), + (Fjn._c = function (n, t) { + return QW(this, n, t); + }), + (Fjn.gc = function () { + return this.c.length; + }), + (Fjn.ad = function (n) { + JC(this, n); + }), + (Fjn.Pc = function () { + return w$(this); + }), + (Fjn.Qc = function (n) { + return Htn(this, n); + }); + var TFn, + MFn, + SFn, + PFn, + IFn, + CFn, + OFn, + AFn, + $Fn, + LFn = EF(lEn, "ArrayList", 12); + Wfn(7, 1, fEn, pb), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return ZC(this); + }), + (Fjn.Pb = function () { + return Hz(this); + }), + (Fjn.Qb = function () { + z_(this); + }), + (Fjn.a = 0), + (Fjn.b = -1), + EF(lEn, "ArrayList/1", 7), + Wfn(2013, e.Function, {}, T), + (Fjn.te = function (n, t) { + return $9(n, t); + }), + Wfn(154, 52, lMn, ay), + (Fjn.Hc = function (n) { + return -1 != p0(this, n); + }), + (Fjn.Jc = function (n) { + var t, e, i, r; + for (vB(n), i = 0, r = (e = this.a).length; i < r; ++i) (t = e[i]), n.td(t); + }), + (Fjn.Xb = function (n) { + return MR(this, n); + }), + (Fjn._c = function (n, t) { + var e; + return $z(n, this.a.length), (e = this.a[n]), DF(this.a, n, t), e; + }), + (Fjn.gc = function () { + return this.a.length; + }), + (Fjn.ad = function (n) { + JR(this.a, this.a.length, n); + }), + (Fjn.Pc = function () { + return qtn(this, VQ(UKn, iEn, 1, this.a.length, 5, 1)); + }), + (Fjn.Qc = function (n) { + return qtn(this, n); + }), + EF(lEn, "Arrays/ArrayList", 154), + Wfn(940, 52, lMn, S), + (Fjn.Hc = function (n) { + return !1; + }), + (Fjn.Xb = function (n) { + return CI(n); + }), + (Fjn.Kc = function () { + return XH(), sE(), PFn; + }), + (Fjn.Yc = function () { + return XH(), sE(), PFn; + }), + (Fjn.gc = function () { + return 0; + }), + EF(lEn, "Collections/EmptyList", 940), + Wfn(941, 1, yEn, P), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Rb = function (n) { + throw hp(new xp()); + }), + (Fjn.Ob = function () { + return !1; + }), + (Fjn.Sb = function () { + return !1; + }), + (Fjn.Pb = function () { + throw hp(new Kp()); + }), + (Fjn.Tb = function () { + return 0; + }), + (Fjn.Ub = function () { + throw hp(new Kp()); + }), + (Fjn.Vb = function () { + return -1; + }), + (Fjn.Qb = function () { + throw hp(new Lp()); + }), + (Fjn.Wb = function (n) { + throw hp(new Lp()); + }), + EF(lEn, "Collections/EmptyListIterator", 941), + Wfn(943, 1967, REn, I), + (Fjn._b = function (n) { + return !1; + }), + (Fjn.uc = function (n) { + return !1; + }), + (Fjn.vc = function () { + return XH(), SFn; + }), + (Fjn.xc = function (n) { + return null; + }), + (Fjn.ec = function () { + return XH(), SFn; + }), + (Fjn.gc = function () { + return 0; + }), + (Fjn.Cc = function () { + return XH(), TFn; + }), + EF(lEn, "Collections/EmptyMap", 943), + Wfn(942, dEn, _En, M), + (Fjn.Hc = function (n) { + return !1; + }), + (Fjn.Kc = function () { + return XH(), sE(), PFn; + }), + (Fjn.gc = function () { + return 0; + }), + EF(lEn, "Collections/EmptySet", 942), + Wfn(599, 52, { 3: 1, 20: 1, 28: 1, 52: 1, 14: 1, 15: 1 }, bb), + (Fjn.Hc = function (n) { + return qB(this.a, n); + }), + (Fjn.Xb = function (n) { + return $z(n, 1), this.a; + }), + (Fjn.gc = function () { + return 1; + }), + EF(lEn, "Collections/SingletonList", 599), + Wfn(372, 1, LEn, fb), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Lc = function () { + return new SR(null, this.Nc()); + }), + (Fjn.Nc = function () { + return new Nz(this, 0); + }), + (Fjn.Oc = function () { + return new SR(null, this.Nc()); + }), + (Fjn.Fc = function (n) { + return Hk(); + }), + (Fjn.Gc = function (n) { + return qk(); + }), + (Fjn.$b = function () { + Gk(); + }), + (Fjn.Hc = function (n) { + return fE(this, n); + }), + (Fjn.Ic = function (n) { + return lE(this, n); + }), + (Fjn.dc = function () { + return this.b.dc(); + }), + (Fjn.Kc = function () { + return new lb(this.b.Kc()); + }), + (Fjn.Mc = function (n) { + return zk(); + }), + (Fjn.gc = function () { + return this.b.gc(); + }), + (Fjn.Pc = function () { + return this.b.Pc(); + }), + (Fjn.Qc = function (n) { + return bE(this, n); + }), + (Fjn.Ib = function () { + return I7(this.b); + }), + EF(lEn, "Collections/UnmodifiableCollection", 372), + Wfn(371, 1, fEn, lb), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return this.b.Ob(); + }), + (Fjn.Pb = function () { + return this.b.Pb(); + }), + (Fjn.Qb = function () { + Uk(); + }), + EF(lEn, "Collections/UnmodifiableCollectionIterator", 371), + Wfn(531, 372, bMn, PA), + (Fjn.Nc = function () { + return new Nz(this, 16); + }), + (Fjn.Vc = function (n, t) { + throw hp(new xp()); + }), + (Fjn.Wc = function (n, t) { + throw hp(new xp()); + }), + (Fjn.Fb = function (n) { + return Q8(this.a, n); + }), + (Fjn.Xb = function (n) { + return this.a.Xb(n); + }), + (Fjn.Hb = function () { + return W5(this.a); + }), + (Fjn.Xc = function (n) { + return this.a.Xc(n); + }), + (Fjn.dc = function () { + return this.a.dc(); + }), + (Fjn.Yc = function () { + return new IA(this.a.Zc(0)); + }), + (Fjn.Zc = function (n) { + return new IA(this.a.Zc(n)); + }), + (Fjn.$c = function (n) { + throw hp(new xp()); + }), + (Fjn._c = function (n, t) { + throw hp(new xp()); + }), + (Fjn.ad = function (n) { + throw hp(new xp()); + }), + (Fjn.bd = function (n, t) { + return new PA(this.a.bd(n, t)); + }), + EF(lEn, "Collections/UnmodifiableList", 531), + Wfn(690, 371, yEn, IA), + (Fjn.Qb = function () { + Uk(); + }), + (Fjn.Rb = function (n) { + throw hp(new xp()); + }), + (Fjn.Sb = function () { + return this.a.Sb(); + }), + (Fjn.Tb = function () { + return this.a.Tb(); + }), + (Fjn.Ub = function () { + return this.a.Ub(); + }), + (Fjn.Vb = function () { + return this.a.Vb(); + }), + (Fjn.Wb = function (n) { + throw hp(new xp()); + }), + EF(lEn, "Collections/UnmodifiableListIterator", 690), + Wfn(600, 1, bEn, gb), + (Fjn.wc = function (n) { + S3(this, n); + }), + (Fjn.yc = function (n, t, e) { + return Y9(this, n, t, e); + }), + (Fjn.$b = function () { + throw hp(new xp()); + }), + (Fjn._b = function (n) { + return this.c._b(n); + }), + (Fjn.uc = function (n) { + return dE(this, n); + }), + (Fjn.vc = function () { + return FB(this); + }), + (Fjn.Fb = function (n) { + return pE(this, n); + }), + (Fjn.xc = function (n) { + return this.c.xc(n); + }), + (Fjn.Hb = function () { + return W5(this.c); + }), + (Fjn.dc = function () { + return this.c.dc(); + }), + (Fjn.ec = function () { + return BB(this); + }), + (Fjn.zc = function (n, t) { + throw hp(new xp()); + }), + (Fjn.Bc = function (n) { + throw hp(new xp()); + }), + (Fjn.gc = function () { + return this.c.gc(); + }), + (Fjn.Ib = function () { + return I7(this.c); + }), + (Fjn.Cc = function () { + return _B(this); + }), + EF(lEn, "Collections/UnmodifiableMap", 600), + Wfn(382, 372, KEn, Ny), + (Fjn.Nc = function () { + return new Nz(this, 1); + }), + (Fjn.Fb = function (n) { + return Q8(this.b, n); + }), + (Fjn.Hb = function () { + return W5(this.b); + }), + EF(lEn, "Collections/UnmodifiableSet", 382), + Wfn(944, 382, KEn, Dy), + (Fjn.Hc = function (n) { + return wE(this, n); + }), + (Fjn.Ic = function (n) { + return this.b.Ic(n); + }), + (Fjn.Kc = function () { + return new wb(this.b.Kc()); + }), + (Fjn.Pc = function () { + var n; + return pW((n = this.b.Pc()), n.length), n; + }), + (Fjn.Qc = function (n) { + return Nq(this, n); + }), + EF(lEn, "Collections/UnmodifiableMap/UnmodifiableEntrySet", 944), + Wfn(945, 1, fEn, wb), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Pb = function () { + return new db(Yx(this.a.Pb(), 42)); + }), + (Fjn.Ob = function () { + return this.a.Ob(); + }), + (Fjn.Qb = function () { + throw hp(new xp()); + }), + EF(lEn, "Collections/UnmodifiableMap/UnmodifiableEntrySet/1", 945), + Wfn(688, 1, hMn, db), + (Fjn.Fb = function (n) { + return this.a.Fb(n); + }), + (Fjn.cd = function () { + return this.a.cd(); + }), + (Fjn.dd = function () { + return this.a.dd(); + }), + (Fjn.Hb = function () { + return this.a.Hb(); + }), + (Fjn.ed = function (n) { + throw hp(new xp()); + }), + (Fjn.Ib = function () { + return I7(this.a); + }), + EF(lEn, "Collections/UnmodifiableMap/UnmodifiableEntrySet/UnmodifiableEntry", 688), + Wfn(601, 531, { 20: 1, 14: 1, 15: 1, 54: 1 }, xy), + EF(lEn, "Collections/UnmodifiableRandomAccessList", 601), + Wfn(689, 382, FEn, CA), + (Fjn.Nc = function () { + return new RT(this); + }), + (Fjn.Fb = function (n) { + return Q8(this.a, n); + }), + (Fjn.Hb = function () { + return W5(this.a); + }), + EF(lEn, "Collections/UnmodifiableSortedSet", 689), + Wfn(847, 1, wMn, D), + (Fjn.ue = function (n, t) { + var e; + return 0 != (e = vW(Yx(n, 11), Yx(t, 11))) ? e : Opn(Yx(n, 11), Yx(t, 11)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(lEn, "Comparator/lambda$0$Type", 847), + Wfn(751, 1, wMn, R), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return vB(n), u3(n, (vB(t), t)); + })(Yx(n, 35), Yx(t, 35)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return WH(), OFn; + }), + EF(lEn, "Comparators/NaturalOrderComparator", 751), + Wfn(1177, 1, wMn, K), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return vB(t), u3(t, (vB(n), n)); + })(Yx(n, 35), Yx(t, 35)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return WH(), CFn; + }), + EF(lEn, "Comparators/ReverseNaturalOrderComparator", 1177), + Wfn(64, 1, wMn, Eb), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ue = function (n, t) { + return this.a.ue(t, n); + }), + (Fjn.ve = function () { + return this.a; + }), + EF(lEn, "Comparators/ReversedComparator", 64), + Wfn(166, 60, eTn, Dp), + EF(lEn, "ConcurrentModificationException", 166), + Wfn(1904, 1, dMn, _), + (Fjn.we = function (n) { + Mnn(this, n); + }), + (Fjn.Ib = function () { + return ( + "DoubleSummaryStatistics[count = " + + HK(this.a) + + ", avg = " + + ($T(this.a, 0) ? BV(this) / VU(this.a) : 0) + + ", min = " + + this.c + + ", max = " + + this.b + + ", sum = " + + BV(this) + + "]" + ); + }), + (Fjn.a = 0), + (Fjn.b = ZTn), + (Fjn.c = JTn), + (Fjn.d = 0), + (Fjn.e = 0), + (Fjn.f = 0), + EF(lEn, "DoubleSummaryStatistics", 1904), + Wfn(1805, 60, eTn, Rp), + EF(lEn, "EmptyStackException", 1805), + Wfn(451, 1967, bEn, C7), + (Fjn.zc = function (n, t) { + return VL(this, n, t); + }), + (Fjn.$b = function () { + kB(this); + }), + (Fjn._b = function (n) { + return AT(this, n); + }), + (Fjn.uc = function (n) { + var t, e; + for (e = new TE(this.a); e.a < e.c.a.length; ) if (((t = eW(e)), qB(n, this.b[t.g]))) return !0; + return !1; + }), + (Fjn.vc = function () { + return new Tb(this); + }), + (Fjn.xc = function (n) { + return GB(this, n); + }), + (Fjn.Bc = function (n) { + return rz(this, n); + }), + (Fjn.gc = function () { + return this.a.c; + }), + EF(lEn, "EnumMap", 451), + Wfn(1352, dEn, gEn, Tb), + (Fjn.$b = function () { + kB(this.a); + }), + (Fjn.Hc = function (n) { + return UU(this, n); + }), + (Fjn.Kc = function () { + return new yR(this.a); + }), + (Fjn.Mc = function (n) { + var t; + return !!UU(this, n) && ((t = Yx(n, 42).cd()), rz(this.a, t), !0); + }), + (Fjn.gc = function () { + return this.a.a.c; + }), + EF(lEn, "EnumMap/EntrySet", 1352), + Wfn(1353, 1, fEn, yR), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Pb = function () { + return (this.b = eW(this.a)), new UT(this.c, this.b); + }), + (Fjn.Ob = function () { + return nO(this.a); + }), + (Fjn.Qb = function () { + M$(!!this.b), rz(this.c, this.b), (this.b = null); + }), + EF(lEn, "EnumMap/EntrySetIterator", 1353), + Wfn(1354, 1984, hMn, UT), + (Fjn.cd = function () { + return this.a; + }), + (Fjn.dd = function () { + return this.b.b[this.a.g]; + }), + (Fjn.ed = function (n) { + return K_(this.b, this.a.g, n); + }), + EF(lEn, "EnumMap/MapEntry", 1354), + Wfn(174, dEn, { 20: 1, 28: 1, 14: 1, 174: 1, 21: 1 }); + var NFn = EF(lEn, "EnumSet", 174); + Wfn(156, 174, { 20: 1, 28: 1, 14: 1, 174: 1, 156: 1, 21: 1 }, cx), + (Fjn.Fc = function (n) { + return n2(this, Yx(n, 22)); + }), + (Fjn.Hc = function (n) { + return rK(this, n); + }), + (Fjn.Kc = function () { + return new TE(this); + }), + (Fjn.Mc = function (n) { + return cK(this, n); + }), + (Fjn.gc = function () { + return this.c; + }), + (Fjn.c = 0), + EF(lEn, "EnumSet/EnumSetImpl", 156), + Wfn(343, 1, fEn, TE), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Pb = function () { + return eW(this); + }), + (Fjn.Ob = function () { + return nO(this); + }), + (Fjn.Qb = function () { + M$(-1 != this.b), DF(this.c.b, this.b, null), --this.c.c, (this.b = -1); + }), + (Fjn.a = -1), + (Fjn.b = -1), + EF(lEn, "EnumSet/EnumSetImpl/IteratorImpl", 343), + Wfn(43, 488, gMn, rp, kE, II), + (Fjn.re = function (n, t) { + return iI(n) === iI(t) || (null != n && Q8(n, t)); + }), + (Fjn.se = function (n) { + return 0 | W5(n); + }), + EF(lEn, "HashMap", 43), + Wfn(53, dEn, pMn, Qp, Xk, kR), + (Fjn.Fc = function (n) { + return __(this, n); + }), + (Fjn.$b = function () { + this.a.$b(); + }), + (Fjn.Hc = function (n) { + return gE(this, n); + }), + (Fjn.dc = function () { + return 0 == this.a.gc(); + }), + (Fjn.Kc = function () { + return this.a.ec().Kc(); + }), + (Fjn.Mc = function (n) { + return SO(this, n); + }), + (Fjn.gc = function () { + return this.a.gc(); + }); + var xFn, + DFn = EF(lEn, "HashSet", 53); + Wfn(1781, 1, CEn, F), + (Fjn.ud = function (n) { + C3(this, n); + }), + (Fjn.Ib = function () { + return ( + "IntSummaryStatistics[count = " + + HK(this.a) + + ", avg = " + + ($T(this.a, 0) ? VU(this.d) / VU(this.a) : 0) + + ", min = " + + this.c + + ", max = " + + this.b + + ", sum = " + + HK(this.d) + + "]" + ); + }), + (Fjn.a = 0), + (Fjn.b = nTn), + (Fjn.c = Yjn), + (Fjn.d = 0), + EF(lEn, "IntSummaryStatistics", 1781), + Wfn(1049, 1, $En, iC), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Kc = function () { + return new ZU(this); + }), + (Fjn.c = 0), + EF(lEn, "InternalHashCodeMap", 1049), + Wfn(711, 1, fEn, ZU), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Pb = function () { + return (this.d = this.a[this.c++]), this.d; + }), + (Fjn.Ob = function () { + var n; + return this.c < this.a.length || (!(n = this.b.next()).done && ((this.a = n.value[1]), (this.c = 0), !0)); + }), + (Fjn.Qb = function () { + Qfn(this.e, this.d.cd()), 0 != this.c && --this.c; + }), + (Fjn.c = 0), + (Fjn.d = null), + EF(lEn, "InternalHashCodeMap/1", 711), + Wfn(1047, 1, $En, rC), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Kc = function () { + return new lW(this); + }), + (Fjn.c = 0), + (Fjn.d = 0), + EF(lEn, "InternalStringMap", 1047), + Wfn(710, 1, fEn, lW), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Pb = function () { + return (this.c = this.a), (this.a = this.b.next()), new ax(this.d, this.c, this.d.d); + }), + (Fjn.Ob = function () { + return !this.a.done; + }), + (Fjn.Qb = function () { + s4(this.d, this.c.value[0]); + }), + EF(lEn, "InternalStringMap/1", 710), + Wfn(1048, 1984, hMn, ax), + (Fjn.cd = function () { + return this.b.value[0]; + }), + (Fjn.dd = function () { + return this.a.d != this.c ? NT(this.a, this.b.value[0]) : this.b.value[1]; + }), + (Fjn.ed = function (n) { + return r7(this.a, this.b.value[0], n); + }), + (Fjn.c = 0), + EF(lEn, "InternalStringMap/2", 1048), + Wfn(228, 43, gMn, bW, tY), + (Fjn.$b = function () { + nN(this); + }), + (Fjn._b = function (n) { + return xT(this, n); + }), + (Fjn.uc = function (n) { + var t; + for (t = this.d.a; t != this.d; ) { + if (qB(t.e, n)) return !0; + t = t.a; + } + return !1; + }), + (Fjn.vc = function () { + return new Sb(this); + }), + (Fjn.xc = function (n) { + return UJ(this, n); + }), + (Fjn.zc = function (n, t) { + return Gtn(this, n, t); + }), + (Fjn.Bc = function (n) { + return oJ(this, n); + }), + (Fjn.gc = function () { + return hE(this.e); + }), + (Fjn.c = !1), + EF(lEn, "LinkedHashMap", 228), + Wfn(387, 383, { 484: 1, 383: 1, 387: 1, 42: 1 }, P$, oD), + EF(lEn, "LinkedHashMap/ChainEntry", 387), + Wfn(701, dEn, gEn, Sb), + (Fjn.$b = function () { + nN(this.a); + }), + (Fjn.Hc = function (n) { + return WU(this, n); + }), + (Fjn.Kc = function () { + return new sB(this); + }), + (Fjn.Mc = function (n) { + var t; + return !!WU(this, n) && ((t = Yx(n, 42).cd()), oJ(this.a, t), !0); + }), + (Fjn.gc = function () { + return hE(this.a.e); + }), + EF(lEn, "LinkedHashMap/EntrySet", 701), + Wfn(702, 1, fEn, sB), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Pb = function () { + return sY(this); + }), + (Fjn.Ob = function () { + return this.b != this.c.a.d; + }), + (Fjn.Qb = function () { + M$(!!this.a), zU(this.c.a.e, this), _D(this.a), zV(this.c.a.e, this.a.d), tL(this.c.a.e, this), (this.a = null); + }), + EF(lEn, "LinkedHashMap/EntrySet/EntryIterator", 702), + Wfn(178, 53, pMn, oC, GA, jR); + var RFn = EF(lEn, "LinkedHashSet", 178); + Wfn(68, 1964, { 3: 1, 4: 1, 20: 1, 28: 1, 52: 1, 14: 1, 68: 1, 15: 1 }, ME, ox), + (Fjn.Fc = function (n) { + return KD(this, n); + }), + (Fjn.$b = function () { + BH(this); + }), + (Fjn.Zc = function (n) { + return Ztn(this, n); + }), + (Fjn.gc = function () { + return this.b; + }), + (Fjn.b = 0); + var KFn, + _Fn, + FFn, + BFn, + HFn, + qFn = EF(lEn, "LinkedList", 68); + Wfn(970, 1, yEn, ux), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Rb = function (n) { + oF(this, n); + }), + (Fjn.Ob = function () { + return ij(this); + }), + (Fjn.Sb = function () { + return this.b.b != this.d.a; + }), + (Fjn.Pb = function () { + return IX(this); + }), + (Fjn.Tb = function () { + return this.a; + }), + (Fjn.Ub = function () { + return MU(this); + }), + (Fjn.Vb = function () { + return this.a - 1; + }), + (Fjn.Qb = function () { + BZ(this); + }), + (Fjn.Wb = function (n) { + M$(!!this.c), (this.c.c = n); + }), + (Fjn.a = 0), + (Fjn.c = null), + EF(lEn, "LinkedList/ListIteratorImpl", 970), + Wfn(608, 1, {}, $), + EF(lEn, "LinkedList/Node", 608), + Wfn(1959, 1, {}), + EF(lEn, "Locale", 1959), + Wfn(861, 1959, {}, L), + (Fjn.Ib = function () { + return ""; + }), + EF(lEn, "Locale/1", 861), + Wfn(862, 1959, {}, N), + (Fjn.Ib = function () { + return "unknown"; + }), + EF(lEn, "Locale/4", 862), + Wfn(109, 60, { 3: 1, 102: 1, 60: 1, 78: 1, 109: 1 }, Kp, WB), + EF(lEn, "NoSuchElementException", 109), + Wfn(404, 1, { 404: 1 }, Am), + (Fjn.Fb = function (n) { + var t; + return n === this || (!!CO(n, 404) && ((t = Yx(n, 404)), qB(this.a, t.a))); + }), + (Fjn.Hb = function () { + return NC(this.a); + }), + (Fjn.Ib = function () { + return null != this.a ? cEn + xA(this.a) + ")" : "Optional.empty()"; + }), + EF(lEn, "Optional", 404), + Wfn(463, 1, { 463: 1 }, DI, y$), + (Fjn.Fb = function (n) { + var t; + return n === this || (!!CO(n, 463) && ((t = Yx(n, 463)), this.a == t.a && 0 == $9(this.b, t.b))); + }), + (Fjn.Hb = function () { + return this.a ? oG(this.b) : 0; + }), + (Fjn.Ib = function () { + return this.a ? "OptionalDouble.of(" + this.b + ")" : "OptionalDouble.empty()"; + }), + (Fjn.a = !1), + (Fjn.b = 0), + EF(lEn, "OptionalDouble", 463), + Wfn(517, 1, { 517: 1 }, RI, k$), + (Fjn.Fb = function (n) { + var t; + return n === this || (!!CO(n, 517) && ((t = Yx(n, 517)), this.a == t.a && 0 == eO(this.b, t.b))); + }), + (Fjn.Hb = function () { + return this.a ? this.b : 0; + }), + (Fjn.Ib = function () { + return this.a ? "OptionalInt.of(" + this.b + ")" : "OptionalInt.empty()"; + }), + (Fjn.a = !1), + (Fjn.b = 0), + EF(lEn, "OptionalInt", 517), + Wfn(503, 2004, wEn, h_), + (Fjn.Gc = function (n) { + return Xrn(this, n); + }), + (Fjn.$b = function () { + this.b.c = VQ(UKn, iEn, 1, 0, 5, 1); + }), + (Fjn.Hc = function (n) { + return -1 != (null == n ? -1 : hJ(this.b, n, 0)); + }), + (Fjn.Kc = function () { + return new vb(this); + }), + (Fjn.Mc = function (n) { + return t2(this, n); + }), + (Fjn.gc = function () { + return this.b.c.length; + }), + (Fjn.Nc = function () { + return new Nz(this, 256); + }), + (Fjn.Pc = function () { + return w$(this.b); + }), + (Fjn.Qc = function (n) { + return Htn(this.b, n); + }), + EF(lEn, "PriorityQueue", 503), + Wfn(1277, 1, fEn, vb), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return this.a < this.c.b.c.length; + }), + (Fjn.Pb = function () { + return S$(this.a < this.c.b.c.length), (this.b = this.a++), TR(this.c.b, this.b); + }), + (Fjn.Qb = function () { + M$(-1 != this.b), e2(this.c, (this.a = this.b)), (this.b = -1); + }), + (Fjn.a = 0), + (Fjn.b = -1), + EF(lEn, "PriorityQueue/1", 1277), + Wfn(230, 1, { 230: 1 }, c7, jW), + (Fjn.a = 0), + (Fjn.b = 0); + var GFn, + zFn, + UFn, + XFn = 0; + EF(lEn, "Random", 230), + Wfn(27, 1, SEn, Nz, nF, uH), + (Fjn.qd = function () { + return this.a; + }), + (Fjn.rd = function () { + return e_(this), this.c; + }), + (Fjn.Nb = function (n) { + e_(this), this.d.Nb(n); + }), + (Fjn.sd = function (n) { + return SZ(this, n); + }), + (Fjn.a = 0), + (Fjn.c = 0), + EF(lEn, "Spliterators/IteratorSpliterator", 27), + Wfn(485, 27, SEn, RT), + EF(lEn, "SortedSet/1", 485), + Wfn(602, 1, dMn, mb), + (Fjn.we = function (n) { + this.a.td(n); + }), + EF(lEn, "Spliterator/OfDouble/0methodref$accept$Type", 602), + Wfn(603, 1, dMn, yb), + (Fjn.we = function (n) { + this.a.td(n); + }), + EF(lEn, "Spliterator/OfDouble/1methodref$accept$Type", 603), + Wfn(604, 1, CEn, kb), + (Fjn.ud = function (n) { + this.a.td(d9(n)); + }), + EF(lEn, "Spliterator/OfInt/2methodref$accept$Type", 604), + Wfn(605, 1, CEn, jb), + (Fjn.ud = function (n) { + this.a.td(d9(n)); + }), + EF(lEn, "Spliterator/OfInt/3methodref$accept$Type", 605), + Wfn(617, 1, SEn), + (Fjn.Nb = function (n) { + Yk(this, n); + }), + (Fjn.qd = function () { + return this.d; + }), + (Fjn.rd = function () { + return this.e; + }), + (Fjn.d = 0), + (Fjn.e = 0), + EF(lEn, "Spliterators/BaseSpliterator", 617), + Wfn(721, 617, SEn), + (Fjn.xe = function (n) { + Qk(this, n); + }), + (Fjn.Nb = function (n) { + CO(n, 182) ? Qk(this, Yx(n, 182)) : Qk(this, new yb(n)); + }), + (Fjn.sd = function (n) { + return CO(n, 182) ? this.ye(Yx(n, 182)) : this.ye(new mb(n)); + }), + EF(lEn, "Spliterators/AbstractDoubleSpliterator", 721), + Wfn(720, 617, SEn), + (Fjn.xe = function (n) { + Qk(this, n); + }), + (Fjn.Nb = function (n) { + CO(n, 196) ? Qk(this, Yx(n, 196)) : Qk(this, new jb(n)); + }), + (Fjn.sd = function (n) { + return CO(n, 196) ? this.ye(Yx(n, 196)) : this.ye(new kb(n)); + }), + EF(lEn, "Spliterators/AbstractIntSpliterator", 720), + Wfn(540, 617, SEn), + EF(lEn, "Spliterators/AbstractSpliterator", 540), + Wfn(692, 1, SEn), + (Fjn.Nb = function (n) { + Yk(this, n); + }), + (Fjn.qd = function () { + return this.b; + }), + (Fjn.rd = function () { + return this.d - this.c; + }), + (Fjn.b = 0), + (Fjn.c = 0), + (Fjn.d = 0), + EF(lEn, "Spliterators/BaseArraySpliterator", 692), + Wfn(947, 692, SEn, qD), + (Fjn.ze = function (n, t) { + !(function (n, t, e) { + t.td(n.a[e]); + })(this, Yx(n, 38), t); + }), + (Fjn.Nb = function (n) { + FF(this, n); + }), + (Fjn.sd = function (n) { + return sQ(this, n); + }), + EF(lEn, "Spliterators/ArraySpliterator", 947), + Wfn(693, 692, SEn, QN), + (Fjn.ze = function (n, t) { + !(function (n, t, e) { + t.we(n.a[e]); + })(this, Yx(n, 182), t); + }), + (Fjn.xe = function (n) { + FF(this, n); + }), + (Fjn.Nb = function (n) { + CO(n, 182) ? FF(this, Yx(n, 182)) : FF(this, new yb(n)); + }), + (Fjn.ye = function (n) { + return sQ(this, n); + }), + (Fjn.sd = function (n) { + return CO(n, 182) ? sQ(this, Yx(n, 182)) : sQ(this, new mb(n)); + }), + EF(lEn, "Spliterators/DoubleArraySpliterator", 693), + Wfn(1968, 1, SEn), + (Fjn.Nb = function (n) { + Yk(this, n); + }), + (Fjn.qd = function () { + return 16448; + }), + (Fjn.rd = function () { + return 0; + }), + EF(lEn, "Spliterators/EmptySpliterator", 1968), + Wfn(946, 1968, SEn, z), + (Fjn.xe = function (n) { + _f(n); + }), + (Fjn.Nb = function (n) { + CO(n, 196) ? _f(Yx(n, 196)) : _f(new jb(n)); + }), + (Fjn.ye = function (n) { + return DT(n); + }), + (Fjn.sd = function (n) { + return CO(n, 196) ? DT(Yx(n, 196)) : DT(new kb(n)); + }), + EF(lEn, "Spliterators/EmptySpliterator/OfInt", 946), + Wfn(580, 52, SMn, Jp), + (Fjn.Vc = function (n, t) { + i_(n, this.a.c.length + 1), ZR(this.a, n, t); + }), + (Fjn.Fc = function (n) { + return eD(this.a, n); + }), + (Fjn.Wc = function (n, t) { + return i_(n, this.a.c.length + 1), H6(this.a, n, t); + }), + (Fjn.Gc = function (n) { + return S4(this.a, n); + }), + (Fjn.$b = function () { + this.a.c = VQ(UKn, iEn, 1, 0, 5, 1); + }), + (Fjn.Hc = function (n) { + return -1 != hJ(this.a, n, 0); + }), + (Fjn.Ic = function (n) { + return m4(this.a, n); + }), + (Fjn.Jc = function (n) { + WZ(this.a, n); + }), + (Fjn.Xb = function (n) { + return i_(n, this.a.c.length), TR(this.a, n); + }), + (Fjn.Xc = function (n) { + return hJ(this.a, n, 0); + }), + (Fjn.dc = function () { + return 0 == this.a.c.length; + }), + (Fjn.Kc = function () { + return new pb(this.a); + }), + (Fjn.$c = function (n) { + return i_(n, this.a.c.length), KV(this.a, n); + }), + (Fjn.Ud = function (n, t) { + Az(this.a, n, t); + }), + (Fjn._c = function (n, t) { + return i_(n, this.a.c.length), QW(this.a, n, t); + }), + (Fjn.gc = function () { + return this.a.c.length; + }), + (Fjn.ad = function (n) { + JC(this.a, n); + }), + (Fjn.bd = function (n, t) { + return new Oz(this.a, n, t); + }), + (Fjn.Pc = function () { + return w$(this.a); + }), + (Fjn.Qc = function (n) { + return Htn(this.a, n); + }), + (Fjn.Ib = function () { + return Gun(this.a); + }), + EF(lEn, "Vector", 580), + Wfn(809, 580, SMn, kv), + EF(lEn, "Stack", 809), + Wfn(206, 1, { 206: 1 }, J3), + (Fjn.Ib = function () { + return PU(this); + }), + EF(lEn, "StringJoiner", 206), + Wfn(544, 1992, { 3: 1, 83: 1, 171: 1, 161: 1 }, jE, f_), + (Fjn.$b = function () { + $m(this); + }), + (Fjn.vc = function () { + return new UA(this); + }), + (Fjn.zc = function (n, t) { + return S5(this, n, t); + }), + (Fjn.Bc = function (n) { + return fG(this, n); + }), + (Fjn.gc = function () { + return this.c; + }), + (Fjn.c = 0), + EF(lEn, "TreeMap", 544), + Wfn(390, 1, fEn, gN), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Pb = function () { + return m$(this); + }), + (Fjn.Ob = function () { + return OT(this.a); + }), + (Fjn.Qb = function () { + hx(this); + }), + EF(lEn, "TreeMap/EntryIterator", 390), + Wfn(435, 739, gEn, UA), + (Fjn.$b = function () { + $m(this.a); + }), + EF(lEn, "TreeMap/EntrySet", 435), + Wfn(436, 383, { 484: 1, 383: 1, 42: 1, 436: 1 }, nY), + (Fjn.b = !1); + var WFn, + VFn, + QFn, + YFn, + JFn = EF(lEn, "TreeMap/Node", 436); + Wfn(621, 1, {}, q), + (Fjn.Ib = function () { + return "State: mv=" + this.c + " value=" + this.d + " done=" + this.a + " found=" + this.b; + }), + (Fjn.a = !1), + (Fjn.b = !1), + (Fjn.c = !1), + EF(lEn, "TreeMap/State", 621), + Wfn(297, 22, PMn, _T), + (Fjn.Ae = function () { + return !1; + }), + (Fjn.Be = function () { + return !1; + }); + var ZFn, + nBn = X1( + lEn, + "TreeMap/SubMapType", + 297, + u_n, + function () { + return HY(), x4(Gy(nBn, 1), XEn, 297, 0, [WFn, VFn, QFn, YFn]); + }, + function (n) { + return HY(), rZ((qY(), ZFn), n); + }, + ); + Wfn(1112, 297, PMn, CC), + (Fjn.Be = function () { + return !0; + }), + X1(lEn, "TreeMap/SubMapType/1", 1112, nBn, null, null), + Wfn(1113, 297, PMn, hO), + (Fjn.Ae = function () { + return !0; + }), + (Fjn.Be = function () { + return !0; + }), + X1(lEn, "TreeMap/SubMapType/2", 1113, nBn, null, null), + Wfn(1114, 297, PMn, OC), + (Fjn.Ae = function () { + return !0; + }), + X1(lEn, "TreeMap/SubMapType/3", 1114, nBn, null, null), + Wfn(208, dEn, { 3: 1, 20: 1, 28: 1, 14: 1, 271: 1, 21: 1, 84: 1, 208: 1 }, rv, Vk), + (Fjn.Nc = function () { + return new RT(this); + }), + (Fjn.Fc = function (n) { + return uF(this, n); + }), + (Fjn.$b = function () { + $m(this.a); + }), + (Fjn.Hc = function (n) { + return XN(this.a, n); + }), + (Fjn.Kc = function () { + return new sb(new gN(new UA(new ob(this.a).a).b)); + }), + (Fjn.Mc = function (n) { + return RA(this, n); + }), + (Fjn.gc = function () { + return this.a.c; + }); + var tBn = EF(lEn, "TreeSet", 208); + Wfn(966, 1, {}, Pb), + (Fjn.Ce = function (n, t) { + return (function (n, t, e) { + return n.ue(t, e) <= 0 ? e : t; + })(this.a, n, t); + }), + EF(IMn, "BinaryOperator/lambda$0$Type", 966), + Wfn(967, 1, {}, Ib), + (Fjn.Ce = function (n, t) { + return (function (n, t, e) { + return n.ue(t, e) <= 0 ? t : e; + })(this.a, n, t); + }), + EF(IMn, "BinaryOperator/lambda$1$Type", 967), + Wfn(846, 1, {}, G), + (Fjn.Kb = function (n) { + return n; + }), + EF(IMn, "Function/lambda$0$Type", 846), + Wfn(431, 1, YEn, Cb), + (Fjn.Mb = function (n) { + return !this.a.Mb(n); + }), + EF(IMn, "Predicate/lambda$2$Type", 431), + Wfn(572, 1, { 572: 1 }); + var eBn, + iBn, + rBn = EF(CMn, "Handler", 572); + Wfn(2007, 1, Zjn), + (Fjn.ne = function () { + return "DUMMY"; + }), + (Fjn.Ib = function () { + return this.ne(); + }), + EF(CMn, "Level", 2007), + Wfn(1621, 2007, Zjn, U), + (Fjn.ne = function () { + return "INFO"; + }), + EF(CMn, "Level/LevelInfo", 1621), + Wfn(1640, 1, {}, Yp), + EF(CMn, "LogManager", 1640), + Wfn(1780, 1, Zjn, fx), + (Fjn.b = null), + EF(CMn, "LogRecord", 1780), + Wfn(512, 1, { 512: 1 }, aV), + (Fjn.e = !1); + var cBn, + aBn, + uBn, + oBn = !1, + sBn = !1, + hBn = !1, + fBn = !1, + lBn = !1; + EF(CMn, "Logger", 512), + Wfn(819, 572, { 572: 1 }, X), + EF(CMn, "SimpleConsoleLogHandler", 819), + Wfn(132, 22, { 3: 1, 35: 1, 22: 1, 132: 1 }, FT); + var bBn, + wBn = X1( + $Mn, + "Collector/Characteristics", + 132, + u_n, + function () { + return C6(), x4(Gy(wBn, 1), XEn, 132, 0, [cBn, aBn, uBn]); + }, + function (n) { + return C6(), rZ((kQ(), bBn), n); + }, + ); + Wfn(744, 1, {}, R_), + EF($Mn, "CollectorImpl", 744), + Wfn(1060, 1, {}, W), + (Fjn.Ce = function (n, t) { + return (function (n, t) { + var e; + return t.a && ((e = t.a.a.length), n.a ? yI(n.a, n.b) : (n.a = new SA(n.d)), EU(n.a, t.a, t.d.length, e)), n; + })(Yx(n, 206), Yx(t, 206)); + }), + EF($Mn, "Collectors/10methodref$merge$Type", 1060), + Wfn(1061, 1, {}, V), + (Fjn.Kb = function (n) { + return PU(Yx(n, 206)); + }), + EF($Mn, "Collectors/11methodref$toString$Type", 1061), + Wfn(1062, 1, {}, Ob), + (Fjn.Kb = function (n) { + return TA(), !!$I(n); + }), + EF($Mn, "Collectors/12methodref$test$Type", 1062), + Wfn(251, 1, {}, B), + (Fjn.Od = function (n, t) { + Yx(n, 14).Fc(t); + }), + EF($Mn, "Collectors/20methodref$add$Type", 251), + Wfn(253, 1, {}, H), + (Fjn.Ee = function () { + return new ip(); + }), + EF($Mn, "Collectors/21methodref$ctor$Type", 253), + Wfn(346, 1, {}, Q), + (Fjn.Ee = function () { + return new Qp(); + }), + EF($Mn, "Collectors/23methodref$ctor$Type", 346), + Wfn(347, 1, {}, Y), + (Fjn.Od = function (n, t) { + __(Yx(n, 53), t); + }), + EF($Mn, "Collectors/24methodref$add$Type", 347), + Wfn(1055, 1, {}, J), + (Fjn.Ce = function (n, t) { + return PE(Yx(n, 15), Yx(t, 14)); + }), + EF($Mn, "Collectors/4methodref$addAll$Type", 1055), + Wfn(1059, 1, {}, Z), + (Fjn.Od = function (n, t) { + HV(Yx(n, 206), Yx(t, 475)); + }), + EF($Mn, "Collectors/9methodref$add$Type", 1059), + Wfn(1058, 1, {}, cD), + (Fjn.Ee = function () { + return new J3(this.a, this.b, this.c); + }), + EF($Mn, "Collectors/lambda$15$Type", 1058), + Wfn(1063, 1, {}, nn), + (Fjn.Ee = function () { + var n; + return Gtn((n = new bW()), (TA(), !1), new ip()), Gtn(n, !0, new ip()), n; + }), + EF($Mn, "Collectors/lambda$22$Type", 1063), + Wfn(1064, 1, {}, Ab), + (Fjn.Ee = function () { + return x4(Gy(UKn, 1), iEn, 1, 5, [this.a]); + }), + EF($Mn, "Collectors/lambda$25$Type", 1064), + Wfn(1065, 1, {}, $b), + (Fjn.Od = function (n, t) { + !(function (n, t) { + DF(t, 0, PR(t[0], ytn(1))); + })(this.a, h1(n)); + }), + EF($Mn, "Collectors/lambda$26$Type", 1065), + Wfn(1066, 1, {}, Lb), + (Fjn.Ce = function (n, t) { + return (function (n, t, e) { + return DF(t, 0, PR(t[0], e[0])), t; + })(this.a, h1(n), h1(t)); + }), + EF($Mn, "Collectors/lambda$27$Type", 1066), + Wfn(1067, 1, {}, tn), + (Fjn.Kb = function (n) { + return h1(n)[0]; + }), + EF($Mn, "Collectors/lambda$28$Type", 1067), + Wfn(713, 1, {}, en), + (Fjn.Ce = function (n, t) { + return PR(n, t); + }), + EF($Mn, "Collectors/lambda$4$Type", 713), + Wfn(252, 1, {}, rn), + (Fjn.Ce = function (n, t) { + return (function (n, t) { + return n.Gc(t), n; + })(Yx(n, 14), Yx(t, 14)); + }), + EF($Mn, "Collectors/lambda$42$Type", 252), + Wfn(348, 1, {}, cn), + (Fjn.Ce = function (n, t) { + return (function (n, t) { + return C2(n, t), n; + })(Yx(n, 53), Yx(t, 53)); + }), + EF($Mn, "Collectors/lambda$50$Type", 348), + Wfn(349, 1, {}, an), + (Fjn.Kb = function (n) { + return Yx(n, 53); + }), + EF($Mn, "Collectors/lambda$51$Type", 349), + Wfn(1054, 1, {}, Nb), + (Fjn.Od = function (n, t) { + !(function (n, t, e) { + var i, r; + TA(), (i = !!$I(e)), (r = Yx(t.xc(i), 15)) || ((r = new ip()), t.zc(i, r)), r.Fc(e); + })(this.a, Yx(n, 83), t); + }), + EF($Mn, "Collectors/lambda$7$Type", 1054), + Wfn(1056, 1, {}, un), + (Fjn.Ce = function (n, t) { + return (function (n, t, e) { + var i, r; + for (r = t.vc().Kc(); r.Ob(); ) (i = Yx(r.Pb(), 42)), n.yc(i.cd(), i.dd(), e); + return n; + })(Yx(n, 83), Yx(t, 83), new J()); + }), + EF($Mn, "Collectors/lambda$8$Type", 1056), + Wfn(1057, 1, {}, xb), + (Fjn.Kb = function (n) { + return (function (n, t) { + var e, i, r; + for (r = new rp(), i = t.vc().Kc(); i.Ob(); ) xB(r, (e = Yx(i.Pb(), 42)).cd(), R3(n, Yx(e.dd(), 15))); + return r; + })(this.a, Yx(n, 83)); + }), + EF($Mn, "Collectors/lambda$9$Type", 1057), + Wfn(539, 1, {}), + (Fjn.He = function () { + mB(this); + }), + (Fjn.d = !1), + EF($Mn, "TerminatableStream", 539), + Wfn(812, 539, LMn, pL), + (Fjn.He = function () { + mB(this); + }), + EF($Mn, "DoubleStreamImpl", 812), + Wfn(1784, 721, SEn, uD), + (Fjn.ye = function (n) { + return (function (n, t) { + var e; + return ( + n.a || ((e = VQ(Jot, rMn, 25, 0, 15, 1)), Qk(n.b.a, new Db(e)), e.sort(f1(T.prototype.te, T, [])), (n.a = new QN(e, n.d))), + sQ(n.a, t) + ); + })(this, Yx(n, 182)); + }), + (Fjn.a = null), + EF($Mn, "DoubleStreamImpl/2", 1784), + Wfn(1785, 1, dMn, Db), + (Fjn.we = function (n) { + !(function (n, t) { + n[n.length] = t; + })(this.a, n); + }), + EF($Mn, "DoubleStreamImpl/2/lambda$0$Type", 1785), + Wfn(1782, 1, dMn, Rb), + (Fjn.we = function (n) { + !(function (n, t) { + n[n.length] = t; + })(this.a, n); + }), + EF($Mn, "DoubleStreamImpl/lambda$0$Type", 1782), + Wfn(1783, 1, dMn, Kb), + (Fjn.we = function (n) { + Mnn(this.a, n); + }), + EF($Mn, "DoubleStreamImpl/lambda$2$Type", 1783), + Wfn(1358, 720, SEn, cV), + (Fjn.ye = function (n) { + return (function (n, t) { + return n.a <= n.b && (t.ud(n.a++), !0); + })(this, Yx(n, 196)); + }), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.c = 0), + EF($Mn, "IntStream/5", 1358), + Wfn(787, 539, LMn, vL), + (Fjn.He = function () { + mB(this); + }), + (Fjn.Ie = function () { + return yB(this), this.a; + }), + EF($Mn, "IntStreamImpl", 787), + Wfn(788, 539, LMn, EE), + (Fjn.He = function () { + mB(this); + }), + (Fjn.Ie = function () { + return yB(this), GO(), UFn; + }), + EF($Mn, "IntStreamImpl/Empty", 788), + Wfn(1463, 1, CEn, _b), + (Fjn.ud = function (n) { + C3(this.a, n); + }), + EF($Mn, "IntStreamImpl/lambda$4$Type", 1463); + var dBn, + gBn = aR($Mn, "Stream"); + Wfn(30, 539, { 525: 1, 670: 1, 833: 1 }, SR), + (Fjn.He = function () { + mB(this); + }), + EF($Mn, "StreamImpl", 30), + Wfn(845, 1, {}, on), + (Fjn.ld = function (n) { + return pD(n); + }), + EF($Mn, "StreamImpl/0methodref$lambda$2$Type", 845), + Wfn(1084, 540, SEn, VN), + (Fjn.sd = function (n) { + for (; SY(this); ) { + if (this.a.sd(n)) return !0; + mB(this.b), (this.b = null), (this.a = null); + } + return !1; + }), + EF($Mn, "StreamImpl/1", 1084), + Wfn(1085, 1, PEn, Fb), + (Fjn.td = function (n) { + !(function (n, t) { + t && ((n.b = t), (n.a = (yB(t), t.a))); + })(this.a, Yx(n, 833)); + }), + EF($Mn, "StreamImpl/1/lambda$0$Type", 1085), + Wfn(1086, 1, YEn, Bb), + (Fjn.Mb = function (n) { + return __(this.a, n); + }), + EF($Mn, "StreamImpl/1methodref$add$Type", 1086), + Wfn(1087, 540, SEn, _H), + (Fjn.sd = function (n) { + var t; + return this.a || ((t = new ip()), this.b.a.Nb(new Hb(t)), XH(), JC(t, this.c), (this.a = new Nz(t, 16))), SZ(this.a, n); + }), + (Fjn.a = null), + EF($Mn, "StreamImpl/5", 1087), + Wfn(1088, 1, PEn, Hb), + (Fjn.td = function (n) { + eD(this.a, n); + }), + EF($Mn, "StreamImpl/5/2methodref$add$Type", 1088), + Wfn(722, 540, SEn, _Y), + (Fjn.sd = function (n) { + for (this.b = !1; !this.b && this.c.sd(new VT(this, n)); ); + return this.b; + }), + (Fjn.b = !1), + EF($Mn, "StreamImpl/FilterSpliterator", 722), + Wfn(1079, 1, PEn, VT), + (Fjn.td = function (n) { + !(function (n, t, e) { + n.a.Mb(e) && ((n.b = !0), t.td(e)); + })(this.a, this.b, n); + }), + EF($Mn, "StreamImpl/FilterSpliterator/lambda$0$Type", 1079), + Wfn(1075, 721, SEn, QV), + (Fjn.ye = function (n) { + return (function (n, t) { + return n.b.sd(new QT(n, t)); + })(this, Yx(n, 182)); + }), + EF($Mn, "StreamImpl/MapToDoubleSpliterator", 1075), + Wfn(1078, 1, PEn, QT), + (Fjn.td = function (n) { + !(function (n, t, e) { + t.we(n.a.Fe(e)); + })(this.a, this.b, n); + }), + EF($Mn, "StreamImpl/MapToDoubleSpliterator/lambda$0$Type", 1078), + Wfn(1074, 720, SEn, YV), + (Fjn.ye = function (n) { + return (function (n, t) { + return n.b.sd(new YT(n, t)); + })(this, Yx(n, 196)); + }), + EF($Mn, "StreamImpl/MapToIntSpliterator", 1074), + Wfn(1077, 1, PEn, YT), + (Fjn.td = function (n) { + !(function (n, t, e) { + t.ud(n.a.Ge(e)); + })(this.a, this.b, n); + }), + EF($Mn, "StreamImpl/MapToIntSpliterator/lambda$0$Type", 1077), + Wfn(719, 540, SEn, JV), + (Fjn.sd = function (n) { + return HN(this, n); + }), + EF($Mn, "StreamImpl/MapToObjSpliterator", 719), + Wfn(1076, 1, PEn, JT), + (Fjn.td = function (n) { + !(function (n, t, e) { + t.td(n.a.Kb(e)); + })(this.a, this.b, n); + }), + EF($Mn, "StreamImpl/MapToObjSpliterator/lambda$0$Type", 1076), + Wfn(618, 1, PEn, sn), + (Fjn.td = function (n) { + Pl(this, n); + }), + EF($Mn, "StreamImpl/ValueConsumer", 618), + Wfn(1080, 1, PEn, hn), + (Fjn.td = function (n) { + HE(); + }), + EF($Mn, "StreamImpl/lambda$0$Type", 1080), + Wfn(1081, 1, PEn, fn), + (Fjn.td = function (n) { + HE(); + }), + EF($Mn, "StreamImpl/lambda$1$Type", 1081), + Wfn(1082, 1, {}, qb), + (Fjn.Ce = function (n, t) { + return (function (n, t, e) { + return HE(), n.a.Od(t, e), t; + })(this.a, n, t); + }), + EF($Mn, "StreamImpl/lambda$4$Type", 1082), + Wfn(1083, 1, PEn, XT), + (Fjn.td = function (n) { + !(function (n, t, e) { + HE(), Pl(n, t.Ce(n.a, e)); + })(this.b, this.a, n); + }), + EF($Mn, "StreamImpl/lambda$5$Type", 1083), + Wfn(1089, 1, PEn, Gb), + (Fjn.td = function (n) { + !(function (n, t) { + var e; + try { + t.Vd(); + } catch (t) { + if (!CO((t = j4(t)), 78)) throw hp(t); + (e = t), (n.c[n.c.length] = e); + } + })(this.a, Yx(n, 365)); + }), + EF($Mn, "TerminatableStream/lambda$0$Type", 1089), + Wfn(2041, 1, {}), + Wfn(1914, 1, {}, ln), + EF("javaemul.internal", "ConsoleLogger", 1914), + Wfn(2038, 1, {}); + var pBn, + vBn, + mBn = 0, + yBn = 0; + Wfn(1768, 1, PEn, bn), + (Fjn.td = function (n) { + Yx(n, 308); + }), + EF(_Mn, "BowyerWatsonTriangulation/lambda$0$Type", 1768), + Wfn(1769, 1, PEn, zb), + (Fjn.td = function (n) { + C2(this.a, Yx(n, 308).e); + }), + EF(_Mn, "BowyerWatsonTriangulation/lambda$1$Type", 1769), + Wfn(1770, 1, PEn, wn), + (Fjn.td = function (n) { + Yx(n, 168); + }), + EF(_Mn, "BowyerWatsonTriangulation/lambda$2$Type", 1770), + Wfn(1765, 1, FMn, Ub), + (Fjn.ue = function (n, t) { + return (function (n, t, e) { + return WK(fL(eI(Dq(n.f, t))), fL(eI(Dq(n.f, e)))); + })(this.a, Yx(n, 168), Yx(t, 168)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(_Mn, "NaiveMinST/lambda$0$Type", 1765), + Wfn(499, 1, {}, Xb), + EF(_Mn, "NodeMicroLayout", 499), + Wfn(168, 1, { 168: 1 }, ZT), + (Fjn.Fb = function (n) { + var t; + return !!CO(n, 168) && ((t = Yx(n, 168)), (qB(this.a, t.a) && qB(this.b, t.b)) || (qB(this.a, t.b) && qB(this.b, t.a))); + }), + (Fjn.Hb = function () { + return NC(this.a) + NC(this.b); + }); + var kBn = EF(_Mn, "TEdge", 168); + Wfn(308, 1, { 308: 1 }, pvn), + (Fjn.Fb = function (n) { + var t; + return !!CO(n, 308) && TJ(this, (t = Yx(n, 308)).a) && TJ(this, t.b) && TJ(this, t.c); + }), + (Fjn.Hb = function () { + return NC(this.a) + NC(this.b) + NC(this.c); + }), + EF(_Mn, "TTriangle", 308), + Wfn(221, 1, { 221: 1 }, uO), + EF(_Mn, "Tree", 221), + Wfn(1254, 1, {}, nz), + EF(BMn, "Scanline", 1254); + var jBn = aR(BMn, HMn); + Wfn(1692, 1, {}, DZ), + EF(qMn, "CGraph", 1692), + Wfn(307, 1, { 307: 1 }, NG), + (Fjn.b = 0), + (Fjn.c = 0), + (Fjn.d = 0), + (Fjn.g = 0), + (Fjn.i = 0), + (Fjn.k = ZTn), + EF(qMn, "CGroup", 307), + Wfn(815, 1, {}, av), + EF(qMn, "CGroup/CGroupBuilder", 815), + Wfn(57, 1, { 57: 1 }, aN), + (Fjn.Ib = function () { + return this.j ? lL(this.j.Kb(this)) : (sL(PBn), PBn.o + "@" + (_A(this) >>> 0).toString(16)); + }), + (Fjn.f = 0), + (Fjn.i = ZTn); + var EBn, + TBn, + MBn, + SBn, + PBn = EF(qMn, "CNode", 57); + Wfn(814, 1, {}, uv), + EF(qMn, "CNode/CNodeBuilder", 814), + Wfn(1525, 1, {}, dn), + (Fjn.Oe = function (n, t) { + return 0; + }), + (Fjn.Pe = function (n, t) { + return 0; + }), + EF(qMn, zMn, 1525), + Wfn(1790, 1, {}, gn), + (Fjn.Le = function (n) { + var t, i, r, c, a, u, o, s, h, f, l, b, w, d, g; + for (h = JTn, r = new pb(n.a.b); r.a < r.c.c.length; ) (t = Yx(Hz(r), 57)), (h = e.Math.min(h, t.a.j.d.c + t.b.a)); + for (w = new ME(), u = new pb(n.a.a); u.a < u.c.c.length; ) ((a = Yx(Hz(u), 307)).k = h), 0 == a.g && VW(w, a, w.c.b, w.c); + for (; 0 != w.b; ) { + for (c = (a = Yx(0 == w.b ? null : (S$(0 != w.b), VZ(w, w.a.a)), 307)).j.d.c, b = a.a.a.ec().Kc(); b.Ob(); ) + (f = Yx(b.Pb(), 57)), (g = a.k + f.b.a), !p8(n, a, n.d) || f.d.c < g ? (f.i = g) : (f.i = f.d.c); + for (c -= a.j.i, a.b += c, n.d == (t9(), net) || n.d == Jtt ? (a.c += c) : (a.c -= c), l = a.a.a.ec().Kc(); l.Ob(); ) + for (s = (f = Yx(l.Pb(), 57)).c.Kc(); s.Ob(); ) + (o = Yx(s.Pb(), 57)), + (d = lC(n.d) ? n.g.Oe(f, o) : n.g.Pe(f, o)), + (o.a.k = e.Math.max(o.a.k, f.i + f.d.b + d - o.b.a)), + bq(n, o, n.d) && (o.a.k = e.Math.max(o.a.k, o.d.c - o.b.a)), + --o.a.g, + 0 == o.a.g && KD(w, o.a); + } + for (i = new pb(n.a.b); i.a < i.c.c.length; ) (t = Yx(Hz(i), 57)).d.c = t.i; + }), + EF(qMn, "LongestPathCompaction", 1790), + Wfn(1690, 1, {}, wfn), + (Fjn.e = !1); + var IBn, + CBn, + OBn = EF(qMn, QMn, 1690); + Wfn(1691, 1, PEn, Wb), + (Fjn.td = function (n) { + !(function (n, t) { + n.d == (t9(), Ztt) || n.d == eet ? Yx(t.a, 57).c.Fc(Yx(t.b, 57)) : Yx(t.b, 57).c.Fc(Yx(t.a, 57)); + })(this.a, Yx(n, 46)); + }), + EF(qMn, YMn, 1691), + Wfn(1791, 1, {}, pn), + (Fjn.Me = function (n) { + var t, e, i, r, c, a; + for (t = new pb(n.a.b); t.a < t.c.c.length; ) Yx(Hz(t), 57).c.$b(); + for (i = new pb(n.a.b); i.a < i.c.c.length; ) + for (e = Yx(Hz(i), 57), c = new pb(n.a.b); c.a < c.c.c.length; ) + e != (r = Yx(Hz(c), 57)) && + ((e.a && e.a == r.a) || + ((a = lC(n.d) ? n.g.Pe(e, r) : n.g.Oe(e, r)), + (r.d.c > e.d.c || (e.d.c == r.d.c && e.d.b < r.d.b)) && + znn(r.d.d + r.d.a + a, e.d.d) && + Unn(r.d.d, e.d.d + e.d.a + a) && + e.c.Fc(r))); + }), + EF(qMn, "QuadraticConstraintCalculation", 1791), + Wfn(522, 1, { 522: 1 }, cp), + (Fjn.a = !1), + (Fjn.b = !1), + (Fjn.c = !1), + (Fjn.d = !1), + EF(qMn, JMn, 522), + Wfn(803, 1, {}, bK), + (Fjn.Me = function (n) { + (this.c = n), Wsn(this, new yn()); + }), + EF(qMn, ZMn, 803), + Wfn(1718, 1, { 679: 1 }, mq), + (Fjn.Ke = function (n) { + Esn(this, Yx(n, 464)); + }), + EF(qMn, nSn, 1718), + Wfn(1719, 1, FMn, vn), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return $9(n.d.c + n.d.b / 2, t.d.c + t.d.b / 2); + })(Yx(n, 57), Yx(t, 57)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(qMn, tSn, 1719), + Wfn(464, 1, { 464: 1 }, WT), + (Fjn.a = !1), + EF(qMn, eSn, 464), + Wfn(1720, 1, FMn, mn), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i, r; + if (((i = n.b.d.d), n.a || (i += n.b.d.a), (r = t.b.d.d), t.a || (r += t.b.d.a), 0 == (e = $9(i, r)))) { + if (!n.a && t.a) return -1; + if (!t.a && n.a) return 1; + } + return e; + })(Yx(n, 464), Yx(t, 464)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(qMn, iSn, 1720), + Wfn(1721, 1, rSn, yn), + (Fjn.Lb = function (n) { + return Yx(n, 57), !0; + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Mb = function (n) { + return Yx(n, 57), !0; + }), + EF(qMn, "ScanlineConstraintCalculator/lambda$1$Type", 1721), + Wfn(428, 22, { 3: 1, 35: 1, 22: 1, 428: 1 }, rM); + var ABn, + $Bn, + LBn, + NBn = X1( + cSn, + "HighLevelSortingCriterion", + 428, + u_n, + function () { + return nen(), x4(Gy(NBn, 1), XEn, 428, 0, [CBn, IBn]); + }, + function (n) { + return nen(), rZ((EW(), ABn), n); + }, + ); + Wfn(427, 22, { 3: 1, 35: 1, 22: 1, 427: 1 }, cM); + var xBn, + DBn, + RBn, + KBn, + _Bn, + FBn, + BBn, + HBn, + qBn, + GBn, + zBn, + UBn, + XBn, + WBn, + VBn, + QBn, + YBn, + JBn = X1( + cSn, + "LowLevelSortingCriterion", + 427, + u_n, + function () { + return sZ(), x4(Gy(JBn, 1), XEn, 427, 0, [$Bn, LBn]); + }, + function (n) { + return sZ(), rZ((TW(), xBn), n); + }, + ), + ZBn = aR(aSn, "ILayoutMetaDataProvider"); + Wfn(853, 1, fSn, Hh), + (Fjn.Qe = function (n) { + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), uSn), lSn), "Polyomino Traversal Strategy"), + "Traversal strategy for trying different candidate positions for polyominoes.", + ), + HBn, + ), + (lsn(), O7n), + ), + tHn, + ), + J9((Qtn(), T7n)), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), oSn), lSn), "Polyomino Secondary Sorting Criterion"), + "Possible secondary sorting criteria for the processing order of polyominoes. They are used when polyominoes are equal according to the primary sorting criterion HighLevelSortingCriterion.", + ), + FBn, + ), + O7n, + ), + JBn, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), sSn), lSn), "Polyomino Primary Sorting Criterion"), + "Possible primary sorting criteria for the processing order of polyominoes.", + ), + KBn, + ), + O7n, + ), + NBn, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), hSn), lSn), "Fill Polyominoes"), + "Use the Profile Fill algorithm to fill polyominoes to prevent small polyominoes from being placed inside of big polyominoes with large holes. Might increase packing area.", + ), + (TA(), !0), + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ); + }), + EF(cSn, "PolyominoOptions", 853), + Wfn(250, 22, { 3: 1, 35: 1, 22: 1, 250: 1 }, aM); + var nHn, + tHn = X1( + cSn, + "TraversalStrategy", + 250, + u_n, + function () { + return $dn(), x4(Gy(tHn, 1), XEn, 250, 0, [YBn, UBn, XBn, zBn, VBn, QBn, WBn, GBn, qBn]); + }, + function (n) { + return $dn(), rZ((t4(), nHn), n); + }, + ); + Wfn(213, 1, { 213: 1 }, kn), + (Fjn.Ib = function () { + return "NEdge[id=" + this.b + " w=" + this.g + " d=" + this.a + "]"; + }), + (Fjn.a = 1), + (Fjn.b = 0), + (Fjn.c = 0), + (Fjn.f = !1), + (Fjn.g = 0); + var eHn = EF(bSn, "NEdge", 213); + Wfn(176, 1, {}, tv), + EF(bSn, "NEdge/NEdgeBuilder", 176), + Wfn(653, 1, {}, Zp), + EF(bSn, "NGraph", 653), + Wfn(121, 1, { 121: 1 }, WV), + (Fjn.c = -1), + (Fjn.d = 0), + (Fjn.e = 0), + (Fjn.i = -1), + (Fjn.j = !1); + var iHn = EF(bSn, "NNode", 121); + Wfn(795, 1, bMn, nv), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Lc = function () { + return new SR(null, new Nz(this, 16)); + }), + (Fjn.ad = function (n) { + I2(this, n); + }), + (Fjn.Nc = function () { + return new Nz(this, 16); + }), + (Fjn.Oc = function () { + return new SR(null, new Nz(this, 16)); + }), + (Fjn.Vc = function (n, t) { + ++this.b, ZR(this.a, n, t); + }), + (Fjn.Fc = function (n) { + return WA(this, n); + }), + (Fjn.Wc = function (n, t) { + return ++this.b, H6(this.a, n, t); + }), + (Fjn.Gc = function (n) { + return ++this.b, S4(this.a, n); + }), + (Fjn.$b = function () { + ++this.b, (this.a.c = VQ(UKn, iEn, 1, 0, 5, 1)); + }), + (Fjn.Hc = function (n) { + return -1 != hJ(this.a, n, 0); + }), + (Fjn.Ic = function (n) { + return m4(this.a, n); + }), + (Fjn.Xb = function (n) { + return TR(this.a, n); + }), + (Fjn.Xc = function (n) { + return hJ(this.a, n, 0); + }), + (Fjn.dc = function () { + return 0 == this.a.c.length; + }), + (Fjn.Kc = function () { + return PY(new pb(this.a)); + }), + (Fjn.Yc = function () { + throw hp(new xp()); + }), + (Fjn.Zc = function (n) { + throw hp(new xp()); + }), + (Fjn.$c = function (n) { + return ++this.b, KV(this.a, n); + }), + (Fjn.Mc = function (n) { + return VA(this, n); + }), + (Fjn._c = function (n, t) { + return ++this.b, QW(this.a, n, t); + }), + (Fjn.gc = function () { + return this.a.c.length; + }), + (Fjn.bd = function (n, t) { + return new Oz(this.a, n, t); + }), + (Fjn.Pc = function () { + return w$(this.a); + }), + (Fjn.Qc = function (n) { + return Htn(this.a, n); + }), + (Fjn.b = 0), + EF(bSn, "NNode/ChangeAwareArrayList", 795), + Wfn(269, 1, {}, ev), + EF(bSn, "NNode/NNodeBuilder", 269), + Wfn(1630, 1, {}, jn), + (Fjn.a = !1), + (Fjn.f = Yjn), + (Fjn.j = 0), + EF(bSn, "NetworkSimplex", 1630), + Wfn(1294, 1, PEn, Vb), + (Fjn.td = function (n) { + hkn(this.a, Yx(n, 680), !0, !1); + }), + EF(dSn, "NodeLabelAndSizeCalculator/lambda$0$Type", 1294), + Wfn(558, 1, {}, Qb), + (Fjn.b = !0), + (Fjn.c = !0), + (Fjn.d = !0), + (Fjn.e = !0), + EF(dSn, "NodeMarginCalculator", 558), + Wfn(212, 1, { 212: 1 }), + (Fjn.j = !1), + (Fjn.k = !1); + var rHn, + cHn, + aHn, + uHn = EF(gSn, "Cell", 212); + Wfn(124, 212, { 124: 1, 212: 1 }, dN), + (Fjn.Re = function () { + return UD(this); + }), + (Fjn.Se = function () { + var n; + return (n = this.n), this.a.a + n.b + n.c; + }), + EF(gSn, "AtomicCell", 124), + Wfn(232, 22, { 3: 1, 35: 1, 22: 1, 232: 1 }, uM); + var oHn, + sHn = X1( + gSn, + "ContainerArea", + 232, + u_n, + function () { + return JZ(), x4(Gy(sHn, 1), XEn, 232, 0, [rHn, cHn, aHn]); + }, + function (n) { + return JZ(), rZ((vQ(), oHn), n); + }, + ); + Wfn(326, 212, vSn), + EF(gSn, "ContainerCell", 326), + Wfn(1473, 326, vSn, snn), + (Fjn.Re = function () { + var n; + return ( + (n = 0), + this.e ? (this.b ? (n = this.b.b) : this.a[1][1] && (n = this.a[1][1].Re())) : (n = x7(this, irn(this, !0))), + n > 0 ? n + this.n.d + this.n.a : 0 + ); + }), + (Fjn.Se = function () { + var n, t, i, r, c; + if (((c = 0), this.e)) this.b ? (c = this.b.a) : this.a[1][1] && (c = this.a[1][1].Se()); + else if (this.g) c = x7(this, lcn(this, null, !0)); + else + for (JZ(), i = 0, r = (t = x4(Gy(sHn, 1), XEn, 232, 0, [rHn, cHn, aHn])).length; i < r; ++i) + (n = t[i]), (c = e.Math.max(c, x7(this, lcn(this, n, !0)))); + return c > 0 ? c + this.n.b + this.n.c : 0; + }), + (Fjn.Te = function () { + var n, t, e, i, r; + if (this.g) + for (n = lcn(this, null, !1), JZ(), i = 0, r = (e = x4(Gy(sHn, 1), XEn, 232, 0, [rHn, cHn, aHn])).length; i < r; ++i) + qwn(this, (t = e[i]), n); + else + for (JZ(), i = 0, r = (e = x4(Gy(sHn, 1), XEn, 232, 0, [rHn, cHn, aHn])).length; i < r; ++i) + qwn(this, (t = e[i]), (n = lcn(this, t, !1))); + }), + (Fjn.Ue = function () { + var n, t, i, r; + (t = this.i), + (n = this.n), + (r = irn(this, !1)), + MV(this, (JZ(), rHn), t.d + n.d, r), + MV(this, aHn, t.d + t.a - n.a - r[2], r), + (i = t.a - n.d - n.a), + r[0] > 0 && ((r[0] += this.d), (i -= r[0])), + r[2] > 0 && ((r[2] += this.d), (i -= r[2])), + (this.c.a = e.Math.max(0, i)), + (this.c.d = t.d + n.d + (this.c.a - i) / 2), + (r[1] = e.Math.max(r[1], i)), + MV(this, cHn, t.d + n.d + r[0] - (r[1] - i) / 2, r); + }), + (Fjn.b = null), + (Fjn.d = 0), + (Fjn.e = !1), + (Fjn.f = !1), + (Fjn.g = !1); + var hHn, + fHn, + lHn, + bHn = 0, + wHn = 0; + EF(gSn, "GridContainerCell", 1473), Wfn(461, 22, { 3: 1, 35: 1, 22: 1, 461: 1 }, oM); + var dHn, + gHn = X1( + gSn, + "HorizontalLabelAlignment", + 461, + u_n, + function () { + return BY(), x4(Gy(gHn, 1), XEn, 461, 0, [fHn, hHn, lHn]); + }, + function (n) { + return BY(), rZ((mQ(), dHn), n); + }, + ); + Wfn(306, 212, { 212: 1, 306: 1 }, eG, KZ, qq), + (Fjn.Re = function () { + return XD(this); + }), + (Fjn.Se = function () { + return WD(this); + }), + (Fjn.a = 0), + (Fjn.c = !1); + var pHn, + vHn, + mHn, + yHn = EF(gSn, "LabelCell", 306); + Wfn(244, 326, { 212: 1, 326: 1, 244: 1 }, Stn), + (Fjn.Re = function () { + return Dhn(this); + }), + (Fjn.Se = function () { + return Rhn(this); + }), + (Fjn.Te = function () { + cvn(this); + }), + (Fjn.Ue = function () { + hvn(this); + }), + (Fjn.b = 0), + (Fjn.c = 0), + (Fjn.d = !1), + EF(gSn, "StripContainerCell", 244), + Wfn(1626, 1, YEn, En), + (Fjn.Mb = function (n) { + return (function (n) { + return !!n && n.k; + })(Yx(n, 212)); + }), + EF(gSn, "StripContainerCell/lambda$0$Type", 1626), + Wfn(1627, 1, {}, Tn), + (Fjn.Fe = function (n) { + return Yx(n, 212).Se(); + }), + EF(gSn, "StripContainerCell/lambda$1$Type", 1627), + Wfn(1628, 1, YEn, Mn), + (Fjn.Mb = function (n) { + return (function (n) { + return !!n && n.j; + })(Yx(n, 212)); + }), + EF(gSn, "StripContainerCell/lambda$2$Type", 1628), + Wfn(1629, 1, {}, Sn), + (Fjn.Fe = function (n) { + return Yx(n, 212).Re(); + }), + EF(gSn, "StripContainerCell/lambda$3$Type", 1629), + Wfn(462, 22, { 3: 1, 35: 1, 22: 1, 462: 1 }, sM); + var kHn, + jHn, + EHn, + THn, + MHn, + SHn, + PHn, + IHn, + CHn, + OHn, + AHn, + $Hn, + LHn, + NHn, + xHn, + DHn, + RHn, + KHn, + _Hn, + FHn, + BHn, + HHn, + qHn, + GHn = X1( + gSn, + "VerticalLabelAlignment", + 462, + u_n, + function () { + return OJ(), x4(Gy(GHn, 1), XEn, 462, 0, [mHn, vHn, pHn]); + }, + function (n) { + return OJ(), rZ((yQ(), kHn), n); + }, + ); + Wfn(789, 1, {}, vkn), + (Fjn.c = 0), + (Fjn.d = 0), + (Fjn.k = 0), + (Fjn.s = 0), + (Fjn.t = 0), + (Fjn.v = !1), + (Fjn.w = 0), + (Fjn.D = !1), + EF(TSn, "NodeContext", 789), + Wfn(1471, 1, FMn, Pn), + (Fjn.ue = function (n, t) { + return nC(Yx(n, 61), Yx(t, 61)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(TSn, "NodeContext/0methodref$comparePortSides$Type", 1471), + Wfn(1472, 1, FMn, In), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e; + if (0 != (e = nC(n.b.Hf(), t.b.Hf()))) return e; + switch (n.b.Hf().g) { + case 1: + case 2: + return eO(n.b.sf(), t.b.sf()); + case 3: + case 4: + return eO(t.b.sf(), n.b.sf()); + } + return 0; + })(Yx(n, 111), Yx(t, 111)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(TSn, "NodeContext/1methodref$comparePortContexts$Type", 1472), + Wfn(159, 22, { 3: 1, 35: 1, 22: 1, 159: 1 }, U2); + var zHn, + UHn, + XHn, + WHn, + VHn, + QHn, + YHn, + JHn = X1(TSn, "NodeLabelLocation", 159, u_n, Xtn, function (n) { + return Njn(), rZ((LI(), zHn), n); + }); + Wfn(111, 1, { 111: 1 }, gfn), + (Fjn.a = !1), + EF(TSn, "PortContext", 111), + Wfn(1476, 1, PEn, Cn), + (Fjn.td = function (n) { + oj(Yx(n, 306)); + }), + EF(PSn, ISn, 1476), + Wfn(1477, 1, YEn, On), + (Fjn.Mb = function (n) { + return !!Yx(n, 111).c; + }), + EF(PSn, CSn, 1477), + Wfn(1478, 1, PEn, An), + (Fjn.td = function (n) { + oj(Yx(n, 111).c); + }), + EF(PSn, "LabelPlacer/lambda$2$Type", 1478), + Wfn(1475, 1, PEn, Ln), + (Fjn.td = function (n) { + PL(), + (function (n) { + n.b.tf(n.e); + })(Yx(n, 111)); + }), + EF(PSn, "NodeLabelAndSizeUtilities/lambda$0$Type", 1475), + Wfn(790, 1, PEn, kx), + (Fjn.td = function (n) { + hT(this.b, this.c, this.a, Yx(n, 181)); + }), + (Fjn.a = !1), + (Fjn.c = !1), + EF(PSn, "NodeLabelCellCreator/lambda$0$Type", 790), + Wfn(1474, 1, PEn, Yb), + (Fjn.td = function (n) { + !(function (n, t) { + Fon(n.c, t); + })(this.a, Yx(n, 181)); + }), + EF(PSn, "PortContextCreator/lambda$0$Type", 1474), + Wfn(1829, 1, {}, Nn), + EF(ASn, "GreedyRectangleStripOverlapRemover", 1829), + Wfn(1830, 1, FMn, $n), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return $9(n.c.d, t.c.d); + })(Yx(n, 222), Yx(t, 222)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(ASn, "GreedyRectangleStripOverlapRemover/0methodref$compareByYCoordinate$Type", 1830), + Wfn(1786, 1, {}, lv), + (Fjn.a = 5), + (Fjn.e = 0), + EF(ASn, "RectangleStripOverlapRemover", 1786), + Wfn(1787, 1, FMn, Dn), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return $9(n.c.c, t.c.c); + })(Yx(n, 222), Yx(t, 222)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(ASn, "RectangleStripOverlapRemover/0methodref$compareLeftRectangleBorders$Type", 1787), + Wfn(1789, 1, FMn, Rn), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return $9(n.c.c + n.c.b, t.c.c + t.c.b); + })(Yx(n, 222), Yx(t, 222)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(ASn, "RectangleStripOverlapRemover/1methodref$compareRightRectangleBorders$Type", 1789), + Wfn(406, 22, { 3: 1, 35: 1, 22: 1, 406: 1 }, hM); + var ZHn, + nqn, + tqn, + eqn, + iqn, + rqn = X1( + ASn, + "RectangleStripOverlapRemover/OverlapRemovalDirection", + 406, + u_n, + function () { + return e4(), x4(Gy(rqn, 1), XEn, 406, 0, [YHn, WHn, VHn, QHn]); + }, + function (n) { + return e4(), rZ((zY(), ZHn), n); + }, + ); + Wfn(222, 1, { 222: 1 }, fK), + EF(ASn, "RectangleStripOverlapRemover/RectangleNode", 222), + Wfn(1788, 1, PEn, Jb), + (Fjn.td = function (n) { + !(function (n, t) { + var e, i; + switch (((i = t.c), (e = t.a), n.b.g)) { + case 0: + e.d = n.e - i.a - i.d; + break; + case 1: + e.d += n.e; + break; + case 2: + e.c = n.e - i.a - i.d; + break; + case 3: + e.c = n.e + i.d; + } + })(this.a, Yx(n, 222)); + }), + EF(ASn, "RectangleStripOverlapRemover/lambda$1$Type", 1788), + Wfn(1304, 1, FMn, Kn), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i, r, c; + return ( + (e = new _n()), + 1 == + (r = + 2 == + (r = (i = Yx( + kW( + fH(new SR(null, new Nz(n.f, 16)), e), + kJ(new Q(), new Y(), new cn(), new an(), x4(Gy(wBn, 1), XEn, 132, 0, [(C6(), uBn), aBn])), + ), + 21, + )).gc()) + ? 1 + : 0) && + sI(Snn(Yx(kW(hH(i.Lc(), new Fn()), k3(ytn(0), new en())), 162).a, 2), 0) && + (r = 0), + 1 == + (c = + 2 == + (c = (i = Yx( + kW( + fH(new SR(null, new Nz(t.f, 16)), e), + kJ(new Q(), new Y(), new cn(), new an(), x4(Gy(wBn, 1), XEn, 132, 0, [uBn, aBn])), + ), + 21, + )).gc()) + ? 1 + : 0) && + sI(Snn(Yx(kW(hH(i.Lc(), new Bn()), k3(ytn(0), new en())), 162).a, 2), 0) && + (c = 0), + r < c ? -1 : r == c ? 0 : 1 + ); + })(Yx(n, 167), Yx(t, 167)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(LSn, "PolyominoCompactor/CornerCasesGreaterThanRestComparator", 1304), + Wfn(1307, 1, {}, _n), + (Fjn.Kb = function (n) { + return Yx(n, 324).a; + }), + EF(LSn, "PolyominoCompactor/CornerCasesGreaterThanRestComparator/lambda$0$Type", 1307), + Wfn(1308, 1, YEn, Fn), + (Fjn.Mb = function (n) { + return Yx(n, 323).a; + }), + EF(LSn, "PolyominoCompactor/CornerCasesGreaterThanRestComparator/lambda$1$Type", 1308), + Wfn(1309, 1, YEn, Bn), + (Fjn.Mb = function (n) { + return Yx(n, 323).a; + }), + EF(LSn, "PolyominoCompactor/CornerCasesGreaterThanRestComparator/lambda$2$Type", 1309), + Wfn(1302, 1, FMn, Hn), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i, r; + return ( + (e = new xn()), + (i = Yx( + kW( + fH(new SR(null, new Nz(n.f, 16)), e), + kJ(new Q(), new Y(), new cn(), new an(), x4(Gy(wBn, 1), XEn, 132, 0, [(C6(), uBn), aBn])), + ), + 21, + ).gc()) < + (r = Yx( + kW( + fH(new SR(null, new Nz(t.f, 16)), e), + kJ(new Q(), new Y(), new cn(), new an(), x4(Gy(wBn, 1), XEn, 132, 0, [uBn, aBn])), + ), + 21, + ).gc()) + ? -1 + : i == r + ? 0 + : 1 + ); + })(Yx(n, 167), Yx(t, 167)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(LSn, "PolyominoCompactor/MinNumOfExtensionDirectionsComparator", 1302), + Wfn(1305, 1, {}, xn), + (Fjn.Kb = function (n) { + return Yx(n, 324).a; + }), + EF(LSn, "PolyominoCompactor/MinNumOfExtensionDirectionsComparator/lambda$0$Type", 1305), + Wfn(767, 1, FMn, qn), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i; + return (e = n.f.c.length) < (i = t.f.c.length) ? -1 : e == i ? 0 : 1; + })(Yx(n, 167), Yx(t, 167)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(LSn, "PolyominoCompactor/MinNumOfExtensionsComparator", 767), + Wfn(1300, 1, FMn, Gn), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i; + return (e = n.o + n.p) < (i = t.o + t.p) ? -1 : e == i ? 0 : 1; + })(Yx(n, 321), Yx(t, 321)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(LSn, "PolyominoCompactor/MinPerimeterComparator", 1300), + Wfn(1301, 1, FMn, zn), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i, r, c; + return ( + (c = n.o) < (e = n.p) ? (c *= c) : (e *= e), + (i = c + e), + (c = t.o) < (e = t.p) ? (c *= c) : (e *= e), + i < (r = c + e) ? -1 : i == r ? 0 : 1 + ); + })(Yx(n, 321), Yx(t, 321)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(LSn, "PolyominoCompactor/MinPerimeterComparatorWithShape", 1301), + Wfn(1303, 1, FMn, Un), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i, r; + return ( + (e = new Xn()), + (i = + 1 == + (i = Yx( + kW( + fH(new SR(null, new Nz(n.f, 16)), e), + kJ(new Q(), new Y(), new cn(), new an(), x4(Gy(wBn, 1), XEn, 132, 0, [(C6(), uBn), aBn])), + ), + 21, + ).gc()) + ? 1 + : 0) < + (r = + 1 == + (r = Yx( + kW( + fH(new SR(null, new Nz(t.f, 16)), e), + kJ(new Q(), new Y(), new cn(), new an(), x4(Gy(wBn, 1), XEn, 132, 0, [uBn, aBn])), + ), + 21, + ).gc()) + ? 1 + : 0) + ? -1 + : i == r + ? 0 + : 1 + ); + })(Yx(n, 167), Yx(t, 167)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(LSn, "PolyominoCompactor/SingleExtensionSideGreaterThanRestComparator", 1303), + Wfn(1306, 1, {}, Xn), + (Fjn.Kb = function (n) { + return Yx(n, 324).a; + }), + EF(LSn, "PolyominoCompactor/SingleExtensionSideGreaterThanRestComparator/lambda$0$Type", 1306), + Wfn(777, 1, {}, nM), + (Fjn.Ce = function (n, t) { + return (function (n, t, e) { + return e.f.c.length > 0 ? Y_(n.a, t, e) : Y_(n.b, t, e); + })(this, Yx(n, 46), Yx(t, 167)); + }), + EF(LSn, "SuccessorCombination", 777), + Wfn(644, 1, {}, Wn), + (Fjn.Ce = function (n, t) { + var i; + return (function (n) { + var t, i, r, c, a; + return ( + (i = c = Yx(n.a, 19).a), + (r = a = Yx(n.b, 19).a), + (t = e.Math.max(e.Math.abs(c), e.Math.abs(a))), + c <= 0 && c == a ? ((i = 0), (r = a - 1)) : c == -t && a != t ? ((i = a), (r = c), a >= 0 && ++i) : ((i = -a), (r = c)), + new mP(d9(i), d9(r)) + ); + })(((i = Yx(n, 46)), Yx(t, 167), i)); + }), + EF(LSn, "SuccessorJitter", 644), + Wfn(643, 1, {}, Vn), + (Fjn.Ce = function (n, t) { + var i; + return (function (n) { + var t, i; + if (((t = Yx(n.a, 19).a), (i = Yx(n.b, 19).a), t >= 0)) { + if (t == i) return new mP(d9(-t - 1), d9(-t - 1)); + if (t == -i) return new mP(d9(-t), d9(i + 1)); + } + return e.Math.abs(t) > e.Math.abs(i) ? new mP(d9(-t), d9(t < 0 ? i : i + 1)) : new mP(d9(t + 1), d9(i)); + })(((i = Yx(n, 46)), Yx(t, 167), i)); + }), + EF(LSn, "SuccessorLineByLine", 643), + Wfn(568, 1, {}, Qn), + (Fjn.Ce = function (n, t) { + var e; + return (function (n) { + var t, e, i, r; + return ( + (t = i = Yx(n.a, 19).a), + (e = r = Yx(n.b, 19).a), + 0 == i && 0 == r + ? (e -= 1) + : -1 == i && r <= 0 + ? ((t = 0), (e -= 2)) + : i <= 0 && r > 0 + ? ((t -= 1), (e -= 1)) + : i >= 0 && r < 0 + ? ((t += 1), (e += 1)) + : i > 0 && r >= 0 + ? ((t -= 1), (e += 1)) + : ((t += 1), (e -= 1)), + new mP(d9(t), d9(e)) + ); + })(((e = Yx(n, 46)), Yx(t, 167), e)); + }), + EF(LSn, "SuccessorManhattan", 568), + Wfn(1356, 1, {}, Yn), + (Fjn.Ce = function (n, t) { + var i; + return (function (n) { + var t, i, r; + return ( + (i = Yx(n.a, 19).a), + (r = Yx(n.b, 19).a), + i < (t = e.Math.max(e.Math.abs(i), e.Math.abs(r))) && r == -t + ? new mP(d9(i + 1), d9(r)) + : i == t && r < t + ? new mP(d9(i), d9(r + 1)) + : i >= -t && r == t + ? new mP(d9(i - 1), d9(r)) + : new mP(d9(i), d9(r - 1)) + ); + })(((i = Yx(n, 46)), Yx(t, 167), i)); + }), + EF(LSn, "SuccessorMaxNormWindingInMathPosSense", 1356), + Wfn(400, 1, {}, Zb), + (Fjn.Ce = function (n, t) { + return Y_(this, n, t); + }), + (Fjn.c = !1), + (Fjn.d = !1), + (Fjn.e = !1), + (Fjn.f = !1), + EF(LSn, "SuccessorQuadrantsGeneric", 400), + Wfn(1357, 1, {}, Jn), + (Fjn.Kb = function (n) { + return Yx(n, 324).a; + }), + EF(LSn, "SuccessorQuadrantsGeneric/lambda$0$Type", 1357), + Wfn(323, 22, { 3: 1, 35: 1, 22: 1, 323: 1 }, iM), + (Fjn.a = !1); + var cqn, + aqn = X1( + KSn, + _Sn, + 323, + u_n, + function () { + return Sen(), x4(Gy(aqn, 1), XEn, 323, 0, [tqn, nqn, eqn, iqn]); + }, + function (n) { + return Sen(), rZ((UY(), cqn), n); + }, + ); + Wfn(1298, 1, {}), + (Fjn.Ib = function () { + var n, t, e, i, r, c; + for (e = " ", n = d9(0), r = 0; r < this.o; r++) (e += "" + n.a), (n = d9(WL(n.a))); + for (e += "\n", n = d9(0), c = 0; c < this.p; c++) { + for (e += "" + n.a, n = d9(WL(n.a)), i = 0; i < this.o; i++) + 0 == k8((t = V0(this, i, c)), 0) ? (e += "_") : 0 == k8(t, 1) ? (e += "X") : (e += "0"); + e += "\n"; + } + return l$(e, 0, e.length - 1); + }), + (Fjn.o = 0), + (Fjn.p = 0), + EF(KSn, "TwoBitGrid", 1298), + Wfn(321, 1298, { 321: 1 }, hnn), + (Fjn.j = 0), + (Fjn.k = 0), + EF(KSn, "PlanarGrid", 321), + Wfn(167, 321, { 321: 1, 167: 1 }), + (Fjn.g = 0), + (Fjn.i = 0), + EF(KSn, "Polyomino", 167); + var uqn = aR(GSn, zSn); + Wfn(134, 1, USn, Zn), + (Fjn.Ye = function (n, t) { + return l5(this, n, t); + }), + (Fjn.Ve = function () { + return CR(this); + }), + (Fjn.We = function (n) { + return Aun(this, n); + }), + (Fjn.Xe = function (n) { + return O$(this, n); + }), + EF(GSn, "MapPropertyHolder", 134), + Wfn(1299, 134, USn, Twn), + EF(KSn, "Polyominoes", 1299); + var oqn, + sqn, + hqn, + fqn, + lqn, + bqn, + wqn, + dqn, + gqn = !1; + Wfn(1766, 1, PEn, nt), + (Fjn.td = function (n) { + Bmn(Yx(n, 221)); + }), + EF(XSn, "DepthFirstCompaction/0methodref$compactTree$Type", 1766), + Wfn(810, 1, PEn, nw), + (Fjn.td = function (n) { + !(function (n, t) { + sK(Yx(t.b, 65), n), WZ(t.a, new nw(n)); + })(this.a, Yx(n, 221)); + }), + EF(XSn, "DepthFirstCompaction/lambda$1$Type", 810), + Wfn(1767, 1, PEn, Ex), + (Fjn.td = function (n) { + !(function (n, t, e, i) { + Yx(e.b, 65), Yx(e.b, 65), Yx(i.b, 65), Yx(i.b, 65).c.b, QQ(i, t, n); + })(this.a, this.b, this.c, Yx(n, 221)); + }), + EF(XSn, "DepthFirstCompaction/lambda$2$Type", 1767), + Wfn(65, 1, { 65: 1 }, ez), + EF(XSn, "Node", 65), + Wfn(1250, 1, {}, oO), + EF(XSn, "ScanlineOverlapCheck", 1250), + Wfn(1251, 1, { 679: 1 }, vq), + (Fjn.Ke = function (n) { + IL(this, Yx(n, 440)); + }), + EF(XSn, "ScanlineOverlapCheck/OverlapsScanlineHandler", 1251), + Wfn(1252, 1, FMn, tt), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e; + return 0 != (e = $9(n.b.c, t.b.c)) || 0 != (e = $9(n.a.a, t.a.a)) ? e : $9(n.a.b, t.a.b); + })(Yx(n, 65), Yx(t, 65)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(XSn, "ScanlineOverlapCheck/OverlapsScanlineHandler/lambda$0$Type", 1252), + Wfn(440, 1, { 440: 1 }, tM), + (Fjn.a = !1), + EF(XSn, "ScanlineOverlapCheck/Timestamp", 440), + Wfn(1253, 1, FMn, et), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i, r; + if (((i = n.b.b.d), n.a || (i += n.b.b.a), (r = t.b.b.d), t.a || (r += t.b.b.a), 0 == (e = $9(i, r)))) { + if (!n.a && t.a) return -1; + if (!t.a && n.a) return 1; + } + return e; + })(Yx(n, 440), Yx(t, 440)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(XSn, "ScanlineOverlapCheck/lambda$0$Type", 1253), + Wfn(550, 1, {}, it), + EF(WSn, "SVGImage", 550), + Wfn(324, 1, { 324: 1 }, Tx), + (Fjn.Ib = function () { + return "(" + this.a + tEn + this.b + tEn + this.c + ")"; + }), + EF(WSn, "UniqueTriple", 324), + Wfn(209, 1, VSn), + EF(QSn, "AbstractLayoutProvider", 209), + Wfn(1132, 209, VSn, rt), + (Fjn.Ze = function (n, t) { + var e, i, r; + run(t, YSn, 1), + (this.a = ty(fL(jln(n, (len(), Rqn))))), + zQ(n, Pqn) && ((i = lL(jln(n, Pqn))), (e = sgn(s0(), i)) && Yx(Xq(e.f), 209).Ze(n, J2(t, 1))), + (r = new rW(this.a)), + (this.b = (function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y; + for (n.e = t, u = Jhn(t), m = new ip(), i = new pb(u); i.a < i.c.c.length; ) { + for (e = Yx(Hz(i), 15), y = new ip(), m.c[m.c.length] = y, o = new Qp(), l = e.Kc(); l.Ob(); ) { + for ( + c = lgn(n, (f = Yx(l.Pb(), 33)), !0, 0, 0), + y.c[y.c.length] = c, + new QS((b = f.i), (w = f.j)), + !f.n && (f.n = new m_(act, f, 1, 7)), + h = new UO(f.n); + h.e != h.i.gc(); + + ) + (r = lgn(n, Yx(hen(h), 137), !1, b, w)), (y.c[y.c.length] = r); + for (!f.c && (f.c = new m_(oct, f, 9, 9)), g = new UO(f.c); g.e != g.i.gc(); ) + for ( + a = lgn(n, (d = Yx(hen(g), 118)), !1, b, w), + y.c[y.c.length] = a, + p = d.i + b, + v = d.j + w, + !d.n && (d.n = new m_(act, d, 1, 7)), + s = new UO(d.n); + s.e != s.i.gc(); + + ) + (r = lgn(n, Yx(hen(s), 137), !1, p, v)), (y.c[y.c.length] = r); + C2(o, oq(n0(x4(Gy(QKn, 1), iEn, 20, 0, [lbn(f), fbn(f)])))); + } + Obn(n, o, y); + } + return (n.f = new jk(m)), o4(n.f, t), n.f; + })(r, n)), + 0 === Yx(jln(n, (O6(), jqn)), 481).g ? (Cfn(new ct(), this.b), Aen(n, Oqn, Aun(this.b, Oqn))) : oE(), + (function (n) { + var t, e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E; + for ( + l = (c = n.f.b).a, h = c.b, w = n.e.g, b = n.e.f, kC(n.e, c.a, c.b), j = l / w, E = h / b, s = new UO(JB(n.e)); + s.e != s.i.gc(); + + ) + L1((o = Yx(hen(s), 137)), o.i * j), N1(o, o.j * E); + for (v = new UO(ZB(n.e)); v.e != v.i.gc(); ) + (y = (p = Yx(hen(v), 118)).i), (k = p.j), y > 0 && L1(p, y * j), k > 0 && N1(p, k * E); + for (S3(n.b, new lt()), t = new ip(), u = new t6(new Ql(n.c).a); u.b; ) + (i = Yx((a = s1(u)).cd(), 79)), + (e = Yx(a.dd(), 395).a), + (r = Ywn(i, !1, !1)), + wvn((f = Xan(Kun(i), Kon(r), e)), r), + (m = _un(i)) && -1 == hJ(t, m, 0) && ((t.c[t.c.length] = m), OH(m, (S$(0 != f.b), Yx(f.a.a.c, 8)), e)); + for (g = new t6(new Ql(n.d).a); g.b; ) + (i = Yx((d = s1(g)).cd(), 79)), + (e = Yx(d.dd(), 395).a), + (r = Ywn(i, !1, !1)), + (f = Xan(Bun(i), U5(Kon(r)), e)), + wvn((f = U5(f)), r), + (m = Fun(i)) && -1 == hJ(t, m, 0) && ((t.c[t.c.length] = m), OH(m, (S$(0 != f.b), Yx(f.c.b.c, 8)), e)); + })(r), + Aen(n, Cqn, this.b), + Ron(t); + }), + (Fjn.a = 0), + EF(JSn, "DisCoLayoutProvider", 1132), + Wfn(1244, 1, {}, ct), + (Fjn.c = !1), + (Fjn.e = 0), + (Fjn.f = 0), + EF(JSn, "DisCoPolyominoCompactor", 1244), + Wfn(561, 1, { 561: 1 }, qR), + (Fjn.b = !0), + EF(ZSn, "DCComponent", 561), + Wfn(394, 22, { 3: 1, 35: 1, 22: 1, 394: 1 }, eM), + (Fjn.a = !1); + var pqn, + vqn, + mqn = X1( + ZSn, + "DCDirection", + 394, + u_n, + function () { + return Pen(), x4(Gy(mqn, 1), XEn, 394, 0, [bqn, lqn, wqn, dqn]); + }, + function (n) { + return Pen(), rZ((XY(), pqn), n); + }, + ); + Wfn(266, 134, { 3: 1, 266: 1, 94: 1, 134: 1 }, eln), + EF(ZSn, "DCElement", 266), + Wfn(395, 1, { 395: 1 }, Bin), + (Fjn.c = 0), + EF(ZSn, "DCExtension", 395), + Wfn(755, 134, USn, jk), + EF(ZSn, "DCGraph", 755), + Wfn(481, 22, { 3: 1, 35: 1, 22: 1, 481: 1 }, I$); + var yqn, + kqn, + jqn, + Eqn, + Tqn, + Mqn, + Sqn, + Pqn, + Iqn, + Cqn, + Oqn, + Aqn, + $qn, + Lqn, + Nqn, + xqn, + Dqn, + Rqn, + Kqn, + _qn, + Fqn, + Bqn = X1( + nPn, + tPn, + 481, + u_n, + function () { + return BE(), x4(Gy(Bqn, 1), XEn, 481, 0, [vqn]); + }, + function (n) { + return BE(), rZ((yX(), yqn), n); + }, + ); + Wfn(854, 1, fSn, Fh), + (Fjn.Qe = function (n) { + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), ePn), aPn), "Connected Components Compaction Strategy"), + "Strategy for packing different connected components in order to save space and enhance readability of a graph.", + ), + Eqn, + ), + (lsn(), O7n), + ), + Bqn, + ), + J9((Qtn(), T7n)), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), iPn), aPn), "Connected Components Layout Algorithm"), + "A layout algorithm that is to be applied to each connected component before the components themselves are compacted. If unspecified, the positions of the components' nodes are not altered.", + ), + N7n, + ), + fFn, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk(sk(bk(fk(lk(new Fu(), rPn), "debug"), "DCGraph"), "Access to the DCGraph is intended for the debug view,"), L7n), + UKn, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), cPn), "debug"), "List of Polyominoes"), + "Access to the polyominoes is intended for the debug view,", + ), + L7n, + ), + UKn, + ), + J9(T7n), + ), + ), + ), + Qvn((new Bh(), n)); + }), + EF(nPn, "DisCoMetaDataProvider", 854), + Wfn(998, 1, fSn, Bh), + (Fjn.Qe = function (n) { + Qvn(n); + }), + EF(nPn, "DisCoOptions", 998), + Wfn(999, 1, {}, at), + (Fjn.$e = function () { + return new rt(); + }), + (Fjn._e = function (n) {}), + EF(nPn, "DisCoOptions/DiscoFactory", 999), + Wfn(562, 167, { 321: 1, 167: 1, 562: 1 }, nbn), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.c = 0), + (Fjn.d = 0), + EF("org.eclipse.elk.alg.disco.structures", "DCPolyomino", 562), + Wfn(1268, 1, YEn, ut), + (Fjn.Mb = function (n) { + return $I(n); + }), + EF(lPn, "ElkGraphComponentsProcessor/lambda$0$Type", 1268), + Wfn(1269, 1, {}, ot), + (Fjn.Kb = function (n) { + return UH(), Kun(Yx(n, 79)); + }), + EF(lPn, "ElkGraphComponentsProcessor/lambda$1$Type", 1269), + Wfn(1270, 1, YEn, st), + (Fjn.Mb = function (n) { + return (function (n) { + return UH(), Kun(n) == IG(Bun(n)); + })(Yx(n, 79)); + }), + EF(lPn, "ElkGraphComponentsProcessor/lambda$2$Type", 1270), + Wfn(1271, 1, {}, ht), + (Fjn.Kb = function (n) { + return UH(), Bun(Yx(n, 79)); + }), + EF(lPn, "ElkGraphComponentsProcessor/lambda$3$Type", 1271), + Wfn(1272, 1, YEn, ft), + (Fjn.Mb = function (n) { + return (function (n) { + return UH(), Bun(n) == IG(Kun(n)); + })(Yx(n, 79)); + }), + EF(lPn, "ElkGraphComponentsProcessor/lambda$4$Type", 1272), + Wfn(1273, 1, YEn, tw), + (Fjn.Mb = function (n) { + return (function (n, t) { + return UH(), n == IG(Kun(t)) || n == IG(Bun(t)); + })(this.a, Yx(n, 79)); + }), + EF(lPn, "ElkGraphComponentsProcessor/lambda$5$Type", 1273), + Wfn(1274, 1, {}, ew), + (Fjn.Kb = function (n) { + return (function (n, t) { + return UH(), n == Kun(t) ? Bun(t) : Kun(t); + })(this.a, Yx(n, 79)); + }), + EF(lPn, "ElkGraphComponentsProcessor/lambda$6$Type", 1274), + Wfn(1241, 1, {}, rW), + (Fjn.a = 0), + EF(lPn, "ElkGraphTransformer", 1241), + Wfn(1242, 1, {}, lt), + (Fjn.Od = function (n, t) { + !(function (n, t, e) { + var i, r, c, a; + (n.a = e.b.d), + CO(t, 352) + ? (XW((c = Kon((r = Ywn(Yx(t, 79), !1, !1)))), (i = new iw(n))), + wvn(c, r), + null != t.We((Cjn(), Gnt)) && XW(Yx(t.We(Gnt), 74), i)) + : ((a = Yx(t, 470)).Hg(a.Dg() + n.a.a), a.Ig(a.Eg() + n.a.b)); + })(this, Yx(n, 160), Yx(t, 266)); + }), + EF(lPn, "ElkGraphTransformer/OffsetApplier", 1242), + Wfn(1243, 1, PEn, iw), + (Fjn.td = function (n) { + !(function (n, t) { + $$(t, n.a.a.a, n.a.a.b); + })(this, Yx(n, 8)); + }), + EF(lPn, "ElkGraphTransformer/OffsetApplier/OffSetToChainApplier", 1243), + Wfn(753, 1, {}, bt), + EF(pPn, vPn, 753), + Wfn(1232, 1, FMn, wt), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i, r; + return 0 == (e = Yx(Aun(t, (Bdn(), bGn)), 19).a - Yx(Aun(n, bGn), 19).a) + ? ((i = yN(dO(Yx(Aun(n, (d2(), kGn)), 8)), Yx(Aun(n, jGn), 8))), + (r = yN(dO(Yx(Aun(t, kGn), 8)), Yx(Aun(t, jGn), 8))), + $9(i.a * i.b, r.a * r.b)) + : e; + })(Yx(n, 231), Yx(t, 231)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(pPn, mPn, 1232), + Wfn(740, 209, VSn, iv), + (Fjn.Ze = function (n, t) { + bbn(this, n, t); + }), + EF(pPn, "ForceLayoutProvider", 740), + Wfn(357, 134, { 3: 1, 357: 1, 94: 1, 134: 1 }), + EF(yPn, "FParticle", 357), + Wfn(559, 357, { 3: 1, 559: 1, 357: 1, 94: 1, 134: 1 }, dF), + (Fjn.Ib = function () { + var n; + return this.a + ? (n = hJ(this.a.a, this, 0)) >= 0 + ? "b" + n + "[" + YW(this.a) + "]" + : "b[" + YW(this.a) + "]" + : "b_" + _A(this); + }), + EF(yPn, "FBendpoint", 559), + Wfn(282, 134, { 3: 1, 282: 1, 94: 1, 134: 1 }, rN), + (Fjn.Ib = function () { + return YW(this); + }), + EF(yPn, "FEdge", 282), + Wfn(231, 134, { 3: 1, 231: 1, 94: 1, 134: 1 }, XV); + var Hqn, + qqn, + Gqn, + zqn, + Uqn, + Xqn, + Wqn, + Vqn, + Qqn, + Yqn, + Jqn = EF(yPn, "FGraph", 231); + Wfn(447, 357, { 3: 1, 447: 1, 357: 1, 94: 1, 134: 1 }, wW), + (Fjn.Ib = function () { + return null == this.b || 0 == this.b.length ? "l[" + YW(this.a) + "]" : "l_" + this.b; + }), + EF(yPn, "FLabel", 447), + Wfn(144, 357, { 3: 1, 144: 1, 357: 1, 94: 1, 134: 1 }, GF), + (Fjn.Ib = function () { + return Yz(this); + }), + (Fjn.b = 0), + EF(yPn, "FNode", 144), + Wfn(2003, 1, {}), + (Fjn.bf = function (n) { + Kpn(this, n); + }), + (Fjn.cf = function () { + trn(this); + }), + (Fjn.d = 0), + EF(jPn, "AbstractForceModel", 2003), + Wfn(631, 2003, { 631: 1 }, Z3), + (Fjn.af = function (n, t) { + var i, r, c, a; + return ( + mhn(this.f, n, t), + (c = yN(dO(t.d), n.d)), + (a = e.Math.sqrt(c.a * c.a + c.b * c.b)), + (r = e.Math.max(0, a - fB(n.e) / 2 - fB(t.e) / 2)), + KO( + c, + ((i = F5(this.e, n, t)) > 0 + ? -(function (n, t) { + return n > 0 ? e.Math.log(n / t) : -100; + })(r, this.c) * i + : (function (n, t) { + return n > 0 ? t / (n * n) : 100 * t; + })(r, this.b) * Yx(Aun(n, (Bdn(), bGn)), 19).a) / a, + ), + c + ); + }), + (Fjn.bf = function (n) { + Kpn(this, n), (this.a = Yx(Aun(n, (Bdn(), iGn)), 19).a), (this.c = ty(fL(Aun(n, mGn)))), (this.b = ty(fL(Aun(n, dGn)))); + }), + (Fjn.df = function (n) { + return n < this.a; + }), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.c = 0), + EF(jPn, "EadesModel", 631), + Wfn(632, 2003, { 632: 1 }, gD), + (Fjn.af = function (n, t) { + var i, r, c, a, u; + return ( + mhn(this.f, n, t), + (c = yN(dO(t.d), n.d)), + (u = e.Math.sqrt(c.a * c.a + c.b * c.b)), + (a = + (function (n, t) { + return n > 0 ? (t * t) / n : t * t * 100; + })((r = e.Math.max(0, u - fB(n.e) / 2 - fB(t.e) / 2)), this.a) * Yx(Aun(n, (Bdn(), bGn)), 19).a), + (i = F5(this.e, n, t)) > 0 && + (a -= + (function (n, t) { + return (n * n) / t; + })(r, this.a) * i), + KO(c, (a * this.b) / u), + c + ); + }), + (Fjn.bf = function (n) { + var t, i, r, c, a, u, o; + for ( + Kpn(this, n), + this.b = ty(fL(Aun(n, (Bdn(), yGn)))), + this.c = this.b / Yx(Aun(n, iGn), 19).a, + r = n.e.c.length, + a = 0, + c = 0, + o = new pb(n.e); + o.a < o.c.c.length; + + ) + (a += (u = Yx(Hz(o), 144)).e.a), (c += u.e.b); + (t = a * c), (i = ty(fL(Aun(n, mGn))) * SSn), (this.a = e.Math.sqrt(t / (2 * r)) * i); + }), + (Fjn.cf = function () { + trn(this), (this.b -= this.c); + }), + (Fjn.df = function (n) { + return this.b > 0; + }), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.c = 0), + EF(jPn, "FruchtermanReingoldModel", 632), + Wfn(849, 1, fSn, qh), + (Fjn.Qe = function (n) { + j7( + n, + new isn( + dk( + wk( + gk( + hk(sk(bk(fk(lk(new Fu(), EPn), ""), "Force Model"), "Determines the model for force calculation."), Gqn), + (lsn(), O7n), + ), + UGn, + ), + J9((Qtn(), T7n)), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk(hk(sk(bk(fk(lk(new Fu(), TPn), ""), "Iterations"), "The number of iterations on the force model."), d9(300)), $7n), + U_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), MPn), ""), "Repulsive Power"), + "Determines how many bend points are added to the edge; such bend points are regarded as repelling particles in the force model", + ), + d9(0), + ), + $7n, + ), + U_n, + ), + J9(k7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), SPn), ""), "FR Temperature"), + "The temperature is used as a scaling factor for particle displacements.", + ), + PPn, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + xU(n, SPn, EPn, Vqn), + j7( + n, + new isn( + dk( + wk( + gk(hk(sk(bk(fk(lk(new Fu(), IPn), ""), "Eades Repulsion"), "Factor for repulsive forces in Eades' model."), 5), C7n), + H_n, + ), + J9(T7n), + ), + ), + ), + xU(n, IPn, EPn, Uqn), + Mkn((new Gh(), n)); + }), + EF(CPn, "ForceMetaDataProvider", 849), + Wfn(424, 22, { 3: 1, 35: 1, 22: 1, 424: 1 }, fM); + var Zqn, + nGn, + tGn, + eGn, + iGn, + rGn, + cGn, + aGn, + uGn, + oGn, + sGn, + hGn, + fGn, + lGn, + bGn, + wGn, + dGn, + gGn, + pGn, + vGn, + mGn, + yGn, + kGn, + jGn, + EGn, + TGn, + MGn, + SGn, + PGn, + IGn, + CGn, + OGn, + AGn, + $Gn, + LGn, + NGn, + xGn, + DGn, + RGn, + KGn, + _Gn, + FGn, + BGn, + HGn, + qGn, + GGn, + zGn, + UGn = X1( + CPn, + "ForceModelStrategy", + 424, + u_n, + function () { + return hZ(), x4(Gy(UGn, 1), XEn, 424, 0, [Qqn, Yqn]); + }, + function (n) { + return hZ(), rZ((MW(), Zqn), n); + }, + ); + Wfn(988, 1, fSn, Gh), + (Fjn.Qe = function (n) { + Mkn(n); + }), + EF(CPn, "ForceOptions", 988), + Wfn(989, 1, {}, dt), + (Fjn.$e = function () { + return new iv(); + }), + (Fjn._e = function (n) {}), + EF(CPn, "ForceOptions/ForceFactory", 989), + Wfn(850, 1, fSn, zh), + (Fjn.Qe = function (n) { + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk(bk(fk(lk(new Fu(), VPn), ""), "Fixed Position"), "Prevent that the node is moved by the layout algorithm."), + (TA(), !1), + ), + (lsn(), I7n), + ), + D_n, + ), + J9((Qtn(), E7n)), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), QPn), ""), "Desired Edge Length"), + "Either specified for parent nodes or for individual edges, where the latter takes higher precedence.", + ), + 100, + ), + C7n, + ), + H_n, + ), + tK(T7n, x4(Gy(D7n, 1), XEn, 175, 0, [k7n])), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), YPn), ""), "Layout Dimension"), + "Dimensions that are permitted to be altered during layout.", + ), + PGn, + ), + O7n, + ), + ezn, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk(sk(bk(fk(lk(new Fu(), JPn), ""), "Stress Epsilon"), "Termination criterion for the iterative process."), PPn), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), ZPn), ""), "Iteration Limit"), + "Maximum number of performed iterations. Takes higher precedence than 'epsilon'.", + ), + d9(Yjn), + ), + $7n, + ), + U_n, + ), + J9(T7n), + ), + ), + ), + Kyn((new Uh(), n)); + }), + EF(CPn, "StressMetaDataProvider", 850), + Wfn(992, 1, fSn, Uh), + (Fjn.Qe = function (n) { + Kyn(n); + }), + EF(CPn, "StressOptions", 992), + Wfn(993, 1, {}, gt), + (Fjn.$e = function () { + return new cN(); + }), + (Fjn._e = function (n) {}), + EF(CPn, "StressOptions/StressFactory", 993), + Wfn(1128, 209, VSn, cN), + (Fjn.Ze = function (n, t) { + var e, i, r, c; + for ( + run(t, tIn, 1), + ny(hL(jln(n, (Wrn(), xGn)))) ? ny(hL(jln(n, BGn))) || rG(new Xb((dT(), new Xm(n)))) : bbn(new iv(), n, J2(t, 1)), + i = w5(n), + c = (e = ovn(this.a, i)).Kc(); + c.Ob(); + + ) + (r = Yx(c.Pb(), 231)).e.c.length <= 1 || ($mn(this.b, r), Mln(this.b), WZ(r.d, new pt())); + Okn((i = _kn(e))), Ron(t); + }), + EF(iIn, "StressLayoutProvider", 1128), + Wfn(1129, 1, PEn, pt), + (Fjn.td = function (n) { + Wvn(Yx(n, 447)); + }), + EF(iIn, "StressLayoutProvider/lambda$0$Type", 1129), + Wfn(990, 1, {}, Hp), + (Fjn.c = 0), + (Fjn.e = 0), + (Fjn.g = 0), + EF(iIn, "StressMajorization", 990), + Wfn(379, 22, { 3: 1, 35: 1, 22: 1, 379: 1 }, lM); + var XGn, + WGn, + VGn, + QGn, + YGn, + JGn, + ZGn, + nzn, + tzn, + ezn = X1( + iIn, + "StressMajorization/Dimension", + 379, + u_n, + function () { + return CJ(), x4(Gy(ezn, 1), XEn, 379, 0, [GGn, qGn, zGn]); + }, + function (n) { + return CJ(), rZ((jQ(), XGn), n); + }, + ); + Wfn(991, 1, FMn, rw), + (Fjn.ue = function (n, t) { + return (function (n, t, e) { + return $9(n[t.b], n[e.b]); + })(this.a, Yx(n, 144), Yx(t, 144)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(iIn, "StressMajorization/lambda$0$Type", 991), + Wfn(1229, 1, {}, gU), + EF(cIn, "ElkLayered", 1229), + Wfn(1230, 1, PEn, vt), + (Fjn.td = function (n) { + !(function (n) { + var t; + if ((t = Yx(Aun(n, (gjn(), i1n)), 314)) == (O0(), TWn)) + throw hp( + new by( + "The hierarchy aware processor " + + t + + " in child node " + + n + + " is only allowed if the root node specifies the same hierarchical processor.", + ), + ); + })(Yx(n, 37)); + }), + EF(cIn, "ElkLayered/lambda$0$Type", 1230), + Wfn(1231, 1, PEn, cw), + (Fjn.td = function (n) { + !(function (n, t) { + b5(t, (gjn(), YZn), n); + })(this.a, Yx(n, 37)); + }), + EF(cIn, "ElkLayered/lambda$1$Type", 1231), + Wfn(1263, 1, {}, fO), + EF(cIn, "GraphConfigurator", 1263), + Wfn(759, 1, PEn, aw), + (Fjn.td = function (n) { + ron(this.a, Yx(n, 10)); + }), + EF(cIn, "GraphConfigurator/lambda$0$Type", 759), + Wfn(760, 1, {}, mt), + (Fjn.Kb = function (n) { + return Mcn(), new SR(null, new Nz(Yx(n, 29).a, 16)); + }), + EF(cIn, "GraphConfigurator/lambda$1$Type", 760), + Wfn(761, 1, PEn, uw), + (Fjn.td = function (n) { + ron(this.a, Yx(n, 10)); + }), + EF(cIn, "GraphConfigurator/lambda$2$Type", 761), + Wfn(1127, 209, VSn, cv), + (Fjn.Ze = function (n, t) { + var e; + (e = Kvn(new wv(), n)), iI(jln(n, (gjn(), E1n))) === iI((O8(), $et)) ? _7(this.a, e, t) : ofn(this.a, e, t), Tkn(new Wh(), e); + }), + EF(cIn, "LayeredLayoutProvider", 1127), + Wfn(356, 22, { 3: 1, 35: 1, 22: 1, 356: 1 }, bM); + var izn, + rzn, + czn, + azn = X1( + cIn, + "LayeredPhases", + 356, + u_n, + function () { + return $un(), x4(Gy(azn, 1), XEn, 356, 0, [YGn, JGn, ZGn, nzn, tzn]); + }, + function (n) { + return $un(), rZ((mZ(), izn), n); + }, + ); + Wfn(1651, 1, {}, y0), + (Fjn.i = 0), + EF(aIn, "ComponentsToCGraphTransformer", 1651), + Wfn(1652, 1, {}, yt), + (Fjn.ef = function (n, t) { + return e.Math.min(null != n.a ? ty(n.a) : n.c.i, null != t.a ? ty(t.a) : t.c.i); + }), + (Fjn.ff = function (n, t) { + return e.Math.min(null != n.a ? ty(n.a) : n.c.i, null != t.a ? ty(t.a) : t.c.i); + }), + EF(aIn, "ComponentsToCGraphTransformer/1", 1652), + Wfn(81, 1, { 81: 1 }), + (Fjn.i = 0), + (Fjn.k = !0), + (Fjn.o = ZTn); + var uzn, + ozn, + szn, + hzn = EF(uIn, "CNode", 81); + Wfn(460, 81, { 460: 1, 81: 1 }, zA, Etn), + (Fjn.Ib = function () { + return ""; + }), + EF(aIn, "ComponentsToCGraphTransformer/CRectNode", 460), + Wfn(1623, 1, {}, kt), + EF(aIn, "OneDimensionalComponentsCompaction", 1623), + Wfn(1624, 1, {}, jt), + (Fjn.Kb = function (n) { + return (function (n) { + return r8(), TA(), 0 != Yx(n.a, 81).d.e; + })(Yx(n, 46)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + EF(aIn, "OneDimensionalComponentsCompaction/lambda$0$Type", 1624), + Wfn(1625, 1, {}, Et), + (Fjn.Kb = function (n) { + return (function (n) { + return r8(), TA(), !!(M7(Yx(n.a, 81).j, Yx(n.b, 103)) || (0 != Yx(n.a, 81).d.e && M7(Yx(n.a, 81).j, Yx(n.b, 103)))); + })(Yx(n, 46)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + EF(aIn, "OneDimensionalComponentsCompaction/lambda$1$Type", 1625), + Wfn(1654, 1, {}, HF), + EF(uIn, "CGraph", 1654), + Wfn(189, 1, { 189: 1 }, Ttn), + (Fjn.b = 0), + (Fjn.c = 0), + (Fjn.e = 0), + (Fjn.g = !0), + (Fjn.i = ZTn), + EF(uIn, "CGroup", 189), + Wfn(1653, 1, {}, Pt), + (Fjn.ef = function (n, t) { + return e.Math.max(null != n.a ? ty(n.a) : n.c.i, null != t.a ? ty(t.a) : t.c.i); + }), + (Fjn.ff = function (n, t) { + return e.Math.max(null != n.a ? ty(n.a) : n.c.i, null != t.a ? ty(t.a) : t.c.i); + }), + EF(uIn, zMn, 1653), + Wfn(1655, 1, {}, rfn), + (Fjn.d = !1); + var fzn = EF(uIn, QMn, 1655); + Wfn(1656, 1, {}, It), + (Fjn.Kb = function (n) { + return WE(), TA(), 0 != Yx(Yx(n, 46).a, 81).d.e; + }), + (Fjn.Fb = function (n) { + return this === n; + }), + EF(uIn, YMn, 1656), + Wfn(823, 1, {}, gR), + (Fjn.a = !1), + (Fjn.b = !1), + (Fjn.c = !1), + (Fjn.d = !1), + EF(uIn, JMn, 823), + Wfn(1825, 1, {}, lK), + EF(oIn, ZMn, 1825); + var lzn = aR(sIn, HMn); + Wfn(1826, 1, { 369: 1 }, yq), + (Fjn.Ke = function (n) { + !(function (n, t) { + var e, i, r; + t.a + ? (uF(n.b, t.b), (n.a[t.b.i] = Yx(BN(n.b, t.b), 81)), (e = Yx(FN(n.b, t.b), 81)) && (n.a[e.i] = t.b)) + : (!!(i = Yx(BN(n.b, t.b), 81)) && i == n.a[t.b.i] && !!i.d && i.d != t.b.d && i.f.Fc(t.b), + !!(r = Yx(FN(n.b, t.b), 81)) && n.a[r.i] == t.b && !!r.d && r.d != t.b.d && t.b.f.Fc(r), + RA(n.b, t.b)); + })(this, Yx(n, 466)); + }), + EF(oIn, nSn, 1826), + Wfn(1827, 1, FMn, Ct), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return $9(n.g.c + n.g.b / 2, t.g.c + t.g.b / 2); + })(Yx(n, 81), Yx(t, 81)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(oIn, tSn, 1827), + Wfn(466, 1, { 466: 1 }, CM), + (Fjn.a = !1), + EF(oIn, eSn, 466), + Wfn(1828, 1, FMn, Ot), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i, r; + if (((i = n.b.g.d), n.a || (i += n.b.g.a), (r = t.b.g.d), t.a || (r += t.b.g.a), 0 == (e = $9(i, r)))) { + if (!n.a && t.a) return -1; + if (!t.a && n.a) return 1; + } + return e; + })(Yx(n, 466), Yx(t, 466)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(oIn, iSn, 1828), + Wfn(140, 1, { 140: 1 }, LM, ED), + (Fjn.Fb = function (n) { + var t; + return null != n && pzn == V5(n) && ((t = Yx(n, 140)), qB(this.c, t.c) && qB(this.d, t.d)); + }), + (Fjn.Hb = function () { + return G6(x4(Gy(UKn, 1), iEn, 1, 5, [this.c, this.d])); + }), + (Fjn.Ib = function () { + return "(" + this.c + tEn + this.d + (this.a ? "cx" : "") + this.b + ")"; + }), + (Fjn.a = !0), + (Fjn.c = 0), + (Fjn.d = 0); + var bzn, + wzn, + dzn, + gzn, + pzn = EF(sIn, "Point", 140); + Wfn(405, 22, { 3: 1, 35: 1, 22: 1, 405: 1 }, wM); + var vzn, + mzn, + yzn, + kzn, + jzn, + Ezn, + Tzn, + Mzn, + Szn, + Pzn, + Izn, + Czn = X1( + sIn, + "Point/Quadrant", + 405, + u_n, + function () { + return _4(), x4(Gy(Czn, 1), XEn, 405, 0, [bzn, gzn, wzn, dzn]); + }, + function (n) { + return _4(), rZ((GY(), vzn), n); + }, + ); + Wfn(1642, 1, {}, ov), + (Fjn.b = null), + (Fjn.c = null), + (Fjn.d = null), + (Fjn.e = null), + (Fjn.f = null), + EF(sIn, "RectilinearConvexHull", 1642), + Wfn(574, 1, { 369: 1 }, ben), + (Fjn.Ke = function (n) { + !(function (n, t) { + n.a.ue(t.d, n.b) > 0 && (eD(n.c, new ED(t.c, t.d, n.d)), (n.b = t.d)); + })(this, Yx(n, 140)); + }), + (Fjn.b = 0), + EF(sIn, "RectilinearConvexHull/MaximalElementsEventHandler", 574), + Wfn(1644, 1, FMn, Mt), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return VE(), $9((vB(n), n), (vB(t), t)); + })(fL(n), fL(t)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(sIn, "RectilinearConvexHull/MaximalElementsEventHandler/lambda$0$Type", 1644), + Wfn(1643, 1, { 369: 1 }, xZ), + (Fjn.Ke = function (n) { + zbn(this, Yx(n, 140)); + }), + (Fjn.a = 0), + (Fjn.b = null), + (Fjn.c = null), + (Fjn.d = null), + (Fjn.e = null), + EF(sIn, "RectilinearConvexHull/RectangleEventHandler", 1643), + Wfn(1645, 1, FMn, St), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return oZ(), n.c == t.c ? $9(t.d, n.d) : $9(n.c, t.c); + })(Yx(n, 140), Yx(t, 140)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(sIn, "RectilinearConvexHull/lambda$0$Type", 1645), + Wfn(1646, 1, FMn, Tt), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return oZ(), n.c == t.c ? $9(n.d, t.d) : $9(n.c, t.c); + })(Yx(n, 140), Yx(t, 140)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(sIn, "RectilinearConvexHull/lambda$1$Type", 1646), + Wfn(1647, 1, FMn, At), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return oZ(), n.c == t.c ? $9(t.d, n.d) : $9(t.c, n.c); + })(Yx(n, 140), Yx(t, 140)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(sIn, "RectilinearConvexHull/lambda$2$Type", 1647), + Wfn(1648, 1, FMn, $t), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return oZ(), n.c == t.c ? $9(n.d, t.d) : $9(t.c, n.c); + })(Yx(n, 140), Yx(t, 140)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(sIn, "RectilinearConvexHull/lambda$3$Type", 1648), + Wfn(1649, 1, FMn, Lt), + (Fjn.ue = function (n, t) { + return Nun(Yx(n, 140), Yx(t, 140)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(sIn, "RectilinearConvexHull/lambda$4$Type", 1649), + Wfn(1650, 1, {}, tz), + EF(sIn, "Scanline", 1650), + Wfn(2005, 1, {}), + EF(hIn, "AbstractGraphPlacer", 2005), + Wfn(325, 1, { 325: 1 }, F$), + (Fjn.mf = function (n) { + return !!this.nf(n) && (Qhn(this.b, Yx(Aun(n, (Ojn(), uQn)), 21), n), !0); + }), + (Fjn.nf = function (n) { + var t, e, i; + for (t = Yx(Aun(n, (Ojn(), uQn)), 21), i = Yx(_V(Mzn, t), 21).Kc(); i.Ob(); ) + if (((e = Yx(i.Pb(), 21)), !Yx(_V(this.b, e), 15).dc())) return !1; + return !0; + }), + EF(hIn, "ComponentGroup", 325), + Wfn(765, 2005, {}, sv), + (Fjn.of = function (n) { + var t; + for (t = new pb(this.a); t.a < t.c.c.length; ) if (Yx(Hz(t), 325).mf(n)) return; + eD(this.a, new F$(n)); + }), + (Fjn.lf = function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w; + if (((this.a.c = VQ(UKn, iEn, 1, 0, 5, 1)), (t.a.c = VQ(UKn, iEn, 1, 0, 5, 1)), n.dc())) return (t.f.a = 0), void (t.f.b = 0); + for (o4(t, (a = Yx(n.Xb(0), 37))), r = n.Kc(); r.Ob(); ) (i = Yx(r.Pb(), 37)), this.of(i); + for (w = new Pk(), c = ty(fL(Aun(a, (gjn(), L0n)))), s = new pb(this.a); s.a < s.c.c.length; ) + (h = ijn((u = Yx(Hz(s), 325)), c)), wY(CF(u.b), w.a, w.b), (w.a += h.a), (w.b += h.b); + if (((t.f.a = w.a - c), (t.f.b = w.b - c), ny(hL(Aun(a, _Zn))) && iI(Aun(a, b1n)) === iI((g7(), het)))) { + for (b = n.Kc(); b.Ob(); ) bgn((f = Yx(b.Pb(), 37)), f.c.a, f.c.b); + for (bjn((e = new Nt()), n, c), l = n.Kc(); l.Ob(); ) mN(OI((f = Yx(l.Pb(), 37)).c), e.e); + mN(OI(t.f), e.a); + } + for (o = new pb(this.a); o.a < o.c.c.length; ) dY(t, CF((u = Yx(Hz(o), 325)).b)); + }), + EF(hIn, "ComponentGroupGraphPlacer", 765), + Wfn(1293, 765, {}, Ev), + (Fjn.of = function (n) { + K8(this, n); + }), + (Fjn.lf = function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v; + if (((this.a.c = VQ(UKn, iEn, 1, 0, 5, 1)), (t.a.c = VQ(UKn, iEn, 1, 0, 5, 1)), n.dc())) return (t.f.a = 0), void (t.f.b = 0); + for (o4(t, (a = Yx(n.Xb(0), 37))), r = n.Kc(); r.Ob(); ) K8(this, Yx(r.Pb(), 37)); + for ( + v = new Pk(), p = new Pk(), d = new Pk(), w = new Pk(), c = ty(fL(Aun(a, (gjn(), L0n)))), s = new pb(this.a); + s.a < s.c.c.length; + + ) { + if (((u = Yx(Hz(s), 325)), lC(Yx(Aun(t, (Cjn(), Pnt)), 103)))) { + for (d.a = v.a, g = new Mm(OF(SF(u.b).a).a.kc()); g.b.Ob(); ) + if (Yx(CT(g.b.Pb()), 21).Hc((Ikn(), Tit))) { + d.a = p.a; + break; + } + } else if (bC(Yx(Aun(t, Pnt), 103))) + for (d.b = v.b, g = new Mm(OF(SF(u.b).a).a.kc()); g.b.Ob(); ) + if (Yx(CT(g.b.Pb()), 21).Hc((Ikn(), qit))) { + d.b = p.b; + break; + } + if (((h = ijn(Yx(u, 570), c)), wY(CF(u.b), d.a, d.b), lC(Yx(Aun(t, Pnt), 103)))) { + for (p.a = d.a + h.a, w.a = e.Math.max(w.a, p.a), g = new Mm(OF(SF(u.b).a).a.kc()); g.b.Ob(); ) + if (Yx(CT(g.b.Pb()), 21).Hc((Ikn(), Bit))) { + v.a = d.a + h.a; + break; + } + (p.b = d.b + h.b), (d.b = p.b), (w.b = e.Math.max(w.b, d.b)); + } else if (bC(Yx(Aun(t, Pnt), 103))) { + for (p.b = d.b + h.b, w.b = e.Math.max(w.b, p.b), g = new Mm(OF(SF(u.b).a).a.kc()); g.b.Ob(); ) + if (Yx(CT(g.b.Pb()), 21).Hc((Ikn(), Eit))) { + v.b = d.b + h.b; + break; + } + (p.a = d.a + h.a), (d.a = p.a), (w.a = e.Math.max(w.a, d.a)); + } + } + if (((t.f.a = w.a - c), (t.f.b = w.b - c), ny(hL(Aun(a, _Zn))) && iI(Aun(a, b1n)) === iI((g7(), het)))) { + for (b = n.Kc(); b.Ob(); ) bgn((f = Yx(b.Pb(), 37)), f.c.a, f.c.b); + for (bjn((i = new Nt()), n, c), l = n.Kc(); l.Ob(); ) mN(OI((f = Yx(l.Pb(), 37)).c), i.e); + mN(OI(t.f), i.a); + } + for (o = new pb(this.a); o.a < o.c.c.length; ) dY(t, CF((u = Yx(Hz(o), 325)).b)); + }), + EF(hIn, "ComponentGroupModelOrderGraphPlacer", 1293), + Wfn(423, 22, { 3: 1, 35: 1, 22: 1, 423: 1 }, dM); + var Ozn, + Azn, + $zn, + Lzn = X1( + hIn, + "ComponentOrderingStrategy", + 423, + u_n, + function () { + return e9(), x4(Gy(Lzn, 1), XEn, 423, 0, [Izn, Pzn, Szn]); + }, + function (n) { + return e9(), rZ((EQ(), Ozn), n); + }, + ); + Wfn(650, 1, {}, Nt), + EF(hIn, "ComponentsCompactor", 650), + Wfn(1468, 12, fMn, rV), + (Fjn.Fc = function (n) { + return ean(this, Yx(n, 140)); + }), + EF(hIn, "ComponentsCompactor/Hullpoints", 1468), + Wfn(1465, 1, { 841: 1 }, Fen), + (Fjn.a = !1), + EF(hIn, "ComponentsCompactor/InternalComponent", 1465), + Wfn(1464, 1, $En, hv), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Kc = function () { + return new pb(this.a); + }), + EF(hIn, "ComponentsCompactor/InternalConnectedComponents", 1464), + Wfn(1467, 1, { 594: 1 }, sfn), + (Fjn.hf = function () { + return null; + }), + (Fjn.jf = function () { + return this.a; + }), + (Fjn.gf = function () { + return Jtn(this.d); + }), + (Fjn.kf = function () { + return this.b; + }), + EF(hIn, "ComponentsCompactor/InternalExternalExtension", 1467), + Wfn(1466, 1, { 594: 1 }, bv), + (Fjn.jf = function () { + return this.a; + }), + (Fjn.gf = function () { + return Jtn(this.d); + }), + (Fjn.hf = function () { + return this.c; + }), + (Fjn.kf = function () { + return this.b; + }), + EF(hIn, "ComponentsCompactor/InternalUnionExternalExtension", 1466), + Wfn(1470, 1, {}, Gwn), + EF(hIn, "ComponentsCompactor/OuterSegments", 1470), + Wfn(1469, 1, {}, fv), + EF(hIn, "ComponentsCompactor/Segments", 1469), + Wfn(1264, 1, {}, kq), + EF(hIn, vPn, 1264), + Wfn(1265, 1, FMn, xt), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i; + return (e = wrn(n)) < (i = wrn(t)) ? -1 : e > i ? 1 : 0; + })(Yx(n, 37), Yx(t, 37)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(hIn, "ComponentsProcessor/lambda$0$Type", 1265), + Wfn(570, 325, { 325: 1, 570: 1 }, iV), + (Fjn.mf = function (n) { + return a6(this, n); + }), + (Fjn.nf = function (n) { + return Fbn(this, n); + }), + EF(hIn, "ModelOrderComponentGroup", 570), + Wfn(1291, 2005, {}, Dt), + (Fjn.lf = function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j; + if (1 != n.gc()) { + if (n.dc()) return (t.a.c = VQ(UKn, iEn, 1, 0, 5, 1)), (t.f.a = 0), void (t.f.b = 0); + if (iI(Aun(t, (gjn(), HZn))) === iI((e9(), Izn))) { + for (s = n.Kc(); s.Ob(); ) { + for (p = 0, d = new pb((u = Yx(s.Pb(), 37)).a); d.a < d.c.c.length; ) (w = Yx(Hz(d), 10)), (p += Yx(Aun(w, T0n), 19).a); + u.p = p; + } + XH(), n.ad(new Rt()); + } + for (a = Yx(n.Xb(0), 37), t.a.c = VQ(UKn, iEn, 1, 0, 5, 1), o4(t, a), b = 0, y = 0, h = n.Kc(); h.Ob(); ) + (v = (u = Yx(h.Pb(), 37)).f), (b = e.Math.max(b, v.a)), (y += v.a * v.b); + for ( + b = e.Math.max(b, e.Math.sqrt(y) * ty(fL(Aun(t, RZn)))), k = 0, j = 0, l = 0, i = c = ty(fL(Aun(t, L0n))), o = n.Kc(); + o.Ob(); + + ) + k + (v = (u = Yx(o.Pb(), 37)).f).a > b && ((k = 0), (j += l + c), (l = 0)), + bgn(u, k + (g = u.c).a, j + g.b), + OI(g), + (i = e.Math.max(i, k + v.a)), + (l = e.Math.max(l, v.b)), + (k += v.a + c); + if (((t.f.a = i), (t.f.b = j + l), ny(hL(Aun(a, _Zn))))) { + for (bjn((r = new Nt()), n, c), f = n.Kc(); f.Ob(); ) mN(OI(Yx(f.Pb(), 37).c), r.e); + mN(OI(t.f), r.a); + } + dY(t, n); + } else + (m = Yx(n.Xb(0), 37)) != t && + ((t.a.c = VQ(UKn, iEn, 1, 0, 5, 1)), Dgn(t, m, 0, 0), o4(t, m), HH(t.d, m.d), (t.f.a = m.f.a), (t.f.b = m.f.b)); + }), + EF(hIn, "SimpleRowGraphPlacer", 1291), + Wfn(1292, 1, FMn, Rt), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e; + return 0 == (e = t.p - n.p) ? $9(n.f.a * n.f.b, t.f.a * t.f.b) : e; + })(Yx(n, 37), Yx(t, 37)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(hIn, "SimpleRowGraphPlacer/1", 1292), + Wfn(1262, 1, rSn, Kt), + (Fjn.Lb = function (n) { + var t; + return !!(t = Yx(Aun(Yx(n, 243).b, (gjn(), $1n)), 74)) && 0 != t.b; + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Mb = function (n) { + var t; + return !!(t = Yx(Aun(Yx(n, 243).b, (gjn(), $1n)), 74)) && 0 != t.b; + }), + EF(wIn, "CompoundGraphPostprocessor/1", 1262), + Wfn(1261, 1, dIn, dv), + (Fjn.pf = function (n, t) { + Wen(this, Yx(n, 37), t); + }), + EF(wIn, "CompoundGraphPreprocessor", 1261), + Wfn(441, 1, { 441: 1 }, c9), + (Fjn.c = !1), + EF(wIn, "CompoundGraphPreprocessor/ExternalPort", 441), + Wfn(243, 1, { 243: 1 }, jx), + (Fjn.Ib = function () { + return d$(this.c) + ":" + Khn(this.b); + }), + EF(wIn, "CrossHierarchyEdge", 243), + Wfn(763, 1, FMn, ow), + (Fjn.ue = function (n, t) { + return (function (n, t, e) { + var i, r; + return t.c == (h0(), i3n) && e.c == e3n + ? -1 + : t.c == e3n && e.c == i3n + ? 1 + : ((i = X6(t.a, n.a)), (r = X6(e.a, n.a)), t.c == i3n ? r - i : i - r); + })(this, Yx(n, 243), Yx(t, 243)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(wIn, "CrossHierarchyEdgeComparator", 763), + Wfn(299, 134, { 3: 1, 299: 1, 94: 1, 134: 1 }), + (Fjn.p = 0), + EF(gIn, "LGraphElement", 299), + Wfn(17, 299, { 3: 1, 17: 1, 299: 1, 94: 1, 134: 1 }, jq), + (Fjn.Ib = function () { + return Khn(this); + }); + var Nzn = EF(gIn, "LEdge", 17); + Wfn(37, 299, { 3: 1, 20: 1, 37: 1, 299: 1, 94: 1, 134: 1 }, k0), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Kc = function () { + return new pb(this.b); + }), + (Fjn.Ib = function () { + return 0 == this.b.c.length + ? "G-unlayered" + Gun(this.a) + : 0 == this.a.c.length + ? "G-layered" + Gun(this.b) + : "G[layerless" + Gun(this.a) + ", layers" + Gun(this.b) + "]"; + }); + var xzn, + Dzn = EF(gIn, "LGraph", 37); + Wfn(657, 1, {}), + (Fjn.qf = function () { + return this.e.n; + }), + (Fjn.We = function (n) { + return Aun(this.e, n); + }), + (Fjn.rf = function () { + return this.e.o; + }), + (Fjn.sf = function () { + return this.e.p; + }), + (Fjn.Xe = function (n) { + return O$(this.e, n); + }), + (Fjn.tf = function (n) { + (this.e.n.a = n.a), (this.e.n.b = n.b); + }), + (Fjn.uf = function (n) { + (this.e.o.a = n.a), (this.e.o.b = n.b); + }), + (Fjn.vf = function (n) { + this.e.p = n; + }), + EF(gIn, "LGraphAdapters/AbstractLShapeAdapter", 657), + Wfn(577, 1, { 839: 1 }, sw), + (Fjn.wf = function () { + var n, t; + if (!this.b) + for (this.b = h$(this.a.b.c.length), t = new pb(this.a.b); t.a < t.c.c.length; ) (n = Yx(Hz(t), 70)), eD(this.b, new hw(n)); + return this.b; + }), + (Fjn.b = null), + EF(gIn, "LGraphAdapters/LEdgeAdapter", 577), + Wfn(656, 1, {}, dH), + (Fjn.xf = function () { + var n, t, e, i, r; + if (!this.b) + for (this.b = new ip(), e = new pb(this.a.b); e.a < e.c.c.length; ) + for (r = new pb(Yx(Hz(e), 29).a); r.a < r.c.c.length; ) + if (((i = Yx(Hz(r), 10)), this.c.Mb(i) && (eD(this.b, new Ix(this, i, this.e)), this.d))) { + if (O$(i, (Ojn(), JQn))) + for (t = Yx(Aun(i, JQn), 15).Kc(); t.Ob(); ) (n = Yx(t.Pb(), 10)), eD(this.b, new Ix(this, n, !1)); + if (O$(i, QVn)) for (t = Yx(Aun(i, QVn), 15).Kc(); t.Ob(); ) (n = Yx(t.Pb(), 10)), eD(this.b, new Ix(this, n, !1)); + } + return this.b; + }), + (Fjn.qf = function () { + throw hp(new sy(vIn)); + }), + (Fjn.We = function (n) { + return Aun(this.a, n); + }), + (Fjn.rf = function () { + return this.a.f; + }), + (Fjn.sf = function () { + return this.a.p; + }), + (Fjn.Xe = function (n) { + return O$(this.a, n); + }), + (Fjn.tf = function (n) { + throw hp(new sy(vIn)); + }), + (Fjn.uf = function (n) { + (this.a.f.a = n.a), (this.a.f.b = n.b); + }), + (Fjn.vf = function (n) { + this.a.p = n; + }), + (Fjn.b = null), + (Fjn.d = !1), + (Fjn.e = !1), + EF(gIn, "LGraphAdapters/LGraphAdapter", 656), + Wfn(576, 657, { 181: 1 }, hw), + EF(gIn, "LGraphAdapters/LLabelAdapter", 576), + Wfn(575, 657, { 680: 1 }, Ix), + (Fjn.yf = function () { + return this.b; + }), + (Fjn.zf = function () { + return XH(), XH(), TFn; + }), + (Fjn.wf = function () { + var n, t; + if (!this.a) + for (this.a = h$(Yx(this.e, 10).b.c.length), t = new pb(Yx(this.e, 10).b); t.a < t.c.c.length; ) + (n = Yx(Hz(t), 70)), eD(this.a, new hw(n)); + return this.a; + }), + (Fjn.Af = function () { + var n; + return new pN((n = Yx(this.e, 10).d).d, n.c, n.a, n.b); + }), + (Fjn.Bf = function () { + return XH(), XH(), TFn; + }), + (Fjn.Cf = function () { + var n, t; + if (!this.c) + for (this.c = h$(Yx(this.e, 10).j.c.length), t = new pb(Yx(this.e, 10).j); t.a < t.c.c.length; ) + (n = Yx(Hz(t), 11)), eD(this.c, new NM(n, this.d)); + return this.c; + }), + (Fjn.Df = function () { + return ny(hL(Aun(Yx(this.e, 10), (Ojn(), ZVn)))); + }), + (Fjn.Ef = function (n) { + (Yx(this.e, 10).d.b = n.b), (Yx(this.e, 10).d.d = n.d), (Yx(this.e, 10).d.c = n.c), (Yx(this.e, 10).d.a = n.a); + }), + (Fjn.Ff = function (n) { + (Yx(this.e, 10).f.b = n.b), (Yx(this.e, 10).f.d = n.d), (Yx(this.e, 10).f.c = n.c), (Yx(this.e, 10).f.a = n.a); + }), + (Fjn.Gf = function () { + var n, t; + (n = this), qE(), (t = xzn), zN(Yx(Aun(Yx(n.e, 10), (gjn(), g0n)), 98)) && (XH(), JC(Yx(n.e, 10).j, t)); + }), + (Fjn.a = null), + (Fjn.b = null), + (Fjn.c = null), + (Fjn.d = !1), + EF(gIn, "LGraphAdapters/LNodeAdapter", 575), + Wfn(1722, 657, { 838: 1 }, NM), + (Fjn.zf = function () { + var n, t, e, i; + if (this.d && Yx(this.e, 11).i.k == (bon(), qzn)) return XH(), XH(), TFn; + if (!this.a) { + for (this.a = new ip(), e = new pb(Yx(this.e, 11).e); e.a < e.c.c.length; ) (n = Yx(Hz(e), 17)), eD(this.a, new sw(n)); + if (this.d && (i = Yx(Aun(Yx(this.e, 11), (Ojn(), RQn)), 10))) + for (t = new $K(bA(u7(i).a.Kc(), new h())); Vfn(t); ) (n = Yx(kV(t), 17)), eD(this.a, new sw(n)); + } + return this.a; + }), + (Fjn.wf = function () { + var n, t; + if (!this.b) + for (this.b = h$(Yx(this.e, 11).f.c.length), t = new pb(Yx(this.e, 11).f); t.a < t.c.c.length; ) + (n = Yx(Hz(t), 70)), eD(this.b, new hw(n)); + return this.b; + }), + (Fjn.Bf = function () { + var n, t, e, i; + if (this.d && Yx(this.e, 11).i.k == (bon(), qzn)) return XH(), XH(), TFn; + if (!this.c) { + for (this.c = new ip(), e = new pb(Yx(this.e, 11).g); e.a < e.c.c.length; ) (n = Yx(Hz(e), 17)), eD(this.c, new sw(n)); + if (this.d && (i = Yx(Aun(Yx(this.e, 11), (Ojn(), RQn)), 10))) + for (t = new $K(bA(o7(i).a.Kc(), new h())); Vfn(t); ) (n = Yx(kV(t), 17)), eD(this.c, new sw(n)); + } + return this.c; + }), + (Fjn.Hf = function () { + return Yx(this.e, 11).j; + }), + (Fjn.If = function () { + return ny(hL(Aun(Yx(this.e, 11), (Ojn(), gQn)))); + }), + (Fjn.a = null), + (Fjn.b = null), + (Fjn.c = null), + (Fjn.d = !1), + EF(gIn, "LGraphAdapters/LPortAdapter", 1722), + Wfn(1723, 1, FMn, _t), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i, r, c; + if (0 != (c = n.j.g - t.j.g)) return c; + if (((e = Yx(Aun(n, (gjn(), p0n)), 19)), (i = Yx(Aun(t, p0n), 19)), e && i && 0 != (r = e.a - i.a))) return r; + switch (n.j.g) { + case 1: + return $9(n.n.a, t.n.a); + case 2: + return $9(n.n.b, t.n.b); + case 3: + return $9(t.n.a, n.n.a); + case 4: + return $9(t.n.b, n.n.b); + default: + throw hp(new Ym(mIn)); + } + })(Yx(n, 11), Yx(t, 11)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(gIn, "LGraphAdapters/PortComparator", 1723), + Wfn(804, 1, YEn, Ft), + (Fjn.Mb = function (n) { + return Yx(n, 10), qE(), !0; + }), + EF(gIn, "LGraphAdapters/lambda$0$Type", 804), + Wfn(392, 299, { 3: 1, 299: 1, 392: 1, 94: 1, 134: 1 }), + EF(gIn, "LShape", 392), + Wfn(70, 392, { 3: 1, 299: 1, 70: 1, 392: 1, 94: 1, 134: 1 }, Sk, sO), + (Fjn.Ib = function () { + var n; + return null == + (n = (function (n) { + return n.a ? n.a : IH(n); + })(this)) + ? "label" + : "l_" + n; + }), + EF(gIn, "LLabel", 70), + Wfn(207, 1, { 3: 1, 4: 1, 207: 1, 414: 1 }), + (Fjn.Fb = function (n) { + var t; + return !!CO(n, 207) && ((t = Yx(n, 207)), this.d == t.d && this.a == t.a && this.b == t.b && this.c == t.c); + }), + (Fjn.Hb = function () { + var n; + return (n = ZI(this.b) << 16), (n |= ZI(this.a) & fTn) ^ ((ZI(this.c) << 16) | (ZI(this.d) & fTn)); + }), + (Fjn.Jf = function (n) { + var t, e, i, r, c, a, u, o, s; + for (r = 0; r < n.length && l8((Lz(r, n.length), n.charCodeAt(r)), EIn); ) ++r; + for (t = n.length; t > 0 && l8((Lz(t - 1, n.length), n.charCodeAt(t - 1)), TIn); ) --t; + if (r < t) { + o = Ogn(n.substr(r, t - r), ",|;"); + try { + for (a = 0, u = (c = o).length; a < u; ++a) { + if (2 != (i = Ogn(c[a], "=")).length) throw hp(new Qm("Expecting a list of key-value pairs.")); + (e = Wun(i[0])), + (s = gon(Wun(i[1]))), + _N(e, "top") + ? (this.d = s) + : _N(e, "left") + ? (this.b = s) + : _N(e, "bottom") + ? (this.a = s) + : _N(e, "right") && (this.c = s); + } + } catch (n) { + throw CO((n = j4(n)), 127) ? hp(new Qm(MIn + n)) : hp(n); + } + } + }), + (Fjn.Ib = function () { + return "[top=" + this.d + ",left=" + this.b + ",bottom=" + this.a + ",right=" + this.c + "]"; + }), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.c = 0), + (Fjn.d = 0), + EF(SIn, "Spacing", 207), + Wfn(142, 207, PIn, Mv, sC, pN, yx); + var Rzn = EF(SIn, "ElkMargin", 142); + Wfn(651, 142, PIn, Tv), + EF(gIn, "LMargin", 651), + Wfn(10, 392, { 3: 1, 299: 1, 10: 1, 392: 1, 94: 1, 134: 1 }, rin), + (Fjn.Ib = function () { + return ven(this); + }), + (Fjn.i = !1); + var Kzn, + _zn, + Fzn, + Bzn, + Hzn, + qzn, + Gzn = EF(gIn, "LNode", 10); + Wfn(267, 22, { 3: 1, 35: 1, 22: 1, 267: 1 }, gM); + var zzn, + Uzn = X1( + gIn, + "LNode/NodeType", + 267, + u_n, + function () { + return bon(), x4(Gy(Uzn, 1), XEn, 267, 0, [Hzn, Bzn, _zn, qzn, Fzn, Kzn]); + }, + function (n) { + return bon(), rZ((p1(), zzn), n); + }, + ); + Wfn(116, 207, IIn, Sv, RC, mx); + var Xzn, + Wzn, + Vzn, + Qzn, + Yzn, + Jzn, + Zzn = EF(SIn, "ElkPadding", 116); + Wfn(764, 116, IIn, Pv), + EF(gIn, "LPadding", 764), + Wfn(11, 392, { 3: 1, 299: 1, 11: 1, 392: 1, 94: 1, 134: 1 }, Ion), + (Fjn.Ib = function () { + var n, t, e; + return ( + yI((((n = new Ay()).a += "p_"), n), krn(this)), + this.i && yI(mI(((n.a += "["), n), this.i), "]"), + 1 == this.e.c.length && + 0 == this.g.c.length && + Yx(TR(this.e, 0), 17).c != this && + ((t = Yx(TR(this.e, 0), 17).c), yI(((n.a += " << "), n), krn(t)), yI(mI(((n.a += "["), n), t.i), "]")), + 0 == this.e.c.length && + 1 == this.g.c.length && + Yx(TR(this.g, 0), 17).d != this && + ((e = Yx(TR(this.g, 0), 17).d), yI(((n.a += " >> "), n), krn(e)), yI(mI(((n.a += "["), n), e.i), "]")), + n.a + ); + }), + (Fjn.c = !0), + (Fjn.d = !1); + var nUn, + tUn, + eUn, + iUn, + rUn = EF(gIn, "LPort", 11); + Wfn(397, 1, $En, fw), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Kc = function () { + return new lw(new pb(this.a.e)); + }), + EF(gIn, "LPort/1", 397), + Wfn(1290, 1, fEn, lw), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Pb = function () { + return Yx(Hz(this.a), 17).c; + }), + (Fjn.Ob = function () { + return ZC(this.a); + }), + (Fjn.Qb = function () { + z_(this.a); + }), + EF(gIn, "LPort/1/1", 1290), + Wfn(359, 1, $En, bw), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Kc = function () { + return new ww(new pb(this.a.g)); + }), + EF(gIn, "LPort/2", 359), + Wfn(762, 1, fEn, ww), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Pb = function () { + return Yx(Hz(this.a), 17).d; + }), + (Fjn.Ob = function () { + return ZC(this.a); + }), + (Fjn.Qb = function () { + z_(this.a); + }), + EF(gIn, "LPort/2/1", 762), + Wfn(1283, 1, $En, IM), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Kc = function () { + return new UV(this); + }), + EF(gIn, "LPort/CombineIter", 1283), + Wfn(201, 1, fEn, UV), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Qb = function () { + Bk(); + }), + (Fjn.Ob = function () { + return YA(this); + }), + (Fjn.Pb = function () { + return ZC(this.a) ? Hz(this.a) : Hz(this.b); + }), + EF(gIn, "LPort/CombineIter/1", 201), + Wfn(1285, 1, rSn, Bt), + (Fjn.Lb = function (n) { + return JK(n); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Mb = function (n) { + return Q2(), 0 != Yx(n, 11).e.c.length; + }), + EF(gIn, "LPort/lambda$0$Type", 1285), + Wfn(1284, 1, rSn, Ht), + (Fjn.Lb = function (n) { + return ZK(n); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Mb = function (n) { + return Q2(), 0 != Yx(n, 11).g.c.length; + }), + EF(gIn, "LPort/lambda$1$Type", 1284), + Wfn(1286, 1, rSn, qt), + (Fjn.Lb = function (n) { + return Q2(), Yx(n, 11).j == (Ikn(), Tit); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Mb = function (n) { + return Q2(), Yx(n, 11).j == (Ikn(), Tit); + }), + EF(gIn, "LPort/lambda$2$Type", 1286), + Wfn(1287, 1, rSn, Gt), + (Fjn.Lb = function (n) { + return Q2(), Yx(n, 11).j == (Ikn(), Eit); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Mb = function (n) { + return Q2(), Yx(n, 11).j == (Ikn(), Eit); + }), + EF(gIn, "LPort/lambda$3$Type", 1287), + Wfn(1288, 1, rSn, zt), + (Fjn.Lb = function (n) { + return Q2(), Yx(n, 11).j == (Ikn(), Bit); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Mb = function (n) { + return Q2(), Yx(n, 11).j == (Ikn(), Bit); + }), + EF(gIn, "LPort/lambda$4$Type", 1288), + Wfn(1289, 1, rSn, Ut), + (Fjn.Lb = function (n) { + return Q2(), Yx(n, 11).j == (Ikn(), qit); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Mb = function (n) { + return Q2(), Yx(n, 11).j == (Ikn(), qit); + }), + EF(gIn, "LPort/lambda$5$Type", 1289), + Wfn(29, 299, { 3: 1, 20: 1, 299: 1, 29: 1, 94: 1, 134: 1 }, qF), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Kc = function () { + return new pb(this.a); + }), + (Fjn.Ib = function () { + return "L_" + hJ(this.b.b, this, 0) + Gun(this.a); + }), + EF(gIn, "Layer", 29), + Wfn(1342, 1, {}, wv), + EF(OIn, AIn, 1342), + Wfn(1346, 1, {}, Xt), + (Fjn.Kb = function (n) { + return iun(Yx(n, 82)); + }), + EF(OIn, "ElkGraphImporter/0methodref$connectableShapeToNode$Type", 1346), + Wfn(1349, 1, {}, Wt), + (Fjn.Kb = function (n) { + return iun(Yx(n, 82)); + }), + EF(OIn, "ElkGraphImporter/1methodref$connectableShapeToNode$Type", 1349), + Wfn(1343, 1, PEn, dw), + (Fjn.td = function (n) { + vfn(this.a, Yx(n, 118)); + }), + EF(OIn, $In, 1343), + Wfn(1344, 1, PEn, gw), + (Fjn.td = function (n) { + vfn(this.a, Yx(n, 118)); + }), + EF(OIn, LIn, 1344), + Wfn(1345, 1, {}, Vt), + (Fjn.Kb = function (n) { + return new SR( + null, + new Nz( + (function (n) { + return !n.c && (n.c = new AN(Zrt, n, 5, 8)), n.c; + })(Yx(n, 79)), + 16, + ), + ); + }), + EF(OIn, NIn, 1345), + Wfn(1347, 1, YEn, pw), + (Fjn.Mb = function (n) { + return (function (n, t) { + return XZ(t, TG(n)); + })(this.a, Yx(n, 33)); + }), + EF(OIn, xIn, 1347), + Wfn(1348, 1, {}, Qt), + (Fjn.Kb = function (n) { + return new SR( + null, + new Nz( + (function (n) { + return !n.b && (n.b = new AN(Zrt, n, 4, 7)), n.b; + })(Yx(n, 79)), + 16, + ), + ); + }), + EF(OIn, "ElkGraphImporter/lambda$5$Type", 1348), + Wfn(1350, 1, YEn, vw), + (Fjn.Mb = function (n) { + return (function (n, t) { + return XZ(t, TG(n)); + })(this.a, Yx(n, 33)); + }), + EF(OIn, "ElkGraphImporter/lambda$7$Type", 1350), + Wfn(1351, 1, YEn, Yt), + (Fjn.Mb = function (n) { + return (function (n) { + return Whn(n) && ny(hL(jln(n, (gjn(), C1n)))); + })(Yx(n, 79)); + }), + EF(OIn, "ElkGraphImporter/lambda$8$Type", 1351), + Wfn(1278, 1, {}, Wh), + EF(OIn, "ElkGraphLayoutTransferrer", 1278), + Wfn(1279, 1, YEn, mw), + (Fjn.Mb = function (n) { + return (function (n, t) { + return UE(), !_3(t.d.i, n); + })(this.a, Yx(n, 17)); + }), + EF(OIn, "ElkGraphLayoutTransferrer/lambda$0$Type", 1279), + Wfn(1280, 1, PEn, yw), + (Fjn.td = function (n) { + UE(), eD(this.a, Yx(n, 17)); + }), + EF(OIn, "ElkGraphLayoutTransferrer/lambda$1$Type", 1280), + Wfn(1281, 1, YEn, kw), + (Fjn.Mb = function (n) { + return (function (n, t) { + return UE(), _3(t.d.i, n); + })(this.a, Yx(n, 17)); + }), + EF(OIn, "ElkGraphLayoutTransferrer/lambda$2$Type", 1281), + Wfn(1282, 1, PEn, jw), + (Fjn.td = function (n) { + UE(), eD(this.a, Yx(n, 17)); + }), + EF(OIn, "ElkGraphLayoutTransferrer/lambda$3$Type", 1282), + Wfn(1485, 1, dIn, Jt), + (Fjn.pf = function (n, t) { + !(function (n, t) { + run(t, DIn, 1), SE(WJ(new SR(null, new Nz(n.b, 16)), new Zt()), new ne()), Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "CommentNodeMarginCalculator", 1485), + Wfn(1486, 1, {}, Zt), + (Fjn.Kb = function (n) { + return new SR(null, new Nz(Yx(n, 29).a, 16)); + }), + EF(RIn, "CommentNodeMarginCalculator/lambda$0$Type", 1486), + Wfn(1487, 1, PEn, ne), + (Fjn.td = function (n) { + !(function (n) { + var t, i, r, c, a, u, o, s, h, f, l, b; + if (((o = n.d), (l = Yx(Aun(n, (Ojn(), JQn)), 15)), (t = Yx(Aun(n, QVn), 15)), l || t)) { + if (((a = ty(fL(pnn(n, (gjn(), A0n))))), (u = ty(fL(pnn(n, $0n)))), (b = 0), l)) { + for (h = 0, c = l.Kc(); c.Ob(); ) (r = Yx(c.Pb(), 10)), (h = e.Math.max(h, r.o.b)), (b += r.o.a); + (b += a * (l.gc() - 1)), (o.d += h + u); + } + if (((i = 0), t)) { + for (h = 0, c = t.Kc(); c.Ob(); ) (r = Yx(c.Pb(), 10)), (h = e.Math.max(h, r.o.b)), (i += r.o.a); + (i += a * (t.gc() - 1)), (o.a += h + u); + } + (s = e.Math.max(b, i)) > n.o.a && ((f = (s - n.o.a) / 2), (o.b = e.Math.max(o.b, f)), (o.c = e.Math.max(o.c, f))); + } + })(Yx(n, 10)); + }), + EF(RIn, "CommentNodeMarginCalculator/lambda$1$Type", 1487), + Wfn(1488, 1, dIn, te), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c, a, u, o; + for (run(t, "Comment post-processing", 1), c = new pb(n.b); c.a < c.c.c.length; ) { + for (r = Yx(Hz(c), 29), i = new ip(), u = new pb(r.a); u.a < u.c.c.length; ) + (a = Yx(Hz(u), 10)), + (o = Yx(Aun(a, (Ojn(), JQn)), 15)), + (e = Yx(Aun(a, QVn), 15)), + (o || e) && (lkn(a, o, e), o && S4(i, o), e && S4(i, e)); + S4(r.a, i); + } + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "CommentPostprocessor", 1488), + Wfn(1489, 1, dIn, ee), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g; + for (run(t, "Comment pre-processing", 1), e = 0, o = new pb(n.a); o.a < o.c.c.length; ) + if (ny(hL(Aun((u = Yx(Hz(o), 10)), (gjn(), KZn))))) { + for (++e, r = 0, i = null, s = null, w = new pb(u.j); w.a < w.c.c.length; ) + (r += (l = Yx(Hz(w), 11)).e.c.length + l.g.c.length), + 1 == l.e.c.length && (s = (i = Yx(TR(l.e, 0), 17)).c), + 1 == l.g.c.length && (s = (i = Yx(TR(l.g, 0), 17)).d); + if (1 != r || s.e.c.length + s.g.c.length != 1 || ny(hL(Aun(s.i, KZn)))) { + for (g = new ip(), b = new pb(u.j); b.a < b.c.c.length; ) { + for (f = new pb((l = Yx(Hz(b), 11)).g); f.a < f.c.c.length; ) + 0 == (h = Yx(Hz(f), 17)).d.g.c.length || (g.c[g.c.length] = h); + for (a = new pb(l.e); a.a < a.c.c.length; ) 0 == (c = Yx(Hz(a), 17)).c.e.c.length || (g.c[g.c.length] = c); + } + for (d = new pb(g); d.a < d.c.c.length; ) mvn(Yx(Hz(d), 17), !0); + } else zkn(u, i, s, s.i), z_(o); + } + t.n && LD(t, "Found " + e + " comment boxes"), Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "CommentPreprocessor", 1489), + Wfn(1490, 1, dIn, ie), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c, a; + for (run(t, "Constraints Postprocessor", 1), c = 0, r = new pb(n.b); r.a < r.c.c.length; ) { + for (a = 0, i = new pb(Yx(Hz(r), 29).a); i.a < i.c.c.length; ) + (e = Yx(Hz(i), 10)).k == (bon(), Hzn) && (b5(e, (gjn(), D1n), d9(c)), b5(e, t1n, d9(a)), ++a); + ++c; + } + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "ConstraintsPostprocessor", 1490), + Wfn(1491, 1, dIn, re), + (Fjn.pf = function (n, t) { + O3(Yx(n, 37), t); + }), + EF(RIn, "EdgeAndLayerConstraintEdgeReverser", 1491), + Wfn(1492, 1, dIn, ce), + (Fjn.pf = function (n, t) { + !(function (n, t) { + run(t, "End label post-processing", 1), SE(hH(WJ(new SR(null, new Nz(n.b, 16)), new ae()), new ue()), new oe()), Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "EndLabelPostprocessor", 1492), + Wfn(1493, 1, {}, ae), + (Fjn.Kb = function (n) { + return new SR(null, new Nz(Yx(n, 29).a, 16)); + }), + EF(RIn, "EndLabelPostprocessor/lambda$0$Type", 1493), + Wfn(1494, 1, YEn, ue), + (Fjn.Mb = function (n) { + return (function (n) { + return n.k == (bon(), Hzn) && O$(n, (Ojn(), cQn)); + })(Yx(n, 10)); + }), + EF(RIn, "EndLabelPostprocessor/lambda$1$Type", 1494), + Wfn(1495, 1, PEn, oe), + (Fjn.td = function (n) { + !(function (n) { + var t, e, i, r, c; + for (t = Yx(Aun(n, (Ojn(), cQn)), 83), c = n.n, i = t.Cc().Kc(); i.Ob(); ) + ((r = (e = Yx(i.Pb(), 306)).i).c += c.a), (r.d += c.b), e.c ? pdn(e) : vdn(e); + b5(n, cQn, null); + })(Yx(n, 10)); + }), + EF(RIn, "EndLabelPostprocessor/lambda$2$Type", 1495), + Wfn(1496, 1, dIn, se), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r; + run(t, "End label pre-processing", 1), + (e = ty(fL(Aun(n, (gjn(), D0n))))), + (i = ty(fL(Aun(n, F0n)))), + (r = bC(Yx(Aun(n, a1n), 103))), + SE(WJ(new SR(null, new Nz(n.b, 16)), new he()), new Mx(e, i, r)), + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "EndLabelPreprocessor", 1496), + Wfn(1497, 1, {}, he), + (Fjn.Kb = function (n) { + return new SR(null, new Nz(Yx(n, 29).a, 16)); + }), + EF(RIn, "EndLabelPreprocessor/lambda$0$Type", 1497), + Wfn(1498, 1, PEn, Mx), + (Fjn.td = function (n) { + fT(this.a, this.b, this.c, Yx(n, 10)); + }), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.c = !1), + EF(RIn, "EndLabelPreprocessor/lambda$1$Type", 1498), + Wfn(1499, 1, YEn, fe), + (Fjn.Mb = function (n) { + return iI(Aun(Yx(n, 70), (gjn(), f1n))) === iI((ZZ(), uet)); + }), + EF(RIn, "EndLabelPreprocessor/lambda$2$Type", 1499), + Wfn(1500, 1, PEn, Ew), + (Fjn.td = function (n) { + KD(this.a, Yx(n, 70)); + }), + EF(RIn, "EndLabelPreprocessor/lambda$3$Type", 1500), + Wfn(1501, 1, YEn, le), + (Fjn.Mb = function (n) { + return iI(Aun(Yx(n, 70), (gjn(), f1n))) === iI((ZZ(), aet)); + }), + EF(RIn, "EndLabelPreprocessor/lambda$4$Type", 1501), + Wfn(1502, 1, PEn, Tw), + (Fjn.td = function (n) { + KD(this.a, Yx(n, 70)); + }), + EF(RIn, "EndLabelPreprocessor/lambda$5$Type", 1502), + Wfn(1551, 1, dIn, Xh), + (Fjn.pf = function (n, t) { + !(function (n, t) { + run(t, "Sort end labels", 1), SE(hH(WJ(new SR(null, new Nz(n.b, 16)), new we()), new de()), new ge()), Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "EndLabelSorter", 1551), + Wfn(1552, 1, FMn, be), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i; + return 0 != (e = eO(n.a.c.p, t.a.c.p)) ? e : 0 != (i = eO(n.a.d.i.p, t.a.d.i.p)) ? i : eO(t.a.d.p, n.a.d.p); + })(Yx(n, 456), Yx(t, 456)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(RIn, "EndLabelSorter/1", 1552), + Wfn(456, 1, { 456: 1 }, zH), + EF(RIn, "EndLabelSorter/LabelGroup", 456), + Wfn(1553, 1, {}, we), + (Fjn.Kb = function (n) { + return QE(), new SR(null, new Nz(Yx(n, 29).a, 16)); + }), + EF(RIn, "EndLabelSorter/lambda$0$Type", 1553), + Wfn(1554, 1, YEn, de), + (Fjn.Mb = function (n) { + return QE(), Yx(n, 10).k == (bon(), Hzn); + }), + EF(RIn, "EndLabelSorter/lambda$1$Type", 1554), + Wfn(1555, 1, PEn, ge), + (Fjn.td = function (n) { + !(function (n) { + var t, e, i, r; + if (((t = !1), O$(n, (Ojn(), cQn)))) + for (e = Yx(Aun(n, cQn), 83), r = new pb(n.j); r.a < r.c.c.length; ) + ebn((i = Yx(Hz(r), 11))) && (t || (khn(dB(n)), (t = !0)), ten(Yx(e.xc(i), 306))); + })(Yx(n, 10)); + }), + EF(RIn, "EndLabelSorter/lambda$2$Type", 1555), + Wfn(1556, 1, YEn, pe), + (Fjn.Mb = function (n) { + return QE(), iI(Aun(Yx(n, 70), (gjn(), f1n))) === iI((ZZ(), aet)); + }), + EF(RIn, "EndLabelSorter/lambda$3$Type", 1556), + Wfn(1557, 1, YEn, ve), + (Fjn.Mb = function (n) { + return QE(), iI(Aun(Yx(n, 70), (gjn(), f1n))) === iI((ZZ(), uet)); + }), + EF(RIn, "EndLabelSorter/lambda$4$Type", 1557), + Wfn(1503, 1, dIn, me), + (Fjn.pf = function (n, t) { + Tmn(this, Yx(n, 37)); + }), + (Fjn.b = 0), + (Fjn.c = 0), + EF(RIn, "FinalSplineBendpointsCalculator", 1503), + Wfn(1504, 1, {}, ye), + (Fjn.Kb = function (n) { + return new SR(null, new Nz(Yx(n, 29).a, 16)); + }), + EF(RIn, "FinalSplineBendpointsCalculator/lambda$0$Type", 1504), + Wfn(1505, 1, {}, ke), + (Fjn.Kb = function (n) { + return new SR(null, new nF(new $K(bA(o7(Yx(n, 10)).a.Kc(), new h())))); + }), + EF(RIn, "FinalSplineBendpointsCalculator/lambda$1$Type", 1505), + Wfn(1506, 1, YEn, je), + (Fjn.Mb = function (n) { + return !ZW(Yx(n, 17)); + }), + EF(RIn, "FinalSplineBendpointsCalculator/lambda$2$Type", 1506), + Wfn(1507, 1, YEn, Ee), + (Fjn.Mb = function (n) { + return O$(Yx(n, 17), (Ojn(), WQn)); + }), + EF(RIn, "FinalSplineBendpointsCalculator/lambda$3$Type", 1507), + Wfn(1508, 1, PEn, Mw), + (Fjn.td = function (n) { + !(function (n, t) { + var e, i, r, c, a; + if (!t.e) { + for (t.e = !0, i = t.d.a.ec().Kc(); i.Ob(); ) + (e = Yx(i.Pb(), 17)), + t.o && t.d.a.gc() <= 1 + ? ((a = new QS((c = t.a.c) + (t.a.c + t.a.b - c) / 2, t.b)), KD(Yx(t.d.a.ec().Kc().Pb(), 17).a, a)) + : (r = Yx(BF(t.c, e), 459)).b || r.c + ? Pgn(n, e, t) + : n.d == ($6(), v3n) && (r.d || r.e) && Efn(n, t) && t.d.a.gc() <= 1 + ? Yyn(e, t) + : mdn(n, e, t); + t.k && XW(t.d, new Te()); + } + })(this.a, Yx(n, 128)); + }), + EF(RIn, "FinalSplineBendpointsCalculator/lambda$4$Type", 1508), + Wfn(1509, 1, PEn, Te), + (Fjn.td = function (n) { + Dsn(Yx(n, 17).a); + }), + EF(RIn, "FinalSplineBendpointsCalculator/lambda$5$Type", 1509), + Wfn(792, 1, dIn, Sw), + (Fjn.pf = function (n, t) { + !(function (n, t, e) { + var i, r; + for (run(e, "Graph transformation (" + n.a + ")", 1), r = Xz(t.a), i = new pb(t.b); i.a < i.c.c.length; ) + S4(r, Yx(Hz(i), 29).a); + if (Yx(Aun(t, (gjn(), u1n)), 419) == (fZ(), FWn)) + switch (Yx(Aun(t, a1n), 103).g) { + case 2: + rX(t, r); + break; + case 3: + Pnn(t, r); + break; + case 4: + n.a == (g2(), iUn) ? (Pnn(t, r), iX(t, r)) : (iX(t, r), Pnn(t, r)); + } + else if (n.a == (g2(), iUn)) + switch (Yx(Aun(t, a1n), 103).g) { + case 2: + rX(t, r), iX(t, r); + break; + case 3: + Pnn(t, r), rX(t, r); + break; + case 4: + rX(t, r), Pnn(t, r); + } + else + switch (Yx(Aun(t, a1n), 103).g) { + case 2: + rX(t, r), iX(t, r); + break; + case 3: + rX(t, r), Pnn(t, r); + break; + case 4: + Pnn(t, r), rX(t, r); + } + Ron(e); + })(this, Yx(n, 37), t); + }), + EF(RIn, "GraphTransformer", 792), + Wfn(511, 22, { 3: 1, 35: 1, 22: 1, 511: 1 }, pM); + var cUn, + aUn, + uUn, + oUn = X1( + RIn, + "GraphTransformer/Mode", + 511, + u_n, + function () { + return g2(), x4(Gy(oUn, 1), XEn, 511, 0, [iUn, eUn]); + }, + function (n) { + return g2(), rZ((SW(), cUn), n); + }, + ); + Wfn(1510, 1, dIn, Me), + (Fjn.pf = function (n, t) { + lwn(Yx(n, 37), t); + }), + EF(RIn, "HierarchicalNodeResizingProcessor", 1510), + Wfn(1511, 1, dIn, Se), + (Fjn.pf = function (n, t) { + i2(Yx(n, 37), t); + }), + EF(RIn, "HierarchicalPortConstraintProcessor", 1511), + Wfn(1512, 1, FMn, Pe), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i, r, c; + return ( + (r = n.k), + (e = ty(fL(Aun(n, (Ojn(), KQn))))), + (c = t.k), + (i = ty(fL(Aun(t, KQn)))), + c != (bon(), _zn) ? -1 : r != _zn ? 1 : e == i ? 0 : e < i ? -1 : 1 + ); + })(Yx(n, 10), Yx(t, 10)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(RIn, "HierarchicalPortConstraintProcessor/NodeComparator", 1512), + Wfn(1513, 1, dIn, Ie), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c, a, u, o, s; + for ( + run(t, "Hierarchical port dummy size processing", 1), + u = new ip(), + s = new ip(), + e = 2 * ty(fL(Aun(n, (gjn(), x0n)))), + r = new pb(n.b); + r.a < r.c.c.length; + + ) { + for ( + i = Yx(Hz(r), 29), u.c = VQ(UKn, iEn, 1, 0, 5, 1), s.c = VQ(UKn, iEn, 1, 0, 5, 1), a = new pb(i.a); + a.a < a.c.c.length; + + ) + (c = Yx(Hz(a), 10)).k == (bon(), _zn) && + ((o = Yx(Aun(c, (Ojn(), hQn)), 61)) == (Ikn(), Tit) ? (u.c[u.c.length] = c) : o == Bit && (s.c[s.c.length] = c)); + Ofn(u, !0, e), Ofn(s, !1, e); + } + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "HierarchicalPortDummySizeProcessor", 1513), + Wfn(1514, 1, dIn, Ce), + (Fjn.pf = function (n, t) { + Cdn(this, Yx(n, 37), t); + }), + (Fjn.a = 0), + EF(RIn, "HierarchicalPortOrthogonalEdgeRouter", 1514), + Wfn(1515, 1, FMn, Oe), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return $9(n.n.a, t.n.a); + })(Yx(n, 10), Yx(t, 10)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(RIn, "HierarchicalPortOrthogonalEdgeRouter/1", 1515), + Wfn(1516, 1, FMn, Ae), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return $9(ty(fL(Aun(n, (Ojn(), KQn)))), ty(fL(Aun(t, KQn)))); + })(Yx(n, 10), Yx(t, 10)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(RIn, "HierarchicalPortOrthogonalEdgeRouter/2", 1516), + Wfn(1517, 1, dIn, $e), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e; + run(t, "Hierarchical port position processing", 1), + (e = n.b).c.length > 0 && Jgn(($z(0, e.c.length), Yx(e.c[0], 29)), n), + e.c.length > 1 && Jgn(Yx(TR(e, e.c.length - 1), 29), n), + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "HierarchicalPortPositionProcessor", 1517), + Wfn(1518, 1, dIn, Vh), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var i, r, c, a, u, o, s, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M; + for ( + n.b = t, n.a = Yx(Aun(t, (gjn(), T1n)), 19).a, n.c = Yx(Aun(t, S1n), 19).a, 0 == n.c && (n.c = Yjn), g = new JU(t.b, 0); + g.b < g.d.gc(); + + ) { + for ( + S$(g.b < g.d.gc()), d = Yx(g.d.Xb((g.c = g.b++)), 29), o = new ip(), l = -1, y = -1, m = new pb(d.a); + m.a < m.c.c.length; + + ) + (v = Yx(Hz(m), 10)), + FX((Ax(), new $K(bA(a7(v).a.Kc(), new h())))) >= n.a && + ((r = Nvn(n, v)), (l = e.Math.max(l, r.b)), (y = e.Math.max(y, r.d)), eD(o, new mP(v, r))); + for (E = new ip(), f = 0; f < l; ++f) + ZR(E, 0, (S$(g.b > 0), g.a.Xb((g.c = --g.b)), ZL(g, (T = new qF(n.b))), S$(g.b < g.d.gc()), g.d.Xb((g.c = g.b++)), T)); + for (u = new pb(o); u.a < u.c.c.length; ) + if (((c = Yx(Hz(u), 46)), (w = Yx(c.b, 571).a))) for (b = new pb(w); b.a < b.c.c.length; ) Vrn(n, Yx(Hz(b), 10), aUn, E); + for (i = new ip(), s = 0; s < y; ++s) eD(i, (ZL(g, (M = new qF(n.b))), M)); + for (a = new pb(o); a.a < a.c.c.length; ) + if (((c = Yx(Hz(a), 46)), (j = Yx(c.b, 571).c))) for (k = new pb(j); k.a < k.c.c.length; ) Vrn(n, Yx(Hz(k), 10), uUn, i); + } + for (p = new JU(t.b, 0); p.b < p.d.gc(); ) S$(p.b < p.d.gc()), 0 == Yx(p.d.Xb((p.c = p.b++)), 29).a.c.length && hB(p); + })(this, Yx(n, 37)); + }), + (Fjn.a = 0), + (Fjn.c = 0), + EF(RIn, "HighDegreeNodeLayeringProcessor", 1518), + Wfn(571, 1, { 571: 1 }, Le), + (Fjn.b = -1), + (Fjn.d = -1), + EF(RIn, "HighDegreeNodeLayeringProcessor/HighDegreeNodeInformation", 571), + Wfn(1519, 1, {}, Ne), + (Fjn.Kb = function (n) { + return Ax(), u7(Yx(n, 10)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + EF(RIn, "HighDegreeNodeLayeringProcessor/lambda$0$Type", 1519), + Wfn(1520, 1, {}, xe), + (Fjn.Kb = function (n) { + return Ax(), o7(Yx(n, 10)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + EF(RIn, "HighDegreeNodeLayeringProcessor/lambda$1$Type", 1520), + Wfn(1526, 1, dIn, De), + (Fjn.pf = function (n, t) { + Hpn(this, Yx(n, 37), t); + }), + EF(RIn, "HyperedgeDummyMerger", 1526), + Wfn(793, 1, {}, Sx), + (Fjn.a = !1), + (Fjn.b = !1), + (Fjn.c = !1), + EF(RIn, "HyperedgeDummyMerger/MergeState", 793), + Wfn(1527, 1, {}, Re), + (Fjn.Kb = function (n) { + return new SR(null, new Nz(Yx(n, 29).a, 16)); + }), + EF(RIn, "HyperedgeDummyMerger/lambda$0$Type", 1527), + Wfn(1528, 1, {}, Ke), + (Fjn.Kb = function (n) { + return new SR(null, new Nz(Yx(n, 10).j, 16)); + }), + EF(RIn, "HyperedgeDummyMerger/lambda$1$Type", 1528), + Wfn(1529, 1, PEn, _e), + (Fjn.td = function (n) { + Yx(n, 11).p = -1; + }), + EF(RIn, "HyperedgeDummyMerger/lambda$2$Type", 1529), + Wfn(1530, 1, dIn, Fe), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c, a, u, o, s; + for (run(t, "Hypernodes processing", 1), i = new pb(n.b); i.a < i.c.c.length; ) + for (a = new pb(Yx(Hz(i), 29).a); a.a < a.c.c.length; ) + if (ny(hL(Aun((c = Yx(Hz(a), 10)), (gjn(), P1n)))) && c.j.c.length <= 2) { + for (s = 0, o = 0, e = 0, r = 0, u = new pb(c.j); u.a < u.c.c.length; ) + switch (Yx(Hz(u), 11).j.g) { + case 1: + ++s; + break; + case 2: + ++o; + break; + case 3: + ++e; + break; + case 4: + ++r; + } + 0 == s && 0 == e && tjn(n, c, r <= o); + } + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "HypernodesProcessor", 1530), + Wfn(1531, 1, dIn, Be), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c, a, u, o, s, h; + for (run(t, "Layer constraint edge reversal", 1), a = new pb(n.b); a.a < a.c.c.length; ) { + for (c = Yx(Hz(a), 29), h = -1, e = new ip(), s = OU(c.a), r = 0; r < s.length; r++) + (i = Yx(Aun(s[r], (Ojn(), pQn)), 303)), + -1 == h ? i != (AJ(), HVn) && (h = r) : i == (AJ(), HVn) && (JG(s[r], null), Hrn(s[r], h++, c)), + i == (AJ(), FVn) && eD(e, s[r]); + for (o = new pb(e); o.a < o.c.c.length; ) JG((u = Yx(Hz(o), 10)), null), JG(u, c); + } + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "InLayerConstraintProcessor", 1531), + Wfn(1532, 1, dIn, He), + (Fjn.pf = function (n, t) { + !(function (n, t) { + run(t, DIn, 1), + R7( + (function (n) { + return (n.b = !1), n; + })(new Qb((qE(), new dH(n, !1, !1, new Ft())))), + ), + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "InnermostNodeMarginCalculator", 1532), + Wfn(1533, 1, dIn, qe), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var i, r, c, a, u, o; + if (Yx(Aun(t, (Ojn(), bQn)), 21).Hc((edn(), SVn))) { + for (o = new pb(t.a); o.a < o.c.c.length; ) + (a = Yx(Hz(o), 10)).k == (bon(), Hzn) && + ((c = Yx(Aun(a, (gjn(), H1n)), 142)), + (n.c = e.Math.min(n.c, a.n.a - c.b)), + (n.a = e.Math.max(n.a, a.n.a + a.o.a + c.c)), + (n.d = e.Math.min(n.d, a.n.b - c.d)), + (n.b = e.Math.max(n.b, a.n.b + a.o.b + c.a))); + for (u = new pb(t.a); u.a < u.c.c.length; ) + if ((a = Yx(Hz(u), 10)).k != (bon(), Hzn)) + switch (a.k.g) { + case 2: + if ((r = Yx(Aun(a, (gjn(), x1n)), 163)) == (d7(), nYn)) { + (a.n.a = n.c - 10), qrn(a, new Ge()).Jb(new Pw(a)); + break; + } + if (r == eYn) { + (a.n.a = n.a + 10), qrn(a, new ze()).Jb(new Iw(a)); + break; + } + if ((i = Yx(Aun(a, pQn), 303)) == (AJ(), HVn)) { + Gmn(a).Jb(new Cw(a)), (a.n.b = n.d - 10); + break; + } + if (i == FVn) { + Gmn(a).Jb(new Ow(a)), (a.n.b = n.b + 10); + break; + } + break; + default: + throw hp(new Qm("The node type " + a.k + " is not supported by the " + lXn)); + } + } + })(this, Yx(n, 37)); + }), + (Fjn.a = ZTn), + (Fjn.b = ZTn), + (Fjn.c = JTn), + (Fjn.d = JTn); + var sUn, + hUn, + fUn, + lUn, + bUn, + wUn, + dUn, + gUn, + pUn, + vUn, + mUn, + yUn, + kUn, + jUn, + EUn, + TUn, + MUn, + SUn, + PUn, + IUn, + CUn, + OUn, + AUn, + $Un, + LUn, + NUn, + xUn, + DUn, + RUn, + KUn, + _Un, + FUn, + BUn, + HUn, + qUn, + GUn, + zUn, + UUn, + XUn, + WUn, + VUn, + QUn, + YUn, + JUn, + ZUn, + nXn, + tXn, + eXn, + iXn, + rXn, + cXn, + aXn, + uXn, + oXn, + sXn, + hXn, + fXn, + lXn = EF(RIn, "InteractiveExternalPortPositioner", 1533); + Wfn(1534, 1, {}, Ge), + (Fjn.Kb = function (n) { + return Yx(n, 17).d.i; + }), + (Fjn.Fb = function (n) { + return this === n; + }), + EF(RIn, "InteractiveExternalPortPositioner/lambda$0$Type", 1534), + Wfn(1535, 1, {}, Pw), + (Fjn.Kb = function (n) { + return (function (n, t) { + return (n.n.b = (vB(t), t)); + })(this.a, fL(n)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + EF(RIn, "InteractiveExternalPortPositioner/lambda$1$Type", 1535), + Wfn(1536, 1, {}, ze), + (Fjn.Kb = function (n) { + return Yx(n, 17).c.i; + }), + (Fjn.Fb = function (n) { + return this === n; + }), + EF(RIn, "InteractiveExternalPortPositioner/lambda$2$Type", 1536), + Wfn(1537, 1, {}, Iw), + (Fjn.Kb = function (n) { + return (function (n, t) { + return (n.n.b = (vB(t), t)); + })(this.a, fL(n)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + EF(RIn, "InteractiveExternalPortPositioner/lambda$3$Type", 1537), + Wfn(1538, 1, {}, Cw), + (Fjn.Kb = function (n) { + return (function (n, t) { + return (n.n.a = (vB(t), t + 10)); + })(this.a, fL(n)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + EF(RIn, "InteractiveExternalPortPositioner/lambda$4$Type", 1538), + Wfn(1539, 1, {}, Ow), + (Fjn.Kb = function (n) { + return (function (n, t) { + return (n.n.a = (vB(t), t + 10)); + })(this.a, fL(n)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + EF(RIn, "InteractiveExternalPortPositioner/lambda$5$Type", 1539), + Wfn(77, 22, { 3: 1, 35: 1, 22: 1, 77: 1, 234: 1 }, vM), + (Fjn.Kf = function () { + switch (this.g) { + case 15: + return new dc(); + case 22: + return new gc(); + case 47: + return new mc(); + case 28: + case 35: + return new ei(); + case 32: + return new Jt(); + case 42: + return new te(); + case 1: + return new ee(); + case 41: + return new ie(); + case 56: + return new Sw((g2(), iUn)); + case 0: + return new Sw((g2(), eUn)); + case 2: + return new re(); + case 54: + return new ce(); + case 33: + return new se(); + case 51: + return new me(); + case 55: + return new Me(); + case 13: + return new Se(); + case 38: + return new Ie(); + case 44: + return new Ce(); + case 40: + return new $e(); + case 9: + return new Vh(); + case 49: + return new s$(); + case 37: + return new De(); + case 43: + return new Fe(); + case 27: + return new Be(); + case 30: + return new He(); + case 3: + return new qe(); + case 18: + return new Xe(); + case 29: + return new We(); + case 5: + return new Qh(); + case 50: + return new Ue(); + case 34: + return new Yh(); + case 36: + return new ii(); + case 52: + return new Xh(); + case 11: + return new ci(); + case 7: + return new Zh(); + case 39: + return new ai(); + case 45: + return new ui(); + case 16: + return new oi(); + case 10: + return new si(); + case 48: + return new fi(); + case 21: + return new li(); + case 23: + return new zm((l0(), z3n)); + case 8: + return new wi(); + case 12: + return new gi(); + case 4: + return new pi(); + case 19: + return new rf(); + case 17: + return new Pi(); + case 53: + return new Ii(); + case 6: + return new Bi(); + case 25: + return new mv(); + case 46: + return new Ni(); + case 31: + return new hN(); + case 14: + return new Vi(); + case 26: + return new Sc(); + case 20: + return new nr(); + case 24: + return new zm((l0(), U3n)); + default: + throw hp(new Qm(FIn + (null != this.f ? this.f : "" + this.g))); + } + }); + var bXn, + wXn, + dXn, + gXn, + pXn, + vXn, + mXn, + yXn, + kXn = X1(RIn, BIn, 77, u_n, Gbn, function (n) { + return $jn(), rZ((NI(), bXn), n); + }); + Wfn(1540, 1, dIn, Xe), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g; + for (run(t, "Inverted port preprocessing", 1), u = new JU(n.b, 0), e = null, g = new ip(); u.b < u.d.gc(); ) { + for (d = e, S$(u.b < u.d.gc()), e = Yx(u.d.Xb((u.c = u.b++)), 29), h = new pb(g); h.a < h.c.c.length; ) + JG((o = Yx(Hz(h), 10)), d); + for (g.c = VQ(UKn, iEn, 1, 0, 5, 1), f = new pb(e.a); f.a < f.c.c.length; ) + if ((o = Yx(Hz(f), 10)).k == (bon(), Hzn) && dC(Yx(Aun(o, (gjn(), g0n)), 98))) { + for (w = Ddn(o, (h0(), e3n), (Ikn(), Eit)).Kc(); w.Ob(); ) + for ( + l = Yx(w.Pb(), 11), r = 0, c = (i = Yx(Htn((a = l.e), VQ(Nzn, yIn, 17, a.c.length, 0, 1)), 474)).length; + r < c; + ++r + ) + qvn(n, l, i[r], g); + for (b = Ddn(o, i3n, qit).Kc(); b.Ob(); ) + for ( + l = Yx(b.Pb(), 11), r = 0, c = (i = Yx(Htn((a = l.g), VQ(Nzn, yIn, 17, a.c.length, 0, 1)), 474)).length; + r < c; + ++r + ) + Hvn(n, l, i[r], g); + } + } + for (s = new pb(g); s.a < s.c.c.length; ) JG((o = Yx(Hz(s), 10)), e); + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "InvertedPortProcessor", 1540), + Wfn(1541, 1, dIn, We), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c; + if ( + (run(t, "Node and Port Label Placement and Node Sizing", 1), + LC((qE(), new dH(n, !0, !0, new Ve()))), + Yx(Aun(n, (Ojn(), bQn)), 21).Hc((edn(), SVn))) + ) + for ( + i = (r = Yx(Aun(n, (gjn(), m0n)), 21)).Hc((Chn(), vit)), c = ny(hL(Aun(n, y0n))), e = new pb(n.b); + e.a < e.c.c.length; + + ) + SE(hH(new SR(null, new Nz(Yx(Hz(e), 29).a, 16)), new Qe()), new Px(r, i, c)); + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "LabelAndNodeSizeProcessor", 1541), + Wfn(1542, 1, YEn, Ve), + (Fjn.Mb = function (n) { + return Yx(n, 10).k == (bon(), Hzn); + }), + EF(RIn, "LabelAndNodeSizeProcessor/lambda$0$Type", 1542), + Wfn(1543, 1, YEn, Qe), + (Fjn.Mb = function (n) { + return Yx(n, 10).k == (bon(), _zn); + }), + EF(RIn, "LabelAndNodeSizeProcessor/lambda$1$Type", 1543), + Wfn(1544, 1, PEn, Px), + (Fjn.td = function (n) { + lT(this.b, this.a, this.c, Yx(n, 10)); + }), + (Fjn.a = !1), + (Fjn.c = !1), + EF(RIn, "LabelAndNodeSizeProcessor/lambda$2$Type", 1544), + Wfn(1545, 1, dIn, Qh), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var i, r, c, a, u, o, s, f, l, b, w, d, g; + for ( + run(t, "Label dummy insertions", 1), + b = new ip(), + u = ty(fL(Aun(n, (gjn(), D0n)))), + f = ty(fL(Aun(n, F0n))), + l = Yx(Aun(n, a1n), 103), + w = new pb(n.a); + w.a < w.c.c.length; + + ) + for (a = new $K(bA(o7(Yx(Hz(w), 10)).a.Kc(), new h())); Vfn(a); ) + if ((c = Yx(kV(a), 17)).c.i != c.d.i && MO(c.b, wXn)) { + for ( + i = ubn(n, c, (g = GZ(c)), (d = h$(c.b.c.length))), b.c[b.c.length] = i, r = i.o, o = new JU(c.b, 0); + o.b < o.d.gc(); + + ) + S$(o.b < o.d.gc()), + iI(Aun((s = Yx(o.d.Xb((o.c = o.b++)), 70)), f1n)) === iI((ZZ(), cet)) && + (l == (t9(), eet) || l == Jtt + ? ((r.a += s.o.a + f), (r.b = e.Math.max(r.b, s.o.b))) + : ((r.a = e.Math.max(r.a, s.o.a)), (r.b += s.o.b + f)), + (d.c[d.c.length] = s), + hB(o)); + l == (t9(), eet) || l == Jtt ? ((r.a -= f), (r.b += u + g)) : (r.b += u - f + g); + } + S4(n.a, b), Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "LabelDummyInserter", 1545), + Wfn(1546, 1, rSn, Ye), + (Fjn.Lb = function (n) { + return iI(Aun(Yx(n, 70), (gjn(), f1n))) === iI((ZZ(), cet)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Mb = function (n) { + return iI(Aun(Yx(n, 70), (gjn(), f1n))) === iI((ZZ(), cet)); + }), + EF(RIn, "LabelDummyInserter/1", 1546), + Wfn(1547, 1, dIn, Ue), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b; + for ( + run(t, "Label dummy removal", 1), + i = ty(fL(Aun(n, (gjn(), D0n)))), + r = ty(fL(Aun(n, F0n))), + o = Yx(Aun(n, a1n), 103), + u = new pb(n.b); + u.a < u.c.c.length; + + ) + for (h = new JU(Yx(Hz(u), 29).a, 0); h.b < h.d.gc(); ) + S$(h.b < h.d.gc()), + (s = Yx(h.d.Xb((h.c = h.b++)), 10)).k == (bon(), Fzn) && + ((f = Yx(Aun(s, (Ojn(), CQn)), 17)), + (b = ty(fL(Aun(f, y1n)))), + (a = iI(Aun(s, kQn)) === iI((Frn(), Ket))), + (e = new fC(s.n)), + a && (e.b += b + i), + (c = new QS(s.o.a, s.o.b - b - i)), + (l = Yx(Aun(s, BQn), 15)), + o == (t9(), eet) || o == Jtt ? wdn(l, e, r, c, a, o) : g8(l, e, r, c), + S4(f.b, l), + lyn(s, iI(Aun(n, b1n)) === iI((g7(), fet))), + hB(h)); + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "LabelDummyRemover", 1547), + Wfn(1548, 1, YEn, Je), + (Fjn.Mb = function (n) { + return ny(hL(Aun(Yx(n, 70), (gjn(), h1n)))); + }), + EF(RIn, "LabelDummyRemover/lambda$0$Type", 1548), + Wfn(1359, 1, dIn, Yh), + (Fjn.pf = function (n, t) { + Syn(this, Yx(n, 37), t); + }), + (Fjn.a = null), + EF(RIn, "LabelDummySwitcher", 1359), + Wfn(286, 1, { 286: 1 }, vgn), + (Fjn.c = 0), + (Fjn.d = null), + (Fjn.f = 0), + EF(RIn, "LabelDummySwitcher/LabelDummyInfo", 286), + Wfn(1360, 1, {}, Ze), + (Fjn.Kb = function (n) { + return m2(), new SR(null, new Nz(Yx(n, 29).a, 16)); + }), + EF(RIn, "LabelDummySwitcher/lambda$0$Type", 1360), + Wfn(1361, 1, YEn, ni), + (Fjn.Mb = function (n) { + return m2(), Yx(n, 10).k == (bon(), Fzn); + }), + EF(RIn, "LabelDummySwitcher/lambda$1$Type", 1361), + Wfn(1362, 1, {}, Lw), + (Fjn.Kb = function (n) { + return (function (n, t) { + return m2(), new vgn(t, n); + })(this.a, Yx(n, 10)); + }), + EF(RIn, "LabelDummySwitcher/lambda$2$Type", 1362), + Wfn(1363, 1, PEn, Nw), + (Fjn.td = function (n) { + !(function (n, t) { + m2(), Yx(GB(n, t.d), 15).Fc(t); + })(this.a, Yx(n, 286)); + }), + EF(RIn, "LabelDummySwitcher/lambda$3$Type", 1363), + Wfn(1364, 1, FMn, ti), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return m2(), $9(t.a.o.a, n.a.o.a); + })(Yx(n, 286), Yx(t, 286)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(RIn, "LabelDummySwitcher/lambda$4$Type", 1364), + Wfn(791, 1, dIn, ei), + (Fjn.pf = function (n, t) { + !(function (n, t) { + run(t, "Label management", 1), dI(Aun(n, (tQ(), K7n))), Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "LabelManagementProcessor", 791), + Wfn(1549, 1, dIn, ii), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e; + switch ((run(t, "Label side selection (" + (e = Yx(Aun(n, (gjn(), l1n)), 276)) + ")", 1), e.g)) { + case 0: + iln(n, (Frn(), Ret)); + break; + case 1: + iln(n, (Frn(), Ket)); + break; + case 2: + Mvn(n, (Frn(), Ret)); + break; + case 3: + Mvn(n, (Frn(), Ket)); + break; + case 4: + Jwn(n, (Frn(), Ret)); + break; + case 5: + Jwn(n, (Frn(), Ket)); + } + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "LabelSideSelector", 1549), + Wfn(1550, 1, YEn, ri), + (Fjn.Mb = function (n) { + return ny(hL(Aun(Yx(n, 70), (gjn(), h1n)))); + }), + EF(RIn, "LabelSideSelector/lambda$0$Type", 1550), + Wfn(1558, 1, dIn, ci), + (Fjn.pf = function (n, t) { + Dvn(Yx(n, 37), t); + }), + EF(RIn, "LayerConstraintPostprocessor", 1558), + Wfn(1559, 1, dIn, Zh), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r; + for (run(t, "Layer constraint preprocessing", 1), e = new ip(), r = new JU(n.a, 0); r.b < r.d.gc(); ) + S$(r.b < r.d.gc()), Z4((i = Yx(r.d.Xb((r.c = r.b++)), 10))) && (qan(i), (e.c[e.c.length] = i), hB(r)); + 0 == e.c.length || b5(n, (Ojn(), wQn), e), Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "LayerConstraintPreprocessor", 1559), + Wfn(360, 22, { 3: 1, 35: 1, 22: 1, 360: 1 }, mM); + var jXn, + EXn, + TXn, + MXn, + SXn, + PXn, + IXn, + CXn, + OXn, + AXn = X1( + RIn, + "LayerConstraintPreprocessor/HiddenNodeConnections", + 360, + u_n, + function () { + return R4(), x4(Gy(AXn, 1), XEn, 360, 0, [yXn, vXn, mXn, pXn]); + }, + function (n) { + return R4(), rZ((VY(), jXn), n); + }, + ); + Wfn(1560, 1, dIn, ai), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g; + for (run(t, "Layer size calculation", 1), f = JTn, h = ZTn, c = !1, o = new pb(n.b); o.a < o.c.c.length; ) + if ((((s = (u = Yx(Hz(o), 29)).c).a = 0), (s.b = 0), 0 != u.a.c.length)) { + for (c = !0, b = new pb(u.a); b.a < b.c.c.length; ) + (d = (l = Yx(Hz(b), 10)).o), (w = l.d), (s.a = e.Math.max(s.a, d.a + w.b + w.c)); + (g = (r = Yx(TR(u.a, 0), 10)).n.b - r.d.d), + r.k == (bon(), _zn) && (g -= Yx(Aun(n, (gjn(), X0n)), 142).d), + (i = (a = Yx(TR(u.a, u.a.c.length - 1), 10)).n.b + a.o.b + a.d.a), + a.k == _zn && (i += Yx(Aun(n, (gjn(), X0n)), 142).a), + (s.b = i - g), + (f = e.Math.min(f, g)), + (h = e.Math.max(h, i)); + } + c || ((f = 0), (h = 0)), (n.f.b = h - f), (n.c.b -= f), Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "LayerSizeAndGraphHeightCalculator", 1560), + Wfn(1561, 1, dIn, ui), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c; + for (run(t, "Edge joining", 1), e = ny(hL(Aun(n, (gjn(), Q0n)))), i = new pb(n.b); i.a < i.c.c.length; ) + for (c = new JU(Yx(Hz(i), 29).a, 0); c.b < c.d.gc(); ) + S$(c.b < c.d.gc()), (r = Yx(c.d.Xb((c.c = c.b++)), 10)).k == (bon(), Bzn) && (lyn(r, e), hB(c)); + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "LongEdgeJoiner", 1561), + Wfn(1562, 1, dIn, oi), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c, a, u, o, s, h; + if ((run(t, "Edge splitting", 1), n.b.c.length <= 2)) Ron(t); + else { + for (S$((c = new JU(n.b, 0)).b < c.d.gc()), a = Yx(c.d.Xb((c.c = c.b++)), 29); c.b < c.d.gc(); ) + for (r = a, S$(c.b < c.d.gc()), a = Yx(c.d.Xb((c.c = c.b++)), 29), u = new pb(r.a); u.a < u.c.c.length; ) + for (o = new pb(Yx(Hz(u), 10).j); o.a < o.c.c.length; ) + for (i = new pb(Yx(Hz(o), 11).g); i.a < i.c.c.length; ) + (s = (e = Yx(Hz(i), 17)).d.i.c) != r && + s != a && + Bwn( + e, + (Al((h = new rin(n)), (bon(), Bzn)), b5(h, (Ojn(), CQn), e), b5(h, (gjn(), g0n), (Ran(), oit)), JG(h, a), h), + ); + Ron(t); + } + })(Yx(n, 37), t); + }), + EF(RIn, "LongEdgeSplitter", 1562), + Wfn(1563, 1, dIn, si), + (Fjn.pf = function (n, t) { + Iyn(this, Yx(n, 37), t); + }), + (Fjn.d = 0), + (Fjn.e = 0), + (Fjn.i = 0), + (Fjn.j = 0), + (Fjn.k = 0), + (Fjn.n = 0), + EF(RIn, "NodePromotion", 1563), + Wfn(1564, 1, {}, hi), + (Fjn.Kb = function (n) { + return Yx(n, 46), TA(), !0; + }), + (Fjn.Fb = function (n) { + return this === n; + }), + EF(RIn, "NodePromotion/lambda$0$Type", 1564), + Wfn(1565, 1, {}, Aw), + (Fjn.Kb = function (n) { + return (function (n, t) { + return TA(), Yx(t.b, 19).a < n; + })(this.a, Yx(n, 46)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.a = 0), + EF(RIn, "NodePromotion/lambda$1$Type", 1565), + Wfn(1566, 1, {}, $w), + (Fjn.Kb = function (n) { + return (function (n, t) { + return TA(), Yx(t.a, 19).a < n; + })(this.a, Yx(n, 46)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.a = 0), + EF(RIn, "NodePromotion/lambda$2$Type", 1566), + Wfn(1567, 1, dIn, fi), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m; + for (run(t, zIn, 1), l = Yx(Aun(n, (gjn(), b1n)), 218), i = new pb(n.b); i.a < i.c.c.length; ) + for (a = 0, u = (c = OU(Yx(Hz(i), 29).a)).length; a < u; ++a) + if ((r = c[a]).k == (bon(), qzn)) { + if (l == (g7(), bet)) + for (s = new pb(r.j); s.a < s.c.c.length; ) + 0 == (o = Yx(Hz(s), 11)).e.c.length || Itn(o), 0 == o.g.c.length || Ctn(o); + else if (CO(Aun(r, (Ojn(), CQn)), 17)) + (w = Yx(Aun(r, CQn), 17)), + (d = Yx( + $on(r, (Ikn(), qit)) + .Kc() + .Pb(), + 11, + )), + (g = Yx($on(r, Eit).Kc().Pb(), 11)), + (p = Yx(Aun(d, CQn), 11)), + YG(w, (v = Yx(Aun(g, CQn), 11))), + QG(w, p), + ((m = new fC(g.i.n)).a = $5(x4(Gy(B7n, 1), TEn, 8, 0, [v.i.n, v.n, v.a])).a), + KD(w.a, m), + ((m = new fC(d.i.n)).a = $5(x4(Gy(B7n, 1), TEn, 8, 0, [p.i.n, p.n, p.a])).a), + KD(w.a, m); + else { + if (r.j.c.length >= 2) { + for (b = !0, e = Yx(Hz((h = new pb(r.j))), 11), f = null; h.a < h.c.c.length; ) + if (((f = e), (e = Yx(Hz(h), 11)), !Q8(Aun(f, CQn), Aun(e, CQn)))) { + b = !1; + break; + } + } else b = !1; + for (s = new pb(r.j); s.a < s.c.c.length; ) + 0 == (o = Yx(Hz(s), 11)).e.c.length || gwn(o, b), 0 == o.g.c.length || pwn(o, b); + } + JG(r, null); + } + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "NorthSouthPortPostprocessor", 1567), + Wfn(1568, 1, dIn, li), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k; + for (run(t, zIn, 1), w = new ip(), y = new ip(), s = new pb(n.b); s.a < s.c.c.length; ) + for (g = -1, l = 0, b = (f = OU((o = Yx(Hz(s), 29)).a)).length; l < b; ++l) + if ((++g, (h = f[l]).k == (bon(), Hzn) && dC(Yx(Aun(h, (gjn(), g0n)), 98)))) { + for ( + zN(Yx(Aun(h, (gjn(), g0n)), 98)) || cwn(h), + b5(h, (Ojn(), vQn), h), + w.c = VQ(UKn, iEn, 1, 0, 5, 1), + y.c = VQ(UKn, iEn, 1, 0, 5, 1), + e = new ip(), + $2((v = new ME()), $on(h, (Ikn(), Tit))), + ojn(n, v, w, y, e), + u = g, + k = h, + c = new pb(w); + c.a < c.c.c.length; + + ) + Hrn((i = Yx(Hz(c), 10)), u, o), + ++g, + b5(i, vQn, h), + (a = Yx(TR(i.j, 0), 11)), + (d = Yx(Aun(a, CQn), 11)), + ny(hL(Aun(d, DZn))) || Yx(Aun(i, mQn), 15).Fc(k); + for (BH(v), p = $on(h, Bit).Kc(); p.Ob(); ) VW(v, Yx(p.Pb(), 11), v.a, v.a.a); + for (ojn(n, v, y, null, e), m = h, r = new pb(y); r.a < r.c.c.length; ) + Hrn((i = Yx(Hz(r), 10)), ++g, o), + b5(i, vQn, h), + (a = Yx(TR(i.j, 0), 11)), + (d = Yx(Aun(a, CQn), 11)), + ny(hL(Aun(d, DZn))) || Yx(Aun(m, mQn), 15).Fc(i); + 0 == e.c.length || b5(h, VVn, e); + } + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "NorthSouthPortPreprocessor", 1568), + Wfn(1569, 1, FMn, bi), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i; + return (e = n.j) != (i = t.j) ? e.g - i.g : n.p == t.p ? 0 : e == (Ikn(), Tit) ? n.p - t.p : t.p - n.p; + })(Yx(n, 11), Yx(t, 11)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(RIn, "NorthSouthPortPreprocessor/lambda$0$Type", 1569), + Wfn(1570, 1, dIn, wi), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c, a; + if ( + (run(t, "Partition midprocessing", 1), (r = new Zq()), SE(hH(new SR(null, new Nz(n.a, 16)), new di()), new xw(r)), 0 != r.d) + ) { + for ( + a = Yx( + kW( + Pz(new SR(null, (r.i || (r.i = new iA(r, r.c))).Nc())), + mY(new H(), new B(), new rn(), x4(Gy(wBn, 1), XEn, 132, 0, [(C6(), aBn)])), + ), + 15, + ), + e = Yx((i = a.Kc()).Pb(), 19); + i.Ob(); + + ) + (c = Yx(i.Pb(), 19)), Abn(Yx(_V(r, e), 21), Yx(_V(r, c), 21)), (e = c); + Ron(t); + } + })(Yx(n, 37), t); + }), + EF(RIn, "PartitionMidprocessor", 1570), + Wfn(1571, 1, YEn, di), + (Fjn.Mb = function (n) { + return O$(Yx(n, 10), (gjn(), o0n)); + }), + EF(RIn, "PartitionMidprocessor/lambda$0$Type", 1571), + Wfn(1572, 1, PEn, xw), + (Fjn.td = function (n) { + !(function (n, t) { + Qhn(n, Yx(Aun(t, (gjn(), o0n)), 19), t); + })(this.a, Yx(n, 10)); + }), + EF(RIn, "PartitionMidprocessor/lambda$1$Type", 1572), + Wfn(1573, 1, dIn, gi), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r; + for (run(t, "Partition postprocessing", 1), e = new pb(n.b); e.a < e.c.c.length; ) + for (i = new pb(Yx(Hz(e), 29).a); i.a < i.c.c.length; ) + for (r = new pb(Yx(Hz(i), 10).j); r.a < r.c.c.length; ) ny(hL(Aun(Yx(Hz(r), 11), (Ojn(), DQn)))) && z_(r); + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "PartitionPostprocessor", 1573), + Wfn(1574, 1, dIn, pi), + (Fjn.pf = function (n, t) { + !(function (n, t) { + run(t, "Partition preprocessing", 1), + SE( + Yx( + kW( + hH(WJ(hH(new SR(null, new Nz(n.a, 16)), new vi()), new mi()), new yi()), + mY(new H(), new B(), new rn(), x4(Gy(wBn, 1), XEn, 132, 0, [(C6(), aBn)])), + ), + 15, + ).Oc(), + new ki(), + ), + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "PartitionPreprocessor", 1574), + Wfn(1575, 1, YEn, vi), + (Fjn.Mb = function (n) { + return O$(Yx(n, 10), (gjn(), o0n)); + }), + EF(RIn, "PartitionPreprocessor/lambda$0$Type", 1575), + Wfn(1576, 1, {}, mi), + (Fjn.Kb = function (n) { + return new SR(null, new nF(new $K(bA(o7(Yx(n, 10)).a.Kc(), new h())))); + }), + EF(RIn, "PartitionPreprocessor/lambda$1$Type", 1576), + Wfn(1577, 1, YEn, yi), + (Fjn.Mb = function (n) { + return (function (n) { + var t, e; + return !!O$(n.d.i, (gjn(), o0n)) && ((t = Yx(Aun(n.c.i, o0n), 19)), (e = Yx(Aun(n.d.i, o0n), 19)), eO(t.a, e.a) > 0); + })(Yx(n, 17)); + }), + EF(RIn, "PartitionPreprocessor/lambda$2$Type", 1577), + Wfn(1578, 1, PEn, ki), + (Fjn.td = function (n) { + !(function (n) { + var t; + mvn(n, !0), (t = hTn), O$(n, (gjn(), M0n)) && (t += Yx(Aun(n, M0n), 19).a), b5(n, M0n, d9(t)); + })(Yx(n, 17)); + }), + EF(RIn, "PartitionPreprocessor/lambda$3$Type", 1578), + Wfn(1579, 1, dIn, rf), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c, a, u; + for (run(t, "Port order processing", 1), u = Yx(Aun(n, (gjn(), j0n)), 421), e = new pb(n.b); e.a < e.c.c.length; ) + for (r = new pb(Yx(Hz(e), 29).a); r.a < r.c.c.length; ) + (i = Yx(Hz(r), 10)), + (c = Yx(Aun(i, g0n), 98)), + (a = i.j), + c == (Ran(), uit) || c == sit || c == oit + ? (XH(), JC(a, EXn)) + : c != fit && c != lit && (XH(), JC(a, MXn), cin(a), u == ($J(), Z2n) && JC(a, TXn)), + (i.i = !0), + yhn(i); + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "PortListSorter", 1579), + Wfn(1580, 1, {}, ji), + (Fjn.Kb = function (n) { + return A6(), Yx(n, 11).e; + }), + EF(RIn, "PortListSorter/lambda$0$Type", 1580), + Wfn(1581, 1, {}, Ei), + (Fjn.Kb = function (n) { + return A6(), Yx(n, 11).g; + }), + EF(RIn, "PortListSorter/lambda$1$Type", 1581), + Wfn(1582, 1, FMn, Ti), + (Fjn.ue = function (n, t) { + return vW(Yx(n, 11), Yx(t, 11)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(RIn, "PortListSorter/lambda$2$Type", 1582), + Wfn(1583, 1, FMn, Mi), + (Fjn.ue = function (n, t) { + return (function (n, t) { + if ((A6(), 0 != n.j.g - t.j.g)) return 0; + switch (n.j.g) { + case 2: + return w7(t, PXn) - w7(n, PXn); + case 4: + return w7(n, SXn) - w7(t, SXn); + } + return 0; + })(Yx(n, 11), Yx(t, 11)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(RIn, "PortListSorter/lambda$3$Type", 1583), + Wfn(1584, 1, FMn, Si), + (Fjn.ue = function (n, t) { + return Opn(Yx(n, 11), Yx(t, 11)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(RIn, "PortListSorter/lambda$4$Type", 1584), + Wfn(1585, 1, dIn, Pi), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r; + for (run(t, "Port side processing", 1), r = new pb(n.a); r.a < r.c.c.length; ) kvn(Yx(Hz(r), 10)); + for (e = new pb(n.b); e.a < e.c.c.length; ) for (i = new pb(Yx(Hz(e), 29).a); i.a < i.c.c.length; ) kvn(Yx(Hz(i), 10)); + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "PortSideProcessor", 1585), + Wfn(1586, 1, dIn, Ii), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c, a, u, o; + for (run(t, "Restoring reversed edges", 1), a = new pb(n.b); a.a < a.c.c.length; ) + for (u = new pb(Yx(Hz(a), 29).a); u.a < u.c.c.length; ) + for (o = new pb(Yx(Hz(u), 10).j); o.a < o.c.c.length; ) + for (r = 0, c = (i = CU(Yx(Hz(o), 11).g)).length; r < c; ++r) ny(hL(Aun((e = i[r]), (Ojn(), HQn)))) && mvn(e, !1); + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "ReversedEdgeRestorer", 1586), + Wfn(1591, 1, dIn, mv), + (Fjn.pf = function (n, t) { + !(function (n, t, e) { + run(e, "Self-Loop ordering", 1), + SE(fH(hH(hH(WJ(new SR(null, new Nz(t.b, 16)), new Ci()), new Oi()), new Ai()), new $i()), new Dw(n)), + Ron(e); + })(this, Yx(n, 37), t); + }), + EF(RIn, "SelfLoopPortRestorer", 1591), + Wfn(1592, 1, {}, Ci), + (Fjn.Kb = function (n) { + return new SR(null, new Nz(Yx(n, 29).a, 16)); + }), + EF(RIn, "SelfLoopPortRestorer/lambda$0$Type", 1592), + Wfn(1593, 1, YEn, Oi), + (Fjn.Mb = function (n) { + return Yx(n, 10).k == (bon(), Hzn); + }), + EF(RIn, "SelfLoopPortRestorer/lambda$1$Type", 1593), + Wfn(1594, 1, YEn, Ai), + (Fjn.Mb = function (n) { + return O$(Yx(n, 10), (Ojn(), GQn)); + }), + EF(RIn, "SelfLoopPortRestorer/lambda$2$Type", 1594), + Wfn(1595, 1, {}, $i), + (Fjn.Kb = function (n) { + return Yx(Aun(Yx(n, 10), (Ojn(), GQn)), 403); + }), + EF(RIn, "SelfLoopPortRestorer/lambda$3$Type", 1595), + Wfn(1596, 1, PEn, Dw), + (Fjn.td = function (n) { + Son(this.a, Yx(n, 403)); + }), + EF(RIn, "SelfLoopPortRestorer/lambda$4$Type", 1596), + Wfn(794, 1, PEn, Li), + (Fjn.td = function (n) { + Uon(Yx(n, 101)); + }), + EF(RIn, "SelfLoopPortRestorer/lambda$5$Type", 794), + Wfn(1597, 1, dIn, Ni), + (Fjn.pf = function (n, t) { + !(function (n, t) { + run(t, "Self-Loop post-processing", 1), + SE(hH(hH(WJ(new SR(null, new Nz(n.b, 16)), new xi()), new Di()), new Ri()), new Ki()), + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "SelfLoopPostProcessor", 1597), + Wfn(1598, 1, {}, xi), + (Fjn.Kb = function (n) { + return new SR(null, new Nz(Yx(n, 29).a, 16)); + }), + EF(RIn, "SelfLoopPostProcessor/lambda$0$Type", 1598), + Wfn(1599, 1, YEn, Di), + (Fjn.Mb = function (n) { + return Yx(n, 10).k == (bon(), Hzn); + }), + EF(RIn, "SelfLoopPostProcessor/lambda$1$Type", 1599), + Wfn(1600, 1, YEn, Ri), + (Fjn.Mb = function (n) { + return O$(Yx(n, 10), (Ojn(), GQn)); + }), + EF(RIn, "SelfLoopPostProcessor/lambda$2$Type", 1600), + Wfn(1601, 1, PEn, Ki), + (Fjn.td = function (n) { + !(function (n) { + var t; + SE(WJ(new SR(null, new Nz((t = Yx(Aun(n, (Ojn(), GQn)), 403)).d, 16)), new _i()), new Rw(n)), + SE(hH(new SR(null, new Nz(t.d, 16)), new Fi()), new Kw(n)); + })(Yx(n, 10)); + }), + EF(RIn, "SelfLoopPostProcessor/lambda$3$Type", 1601), + Wfn(1602, 1, {}, _i), + (Fjn.Kb = function (n) { + return new SR(null, new Nz(Yx(n, 101).f, 1)); + }), + EF(RIn, "SelfLoopPostProcessor/lambda$4$Type", 1602), + Wfn(1603, 1, PEn, Rw), + (Fjn.td = function (n) { + !(function (n, t) { + var e; + YG((e = t.a), t.c.d), QG(e, t.d.d), o1(e.a, n.n); + })(this.a, Yx(n, 409)); + }), + EF(RIn, "SelfLoopPostProcessor/lambda$5$Type", 1603), + Wfn(1604, 1, YEn, Fi), + (Fjn.Mb = function (n) { + return !!Yx(n, 101).i; + }), + EF(RIn, "SelfLoopPostProcessor/lambda$6$Type", 1604), + Wfn(1605, 1, PEn, Kw), + (Fjn.td = function (n) { + Dm(this.a, Yx(n, 101)); + }), + EF(RIn, "SelfLoopPostProcessor/lambda$7$Type", 1605), + Wfn(1587, 1, dIn, Bi), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c; + for (run(t, "Self-Loop pre-processing", 1), i = new pb(n.a); i.a < i.c.c.length; ) + P7((e = Yx(Hz(i), 10))) && + ((c = new Ptn(e)), + b5(e, (Ojn(), GQn), c), + upn(c), + SE(fH(WJ(new SR(null, new Nz((r = c).d, 16)), new Hi()), new qi()), new Gi()), + bwn(r)); + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "SelfLoopPreProcessor", 1587), + Wfn(1588, 1, {}, Hi), + (Fjn.Kb = function (n) { + return new SR(null, new Nz(Yx(n, 101).f, 1)); + }), + EF(RIn, "SelfLoopPreProcessor/lambda$0$Type", 1588), + Wfn(1589, 1, {}, qi), + (Fjn.Kb = function (n) { + return Yx(n, 409).a; + }), + EF(RIn, "SelfLoopPreProcessor/lambda$1$Type", 1589), + Wfn(1590, 1, PEn, Gi), + (Fjn.td = function (n) { + !(function (n) { + YG(n, null), QG(n, null); + })(Yx(n, 17)); + }), + EF(RIn, "SelfLoopPreProcessor/lambda$2$Type", 1590), + Wfn(1606, 1, dIn, hN), + (Fjn.pf = function (n, t) { + won(this, Yx(n, 37), t); + }), + EF(RIn, "SelfLoopRouter", 1606), + Wfn(1607, 1, {}, zi), + (Fjn.Kb = function (n) { + return new SR(null, new Nz(Yx(n, 29).a, 16)); + }), + EF(RIn, "SelfLoopRouter/lambda$0$Type", 1607), + Wfn(1608, 1, YEn, Ui), + (Fjn.Mb = function (n) { + return Yx(n, 10).k == (bon(), Hzn); + }), + EF(RIn, "SelfLoopRouter/lambda$1$Type", 1608), + Wfn(1609, 1, YEn, Xi), + (Fjn.Mb = function (n) { + return O$(Yx(n, 10), (Ojn(), GQn)); + }), + EF(RIn, "SelfLoopRouter/lambda$2$Type", 1609), + Wfn(1610, 1, {}, Wi), + (Fjn.Kb = function (n) { + return Yx(Aun(Yx(n, 10), (Ojn(), GQn)), 403); + }), + EF(RIn, "SelfLoopRouter/lambda$3$Type", 1610), + Wfn(1611, 1, PEn, yM), + (Fjn.td = function (n) { + EH(this.a, this.b, Yx(n, 403)); + }), + EF(RIn, "SelfLoopRouter/lambda$4$Type", 1611), + Wfn(1612, 1, dIn, Vi), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i; + for (run(t, "Semi-Interactive Crossing Minimization Processor", 1), e = !1, i = new pb(n.b); i.a < i.c.c.length; ) + e |= null != W8(HZ(hH(hH(new SR(null, new Nz(Yx(Hz(i), 29).a, 16)), new Qi()), new Yi()), new Ji()), new Zi()).a; + e && b5(n, (Ojn(), yQn), (TA(), !0)), Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "SemiInteractiveCrossMinProcessor", 1612), + Wfn(1613, 1, YEn, Qi), + (Fjn.Mb = function (n) { + return Yx(n, 10).k == (bon(), Hzn); + }), + EF(RIn, "SemiInteractiveCrossMinProcessor/lambda$0$Type", 1613), + Wfn(1614, 1, YEn, Yi), + (Fjn.Mb = function (n) { + return CR(Yx(n, 10))._b((gjn(), E0n)); + }), + EF(RIn, "SemiInteractiveCrossMinProcessor/lambda$1$Type", 1614), + Wfn(1615, 1, FMn, Ji), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i; + return (e = Yx(Aun(n, (gjn(), E0n)), 8)), (i = Yx(Aun(t, E0n), 8)), $9(e.b, i.b); + })(Yx(n, 10), Yx(t, 10)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(RIn, "SemiInteractiveCrossMinProcessor/lambda$2$Type", 1615), + Wfn(1616, 1, {}, Zi), + (Fjn.Ce = function (n, t) { + return (function (n, t) { + return Yx(Aun(n, (Ojn(), mQn)), 15).Fc(t), t; + })(Yx(n, 10), Yx(t, 10)); + }), + EF(RIn, "SemiInteractiveCrossMinProcessor/lambda$3$Type", 1616), + Wfn(1618, 1, dIn, nr), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c, a, u, o; + for (run(t, "Sort By Input Model " + Aun(n, (gjn(), XZn)), 1), r = 0, i = new pb(n.b); i.a < i.c.c.length; ) { + for (e = Yx(Hz(i), 29), o = 0 == r ? 0 : r - 1, u = Yx(TR(n.b, o), 29), a = new pb(e.a); a.a < a.c.c.length; ) + iI(Aun((c = Yx(Hz(a), 10)), g0n)) !== iI((Ran(), uit)) && + iI(Aun(c, g0n)) !== iI(oit) && + (XH(), JC(c.j, new gJ(u, Qrn(c))), LD(t, "Node " + c + " ports: " + c.j)); + XH(), JC(e.a, new L2(u, Yx(Aun(n, XZn), 339), Yx(Aun(n, zZn), 378))), LD(t, "Layer " + r + ": " + e), ++r; + } + Ron(t); + })(Yx(n, 37), t); + }), + EF(RIn, "SortByInputModelProcessor", 1618), + Wfn(1619, 1, YEn, tr), + (Fjn.Mb = function (n) { + return 0 != Yx(n, 11).g.c.length; + }), + EF(RIn, "SortByInputModelProcessor/lambda$0$Type", 1619), + Wfn(1620, 1, PEn, _w), + (Fjn.td = function (n) { + tsn(this.a, Yx(n, 11)); + }), + EF(RIn, "SortByInputModelProcessor/lambda$1$Type", 1620), + Wfn(1693, 803, {}, a2), + (Fjn.Me = function (n) { + var t, e, i, r; + switch (((this.c = n), this.a.g)) { + case 2: + (t = new ip()), + SE(hH(new SR(null, new Nz(this.c.a.b, 16)), new dr()), new MM(this, t)), + Wsn(this, new rr()), + WZ(t, new cr()), + (t.c = VQ(UKn, iEn, 1, 0, 5, 1)), + SE(hH(new SR(null, new Nz(this.c.a.b, 16)), new ar()), new Bw(t)), + Wsn(this, new ur()), + WZ(t, new or()), + (t.c = VQ(UKn, iEn, 1, 0, 5, 1)), + (e = tO(B2(lH(new SR(null, new Nz(this.c.a.b, 16)), new Hw(this))), new sr())), + SE(new SR(null, new Nz(this.c.a.a, 16)), new jM(e, t)), + Wsn(this, new fr()), + WZ(t, new er()), + (t.c = VQ(UKn, iEn, 1, 0, 5, 1)); + break; + case 3: + (i = new ip()), + Wsn(this, new ir()), + (r = tO(B2(lH(new SR(null, new Nz(this.c.a.b, 16)), new Fw(this))), new hr())), + SE(hH(new SR(null, new Nz(this.c.a.b, 16)), new lr()), new TM(r, i)), + Wsn(this, new br()), + WZ(i, new wr()), + (i.c = VQ(UKn, iEn, 1, 0, 5, 1)); + break; + default: + throw hp(new _p()); + } + }), + (Fjn.b = 0), + EF(UIn, "EdgeAwareScanlineConstraintCalculation", 1693), + Wfn(1694, 1, rSn, ir), + (Fjn.Lb = function (n) { + return CO(Yx(n, 57).g, 145); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Mb = function (n) { + return CO(Yx(n, 57).g, 145); + }), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$0$Type", 1694), + Wfn(1695, 1, {}, Fw), + (Fjn.Fe = function (n) { + return (function (n, t) { + var i, r; + return CO(t.g, 10) && Yx(t.g, 10).k == (bon(), _zn) + ? JTn + : SX(t) + ? e.Math.max(0, n.b / 2 - 0.5) + : (i = FU(t)) + ? ((r = ty(fL(pnn(i, (gjn(), G0n))))), e.Math.max(0, r / 2 - 0.5)) + : JTn; + })(this.a, Yx(n, 57)); + }), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$1$Type", 1695), + Wfn(1703, 1, JEn, kM), + (Fjn.Vd = function () { + vcn(this.a, this.b, -1); + }), + (Fjn.b = 0), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$10$Type", 1703), + Wfn(1705, 1, rSn, rr), + (Fjn.Lb = function (n) { + return CO(Yx(n, 57).g, 145); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Mb = function (n) { + return CO(Yx(n, 57).g, 145); + }), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$11$Type", 1705), + Wfn(1706, 1, PEn, cr), + (Fjn.td = function (n) { + Yx(n, 365).Vd(); + }), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$12$Type", 1706), + Wfn(1707, 1, YEn, ar), + (Fjn.Mb = function (n) { + return CO(Yx(n, 57).g, 10); + }), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$13$Type", 1707), + Wfn(1709, 1, PEn, Bw), + (Fjn.td = function (n) { + !(function (n, t) { + var i, r; + (r = ty(fL(pnn(FU(t), (gjn(), N0n))))), vcn(t, (i = e.Math.max(0, r / 2 - 0.5)), 1), eD(n, new OM(t, i)); + })(this.a, Yx(n, 57)); + }), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$14$Type", 1709), + Wfn(1708, 1, JEn, OM), + (Fjn.Vd = function () { + vcn(this.b, this.a, -1); + }), + (Fjn.a = 0), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$15$Type", 1708), + Wfn(1710, 1, rSn, ur), + (Fjn.Lb = function (n) { + return CO(Yx(n, 57).g, 10); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Mb = function (n) { + return CO(Yx(n, 57).g, 10); + }), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$16$Type", 1710), + Wfn(1711, 1, PEn, or), + (Fjn.td = function (n) { + Yx(n, 365).Vd(); + }), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$17$Type", 1711), + Wfn(1712, 1, {}, Hw), + (Fjn.Fe = function (n) { + return (function (n, t) { + var i, r; + return CO(t.g, 10) && Yx(t.g, 10).k == (bon(), _zn) + ? JTn + : SX(t) + ? e.Math.max(0, n.b / 2 - 0.5) + : (i = FU(t)) + ? ((r = ty(fL(pnn(i, (gjn(), G0n))))), e.Math.max(0, r / 2 - 0.5)) + : JTn; + })(this.a, Yx(n, 57)); + }), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$18$Type", 1712), + Wfn(1713, 1, {}, sr), + (Fjn.De = function () { + return 0; + }), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$19$Type", 1713), + Wfn(1696, 1, {}, hr), + (Fjn.De = function () { + return 0; + }), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$2$Type", 1696), + Wfn(1715, 1, PEn, jM), + (Fjn.td = function (n) { + !(function (n, t, e) { + yln(e, n, 1), eD(t, new EM(e, n)); + })(this.a, this.b, Yx(n, 307)); + }), + (Fjn.a = 0), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$20$Type", 1715), + Wfn(1714, 1, JEn, EM), + (Fjn.Vd = function () { + yln(this.a, this.b, -1); + }), + (Fjn.b = 0), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$21$Type", 1714), + Wfn(1716, 1, rSn, fr), + (Fjn.Lb = function (n) { + return Yx(n, 57), !0; + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Mb = function (n) { + return Yx(n, 57), !0; + }), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$22$Type", 1716), + Wfn(1717, 1, PEn, er), + (Fjn.td = function (n) { + Yx(n, 365).Vd(); + }), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$23$Type", 1717), + Wfn(1697, 1, YEn, lr), + (Fjn.Mb = function (n) { + return CO(Yx(n, 57).g, 10); + }), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$3$Type", 1697), + Wfn(1699, 1, PEn, TM), + (Fjn.td = function (n) { + !(function (n, t, e) { + vcn(e, n, 1), eD(t, new AM(e, n)); + })(this.a, this.b, Yx(n, 57)); + }), + (Fjn.a = 0), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$4$Type", 1699), + Wfn(1698, 1, JEn, AM), + (Fjn.Vd = function () { + vcn(this.b, this.a, -1); + }), + (Fjn.a = 0), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$5$Type", 1698), + Wfn(1700, 1, rSn, br), + (Fjn.Lb = function (n) { + return Yx(n, 57), !0; + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Mb = function (n) { + return Yx(n, 57), !0; + }), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$6$Type", 1700), + Wfn(1701, 1, PEn, wr), + (Fjn.td = function (n) { + Yx(n, 365).Vd(); + }), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$7$Type", 1701), + Wfn(1702, 1, YEn, dr), + (Fjn.Mb = function (n) { + return CO(Yx(n, 57).g, 145); + }), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$8$Type", 1702), + Wfn(1704, 1, PEn, MM), + (Fjn.td = function (n) { + !(function (n, t, i) { + var r; + vcn(i, (r = e.Math.max(0, n.b / 2 - 0.5)), 1), eD(t, new kM(i, r)); + })(this.a, this.b, Yx(n, 57)); + }), + EF(UIn, "EdgeAwareScanlineConstraintCalculation/lambda$9$Type", 1704), + Wfn(1521, 1, dIn, s$), + (Fjn.pf = function (n, t) { + _mn(this, Yx(n, 37), t); + }), + EF(UIn, "HorizontalGraphCompactor", 1521), + Wfn(1522, 1, {}, qw), + (Fjn.Oe = function (n, t) { + var e, i; + return _J(n, t) + ? 0 + : ((e = FU(n)), + (i = FU(t)), + (e && e.k == (bon(), _zn)) || (i && i.k == (bon(), _zn)) + ? 0 + : (function (n, t, e) { + return $X(n, t, e, n.b); + })(Yx(Aun(this.a.a, (Ojn(), zQn)), 304), e ? e.k : (bon(), Bzn), i ? i.k : (bon(), Bzn))); + }), + (Fjn.Pe = function (n, t) { + var e, i; + return _J(n, t) + ? 1 + : ((e = FU(n)), (i = FU(t)), JA(Yx(Aun(this.a.a, (Ojn(), zQn)), 304), e ? e.k : (bon(), Bzn), i ? i.k : (bon(), Bzn))); + }), + EF(UIn, "HorizontalGraphCompactor/1", 1522), + Wfn(1523, 1, {}, gr), + (Fjn.Ne = function (n, t) { + return JE(), 0 == n.a.i; + }), + EF(UIn, "HorizontalGraphCompactor/lambda$0$Type", 1523), + Wfn(1524, 1, {}, Gw), + (Fjn.Ne = function (n, t) { + return (function (n, t, e) { + return ( + JE(), + (function (n, t) { + switch (t.g) { + case 2: + return n.b; + case 1: + return n.c; + case 4: + return n.d; + case 3: + return n.a; + default: + return !1; + } + })(Yx(BF(n.e, t), 522), e) + ); + })(this.a, n, t); + }), + EF(UIn, "HorizontalGraphCompactor/lambda$1$Type", 1524), + Wfn(1664, 1, {}, dJ), + EF(UIn, "LGraphToCGraphTransformer", 1664), + Wfn(1672, 1, YEn, pr), + (Fjn.Mb = function (n) { + return null != n; + }), + EF(UIn, "LGraphToCGraphTransformer/0methodref$nonNull$Type", 1672), + Wfn(1665, 1, {}, vr), + (Fjn.Kb = function (n) { + return $x(), I7(Aun(Yx(Yx(n, 57).g, 10), (Ojn(), CQn))); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$0$Type", 1665), + Wfn(1666, 1, {}, mr), + (Fjn.Kb = function (n) { + return $x(), _8(Yx(Yx(n, 57).g, 145)); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$1$Type", 1666), + Wfn(1675, 1, YEn, yr), + (Fjn.Mb = function (n) { + return $x(), CO(Yx(n, 57).g, 10); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$10$Type", 1675), + Wfn(1676, 1, PEn, kr), + (Fjn.td = function (n) { + !(function (n) { + var t; + $x(), ((t = Yx(n.g, 10)).n.a = n.d.c + t.d.b); + })(Yx(n, 57)); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$11$Type", 1676), + Wfn(1677, 1, YEn, jr), + (Fjn.Mb = function (n) { + return $x(), CO(Yx(n, 57).g, 145); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$12$Type", 1677), + Wfn(1681, 1, PEn, Er), + (Fjn.td = function (n) { + !(function (n) { + var t, e; + $x(), (t = n.d.c - n.e.c), WZ((e = Yx(n.g, 145)).b, new zw(t)), WZ(e.c, new Uw(t)), XW(e.i, new Xw(t)); + })(Yx(n, 57)); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$13$Type", 1681), + Wfn(1678, 1, PEn, zw), + (Fjn.td = function (n) { + !(function (n, t) { + $x(), (t.a += n); + })(this.a, Yx(n, 8)); + }), + (Fjn.a = 0), + EF(UIn, "LGraphToCGraphTransformer/lambda$14$Type", 1678), + Wfn(1679, 1, PEn, Uw), + (Fjn.td = function (n) { + !(function (n, t) { + $x(), (t.c += n); + })(this.a, Yx(n, 110)); + }), + (Fjn.a = 0), + EF(UIn, "LGraphToCGraphTransformer/lambda$15$Type", 1679), + Wfn(1680, 1, PEn, Xw), + (Fjn.td = function (n) { + !(function (n, t) { + $x(), (t.a += n); + })(this.a, Yx(n, 8)); + }), + (Fjn.a = 0), + EF(UIn, "LGraphToCGraphTransformer/lambda$16$Type", 1680), + Wfn(1682, 1, {}, Tr), + (Fjn.Kb = function (n) { + return $x(), new SR(null, new nF(new $K(bA(o7(Yx(n, 10)).a.Kc(), new h())))); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$17$Type", 1682), + Wfn(1683, 1, YEn, Mr), + (Fjn.Mb = function (n) { + return $x(), ZW(Yx(n, 17)); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$18$Type", 1683), + Wfn(1684, 1, PEn, Ww), + (Fjn.td = function (n) { + !(function (n, t) { + var e, i, r; + (r = t.c.i), (i = (e = Yx(BF(n.f, r), 57)).d.c - e.e.c), R2(t.a, i, 0); + })(this.a, Yx(n, 17)); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$19$Type", 1684), + Wfn(1668, 1, PEn, Vw), + (Fjn.td = function (n) { + !(function (n, t) { + var e; + (e = Yx(BF(n.g, t), 57)), WZ(t.d, new SM(n, e)); + })(this.a, Yx(n, 145)); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$2$Type", 1668), + Wfn(1685, 1, {}, Sr), + (Fjn.Kb = function (n) { + return $x(), new SR(null, new Nz(Yx(n, 29).a, 16)); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$20$Type", 1685), + Wfn(1686, 1, {}, Pr), + (Fjn.Kb = function (n) { + return $x(), new SR(null, new nF(new $K(bA(o7(Yx(n, 10)).a.Kc(), new h())))); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$21$Type", 1686), + Wfn(1687, 1, {}, Ir), + (Fjn.Kb = function (n) { + return $x(), Yx(Aun(Yx(n, 17), (Ojn(), WQn)), 15); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$22$Type", 1687), + Wfn(1688, 1, YEn, Cr), + (Fjn.Mb = function (n) { + return (function (n) { + return $x(), !!n && !n.dc(); + })(Yx(n, 15)); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$23$Type", 1688), + Wfn(1689, 1, PEn, Qw), + (Fjn.td = function (n) { + !(function (n, t) { + var e, i, r, c, a; + if (!t.dc()) + if (((r = Yx(t.Xb(0), 128)), 1 != t.gc())) + for (e = 1; e < t.gc(); ) + (!r.j && r.o) || + ((c = jrn(t, e)) && ((i = Yx(c.a, 19).a), Mwn(n, r, (a = Yx(c.b, 128)), e, i, t), (e = i + 1), (r = a))); + else Mwn(n, r, r, 1, 0, t); + })(this.a, Yx(n, 15)); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$24$Type", 1689), + Wfn(1667, 1, PEn, SM), + (Fjn.td = function (n) { + !(function (n, t, e) { + var i; + (i = Yx(BF(n.g, e), 57)), eD(n.a.c, new mP(t, i)); + })(this.a, this.b, Yx(n, 145)); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$3$Type", 1667), + Wfn(1669, 1, {}, Or), + (Fjn.Kb = function (n) { + return $x(), new SR(null, new Nz(Yx(n, 29).a, 16)); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$4$Type", 1669), + Wfn(1670, 1, {}, Ar), + (Fjn.Kb = function (n) { + return $x(), new SR(null, new nF(new $K(bA(o7(Yx(n, 10)).a.Kc(), new h())))); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$5$Type", 1670), + Wfn(1671, 1, {}, $r), + (Fjn.Kb = function (n) { + return $x(), Yx(Aun(Yx(n, 17), (Ojn(), WQn)), 15); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$6$Type", 1671), + Wfn(1673, 1, PEn, Yw), + (Fjn.td = function (n) { + !(function (n, t) { + var e, i, r, c; + for ($x(), e = null, r = t.Kc(); r.Ob(); ) + (i = Yx(r.Pb(), 128)).o || + (eD((c = new _vn(wO(i.a), vD(i.a), null, Yx(i.d.a.ec().Kc().Pb(), 17))).c, i.a), + (n.c[n.c.length] = c), + e && eD(e.d, c), + (e = c)); + })(this.a, Yx(n, 15)); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$8$Type", 1673), + Wfn(1674, 1, PEn, PM), + (Fjn.td = function (n) { + !(function (n, t, e) { + xB(n.g, e, t); + })(this.a, this.b, Yx(n, 145)); + }), + EF(UIn, "LGraphToCGraphTransformer/lambda$9$Type", 1674), + Wfn(1663, 1, {}, Lr), + (Fjn.Le = function (n) { + var t, i, r, c, a; + for ( + this.a = n, this.d = new Zp(), this.c = VQ(iHn, iEn, 121, this.a.a.a.c.length, 0, 1), this.b = 0, i = new pb(this.a.a.a); + i.a < i.c.c.length; + + ) + ((t = Yx(Hz(i), 307)).d = this.b), (a = HA(DE(new ev(), t), this.d)), (this.c[this.b] = a), ++this.b; + for ( + (function (n) { + var t, i, r, c, a, u, o, s, h, f, l, b; + for (c = new pb(n.a.a.b); c.a < c.c.c.length; ) + for (s = (r = Yx(Hz(c), 57)).c.Kc(); s.Ob(); ) + (o = Yx(s.Pb(), 57)), + r.a != o.a && + ((l = lC(n.a.d) ? n.a.g.Oe(r, o) : n.a.g.Pe(r, o)), + (a = r.b.a + r.d.b + l - o.b.a), + (a = e.Math.ceil(a)), + (a = e.Math.max(0, a)), + _J(r, o) + ? ((u = HA(new ev(), n.d)), + (t = (h = oG(e.Math.ceil(o.b.a - r.b.a))) - (o.b.a - r.b.a)), + (i = r), + (f = SX(r).a) || ((f = SX(o).a), (t = -t), (i = o)), + f && ((i.b.a -= t), (f.n.a -= t)), + uwn(NE(LE(xE($E(new tv(), e.Math.max(0, h)), 1), u), n.c[r.a.d])), + uwn(NE(LE(xE($E(new tv(), e.Math.max(0, -h)), 1), u), n.c[o.a.d]))) + : ((b = 1), + ((CO(r.g, 145) && CO(o.g, 10)) || (CO(o.g, 145) && CO(r.g, 10))) && (b = 2), + uwn(NE(LE(xE($E(new tv(), oG(a)), b), n.c[r.a.d]), n.c[o.a.d])))); + })(this), + (function (n) { + var t, e, i, r, c, a, u, o, s, f, l, b, w, d, g, p, v; + for (s = new rp(), u = new Zq(), i = new pb(n.a.a.b); i.a < i.c.c.length; ) + if ((o = FU((t = Yx(Hz(i), 57))))) Ysn(s.f, o, t); + else if ((v = SX(t))) for (r = new pb(v.k); r.a < r.c.c.length; ) Qhn(u, Yx(Hz(r), 17), t); + for (e = new pb(n.a.a.b); e.a < e.c.c.length; ) + if ((o = FU((t = Yx(Hz(e), 57))))) + for (a = new $K(bA(o7(o).a.Kc(), new h())); Vfn(a); ) + if (!ZW((c = Yx(kV(a), 17))) && ((w = c.c), (p = c.d), !(Ikn(), xit).Hc(c.c.j) || !xit.Hc(c.d.j))) { + if ( + ((d = Yx(BF(s, c.d.i), 57)), + uwn(NE(LE(xE($E(new tv(), 0), 100), n.c[t.a.d]), n.c[d.a.d])), + w.j == qit && ZK((Q2(), w))) + ) + for (l = Yx(_V(u, c), 21).Kc(); l.Ob(); ) + if ((f = Yx(l.Pb(), 57)).d.c < t.d.c) { + if ((b = n.c[f.a.d]) == (g = n.c[t.a.d])) continue; + uwn(NE(LE(xE($E(new tv(), 1), 100), b), g)); + } + if (p.j == Eit && JK((Q2(), p))) + for (l = Yx(_V(u, c), 21).Kc(); l.Ob(); ) + if ((f = Yx(l.Pb(), 57)).d.c > t.d.c) { + if ((b = n.c[t.a.d]) == (g = n.c[f.a.d])) continue; + uwn(NE(LE(xE($E(new tv(), 1), 100), b), g)); + } + } + })(this), + (function (n) { + var t, e, i, r, c, a, u; + for (c = new ME(), r = new pb(n.d.a); r.a < r.c.c.length; ) + 0 == (i = Yx(Hz(r), 121)).b.a.c.length && VW(c, i, c.c.b, c.c); + if (c.b > 1) + for (t = HA(((e = new ev()), ++n.b, e), n.d), u = Ztn(c, 0); u.b != u.d.c; ) + (a = Yx(IX(u), 121)), uwn(NE(LE(xE($E(new tv(), 1), 0), t), a)); + })(this), + Ggn(Cx(this.d), new am()), + c = new pb(this.a.a.b); + c.a < c.c.c.length; + + ) + (r = Yx(Hz(c), 57)).d.c = this.c[r.a.d].e + r.b.a; + }), + (Fjn.b = 0), + EF(UIn, "NetworkSimplexCompaction", 1663), + Wfn(145, 1, { 35: 1, 145: 1 }, _vn), + (Fjn.wd = function (n) { + return (function (n, t) { + var e; + return 0 == (e = y7(n.e.c, t.e.c)) ? $9(n.e.d, t.e.d) : e; + })(this, Yx(n, 145)); + }), + (Fjn.Ib = function () { + return _8(this); + }), + EF(UIn, "VerticalSegment", 145), + Wfn(827, 1, {}, $an), + (Fjn.c = 0), + (Fjn.e = 0), + (Fjn.i = 0), + EF(XIn, "BetweenLayerEdgeTwoNodeCrossingsCounter", 827), + Wfn(663, 1, { 663: 1 }, n3), + (Fjn.Ib = function () { + return "AdjacencyList [node=" + this.d + ", adjacencies= " + this.a + "]"; + }), + (Fjn.b = 0), + (Fjn.c = 0), + (Fjn.f = 0), + EF(XIn, "BetweenLayerEdgeTwoNodeCrossingsCounter/AdjacencyList", 663), + Wfn(287, 1, { 35: 1, 287: 1 }, R$), + (Fjn.wd = function (n) { + return (function (n, t) { + return n.c < t.c ? -1 : n.c == t.c ? 0 : 1; + })(this, Yx(n, 287)); + }), + (Fjn.Ib = function () { + return "Adjacency [position=" + this.c + ", cardinality=" + this.a + ", currentCardinality=" + this.b + "]"; + }), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.c = 0), + EF(XIn, "BetweenLayerEdgeTwoNodeCrossingsCounter/AdjacencyList/Adjacency", 287), + Wfn(1929, 1, {}, zon), + (Fjn.b = 0), + (Fjn.e = !1), + EF(XIn, "CrossingMatrixFiller", 1929); + var $Xn, + LXn, + NXn, + xXn, + DXn = aR(WIn, "IInitializable"); + Wfn(1804, 1, VIn, DM), + (Fjn.Nf = function (n, t, e, i, r, c) {}), + (Fjn.Pf = function (n, t, e) {}), + (Fjn.Lf = function () { + return this.c != (l0(), z3n); + }), + (Fjn.Mf = function () { + this.e = VQ(Wot, MTn, 25, this.d, 15, 1); + }), + (Fjn.Of = function (n, t) { + t[n][0].c.p = n; + }), + (Fjn.Qf = function (n, t, e, i) { + ++this.d; + }), + (Fjn.Rf = function () { + return !0; + }), + (Fjn.Sf = function (n, t, e, i) { + return ( + E8(this, n, t, e), + (function (n, t) { + var e, i; + i = !1; + do { + i |= e = d5(n, t); + } while (e); + return i; + })(this, t) + ); + }), + (Fjn.Tf = function (n, t) { + var e; + return ( + E8( + this, + n, + (e = (function (n, t) { + return n ? 0 : t - 1; + })(t, n.length)), + t, + ), + d5(this, e) + ); + }), + (Fjn.d = 0), + EF(XIn, "GreedySwitchHeuristic", 1804), + Wfn(1930, 1, {}, zR), + (Fjn.b = 0), + (Fjn.d = 0), + EF(XIn, "NorthSouthEdgeNeighbouringNodeCrossingsCounter", 1930), + Wfn(1917, 1, {}, Kdn), + (Fjn.a = !1), + EF(XIn, "SwitchDecider", 1917), + Wfn(101, 1, { 101: 1 }, csn), + (Fjn.a = null), + (Fjn.c = null), + (Fjn.i = null), + EF(QIn, "SelfHyperLoop", 101), + Wfn(1916, 1, {}, Wtn), + (Fjn.c = 0), + (Fjn.e = 0), + EF(QIn, "SelfHyperLoopLabels", 1916), + Wfn(411, 22, { 3: 1, 35: 1, 22: 1, 411: 1 }, RM); + var RXn, + KXn, + _Xn, + FXn, + BXn, + HXn, + qXn = X1( + QIn, + "SelfHyperLoopLabels/Alignment", + 411, + u_n, + function () { + return K4(), x4(Gy(qXn, 1), XEn, 411, 0, [$Xn, LXn, NXn, xXn]); + }, + function (n) { + return K4(), rZ((YY(), RXn), n); + }, + ); + Wfn(409, 1, { 409: 1 }, VV), + EF(QIn, "SelfLoopEdge", 409), + Wfn(403, 1, { 403: 1 }, Ptn), + (Fjn.a = !1), + EF(QIn, "SelfLoopHolder", 403), + Wfn(1724, 1, YEn, qr), + (Fjn.Mb = function (n) { + return ZW(Yx(n, 17)); + }), + EF(QIn, "SelfLoopHolder/lambda$0$Type", 1724), + Wfn(113, 1, { 113: 1 }, Vtn), + (Fjn.a = !1), + (Fjn.c = !1), + EF(QIn, "SelfLoopPort", 113), + Wfn(1792, 1, YEn, Gr), + (Fjn.Mb = function (n) { + return ZW(Yx(n, 17)); + }), + EF(QIn, "SelfLoopPort/lambda$0$Type", 1792), + Wfn(363, 22, { 3: 1, 35: 1, 22: 1, 363: 1 }, KM); + var GXn, + zXn, + UXn, + XXn, + WXn, + VXn, + QXn, + YXn, + JXn = X1( + QIn, + "SelfLoopType", + 363, + u_n, + function () { + return Tan(), x4(Gy(JXn, 1), XEn, 363, 0, [_Xn, BXn, HXn, FXn, KXn]); + }, + function (n) { + return Tan(), rZ((wZ(), GXn), n); + }, + ); + Wfn(1732, 1, {}, cf), EF(YIn, "PortRestorer", 1732), Wfn(361, 22, { 3: 1, 35: 1, 22: 1, 361: 1 }, _M); + var ZXn, + nWn, + tWn, + eWn, + iWn, + rWn, + cWn, + aWn, + uWn, + oWn = X1( + YIn, + "PortRestorer/PortSideArea", + 361, + u_n, + function () { + return v2(), x4(Gy(oWn, 1), XEn, 361, 0, [YXn, QXn, VXn]); + }, + function (n) { + return v2(), rZ((PQ(), ZXn), n); + }, + ); + Wfn(1733, 1, {}, Wr), + (Fjn.Kb = function (n) { + return Qun(), Yx(n, 15).Oc(); + }), + EF(YIn, "PortRestorer/lambda$0$Type", 1733), + Wfn(1734, 1, PEn, Vr), + (Fjn.td = function (n) { + Qun(), (Yx(n, 113).c = !1); + }), + EF(YIn, "PortRestorer/lambda$1$Type", 1734), + Wfn(1743, 1, YEn, Qr), + (Fjn.Mb = function (n) { + return Qun(), Yx(n, 11).j == (Ikn(), qit); + }), + EF(YIn, "PortRestorer/lambda$10$Type", 1743), + Wfn(1744, 1, {}, Yr), + (Fjn.Kb = function (n) { + return Qun(), Yx(n, 113).d; + }), + EF(YIn, "PortRestorer/lambda$11$Type", 1744), + Wfn(1745, 1, PEn, Jw), + (Fjn.td = function (n) { + !(function (n, t) { + Qun(), ZG(t, n); + })(this.a, Yx(n, 11)); + }), + EF(YIn, "PortRestorer/lambda$12$Type", 1745), + Wfn(1735, 1, PEn, Zw), + (Fjn.td = function (n) { + !(function (n, t) { + Qun(), Qhn(n, t.e, t); + })(this.a, Yx(n, 101)); + }), + EF(YIn, "PortRestorer/lambda$2$Type", 1735), + Wfn(1736, 1, FMn, Jr), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return Qun(), eO(n.b.c.length - n.e.c.length, t.b.c.length - t.e.c.length); + })(Yx(n, 113), Yx(t, 113)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(YIn, "PortRestorer/lambda$3$Type", 1736), + Wfn(1737, 1, YEn, Zr), + (Fjn.Mb = function (n) { + return Qun(), Yx(n, 113).c; + }), + EF(YIn, "PortRestorer/lambda$4$Type", 1737), + Wfn(1738, 1, YEn, xr), + (Fjn.Mb = function (n) { + return (function (n) { + var t, e, i; + return n.j == (Ikn(), Tit) && ((e = KA((t = Lfn(n)), Eit)), (i = KA(t, qit)) || (i && e)); + })(Yx(n, 11)); + }), + EF(YIn, "PortRestorer/lambda$5$Type", 1738), + Wfn(1739, 1, YEn, Nr), + (Fjn.Mb = function (n) { + return Qun(), Yx(n, 11).j == (Ikn(), Tit); + }), + EF(YIn, "PortRestorer/lambda$6$Type", 1739), + Wfn(1740, 1, YEn, Dr), + (Fjn.Mb = function (n) { + return Qun(), Yx(n, 11).j == (Ikn(), Eit); + }), + EF(YIn, "PortRestorer/lambda$7$Type", 1740), + Wfn(1741, 1, YEn, Rr), + (Fjn.Mb = function (n) { + return (function (n) { + return n.j == (Ikn(), Bit) && KA(Lfn(n), Eit); + })(Yx(n, 11)); + }), + EF(YIn, "PortRestorer/lambda$8$Type", 1741), + Wfn(1742, 1, YEn, Kr), + (Fjn.Mb = function (n) { + return Qun(), Yx(n, 11).j == (Ikn(), Bit); + }), + EF(YIn, "PortRestorer/lambda$9$Type", 1742), + Wfn(270, 22, { 3: 1, 35: 1, 22: 1, 270: 1 }, kH); + var sWn, + hWn, + fWn, + lWn, + bWn, + wWn, + dWn, + gWn, + pWn = X1( + YIn, + "PortSideAssigner/Target", + 270, + u_n, + function () { + return adn(), x4(Gy(pWn, 1), XEn, 270, 0, [tWn, rWn, nWn, uWn, iWn, eWn, aWn, cWn]); + }, + function (n) { + return adn(), rZ((p3(), sWn), n); + }, + ); + Wfn(1725, 1, {}, _r), + (Fjn.Kb = function (n) { + return hH(new SR(null, new Nz(Yx(n, 101).j, 16)), new Xr()); + }), + EF(YIn, "PortSideAssigner/lambda$1$Type", 1725), + Wfn(1726, 1, {}, Fr), + (Fjn.Kb = function (n) { + return Yx(n, 113).d; + }), + EF(YIn, "PortSideAssigner/lambda$2$Type", 1726), + Wfn(1727, 1, PEn, Br), + (Fjn.td = function (n) { + whn(Yx(n, 11), (Ikn(), Tit)); + }), + EF(YIn, "PortSideAssigner/lambda$3$Type", 1727), + Wfn(1728, 1, {}, Hr), + (Fjn.Kb = function (n) { + return Yx(n, 113).d; + }), + EF(YIn, "PortSideAssigner/lambda$4$Type", 1728), + Wfn(1729, 1, PEn, nd), + (Fjn.td = function (n) { + !(function (n, t) { + whn(t, n); + })(this.a, Yx(n, 11)); + }), + EF(YIn, "PortSideAssigner/lambda$5$Type", 1729), + Wfn(1730, 1, FMn, zr), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return eO(t.j.c.length, n.j.c.length); + })(Yx(n, 101), Yx(t, 101)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(YIn, "PortSideAssigner/lambda$6$Type", 1730), + Wfn(1731, 1, FMn, Ur), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return eO(eR(n.d), eR(t.d)); + })(Yx(n, 113), Yx(t, 113)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(YIn, "PortSideAssigner/lambda$7$Type", 1731), + Wfn(805, 1, YEn, Xr), + (Fjn.Mb = function (n) { + return Yx(n, 113).c; + }), + EF(YIn, "PortSideAssigner/lambda$8$Type", 805), + Wfn(2009, 1, {}), + EF(JIn, "AbstractSelfLoopRouter", 2009), + Wfn(1750, 1, FMn, nc), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return eO(n.a.d.p, t.a.d.p); + })(Yx(n, 101), Yx(t, 101)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(JIn, ISn, 1750), + Wfn(1751, 1, FMn, tc), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return eO(t.a.d.p, n.a.d.p); + })(Yx(n, 101), Yx(t, 101)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(JIn, CSn, 1751), + Wfn(1793, 2009, {}, ec), + (Fjn.Uf = function (n, t, e) { + return e; + }), + EF(JIn, "OrthogonalSelfLoopRouter", 1793), + Wfn(1795, 1, PEn, $M), + (Fjn.td = function (n) { + ptn(this.b, this.a, Yx(n, 8)); + }), + EF(JIn, "OrthogonalSelfLoopRouter/lambda$0$Type", 1795), + Wfn(1794, 1793, {}, ic), + (Fjn.Uf = function (n, t, i) { + var r, c; + return ( + A$(i, 0, mN(dO((r = n.c.d).n), r.a)), + KD(i, mN(dO((c = n.d.d).n), c.a)), + (function (n) { + var t, i, r, c, a, u, o, s; + for (s = new Nv(), o = null, i = Yx(IX((t = Ztn(n, 0))), 8), c = Yx(IX(t), 8); t.b != t.d.c; ) + (o = i), + (i = c), + (c = Yx(IX(t), 8)), + (a = AZ(yN(new QS(o.a, o.b), i))), + (u = AZ(yN(new QS(c.a, c.b), i))), + (r = 10), + (r = e.Math.min(r, e.Math.abs(a.a + a.b) / 2)), + (r = e.Math.min(r, e.Math.abs(u.a + u.b) / 2)), + (a.a = GD(a.a) * r), + (a.b = GD(a.b) * r), + (u.a = GD(u.a) * r), + (u.b = GD(u.b) * r), + KD(s, mN(a, i)), + KD(s, mN(u, i)); + return s; + })(i) + ); + }), + EF(JIn, "PolylineSelfLoopRouter", 1794), + Wfn(1746, 1, {}, Jh), + (Fjn.a = null), + EF(JIn, "RoutingDirector", 1746), + Wfn(1747, 1, FMn, rc), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return ZE(), eO(n.d.p, t.d.p); + })(Yx(n, 113), Yx(t, 113)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(JIn, "RoutingDirector/lambda$0$Type", 1747), + Wfn(1748, 1, {}, cc), + (Fjn.Kb = function (n) { + return ZE(), Yx(n, 101).j; + }), + EF(JIn, "RoutingDirector/lambda$1$Type", 1748), + Wfn(1749, 1, PEn, ac), + (Fjn.td = function (n) { + ZE(), Yx(n, 15).ad(hWn); + }), + EF(JIn, "RoutingDirector/lambda$2$Type", 1749), + Wfn(1752, 1, {}, uc), + EF(JIn, "RoutingSlotAssigner", 1752), + Wfn(1753, 1, YEn, td), + (Fjn.Mb = function (n) { + return (function (n, t) { + return KA(t.b, n); + })(this.a, Yx(n, 101)); + }), + EF(JIn, "RoutingSlotAssigner/lambda$0$Type", 1753), + Wfn(1754, 1, FMn, ed), + (Fjn.ue = function (n, t) { + return (function (n, t, e) { + return eO(t.d[n.g], e.d[n.g]); + })(this.a, Yx(n, 101), Yx(t, 101)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(JIn, "RoutingSlotAssigner/lambda$1$Type", 1754), + Wfn(1796, 1793, {}, oc), + (Fjn.Uf = function (n, t, e) { + var i, r, c, a; + return ( + (i = ty(fL(cen(n.b.g.b, (gjn(), D0n))))), + (function (n, t, e, i, r) { + var c, a, u, o, s; + for (c = n.c.d.j, a = Yx(ken(e, 0), 8), s = 1; s < e.b; s++) + (o = Yx(ken(e, s), 8)), + VW(i, a, i.c.b, i.c), + (u = KO(mN(new fC(a), o), 0.5)), + mN(u, KO(new gz(i6(c)), r)), + VW(i, u, i.c.b, i.c), + (a = o), + (c = 0 == t ? A9(c) : C9(c)); + KD(i, (S$(0 != e.b), Yx(e.c.b.c, 8))); + })(n, t, e, (a = new _$(x4(Gy(B7n, 1), TEn, 8, 0, [((c = n.c.d), mN(new fC(c.n), c.a))]))), i), + KD(a, mN(new fC((r = n.d.d).n), r.a)), + fin(new Tvn(a)) + ); + }), + EF(JIn, "SplineSelfLoopRouter", 1796), + Wfn(578, 1, FMn, L2, MD), + (Fjn.ue = function (n, t) { + return Qkn(this, Yx(n, 10), Yx(t, 10)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(ZIn, "ModelOrderNodeComparator", 578), + Wfn(1755, 1, YEn, sc), + (Fjn.Mb = function (n) { + return 0 != Yx(n, 11).e.c.length; + }), + EF(ZIn, "ModelOrderNodeComparator/lambda$0$Type", 1755), + Wfn(1756, 1, {}, hc), + (Fjn.Kb = function (n) { + return Yx(TR(Yx(n, 11).e, 0), 17).c; + }), + EF(ZIn, "ModelOrderNodeComparator/lambda$1$Type", 1756), + Wfn(1757, 1, YEn, fc), + (Fjn.Mb = function (n) { + return 0 != Yx(n, 11).e.c.length; + }), + EF(ZIn, "ModelOrderNodeComparator/lambda$2$Type", 1757), + Wfn(1758, 1, {}, lc), + (Fjn.Kb = function (n) { + return Yx(TR(Yx(n, 11).e, 0), 17).c; + }), + EF(ZIn, "ModelOrderNodeComparator/lambda$3$Type", 1758), + Wfn(1759, 1, YEn, bc), + (Fjn.Mb = function (n) { + return 0 != Yx(n, 11).e.c.length; + }), + EF(ZIn, "ModelOrderNodeComparator/lambda$4$Type", 1759), + Wfn(806, 1, FMn, gJ, xM), + (Fjn.ue = function (n, t) { + return n_(this, n, t); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(ZIn, "ModelOrderPortComparator", 806), + Wfn(801, 1, {}, wc), + (Fjn.Vf = function (n, t) { + var i, r, c, a; + for (c = Pon(t), i = new ip(), a = t.f / c, r = 1; r < c; ++r) eD(i, d9(WR(D3(e.Math.round(r * a))))); + return i; + }), + (Fjn.Wf = function () { + return !1; + }), + EF(nCn, "ARDCutIndexHeuristic", 801), + Wfn(1479, 1, dIn, dc), + (Fjn.pf = function (n, t) { + kgn(Yx(n, 37), t); + }), + EF(nCn, "BreakingPointInserter", 1479), + Wfn(305, 1, { 305: 1 }, LX), + (Fjn.Ib = function () { + var n; + return ( + ((n = new Ay()).a += "BPInfo["), + (n.a += "\n\tstart="), + mI(n, this.i), + (n.a += "\n\tend="), + mI(n, this.a), + (n.a += "\n\tnodeStartEdge="), + mI(n, this.e), + (n.a += "\n\tstartEndEdge="), + mI(n, this.j), + (n.a += "\n\toriginalEdge="), + mI(n, this.f), + (n.a += "\n\tstartInLayerDummy="), + mI(n, this.k), + (n.a += "\n\tstartInLayerEdge="), + mI(n, this.n), + (n.a += "\n\tendInLayerDummy="), + mI(n, this.b), + (n.a += "\n\tendInLayerEdge="), + mI(n, this.c), + n.a + ); + }), + EF(nCn, "BreakingPointInserter/BPInfo", 305), + Wfn(652, 1, { 652: 1 }, fd), + (Fjn.a = !1), + (Fjn.b = 0), + (Fjn.c = 0), + EF(nCn, "BreakingPointInserter/Cut", 652), + Wfn(1480, 1, dIn, gc), + (Fjn.pf = function (n, t) { + wbn(Yx(n, 37), t); + }), + EF(nCn, "BreakingPointProcessor", 1480), + Wfn(1481, 1, YEn, pc), + (Fjn.Mb = function (n) { + return TZ(Yx(n, 10)); + }), + EF(nCn, "BreakingPointProcessor/0methodref$isEnd$Type", 1481), + Wfn(1482, 1, YEn, vc), + (Fjn.Mb = function (n) { + return MZ(Yx(n, 10)); + }), + EF(nCn, "BreakingPointProcessor/1methodref$isStart$Type", 1482), + Wfn(1483, 1, dIn, mc), + (Fjn.pf = function (n, t) { + !(function (n, t, e) { + var i, r, c, a; + for (run(e, "Breaking Point Removing", 1), n.a = Yx(Aun(t, (gjn(), b1n)), 218), r = new pb(t.b); r.a < r.c.c.length; ) + for (a = new pb(Xz(Yx(Hz(r), 29).a)); a.a < a.c.c.length; ) + TZ((c = Yx(Hz(a), 10))) && !(i = Yx(Aun(c, (Ojn(), YVn)), 305)).d && Fkn(n, i); + Ron(e); + })(this, Yx(n, 37), t); + }), + EF(nCn, "BreakingPointRemover", 1483), + Wfn(1484, 1, PEn, yc), + (Fjn.td = function (n) { + Yx(n, 128).k = !0; + }), + EF(nCn, "BreakingPointRemover/lambda$0$Type", 1484), + Wfn(797, 1, {}, rln), + (Fjn.b = 0), + (Fjn.e = 0), + (Fjn.f = 0), + (Fjn.j = 0), + EF(nCn, "GraphStats", 797), + Wfn(798, 1, {}, kc), + (Fjn.Ce = function (n, t) { + return e.Math.max(ty(fL(n)), ty(fL(t))); + }), + EF(nCn, "GraphStats/0methodref$max$Type", 798), + Wfn(799, 1, {}, jc), + (Fjn.Ce = function (n, t) { + return e.Math.max(ty(fL(n)), ty(fL(t))); + }), + EF(nCn, "GraphStats/2methodref$max$Type", 799), + Wfn(1660, 1, {}, Ec), + (Fjn.Ce = function (n, t) { + return (function (n, t) { + return vB(n), n + (vB(t), t); + })(fL(n), fL(t)); + }), + EF(nCn, "GraphStats/lambda$1$Type", 1660), + Wfn(1661, 1, {}, id), + (Fjn.Kb = function (n) { + return ien(this.a, Yx(n, 29)); + }), + EF(nCn, "GraphStats/lambda$2$Type", 1661), + Wfn(1662, 1, {}, rd), + (Fjn.Kb = function (n) { + return Lbn(this.a, Yx(n, 29)); + }), + EF(nCn, "GraphStats/lambda$6$Type", 1662), + Wfn(800, 1, {}, Tc), + (Fjn.Vf = function (n, t) { + return Yx(Aun(n, (gjn(), Z0n)), 15) || (XH(), XH(), TFn); + }), + (Fjn.Wf = function () { + return !1; + }), + EF(nCn, "ICutIndexCalculator/ManualCutIndexCalculator", 800), + Wfn(802, 1, {}, Mc), + (Fjn.Vf = function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k; + for ( + null == t.n && Win(t), + k = t.n, + null == t.d && Win(t), + s = t.d, + (y = VQ(Jot, rMn, 25, k.length, 15, 1))[0] = k[0], + v = k[0], + h = 1; + h < k.length; + h++ + ) + (y[h] = y[h - 1] + k[h]), (v += k[h]); + for ( + c = Pon(t) - 1, u = Yx(Aun(n, (gjn(), n2n)), 19).a, r = ZTn, i = new ip(), b = e.Math.max(0, c - u); + b <= e.Math.min(t.f - 1, c + u); + b++ + ) { + if (((g = v / (b + 1)), (p = 0), (f = 1), (a = new ip()), (m = ZTn), (l = 0), (o = 0), (d = s[0]), 0 == b)) + (m = v), null == t.g && (t.g = x2(t, new jc())), (o = ty(t.g)); + else { + for (; f < t.f; ) + y[f - 1] - p >= g && + (eD(a, d9(f)), (m = e.Math.max(m, y[f - 1] - l)), (o += d), (p += y[f - 1] - p), (l = y[f - 1]), (d = s[f])), + (d = e.Math.max(d, s[f])), + ++f; + o += d; + } + (w = e.Math.min(1 / m, 1 / t.b / o)) > r && ((r = w), (i = a)); + } + return i; + }), + (Fjn.Wf = function () { + return !1; + }), + EF(nCn, "MSDCutIndexHeuristic", 802), + Wfn(1617, 1, dIn, Sc), + (Fjn.pf = function (n, t) { + Cvn(Yx(n, 37), t); + }), + EF(nCn, "SingleEdgeGraphWrapper", 1617), + Wfn(227, 22, { 3: 1, 35: 1, 22: 1, 227: 1 }, FM); + var vWn, + mWn, + yWn, + kWn = X1( + tCn, + "CenterEdgeLabelPlacementStrategy", + 227, + u_n, + function () { + return psn(), x4(Gy(kWn, 1), XEn, 227, 0, [bWn, dWn, lWn, wWn, gWn, fWn]); + }, + function (n) { + return psn(), rZ((y1(), vWn), n); + }, + ); + Wfn(422, 22, { 3: 1, 35: 1, 22: 1, 422: 1 }, BM); + var jWn, + EWn, + TWn, + MWn, + SWn = X1( + tCn, + "ConstraintCalculationStrategy", + 422, + u_n, + function () { + return aY(), x4(Gy(SWn, 1), XEn, 422, 0, [mWn, yWn]); + }, + function (n) { + return aY(), rZ((AW(), jWn), n); + }, + ); + Wfn(314, 22, { 3: 1, 35: 1, 22: 1, 314: 1, 246: 1, 234: 1 }, HM), + (Fjn.Kf = function () { + return Shn(this); + }), + (Fjn.Xf = function () { + return Shn(this); + }); + var PWn, + IWn, + CWn, + OWn, + AWn = X1( + tCn, + "CrossingMinimizationStrategy", + 314, + u_n, + function () { + return O0(), x4(Gy(AWn, 1), XEn, 314, 0, [TWn, EWn, MWn]); + }, + function (n) { + return O0(), rZ((TQ(), PWn), n); + }, + ); + Wfn(337, 22, { 3: 1, 35: 1, 22: 1, 337: 1 }, qM); + var $Wn, + LWn, + NWn, + xWn, + DWn, + RWn, + KWn = X1( + tCn, + "CuttingStrategy", + 337, + u_n, + function () { + return f0(), x4(Gy(KWn, 1), XEn, 337, 0, [IWn, OWn, CWn]); + }, + function (n) { + return f0(), rZ((MQ(), $Wn), n); + }, + ); + Wfn(335, 22, { 3: 1, 35: 1, 22: 1, 335: 1, 246: 1, 234: 1 }, GM), + (Fjn.Kf = function () { + return fln(this); + }), + (Fjn.Xf = function () { + return fln(this); + }); + var _Wn, + FWn, + BWn, + HWn = X1( + tCn, + "CycleBreakingStrategy", + 335, + u_n, + function () { + return min(), x4(Gy(HWn, 1), XEn, 335, 0, [NWn, LWn, DWn, RWn, xWn]); + }, + function (n) { + return min(), rZ((lZ(), _Wn), n); + }, + ); + Wfn(419, 22, { 3: 1, 35: 1, 22: 1, 419: 1 }, zM); + var qWn, + GWn, + zWn, + UWn, + XWn = X1( + tCn, + "DirectionCongruency", + 419, + u_n, + function () { + return fZ(), x4(Gy(XWn, 1), XEn, 419, 0, [FWn, BWn]); + }, + function (n) { + return fZ(), rZ((PW(), qWn), n); + }, + ); + Wfn(450, 22, { 3: 1, 35: 1, 22: 1, 450: 1 }, UM); + var WWn, + VWn, + QWn, + YWn, + JWn, + ZWn, + nVn, + tVn = X1( + tCn, + "EdgeConstraint", + 450, + u_n, + function () { + return i5(), x4(Gy(tVn, 1), XEn, 450, 0, [zWn, GWn, UWn]); + }, + function (n) { + return i5(), rZ((SQ(), WWn), n); + }, + ); + Wfn(276, 22, { 3: 1, 35: 1, 22: 1, 276: 1 }, XM); + var eVn, + iVn, + rVn, + cVn = X1( + tCn, + "EdgeLabelSideSelection", + 276, + u_n, + function () { + return pon(), x4(Gy(cVn, 1), XEn, 276, 0, [QWn, VWn, JWn, YWn, nVn, ZWn]); + }, + function (n) { + return pon(), rZ((T1(), eVn), n); + }, + ); + Wfn(479, 22, { 3: 1, 35: 1, 22: 1, 479: 1 }, WM); + var aVn, + uVn, + oVn, + sVn, + hVn, + fVn, + lVn, + bVn = X1( + tCn, + "EdgeStraighteningStrategy", + 479, + u_n, + function () { + return cJ(), x4(Gy(bVn, 1), XEn, 479, 0, [rVn, iVn]); + }, + function (n) { + return cJ(), rZ((IW(), aVn), n); + }, + ); + Wfn(274, 22, { 3: 1, 35: 1, 22: 1, 274: 1 }, VM); + var wVn, + dVn, + gVn, + pVn, + vVn, + mVn, + yVn, + kVn = X1( + tCn, + "FixedAlignment", + 274, + u_n, + function () { + return Wcn(), x4(Gy(kVn, 1), XEn, 274, 0, [hVn, sVn, lVn, oVn, fVn, uVn]); + }, + function (n) { + return Wcn(), rZ((j1(), wVn), n); + }, + ); + Wfn(275, 22, { 3: 1, 35: 1, 22: 1, 275: 1 }, QM); + var jVn, + EVn, + TVn, + MVn, + SVn, + PVn, + IVn, + CVn, + OVn, + AVn, + $Vn, + LVn = X1( + tCn, + "GraphCompactionStrategy", + 275, + u_n, + function () { + return uon(), x4(Gy(LVn, 1), XEn, 275, 0, [mVn, gVn, yVn, vVn, pVn, dVn]); + }, + function (n) { + return uon(), rZ((k1(), jVn), n); + }, + ); + Wfn(256, 22, { 3: 1, 35: 1, 22: 1, 256: 1 }, YM); + var NVn, + xVn, + DVn, + RVn, + KVn = X1( + tCn, + "GraphProperties", + 256, + u_n, + function () { + return edn(), x4(Gy(KVn, 1), XEn, 256, 0, [TVn, SVn, PVn, IVn, CVn, OVn, $Vn, EVn, MVn, AVn]); + }, + function (n) { + return edn(), rZ((n5(), NVn), n); + }, + ); + Wfn(292, 22, { 3: 1, 35: 1, 22: 1, 292: 1 }, JM); + var _Vn, + FVn, + BVn, + HVn, + qVn = X1( + tCn, + "GreedySwitchType", + 292, + u_n, + function () { + return r4(), x4(Gy(qVn, 1), XEn, 292, 0, [DVn, RVn, xVn]); + }, + function (n) { + return r4(), rZ((CQ(), _Vn), n); + }, + ); + Wfn(303, 22, { 3: 1, 35: 1, 22: 1, 303: 1 }, ZM); + var GVn, + zVn, + UVn, + XVn = X1( + tCn, + "InLayerConstraint", + 303, + u_n, + function () { + return AJ(), x4(Gy(XVn, 1), XEn, 303, 0, [BVn, HVn, FVn]); + }, + function (n) { + return AJ(), rZ((IQ(), GVn), n); + }, + ); + Wfn(420, 22, { 3: 1, 35: 1, 22: 1, 420: 1 }, nS); + var WVn, + VVn, + QVn, + YVn, + JVn, + ZVn, + nQn, + tQn, + eQn, + iQn, + rQn, + cQn, + aQn, + uQn, + oQn, + sQn, + hQn, + fQn, + lQn, + bQn, + wQn, + dQn, + gQn, + pQn, + vQn, + mQn, + yQn, + kQn, + jQn, + EQn, + TQn, + MQn, + SQn, + PQn, + IQn, + CQn, + OQn, + AQn, + $Qn, + LQn, + NQn, + xQn, + DQn, + RQn, + KQn, + _Qn, + FQn, + BQn, + HQn, + qQn, + GQn, + zQn, + UQn, + XQn, + WQn, + VQn, + QQn, + YQn, + JQn, + ZQn, + nYn, + tYn, + eYn, + iYn, + rYn = X1( + tCn, + "InteractiveReferencePoint", + 420, + u_n, + function () { + return dX(), x4(Gy(rYn, 1), XEn, 420, 0, [zVn, UVn]); + }, + function (n) { + return dX(), rZ(($W(), WVn), n); + }, + ); + Wfn(163, 22, { 3: 1, 35: 1, 22: 1, 163: 1 }, cS); + var cYn, + aYn, + uYn, + oYn, + sYn, + hYn, + fYn, + lYn, + bYn, + wYn, + dYn, + gYn, + pYn, + vYn, + mYn, + yYn, + kYn, + jYn, + EYn, + TYn, + MYn, + SYn, + PYn, + IYn, + CYn, + OYn, + AYn, + $Yn, + LYn, + NYn, + xYn, + DYn, + RYn, + KYn, + _Yn, + FYn, + BYn, + HYn, + qYn, + GYn, + zYn, + UYn, + XYn, + WYn, + VYn, + QYn, + YYn, + JYn, + ZYn, + nJn, + tJn, + eJn, + iJn, + rJn, + cJn, + aJn, + uJn, + oJn, + sJn, + hJn, + fJn, + lJn, + bJn, + wJn, + dJn, + gJn, + pJn, + vJn, + mJn, + yJn, + kJn, + jJn, + EJn, + TJn, + MJn, + SJn, + PJn, + IJn, + CJn, + OJn, + AJn, + $Jn, + LJn, + NJn, + xJn, + DJn, + RJn, + KJn, + _Jn, + FJn, + BJn, + HJn, + qJn, + GJn, + zJn, + UJn, + XJn, + WJn, + VJn, + QJn, + YJn, + JJn, + ZJn, + nZn, + tZn, + eZn, + iZn, + rZn, + cZn, + aZn, + uZn, + oZn, + sZn, + hZn, + fZn, + lZn, + bZn, + wZn, + dZn, + gZn, + pZn, + vZn, + mZn, + yZn, + kZn, + jZn, + EZn, + TZn, + MZn, + SZn, + PZn, + IZn, + CZn, + OZn, + AZn, + $Zn, + LZn, + NZn, + xZn, + DZn, + RZn, + KZn, + _Zn, + FZn, + BZn, + HZn, + qZn, + GZn, + zZn, + UZn, + XZn, + WZn, + VZn, + QZn, + YZn, + JZn, + ZZn, + n1n, + t1n, + e1n, + i1n, + r1n, + c1n, + a1n, + u1n, + o1n, + s1n, + h1n, + f1n, + l1n, + b1n, + w1n, + d1n, + g1n, + p1n, + v1n, + m1n, + y1n, + k1n, + j1n, + E1n, + T1n, + M1n, + S1n, + P1n, + I1n, + C1n, + O1n, + A1n, + $1n, + L1n, + N1n, + x1n, + D1n, + R1n, + K1n, + _1n, + F1n, + B1n, + H1n, + q1n, + G1n, + z1n, + U1n, + X1n, + W1n, + V1n, + Q1n, + Y1n, + J1n, + Z1n, + n0n, + t0n, + e0n, + i0n, + r0n, + c0n, + a0n, + u0n, + o0n, + s0n, + h0n, + f0n, + l0n, + b0n, + w0n, + d0n, + g0n, + p0n, + v0n, + m0n, + y0n, + k0n, + j0n, + E0n, + T0n, + M0n, + S0n, + P0n, + I0n, + C0n, + O0n, + A0n, + $0n, + L0n, + N0n, + x0n, + D0n, + R0n, + K0n, + _0n, + F0n, + B0n, + H0n, + q0n, + G0n, + z0n, + U0n, + X0n, + W0n, + V0n, + Q0n, + Y0n, + J0n, + Z0n, + n2n, + t2n, + e2n, + i2n, + r2n, + c2n, + a2n, + u2n, + o2n, + s2n, + h2n, + f2n, + l2n, + b2n, + w2n, + d2n, + g2n, + p2n = X1( + tCn, + "LayerConstraint", + 163, + u_n, + function () { + return d7(), x4(Gy(p2n, 1), XEn, 163, 0, [iYn, ZQn, nYn, tYn, eYn]); + }, + function (n) { + return d7(), rZ((dZ(), cYn), n); + }, + ); + Wfn(848, 1, fSn, of), + (Fjn.Qe = function (n) { + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), uCn), ""), "Direction Congruency"), + "Specifies how drawings of the same graph with different layout directions compare to each other: either a natural reading direction is preserved or the drawings are rotated versions of each other.", + ), + BYn, + ), + (lsn(), O7n), + ), + XWn, + ), + J9((Qtn(), T7n)), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), oCn), ""), "Feedback Edges"), + "Whether feedback edges should be highlighted by routing around the nodes.", + ), + (TA(), !1), + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), sCn), ""), "Interactive Reference Point"), + "Determines which point of a node is considered by interactive layout phases.", + ), + hJn, + ), + O7n, + ), + rYn, + ), + J9(T7n), + ), + ), + ), + xU(n, sCn, pCn, lJn), + xU(n, sCn, PCn, fJn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), hCn), ""), "Merge Edges"), + "Edges that have no ports are merged so they touch the connected nodes at the same points. When this option is disabled, one port is created for each edge directly connected to a node. When it is enabled, all such incoming edges share an input port, and all outgoing edges share an output port.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), fCn), ""), "Merge Hierarchy-Crossing Edges"), + "If hierarchical layout is active, hierarchy-crossing edges use as few hierarchical ports as possible. They are broken by the algorithm, with hierarchical ports inserted as required. Usually, one such port is created for each edge at each hierarchy crossing point. With this option set to true, we try to create as few hierarchical ports as possible in the process. In particular, all edges that form a hyperedge can share a port.", + ), + !0, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + (function (n, t) { + return (n.f = t), n; + })( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), lCn), ""), "Allow Non-Flow Ports To Switch Sides"), + "Specifies whether non-flow ports may switch sides if their node's port constraints are either FIXED_SIDE or FIXED_ORDER. A non-flow port is a port on a side that is not part of the currently configured layout flow. For instance, given a left-to-right layout direction, north and south ports would be considered non-flow ports. Further note that the underlying criterium whether to switch sides or not solely relies on the minimization of edge crossings. Hence, edge length and other aesthetics criteria are not addressed.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(M7n), + ), + x4(Gy(fFn, 1), TEn, 2, 6, ["org.eclipse.elk.layered.northOrSouthPort"]), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), bCn), ""), "Port Sorting Strategy"), + "Only relevant for nodes with FIXED_SIDE port constraints. Determines the way a node's ports are distributed on the sides of a node if their order is not prescribed. The option is set on parent nodes.", + ), + VJn, + ), + O7n, + ), + c3n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk(bk(fk(lk(new Fu(), wCn), ""), "Thoroughness"), "How much effort should be spent to produce a nice layout."), + d9(7), + ), + $7n, + ), + U_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), dCn), ""), "Add Unnecessary Bendpoints"), + "Adds bend points even if an edge does not change direction. If true, each long edge dummy will contribute a bend point to its edges and hierarchy-crossing edges will always get a bend point where they cross hierarchy boundaries. By default, bend points are only added where an edge changes direction.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), gCn), ""), "Generate Position and Layer IDs"), + "If enabled position id and layer id are generated, which are usually only used internally when setting the interactiveLayout option. This option should be specified on the root node.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), pCn), "cycleBreaking"), "Cycle Breaking Strategy"), + "Strategy for cycle breaking. Cycle breaking looks for cycles in the graph and determines which edges to reverse to break the cycles. Reversed edges will end up pointing to the opposite direction of regular edges (that is, reversed edges will point left if edges usually point right).", + ), + _Yn, + ), + O7n, + ), + HWn, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk(gk(hk(sk(bk(fk(lk(new Fu(), vCn), SOn), "Node Layering Strategy"), "Strategy for node layering."), PJn), O7n), j2n), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), mCn), SOn), "Layer Constraint"), + "Determines a constraint on the placement of the node regarding the layering.", + ), + pJn, + ), + O7n, + ), + p2n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), yCn), SOn), "Layer Choice Constraint"), + "Allows to set a constraint regarding the layer placement of a node. Let i be the value of teh constraint. Assumed the drawing has n layers and i < n. If set to i, it expresses that the node should be placed in i-th layer. Should i>=n be true then the node is placed in the last layer of the drawing. Note that this option is not part of any of ELK Layered's default configurations but is only evaluated as part of the `InteractiveLayeredGraphVisitor`, which must be applied manually or used via the `DiagramLayoutEngine.", + ), + d9(-1), + ), + $7n, + ), + U_n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), kCn), SOn), "Layer ID"), + "Layer identifier that was calculated by ELK Layered for a node. This is only generated if interactiveLayot or generatePositionAndLayerIds is set.", + ), + d9(-1), + ), + $7n, + ), + U_n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), jCn), POn), "Upper Bound On Width [MinWidth Layerer]"), + "Defines a loose upper bound on the width of the MinWidth layerer. If set to '-1' multiple values are tested and the best result is selected.", + ), + d9(4), + ), + $7n, + ), + U_n, + ), + J9(T7n), + ), + ), + ), + xU(n, jCn, vCn, yJn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), ECn), POn), "Upper Layer Estimation Scaling Factor [MinWidth Layerer]"), + "Multiplied with Upper Bound On Width for defining an upper bound on the width of layers which haven't been determined yet, but whose maximum width had been (roughly) estimated by the MinWidth algorithm. Compensates for too high estimations. If set to '-1' multiple values are tested and the best result is selected.", + ), + d9(2), + ), + $7n, + ), + U_n, + ), + J9(T7n), + ), + ), + ), + xU(n, ECn, vCn, jJn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), TCn), IOn), "Node Promotion Strategy"), + "Reduces number of dummy nodes after layering phase (if possible).", + ), + MJn, + ), + O7n, + ), + Q2n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), MCn), IOn), "Max Node Promotion Iterations"), + "Limits the number of iterations for node promotion.", + ), + d9(0), + ), + $7n, + ), + U_n, + ), + J9(T7n), + ), + ), + ), + xU(n, MCn, TCn, null), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), SCn), "layering.coffmanGraham"), "Layer Bound"), + "The maximum number of nodes allowed per layer.", + ), + d9(Yjn), + ), + $7n, + ), + U_n, + ), + J9(T7n), + ), + ), + ), + xU(n, SCn, vCn, wJn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk(bk(fk(lk(new Fu(), PCn), COn), "Crossing Minimization Strategy"), "Strategy for crossing minimization."), + RYn, + ), + O7n, + ), + AWn, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), ICn), COn), "Force Node Model Order"), + "The node order given by the model does not change to produce a better layout. E.g. if node A is before node B in the model this is not changed during crossing minimization. This assumes that the node model order is already respected before crossing minimization. This can be achieved by setting considerModelOrder.strategy to NODES_AND_EDGES.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), CCn), COn), "Hierarchical Sweepiness"), + "How likely it is to use cross-hierarchy (1) vs bottom-up (-1).", + ), + 0.1, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + xU(n, CCn, OOn, AYn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), OCn), COn), "Semi-Interactive Crossing Minimization"), + "Preserves the order of nodes within a layer but still minimizes crossings between edges connecting long edge dummies. Derives the desired order from positions specified by the 'org.eclipse.elk.position' layout option. Requires a crossing minimization strategy that is able to process 'in-layer' constraints.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + xU(n, OCn, PCn, xYn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), ACn), COn), "Position Choice Constraint"), + "Allows to set a constraint regarding the position placement of a node in a layer. Assumed the layer in which the node placed includes n other nodes and i < n. If set to i, it expresses that the node should be placed at the i-th position. Should i>=n be true then the node is placed at the last position in the layer. Note that this option is not part of any of ELK Layered's default configurations but is only evaluated as part of the `InteractiveLayeredGraphVisitor`, which must be applied manually or used via the `DiagramLayoutEngine.", + ), + d9(-1), + ), + $7n, + ), + U_n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), $Cn), COn), "Position ID"), + "Position within a layer that was determined by ELK Layered for a node. This is only generated if interactiveLayot or generatePositionAndLayerIds is set.", + ), + d9(-1), + ), + $7n, + ), + U_n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), LCn), AOn), "Greedy Switch Activation Threshold"), + "By default it is decided automatically if the greedy switch is activated or not. The decision is based on whether the size of the input graph (without dummy nodes) is smaller than the value of this option. A '0' enforces the activation.", + ), + d9(40), + ), + $7n, + ), + U_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), NCn), AOn), "Greedy Switch Crossing Minimization"), + "Greedy Switch strategy for crossing minimization. The greedy switch heuristic is executed after the regular crossing minimization as a post-processor. Note that if 'hierarchyHandling' is set to 'INCLUDE_CHILDREN', the 'greedySwitchHierarchical.type' option must be used.", + ), + IYn, + ), + O7n, + ), + qVn, + ), + J9(T7n), + ), + ), + ), + xU(n, NCn, PCn, CYn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk( + fk(lk(new Fu(), xCn), "crossingMinimization.greedySwitchHierarchical"), + "Greedy Switch Crossing Minimization (hierarchical)", + ), + "Activates the greedy switch heuristic in case hierarchical layout is used. The differences to the non-hierarchical case (see 'greedySwitch.type') are: 1) greedy switch is inactive by default, 3) only the option value set on the node at which hierarchical layout starts is relevant, and 2) if it's activated by the user, it properly addresses hierarchy-crossing edges.", + ), + TYn, + ), + O7n, + ), + qVn, + ), + J9(T7n), + ), + ), + ), + xU(n, xCn, PCn, MYn), + xU(n, xCn, OOn, SYn), + j7( + n, + new isn( + dk( + wk( + gk(hk(sk(bk(fk(lk(new Fu(), DCn), $On), "Node Placement Strategy"), "Strategy for node placement."), XJn), O7n), + z2n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), RCn), $On), "Favor Straight Edges Over Balancing"), + "Favor straight edges over a balanced node placement. The default behavior is determined automatically based on the used 'edgeRouting'. For an orthogonal style it is set to true, for all other styles to false.", + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + xU(n, RCn, DCn, RJn), + xU(n, RCn, DCn, KJn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), KCn), LOn), "BK Edge Straightening"), + "Specifies whether the Brandes Koepf node placer tries to increase the number of straight edges at the expense of diagram size. There is a subtle difference to the 'favorStraightEdges' option, which decides whether a balanced placement of the nodes is desired, or not. In bk terms this means combining the four alignments into a single balanced one, or not. This option on the other hand tries to straighten additional edges during the creation of each of the four alignments.", + ), + AJn, + ), + O7n, + ), + bVn, + ), + J9(T7n), + ), + ), + ), + xU(n, KCn, DCn, $Jn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), _Cn), LOn), "BK Fixed Alignment"), + "Tells the BK node placer to use a certain alignment (out of its four) instead of the one producing the smallest height, or the combination of all four.", + ), + NJn, + ), + O7n, + ), + kVn, + ), + J9(T7n), + ), + ), + ), + xU(n, _Cn, DCn, xJn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), FCn), "nodePlacement.linearSegments"), "Linear Segments Deflection Dampening"), + "Dampens the movement of nodes to keep the diagram from getting too large.", + ), + 0.3, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + xU(n, FCn, DCn, FJn), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), BCn), "nodePlacement.networkSimplex"), "Node Flexibility"), + "Aims at shorter and straighter edges. Two configurations are possible: (a) allow ports to move freely on the side they are assigned to (the order is always defined beforehand), (b) additionally allow to enlarge a node wherever it helps. If this option is not configured for a node, the 'nodeFlexibility.default' value is used, which is specified for the node's parent.", + ), + O7n, + ), + x2n, + ), + J9(E7n), + ), + ), + ), + xU(n, BCn, DCn, zJn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), HCn), "nodePlacement.networkSimplex.nodeFlexibility"), "Node Flexibility Default"), + "Default value of the 'nodeFlexibility' option for the children of a hierarchical node.", + ), + qJn, + ), + O7n, + ), + x2n, + ), + J9(T7n), + ), + ), + ), + xU(n, HCn, DCn, GJn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), qCn), NOn), "Self-Loop Distribution"), + "Alter the distribution of the loops around the node. It only takes effect for PortConstraints.FREE.", + ), + VYn, + ), + O7n, + ), + w3n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), GCn), NOn), "Self-Loop Ordering"), + "Alter the ordering of the loops they can either be stacked or sequenced. It only takes effect for PortConstraints.FREE.", + ), + YYn, + ), + O7n, + ), + m3n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), zCn), "edgeRouting.splines"), "Spline Routing Mode"), + "Specifies the way control points are assembled for each individual edge. CONSERVATIVE ensures that edges are properly routed around the nodes but feels rather orthogonal at times. SLOPPY uses fewer control points to obtain curvier edge routes but may result in edges overlapping nodes.", + ), + ZYn, + ), + O7n, + ), + T3n, + ), + J9(T7n), + ), + ), + ), + xU(n, zCn, xOn, nJn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), UCn), "edgeRouting.splines.sloppy"), "Sloppy Spline Layer Spacing Factor"), + "Spacing factor for routing area between layers when using sloppy spline routing.", + ), + 0.2, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + xU(n, UCn, xOn, eJn), + xU(n, UCn, zCn, iJn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), XCn), "edgeRouting.polyline"), "Sloped Edge Zone Width"), + "Width of the strip to the left and to the right of each layer where the polyline edge router is allowed to refrain from ensuring that edges are routed horizontally. This prevents awkward bend points for nodes that extent almost to the edge of their layer.", + ), + 2, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + xU(n, XCn, xOn, XYn), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), WCn), DOn), "Spacing Base Value"), + "An optional base value for all other layout options of the 'spacing' group. It can be used to conveniently alter the overall 'spaciousness' of the drawing. Whenever an explicit value is set for the other layout options, this base value will have no effect. The base value is not inherited, i.e. it must be set for each hierarchical node.", + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), VCn), DOn), "Edge Node Between Layers Spacing"), + "The spacing to be preserved between nodes and edges that are routed next to the node's layer. For the spacing between nodes and edges that cross the node's layer 'spacing.edgeNode' is used.", + ), + 10, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), QCn), DOn), "Edge Edge Between Layer Spacing"), + "Spacing to be preserved between pairs of edges that are routed between the same pair of layers. Note that 'spacing.edgeEdge' is used for the spacing between pairs of edges crossing the same layer.", + ), + 10, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), YCn), DOn), "Node Node Between Layers Spacing"), + "The spacing to be preserved between any pair of nodes of two adjacent layers. Note that 'spacing.nodeNode' is used for the spacing between nodes within the layer itself.", + ), + 20, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), JCn), ROn), "Direction Priority"), + "Defines how important it is to have a certain edge point into the direction of the overall layout. This option is evaluated during the cycle breaking phase.", + ), + d9(0), + ), + $7n, + ), + U_n, + ), + J9(k7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), ZCn), ROn), "Shortness Priority"), + "Defines how important it is to keep an edge as short as possible. This option is evaluated during the layering phase.", + ), + d9(0), + ), + $7n, + ), + U_n, + ), + J9(k7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), nOn), ROn), "Straightness Priority"), + "Defines how important it is to keep an edge straight, i.e. aligned with one of the two axes. This option is evaluated during node placement.", + ), + d9(0), + ), + $7n, + ), + U_n, + ), + J9(k7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk(sk(bk(fk(lk(new Fu(), tOn), KOn), YSn), "Tries to further compact components (disconnected sub-graphs)."), !1), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + xU(n, tOn, DPn, !0), + j7(n, new isn(dk(wk(gk(hk(sk(bk(fk(lk(new Fu(), eOn), _On), "Post Compaction Strategy"), FOn), fYn), O7n), LVn), J9(T7n)))), + j7( + n, + new isn( + dk(wk(gk(hk(sk(bk(fk(lk(new Fu(), iOn), _On), "Post Compaction Constraint Calculation"), FOn), sYn), O7n), SWn), J9(T7n)), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), rOn), BOn), "High Degree Node Treatment"), + "Makes room around high degree nodes to place leafs and trees.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), cOn), BOn), "High Degree Node Threshold"), + "Whether a node is considered to have a high degree.", + ), + d9(16), + ), + $7n, + ), + U_n, + ), + J9(T7n), + ), + ), + ), + xU(n, cOn, rOn, !0), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), aOn), BOn), "High Degree Node Maximum Tree Height"), + "Maximum height of a subtree connected to a high degree node to be moved to separate layers.", + ), + d9(5), + ), + $7n, + ), + U_n, + ), + J9(T7n), + ), + ), + ), + xU(n, aOn, rOn, !0), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), uOn), HOn), "Graph Wrapping Strategy"), + "For certain graphs and certain prescribed drawing areas it may be desirable to split the laid out graph into chunks that are placed side by side. The edges that connect different chunks are 'wrapped' around from the end of one chunk to the start of the other chunk. The points between the chunks are referred to as 'cuts'.", + ), + PZn, + ), + O7n, + ), + F3n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), oOn), HOn), "Additional Wrapped Edges Spacing"), + "To visually separate edges that are wrapped from regularly routed edges an additional spacing value can be specified in form of this layout option. The spacing is added to the regular edgeNode spacing.", + ), + 10, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + xU(n, oOn, uOn, aZn), + xU(n, oOn, uOn, uZn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), sOn), HOn), "Correction Factor for Wrapping"), + "At times and for certain types of graphs the executed wrapping may produce results that are consistently biased in the same fashion: either wrapping to often or to rarely. This factor can be used to correct the bias. Internally, it is simply multiplied with the 'aspect ratio' layout option.", + ), + 1, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + xU(n, sOn, uOn, sZn), + xU(n, sOn, uOn, hZn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), hOn), qOn), "Cutting Strategy"), + "The strategy by which the layer indexes are determined at which the layering crumbles into chunks.", + ), + pZn, + ), + O7n, + ), + KWn, + ), + J9(T7n), + ), + ), + ), + xU(n, hOn, uOn, vZn), + xU(n, hOn, uOn, mZn), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), fOn), qOn), "Manually Specified Cuts"), + "Allows the user to specify her own cuts for a certain graph.", + ), + L7n, + ), + JKn, + ), + J9(T7n), + ), + ), + ), + xU(n, fOn, hOn, lZn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), lOn), "wrapping.cutting.msd"), "MSD Freedom"), + "The MSD cutting strategy starts with an initial guess on the number of chunks the graph should be split into. The freedom specifies how much the strategy may deviate from this guess. E.g. if an initial number of 3 is computed, a freedom of 1 allows 2, 3, and 4 cuts.", + ), + wZn, + ), + $7n, + ), + U_n, + ), + J9(T7n), + ), + ), + ), + xU(n, lOn, hOn, dZn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), bOn), GOn), "Validification Strategy"), + "When wrapping graphs, one can specify indices that are not allowed as split points. The validification strategy makes sure every computed split point is allowed.", + ), + $Zn, + ), + O7n, + ), + C3n, + ), + J9(T7n), + ), + ), + ), + xU(n, bOn, uOn, LZn), + xU(n, bOn, uOn, NZn), + j7(n, new isn(dk(wk(gk(sk(bk(fk(lk(new Fu(), wOn), GOn), "Valid Indices for Wrapping"), null), L7n), JKn), J9(T7n)))), + xU(n, wOn, uOn, CZn), + xU(n, wOn, uOn, OZn), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), dOn), zOn), "Improve Cuts"), + "For general graphs it is important that not too many edges wrap backwards. Thus a compromise between evenly-distributed cuts and the total number of cut edges is sought.", + ), + !0, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + xU(n, dOn, uOn, EZn), + j7( + n, + new isn( + dk(wk(gk(hk(sk(bk(fk(lk(new Fu(), gOn), zOn), "Distance Penalty When Improving Cuts"), null), 2), C7n), H_n), J9(T7n)), + ), + ), + xU(n, gOn, uOn, kZn), + xU(n, gOn, dOn, !0), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), pOn), zOn), "Improve Wrapped Edges"), + "The initial wrapping is performed in a very simple way. As a consequence, edges that wrap from one chunk to another may be unnecessarily long. Activating this option tries to shorten such edges.", + ), + !0, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + xU(n, pOn, uOn, MZn), + j7( + n, + new isn( + dk( + wk( + gk( + hk(sk(bk(fk(lk(new Fu(), vOn), UOn), "Edge Label Side Selection"), "Method to decide on edge label sides."), zYn), + O7n, + ), + cVn, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), mOn), UOn), "Edge Center Label Placement Strategy"), + "Determines in which layer center labels of long edges should be placed.", + ), + qYn, + ), + O7n, + ), + kWn, + ), + tK(T7n, x4(Gy(D7n, 1), XEn, 175, 0, [j7n])), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), yOn), XOn), "Consider Model Order"), + "Preserves the order of nodes and edges in the model file if this does not lead to additional edge crossings. Depending on the strategy this is not always possible since the node and edge order might be conflicting.", + ), + yYn, + ), + O7n, + ), + n3n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), kOn), XOn), "No Model Order"), + "Set on a node to not set a model order for this node even though it is a real node.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), jOn), XOn), "Consider Model Order for Components"), + "If set to NONE the usual ordering strategy (by cumulative node priority and size of nodes) is used. INSIDE_PORT_SIDES orders the components with external ports only inside the groups with the same port side. FORCE_MODEL_ORDER enforces the mode order on components. This option might produce bad alignments and sub optimal drawings in terms of used area since the ordering should be respected.", + ), + bYn, + ), + O7n, + ), + Lzn, + ), + J9(T7n), + ), + ), + ), + xU(n, jOn, DPn, null), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), EOn), XOn), "Long Edge Ordering Strategy"), + "Indicates whether long edges are sorted under, over, or equal to nodes that have no connection to a previous layer in a left-to-right or right-to-left layout. Under and over changes to right and left in a vertical layout.", + ), + pYn, + ), + O7n, + ), + I2n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), TOn), XOn), "Crossing Counter Node Order Influence"), + "Indicates with what percentage (1 for 100%) violations of the node model order are weighted against the crossings e.g. a value of 0.5 means two model order violations are as important as on edge crossing. This allows some edge crossings in favor of preserving the model order. It is advised to set this value to a very small positive value (e.g. 0.001) to have minimal crossing and a optimal node order. Defaults to no influence (0).", + ), + 0, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + xU(n, TOn, yOn, null), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), MOn), XOn), "Crossing Counter Port Order Influence"), + "Indicates with what percentage (1 for 100%) violations of the port model order are weighted against the crossings e.g. a value of 0.5 means two model order violations are as important as on edge crossing. This allows some edge crossings in favor of preserving the model order. It is advised to set this value to a very small positive value (e.g. 0.001) to have minimal crossing and a optimal port order. Defaults to no influence (0).", + ), + 0, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + xU(n, MOn, yOn, null), + Djn((new ff(), n)); + }), + EF(tCn, "LayeredMetaDataProvider", 848), + Wfn(986, 1, fSn, ff), + (Fjn.Qe = function (n) { + Djn(n); + }), + EF(tCn, "LayeredOptions", 986), + Wfn(987, 1, {}, Ic), + (Fjn.$e = function () { + return new cv(); + }), + (Fjn._e = function (n) {}), + EF(tCn, "LayeredOptions/LayeredFactory", 987), + Wfn(1372, 1, {}), + (Fjn.a = 0), + EF(xAn, "ElkSpacings/AbstractSpacingsBuilder", 1372), + Wfn(779, 1372, {}, B7), + EF(tCn, "LayeredSpacings/LayeredSpacingsBuilder", 779), + Wfn(313, 22, { 3: 1, 35: 1, 22: 1, 313: 1, 246: 1, 234: 1 }, tS), + (Fjn.Kf = function () { + return rbn(this); + }), + (Fjn.Xf = function () { + return rbn(this); + }); + var v2n, + m2n, + y2n, + k2n, + j2n = X1( + tCn, + "LayeringStrategy", + 313, + u_n, + function () { + return nun(), x4(Gy(j2n, 1), XEn, 313, 0, [d2n, b2n, f2n, l2n, g2n, w2n]); + }, + function (n) { + return nun(), rZ((E1(), v2n), n); + }, + ); + Wfn(378, 22, { 3: 1, 35: 1, 22: 1, 378: 1 }, eS); + var E2n, + T2n, + M2n, + S2n, + P2n, + I2n = X1( + tCn, + "LongEdgeOrderingStrategy", + 378, + u_n, + function () { + return i8(), x4(Gy(I2n, 1), XEn, 378, 0, [m2n, y2n, k2n]); + }, + function (n) { + return i8(), rZ((OQ(), E2n), n); + }, + ); + Wfn(197, 22, { 3: 1, 35: 1, 22: 1, 197: 1 }, iS); + var C2n, + O2n, + A2n, + $2n, + L2n, + N2n, + x2n = X1( + tCn, + "NodeFlexibility", + 197, + u_n, + function () { + return Hen(), x4(Gy(x2n, 1), XEn, 197, 0, [S2n, P2n, M2n, T2n]); + }, + function (n) { + return Hen(), rZ((JY(), C2n), n); + }, + ); + Wfn(315, 22, { 3: 1, 35: 1, 22: 1, 315: 1, 246: 1, 234: 1 }, rS), + (Fjn.Kf = function () { + return hln(this); + }), + (Fjn.Xf = function () { + return hln(this); + }); + var D2n, + R2n, + K2n, + _2n, + F2n, + B2n, + H2n, + q2n, + G2n, + z2n = X1( + tCn, + "NodePlacementStrategy", + 315, + u_n, + function () { + return ain(), x4(Gy(z2n, 1), XEn, 315, 0, [N2n, A2n, $2n, O2n, L2n]); + }, + function (n) { + return ain(), rZ((bZ(), D2n), n); + }, + ); + Wfn(260, 22, { 3: 1, 35: 1, 22: 1, 260: 1 }, aS); + var U2n, + X2n, + W2n, + V2n, + Q2n = X1( + tCn, + "NodePromotionStrategy", + 260, + u_n, + function () { + return _bn(), x4(Gy(Q2n, 1), XEn, 260, 0, [q2n, K2n, B2n, _2n, F2n, R2n, H2n, G2n]); + }, + function (n) { + return _bn(), rZ((g3(), U2n), n); + }, + ); + Wfn(339, 22, { 3: 1, 35: 1, 22: 1, 339: 1 }, uS); + var Y2n, + J2n, + Z2n, + n3n = X1( + tCn, + "OrderingStrategy", + 339, + u_n, + function () { + return k5(), x4(Gy(n3n, 1), XEn, 339, 0, [W2n, X2n, V2n]); + }, + function (n) { + return k5(), rZ(($Q(), Y2n), n); + }, + ); + Wfn(421, 22, { 3: 1, 35: 1, 22: 1, 421: 1 }, oS); + var t3n, + e3n, + i3n, + r3n, + c3n = X1( + tCn, + "PortSortingStrategy", + 421, + u_n, + function () { + return $J(), x4(Gy(c3n, 1), XEn, 421, 0, [J2n, Z2n]); + }, + function (n) { + return $J(), rZ((OW(), t3n), n); + }, + ); + Wfn(452, 22, { 3: 1, 35: 1, 22: 1, 452: 1 }, sS); + var a3n, + u3n, + o3n, + s3n, + h3n = X1( + tCn, + "PortType", + 452, + u_n, + function () { + return h0(), x4(Gy(h3n, 1), XEn, 452, 0, [r3n, e3n, i3n]); + }, + function (n) { + return h0(), rZ((LQ(), a3n), n); + }, + ); + Wfn(375, 22, { 3: 1, 35: 1, 22: 1, 375: 1 }, hS); + var f3n, + l3n, + b3n, + w3n = X1( + tCn, + "SelfLoopDistributionStrategy", + 375, + u_n, + function () { + return d3(), x4(Gy(w3n, 1), XEn, 375, 0, [u3n, o3n, s3n]); + }, + function (n) { + return d3(), rZ((AQ(), f3n), n); + }, + ); + Wfn(376, 22, { 3: 1, 35: 1, 22: 1, 376: 1 }, fS); + var d3n, + g3n, + p3n, + v3n, + m3n = X1( + tCn, + "SelfLoopOrderingStrategy", + 376, + u_n, + function () { + return rQ(), x4(Gy(m3n, 1), XEn, 376, 0, [b3n, l3n]); + }, + function (n) { + return rQ(), rZ((CW(), d3n), n); + }, + ); + Wfn(304, 1, { 304: 1 }, pyn), EF(tCn, "Spacings", 304), Wfn(336, 22, { 3: 1, 35: 1, 22: 1, 336: 1 }, lS); + var y3n, + k3n, + j3n, + E3n, + T3n = X1( + tCn, + "SplineRoutingMode", + 336, + u_n, + function () { + return $6(), x4(Gy(T3n, 1), XEn, 336, 0, [g3n, p3n, v3n]); + }, + function (n) { + return $6(), rZ((xQ(), y3n), n); + }, + ); + Wfn(338, 22, { 3: 1, 35: 1, 22: 1, 338: 1 }, bS); + var M3n, + S3n, + P3n, + I3n, + C3n = X1( + tCn, + "ValidifyStrategy", + 338, + u_n, + function () { + return V2(), x4(Gy(C3n, 1), XEn, 338, 0, [E3n, k3n, j3n]); + }, + function (n) { + return V2(), rZ((DQ(), M3n), n); + }, + ); + Wfn(377, 22, { 3: 1, 35: 1, 22: 1, 377: 1 }, wS); + var O3n, + A3n, + $3n, + L3n, + N3n, + x3n, + D3n, + R3n, + K3n, + _3n, + F3n = X1( + tCn, + "WrappingStrategy", + 377, + u_n, + function () { + return F4(), x4(Gy(F3n, 1), XEn, 377, 0, [P3n, I3n, S3n]); + }, + function (n) { + return F4(), rZ((NQ(), O3n), n); + }, + ); + Wfn(1383, 1, KAn, lf), + (Fjn.Yf = function (n) { + return Yx(n, 37), A3n; + }), + (Fjn.pf = function (n, t) { + !(function (n, t, e) { + var i, r, c, a, u, o, s, h; + for ( + run(e, "Depth-first cycle removal", 1), + o = (s = t.a).c.length, + n.c = new ip(), + n.d = VQ(Vot, wSn, 25, o, 16, 1), + n.a = VQ(Vot, wSn, 25, o, 16, 1), + n.b = new ip(), + c = 0, + u = new pb(s); + u.a < u.c.c.length; + + ) + ((a = Yx(Hz(u), 10)).p = c), MX(u7(a)) && eD(n.c, a), ++c; + for (h = new pb(n.c); h.a < h.c.c.length; ) Isn(n, Yx(Hz(h), 10)); + for (r = 0; r < o; r++) n.d[r] || ($z(r, s.c.length), Isn(n, Yx(s.c[r], 10))); + for (i = new pb(n.b); i.a < i.c.c.length; ) mvn(Yx(Hz(i), 17), !0), b5(t, (Ojn(), iQn), (TA(), !0)); + (n.c = null), (n.d = null), (n.a = null), (n.b = null), Ron(e); + })(this, Yx(n, 37), t); + }), + EF(_An, "DepthFirstCycleBreaker", 1383), + Wfn(782, 1, KAn, wK), + (Fjn.Yf = function (n) { + return Yx(n, 37), $3n; + }), + (Fjn.pf = function (n, t) { + !(function (n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M, S, P, I, C, O, A; + for ( + run(e, "Greedy cycle removal", 1), + A = (m = t.a).c.length, + n.a = VQ(Wot, MTn, 25, A, 15, 1), + n.c = VQ(Wot, MTn, 25, A, 15, 1), + n.b = VQ(Wot, MTn, 25, A, 15, 1), + s = 0, + p = new pb(m); + p.a < p.c.c.length; + + ) { + for ((d = Yx(Hz(p), 10)).p = s, T = new pb(d.j); T.a < T.c.c.length; ) { + for (u = new pb((k = Yx(Hz(T), 11)).e); u.a < u.c.c.length; ) + (i = Yx(Hz(u), 17)).c.i != d && ((S = Yx(Aun(i, (gjn(), M0n)), 19).a), (n.a[s] += S > 0 ? S + 1 : 1)); + for (a = new pb(k.g); a.a < a.c.c.length; ) + (i = Yx(Hz(a), 17)).d.i != d && ((S = Yx(Aun(i, (gjn(), M0n)), 19).a), (n.c[s] += S > 0 ? S + 1 : 1)); + } + 0 == n.c[s] ? KD(n.e, d) : 0 == n.a[s] && KD(n.f, d), ++s; + } + for (w = -1, b = 1, f = new ip(), n.d = Yx(Aun(t, (Ojn(), FQn)), 230); A > 0; ) { + for (; 0 != n.e.b; ) (I = Yx(mD(n.e), 10)), (n.b[I.p] = w--), Ugn(n, I), --A; + for (; 0 != n.f.b; ) (C = Yx(mD(n.f), 10)), (n.b[C.p] = b++), Ugn(n, C), --A; + if (A > 0) { + for (l = nTn, v = new pb(m); v.a < v.c.c.length; ) + (d = Yx(Hz(v), 10)), + 0 == n.b[d.p] && + (y = n.c[d.p] - n.a[d.p]) >= l && + (y > l && ((f.c = VQ(UKn, iEn, 1, 0, 5, 1)), (l = y)), (f.c[f.c.length] = d)); + (h = n.Zf(f)), (n.b[h.p] = b++), Ugn(n, h), --A; + } + } + for (P = m.c.length + 1, s = 0; s < m.c.length; s++) n.b[s] < 0 && (n.b[s] += P); + for (g = new pb(m); g.a < g.c.c.length; ) + for (E = 0, M = (j = tX((d = Yx(Hz(g), 10)).j)).length; E < M; ++E) + for (c = 0, o = (r = CU((k = j[E]).g)).length; c < o; ++c) + (O = (i = r[c]).d.i.p), n.b[d.p] > n.b[O] && (mvn(i, !0), b5(t, iQn, (TA(), !0))); + (n.a = null), (n.c = null), (n.b = null), BH(n.f), BH(n.e), Ron(e); + })(this, Yx(n, 37), t); + }), + (Fjn.Zf = function (n) { + return Yx(TR(n, Uen(this.d, n.c.length)), 10); + }), + EF(_An, "GreedyCycleBreaker", 782), + Wfn(1386, 782, KAn, KP), + (Fjn.Zf = function (n) { + var t, e, i, r; + for (r = null, t = Yjn, i = new pb(n); i.a < i.c.c.length; ) + O$((e = Yx(Hz(i), 10)), (Ojn(), IQn)) && Yx(Aun(e, IQn), 19).a < t && ((t = Yx(Aun(e, IQn), 19).a), (r = e)); + return r || Yx(TR(n, Uen(this.d, n.c.length)), 10); + }), + EF(_An, "GreedyModelOrderCycleBreaker", 1386), + Wfn(1384, 1, KAn, tf), + (Fjn.Yf = function (n) { + return Yx(n, 37), L3n; + }), + (Fjn.pf = function (n, t) { + !(function (n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b, w; + for (run(e, "Interactive cycle breaking", 1), h = new ip(), l = new pb(t.a); l.a < l.c.c.length; ) + for ((f = Yx(Hz(l), 10)).p = 1, b = Xcn(f).a, s = inn(f, (h0(), i3n)).Kc(); s.Ob(); ) + for (c = new pb(Yx(s.Pb(), 11).g); c.a < c.c.c.length; ) + (w = (i = Yx(Hz(c), 17)).d.i) != f && Xcn(w).a < b && (h.c[h.c.length] = i); + for (a = new pb(h); a.a < a.c.c.length; ) mvn((i = Yx(Hz(a), 17)), !0); + for (h.c = VQ(UKn, iEn, 1, 0, 5, 1), o = new pb(t.a); o.a < o.c.c.length; ) (u = Yx(Hz(o), 10)).p > 0 && esn(n, u, h); + for (r = new pb(h); r.a < r.c.c.length; ) mvn((i = Yx(Hz(r), 17)), !0); + (h.c = VQ(UKn, iEn, 1, 0, 5, 1)), Ron(e); + })(this, Yx(n, 37), t); + }), + EF(_An, "InteractiveCycleBreaker", 1384), + Wfn(1385, 1, KAn, ef), + (Fjn.Yf = function (n) { + return Yx(n, 37), N3n; + }), + (Fjn.pf = function (n, t) { + !(function (n, t, i) { + var r, c, a, u, o, s, h, f, l, b, w; + for ( + run(i, "Model order cycle breaking", 1), n.a = 0, n.b = 0, l = new ip(), h = t.a.c.length, s = new pb(t.a); + s.a < s.c.c.length; + + ) + O$((o = Yx(Hz(s), 10)), (Ojn(), IQn)) && (h = e.Math.max(h, Yx(Aun(o, IQn), 19).a + 1)); + for (w = new pb(t.a); w.a < w.c.c.length; ) + for (u = Csn(n, (b = Yx(Hz(w), 10)), h), f = inn(b, (h0(), i3n)).Kc(); f.Ob(); ) + for (a = new pb(Yx(f.Pb(), 11).g); a.a < a.c.c.length; ) Csn(n, (r = Yx(Hz(a), 17)).d.i, h) < u && (l.c[l.c.length] = r); + for (c = new pb(l); c.a < c.c.c.length; ) mvn((r = Yx(Hz(c), 17)), !0), b5(t, (Ojn(), iQn), (TA(), !0)); + (l.c = VQ(UKn, iEn, 1, 0, 5, 1)), Ron(i); + })(this, Yx(n, 37), t); + }), + (Fjn.a = 0), + (Fjn.b = 0), + EF(_An, "ModelOrderCycleBreaker", 1385), + Wfn(1389, 1, KAn, cT), + (Fjn.Yf = function (n) { + return Yx(n, 37), x3n; + }), + (Fjn.pf = function (n, t) { + jjn(this, Yx(n, 37), t); + }), + EF(FAn, "CoffmanGrahamLayerer", 1389), + Wfn(1390, 1, FMn, cd), + (Fjn.ue = function (n, t) { + return (function (n, t, e) { + var i, r, c, a, u, o; + for (i = Yx(_V(n.c, t), 15), r = Yx(_V(n.c, e), 15), c = i.Zc(i.gc()), a = r.Zc(r.gc()); c.Sb() && a.Sb(); ) + if ((u = Yx(c.Ub(), 19)) != (o = Yx(a.Ub(), 19))) return eO(u.a, o.a); + return c.Ob() || a.Ob() ? (c.Ob() ? 1 : -1) : 0; + })(this.a, Yx(n, 10), Yx(t, 10)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(FAn, "CoffmanGrahamLayerer/0methodref$compareNodesInTopo$Type", 1390), + Wfn(1391, 1, FMn, ad), + (Fjn.ue = function (n, t) { + return (function (n, t, e) { + return -eO(n.f[t.p], n.f[e.p]); + })(this.a, Yx(n, 10), Yx(t, 10)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(FAn, "CoffmanGrahamLayerer/lambda$1$Type", 1391), + Wfn(1392, 1, KAn, Cc), + (Fjn.Yf = function (n) { + return Yx(n, 37), oR(oR(oR(new fX(), ($un(), YGn), ($jn(), xUn)), JGn, GUn), ZGn, qUn); + }), + (Fjn.pf = function (n, t) { + !(function (n, t, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g, p, v; + for (run(i, "Interactive node layering", 1), r = new ip(), w = new pb(t.a); w.a < w.c.c.length; ) { + for (s = (h = (l = Yx(Hz(w), 10)).n.a) + l.o.a, s = e.Math.max(h + 1, s), v = new JU(r, 0), c = null; v.b < v.d.gc(); ) { + if ((S$(v.b < v.d.gc()), (g = Yx(v.d.Xb((v.c = v.b++)), 569)).c >= s)) { + S$(v.b > 0), v.a.Xb((v.c = --v.b)); + break; + } + g.a > h && + (c + ? (S4(c.b, g.b), (c.a = e.Math.max(c.a, g.a)), hB(v)) + : (eD(g.b, l), (g.c = e.Math.min(g.c, h)), (g.a = e.Math.max(g.a, s)), (c = g))); + } + c || (((c = new gv()).c = h), (c.a = s), ZL(v, c), eD(c.b, l)); + } + for (o = t.b, f = 0, p = new pb(r); p.a < p.c.c.length; ) + for (g = Yx(Hz(p), 569), (a = new qF(t)).p = f++, o.c[o.c.length] = a, d = new pb(g.b); d.a < d.c.c.length; ) + JG((l = Yx(Hz(d), 10)), a), (l.p = 0); + for (b = new pb(t.a); b.a < b.c.c.length; ) 0 == (l = Yx(Hz(b), 10)).p && fdn(n, l, t); + for (u = new JU(o, 0); u.b < u.d.gc(); ) 0 == (S$(u.b < u.d.gc()), Yx(u.d.Xb((u.c = u.b++)), 29)).a.c.length && hB(u); + (t.a.c = VQ(UKn, iEn, 1, 0, 5, 1)), Ron(i); + })(this, Yx(n, 37), t); + }), + EF(FAn, "InteractiveLayerer", 1392), + Wfn(569, 1, { 569: 1 }, gv), + (Fjn.a = 0), + (Fjn.c = 0), + EF(FAn, "InteractiveLayerer/LayerSpan", 569), + Wfn(1388, 1, KAn, nf), + (Fjn.Yf = function (n) { + return Yx(n, 37), D3n; + }), + (Fjn.pf = function (n, t) { + !(function (n, t, e) { + var i, r, c, a; + for ( + run(e, "Longest path layering", 1), n.a = t, a = n.a.a, n.b = VQ(Wot, MTn, 25, a.c.length, 15, 1), i = 0, c = new pb(a); + c.a < c.c.c.length; + + ) + (Yx(Hz(c), 10).p = i), (n.b[i] = -1), ++i; + for (r = new pb(a); r.a < r.c.c.length; ) qln(n, Yx(Hz(r), 10)); + (a.c = VQ(UKn, iEn, 1, 0, 5, 1)), (n.a = null), (n.b = null), Ron(e); + })(this, Yx(n, 37), t); + }), + EF(FAn, "LongestPathLayerer", 1388), + Wfn(1395, 1, KAn, uf), + (Fjn.Yf = function (n) { + return Yx(n, 37), oR(oR(oR(new fX(), ($un(), YGn), ($jn(), mUn)), JGn, GUn), ZGn, qUn); + }), + (Fjn.pf = function (n, t) { + Ukn(this, Yx(n, 37), t); + }), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.d = 0), + EF(FAn, "MinWidthLayerer", 1395), + Wfn(1396, 1, FMn, ud), + (Fjn.ue = function (n, t) { + return (function (n, t, e) { + var i, r; + return (i = n.a.f[t.p]) < (r = n.a.f[e.p]) ? -1 : i == r ? 0 : 1; + })(this, Yx(n, 10), Yx(t, 10)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(FAn, "MinWidthLayerer/MinOutgoingEdgesComparator", 1396), + Wfn(1387, 1, KAn, af), + (Fjn.Yf = function (n) { + return Yx(n, 37), _3n; + }), + (Fjn.pf = function (n, t) { + kyn(this, Yx(n, 37), t); + }), + EF(FAn, "NetworkSimplexLayerer", 1387), + Wfn(1393, 1, KAn, lN), + (Fjn.Yf = function (n) { + return Yx(n, 37), oR(oR(oR(new fX(), ($un(), YGn), ($jn(), mUn)), JGn, GUn), ZGn, qUn); + }), + (Fjn.pf = function (n, t) { + ckn(this, Yx(n, 37), t); + }), + (Fjn.d = 0), + (Fjn.f = 0), + (Fjn.g = 0), + (Fjn.i = 0), + (Fjn.s = 0), + (Fjn.t = 0), + (Fjn.u = 0), + EF(FAn, "StretchWidthLayerer", 1393), + Wfn(1394, 1, FMn, Oc), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return n.p < t.p ? 1 : n.p > t.p ? -1 : 0; + })(Yx(n, 10), Yx(t, 10)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(FAn, "StretchWidthLayerer/1", 1394), + Wfn(402, 1, BAn), + (Fjn.Nf = function (n, t, e, i, r, c) {}), + (Fjn._f = function (n, t, e) { + return Zgn(this, n, t, e); + }), + (Fjn.Mf = function () { + (this.g = VQ(Zot, HAn, 25, this.d, 15, 1)), (this.f = VQ(Zot, HAn, 25, this.d, 15, 1)); + }), + (Fjn.Of = function (n, t) { + this.e[n] = VQ(Wot, MTn, 25, t[n].length, 15, 1); + }), + (Fjn.Pf = function (n, t, e) { + (e[n][t].p = t), (this.e[n][t] = t); + }), + (Fjn.Qf = function (n, t, e, i) { + Yx(TR(i[n][t].j, e), 11).p = this.d++; + }), + (Fjn.b = 0), + (Fjn.c = 0), + (Fjn.d = 0), + EF(qAn, "AbstractBarycenterPortDistributor", 402), + Wfn(1633, 1, FMn, od), + (Fjn.ue = function (n, t) { + return (function (n, t, e) { + var i, r, c, a; + return (c = t.j) != (a = e.j) + ? c.g - a.g + : ((i = n.f[t.p]), (r = n.f[e.p]), 0 == i && 0 == r ? 0 : 0 == i ? -1 : 0 == r ? 1 : $9(i, r)); + })(this.a, Yx(n, 11), Yx(t, 11)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(qAn, "AbstractBarycenterPortDistributor/lambda$0$Type", 1633), + Wfn(817, 1, VIn, wX), + (Fjn.Nf = function (n, t, e, i, r, c) {}), + (Fjn.Pf = function (n, t, e) {}), + (Fjn.Qf = function (n, t, e, i) {}), + (Fjn.Lf = function () { + return !1; + }), + (Fjn.Mf = function () { + (this.c = this.e.a), (this.g = this.f.g); + }), + (Fjn.Of = function (n, t) { + t[n][0].c.p = n; + }), + (Fjn.Rf = function () { + return !1; + }), + (Fjn.ag = function (n, t, e, i) { + e ? Ocn(this, n) : (Gcn(this, n, i), Byn(this, n, t)), + n.c.length > 1 && + (ny(hL(Aun(dB(($z(0, n.c.length), Yx(n.c[0], 10))), (gjn(), VZn)))) ? Gln(n, this.d, Yx(this, 660)) : (XH(), JC(n, this.d)), + u4(this.e, n)); + }), + (Fjn.Sf = function (n, t, e, i) { + var r, c, a, u, o, s, h; + for ( + t != $R(e, n.length) && ((c = n[t - (e ? 1 : -1)]), lQ(this.f, c, e ? (h0(), i3n) : (h0(), e3n))), + r = n[t][0], + h = !i || r.k == (bon(), _zn), + s = DV(n[t]), + this.ag(s, h, !1, e), + a = 0, + o = new pb(s); + o.a < o.c.c.length; + + ) + (u = Yx(Hz(o), 10)), (n[t][a++] = u); + return !1; + }), + (Fjn.Tf = function (n, t) { + var e, i, r, c, a; + for (c = DV(n[(a = $R(t, n.length))]), this.ag(c, !1, !0, t), e = 0, r = new pb(c); r.a < r.c.c.length; ) + (i = Yx(Hz(r), 10)), (n[a][e++] = i); + return !1; + }), + EF(qAn, "BarycenterHeuristic", 817), + Wfn(658, 1, { 658: 1 }, hd), + (Fjn.Ib = function () { + return ( + "BarycenterState [node=" + + this.c + + ", summedWeight=" + + this.d + + ", degree=" + + this.b + + ", barycenter=" + + this.a + + ", visited=" + + this.e + + "]" + ); + }), + (Fjn.b = 0), + (Fjn.d = 0), + (Fjn.e = !1); + var B3n = EF(qAn, "BarycenterHeuristic/BarycenterState", 658); + Wfn(1802, 1, FMn, sd), + (Fjn.ue = function (n, t) { + return (function (n, t, e) { + var i, r; + return ( + (i = n.c[t.c.p][t.p]), + (r = n.c[e.c.p][e.p]), + null != i.a && null != r.a ? WK(i.a, r.a) : null != i.a ? -1 : null != r.a ? 1 : 0 + ); + })(this.a, Yx(n, 10), Yx(t, 10)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(qAn, "BarycenterHeuristic/lambda$0$Type", 1802), + Wfn(816, 1, VIn, Lan), + (Fjn.Mf = function () {}), + (Fjn.Nf = function (n, t, e, i, r, c) {}), + (Fjn.Qf = function (n, t, e, i) {}), + (Fjn.Of = function (n, t) { + (this.a[n] = VQ(B3n, { 3: 1, 4: 1, 5: 1, 2018: 1 }, 658, t[n].length, 0, 1)), + (this.b[n] = VQ(X3n, { 3: 1, 4: 1, 5: 1, 2019: 1 }, 233, t[n].length, 0, 1)); + }), + (Fjn.Pf = function (n, t, e) { + Atn(this, e[n][t], !0); + }), + (Fjn.c = !1), + EF(qAn, "ForsterConstraintResolver", 816), + Wfn(233, 1, { 233: 1 }, Bq, dyn), + (Fjn.Ib = function () { + var n, t; + for ((t = new Ay()).a += "[", n = 0; n < this.d.length; n++) + yI(t, ven(this.d[n])), + null != NO(this.g, this.d[0]).a && yI(yI(((t.a += "<"), t), fI(NO(this.g, this.d[0]).a)), ">"), + n < this.d.length - 1 && (t.a += tEn); + return ((t.a += "]"), t).a; + }), + (Fjn.a = 0), + (Fjn.c = 0), + (Fjn.f = 0); + var H3n, + q3n, + G3n, + z3n, + U3n, + X3n = EF(qAn, "ForsterConstraintResolver/ConstraintGroup", 233); + Wfn(1797, 1, PEn, ld), + (Fjn.td = function (n) { + Atn(this.a, Yx(n, 10), !1); + }), + EF(qAn, "ForsterConstraintResolver/lambda$0$Type", 1797), + Wfn(214, 1, { 214: 1, 225: 1 }, Cyn), + (Fjn.Nf = function (n, t, e, i, r, c) {}), + (Fjn.Of = function (n, t) {}), + (Fjn.Mf = function () { + this.r = VQ(Wot, MTn, 25, this.n, 15, 1); + }), + (Fjn.Pf = function (n, t, e) { + var i; + (i = e[n][t].e) && eD(this.b, i); + }), + (Fjn.Qf = function (n, t, e, i) { + ++this.n; + }), + (Fjn.Ib = function () { + return qyn(this.e, new Qp()); + }), + (Fjn.g = !1), + (Fjn.i = !1), + (Fjn.n = 0), + (Fjn.s = !1), + EF(qAn, "GraphInfoHolder", 214), + Wfn(1832, 1, VIn, Pc), + (Fjn.Nf = function (n, t, e, i, r, c) {}), + (Fjn.Of = function (n, t) {}), + (Fjn.Qf = function (n, t, e, i) {}), + (Fjn._f = function (n, t, e) { + return ( + e && t > 0 + ? DG(this.a, n[t - 1], n[t]) + : !e && t < n.length - 1 + ? DG(this.a, n[t], n[t + 1]) + : h2(this.a, n[t], e ? (Ikn(), qit) : (Ikn(), Eit)), + (function (n, t, e, i) { + var r, c, a, u, o, s, h, f, l; + for (f = i ? (Ikn(), qit) : (Ikn(), Eit), r = !1, s = 0, h = (o = t[e]).length; s < h; ++s) + zN(Yx(Aun((u = o[s]), (gjn(), g0n)), 98)) || + ((a = u.e), + (l = !i7(u, f).dc() && !!a) && ((c = Oan(a)), (n.b = new $an(c, i ? 0 : c.length - 1))), + (r |= npn(n, u, f, l))); + return r; + })(this, n, t, e) + ); + }), + (Fjn.Mf = function () { + (this.d = VQ(Wot, MTn, 25, this.c, 15, 1)), (this.a = new rx(this.d)); + }), + (Fjn.Pf = function (n, t, e) { + var i; + (i = e[n][t]), (this.c += i.j.c.length); + }), + (Fjn.c = 0), + EF(qAn, "GreedyPortDistributor", 1832), + Wfn(1401, 1, KAn, bf), + (Fjn.Yf = function (n) { + return (function (n) { + var t; + return (t = vC(H3n)), Yx(Aun(n, (Ojn(), bQn)), 21).Hc((edn(), CVn)) && oR(t, ($un(), ZGn), ($jn(), tXn)), t; + })(Yx(n, 37)); + }), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g; + for (run(t, "Interactive crossing minimization", 1), a = 0, c = new pb(n.b); c.a < c.c.c.length; ) + (i = Yx(Hz(c), 29)).p = a++; + for ( + d = new yk((l = Oan(n)).length), Emn(new ay(x4(Gy(DXn, 1), iEn, 225, 0, [d])), l), w = 0, a = 0, r = new pb(n.b); + r.a < r.c.c.length; + + ) { + for (e = 0, f = 0, h = new pb((i = Yx(Hz(r), 29)).a); h.a < h.c.c.length; ) + for ((o = Yx(Hz(h), 10)).n.a > 0 && ((e += o.n.a + o.o.a / 2), ++f), b = new pb(o.j); b.a < b.c.c.length; ) + Yx(Hz(b), 11).p = w++; + for (f > 0 && (e /= f), g = VQ(Jot, rMn, 25, i.a.c.length, 15, 1), u = 0, s = new pb(i.a); s.a < s.c.c.length; ) + ((o = Yx(Hz(s), 10)).p = u++), (g[o.p] = Pyn(o, e)), o.k == (bon(), Bzn) && b5(o, (Ojn(), AQn), g[o.p]); + XH(), JC(i.a, new bd(g)), Zgn(d, l, a, !0), ++a; + } + Ron(t); + })(Yx(n, 37), t); + }), + EF(qAn, "InteractiveCrossingMinimizer", 1401), + Wfn(1402, 1, FMn, bd), + (Fjn.ue = function (n, t) { + return (function (n, t, e) { + var i, r, c; + if (0 == (i = $9(n.a[t.p], n.a[e.p]))) { + if (((r = Yx(Aun(t, (Ojn(), mQn)), 15)), (c = Yx(Aun(e, mQn), 15)), r.Hc(e))) return -1; + if (c.Hc(t)) return 1; + } + return i; + })(this, Yx(n, 10), Yx(t, 10)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(qAn, "InteractiveCrossingMinimizer/1", 1402), + Wfn(507, 1, { 507: 1, 123: 1, 51: 1 }, zm), + (Fjn.Yf = function (n) { + var t; + return Yx(n, 37), oR((t = vC(q3n)), ($un(), ZGn), ($jn(), tXn)), t; + }), + (Fjn.pf = function (n, t) { + hpn(this, Yx(n, 37), t); + }), + (Fjn.e = 0), + EF(qAn, "LayerSweepCrossingMinimizer", 507), + Wfn(1398, 1, PEn, wd), + (Fjn.td = function (n) { + Ovn(this.a, Yx(n, 214)); + }), + EF(qAn, "LayerSweepCrossingMinimizer/0methodref$compareDifferentRandomizedLayouts$Type", 1398), + Wfn(1399, 1, PEn, dd), + (Fjn.td = function (n) { + !(function (n, t) { + var e, i; + for (i = 0 != Xln(n.d, 1), e = !0; e; ) (e = !1), (e = t.c.Tf(t.e, i)), (e |= Zbn(n, t, i, !1)), (i = !i); + k2(n); + })(this.a, Yx(n, 214)); + }), + EF(qAn, "LayerSweepCrossingMinimizer/1methodref$minimizeCrossingsNoCounter$Type", 1399), + Wfn(1400, 1, PEn, gd), + (Fjn.td = function (n) { + Gpn(this.a, Yx(n, 214)); + }), + EF(qAn, "LayerSweepCrossingMinimizer/2methodref$minimizeCrossingsWithCounter$Type", 1400), + Wfn(454, 22, { 3: 1, 35: 1, 22: 1, 454: 1 }, dS); + var W3n, + V3n = X1( + qAn, + "LayerSweepCrossingMinimizer/CrossMinType", + 454, + u_n, + function () { + return l0(), x4(Gy(V3n, 1), XEn, 454, 0, [G3n, z3n, U3n]); + }, + function (n) { + return l0(), rZ((RQ(), W3n), n); + }, + ); + Wfn(1397, 1, YEn, Ac), + (Fjn.Mb = function (n) { + return l3(), 0 == Yx(n, 29).a.c.length; + }), + EF(qAn, "LayerSweepCrossingMinimizer/lambda$0$Type", 1397), + Wfn(1799, 1, VIn, xG), + (Fjn.Mf = function () {}), + (Fjn.Nf = function (n, t, e, i, r, c) {}), + (Fjn.Qf = function (n, t, e, i) {}), + (Fjn.Of = function (n, t) { + (t[n][0].c.p = n), (this.b[n] = VQ(Z3n, { 3: 1, 4: 1, 5: 1, 1944: 1 }, 659, t[n].length, 0, 1)); + }), + (Fjn.Pf = function (n, t, e) { + (e[n][t].p = t), DF(this.b[n], t, new $c()); + }), + EF(qAn, "LayerSweepTypeDecider", 1799), + Wfn(659, 1, { 659: 1 }, $c), + (Fjn.Ib = function () { + return "NodeInfo [connectedEdges=" + this.a + ", hierarchicalInfluence=" + this.b + ", randomInfluence=" + this.c + "]"; + }), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.c = 0); + var Q3n, + Y3n, + J3n, + Z3n = EF(qAn, "LayerSweepTypeDecider/NodeInfo", 659); + Wfn(1800, 1, rSn, Lc), + (Fjn.Lb = function (n) { + return YA(new UV(Yx(n, 11).b)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Mb = function (n) { + return YA(new UV(Yx(n, 11).b)); + }), + EF(qAn, "LayerSweepTypeDecider/lambda$0$Type", 1800), + Wfn(1801, 1, rSn, Nc), + (Fjn.Lb = function (n) { + return YA(new UV(Yx(n, 11).b)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Mb = function (n) { + return YA(new UV(Yx(n, 11).b)); + }), + EF(qAn, "LayerSweepTypeDecider/lambda$1$Type", 1801), + Wfn(1833, 402, BAn, mk), + (Fjn.$f = function (n, t, e) { + var i, r, c, a, u, o, s, h, f; + switch (((s = this.g), e.g)) { + case 1: + for (i = 0, r = 0, o = new pb(n.j); o.a < o.c.c.length; ) + 0 != (a = Yx(Hz(o), 11)).e.c.length && (++i, a.j == (Ikn(), Tit) && ++r); + for (c = t + r, f = t + i, u = inn(n, (h0(), e3n)).Kc(); u.Ob(); ) + (a = Yx(u.Pb(), 11)).j == (Ikn(), Tit) ? ((s[a.p] = c), --c) : ((s[a.p] = f), --f); + return i; + case 2: + for (h = 0, u = inn(n, (h0(), i3n)).Kc(); u.Ob(); ) ++h, (s[(a = Yx(u.Pb(), 11)).p] = t + h); + return h; + default: + throw hp(new $p()); + } + }), + EF(qAn, "LayerTotalPortDistributor", 1833), + Wfn(660, 817, { 660: 1, 225: 1 }, u2), + (Fjn.ag = function (n, t, e, i) { + e ? Ocn(this, n) : (Gcn(this, n, i), Byn(this, n, t)), + n.c.length > 1 && + (ny(hL(Aun(dB(($z(0, n.c.length), Yx(n.c[0], 10))), (gjn(), VZn)))) ? Gln(n, this.d, this) : (XH(), JC(n, this.d)), + ny(hL(Aun(dB(($z(0, n.c.length), Yx(n.c[0], 10))), VZn))) || u4(this.e, n)); + }), + EF(qAn, "ModelOrderBarycenterHeuristic", 660), + Wfn(1803, 1, FMn, pd), + (Fjn.ue = function (n, t) { + return Non(this.a, Yx(n, 10), Yx(t, 10)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(qAn, "ModelOrderBarycenterHeuristic/lambda$0$Type", 1803), + Wfn(1403, 1, KAn, yf), + (Fjn.Yf = function (n) { + var t; + return Yx(n, 37), oR((t = vC(Q3n)), ($un(), ZGn), ($jn(), tXn)), t; + }), + (Fjn.pf = function (n, t) { + !(function (n) { + run(n, "No crossing minimization", 1), Ron(n); + })((Yx(n, 37), t)); + }), + EF(qAn, "NoCrossingMinimizer", 1403), + Wfn(796, 402, BAn, yk), + (Fjn.$f = function (n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b; + switch (((f = this.g), e.g)) { + case 1: + for (r = 0, c = 0, h = new pb(n.j); h.a < h.c.c.length; ) + 0 != (o = Yx(Hz(h), 11)).e.c.length && (++r, o.j == (Ikn(), Tit) && ++c); + for (a = t + c * (i = 1 / (r + 1)), b = t + 1 - i, s = inn(n, (h0(), e3n)).Kc(); s.Ob(); ) + (o = Yx(s.Pb(), 11)).j == (Ikn(), Tit) ? ((f[o.p] = a), (a -= i)) : ((f[o.p] = b), (b -= i)); + break; + case 2: + for (u = 0, h = new pb(n.j); h.a < h.c.c.length; ) 0 == (o = Yx(Hz(h), 11)).g.c.length || ++u; + for (l = t + (i = 1 / (u + 1)), s = inn(n, (h0(), i3n)).Kc(); s.Ob(); ) (f[(o = Yx(s.Pb(), 11)).p] = l), (l += i); + break; + default: + throw hp(new Qm("Port type is undefined")); + } + return 1; + }), + EF(qAn, "NodeRelativePortDistributor", 796), + Wfn(807, 1, {}, l_, Zun), + EF(qAn, "SweepCopy", 807), + Wfn(1798, 1, VIn, Inn), + (Fjn.Of = function (n, t) {}), + (Fjn.Mf = function () { + var n; + (n = VQ(Wot, MTn, 25, this.f, 15, 1)), (this.d = new Md(n)), (this.a = new rx(n)); + }), + (Fjn.Nf = function (n, t, e, i, r, c) { + var a; + (a = Yx(TR(c[n][t].j, e), 11)), r.c == a && r.c.i.c == r.d.i.c && ++this.e[n]; + }), + (Fjn.Pf = function (n, t, e) { + var i; + (i = e[n][t]), (this.c[n] = this.c[n] | (i.k == (bon(), qzn))); + }), + (Fjn.Qf = function (n, t, e, i) { + var r; + ((r = Yx(TR(i[n][t].j, e), 11)).p = this.f++), + r.g.c.length + r.e.c.length > 1 && (r.j == (Ikn(), Eit) ? (this.b[n] = !0) : r.j == qit && n > 0 && (this.b[n - 1] = !0)); + }), + (Fjn.f = 0), + EF(WIn, "AllCrossingsCounter", 1798), + Wfn(587, 1, {}, s2), + (Fjn.b = 0), + (Fjn.d = 0), + EF(WIn, "BinaryIndexedTree", 587), + Wfn(524, 1, {}, rx), + EF(WIn, "CrossingsCounter", 524), + Wfn(1906, 1, FMn, vd), + (Fjn.ue = function (n, t) { + return (function (n, t, e) { + return eO(n.d[t.p], n.d[e.p]); + })(this.a, Yx(n, 11), Yx(t, 11)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(WIn, "CrossingsCounter/lambda$0$Type", 1906), + Wfn(1907, 1, FMn, md), + (Fjn.ue = function (n, t) { + return (function (n, t, e) { + return eO(n.d[t.p], n.d[e.p]); + })(this.a, Yx(n, 11), Yx(t, 11)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(WIn, "CrossingsCounter/lambda$1$Type", 1907), + Wfn(1908, 1, FMn, yd), + (Fjn.ue = function (n, t) { + return (function (n, t, e) { + return eO(n.d[t.p], n.d[e.p]); + })(this.a, Yx(n, 11), Yx(t, 11)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(WIn, "CrossingsCounter/lambda$2$Type", 1908), + Wfn(1909, 1, FMn, kd), + (Fjn.ue = function (n, t) { + return (function (n, t, e) { + return eO(n.d[t.p], n.d[e.p]); + })(this.a, Yx(n, 11), Yx(t, 11)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(WIn, "CrossingsCounter/lambda$3$Type", 1909), + Wfn(1910, 1, PEn, jd), + (Fjn.td = function (n) { + !(function (n, t) { + dD(), eD(n, new mP(t, d9(t.e.c.length + t.g.c.length))); + })(this.a, Yx(n, 11)); + }), + EF(WIn, "CrossingsCounter/lambda$4$Type", 1910), + Wfn(1911, 1, YEn, Ed), + (Fjn.Mb = function (n) { + return (function (n, t) { + return dD(), t != n; + })(this.a, Yx(n, 11)); + }), + EF(WIn, "CrossingsCounter/lambda$5$Type", 1911), + Wfn(1912, 1, PEn, Td), + (Fjn.td = function (n) { + NP(this, n); + }), + EF(WIn, "CrossingsCounter/lambda$6$Type", 1912), + Wfn(1913, 1, PEn, pS), + (Fjn.td = function (n) { + var t; + dD(), OX(this.b, ((t = this.a), Yx(n, 11), t)); + }), + EF(WIn, "CrossingsCounter/lambda$7$Type", 1913), + Wfn(826, 1, rSn, xc), + (Fjn.Lb = function (n) { + return dD(), O$(Yx(n, 11), (Ojn(), RQn)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Mb = function (n) { + return dD(), O$(Yx(n, 11), (Ojn(), RQn)); + }), + EF(WIn, "CrossingsCounter/lambda$8$Type", 826), + Wfn(1905, 1, {}, Md), + EF(WIn, "HyperedgeCrossingsCounter", 1905), + Wfn(467, 1, { 35: 1, 467: 1 }, fN), + (Fjn.wd = function (n) { + return (function (n, t) { + return n.e < t.e ? -1 : n.e > t.e ? 1 : n.f < t.f ? -1 : n.f > t.f ? 1 : W5(n) - W5(t); + })(this, Yx(n, 467)); + }), + (Fjn.b = 0), + (Fjn.c = 0), + (Fjn.e = 0), + (Fjn.f = 0); + var n4n = EF(WIn, "HyperedgeCrossingsCounter/Hyperedge", 467); + Wfn(362, 1, { 35: 1, 362: 1 }, gH), + (Fjn.wd = function (n) { + return (function (n, t) { + return n.c < t.c + ? -1 + : n.c > t.c + ? 1 + : n.b < t.b + ? -1 + : n.b > t.b + ? 1 + : n.a != t.a + ? W5(n.a) - W5(t.a) + : n.d == (GW(), e4n) && t.d == t4n + ? -1 + : n.d == t4n && t.d == e4n + ? 1 + : 0; + })(this, Yx(n, 362)); + }), + (Fjn.b = 0), + (Fjn.c = 0); + var t4n, + e4n, + i4n = EF(WIn, "HyperedgeCrossingsCounter/HyperedgeCorner", 362); + Wfn(523, 22, { 3: 1, 35: 1, 22: 1, 523: 1 }, gS); + var r4n, + c4n, + a4n, + u4n, + o4n, + s4n = X1( + WIn, + "HyperedgeCrossingsCounter/HyperedgeCorner/Type", + 523, + u_n, + function () { + return GW(), x4(Gy(s4n, 1), XEn, 523, 0, [e4n, t4n]); + }, + function (n) { + return GW(), rZ((NW(), r4n), n); + }, + ); + Wfn(1405, 1, KAn, hf), + (Fjn.Yf = function (n) { + return Yx(Aun(Yx(n, 37), (Ojn(), bQn)), 21).Hc((edn(), SVn)) ? c4n : null; + }), + (Fjn.pf = function (n, t) { + !(function (n, t, e) { + var i; + for (run(e, "Interactive node placement", 1), n.a = Yx(Aun(t, (Ojn(), zQn)), 304), i = new pb(t.b); i.a < i.c.c.length; ) + Xwn(n, Yx(Hz(i), 29)); + Ron(e); + })(this, Yx(n, 37), t); + }), + EF(GAn, "InteractiveNodePlacer", 1405), + Wfn(1406, 1, KAn, sf), + (Fjn.Yf = function (n) { + return Yx(Aun(Yx(n, 37), (Ojn(), bQn)), 21).Hc((edn(), SVn)) ? a4n : null; + }), + (Fjn.pf = function (n, t) { + Kin(this, Yx(n, 37), t); + }), + EF(GAn, "LinearSegmentsNodePlacer", 1406), + Wfn(257, 1, { 35: 1, 257: 1 }, pv), + (Fjn.wd = function (n) { + return (function (n, t) { + return n.b - t.b; + })(this, Yx(n, 257)); + }), + (Fjn.Fb = function (n) { + var t; + return !!CO(n, 257) && ((t = Yx(n, 257)), this.b == t.b); + }), + (Fjn.Hb = function () { + return this.b; + }), + (Fjn.Ib = function () { + return "ls" + Gun(this.e); + }), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.c = -1), + (Fjn.d = -1), + (Fjn.g = 0); + var h4n, + f4n = EF(GAn, "LinearSegmentsNodePlacer/LinearSegment", 257); + Wfn(1408, 1, KAn, dK), + (Fjn.Yf = function (n) { + return Yx(Aun(Yx(n, 37), (Ojn(), bQn)), 21).Hc((edn(), SVn)) ? h4n : null; + }), + (Fjn.pf = function (n, t) { + rjn(this, Yx(n, 37), t); + }), + (Fjn.b = 0), + (Fjn.g = 0), + EF(GAn, "NetworkSimplexPlacer", 1408), + Wfn(1427, 1, FMn, Dc), + (Fjn.ue = function (n, t) { + return eO(Yx(n, 19).a, Yx(t, 19).a); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(GAn, "NetworkSimplexPlacer/0methodref$compare$Type", 1427), + Wfn(1429, 1, FMn, Rc), + (Fjn.ue = function (n, t) { + return eO(Yx(n, 19).a, Yx(t, 19).a); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(GAn, "NetworkSimplexPlacer/1methodref$compare$Type", 1429), + Wfn(649, 1, { 649: 1 }, vS); + var l4n = EF(GAn, "NetworkSimplexPlacer/EdgeRep", 649); + Wfn(401, 1, { 401: 1 }, pH), (Fjn.b = !1); + var b4n, + w4n, + d4n, + g4n = EF(GAn, "NetworkSimplexPlacer/NodeRep", 401); + Wfn(508, 12, { 3: 1, 4: 1, 20: 1, 28: 1, 52: 1, 12: 1, 14: 1, 15: 1, 54: 1, 508: 1 }, yv), + EF(GAn, "NetworkSimplexPlacer/Path", 508), + Wfn(1409, 1, {}, Kc), + (Fjn.Kb = function (n) { + return Yx(n, 17).d.i.k; + }), + EF(GAn, "NetworkSimplexPlacer/Path/lambda$0$Type", 1409), + Wfn(1410, 1, YEn, _c), + (Fjn.Mb = function (n) { + return Yx(n, 267) == (bon(), Bzn); + }), + EF(GAn, "NetworkSimplexPlacer/Path/lambda$1$Type", 1410), + Wfn(1411, 1, {}, Fc), + (Fjn.Kb = function (n) { + return Yx(n, 17).d.i; + }), + EF(GAn, "NetworkSimplexPlacer/Path/lambda$2$Type", 1411), + Wfn(1412, 1, YEn, Sd), + (Fjn.Mb = function (n) { + return SL(gnn(Yx(n, 10))); + }), + EF(GAn, "NetworkSimplexPlacer/Path/lambda$3$Type", 1412), + Wfn(1413, 1, YEn, Bc), + (Fjn.Mb = function (n) { + return (function (n) { + return hz(), (Ikn(), Iit).Hc(n.j); + })(Yx(n, 11)); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$0$Type", 1413), + Wfn(1414, 1, PEn, mS), + (Fjn.td = function (n) { + !(function (n, t, e) { + xB(n.k, e, t); + })(this.a, this.b, Yx(n, 11)); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$1$Type", 1414), + Wfn(1423, 1, PEn, Pd), + (Fjn.td = function (n) { + ghn(this.a, Yx(n, 17)); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$10$Type", 1423), + Wfn(1424, 1, {}, Hc), + (Fjn.Kb = function (n) { + return hz(), new SR(null, new Nz(Yx(n, 29).a, 16)); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$11$Type", 1424), + Wfn(1425, 1, PEn, Id), + (Fjn.td = function (n) { + !(function (n, t) { + var e, i, r, c; + for (c = i7(t, (Ikn(), Bit)).Kc(); c.Ob(); ) + (i = Yx(c.Pb(), 11)), (e = Yx(Aun(i, (Ojn(), RQn)), 10)) && uwn(NE(LE(xE($E(new tv(), 0), 0.1), n.i[t.p].d), n.i[e.p].a)); + for (r = i7(t, Tit).Kc(); r.Ob(); ) + (i = Yx(r.Pb(), 11)), (e = Yx(Aun(i, (Ojn(), RQn)), 10)) && uwn(NE(LE(xE($E(new tv(), 0), 0.1), n.i[e.p].d), n.i[t.p].a)); + })(this.a, Yx(n, 10)); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$12$Type", 1425), + Wfn(1426, 1, {}, qc), + (Fjn.Kb = function (n) { + return hz(), d9(Yx(n, 121).e); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$13$Type", 1426), + Wfn(1428, 1, {}, Gc), + (Fjn.Kb = function (n) { + return hz(), d9(Yx(n, 121).e); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$15$Type", 1428), + Wfn(1430, 1, YEn, zc), + (Fjn.Mb = function (n) { + return hz(), Yx(n, 401).c.k == (bon(), Hzn); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$17$Type", 1430), + Wfn(1431, 1, YEn, Uc), + (Fjn.Mb = function (n) { + return hz(), Yx(n, 401).c.j.c.length > 1; + }), + EF(GAn, "NetworkSimplexPlacer/lambda$18$Type", 1431), + Wfn(1432, 1, PEn, vH), + (Fjn.td = function (n) { + !(function (n, t, e, i, r) { + hz(), uwn(NE(LE($E(xE(new tv(), 0), r.d.e - n), t), r.d)), uwn(NE(LE($E(xE(new tv(), 0), e - r.a.e), r.a), i)); + })(this.c, this.b, this.d, this.a, Yx(n, 401)); + }), + (Fjn.c = 0), + (Fjn.d = 0), + EF(GAn, "NetworkSimplexPlacer/lambda$19$Type", 1432), + Wfn(1415, 1, {}, Xc), + (Fjn.Kb = function (n) { + return hz(), new SR(null, new Nz(Yx(n, 29).a, 16)); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$2$Type", 1415), + Wfn(1433, 1, PEn, Cd), + (Fjn.td = function (n) { + !(function (n, t) { + hz(), (t.n.b += n); + })(this.a, Yx(n, 11)); + }), + (Fjn.a = 0), + EF(GAn, "NetworkSimplexPlacer/lambda$20$Type", 1433), + Wfn(1434, 1, {}, Wc), + (Fjn.Kb = function (n) { + return hz(), new SR(null, new Nz(Yx(n, 29).a, 16)); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$21$Type", 1434), + Wfn(1435, 1, PEn, Od), + (Fjn.td = function (n) { + RO(this.a, Yx(n, 10)); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$22$Type", 1435), + Wfn(1436, 1, YEn, Vc), + (Fjn.Mb = function (n) { + return SL(n); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$23$Type", 1436), + Wfn(1437, 1, {}, Qc), + (Fjn.Kb = function (n) { + return hz(), new SR(null, new Nz(Yx(n, 29).a, 16)); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$24$Type", 1437), + Wfn(1438, 1, YEn, Ad), + (Fjn.Mb = function (n) { + return (function (n, t) { + return 2 == n.j[t.p]; + })(this.a, Yx(n, 10)); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$25$Type", 1438), + Wfn(1439, 1, PEn, yS), + (Fjn.td = function (n) { + !(function (n, t, e) { + var i, r, c; + for (r = new $K(bA(a7(e).a.Kc(), new h())); Vfn(r); ) + ZW((i = Yx(kV(r), 17))) || + (!ZW(i) && i.c.i.c == i.d.i.c) || + ((c = Cbn(n, i, e, new yv())).c.length > 1 && (t.c[t.c.length] = c)); + })(this.a, this.b, Yx(n, 10)); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$26$Type", 1439), + Wfn(1440, 1, YEn, Yc), + (Fjn.Mb = function (n) { + return hz(), !ZW(Yx(n, 17)); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$27$Type", 1440), + Wfn(1441, 1, YEn, Jc), + (Fjn.Mb = function (n) { + return hz(), !ZW(Yx(n, 17)); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$28$Type", 1441), + Wfn(1442, 1, {}, $d), + (Fjn.Ce = function (n, t) { + return AO(this.a, Yx(n, 29), Yx(t, 29)); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$29$Type", 1442), + Wfn(1416, 1, {}, Zc), + (Fjn.Kb = function (n) { + return hz(), new SR(null, new nF(new $K(bA(o7(Yx(n, 10)).a.Kc(), new h())))); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$3$Type", 1416), + Wfn(1417, 1, YEn, na), + (Fjn.Mb = function (n) { + return ( + hz(), + (function (n) { + return hz(), !(ZW(n) || (!ZW(n) && n.c.i.c == n.d.i.c)); + })(Yx(n, 17)) + ); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$4$Type", 1417), + Wfn(1418, 1, PEn, Ld), + (Fjn.td = function (n) { + !(function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b; + (i = HA(new ev(), n.f)), + (o = n.i[t.c.i.p]), + (l = n.i[t.d.i.p]), + (u = t.c), + (f = t.d), + (a = u.a.b), + (h = f.a.b), + o.b || (a += u.n.b), + l.b || (h += f.n.b), + (s = oG(e.Math.max(0, a - h))), + (c = oG(e.Math.max(0, h - a))), + (b = e.Math.max(1, Yx(Aun(t, (gjn(), P0n)), 19).a) * GX(t.c.i.k, t.d.i.k)), + (r = new vS( + uwn(NE(LE($E(xE(new tv(), b), c), i), Yx(BF(n.k, t.c), 121))), + uwn(NE(LE($E(xE(new tv(), b), s), i), Yx(BF(n.k, t.d), 121))), + )), + (n.c[t.p] = r); + })(this.a, Yx(n, 17)); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$5$Type", 1418), + Wfn(1419, 1, {}, ta), + (Fjn.Kb = function (n) { + return hz(), new SR(null, new Nz(Yx(n, 29).a, 16)); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$6$Type", 1419), + Wfn(1420, 1, YEn, ea), + (Fjn.Mb = function (n) { + return hz(), Yx(n, 10).k == (bon(), Hzn); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$7$Type", 1420), + Wfn(1421, 1, {}, ia), + (Fjn.Kb = function (n) { + return hz(), new SR(null, new nF(new $K(bA(a7(Yx(n, 10)).a.Kc(), new h())))); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$8$Type", 1421), + Wfn(1422, 1, YEn, ra), + (Fjn.Mb = function (n) { + return ( + hz(), + (function (n) { + return !ZW(n) && n.c.i.c == n.d.i.c; + })(Yx(n, 17)) + ); + }), + EF(GAn, "NetworkSimplexPlacer/lambda$9$Type", 1422), + Wfn(1404, 1, KAn, Sf), + (Fjn.Yf = function (n) { + return Yx(Aun(Yx(n, 37), (Ojn(), bQn)), 21).Hc((edn(), SVn)) ? b4n : null; + }), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var i, r, c, a, u, o, s, h, f, l; + for (run(t, "Simple node placement", 1), l = Yx(Aun(n, (Ojn(), zQn)), 304), o = 0, a = new pb(n.b); a.a < a.c.c.length; ) { + for ((u = (r = Yx(Hz(a), 29)).c).b = 0, i = null, h = new pb(r.a); h.a < h.c.c.length; ) + (s = Yx(Hz(h), 10)), i && (u.b += Fnn(s, i, l.c)), (u.b += s.d.d + s.o.b + s.d.a), (i = s); + o = e.Math.max(o, u.b); + } + for (c = new pb(n.b); c.a < c.c.c.length; ) + for (f = (o - (u = (r = Yx(Hz(c), 29)).c).b) / 2, i = null, h = new pb(r.a); h.a < h.c.c.length; ) + (s = Yx(Hz(h), 10)), i && (f += Fnn(s, i, l.c)), (f += s.d.d), (s.n.b = f), (f += s.o.b + s.d.a), (i = s); + Ron(t); + })(Yx(n, 37), t); + }), + EF(GAn, "SimpleNodePlacer", 1404), + Wfn(180, 1, { 180: 1 }, Bgn), + (Fjn.Ib = function () { + var n; + return ( + (n = ""), + this.c == (Jq(), d4n) ? (n += kSn) : this.c == w4n && (n += ySn), + this.o == (RG(), v4n) ? (n += $Sn) : this.o == m4n ? (n += "UP") : (n += "BALANCED"), + n + ); + }), + EF(XAn, "BKAlignedLayout", 180), + Wfn(516, 22, { 3: 1, 35: 1, 22: 1, 516: 1 }, ES); + var p4n, + v4n, + m4n, + y4n = X1( + XAn, + "BKAlignedLayout/HDirection", + 516, + u_n, + function () { + return Jq(), x4(Gy(y4n, 1), XEn, 516, 0, [d4n, w4n]); + }, + function (n) { + return Jq(), rZ((xW(), p4n), n); + }, + ); + Wfn(515, 22, { 3: 1, 35: 1, 22: 1, 515: 1 }, jS); + var k4n, + j4n, + E4n, + T4n, + M4n, + S4n, + P4n, + I4n, + C4n, + O4n, + A4n, + $4n, + L4n, + N4n, + x4n, + D4n, + R4n, + K4n, + _4n, + F4n = X1( + XAn, + "BKAlignedLayout/VDirection", + 515, + u_n, + function () { + return RG(), x4(Gy(F4n, 1), XEn, 515, 0, [v4n, m4n]); + }, + function (n) { + return RG(), rZ((DW(), k4n), n); + }, + ); + Wfn(1634, 1, {}, kS), + EF(XAn, "BKAligner", 1634), + Wfn(1637, 1, {}, Grn), + EF(XAn, "BKCompactor", 1637), + Wfn(654, 1, { 654: 1 }, ca), + (Fjn.a = 0), + EF(XAn, "BKCompactor/ClassEdge", 654), + Wfn(458, 1, { 458: 1 }, vv), + (Fjn.a = null), + (Fjn.b = 0), + EF(XAn, "BKCompactor/ClassNode", 458), + Wfn(1407, 1, KAn, DP), + (Fjn.Yf = function (n) { + return Yx(Aun(Yx(n, 37), (Ojn(), bQn)), 21).Hc((edn(), SVn)) ? j4n : null; + }), + (Fjn.pf = function (n, t) { + Sjn(this, Yx(n, 37), t); + }), + (Fjn.d = !1), + EF(XAn, "BKNodePlacer", 1407), + Wfn(1635, 1, {}, aa), + (Fjn.d = 0), + EF(XAn, "NeighborhoodInformation", 1635), + Wfn(1636, 1, FMn, Nd), + (Fjn.ue = function (n, t) { + return (function (n, t, e) { + return oG(GD(n.a.e[Yx(t.a, 10).p] - n.a.e[Yx(e.a, 10).p])); + })(this, Yx(n, 46), Yx(t, 46)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(XAn, "NeighborhoodInformation/NeighborComparator", 1636), + Wfn(808, 1, {}), + EF(XAn, "ThresholdStrategy", 808), + Wfn(1763, 808, {}, Iv), + (Fjn.bg = function (n, t, e) { + return this.a.o == (RG(), m4n) ? JTn : ZTn; + }), + (Fjn.cg = function () {}), + EF(XAn, "ThresholdStrategy/NullThresholdStrategy", 1763), + Wfn(579, 1, { 579: 1 }, TS), + (Fjn.c = !1), + (Fjn.d = !1), + EF(XAn, "ThresholdStrategy/Postprocessable", 579), + Wfn(1764, 808, {}, Cv), + (Fjn.bg = function (n, t, e) { + var i, r, c; + return ( + (r = t == e), + (i = this.a.a[e.p] == t), + r || i + ? ((c = n), this.a.c, Jq(), r && (c = ymn(this, t, !0)), !isNaN(c) && !isFinite(c) && i && (c = ymn(this, e, !1)), c) + : n + ); + }), + (Fjn.cg = function () { + for (var n, t, e; 0 != this.d.b; ) + (t = xpn(this, (e = Yx(uG(this.d), 579)))).a && + ((n = t.a), (ny(this.a.f[this.a.g[e.b.p].p]) || ZW(n) || n.c.i.c != n.d.i.c) && (Cln(this, e) || cC(this.e, e))); + for (; 0 != this.e.a.c.length; ) Cln(this, Yx(K6(this.e), 579)); + }), + EF(XAn, "ThresholdStrategy/SimpleThresholdStrategy", 1764), + Wfn(635, 1, { 635: 1, 246: 1, 234: 1 }, ua), + (Fjn.Kf = function () { + return U3(this); + }), + (Fjn.Xf = function () { + return U3(this); + }), + EF(WAn, "EdgeRouterFactory", 635), + Wfn(1458, 1, KAn, Pf), + (Fjn.Yf = function (n) { + return (function (n) { + var t, e; + return ( + (e = Yx(Aun(n, (Ojn(), bQn)), 21)), + (t = new fX()), + e.Hc((edn(), PVn)) && (T3(t, P4n), T3(t, C4n)), + (e.Hc(CVn) || ny(hL(Aun(n, (gjn(), k1n))))) && (T3(t, C4n), e.Hc(OVn) && T3(t, O4n)), + e.Hc(SVn) && T3(t, S4n), + e.Hc($Vn) && T3(t, A4n), + e.Hc(IVn) && T3(t, I4n), + e.Hc(EVn) && T3(t, T4n), + e.Hc(MVn) && T3(t, M4n), + t + ); + })(Yx(n, 37)); + }), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d; + run(t, "Orthogonal edge routing", 1), + (s = ty(fL(Aun(n, (gjn(), z0n))))), + (e = ty(fL(Aun(n, x0n)))), + (i = ty(fL(Aun(n, K0n)))), + (l = new gF(0, e)), + (d = 0), + (a = new JU(n.b, 0)), + (u = null), + (h = null), + (o = null), + (f = null); + do { + (f = (h = a.b < a.d.gc() ? (S$(a.b < a.d.gc()), Yx(a.d.Xb((a.c = a.b++)), 29)) : null) ? h.a : null), + u && (Qmn(u, d), (d += u.c.a)), + (w = Ayn(l, n, o, f, u ? d + i : d)), + (r = !u || oI(o, (ywn(), D4n))), + (c = !h || oI(f, (ywn(), D4n))), + w > 0 ? ((b = (w - 1) * e), u && (b += i), h && (b += i), b < s && !r && !c && (b = s), (d += b)) : !r && !c && (d += s), + (u = h), + (o = f); + } while (h); + (n.f.a = d), Ron(t); + })(Yx(n, 37), t); + }), + EF(WAn, "OrthogonalEdgeRouter", 1458), + Wfn(1451, 1, KAn, RP), + (Fjn.Yf = function (n) { + return (function (n) { + var t, e; + return ( + (e = Yx(Aun(n, (Ojn(), bQn)), 21)), + (t = vC($4n)), + e.Hc((edn(), OVn)) && T3(t, x4n), + e.Hc($Vn) && T3(t, R4n), + e.Hc(EVn) && T3(t, L4n), + e.Hc(MVn) && T3(t, N4n), + t + ); + })(Yx(n, 37)); + }), + (Fjn.pf = function (n, t) { + !(function (n, t, i) { + var r, c, a, u, o, s, f, l, b, w, d, g, p, v, m, y, k, j; + for ( + run(i, "Polyline edge routing", 1), + v = ty(fL(Aun(t, (gjn(), d1n)))), + d = ty(fL(Aun(t, z0n))), + c = ty(fL(Aun(t, x0n))), + r = e.Math.min(1, c / d), + k = 0, + s = 0, + 0 != t.b.c.length && (k = 0.4 * r * (j = obn(Yx(TR(t.b, 0), 29)))), + o = new JU(t.b, 0); + o.b < o.d.gc(); + + ) { + for ( + S$(o.b < o.d.gc()), + (a = oI((u = Yx(o.d.Xb((o.c = o.b++)), 29)), D4n)) && k > 0 && (k -= d), + Qmn(u, k), + l = 0, + w = new pb(u.a); + w.a < w.c.c.length; + + ) { + for (f = 0, p = new $K(bA(o7((b = Yx(Hz(w), 10))).a.Kc(), new h())); Vfn(p); ) + (m = Dz((g = Yx(kV(p), 17)).c).b), + (y = Dz(g.d).b), + u != g.d.i.c || ZW(g) || (Xhn(g, k, 0.4 * r * e.Math.abs(m - y)), g.c.j == (Ikn(), qit) && ((m = 0), (y = 0))), + (f = e.Math.max(f, e.Math.abs(y - m))); + switch (b.k.g) { + case 0: + case 4: + case 1: + case 3: + case 5: + cyn(n, b, k, v); + } + l = e.Math.max(l, f); + } + o.b < o.d.gc() && + ((j = obn((S$(o.b < o.d.gc()), Yx(o.d.Xb((o.c = o.b++)), 29)))), + (l = e.Math.max(l, j)), + S$(o.b > 0), + o.a.Xb((o.c = --o.b))), + (s = 0.4 * r * l), + !a && o.b < o.d.gc() && (s += d), + (k += u.c.a + s); + } + n.a.a.$b(), (t.f.a = k), Ron(i); + })(this, Yx(n, 37), t); + }), + EF(WAn, "PolylineEdgeRouter", 1451), + Wfn(1452, 1, rSn, oa), + (Fjn.Lb = function (n) { + return f4(Yx(n, 10)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Mb = function (n) { + return f4(Yx(n, 10)); + }), + EF(WAn, "PolylineEdgeRouter/1", 1452), + Wfn(1809, 1, YEn, sa), + (Fjn.Mb = function (n) { + return Yx(n, 129).c == (iQ(), K4n); + }), + EF(VAn, "HyperEdgeCycleDetector/lambda$0$Type", 1809), + Wfn(1810, 1, {}, ha), + (Fjn.Ge = function (n) { + return Yx(n, 129).d; + }), + EF(VAn, "HyperEdgeCycleDetector/lambda$1$Type", 1810), + Wfn(1811, 1, YEn, fa), + (Fjn.Mb = function (n) { + return Yx(n, 129).c == (iQ(), K4n); + }), + EF(VAn, "HyperEdgeCycleDetector/lambda$2$Type", 1811), + Wfn(1812, 1, {}, la), + (Fjn.Ge = function (n) { + return Yx(n, 129).d; + }), + EF(VAn, "HyperEdgeCycleDetector/lambda$3$Type", 1812), + Wfn(1813, 1, {}, ba), + (Fjn.Ge = function (n) { + return Yx(n, 129).d; + }), + EF(VAn, "HyperEdgeCycleDetector/lambda$4$Type", 1813), + Wfn(1814, 1, {}, wa), + (Fjn.Ge = function (n) { + return Yx(n, 129).d; + }), + EF(VAn, "HyperEdgeCycleDetector/lambda$5$Type", 1814), + Wfn(112, 1, { 35: 1, 112: 1 }, a4), + (Fjn.wd = function (n) { + return (function (n, t) { + return n.g - t.g; + })(this, Yx(n, 112)); + }), + (Fjn.Fb = function (n) { + var t; + return !!CO(n, 112) && ((t = Yx(n, 112)), this.g == t.g); + }), + (Fjn.Hb = function () { + return this.g; + }), + (Fjn.Ib = function () { + var n, t, e, i; + for (n = new SA("{"), i = new pb(this.n); i.a < i.c.c.length; ) + null == (t = yrn((e = Yx(Hz(i), 11)).i)) && (t = "n" + GN(e.i)), (n.a += "" + t), i.a < i.c.c.length && (n.a += ","); + return (n.a += "}"), n.a; + }), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.c = NaN), + (Fjn.d = 0), + (Fjn.g = 0), + (Fjn.i = 0), + (Fjn.o = 0), + (Fjn.s = NaN), + EF(VAn, "HyperEdgeSegment", 112), + Wfn(129, 1, { 129: 1 }, wz), + (Fjn.Ib = function () { + return this.a + "->" + this.b + " (" + ((null != (n = this.c).f ? n.f : "" + n.g) + ")"); + var n; + }), + (Fjn.d = 0), + EF(VAn, "HyperEdgeSegmentDependency", 129), + Wfn(520, 22, { 3: 1, 35: 1, 22: 1, 520: 1 }, MS); + var B4n, + H4n, + q4n, + G4n, + z4n, + U4n, + X4n, + W4n, + V4n = X1( + VAn, + "HyperEdgeSegmentDependency/DependencyType", + 520, + u_n, + function () { + return iQ(), x4(Gy(V4n, 1), XEn, 520, 0, [_4n, K4n]); + }, + function (n) { + return iQ(), rZ((LW(), B4n), n); + }, + ); + Wfn(1815, 1, {}, xd), + EF(VAn, "HyperEdgeSegmentSplitter", 1815), + Wfn(1816, 1, {}, Ik), + (Fjn.a = 0), + (Fjn.b = 0), + EF(VAn, "HyperEdgeSegmentSplitter/AreaRating", 1816), + Wfn(329, 1, { 329: 1 }, Lx), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.c = 0), + EF(VAn, "HyperEdgeSegmentSplitter/FreeArea", 329), + Wfn(1817, 1, FMn, ja), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return $9(n.c - n.s, t.c - t.s); + })(Yx(n, 112), Yx(t, 112)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(VAn, "HyperEdgeSegmentSplitter/lambda$0$Type", 1817), + Wfn(1818, 1, PEn, yH), + (Fjn.td = function (n) { + QX(this.a, this.d, this.c, this.b, Yx(n, 112)); + }), + (Fjn.b = 0), + EF(VAn, "HyperEdgeSegmentSplitter/lambda$1$Type", 1818), + Wfn(1819, 1, {}, Ea), + (Fjn.Kb = function (n) { + return new SR(null, new Nz(Yx(n, 112).e, 16)); + }), + EF(VAn, "HyperEdgeSegmentSplitter/lambda$2$Type", 1819), + Wfn(1820, 1, {}, Ta), + (Fjn.Kb = function (n) { + return new SR(null, new Nz(Yx(n, 112).j, 16)); + }), + EF(VAn, "HyperEdgeSegmentSplitter/lambda$3$Type", 1820), + Wfn(1821, 1, {}, Ma), + (Fjn.Fe = function (n) { + return ty(fL(n)); + }), + EF(VAn, "HyperEdgeSegmentSplitter/lambda$4$Type", 1821), + Wfn(655, 1, {}, gF), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.c = 0), + EF(VAn, "OrthogonalRoutingGenerator", 655), + Wfn(1638, 1, {}, Sa), + (Fjn.Kb = function (n) { + return new SR(null, new Nz(Yx(n, 112).e, 16)); + }), + EF(VAn, "OrthogonalRoutingGenerator/lambda$0$Type", 1638), + Wfn(1639, 1, {}, Pa), + (Fjn.Kb = function (n) { + return new SR(null, new Nz(Yx(n, 112).j, 16)); + }), + EF(VAn, "OrthogonalRoutingGenerator/lambda$1$Type", 1639), + Wfn(661, 1, {}), + EF(QAn, "BaseRoutingDirectionStrategy", 661), + Wfn(1807, 661, {}, Ov), + (Fjn.dg = function (n, t, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g; + if (!n.r || n.q) + for (f = t + n.o * i, h = new pb(n.n); h.a < h.c.c.length; ) + for (s = Yx(Hz(h), 11), l = $5(x4(Gy(B7n, 1), TEn, 8, 0, [s.i.n, s.n, s.a])).a, o = new pb(s.g); o.a < o.c.c.length; ) + ZW((u = Yx(Hz(o), 17))) || + ((d = u.d), + (g = $5(x4(Gy(B7n, 1), TEn, 8, 0, [d.i.n, d.n, d.a])).a), + e.Math.abs(l - g) > PPn && + ((c = n), + (r = new QS(l, (a = f))), + KD(u.a, r), + kpn(this, u, c, r, !1), + (b = n.r) && + ((r = new QS((w = ty(fL(ken(b.e, 0)))), a)), + KD(u.a, r), + kpn(this, u, c, r, !1), + (c = b), + (r = new QS(w, (a = t + b.o * i))), + KD(u.a, r), + kpn(this, u, c, r, !1)), + (r = new QS(g, a)), + KD(u.a, r), + kpn(this, u, c, r, !1))); + }), + (Fjn.eg = function (n) { + return n.i.n.a + n.n.a + n.a.a; + }), + (Fjn.fg = function () { + return Ikn(), Bit; + }), + (Fjn.gg = function () { + return Ikn(), Tit; + }), + EF(QAn, "NorthToSouthRoutingStrategy", 1807), + Wfn(1808, 661, {}, Av), + (Fjn.dg = function (n, t, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g; + if (!n.r || n.q) + for (f = t - n.o * i, h = new pb(n.n); h.a < h.c.c.length; ) + for (s = Yx(Hz(h), 11), l = $5(x4(Gy(B7n, 1), TEn, 8, 0, [s.i.n, s.n, s.a])).a, o = new pb(s.g); o.a < o.c.c.length; ) + ZW((u = Yx(Hz(o), 17))) || + ((d = u.d), + (g = $5(x4(Gy(B7n, 1), TEn, 8, 0, [d.i.n, d.n, d.a])).a), + e.Math.abs(l - g) > PPn && + ((c = n), + (r = new QS(l, (a = f))), + KD(u.a, r), + kpn(this, u, c, r, !1), + (b = n.r) && + ((r = new QS((w = ty(fL(ken(b.e, 0)))), a)), + KD(u.a, r), + kpn(this, u, c, r, !1), + (c = b), + (r = new QS(w, (a = t - b.o * i))), + KD(u.a, r), + kpn(this, u, c, r, !1)), + (r = new QS(g, a)), + KD(u.a, r), + kpn(this, u, c, r, !1))); + }), + (Fjn.eg = function (n) { + return n.i.n.a + n.n.a + n.a.a; + }), + (Fjn.fg = function () { + return Ikn(), Tit; + }), + (Fjn.gg = function () { + return Ikn(), Bit; + }), + EF(QAn, "SouthToNorthRoutingStrategy", 1808), + Wfn(1806, 661, {}, $v), + (Fjn.dg = function (n, t, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g; + if (!n.r || n.q) + for (f = t + n.o * i, h = new pb(n.n); h.a < h.c.c.length; ) + for (s = Yx(Hz(h), 11), l = $5(x4(Gy(B7n, 1), TEn, 8, 0, [s.i.n, s.n, s.a])).b, o = new pb(s.g); o.a < o.c.c.length; ) + ZW((u = Yx(Hz(o), 17))) || + ((d = u.d), + (g = $5(x4(Gy(B7n, 1), TEn, 8, 0, [d.i.n, d.n, d.a])).b), + e.Math.abs(l - g) > PPn && + ((c = n), + (r = new QS((a = f), l)), + KD(u.a, r), + kpn(this, u, c, r, !0), + (b = n.r) && + ((r = new QS(a, (w = ty(fL(ken(b.e, 0)))))), + KD(u.a, r), + kpn(this, u, c, r, !0), + (c = b), + (r = new QS((a = t + b.o * i), w)), + KD(u.a, r), + kpn(this, u, c, r, !0)), + (r = new QS(a, g)), + KD(u.a, r), + kpn(this, u, c, r, !0))); + }), + (Fjn.eg = function (n) { + return n.i.n.b + n.n.b + n.a.b; + }), + (Fjn.fg = function () { + return Ikn(), Eit; + }), + (Fjn.gg = function () { + return Ikn(), qit; + }), + EF(QAn, "WestToEastRoutingStrategy", 1806), + Wfn(813, 1, {}, Tvn), + (Fjn.Ib = function () { + return Gun(this.a); + }), + (Fjn.b = 0), + (Fjn.c = !1), + (Fjn.d = !1), + (Fjn.f = 0), + EF(JAn, "NubSpline", 813), + Wfn(407, 1, { 407: 1 }, Pwn, Qq), + EF(JAn, "NubSpline/PolarCP", 407), + Wfn(1453, 1, KAn, grn), + (Fjn.Yf = function (n) { + return (function (n) { + var t, e; + return ( + T3((t = new fX()), H4n), + (e = Yx(Aun(n, (Ojn(), bQn)), 21)).Hc((edn(), $Vn)) && T3(t, U4n), + e.Hc(EVn) && T3(t, q4n), + e.Hc(OVn) && T3(t, z4n), + e.Hc(MVn) && T3(t, G4n), + t + ); + })(Yx(n, 37)); + }), + (Fjn.pf = function (n, t) { + !(function (n, t, i) { + var r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M, S, P, I; + if ((run(i, "Spline edge routing", 1), 0 == t.b.c.length)) return (t.f.a = 0), void Ron(i); + (v = ty(fL(Aun(t, (gjn(), z0n))))), + (o = ty(fL(Aun(t, K0n)))), + (u = ty(fL(Aun(t, x0n)))), + (T = Yx(Aun(t, v1n), 336) == ($6(), v3n)), + (E = ty(fL(Aun(t, m1n)))), + (n.d = t), + (n.j.c = VQ(UKn, iEn, 1, 0, 5, 1)), + (n.a.c = VQ(UKn, iEn, 1, 0, 5, 1)), + U_(n.k), + (f = oI((s = Yx(TR(t.b, 0), 29)).a, (ywn(), D4n))), + (l = oI((d = Yx(TR(t.b, t.b.c.length - 1), 29)).a, D4n)), + (g = new pb(t.b)), + (p = null), + (I = 0); + do { + for ( + Nkn(n, p, (m = g.a < g.c.c.length ? Yx(Hz(g), 29) : null)), + Qpn(n), + P = 0, + y = I, + b = !p || (f && p == s), + w = !m || (l && m == d), + (M = Hy(H2(bH(hH(new SR(null, new Nz(n.i, 16)), new ya()), new ma())))) > 0 + ? ((h = 0), + p && (h += o), + (h += (M - 1) * u), + m && (h += o), + T && m && (h = e.Math.max(h, hwn(m, u, v, E))), + h < v && !b && !w && ((P = (v - h) / 2), (h = v)), + (y += h)) + : !b && !w && (y += v), + m && Qmn(m, y), + j = new pb(n.i); + j.a < j.c.c.length; + + ) + ((k = Yx(Hz(j), 128)).a.c = I), (k.a.b = y - I), (k.F = P), (k.p = !p); + S4(n.a, n.i), (I = y), m && (I += m.c.a), (p = m), (b = w); + } while (m); + for (c = new pb(n.j); c.a < c.c.c.length; ) + (a = B3(n, (r = Yx(Hz(c), 17)))), b5(r, (Ojn(), UQn), a), (S = Dwn(n, r)), b5(r, WQn, S); + (t.f.a = I), (n.d = null), Ron(i); + })(this, Yx(n, 37), t); + }), + EF(JAn, "SplineEdgeRouter", 1453), + Wfn(268, 1, { 268: 1 }, ZV), + (Fjn.Ib = function () { + return this.a + " ->(" + this.c + ") " + this.b; + }), + (Fjn.c = 0), + EF(JAn, "SplineEdgeRouter/Dependency", 268), + Wfn(455, 22, { 3: 1, 35: 1, 22: 1, 455: 1 }, SS); + var Q4n, + Y4n, + J4n, + Z4n, + n5n, + t5n = X1( + JAn, + "SplineEdgeRouter/SideToProcess", + 455, + u_n, + function () { + return Yq(), x4(Gy(t5n, 1), XEn, 455, 0, [X4n, W4n]); + }, + function (n) { + return Yq(), rZ((RW(), Q4n), n); + }, + ); + Wfn(1454, 1, YEn, ya), + (Fjn.Mb = function (n) { + return kwn(), !Yx(n, 128).o; + }), + EF(JAn, "SplineEdgeRouter/lambda$0$Type", 1454), + Wfn(1455, 1, {}, ma), + (Fjn.Ge = function (n) { + return kwn(), Yx(n, 128).v + 1; + }), + EF(JAn, "SplineEdgeRouter/lambda$1$Type", 1455), + Wfn(1456, 1, PEn, PS), + (Fjn.td = function (n) { + !(function (n, t, e) { + xB(n.b, Yx(e.b, 17), t); + })(this.a, this.b, Yx(n, 46)); + }), + EF(JAn, "SplineEdgeRouter/lambda$2$Type", 1456), + Wfn(1457, 1, PEn, IS), + (Fjn.td = function (n) { + !(function (n, t, e) { + xB(n.b, Yx(e.b, 17), t); + })(this.a, this.b, Yx(n, 46)); + }), + EF(JAn, "SplineEdgeRouter/lambda$3$Type", 1457), + Wfn(128, 1, { 35: 1, 128: 1 }, Ksn, qmn), + (Fjn.wd = function (n) { + return (function (n, t) { + return n.s - t.s; + })(this, Yx(n, 128)); + }), + (Fjn.b = 0), + (Fjn.e = !1), + (Fjn.f = 0), + (Fjn.g = 0), + (Fjn.j = !1), + (Fjn.k = !1), + (Fjn.n = 0), + (Fjn.o = !1), + (Fjn.p = !1), + (Fjn.q = !1), + (Fjn.s = 0), + (Fjn.u = 0), + (Fjn.v = 0), + (Fjn.F = 0), + EF(JAn, "SplineSegment", 128), + Wfn(459, 1, { 459: 1 }, ka), + (Fjn.a = 0), + (Fjn.b = !1), + (Fjn.c = !1), + (Fjn.d = !1), + (Fjn.e = !1), + (Fjn.f = 0), + EF(JAn, "SplineSegment/EdgeInformation", 459), + Wfn(1234, 1, {}, da), + EF(i$n, vPn, 1234), + Wfn(1235, 1, FMn, ga), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i, r; + return 0 == (e = Yx(Aun(t, (cln(), U5n)), 19).a - Yx(Aun(n, U5n), 19).a) + ? ((i = yN(dO(Yx(Aun(n, (ryn(), b5n)), 8)), Yx(Aun(n, w5n), 8))), + (r = yN(dO(Yx(Aun(t, b5n), 8)), Yx(Aun(t, w5n), 8))), + $9(i.a * i.b, r.a * r.b)) + : e; + })(Yx(n, 135), Yx(t, 135)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(i$n, mPn, 1235), + Wfn(1233, 1, {}, fj), + EF(i$n, "MrTree", 1233), + Wfn(393, 22, { 3: 1, 35: 1, 22: 1, 393: 1, 246: 1, 234: 1 }, CS), + (Fjn.Kf = function () { + return _hn(this); + }), + (Fjn.Xf = function () { + return _hn(this); + }); + var e5n, + i5n = X1( + i$n, + "TreeLayoutPhases", + 393, + u_n, + function () { + return Krn(), x4(Gy(i5n, 1), XEn, 393, 0, [Y4n, J4n, Z4n, n5n]); + }, + function (n) { + return Krn(), rZ((WY(), e5n), n); + }, + ); + Wfn(1130, 209, VSn, wN), + (Fjn.Ze = function (n, t) { + var i, r, c, a, u, o; + for ( + ny(hL(jln(n, (cln(), H5n)))) || rG(new Xb((dT(), new Xm(n)))), + o4((u = new nQ()), n), + b5(u, (ryn(), E5n), n), + (function (n, t, i) { + var r, c, a, u, o; + for (a = 0, c = new UO((!n.a && (n.a = new m_(uct, n, 10, 11)), n.a)); c.e != c.i.gc(); ) + (u = ""), + 0 == (!(r = Yx(hen(c), 33)).n && (r.n = new m_(act, r, 1, 7)), r.n).i || + (u = Yx(c1((!r.n && (r.n = new m_(act, r, 1, 7)), r.n), 0), 137).a), + o4((o = new Z5(a++, t, u)), r), + b5(o, (ryn(), E5n), r), + (o.e.b = r.j + r.f / 2), + (o.f.a = e.Math.max(r.g, 1)), + (o.e.a = r.i + r.g / 2), + (o.f.b = e.Math.max(r.f, 1)), + KD(t.b, o), + Ysn(i.f, r, o); + })(n, u, (o = new rp())), + (function (n, t, e) { + var i, r, c, a, u, o, s; + for (a = new UO((!n.a && (n.a = new m_(uct, n, 10, 11)), n.a)); a.e != a.i.gc(); ) + for (r = new $K(bA(lbn((c = Yx(hen(a), 33))).a.Kc(), new h())); Vfn(r); ) + Rfn((i = Yx(kV(r), 79))) || + Rfn(i) || + Whn(i) || + ((o = Yx(eI(Dq(e.f, c)), 86)), + (s = Yx(BF(e, iun(Yx(c1((!i.c && (i.c = new AN(Zrt, i, 5, 8)), i.c), 0), 82))), 86)), + o && s && (b5((u = new iq(o, s)), (ryn(), E5n), i), o4(u, i), KD(o.d, u), KD(s.b, u), KD(t.a, u))); + })(n, u, o), + a = u, + r = new pb((c = gpn(this.a, a))); + r.a < r.c.c.length; + + ) + (i = Yx(Hz(r), 135)), xan(this.b, i, J2(t, 1 / c.c.length)); + !(function (n) { + var t, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j; + for (r = Yx(Aun(n, (ryn(), E5n)), 33), o = Yjn, s = Yjn, a = nTn, u = nTn, k = Ztn(n.b, 0); k.b != k.d.c; ) + (w = (m = Yx(IX(k), 86)).e), + (d = m.f), + (o = e.Math.min(o, w.a - d.a / 2)), + (s = e.Math.min(s, w.b - d.b / 2)), + (a = e.Math.max(a, w.a + d.a / 2)), + (u = e.Math.max(u, w.b + d.b / 2)); + for (l = new QS((b = Yx(jln(r, (cln(), q5n)), 116)).b - o, b.d - s), y = Ztn(n.b, 0); y.b != y.d.c; ) + CO((f = Aun((m = Yx(IX(y), 86)), E5n)), 239) && jC((c = Yx(f, 33)), (h = mN(m.e, l)).a - c.g / 2, h.b - c.f / 2); + for (v = Ztn(n.a, 0); v.b != v.d.c; ) + (p = Yx(IX(v), 188)), + (i = Yx(Aun(p, E5n), 79)) && + (VW((t = p.a), (g = new fC(p.b.e)), t.a, t.a.a), + VW(t, (j = new fC(p.c.e)), t.c.b, t.c), + oon(g, Yx(ken(t, 1), 8), p.b.f), + oon(j, Yx(ken(t, t.b - 2), 8), p.c.f), + wvn(t, Ywn(i, !0, !0))); + xkn(r, a - o + (b.b + b.c), u - s + (b.d + b.a), !1, !1); + })( + (a = (function (n) { + var t, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M, S, P, I; + if (1 == n.c.length) return $z(0, n.c.length), Yx(n.c[0], 135); + if (n.c.length <= 0) return new nQ(); + for (s = new pb(n); s.a < s.c.c.length; ) { + for (u = Yx(Hz(s), 135), m = 0, d = Yjn, g = Yjn, b = nTn, w = nTn, v = Ztn(u.b, 0); v.b != v.d.c; ) + (p = Yx(IX(v), 86)), + (m += Yx(Aun(p, (cln(), U5n)), 19).a), + (d = e.Math.min(d, p.e.a)), + (g = e.Math.min(g, p.e.b)), + (b = e.Math.max(b, p.e.a + p.f.a)), + (w = e.Math.max(w, p.e.b + p.f.b)); + b5(u, (cln(), U5n), d9(m)), b5(u, (ryn(), w5n), new QS(d, g)), b5(u, b5n, new QS(b, w)); + } + for ( + XH(), JC(n, new ga()), o4((k = new nQ()), ($z(0, n.c.length), Yx(n.c[0], 94))), l = 0, S = 0, h = new pb(n); + h.a < h.c.c.length; + + ) + (u = Yx(Hz(h), 135)), + (j = yN(dO(Yx(Aun(u, (ryn(), b5n)), 8)), Yx(Aun(u, w5n), 8))), + (l = e.Math.max(l, j.a)), + (S += j.a * j.b); + for ( + l = e.Math.max(l, e.Math.sqrt(S) * ty(fL(Aun(k, (cln(), D5n))))), + P = 0, + I = 0, + f = 0, + t = E = ty(fL(Aun(k, V5n))), + o = new pb(n); + o.a < o.c.c.length; + + ) + (u = Yx(Hz(o), 135)), + P + (j = yN(dO(Yx(Aun(u, (ryn(), b5n)), 8)), Yx(Aun(u, w5n), 8))).a > l && ((P = 0), (I += f + E), (f = 0)), + gbn(k, u, P, I), + (t = e.Math.max(t, P + j.a)), + (f = e.Math.max(f, j.b)), + (P += j.a + E); + for (y = new rp(), i = new rp(), M = new pb(n); M.a < M.c.c.length; ) + for (r = ny(hL(Aun((T = Yx(Hz(M), 135)), (Cjn(), Snt)))), a = (T.q ? T.q : MFn).vc().Kc(); a.Ob(); ) + P_(y, (c = Yx(a.Pb(), 42)).cd()) + ? iI(Yx(c.cd(), 146).wg()) !== iI(c.dd()) && + (r && P_(i, c.cd()) + ? (oE(), Yx(c.cd(), 146).tg()) + : (xB(y, Yx(c.cd(), 146), c.dd()), b5(k, Yx(c.cd(), 146), c.dd()), r && xB(i, Yx(c.cd(), 146), c.dd()))) + : (xB(y, Yx(c.cd(), 146), c.dd()), b5(k, Yx(c.cd(), 146), c.dd())); + return k; + })(c)), + ); + }), + EF(i$n, "TreeLayoutProvider", 1130), + Wfn(1847, 1, $En, pa), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Kc = function () { + return XH(), sE(), PFn; + }), + EF(i$n, "TreeUtil/1", 1847), + Wfn(1848, 1, $En, va), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Kc = function () { + return XH(), sE(), PFn; + }), + EF(i$n, "TreeUtil/2", 1848), + Wfn(502, 134, { 3: 1, 502: 1, 94: 1, 134: 1 }), + (Fjn.g = 0), + EF(r$n, "TGraphElement", 502), + Wfn(188, 502, { 3: 1, 188: 1, 502: 1, 94: 1, 134: 1 }, iq), + (Fjn.Ib = function () { + return this.b && this.c ? Qz(this.b) + "->" + Qz(this.c) : "e_" + W5(this); + }), + EF(r$n, "TEdge", 188), + Wfn(135, 134, { 3: 1, 135: 1, 94: 1, 134: 1 }, nQ), + (Fjn.Ib = function () { + var n, t, e, i, r; + for (r = null, i = Ztn(this.b, 0); i.b != i.d.c; ) + r += (null == (e = Yx(IX(i), 86)).c || 0 == e.c.length ? "n_" + e.g : "n_" + e.c) + "\n"; + for (t = Ztn(this.a, 0); t.b != t.d.c; ) r += ((n = Yx(IX(t), 188)).b && n.c ? Qz(n.b) + "->" + Qz(n.c) : "e_" + W5(n)) + "\n"; + return r; + }); + var r5n = EF(r$n, "TGraph", 135); + Wfn(633, 502, { 3: 1, 502: 1, 633: 1, 94: 1, 134: 1 }), + EF(r$n, "TShape", 633), + Wfn(86, 633, { 3: 1, 502: 1, 86: 1, 633: 1, 94: 1, 134: 1 }, Z5), + (Fjn.Ib = function () { + return Qz(this); + }); + var c5n, + a5n, + u5n, + o5n, + s5n, + h5n, + f5n = EF(r$n, "TNode", 86); + Wfn(255, 1, $En, Dd), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Kc = function () { + return new Rd(Ztn(this.a.d, 0)); + }), + EF(r$n, "TNode/2", 255), + Wfn(358, 1, fEn, Rd), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Pb = function () { + return Yx(IX(this.a), 188).c; + }), + (Fjn.Ob = function () { + return ij(this.a); + }), + (Fjn.Qb = function () { + BZ(this.a); + }), + EF(r$n, "TNode/2/1", 358), + Wfn(1840, 1, dIn, bN), + (Fjn.pf = function (n, t) { + ivn(this, Yx(n, 135), t); + }), + EF(c$n, "FanProcessor", 1840), + Wfn(327, 22, { 3: 1, 35: 1, 22: 1, 327: 1, 234: 1 }, OS), + (Fjn.Kf = function () { + switch (this.g) { + case 0: + return new sm(); + case 1: + return new bN(); + case 2: + return new Oa(); + case 3: + return new Ia(); + case 4: + return new $a(); + case 5: + return new La(); + default: + throw hp(new Qm(FIn + (null != this.f ? this.f : "" + this.g))); + } + }); + var l5n, + b5n, + w5n, + d5n, + g5n, + p5n, + v5n, + m5n, + y5n, + k5n, + j5n, + E5n, + T5n, + M5n, + S5n, + P5n, + I5n, + C5n, + O5n, + A5n, + $5n, + L5n, + N5n, + x5n, + D5n, + R5n, + K5n, + _5n, + F5n, + B5n, + H5n, + q5n, + G5n, + z5n, + U5n, + X5n, + W5n, + V5n, + Q5n, + Y5n, + J5n, + Z5n = X1( + c$n, + BIn, + 327, + u_n, + function () { + return ysn(), x4(Gy(Z5n, 1), XEn, 327, 0, [h5n, a5n, o5n, u5n, s5n, c5n]); + }, + function (n) { + return ysn(), rZ((M1(), l5n), n); + }, + ); + Wfn(1843, 1, dIn, Ia), + (Fjn.pf = function (n, t) { + Pln(this, Yx(n, 135), t); + }), + (Fjn.a = 0), + EF(c$n, "LevelHeightProcessor", 1843), + Wfn(1844, 1, $En, Ca), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Kc = function () { + return XH(), sE(), PFn; + }), + EF(c$n, "LevelHeightProcessor/1", 1844), + Wfn(1841, 1, dIn, Oa), + (Fjn.pf = function (n, t) { + Nsn(this, Yx(n, 135), t); + }), + (Fjn.a = 0), + EF(c$n, "NeighborsProcessor", 1841), + Wfn(1842, 1, $En, Aa), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Kc = function () { + return XH(), sE(), PFn; + }), + EF(c$n, "NeighborsProcessor/1", 1842), + Wfn(1845, 1, dIn, $a), + (Fjn.pf = function (n, t) { + Sln(this, Yx(n, 135), t); + }), + (Fjn.a = 0), + EF(c$n, "NodePositionProcessor", 1845), + Wfn(1839, 1, dIn, sm), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i, r, c, a, u, o; + for (n.a.c = VQ(UKn, iEn, 1, 0, 5, 1), i = Ztn(t.b, 0); i.b != i.d.c; ) + 0 == (e = Yx(IX(i), 86)).b.b && (b5(e, (ryn(), C5n), (TA(), !0)), eD(n.a, e)); + switch (n.a.c.length) { + case 0: + b5((r = new Z5(0, t, "DUMMY_ROOT")), (ryn(), C5n), (TA(), !0)), b5(r, g5n, !0), KD(t.b, r); + break; + case 1: + break; + default: + for (c = new Z5(0, t, "SUPER_ROOT"), u = new pb(n.a); u.a < u.c.c.length; ) + b5((o = new iq(c, (a = Yx(Hz(u), 86)))), (ryn(), g5n), (TA(), !0)), + KD(c.a.a, o), + KD(c.d, o), + KD(a.b, o), + b5(a, C5n, !1); + b5(c, (ryn(), C5n), (TA(), !0)), b5(c, g5n, !0), KD(t.b, c); + } + })(this, Yx(n, 135)); + }), + EF(c$n, "RootProcessor", 1839), + Wfn(1846, 1, dIn, La), + (Fjn.pf = function (n, t) { + !(function (n) { + var t, e; + for (e = Yx(Aun(n, (ryn(), S5n)), 15).Kc(); e.Ob(); ) KD((t = Yx(e.Pb(), 188)).b.d, t), KD(t.c.b, t); + })(Yx(n, 135)); + }), + EF(c$n, "Untreeifyer", 1846), + Wfn(851, 1, fSn, Mf), + (Fjn.Qe = function (n) { + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk(bk(fk(lk(new Fu(), o$n), ""), "Weighting of Nodes"), "Which weighting to use when computing a node order."), + x5n, + ), + (lsn(), O7n), + ), + i6n, + ), + J9((Qtn(), T7n)), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk(bk(fk(lk(new Fu(), s$n), ""), "Search Order"), "Which search order to use when computing a spanning tree."), + L5n, + ), + O7n, + ), + l6n, + ), + J9(T7n), + ), + ), + ), + Nyn((new Tf(), n)); + }), + EF(h$n, "MrTreeMetaDataProvider", 851), + Wfn(994, 1, fSn, Tf), + (Fjn.Qe = function (n) { + Nyn(n); + }), + EF(h$n, "MrTreeOptions", 994), + Wfn(995, 1, {}, Na), + (Fjn.$e = function () { + return new wN(); + }), + (Fjn._e = function (n) {}), + EF(h$n, "MrTreeOptions/MrtreeFactory", 995), + Wfn(480, 22, { 3: 1, 35: 1, 22: 1, 480: 1 }, AS); + var n6n, + t6n, + e6n, + i6n = X1( + h$n, + "OrderWeighting", + 480, + u_n, + function () { + return KG(), x4(Gy(i6n, 1), XEn, 480, 0, [Y5n, J5n]); + }, + function (n) { + return KG(), rZ((FW(), n6n), n); + }, + ); + Wfn(425, 22, { 3: 1, 35: 1, 22: 1, 425: 1 }, $S); + var r6n, + c6n, + a6n, + u6n, + o6n, + s6n, + h6n, + f6n, + l6n = X1( + h$n, + "TreeifyingOrder", + 425, + u_n, + function () { + return kU(), x4(Gy(l6n, 1), XEn, 425, 0, [e6n, t6n]); + }, + function (n) { + return kU(), rZ((KW(), r6n), n); + }, + ); + Wfn(1459, 1, KAn, df), + (Fjn.Yf = function (n) { + return Yx(n, 135), c6n; + }), + (Fjn.pf = function (n, t) { + Z2(this, Yx(n, 135), t); + }), + EF("org.eclipse.elk.alg.mrtree.p1treeify", "DFSTreeifyer", 1459), + Wfn(1460, 1, KAn, gf), + (Fjn.Yf = function (n) { + return Yx(n, 135), a6n; + }), + (Fjn.pf = function (n, t) { + Hsn(this, Yx(n, 135), t); + }), + EF("org.eclipse.elk.alg.mrtree.p2order", "NodeOrderer", 1460), + Wfn(1461, 1, KAn, wf), + (Fjn.Yf = function (n) { + return Yx(n, 135), u6n; + }), + (Fjn.pf = function (n, t) { + Adn(this, Yx(n, 135), t); + }), + (Fjn.a = 0), + EF("org.eclipse.elk.alg.mrtree.p3place", "NodePlacer", 1461), + Wfn(1462, 1, KAn, pf), + (Fjn.Yf = function (n) { + return Yx(n, 135), o6n; + }), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e, i; + for (run(t, "Dull edge routing", 1), i = Ztn(n.b, 0); i.b != i.d.c; ) + for (e = Ztn(Yx(IX(i), 86).d, 0); e.b != e.d.c; ) BH(Yx(IX(e), 188).a); + })(Yx(n, 135), t); + }), + EF("org.eclipse.elk.alg.mrtree.p4route", "EdgeRouter", 1462), + Wfn(495, 22, { 3: 1, 35: 1, 22: 1, 495: 1, 246: 1, 234: 1 }, LS), + (Fjn.Kf = function () { + return U7(this); + }), + (Fjn.Xf = function () { + return U7(this); + }); + var b6n, + w6n, + d6n, + g6n, + p6n = X1( + b$n, + "RadialLayoutPhases", + 495, + u_n, + function () { + return p2(), x4(Gy(p6n, 1), XEn, 495, 0, [h6n, f6n]); + }, + function (n) { + return p2(), rZ((_W(), b6n), n); + }, + ); + Wfn(1131, 209, VSn, hj), + (Fjn.Ze = function (n, t) { + var e, i, r; + if ( + (run(t, "Radial layout", Jsn(this, n).c.length), + ny(hL(jln(n, (_rn(), z6n)))) || rG(new Xb((dT(), new Xm(n)))), + (r = (function (n) { + var t, e; + for (e = new UO((!n.a && (n.a = new m_(uct, n, 10, 11)), n.a)); e.e != e.i.gc(); ) + if (!Vfn(new $K(bA(fbn((t = Yx(hen(e), 33))).a.Kc(), new h())))) return t; + return null; + })(n)), + Aen(n, (eL(), s6n), r), + !r) + ) + throw hp(new Qm("The given graph is not a tree!")); + for (0 == (e = ty(fL(jln(n, Q6n)))) && (e = Ihn(n)), Aen(n, Q6n, e), i = new pb(Jsn(this, n)); i.a < i.c.c.length; ) + Yx(Hz(i), 51).pf(n, J2(t, 1)); + Ron(t); + }), + EF(b$n, "RadialLayoutProvider", 1131), + Wfn(549, 1, FMn, sj), + (Fjn.ue = function (n, t) { + return (function (n, t, i, r) { + var c, a, u, o, s, h, f, l; + return ( + (s = (u = Yx(jln(i, (Cjn(), Ott)), 8)).a), + (f = u.b + n), + (c = e.Math.atan2(f, s)) < 0 && (c += w$n), + (c += t) > w$n && (c -= w$n), + (h = (o = Yx(jln(r, Ott), 8)).a), + (l = o.b + n), + (a = e.Math.atan2(l, h)) < 0 && (a += w$n), + (a += t) > w$n && (a -= w$n), + XC(), + o0(1e-10), + e.Math.abs(c - a) <= 1e-10 || c == a || (isNaN(c) && isNaN(a)) ? 0 : c < a ? -1 : c > a ? 1 : QI(isNaN(c), isNaN(a)) + ); + })(this.a, this.b, Yx(n, 33), Yx(t, 33)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + (Fjn.a = 0), + (Fjn.b = 0), + EF(b$n, "RadialUtil/lambda$0$Type", 549), + Wfn(1375, 1, dIn, Da), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v; + for ( + run(t, "Calculate Graph Size", 1), + t.n && n && nU(t, RU(n), (P6(), jrt)), + o = wPn, + s = wPn, + a = d$n, + u = d$n, + l = new UO((!n.a && (n.a = new m_(uct, n, 10, 11)), n.a)); + l.e != l.i.gc(); + + ) + (d = (h = Yx(hen(l), 33)).i), + (g = h.j), + (v = h.g), + (r = h.f), + (c = Yx(jln(h, (Cjn(), Unt)), 142)), + (o = e.Math.min(o, d - c.b)), + (s = e.Math.min(s, g - c.d)), + (a = e.Math.max(a, d + v + c.c)), + (u = e.Math.max(u, g + r + c.a)); + for ( + b = new QS(o - (w = Yx(jln(n, (Cjn(), utt)), 116)).b, s - w.d), f = new UO((!n.a && (n.a = new m_(uct, n, 10, 11)), n.a)); + f.e != f.i.gc(); + + ) + L1((h = Yx(hen(f), 33)), h.i - b.a), N1(h, h.j - b.b); + (p = a - o + (w.b + w.c)), (i = u - s + (w.d + w.a)), $1(n, p), A1(n, i), t.n && n && nU(t, RU(n), (P6(), jrt)); + })(Yx(n, 33), t); + }), + EF(g$n, "CalculateGraphSize", 1375), + Wfn(442, 22, { 3: 1, 35: 1, 22: 1, 442: 1, 234: 1 }, NS), + (Fjn.Kf = function () { + switch (this.g) { + case 0: + return new Ba(); + case 1: + return new xa(); + case 2: + return new Da(); + default: + throw hp(new Qm(FIn + (null != this.f ? this.f : "" + this.g))); + } + }); + var v6n, + m6n, + y6n, + k6n = X1( + g$n, + BIn, + 442, + u_n, + function () { + return m7(), x4(Gy(k6n, 1), XEn, 442, 0, [g6n, w6n, d6n]); + }, + function (n) { + return m7(), rZ((KQ(), v6n), n); + }, + ); + Wfn(645, 1, {}), + (Fjn.e = 1), + (Fjn.g = 0), + EF(p$n, "AbstractRadiusExtensionCompaction", 645), + Wfn(1772, 645, {}, rL), + (Fjn.hg = function (n) { + var t, e, i, r, c, a, u, o, s; + for ( + this.c = Yx(jln(n, (eL(), s6n)), 33), + (function (n, t) { + n.f = t; + })(this, this.c), + this.d = Ven(Yx(jln(n, (_rn(), Y6n)), 293)), + (o = Yx(jln(n, _6n), 19)) && Bl(this, o.a), + Hl(this, (vB((u = fL(jln(n, (Cjn(), Xtt))))), u)), + s = idn(this.c), + this.d && this.d.lg(s), + (function (n, t) { + var e, i, r; + for (i = new pb(t); i.a < i.c.c.length; ) + if (((e = Yx(Hz(i), 33)), Qhn(n.a, e, e), Qhn(n.b, e, e), 0 != (r = idn(e)).c.length)) + for ( + n.d && n.d.lg(r), Qhn(n.a, e, ($z(0, r.c.length), Yx(r.c[0], 33))), Qhn(n.b, e, Yx(TR(r, r.c.length - 1), 33)); + 0 != G4(r).c.length; + + ) + (r = G4(r)), + n.d && n.d.lg(r), + Qhn(n.a, e, ($z(0, r.c.length), Yx(r.c[0], 33))), + Qhn(n.b, e, Yx(TR(r, r.c.length - 1), 33)); + })(this, s), + a = new ay(x4(Gy(uct, 1), v$n, 33, 0, [this.c])), + e = 0; + e < 2; + e++ + ) + for (t = 0; t < s.c.length; t++) + (r = new ay(x4(Gy(uct, 1), v$n, 33, 0, [($z(t, s.c.length), Yx(s.c[t], 33))]))), + (c = t < s.c.length - 1 ? ($z(t + 1, s.c.length), Yx(s.c[t + 1], 33)) : ($z(0, s.c.length), Yx(s.c[0], 33))), + (i = 0 == t ? Yx(TR(s, s.c.length - 1), 33) : ($z(t - 1, s.c.length), Yx(s.c[t - 1], 33))), + pun(this, ($z(t, s.c.length), Yx(s.c[t], 33), a), i, c, r); + }), + EF(p$n, "AnnulusWedgeCompaction", 1772), + Wfn(1374, 1, dIn, xa), + (Fjn.pf = function (n, t) { + $cn(Yx(n, 33), t); + }), + EF(p$n, "GeneralCompactor", 1374), + Wfn(1771, 645, {}, Ra), + (Fjn.hg = function (n) { + var t, e, i, r; + (e = Yx(jln(n, (eL(), s6n)), 33)), + (this.f = e), + (this.b = Ven(Yx(jln(n, (_rn(), Y6n)), 293))), + (r = Yx(jln(n, _6n), 19)) && Bl(this, r.a), + Hl(this, (vB((i = fL(jln(n, (Cjn(), Xtt))))), i)), + (t = idn(e)), + this.b && this.b.lg(t), + asn(this, t); + }), + (Fjn.a = 0), + EF(p$n, "RadialCompaction", 1771), + Wfn(1779, 1, {}, Ka), + (Fjn.ig = function (n) { + var t, e, i, r, c, a; + for (this.a = n, t = 0, i = 0, c = new pb((a = idn(n))); c.a < c.c.c.length; ) + for (r = Yx(Hz(c), 33), e = ++i; e < a.c.length; e++) gvn(this, r, ($z(e, a.c.length), Yx(a.c[e], 33))) && (t += 1); + return t; + }), + EF(m$n, "CrossingMinimizationPosition", 1779), + Wfn(1777, 1, {}, _a), + (Fjn.ig = function (n) { + var t, i, r, c, a, u, o, s, f, l, b, w, d; + for (r = 0, i = new $K(bA(lbn(n).a.Kc(), new h())); Vfn(i); ) + (t = Yx(kV(i), 79)), + (f = (o = iun(Yx(c1((!t.c && (t.c = new AN(Zrt, t, 5, 8)), t.c), 0), 82))).i + o.g / 2), + (l = o.j + o.f / 2), + (c = n.i + n.g / 2), + (a = n.j + n.f / 2), + ((b = new Pk()).a = f - c), + (b.b = l - a), + Ecn((u = new QS(b.a, b.b)), n.g, n.f), + (b.a -= u.a), + (b.b -= u.b), + (c = f - b.a), + (a = l - b.b), + Ecn((s = new QS(b.a, b.b)), o.g, o.f), + (b.a -= s.a), + (b.b -= s.b), + (w = (f = c + b.a) - c), + (d = (l = a + b.b) - a), + (r += e.Math.sqrt(w * w + d * d)); + return r; + }), + EF(m$n, "EdgeLengthOptimization", 1777), + Wfn(1778, 1, {}, Fa), + (Fjn.ig = function (n) { + var t, i, r, c, a, u, o, s, f; + for (r = 0, i = new $K(bA(lbn(n).a.Kc(), new h())); Vfn(i); ) + (t = Yx(kV(i), 79)), + (u = (a = iun(Yx(c1((!t.c && (t.c = new AN(Zrt, t, 5, 8)), t.c), 0), 82))).i + a.g / 2), + (o = a.j + a.f / 2), + (c = Yx(jln(a, (Cjn(), Ott)), 8)), + (s = u - (n.i + c.a + n.g / 2)), + (f = o - (n.j + c.b + n.f)), + (r += e.Math.sqrt(s * s + f * f)); + return r; + }), + EF(m$n, "EdgeLengthPositionOptimization", 1778), + Wfn(1373, 645, dIn, Ba), + (Fjn.pf = function (n, t) { + sbn(this, Yx(n, 33), t); + }), + EF("org.eclipse.elk.alg.radial.intermediate.overlaps", "RadiusExtensionOverlapRemoval", 1373), + Wfn(426, 22, { 3: 1, 35: 1, 22: 1, 426: 1 }, xS); + var j6n, + E6n, + T6n, + M6n, + S6n = X1( + k$n, + "AnnulusWedgeCriteria", + 426, + u_n, + function () { + return CY(), x4(Gy(S6n, 1), XEn, 426, 0, [m6n, y6n]); + }, + function (n) { + return CY(), rZ((BW(), j6n), n); + }, + ); + Wfn(380, 22, { 3: 1, 35: 1, 22: 1, 380: 1 }, DS); + var P6n, + I6n, + C6n, + O6n, + A6n, + $6n, + L6n, + N6n, + x6n, + D6n, + R6n, + K6n, + _6n, + F6n, + B6n, + H6n, + q6n, + G6n, + z6n, + U6n, + X6n, + W6n, + V6n, + Q6n, + Y6n, + J6n, + Z6n, + n8n, + t8n, + e8n, + i8n, + r8n = X1( + k$n, + tPn, + 380, + u_n, + function () { + return I6(), x4(Gy(r8n, 1), XEn, 380, 0, [E6n, T6n, M6n]); + }, + function (n) { + return I6(), rZ((_Q(), P6n), n); + }, + ); + Wfn(852, 1, fSn, vf), + (Fjn.Qe = function (n) { + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), j$n), ""), "Order ID"), + "The id can be used to define an order for nodes of one radius. This can be used to sort them in the layer accordingly.", + ), + d9(0), + ), + (lsn(), $7n), + ), + U_n, + ), + J9((Qtn(), E7n)), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), E$n), ""), "Radius"), + "The radius option can be used to set the initial radius for the radial layouter.", + ), + 0, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), T$n), ""), "Compaction"), + "With the compacter option it can be determined how compaction on the graph is done. It can be chosen between none, the radial compaction or the compaction of wedges separately.", + ), + O6n, + ), + O7n, + ), + r8n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), M$n), ""), "Compaction Step Size"), + "Determine the size of steps with which the compaction is done. Step size 1 correlates to a compaction of 1 pixel per Iteration.", + ), + d9(1), + ), + $7n, + ), + U_n, + ), + J9(T7n), + ), + ), + ), + xU(n, M$n, T$n, null), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), S$n), ""), "Sorter"), + "Sort the nodes per radius according to the sorting algorithm. The strategies are none, by the given order id, or sorting them by polar coordinates.", + ), + D6n, + ), + O7n, + ), + f8n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), P$n), ""), "Annulus Wedge Criteria"), + "Determine how the wedge for the node placement is calculated. It can be chosen between wedge determination by the number of leaves or by the maximum sum of diagonals.", + ), + K6n, + ), + O7n, + ), + S6n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), I$n), ""), "Translation Optimization"), + "Find the optimal translation of the nodes of the first radii according to this criteria. For example edge crossings can be minimized.", + ), + $6n, + ), + O7n, + ), + s8n, + ), + J9(T7n), + ), + ), + ), + pkn((new mf(), n)); + }), + EF(k$n, "RadialMetaDataProvider", 852), + Wfn(996, 1, fSn, mf), + (Fjn.Qe = function (n) { + pkn(n); + }), + EF(k$n, "RadialOptions", 996), + Wfn(997, 1, {}, Ha), + (Fjn.$e = function () { + return new hj(); + }), + (Fjn._e = function (n) {}), + EF(k$n, "RadialOptions/RadialFactory", 997), + Wfn(340, 22, { 3: 1, 35: 1, 22: 1, 340: 1 }, RS); + var c8n, + a8n, + u8n, + o8n, + s8n = X1( + k$n, + "RadialTranslationStrategy", + 340, + u_n, + function () { + return Hin(), x4(Gy(s8n, 1), XEn, 340, 0, [i8n, t8n, e8n, n8n]); + }, + function (n) { + return Hin(), rZ((QY(), c8n), n); + }, + ); + Wfn(293, 22, { 3: 1, 35: 1, 22: 1, 293: 1 }, KS); + var h8n, + f8n = X1( + k$n, + "SortingStrategy", + 293, + u_n, + function () { + return w3(), x4(Gy(f8n, 1), XEn, 293, 0, [u8n, o8n, a8n]); + }, + function (n) { + return w3(), rZ((BQ(), h8n), n); + }, + ); + Wfn(1449, 1, KAn, qa), + (Fjn.Yf = function (n) { + return Yx(n, 33), null; + }), + (Fjn.pf = function (n, t) { + vbn(this, Yx(n, 33), t); + }), + (Fjn.c = 0), + EF("org.eclipse.elk.alg.radial.p1position", "EadesRadial", 1449), + Wfn(1775, 1, {}, Ga), + (Fjn.jg = function (n) { + return Ien(n); + }), + EF(O$n, "AnnulusWedgeByLeafs", 1775), + Wfn(1776, 1, {}, za), + (Fjn.jg = function (n) { + return Dan(this, n); + }), + EF(O$n, "AnnulusWedgeByNodeSpace", 1776), + Wfn(1450, 1, KAn, Ua), + (Fjn.Yf = function (n) { + return Yx(n, 33), null; + }), + (Fjn.pf = function (n, t) { + wan(this, Yx(n, 33), t); + }), + EF("org.eclipse.elk.alg.radial.p2routing", "StraightLineEdgeRouter", 1450), + Wfn(811, 1, {}, fm), + (Fjn.kg = function (n) {}), + (Fjn.lg = function (n) { + yp(this, n); + }), + EF(A$n, "IDSorter", 811), + Wfn(1774, 1, FMn, Xa), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i; + return (e = Yx(jln(n, (_rn(), X6n)), 19)), (i = Yx(jln(t, X6n), 19)), eO(e.a, i.a); + })(Yx(n, 33), Yx(t, 33)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(A$n, "IDSorter/lambda$0$Type", 1774), + Wfn(1773, 1, {}, y2), + (Fjn.kg = function (n) { + NU(this, n); + }), + (Fjn.lg = function (n) { + n.dc() || (this.e || NU(this, LR(Yx(n.Xb(0), 33))), yp(this.e, n)); + }), + EF(A$n, "PolarCoordinateSorter", 1773), + Wfn(1136, 209, VSn, Wa), + (Fjn.Ze = function (n, t) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g, p, v, m, y, k, j, E, T; + if ( + (run(t, "Rectangle Packing", 1), + t.n && t.n && n && nU(t, RU(n), (P6(), jrt)), + (i = ty(fL(jln(n, (Jln(), S8n))))), + (w = Yx(jln(n, B8n), 381)), + (p = ny(hL(jln(n, N8n)))), + (y = ny(hL(jln(n, F8n)))), + (f = ny(hL(jln(n, O8n)))), + (k = Yx(jln(n, H8n), 116)), + (m = ty(fL(jln(n, U8n)))), + (r = ny(hL(jln(n, z8n)))), + (l = ny(hL(jln(n, A8n)))), + (g = ny(hL(jln(n, $8n)))), + (T = ty(fL(jln(n, X8n)))), + !n.a && (n.a = new m_(uct, n, 10, 11)), + w2((E = n.a)), + g) + ) { + for (b = new ip(), o = new UO(E); o.e != o.i.gc(); ) zQ((a = Yx(hen(o), 33)), C8n) && (b.c[b.c.length] = a); + for (s = new pb(b); s.a < s.c.c.length; ) qJ(E, (a = Yx(Hz(s), 33))); + for (XH(), JC(b, new Va()), h = new pb(b); h.a < h.c.c.length; ) + (a = Yx(Hz(h), 33)), (j = Yx(jln(a, C8n), 19).a), y9(E, (j = e.Math.min(j, E.i)), a); + for (d = 0, u = new UO(E); u.e != u.i.gc(); ) Aen((a = Yx(hen(u), 33)), I8n, d9(d)), ++d; + } + ((v = Asn(n)).a -= k.b + k.c), + (v.b -= k.d + k.a), + v.a, + T < 0 || T < v.a + ? ((c = (function (n, t, e, i) { + var r, c, a, u, o, s, h; + for ( + L1((a = Yx(c1(t, 0), 33)), 0), + N1(a, 0), + (o = new ip()).c[o.c.length] = a, + u = a, + c = new nR(n.a, a.g, a.f, (xbn(), Z8n)), + s = 1; + s < t.i; + s++ + ) + L1( + (h = Yx(c1(t, s), 33)), + (r = Fmn( + n, + cmn(n, Q8n, h, u, c, o, e), + cmn(n, V8n, h, u, c, o, e), + cmn(n, J8n, h, u, c, o, e), + cmn(n, Y8n, h, u, c, o, e), + h, + u, + i, + )).d, + ), + N1(h, r.e), + zl(r, Z8n), + (c = r), + (u = h), + (o.c[o.c.length] = h); + return c; + })(new Nx(i, w, p), E, m, k)), + t.n && t.n && n && nU(t, RU(n), (P6(), jrt))) + : (c = new nR(i, T, 0, (xbn(), Z8n))), + (v.a += k.b + k.c), + (v.b += k.d + k.a), + y || (w2(E), (c = tkn(new NX(i, f, l, r, m), E, e.Math.max(v.a, c.c), v, t, n, k))), + (function (n, t) { + var e, i; + for (i = new UO(n); i.e != i.i.gc(); ) jC((e = Yx(hen(i), 33)), e.i + t.b, e.j + t.d); + })(E, k), + xkn(n, c.c + (k.b + k.c), c.b + (k.d + k.a), !1, !0), + ny(hL(jln(n, _8n))) || rG(new Xb((dT(), new Xm(n)))), + t.n && t.n && n && nU(t, RU(n), (P6(), jrt)), + Ron(t); + }), + EF(x$n, "RectPackingLayoutProvider", 1136), + Wfn(1137, 1, FMn, Va), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i; + return (e = Yx(jln(n, (Jln(), C8n)), 19).a) == (i = Yx(jln(t, C8n), 19).a) || e < i ? -1 : e > i ? 1 : 0; + })(Yx(n, 33), Yx(t, 33)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(x$n, "RectPackingLayoutProvider/lambda$0$Type", 1137), + Wfn(1256, 1, {}, Nx), + (Fjn.a = 0), + (Fjn.c = !1), + EF(D$n, "AreaApproximation", 1256); + var l8n, + b8n, + w8n, + d8n = aR(D$n, "BestCandidateFilter"); + Wfn(638, 1, { 526: 1 }, Qa), + (Fjn.mg = function (n, t, i) { + var r, c, a, u, o, s; + for (s = new ip(), a = JTn, o = new pb(n); o.a < o.c.c.length; ) + (u = Yx(Hz(o), 220)), (a = e.Math.min(a, (u.c + (i.b + i.c)) * (u.b + (i.d + i.a)))); + for (c = new pb(n); c.a < c.c.c.length; ) + ((r = Yx(Hz(c), 220)).c + (i.b + i.c)) * (r.b + (i.d + i.a)) == a && (s.c[s.c.length] = r); + return s; + }), + EF(D$n, "AreaFilter", 638), + Wfn(639, 1, { 526: 1 }, Ya), + (Fjn.mg = function (n, t, i) { + var r, c, a, u, o, s; + for (o = new ip(), s = JTn, u = new pb(n); u.a < u.c.c.length; ) + (a = Yx(Hz(u), 220)), (s = e.Math.min(s, e.Math.abs((a.c + (i.b + i.c)) / (a.b + (i.d + i.a)) - t))); + for (c = new pb(n); c.a < c.c.c.length; ) + (r = Yx(Hz(c), 220)), e.Math.abs((r.c + (i.b + i.c)) / (r.b + (i.d + i.a)) - t) == s && (o.c[o.c.length] = r); + return o; + }), + EF(D$n, "AspectRatioFilter", 639), + Wfn(637, 1, { 526: 1 }, Ja), + (Fjn.mg = function (n, t, i) { + var r, c, a, u, o, s; + for (s = new ip(), a = ZTn, o = new pb(n); o.a < o.c.c.length; ) + (u = Yx(Hz(o), 220)), (a = e.Math.max(a, AR(u.c + (i.b + i.c), u.b + (i.d + i.a), u.a))); + for (c = new pb(n); c.a < c.c.c.length; ) + AR((r = Yx(Hz(c), 220)).c + (i.b + i.c), r.b + (i.d + i.a), r.a) == a && (s.c[s.c.length] = r); + return s; + }), + EF(D$n, "ScaleMeasureFilter", 637), + Wfn(381, 22, { 3: 1, 35: 1, 22: 1, 381: 1 }, _S); + var g8n, + p8n, + v8n, + m8n, + y8n, + k8n, + j8n, + E8n, + T8n, + M8n, + S8n, + P8n, + I8n, + C8n, + O8n, + A8n, + $8n, + L8n, + N8n, + x8n, + D8n, + R8n, + K8n, + _8n, + F8n, + B8n, + H8n, + q8n, + G8n, + z8n, + U8n, + X8n, + W8n = X1( + R$n, + "OptimizationGoal", + 381, + u_n, + function () { + return p7(), x4(Gy(W8n, 1), XEn, 381, 0, [b8n, w8n, l8n]); + }, + function (n) { + return p7(), rZ((FQ(), g8n), n); + }, + ); + Wfn(856, 1, fSn, If), + (Fjn.Qe = function (n) { + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), K$n), ""), "Optimization Goal"), + "Optimization goal for approximation of the bounding box given by the first iteration. Determines whether layout is sorted by the maximum scaling, aspect ratio, or area. Depending on the strategy the aspect ratio might be nearly ignored.", + ), + E8n, + ), + (lsn(), O7n), + ), + W8n, + ), + J9((Qtn(), E7n)), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), _$n), ""), "Shift Last Placed."), + "When placing a rectangle behind or below the last placed rectangle in the first iteration, it is sometimes possible to shift the rectangle further to the left or right, resulting in less whitespace. True (default) enables the shift and false disables it. Disabling the shift produces a greater approximated area by the first iteration and a layout, when using ONLY the first iteration (default not the case), where it is sometimes impossible to implement a size transformation of rectangles that will fill the bounding box and eliminate empty spaces.", + ), + (TA(), !0), + ), + I7n, + ), + D_n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), F$n), ""), "Current position of a node in the order of nodes"), + "The rectangles are ordered. Normally according to their definition the the model. This option specifies the current position of a node.", + ), + d9(-1), + ), + $7n, + ), + U_n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), B$n), ""), "Desired index of node"), + "The rectangles are ordered. Normally according to their definition the the model. This option allows to specify a desired position that has preference over the original position.", + ), + d9(-1), + ), + $7n, + ), + U_n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), H$n), ""), "Only Area Approximation"), + "If enabled only the width approximation step is executed and the nodes are placed accordingly. The nodes are layouted according to the packingStrategy. If set to true not expansion of nodes is taking place.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), q$n), ""), "Compact Rows"), + "Enables compaction. Compacts blocks if they do not use the full height of the row. This option allows to have a smaller drawing. If this option is disabled all nodes are placed next to each other in rows.", + ), + !0, + ), + I7n, + ), + D_n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), G$n), ""), "Fit Aspect Ratio"), + "Expands nodes if expandNodes is true to fit the aspect ratio instead of only in their bounds. The option is only useful if the used packingStrategy is ASPECT_RATIO_DRIVEN, otherwise this may result in unreasonable ndoe expansion.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(E7n), + ), + ), + ), + xU(n, G$n, U$n, null), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), z$n), ""), "Target Width"), + "Option to place the rectangles in the given target width instead of approximating the width using the desired aspect ratio. The padding is not included in this. Meaning a drawing will have width of targetwidth + horizontal padding.", + ), + -1, + ), + C7n, + ), + H_n, + ), + J9(E7n), + ), + ), + ), + hjn((new Cf(), n)); + }), + EF(R$n, "RectPackingMetaDataProvider", 856), + Wfn(1004, 1, fSn, Cf), + (Fjn.Qe = function (n) { + hjn(n); + }), + EF(R$n, "RectPackingOptions", 1004), + Wfn(1005, 1, {}, Za), + (Fjn.$e = function () { + return new Wa(); + }), + (Fjn._e = function (n) {}), + EF(R$n, "RectPackingOptions/RectpackingFactory", 1005), + Wfn(1257, 1, {}, NX), + (Fjn.a = 0), + (Fjn.b = !1), + (Fjn.c = 0), + (Fjn.d = 0), + (Fjn.e = !1), + (Fjn.f = !1), + (Fjn.g = 0), + EF("org.eclipse.elk.alg.rectpacking.seconditeration", "RowFillingAndCompaction", 1257), + Wfn(187, 1, { 187: 1 }, n6), + (Fjn.a = 0), + (Fjn.c = !1), + (Fjn.d = 0), + (Fjn.e = 0), + (Fjn.f = 0), + (Fjn.g = 0), + (Fjn.i = 0), + (Fjn.k = !1), + (Fjn.o = JTn), + (Fjn.p = JTn), + (Fjn.r = 0), + (Fjn.s = 0), + (Fjn.t = 0), + EF(W$n, "Block", 187), + Wfn(211, 1, { 211: 1 }, gG), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.d = 0), + (Fjn.e = 0), + (Fjn.f = 0), + EF(W$n, "BlockRow", 211), + Wfn(443, 1, { 443: 1 }, pG), + (Fjn.b = 0), + (Fjn.c = 0), + (Fjn.d = 0), + (Fjn.e = 0), + (Fjn.f = 0), + EF(W$n, "BlockStack", 443), + Wfn(220, 1, { 220: 1 }, nR, F7), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.c = 0), + (Fjn.d = 0), + (Fjn.e = 0); + var V8n, + Q8n, + Y8n, + J8n, + Z8n, + n9n = EF(W$n, "DrawingData", 220); + Wfn(355, 22, { 3: 1, 35: 1, 22: 1, 355: 1 }, FS); + var t9n, + e9n, + i9n, + r9n, + c9n = X1( + W$n, + "DrawingDataDescriptor", + 355, + u_n, + function () { + return xbn(), x4(Gy(c9n, 1), XEn, 355, 0, [Q8n, V8n, J8n, Y8n, Z8n]); + }, + function (n) { + return xbn(), rZ((vZ(), t9n), n); + }, + ); + Wfn(200, 1, { 200: 1 }, dU), + (Fjn.b = 0), + (Fjn.c = 0), + (Fjn.e = 0), + (Fjn.f = 0), + EF(W$n, "RectRow", 200), + Wfn(756, 1, {}, t8), + (Fjn.j = 0), + EF(Q$n, AIn, 756), + Wfn(1245, 1, {}, nu), + (Fjn.Je = function (n) { + return cY(n.a, n.b); + }), + EF(Q$n, $In, 1245), + Wfn(1246, 1, {}, Kd), + (Fjn.Je = function (n) { + return (function (n, t) { + return e.Math.min(cY(t.a, n.d.d.c), cY(t.b, n.d.d.c)); + })(this.a, n); + }), + EF(Q$n, LIn, 1246), + Wfn(1247, 1, {}, _d), + (Fjn.Je = function (n) { + return (function (n, t) { + var e, i; + return ( + (e = Yx(Yx(BF(n.g, t.a), 46).a, 65)), + (i = Yx(Yx(BF(n.g, t.b), 46).a, 65)), + cY(t.a, t.b) - cY(t.a, bO(e.b)) - cY(t.b, bO(i.b)) + ); + })(this.a, n); + }), + EF(Q$n, NIn, 1247), + Wfn(1248, 1, {}, Fd), + (Fjn.Je = function (n) { + return (function (n, t) { + return Vpn(Yx(Yx(BF(n.g, t.a), 46).a, 65), Yx(Yx(BF(n.g, t.b), 46).a, 65)); + })(this.a, n); + }), + EF(Q$n, "ElkGraphImporter/lambda$3$Type", 1248), + Wfn(1249, 1, {}, Bd), + (Fjn.Je = function (n) { + return nfn(this.a, n); + }), + EF(Q$n, xIn, 1249), + Wfn(1133, 209, VSn, lj), + (Fjn.Ze = function (n, t) { + var e, i, r, c, a, u, o, s, h, f; + for ( + zQ(n, (Dun(), x9n)) && ((f = lL(jln(n, (lin(), i7n)))), (c = sgn(s0(), f)) && Yx(Xq(c.f), 209).Ze(n, J2(t, 1))), + Aen(n, O9n, (cQ(), b9n)), + Aen(n, A9n, (Aon(), m9n)), + Aen(n, $9n, (B4(), o7n)), + a = Yx(jln(n, (lin(), Z9n)), 19).a, + run(t, "Overlap removal", 1), + ny(hL(jln(n, J9n))), + o = new Hd((u = new Qp())), + e = vjn((i = new t8()), n), + s = !0, + r = 0; + r < a && s; + + ) { + if (ny(hL(jln(n, n7n)))) { + if ((u.a.$b(), Ssn(new oO(o), e.i), 0 == u.a.gc())) break; + e.e = u; + } + for ( + _U(this.b), + q_(this.b, (v7(), e9n), (iT(), r7n)), + q_(this.b, i9n, e.g), + q_(this.b, r9n, (eT(), h9n)), + this.a = Zmn(this.b, e), + h = new pb(this.a); + h.a < h.c.c.length; + + ) + Yx(Hz(h), 51).pf(e, J2(t, 1)); + Scn(i, e), (s = ny(hL(Aun(e, (y3(), fqn))))), ++r; + } + Lyn(i, e), Ron(t); + }), + EF(Q$n, "OverlapRemovalLayoutProvider", 1133), + Wfn(1134, 1, {}, Hd), + EF(Q$n, "OverlapRemovalLayoutProvider/lambda$0$Type", 1134), + Wfn(437, 22, { 3: 1, 35: 1, 22: 1, 437: 1 }, BS); + var a9n, + u9n, + o9n = X1( + Q$n, + "SPOrEPhases", + 437, + u_n, + function () { + return v7(), x4(Gy(o9n, 1), XEn, 437, 0, [e9n, i9n, r9n]); + }, + function (n) { + return v7(), rZ((HQ(), a9n), n); + }, + ); + Wfn(1255, 1, {}, bj), + EF(Q$n, "ShrinkTree", 1255), + Wfn(1135, 209, VSn, lm), + (Fjn.Ze = function (n, t) { + var e, i, r, c; + zQ(n, (Dun(), x9n)) && ((c = lL(jln(n, x9n))), (r = sgn(s0(), c)) && Yx(Xq(r.f), 209).Ze(n, J2(t, 1))), + (e = vjn((i = new t8()), n)), + (function (n, t, e) { + var i; + if ( + (_U(n.b), + q_(n.b, (v7(), e9n), (iT(), r7n)), + q_(n.b, i9n, t.g), + q_(n.b, r9n, t.a), + (n.a = Zmn(n.b, t)), + run(e, "Compaction by shrinking a tree", n.a.c.length), + t.i.c.length > 1) + ) + for (i = new pb(n.a); i.a < i.c.c.length; ) Yx(Hz(i), 51).pf(t, J2(e, 1)); + Ron(e); + })(this.a, e, J2(t, 1)), + Lyn(i, e); + }), + EF(Q$n, "ShrinkTreeLayoutProvider", 1135), + Wfn(300, 134, { 3: 1, 300: 1, 94: 1, 134: 1 }, dG), + (Fjn.c = !1), + EF("org.eclipse.elk.alg.spore.graph", "Graph", 300), + Wfn(482, 22, { 3: 1, 35: 1, 22: 1, 482: 1, 246: 1, 234: 1 }, aT), + (Fjn.Kf = function () { + return Q5(this); + }), + (Fjn.Xf = function () { + return Q5(this); + }); + var s9n, + h9n, + f9n = X1( + Y$n, + tPn, + 482, + u_n, + function () { + return tT(), x4(Gy(f9n, 1), XEn, 482, 0, [u9n]); + }, + function (n) { + return tT(), rZ((vX(), s9n), n); + }, + ); + Wfn(551, 22, { 3: 1, 35: 1, 22: 1, 551: 1, 246: 1, 234: 1 }, aL), + (Fjn.Kf = function () { + return new ru(); + }), + (Fjn.Xf = function () { + return new ru(); + }); + var l9n, + b9n, + w9n, + d9n = X1( + Y$n, + "OverlapRemovalStrategy", + 551, + u_n, + function () { + return eT(), x4(Gy(d9n, 1), XEn, 551, 0, [h9n]); + }, + function (n) { + return eT(), rZ((pX(), l9n), n); + }, + ); + Wfn(430, 22, { 3: 1, 35: 1, 22: 1, 430: 1 }, HS); + var g9n, + p9n, + v9n, + m9n, + y9n, + k9n, + j9n = X1( + Y$n, + "RootSelection", + 430, + u_n, + function () { + return cQ(), x4(Gy(j9n, 1), XEn, 430, 0, [w9n, b9n]); + }, + function (n) { + return cQ(), rZ((qW(), g9n), n); + }, + ); + Wfn(316, 22, { 3: 1, 35: 1, 22: 1, 316: 1 }, qS); + var E9n, + T9n, + M9n, + S9n, + P9n, + I9n, + C9n, + O9n, + A9n, + $9n, + L9n, + N9n, + x9n, + D9n, + R9n, + K9n, + _9n, + F9n, + B9n, + H9n, + q9n, + G9n, + z9n, + U9n, + X9n, + W9n, + V9n, + Q9n, + Y9n, + J9n, + Z9n, + n7n, + t7n, + e7n, + i7n, + r7n, + c7n = X1( + Y$n, + "SpanningTreeCostFunction", + 316, + u_n, + function () { + return Aon(), x4(Gy(c7n, 1), XEn, 316, 0, [p9n, v9n, k9n, m9n, y9n]); + }, + function (n) { + return Aon(), rZ((gZ(), E9n), n); + }, + ); + Wfn(1002, 1, fSn, kf), + (Fjn.Qe = function (n) { + mmn(n); + }), + EF(Y$n, "SporeCompactionOptions", 1002), + Wfn(1003, 1, {}, tu), + (Fjn.$e = function () { + return new lm(); + }), + (Fjn._e = function (n) {}), + EF(Y$n, "SporeCompactionOptions/SporeCompactionFactory", 1003), + Wfn(855, 1, fSn, jf), + (Fjn.Qe = function (n) { + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), Z$n), ""), "Underlying Layout Algorithm"), + "A layout algorithm that is applied to the graph before it is compacted. If this is null, nothing is applied before compaction.", + ), + (lsn(), N7n), + ), + fFn, + ), + J9((Qtn(), T7n)), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), rLn), "structure"), "Structure Extraction Strategy"), + "This option defines what kind of triangulation or other partitioning of the plane is applied to the vertices.", + ), + Q9n, + ), + O7n, + ), + s7n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), nLn), sLn), "Tree Construction Strategy"), + "Whether a minimum spanning tree or a maximum spanning tree should be constructed.", + ), + W9n, + ), + O7n, + ), + f7n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), tLn), sLn), "Cost Function for Spanning Tree"), + "The cost function is used in the creation of the spanning tree.", + ), + U9n, + ), + O7n, + ), + c7n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), eLn), sLn), "Root node for spanning tree construction"), + "The identifier of the node that is preferred as the root of the spanning tree. If this is null, the first node is chosen.", + ), + null, + ), + N7n, + ), + fFn, + ), + J9(T7n), + ), + ), + ), + xU(n, eLn, iLn, H9n), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), iLn), sLn), "Root selection for spanning tree"), + "This sets the method used to select a root node for the construction of a spanning tree", + ), + G9n, + ), + O7n, + ), + j9n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk(bk(fk(lk(new Fu(), cLn), KOn), "Compaction Strategy"), "This option defines how the compaction is applied."), + R9n, + ), + O7n, + ), + f9n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), aLn), KOn), "Orthogonal Compaction"), + "Restricts the translation of nodes to orthogonal directions in the compaction phase.", + ), + (TA(), !1), + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk(gk(hk(sk(bk(fk(lk(new Fu(), uLn), hLn), "Upper limit for iterations of overlap removal"), null), d9(64)), $7n), U_n), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk(hk(sk(bk(fk(lk(new Fu(), oLn), hLn), "Whether to run a supplementary scanline overlap check."), null), !0), I7n), + D_n, + ), + J9(T7n), + ), + ), + ), + xgn((new Ef(), n)), + mmn((new kf(), n)); + }), + EF(Y$n, "SporeMetaDataProvider", 855), + Wfn(hTn, 1, fSn, Ef), + (Fjn.Qe = function (n) { + xgn(n); + }), + EF(Y$n, "SporeOverlapRemovalOptions", hTn), + Wfn(1001, 1, {}, eu), + (Fjn.$e = function () { + return new lj(); + }), + (Fjn._e = function (n) {}), + EF(Y$n, "SporeOverlapRemovalOptions/SporeOverlapFactory", 1001), + Wfn(530, 22, { 3: 1, 35: 1, 22: 1, 530: 1, 246: 1, 234: 1 }, LB), + (Fjn.Kf = function () { + return Y5(this); + }), + (Fjn.Xf = function () { + return Y5(this); + }); + var a7n, + u7n, + o7n, + s7n = X1( + Y$n, + "StructureExtractionStrategy", + 530, + u_n, + function () { + return iT(), x4(Gy(s7n, 1), XEn, 530, 0, [r7n]); + }, + function (n) { + return iT(), rZ((mX(), a7n), n); + }, + ); + Wfn(429, 22, { 3: 1, 35: 1, 22: 1, 429: 1, 246: 1, 234: 1 }, GS), + (Fjn.Kf = function () { + return X7(this); + }), + (Fjn.Xf = function () { + return X7(this); + }); + var h7n, + f7n = X1( + Y$n, + "TreeConstructionStrategy", + 429, + u_n, + function () { + return B4(), x4(Gy(f7n, 1), XEn, 429, 0, [o7n, u7n]); + }, + function (n) { + return B4(), rZ((HW(), h7n), n); + }, + ); + Wfn(1443, 1, KAn, iu), + (Fjn.Yf = function (n) { + return Yx(n, 300), new fX(); + }), + (Fjn.pf = function (n, t) { + !(function (n, t) { + var e; + run(t, "Delaunay triangulation", 1), + (e = new ip()), + WZ(n.i, new qd(e)), + ny(hL(Aun(n, (y3(), hqn)))), + n.e ? C2(n.e, sjn(e)) : (n.e = sjn(e)), + Ron(t); + })(Yx(n, 300), t); + }), + EF(lLn, "DelaunayTriangulationPhase", 1443), + Wfn(1444, 1, PEn, qd), + (Fjn.td = function (n) { + eD(this.a, Yx(n, 65).a); + }), + EF(lLn, "DelaunayTriangulationPhase/lambda$0$Type", 1444), + Wfn(783, 1, KAn, om), + (Fjn.Yf = function (n) { + return Yx(n, 300), new fX(); + }), + (Fjn.pf = function (n, t) { + this.ng(Yx(n, 300), t); + }), + (Fjn.ng = function (n, t) { + var e; + run(t, "Minimum spanning tree construction", 1), + (e = n.d ? n.d.a : Yx(TR(n.i, 0), 65).a), + z4(this, (ny(hL(Aun(n, (y3(), hqn)))), Dmn(n.e, e, n.b)), n), + Ron(t); + }), + EF(bLn, "MinSTPhase", 783), + Wfn(1446, 783, KAn, Lv), + (Fjn.ng = function (n, t) { + var e, i; + run(t, "Maximum spanning tree construction", 1), + (e = new Gd(n)), + (i = n.d ? n.d.c : Yx(TR(n.i, 0), 65).c), + z4(this, (ny(hL(Aun(n, (y3(), hqn)))), Dmn(n.e, i, e)), n), + Ron(t); + }), + EF(bLn, "MaxSTPhase", 1446), + Wfn(1447, 1, {}, Gd), + (Fjn.Je = function (n) { + return (function (n, t) { + return -n.b.Je(t); + })(this.a, n); + }), + EF(bLn, "MaxSTPhase/lambda$0$Type", 1447), + Wfn(1445, 1, PEn, zd), + (Fjn.td = function (n) { + !(function (n, t) { + xB(n.a, t.a, t); + })(this.a, Yx(n, 65)); + }), + EF(bLn, "MinSTPhase/lambda$0$Type", 1445), + Wfn(785, 1, KAn, ru), + (Fjn.Yf = function (n) { + return Yx(n, 300), new fX(); + }), + (Fjn.pf = function (n, t) { + dun(this, Yx(n, 300), t); + }), + (Fjn.a = !1), + EF(wLn, "GrowTreePhase", 785), + Wfn(786, 1, PEn, xx), + (Fjn.td = function (n) { + !(function (n, t, e, i) { + Yx(e.b, 65), Yx(e.b, 65), Yx(i.b, 65), Yx(i.b, 65), Yx(i.b, 65), WZ(i.a, new xx(n, t, i)); + })(this.a, this.b, this.c, Yx(n, 221)); + }), + EF(wLn, "GrowTreePhase/lambda$0$Type", 786), + Wfn(1448, 1, KAn, cu), + (Fjn.Yf = function (n) { + return Yx(n, 300), new fX(); + }), + (Fjn.pf = function (n, t) { + jin(this, Yx(n, 300), t); + }), + EF(wLn, "ShrinkTreeCompactionPhase", 1448), + Wfn(784, 1, PEn, Dx), + (Fjn.td = function (n) { + !(function (n, t, e, i) { + var r; + Yx(e.b, 65), + Yx(e.b, 65), + Yx(i.b, 65), + Yx(i.b, 65), + DD((r = yN(dO(Yx(e.b, 65).c), Yx(i.b, 65).c)), bhn(Yx(e.b, 65), Yx(i.b, 65), r)), + Yx(i.b, 65), + Yx(i.b, 65), + Yx(i.b, 65).c.a, + r.a, + Yx(i.b, 65).c.b, + r.b, + Yx(i.b, 65), + WZ(i.a, new Dx(n, t, i)); + })(this.a, this.b, this.c, Yx(n, 221)); + }), + EF(wLn, "ShrinkTreeCompactionPhase/lambda$0$Type", 784); + var l7n, + b7n, + w7n = aR(xAn, "IGraphElementVisitor"); + Wfn(860, 1, { 527: 1 }, pU), + (Fjn.og = function (n) { + var t; + o4( + (t = (function (n, t) { + var e; + return ( + (e = new Zn()), + t && o4(e, Yx(BF(n.a, Yrt), 94)), + CO(t, 470) && o4(e, Yx(BF(n.a, Jrt), 94)), + CO(t, 354) + ? (o4(e, Yx(BF(n.a, act), 94)), e) + : (CO(t, 82) && o4(e, Yx(BF(n.a, Zrt), 94)), + CO(t, 239) + ? (o4(e, Yx(BF(n.a, uct), 94)), e) + : CO(t, 186) + ? (o4(e, Yx(BF(n.a, oct), 94)), e) + : (CO(t, 352) && o4(e, Yx(BF(n.a, nct), 94)), e)) + ); + })(this, n)), + Yx(BF(this.b, n), 94), + ), + (function (n, t, e) { + var i, r, c, a, u; + for (a = n.c, c = (e.q ? e.q : (XH(), XH(), MFn)).vc().Kc(); c.Ob(); ) + (r = Yx(c.Pb(), 42)), + !ej(hH(new SR(null, new Nz(a, 16)), new Cb(new WS(t, r)))).sd((HE(), dBn)) && + (CO((u = r.dd()), 4) && null != (i = ctn(u)) && (u = i), t.Ye(Yx(r.cd(), 146), u)); + })(this, n, t); + }), + EF(QSn, "LayoutConfigurator", 860); + var d7n, + g7n, + p7n, + v7n = aR(QSn, "LayoutConfigurator/IPropertyHolderOptionFilter"); + Wfn(932, 1, { 1933: 1 }, au), + (Fjn.pg = function (n, t) { + return H4(), !n.Xe(t); + }), + EF(QSn, "LayoutConfigurator/lambda$0$Type", 932), + Wfn(933, 1, { 1933: 1 }, uu), + (Fjn.pg = function (n, t) { + return aj(n, t); + }), + EF(QSn, "LayoutConfigurator/lambda$1$Type", 933), + Wfn(931, 1, { 831: 1 }, ou), + (Fjn.qg = function (n, t) { + return H4(), !n.Xe(t); + }), + EF(QSn, "LayoutConfigurator/lambda$2$Type", 931), + Wfn(934, 1, YEn, WS), + (Fjn.Mb = function (n) { + return (function (n, t, e) { + return H4(), e.pg(n, Yx(t.cd(), 146)); + })(this.a, this.b, Yx(n, 1933)); + }), + EF(QSn, "LayoutConfigurator/lambda$3$Type", 934), + Wfn(858, 1, {}, su), + EF(QSn, "RecursiveGraphLayoutEngine", 858), + Wfn(296, 60, eTn, _p, ly), + EF(QSn, "UnsupportedConfigurationException", 296), + Wfn(453, 60, eTn, by), + EF(QSn, "UnsupportedGraphException", 453), + Wfn(754, 1, {}), + EF(xAn, "AbstractRandomListAccessor", 754), + Wfn(500, 754, {}, Ubn), + (Fjn.rg = function () { + return null; + }), + (Fjn.d = !0), + (Fjn.e = !0), + (Fjn.f = 0), + EF(gLn, "AlgorithmAssembler", 500), + Wfn(1236, 1, YEn, hu), + (Fjn.Mb = function (n) { + return !!Yx(n, 123); + }), + EF(gLn, "AlgorithmAssembler/lambda$0$Type", 1236), + Wfn(1237, 1, {}, Ud), + (Fjn.Kb = function (n) { + return (function (n, t) { + return t.Yf(n); + })(this.a, Yx(n, 123)); + }), + EF(gLn, "AlgorithmAssembler/lambda$1$Type", 1237), + Wfn(1238, 1, YEn, fu), + (Fjn.Mb = function (n) { + return !!Yx(n, 80); + }), + EF(gLn, "AlgorithmAssembler/lambda$2$Type", 1238), + Wfn(1239, 1, PEn, Xd), + (Fjn.td = function (n) { + T3(this.a, Yx(n, 80)); + }), + EF(gLn, "AlgorithmAssembler/lambda$3$Type", 1239), + Wfn(1240, 1, PEn, VS), + (Fjn.td = function (n) { + !(function (n, t, e) { + eD(t, H7(n, e)); + })(this.a, this.b, Yx(n, 234)); + }), + EF(gLn, "AlgorithmAssembler/lambda$4$Type", 1240), + Wfn(1355, 1, FMn, lu), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return V5(n), V5(t), Km(Yx(n, 22), Yx(t, 22)); + })(Yx(n, 234), Yx(t, 234)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(gLn, "EnumBasedFactoryComparator", 1355), + Wfn(80, 754, { 80: 1 }, fX), + (Fjn.rg = function () { + return new Qp(); + }), + (Fjn.a = 0), + EF(gLn, "LayoutProcessorConfiguration", 80), + Wfn(1013, 1, { 527: 1 }, Of), + (Fjn.og = function (n) { + S3(g7n, new Wd(n)); + }), + EF(aSn, "DeprecatedLayoutOptionReplacer", 1013), + Wfn(1014, 1, PEn, bu), + (Fjn.td = function (n) { + !(function (n) { + IY(), Yx(n.We((Cjn(), Mtt)), 174).Fc((Chn(), vit)), n.Ye(Ttt, null); + })(Yx(n, 160)); + }), + EF(aSn, "DeprecatedLayoutOptionReplacer/lambda$0$Type", 1014), + Wfn(1015, 1, PEn, wu), + (Fjn.td = function (n) { + !(function (n) { + IY(), Yx(n.We((Cjn(), itt)), 174).Hc((Vgn(), hrt)) && (Yx(n.We(Mtt), 174).Fc((Chn(), yit)), Yx(n.We(itt), 174).Mc(hrt)); + })(Yx(n, 160)); + }), + EF(aSn, "DeprecatedLayoutOptionReplacer/lambda$1$Type", 1015), + Wfn(1016, 1, {}, Wd), + (Fjn.Od = function (n, t) { + !(function (n, t, e) { + IY(), n.Xe(t) && e.td(n); + })(this.a, Yx(n, 146), Yx(t, 38)); + }), + EF(aSn, "DeprecatedLayoutOptionReplacer/lambda$2$Type", 1016), + Wfn(149, 1, { 686: 1, 149: 1 }, tun), + (Fjn.Fb = function (n) { + return oV(this, n); + }), + (Fjn.sg = function () { + return this.b; + }), + (Fjn.tg = function () { + return this.c; + }), + (Fjn.ne = function () { + return this.e; + }), + (Fjn.Hb = function () { + return Xen(this.c); + }), + (Fjn.Ib = function () { + return "Layout Algorithm: " + this.c; + }); + var m7n, + y7n = EF(aSn, "LayoutAlgorithmData", 149); + Wfn(263, 1, {}, du), + EF(aSn, "LayoutAlgorithmData/Builder", 263), + Wfn(1017, 1, { 527: 1 }, gu), + (Fjn.og = function (n) { + CO(n, 239) && + !ny(hL(n.We((Cjn(), ctt)))) && + (function (n) { + var t, e; + if ( + !E3((t = lL(jln(n, (Cjn(), gnt)))), n) && + !zQ(n, Ltt) && + (0 != (!n.a && (n.a = new m_(uct, n, 10, 11)), n.a).i || ny(hL(jln(n, Fnt)))) + ) { + if (null != t && 0 != Wun(t).length) + throw (Jyn(n, (e = yI(yI(new SA("Layout algorithm '"), t), "' not found for "))), hp(new ly(e.a))); + if (!E3(CIn, n)) + throw ( + (Jyn(n, (e = yI(yI(new SA("Unable to load default layout algorithm "), CIn), " for unconfigured node "))), + hp(new ly(e.a))) + ); + } + })(Yx(n, 33)); + }), + EF(aSn, "LayoutAlgorithmResolver", 1017), + Wfn(229, 1, { 686: 1, 229: 1 }, dz), + (Fjn.Fb = function (n) { + return !!CO(n, 229) && _N(this.b, Yx(n, 229).b); + }), + (Fjn.sg = function () { + return this.a; + }), + (Fjn.tg = function () { + return this.b; + }), + (Fjn.ne = function () { + return this.d; + }), + (Fjn.Hb = function () { + return Xen(this.b); + }), + (Fjn.Ib = function () { + return "Layout Type: " + this.b; + }), + EF(aSn, "LayoutCategoryData", 229), + Wfn(344, 1, {}, pu), + EF(aSn, "LayoutCategoryData/Builder", 344), + Wfn(867, 1, {}, Jdn), + EF(aSn, "LayoutMetaDataService", 867), + Wfn(868, 1, {}, XF), + EF(aSn, "LayoutMetaDataService/Registry", 868), + Wfn(478, 1, { 478: 1 }, vu), + EF(aSn, "LayoutMetaDataService/Registry/Triple", 478), + Wfn(869, 1, pLn, mu), + (Fjn.ug = function () { + return new Pk(); + }), + EF(aSn, "LayoutMetaDataService/lambda$0$Type", 869), + Wfn(870, 1, vLn, yu), + (Fjn.vg = function (n) { + return dO(Yx(n, 8)); + }), + EF(aSn, "LayoutMetaDataService/lambda$1$Type", 870), + Wfn(879, 1, pLn, ku), + (Fjn.ug = function () { + return new ip(); + }), + EF(aSn, "LayoutMetaDataService/lambda$10$Type", 879), + Wfn(880, 1, vLn, ju), + (Fjn.vg = function (n) { + return new sx(Yx(n, 12)); + }), + EF(aSn, "LayoutMetaDataService/lambda$11$Type", 880), + Wfn(881, 1, pLn, Eu), + (Fjn.ug = function () { + return new ME(); + }), + EF(aSn, "LayoutMetaDataService/lambda$12$Type", 881), + Wfn(882, 1, vLn, Tu), + (Fjn.vg = function (n) { + return nD(Yx(n, 68)); + }), + EF(aSn, "LayoutMetaDataService/lambda$13$Type", 882), + Wfn(883, 1, pLn, Mu), + (Fjn.ug = function () { + return new Qp(); + }), + EF(aSn, "LayoutMetaDataService/lambda$14$Type", 883), + Wfn(884, 1, vLn, Su), + (Fjn.vg = function (n) { + return oq(Yx(n, 53)); + }), + EF(aSn, "LayoutMetaDataService/lambda$15$Type", 884), + Wfn(885, 1, pLn, Pu), + (Fjn.ug = function () { + return new oC(); + }), + EF(aSn, "LayoutMetaDataService/lambda$16$Type", 885), + Wfn(886, 1, vLn, Iu), + (Fjn.vg = function (n) { + return yW(Yx(n, 53)); + }), + EF(aSn, "LayoutMetaDataService/lambda$17$Type", 886), + Wfn(887, 1, pLn, Cu), + (Fjn.ug = function () { + return new rv(); + }), + EF(aSn, "LayoutMetaDataService/lambda$18$Type", 887), + Wfn(888, 1, vLn, Ou), + (Fjn.vg = function (n) { + return Zx(Yx(n, 208)); + }), + EF(aSn, "LayoutMetaDataService/lambda$19$Type", 888), + Wfn(871, 1, pLn, Au), + (Fjn.ug = function () { + return new Nv(); + }), + EF(aSn, "LayoutMetaDataService/lambda$2$Type", 871), + Wfn(872, 1, vLn, $u), + (Fjn.vg = function (n) { + return new kk(Yx(n, 74)); + }), + EF(aSn, "LayoutMetaDataService/lambda$3$Type", 872), + Wfn(873, 1, pLn, Lu), + (Fjn.ug = function () { + return new Mv(); + }), + EF(aSn, "LayoutMetaDataService/lambda$4$Type", 873), + Wfn(874, 1, vLn, Nu), + (Fjn.vg = function (n) { + return new yx(Yx(n, 142)); + }), + EF(aSn, "LayoutMetaDataService/lambda$5$Type", 874), + Wfn(875, 1, pLn, Du), + (Fjn.ug = function () { + return new Sv(); + }), + EF(aSn, "LayoutMetaDataService/lambda$6$Type", 875), + Wfn(876, 1, vLn, Ru), + (Fjn.vg = function (n) { + return new mx(Yx(n, 116)); + }), + EF(aSn, "LayoutMetaDataService/lambda$7$Type", 876), + Wfn(877, 1, pLn, Ku), + (Fjn.ug = function () { + return new Yu(); + }), + EF(aSn, "LayoutMetaDataService/lambda$8$Type", 877), + Wfn(878, 1, vLn, _u), + (Fjn.vg = function (n) { + return new FJ(Yx(n, 373)); + }), + EF(aSn, "LayoutMetaDataService/lambda$9$Type", 878); + var k7n, + j7n, + E7n, + T7n, + M7n, + S7n = aR(GSn, "IProperty"); + Wfn(23, 1, { 35: 1, 686: 1, 23: 1, 146: 1 }, isn), + (Fjn.wd = function (n) { + return (function (n, t) { + return FV(n.f, t.tg()); + })(this, Yx(n, 146)); + }), + (Fjn.Fb = function (n) { + return CO(n, 23) ? _N(this.f, Yx(n, 23).f) : CO(n, 146) && _N(this.f, Yx(n, 146).tg()); + }), + (Fjn.wg = function () { + var n; + if (CO(this.b, 4)) { + if (null == (n = ctn(this.b))) + throw hp(new Ym(ELn + this.f + "'. Make sure it's type is registered with the " + (sL(Ict), Ict.k) + yLn)); + return n; + } + return this.b; + }), + (Fjn.sg = function () { + return this.d; + }), + (Fjn.tg = function () { + return this.f; + }), + (Fjn.ne = function () { + return this.i; + }), + (Fjn.Hb = function () { + return Xen(this.f); + }), + (Fjn.Ib = function () { + return "Layout Option: " + this.f; + }), + EF(aSn, "LayoutOptionData", 23), + Wfn(24, 1, {}, Fu), + EF(aSn, "LayoutOptionData/Builder", 24), + Wfn(175, 22, { 3: 1, 35: 1, 22: 1, 175: 1 }, US); + var P7n, + I7n, + C7n, + O7n, + A7n, + $7n, + L7n, + N7n, + x7n, + D7n = X1( + aSn, + "LayoutOptionData/Target", + 175, + u_n, + function () { + return Qtn(), x4(Gy(D7n, 1), XEn, 175, 0, [T7n, E7n, k7n, M7n, j7n]); + }, + function (n) { + return Qtn(), rZ((pZ(), P7n), n); + }, + ); + Wfn(277, 22, { 3: 1, 35: 1, 22: 1, 277: 1 }, XS); + var R7n, + K7n, + _7n, + F7n = X1( + aSn, + "LayoutOptionData/Type", + 277, + u_n, + function () { + return lsn(), x4(Gy(F7n, 1), XEn, 277, 0, [x7n, I7n, $7n, N7n, C7n, O7n, A7n, L7n]); + }, + function (n) { + return lsn(), rZ((v3(), R7n), n); + }, + ); + Wfn(110, 1, { 110: 1 }, hC, mH, Tq), + (Fjn.Fb = function (n) { + var t; + return ( + !(null == n || !CO(n, 110)) && ((t = Yx(n, 110)), qB(this.c, t.c) && qB(this.d, t.d) && qB(this.b, t.b) && qB(this.a, t.a)) + ); + }), + (Fjn.Hb = function () { + return G6(x4(Gy(UKn, 1), iEn, 1, 5, [this.c, this.d, this.b, this.a])); + }), + (Fjn.Ib = function () { + return "Rect[x=" + this.c + ",y=" + this.d + ",w=" + this.b + ",h=" + this.a + "]"; + }), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.c = 0), + (Fjn.d = 0), + EF(SIn, "ElkRectangle", 110), + Wfn(8, 1, { 3: 1, 4: 1, 8: 1, 414: 1 }, Pk, gz, QS, fC), + (Fjn.Fb = function (n) { + return W0(this, n); + }), + (Fjn.Hb = function () { + return ( + ZI(this.a) + + ((n = ZI(this.b)), + M0(), + (t = z_n)[n >>> 28] | + (t[(n >> 24) & 15] << 4) | + (t[(n >> 20) & 15] << 8) | + (t[(n >> 16) & 15] << 12) | + (t[(n >> 12) & 15] << 16) | + (t[(n >> 8) & 15] << 20) | + (t[(n >> 4) & 15] << 24) | + (t[15 & n] << 28)) + ); + var n, t; + }), + (Fjn.Jf = function (n) { + var t, e, i; + for (e = 0; e < n.length && f8((Lz(e, n.length), n.charCodeAt(e)), EIn); ) ++e; + for (t = n.length; t > 0 && f8((Lz(t - 1, n.length), n.charCodeAt(t - 1)), TIn); ) --t; + if (e >= t) throw hp(new Qm("The given string does not contain any numbers.")); + if (2 != (i = Ogn(n.substr(e, t - e), ",|;|\r|\n")).length) + throw hp(new Qm("Exactly two numbers are expected, " + i.length + " were found.")); + try { + (this.a = gon(Wun(i[0]))), (this.b = gon(Wun(i[1]))); + } catch (n) { + throw CO((n = j4(n)), 127) ? hp(new Qm(MIn + n)) : hp(n); + } + }), + (Fjn.Ib = function () { + return "(" + this.a + "," + this.b + ")"; + }), + (Fjn.a = 0), + (Fjn.b = 0); + var B7n = EF(SIn, "KVector", 8); + Wfn(74, 68, { 3: 1, 4: 1, 20: 1, 28: 1, 52: 1, 14: 1, 68: 1, 15: 1, 74: 1, 414: 1 }, Nv, kk, _$), + (Fjn.Pc = function () { + return (function (n) { + var t, e, i; + for (t = 0, i = VQ(B7n, TEn, 8, n.b, 0, 1), e = Ztn(n, 0); e.b != e.d.c; ) i[t++] = Yx(IX(e), 8); + return i; + })(this); + }), + (Fjn.Jf = function (n) { + var t, e, i, r, c; + (e = Ogn(n, ",|;|\\(|\\)|\\[|\\]|\\{|\\}| |\t|\n")), BH(this); + try { + for (t = 0, r = 0, i = 0, c = 0; t < e.length; ) + null != e[t] && + Wun(e[t]).length > 0 && + (r % 2 == 0 ? (i = gon(e[t])) : (c = gon(e[t])), r > 0 && r % 2 != 0 && KD(this, new QS(i, c)), ++r), + ++t; + } catch (n) { + throw CO((n = j4(n)), 127) ? hp(new Qm("The given string does not match the expected format for vectors." + n)) : hp(n); + } + }), + (Fjn.Ib = function () { + var n, t, e; + for (n = new SA("("), t = Ztn(this, 0); t.b != t.d.c; ) yI(n, (e = Yx(IX(t), 8)).a + "," + e.b), t.b != t.d.c && (n.a += "; "); + return ((n.a += ")"), n).a; + }); + var H7n, + q7n, + G7n, + z7n, + U7n, + X7n, + W7n = EF(SIn, "KVectorChain", 74); + Wfn(248, 22, { 3: 1, 35: 1, 22: 1, 248: 1 }, YS); + var V7n, + Q7n, + Y7n, + J7n, + Z7n, + nnt, + tnt, + ent, + int, + rnt, + cnt, + ant, + unt, + ont, + snt, + hnt, + fnt, + lnt, + bnt, + wnt = X1( + MLn, + "Alignment", + 248, + u_n, + function () { + return qen(), x4(Gy(wnt, 1), XEn, 248, 0, [H7n, z7n, U7n, X7n, q7n, G7n]); + }, + function (n) { + return qen(), rZ((m1(), V7n), n); + }, + ); + Wfn(979, 1, fSn, Af), + (Fjn.Qe = function (n) { + Epn(n); + }), + EF(MLn, "BoxLayouterOptions", 979), + Wfn(980, 1, {}, xu), + (Fjn.$e = function () { + return new Gu(); + }), + (Fjn._e = function (n) {}), + EF(MLn, "BoxLayouterOptions/BoxFactory", 980), + Wfn(291, 22, { 3: 1, 35: 1, 22: 1, 291: 1 }, JS); + var dnt, + gnt, + pnt, + vnt, + mnt, + ynt, + knt, + jnt, + Ent, + Tnt, + Mnt, + Snt, + Pnt, + Int, + Cnt, + Ont, + Ant, + $nt, + Lnt, + Nnt, + xnt, + Dnt, + Rnt, + Knt, + _nt, + Fnt, + Bnt, + Hnt, + qnt, + Gnt, + znt, + Unt, + Xnt, + Wnt, + Vnt, + Qnt, + Ynt, + Jnt, + Znt, + ntt, + ttt, + ett, + itt, + rtt, + ctt, + att, + utt, + ott, + stt, + htt, + ftt, + ltt, + btt, + wtt, + dtt, + gtt, + ptt, + vtt, + mtt, + ytt, + ktt, + jtt, + Ett, + Ttt, + Mtt, + Stt, + Ptt, + Itt, + Ctt, + Ott, + Att, + $tt, + Ltt, + Ntt, + xtt, + Dtt, + Rtt, + Ktt, + _tt, + Ftt, + Btt, + Htt, + qtt, + Gtt, + ztt, + Utt, + Xtt, + Wtt, + Vtt, + Qtt, + Ytt, + Jtt, + Ztt, + net, + tet, + eet, + iet = X1( + MLn, + "ContentAlignment", + 291, + u_n, + function () { + return dan(), x4(Gy(iet, 1), XEn, 291, 0, [bnt, lnt, fnt, snt, ont, hnt]); + }, + function (n) { + return dan(), rZ((v1(), dnt), n); + }, + ); + Wfn(684, 1, fSn, $f), + (Fjn.Qe = function (n) { + j7( + n, + new isn( + dk( + wk(gk(sk(bk(fk(lk(new Fu(), CLn), ""), "Layout Algorithm"), "Select a specific layout algorithm."), (lsn(), N7n)), fFn), + J9((Qtn(), T7n)), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk(bk(fk(lk(new Fu(), OLn), ""), "Resolved Layout Algorithm"), "Meta data associated with the selected algorithm."), + L7n, + ), + y7n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), sAn), ""), "Alignment"), + "Alignment of the selected node relative to other nodes; the exact meaning depends on the used algorithm.", + ), + vnt, + ), + O7n, + ), + wnt, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), hPn), ""), "Aspect Ratio"), + "The desired aspect ratio of the drawing, that is the quotient of width by height.", + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), ALn), ""), "Bend Points"), + "A fixed list of bend points for the edge. This is used by the 'Fixed Layout' algorithm to specify a pre-defined routing for an edge. The vector chain must include the source point, any bend points, and the target point, so it must have at least two points.", + ), + L7n, + ), + W7n, + ), + J9(k7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), jAn), ""), "Content Alignment"), + "Specifies how the content of a node are aligned. Each node can individually control the alignment of its contents. I.e. if a node should be aligned top left in its parent node, the parent node should specify that option.", + ), + Mnt, + ), + A7n, + ), + iet, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk(bk(fk(lk(new Fu(), oAn), ""), "Debug Mode"), "Whether additional debug information shall be generated."), + (TA(), !1), + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), bAn), ""), _Sn), + "Overall direction of edges: horizontal (right / left) or vertical (down / up).", + ), + Int, + ), + O7n, + ), + oet, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), xOn), ""), "Edge Routing"), + "What kind of edge routing style should be applied for the content of a parent node. Algorithms may also set this option to single edges in order to mark them as splines. The bend point list of edges with this option set to SPLINES must be interpreted as control points for a piecewise cubic spline.", + ), + Lnt, + ), + O7n, + ), + Eet, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), U$n), ""), "Expand Nodes"), + "If active, nodes are expanded to fill the area of their parent.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), OOn), ""), "Hierarchy Handling"), + "Determines whether separate layout runs are triggered for different compound nodes in a hierarchical graph. Setting a node's hierarchy handling to `INCLUDE_CHILDREN` will lay out that node and all of its descendants in a single layout run, until a descendant is encountered which has its hierarchy handling set to `SEPARATE_CHILDREN`. In general, `SEPARATE_CHILDREN` will ensure that a new layout run is triggered for a node with that setting. Including multiple levels of hierarchy in a single layout run may allow cross-hierarchical edges to be laid out properly. If the root node is set to `INHERIT` (or not set at all), the default behavior is `SEPARATE_CHILDREN`.", + ), + Knt, + ), + O7n, + ), + Bet, + ), + tK(T7n, x4(Gy(D7n, 1), XEn, 175, 0, [E7n])), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), fPn), ""), "Padding"), + "The padding to be left to a parent element's border when placing child elements. This can also serve as an output option of a layout algorithm if node size calculation is setup appropriately.", + ), + ott, + ), + L7n, + ), + Zzn, + ), + tK(T7n, x4(Gy(D7n, 1), XEn, 175, 0, [E7n])), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), RPn), ""), "Interactive"), + "Whether the algorithm should be run in interactive mode for the content of a parent node. What this means exactly depends on how the specific algorithm interprets this option. Usually in the interactive mode algorithms try to modify the current layout as little as possible.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), NAn), ""), "interactive Layout"), + "Whether the graph should be changeable interactively and by setting constraints", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), FPn), ""), "Omit Node Micro Layout"), + "Node micro layout comprises the computation of node dimensions (if requested), the placement of ports and their labels, and the placement of node labels. The functionality is implemented independent of any specific layout algorithm and shouldn't have any negative impact on the layout algorithm's performance itself. Yet, if any unforeseen behavior occurs, this option allows to deactivate the micro layout.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), KPn), ""), "Port Constraints"), + "Defines constraints of the position of the ports of a node.", + ), + jtt, + ), + O7n, + ), + kit, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), AAn), ""), "Position"), + "The position of a node, port, or label. This is used by the 'Fixed Layout' algorithm to specify a pre-defined position.", + ), + L7n, + ), + B7n, + ), + tK(E7n, x4(Gy(D7n, 1), XEn, 175, 0, [M7n, j7n])), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), $Pn), ""), "Priority"), + "Defines the priority of an object; its meaning depends on the specific layout algorithm and the context where it is used.", + ), + $7n, + ), + U_n, + ), + tK(E7n, x4(Gy(D7n, 1), XEn, 175, 0, [k7n])), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), xPn), ""), "Randomization Seed"), + "Seed used for pseudo-random number generators to control the layout algorithm. If the value is 0, the seed shall be determined pseudo-randomly (e.g. from the system time).", + ), + $7n, + ), + U_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), DPn), ""), "Separate Connected Components"), + "Whether each connected component should be processed separately.", + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), EAn), ""), "Junction Points"), + "This option is not used as option, but as output of the layout algorithms. It is attached to edges and determines the points where junction symbols should be drawn in order to represent hyperedges with orthogonal routing. Whether such points are computed depends on the chosen layout algorithm and edge routing style. The points are put into the vector chain with no specific order.", + ), + znt, + ), + L7n, + ), + W7n, + ), + J9(k7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), SAn), ""), "Comment Box"), + "Whether the node should be regarded as a comment box instead of a regular node. In that case its placement should be similar to how labels are handled. Any edges incident to a comment box specify to which graph elements the comment is related.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk(hk(sk(bk(fk(lk(new Fu(), PAn), ""), "Hypernode"), "Whether the node should be handled as a hypernode."), !1), I7n), + D_n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), $Ln), ""), "Label Manager"), + "Label managers can shorten labels upon a layout algorithm's request.", + ), + L7n, + ), + tst, + ), + tK(T7n, x4(Gy(D7n, 1), XEn, 175, 0, [j7n])), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), $An), ""), "Margins"), + "Margins define additional space around the actual bounds of a graph element. For instance, ports or labels being placed on the outside of a node's border might introduce such a margin. The margin is used to guarantee non-overlap of other graph elements with those ports or labels.", + ), + Xnt, + ), + L7n, + ), + Rzn, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), aAn), ""), "No Layout"), + "No layout is done for the associated element. This is used to mark parts of a diagram to avoid their inclusion in the layout graph, or to mark parts of the layout graph to prevent layout engines from processing them. If you wish to exclude the contents of a compound node from automatic layout, while the node itself is still considered on its own layer, use the 'Fixed Layout' algorithm for that node.", + ), + !1, + ), + I7n, + ), + D_n, + ), + tK(E7n, x4(Gy(D7n, 1), XEn, 175, 0, [k7n, M7n, j7n])), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), LLn), ""), "Scale Factor"), + "The scaling factor to be applied to the corresponding node in recursive layout. It causes the corresponding node's size to be adjusted, and its ports and labels to be sized and placed accordingly after the layout of that node has been determined (and before the node itself and its siblings are arranged). The scaling is not reverted afterwards, so the resulting layout graph contains the adjusted size and position data. This option is currently not supported if 'Layout Hierarchy' is set.", + ), + 1, + ), + C7n, + ), + H_n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), NLn), ""), "Animate"), + "Whether the shift from the old layout to the new computed layout shall be animated.", + ), + !0, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), xLn), ""), "Animation Time Factor"), + "Factor for computation of animation time. The higher the value, the longer the animation time. If the value is 0, the resulting time is always equal to the minimum defined by 'Minimal Animation Time'.", + ), + d9(100), + ), + $7n, + ), + U_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), DLn), ""), "Layout Ancestors"), + "Whether the hierarchy levels on the path from the selected element to the root of the diagram shall be included in the layout process.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk(bk(fk(lk(new Fu(), RLn), ""), "Maximal Animation Time"), "The maximal time for animations, in milliseconds."), + d9(4e3), + ), + $7n, + ), + U_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk(bk(fk(lk(new Fu(), KLn), ""), "Minimal Animation Time"), "The minimal time for animations, in milliseconds."), + d9(400), + ), + $7n, + ), + U_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), _Ln), ""), "Progress Bar"), + "Whether a progress bar shall be displayed during layout computations.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), FLn), ""), "Validate Graph"), + "Whether the graph shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), BLn), ""), "Validate Options"), + "Whether layout options shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user.", + ), + !0, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), HLn), ""), "Zoom to Fit"), + "Whether the zoom level shall be set to view the whole diagram after layout.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), ILn), "box"), "Box Layout Mode"), + "Configures the packing mode used by the {@link BoxLayoutProvider}. If SIMPLE is not required (neither priorities are used nor the interactive mode), GROUP_DEC can improve the packing and decrease the area. GROUP_MIXED and GROUP_INC may, in very specific scenarios, work better.", + ), + jnt, + ), + O7n, + ), + yrt, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), WOn), DOn), "Comment Comment Spacing"), + "Spacing to be preserved between a comment box and other comment boxes connected to the same node. The space left between comment boxes of different nodes is controlled by the node-node spacing.", + ), + 10, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), VOn), DOn), "Comment Node Spacing"), + "Spacing to be preserved between a node and its connected comment boxes. The space left between a node and the comments of another node is controlled by the node-node spacing.", + ), + 10, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), oPn), DOn), "Components Spacing"), + "Spacing to be preserved between pairs of connected components. This option is only relevant if 'separateConnectedComponents' is activated.", + ), + 20, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), QOn), DOn), "Edge Spacing"), + "Spacing to be preserved between any two edges. Note that while this can somewhat easily be satisfied for the segments of orthogonally drawn edges, it is harder for general polylines or splines.", + ), + 10, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), NPn), DOn), "Edge Label Spacing"), + "The minimal distance to be preserved between a label and the edge it is associated with. Note that the placement of a label is influenced by the 'edgelabels.placement' option.", + ), + 2, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk(sk(bk(fk(lk(new Fu(), YOn), DOn), "Edge Node Spacing"), "Spacing to be preserved between nodes and edges."), 10), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), JOn), DOn), "Label Spacing"), + "Determines the amount of space to be left between two labels of the same graph element.", + ), + 0, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), tAn), DOn), "Label Node Spacing"), + "Spacing to be preserved between labels and the border of node they are associated with. Note that the placement of a label is influenced by the 'nodelabels.placement' option.", + ), + 5, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), ZOn), DOn), "Horizontal spacing between Label and Port"), + "Horizontal spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option.", + ), + 1, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), nAn), DOn), "Vertical spacing between Label and Port"), + "Vertical spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option.", + ), + 1, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), LPn), DOn), "Node Spacing"), + "The minimal distance to be preserved between each two nodes.", + ), + 20, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), eAn), DOn), "Node Self Loop Spacing"), + "Spacing to be preserved between a node and its self loops.", + ), + 10, + ), + C7n, + ), + H_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk(sk(bk(fk(lk(new Fu(), iAn), DOn), "Port Spacing"), "Spacing between pairs of ports of the same node."), 10), + C7n, + ), + H_n, + ), + tK(T7n, x4(Gy(D7n, 1), XEn, 175, 0, [E7n])), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), rAn), DOn), "Individual Spacing"), + "Allows to specify individual spacing values for graph elements that shall be different from the value specified for the element's parent.", + ), + L7n, + ), + Mrt, + ), + tK(E7n, x4(Gy(D7n, 1), XEn, 175, 0, [k7n, M7n, j7n])), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), LAn), DOn), "Additional Port Space"), + "Additional space around the sets of ports on each node side. For each side of a node, this option can reserve additional space before and after the ports on each side. For example, a top spacing of 20 makes sure that the first port on the western and eastern side is 20 units away from the northern border.", + ), + Qtt, + ), + L7n, + ), + Rzn, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), OAn), ULn), "Layout Partition"), + "Partition to which the node belongs. This requires Layout Partitioning to be active. Nodes with lower partition IDs will appear to the left of nodes with higher partition IDs (assuming a left-to-right layout direction).", + ), + $7n, + ), + U_n, + ), + tK(T7n, x4(Gy(D7n, 1), XEn, 175, 0, [E7n])), + ), + ), + ), + xU(n, OAn, CAn, ltt), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), CAn), ULn), "Layout Partitioning"), + "Whether to activate partitioned layout. This will allow to group nodes through the Layout Partition option. a pair of nodes with different partition indices is then placed such that the node with lower index is placed to the left of the other node (with left-to-right layout direction). Depending on the layout algorithm, this may only be guaranteed to work if all nodes have a layout partition configured, or at least if edges that cross partitions are not part of a partition-crossing cycle.", + ), + htt, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), wAn), XLn), "Node Label Padding"), + "Define padding for node labels that are placed inside of a node.", + ), + Vnt, + ), + L7n, + ), + Zzn, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), qPn), XLn), "Node Label Placement"), + "Hints for where node labels are to be placed; if empty, the node label's position is not modified.", + ), + Ynt, + ), + A7n, + ), + cit, + ), + tK(E7n, x4(Gy(D7n, 1), XEn, 175, 0, [j7n])), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), pAn), WLn), "Port Alignment"), + "Defines the default port distribution for a node. May be overridden for each side individually.", + ), + wtt, + ), + O7n, + ), + bit, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), vAn), WLn), "Port Alignment (North)"), + "Defines how ports on the northern side are placed, overriding the node's general port alignment.", + ), + O7n, + ), + bit, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), mAn), WLn), "Port Alignment (South)"), + "Defines how ports on the southern side are placed, overriding the node's general port alignment.", + ), + O7n, + ), + bit, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), yAn), WLn), "Port Alignment (West)"), + "Defines how ports on the western side are placed, overriding the node's general port alignment.", + ), + O7n, + ), + bit, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), kAn), WLn), "Port Alignment (East)"), + "Defines how ports on the eastern side are placed, overriding the node's general port alignment.", + ), + O7n, + ), + bit, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), HPn), VLn), "Node Size Constraints"), + "What should be taken into account when calculating a node's size. Empty size constraints specify that a node's size is already fixed and should not be changed.", + ), + Znt, + ), + A7n, + ), + lrt, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), BPn), VLn), "Node Size Options"), + "Options modifying the behavior of the size constraints set on a node. Each member of the set specifies something that should be taken into account when calculating node sizes. The empty set corresponds to no further modifications.", + ), + rtt, + ), + A7n, + ), + vrt, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk(bk(fk(lk(new Fu(), eIn), VLn), "Node Size Minimum"), "The minimal size to which a node can be reduced."), + ett, + ), + L7n, + ), + B7n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), lAn), VLn), "Fixed Graph Size"), + "By default, the fixed layout provider will enlarge a graph until it is large enough to contain its children. If this option is set, it won't do so.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(T7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk(sk(bk(fk(lk(new Fu(), TAn), UOn), "Edge Label Placement"), "Gives a hint on where to put edge labels."), Ant), + O7n, + ), + det, + ), + J9(j7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), _Pn), UOn), "Inline Edge Labels"), + "If true, an edge label is placed directly on its edge. May only apply to center edge labels. This kind of label placement is only advisable if the label's rendering is such that it is not crossed by its edge and thus stays legible.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(j7n), + ), + ), + ), + j7( + n, + new isn(dk(wk(gk(sk(bk(fk(lk(new Fu(), qLn), "font"), "Font Name"), "Font name used for a label."), N7n), fFn), J9(j7n))), + ), + j7( + n, + new isn(dk(wk(gk(sk(bk(fk(lk(new Fu(), GLn), "font"), "Font Size"), "Font size used for a label."), $7n), U_n), J9(j7n))), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), IAn), QLn), "Port Anchor Offset"), + "The offset to the port position where connections shall be attached.", + ), + L7n, + ), + B7n, + ), + J9(M7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), MAn), QLn), "Port Index"), + "The index of a port in the fixed order around a node. The order is assumed as clockwise, starting with the leftmost port on the top side. This option must be set if 'Port Constraints' is set to FIXED_ORDER and no specific positions are given for the ports. Additionally, the option 'Port Side' must be defined in this case.", + ), + $7n, + ), + U_n, + ), + J9(M7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), uAn), QLn), "Port Side"), + "The side of a node on which a port is situated. This option must be set if 'Port Constraints' is set to FIXED_SIDE or FIXED_ORDER and no specific positions are given for the ports.", + ), + Ctt, + ), + O7n, + ), + trt, + ), + J9(M7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + sk( + bk(fk(lk(new Fu(), cAn), QLn), "Port Border Offset"), + "The offset of ports on the node border. With a positive offset the port is moved outside of the node, while with a negative offset the port is moved towards the inside. An offset of 0 means that the port is placed directly on the node border, i.e. if the port side is north, the port's south border touches the nodes's north border; if the port side is east, the port's west border touches the nodes's east border; if the port side is south, the port's north border touches the node's south border; if the port side is west, the port's east border touches the node's west border.", + ), + C7n, + ), + H_n, + ), + J9(M7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), GPn), YLn), "Port Label Placement"), + "Decides on a placement method for port labels; if empty, the node label's position is not modified.", + ), + Stt, + ), + A7n, + ), + Git, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), dAn), YLn), "Port Labels Next to Port"), + "Use 'portLabels.placement': NEXT_TO_PORT_OF_POSSIBLE.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), gAn), YLn), "Treat Port Labels as Group"), + "If this option is true (default), the labels of a port will be treated as a group when it comes to centering them next to their port. If this option is false, only the first label will be centered next to the port, with the others being placed below. This only applies to labels of eastern and western ports and will have no effect if labels are not placed next to their port.", + ), + !0, + ), + I7n, + ), + D_n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), hAn), JLn), "Activate Inside Self Loops"), + "Whether this node allows to route self loops inside of it instead of around it. If set to true, this will make the node a compound node if it isn't already, and will require the layout algorithm to support compound nodes with hierarchical ports.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(E7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), fAn), JLn), "Inside Self Loop"), + "Whether a self loop should be routed inside a node instead of around that node.", + ), + !1, + ), + I7n, + ), + D_n, + ), + J9(k7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), sPn), "edge"), "Edge Thickness"), + "The thickness of an edge. This is a hint on the line width used to draw an edge, possibly requiring more space to be reserved for it.", + ), + 1, + ), + C7n, + ), + H_n, + ), + J9(k7n), + ), + ), + ), + j7( + n, + new isn( + dk( + wk( + gk( + hk( + sk( + bk(fk(lk(new Fu(), zLn), "edge"), "Edge Type"), + "The type of an edge. This is usually used for UML class diagrams, where associations must be handled differently from generalizations.", + ), + xnt, + ), + O7n, + ), + xet, + ), + J9(k7n), + ), + ), + ), + oT( + n, + new dz( + ak( + ok(uk(new pu(), CIn), "Layered"), + 'The layer-based method was introduced by Sugiyama, Tagawa and Toda in 1981. It emphasizes the direction of edges by pointing as many edges as possible into the same direction. The nodes are arranged in layers, which are sometimes called "hierarchies", and then reordered such that the number of edge crossings is minimized. Afterwards, concrete coordinates are computed for the nodes and edge bend points.', + ), + ), + ), + oT( + n, + new dz( + ak( + ok(uk(new pu(), "org.eclipse.elk.orthogonal"), "Orthogonal"), + 'Orthogonal methods that follow the "topology-shape-metrics" approach by Batini, Nardelli and Tamassia \'86. The first phase determines the topology of the drawing by applying a planarization technique, which results in a planar representation of the graph. The orthogonal shape is computed in the second phase, which aims at minimizing the number of edge bends, and is called orthogonalization. The third phase leads to concrete coordinates for nodes and edge bend points by applying a compaction method, thus defining the metrics.', + ), + ), + ), + oT( + n, + new dz( + ak( + ok(uk(new pu(), APn), "Force"), + "Layout algorithms that follow physical analogies by simulating a system of attractive and repulsive forces. The first successful method of this kind was proposed by Eades in 1984.", + ), + ), + ), + oT( + n, + new dz( + ak( + ok(uk(new pu(), "org.eclipse.elk.circle"), "Circle"), + "Circular layout algorithms emphasize cycles or biconnected components of a graph by arranging them in circles. This is useful if a drawing is desired where such components are clearly grouped, or where cycles are shown as prominent OPTIONS of the graph.", + ), + ), + ), + oT( + n, + new dz( + ak( + ok(uk(new pu(), l$n), "Tree"), + "Specialized layout methods for trees, i.e. acyclic graphs. The regular structure of graphs that have no undirected cycles can be emphasized using an algorithm of this type.", + ), + ), + ), + oT( + n, + new dz( + ak( + ok(uk(new pu(), "org.eclipse.elk.planar"), "Planar"), + "Algorithms that require a planar or upward planar graph. Most of these algorithms are theoretically interesting, but not practically usable.", + ), + ), + ), + oT( + n, + new dz( + ak( + ok(uk(new pu(), C$n), "Radial"), + "Radial layout algorithms usually position the nodes of the graph on concentric circles.", + ), + ), + ), + Mgn((new Lf(), n)), + Epn((new Af(), n)), + ydn((new Nf(), n)); + }), + EF(MLn, "CoreOptions", 684), + Wfn(103, 22, { 3: 1, 35: 1, 22: 1, 103: 1 }, ZS); + var ret, + cet, + aet, + uet, + oet = X1( + MLn, + _Sn, + 103, + u_n, + function () { + return t9(), x4(Gy(oet, 1), XEn, 103, 0, [tet, net, Ztt, Jtt, eet]); + }, + function (n) { + return t9(), rZ((yZ(), ret), n); + }, + ); + Wfn(272, 22, { 3: 1, 35: 1, 22: 1, 272: 1 }, nP); + var set, + het, + fet, + bet, + wet, + det = X1( + MLn, + "EdgeLabelPlacement", + 272, + u_n, + function () { + return ZZ(), x4(Gy(det, 1), XEn, 272, 0, [cet, aet, uet]); + }, + function (n) { + return ZZ(), rZ((GQ(), set), n); + }, + ); + Wfn(218, 22, { 3: 1, 35: 1, 22: 1, 218: 1 }, tP); + var get, + pet, + vet, + met, + yet, + ket, + jet, + Eet = X1( + MLn, + "EdgeRouting", + 218, + u_n, + function () { + return g7(), x4(Gy(Eet, 1), XEn, 218, 0, [wet, fet, het, bet]); + }, + function (n) { + return g7(), rZ((tJ(), get), n); + }, + ); + Wfn(312, 22, { 3: 1, 35: 1, 22: 1, 312: 1 }, eP); + var Tet, + Met, + Set, + Pet, + Iet, + Cet, + Oet, + Aet, + $et, + Let, + Net, + xet = X1( + MLn, + "EdgeType", + 312, + u_n, + function () { + return vun(), x4(Gy(xet, 1), XEn, 312, 0, [ket, met, jet, pet, yet, vet]); + }, + function (n) { + return vun(), rZ((P1(), Tet), n); + }, + ); + Wfn(977, 1, fSn, Lf), + (Fjn.Qe = function (n) { + Mgn(n); + }), + EF(MLn, "FixedLayouterOptions", 977), + Wfn(978, 1, {}, Vu), + (Fjn.$e = function () { + return new Hu(); + }), + (Fjn._e = function (n) {}), + EF(MLn, "FixedLayouterOptions/FixedFactory", 978), + Wfn(334, 22, { 3: 1, 35: 1, 22: 1, 334: 1 }, iP); + var Det, + Ret, + Ket, + _et, + Fet, + Bet = X1( + MLn, + "HierarchyHandling", + 334, + u_n, + function () { + return O8(), x4(Gy(Bet, 1), XEn, 334, 0, [Let, $et, Net]); + }, + function (n) { + return O8(), rZ((qQ(), Det), n); + }, + ); + Wfn(285, 22, { 3: 1, 35: 1, 22: 1, 285: 1 }, rP); + var Het, + qet, + Get, + zet, + Uet, + Xet, + Wet, + Vet, + Qet, + Yet, + Jet = X1( + MLn, + "LabelSide", + 285, + u_n, + function () { + return Frn(), x4(Gy(Jet, 1), XEn, 285, 0, [Fet, Ret, Ket, _et]); + }, + function (n) { + return Frn(), rZ((nJ(), Het), n); + }, + ); + Wfn(93, 22, { 3: 1, 35: 1, 22: 1, 93: 1 }, cP); + var Zet, + nit, + tit, + eit, + iit, + rit, + cit = X1( + MLn, + "NodeLabelPlacement", + 93, + u_n, + function () { + return Eln(), x4(Gy(cit, 1), XEn, 93, 0, [Get, qet, Uet, Yet, Qet, Vet, Xet, Wet, zet]); + }, + function (n) { + return Eln(), rZ((n4(), Zet), n); + }, + ); + Wfn(249, 22, { 3: 1, 35: 1, 22: 1, 249: 1 }, aP); + var ait, + uit, + oit, + sit, + hit, + fit, + lit, + bit = X1( + MLn, + "PortAlignment", + 249, + u_n, + function () { + return Ytn(), x4(Gy(bit, 1), XEn, 249, 0, [eit, rit, nit, tit, iit]); + }, + function (n) { + return Ytn(), rZ((kZ(), ait), n); + }, + ); + Wfn(98, 22, { 3: 1, 35: 1, 22: 1, 98: 1 }, uP); + var wit, + dit, + git, + pit, + vit, + mit, + yit, + kit = X1( + MLn, + "PortConstraints", + 98, + u_n, + function () { + return Ran(), x4(Gy(kit, 1), XEn, 98, 0, [lit, fit, hit, uit, sit, oit]); + }, + function (n) { + return Ran(), rZ((n1(), wit), n); + }, + ); + Wfn(273, 22, { 3: 1, 35: 1, 22: 1, 273: 1 }, oP); + var jit, + Eit, + Tit, + Mit, + Sit, + Pit, + Iit, + Cit, + Oit, + Ait, + $it, + Lit, + Nit, + xit, + Dit, + Rit, + Kit, + _it, + Fit, + Bit, + Hit, + qit, + Git = X1( + MLn, + "PortLabelPlacement", + 273, + u_n, + function () { + return Chn(), x4(Gy(Git, 1), XEn, 273, 0, [mit, pit, vit, git, dit, yit]); + }, + function (n) { + return Chn(), rZ((S1(), jit), n); + }, + ); + Wfn(61, 22, { 3: 1, 35: 1, 22: 1, 61: 1 }, sP); + var zit, + Uit, + Xit, + Wit, + Vit, + Qit, + Yit, + Jit, + Zit, + nrt, + trt = X1( + MLn, + "PortSide", + 61, + u_n, + function () { + return Ikn(), x4(Gy(trt, 1), lIn, 61, 0, [Hit, Tit, Eit, Bit, qit]); + }, + function (n) { + return Ikn(), rZ((jZ(), zit), n); + }, + ); + Wfn(981, 1, fSn, Nf), + (Fjn.Qe = function (n) { + ydn(n); + }), + EF(MLn, "RandomLayouterOptions", 981), + Wfn(982, 1, {}, Qu), + (Fjn.$e = function () { + return new no(); + }), + (Fjn._e = function (n) {}), + EF(MLn, "RandomLayouterOptions/RandomFactory", 982), + Wfn(374, 22, { 3: 1, 35: 1, 22: 1, 374: 1 }, hP); + var ert, + irt, + rrt, + crt, + art, + urt, + ort, + srt, + hrt, + frt, + lrt = X1( + MLn, + "SizeConstraint", + 374, + u_n, + function () { + return Ann(), x4(Gy(lrt, 1), XEn, 374, 0, [Zit, nrt, Jit, Yit]); + }, + function (n) { + return Ann(), rZ((iJ(), ert), n); + }, + ); + Wfn(259, 22, { 3: 1, 35: 1, 22: 1, 259: 1 }, fP); + var brt, + wrt, + drt, + grt, + prt, + vrt = X1( + MLn, + "SizeOptions", + 259, + u_n, + function () { + return Vgn(), x4(Gy(vrt, 1), XEn, 259, 0, [crt, urt, rrt, ort, srt, frt, hrt, art, irt]); + }, + function (n) { + return Vgn(), rZ((t5(), brt), n); + }, + ); + Wfn(370, 1, { 1949: 1 }, am), + (Fjn.b = !1), + (Fjn.c = 0), + (Fjn.d = -1), + (Fjn.e = null), + (Fjn.f = null), + (Fjn.g = -1), + (Fjn.j = !1), + (Fjn.k = !1), + (Fjn.n = !1), + (Fjn.o = 0), + (Fjn.q = 0), + (Fjn.r = 0), + EF(xAn, "BasicProgressMonitor", 370), + Wfn(972, 209, VSn, Gu), + (Fjn.Ze = function (n, t) { + var e, i, r, c, a, u, o, s, h; + run(t, "Box layout", 2), + (r = ey(fL(jln(n, (Run(), unt))))), + (c = Yx(jln(n, rnt), 116)), + (e = ny(hL(jln(n, Z7n)))), + (i = ny(hL(jln(n, nnt)))), + 0 === Yx(jln(n, Y7n), 311).g + ? ((u = new sx((!n.a && (n.a = new m_(uct, n, 10, 11)), n.a))), + XH(), + JC(u, new Vd(i)), + (a = u), + (o = Asn(n)), + (null == (s = fL(jln(n, Q7n))) || (vB(s), s <= 0)) && (s = 1.3), + xkn(n, (h = Kkn(a, r, c, o.a, o.b, e, (vB(s), s))).a, h.b, !1, !0)) + : Vmn(n, r, c, e), + Ron(t); + }), + EF(xAn, "BoxLayoutProvider", 972), + Wfn(973, 1, FMn, Vd), + (Fjn.ue = function (n, t) { + return (function (n, t, e) { + var i, r, c; + if ((!(r = Yx(jln(t, (Run(), ant)), 19)) && (r = d9(0)), !(c = Yx(jln(e, ant), 19)) && (c = d9(0)), r.a > c.a)) return -1; + if (r.a < c.a) return 1; + if (n.a) { + if (0 != (i = $9(t.j, e.j))) return i; + if (0 != (i = $9(t.i, e.i))) return i; + } + return $9(t.g * t.f, e.g * e.f); + })(this, Yx(n, 33), Yx(t, 33)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + (Fjn.a = !1), + EF(xAn, "BoxLayoutProvider/1", 973), + Wfn(157, 1, { 157: 1 }, e1, K$), + (Fjn.Ib = function () { + return this.c ? ugn(this.c) : Gun(this.b); + }), + EF(xAn, "BoxLayoutProvider/Group", 157), + Wfn(311, 22, { 3: 1, 35: 1, 22: 1, 311: 1 }, lP); + var mrt, + yrt = X1( + xAn, + "BoxLayoutProvider/PackingMode", + 311, + u_n, + function () { + return unn(), x4(Gy(yrt, 1), XEn, 311, 0, [prt, wrt, grt, drt]); + }, + function (n) { + return unn(), rZ((eJ(), mrt), n); + }, + ); + Wfn(974, 1, FMn, zu), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return -$9(DR(n) * xR(n), DR(t) * xR(t)); + })(Yx(n, 157), Yx(t, 157)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(xAn, "BoxLayoutProvider/lambda$0$Type", 974), + Wfn(975, 1, FMn, Uu), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return $9(DR(n) * xR(n), DR(t) * xR(t)); + })(Yx(n, 157), Yx(t, 157)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(xAn, "BoxLayoutProvider/lambda$1$Type", 975), + Wfn(976, 1, FMn, Xu), + (Fjn.ue = function (n, t) { + return (function (n, t) { + return $9(DR(n) * xR(n), DR(t) * xR(t)); + })(Yx(n, 157), Yx(t, 157)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(xAn, "BoxLayoutProvider/lambda$2$Type", 976), + Wfn(1365, 1, { 831: 1 }, Wu), + (Fjn.qg = function (n, t) { + return rT(), !CO(t, 160) || aj((H4(), Yx(n, 160)), t); + }), + EF(xAn, "ElkSpacings/AbstractSpacingsBuilder/lambda$0$Type", 1365), + Wfn(1366, 1, PEn, Qd), + (Fjn.td = function (n) { + !(function (n, t) { + var e; + (e = null != oen((cnn(), s2n)) && null != t.wg() ? ty(fL(t.wg())) / ty(fL(oen(s2n))) : 1), xB(n.b, t, e); + })(this.a, Yx(n, 146)); + }), + EF(xAn, "ElkSpacings/AbstractSpacingsBuilder/lambda$1$Type", 1366), + Wfn(1367, 1, PEn, qu), + (Fjn.td = function (n) { + Yx(n, 94), rT(); + }), + EF(xAn, "ElkSpacings/AbstractSpacingsBuilder/lambda$2$Type", 1367), + Wfn(1371, 1, PEn, Yd), + (Fjn.td = function (n) { + !(function (n, t) { + SE(hH(new SR(null, new Nz(new Yl(n.b), 1)), new bP(n, t)), new dP(n, t)); + })(this.a, Yx(n, 94)); + }), + EF(xAn, "ElkSpacings/AbstractSpacingsBuilder/lambda$3$Type", 1371), + Wfn(1369, 1, YEn, bP), + (Fjn.Mb = function (n) { + return (function (n, t, e) { + return !ej(hH(new SR(null, new Nz(n.c, 16)), new Cb(new wP(t, e)))).sd((HE(), dBn)); + })(this.a, this.b, Yx(n, 146)); + }), + EF(xAn, "ElkSpacings/AbstractSpacingsBuilder/lambda$4$Type", 1369), + Wfn(1368, 1, YEn, wP), + (Fjn.Mb = function (n) { + return (function (n, t, e) { + return rT(), e.qg(n, t); + })(this.a, this.b, Yx(n, 831)); + }), + EF(xAn, "ElkSpacings/AbstractSpacingsBuilder/lambda$5$Type", 1368), + Wfn(1370, 1, PEn, dP), + (Fjn.td = function (n) { + !(function (n, t, e) { + t.Ye(e, ty(fL(BF(n.b, e))) * n.a); + })(this.a, this.b, Yx(n, 146)); + }), + EF(xAn, "ElkSpacings/AbstractSpacingsBuilder/lambda$6$Type", 1370), + Wfn(935, 1, {}, Bu), + (Fjn.Kb = function (n) { + return pC(n); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + EF(xAn, "ElkUtil/lambda$0$Type", 935), + Wfn(936, 1, PEn, gP), + (Fjn.td = function (n) { + !(function (n, t, e) { + var i; + SE(new SR(null, (!e.a && (e.a = new m_(tct, e, 6, 6)), new Nz(e.a, 16))), new pP(n, t)), + SE(new SR(null, (!e.n && (e.n = new m_(act, e, 1, 7)), new Nz(e.n, 16))), new vP(n, t)), + (i = Yx(jln(e, (Cjn(), Gnt)), 74)) && R2(i, n, t); + })(this.a, this.b, Yx(n, 79)); + }), + (Fjn.a = 0), + (Fjn.b = 0), + EF(xAn, "ElkUtil/lambda$1$Type", 936), + Wfn(937, 1, PEn, pP), + (Fjn.td = function (n) { + xm(this.a, this.b, Yx(n, 202)); + }), + (Fjn.a = 0), + (Fjn.b = 0), + EF(xAn, "ElkUtil/lambda$2$Type", 937), + Wfn(938, 1, PEn, vP), + (Fjn.td = function (n) { + !(function (n, t, e) { + jC(e, e.i + n, e.j + t); + })(this.a, this.b, Yx(n, 137)); + }), + (Fjn.a = 0), + (Fjn.b = 0), + EF(xAn, "ElkUtil/lambda$3$Type", 938), + Wfn(939, 1, PEn, Jd), + (Fjn.td = function (n) { + !(function (n, t) { + eD(n, new QS(t.a, t.b)); + })(this.a, Yx(n, 469)); + }), + EF(xAn, "ElkUtil/lambda$4$Type", 939), + Wfn(342, 1, { 35: 1, 342: 1 }, tp), + (Fjn.wd = function (n) { + return (function (n, t) { + return n.a < tx(t) ? -1 : 1; + })(this, Yx(n, 236)); + }), + (Fjn.Fb = function (n) { + var t; + return !!CO(n, 342) && ((t = Yx(n, 342)), this.a == t.a); + }), + (Fjn.Hb = function () { + return oG(this.a); + }), + (Fjn.Ib = function () { + return this.a + " (exclusive)"; + }), + (Fjn.a = 0), + EF(xAn, "ExclusiveBounds/ExclusiveLowerBound", 342), + Wfn(1138, 209, VSn, Hu), + (Fjn.Ze = function (n, t) { + var i, r, c, a, u, o, s, f, l, b, w, d, g, p, v, m, y, k, j, E, T; + for ( + run(t, "Fixed Layout", 1), + a = Yx(jln(n, (Cjn(), $nt)), 218), + b = 0, + w = 0, + v = new UO((!n.a && (n.a = new m_(uct, n, 10, 11)), n.a)); + v.e != v.i.gc(); + + ) { + for ( + g = Yx(hen(v), 33), + (T = Yx(jln(g, (L6(), Aet)), 8)) && + (jC(g, T.a, T.b), + Yx(jln(g, Set), 174).Hc((Ann(), Yit)) && (d = Yx(jln(g, Iet), 8)).a > 0 && d.b > 0 && xkn(g, d.a, d.b, !0, !0)), + b = e.Math.max(b, g.i + g.g), + w = e.Math.max(w, g.j + g.f), + f = new UO((!g.n && (g.n = new m_(act, g, 1, 7)), g.n)); + f.e != f.i.gc(); + + ) + (o = Yx(hen(f), 137)), + (T = Yx(jln(o, Aet), 8)) && jC(o, T.a, T.b), + (b = e.Math.max(b, g.i + o.i + o.g)), + (w = e.Math.max(w, g.j + o.j + o.f)); + for (k = new UO((!g.c && (g.c = new m_(oct, g, 9, 9)), g.c)); k.e != k.i.gc(); ) + for ( + y = Yx(hen(k), 118), + (T = Yx(jln(y, Aet), 8)) && jC(y, T.a, T.b), + j = g.i + y.i, + E = g.j + y.j, + b = e.Math.max(b, j + y.g), + w = e.Math.max(w, E + y.f), + s = new UO((!y.n && (y.n = new m_(act, y, 1, 7)), y.n)); + s.e != s.i.gc(); + + ) + (o = Yx(hen(s), 137)), + (T = Yx(jln(o, Aet), 8)) && jC(o, T.a, T.b), + (b = e.Math.max(b, j + o.i + o.g)), + (w = e.Math.max(w, E + o.j + o.f)); + for (c = new $K(bA(lbn(g).a.Kc(), new h())); Vfn(c); ) + (l = Dkn((i = Yx(kV(c), 79)))), (b = e.Math.max(b, l.a)), (w = e.Math.max(w, l.b)); + for (r = new $K(bA(fbn(g).a.Kc(), new h())); Vfn(r); ) + IG(Kun((i = Yx(kV(r), 79)))) != n && ((l = Dkn(i)), (b = e.Math.max(b, l.a)), (w = e.Math.max(w, l.b))); + } + if (a == (g7(), het)) + for (p = new UO((!n.a && (n.a = new m_(uct, n, 10, 11)), n.a)); p.e != p.i.gc(); ) + for (r = new $K(bA(lbn((g = Yx(hen(p), 33))).a.Kc(), new h())); Vfn(r); ) + 0 == (u = Npn((i = Yx(kV(r), 79)))).b ? Aen(i, Gnt, null) : Aen(i, Gnt, u); + ny(hL(jln(n, (L6(), Pet)))) || xkn(n, b + (m = Yx(jln(n, Cet), 116)).b + m.c, w + m.d + m.a, !0, !0), Ron(t); + }), + EF(xAn, "FixedLayoutProvider", 1138), + Wfn(373, 134, { 3: 1, 414: 1, 373: 1, 94: 1, 134: 1 }, Yu, FJ), + (Fjn.Jf = function (n) { + var t, e, i, r, c, a, u; + if (n) + try { + for (a = Ogn(n, ";,;"), r = 0, c = (i = a).length; r < c; ++r) { + if (((t = Ogn(i[r], "\\:")), !(e = yyn(s0(), t[0])))) throw hp(new Qm("Invalid option id: " + t[0])); + if (null == (u = oyn(e, t[1]))) throw hp(new Qm("Invalid option value: " + t[1])); + null == u ? (!this.q && (this.q = new rp()), zV(this.q, e)) : (!this.q && (this.q = new rp()), xB(this.q, e, u)); + } + } catch (n) { + throw CO((n = j4(n)), 102) ? hp(new S6(n)) : hp(n); + } + }), + (Fjn.Ib = function () { + return lL( + kW( + fH((this.q ? this.q : (XH(), XH(), MFn)).vc().Oc(), new Ju()), + kJ(new cD(), new Z(), new W(), new V(), x4(Gy(wBn, 1), XEn, 132, 0, [])), + ), + ); + }); + var krt, + jrt, + Ert, + Trt, + Mrt = EF(xAn, "IndividualSpacings", 373); + Wfn(971, 1, {}, Ju), + (Fjn.Kb = function (n) { + return (function (n) { + return Yx(n.cd(), 146).tg() + ":" + I7(n.dd()); + })(Yx(n, 42)); + }), + EF(xAn, "IndividualSpacings/lambda$0$Type", 971), + Wfn(709, 1, {}, HR), + (Fjn.c = 0), + EF(xAn, "InstancePool", 709), + Wfn(1275, 1, {}, Zu), + EF(xAn, "LoggedGraph", 1275), + Wfn(396, 22, { 3: 1, 35: 1, 22: 1, 396: 1 }, yP); + var Srt, + Prt, + Irt, + Crt = X1( + xAn, + "LoggedGraph/Type", + 396, + u_n, + function () { + return P6(), x4(Gy(Crt, 1), XEn, 396, 0, [jrt, Ert, krt, Trt]); + }, + function (n) { + return P6(), rZ((ZY(), Srt), n); + }, + ); + Wfn(46, 1, { 20: 1, 46: 1 }, mP), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Fb = function (n) { + var t, e, i; + return ( + !!CO(n, 46) && + ((e = Yx(n, 46)), + (t = null == this.a ? null == e.a : Q8(this.a, e.a)), + (i = null == this.b ? null == e.b : Q8(this.b, e.b)), + t && i) + ); + }), + (Fjn.Hb = function () { + var n, t, e; + return ( + (n = -65536 & (t = null == this.a ? 0 : W5(this.a))), + ((t & fTn) ^ (((-65536 & (e = null == this.b ? 0 : W5(this.b))) >> 16) & fTn)) | (n ^ ((e & fTn) << 16)) + ); + }), + (Fjn.Kc = function () { + return new Zd(this); + }), + (Fjn.Ib = function () { + return null == this.a && null == this.b + ? "pair(null,null)" + : null == this.a + ? "pair(null," + I7(this.b) + ")" + : null == this.b + ? "pair(" + I7(this.a) + ",null)" + : "pair(" + I7(this.a) + "," + I7(this.b) + ")"; + }), + EF(xAn, "Pair", 46), + Wfn(983, 1, fEn, Zd), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return !this.c && ((!this.b && null != this.a.a) || null != this.a.b); + }), + (Fjn.Pb = function () { + if (!this.c && !this.b && null != this.a.a) return (this.b = !0), this.a.a; + if (!this.c && null != this.a.b) return (this.c = !0), this.a.b; + throw hp(new Kp()); + }), + (Fjn.Qb = function () { + throw (this.c && null != this.a.b ? (this.a.b = null) : this.b && null != this.a.a && (this.a.a = null), hp(new Lp())); + }), + (Fjn.b = !1), + (Fjn.c = !1), + EF(xAn, "Pair/1", 983), + Wfn(448, 1, { 448: 1 }, jH), + (Fjn.Fb = function (n) { + return qB(this.a, Yx(n, 448).a) && qB(this.c, Yx(n, 448).c) && qB(this.d, Yx(n, 448).d) && qB(this.b, Yx(n, 448).b); + }), + (Fjn.Hb = function () { + return G6(x4(Gy(UKn, 1), iEn, 1, 5, [this.a, this.c, this.d, this.b])); + }), + (Fjn.Ib = function () { + return "(" + this.a + tEn + this.c + tEn + this.d + tEn + this.b + ")"; + }), + EF(xAn, "Quadruple", 448), + Wfn(1126, 209, VSn, no), + (Fjn.Ze = function (n, t) { + var i; + run(t, "Random Layout", 1), + 0 != (!n.a && (n.a = new m_(uct, n, 10, 11)), n.a).i + ? ((function (n, t, i, r, c) { + var a, u, o, s, f, l, b, w, d, g, p, v, m, y, k, j, E, T, M, S; + for (y = 0, g = 0, d = 0, w = 1, m = new UO((!n.a && (n.a = new m_(uct, n, 10, 11)), n.a)); m.e != m.i.gc(); ) + (w += FX(new $K(bA(lbn((p = Yx(hen(m), 33))).a.Kc(), new h())))), + (T = p.g), + (g = e.Math.max(g, T)), + (b = p.f), + (d = e.Math.max(d, b)), + (y += T * b); + for ( + u = y + 2 * r * r * w * (!n.a && (n.a = new m_(uct, n, 10, 11)), n.a).i, + a = e.Math.sqrt(u), + s = e.Math.max(a * i, g), + o = e.Math.max(a / i, d), + v = new UO((!n.a && (n.a = new m_(uct, n, 10, 11)), n.a)); + v.e != v.i.gc(); + + ) + (p = Yx(hen(v), 33)), + (M = c.b + (Xln(t, 26) * mMn + Xln(t, 27) * yMn) * (s - p.g)), + (S = c.b + (Xln(t, 26) * mMn + Xln(t, 27) * yMn) * (o - p.f)), + L1(p, M), + N1(p, S); + for ( + E = s + (c.b + c.c), j = o + (c.d + c.a), k = new UO((!n.a && (n.a = new m_(uct, n, 10, 11)), n.a)); + k.e != k.i.gc(); + + ) + for (l = new $K(bA(lbn(Yx(hen(k), 33)).a.Kc(), new h())); Vfn(l); ) Rfn((f = Yx(kV(l), 79))) || djn(f, t, E, j); + xkn(n, (E += c.b + c.c), (j += c.d + c.a), !1, !0); + })( + n, + (i = Yx(jln(n, (Onn(), Vit)), 19)) && 0 != i.a ? new jW(i.a) : new c7(), + ey(fL(jln(n, Uit))), + ey(fL(jln(n, Qit))), + Yx(jln(n, Xit), 116), + ), + Ron(t)) + : Ron(t); + }), + EF(xAn, "RandomLayoutProvider", 1126), + Wfn(553, 1, {}), + (Fjn.qf = function () { + return new QS(this.f.i, this.f.j); + }), + (Fjn.We = function (n) { + return Oq(n, (Cjn(), ytt)) ? jln(this.f, Irt) : jln(this.f, n); + }), + (Fjn.rf = function () { + return new QS(this.f.g, this.f.f); + }), + (Fjn.sf = function () { + return this.g; + }), + (Fjn.Xe = function (n) { + return zQ(this.f, n); + }), + (Fjn.tf = function (n) { + L1(this.f, n.a), N1(this.f, n.b); + }), + (Fjn.uf = function (n) { + $1(this.f, n.a), A1(this.f, n.b); + }), + (Fjn.vf = function (n) { + this.g = n; + }), + (Fjn.g = 0), + EF(iNn, "ElkGraphAdapters/AbstractElkGraphElementAdapter", 553), + Wfn(554, 1, { 839: 1 }, ng), + (Fjn.wf = function () { + var n, t; + if (!this.b) + for (this.b = nX(JB(this.a).i), t = new UO(JB(this.a)); t.e != t.i.gc(); ) (n = Yx(hen(t), 137)), eD(this.b, new Wm(n)); + return this.b; + }), + (Fjn.b = null), + EF(iNn, "ElkGraphAdapters/ElkEdgeAdapter", 554), + Wfn(301, 553, {}, Xm), + (Fjn.xf = function () { + return hrn(this); + }), + (Fjn.a = null), + EF(iNn, "ElkGraphAdapters/ElkGraphAdapter", 301), + Wfn(630, 553, { 181: 1 }, Wm), + EF(iNn, "ElkGraphAdapters/ElkLabelAdapter", 630), + Wfn(629, 553, { 680: 1 }, e$), + (Fjn.wf = function () { + return (function (n) { + var t, e; + if (!n.b) + for (n.b = nX(Yx(n.f, 33).Ag().i), e = new UO(Yx(n.f, 33).Ag()); e.e != e.i.gc(); ) + (t = Yx(hen(e), 137)), eD(n.b, new Wm(t)); + return n.b; + })(this); + }), + (Fjn.Af = function () { + var n; + return !(n = Yx(jln(this.f, (Cjn(), Unt)), 142)) && (n = new Mv()), n; + }), + (Fjn.Cf = function () { + return (function (n) { + var t, e; + if (!n.e) + for (n.e = nX(ZB(Yx(n.f, 33)).i), e = new UO(ZB(Yx(n.f, 33))); e.e != e.i.gc(); ) (t = Yx(hen(e), 118)), eD(n.e, new Ag(t)); + return n.e; + })(this); + }), + (Fjn.Ef = function (n) { + var t; + (t = new yx(n)), Aen(this.f, (Cjn(), Unt), t); + }), + (Fjn.Ff = function (n) { + Aen(this.f, (Cjn(), utt), new mx(n)); + }), + (Fjn.yf = function () { + return this.d; + }), + (Fjn.zf = function () { + var n, t; + if (!this.a) + for (this.a = new ip(), t = new $K(bA(fbn(Yx(this.f, 33)).a.Kc(), new h())); Vfn(t); ) + (n = Yx(kV(t), 79)), eD(this.a, new ng(n)); + return this.a; + }), + (Fjn.Bf = function () { + var n, t; + if (!this.c) + for (this.c = new ip(), t = new $K(bA(lbn(Yx(this.f, 33)).a.Kc(), new h())); Vfn(t); ) + (n = Yx(kV(t), 79)), eD(this.c, new ng(n)); + return this.c; + }), + (Fjn.Df = function () { + return 0 != uq(Yx(this.f, 33)).i || ny(hL(Yx(this.f, 33).We((Cjn(), Fnt)))); + }), + (Fjn.Gf = function () { + MJ(this, (dT(), Prt)); + }), + (Fjn.a = null), + (Fjn.b = null), + (Fjn.c = null), + (Fjn.d = null), + (Fjn.e = null), + EF(iNn, "ElkGraphAdapters/ElkNodeAdapter", 629), + Wfn(1266, 553, { 838: 1 }, Ag), + (Fjn.wf = function () { + return (function (n) { + var t, e; + if (!n.b) + for (n.b = nX(Yx(n.f, 118).Ag().i), e = new UO(Yx(n.f, 118).Ag()); e.e != e.i.gc(); ) + (t = Yx(hen(e), 137)), eD(n.b, new Wm(t)); + return n.b; + })(this); + }), + (Fjn.zf = function () { + var n, t; + if (!this.a) + for (this.a = h$(Yx(this.f, 118).xg().i), t = new UO(Yx(this.f, 118).xg()); t.e != t.i.gc(); ) + (n = Yx(hen(t), 79)), eD(this.a, new ng(n)); + return this.a; + }), + (Fjn.Bf = function () { + var n, t; + if (!this.c) + for (this.c = h$(Yx(this.f, 118).yg().i), t = new UO(Yx(this.f, 118).yg()); t.e != t.i.gc(); ) + (n = Yx(hen(t), 79)), eD(this.c, new ng(n)); + return this.c; + }), + (Fjn.Hf = function () { + return Yx(Yx(this.f, 118).We((Cjn(), Itt)), 61); + }), + (Fjn.If = function () { + var n, t, e, i, r, c, a; + for (i = TG(Yx(this.f, 118)), e = new UO(Yx(this.f, 118).yg()); e.e != e.i.gc(); ) + for (a = new UO((!(n = Yx(hen(e), 79)).c && (n.c = new AN(Zrt, n, 5, 8)), n.c)); a.e != a.i.gc(); ) { + if (XZ(iun((c = Yx(hen(a), 82))), i)) return !0; + if (iun(c) == i && ny(hL(jln(n, (Cjn(), Bnt))))) return !0; + } + for (t = new UO(Yx(this.f, 118).xg()); t.e != t.i.gc(); ) + for (r = new UO((!(n = Yx(hen(t), 79)).b && (n.b = new AN(Zrt, n, 4, 7)), n.b)); r.e != r.i.gc(); ) + if (XZ(iun(Yx(hen(r), 82)), i)) return !0; + return !1; + }), + (Fjn.a = null), + (Fjn.b = null), + (Fjn.c = null), + EF(iNn, "ElkGraphAdapters/ElkPortAdapter", 1266), + Wfn(1267, 1, FMn, to), + (Fjn.ue = function (n, t) { + return (function (n, t) { + var e, i, r, c; + if (0 != (c = Yx(jln(n, (Cjn(), Itt)), 61).g - Yx(jln(t, Itt), 61).g)) return c; + if (((e = Yx(jln(n, Ett), 19)), (i = Yx(jln(t, Ett), 19)), e && i && 0 != (r = e.a - i.a))) return r; + switch (Yx(jln(n, Itt), 61).g) { + case 1: + return $9(n.i, t.i); + case 2: + return $9(n.j, t.j); + case 3: + return $9(t.i, n.i); + case 4: + return $9(t.j, n.j); + default: + throw hp(new Ym(mIn)); + } + })(Yx(n, 118), Yx(t, 118)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(iNn, "ElkGraphAdapters/PortComparator", 1267); + var Ort, + Art, + $rt, + Lrt, + Nrt, + xrt, + Drt, + Rrt, + Krt, + _rt, + Frt, + Brt, + Hrt, + qrt, + Grt, + zrt, + Urt, + Xrt, + Wrt = aR(rNn, "EObject"), + Vrt = aR(cNn, aNn), + Qrt = aR(cNn, uNn), + Yrt = aR(cNn, oNn), + Jrt = aR(cNn, "ElkShape"), + Zrt = aR(cNn, sNn), + nct = aR(cNn, hNn), + tct = aR(cNn, fNn), + ect = aR(rNn, lNn), + ict = aR(rNn, "EFactory"), + rct = aR(rNn, bNn), + cct = aR(rNn, "EPackage"), + act = aR(cNn, wNn), + uct = aR(cNn, dNn), + oct = aR(cNn, gNn); + Wfn(90, 1, pNn), + (Fjn.Jg = function () { + return this.Kg(), null; + }), + (Fjn.Kg = function () { + return null; + }), + (Fjn.Lg = function () { + return this.Kg(), !1; + }), + (Fjn.Mg = function () { + return !1; + }), + (Fjn.Ng = function (n) { + K3(this, n); + }), + EF(vNn, "BasicNotifierImpl", 90), + Wfn(97, 90, SNn), + (Fjn.nh = function () { + return gC(this); + }), + (Fjn.Og = function (n, t) { + return n; + }), + (Fjn.Pg = function () { + throw hp(new xp()); + }), + (Fjn.Qg = function (n) { + var t; + return (t = nin(Yx(CZ(this.Tg(), this.Vg()), 18))), this.eh().ih(this, t.n, t.f, n); + }), + (Fjn.Rg = function (n, t) { + throw hp(new xp()); + }), + (Fjn.Sg = function (n, t, e) { + return opn(this, n, t, e); + }), + (Fjn.Tg = function () { + var n; + return this.Pg() && (n = this.Pg().ck()) ? n : this.zh(); + }), + (Fjn.Ug = function () { + return Bfn(this); + }), + (Fjn.Vg = function () { + throw hp(new xp()); + }), + (Fjn.Wg = function () { + var n, t; + return !(t = this.ph().dk()) && this.Pg().ik((kT(), (t = null == (n = Wq(svn(this.Tg()))) ? Vat : new n$(this, n)))), t; + }), + (Fjn.Xg = function (n, t) { + return n; + }), + (Fjn.Yg = function (n) { + return n.Gj() ? n.aj() : tnn(this.Tg(), n); + }), + (Fjn.Zg = function () { + var n; + return (n = this.Pg()) ? n.fk() : null; + }), + (Fjn.$g = function () { + return this.Pg() ? this.Pg().ck() : null; + }), + (Fjn._g = function (n, t, e) { + return $en(this, n, t, e); + }), + (Fjn.ah = function (n) { + return TY(this, n); + }), + (Fjn.bh = function (n, t) { + return TV(this, n, t); + }), + (Fjn.dh = function () { + var n; + return !!(n = this.Pg()) && n.gk(); + }), + (Fjn.eh = function () { + throw hp(new xp()); + }), + (Fjn.fh = function () { + return rtn(this); + }), + (Fjn.gh = function (n, t, e, i) { + return men(this, n, t, i); + }), + (Fjn.hh = function (n, t, e) { + return Yx(CZ(this.Tg(), t), 66) + .Nj() + .Qj(this, this.yh(), t - this.Ah(), n, e); + }), + (Fjn.ih = function (n, t, e, i) { + return Uq(this, n, t, i); + }), + (Fjn.jh = function (n, t, e) { + return Yx(CZ(this.Tg(), t), 66) + .Nj() + .Rj(this, this.yh(), t - this.Ah(), n, e); + }), + (Fjn.kh = function () { + return !!this.Pg() && !!this.Pg().ek(); + }), + (Fjn.lh = function (n) { + return uen(this, n); + }), + (Fjn.mh = function (n) { + return CG(this, n); + }), + (Fjn.oh = function (n) { + return eyn(this, n); + }), + (Fjn.ph = function () { + throw hp(new xp()); + }), + (Fjn.qh = function () { + return this.Pg() ? this.Pg().ek() : null; + }), + (Fjn.rh = function () { + return rtn(this); + }), + (Fjn.sh = function (n, t) { + Vsn(this, n, t); + }), + (Fjn.th = function (n) { + this.ph().hk(n); + }), + (Fjn.uh = function (n) { + this.ph().kk(n); + }), + (Fjn.vh = function (n) { + this.ph().jk(n); + }), + (Fjn.wh = function (n, t) { + var e, i, r, c; + return ( + (c = this.Zg()) && n && ((t = Ten(c.Vk(), this, t)), c.Zk(this)), + (i = this.eh()) && + (0 != (Ign(this, this.eh(), this.Vg()).Bb & eMn) + ? (r = i.fh()) && (n ? !c && r.Zk(this) : r.Yk(this)) + : ((t = (e = this.Vg()) >= 0 ? this.Qg(t) : this.eh().ih(this, -1 - e, null, t)), (t = this.Sg(null, -1, t)))), + this.uh(n), + t + ); + }), + (Fjn.xh = function (n) { + var t, e, i, r, c, a, u; + if ((c = tnn((e = this.Tg()), n)) >= (t = this.Ah())) + return Yx(n, 66) + .Nj() + .Uj(this, this.yh(), c - t); + if (c <= -1) { + if (!(a = iyn((wsn(), wut), e, n))) throw hp(new Qm(mNn + n.ne() + jNn)); + if ( + (TT(), + Yx(a, 66).Oj() || (a = Bz(PJ(wut, a))), + (r = Yx((i = this.Yg(a)) >= 0 ? this._g(i, !0, !0) : tfn(this, a, !0), 153)), + (u = a.Zj()) > 1 || -1 == u) + ) + return Yx(Yx(r, 215).hl(n, !1), 76); + } else if (n.$j()) return Yx((i = this.Yg(n)) >= 0 ? this._g(i, !1, !0) : tfn(this, n, !1), 76); + return new qP(this, n); + }), + (Fjn.yh = function () { + return DJ(this); + }), + (Fjn.zh = function () { + return (YF(), gat).S; + }), + (Fjn.Ah = function () { + return vF(this.zh()); + }), + (Fjn.Bh = function (n) { + usn(this, n); + }), + (Fjn.Ib = function () { + return Kln(this); + }), + EF(PNn, "BasicEObjectImpl", 97), + Wfn(114, 97, { 105: 1, 92: 1, 90: 1, 56: 1, 108: 1, 49: 1, 97: 1, 114: 1 }), + (Fjn.Ch = function (n) { + return RJ(this)[n]; + }), + (Fjn.Dh = function (n, t) { + DF(RJ(this), n, t); + }), + (Fjn.Eh = function (n) { + DF(RJ(this), n, null); + }), + (Fjn.Jg = function () { + return Yx(H3(this, 4), 126); + }), + (Fjn.Kg = function () { + throw hp(new xp()); + }), + (Fjn.Lg = function () { + return 0 != (4 & this.Db); + }), + (Fjn.Pg = function () { + throw hp(new xp()); + }), + (Fjn.Fh = function (n) { + wtn(this, 2, n); + }), + (Fjn.Rg = function (n, t) { + (this.Db = (t << 16) | (255 & this.Db)), this.Fh(n); + }), + (Fjn.Tg = function () { + return Cq(this); + }), + (Fjn.Vg = function () { + return this.Db >> 16; + }), + (Fjn.Wg = function () { + var n; + return kT(), null == (n = Wq(svn(Yx(H3(this, 16), 26) || this.zh()))) ? Vat : new n$(this, n); + }), + (Fjn.Mg = function () { + return 0 == (1 & this.Db); + }), + (Fjn.Zg = function () { + return Yx(H3(this, 128), 1935); + }), + (Fjn.$g = function () { + return Yx(H3(this, 16), 26); + }), + (Fjn.dh = function () { + return 0 != (32 & this.Db); + }), + (Fjn.eh = function () { + return Yx(H3(this, 2), 49); + }), + (Fjn.kh = function () { + return 0 != (64 & this.Db); + }), + (Fjn.ph = function () { + throw hp(new xp()); + }), + (Fjn.qh = function () { + return Yx(H3(this, 64), 281); + }), + (Fjn.th = function (n) { + wtn(this, 16, n); + }), + (Fjn.uh = function (n) { + wtn(this, 128, n); + }), + (Fjn.vh = function (n) { + wtn(this, 64, n); + }), + (Fjn.yh = function () { + return dtn(this); + }), + (Fjn.Db = 0), + EF(PNn, "MinimalEObjectImpl", 114), + Wfn(115, 114, { + 105: 1, + 92: 1, + 90: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 114: 1, + 115: 1, + }), + (Fjn.Fh = function (n) { + this.Cb = n; + }), + (Fjn.eh = function () { + return this.Cb; + }), + EF(PNn, "MinimalEObjectImpl/Container", 115), + Wfn(1985, 115, { + 105: 1, + 413: 1, + 94: 1, + 92: 1, + 90: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 114: 1, + 115: 1, + }), + (Fjn._g = function (n, t, e) { + return Mrn(this, n, t, e); + }), + (Fjn.jh = function (n, t, e) { + return fon(this, n, t, e); + }), + (Fjn.lh = function (n) { + return Zz(this, n); + }), + (Fjn.sh = function (n, t) { + J5(this, n, t); + }), + (Fjn.zh = function () { + return ajn(), Hrt; + }), + (Fjn.Bh = function (n) { + Q4(this, n); + }), + (Fjn.Ve = function () { + return een(this); + }), + (Fjn.We = function (n) { + return jln(this, n); + }), + (Fjn.Xe = function (n) { + return zQ(this, n); + }), + (Fjn.Ye = function (n, t) { + return Aen(this, n, t); + }), + EF(INn, "EMapPropertyHolderImpl", 1985), + Wfn(567, 115, { 105: 1, 469: 1, 92: 1, 90: 1, 56: 1, 108: 1, 49: 1, 97: 1, 114: 1, 115: 1 }, ro), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return this.a; + case 1: + return this.b; + } + return $en(this, n, t, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return 0 != this.a; + case 1: + return 0 != this.b; + } + return uen(this, n); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 0: + return void I1(this, ty(fL(t))); + case 1: + return void C1(this, ty(fL(t))); + } + Vsn(this, n, t); + }), + (Fjn.zh = function () { + return ajn(), $rt; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 0: + return void I1(this, 0); + case 1: + return void C1(this, 0); + } + usn(this, n); + }), + (Fjn.Ib = function () { + var n; + return 0 != (64 & this.Db) + ? Kln(this) + : (((n = new MA(Kln(this))).a += " (x: "), Jk(n, this.a), (n.a += ", y: "), Jk(n, this.b), (n.a += ")"), n.a); + }), + (Fjn.a = 0), + (Fjn.b = 0), + EF(INn, "ElkBendPointImpl", 567), + Wfn(723, 1985, { + 105: 1, + 413: 1, + 160: 1, + 94: 1, + 92: 1, + 90: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 114: 1, + 115: 1, + }), + (Fjn._g = function (n, t, e) { + return n9(this, n, t, e); + }), + (Fjn.hh = function (n, t, e) { + return sun(this, n, t, e); + }), + (Fjn.jh = function (n, t, e) { + return d4(this, n, t, e); + }), + (Fjn.lh = function (n) { + return z3(this, n); + }), + (Fjn.sh = function (n, t) { + Vcn(this, n, t); + }), + (Fjn.zh = function () { + return ajn(), Drt; + }), + (Fjn.Bh = function (n) { + A8(this, n); + }), + (Fjn.zg = function () { + return this.k; + }), + (Fjn.Ag = function () { + return JB(this); + }), + (Fjn.Ib = function () { + return V9(this); + }), + (Fjn.k = null), + EF(INn, "ElkGraphElementImpl", 723), + Wfn(724, 723, { + 105: 1, + 413: 1, + 160: 1, + 470: 1, + 94: 1, + 92: 1, + 90: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 114: 1, + 115: 1, + }), + (Fjn._g = function (n, t, e) { + return S7(this, n, t, e); + }), + (Fjn.lh = function (n) { + return z7(this, n); + }), + (Fjn.sh = function (n, t) { + Qcn(this, n, t); + }), + (Fjn.zh = function () { + return ajn(), Brt; + }), + (Fjn.Bh = function (n) { + rnn(this, n); + }), + (Fjn.Bg = function () { + return this.f; + }), + (Fjn.Cg = function () { + return this.g; + }), + (Fjn.Dg = function () { + return this.i; + }), + (Fjn.Eg = function () { + return this.j; + }), + (Fjn.Fg = function (n, t) { + kC(this, n, t); + }), + (Fjn.Gg = function (n, t) { + jC(this, n, t); + }), + (Fjn.Hg = function (n) { + L1(this, n); + }), + (Fjn.Ig = function (n) { + N1(this, n); + }), + (Fjn.Ib = function () { + return yon(this); + }), + (Fjn.f = 0), + (Fjn.g = 0), + (Fjn.i = 0), + (Fjn.j = 0), + EF(INn, "ElkShapeImpl", 724), + Wfn(725, 724, { + 105: 1, + 413: 1, + 82: 1, + 160: 1, + 470: 1, + 94: 1, + 92: 1, + 90: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 114: 1, + 115: 1, + }), + (Fjn._g = function (n, t, e) { + return bin(this, n, t, e); + }), + (Fjn.hh = function (n, t, e) { + return Lcn(this, n, t, e); + }), + (Fjn.jh = function (n, t, e) { + return Ncn(this, n, t, e); + }), + (Fjn.lh = function (n) { + return B5(this, n); + }), + (Fjn.sh = function (n, t) { + oln(this, n, t); + }), + (Fjn.zh = function () { + return ajn(), Lrt; + }), + (Fjn.Bh = function (n) { + yen(this, n); + }), + (Fjn.xg = function () { + return !this.d && (this.d = new AN(nct, this, 8, 5)), this.d; + }), + (Fjn.yg = function () { + return !this.e && (this.e = new AN(nct, this, 7, 4)), this.e; + }), + EF(INn, "ElkConnectableShapeImpl", 725), + Wfn( + 352, + 723, + { + 105: 1, + 413: 1, + 79: 1, + 160: 1, + 352: 1, + 94: 1, + 92: 1, + 90: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 114: 1, + 115: 1, + }, + io, + ), + (Fjn.Qg = function (n) { + return ucn(this, n); + }), + (Fjn._g = function (n, t, e) { + switch (n) { + case 3: + return EG(this); + case 4: + return !this.b && (this.b = new AN(Zrt, this, 4, 7)), this.b; + case 5: + return !this.c && (this.c = new AN(Zrt, this, 5, 8)), this.c; + case 6: + return !this.a && (this.a = new m_(tct, this, 6, 6)), this.a; + case 7: + return ( + TA(), + !this.b && (this.b = new AN(Zrt, this, 4, 7)), + !(this.b.i <= 1 && (!this.c && (this.c = new AN(Zrt, this, 5, 8)), this.c.i <= 1)) + ); + case 8: + return TA(), !!Rfn(this); + case 9: + return TA(), !!Whn(this); + case 10: + return ( + TA(), + !this.b && (this.b = new AN(Zrt, this, 4, 7)), + 0 != this.b.i && (!this.c && (this.c = new AN(Zrt, this, 5, 8)), 0 != this.c.i) + ); + } + return n9(this, n, t, e); + }), + (Fjn.hh = function (n, t, e) { + var i; + switch (t) { + case 3: + return this.Cb && (e = (i = this.Db >> 16) >= 0 ? ucn(this, e) : this.Cb.ih(this, -1 - i, null, e)), AL(this, Yx(n, 33), e); + case 4: + return !this.b && (this.b = new AN(Zrt, this, 4, 7)), wnn(this.b, n, e); + case 5: + return !this.c && (this.c = new AN(Zrt, this, 5, 8)), wnn(this.c, n, e); + case 6: + return !this.a && (this.a = new m_(tct, this, 6, 6)), wnn(this.a, n, e); + } + return sun(this, n, t, e); + }), + (Fjn.jh = function (n, t, e) { + switch (t) { + case 3: + return AL(this, null, e); + case 4: + return !this.b && (this.b = new AN(Zrt, this, 4, 7)), Ten(this.b, n, e); + case 5: + return !this.c && (this.c = new AN(Zrt, this, 5, 8)), Ten(this.c, n, e); + case 6: + return !this.a && (this.a = new m_(tct, this, 6, 6)), Ten(this.a, n, e); + } + return d4(this, n, t, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 3: + return !!EG(this); + case 4: + return !!this.b && 0 != this.b.i; + case 5: + return !!this.c && 0 != this.c.i; + case 6: + return !!this.a && 0 != this.a.i; + case 7: + return ( + !this.b && (this.b = new AN(Zrt, this, 4, 7)), + !(this.b.i <= 1 && (!this.c && (this.c = new AN(Zrt, this, 5, 8)), this.c.i <= 1)) + ); + case 8: + return Rfn(this); + case 9: + return Whn(this); + case 10: + return ( + !this.b && (this.b = new AN(Zrt, this, 4, 7)), + 0 != this.b.i && (!this.c && (this.c = new AN(Zrt, this, 5, 8)), 0 != this.c.i) + ); + } + return z3(this, n); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 3: + return void Sbn(this, Yx(t, 33)); + case 4: + return ( + !this.b && (this.b = new AN(Zrt, this, 4, 7)), + Hmn(this.b), + !this.b && (this.b = new AN(Zrt, this, 4, 7)), + void jF(this.b, Yx(t, 14)) + ); + case 5: + return ( + !this.c && (this.c = new AN(Zrt, this, 5, 8)), + Hmn(this.c), + !this.c && (this.c = new AN(Zrt, this, 5, 8)), + void jF(this.c, Yx(t, 14)) + ); + case 6: + return ( + !this.a && (this.a = new m_(tct, this, 6, 6)), + Hmn(this.a), + !this.a && (this.a = new m_(tct, this, 6, 6)), + void jF(this.a, Yx(t, 14)) + ); + } + Vcn(this, n, t); + }), + (Fjn.zh = function () { + return ajn(), Nrt; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 3: + return void Sbn(this, null); + case 4: + return !this.b && (this.b = new AN(Zrt, this, 4, 7)), void Hmn(this.b); + case 5: + return !this.c && (this.c = new AN(Zrt, this, 5, 8)), void Hmn(this.c); + case 6: + return !this.a && (this.a = new m_(tct, this, 6, 6)), void Hmn(this.a); + } + A8(this, n); + }), + (Fjn.Ib = function () { + return bmn(this); + }), + EF(INn, "ElkEdgeImpl", 352), + Wfn( + 439, + 1985, + { + 105: 1, + 413: 1, + 202: 1, + 439: 1, + 94: 1, + 92: 1, + 90: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 114: 1, + 115: 1, + }, + co, + ), + (Fjn.Qg = function (n) { + return Yrn(this, n); + }), + (Fjn._g = function (n, t, e) { + switch (n) { + case 1: + return this.j; + case 2: + return this.k; + case 3: + return this.b; + case 4: + return this.c; + case 5: + return !this.a && (this.a = new XO(Qrt, this, 5)), this.a; + case 6: + return MG(this); + case 7: + return t ? Zen(this) : this.i; + case 8: + return t ? Jen(this) : this.f; + case 9: + return !this.g && (this.g = new AN(tct, this, 9, 10)), this.g; + case 10: + return !this.e && (this.e = new AN(tct, this, 10, 9)), this.e; + case 11: + return this.d; + } + return Mrn(this, n, t, e); + }), + (Fjn.hh = function (n, t, e) { + var i; + switch (t) { + case 6: + return this.Cb && (e = (i = this.Db >> 16) >= 0 ? Yrn(this, e) : this.Cb.ih(this, -1 - i, null, e)), $L(this, Yx(n, 79), e); + case 9: + return !this.g && (this.g = new AN(tct, this, 9, 10)), wnn(this.g, n, e); + case 10: + return !this.e && (this.e = new AN(tct, this, 10, 9)), wnn(this.e, n, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (ajn(), xrt), t), 66) + .Nj() + .Qj(this, dtn(this), t - vF((ajn(), xrt)), n, e); + }), + (Fjn.jh = function (n, t, e) { + switch (t) { + case 5: + return !this.a && (this.a = new XO(Qrt, this, 5)), Ten(this.a, n, e); + case 6: + return $L(this, null, e); + case 9: + return !this.g && (this.g = new AN(tct, this, 9, 10)), Ten(this.g, n, e); + case 10: + return !this.e && (this.e = new AN(tct, this, 10, 9)), Ten(this.e, n, e); + } + return fon(this, n, t, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 1: + return 0 != this.j; + case 2: + return 0 != this.k; + case 3: + return 0 != this.b; + case 4: + return 0 != this.c; + case 5: + return !!this.a && 0 != this.a.i; + case 6: + return !!MG(this); + case 7: + return !!this.i; + case 8: + return !!this.f; + case 9: + return !!this.g && 0 != this.g.i; + case 10: + return !!this.e && 0 != this.e.i; + case 11: + return null != this.d; + } + return Zz(this, n); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 1: + return void x1(this, ty(fL(t))); + case 2: + return void R1(this, ty(fL(t))); + case 3: + return void O1(this, ty(fL(t))); + case 4: + return void D1(this, ty(fL(t))); + case 5: + return ( + !this.a && (this.a = new XO(Qrt, this, 5)), + Hmn(this.a), + !this.a && (this.a = new XO(Qrt, this, 5)), + void jF(this.a, Yx(t, 14)) + ); + case 6: + return void Tbn(this, Yx(t, 79)); + case 7: + return void N0(this, Yx(t, 82)); + case 8: + return void L0(this, Yx(t, 82)); + case 9: + return ( + !this.g && (this.g = new AN(tct, this, 9, 10)), + Hmn(this.g), + !this.g && (this.g = new AN(tct, this, 9, 10)), + void jF(this.g, Yx(t, 14)) + ); + case 10: + return ( + !this.e && (this.e = new AN(tct, this, 10, 9)), + Hmn(this.e), + !this.e && (this.e = new AN(tct, this, 10, 9)), + void jF(this.e, Yx(t, 14)) + ); + case 11: + return void Y0(this, lL(t)); + } + J5(this, n, t); + }), + (Fjn.zh = function () { + return ajn(), xrt; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 1: + return void x1(this, 0); + case 2: + return void R1(this, 0); + case 3: + return void O1(this, 0); + case 4: + return void D1(this, 0); + case 5: + return !this.a && (this.a = new XO(Qrt, this, 5)), void Hmn(this.a); + case 6: + return void Tbn(this, null); + case 7: + return void N0(this, null); + case 8: + return void L0(this, null); + case 9: + return !this.g && (this.g = new AN(tct, this, 9, 10)), void Hmn(this.g); + case 10: + return !this.e && (this.e = new AN(tct, this, 10, 9)), void Hmn(this.e); + case 11: + return void Y0(this, null); + } + Q4(this, n); + }), + (Fjn.Ib = function () { + return Mfn(this); + }), + (Fjn.b = 0), + (Fjn.c = 0), + (Fjn.d = null), + (Fjn.j = 0), + (Fjn.k = 0), + EF(INn, "ElkEdgeSectionImpl", 439), + Wfn(150, 115, { + 105: 1, + 92: 1, + 90: 1, + 147: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 150: 1, + 114: 1, + 115: 1, + }), + (Fjn._g = function (n, t, e) { + return 0 == n + ? (!this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), this.Ab) + : RY(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n), t, e); + }), + (Fjn.hh = function (n, t, e) { + return 0 == t + ? (!this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), wnn(this.Ab, n, e)) + : Yx(CZ(Yx(H3(this, 16), 26) || this.zh(), t), 66) + .Nj() + .Qj(this, dtn(this), t - vF(this.zh()), n, e); + }), + (Fjn.jh = function (n, t, e) { + return 0 == t + ? (!this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), Ten(this.Ab, n, e)) + : Yx(CZ(Yx(H3(this, 16), 26) || this.zh(), t), 66) + .Nj() + .Rj(this, dtn(this), t - vF(this.zh()), n, e); + }), + (Fjn.lh = function (n) { + return 0 == n ? !!this.Ab && 0 != this.Ab.i : xX(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n)); + }), + (Fjn.oh = function (n) { + return jkn(this, n); + }), + (Fjn.sh = function (n, t) { + if (0 === n) + return ( + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + Hmn(this.Ab), + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + void jF(this.Ab, Yx(t, 14)) + ); + E7(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n), t); + }), + (Fjn.uh = function (n) { + wtn(this, 128, n); + }), + (Fjn.zh = function () { + return xjn(), Iat; + }), + (Fjn.Bh = function (n) { + if (0 === n) return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), void Hmn(this.Ab); + r9(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n)); + }), + (Fjn.Gh = function () { + this.Bb |= 1; + }), + (Fjn.Hh = function (n) { + return dpn(this, n); + }), + (Fjn.Bb = 0), + EF(PNn, "EModelElementImpl", 150), + Wfn( + 704, + 150, + { + 105: 1, + 92: 1, + 90: 1, + 471: 1, + 147: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 150: 1, + 114: 1, + 115: 1, + }, + xf, + ), + (Fjn.Ih = function (n, t) { + return Dyn(this, n, t); + }), + (Fjn.Jh = function (n) { + var t, e, i, r; + if (this.a != i1(n) || 0 != (256 & n.Bb)) throw hp(new Qm(NNn + n.zb + ANn)); + for (e = Iq(n); 0 != tW(e.a).i; ) { + if (frn((t = Yx(hyn(e, 0, CO((r = Yx(c1(tW(e.a), 0), 87).c), 88) ? Yx(r, 26) : (xjn(), Oat)), 26)))) + return Yx((i = i1(t).Nh().Jh(t)), 49).th(n), i; + e = Iq(t); + } + return "java.util.Map$Entry" == (null != n.D ? n.D : n.B) ? new rR(n) : new SD(n); + }), + (Fjn.Kh = function (n, t) { + return fjn(this, n, t); + }), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), this.Ab; + case 1: + return this.a; + } + return RY(this, n - vF((xjn(), Mat)), CZ(Yx(H3(this, 16), 26) || Mat, n), t, e); + }), + (Fjn.hh = function (n, t, e) { + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), wnn(this.Ab, n, e); + case 1: + return this.a && (e = Yx(this.a, 49).ih(this, 4, cct, e)), T8(this, Yx(n, 235), e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (xjn(), Mat), t), 66) + .Nj() + .Qj(this, dtn(this), t - vF((xjn(), Mat)), n, e); + }), + (Fjn.jh = function (n, t, e) { + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), Ten(this.Ab, n, e); + case 1: + return T8(this, null, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (xjn(), Mat), t), 66) + .Nj() + .Rj(this, dtn(this), t - vF((xjn(), Mat)), n, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return !!this.Ab && 0 != this.Ab.i; + case 1: + return !!this.a; + } + return xX(this, n - vF((xjn(), Mat)), CZ(Yx(H3(this, 16), 26) || Mat, n)); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 0: + return ( + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + Hmn(this.Ab), + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + void jF(this.Ab, Yx(t, 14)) + ); + case 1: + return void Uun(this, Yx(t, 235)); + } + E7(this, n - vF((xjn(), Mat)), CZ(Yx(H3(this, 16), 26) || Mat, n), t); + }), + (Fjn.zh = function () { + return xjn(), Mat; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), void Hmn(this.Ab); + case 1: + return void Uun(this, null); + } + r9(this, n - vF((xjn(), Mat)), CZ(Yx(H3(this, 16), 26) || Mat, n)); + }), + EF(PNn, "EFactoryImpl", 704), + Wfn( + DNn, + 704, + { + 105: 1, + 2014: 1, + 92: 1, + 90: 1, + 471: 1, + 147: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 150: 1, + 114: 1, + 115: 1, + }, + ao, + ), + (Fjn.Ih = function (n, t) { + switch (n.yj()) { + case 12: + return Yx(t, 146).tg(); + case 13: + return I7(t); + default: + throw hp(new Qm(ONn + n.ne() + ANn)); + } + }), + (Fjn.Jh = function (n) { + var t; + switch ((-1 == n.G && (n.G = (t = i1(n)) ? Ren(t.Mh(), n) : -1), n.G)) { + case 4: + return new uo(); + case 6: + return new xv(); + case 7: + return new Dv(); + case 8: + return new io(); + case 9: + return new ro(); + case 10: + return new co(); + case 11: + return new so(); + default: + throw hp(new Qm(NNn + n.zb + ANn)); + } + }), + (Fjn.Kh = function (n, t) { + switch (n.yj()) { + case 13: + case 12: + return null; + default: + throw hp(new Qm(ONn + n.ne() + ANn)); + } + }), + EF(INn, "ElkGraphFactoryImpl", DNn), + Wfn(438, 150, { + 105: 1, + 92: 1, + 90: 1, + 147: 1, + 191: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 150: 1, + 114: 1, + 115: 1, + }), + (Fjn.Wg = function () { + var n; + return null == (n = Wq(svn(Yx(H3(this, 16), 26) || this.zh()))) ? (kT(), kT(), Vat) : new B$(this, n); + }), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), this.Ab; + case 1: + return this.ne(); + } + return RY(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n), t, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return !!this.Ab && 0 != this.Ab.i; + case 1: + return null != this.zb; + } + return xX(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n)); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 0: + return ( + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + Hmn(this.Ab), + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + void jF(this.Ab, Yx(t, 14)) + ); + case 1: + return void this.Lh(lL(t)); + } + E7(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n), t); + }), + (Fjn.zh = function () { + return xjn(), Cat; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), void Hmn(this.Ab); + case 1: + return void this.Lh(null); + } + r9(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n)); + }), + (Fjn.ne = function () { + return this.zb; + }), + (Fjn.Lh = function (n) { + E2(this, n); + }), + (Fjn.Ib = function () { + return B8(this); + }), + (Fjn.zb = null), + EF(PNn, "ENamedElementImpl", 438), + Wfn( + 179, + 438, + { + 105: 1, + 92: 1, + 90: 1, + 147: 1, + 191: 1, + 56: 1, + 235: 1, + 108: 1, + 49: 1, + 97: 1, + 150: 1, + 179: 1, + 114: 1, + 115: 1, + 675: 1, + }, + Sq, + ), + (Fjn.Qg = function (n) { + return ecn(this, n); + }), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), this.Ab; + case 1: + return this.zb; + case 2: + return this.yb; + case 3: + return this.xb; + case 4: + return this.sb; + case 5: + return !this.rb && (this.rb = new d_(this, iat, this)), this.rb; + case 6: + return !this.vb && (this.vb = new EN(cct, this, 6, 7)), this.vb; + case 7: + return t ? (this.Db >> 16 == 7 ? Yx(this.Cb, 235) : null) : SG(this); + } + return RY(this, n - vF((xjn(), Lat)), CZ(Yx(H3(this, 16), 26) || Lat, n), t, e); + }), + (Fjn.hh = function (n, t, e) { + var i; + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), wnn(this.Ab, n, e); + case 4: + return this.sb && (e = Yx(this.sb, 49).ih(this, 1, ict, e)), H8(this, Yx(n, 471), e); + case 5: + return !this.rb && (this.rb = new d_(this, iat, this)), wnn(this.rb, n, e); + case 6: + return !this.vb && (this.vb = new EN(cct, this, 6, 7)), wnn(this.vb, n, e); + case 7: + return this.Cb && (e = (i = this.Db >> 16) >= 0 ? ecn(this, e) : this.Cb.ih(this, -1 - i, null, e)), opn(this, n, 7, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (xjn(), Lat), t), 66) + .Nj() + .Qj(this, dtn(this), t - vF((xjn(), Lat)), n, e); + }), + (Fjn.jh = function (n, t, e) { + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), Ten(this.Ab, n, e); + case 4: + return H8(this, null, e); + case 5: + return !this.rb && (this.rb = new d_(this, iat, this)), Ten(this.rb, n, e); + case 6: + return !this.vb && (this.vb = new EN(cct, this, 6, 7)), Ten(this.vb, n, e); + case 7: + return opn(this, null, 7, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (xjn(), Lat), t), 66) + .Nj() + .Rj(this, dtn(this), t - vF((xjn(), Lat)), n, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return !!this.Ab && 0 != this.Ab.i; + case 1: + return null != this.zb; + case 2: + return null != this.yb; + case 3: + return null != this.xb; + case 4: + return !!this.sb; + case 5: + return !!this.rb && 0 != this.rb.i; + case 6: + return !!this.vb && 0 != this.vb.i; + case 7: + return !!SG(this); + } + return xX(this, n - vF((xjn(), Lat)), CZ(Yx(H3(this, 16), 26) || Lat, n)); + }), + (Fjn.oh = function (n) { + return ( + (function (n, t) { + var e, i, r, c, a, u; + if (!n.tb) { + for (!n.rb && (n.rb = new d_(n, iat, n)), u = new kE((c = n.rb).i), r = new UO(c); r.e != r.i.gc(); ) + (i = Yx(hen(r), 138)), + (e = Yx(null == (a = i.ne()) ? Ysn(u.f, null, i) : r7(u.g, a, i), 138)) && + (null == a ? Ysn(u.f, null, e) : r7(u.g, a, e)); + n.tb = u; + } + return Yx(aG(n.tb, t), 138); + })(this, n) || jkn(this, n) + ); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 0: + return ( + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + Hmn(this.Ab), + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + void jF(this.Ab, Yx(t, 14)) + ); + case 1: + return void E2(this, lL(t)); + case 2: + return void M2(this, lL(t)); + case 3: + return void T2(this, lL(t)); + case 4: + return void lon(this, Yx(t, 471)); + case 5: + return ( + !this.rb && (this.rb = new d_(this, iat, this)), + Hmn(this.rb), + !this.rb && (this.rb = new d_(this, iat, this)), + void jF(this.rb, Yx(t, 14)) + ); + case 6: + return ( + !this.vb && (this.vb = new EN(cct, this, 6, 7)), + Hmn(this.vb), + !this.vb && (this.vb = new EN(cct, this, 6, 7)), + void jF(this.vb, Yx(t, 14)) + ); + } + E7(this, n - vF((xjn(), Lat)), CZ(Yx(H3(this, 16), 26) || Lat, n), t); + }), + (Fjn.vh = function (n) { + var t, e; + if (n && this.rb) for (e = new UO(this.rb); e.e != e.i.gc(); ) CO((t = hen(e)), 351) && (Yx(t, 351).w = null); + wtn(this, 64, n); + }), + (Fjn.zh = function () { + return xjn(), Lat; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), void Hmn(this.Ab); + case 1: + return void E2(this, null); + case 2: + return void M2(this, null); + case 3: + return void T2(this, null); + case 4: + return void lon(this, null); + case 5: + return !this.rb && (this.rb = new d_(this, iat, this)), void Hmn(this.rb); + case 6: + return !this.vb && (this.vb = new EN(cct, this, 6, 7)), void Hmn(this.vb); + } + r9(this, n - vF((xjn(), Lat)), CZ(Yx(H3(this, 16), 26) || Lat, n)); + }), + (Fjn.Gh = function () { + Srn(this); + }), + (Fjn.Mh = function () { + return !this.rb && (this.rb = new d_(this, iat, this)), this.rb; + }), + (Fjn.Nh = function () { + return this.sb; + }), + (Fjn.Oh = function () { + return this.ub; + }), + (Fjn.Ph = function () { + return this.xb; + }), + (Fjn.Qh = function () { + return this.yb; + }), + (Fjn.Rh = function (n) { + this.ub = n; + }), + (Fjn.Ib = function () { + var n; + return 0 != (64 & this.Db) + ? B8(this) + : (((n = new MA(B8(this))).a += " (nsURI: "), pI(n, this.yb), (n.a += ", nsPrefix: "), pI(n, this.xb), (n.a += ")"), n.a); + }), + (Fjn.xb = null), + (Fjn.yb = null), + EF(PNn, "EPackageImpl", 179), + Wfn( + 555, + 179, + { + 105: 1, + 2016: 1, + 555: 1, + 92: 1, + 90: 1, + 147: 1, + 191: 1, + 56: 1, + 235: 1, + 108: 1, + 49: 1, + 97: 1, + 150: 1, + 179: 1, + 114: 1, + 115: 1, + 675: 1, + }, + Gfn, + ), + (Fjn.q = !1), + (Fjn.r = !1); + var sct = !1; + EF(INn, "ElkGraphPackageImpl", 555), + Wfn( + 354, + 724, + { + 105: 1, + 413: 1, + 160: 1, + 137: 1, + 470: 1, + 354: 1, + 94: 1, + 92: 1, + 90: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 114: 1, + 115: 1, + }, + uo, + ), + (Fjn.Qg = function (n) { + return Jrn(this, n); + }), + (Fjn._g = function (n, t, e) { + switch (n) { + case 7: + return PG(this); + case 8: + return this.a; + } + return S7(this, n, t, e); + }), + (Fjn.hh = function (n, t, e) { + var i; + return 7 === t + ? (this.Cb && (e = (i = this.Db >> 16) >= 0 ? Jrn(this, e) : this.Cb.ih(this, -1 - i, null, e)), kK(this, Yx(n, 160), e)) + : sun(this, n, t, e); + }), + (Fjn.jh = function (n, t, e) { + return 7 == t ? kK(this, null, e) : d4(this, n, t, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 7: + return !!PG(this); + case 8: + return !_N("", this.a); + } + return z7(this, n); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 7: + return void Xbn(this, Yx(t, 160)); + case 8: + return void x0(this, lL(t)); + } + Qcn(this, n, t); + }), + (Fjn.zh = function () { + return ajn(), Rrt; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 7: + return void Xbn(this, null); + case 8: + return void x0(this, ""); + } + rnn(this, n); + }), + (Fjn.Ib = function () { + return Qon(this); + }), + (Fjn.a = ""), + EF(INn, "ElkLabelImpl", 354), + Wfn( + 239, + 725, + { + 105: 1, + 413: 1, + 82: 1, + 160: 1, + 33: 1, + 470: 1, + 239: 1, + 94: 1, + 92: 1, + 90: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 114: 1, + 115: 1, + }, + xv, + ), + (Fjn.Qg = function (n) { + return ocn(this, n); + }), + (Fjn._g = function (n, t, e) { + switch (n) { + case 9: + return !this.c && (this.c = new m_(oct, this, 9, 9)), this.c; + case 10: + return !this.a && (this.a = new m_(uct, this, 10, 11)), this.a; + case 11: + return IG(this); + case 12: + return !this.b && (this.b = new m_(nct, this, 12, 3)), this.b; + case 13: + return TA(), !this.a && (this.a = new m_(uct, this, 10, 11)), this.a.i > 0; + } + return bin(this, n, t, e); + }), + (Fjn.hh = function (n, t, e) { + var i; + switch (t) { + case 9: + return !this.c && (this.c = new m_(oct, this, 9, 9)), wnn(this.c, n, e); + case 10: + return !this.a && (this.a = new m_(uct, this, 10, 11)), wnn(this.a, n, e); + case 11: + return this.Cb && (e = (i = this.Db >> 16) >= 0 ? ocn(this, e) : this.Cb.ih(this, -1 - i, null, e)), vN(this, Yx(n, 33), e); + case 12: + return !this.b && (this.b = new m_(nct, this, 12, 3)), wnn(this.b, n, e); + } + return Lcn(this, n, t, e); + }), + (Fjn.jh = function (n, t, e) { + switch (t) { + case 9: + return !this.c && (this.c = new m_(oct, this, 9, 9)), Ten(this.c, n, e); + case 10: + return !this.a && (this.a = new m_(uct, this, 10, 11)), Ten(this.a, n, e); + case 11: + return vN(this, null, e); + case 12: + return !this.b && (this.b = new m_(nct, this, 12, 3)), Ten(this.b, n, e); + } + return Ncn(this, n, t, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 9: + return !!this.c && 0 != this.c.i; + case 10: + return !!this.a && 0 != this.a.i; + case 11: + return !!IG(this); + case 12: + return !!this.b && 0 != this.b.i; + case 13: + return !this.a && (this.a = new m_(uct, this, 10, 11)), this.a.i > 0; + } + return B5(this, n); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 9: + return ( + !this.c && (this.c = new m_(oct, this, 9, 9)), + Hmn(this.c), + !this.c && (this.c = new m_(oct, this, 9, 9)), + void jF(this.c, Yx(t, 14)) + ); + case 10: + return ( + !this.a && (this.a = new m_(uct, this, 10, 11)), + Hmn(this.a), + !this.a && (this.a = new m_(uct, this, 10, 11)), + void jF(this.a, Yx(t, 14)) + ); + case 11: + return void Dbn(this, Yx(t, 33)); + case 12: + return ( + !this.b && (this.b = new m_(nct, this, 12, 3)), + Hmn(this.b), + !this.b && (this.b = new m_(nct, this, 12, 3)), + void jF(this.b, Yx(t, 14)) + ); + } + oln(this, n, t); + }), + (Fjn.zh = function () { + return ajn(), Krt; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 9: + return !this.c && (this.c = new m_(oct, this, 9, 9)), void Hmn(this.c); + case 10: + return !this.a && (this.a = new m_(uct, this, 10, 11)), void Hmn(this.a); + case 11: + return void Dbn(this, null); + case 12: + return !this.b && (this.b = new m_(nct, this, 12, 3)), void Hmn(this.b); + } + yen(this, n); + }), + (Fjn.Ib = function () { + return ugn(this); + }), + EF(INn, "ElkNodeImpl", 239), + Wfn( + 186, + 725, + { + 105: 1, + 413: 1, + 82: 1, + 160: 1, + 118: 1, + 470: 1, + 186: 1, + 94: 1, + 92: 1, + 90: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 114: 1, + 115: 1, + }, + Dv, + ), + (Fjn.Qg = function (n) { + return Zrn(this, n); + }), + (Fjn._g = function (n, t, e) { + return 9 == n ? TG(this) : bin(this, n, t, e); + }), + (Fjn.hh = function (n, t, e) { + var i; + return 9 === t + ? (this.Cb && (e = (i = this.Db >> 16) >= 0 ? Zrn(this, e) : this.Cb.ih(this, -1 - i, null, e)), LL(this, Yx(n, 33), e)) + : Lcn(this, n, t, e); + }), + (Fjn.jh = function (n, t, e) { + return 9 == t ? LL(this, null, e) : Ncn(this, n, t, e); + }), + (Fjn.lh = function (n) { + return 9 == n ? !!TG(this) : B5(this, n); + }), + (Fjn.sh = function (n, t) { + 9 !== n ? oln(this, n, t) : Mbn(this, Yx(t, 33)); + }), + (Fjn.zh = function () { + return ajn(), _rt; + }), + (Fjn.Bh = function (n) { + 9 !== n ? yen(this, n) : Mbn(this, null); + }), + (Fjn.Ib = function () { + return ogn(this); + }), + EF(INn, "ElkPortImpl", 186); + var hct = aR(exn, "BasicEMap/Entry"); + Wfn( + 1092, + 115, + { + 105: 1, + 42: 1, + 92: 1, + 90: 1, + 133: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 114: 1, + 115: 1, + }, + so, + ), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.cd = function () { + return this.b; + }), + (Fjn.Hb = function () { + return _A(this); + }), + (Fjn.Uh = function (n) { + D0(this, Yx(n, 146)); + }), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return this.b; + case 1: + return this.c; + } + return $en(this, n, t, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return !!this.b; + case 1: + return null != this.c; + } + return uen(this, n); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 0: + return void D0(this, Yx(t, 146)); + case 1: + return void _0(this, t); + } + Vsn(this, n, t); + }), + (Fjn.zh = function () { + return ajn(), Frt; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 0: + return void D0(this, null); + case 1: + return void _0(this, null); + } + usn(this, n); + }), + (Fjn.Sh = function () { + var n; + return -1 == this.a && ((n = this.b), (this.a = n ? W5(n) : 0)), this.a; + }), + (Fjn.dd = function () { + return this.c; + }), + (Fjn.Th = function (n) { + this.a = n; + }), + (Fjn.ed = function (n) { + var t; + return (t = this.c), _0(this, n), t; + }), + (Fjn.Ib = function () { + var n; + return 0 != (64 & this.Db) ? Kln(this) : (yI(yI(yI((n = new Ay()), this.b ? this.b.tg() : aEn), pIn), xA(this.c)), n.a); + }), + (Fjn.a = -1), + (Fjn.c = null); + var fct, + lct, + bct, + wct, + dct, + gct, + pct, + vct, + mct = EF(INn, "ElkPropertyToValueMapEntryImpl", 1092); + Wfn(984, 1, {}, lo), + EF(cxn, "JsonAdapter", 984), + Wfn(210, 60, eTn, hy), + EF(cxn, "JsonImportException", 210), + Wfn(857, 1, {}, icn), + EF(cxn, "JsonImporter", 857), + Wfn(891, 1, {}, kP), + EF(cxn, "JsonImporter/lambda$0$Type", 891), + Wfn(892, 1, {}, jP), + EF(cxn, "JsonImporter/lambda$1$Type", 892), + Wfn(900, 1, {}, tg), + EF(cxn, "JsonImporter/lambda$10$Type", 900), + Wfn(902, 1, {}, EP), + EF(cxn, "JsonImporter/lambda$11$Type", 902), + Wfn(903, 1, {}, TP), + EF(cxn, "JsonImporter/lambda$12$Type", 903), + Wfn(909, 1, {}, $H), + EF(cxn, "JsonImporter/lambda$13$Type", 909), + Wfn(908, 1, {}, AH), + EF(cxn, "JsonImporter/lambda$14$Type", 908), + Wfn(904, 1, {}, MP), + EF(cxn, "JsonImporter/lambda$15$Type", 904), + Wfn(905, 1, {}, SP), + EF(cxn, "JsonImporter/lambda$16$Type", 905), + Wfn(906, 1, {}, PP), + EF(cxn, "JsonImporter/lambda$17$Type", 906), + Wfn(907, 1, {}, IP), + EF(cxn, "JsonImporter/lambda$18$Type", 907), + Wfn(912, 1, {}, eg), + EF(cxn, "JsonImporter/lambda$19$Type", 912), + Wfn(893, 1, {}, ig), + EF(cxn, "JsonImporter/lambda$2$Type", 893), + Wfn(910, 1, {}, rg), + EF(cxn, "JsonImporter/lambda$20$Type", 910), + Wfn(911, 1, {}, cg), + EF(cxn, "JsonImporter/lambda$21$Type", 911), + Wfn(915, 1, {}, ag), + EF(cxn, "JsonImporter/lambda$22$Type", 915), + Wfn(913, 1, {}, ug), + EF(cxn, "JsonImporter/lambda$23$Type", 913), + Wfn(914, 1, {}, og), + EF(cxn, "JsonImporter/lambda$24$Type", 914), + Wfn(917, 1, {}, sg), + EF(cxn, "JsonImporter/lambda$25$Type", 917), + Wfn(916, 1, {}, hg), + EF(cxn, "JsonImporter/lambda$26$Type", 916), + Wfn(918, 1, PEn, CP), + (Fjn.td = function (n) { + !(function (n, t, e) { + var i, r; + (r = null), (i = jG(n, e)) && (r = osn(i)), Ftn(t, e, r); + })(this.b, this.a, lL(n)); + }), + EF(cxn, "JsonImporter/lambda$27$Type", 918), + Wfn(919, 1, PEn, OP), + (Fjn.td = function (n) { + !(function (n, t, e) { + var i, r; + (r = null), (i = jG(n, e)) && (r = osn(i)), Ftn(t, e, r); + })(this.b, this.a, lL(n)); + }), + EF(cxn, "JsonImporter/lambda$28$Type", 919), + Wfn(920, 1, {}, AP), + EF(cxn, "JsonImporter/lambda$29$Type", 920), + Wfn(896, 1, {}, fg), + EF(cxn, "JsonImporter/lambda$3$Type", 896), + Wfn(921, 1, {}, $P), + EF(cxn, "JsonImporter/lambda$30$Type", 921), + Wfn(922, 1, {}, lg), + EF(cxn, "JsonImporter/lambda$31$Type", 922), + Wfn(923, 1, {}, bg), + EF(cxn, "JsonImporter/lambda$32$Type", 923), + Wfn(924, 1, {}, wg), + EF(cxn, "JsonImporter/lambda$33$Type", 924), + Wfn(925, 1, {}, dg), + EF(cxn, "JsonImporter/lambda$34$Type", 925), + Wfn(859, 1, {}, gg), + EF(cxn, "JsonImporter/lambda$35$Type", 859), + Wfn(929, 1, {}, Rx), + EF(cxn, "JsonImporter/lambda$36$Type", 929), + Wfn(926, 1, PEn, pg), + (Fjn.td = function (n) { + !(function (n, t) { + var e; + nq((e = new Om()), "x", t.a), nq(e, "y", t.b), nB(n, e); + })(this.a, Yx(n, 469)); + }), + EF(cxn, "JsonImporter/lambda$37$Type", 926), + Wfn(927, 1, PEn, FP), + (Fjn.td = function (n) { + !(function (n, t, e) { + Ucn(t, ksn(n, e)); + })(this.a, this.b, Yx(n, 202)); + }), + EF(cxn, "JsonImporter/lambda$38$Type", 927), + Wfn(928, 1, PEn, BP), + (Fjn.td = function (n) { + !(function (n, t, e) { + Ucn(t, ksn(n, e)); + })(this.a, this.b, Yx(n, 202)); + }), + EF(cxn, "JsonImporter/lambda$39$Type", 928), + Wfn(894, 1, {}, vg), + EF(cxn, "JsonImporter/lambda$4$Type", 894), + Wfn(930, 1, PEn, mg), + (Fjn.td = function (n) { + !(function (n, t) { + var e; + nq((e = new Om()), "x", t.a), nq(e, "y", t.b), nB(n, e); + })(this.a, Yx(n, 8)); + }), + EF(cxn, "JsonImporter/lambda$40$Type", 930), + Wfn(895, 1, {}, yg), + EF(cxn, "JsonImporter/lambda$5$Type", 895), + Wfn(899, 1, {}, kg), + EF(cxn, "JsonImporter/lambda$6$Type", 899), + Wfn(897, 1, {}, jg), + EF(cxn, "JsonImporter/lambda$7$Type", 897), + Wfn(898, 1, {}, Eg), + EF(cxn, "JsonImporter/lambda$8$Type", 898), + Wfn(901, 1, {}, Tg), + EF(cxn, "JsonImporter/lambda$9$Type", 901), + Wfn(948, 1, PEn, Mg), + (Fjn.td = function (n) { + nB(this.a, new zF(lL(n))); + }), + EF(cxn, "JsonMetaDataConverter/lambda$0$Type", 948), + Wfn(949, 1, PEn, Sg), + (Fjn.td = function (n) { + !(function (n, t) { + nB(n, new zF(null != t.f ? t.f : "" + t.g)); + })(this.a, Yx(n, 237)); + }), + EF(cxn, "JsonMetaDataConverter/lambda$1$Type", 949), + Wfn(950, 1, PEn, Pg), + (Fjn.td = function (n) { + !(function (n, t) { + null != t.c && nB(n, new zF(t.c)); + })(this.a, Yx(n, 149)); + }), + EF(cxn, "JsonMetaDataConverter/lambda$2$Type", 950), + Wfn(951, 1, PEn, Ig), + (Fjn.td = function (n) { + !(function (n, t) { + nB(n, new zF(null != t.f ? t.f : "" + t.g)); + })(this.a, Yx(n, 175)); + }), + EF(cxn, "JsonMetaDataConverter/lambda$3$Type", 951), + Wfn(237, 22, { 3: 1, 35: 1, 22: 1, 237: 1 }, _P); + var yct, + kct = X1( + GSn, + "GraphFeature", + 237, + u_n, + function () { + return zfn(), x4(Gy(kct, 1), XEn, 237, 0, [vct, dct, gct, wct, pct, lct, fct, bct]); + }, + function (n) { + return zfn(), rZ((m3(), yct), n); + }, + ); + Wfn(13, 1, { 35: 1, 146: 1 }, Og, _L, FI, DC), + (Fjn.wd = function (n) { + return (function (n, t) { + return FV(n.b, t.tg()); + })(this, Yx(n, 146)); + }), + (Fjn.Fb = function (n) { + return Oq(this, n); + }), + (Fjn.wg = function () { + return oen(this); + }), + (Fjn.tg = function () { + return this.b; + }), + (Fjn.Hb = function () { + return Xen(this.b); + }), + (Fjn.Ib = function () { + return this.b; + }), + EF(GSn, "Property", 13), + Wfn(818, 1, FMn, Cg), + (Fjn.ue = function (n, t) { + return (function (n, t, e) { + var i, r; + return ( + (i = Yx(t.We(n.a), 35)), (r = Yx(e.We(n.a), 35)), null != i && null != r ? u3(i, r) : null != i ? -1 : null != r ? 1 : 0 + ); + })(this, Yx(n, 94), Yx(t, 94)); + }), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.ve = function () { + return new Eb(this); + }), + EF(GSn, "PropertyHolderComparator", 818), + Wfn(695, 1, fEn, $g), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Pb = function () { + return (function (n) { + var t; + if (!n.a) throw hp(new WB()); + return (t = n.a), (n.a = IG(n.a)), t; + })(this); + }), + (Fjn.Qb = function () { + Bk(); + }), + (Fjn.Ob = function () { + return !!this.a; + }), + EF(yxn, "ElkGraphUtil/AncestorIterator", 695); + var jct = aR(exn, "EList"); + Wfn(67, 52, { 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 67: 1, 58: 1 }), + (Fjn.Vc = function (n, t) { + y9(this, n, t); + }), + (Fjn.Fc = function (n) { + return fY(this, n); + }), + (Fjn.Wc = function (n, t) { + return f5(this, n, t); + }), + (Fjn.Gc = function (n) { + return jF(this, n); + }), + (Fjn.Zh = function () { + return new u$(this); + }), + (Fjn.$h = function () { + return new o$(this); + }), + (Fjn._h = function (n) { + return b0(this, n); + }), + (Fjn.ai = function () { + return !0; + }), + (Fjn.bi = function (n, t) {}), + (Fjn.ci = function () {}), + (Fjn.di = function (n, t) { + XQ(this, n, t); + }), + (Fjn.ei = function (n, t, e) {}), + (Fjn.fi = function (n, t) {}), + (Fjn.gi = function (n, t, e) {}), + (Fjn.Fb = function (n) { + return Pdn(this, n); + }), + (Fjn.Hb = function () { + return L4(this); + }), + (Fjn.hi = function () { + return !1; + }), + (Fjn.Kc = function () { + return new UO(this); + }), + (Fjn.Yc = function () { + return new a$(this); + }), + (Fjn.Zc = function (n) { + var t; + if (((t = this.gc()), n < 0 || n > t)) throw hp(new jN(n, t)); + return new Z_(this, n); + }), + (Fjn.ji = function (n, t) { + this.ii(n, this.Xc(t)); + }), + (Fjn.Mc = function (n) { + return qJ(this, n); + }), + (Fjn.li = function (n, t) { + return t; + }), + (Fjn._c = function (n, t) { + return Ken(this, n, t); + }), + (Fjn.Ib = function () { + return D7(this); + }), + (Fjn.ni = function () { + return !0; + }), + (Fjn.oi = function (n, t) { + return k6(this, t); + }), + EF(exn, "AbstractEList", 67), + Wfn(63, 67, Mxn, go, FZ, t3), + (Fjn.Vh = function (n, t) { + return hun(this, n, t); + }), + (Fjn.Wh = function (n) { + return $in(this, n); + }), + (Fjn.Xh = function (n, t) { + X8(this, n, t); + }), + (Fjn.Yh = function (n) { + NV(this, n); + }), + (Fjn.pi = function (n) { + return AY(this, n); + }), + (Fjn.$b = function () { + xV(this); + }), + (Fjn.Hc = function (n) { + return Fcn(this, n); + }), + (Fjn.Xb = function (n) { + return c1(this, n); + }), + (Fjn.qi = function (n) { + var t, e, i; + ++this.j, + n > (e = null == this.g ? 0 : this.g.length) && + ((i = this.g), + (t = e + ((e / 2) | 0) + 4) < n && (t = n), + (this.g = this.ri(t)), + null != i && smn(i, 0, this.g, 0, this.i)); + }), + (Fjn.Xc = function (n) { + return Brn(this, n); + }), + (Fjn.dc = function () { + return 0 == this.i; + }), + (Fjn.ii = function (n, t) { + return Vhn(this, n, t); + }), + (Fjn.ri = function (n) { + return VQ(UKn, iEn, 1, n, 5, 1); + }), + (Fjn.ki = function (n) { + return this.g[n]; + }), + (Fjn.$c = function (n) { + return Orn(this, n); + }), + (Fjn.mi = function (n, t) { + return HJ(this, n, t); + }), + (Fjn.gc = function () { + return this.i; + }), + (Fjn.Pc = function () { + return KX(this); + }), + (Fjn.Qc = function (n) { + return bnn(this, n); + }), + (Fjn.i = 0); + var Ect = EF(exn, "BasicEList", 63), + Tct = aR(exn, "TreeIterator"); + Wfn(694, 63, Sxn), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return null != this.g || this.c ? null == this.g || (0 != this.i && Yx(this.g[this.i - 1], 47).Ob()) : AG(this); + }), + (Fjn.Pb = function () { + return abn(this); + }), + (Fjn.Qb = function () { + if (!this.e) throw hp(new Ym("There is no valid object to remove.")); + this.e.Qb(); + }), + (Fjn.c = !1), + EF(exn, "AbstractTreeIterator", 694), + Wfn(685, 694, Sxn, SC), + (Fjn.si = function (n) { + var t; + return CO((t = Yx(n, 56).Wg().Kc()), 279) && Yx(t, 279).Nk(new bo()), t; + }), + EF(yxn, "ElkGraphUtil/PropertiesSkippingTreeIterator", 685), + Wfn(952, 1, {}, bo), + EF(yxn, "ElkGraphUtil/PropertiesSkippingTreeIterator/1", 952); + var Mct, + Sct, + Pct, + Ict = EF(yxn, "ElkReflect", null); + Wfn(889, 1, vLn, wo), + (Fjn.vg = function (n) { + return ( + _G(), + (function (n) { + var t; + return (t = Yx(rF(n.b, n.b.length), 9)), new cx(n.a, t, n.c); + })(Yx(n, 174)) + ); + }), + EF(yxn, "ElkReflect/lambda$0$Type", 889), + aR(exn, "ResourceLocator"), + Wfn(1051, 1, {}), + EF(exn, "DelegatingResourceLocator", 1051), + Wfn(1052, 1051, {}), + EF("org.eclipse.emf.common", "EMFPlugin", 1052); + var Cct, + Oct = aR(bDn, "Adapter"), + Act = aR(bDn, "Notification"); + Wfn(1153, 1, wDn), + (Fjn.ti = function () { + return this.d; + }), + (Fjn.ui = function (n) {}), + (Fjn.vi = function (n) { + this.d = n; + }), + (Fjn.wi = function (n) { + this.d == n && (this.d = null); + }), + (Fjn.d = null), + EF(vNn, "AdapterImpl", 1153), + Wfn(1995, 67, dDn), + (Fjn.Vh = function (n, t) { + return Q7(this, n, t); + }), + (Fjn.Wh = function (n) { + var t, e, i; + if ((++this.j, n.dc())) return !1; + for (t = this.Vi(), i = n.Kc(); i.Ob(); ) (e = i.Pb()), this.Ii(this.oi(t, e)), ++t; + return !0; + }), + (Fjn.Xh = function (n, t) { + xL(this, n, t); + }), + (Fjn.Yh = function (n) { + eB(this, n); + }), + (Fjn.Gi = function () { + return this.Ji(); + }), + (Fjn.$b = function () { + NL(this, this.Vi(), this.Wi()); + }), + (Fjn.Hc = function (n) { + return this.Li(n); + }), + (Fjn.Ic = function (n) { + return this.Mi(n); + }), + (Fjn.Hi = function (n, t) { + this.Si().jm(); + }), + (Fjn.Ii = function (n) { + this.Si().jm(); + }), + (Fjn.Ji = function () { + return this.Si(); + }), + (Fjn.Ki = function () { + this.Si().jm(); + }), + (Fjn.Li = function (n) { + return this.Si().jm(); + }), + (Fjn.Mi = function (n) { + return this.Si().jm(); + }), + (Fjn.Ni = function (n) { + return this.Si().jm(); + }), + (Fjn.Oi = function (n) { + return this.Si().jm(); + }), + (Fjn.Pi = function () { + return this.Si().jm(); + }), + (Fjn.Qi = function (n) { + return this.Si().jm(); + }), + (Fjn.Ri = function () { + return this.Si().jm(); + }), + (Fjn.Ti = function (n) { + return this.Si().jm(); + }), + (Fjn.Ui = function (n, t) { + return this.Si().jm(); + }), + (Fjn.Vi = function () { + return this.Si().jm(); + }), + (Fjn.Wi = function () { + return this.Si().jm(); + }), + (Fjn.Xi = function (n) { + return this.Si().jm(); + }), + (Fjn.Yi = function () { + return this.Si().jm(); + }), + (Fjn.Fb = function (n) { + return this.Ni(n); + }), + (Fjn.Xb = function (n) { + return this.li(n, this.Oi(n)); + }), + (Fjn.Hb = function () { + return this.Pi(); + }), + (Fjn.Xc = function (n) { + return this.Qi(n); + }), + (Fjn.dc = function () { + return this.Ri(); + }), + (Fjn.ii = function (n, t) { + return Hun(this, n, t); + }), + (Fjn.ki = function (n) { + return this.Oi(n); + }), + (Fjn.$c = function (n) { + return uR(this, n); + }), + (Fjn.Mc = function (n) { + var t; + return (t = this.Xc(n)) >= 0 && (this.$c(t), !0); + }), + (Fjn.mi = function (n, t) { + return this.Ui(n, this.oi(n, t)); + }), + (Fjn.gc = function () { + return this.Vi(); + }), + (Fjn.Pc = function () { + return this.Wi(); + }), + (Fjn.Qc = function (n) { + return this.Xi(n); + }), + (Fjn.Ib = function () { + return this.Yi(); + }), + EF(exn, "DelegatingEList", 1995), + Wfn(1996, 1995, dDn), + (Fjn.Vh = function (n, t) { + return Dpn(this, n, t); + }), + (Fjn.Wh = function (n) { + return this.Vh(this.Vi(), n); + }), + (Fjn.Xh = function (n, t) { + _fn(this, n, t); + }), + (Fjn.Yh = function (n) { + yfn(this, n); + }), + (Fjn.ai = function () { + return !this.bj(); + }), + (Fjn.$b = function () { + Wmn(this); + }), + (Fjn.Zi = function (n, t, e, i, r) { + return new _q(this, n, t, e, i, r); + }), + (Fjn.$i = function (n) { + K3(this.Ai(), n); + }), + (Fjn._i = function () { + return null; + }), + (Fjn.aj = function () { + return -1; + }), + (Fjn.Ai = function () { + return null; + }), + (Fjn.bj = function () { + return !1; + }), + (Fjn.cj = function (n, t) { + return t; + }), + (Fjn.dj = function (n, t) { + return t; + }), + (Fjn.ej = function () { + return !1; + }), + (Fjn.fj = function () { + return !this.Ri(); + }), + (Fjn.ii = function (n, t) { + var e, i; + return this.ej() ? ((i = this.fj()), (e = Hun(this, n, t)), this.$i(this.Zi(7, d9(t), e, n, i)), e) : Hun(this, n, t); + }), + (Fjn.$c = function (n) { + var t, e, i, r; + return this.ej() + ? ((e = null), + (i = this.fj()), + (t = this.Zi(4, (r = uR(this, n)), null, n, i)), + this.bj() && r ? ((e = this.dj(r, e)) ? (e.Ei(t), e.Fi()) : this.$i(t)) : e ? (e.Ei(t), e.Fi()) : this.$i(t), + r) + : ((r = uR(this, n)), this.bj() && r && (e = this.dj(r, null)) && e.Fi(), r); + }), + (Fjn.mi = function (n, t) { + return Rpn(this, n, t); + }), + EF(vNn, "DelegatingNotifyingListImpl", 1996), + Wfn(143, 1, gDn), + (Fjn.Ei = function (n) { + return Pan(this, n); + }), + (Fjn.Fi = function () { + vJ(this); + }), + (Fjn.xi = function () { + return this.d; + }), + (Fjn._i = function () { + return null; + }), + (Fjn.gj = function () { + return null; + }), + (Fjn.yi = function (n) { + return -1; + }), + (Fjn.zi = function () { + return Rwn(this); + }), + (Fjn.Ai = function () { + return null; + }), + (Fjn.Bi = function () { + return Kwn(this); + }), + (Fjn.Ci = function () { + return this.o < 0 ? (this.o < -2 ? -2 - this.o - 1 : -1) : this.o; + }), + (Fjn.hj = function () { + return !1; + }), + (Fjn.Di = function (n) { + var t, e, i, r, c, a, u, o; + switch (this.d) { + case 1: + case 2: + switch (n.xi()) { + case 1: + case 2: + if (iI(n.Ai()) === iI(this.Ai()) && this.yi(null) == n.yi(null)) + return (this.g = n.zi()), 1 == n.xi() && (this.d = 1), !0; + } + case 4: + if (4 === n.xi() && iI(n.Ai()) === iI(this.Ai()) && this.yi(null) == n.yi(null)) + return ( + (a = syn(this)), + (c = this.o < 0 ? (this.o < -2 ? -2 - this.o - 1 : -1) : this.o), + (i = n.Ci()), + (this.d = 6), + (o = new FZ(2)), + c <= i + ? (fY(o, this.n), fY(o, n.Bi()), (this.g = x4(Gy(Wot, 1), MTn, 25, 15, [(this.o = c), i + 1]))) + : (fY(o, n.Bi()), fY(o, this.n), (this.g = x4(Gy(Wot, 1), MTn, 25, 15, [(this.o = i), c]))), + (this.n = o), + a || (this.o = -2 - this.o - 1), + !0 + ); + break; + case 6: + if (4 === n.xi() && iI(n.Ai()) === iI(this.Ai()) && this.yi(null) == n.yi(null)) { + for ( + a = syn(this), i = n.Ci(), u = Yx(this.g, 48), e = VQ(Wot, MTn, 25, u.length + 1, 15, 1), t = 0; + t < u.length && (r = u[t]) <= i; + + ) + (e[t++] = r), ++i; + for (Yx(this.n, 15).Vc(t, n.Bi()), e[t] = i; ++t < e.length; ) e[t] = u[t - 1]; + return (this.g = e), a || (this.o = -2 - e[0]), !0; + } + } + return !1; + }), + (Fjn.Ib = function () { + var n, t, e; + switch ((((e = new MA(Nk(this.gm) + "@" + (W5(this) >>> 0).toString(16))).a += " (eventType: "), this.d)) { + case 1: + e.a += "SET"; + break; + case 2: + e.a += "UNSET"; + break; + case 3: + e.a += "ADD"; + break; + case 5: + e.a += "ADD_MANY"; + break; + case 4: + e.a += "REMOVE"; + break; + case 6: + e.a += "REMOVE_MANY"; + break; + case 7: + e.a += "MOVE"; + break; + case 8: + e.a += "REMOVING_ADAPTER"; + break; + case 9: + e.a += "RESOLVE"; + break; + default: + Zk(e, this.d); + } + if ( + (Tgn(this) && (e.a += ", touch: true"), + (e.a += ", position: "), + Zk(e, this.o < 0 ? (this.o < -2 ? -2 - this.o - 1 : -1) : this.o), + (e.a += ", notifier: "), + gI(e, this.Ai()), + (e.a += ", feature: "), + gI(e, this._i()), + (e.a += ", oldValue: "), + gI(e, Kwn(this)), + (e.a += ", newValue: "), + 6 == this.d && CO(this.g, 48)) + ) { + for (t = Yx(this.g, 48), e.a += "[", n = 0; n < t.length; ) (e.a += t[n]), ++n < t.length && (e.a += tEn); + e.a += "]"; + } else gI(e, Rwn(this)); + return (e.a += ", isTouch: "), nj(e, Tgn(this)), (e.a += ", wasSet: "), nj(e, syn(this)), (e.a += ")"), e.a; + }), + (Fjn.d = 0), + (Fjn.e = 0), + (Fjn.f = 0), + (Fjn.j = 0), + (Fjn.k = 0), + (Fjn.o = 0), + (Fjn.p = 0), + EF(vNn, "NotificationImpl", 143), + Wfn(1167, 143, gDn, _q), + (Fjn._i = function () { + return this.a._i(); + }), + (Fjn.yi = function (n) { + return this.a.aj(); + }), + (Fjn.Ai = function () { + return this.a.Ai(); + }), + EF(vNn, "DelegatingNotifyingListImpl/1", 1167), + Wfn(242, 63, Mxn, po, Ek), + (Fjn.Fc = function (n) { + return Y7(this, Yx(n, 366)); + }), + (Fjn.Ei = function (n) { + return Y7(this, n); + }), + (Fjn.Fi = function () { + var n, t, e; + for (n = 0; n < this.i; ++n) null != (e = (t = Yx(this.g[n], 366)).Ai()) && -1 != t.xi() && Yx(e, 92).Ng(t); + }), + (Fjn.ri = function (n) { + return VQ(Act, iEn, 366, n, 0, 1); + }), + EF(vNn, "NotificationChainImpl", 242), + Wfn(1378, 90, pNn), + (Fjn.Kg = function () { + return this.e; + }), + (Fjn.Mg = function () { + return 0 != (1 & this.f); + }), + (Fjn.f = 1), + EF(vNn, "NotifierImpl", 1378), + Wfn(1993, 63, Mxn), + (Fjn.Vh = function (n, t) { + return tvn(this, n, t); + }), + (Fjn.Wh = function (n) { + return this.Vh(this.i, n); + }), + (Fjn.Xh = function (n, t) { + Afn(this, n, t); + }), + (Fjn.Yh = function (n) { + Kfn(this, n); + }), + (Fjn.ai = function () { + return !this.bj(); + }), + (Fjn.$b = function () { + Hmn(this); + }), + (Fjn.Zi = function (n, t, e, i, r) { + return new Fq(this, n, t, e, i, r); + }), + (Fjn.$i = function (n) { + K3(this.Ai(), n); + }), + (Fjn._i = function () { + return null; + }), + (Fjn.aj = function () { + return -1; + }), + (Fjn.Ai = function () { + return null; + }), + (Fjn.bj = function () { + return !1; + }), + (Fjn.ij = function () { + return !1; + }), + (Fjn.cj = function (n, t) { + return t; + }), + (Fjn.dj = function (n, t) { + return t; + }), + (Fjn.ej = function () { + return !1; + }), + (Fjn.fj = function () { + return 0 != this.i; + }), + (Fjn.ii = function (n, t) { + return L9(this, n, t); + }), + (Fjn.$c = function (n) { + return tdn(this, n); + }), + (Fjn.mi = function (n, t) { + return Pvn(this, n, t); + }), + (Fjn.jj = function (n, t) { + return t; + }), + (Fjn.kj = function (n, t) { + return t; + }), + (Fjn.lj = function (n, t, e) { + return e; + }), + EF(vNn, "NotifyingListImpl", 1993), + Wfn(1166, 143, gDn, Fq), + (Fjn._i = function () { + return this.a._i(); + }), + (Fjn.yi = function (n) { + return this.a.aj(); + }), + (Fjn.Ai = function () { + return this.a.Ai(); + }), + EF(vNn, "NotifyingListImpl/1", 1166), + Wfn(953, 63, Mxn, HL), + (Fjn.Hc = function (n) { + return this.i > 10 + ? ((this.b && this.c.j == this.a) || ((this.b = new kR(this)), (this.a = this.j)), gE(this.b, n)) + : Fcn(this, n); + }), + (Fjn.ni = function () { + return !0; + }), + (Fjn.a = 0), + EF(exn, "AbstractEList/1", 953), + Wfn(295, 73, VTn, jN), + EF(exn, "AbstractEList/BasicIndexOutOfBoundsException", 295), + Wfn(40, 1, fEn, UO), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.mj = function () { + if (this.i.j != this.f) throw hp(new Dp()); + }), + (Fjn.nj = function () { + return hen(this); + }), + (Fjn.Ob = function () { + return this.e != this.i.gc(); + }), + (Fjn.Pb = function () { + return this.nj(); + }), + (Fjn.Qb = function () { + tan(this); + }), + (Fjn.e = 0), + (Fjn.f = 0), + (Fjn.g = -1), + EF(exn, "AbstractEList/EIterator", 40), + Wfn(278, 40, yEn, a$, Z_), + (Fjn.Qb = function () { + tan(this); + }), + (Fjn.Rb = function (n) { + Enn(this, n); + }), + (Fjn.oj = function () { + var n; + try { + return (n = this.d.Xb(--this.e)), this.mj(), (this.g = this.e), n; + } catch (n) { + throw CO((n = j4(n)), 73) ? (this.mj(), hp(new Kp())) : hp(n); + } + }), + (Fjn.pj = function (n) { + Rin(this, n); + }), + (Fjn.Sb = function () { + return 0 != this.e; + }), + (Fjn.Tb = function () { + return this.e; + }), + (Fjn.Ub = function () { + return this.oj(); + }), + (Fjn.Vb = function () { + return this.e - 1; + }), + (Fjn.Wb = function (n) { + this.pj(n); + }), + EF(exn, "AbstractEList/EListIterator", 278), + Wfn(341, 40, fEn, u$), + (Fjn.nj = function () { + return fen(this); + }), + (Fjn.Qb = function () { + throw hp(new xp()); + }), + EF(exn, "AbstractEList/NonResolvingEIterator", 341), + Wfn(385, 278, yEn, o$, WN), + (Fjn.Rb = function (n) { + throw hp(new xp()); + }), + (Fjn.nj = function () { + var n; + try { + return (n = this.c.ki(this.e)), this.mj(), (this.g = this.e++), n; + } catch (n) { + throw CO((n = j4(n)), 73) ? (this.mj(), hp(new Kp())) : hp(n); + } + }), + (Fjn.oj = function () { + var n; + try { + return (n = this.c.ki(--this.e)), this.mj(), (this.g = this.e), n; + } catch (n) { + throw CO((n = j4(n)), 73) ? (this.mj(), hp(new Kp())) : hp(n); + } + }), + (Fjn.Qb = function () { + throw hp(new xp()); + }), + (Fjn.Wb = function (n) { + throw hp(new xp()); + }), + EF(exn, "AbstractEList/NonResolvingEListIterator", 385), + Wfn(1982, 67, mDn), + (Fjn.Vh = function (n, t) { + var e, i, r, c, a, u, o, s, h; + if (0 != (i = t.gc())) { + for ( + e = d6(this, (s = null == (o = Yx(H3(this.a, 4), 126)) ? 0 : o.length) + i), + (h = s - n) > 0 && smn(o, n, e, n + i, h), + u = t.Kc(), + c = 0; + c < i; + ++c + ) + FC(e, n + c, k6(this, (a = u.Pb()))); + for (xtn(this, e), r = 0; r < i; ++r) (a = e[n]), this.bi(n, a), ++n; + return !0; + } + return ++this.j, !1; + }), + (Fjn.Wh = function (n) { + var t, e, i, r, c, a, u, o, s; + if (0 != (i = n.gc())) { + for (t = d6(this, (s = (o = null == (e = Yx(H3(this.a, 4), 126)) ? 0 : e.length) + i)), u = n.Kc(), c = o; c < s; ++c) + FC(t, c, k6(this, (a = u.Pb()))); + for (xtn(this, t), r = o; r < s; ++r) (a = t[r]), this.bi(r, a); + return !0; + } + return ++this.j, !1; + }), + (Fjn.Xh = function (n, t) { + var e, i, r, c; + (e = d6(this, (r = null == (i = Yx(H3(this.a, 4), 126)) ? 0 : i.length) + 1)), + (c = k6(this, t)), + n != r && smn(i, n, e, n + 1, r - n), + DF(e, n, c), + xtn(this, e), + this.bi(n, t); + }), + (Fjn.Yh = function (n) { + var t, e, i; + FC((t = d6(this, (i = null == (e = Yx(H3(this.a, 4), 126)) ? 0 : e.length) + 1)), i, k6(this, n)), xtn(this, t), this.bi(i, n); + }), + (Fjn.Zh = function () { + return new lV(this); + }), + (Fjn.$h = function () { + return new w_(this); + }), + (Fjn._h = function (n) { + var t, e; + if (((e = null == (t = Yx(H3(this.a, 4), 126)) ? 0 : t.length), n < 0 || n > e)) throw hp(new jN(n, e)); + return new PB(this, n); + }), + (Fjn.$b = function () { + var n, t; + ++this.j, (t = null == (n = Yx(H3(this.a, 4), 126)) ? 0 : n.length), xtn(this, null), XQ(this, t, n); + }), + (Fjn.Hc = function (n) { + var t, e, i, r; + if (null != (t = Yx(H3(this.a, 4), 126))) + if (null != n) { + for (i = 0, r = (e = t).length; i < r; ++i) if (Q8(n, e[i])) return !0; + } else for (i = 0, r = (e = t).length; i < r; ++i) if (iI(e[i]) === iI(n)) return !0; + return !1; + }), + (Fjn.Xb = function (n) { + var t, e; + if (n >= (e = null == (t = Yx(H3(this.a, 4), 126)) ? 0 : t.length)) throw hp(new jN(n, e)); + return t[n]; + }), + (Fjn.Xc = function (n) { + var t, e, i; + if (null != (t = Yx(H3(this.a, 4), 126))) + if (null != n) { + for (e = 0, i = t.length; e < i; ++e) if (Q8(n, t[e])) return e; + } else for (e = 0, i = t.length; e < i; ++e) if (iI(t[e]) === iI(n)) return e; + return -1; + }), + (Fjn.dc = function () { + return null == Yx(H3(this.a, 4), 126); + }), + (Fjn.Kc = function () { + return new fV(this); + }), + (Fjn.Yc = function () { + return new b_(this); + }), + (Fjn.Zc = function (n) { + var t, e; + if (((e = null == (t = Yx(H3(this.a, 4), 126)) ? 0 : t.length), n < 0 || n > e)) throw hp(new jN(n, e)); + return new SB(this, n); + }), + (Fjn.ii = function (n, t) { + var e, i, r; + if (n >= (r = null == (e = Hnn(this)) ? 0 : e.length)) throw hp(new Hm(jxn + n + Exn + r)); + if (t >= r) throw hp(new Hm(Txn + t + Exn + r)); + return (i = e[t]), n != t && (n < t ? smn(e, n, e, n + 1, t - n) : smn(e, t + 1, e, t, n - t), DF(e, n, i), xtn(this, e)), i; + }), + (Fjn.ki = function (n) { + return Yx(H3(this.a, 4), 126)[n]; + }), + (Fjn.$c = function (n) { + return (function (n, t) { + var e, i, r, c, a; + if (t >= (a = null == (e = Yx(H3(n.a, 4), 126)) ? 0 : e.length)) throw hp(new jN(t, a)); + return ( + (r = e[t]), + 1 == a + ? (i = null) + : (smn(e, 0, (i = VQ(Oct, vDn, 415, a - 1, 0, 1)), 0, t), (c = a - t - 1) > 0 && smn(e, t + 1, i, t, c)), + xtn(n, i), + _sn(n, t, r), + r + ); + })(this, n); + }), + (Fjn.mi = function (n, t) { + var e, i; + return (i = (e = Hnn(this))[n]), FC(e, n, k6(this, t)), xtn(this, e), i; + }), + (Fjn.gc = function () { + var n; + return null == (n = Yx(H3(this.a, 4), 126)) ? 0 : n.length; + }), + (Fjn.Pc = function () { + var n, t, e; + return ( + (e = null == (n = Yx(H3(this.a, 4), 126)) ? 0 : n.length), (t = VQ(Oct, vDn, 415, e, 0, 1)), e > 0 && smn(n, 0, t, 0, e), t + ); + }), + (Fjn.Qc = function (n) { + var t, e; + return ( + (e = null == (t = Yx(H3(this.a, 4), 126)) ? 0 : t.length) > 0 && (n.length < e && (n = H1(V5(n).c, e)), smn(t, 0, n, 0, e)), + n.length > e && DF(n, e, null), + n + ); + }), + EF(exn, "ArrayDelegatingEList", 1982), + Wfn(1038, 40, fEn, fV), + (Fjn.mj = function () { + if (this.b.j != this.f || iI(Yx(H3(this.b.a, 4), 126)) !== iI(this.a)) throw hp(new Dp()); + }), + (Fjn.Qb = function () { + tan(this), (this.a = Yx(H3(this.b.a, 4), 126)); + }), + EF(exn, "ArrayDelegatingEList/EIterator", 1038), + Wfn(706, 278, yEn, b_, SB), + (Fjn.mj = function () { + if (this.b.j != this.f || iI(Yx(H3(this.b.a, 4), 126)) !== iI(this.a)) throw hp(new Dp()); + }), + (Fjn.pj = function (n) { + Rin(this, n), (this.a = Yx(H3(this.b.a, 4), 126)); + }), + (Fjn.Qb = function () { + tan(this), (this.a = Yx(H3(this.b.a, 4), 126)); + }), + EF(exn, "ArrayDelegatingEList/EListIterator", 706), + Wfn(1039, 341, fEn, lV), + (Fjn.mj = function () { + if (this.b.j != this.f || iI(Yx(H3(this.b.a, 4), 126)) !== iI(this.a)) throw hp(new Dp()); + }), + EF(exn, "ArrayDelegatingEList/NonResolvingEIterator", 1039), + Wfn(707, 385, yEn, w_, PB), + (Fjn.mj = function () { + if (this.b.j != this.f || iI(Yx(H3(this.b.a, 4), 126)) !== iI(this.a)) throw hp(new Dp()); + }), + EF(exn, "ArrayDelegatingEList/NonResolvingEListIterator", 707), + Wfn(606, 295, VTn, BI), + EF(exn, "BasicEList/BasicIndexOutOfBoundsException", 606), + Wfn(696, 63, Mxn, QP), + (Fjn.Vc = function (n, t) { + throw hp(new xp()); + }), + (Fjn.Fc = function (n) { + throw hp(new xp()); + }), + (Fjn.Wc = function (n, t) { + throw hp(new xp()); + }), + (Fjn.Gc = function (n) { + throw hp(new xp()); + }), + (Fjn.$b = function () { + throw hp(new xp()); + }), + (Fjn.qi = function (n) { + throw hp(new xp()); + }), + (Fjn.Kc = function () { + return this.Zh(); + }), + (Fjn.Yc = function () { + return this.$h(); + }), + (Fjn.Zc = function (n) { + return this._h(n); + }), + (Fjn.ii = function (n, t) { + throw hp(new xp()); + }), + (Fjn.ji = function (n, t) { + throw hp(new xp()); + }), + (Fjn.$c = function (n) { + throw hp(new xp()); + }), + (Fjn.Mc = function (n) { + throw hp(new xp()); + }), + (Fjn._c = function (n, t) { + throw hp(new xp()); + }), + EF(exn, "BasicEList/UnmodifiableEList", 696), + Wfn(705, 1, { 3: 1, 20: 1, 14: 1, 15: 1, 58: 1, 589: 1 }), + (Fjn.Vc = function (n, t) { + !(function (n, t, e) { + n.c.Vc(t, Yx(e, 133)); + })(this, n, Yx(t, 42)); + }), + (Fjn.Fc = function (n) { + return (function (n, t) { + return n.c.Fc(Yx(t, 133)); + })(this, Yx(n, 42)); + }), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Xb = function (n) { + return Yx(c1(this.c, n), 133); + }), + (Fjn.ii = function (n, t) { + return Yx(this.c.ii(n, t), 42); + }), + (Fjn.ji = function (n, t) { + !(function (n, t, e) { + n.c.ji(t, Yx(e, 133)); + })(this, n, Yx(t, 42)); + }), + (Fjn.Lc = function () { + return new SR(null, new Nz(this, 16)); + }), + (Fjn.$c = function (n) { + return Yx(this.c.$c(n), 42); + }), + (Fjn._c = function (n, t) { + return (function (n, t, e) { + return Yx(n.c._c(t, Yx(e, 133)), 42); + })(this, n, Yx(t, 42)); + }), + (Fjn.ad = function (n) { + I2(this, n); + }), + (Fjn.Nc = function () { + return new Nz(this, 16); + }), + (Fjn.Oc = function () { + return new SR(null, new Nz(this, 16)); + }), + (Fjn.Wc = function (n, t) { + return this.c.Wc(n, t); + }), + (Fjn.Gc = function (n) { + return this.c.Gc(n); + }), + (Fjn.$b = function () { + this.c.$b(); + }), + (Fjn.Hc = function (n) { + return this.c.Hc(n); + }), + (Fjn.Ic = function (n) { + return m4(this.c, n); + }), + (Fjn.qj = function () { + var n, t; + if (null == this.d) { + for (this.d = VQ(Ect, yDn, 63, 2 * this.f + 1, 0, 1), t = this.e, this.f = 0, n = this.c.Kc(); n.e != n.i.gc(); ) + tin(this, Yx(n.nj(), 133)); + this.e = t; + } + }), + (Fjn.Fb = function (n) { + return UN(this, n); + }), + (Fjn.Hb = function () { + return L4(this.c); + }), + (Fjn.Xc = function (n) { + return this.c.Xc(n); + }), + (Fjn.rj = function () { + this.c = new Lg(this); + }), + (Fjn.dc = function () { + return 0 == this.f; + }), + (Fjn.Kc = function () { + return this.c.Kc(); + }), + (Fjn.Yc = function () { + return this.c.Yc(); + }), + (Fjn.Zc = function (n) { + return this.c.Zc(n); + }), + (Fjn.sj = function () { + return UQ(this); + }), + (Fjn.tj = function (n, t, e) { + return new Kx(n, t, e); + }), + (Fjn.uj = function () { + return new vo(); + }), + (Fjn.Mc = function (n) { + return w0(this, n); + }), + (Fjn.gc = function () { + return this.f; + }), + (Fjn.bd = function (n, t) { + return new Oz(this.c, n, t); + }), + (Fjn.Pc = function () { + return this.c.Pc(); + }), + (Fjn.Qc = function (n) { + return this.c.Qc(n); + }), + (Fjn.Ib = function () { + return D7(this.c); + }), + (Fjn.e = 0), + (Fjn.f = 0), + EF(exn, "BasicEMap", 705), + Wfn(1033, 63, Mxn, Lg), + (Fjn.bi = function (n, t) { + !(function (n, t) { + tin(n.a, t); + })(this, Yx(t, 133)); + }), + (Fjn.ei = function (n, t, e) { + ++(this, Yx(t, 133), this).a.e; + }), + (Fjn.fi = function (n, t) { + !(function (n, t) { + N9(n.a, t); + })(this, Yx(t, 133)); + }), + (Fjn.gi = function (n, t, e) { + !(function (n, t, e) { + N9(n.a, e), tin(n.a, t); + })(this, Yx(t, 133), Yx(e, 133)); + }), + (Fjn.di = function (n, t) { + A3(this.a); + }), + EF(exn, "BasicEMap/1", 1033), + Wfn(1034, 63, Mxn, vo), + (Fjn.ri = function (n) { + return VQ(Lct, kDn, 612, n, 0, 1); + }), + EF(exn, "BasicEMap/2", 1034), + Wfn(1035, dEn, gEn, Ng), + (Fjn.$b = function () { + this.a.c.$b(); + }), + (Fjn.Hc = function (n) { + return mnn(this.a, n); + }), + (Fjn.Kc = function () { + return 0 == this.a.f ? (iL(), $ct.a) : new Tk(this.a); + }), + (Fjn.Mc = function (n) { + var t; + return (t = this.a.f), ttn(this.a, n), this.a.f != t; + }), + (Fjn.gc = function () { + return this.a.f; + }), + EF(exn, "BasicEMap/3", 1035), + Wfn(1036, 28, wEn, xg), + (Fjn.$b = function () { + this.a.c.$b(); + }), + (Fjn.Hc = function (n) { + return Idn(this.a, n); + }), + (Fjn.Kc = function () { + return 0 == this.a.f ? (iL(), $ct.a) : new Mk(this.a); + }), + (Fjn.gc = function () { + return this.a.f; + }), + EF(exn, "BasicEMap/4", 1036), + Wfn(1037, dEn, gEn, Dg), + (Fjn.$b = function () { + this.a.c.$b(); + }), + (Fjn.Hc = function (n) { + var t, e, i, r, c, a, u, o, s; + if ( + this.a.f > 0 && + CO(n, 42) && + (this.a.qj(), (r = null == (u = (o = Yx(n, 42)).cd()) ? 0 : W5(u)), (c = KL(this.a, r)), (t = this.a.d[c])) + ) + for (e = Yx(t.g, 367), s = t.i, a = 0; a < s; ++a) if ((i = e[a]).Sh() == r && i.Fb(o)) return !0; + return !1; + }), + (Fjn.Kc = function () { + return 0 == this.a.f ? (iL(), $ct.a) : new KH(this.a); + }), + (Fjn.Mc = function (n) { + return aln(this, n); + }), + (Fjn.gc = function () { + return this.a.f; + }), + EF(exn, "BasicEMap/5", 1037), + Wfn(613, 1, fEn, KH), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return -1 != this.b; + }), + (Fjn.Pb = function () { + var n; + if (this.f.e != this.c) throw hp(new Dp()); + if (-1 == this.b) throw hp(new Kp()); + return (this.d = this.a), (this.e = this.b), Icn(this), (n = Yx(this.f.d[this.d].g[this.e], 133)), this.vj(n); + }), + (Fjn.Qb = function () { + if (this.f.e != this.c) throw hp(new Dp()); + if (-1 == this.e) throw hp(new Lp()); + this.f.c.Mc(c1(this.f.d[this.d], this.e)), (this.c = this.f.e), (this.e = -1), this.a == this.d && -1 != this.b && --this.b; + }), + (Fjn.vj = function (n) { + return n; + }), + (Fjn.a = 0), + (Fjn.b = -1), + (Fjn.c = 0), + (Fjn.d = 0), + (Fjn.e = 0), + EF(exn, "BasicEMap/BasicEMapIterator", 613), + Wfn(1031, 613, fEn, Tk), + (Fjn.vj = function (n) { + return n.cd(); + }), + EF(exn, "BasicEMap/BasicEMapKeyIterator", 1031), + Wfn(1032, 613, fEn, Mk), + (Fjn.vj = function (n) { + return n.dd(); + }), + EF(exn, "BasicEMap/BasicEMapValueIterator", 1032), + Wfn(1030, 1, bEn, Rg), + (Fjn.wc = function (n) { + S3(this, n); + }), + (Fjn.yc = function (n, t, e) { + return Y9(this, n, t, e); + }), + (Fjn.$b = function () { + this.a.c.$b(); + }), + (Fjn._b = function (n) { + return nI(this, n); + }), + (Fjn.uc = function (n) { + return Idn(this.a, n); + }), + (Fjn.vc = function () { + return !(n = this.a).g && (n.g = new oo()), !n.g.a && (n.g.a = new Dg(n)), n.g.a; + var n; + }), + (Fjn.Fb = function (n) { + return UN(this.a, n); + }), + (Fjn.xc = function (n) { + return ynn(this.a, n); + }), + (Fjn.Hb = function () { + return L4(this.a.c); + }), + (Fjn.dc = function () { + return 0 == this.a.f; + }), + (Fjn.ec = function () { + return !(n = this.a).g && (n.g = new oo()), !n.g.b && (n.g.b = new Ng(n)), n.g.b; + var n; + }), + (Fjn.zc = function (n, t) { + return xcn(this.a, n, t); + }), + (Fjn.Bc = function (n) { + return ttn(this.a, n); + }), + (Fjn.gc = function () { + return this.a.f; + }), + (Fjn.Ib = function () { + return D7(this.a.c); + }), + (Fjn.Cc = function () { + return !(n = this.a).g && (n.g = new oo()), !n.g.d && (n.g.d = new xg(n)), n.g.d; + var n; + }), + EF(exn, "BasicEMap/DelegatingMap", 1030), + Wfn(612, 1, { 42: 1, 133: 1, 612: 1 }, Kx), + (Fjn.Fb = function (n) { + var t; + return ( + !!CO(n, 42) && + ((t = Yx(n, 42)), + (null != this.b ? Q8(this.b, t.cd()) : iI(this.b) === iI(t.cd())) && + (null != this.c ? Q8(this.c, t.dd()) : iI(this.c) === iI(t.dd()))) + ); + }), + (Fjn.Sh = function () { + return this.a; + }), + (Fjn.cd = function () { + return this.b; + }), + (Fjn.dd = function () { + return this.c; + }), + (Fjn.Hb = function () { + return this.a ^ (null == this.c ? 0 : W5(this.c)); + }), + (Fjn.Th = function (n) { + this.a = n; + }), + (Fjn.Uh = function (n) { + throw hp(new Pp()); + }), + (Fjn.ed = function (n) { + var t; + return (t = this.c), (this.c = n), t; + }), + (Fjn.Ib = function () { + return this.b + "->" + this.c; + }), + (Fjn.a = 0); + var $ct, + Lct = EF(exn, "BasicEMap/EntryImpl", 612); + Wfn(536, 1, {}, oo), + EF(exn, "BasicEMap/View", 536), + Wfn(768, 1, {}), + (Fjn.Fb = function (n) { + return sln((XH(), TFn), n); + }), + (Fjn.Hb = function () { + return K5((XH(), TFn)); + }), + (Fjn.Ib = function () { + return Gun((XH(), TFn)); + }), + EF(exn, "ECollections/BasicEmptyUnmodifiableEList", 768), + Wfn(1312, 1, yEn, mo), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Rb = function (n) { + throw hp(new xp()); + }), + (Fjn.Ob = function () { + return !1; + }), + (Fjn.Sb = function () { + return !1; + }), + (Fjn.Pb = function () { + throw hp(new Kp()); + }), + (Fjn.Tb = function () { + return 0; + }), + (Fjn.Ub = function () { + throw hp(new Kp()); + }), + (Fjn.Vb = function () { + return -1; + }), + (Fjn.Qb = function () { + throw hp(new xp()); + }), + (Fjn.Wb = function (n) { + throw hp(new xp()); + }), + EF(exn, "ECollections/BasicEmptyUnmodifiableEList/1", 1312), + Wfn(1310, 768, { 20: 1, 14: 1, 15: 1, 58: 1 }, Rv), + (Fjn.Vc = function (n, t) { + wj(); + }), + (Fjn.Fc = function (n) { + return dj(); + }), + (Fjn.Wc = function (n, t) { + return gj(); + }), + (Fjn.Gc = function (n) { + return pj(); + }), + (Fjn.$b = function () { + vj(); + }), + (Fjn.Hc = function (n) { + return !1; + }), + (Fjn.Ic = function (n) { + return !1; + }), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Xb = function (n) { + return CI((XH(), n)), null; + }), + (Fjn.Xc = function (n) { + return -1; + }), + (Fjn.dc = function () { + return !0; + }), + (Fjn.Kc = function () { + return this.a; + }), + (Fjn.Yc = function () { + return this.a; + }), + (Fjn.Zc = function (n) { + return this.a; + }), + (Fjn.ii = function (n, t) { + return mj(); + }), + (Fjn.ji = function (n, t) { + yj(); + }), + (Fjn.Lc = function () { + return new SR(null, new Nz(this, 16)); + }), + (Fjn.$c = function (n) { + return kj(); + }), + (Fjn.Mc = function (n) { + return jj(); + }), + (Fjn._c = function (n, t) { + return Ej(); + }), + (Fjn.gc = function () { + return 0; + }), + (Fjn.ad = function (n) { + I2(this, n); + }), + (Fjn.Nc = function () { + return new Nz(this, 16); + }), + (Fjn.Oc = function () { + return new SR(null, new Nz(this, 16)); + }), + (Fjn.bd = function (n, t) { + return XH(), new Oz(TFn, n, t); + }), + (Fjn.Pc = function () { + return CK((XH(), TFn)); + }), + (Fjn.Qc = function (n) { + return XH(), _in(TFn, n); + }), + EF(exn, "ECollections/EmptyUnmodifiableEList", 1310), + Wfn(1311, 768, { 20: 1, 14: 1, 15: 1, 58: 1, 589: 1 }, Kv), + (Fjn.Vc = function (n, t) { + wj(); + }), + (Fjn.Fc = function (n) { + return dj(); + }), + (Fjn.Wc = function (n, t) { + return gj(); + }), + (Fjn.Gc = function (n) { + return pj(); + }), + (Fjn.$b = function () { + vj(); + }), + (Fjn.Hc = function (n) { + return !1; + }), + (Fjn.Ic = function (n) { + return !1; + }), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Xb = function (n) { + return CI((XH(), n)), null; + }), + (Fjn.Xc = function (n) { + return -1; + }), + (Fjn.dc = function () { + return !0; + }), + (Fjn.Kc = function () { + return this.a; + }), + (Fjn.Yc = function () { + return this.a; + }), + (Fjn.Zc = function (n) { + return this.a; + }), + (Fjn.ii = function (n, t) { + return mj(); + }), + (Fjn.ji = function (n, t) { + yj(); + }), + (Fjn.Lc = function () { + return new SR(null, new Nz(this, 16)); + }), + (Fjn.$c = function (n) { + return kj(); + }), + (Fjn.Mc = function (n) { + return jj(); + }), + (Fjn._c = function (n, t) { + return Ej(); + }), + (Fjn.gc = function () { + return 0; + }), + (Fjn.ad = function (n) { + I2(this, n); + }), + (Fjn.Nc = function () { + return new Nz(this, 16); + }), + (Fjn.Oc = function () { + return new SR(null, new Nz(this, 16)); + }), + (Fjn.bd = function (n, t) { + return XH(), new Oz(TFn, n, t); + }), + (Fjn.Pc = function () { + return CK((XH(), TFn)); + }), + (Fjn.Qc = function (n) { + return XH(), _in(TFn, n); + }), + (Fjn.sj = function () { + return XH(), XH(), MFn; + }), + EF(exn, "ECollections/EmptyUnmodifiableEMap", 1311); + var Nct, + xct = aR(exn, "Enumerator"); + Wfn(281, 1, { 281: 1 }, xdn), + (Fjn.Fb = function (n) { + var t; + return ( + this === n || + (!!CO(n, 281) && + ((t = Yx(n, 281)), + this.f == t.f && + (function (n, t) { + return null == n ? null == t : vtn(n, t); + })(this.i, t.i) && + QR(this.a, 0 != (256 & this.f) ? (0 != (256 & t.f) ? t.a : null) : 0 != (256 & t.f) ? null : t.a) && + QR(this.d, t.d) && + QR(this.g, t.g) && + QR(this.e, t.e) && + (function (n, t) { + var e, i; + if (n.j.length != t.j.length) return !1; + for (e = 0, i = n.j.length; e < i; e++) if (!_N(n.j[e], t.j[e])) return !1; + return !0; + })(this, t))) + ); + }), + (Fjn.Hb = function () { + return this.f; + }), + (Fjn.Ib = function () { + return spn(this); + }), + (Fjn.f = 0); + var Dct, + Rct, + Kct, + _ct = 0, + Fct = 0, + Bct = 0, + Hct = 0, + qct = 0, + Gct = 0, + zct = 0, + Uct = 0, + Xct = 0, + Wct = 0, + Vct = 0, + Qct = 0, + Yct = 0; + EF(exn, "URI", 281), + Wfn(1091, 43, gMn, _v), + (Fjn.zc = function (n, t) { + return Yx(GG(this, lL(n), Yx(t, 281)), 281); + }), + EF(exn, "URI/URICache", 1091), + Wfn(497, 63, Mxn, fo, RR), + (Fjn.hi = function () { + return !0; + }), + EF(exn, "UniqueEList", 497), + Wfn(581, 60, eTn, mJ), + EF(exn, "WrappedException", 581); + var Jct, + Zct = aR(rNn, TDn), + nat = aR(rNn, MDn), + tat = aR(rNn, SDn), + eat = aR(rNn, PDn), + iat = aR(rNn, IDn), + rat = aR(rNn, "EClass"), + cat = aR(rNn, "EDataType"); + Wfn(1183, 43, gMn, Fv), + (Fjn.xc = function (n) { + return aI(n) ? aG(this, n) : eI(Dq(this.f, n)); + }), + EF(rNn, "EDataType/Internal/ConversionDelegate/Factory/Registry/Impl", 1183); + var aat, + uat, + oat = aR(rNn, "EEnum"), + sat = aR(rNn, CDn), + hat = aR(rNn, ODn), + fat = aR(rNn, ADn), + lat = aR(rNn, $Dn), + bat = aR(rNn, LDn); + Wfn(1029, 1, {}, ho), + (Fjn.Ib = function () { + return "NIL"; + }), + EF(rNn, "EStructuralFeature/Internal/DynamicValueHolder/1", 1029), + Wfn(1028, 43, gMn, Bv), + (Fjn.xc = function (n) { + return aI(n) ? aG(this, n) : eI(Dq(this.f, n)); + }), + EF(rNn, "EStructuralFeature/Internal/SettingDelegate/Factory/Registry/Impl", 1028); + var wat, + dat, + gat, + pat, + vat, + mat, + yat, + kat, + jat, + Eat, + Tat, + Mat, + Sat, + Pat, + Iat, + Cat, + Oat, + Aat, + $at, + Lat, + Nat, + xat, + Dat, + Rat, + Kat, + _at, + Fat, + Bat, + Hat, + qat, + Gat, + zat = aR(rNn, NDn), + Uat = aR(rNn, "EValidator/PatternMatcher"), + Xat = aR(xDn, "FeatureMap/Entry"); + Wfn(535, 1, { 72: 1 }, HP), + (Fjn.ak = function () { + return this.a; + }), + (Fjn.dd = function () { + return this.b; + }), + EF(PNn, "BasicEObjectImpl/1", 535), + Wfn(1027, 1, DDn, qP), + (Fjn.Wj = function (n) { + return TV(this.a, this.b, n); + }), + (Fjn.fj = function () { + return CG(this.a, this.b); + }), + (Fjn.Wb = function (n) { + bG(this.a, this.b, n); + }), + (Fjn.Xj = function () { + var n, t, e; + (n = this.a), (t = this.b), (e = n.Yg(t)) >= 0 ? n.Bh(e) : Ehn(n, t); + }), + EF(PNn, "BasicEObjectImpl/4", 1027), + Wfn(1983, 1, { 108: 1 }), + (Fjn.bk = function (n) { + this.e = 0 == n ? Fat : VQ(UKn, iEn, 1, n, 5, 1); + }), + (Fjn.Ch = function (n) { + return this.e[n]; + }), + (Fjn.Dh = function (n, t) { + this.e[n] = t; + }), + (Fjn.Eh = function (n) { + this.e[n] = null; + }), + (Fjn.ck = function () { + return this.c; + }), + (Fjn.dk = function () { + throw hp(new xp()); + }), + (Fjn.ek = function () { + throw hp(new xp()); + }), + (Fjn.fk = function () { + return this.d; + }), + (Fjn.gk = function () { + return null != this.e; + }), + (Fjn.hk = function (n) { + this.c = n; + }), + (Fjn.ik = function (n) { + throw hp(new xp()); + }), + (Fjn.jk = function (n) { + throw hp(new xp()); + }), + (Fjn.kk = function (n) { + this.d = n; + }), + EF(PNn, "BasicEObjectImpl/EPropertiesHolderBaseImpl", 1983), + Wfn(185, 1983, { 108: 1 }, Df), + (Fjn.dk = function () { + return this.a; + }), + (Fjn.ek = function () { + return this.b; + }), + (Fjn.ik = function (n) { + this.a = n; + }), + (Fjn.jk = function (n) { + this.b = n; + }), + EF(PNn, "BasicEObjectImpl/EPropertiesHolderImpl", 185), + Wfn(506, 97, SNn, yo), + (Fjn.Kg = function () { + return this.f; + }), + (Fjn.Pg = function () { + return this.k; + }), + (Fjn.Rg = function (n, t) { + (this.g = n), (this.i = t); + }), + (Fjn.Tg = function () { + return 0 == (2 & this.j) ? this.zh() : this.ph().ck(); + }), + (Fjn.Vg = function () { + return this.i; + }), + (Fjn.Mg = function () { + return 0 != (1 & this.j); + }), + (Fjn.eh = function () { + return this.g; + }), + (Fjn.kh = function () { + return 0 != (4 & this.j); + }), + (Fjn.ph = function () { + return !this.k && (this.k = new Df()), this.k; + }), + (Fjn.th = function (n) { + this.ph().hk(n), n ? (this.j |= 2) : (this.j &= -3); + }), + (Fjn.vh = function (n) { + this.ph().jk(n), n ? (this.j |= 4) : (this.j &= -5); + }), + (Fjn.zh = function () { + return (YF(), gat).S; + }), + (Fjn.i = 0), + (Fjn.j = 1), + EF(PNn, "EObjectImpl", 506), + Wfn(780, 506, { 105: 1, 92: 1, 90: 1, 56: 1, 108: 1, 49: 1, 97: 1 }, SD), + (Fjn.Ch = function (n) { + return this.e[n]; + }), + (Fjn.Dh = function (n, t) { + this.e[n] = t; + }), + (Fjn.Eh = function (n) { + this.e[n] = null; + }), + (Fjn.Tg = function () { + return this.d; + }), + (Fjn.Yg = function (n) { + return tnn(this.d, n); + }), + (Fjn.$g = function () { + return this.d; + }), + (Fjn.dh = function () { + return null != this.e; + }), + (Fjn.ph = function () { + return !this.k && (this.k = new ko()), this.k; + }), + (Fjn.th = function (n) { + this.d = n; + }), + (Fjn.yh = function () { + var n; + return null == this.e && ((n = vF(this.d)), (this.e = 0 == n ? Bat : VQ(UKn, iEn, 1, n, 5, 1))), this; + }), + (Fjn.Ah = function () { + return 0; + }), + EF(PNn, "DynamicEObjectImpl", 780), + Wfn(1376, 780, { 105: 1, 42: 1, 92: 1, 90: 1, 133: 1, 56: 1, 108: 1, 49: 1, 97: 1 }, rR), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.Hb = function () { + return _A(this); + }), + (Fjn.th = function (n) { + (this.d = n), (this.b = Ybn(n, "key")), (this.c = Ybn(n, KNn)); + }), + (Fjn.Sh = function () { + var n; + return -1 == this.a && ((n = KJ(this, this.b)), (this.a = null == n ? 0 : W5(n))), this.a; + }), + (Fjn.cd = function () { + return KJ(this, this.b); + }), + (Fjn.dd = function () { + return KJ(this, this.c); + }), + (Fjn.Th = function (n) { + this.a = n; + }), + (Fjn.Uh = function (n) { + bG(this, this.b, n); + }), + (Fjn.ed = function (n) { + var t; + return (t = KJ(this, this.c)), bG(this, this.c, n), t; + }), + (Fjn.a = 0), + EF(PNn, "DynamicEObjectImpl/BasicEMapEntry", 1376), + Wfn(1377, 1, { 108: 1 }, ko), + (Fjn.bk = function (n) { + throw hp(new xp()); + }), + (Fjn.Ch = function (n) { + throw hp(new xp()); + }), + (Fjn.Dh = function (n, t) { + throw hp(new xp()); + }), + (Fjn.Eh = function (n) { + throw hp(new xp()); + }), + (Fjn.ck = function () { + throw hp(new xp()); + }), + (Fjn.dk = function () { + return this.a; + }), + (Fjn.ek = function () { + return this.b; + }), + (Fjn.fk = function () { + return this.c; + }), + (Fjn.gk = function () { + throw hp(new xp()); + }), + (Fjn.hk = function (n) { + throw hp(new xp()); + }), + (Fjn.ik = function (n) { + this.a = n; + }), + (Fjn.jk = function (n) { + this.b = n; + }), + (Fjn.kk = function (n) { + this.c = n; + }), + EF(PNn, "DynamicEObjectImpl/DynamicEPropertiesHolderImpl", 1377), + Wfn( + 510, + 150, + { + 105: 1, + 92: 1, + 90: 1, + 590: 1, + 147: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 510: 1, + 150: 1, + 114: 1, + 115: 1, + }, + jo, + ), + (Fjn.Qg = function (n) { + return tcn(this, n); + }), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), this.Ab; + case 1: + return this.d; + case 2: + return e + ? (!this.b && (this.b = new z$((xjn(), Dat), out, this)), this.b) + : (!this.b && (this.b = new z$((xjn(), Dat), out, this)), UQ(this.b)); + case 3: + return FG(this); + case 4: + return !this.a && (this.a = new XO(Wrt, this, 4)), this.a; + case 5: + return !this.c && (this.c = new JO(Wrt, this, 5)), this.c; + } + return RY(this, n - vF((xjn(), pat)), CZ(Yx(H3(this, 16), 26) || pat, n), t, e); + }), + (Fjn.hh = function (n, t, e) { + var i; + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), wnn(this.Ab, n, e); + case 3: + return ( + this.Cb && (e = (i = this.Db >> 16) >= 0 ? tcn(this, e) : this.Cb.ih(this, -1 - i, null, e)), jK(this, Yx(n, 147), e) + ); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (xjn(), pat), t), 66) + .Nj() + .Qj(this, dtn(this), t - vF((xjn(), pat)), n, e); + }), + (Fjn.jh = function (n, t, e) { + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), Ten(this.Ab, n, e); + case 2: + return !this.b && (this.b = new z$((xjn(), Dat), out, this)), YN(this.b, n, e); + case 3: + return jK(this, null, e); + case 4: + return !this.a && (this.a = new XO(Wrt, this, 4)), Ten(this.a, n, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (xjn(), pat), t), 66) + .Nj() + .Rj(this, dtn(this), t - vF((xjn(), pat)), n, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return !!this.Ab && 0 != this.Ab.i; + case 1: + return null != this.d; + case 2: + return !!this.b && 0 != this.b.f; + case 3: + return !!FG(this); + case 4: + return !!this.a && 0 != this.a.i; + case 5: + return !!this.c && 0 != this.c.i; + } + return xX(this, n - vF((xjn(), pat)), CZ(Yx(H3(this, 16), 26) || pat, n)); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 0: + return ( + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + Hmn(this.Ab), + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + void jF(this.Ab, Yx(t, 14)) + ); + case 1: + return void (function (n, t) { + B0(n, null == t ? null : (vB(t), t)); + })(this, lL(t)); + case 2: + return !this.b && (this.b = new z$((xjn(), Dat), out, this)), void P3(this.b, t); + case 3: + return void Wbn(this, Yx(t, 147)); + case 4: + return ( + !this.a && (this.a = new XO(Wrt, this, 4)), + Hmn(this.a), + !this.a && (this.a = new XO(Wrt, this, 4)), + void jF(this.a, Yx(t, 14)) + ); + case 5: + return ( + !this.c && (this.c = new JO(Wrt, this, 5)), + Hmn(this.c), + !this.c && (this.c = new JO(Wrt, this, 5)), + void jF(this.c, Yx(t, 14)) + ); + } + E7(this, n - vF((xjn(), pat)), CZ(Yx(H3(this, 16), 26) || pat, n), t); + }), + (Fjn.zh = function () { + return xjn(), pat; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), void Hmn(this.Ab); + case 1: + return void B0(this, null); + case 2: + return !this.b && (this.b = new z$((xjn(), Dat), out, this)), void this.b.c.$b(); + case 3: + return void Wbn(this, null); + case 4: + return !this.a && (this.a = new XO(Wrt, this, 4)), void Hmn(this.a); + case 5: + return !this.c && (this.c = new JO(Wrt, this, 5)), void Hmn(this.c); + } + r9(this, n - vF((xjn(), pat)), CZ(Yx(H3(this, 16), 26) || pat, n)); + }), + (Fjn.Ib = function () { + return o9(this); + }), + (Fjn.d = null), + EF(PNn, "EAnnotationImpl", 510), + Wfn(151, 705, RDn, yY), + (Fjn.Xh = function (n, t) { + !(function (n, t, e) { + Yx(n.c, 69).Xh(t, e); + })(this, n, Yx(t, 42)); + }), + (Fjn.lk = function (n, t) { + return (function (n, t, e) { + return Yx(n.c, 69).lk(t, e); + })(this, Yx(n, 42), t); + }), + (Fjn.pi = function (n) { + return Yx(Yx(this.c, 69).pi(n), 133); + }), + (Fjn.Zh = function () { + return Yx(this.c, 69).Zh(); + }), + (Fjn.$h = function () { + return Yx(this.c, 69).$h(); + }), + (Fjn._h = function (n) { + return Yx(this.c, 69)._h(n); + }), + (Fjn.mk = function (n, t) { + return YN(this, n, t); + }), + (Fjn.Wj = function (n) { + return Yx(this.c, 76).Wj(n); + }), + (Fjn.rj = function () {}), + (Fjn.fj = function () { + return Yx(this.c, 76).fj(); + }), + (Fjn.tj = function (n, t, e) { + var i; + return (i = Yx(i1(this.b).Nh().Jh(this.b), 133)).Th(n), i.Uh(t), i.ed(e), i; + }), + (Fjn.uj = function () { + return new Jg(this); + }), + (Fjn.Wb = function (n) { + P3(this, n); + }), + (Fjn.Xj = function () { + Yx(this.c, 76).Xj(); + }), + EF(xDn, "EcoreEMap", 151), + Wfn(158, 151, RDn, z$), + (Fjn.qj = function () { + var n, t, e, i, r; + if (null == this.d) { + for (r = VQ(Ect, yDn, 63, 2 * this.f + 1, 0, 1), e = this.c.Kc(); e.e != e.i.gc(); ) + !(n = r[(i = ((t = Yx(e.nj(), 133)).Sh() & Yjn) % r.length)]) && (n = r[i] = new Jg(this)), n.Fc(t); + this.d = r; + } + }), + EF(PNn, "EAnnotationImpl/1", 158), + Wfn(284, 438, { + 105: 1, + 92: 1, + 90: 1, + 147: 1, + 191: 1, + 56: 1, + 108: 1, + 472: 1, + 49: 1, + 97: 1, + 150: 1, + 284: 1, + 114: 1, + 115: 1, + }), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), this.Ab; + case 1: + return this.zb; + case 2: + return TA(), 0 != (256 & this.Bb); + case 3: + return TA(), 0 != (512 & this.Bb); + case 4: + return d9(this.s); + case 5: + return d9(this.t); + case 6: + return TA(), !!this.$j(); + case 7: + return TA(), this.s >= 1; + case 8: + return t ? fcn(this) : this.r; + case 9: + return this.q; + } + return RY(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n), t, e); + }), + (Fjn.jh = function (n, t, e) { + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), Ten(this.Ab, n, e); + case 9: + return kF(this, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || this.zh(), t), 66) + .Nj() + .Rj(this, dtn(this), t - vF(this.zh()), n, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return !!this.Ab && 0 != this.Ab.i; + case 1: + return null != this.zb; + case 2: + return 0 == (256 & this.Bb); + case 3: + return 0 == (512 & this.Bb); + case 4: + return 0 != this.s; + case 5: + return 1 != this.t; + case 6: + return this.$j(); + case 7: + return this.s >= 1; + case 8: + return !!this.r && !this.q.e && 0 == pB(this.q).i; + case 9: + return !(!this.q || (this.r && !this.q.e && 0 == pB(this.q).i)); + } + return xX(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n)); + }), + (Fjn.sh = function (n, t) { + var e; + switch (n) { + case 0: + return ( + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + Hmn(this.Ab), + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + void jF(this.Ab, Yx(t, 14)) + ); + case 1: + return void this.Lh(lL(t)); + case 2: + return void s9(this, ny(hL(t))); + case 3: + return void l9(this, ny(hL(t))); + case 4: + return void _1(this, Yx(t, 19).a); + case 5: + return void this.ok(Yx(t, 19).a); + case 8: + return void a8(this, Yx(t, 138)); + case 9: + return void ((e = fun(this, Yx(t, 87), null)) && e.Fi()); + } + E7(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n), t); + }), + (Fjn.zh = function () { + return xjn(), Kat; + }), + (Fjn.Bh = function (n) { + var t; + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), void Hmn(this.Ab); + case 1: + return void this.Lh(null); + case 2: + return void s9(this, !0); + case 3: + return void l9(this, !0); + case 4: + return void _1(this, 0); + case 5: + return void this.ok(1); + case 8: + return void a8(this, null); + case 9: + return void ((t = fun(this, null, null)) && t.Fi()); + } + r9(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n)); + }), + (Fjn.Gh = function () { + fcn(this), (this.Bb |= 1); + }), + (Fjn.Yj = function () { + return fcn(this); + }), + (Fjn.Zj = function () { + return this.t; + }), + (Fjn.$j = function () { + var n; + return (n = this.t) > 1 || -1 == n; + }), + (Fjn.hi = function () { + return 0 != (512 & this.Bb); + }), + (Fjn.nk = function (n, t) { + return z8(this, n, t); + }), + (Fjn.ok = function (n) { + F1(this, n); + }), + (Fjn.Ib = function () { + return Sfn(this); + }), + (Fjn.s = 0), + (Fjn.t = 1), + EF(PNn, "ETypedElementImpl", 284), + Wfn(449, 284, { + 105: 1, + 92: 1, + 90: 1, + 147: 1, + 191: 1, + 56: 1, + 170: 1, + 66: 1, + 108: 1, + 472: 1, + 49: 1, + 97: 1, + 150: 1, + 449: 1, + 284: 1, + 114: 1, + 115: 1, + 677: 1, + }), + (Fjn.Qg = function (n) { + return Arn(this, n); + }), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), this.Ab; + case 1: + return this.zb; + case 2: + return TA(), 0 != (256 & this.Bb); + case 3: + return TA(), 0 != (512 & this.Bb); + case 4: + return d9(this.s); + case 5: + return d9(this.t); + case 6: + return TA(), !!this.$j(); + case 7: + return TA(), this.s >= 1; + case 8: + return t ? fcn(this) : this.r; + case 9: + return this.q; + case 10: + return TA(), 0 != (this.Bb & DNn); + case 11: + return TA(), 0 != (this.Bb & FDn); + case 12: + return TA(), 0 != (this.Bb & nMn); + case 13: + return this.j; + case 14: + return Pbn(this); + case 15: + return TA(), 0 != (this.Bb & _Dn); + case 16: + return TA(), 0 != (this.Bb & MEn); + case 17: + return HG(this); + } + return RY(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n), t, e); + }), + (Fjn.hh = function (n, t, e) { + var i; + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), wnn(this.Ab, n, e); + case 17: + return this.Cb && (e = (i = this.Db >> 16) >= 0 ? Arn(this, e) : this.Cb.ih(this, -1 - i, null, e)), opn(this, n, 17, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || this.zh(), t), 66) + .Nj() + .Qj(this, dtn(this), t - vF(this.zh()), n, e); + }), + (Fjn.jh = function (n, t, e) { + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), Ten(this.Ab, n, e); + case 9: + return kF(this, e); + case 17: + return opn(this, null, 17, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || this.zh(), t), 66) + .Nj() + .Rj(this, dtn(this), t - vF(this.zh()), n, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return !!this.Ab && 0 != this.Ab.i; + case 1: + return null != this.zb; + case 2: + return 0 == (256 & this.Bb); + case 3: + return 0 == (512 & this.Bb); + case 4: + return 0 != this.s; + case 5: + return 1 != this.t; + case 6: + return this.$j(); + case 7: + return this.s >= 1; + case 8: + return !!this.r && !this.q.e && 0 == pB(this.q).i; + case 9: + return !(!this.q || (this.r && !this.q.e && 0 == pB(this.q).i)); + case 10: + return 0 == (this.Bb & DNn); + case 11: + return 0 != (this.Bb & FDn); + case 12: + return 0 != (this.Bb & nMn); + case 13: + return null != this.j; + case 14: + return null != Pbn(this); + case 15: + return 0 != (this.Bb & _Dn); + case 16: + return 0 != (this.Bb & MEn); + case 17: + return !!HG(this); + } + return xX(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n)); + }), + (Fjn.sh = function (n, t) { + var e; + switch (n) { + case 0: + return ( + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + Hmn(this.Ab), + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + void jF(this.Ab, Yx(t, 14)) + ); + case 1: + return void yz(this, lL(t)); + case 2: + return void s9(this, ny(hL(t))); + case 3: + return void l9(this, ny(hL(t))); + case 4: + return void _1(this, Yx(t, 19).a); + case 5: + return void this.ok(Yx(t, 19).a); + case 8: + return void a8(this, Yx(t, 138)); + case 9: + return void ((e = fun(this, Yx(t, 87), null)) && e.Fi()); + case 10: + return void x9(this, ny(hL(t))); + case 11: + return void K9(this, ny(hL(t))); + case 12: + return void D9(this, ny(hL(t))); + case 13: + return void ZP(this, lL(t)); + case 15: + return void R9(this, ny(hL(t))); + case 16: + return void H9(this, ny(hL(t))); + } + E7(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n), t); + }), + (Fjn.zh = function () { + return xjn(), Rat; + }), + (Fjn.Bh = function (n) { + var t; + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), void Hmn(this.Ab); + case 1: + return CO(this.Cb, 88) && rhn(bV(Yx(this.Cb, 88)), 4), void E2(this, null); + case 2: + return void s9(this, !0); + case 3: + return void l9(this, !0); + case 4: + return void _1(this, 0); + case 5: + return void this.ok(1); + case 8: + return void a8(this, null); + case 9: + return void ((t = fun(this, null, null)) && t.Fi()); + case 10: + return void x9(this, !0); + case 11: + return void K9(this, !1); + case 12: + return void D9(this, !1); + case 13: + return (this.i = null), void J0(this, null); + case 15: + return void R9(this, !1); + case 16: + return void H9(this, !1); + } + r9(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n)); + }), + (Fjn.Gh = function () { + nH(PJ((wsn(), wut), this)), fcn(this), (this.Bb |= 1); + }), + (Fjn.Gj = function () { + return this.f; + }), + (Fjn.zj = function () { + return Pbn(this); + }), + (Fjn.Hj = function () { + return HG(this); + }), + (Fjn.Lj = function () { + return null; + }), + (Fjn.pk = function () { + return this.k; + }), + (Fjn.aj = function () { + return this.n; + }), + (Fjn.Mj = function () { + return fan(this); + }), + (Fjn.Nj = function () { + var n, t, e, i, r, c, a, u, o; + return ( + this.p || + ((null == (e = HG(this)).i && svn(e), e.i).length, + (i = this.Lj()) && vF(HG(i)), + (n = (a = (r = fcn(this)).Bj()) + ? 0 != (1 & a.i) + ? a == Vot + ? D_n + : a == Wot + ? U_n + : a == Zot + ? q_n + : a == Jot + ? H_n + : a == Qot + ? J_n + : a == nst + ? nFn + : a == Yot + ? __n + : B_n + : a + : null), + (t = Pbn(this)), + (u = r.zj()), + s7(this), + 0 != (this.Bb & MEn) && (((c = Dcn((wsn(), wut), e)) && c != this) || (c = Bz(PJ(wut, this)))) + ? (this.p = new zP(this, c)) + : this.$j() + ? this.rk() + ? i + ? 0 != (this.Bb & _Dn) + ? n + ? this.sk() + ? (this.p = new LH(47, n, this, i)) + : (this.p = new LH(5, n, this, i)) + : this.sk() + ? (this.p = new sW(46, this, i)) + : (this.p = new sW(4, this, i)) + : n + ? this.sk() + ? (this.p = new LH(49, n, this, i)) + : (this.p = new LH(7, n, this, i)) + : this.sk() + ? (this.p = new sW(48, this, i)) + : (this.p = new sW(6, this, i)) + : 0 != (this.Bb & _Dn) + ? n + ? n == i_n + ? (this.p = new _x(50, hct, this)) + : this.sk() + ? (this.p = new _x(43, n, this)) + : (this.p = new _x(1, n, this)) + : this.sk() + ? (this.p = new Hq(42, this)) + : (this.p = new Hq(0, this)) + : n + ? n == i_n + ? (this.p = new _x(41, hct, this)) + : this.sk() + ? (this.p = new _x(45, n, this)) + : (this.p = new _x(3, n, this)) + : this.sk() + ? (this.p = new Hq(44, this)) + : (this.p = new Hq(2, this)) + : CO(r, 148) + ? n == Xat + ? (this.p = new Hq(40, this)) + : 0 != (512 & this.Bb) + ? 0 != (this.Bb & _Dn) + ? (this.p = n ? new _x(9, n, this) : new Hq(8, this)) + : (this.p = n ? new _x(11, n, this) : new Hq(10, this)) + : 0 != (this.Bb & _Dn) + ? (this.p = n ? new _x(13, n, this) : new Hq(12, this)) + : (this.p = n ? new _x(15, n, this) : new Hq(14, this)) + : i + ? (o = i.t) > 1 || -1 == o + ? this.sk() + ? 0 != (this.Bb & _Dn) + ? (this.p = n ? new LH(25, n, this, i) : new sW(24, this, i)) + : (this.p = n ? new LH(27, n, this, i) : new sW(26, this, i)) + : 0 != (this.Bb & _Dn) + ? (this.p = n ? new LH(29, n, this, i) : new sW(28, this, i)) + : (this.p = n ? new LH(31, n, this, i) : new sW(30, this, i)) + : this.sk() + ? 0 != (this.Bb & _Dn) + ? (this.p = n ? new LH(33, n, this, i) : new sW(32, this, i)) + : (this.p = n ? new LH(35, n, this, i) : new sW(34, this, i)) + : 0 != (this.Bb & _Dn) + ? (this.p = n ? new LH(37, n, this, i) : new sW(36, this, i)) + : (this.p = n ? new LH(39, n, this, i) : new sW(38, this, i)) + : this.sk() + ? 0 != (this.Bb & _Dn) + ? (this.p = n ? new _x(17, n, this) : new Hq(16, this)) + : (this.p = n ? new _x(19, n, this) : new Hq(18, this)) + : 0 != (this.Bb & _Dn) + ? (this.p = n ? new _x(21, n, this) : new Hq(20, this)) + : (this.p = n ? new _x(23, n, this) : new Hq(22, this)) + : this.qk() + ? this.sk() + ? (this.p = new Fx(Yx(r, 26), this, i)) + : (this.p = new tG(Yx(r, 26), this, i)) + : CO(r, 148) + ? n == Xat + ? (this.p = new Hq(40, this)) + : 0 != (this.Bb & _Dn) + ? (this.p = n + ? new SK( + t, + u, + this, + (onn(), + a == Wot + ? rut + : a == Vot + ? Zat + : a == Qot + ? cut + : a == Zot + ? iut + : a == Jot + ? eut + : a == nst + ? uut + : a == Yot + ? nut + : a == Xot + ? tut + : aut), + ) + : new DH(Yx(r, 148), t, u, this)) + : (this.p = n + ? new MK( + t, + u, + this, + (onn(), + a == Wot + ? rut + : a == Vot + ? Zat + : a == Qot + ? cut + : a == Zot + ? iut + : a == Jot + ? eut + : a == nst + ? uut + : a == Yot + ? nut + : a == Xot + ? tut + : aut), + ) + : new xH(Yx(r, 148), t, u, this)) + : this.rk() + ? i + ? 0 != (this.Bb & _Dn) + ? this.sk() + ? (this.p = new Ux(Yx(r, 26), this, i)) + : (this.p = new zx(Yx(r, 26), this, i)) + : this.sk() + ? (this.p = new Gx(Yx(r, 26), this, i)) + : (this.p = new Bx(Yx(r, 26), this, i)) + : 0 != (this.Bb & _Dn) + ? this.sk() + ? (this.p = new V$(Yx(r, 26), this)) + : (this.p = new W$(Yx(r, 26), this)) + : this.sk() + ? (this.p = new X$(Yx(r, 26), this)) + : (this.p = new U$(Yx(r, 26), this)) + : this.sk() + ? i + ? 0 != (this.Bb & _Dn) + ? (this.p = new Xx(Yx(r, 26), this, i)) + : (this.p = new Hx(Yx(r, 26), this, i)) + : 0 != (this.Bb & _Dn) + ? (this.p = new Y$(Yx(r, 26), this)) + : (this.p = new Q$(Yx(r, 26), this)) + : i + ? 0 != (this.Bb & _Dn) + ? (this.p = new Wx(Yx(r, 26), this, i)) + : (this.p = new qx(Yx(r, 26), this, i)) + : 0 != (this.Bb & _Dn) + ? (this.p = new J$(Yx(r, 26), this)) + : (this.p = new KR(Yx(r, 26), this))), + this.p + ); + }), + (Fjn.Ij = function () { + return 0 != (this.Bb & DNn); + }), + (Fjn.qk = function () { + return !1; + }), + (Fjn.rk = function () { + return !1; + }), + (Fjn.Jj = function () { + return 0 != (this.Bb & MEn); + }), + (Fjn.Oj = function () { + return GJ(this); + }), + (Fjn.sk = function () { + return !1; + }), + (Fjn.Kj = function () { + return 0 != (this.Bb & _Dn); + }), + (Fjn.tk = function (n) { + this.k = n; + }), + (Fjn.Lh = function (n) { + yz(this, n); + }), + (Fjn.Ib = function () { + return Qdn(this); + }), + (Fjn.e = !1), + (Fjn.n = 0), + EF(PNn, "EStructuralFeatureImpl", 449), + Wfn( + 322, + 449, + { + 105: 1, + 92: 1, + 90: 1, + 34: 1, + 147: 1, + 191: 1, + 56: 1, + 170: 1, + 66: 1, + 108: 1, + 472: 1, + 49: 1, + 97: 1, + 322: 1, + 150: 1, + 449: 1, + 284: 1, + 114: 1, + 115: 1, + 677: 1, + }, + qv, + ), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), this.Ab; + case 1: + return this.zb; + case 2: + return TA(), 0 != (256 & this.Bb); + case 3: + return TA(), 0 != (512 & this.Bb); + case 4: + return d9(this.s); + case 5: + return d9(this.t); + case 6: + return TA(), !!Bhn(this); + case 7: + return TA(), this.s >= 1; + case 8: + return t ? fcn(this) : this.r; + case 9: + return this.q; + case 10: + return TA(), 0 != (this.Bb & DNn); + case 11: + return TA(), 0 != (this.Bb & FDn); + case 12: + return TA(), 0 != (this.Bb & nMn); + case 13: + return this.j; + case 14: + return Pbn(this); + case 15: + return TA(), 0 != (this.Bb & _Dn); + case 16: + return TA(), 0 != (this.Bb & MEn); + case 17: + return HG(this); + case 18: + return TA(), 0 != (this.Bb & MNn); + case 19: + return t ? v4(this) : uQ(this); + } + return RY(this, n - vF((xjn(), vat)), CZ(Yx(H3(this, 16), 26) || vat, n), t, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return !!this.Ab && 0 != this.Ab.i; + case 1: + return null != this.zb; + case 2: + return 0 == (256 & this.Bb); + case 3: + return 0 == (512 & this.Bb); + case 4: + return 0 != this.s; + case 5: + return 1 != this.t; + case 6: + return Bhn(this); + case 7: + return this.s >= 1; + case 8: + return !!this.r && !this.q.e && 0 == pB(this.q).i; + case 9: + return !(!this.q || (this.r && !this.q.e && 0 == pB(this.q).i)); + case 10: + return 0 == (this.Bb & DNn); + case 11: + return 0 != (this.Bb & FDn); + case 12: + return 0 != (this.Bb & nMn); + case 13: + return null != this.j; + case 14: + return null != Pbn(this); + case 15: + return 0 != (this.Bb & _Dn); + case 16: + return 0 != (this.Bb & MEn); + case 17: + return !!HG(this); + case 18: + return 0 != (this.Bb & MNn); + case 19: + return !!uQ(this); + } + return xX(this, n - vF((xjn(), vat)), CZ(Yx(H3(this, 16), 26) || vat, n)); + }), + (Fjn.sh = function (n, t) { + var e; + switch (n) { + case 0: + return ( + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + Hmn(this.Ab), + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + void jF(this.Ab, Yx(t, 14)) + ); + case 1: + return void yz(this, lL(t)); + case 2: + return void s9(this, ny(hL(t))); + case 3: + return void l9(this, ny(hL(t))); + case 4: + return void _1(this, Yx(t, 19).a); + case 5: + return void Ck(this, Yx(t, 19).a); + case 8: + return void a8(this, Yx(t, 138)); + case 9: + return void ((e = fun(this, Yx(t, 87), null)) && e.Fi()); + case 10: + return void x9(this, ny(hL(t))); + case 11: + return void K9(this, ny(hL(t))); + case 12: + return void D9(this, ny(hL(t))); + case 13: + return void ZP(this, lL(t)); + case 15: + return void R9(this, ny(hL(t))); + case 16: + return void H9(this, ny(hL(t))); + case 18: + return void q9(this, ny(hL(t))); + } + E7(this, n - vF((xjn(), vat)), CZ(Yx(H3(this, 16), 26) || vat, n), t); + }), + (Fjn.zh = function () { + return xjn(), vat; + }), + (Fjn.Bh = function (n) { + var t; + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), void Hmn(this.Ab); + case 1: + return CO(this.Cb, 88) && rhn(bV(Yx(this.Cb, 88)), 4), void E2(this, null); + case 2: + return void s9(this, !0); + case 3: + return void l9(this, !0); + case 4: + return void _1(this, 0); + case 5: + return (this.b = 0), void F1(this, 1); + case 8: + return void a8(this, null); + case 9: + return void ((t = fun(this, null, null)) && t.Fi()); + case 10: + return void x9(this, !0); + case 11: + return void K9(this, !1); + case 12: + return void D9(this, !1); + case 13: + return (this.i = null), void J0(this, null); + case 15: + return void R9(this, !1); + case 16: + return void H9(this, !1); + case 18: + return void q9(this, !1); + } + r9(this, n - vF((xjn(), vat)), CZ(Yx(H3(this, 16), 26) || vat, n)); + }), + (Fjn.Gh = function () { + v4(this), nH(PJ((wsn(), wut), this)), fcn(this), (this.Bb |= 1); + }), + (Fjn.$j = function () { + return Bhn(this); + }), + (Fjn.nk = function (n, t) { + return (this.b = 0), (this.a = null), z8(this, n, t); + }), + (Fjn.ok = function (n) { + Ck(this, n); + }), + (Fjn.Ib = function () { + var n; + return 0 != (64 & this.Db) + ? Qdn(this) + : (((n = new MA(Qdn(this))).a += " (iD: "), nj(n, 0 != (this.Bb & MNn)), (n.a += ")"), n.a); + }), + (Fjn.b = 0), + EF(PNn, "EAttributeImpl", 322), + Wfn(351, 438, { + 105: 1, + 92: 1, + 90: 1, + 138: 1, + 147: 1, + 191: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 351: 1, + 150: 1, + 114: 1, + 115: 1, + 676: 1, + }), + (Fjn.uk = function (n) { + return n.Tg() == this; + }), + (Fjn.Qg = function (n) { + return prn(this, n); + }), + (Fjn.Rg = function (n, t) { + (this.w = null), (this.Db = (t << 16) | (255 & this.Db)), (this.Cb = n); + }), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), this.Ab; + case 1: + return this.zb; + case 2: + return null != this.D ? this.D : this.B; + case 3: + return frn(this); + case 4: + return this.zj(); + case 5: + return this.F; + case 6: + return t ? i1(this) : BG(this); + case 7: + return !this.A && (this.A = new VO(zat, this, 7)), this.A; + } + return RY(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n), t, e); + }), + (Fjn.hh = function (n, t, e) { + var i; + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), wnn(this.Ab, n, e); + case 6: + return this.Cb && (e = (i = this.Db >> 16) >= 0 ? prn(this, e) : this.Cb.ih(this, -1 - i, null, e)), opn(this, n, 6, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || this.zh(), t), 66) + .Nj() + .Qj(this, dtn(this), t - vF(this.zh()), n, e); + }), + (Fjn.jh = function (n, t, e) { + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), Ten(this.Ab, n, e); + case 6: + return opn(this, null, 6, e); + case 7: + return !this.A && (this.A = new VO(zat, this, 7)), Ten(this.A, n, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || this.zh(), t), 66) + .Nj() + .Rj(this, dtn(this), t - vF(this.zh()), n, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return !!this.Ab && 0 != this.Ab.i; + case 1: + return null != this.zb; + case 2: + return null != this.D && this.D == this.F; + case 3: + return !!frn(this); + case 4: + return null != this.zj(); + case 5: + return null != this.F && this.F != this.D && this.F != this.B; + case 6: + return !!BG(this); + case 7: + return !!this.A && 0 != this.A.i; + } + return xX(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n)); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 0: + return ( + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + Hmn(this.Ab), + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + void jF(this.Ab, Yx(t, 14)) + ); + case 1: + return void kz(this, lL(t)); + case 2: + return void MC(this, lL(t)); + case 5: + return void uyn(this, lL(t)); + case 7: + return ( + !this.A && (this.A = new VO(zat, this, 7)), + Hmn(this.A), + !this.A && (this.A = new VO(zat, this, 7)), + void jF(this.A, Yx(t, 14)) + ); + } + E7(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n), t); + }), + (Fjn.zh = function () { + return xjn(), yat; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), void Hmn(this.Ab); + case 1: + return CO(this.Cb, 179) && (Yx(this.Cb, 179).tb = null), void E2(this, null); + case 2: + return j6(this, null), void B1(this, this.D); + case 5: + return void uyn(this, null); + case 7: + return !this.A && (this.A = new VO(zat, this, 7)), void Hmn(this.A); + } + r9(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n)); + }), + (Fjn.yj = function () { + var n; + return -1 == this.G && (this.G = (n = i1(this)) ? Ren(n.Mh(), this) : -1), this.G; + }), + (Fjn.zj = function () { + return null; + }), + (Fjn.Aj = function () { + return i1(this); + }), + (Fjn.vk = function () { + return this.v; + }), + (Fjn.Bj = function () { + return frn(this); + }), + (Fjn.Cj = function () { + return null != this.D ? this.D : this.B; + }), + (Fjn.Dj = function () { + return this.F; + }), + (Fjn.wj = function (n) { + return Ypn(this, n); + }), + (Fjn.wk = function (n) { + this.v = n; + }), + (Fjn.xk = function (n) { + N2(this, n); + }), + (Fjn.yk = function (n) { + this.C = n; + }), + (Fjn.Lh = function (n) { + kz(this, n); + }), + (Fjn.Ib = function () { + return nnn(this); + }), + (Fjn.C = null), + (Fjn.D = null), + (Fjn.G = -1), + EF(PNn, "EClassifierImpl", 351), + Wfn( + 88, + 351, + { + 105: 1, + 92: 1, + 90: 1, + 26: 1, + 138: 1, + 147: 1, + 191: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 88: 1, + 351: 1, + 150: 1, + 473: 1, + 114: 1, + 115: 1, + 676: 1, + }, + Rf, + ), + (Fjn.uk = function (n) { + return (function (n, t) { + return t == n || Fcn(mbn(t), n); + })(this, n.Tg()); + }), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), this.Ab; + case 1: + return this.zb; + case 2: + return null != this.D ? this.D : this.B; + case 3: + return frn(this); + case 4: + return null; + case 5: + return this.F; + case 6: + return t ? i1(this) : BG(this); + case 7: + return !this.A && (this.A = new VO(zat, this, 7)), this.A; + case 8: + return TA(), 0 != (256 & this.Bb); + case 9: + return TA(), 0 != (512 & this.Bb); + case 10: + return Iq(this); + case 11: + return !this.q && (this.q = new m_(fat, this, 11, 10)), this.q; + case 12: + return emn(this); + case 13: + return Uvn(this); + case 14: + return Uvn(this), this.r; + case 15: + return emn(this), this.k; + case 16: + return $sn(this); + case 17: + return Avn(this); + case 18: + return svn(this); + case 19: + return mbn(this); + case 20: + return emn(this), this.o; + case 21: + return !this.s && (this.s = new m_(tat, this, 21, 17)), this.s; + case 22: + return tW(this); + case 23: + return Edn(this); + } + return RY(this, n - vF((xjn(), mat)), CZ(Yx(H3(this, 16), 26) || mat, n), t, e); + }), + (Fjn.hh = function (n, t, e) { + var i; + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), wnn(this.Ab, n, e); + case 6: + return this.Cb && (e = (i = this.Db >> 16) >= 0 ? prn(this, e) : this.Cb.ih(this, -1 - i, null, e)), opn(this, n, 6, e); + case 11: + return !this.q && (this.q = new m_(fat, this, 11, 10)), wnn(this.q, n, e); + case 21: + return !this.s && (this.s = new m_(tat, this, 21, 17)), wnn(this.s, n, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (xjn(), mat), t), 66) + .Nj() + .Qj(this, dtn(this), t - vF((xjn(), mat)), n, e); + }), + (Fjn.jh = function (n, t, e) { + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), Ten(this.Ab, n, e); + case 6: + return opn(this, null, 6, e); + case 7: + return !this.A && (this.A = new VO(zat, this, 7)), Ten(this.A, n, e); + case 11: + return !this.q && (this.q = new m_(fat, this, 11, 10)), Ten(this.q, n, e); + case 21: + return !this.s && (this.s = new m_(tat, this, 21, 17)), Ten(this.s, n, e); + case 22: + return Ten(tW(this), n, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (xjn(), mat), t), 66) + .Nj() + .Rj(this, dtn(this), t - vF((xjn(), mat)), n, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return !!this.Ab && 0 != this.Ab.i; + case 1: + return null != this.zb; + case 2: + return null != this.D && this.D == this.F; + case 3: + return !!frn(this); + case 4: + return !1; + case 5: + return null != this.F && this.F != this.D && this.F != this.B; + case 6: + return !!BG(this); + case 7: + return !!this.A && 0 != this.A.i; + case 8: + return 0 != (256 & this.Bb); + case 9: + return 0 != (512 & this.Bb); + case 10: + return !(!this.u || 0 == tW(this.u.a).i || (this.n && sin(this.n))); + case 11: + return !!this.q && 0 != this.q.i; + case 12: + return 0 != emn(this).i; + case 13: + return 0 != Uvn(this).i; + case 14: + return Uvn(this), 0 != this.r.i; + case 15: + return emn(this), 0 != this.k.i; + case 16: + return 0 != $sn(this).i; + case 17: + return 0 != Avn(this).i; + case 18: + return 0 != svn(this).i; + case 19: + return 0 != mbn(this).i; + case 20: + return emn(this), !!this.o; + case 21: + return !!this.s && 0 != this.s.i; + case 22: + return !!this.n && sin(this.n); + case 23: + return 0 != Edn(this).i; + } + return xX(this, n - vF((xjn(), mat)), CZ(Yx(H3(this, 16), 26) || mat, n)); + }), + (Fjn.oh = function (n) { + return (null == this.i || (this.q && 0 != this.q.i) ? null : Ybn(this, n)) || jkn(this, n); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 0: + return ( + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + Hmn(this.Ab), + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + void jF(this.Ab, Yx(t, 14)) + ); + case 1: + return void kz(this, lL(t)); + case 2: + return void MC(this, lL(t)); + case 5: + return void uyn(this, lL(t)); + case 7: + return ( + !this.A && (this.A = new VO(zat, this, 7)), + Hmn(this.A), + !this.A && (this.A = new VO(zat, this, 7)), + void jF(this.A, Yx(t, 14)) + ); + case 8: + return void h9(this, ny(hL(t))); + case 9: + return void b9(this, ny(hL(t))); + case 10: + return Wmn(Iq(this)), void jF(Iq(this), Yx(t, 14)); + case 11: + return ( + !this.q && (this.q = new m_(fat, this, 11, 10)), + Hmn(this.q), + !this.q && (this.q = new m_(fat, this, 11, 10)), + void jF(this.q, Yx(t, 14)) + ); + case 21: + return ( + !this.s && (this.s = new m_(tat, this, 21, 17)), + Hmn(this.s), + !this.s && (this.s = new m_(tat, this, 21, 17)), + void jF(this.s, Yx(t, 14)) + ); + case 22: + return Hmn(tW(this)), void jF(tW(this), Yx(t, 14)); + } + E7(this, n - vF((xjn(), mat)), CZ(Yx(H3(this, 16), 26) || mat, n), t); + }), + (Fjn.zh = function () { + return xjn(), mat; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), void Hmn(this.Ab); + case 1: + return CO(this.Cb, 179) && (Yx(this.Cb, 179).tb = null), void E2(this, null); + case 2: + return j6(this, null), void B1(this, this.D); + case 5: + return void uyn(this, null); + case 7: + return !this.A && (this.A = new VO(zat, this, 7)), void Hmn(this.A); + case 8: + return void h9(this, !1); + case 9: + return void b9(this, !1); + case 10: + return void (this.u && Wmn(this.u)); + case 11: + return !this.q && (this.q = new m_(fat, this, 11, 10)), void Hmn(this.q); + case 21: + return !this.s && (this.s = new m_(tat, this, 21, 17)), void Hmn(this.s); + case 22: + return void (this.n && Hmn(this.n)); + } + r9(this, n - vF((xjn(), mat)), CZ(Yx(H3(this, 16), 26) || mat, n)); + }), + (Fjn.Gh = function () { + var n, t; + if ( + (emn(this), + Uvn(this), + $sn(this), + Avn(this), + svn(this), + mbn(this), + Edn(this), + xV( + (function (n) { + return !n.c && (n.c = new Bo()), n.c; + })(bV(this)), + ), + this.s) + ) + for (n = 0, t = this.s.i; n < t; ++n) v$(c1(this.s, n)); + if (this.q) for (n = 0, t = this.q.i; n < t; ++n) v$(c1(this.q, n)); + U8((wsn(), wut), this).ne(), (this.Bb |= 1); + }), + (Fjn.Ib = function () { + return gan(this); + }), + (Fjn.k = null), + (Fjn.r = null), + EF(PNn, "EClassImpl", 88), + Wfn(1994, 1993, YDn), + (Fjn.Vh = function (n, t) { + return tvn(this, n, t); + }), + (Fjn.Wh = function (n) { + return tvn(this, this.i, n); + }), + (Fjn.Xh = function (n, t) { + Afn(this, n, t); + }), + (Fjn.Yh = function (n) { + Kfn(this, n); + }), + (Fjn.lk = function (n, t) { + return wnn(this, n, t); + }), + (Fjn.pi = function (n) { + return AY(this, n); + }), + (Fjn.mk = function (n, t) { + return Ten(this, n, t); + }), + (Fjn.mi = function (n, t) { + return Pvn(this, n, t); + }), + (Fjn.Zh = function () { + return new u$(this); + }), + (Fjn.$h = function () { + return new o$(this); + }), + (Fjn._h = function (n) { + return b0(this, n); + }), + EF(xDn, "NotifyingInternalEListImpl", 1994), + Wfn(622, 1994, JDn), + (Fjn.Hc = function (n) { + return zmn(this, n); + }), + (Fjn.Zi = function (n, t, e, i, r) { + return zG(this, n, t, e, i, r); + }), + (Fjn.$i = function (n) { + Xp(this, n); + }), + (Fjn.Wj = function (n) { + return this; + }), + (Fjn.ak = function () { + return CZ(this.e.Tg(), this.aj()); + }), + (Fjn._i = function () { + return this.ak(); + }), + (Fjn.aj = function () { + return tnn(this.e.Tg(), this.ak()); + }), + (Fjn.zk = function () { + return Yx(this.ak().Yj(), 26).Bj(); + }), + (Fjn.Ak = function () { + return nin(Yx(this.ak(), 18)).n; + }), + (Fjn.Ai = function () { + return this.e; + }), + (Fjn.Bk = function () { + return !0; + }), + (Fjn.Ck = function () { + return !1; + }), + (Fjn.Dk = function () { + return !1; + }), + (Fjn.Ek = function () { + return !1; + }), + (Fjn.Xc = function (n) { + return Ren(this, n); + }), + (Fjn.cj = function (n, t) { + var e; + return ( + (e = Yx(n, 49)), + this.Dk() + ? this.Bk() + ? e.gh(this.e, this.Ak(), this.zk(), t) + : e.gh(this.e, tnn(e.Tg(), nin(Yx(this.ak(), 18))), null, t) + : e.gh(this.e, -1 - this.aj(), null, t) + ); + }), + (Fjn.dj = function (n, t) { + var e; + return ( + (e = Yx(n, 49)), + this.Dk() + ? this.Bk() + ? e.ih(this.e, this.Ak(), this.zk(), t) + : e.ih(this.e, tnn(e.Tg(), nin(Yx(this.ak(), 18))), null, t) + : e.ih(this.e, -1 - this.aj(), null, t) + ); + }), + (Fjn.rk = function () { + return !1; + }), + (Fjn.Fk = function () { + return !0; + }), + (Fjn.wj = function (n) { + return _X(this.d, n); + }), + (Fjn.ej = function () { + return gC(this.e); + }), + (Fjn.fj = function () { + return 0 != this.i; + }), + (Fjn.ri = function (n) { + return H1(this.d, n); + }), + (Fjn.li = function (n, t) { + return this.Fk() && this.Ek() ? $fn(this, n, Yx(t, 56)) : t; + }), + (Fjn.Gk = function (n) { + return n.kh() ? P8(this.e, Yx(n, 49)) : n; + }), + (Fjn.Wb = function (n) { + EO(this, n); + }), + (Fjn.Pc = function () { + return LY(this); + }), + (Fjn.Qc = function (n) { + var t; + if (this.Ek()) for (t = this.i - 1; t >= 0; --t) c1(this, t); + return bnn(this, n); + }), + (Fjn.Xj = function () { + Hmn(this); + }), + (Fjn.oi = function (n, t) { + return z1(this, 0, t); + }), + EF(xDn, "EcoreEList", 622), + Wfn(496, 622, JDn, TD), + (Fjn.ai = function () { + return !1; + }), + (Fjn.aj = function () { + return this.c; + }), + (Fjn.bj = function () { + return !1; + }), + (Fjn.Fk = function () { + return !0; + }), + (Fjn.hi = function () { + return !0; + }), + (Fjn.li = function (n, t) { + return t; + }), + (Fjn.ni = function () { + return !1; + }), + (Fjn.c = 0), + EF(xDn, "EObjectEList", 496), + Wfn(85, 496, JDn, XO), + (Fjn.bj = function () { + return !0; + }), + (Fjn.Dk = function () { + return !1; + }), + (Fjn.rk = function () { + return !0; + }), + EF(xDn, "EObjectContainmentEList", 85), + Wfn(545, 85, JDn, WO), + (Fjn.ci = function () { + this.b = !0; + }), + (Fjn.fj = function () { + return this.b; + }), + (Fjn.Xj = function () { + var n; + Hmn(this), gC(this.e) ? ((n = this.b), (this.b = !1), K3(this.e, new OV(this.e, 2, this.c, n, !1))) : (this.b = !1); + }), + (Fjn.b = !1), + EF(xDn, "EObjectContainmentEList/Unsettable", 545), + Wfn(1140, 545, JDn, EK), + (Fjn.ii = function (n, t) { + var e, i; + return ( + (e = Yx(L9(this, n, t), 87)), + gC(this.e) && Xp(this, new jY(this.a, 7, (xjn(), kat), d9(t), CO((i = e.c), 88) ? Yx(i, 26) : Oat, n)), + e + ); + }), + (Fjn.jj = function (n, t) { + return (function (n, t, e) { + var i, r; + return (i = new yJ(n.e, 3, 10, null, CO((r = t.c), 88) ? Yx(r, 26) : (xjn(), Oat), Ren(n, t), !1)), e ? e.Ei(i) : (e = i), e; + })(this, Yx(n, 87), t); + }), + (Fjn.kj = function (n, t) { + return (function (n, t, e) { + var i, r; + return (i = new yJ(n.e, 4, 10, CO((r = t.c), 88) ? Yx(r, 26) : (xjn(), Oat), null, Ren(n, t), !1)), e ? e.Ei(i) : (e = i), e; + })(this, Yx(n, 87), t); + }), + (Fjn.lj = function (n, t, e) { + return (function (n, t, e, i) { + var r, c, a; + return ( + (r = new yJ( + n.e, + 1, + 10, + CO((a = t.c), 88) ? Yx(a, 26) : (xjn(), Oat), + CO((c = e.c), 88) ? Yx(c, 26) : (xjn(), Oat), + Ren(n, t), + !1, + )), + i ? i.Ei(r) : (i = r), + i + ); + })(this, Yx(n, 87), Yx(t, 87), e); + }), + (Fjn.Zi = function (n, t, e, i, r) { + switch (n) { + case 3: + return zG(this, n, t, e, i, this.i > 1); + case 5: + return zG(this, n, t, e, i, this.i - Yx(e, 15).gc() > 0); + default: + return new yJ(this.e, n, this.c, t, e, i, !0); + } + }), + (Fjn.ij = function () { + return !0; + }), + (Fjn.fj = function () { + return sin(this); + }), + (Fjn.Xj = function () { + Hmn(this); + }), + EF(PNn, "EClassImpl/1", 1140), + Wfn(1154, 1153, wDn), + (Fjn.ui = function (n) { + var t, e, i, r, c, a, u; + if (8 != (e = n.xi())) { + if ( + 0 == + (i = (function (n) { + switch (n.yi(null)) { + case 10: + return 0; + case 15: + return 1; + case 14: + return 2; + case 11: + return 3; + case 21: + return 4; + } + return -1; + })(n)) + ) + switch (e) { + case 1: + case 9: + null != (u = n.Bi()) && (!(t = bV(Yx(u, 473))).c && (t.c = new Bo()), qJ(t.c, n.Ai())), + null != (a = n.zi()) && + 0 == (1 & (r = Yx(a, 473)).Bb) && + (!(t = bV(r)).c && (t.c = new Bo()), fY(t.c, Yx(n.Ai(), 26))); + break; + case 3: + null != (a = n.zi()) && 0 == (1 & (r = Yx(a, 473)).Bb) && (!(t = bV(r)).c && (t.c = new Bo()), fY(t.c, Yx(n.Ai(), 26))); + break; + case 5: + if (null != (a = n.zi())) + for (c = Yx(a, 14).Kc(); c.Ob(); ) + 0 == (1 & (r = Yx(c.Pb(), 473)).Bb) && (!(t = bV(r)).c && (t.c = new Bo()), fY(t.c, Yx(n.Ai(), 26))); + break; + case 4: + null != (u = n.Bi()) && 0 == (1 & (r = Yx(u, 473)).Bb) && (!(t = bV(r)).c && (t.c = new Bo()), qJ(t.c, n.Ai())); + break; + case 6: + if (null != (u = n.Bi())) + for (c = Yx(u, 14).Kc(); c.Ob(); ) + 0 == (1 & (r = Yx(c.Pb(), 473)).Bb) && (!(t = bV(r)).c && (t.c = new Bo()), qJ(t.c, n.Ai())); + } + this.Hk(i); + } + }), + (Fjn.Hk = function (n) { + Gdn(this, n); + }), + (Fjn.b = 63), + EF(PNn, "ESuperAdapter", 1154), + Wfn(1155, 1154, wDn, Kg), + (Fjn.Hk = function (n) { + rhn(this, n); + }), + EF(PNn, "EClassImpl/10", 1155), + Wfn(1144, 696, JDn), + (Fjn.Vh = function (n, t) { + return hun(this, n, t); + }), + (Fjn.Wh = function (n) { + return $in(this, n); + }), + (Fjn.Xh = function (n, t) { + X8(this, n, t); + }), + (Fjn.Yh = function (n) { + NV(this, n); + }), + (Fjn.pi = function (n) { + return AY(this, n); + }), + (Fjn.mi = function (n, t) { + return HJ(this, n, t); + }), + (Fjn.lk = function (n, t) { + throw hp(new xp()); + }), + (Fjn.Zh = function () { + return new u$(this); + }), + (Fjn.$h = function () { + return new o$(this); + }), + (Fjn._h = function (n) { + return b0(this, n); + }), + (Fjn.mk = function (n, t) { + throw hp(new xp()); + }), + (Fjn.Wj = function (n) { + return this; + }), + (Fjn.fj = function () { + return 0 != this.i; + }), + (Fjn.Wb = function (n) { + throw hp(new xp()); + }), + (Fjn.Xj = function () { + throw hp(new xp()); + }), + EF(xDn, "EcoreEList/UnmodifiableEList", 1144), + Wfn(319, 1144, JDn, HI), + (Fjn.ni = function () { + return !1; + }), + EF(xDn, "EcoreEList/UnmodifiableEList/FastCompare", 319), + Wfn(1147, 319, JDn, p5), + (Fjn.Xc = function (n) { + var t, e; + if (CO(n, 170) && -1 != (t = Yx(n, 170).aj())) for (e = this.i; t < e; ++t) if (iI(this.g[t]) === iI(n)) return t; + return -1; + }), + EF(PNn, "EClassImpl/1EAllStructuralFeaturesList", 1147), + Wfn(1141, 497, Mxn, Eo), + (Fjn.ri = function (n) { + return VQ(hat, eRn, 87, n, 0, 1); + }), + (Fjn.ni = function () { + return !1; + }), + EF(PNn, "EClassImpl/1EGenericSuperTypeEList", 1141), + Wfn(623, 497, Mxn, To), + (Fjn.ri = function (n) { + return VQ(tat, VDn, 170, n, 0, 1); + }), + (Fjn.ni = function () { + return !1; + }), + EF(PNn, "EClassImpl/1EStructuralFeatureUniqueEList", 623), + Wfn(741, 497, Mxn, Mo), + (Fjn.ri = function (n) { + return VQ(bat, VDn, 18, n, 0, 1); + }), + (Fjn.ni = function () { + return !1; + }), + EF(PNn, "EClassImpl/1ReferenceList", 741), + Wfn(1142, 497, Mxn, _g), + (Fjn.bi = function (n, t) { + !(function (n, t) { + 0 != (t.Bb & MNn) && !n.a.o && (n.a.o = t); + })(this, Yx(t, 34)); + }), + (Fjn.ri = function (n) { + return VQ(eat, VDn, 34, n, 0, 1); + }), + (Fjn.ni = function () { + return !1; + }), + EF(PNn, "EClassImpl/2", 1142), + Wfn(1143, 497, Mxn, So), + (Fjn.ri = function (n) { + return VQ(eat, VDn, 34, n, 0, 1); + }), + (Fjn.ni = function () { + return !1; + }), + EF(PNn, "EClassImpl/3", 1143), + Wfn(1145, 319, JDn, PD), + (Fjn.Fc = function (n) { + return (function (n, t) { + return oE(), fY(aq(n.a), t); + })(this, Yx(n, 34)); + }), + (Fjn.Yh = function (n) { + !(function (n, t) { + Kfn(aq(n.a), t); + })(this, Yx(n, 34)); + }), + EF(PNn, "EClassImpl/4", 1145), + Wfn(1146, 319, JDn, ID), + (Fjn.Fc = function (n) { + return (function (n, t) { + return oE(), fY(aq(n.a), t); + })(this, Yx(n, 18)); + }), + (Fjn.Yh = function (n) { + !(function (n, t) { + Kfn(aq(n.a), t); + })(this, Yx(n, 18)); + }), + EF(PNn, "EClassImpl/5", 1146), + Wfn(1148, 497, Mxn, Po), + (Fjn.ri = function (n) { + return VQ(fat, QDn, 59, n, 0, 1); + }), + (Fjn.ni = function () { + return !1; + }), + EF(PNn, "EClassImpl/6", 1148), + Wfn(1149, 497, Mxn, Io), + (Fjn.ri = function (n) { + return VQ(bat, VDn, 18, n, 0, 1); + }), + (Fjn.ni = function () { + return !1; + }), + EF(PNn, "EClassImpl/7", 1149), + Wfn(1997, 1996, { + 3: 1, + 4: 1, + 20: 1, + 28: 1, + 52: 1, + 14: 1, + 15: 1, + 67: 1, + 58: 1, + 69: 1, + }), + (Fjn.Vh = function (n, t) { + return Dpn(this, n, t); + }), + (Fjn.Wh = function (n) { + return Dpn(this, this.Vi(), n); + }), + (Fjn.Xh = function (n, t) { + _fn(this, n, t); + }), + (Fjn.Yh = function (n) { + yfn(this, n); + }), + (Fjn.lk = function (n, t) { + return (function (n, t, e) { + var i, r, c; + return ( + n.ej() + ? ((i = n.Vi()), (c = n.fj()), ++n.j, n.Hi(i, n.oi(i, t)), (r = n.Zi(3, null, t, i, c)), e ? e.Ei(r) : (e = r)) + : xL(n, n.Vi(), t), + e + ); + })(this, n, t); + }), + (Fjn.mk = function (n, t) { + return (function (n, t, e) { + var i, r, c, a; + return ( + -1 != (i = n.Xc(t)) && + (n.ej() ? ((c = n.fj()), (a = uR(n, i)), (r = n.Zi(4, a, null, i, c)), e ? e.Ei(r) : (e = r)) : uR(n, i)), + e + ); + })(this, n, t); + }), + (Fjn.mi = function (n, t) { + return Rpn(this, n, t); + }), + (Fjn.pi = function (n) { + return this.Oi(n); + }), + (Fjn.Zh = function () { + return new u$(this); + }), + (Fjn.Gi = function () { + return this.Ji(); + }), + (Fjn.$h = function () { + return new o$(this); + }), + (Fjn._h = function (n) { + return b0(this, n); + }), + EF(xDn, "DelegatingNotifyingInternalEListImpl", 1997), + Wfn(742, 1997, iRn), + (Fjn.ai = function () { + var n; + return CO((n = CZ(Cq(this.b), this.aj()).Yj()), 148) && !CO(n, 457) && 0 == (1 & n.Bj().i); + }), + (Fjn.Hc = function (n) { + var t, e, i, r, c, a, u; + if (this.Fk()) { + if ((u = this.Vi()) > 4) { + if (!this.wj(n)) return !1; + if (this.rk()) { + if ( + ((a = + (t = (e = Yx(n, 49)).Ug()) == this.b && + (this.Dk() + ? e.Og(e.Vg(), Yx(CZ(Cq(this.b), this.aj()).Yj(), 26).Bj()) == nin(Yx(CZ(Cq(this.b), this.aj()), 18)).n + : -1 - e.Vg() == this.aj())), + this.Ek() && !a && !t && e.Zg()) + ) + for (i = 0; i < u; ++i) if (iI(u_(this, this.Oi(i))) === iI(n)) return !0; + return a; + } + if (this.Dk() && !this.Ck()) { + if (iI((r = Yx(n, 56).ah(nin(Yx(CZ(Cq(this.b), this.aj()), 18))))) === iI(this.b)) return !0; + if (null == r || !Yx(r, 56).kh()) return !1; + } + } + if (((c = this.Li(n)), this.Ek() && !c)) for (i = 0; i < u; ++i) if (iI((e = u_(this, this.Oi(i)))) === iI(n)) return !0; + return c; + } + return this.Li(n); + }), + (Fjn.Zi = function (n, t, e, i, r) { + return new yJ(this.b, n, this.aj(), t, e, i, r); + }), + (Fjn.$i = function (n) { + K3(this.b, n); + }), + (Fjn.Wj = function (n) { + return this; + }), + (Fjn._i = function () { + return CZ(Cq(this.b), this.aj()); + }), + (Fjn.aj = function () { + return tnn(Cq(this.b), CZ(Cq(this.b), this.aj())); + }), + (Fjn.Ai = function () { + return this.b; + }), + (Fjn.Bk = function () { + return !!CZ(Cq(this.b), this.aj()).Yj().Bj(); + }), + (Fjn.bj = function () { + var n; + return !(!CO((n = CZ(Cq(this.b), this.aj())), 99) || (0 == (Yx(n, 18).Bb & MNn) && !nin(Yx(n, 18)))); + }), + (Fjn.Ck = function () { + var n, t, e; + return !!CO((n = CZ(Cq(this.b), this.aj())), 99) && !!(t = nin(Yx(n, 18))) && ((e = t.t) > 1 || -1 == e); + }), + (Fjn.Dk = function () { + var n; + return !!CO((n = CZ(Cq(this.b), this.aj())), 99) && !!nin(Yx(n, 18)); + }), + (Fjn.Ek = function () { + var n; + return !!CO((n = CZ(Cq(this.b), this.aj())), 99) && 0 != (Yx(n, 18).Bb & eMn); + }), + (Fjn.Xc = function (n) { + var t, e, i; + if ((e = this.Qi(n)) >= 0) return e; + if (this.Fk()) for (t = 0, i = this.Vi(); t < i; ++t) if (iI(u_(this, this.Oi(t))) === iI(n)) return t; + return -1; + }), + (Fjn.cj = function (n, t) { + var e; + return ( + (e = Yx(n, 49)), + this.Dk() + ? this.Bk() + ? e.gh(this.b, nin(Yx(CZ(Cq(this.b), this.aj()), 18)).n, Yx(CZ(Cq(this.b), this.aj()).Yj(), 26).Bj(), t) + : e.gh(this.b, tnn(e.Tg(), nin(Yx(CZ(Cq(this.b), this.aj()), 18))), null, t) + : e.gh(this.b, -1 - this.aj(), null, t) + ); + }), + (Fjn.dj = function (n, t) { + var e; + return ( + (e = Yx(n, 49)), + this.Dk() + ? this.Bk() + ? e.ih(this.b, nin(Yx(CZ(Cq(this.b), this.aj()), 18)).n, Yx(CZ(Cq(this.b), this.aj()).Yj(), 26).Bj(), t) + : e.ih(this.b, tnn(e.Tg(), nin(Yx(CZ(Cq(this.b), this.aj()), 18))), null, t) + : e.ih(this.b, -1 - this.aj(), null, t) + ); + }), + (Fjn.rk = function () { + var n; + return !!CO((n = CZ(Cq(this.b), this.aj())), 99) && 0 != (Yx(n, 18).Bb & MNn); + }), + (Fjn.Fk = function () { + return CO(CZ(Cq(this.b), this.aj()).Yj(), 88); + }), + (Fjn.wj = function (n) { + return CZ(Cq(this.b), this.aj()).Yj().wj(n); + }), + (Fjn.ej = function () { + return gC(this.b); + }), + (Fjn.fj = function () { + return !this.Ri(); + }), + (Fjn.hi = function () { + return CZ(Cq(this.b), this.aj()).hi(); + }), + (Fjn.li = function (n, t) { + return hyn(this, n, t); + }), + (Fjn.Wb = function (n) { + Wmn(this), jF(this, Yx(n, 15)); + }), + (Fjn.Pc = function () { + var n; + if (this.Ek()) for (n = this.Vi() - 1; n >= 0; --n) hyn(this, n, this.Oi(n)); + return this.Wi(); + }), + (Fjn.Qc = function (n) { + var t; + if (this.Ek()) for (t = this.Vi() - 1; t >= 0; --t) hyn(this, t, this.Oi(t)); + return this.Xi(n); + }), + (Fjn.Xj = function () { + Wmn(this); + }), + (Fjn.oi = function (n, t) { + return $Y(this, 0, t); + }), + EF(xDn, "DelegatingEcoreEList", 742), + Wfn(1150, 742, iRn, qL), + (Fjn.Hi = function (n, t) { + !(function (n, t, e) { + y9(tW(n.a), t, Ez(e)); + })(this, n, Yx(t, 26)); + }), + (Fjn.Ii = function (n) { + !(function (n, t) { + fY(tW(n.a), Ez(t)); + })(this, Yx(n, 26)); + }), + (Fjn.Oi = function (n) { + var t; + return CO((t = Yx(c1(tW(this.a), n), 87).c), 88) ? Yx(t, 26) : (xjn(), Oat); + }), + (Fjn.Ti = function (n) { + var t; + return CO((t = Yx(tdn(tW(this.a), n), 87).c), 88) ? Yx(t, 26) : (xjn(), Oat); + }), + (Fjn.Ui = function (n, t) { + return (function (n, t, e) { + var i, r, c; + return ( + (0 != (64 & (c = CO((r = (i = Yx(c1(tW(n.a), t), 87)).c), 88) ? Yx(r, 26) : (xjn(), Oat)).Db) ? P8(n.b, c) : c) == e + ? Bpn(i) + : b1(i, e), + c + ); + })(this, n, Yx(t, 26)); + }), + (Fjn.ai = function () { + return !1; + }), + (Fjn.Zi = function (n, t, e, i, r) { + return null; + }), + (Fjn.Ji = function () { + return new Fg(this); + }), + (Fjn.Ki = function () { + Hmn(tW(this.a)); + }), + (Fjn.Li = function (n) { + return a9(this, n); + }), + (Fjn.Mi = function (n) { + var t; + for (t = n.Kc(); t.Ob(); ) if (!a9(this, t.Pb())) return !1; + return !0; + }), + (Fjn.Ni = function (n) { + var t, e, i; + if (CO(n, 15) && (i = Yx(n, 15)).gc() == tW(this.a).i) { + for (t = i.Kc(), e = new UO(this); t.Ob(); ) if (iI(t.Pb()) !== iI(hen(e))) return !1; + return !0; + } + return !1; + }), + (Fjn.Pi = function () { + var n, t, e, i; + for (t = 1, n = new UO(tW(this.a)); n.e != n.i.gc(); ) + t = 31 * t + ((e = CO((i = Yx(hen(n), 87).c), 88) ? Yx(i, 26) : (xjn(), Oat)) ? _A(e) : 0); + return t; + }), + (Fjn.Qi = function (n) { + var t, e, i, r; + for (i = 0, e = new UO(tW(this.a)); e.e != e.i.gc(); ) { + if (((t = Yx(hen(e), 87)), iI(n) === iI(CO((r = t.c), 88) ? Yx(r, 26) : (xjn(), Oat)))) return i; + ++i; + } + return -1; + }), + (Fjn.Ri = function () { + return 0 == tW(this.a).i; + }), + (Fjn.Si = function () { + return null; + }), + (Fjn.Vi = function () { + return tW(this.a).i; + }), + (Fjn.Wi = function () { + var n, t, e, i, r, c; + for (c = tW(this.a).i, r = VQ(UKn, iEn, 1, c, 5, 1), e = 0, t = new UO(tW(this.a)); t.e != t.i.gc(); ) + (n = Yx(hen(t), 87)), (r[e++] = CO((i = n.c), 88) ? Yx(i, 26) : (xjn(), Oat)); + return r; + }), + (Fjn.Xi = function (n) { + var t, e, i, r; + for ( + r = tW(this.a).i, n.length < r && (n = H1(V5(n).c, r)), n.length > r && DF(n, r, null), e = 0, t = new UO(tW(this.a)); + t.e != t.i.gc(); + + ) + DF(n, e++, CO((i = Yx(hen(t), 87).c), 88) ? Yx(i, 26) : (xjn(), Oat)); + return n; + }), + (Fjn.Yi = function () { + var n, t, e, i, r; + for ((r = new Cy()).a += "[", n = tW(this.a), t = 0, i = tW(this.a).i; t < i; ) + pI(r, xA(CO((e = Yx(c1(n, t), 87).c), 88) ? Yx(e, 26) : (xjn(), Oat))), ++t < i && (r.a += tEn); + return (r.a += "]"), r.a; + }), + (Fjn.$i = function (n) {}), + (Fjn.aj = function () { + return 10; + }), + (Fjn.Bk = function () { + return !0; + }), + (Fjn.bj = function () { + return !1; + }), + (Fjn.Ck = function () { + return !1; + }), + (Fjn.Dk = function () { + return !1; + }), + (Fjn.Ek = function () { + return !0; + }), + (Fjn.rk = function () { + return !1; + }), + (Fjn.Fk = function () { + return !0; + }), + (Fjn.wj = function (n) { + return CO(n, 88); + }), + (Fjn.fj = function () { + return !(!(n = this.a).u || 0 == tW(n.u.a).i || (n.n && sin(n.n))); + var n; + }), + (Fjn.hi = function () { + return !0; + }), + (Fjn.ni = function () { + return !0; + }), + EF(PNn, "EClassImpl/8", 1150), + Wfn(1151, 1964, WEn, Fg), + (Fjn.Zc = function (n) { + return b0(this.a, n); + }), + (Fjn.gc = function () { + return tW(this.a.a).i; + }), + EF(PNn, "EClassImpl/8/1", 1151), + Wfn(1152, 497, Mxn, Co), + (Fjn.ri = function (n) { + return VQ(iat, iEn, 138, n, 0, 1); + }), + (Fjn.ni = function () { + return !1; + }), + EF(PNn, "EClassImpl/9", 1152), + Wfn(1139, 53, pMn, Hv), + EF(PNn, "EClassImpl/MyHashSet", 1139), + Wfn( + 566, + 351, + { + 105: 1, + 92: 1, + 90: 1, + 138: 1, + 148: 1, + 834: 1, + 147: 1, + 191: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 351: 1, + 150: 1, + 114: 1, + 115: 1, + 676: 1, + }, + Bp, + ), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), this.Ab; + case 1: + return this.zb; + case 2: + return null != this.D ? this.D : this.B; + case 3: + return frn(this); + case 4: + return this.zj(); + case 5: + return this.F; + case 6: + return t ? i1(this) : BG(this); + case 7: + return !this.A && (this.A = new VO(zat, this, 7)), this.A; + case 8: + return TA(), 0 != (256 & this.Bb); + } + return RY(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n), t, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return !!this.Ab && 0 != this.Ab.i; + case 1: + return null != this.zb; + case 2: + return null != this.D && this.D == this.F; + case 3: + return !!frn(this); + case 4: + return null != this.zj(); + case 5: + return null != this.F && this.F != this.D && this.F != this.B; + case 6: + return !!BG(this); + case 7: + return !!this.A && 0 != this.A.i; + case 8: + return 0 == (256 & this.Bb); + } + return xX(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n)); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 0: + return ( + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + Hmn(this.Ab), + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + void jF(this.Ab, Yx(t, 14)) + ); + case 1: + return void kz(this, lL(t)); + case 2: + return void MC(this, lL(t)); + case 5: + return void uyn(this, lL(t)); + case 7: + return ( + !this.A && (this.A = new VO(zat, this, 7)), + Hmn(this.A), + !this.A && (this.A = new VO(zat, this, 7)), + void jF(this.A, Yx(t, 14)) + ); + case 8: + return void f9(this, ny(hL(t))); + } + E7(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n), t); + }), + (Fjn.zh = function () { + return xjn(), jat; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), void Hmn(this.Ab); + case 1: + return CO(this.Cb, 179) && (Yx(this.Cb, 179).tb = null), void E2(this, null); + case 2: + return j6(this, null), void B1(this, this.D); + case 5: + return void uyn(this, null); + case 7: + return !this.A && (this.A = new VO(zat, this, 7)), void Hmn(this.A); + case 8: + return void f9(this, !0); + } + r9(this, n - vF(this.zh()), CZ(Yx(H3(this, 16), 26) || this.zh(), n)); + }), + (Fjn.Gh = function () { + U8((wsn(), wut), this).ne(), (this.Bb |= 1); + }), + (Fjn.Fj = function () { + var n, t; + if (!this.c && !(n = Vln(i1(this))).dc()) for (t = n.Kc(); t.Ob(); ) dpn(this, lL(t.Pb())) && _9(this); + return this.b; + }), + (Fjn.zj = function () { + var n; + if (!this.e) { + n = null; + try { + n = frn(this); + } catch (n) { + if (!CO((n = j4(n)), 102)) throw hp(n); + } + (this.d = null), + n && + 0 != (1 & n.i) && + (this.d = + n == Vot + ? (TA(), $_n) + : n == Wot + ? d9(0) + : n == Zot + ? new ib(0) + : n == Jot + ? 0 + : n == Qot + ? ytn(0) + : n == nst + ? g9(0) + : n == Yot + ? iZ(0) + : k4(0)), + (this.e = !0); + } + return this.d; + }), + (Fjn.Ej = function () { + return 0 != (256 & this.Bb); + }), + (Fjn.Ik = function (n) { + n && (this.D = "org.eclipse.emf.common.util.AbstractEnumerator"); + }), + (Fjn.xk = function (n) { + N2(this, n), this.Ik(n); + }), + (Fjn.yk = function (n) { + (this.C = n), (this.e = !1); + }), + (Fjn.Ib = function () { + var n; + return 0 != (64 & this.Db) + ? nnn(this) + : (((n = new MA(nnn(this))).a += " (serializable: "), nj(n, 0 != (256 & this.Bb)), (n.a += ")"), n.a); + }), + (Fjn.c = !1), + (Fjn.d = null), + (Fjn.e = !1), + EF(PNn, "EDataTypeImpl", 566), + Wfn( + 457, + 566, + { + 105: 1, + 92: 1, + 90: 1, + 138: 1, + 148: 1, + 834: 1, + 671: 1, + 147: 1, + 191: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 351: 1, + 457: 1, + 150: 1, + 114: 1, + 115: 1, + 676: 1, + }, + Gv, + ), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), this.Ab; + case 1: + return this.zb; + case 2: + return null != this.D ? this.D : this.B; + case 3: + return frn(this); + case 4: + return x6(this); + case 5: + return this.F; + case 6: + return t ? i1(this) : BG(this); + case 7: + return !this.A && (this.A = new VO(zat, this, 7)), this.A; + case 8: + return TA(), 0 != (256 & this.Bb); + case 9: + return !this.a && (this.a = new m_(sat, this, 9, 5)), this.a; + } + return RY(this, n - vF((xjn(), Eat)), CZ(Yx(H3(this, 16), 26) || Eat, n), t, e); + }), + (Fjn.hh = function (n, t, e) { + var i; + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), wnn(this.Ab, n, e); + case 6: + return this.Cb && (e = (i = this.Db >> 16) >= 0 ? prn(this, e) : this.Cb.ih(this, -1 - i, null, e)), opn(this, n, 6, e); + case 9: + return !this.a && (this.a = new m_(sat, this, 9, 5)), wnn(this.a, n, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (xjn(), Eat), t), 66) + .Nj() + .Qj(this, dtn(this), t - vF((xjn(), Eat)), n, e); + }), + (Fjn.jh = function (n, t, e) { + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), Ten(this.Ab, n, e); + case 6: + return opn(this, null, 6, e); + case 7: + return !this.A && (this.A = new VO(zat, this, 7)), Ten(this.A, n, e); + case 9: + return !this.a && (this.a = new m_(sat, this, 9, 5)), Ten(this.a, n, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (xjn(), Eat), t), 66) + .Nj() + .Rj(this, dtn(this), t - vF((xjn(), Eat)), n, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return !!this.Ab && 0 != this.Ab.i; + case 1: + return null != this.zb; + case 2: + return null != this.D && this.D == this.F; + case 3: + return !!frn(this); + case 4: + return !!x6(this); + case 5: + return null != this.F && this.F != this.D && this.F != this.B; + case 6: + return !!BG(this); + case 7: + return !!this.A && 0 != this.A.i; + case 8: + return 0 == (256 & this.Bb); + case 9: + return !!this.a && 0 != this.a.i; + } + return xX(this, n - vF((xjn(), Eat)), CZ(Yx(H3(this, 16), 26) || Eat, n)); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 0: + return ( + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + Hmn(this.Ab), + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + void jF(this.Ab, Yx(t, 14)) + ); + case 1: + return void kz(this, lL(t)); + case 2: + return void MC(this, lL(t)); + case 5: + return void uyn(this, lL(t)); + case 7: + return ( + !this.A && (this.A = new VO(zat, this, 7)), + Hmn(this.A), + !this.A && (this.A = new VO(zat, this, 7)), + void jF(this.A, Yx(t, 14)) + ); + case 8: + return void f9(this, ny(hL(t))); + case 9: + return ( + !this.a && (this.a = new m_(sat, this, 9, 5)), + Hmn(this.a), + !this.a && (this.a = new m_(sat, this, 9, 5)), + void jF(this.a, Yx(t, 14)) + ); + } + E7(this, n - vF((xjn(), Eat)), CZ(Yx(H3(this, 16), 26) || Eat, n), t); + }), + (Fjn.zh = function () { + return xjn(), Eat; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), void Hmn(this.Ab); + case 1: + return CO(this.Cb, 179) && (Yx(this.Cb, 179).tb = null), void E2(this, null); + case 2: + return j6(this, null), void B1(this, this.D); + case 5: + return void uyn(this, null); + case 7: + return !this.A && (this.A = new VO(zat, this, 7)), void Hmn(this.A); + case 8: + return void f9(this, !0); + case 9: + return !this.a && (this.a = new m_(sat, this, 9, 5)), void Hmn(this.a); + } + r9(this, n - vF((xjn(), Eat)), CZ(Yx(H3(this, 16), 26) || Eat, n)); + }), + (Fjn.Gh = function () { + var n, t; + if (this.a) for (n = 0, t = this.a.i; n < t; ++n) v$(c1(this.a, n)); + U8((wsn(), wut), this).ne(), (this.Bb |= 1); + }), + (Fjn.zj = function () { + return x6(this); + }), + (Fjn.wj = function (n) { + return null != n; + }), + (Fjn.Ik = function (n) {}), + EF(PNn, "EEnumImpl", 457), + Wfn( + 573, + 438, + { + 105: 1, + 92: 1, + 90: 1, + 1940: 1, + 678: 1, + 147: 1, + 191: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 573: 1, + 150: 1, + 114: 1, + 115: 1, + }, + Fp, + ), + (Fjn.ne = function () { + return this.zb; + }), + (Fjn.Qg = function (n) { + return ncn(this, n); + }), + (Fjn._g = function (n, t, e) { + var i; + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), this.Ab; + case 1: + return this.zb; + case 2: + return d9(this.d); + case 3: + return this.b ? this.b : this.a; + case 4: + return null == (i = this.c) ? this.zb : i; + case 5: + return this.Db >> 16 == 5 ? Yx(this.Cb, 671) : null; + } + return RY(this, n - vF((xjn(), Tat)), CZ(Yx(H3(this, 16), 26) || Tat, n), t, e); + }), + (Fjn.hh = function (n, t, e) { + var i; + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), wnn(this.Ab, n, e); + case 5: + return this.Cb && (e = (i = this.Db >> 16) >= 0 ? ncn(this, e) : this.Cb.ih(this, -1 - i, null, e)), opn(this, n, 5, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (xjn(), Tat), t), 66) + .Nj() + .Qj(this, dtn(this), t - vF((xjn(), Tat)), n, e); + }), + (Fjn.jh = function (n, t, e) { + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), Ten(this.Ab, n, e); + case 5: + return opn(this, null, 5, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (xjn(), Tat), t), 66) + .Nj() + .Rj(this, dtn(this), t - vF((xjn(), Tat)), n, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return !!this.Ab && 0 != this.Ab.i; + case 1: + return null != this.zb; + case 2: + return 0 != this.d; + case 3: + return !!this.b; + case 4: + return null != this.c; + case 5: + return !(this.Db >> 16 != 5 || !Yx(this.Cb, 671)); + } + return xX(this, n - vF((xjn(), Tat)), CZ(Yx(H3(this, 16), 26) || Tat, n)); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 0: + return ( + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + Hmn(this.Ab), + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + void jF(this.Ab, Yx(t, 14)) + ); + case 1: + return void E2(this, lL(t)); + case 2: + return void K1(this, Yx(t, 19).a); + case 3: + return void hfn(this, Yx(t, 1940)); + case 4: + return void F0(this, lL(t)); + } + E7(this, n - vF((xjn(), Tat)), CZ(Yx(H3(this, 16), 26) || Tat, n), t); + }), + (Fjn.zh = function () { + return xjn(), Tat; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), void Hmn(this.Ab); + case 1: + return void E2(this, null); + case 2: + return void K1(this, 0); + case 3: + return void hfn(this, null); + case 4: + return void F0(this, null); + } + r9(this, n - vF((xjn(), Tat)), CZ(Yx(H3(this, 16), 26) || Tat, n)); + }), + (Fjn.Ib = function () { + var n; + return null == (n = this.c) ? this.zb : n; + }), + (Fjn.b = null), + (Fjn.c = null), + (Fjn.d = 0), + EF(PNn, "EEnumLiteralImpl", 573); + var Wat, + Vat, + Qat, + Yat = aR(PNn, "EFactoryImpl/InternalEDateTimeFormat"); + Wfn(489, 1, { 2015: 1 }, Bg), + EF(PNn, "EFactoryImpl/1ClientInternalEDateTimeFormat", 489), + Wfn( + 241, + 115, + { + 105: 1, + 92: 1, + 90: 1, + 87: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 241: 1, + 114: 1, + 115: 1, + }, + up, + ), + (Fjn.Sg = function (n, t, e) { + var i; + return (e = opn(this, n, t, e)), this.e && CO(n, 170) && (i = dbn(this, this.e)) != this.c && (e = zyn(this, i, e)), e; + }), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return this.f; + case 1: + return !this.d && (this.d = new XO(hat, this, 1)), this.d; + case 2: + return t ? Bpn(this) : this.c; + case 3: + return this.b; + case 4: + return this.e; + case 5: + return t ? win(this) : this.a; + } + return RY(this, n - vF((xjn(), Sat)), CZ(Yx(H3(this, 16), 26) || Sat, n), t, e); + }), + (Fjn.jh = function (n, t, e) { + switch (t) { + case 0: + return S8(this, null, e); + case 1: + return !this.d && (this.d = new XO(hat, this, 1)), Ten(this.d, n, e); + case 3: + return M8(this, null, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (xjn(), Sat), t), 66) + .Nj() + .Rj(this, dtn(this), t - vF((xjn(), Sat)), n, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return !!this.f; + case 1: + return !!this.d && 0 != this.d.i; + case 2: + return !!this.c; + case 3: + return !!this.b; + case 4: + return !!this.e; + case 5: + return !!this.a; + } + return xX(this, n - vF((xjn(), Sat)), CZ(Yx(H3(this, 16), 26) || Sat, n)); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 0: + return void man(this, Yx(t, 87)); + case 1: + return ( + !this.d && (this.d = new XO(hat, this, 1)), + Hmn(this.d), + !this.d && (this.d = new XO(hat, this, 1)), + void jF(this.d, Yx(t, 14)) + ); + case 3: + return void van(this, Yx(t, 87)); + case 4: + return void Xun(this, Yx(t, 836)); + case 5: + return void b1(this, Yx(t, 138)); + } + E7(this, n - vF((xjn(), Sat)), CZ(Yx(H3(this, 16), 26) || Sat, n), t); + }), + (Fjn.zh = function () { + return xjn(), Sat; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 0: + return void man(this, null); + case 1: + return !this.d && (this.d = new XO(hat, this, 1)), void Hmn(this.d); + case 3: + return void van(this, null); + case 4: + return void Xun(this, null); + case 5: + return void b1(this, null); + } + r9(this, n - vF((xjn(), Sat)), CZ(Yx(H3(this, 16), 26) || Sat, n)); + }), + (Fjn.Ib = function () { + var n; + return ((n = new SA(Kln(this))).a += " (expression: "), wmn(this, n), (n.a += ")"), n.a; + }), + EF(PNn, "EGenericTypeImpl", 241), + Wfn(1969, 1964, rRn), + (Fjn.Xh = function (n, t) { + DL(this, n, t); + }), + (Fjn.lk = function (n, t) { + return DL(this, this.gc(), n), t; + }), + (Fjn.pi = function (n) { + return ken(this.Gi(), n); + }), + (Fjn.Zh = function () { + return this.$h(); + }), + (Fjn.Gi = function () { + return new Qg(this); + }), + (Fjn.$h = function () { + return this._h(0); + }), + (Fjn._h = function (n) { + return this.Gi().Zc(n); + }), + (Fjn.mk = function (n, t) { + return V7(this, n, !0), t; + }), + (Fjn.ii = function (n, t) { + var e; + return (e = Urn(this, t)), this.Zc(n).Rb(e), e; + }), + (Fjn.ji = function (n, t) { + V7(this, t, !0), this.Zc(n).Rb(t); + }), + EF(xDn, "AbstractSequentialInternalEList", 1969), + Wfn(486, 1969, rRn, n$), + (Fjn.pi = function (n) { + return ken(this.Gi(), n); + }), + (Fjn.Zh = function () { + return null == this.b ? (jT(), jT(), Qat) : this.Jk(); + }), + (Fjn.Gi = function () { + return new GI(this.a, this.b); + }), + (Fjn.$h = function () { + return null == this.b ? (jT(), jT(), Qat) : this.Jk(); + }), + (Fjn._h = function (n) { + var t, e; + if (null == this.b) { + if (n < 0 || n > 1) throw hp(new Hm(pDn + n + ", size=0")); + return jT(), jT(), Qat; + } + for (e = this.Jk(), t = 0; t < n; ++t) X3(e); + return e; + }), + (Fjn.dc = function () { + var n, t, e, i, r, c; + if (null != this.b) + for (e = 0; e < this.b.length; ++e) + if (((n = this.b[e]), !this.Mk() || this.a.mh(n))) + if (((c = this.a.bh(n, !1)), TT(), Yx(n, 66).Oj())) { + for (i = 0, r = (t = Yx(c, 153)).gc(); i < r; ++i) if (mF(t.il(i)) && null != t.jl(i)) return !1; + } else if (n.$j()) { + if (!Yx(c, 14).dc()) return !1; + } else if (null != c) return !1; + return !0; + }), + (Fjn.Kc = function () { + return b2(this); + }), + (Fjn.Zc = function (n) { + var t, e; + if (null == this.b) { + if (0 != n) throw hp(new Hm(pDn + n + ", size=0")); + return jT(), jT(), Qat; + } + for (e = this.Lk() ? this.Kk() : this.Jk(), t = 0; t < n; ++t) X3(e); + return e; + }), + (Fjn.ii = function (n, t) { + throw hp(new xp()); + }), + (Fjn.ji = function (n, t) { + throw hp(new xp()); + }), + (Fjn.Jk = function () { + return new t$(this.a, this.b); + }), + (Fjn.Kk = function () { + return new H$(this.a, this.b); + }), + (Fjn.Lk = function () { + return !0; + }), + (Fjn.gc = function () { + var n, t, e, i, r, c, a; + if (((r = 0), null != this.b)) + for (e = 0; e < this.b.length; ++e) + if (((n = this.b[e]), !this.Mk() || this.a.mh(n))) + if (((a = this.a.bh(n, !1)), TT(), Yx(n, 66).Oj())) + for (i = 0, c = (t = Yx(a, 153)).gc(); i < c; ++i) mF(t.il(i)) && null != t.jl(i) && ++r; + else n.$j() ? (r += Yx(a, 14).gc()) : null != a && ++r; + return r; + }), + (Fjn.Mk = function () { + return !0; + }), + EF(xDn, "EContentsEList", 486), + Wfn(1156, 486, rRn, B$), + (Fjn.Jk = function () { + return new q$(this.a, this.b); + }), + (Fjn.Kk = function () { + return new G$(this.a, this.b); + }), + (Fjn.Mk = function () { + return !1; + }), + EF(PNn, "ENamedElementImpl/1", 1156), + Wfn(279, 1, cRn, t$), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Rb = function (n) { + throw hp(new xp()); + }), + (Fjn.Nk = function (n) { + if (0 != this.g || this.e) throw hp(new Ym("Iterator already in use or already filtered")); + this.e = n; + }), + (Fjn.Ob = function () { + var n, t, e, i, r, c; + switch (this.g) { + case 3: + case 2: + return !0; + case 1: + return !1; + case -3: + this.p ? this.p.Pb() : ++this.n; + default: + if (this.k && (this.p ? ssn(this, this.p) : ffn(this))) + return ( + (r = this.p ? this.p.Pb() : this.j ? this.j.pi(this.n++) : this.k.Xb(this.n++)), + this.f ? ((n = Yx(r, 72)).ak(), (e = n.dd()), (this.i = e)) : ((e = r), (this.i = e)), + (this.g = 3), + !0 + ); + for (; this.d < this.c.length; ) + if (((t = this.c[this.d++]), (!this.e || t.Gj() != Vrt || 0 != t.aj()) && (!this.Mk() || this.b.mh(t)))) + if (((c = this.b.bh(t, this.Lk())), (this.f = (TT(), Yx(t, 66).Oj())), this.f || t.$j())) { + if ( + (this.Lk() ? ((i = Yx(c, 15)), (this.k = i)) : ((i = Yx(c, 69)), (this.k = this.j = i)), + CO(this.k, 54) + ? ((this.p = null), (this.o = this.k.gc()), (this.n = 0)) + : (this.p = this.j ? this.j.$h() : this.k.Yc()), + this.p ? ssn(this, this.p) : ffn(this)) + ) + return ( + (r = this.p ? this.p.Pb() : this.j ? this.j.pi(this.n++) : this.k.Xb(this.n++)), + this.f ? ((n = Yx(r, 72)).ak(), (e = n.dd()), (this.i = e)) : ((e = r), (this.i = e)), + (this.g = 3), + !0 + ); + } else if (null != c) return (this.k = null), (this.p = null), (e = c), (this.i = e), (this.g = 2), !0; + return (this.k = null), (this.p = null), (this.f = !1), (this.g = 1), !1; + } + }), + (Fjn.Sb = function () { + var n, t, e, i, r, c; + switch (this.g) { + case -3: + case -2: + return !0; + case -1: + return !1; + case 3: + this.p ? this.p.Ub() : --this.n; + default: + if (this.k && (this.p ? hsn(this, this.p) : zsn(this))) + return ( + (r = this.p ? this.p.Ub() : this.j ? this.j.pi(--this.n) : this.k.Xb(--this.n)), + this.f ? ((n = Yx(r, 72)).ak(), (e = n.dd()), (this.i = e)) : ((e = r), (this.i = e)), + (this.g = -3), + !0 + ); + for (; this.d > 0; ) + if (((t = this.c[--this.d]), (!this.e || t.Gj() != Vrt || 0 != t.aj()) && (!this.Mk() || this.b.mh(t)))) + if (((c = this.b.bh(t, this.Lk())), (this.f = (TT(), Yx(t, 66).Oj())), this.f || t.$j())) { + if ( + (this.Lk() ? ((i = Yx(c, 15)), (this.k = i)) : ((i = Yx(c, 69)), (this.k = this.j = i)), + CO(this.k, 54) + ? ((this.o = this.k.gc()), (this.n = this.o)) + : (this.p = this.j ? this.j._h(this.k.gc()) : this.k.Zc(this.k.gc())), + this.p ? hsn(this, this.p) : zsn(this)) + ) + return ( + (r = this.p ? this.p.Ub() : this.j ? this.j.pi(--this.n) : this.k.Xb(--this.n)), + this.f ? ((n = Yx(r, 72)).ak(), (e = n.dd()), (this.i = e)) : ((e = r), (this.i = e)), + (this.g = -3), + !0 + ); + } else if (null != c) return (this.k = null), (this.p = null), (e = c), (this.i = e), (this.g = -2), !0; + return (this.k = null), (this.p = null), (this.g = -1), !1; + } + }), + (Fjn.Pb = function () { + return X3(this); + }), + (Fjn.Tb = function () { + return this.a; + }), + (Fjn.Ub = function () { + var n; + if (this.g < -1 || this.Sb()) return --this.a, (this.g = 0), (n = this.i), this.Sb(), n; + throw hp(new Kp()); + }), + (Fjn.Vb = function () { + return this.a - 1; + }), + (Fjn.Qb = function () { + throw hp(new xp()); + }), + (Fjn.Lk = function () { + return !1; + }), + (Fjn.Wb = function (n) { + throw hp(new xp()); + }), + (Fjn.Mk = function () { + return !0; + }), + (Fjn.a = 0), + (Fjn.d = 0), + (Fjn.f = !1), + (Fjn.g = 0), + (Fjn.n = 0), + (Fjn.o = 0), + EF(xDn, "EContentsEList/FeatureIteratorImpl", 279), + Wfn(697, 279, cRn, H$), + (Fjn.Lk = function () { + return !0; + }), + EF(xDn, "EContentsEList/ResolvingFeatureIteratorImpl", 697), + Wfn(1157, 697, cRn, G$), + (Fjn.Mk = function () { + return !1; + }), + EF(PNn, "ENamedElementImpl/1/1", 1157), + Wfn(1158, 279, cRn, q$), + (Fjn.Mk = function () { + return !1; + }), + EF(PNn, "ENamedElementImpl/1/2", 1158), + Wfn(36, 143, gDn, aW, uW, p_, kY, yJ, OV, W1, aU, V1, uU, PV, oU, J1, sU, IV, hU, Q1, fU, v_, jY, tq, Y1, lU, CV, bU), + (Fjn._i = function () { + return hY(this); + }), + (Fjn.gj = function () { + var n; + return (n = hY(this)) ? n.zj() : null; + }), + (Fjn.yi = function (n) { + return -1 == this.b && this.a && (this.b = this.c.Xg(this.a.aj(), this.a.Gj())), this.c.Og(this.b, n); + }), + (Fjn.Ai = function () { + return this.c; + }), + (Fjn.hj = function () { + var n; + return !!(n = hY(this)) && n.Kj(); + }), + (Fjn.b = -1), + EF(PNn, "ENotificationImpl", 36), + Wfn( + 399, + 284, + { + 105: 1, + 92: 1, + 90: 1, + 147: 1, + 191: 1, + 56: 1, + 59: 1, + 108: 1, + 472: 1, + 49: 1, + 97: 1, + 150: 1, + 399: 1, + 284: 1, + 114: 1, + 115: 1, + }, + zv, + ), + (Fjn.Qg = function (n) { + return scn(this, n); + }), + (Fjn._g = function (n, t, e) { + var i; + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), this.Ab; + case 1: + return this.zb; + case 2: + return TA(), 0 != (256 & this.Bb); + case 3: + return TA(), 0 != (512 & this.Bb); + case 4: + return d9(this.s); + case 5: + return d9(this.t); + case 6: + return TA(), (i = this.t) > 1 || -1 == i; + case 7: + return TA(), this.s >= 1; + case 8: + return t ? fcn(this) : this.r; + case 9: + return this.q; + case 10: + return this.Db >> 16 == 10 ? Yx(this.Cb, 26) : null; + case 11: + return !this.d && (this.d = new VO(zat, this, 11)), this.d; + case 12: + return !this.c && (this.c = new m_(lat, this, 12, 10)), this.c; + case 13: + return !this.a && (this.a = new GL(this, this)), this.a; + case 14: + return IJ(this); + } + return RY(this, n - vF((xjn(), Aat)), CZ(Yx(H3(this, 16), 26) || Aat, n), t, e); + }), + (Fjn.hh = function (n, t, e) { + var i; + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), wnn(this.Ab, n, e); + case 10: + return this.Cb && (e = (i = this.Db >> 16) >= 0 ? scn(this, e) : this.Cb.ih(this, -1 - i, null, e)), opn(this, n, 10, e); + case 12: + return !this.c && (this.c = new m_(lat, this, 12, 10)), wnn(this.c, n, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (xjn(), Aat), t), 66) + .Nj() + .Qj(this, dtn(this), t - vF((xjn(), Aat)), n, e); + }), + (Fjn.jh = function (n, t, e) { + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), Ten(this.Ab, n, e); + case 9: + return kF(this, e); + case 10: + return opn(this, null, 10, e); + case 11: + return !this.d && (this.d = new VO(zat, this, 11)), Ten(this.d, n, e); + case 12: + return !this.c && (this.c = new m_(lat, this, 12, 10)), Ten(this.c, n, e); + case 14: + return Ten(IJ(this), n, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (xjn(), Aat), t), 66) + .Nj() + .Rj(this, dtn(this), t - vF((xjn(), Aat)), n, e); + }), + (Fjn.lh = function (n) { + var t; + switch (n) { + case 0: + return !!this.Ab && 0 != this.Ab.i; + case 1: + return null != this.zb; + case 2: + return 0 == (256 & this.Bb); + case 3: + return 0 == (512 & this.Bb); + case 4: + return 0 != this.s; + case 5: + return 1 != this.t; + case 6: + return (t = this.t) > 1 || -1 == t; + case 7: + return this.s >= 1; + case 8: + return !!this.r && !this.q.e && 0 == pB(this.q).i; + case 9: + return !(!this.q || (this.r && !this.q.e && 0 == pB(this.q).i)); + case 10: + return !(this.Db >> 16 != 10 || !Yx(this.Cb, 26)); + case 11: + return !!this.d && 0 != this.d.i; + case 12: + return !!this.c && 0 != this.c.i; + case 13: + return !(!this.a || 0 == IJ(this.a.a).i || (this.b && hin(this.b))); + case 14: + return !!this.b && hin(this.b); + } + return xX(this, n - vF((xjn(), Aat)), CZ(Yx(H3(this, 16), 26) || Aat, n)); + }), + (Fjn.sh = function (n, t) { + var e; + switch (n) { + case 0: + return ( + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + Hmn(this.Ab), + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + void jF(this.Ab, Yx(t, 14)) + ); + case 1: + return void E2(this, lL(t)); + case 2: + return void s9(this, ny(hL(t))); + case 3: + return void l9(this, ny(hL(t))); + case 4: + return void _1(this, Yx(t, 19).a); + case 5: + return void F1(this, Yx(t, 19).a); + case 8: + return void a8(this, Yx(t, 138)); + case 9: + return void ((e = fun(this, Yx(t, 87), null)) && e.Fi()); + case 11: + return ( + !this.d && (this.d = new VO(zat, this, 11)), + Hmn(this.d), + !this.d && (this.d = new VO(zat, this, 11)), + void jF(this.d, Yx(t, 14)) + ); + case 12: + return ( + !this.c && (this.c = new m_(lat, this, 12, 10)), + Hmn(this.c), + !this.c && (this.c = new m_(lat, this, 12, 10)), + void jF(this.c, Yx(t, 14)) + ); + case 13: + return ( + !this.a && (this.a = new GL(this, this)), + Wmn(this.a), + !this.a && (this.a = new GL(this, this)), + void jF(this.a, Yx(t, 14)) + ); + case 14: + return Hmn(IJ(this)), void jF(IJ(this), Yx(t, 14)); + } + E7(this, n - vF((xjn(), Aat)), CZ(Yx(H3(this, 16), 26) || Aat, n), t); + }), + (Fjn.zh = function () { + return xjn(), Aat; + }), + (Fjn.Bh = function (n) { + var t; + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), void Hmn(this.Ab); + case 1: + return void E2(this, null); + case 2: + return void s9(this, !0); + case 3: + return void l9(this, !0); + case 4: + return void _1(this, 0); + case 5: + return void F1(this, 1); + case 8: + return void a8(this, null); + case 9: + return void ((t = fun(this, null, null)) && t.Fi()); + case 11: + return !this.d && (this.d = new VO(zat, this, 11)), void Hmn(this.d); + case 12: + return !this.c && (this.c = new m_(lat, this, 12, 10)), void Hmn(this.c); + case 13: + return void (this.a && Wmn(this.a)); + case 14: + return void (this.b && Hmn(this.b)); + } + r9(this, n - vF((xjn(), Aat)), CZ(Yx(H3(this, 16), 26) || Aat, n)); + }), + (Fjn.Gh = function () { + var n, t; + if (this.c) for (n = 0, t = this.c.i; n < t; ++n) v$(c1(this.c, n)); + fcn(this), (this.Bb |= 1); + }), + EF(PNn, "EOperationImpl", 399), + Wfn(505, 742, iRn, GL), + (Fjn.Hi = function (n, t) { + !(function (n, t, e) { + y9(IJ(n.a), t, Tz(e)); + })(this, n, Yx(t, 138)); + }), + (Fjn.Ii = function (n) { + !(function (n, t) { + fY(IJ(n.a), Tz(t)); + })(this, Yx(n, 138)); + }), + (Fjn.Oi = function (n) { + return Yx(c1(IJ(this.a), n), 87).c || (xjn(), Pat); + }), + (Fjn.Ti = function (n) { + return Yx(tdn(IJ(this.a), n), 87).c || (xjn(), Pat); + }), + (Fjn.Ui = function (n, t) { + return (function (n, t, e) { + var i, r; + return ((r = (i = Yx(c1(IJ(n.a), t), 87)).c || (xjn(), Pat)).kh() ? P8(n.b, Yx(r, 49)) : r) == e ? Bpn(i) : b1(i, e), r; + })(this, n, Yx(t, 138)); + }), + (Fjn.ai = function () { + return !1; + }), + (Fjn.Zi = function (n, t, e, i, r) { + return null; + }), + (Fjn.Ji = function () { + return new Hg(this); + }), + (Fjn.Ki = function () { + Hmn(IJ(this.a)); + }), + (Fjn.Li = function (n) { + return m9(this, n); + }), + (Fjn.Mi = function (n) { + var t; + for (t = n.Kc(); t.Ob(); ) if (!m9(this, t.Pb())) return !1; + return !0; + }), + (Fjn.Ni = function (n) { + var t, e, i; + if (CO(n, 15) && (i = Yx(n, 15)).gc() == IJ(this.a).i) { + for (t = i.Kc(), e = new UO(this); t.Ob(); ) if (iI(t.Pb()) !== iI(hen(e))) return !1; + return !0; + } + return !1; + }), + (Fjn.Pi = function () { + var n, t, e; + for (t = 1, n = new UO(IJ(this.a)); n.e != n.i.gc(); ) t = 31 * t + ((e = Yx(hen(n), 87).c || (xjn(), Pat)) ? W5(e) : 0); + return t; + }), + (Fjn.Qi = function (n) { + var t, e, i; + for (i = 0, e = new UO(IJ(this.a)); e.e != e.i.gc(); ) { + if (((t = Yx(hen(e), 87)), iI(n) === iI(t.c || (xjn(), Pat)))) return i; + ++i; + } + return -1; + }), + (Fjn.Ri = function () { + return 0 == IJ(this.a).i; + }), + (Fjn.Si = function () { + return null; + }), + (Fjn.Vi = function () { + return IJ(this.a).i; + }), + (Fjn.Wi = function () { + var n, t, e, i, r; + for (r = IJ(this.a).i, i = VQ(UKn, iEn, 1, r, 5, 1), e = 0, t = new UO(IJ(this.a)); t.e != t.i.gc(); ) + (n = Yx(hen(t), 87)), (i[e++] = n.c || (xjn(), Pat)); + return i; + }), + (Fjn.Xi = function (n) { + var t, e, i; + for ( + i = IJ(this.a).i, n.length < i && (n = H1(V5(n).c, i)), n.length > i && DF(n, i, null), e = 0, t = new UO(IJ(this.a)); + t.e != t.i.gc(); + + ) + DF(n, e++, Yx(hen(t), 87).c || (xjn(), Pat)); + return n; + }), + (Fjn.Yi = function () { + var n, t, e, i; + for ((i = new Cy()).a += "[", n = IJ(this.a), t = 0, e = IJ(this.a).i; t < e; ) + pI(i, xA(Yx(c1(n, t), 87).c || (xjn(), Pat))), ++t < e && (i.a += tEn); + return (i.a += "]"), i.a; + }), + (Fjn.$i = function (n) {}), + (Fjn.aj = function () { + return 13; + }), + (Fjn.Bk = function () { + return !0; + }), + (Fjn.bj = function () { + return !1; + }), + (Fjn.Ck = function () { + return !1; + }), + (Fjn.Dk = function () { + return !1; + }), + (Fjn.Ek = function () { + return !0; + }), + (Fjn.rk = function () { + return !1; + }), + (Fjn.Fk = function () { + return !0; + }), + (Fjn.wj = function (n) { + return CO(n, 138); + }), + (Fjn.fj = function () { + return !(!(n = this.a).a || 0 == IJ(n.a.a).i || (n.b && hin(n.b))); + var n; + }), + (Fjn.hi = function () { + return !0; + }), + (Fjn.ni = function () { + return !0; + }), + EF(PNn, "EOperationImpl/1", 505), + Wfn(1340, 1964, WEn, Hg), + (Fjn.Zc = function (n) { + return b0(this.a, n); + }), + (Fjn.gc = function () { + return IJ(this.a.a).i; + }), + EF(PNn, "EOperationImpl/1/1", 1340), + Wfn(1341, 545, JDn, TK), + (Fjn.ii = function (n, t) { + var e; + return (e = Yx(L9(this, n, t), 87)), gC(this.e) && Xp(this, new jY(this.a, 7, (xjn(), $at), d9(t), e.c || Pat, n)), e; + }), + (Fjn.jj = function (n, t) { + return (function (n, t, e) { + var i; + return (i = new yJ(n.e, 3, 13, null, t.c || (xjn(), Pat), Ren(n, t), !1)), e ? e.Ei(i) : (e = i), e; + })(this, Yx(n, 87), t); + }), + (Fjn.kj = function (n, t) { + return (function (n, t, e) { + var i; + return (i = new yJ(n.e, 4, 13, t.c || (xjn(), Pat), null, Ren(n, t), !1)), e ? e.Ei(i) : (e = i), e; + })(this, Yx(n, 87), t); + }), + (Fjn.lj = function (n, t, e) { + return (function (n, t, e, i) { + var r; + return (r = new yJ(n.e, 1, 13, t.c || (xjn(), Pat), e.c || (xjn(), Pat), Ren(n, t), !1)), i ? i.Ei(r) : (i = r), i; + })(this, Yx(n, 87), Yx(t, 87), e); + }), + (Fjn.Zi = function (n, t, e, i, r) { + switch (n) { + case 3: + return zG(this, n, t, e, i, this.i > 1); + case 5: + return zG(this, n, t, e, i, this.i - Yx(e, 15).gc() > 0); + default: + return new yJ(this.e, n, this.c, t, e, i, !0); + } + }), + (Fjn.ij = function () { + return !0; + }), + (Fjn.fj = function () { + return hin(this); + }), + (Fjn.Xj = function () { + Hmn(this); + }), + EF(PNn, "EOperationImpl/2", 1341), + Wfn(498, 1, { 1938: 1, 498: 1 }, GP), + EF(PNn, "EPackageImpl/1", 498), + Wfn(16, 85, JDn, m_), + (Fjn.zk = function () { + return this.d; + }), + (Fjn.Ak = function () { + return this.b; + }), + (Fjn.Dk = function () { + return !0; + }), + (Fjn.b = 0), + EF(xDn, "EObjectContainmentWithInverseEList", 16), + Wfn(353, 16, JDn, EN), + (Fjn.Ek = function () { + return !0; + }), + (Fjn.li = function (n, t) { + return $fn(this, n, Yx(t, 56)); + }), + EF(xDn, "EObjectContainmentWithInverseEList/Resolving", 353), + Wfn(298, 353, JDn, d_), + (Fjn.ci = function () { + this.a.tb = null; + }), + EF(PNn, "EPackageImpl/2", 298), + Wfn(1228, 1, {}, Oo), + EF(PNn, "EPackageImpl/3", 1228), + Wfn(718, 43, gMn, Xv), + (Fjn._b = function (n) { + return aI(n) ? hq(this, n) : !!Dq(this.f, n); + }), + EF(PNn, "EPackageRegistryImpl", 718), + Wfn( + 509, + 284, + { + 105: 1, + 92: 1, + 90: 1, + 147: 1, + 191: 1, + 56: 1, + 2017: 1, + 108: 1, + 472: 1, + 49: 1, + 97: 1, + 150: 1, + 509: 1, + 284: 1, + 114: 1, + 115: 1, + }, + Uv, + ), + (Fjn.Qg = function (n) { + return hcn(this, n); + }), + (Fjn._g = function (n, t, e) { + var i; + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), this.Ab; + case 1: + return this.zb; + case 2: + return TA(), 0 != (256 & this.Bb); + case 3: + return TA(), 0 != (512 & this.Bb); + case 4: + return d9(this.s); + case 5: + return d9(this.t); + case 6: + return TA(), (i = this.t) > 1 || -1 == i; + case 7: + return TA(), this.s >= 1; + case 8: + return t ? fcn(this) : this.r; + case 9: + return this.q; + case 10: + return this.Db >> 16 == 10 ? Yx(this.Cb, 59) : null; + } + return RY(this, n - vF((xjn(), Nat)), CZ(Yx(H3(this, 16), 26) || Nat, n), t, e); + }), + (Fjn.hh = function (n, t, e) { + var i; + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), wnn(this.Ab, n, e); + case 10: + return this.Cb && (e = (i = this.Db >> 16) >= 0 ? hcn(this, e) : this.Cb.ih(this, -1 - i, null, e)), opn(this, n, 10, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (xjn(), Nat), t), 66) + .Nj() + .Qj(this, dtn(this), t - vF((xjn(), Nat)), n, e); + }), + (Fjn.jh = function (n, t, e) { + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), Ten(this.Ab, n, e); + case 9: + return kF(this, e); + case 10: + return opn(this, null, 10, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (xjn(), Nat), t), 66) + .Nj() + .Rj(this, dtn(this), t - vF((xjn(), Nat)), n, e); + }), + (Fjn.lh = function (n) { + var t; + switch (n) { + case 0: + return !!this.Ab && 0 != this.Ab.i; + case 1: + return null != this.zb; + case 2: + return 0 == (256 & this.Bb); + case 3: + return 0 == (512 & this.Bb); + case 4: + return 0 != this.s; + case 5: + return 1 != this.t; + case 6: + return (t = this.t) > 1 || -1 == t; + case 7: + return this.s >= 1; + case 8: + return !!this.r && !this.q.e && 0 == pB(this.q).i; + case 9: + return !(!this.q || (this.r && !this.q.e && 0 == pB(this.q).i)); + case 10: + return !(this.Db >> 16 != 10 || !Yx(this.Cb, 59)); + } + return xX(this, n - vF((xjn(), Nat)), CZ(Yx(H3(this, 16), 26) || Nat, n)); + }), + (Fjn.zh = function () { + return xjn(), Nat; + }), + EF(PNn, "EParameterImpl", 509), + Wfn( + 99, + 449, + { + 105: 1, + 92: 1, + 90: 1, + 147: 1, + 191: 1, + 56: 1, + 18: 1, + 170: 1, + 66: 1, + 108: 1, + 472: 1, + 49: 1, + 97: 1, + 150: 1, + 99: 1, + 449: 1, + 284: 1, + 114: 1, + 115: 1, + 677: 1, + }, + cL, + ), + (Fjn._g = function (n, t, e) { + var i, r; + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), this.Ab; + case 1: + return this.zb; + case 2: + return TA(), 0 != (256 & this.Bb); + case 3: + return TA(), 0 != (512 & this.Bb); + case 4: + return d9(this.s); + case 5: + return d9(this.t); + case 6: + return TA(), (r = this.t) > 1 || -1 == r; + case 7: + return TA(), this.s >= 1; + case 8: + return t ? fcn(this) : this.r; + case 9: + return this.q; + case 10: + return TA(), 0 != (this.Bb & DNn); + case 11: + return TA(), 0 != (this.Bb & FDn); + case 12: + return TA(), 0 != (this.Bb & nMn); + case 13: + return this.j; + case 14: + return Pbn(this); + case 15: + return TA(), 0 != (this.Bb & _Dn); + case 16: + return TA(), 0 != (this.Bb & MEn); + case 17: + return HG(this); + case 18: + return TA(), 0 != (this.Bb & MNn); + case 19: + return TA(), !(!(i = nin(this)) || 0 == (i.Bb & MNn)); + case 20: + return TA(), 0 != (this.Bb & eMn); + case 21: + return t ? nin(this) : this.b; + case 22: + return t ? O5(this) : dV(this); + case 23: + return !this.a && (this.a = new JO(eat, this, 23)), this.a; + } + return RY(this, n - vF((xjn(), xat)), CZ(Yx(H3(this, 16), 26) || xat, n), t, e); + }), + (Fjn.lh = function (n) { + var t, e; + switch (n) { + case 0: + return !!this.Ab && 0 != this.Ab.i; + case 1: + return null != this.zb; + case 2: + return 0 == (256 & this.Bb); + case 3: + return 0 == (512 & this.Bb); + case 4: + return 0 != this.s; + case 5: + return 1 != this.t; + case 6: + return (e = this.t) > 1 || -1 == e; + case 7: + return this.s >= 1; + case 8: + return !!this.r && !this.q.e && 0 == pB(this.q).i; + case 9: + return !(!this.q || (this.r && !this.q.e && 0 == pB(this.q).i)); + case 10: + return 0 == (this.Bb & DNn); + case 11: + return 0 != (this.Bb & FDn); + case 12: + return 0 != (this.Bb & nMn); + case 13: + return null != this.j; + case 14: + return null != Pbn(this); + case 15: + return 0 != (this.Bb & _Dn); + case 16: + return 0 != (this.Bb & MEn); + case 17: + return !!HG(this); + case 18: + return 0 != (this.Bb & MNn); + case 19: + return !!(t = nin(this)) && 0 != (t.Bb & MNn); + case 20: + return 0 == (this.Bb & eMn); + case 21: + return !!this.b; + case 22: + return !!dV(this); + case 23: + return !!this.a && 0 != this.a.i; + } + return xX(this, n - vF((xjn(), xat)), CZ(Yx(H3(this, 16), 26) || xat, n)); + }), + (Fjn.sh = function (n, t) { + var e; + switch (n) { + case 0: + return ( + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + Hmn(this.Ab), + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + void jF(this.Ab, Yx(t, 14)) + ); + case 1: + return void yz(this, lL(t)); + case 2: + return void s9(this, ny(hL(t))); + case 3: + return void l9(this, ny(hL(t))); + case 4: + return void _1(this, Yx(t, 19).a); + case 5: + return void F1(this, Yx(t, 19).a); + case 8: + return void a8(this, Yx(t, 138)); + case 9: + return void ((e = fun(this, Yx(t, 87), null)) && e.Fi()); + case 10: + return void x9(this, ny(hL(t))); + case 11: + return void K9(this, ny(hL(t))); + case 12: + return void D9(this, ny(hL(t))); + case 13: + return void ZP(this, lL(t)); + case 15: + return void R9(this, ny(hL(t))); + case 16: + return void H9(this, ny(hL(t))); + case 18: + return void (function (n, t) { + G9(n, t), CO(n.Cb, 88) && rhn(bV(Yx(n.Cb, 88)), 2); + })(this, ny(hL(t))); + case 20: + return void z9(this, ny(hL(t))); + case 21: + return void Q0(this, Yx(t, 18)); + case 23: + return ( + !this.a && (this.a = new JO(eat, this, 23)), + Hmn(this.a), + !this.a && (this.a = new JO(eat, this, 23)), + void jF(this.a, Yx(t, 14)) + ); + } + E7(this, n - vF((xjn(), xat)), CZ(Yx(H3(this, 16), 26) || xat, n), t); + }), + (Fjn.zh = function () { + return xjn(), xat; + }), + (Fjn.Bh = function (n) { + var t; + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), void Hmn(this.Ab); + case 1: + return CO(this.Cb, 88) && rhn(bV(Yx(this.Cb, 88)), 4), void E2(this, null); + case 2: + return void s9(this, !0); + case 3: + return void l9(this, !0); + case 4: + return void _1(this, 0); + case 5: + return void F1(this, 1); + case 8: + return void a8(this, null); + case 9: + return void ((t = fun(this, null, null)) && t.Fi()); + case 10: + return void x9(this, !0); + case 11: + return void K9(this, !1); + case 12: + return void D9(this, !1); + case 13: + return (this.i = null), void J0(this, null); + case 15: + return void R9(this, !1); + case 16: + return void H9(this, !1); + case 18: + return G9(this, !1), void (CO(this.Cb, 88) && rhn(bV(Yx(this.Cb, 88)), 2)); + case 20: + return void z9(this, !0); + case 21: + return void Q0(this, null); + case 23: + return !this.a && (this.a = new JO(eat, this, 23)), void Hmn(this.a); + } + r9(this, n - vF((xjn(), xat)), CZ(Yx(H3(this, 16), 26) || xat, n)); + }), + (Fjn.Gh = function () { + O5(this), nH(PJ((wsn(), wut), this)), fcn(this), (this.Bb |= 1); + }), + (Fjn.Lj = function () { + return nin(this); + }), + (Fjn.qk = function () { + var n; + return !!(n = nin(this)) && 0 != (n.Bb & MNn); + }), + (Fjn.rk = function () { + return 0 != (this.Bb & MNn); + }), + (Fjn.sk = function () { + return 0 != (this.Bb & eMn); + }), + (Fjn.nk = function (n, t) { + return (this.c = null), z8(this, n, t); + }), + (Fjn.Ib = function () { + var n; + return 0 != (64 & this.Db) + ? Qdn(this) + : (((n = new MA(Qdn(this))).a += " (containment: "), + nj(n, 0 != (this.Bb & MNn)), + (n.a += ", resolveProxies: "), + nj(n, 0 != (this.Bb & eMn)), + (n.a += ")"), + n.a); + }), + EF(PNn, "EReferenceImpl", 99), + Wfn( + 548, + 115, + { + 105: 1, + 42: 1, + 92: 1, + 90: 1, + 133: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 548: 1, + 114: 1, + 115: 1, + }, + Ao, + ), + (Fjn.Fb = function (n) { + return this === n; + }), + (Fjn.cd = function () { + return this.b; + }), + (Fjn.dd = function () { + return this.c; + }), + (Fjn.Hb = function () { + return _A(this); + }), + (Fjn.Uh = function (n) { + !(function (n, t) { + R0(n, null == t ? null : (vB(t), t)); + })(this, lL(n)); + }), + (Fjn.ed = function (n) { + return (function (n, t) { + var e; + return (e = n.c), K0(n, t), e; + })(this, lL(n)); + }), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return this.b; + case 1: + return this.c; + } + return RY(this, n - vF((xjn(), Dat)), CZ(Yx(H3(this, 16), 26) || Dat, n), t, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return null != this.b; + case 1: + return null != this.c; + } + return xX(this, n - vF((xjn(), Dat)), CZ(Yx(H3(this, 16), 26) || Dat, n)); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 0: + return void (function (n, t) { + R0(n, null == t ? null : (vB(t), t)); + })(this, lL(t)); + case 1: + return void K0(this, lL(t)); + } + E7(this, n - vF((xjn(), Dat)), CZ(Yx(H3(this, 16), 26) || Dat, n), t); + }), + (Fjn.zh = function () { + return xjn(), Dat; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 0: + return void R0(this, null); + case 1: + return void K0(this, null); + } + r9(this, n - vF((xjn(), Dat)), CZ(Yx(H3(this, 16), 26) || Dat, n)); + }), + (Fjn.Sh = function () { + var n; + return -1 == this.a && ((n = this.b), (this.a = null == n ? 0 : Xen(n))), this.a; + }), + (Fjn.Th = function (n) { + this.a = n; + }), + (Fjn.Ib = function () { + var n; + return 0 != (64 & this.Db) + ? Kln(this) + : (((n = new MA(Kln(this))).a += " (key: "), pI(n, this.b), (n.a += ", value: "), pI(n, this.c), (n.a += ")"), n.a); + }), + (Fjn.a = -1), + (Fjn.b = null), + (Fjn.c = null); + var Jat, + Zat, + nut, + tut, + eut, + iut, + rut, + cut, + aut, + uut, + out = EF(PNn, "EStringToStringMapEntryImpl", 548), + sut = aR(xDn, "FeatureMap/Entry/Internal"); + Wfn(565, 1, aRn), + (Fjn.Ok = function (n) { + return this.Pk(Yx(n, 49)); + }), + (Fjn.Pk = function (n) { + return this.Ok(n); + }), + (Fjn.Fb = function (n) { + var t, e; + return ( + this === n || (!!CO(n, 72) && (t = Yx(n, 72)).ak() == this.c && (null == (e = this.dd()) ? null == t.dd() : Q8(e, t.dd()))) + ); + }), + (Fjn.ak = function () { + return this.c; + }), + (Fjn.Hb = function () { + var n; + return (n = this.dd()), W5(this.c) ^ (null == n ? 0 : W5(n)); + }), + (Fjn.Ib = function () { + var n, t; + return (t = i1((n = this.c).Hj()).Ph()), n.ne(), (null != t && 0 != t.length ? t + ":" + n.ne() : n.ne()) + "=" + this.dd(); + }), + EF(PNn, "EStructuralFeatureImpl/BasicFeatureMapEntry", 565), + Wfn(776, 565, aRn, FL), + (Fjn.Pk = function (n) { + return new FL(this.c, n); + }), + (Fjn.dd = function () { + return this.a; + }), + (Fjn.Qk = function (n, t, e) { + return (function (n, t, e, i, r) { + var c; + return e && ((c = tnn(t.Tg(), n.c)), (r = e.gh(t, -1 - (-1 == c ? i : c), null, r))), r; + })(this, n, this.a, t, e); + }), + (Fjn.Rk = function (n, t, e) { + return (function (n, t, e, i, r) { + var c; + return e && ((c = tnn(t.Tg(), n.c)), (r = e.ih(t, -1 - (-1 == c ? i : c), null, r))), r; + })(this, n, this.a, t, e); + }), + EF(PNn, "EStructuralFeatureImpl/ContainmentUpdatingFeatureMapEntry", 776), + Wfn(1314, 1, {}, zP), + (Fjn.Pj = function (n, t, e, i, r) { + return Yx(TY(n, this.b), 215).nl(this.a).Wj(i); + }), + (Fjn.Qj = function (n, t, e, i, r) { + return Yx(TY(n, this.b), 215).el(this.a, i, r); + }), + (Fjn.Rj = function (n, t, e, i, r) { + return Yx(TY(n, this.b), 215).fl(this.a, i, r); + }), + (Fjn.Sj = function (n, t, e) { + return Yx(TY(n, this.b), 215).nl(this.a).fj(); + }), + (Fjn.Tj = function (n, t, e, i) { + Yx(TY(n, this.b), 215).nl(this.a).Wb(i); + }), + (Fjn.Uj = function (n, t, e) { + return Yx(TY(n, this.b), 215).nl(this.a); + }), + (Fjn.Vj = function (n, t, e) { + Yx(TY(n, this.b), 215).nl(this.a).Xj(); + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateFeatureMapDelegator", 1314), + Wfn(89, 1, {}, _x, LH, Hq, sW), + (Fjn.Pj = function (n, t, e, i, r) { + var c; + if ((null == (c = t.Ch(e)) && t.Dh(e, (c = Mjn(this, n))), !r)) + switch (this.e) { + case 50: + case 41: + return Yx(c, 589).sj(); + case 40: + return Yx(c, 215).kl(); + } + return c; + }), + (Fjn.Qj = function (n, t, e, i, r) { + var c; + return null == (c = t.Ch(e)) && t.Dh(e, (c = Mjn(this, n))), Yx(c, 69).lk(i, r); + }), + (Fjn.Rj = function (n, t, e, i, r) { + var c; + return null != (c = t.Ch(e)) && (r = Yx(c, 69).mk(i, r)), r; + }), + (Fjn.Sj = function (n, t, e) { + var i; + return null != (i = t.Ch(e)) && Yx(i, 76).fj(); + }), + (Fjn.Tj = function (n, t, e, i) { + var r; + !(r = Yx(t.Ch(e), 76)) && t.Dh(e, (r = Mjn(this, n))), r.Wb(i); + }), + (Fjn.Uj = function (n, t, e) { + var i; + return null == (i = t.Ch(e)) && t.Dh(e, (i = Mjn(this, n))), CO(i, 76) ? Yx(i, 76) : new Ug(Yx(t.Ch(e), 15)); + }), + (Fjn.Vj = function (n, t, e) { + var i; + !(i = Yx(t.Ch(e), 76)) && t.Dh(e, (i = Mjn(this, n))), i.Xj(); + }), + (Fjn.b = 0), + (Fjn.e = 0), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateMany", 89), + Wfn(504, 1, {}), + (Fjn.Qj = function (n, t, e, i, r) { + throw hp(new xp()); + }), + (Fjn.Rj = function (n, t, e, i, r) { + throw hp(new xp()); + }), + (Fjn.Uj = function (n, t, e) { + return new NH(this, n, t, e); + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingle", 504), + Wfn(1331, 1, DDn, NH), + (Fjn.Wj = function (n) { + return this.a.Pj(this.c, this.d, this.b, n, !0); + }), + (Fjn.fj = function () { + return this.a.Sj(this.c, this.d, this.b); + }), + (Fjn.Wb = function (n) { + this.a.Tj(this.c, this.d, this.b, n); + }), + (Fjn.Xj = function () { + this.a.Vj(this.c, this.d, this.b); + }), + (Fjn.b = 0), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingle/1", 1331), + Wfn(769, 504, {}, tG), + (Fjn.Pj = function (n, t, e, i, r) { + return Ign(n, n.eh(), n.Vg()) == this.b ? (this.sk() && i ? Bfn(n) : n.eh()) : null; + }), + (Fjn.Qj = function (n, t, e, i, r) { + var c, a; + return n.eh() && (r = (c = n.Vg()) >= 0 ? n.Qg(r) : n.eh().ih(n, -1 - c, null, r)), (a = tnn(n.Tg(), this.e)), n.Sg(i, a, r); + }), + (Fjn.Rj = function (n, t, e, i, r) { + var c; + return (c = tnn(n.Tg(), this.e)), n.Sg(null, c, r); + }), + (Fjn.Sj = function (n, t, e) { + var i; + return (i = tnn(n.Tg(), this.e)), !!n.eh() && n.Vg() == i; + }), + (Fjn.Tj = function (n, t, e, i) { + var r, c, a, u, o; + if (null != i && !Ypn(this.a, i)) throw hp(new Vm(uRn + (CO(i, 56) ? gan(Yx(i, 56).Tg()) : LZ(V5(i))) + oRn + this.a + "'")); + if (((r = n.eh()), (a = tnn(n.Tg(), this.e)), iI(i) !== iI(r) || (n.Vg() != a && null != i))) { + if (ccn(n, Yx(i, 56))) throw hp(new Qm(CNn + n.Ib())); + (o = null), + r && (o = (c = n.Vg()) >= 0 ? n.Qg(o) : n.eh().ih(n, -1 - c, null, o)), + (u = Yx(i, 49)) && (o = u.gh(n, tnn(u.Tg(), this.b), null, o)), + (o = n.Sg(u, a, o)) && o.Fi(); + } else n.Lg() && n.Mg() && K3(n, new p_(n, 1, a, i, i)); + }), + (Fjn.Vj = function (n, t, e) { + var i, r, c; + n.eh() + ? ((c = (i = n.Vg()) >= 0 ? n.Qg(null) : n.eh().ih(n, -1 - i, null, null)), + (r = tnn(n.Tg(), this.e)), + (c = n.Sg(null, r, c)) && c.Fi()) + : n.Lg() && n.Mg() && K3(n, new v_(n, 1, this.e, null, null)); + }), + (Fjn.sk = function () { + return !1; + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleContainer", 769), + Wfn(1315, 769, {}, Fx), + (Fjn.sk = function () { + return !0; + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleContainerResolving", 1315), + Wfn(563, 504, {}), + (Fjn.Pj = function (n, t, e, i, r) { + var c; + return null == (c = t.Ch(e)) ? this.b : iI(c) === iI(Jat) ? null : c; + }), + (Fjn.Sj = function (n, t, e) { + var i; + return null != (i = t.Ch(e)) && (iI(i) === iI(Jat) || !Q8(i, this.b)); + }), + (Fjn.Tj = function (n, t, e, i) { + var r, c; + n.Lg() && n.Mg() + ? ((r = null == (c = t.Ch(e)) ? this.b : iI(c) === iI(Jat) ? null : c), + null == i + ? null != this.c + ? (t.Dh(e, null), (i = this.b)) + : null != this.b + ? t.Dh(e, Jat) + : t.Dh(e, null) + : (this.Sk(i), t.Dh(e, i)), + K3(n, this.d.Tk(n, 1, this.e, r, i))) + : null == i + ? null != this.c + ? t.Dh(e, null) + : null != this.b + ? t.Dh(e, Jat) + : t.Dh(e, null) + : (this.Sk(i), t.Dh(e, i)); + }), + (Fjn.Vj = function (n, t, e) { + var i, r; + n.Lg() && n.Mg() + ? ((i = null == (r = t.Ch(e)) ? this.b : iI(r) === iI(Jat) ? null : r), t.Eh(e), K3(n, this.d.Tk(n, 1, this.e, i, this.b))) + : t.Eh(e); + }), + (Fjn.Sk = function (n) { + throw hp(new Ap()); + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleData", 563), + Wfn(sRn, 1, {}, $o), + (Fjn.Tk = function (n, t, e, i, r) { + return new v_(n, t, e, i, r); + }), + (Fjn.Uk = function (n, t, e, i, r, c) { + return new tq(n, t, e, i, r, c); + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator", sRn), + Wfn(1332, sRn, {}, Lo), + (Fjn.Tk = function (n, t, e, i, r) { + return new CV(n, t, e, ny(hL(i)), ny(hL(r))); + }), + (Fjn.Uk = function (n, t, e, i, r, c) { + return new bU(n, t, e, ny(hL(i)), ny(hL(r)), c); + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/1", 1332), + Wfn(1333, sRn, {}, No), + (Fjn.Tk = function (n, t, e, i, r) { + return new W1(n, t, e, Yx(i, 217).a, Yx(r, 217).a); + }), + (Fjn.Uk = function (n, t, e, i, r, c) { + return new aU(n, t, e, Yx(i, 217).a, Yx(r, 217).a, c); + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/2", 1333), + Wfn(1334, sRn, {}, xo), + (Fjn.Tk = function (n, t, e, i, r) { + return new V1(n, t, e, Yx(i, 172).a, Yx(r, 172).a); + }), + (Fjn.Uk = function (n, t, e, i, r, c) { + return new uU(n, t, e, Yx(i, 172).a, Yx(r, 172).a, c); + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/3", 1334), + Wfn(1335, sRn, {}, Do), + (Fjn.Tk = function (n, t, e, i, r) { + return new PV(n, t, e, ty(fL(i)), ty(fL(r))); + }), + (Fjn.Uk = function (n, t, e, i, r, c) { + return new oU(n, t, e, ty(fL(i)), ty(fL(r)), c); + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/4", 1335), + Wfn(1336, sRn, {}, Ro), + (Fjn.Tk = function (n, t, e, i, r) { + return new J1(n, t, e, Yx(i, 155).a, Yx(r, 155).a); + }), + (Fjn.Uk = function (n, t, e, i, r, c) { + return new sU(n, t, e, Yx(i, 155).a, Yx(r, 155).a, c); + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/5", 1336), + Wfn(1337, sRn, {}, Ko), + (Fjn.Tk = function (n, t, e, i, r) { + return new IV(n, t, e, Yx(i, 19).a, Yx(r, 19).a); + }), + (Fjn.Uk = function (n, t, e, i, r, c) { + return new hU(n, t, e, Yx(i, 19).a, Yx(r, 19).a, c); + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/6", 1337), + Wfn(1338, sRn, {}, _o), + (Fjn.Tk = function (n, t, e, i, r) { + return new Q1(n, t, e, Yx(i, 162).a, Yx(r, 162).a); + }), + (Fjn.Uk = function (n, t, e, i, r, c) { + return new fU(n, t, e, Yx(i, 162).a, Yx(r, 162).a, c); + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/7", 1338), + Wfn(1339, sRn, {}, Fo), + (Fjn.Tk = function (n, t, e, i, r) { + return new Y1(n, t, e, Yx(i, 184).a, Yx(r, 184).a); + }), + (Fjn.Uk = function (n, t, e, i, r, c) { + return new lU(n, t, e, Yx(i, 184).a, Yx(r, 184).a, c); + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/8", 1339), + Wfn(1317, 563, {}, xH), + (Fjn.Sk = function (n) { + if (!this.a.wj(n)) throw hp(new Vm(uRn + V5(n) + oRn + this.a + "'")); + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleDataDynamic", 1317), + Wfn(1318, 563, {}, MK), + (Fjn.Sk = function (n) {}), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleDataStatic", 1318), + Wfn(770, 563, {}), + (Fjn.Sj = function (n, t, e) { + return null != t.Ch(e); + }), + (Fjn.Tj = function (n, t, e, i) { + var r, c; + n.Lg() && n.Mg() + ? ((r = !0), + null == (c = t.Ch(e)) ? ((r = !1), (c = this.b)) : iI(c) === iI(Jat) && (c = null), + null == i ? (null != this.c ? (t.Dh(e, null), (i = this.b)) : t.Dh(e, Jat)) : (this.Sk(i), t.Dh(e, i)), + K3(n, this.d.Uk(n, 1, this.e, c, i, !r))) + : null == i + ? null != this.c + ? t.Dh(e, null) + : t.Dh(e, Jat) + : (this.Sk(i), t.Dh(e, i)); + }), + (Fjn.Vj = function (n, t, e) { + var i, r; + n.Lg() && n.Mg() + ? ((i = !0), + null == (r = t.Ch(e)) ? ((i = !1), (r = this.b)) : iI(r) === iI(Jat) && (r = null), + t.Eh(e), + K3(n, this.d.Uk(n, 2, this.e, r, this.b, i))) + : t.Eh(e); + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettable", 770), + Wfn(1319, 770, {}, DH), + (Fjn.Sk = function (n) { + if (!this.a.wj(n)) throw hp(new Vm(uRn + V5(n) + oRn + this.a + "'")); + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableDynamic", 1319), + Wfn(1320, 770, {}, SK), + (Fjn.Sk = function (n) {}), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableStatic", 1320), + Wfn(398, 504, {}, KR), + (Fjn.Pj = function (n, t, e, i, r) { + var c, a, u, o, s; + if (((s = t.Ch(e)), this.Kj() && iI(s) === iI(Jat))) return null; + if (this.sk() && i && null != s) { + if ((u = Yx(s, 49)).kh() && u != (o = P8(n, u))) { + if (!Ypn(this.a, o)) throw hp(new Vm(uRn + V5(o) + oRn + this.a + "'")); + t.Dh(e, (s = o)), + this.rk() && + ((c = Yx(o, 49)), + (a = u.ih(n, this.b ? tnn(u.Tg(), this.b) : -1 - tnn(n.Tg(), this.e), null, null)), + !c.eh() && (a = c.gh(n, this.b ? tnn(c.Tg(), this.b) : -1 - tnn(n.Tg(), this.e), null, a)), + a && a.Fi()), + n.Lg() && n.Mg() && K3(n, new v_(n, 9, this.e, u, o)); + } + return s; + } + return s; + }), + (Fjn.Qj = function (n, t, e, i, r) { + var c, a; + return ( + iI((a = t.Ch(e))) === iI(Jat) && (a = null), + t.Dh(e, i), + this.bj() + ? iI(a) !== iI(i) && null != a && (r = (c = Yx(a, 49)).ih(n, tnn(c.Tg(), this.b), null, r)) + : this.rk() && null != a && (r = Yx(a, 49).ih(n, -1 - tnn(n.Tg(), this.e), null, r)), + n.Lg() && n.Mg() && (!r && (r = new Ek(4)), r.Ei(new v_(n, 1, this.e, a, i))), + r + ); + }), + (Fjn.Rj = function (n, t, e, i, r) { + var c; + return ( + iI((c = t.Ch(e))) === iI(Jat) && (c = null), + t.Eh(e), + n.Lg() && + n.Mg() && + (!r && (r = new Ek(4)), this.Kj() ? r.Ei(new v_(n, 2, this.e, c, null)) : r.Ei(new v_(n, 1, this.e, c, null))), + r + ); + }), + (Fjn.Sj = function (n, t, e) { + return null != t.Ch(e); + }), + (Fjn.Tj = function (n, t, e, i) { + var r, c, a, u, o; + if (null != i && !Ypn(this.a, i)) throw hp(new Vm(uRn + (CO(i, 56) ? gan(Yx(i, 56).Tg()) : LZ(V5(i))) + oRn + this.a + "'")); + (u = null != (o = t.Ch(e))), + this.Kj() && iI(o) === iI(Jat) && (o = null), + (a = null), + this.bj() + ? iI(o) !== iI(i) && + (null != o && (a = (r = Yx(o, 49)).ih(n, tnn(r.Tg(), this.b), null, a)), + null != i && (a = (r = Yx(i, 49)).gh(n, tnn(r.Tg(), this.b), null, a))) + : this.rk() && + iI(o) !== iI(i) && + (null != o && (a = Yx(o, 49).ih(n, -1 - tnn(n.Tg(), this.e), null, a)), + null != i && (a = Yx(i, 49).gh(n, -1 - tnn(n.Tg(), this.e), null, a))), + null == i && this.Kj() ? t.Dh(e, Jat) : t.Dh(e, i), + n.Lg() && n.Mg() ? ((c = new tq(n, 1, this.e, o, i, this.Kj() && !u)), a ? (a.Ei(c), a.Fi()) : K3(n, c)) : a && a.Fi(); + }), + (Fjn.Vj = function (n, t, e) { + var i, r, c, a, u; + (a = null != (u = t.Ch(e))), + this.Kj() && iI(u) === iI(Jat) && (u = null), + (c = null), + null != u && + (this.bj() + ? (c = (i = Yx(u, 49)).ih(n, tnn(i.Tg(), this.b), null, c)) + : this.rk() && (c = Yx(u, 49).ih(n, -1 - tnn(n.Tg(), this.e), null, c))), + t.Eh(e), + n.Lg() && n.Mg() ? ((r = new tq(n, this.Kj() ? 2 : 1, this.e, u, null, a)), c ? (c.Ei(r), c.Fi()) : K3(n, r)) : c && c.Fi(); + }), + (Fjn.bj = function () { + return !1; + }), + (Fjn.rk = function () { + return !1; + }), + (Fjn.sk = function () { + return !1; + }), + (Fjn.Kj = function () { + return !1; + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObject", 398), + Wfn(564, 398, {}, U$), + (Fjn.rk = function () { + return !0; + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainment", 564), + Wfn(1323, 564, {}, X$), + (Fjn.sk = function () { + return !0; + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentResolving", 1323), + Wfn(772, 564, {}, W$), + (Fjn.Kj = function () { + return !0; + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettable", 772), + Wfn(1325, 772, {}, V$), + (Fjn.sk = function () { + return !0; + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettableResolving", 1325), + Wfn(640, 564, {}, Bx), + (Fjn.bj = function () { + return !0; + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverse", 640), + Wfn(1324, 640, {}, Gx), + (Fjn.sk = function () { + return !0; + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseResolving", 1324), + Wfn(773, 640, {}, zx), + (Fjn.Kj = function () { + return !0; + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettable", 773), + Wfn(1326, 773, {}, Ux), + (Fjn.sk = function () { + return !0; + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettableResolving", 1326), + Wfn(641, 398, {}, Q$), + (Fjn.sk = function () { + return !0; + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolving", 641), + Wfn(1327, 641, {}, Y$), + (Fjn.Kj = function () { + return !0; + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingUnsettable", 1327), + Wfn(774, 641, {}, Hx), + (Fjn.bj = function () { + return !0; + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverse", 774), + Wfn(1328, 774, {}, Xx), + (Fjn.Kj = function () { + return !0; + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverseUnsettable", 1328), + Wfn(1321, 398, {}, J$), + (Fjn.Kj = function () { + return !0; + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectUnsettable", 1321), + Wfn(771, 398, {}, qx), + (Fjn.bj = function () { + return !0; + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverse", 771), + Wfn(1322, 771, {}, Wx), + (Fjn.Kj = function () { + return !0; + }), + EF(PNn, "EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverseUnsettable", 1322), + Wfn(775, 565, aRn, cB), + (Fjn.Pk = function (n) { + return new cB(this.a, this.c, n); + }), + (Fjn.dd = function () { + return this.b; + }), + (Fjn.Qk = function (n, t, e) { + return (function (n, t, e, i) { + return e && (i = e.gh(t, tnn(e.Tg(), n.c.Lj()), null, i)), i; + })(this, n, this.b, e); + }), + (Fjn.Rk = function (n, t, e) { + return (function (n, t, e, i) { + return e && (i = e.ih(t, tnn(e.Tg(), n.c.Lj()), null, i)), i; + })(this, n, this.b, e); + }), + EF(PNn, "EStructuralFeatureImpl/InverseUpdatingFeatureMapEntry", 775), + Wfn(1329, 1, DDn, Ug), + (Fjn.Wj = function (n) { + return this.a; + }), + (Fjn.fj = function () { + return CO(this.a, 95) ? Yx(this.a, 95).fj() : !this.a.dc(); + }), + (Fjn.Wb = function (n) { + this.a.$b(), this.a.Gc(Yx(n, 15)); + }), + (Fjn.Xj = function () { + CO(this.a, 95) ? Yx(this.a, 95).Xj() : this.a.$b(); + }), + EF(PNn, "EStructuralFeatureImpl/SettingMany", 1329), + Wfn(1330, 565, aRn, fW), + (Fjn.Ok = function (n) { + return new BL((ayn(), tot), this.b.Ih(this.a, n)); + }), + (Fjn.dd = function () { + return null; + }), + (Fjn.Qk = function (n, t, e) { + return e; + }), + (Fjn.Rk = function (n, t, e) { + return e; + }), + EF(PNn, "EStructuralFeatureImpl/SimpleContentFeatureMapEntry", 1330), + Wfn(642, 565, aRn, BL), + (Fjn.Ok = function (n) { + return new BL(this.c, n); + }), + (Fjn.dd = function () { + return this.a; + }), + (Fjn.Qk = function (n, t, e) { + return e; + }), + (Fjn.Rk = function (n, t, e) { + return e; + }), + EF(PNn, "EStructuralFeatureImpl/SimpleFeatureMapEntry", 642), + Wfn(391, 497, Mxn, Bo), + (Fjn.ri = function (n) { + return VQ(rat, iEn, 26, n, 0, 1); + }), + (Fjn.ni = function () { + return !1; + }), + EF(PNn, "ESuperAdapter/1", 391), + Wfn( + 444, + 438, + { + 105: 1, + 92: 1, + 90: 1, + 147: 1, + 191: 1, + 56: 1, + 108: 1, + 836: 1, + 49: 1, + 97: 1, + 150: 1, + 444: 1, + 114: 1, + 115: 1, + }, + Ho, + ), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), this.Ab; + case 1: + return this.zb; + case 2: + return !this.a && (this.a = new _R(this, hat, this)), this.a; + } + return RY(this, n - vF((xjn(), _at)), CZ(Yx(H3(this, 16), 26) || _at, n), t, e); + }), + (Fjn.jh = function (n, t, e) { + switch (t) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), Ten(this.Ab, n, e); + case 2: + return !this.a && (this.a = new _R(this, hat, this)), Ten(this.a, n, e); + } + return Yx(CZ(Yx(H3(this, 16), 26) || (xjn(), _at), t), 66) + .Nj() + .Rj(this, dtn(this), t - vF((xjn(), _at)), n, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return !!this.Ab && 0 != this.Ab.i; + case 1: + return null != this.zb; + case 2: + return !!this.a && 0 != this.a.i; + } + return xX(this, n - vF((xjn(), _at)), CZ(Yx(H3(this, 16), 26) || _at, n)); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 0: + return ( + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + Hmn(this.Ab), + !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), + void jF(this.Ab, Yx(t, 14)) + ); + case 1: + return void E2(this, lL(t)); + case 2: + return ( + !this.a && (this.a = new _R(this, hat, this)), + Hmn(this.a), + !this.a && (this.a = new _R(this, hat, this)), + void jF(this.a, Yx(t, 14)) + ); + } + E7(this, n - vF((xjn(), _at)), CZ(Yx(H3(this, 16), 26) || _at, n), t); + }), + (Fjn.zh = function () { + return xjn(), _at; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 0: + return !this.Ab && (this.Ab = new m_(Zct, this, 0, 3)), void Hmn(this.Ab); + case 1: + return void E2(this, null); + case 2: + return !this.a && (this.a = new _R(this, hat, this)), void Hmn(this.a); + } + r9(this, n - vF((xjn(), _at)), CZ(Yx(H3(this, 16), 26) || _at, n)); + }), + EF(PNn, "ETypeParameterImpl", 444), + Wfn(445, 85, JDn, _R), + (Fjn.cj = function (n, t) { + return (function (n, t, e) { + var i, r; + for (e = men(t, n.e, -1 - n.c, e), r = new Wg(new t6(new Ql(EB(n.a).a).a)); r.a.b; ) + e = zyn((i = Yx(s1(r.a).cd(), 87)), dbn(i, n.a), e); + return e; + })(this, Yx(n, 87), t); + }), + (Fjn.dj = function (n, t) { + return (function (n, t, e) { + var i, r; + for (e = Uq(t, n.e, -1 - n.c, e), r = new Wg(new t6(new Ql(EB(n.a).a).a)); r.a.b; ) + e = zyn((i = Yx(s1(r.a).cd(), 87)), dbn(i, n.a), e); + return e; + })(this, Yx(n, 87), t); + }), + EF(PNn, "ETypeParameterImpl/1", 445), + Wfn(634, 43, gMn, Wv), + (Fjn.ec = function () { + return new Xg(this); + }), + EF(PNn, "ETypeParameterImpl/2", 634), + Wfn(556, dEn, gEn, Xg), + (Fjn.Fc = function (n) { + return kN(this, Yx(n, 87)); + }), + (Fjn.Gc = function (n) { + var t, e, i; + for (i = !1, e = n.Kc(); e.Ob(); ) (t = Yx(e.Pb(), 87)), null == xB(this.a, t, "") && (i = !0); + return i; + }), + (Fjn.$b = function () { + U_(this.a); + }), + (Fjn.Hc = function (n) { + return P_(this.a, n); + }), + (Fjn.Kc = function () { + return new Wg(new t6(new Ql(this.a).a)); + }), + (Fjn.Mc = function (n) { + return hQ(this, n); + }), + (Fjn.gc = function () { + return hE(this.a); + }), + EF(PNn, "ETypeParameterImpl/2/1", 556), + Wfn(557, 1, fEn, Wg), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Pb = function () { + return Yx(s1(this.a).cd(), 87); + }), + (Fjn.Ob = function () { + return this.a.b; + }), + (Fjn.Qb = function () { + oY(this.a); + }), + EF(PNn, "ETypeParameterImpl/2/1/1", 557), + Wfn(1276, 43, gMn, Vv), + (Fjn._b = function (n) { + return aI(n) ? hq(this, n) : !!Dq(this.f, n); + }), + (Fjn.xc = function (n) { + var t; + return CO((t = aI(n) ? aG(this, n) : eI(Dq(this.f, n))), 837) + ? ((t = Yx(t, 837)._j()), xB(this, Yx(n, 235), t), t) + : null != t + ? t + : null == n + ? (ET(), mut) + : null; + }), + EF(PNn, "EValidatorRegistryImpl", 1276), + Wfn( + 1313, + 704, + { + 105: 1, + 92: 1, + 90: 1, + 471: 1, + 147: 1, + 56: 1, + 108: 1, + 1941: 1, + 49: 1, + 97: 1, + 150: 1, + 114: 1, + 115: 1, + }, + qo, + ), + (Fjn.Ih = function (n, t) { + switch (n.yj()) { + case 21: + case 22: + case 23: + case 24: + case 26: + case 31: + case 32: + case 37: + case 38: + case 39: + case 40: + case 43: + case 44: + case 48: + case 49: + case 20: + return null == t ? null : I7(t); + case 25: + return r1(t); + case 27: + case 28: + return (function (n) { + return CO(n, 172) ? "" + Yx(n, 172).a : null == n ? null : I7(n); + })(t); + case 29: + return null == t ? null : gO(Grt[0], Yx(t, 199)); + case 41: + return null == t ? "" : Nk(Yx(t, 290)); + case 42: + return I7(t); + case 50: + return lL(t); + default: + throw hp(new Qm(ONn + n.ne() + ANn)); + } + }), + (Fjn.Jh = function (n) { + var t; + switch ((-1 == n.G && (n.G = (t = i1(n)) ? Ren(t.Mh(), n) : -1), n.G)) { + case 0: + return new qv(); + case 1: + return new jo(); + case 2: + return new Rf(); + case 4: + return new Bp(); + case 5: + return new Gv(); + case 6: + return new Fp(); + case 7: + return new xf(); + case 10: + return new yo(); + case 11: + return new zv(); + case 12: + return new Sq(); + case 13: + return new Uv(); + case 14: + return new cL(); + case 17: + return new Ao(); + case 18: + return new up(); + case 19: + return new Ho(); + default: + throw hp(new Qm(NNn + n.zb + ANn)); + } + }), + (Fjn.Kh = function (n, t) { + switch (n.yj()) { + case 20: + return null == t ? null : new Wk(t); + case 21: + return null == t ? null : new IC(t); + case 23: + case 22: + return null == t + ? null + : (function (n) { + if (vtn(kLn, n)) return TA(), L_n; + if (vtn(jLn, n)) return TA(), $_n; + throw hp(new Qm("Expecting true or false")); + })(t); + case 26: + case 24: + return null == t ? null : iZ((ipn(t, -128, 127) << 24) >> 24); + case 25: + return (function (n) { + var t, e, i, r, c, a, u; + if (null == n) return null; + for ( + u = n.length, + a = VQ(Yot, LNn, 25, (r = ((u + 1) / 2) | 0), 15, 1), + u % 2 != 0 && (a[--r] = Odn((Lz(u - 1, n.length), n.charCodeAt(u - 1)))), + e = 0, + i = 0; + e < r; + ++e + ) + (t = Odn(XB(n, i++))), (c = Odn(XB(n, i++))), (a[e] = (((t << 4) | c) << 24) >> 24); + return a; + })(t); + case 27: + return (function (n) { + var t; + if (null == n) return null; + t = 0; + try { + t = ipn(n, nTn, Yjn) & fTn; + } catch (e) { + if (!CO((e = j4(e)), 127)) throw hp(e); + t = xJ(n)[0]; + } + return k4(t); + })(t); + case 28: + return (function (n) { + var t; + if (null == n) return null; + t = 0; + try { + t = ipn(n, nTn, Yjn) & fTn; + } catch (e) { + if (!CO((e = j4(e)), 127)) throw hp(e); + t = xJ(n)[0]; + } + return k4(t); + })(t); + case 29: + return (function (n) { + var t, e; + if (null == n) return null; + for (t = null, e = 0; e < Grt.length; ++e) + try { + return wT(Grt[e], n); + } catch (n) { + if (!CO((n = j4(n)), 32)) throw hp(n); + t = n; + } + throw hp(new mJ(t)); + })(t); + case 32: + case 31: + return null == t ? null : gon(t); + case 38: + case 37: + return null == t ? null : new Vp(t); + case 40: + case 39: + return null == t ? null : d9(ipn(t, nTn, Yjn)); + case 41: + case 42: + return null; + case 44: + case 43: + return null == t ? null : ytn(mkn(t)); + case 49: + case 48: + return null == t ? null : g9((ipn(t, fRn, 32767) << 16) >> 16); + case 50: + return t; + default: + throw hp(new Qm(ONn + n.ne() + ANn)); + } + }), + EF(PNn, "EcoreFactoryImpl", 1313), + Wfn( + 547, + 179, + { + 105: 1, + 92: 1, + 90: 1, + 147: 1, + 191: 1, + 56: 1, + 235: 1, + 108: 1, + 1939: 1, + 49: 1, + 97: 1, + 150: 1, + 179: 1, + 547: 1, + 114: 1, + 115: 1, + 675: 1, + }, + $B, + ), + (Fjn.gb = !1), + (Fjn.hb = !1); + var hut, + fut = !1; + EF(PNn, "EcorePackageImpl", 547), + Wfn(1184, 1, { 837: 1 }, Go), + (Fjn._j = function () { + return EA(), yut; + }), + EF(PNn, "EcorePackageImpl/1", 1184), + Wfn(1193, 1, TRn, zo), + (Fjn.wj = function (n) { + return CO(n, 147); + }), + (Fjn.xj = function (n) { + return VQ(ect, iEn, 147, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/10", 1193), + Wfn(1194, 1, TRn, Uo), + (Fjn.wj = function (n) { + return CO(n, 191); + }), + (Fjn.xj = function (n) { + return VQ(rct, iEn, 191, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/11", 1194), + Wfn(1195, 1, TRn, Xo), + (Fjn.wj = function (n) { + return CO(n, 56); + }), + (Fjn.xj = function (n) { + return VQ(Wrt, iEn, 56, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/12", 1195), + Wfn(1196, 1, TRn, Wo), + (Fjn.wj = function (n) { + return CO(n, 399); + }), + (Fjn.xj = function (n) { + return VQ(fat, QDn, 59, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/13", 1196), + Wfn(1197, 1, TRn, Vo), + (Fjn.wj = function (n) { + return CO(n, 235); + }), + (Fjn.xj = function (n) { + return VQ(cct, iEn, 235, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/14", 1197), + Wfn(1198, 1, TRn, Qo), + (Fjn.wj = function (n) { + return CO(n, 509); + }), + (Fjn.xj = function (n) { + return VQ(lat, iEn, 2017, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/15", 1198), + Wfn(1199, 1, TRn, Yo), + (Fjn.wj = function (n) { + return CO(n, 99); + }), + (Fjn.xj = function (n) { + return VQ(bat, VDn, 18, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/16", 1199), + Wfn(1200, 1, TRn, Jo), + (Fjn.wj = function (n) { + return CO(n, 170); + }), + (Fjn.xj = function (n) { + return VQ(tat, VDn, 170, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/17", 1200), + Wfn(1201, 1, TRn, Zo), + (Fjn.wj = function (n) { + return CO(n, 472); + }), + (Fjn.xj = function (n) { + return VQ(nat, iEn, 472, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/18", 1201), + Wfn(1202, 1, TRn, ns), + (Fjn.wj = function (n) { + return CO(n, 548); + }), + (Fjn.xj = function (n) { + return VQ(out, kDn, 548, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/19", 1202), + Wfn(1185, 1, TRn, ts), + (Fjn.wj = function (n) { + return CO(n, 322); + }), + (Fjn.xj = function (n) { + return VQ(eat, VDn, 34, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/2", 1185), + Wfn(1203, 1, TRn, es), + (Fjn.wj = function (n) { + return CO(n, 241); + }), + (Fjn.xj = function (n) { + return VQ(hat, eRn, 87, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/20", 1203), + Wfn(1204, 1, TRn, is), + (Fjn.wj = function (n) { + return CO(n, 444); + }), + (Fjn.xj = function (n) { + return VQ(zat, iEn, 836, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/21", 1204), + Wfn(1205, 1, TRn, rs), + (Fjn.wj = function (n) { + return rI(n); + }), + (Fjn.xj = function (n) { + return VQ(D_n, TEn, 476, n, 8, 1); + }), + EF(PNn, "EcorePackageImpl/22", 1205), + Wfn(1206, 1, TRn, cs), + (Fjn.wj = function (n) { + return CO(n, 190); + }), + (Fjn.xj = function (n) { + return VQ(Yot, TEn, 190, n, 0, 2); + }), + EF(PNn, "EcorePackageImpl/23", 1206), + Wfn(1207, 1, TRn, as), + (Fjn.wj = function (n) { + return CO(n, 217); + }), + (Fjn.xj = function (n) { + return VQ(__n, TEn, 217, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/24", 1207), + Wfn(1208, 1, TRn, us), + (Fjn.wj = function (n) { + return CO(n, 172); + }), + (Fjn.xj = function (n) { + return VQ(B_n, TEn, 172, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/25", 1208), + Wfn(1209, 1, TRn, os), + (Fjn.wj = function (n) { + return CO(n, 199); + }), + (Fjn.xj = function (n) { + return VQ(N_n, TEn, 199, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/26", 1209), + Wfn(1210, 1, TRn, ss), + (Fjn.wj = function (n) { + return !1; + }), + (Fjn.xj = function (n) { + return VQ(est, iEn, 2110, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/27", 1210), + Wfn(1211, 1, TRn, hs), + (Fjn.wj = function (n) { + return cI(n); + }), + (Fjn.xj = function (n) { + return VQ(H_n, TEn, 333, n, 7, 1); + }), + EF(PNn, "EcorePackageImpl/28", 1211), + Wfn(1212, 1, TRn, fs), + (Fjn.wj = function (n) { + return CO(n, 58); + }), + (Fjn.xj = function (n) { + return VQ(jct, dPn, 58, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/29", 1212), + Wfn(1186, 1, TRn, ls), + (Fjn.wj = function (n) { + return CO(n, 510); + }), + (Fjn.xj = function (n) { + return VQ(Zct, { 3: 1, 4: 1, 5: 1, 1934: 1 }, 590, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/3", 1186), + Wfn(1213, 1, TRn, bs), + (Fjn.wj = function (n) { + return CO(n, 573); + }), + (Fjn.xj = function (n) { + return VQ(xct, iEn, 1940, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/30", 1213), + Wfn(1214, 1, TRn, ws), + (Fjn.wj = function (n) { + return CO(n, 153); + }), + (Fjn.xj = function (n) { + return VQ(Eut, dPn, 153, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/31", 1214), + Wfn(1215, 1, TRn, ds), + (Fjn.wj = function (n) { + return CO(n, 72); + }), + (Fjn.xj = function (n) { + return VQ(Xat, MRn, 72, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/32", 1215), + Wfn(1216, 1, TRn, gs), + (Fjn.wj = function (n) { + return CO(n, 155); + }), + (Fjn.xj = function (n) { + return VQ(q_n, TEn, 155, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/33", 1216), + Wfn(1217, 1, TRn, ps), + (Fjn.wj = function (n) { + return CO(n, 19); + }), + (Fjn.xj = function (n) { + return VQ(U_n, TEn, 19, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/34", 1217), + Wfn(1218, 1, TRn, vs), + (Fjn.wj = function (n) { + return CO(n, 290); + }), + (Fjn.xj = function (n) { + return VQ(XKn, iEn, 290, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/35", 1218), + Wfn(1219, 1, TRn, ms), + (Fjn.wj = function (n) { + return CO(n, 162); + }), + (Fjn.xj = function (n) { + return VQ(J_n, TEn, 162, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/36", 1219), + Wfn(1220, 1, TRn, ys), + (Fjn.wj = function (n) { + return CO(n, 83); + }), + (Fjn.xj = function (n) { + return VQ(VKn, iEn, 83, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/37", 1220), + Wfn(1221, 1, TRn, ks), + (Fjn.wj = function (n) { + return CO(n, 591); + }), + (Fjn.xj = function (n) { + return VQ(vut, iEn, 591, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/38", 1221), + Wfn(1222, 1, TRn, js), + (Fjn.wj = function (n) { + return !1; + }), + (Fjn.xj = function (n) { + return VQ(ist, iEn, 2111, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/39", 1222), + Wfn(1187, 1, TRn, Es), + (Fjn.wj = function (n) { + return CO(n, 88); + }), + (Fjn.xj = function (n) { + return VQ(rat, iEn, 26, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/4", 1187), + Wfn(1223, 1, TRn, Ts), + (Fjn.wj = function (n) { + return CO(n, 184); + }), + (Fjn.xj = function (n) { + return VQ(nFn, TEn, 184, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/40", 1223), + Wfn(1224, 1, TRn, Ms), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(PNn, "EcorePackageImpl/41", 1224), + Wfn(1225, 1, TRn, Ss), + (Fjn.wj = function (n) { + return CO(n, 588); + }), + (Fjn.xj = function (n) { + return VQ(Tct, iEn, 588, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/42", 1225), + Wfn(1226, 1, TRn, Ps), + (Fjn.wj = function (n) { + return !1; + }), + (Fjn.xj = function (n) { + return VQ(rst, TEn, 2112, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/43", 1226), + Wfn(1227, 1, TRn, Is), + (Fjn.wj = function (n) { + return CO(n, 42); + }), + (Fjn.xj = function (n) { + return VQ(i_n, DEn, 42, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/44", 1227), + Wfn(1188, 1, TRn, Cs), + (Fjn.wj = function (n) { + return CO(n, 138); + }), + (Fjn.xj = function (n) { + return VQ(iat, iEn, 138, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/5", 1188), + Wfn(1189, 1, TRn, Os), + (Fjn.wj = function (n) { + return CO(n, 148); + }), + (Fjn.xj = function (n) { + return VQ(cat, iEn, 148, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/6", 1189), + Wfn(1190, 1, TRn, As), + (Fjn.wj = function (n) { + return CO(n, 457); + }), + (Fjn.xj = function (n) { + return VQ(oat, iEn, 671, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/7", 1190), + Wfn(1191, 1, TRn, $s), + (Fjn.wj = function (n) { + return CO(n, 573); + }), + (Fjn.xj = function (n) { + return VQ(sat, iEn, 678, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/8", 1191), + Wfn(1192, 1, TRn, Ls), + (Fjn.wj = function (n) { + return CO(n, 471); + }), + (Fjn.xj = function (n) { + return VQ(ict, iEn, 471, n, 0, 1); + }), + EF(PNn, "EcorePackageImpl/9", 1192), + Wfn(1025, 1982, mDn, Um), + (Fjn.bi = function (n, t) { + !(function (n, t) { + var e, i, r; + if ((t.vi(n.a), null != (r = Yx(H3(n.a, 8), 1936)))) for (e = 0, i = r.length; e < i; ++e) null.jm(); + })(this, Yx(t, 415)); + }), + (Fjn.fi = function (n, t) { + _sn(this, n, Yx(t, 415)); + }), + EF(PNn, "MinimalEObjectImpl/1ArrayDelegatingAdapterList", 1025), + Wfn(1026, 143, gDn, aB), + (Fjn.Ai = function () { + return this.a.a; + }), + EF(PNn, "MinimalEObjectImpl/1ArrayDelegatingAdapterList/1", 1026), + Wfn(1053, 1052, {}, zC), + EF("org.eclipse.emf.ecore.plugin", "EcorePlugin", 1053); + var lut, + but, + wut, + dut, + gut, + put, + vut = aR(SRn, "Resource"); + Wfn(781, 1378, PRn), + (Fjn.Yk = function (n) {}), + (Fjn.Zk = function (n) {}), + (Fjn.Vk = function () { + return !this.a && (this.a = new Vg(this)), this.a; + }), + (Fjn.Wk = function (n) { + var t, e, i, r, c; + if ((i = n.length) > 0) { + if ((Lz(0, n.length), 47 == n.charCodeAt(0))) { + for (c = new pQ(4), r = 1, t = 1; t < i; ++t) + Lz(t, n.length), 47 == n.charCodeAt(t) && (eD(c, r == t ? "" : n.substr(r, t - r)), (r = t + 1)); + return eD(c, n.substr(r)), Ccn(this, c); + } + Lz(i - 1, n.length), 63 == n.charCodeAt(i - 1) && (e = qN(n, gun(63), i - 2)) > 0 && (n = n.substr(0, e)); + } + return (function (n, t) { + var e, i, r, c, a, u; + for (c = null, r = new k_((!n.a && (n.a = new Vg(n)), n.a)); ufn(r); ) + if ((emn((a = (e = Yx(abn(r), 56)).Tg())), null != (i = (u = a.o) && e.mh(u) ? RN(v4(u), e.ah(u)) : null) && _N(i, t))) { + c = e; + break; + } + return c; + })(this, n); + }), + (Fjn.Xk = function () { + return this.c; + }), + (Fjn.Ib = function () { + return Nk(this.gm) + "@" + (W5(this) >>> 0).toString(16) + " uri='" + this.d + "'"; + }), + (Fjn.b = !1), + EF(IRn, "ResourceImpl", 781), + Wfn(1379, 781, PRn, Yg), + EF(IRn, "BinaryResourceImpl", 1379), + Wfn(1169, 694, Sxn), + (Fjn.si = function (n) { + return CO(n, 56) + ? (function (n, t) { + return n.a ? t.Wg().Kc() : Yx(t.Wg(), 69).Zh(); + })(this, Yx(n, 56)) + : CO(n, 591) + ? new UO(Yx(n, 591).Vk()) + : iI(n) === iI(this.f) + ? Yx(n, 14).Kc() + : (iL(), $ct.a); + }), + (Fjn.Ob = function () { + return ufn(this); + }), + (Fjn.a = !1), + EF(xDn, "EcoreUtil/ContentTreeIterator", 1169), + Wfn(1380, 1169, Sxn, k_), + (Fjn.si = function (n) { + return iI(n) === iI(this.f) ? Yx(n, 15).Kc() : new hX(Yx(n, 56)); + }), + EF(IRn, "ResourceImpl/5", 1380), + Wfn(648, 1994, YDn, Vg), + (Fjn.Hc = function (n) { + return this.i <= 4 ? Fcn(this, n) : CO(n, 49) && Yx(n, 49).Zg() == this.a; + }), + (Fjn.bi = function (n, t) { + n == this.i - 1 && (this.a.b || (this.a.b = !0)); + }), + (Fjn.di = function (n, t) { + 0 == n ? this.a.b || (this.a.b = !0) : XQ(this, n, t); + }), + (Fjn.fi = function (n, t) {}), + (Fjn.gi = function (n, t, e) {}), + (Fjn.aj = function () { + return 2; + }), + (Fjn.Ai = function () { + return this.a; + }), + (Fjn.bj = function () { + return !0; + }), + (Fjn.cj = function (n, t) { + return Yx(n, 49).wh(this.a, t); + }), + (Fjn.dj = function (n, t) { + return Yx(n, 49).wh(null, t); + }), + (Fjn.ej = function () { + return !1; + }), + (Fjn.hi = function () { + return !0; + }), + (Fjn.ri = function (n) { + return VQ(Wrt, iEn, 56, n, 0, 1); + }), + (Fjn.ni = function () { + return !1; + }), + EF(IRn, "ResourceImpl/ContentsEList", 648), + Wfn(957, 1964, WEn, Qg), + (Fjn.Zc = function (n) { + return this.a._h(n); + }), + (Fjn.gc = function () { + return this.a.gc(); + }), + EF(xDn, "AbstractSequentialInternalEList/1", 957), + Wfn(624, 1, {}, OD), + EF(xDn, "BasicExtendedMetaData", 624), + Wfn(1160, 1, {}, UP), + (Fjn.$k = function () { + return null; + }), + (Fjn._k = function () { + return ( + -2 == this.a && + ((n = this), + (t = (function (n, t) { + var e, i, r; + if ((e = t.Hh(n.a)) && null != (r = ynn((!e.b && (e.b = new z$((xjn(), Dat), out, e)), e.b), tRn))) + for (i = 1; i < (wsn(), lut).length; ++i) if (_N(lut[i], r)) return i; + return 0; + })(this.d, this.b)), + (n.a = t)), + this.a + ); + var n, t; + }), + (Fjn.al = function () { + return null; + }), + (Fjn.bl = function () { + return XH(), XH(), TFn; + }), + (Fjn.ne = function () { + return this.c == qRn && ((n = this), (t = ktn(this.d, this.b)), (n.c = t)), this.c; + var n, t; + }), + (Fjn.cl = function () { + return 0; + }), + (Fjn.a = -2), + (Fjn.c = qRn), + EF(xDn, "BasicExtendedMetaData/EClassExtendedMetaDataImpl", 1160), + Wfn(1161, 1, {}, mU), + (Fjn.$k = function () { + return ( + this.a == (wV(), gut) && + (function (n, t) { + n.a = t; + })( + this, + ((n = this.f), + (t = this.b), + (i = t.Hh(n.a)) && + (!i.b && (i.b = new z$((xjn(), Dat), out, i)), + null != (e = lL(ynn(i.b, bRn))) && + CO( + (c = + -1 == (r = e.lastIndexOf("#")) + ? Z$(n, t.Aj(), e) + : 0 == r + ? EY(n, null, e.substr(1)) + : EY(n, e.substr(0, r), e.substr(r + 1))), + 148, + )) + ? Yx(c, 148) + : null), + ), + this.a + ); + var n, t, e, i, r, c; + }), + (Fjn._k = function () { + return 0; + }), + (Fjn.al = function () { + return ( + this.c == (wV(), gut) && + (function (n, t) { + n.c = t; + })( + this, + ((n = this.f), + (t = this.b), + (e = t.Hh(n.a)) && + (!e.b && (e.b = new z$((xjn(), Dat), out, e)), + null != (r = lL(ynn(e.b, DRn))) && + CO( + (c = + -1 == (i = r.lastIndexOf("#")) + ? Z$(n, t.Aj(), r) + : 0 == i + ? EY(n, null, r.substr(1)) + : EY(n, r.substr(0, i), r.substr(i + 1))), + 148, + )) + ? Yx(c, 148) + : null), + ), + this.c + ); + var n, t, e, i, r, c; + }), + (Fjn.bl = function () { + return ( + !this.d && + ((n = this), + (t = (function (n, t) { + var e, i, r, c, a, u, o, s, h; + if ((e = t.Hh(n.a)) && null != (o = lL(ynn((!e.b && (e.b = new z$((xjn(), Dat), out, e)), e.b), "memberTypes")))) { + for (s = new ip(), a = 0, u = (c = Ogn(o, "\\w")).length; a < u; ++a) + CO( + (h = + -1 == (i = (r = c[a]).lastIndexOf("#")) + ? Z$(n, t.Aj(), r) + : 0 == i + ? EY(n, null, r.substr(1)) + : EY(n, r.substr(0, i), r.substr(i + 1))), + 148, + ) && eD(s, Yx(h, 148)); + return s; + } + return XH(), XH(), TFn; + })(this.f, this.b)), + (n.d = t)), + this.d + ); + var n, t; + }), + (Fjn.ne = function () { + return this.e == qRn && ((n = this), (t = ktn(this.f, this.b)), (n.e = t)), this.e; + var n, t; + }), + (Fjn.cl = function () { + return ( + -2 == this.g && + ((n = this), + (t = (function (n, t) { + var e, i, r; + if ((e = t.Hh(n.a))) + for (r = lL(ynn((!e.b && (e.b = new z$((xjn(), Dat), out, e)), e.b), _Rn)), i = 1; i < (wsn(), dut).length; ++i) + if (_N(dut[i], r)) return i; + return 0; + })(this.f, this.b)), + (n.g = t)), + this.g + ); + var n, t; + }), + (Fjn.e = qRn), + (Fjn.g = -2), + EF(xDn, "BasicExtendedMetaData/EDataTypeExtendedMetaDataImpl", 1161), + Wfn(1159, 1, {}, YP), + (Fjn.b = !1), + (Fjn.c = !1), + EF(xDn, "BasicExtendedMetaData/EPackageExtendedMetaDataImpl", 1159), + Wfn(1162, 1, {}, vU), + (Fjn.c = -2), + (Fjn.e = qRn), + (Fjn.f = qRn), + EF(xDn, "BasicExtendedMetaData/EStructuralFeatureExtendedMetaDataImpl", 1162), + Wfn(585, 622, JDn, CD), + (Fjn.aj = function () { + return this.c; + }), + (Fjn.Fk = function () { + return !1; + }), + (Fjn.li = function (n, t) { + return t; + }), + (Fjn.c = 0), + EF(xDn, "EDataTypeEList", 585); + var mut, + yut, + kut, + jut, + Eut = aR(xDn, "FeatureMap"); + Wfn( + 75, + 585, + { + 3: 1, + 4: 1, + 20: 1, + 28: 1, + 52: 1, + 14: 1, + 15: 1, + 54: 1, + 67: 1, + 63: 1, + 58: 1, + 76: 1, + 153: 1, + 215: 1, + 1937: 1, + 69: 1, + 95: 1, + }, + e3, + ), + (Fjn.Vc = function (n, t) { + !(function (n, t, e) { + var i, r, c, a, u, o; + if (((c = (r = e).ak()), Lwn(n.e, c))) { + if (c.hi()) for (i = Yx(n.g, 119), a = 0; a < n.i; ++a) if (Q8((u = i[a]), r) && a != t) throw hp(new Qm(kxn)); + } else + for (o = dwn(n.e.Tg(), c), i = Yx(n.g, 119), a = 0; a < n.i; ++a) if (((u = i[a]), o.rl(u.ak()))) throw hp(new Qm(GRn)); + y9(n, t, e); + })(this, n, Yx(t, 72)); + }), + (Fjn.Fc = function (n) { + return (function (n, t) { + var e, i, r, c, a, u; + if (((r = (i = t).ak()), Lwn(n.e, r))) { + if (r.hi() && HX(n, r, i.dd())) return !1; + } else + for (u = dwn(n.e.Tg(), r), e = Yx(n.g, 119), c = 0; c < n.i; ++c) + if (((a = e[c]), u.rl(a.ak()))) return !Q8(a, i) && (Yx(Ken(n, c, t), 72), !0); + return fY(n, t); + })(this, Yx(n, 72)); + }), + (Fjn.Yh = function (n) { + yF(this, Yx(n, 72)); + }), + (Fjn.cj = function (n, t) { + return (function (n, t, e) { + return (function (n, t, e) { + return t.Qk(n.e, n.c, e); + })(n, Yx(t, 332), e); + })(this, Yx(n, 72), t); + }), + (Fjn.dj = function (n, t) { + return JN(this, Yx(n, 72), t); + }), + (Fjn.ii = function (n, t) { + return (function (n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b, w; + if (!gC(n.e)) return Yx(Vhn(n, t, e), 72); + if (t != e && ((a = (b = (r = Yx(n.g, 119))[e]).ak()), Lwn(n.e, a))) { + for (w = dwn(n.e.Tg(), a), o = -1, u = -1, i = 0, s = 0, f = t > e ? t : e; s <= f; ++s) + s == e ? (u = i++) : ((c = r[s]), (h = w.rl(c.ak())), s == t && (o = s != f || h ? i : i - 1), h && ++i); + return (l = Yx(L9(n, t, e), 72)), u != o && Xp(n, new jY(n.e, 7, a, d9(u), b.dd(), o)), l; + } + return Yx(L9(n, t, e), 72); + })(this, n, t); + }), + (Fjn.li = function (n, t) { + return (function (n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b, w, d, g; + if (CO((a = e.ak()), 99) && 0 != (Yx(a, 18).Bb & eMn) && ((l = Yx(e.dd(), 49)), (d = P8(n.e, l)) != l)) { + if ( + (_O(n, t, zan(n, 0, (h = VX(a, d)))), (f = null), gC(n.e) && (i = iyn((wsn(), wut), n.e.Tg(), a)) != CZ(n.e.Tg(), n.c)) + ) { + for (g = dwn(n.e.Tg(), a), u = 0, c = Yx(n.g, 119), o = 0; o < t; ++o) (r = c[o]), g.rl(r.ak()) && ++u; + (f = new oW(n.e, 9, i, l, d, u, !1)).Ei(new yJ(n.e, 9, n.c, e, h, t, !1)); + } + return ( + (b = nin((w = Yx(a, 18)))) + ? ((f = l.ih(n.e, tnn(l.Tg(), b), null, f)), (f = Yx(d, 49).gh(n.e, tnn(d.Tg(), b), null, f))) + : 0 != (w.Bb & MNn) && + ((s = -1 - tnn(n.e.Tg(), w)), (f = l.ih(n.e, s, null, null)), !Yx(d, 49).eh() && (f = Yx(d, 49).gh(n.e, s, null, f))), + f && f.Fi(), + h + ); + } + return e; + })(this, n, Yx(t, 72)); + }), + (Fjn._c = function (n, t) { + return (function (n, t, e) { + var i, r, c, a, u, o; + if (((c = (r = e).ak()), Lwn(n.e, c))) { + if (c.hi()) for (i = Yx(n.g, 119), a = 0; a < n.i; ++a) if (Q8((u = i[a]), r) && a != t) throw hp(new Qm(kxn)); + } else + for (o = dwn(n.e.Tg(), c), i = Yx(n.g, 119), a = 0; a < n.i; ++a) + if (((u = i[a]), o.rl(u.ak()) && a != t)) throw hp(new Qm(GRn)); + return Yx(Ken(n, t, e), 72); + })(this, n, Yx(t, 72)); + }), + (Fjn.jj = function (n, t) { + return (function (n, t, e) { + return jan(n, Yx(t, 332), e); + })(this, Yx(n, 72), t); + }), + (Fjn.kj = function (n, t) { + return ZN(this, Yx(n, 72), t); + }), + (Fjn.lj = function (n, t, e) { + return (function (n, t, e, i) { + var r, c, a; + return ( + gC(n.e) && + ((a = Kq( + n, + 1, + (r = t.ak()), + t.dd(), + (c = e.dd()), + r.$j() ? $vn(n, r, c, CO(r, 99) && 0 != (Yx(r, 18).Bb & eMn)) : -1, + !0, + )), + i ? i.Ei(a) : (i = a)), + i + ); + })(this, Yx(n, 72), Yx(t, 72), e); + }), + (Fjn.oi = function (n, t) { + return zan(this, 0, Yx(t, 72)); + }), + (Fjn.dl = function (n, t) { + return Rgn(this, n, t); + }), + (Fjn.Wc = function (n, t) { + var e, i, r, c, a, u, o, s, h; + for (s = new FZ(t.gc()), r = t.Kc(); r.Ob(); ) + if (((c = (i = Yx(r.Pb(), 72)).ak()), Lwn(this.e, c))) (!c.hi() || (!HX(this, c, i.dd()) && !Fcn(s, i))) && fY(s, i); + else { + for (h = dwn(this.e.Tg(), c), e = Yx(this.g, 119), a = !0, u = 0; u < this.i; ++u) + if (((o = e[u]), h.rl(o.ak()))) { + Yx(Ken(this, u, i), 72), (a = !1); + break; + } + a && fY(s, i); + } + return f5(this, n, s); + }), + (Fjn.Gc = function (n) { + var t, e, i, r, c, a, u, o, s; + for (o = new FZ(n.gc()), i = n.Kc(); i.Ob(); ) + if (((r = (e = Yx(i.Pb(), 72)).ak()), Lwn(this.e, r))) (!r.hi() || (!HX(this, r, e.dd()) && !Fcn(o, e))) && fY(o, e); + else { + for (s = dwn(this.e.Tg(), r), t = Yx(this.g, 119), c = !0, a = 0; a < this.i; ++a) + if (((u = t[a]), s.rl(u.ak()))) { + Yx(Ken(this, a, e), 72), (c = !1); + break; + } + c && fY(o, e); + } + return jF(this, o); + }), + (Fjn.Wh = function (n) { + return (this.j = -1), tvn(this, this.i, n); + }), + (Fjn.el = function (n, t, e) { + return Ydn(this, n, t, e); + }), + (Fjn.mk = function (n, t) { + return Lgn(this, n, t); + }), + (Fjn.fl = function (n, t, e) { + return rmn(this, n, t, e); + }), + (Fjn.gl = function () { + return this; + }), + (Fjn.hl = function (n, t) { + return umn(this, n, t); + }), + (Fjn.il = function (n) { + return Yx(c1(this, n), 72).ak(); + }), + (Fjn.jl = function (n) { + return Yx(c1(this, n), 72).dd(); + }), + (Fjn.kl = function () { + return this.b; + }), + (Fjn.bj = function () { + return !0; + }), + (Fjn.ij = function () { + return !0; + }), + (Fjn.ll = function (n) { + return !knn(this, n); + }), + (Fjn.ri = function (n) { + return VQ(sut, MRn, 332, n, 0, 1); + }), + (Fjn.Gk = function (n) { + return nL(this, n); + }), + (Fjn.Wb = function (n) { + sF(this, n); + }), + (Fjn.ml = function (n, t) { + kmn(this, n, t); + }), + (Fjn.nl = function (n) { + return G0(this, n); + }), + (Fjn.ol = function (n) { + Qin(this, n); + }), + EF(xDn, "BasicFeatureMap", 75), + Wfn(1851, 1, yEn), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Rb = function (n) { + if (-1 == this.g) throw hp(new Lp()); + qK(this); + try { + $wn(this.e, this.b, this.a, n), (this.d = this.e.j), Den(this); + } catch (n) { + throw CO((n = j4(n)), 73) ? hp(new Dp()) : hp(n); + } + }), + (Fjn.Ob = function () { + return T6(this); + }), + (Fjn.Sb = function () { + return M6(this); + }), + (Fjn.Pb = function () { + return Den(this); + }), + (Fjn.Tb = function () { + return this.a; + }), + (Fjn.Ub = function () { + var n; + if (M6(this)) + return ( + qK(this), + (this.g = --this.a), + this.Lk() && ((n = qhn(this.e, this.b, this.c, this.a, this.j)), (this.j = n)), + (this.i = 0), + this.j + ); + throw hp(new Kp()); + }), + (Fjn.Vb = function () { + return this.a - 1; + }), + (Fjn.Qb = function () { + if (-1 == this.g) throw hp(new Lp()); + qK(this); + try { + Yon(this.e, this.b, this.g), (this.d = this.e.j), this.g < this.a && (--this.a, --this.c), --this.g; + } catch (n) { + throw CO((n = j4(n)), 73) ? hp(new Dp()) : hp(n); + } + }), + (Fjn.Lk = function () { + return !1; + }), + (Fjn.Wb = function (n) { + if (-1 == this.g) throw hp(new Lp()); + qK(this); + try { + lvn(this.e, this.b, this.g, n), (this.d = this.e.j); + } catch (n) { + throw CO((n = j4(n)), 73) ? hp(new Dp()) : hp(n); + } + }), + (Fjn.a = 0), + (Fjn.c = 0), + (Fjn.d = 0), + (Fjn.f = !1), + (Fjn.g = 0), + (Fjn.i = 0), + EF(xDn, "FeatureMapUtil/BasicFeatureEIterator", 1851), + Wfn(410, 1851, yEn, Y3), + (Fjn.pl = function () { + var n, t, e; + for (e = this.e.i, n = Yx(this.e.g, 119); this.c < e; ) { + if (((t = n[this.c]), this.k.rl(t.ak()))) return (this.j = this.f ? t : t.dd()), (this.i = 2), !0; + ++this.c; + } + return (this.i = 1), (this.g = -1), !1; + }), + (Fjn.ql = function () { + var n, t; + for (n = Yx(this.e.g, 119); --this.c >= 0; ) + if (((t = n[this.c]), this.k.rl(t.ak()))) return (this.j = this.f ? t : t.dd()), (this.i = -2), !0; + return (this.i = -1), (this.g = -1), !1; + }), + EF(xDn, "BasicFeatureMap/FeatureEIterator", 410), + Wfn(662, 410, yEn, qI), + (Fjn.Lk = function () { + return !0; + }), + EF(xDn, "BasicFeatureMap/ResolvingFeatureEIterator", 662), + Wfn(955, 486, rRn, vO), + (Fjn.Gi = function () { + return this; + }), + EF(xDn, "EContentsEList/1", 955), + Wfn(956, 486, rRn, GI), + (Fjn.Lk = function () { + return !1; + }), + EF(xDn, "EContentsEList/2", 956), + Wfn(954, 279, cRn, mO), + (Fjn.Nk = function (n) {}), + (Fjn.Ob = function () { + return !1; + }), + (Fjn.Sb = function () { + return !1; + }), + EF(xDn, "EContentsEList/FeatureIteratorImpl/1", 954), + Wfn(825, 585, JDn, ZO), + (Fjn.ci = function () { + this.a = !0; + }), + (Fjn.fj = function () { + return this.a; + }), + (Fjn.Xj = function () { + var n; + Hmn(this), gC(this.e) ? ((n = this.a), (this.a = !1), K3(this.e, new OV(this.e, 2, this.c, n, !1))) : (this.a = !1); + }), + (Fjn.a = !1), + EF(xDn, "EDataTypeEList/Unsettable", 825), + Wfn(1849, 585, JDn, nA), + (Fjn.hi = function () { + return !0; + }), + EF(xDn, "EDataTypeUniqueEList", 1849), + Wfn(1850, 825, JDn, tA), + (Fjn.hi = function () { + return !0; + }), + EF(xDn, "EDataTypeUniqueEList/Unsettable", 1850), + Wfn(139, 85, JDn, VO), + (Fjn.Ek = function () { + return !0; + }), + (Fjn.li = function (n, t) { + return $fn(this, n, Yx(t, 56)); + }), + EF(xDn, "EObjectContainmentEList/Resolving", 139), + Wfn(1163, 545, JDn, QO), + (Fjn.Ek = function () { + return !0; + }), + (Fjn.li = function (n, t) { + return $fn(this, n, Yx(t, 56)); + }), + EF(xDn, "EObjectContainmentEList/Unsettable/Resolving", 1163), + Wfn(748, 16, JDn, TN), + (Fjn.ci = function () { + this.a = !0; + }), + (Fjn.fj = function () { + return this.a; + }), + (Fjn.Xj = function () { + var n; + Hmn(this), gC(this.e) ? ((n = this.a), (this.a = !1), K3(this.e, new OV(this.e, 2, this.c, n, !1))) : (this.a = !1); + }), + (Fjn.a = !1), + EF(xDn, "EObjectContainmentWithInverseEList/Unsettable", 748), + Wfn(1173, 748, JDn, MN), + (Fjn.Ek = function () { + return !0; + }), + (Fjn.li = function (n, t) { + return $fn(this, n, Yx(t, 56)); + }), + EF(xDn, "EObjectContainmentWithInverseEList/Unsettable/Resolving", 1173), + Wfn(743, 496, JDn, YO), + (Fjn.ci = function () { + this.a = !0; + }), + (Fjn.fj = function () { + return this.a; + }), + (Fjn.Xj = function () { + var n; + Hmn(this), gC(this.e) ? ((n = this.a), (this.a = !1), K3(this.e, new OV(this.e, 2, this.c, n, !1))) : (this.a = !1); + }), + (Fjn.a = !1), + EF(xDn, "EObjectEList/Unsettable", 743), + Wfn(328, 496, JDn, JO), + (Fjn.Ek = function () { + return !0; + }), + (Fjn.li = function (n, t) { + return $fn(this, n, Yx(t, 56)); + }), + EF(xDn, "EObjectResolvingEList", 328), + Wfn(1641, 743, JDn, eA), + (Fjn.Ek = function () { + return !0; + }), + (Fjn.li = function (n, t) { + return $fn(this, n, Yx(t, 56)); + }), + EF(xDn, "EObjectResolvingEList/Unsettable", 1641), + Wfn(1381, 1, {}, Ns), + EF(xDn, "EObjectValidator", 1381), + Wfn(546, 496, JDn, y_), + (Fjn.zk = function () { + return this.d; + }), + (Fjn.Ak = function () { + return this.b; + }), + (Fjn.bj = function () { + return !0; + }), + (Fjn.Dk = function () { + return !0; + }), + (Fjn.b = 0), + EF(xDn, "EObjectWithInverseEList", 546), + Wfn(1176, 546, JDn, SN), + (Fjn.Ck = function () { + return !0; + }), + EF(xDn, "EObjectWithInverseEList/ManyInverse", 1176), + Wfn(625, 546, JDn, PN), + (Fjn.ci = function () { + this.a = !0; + }), + (Fjn.fj = function () { + return this.a; + }), + (Fjn.Xj = function () { + var n; + Hmn(this), gC(this.e) ? ((n = this.a), (this.a = !1), K3(this.e, new OV(this.e, 2, this.c, n, !1))) : (this.a = !1); + }), + (Fjn.a = !1), + EF(xDn, "EObjectWithInverseEList/Unsettable", 625), + Wfn(1175, 625, JDn, CN), + (Fjn.Ck = function () { + return !0; + }), + EF(xDn, "EObjectWithInverseEList/Unsettable/ManyInverse", 1175), + Wfn(749, 546, JDn, IN), + (Fjn.Ek = function () { + return !0; + }), + (Fjn.li = function (n, t) { + return $fn(this, n, Yx(t, 56)); + }), + EF(xDn, "EObjectWithInverseResolvingEList", 749), + Wfn(31, 749, JDn, AN), + (Fjn.Ck = function () { + return !0; + }), + EF(xDn, "EObjectWithInverseResolvingEList/ManyInverse", 31), + Wfn(750, 625, JDn, ON), + (Fjn.Ek = function () { + return !0; + }), + (Fjn.li = function (n, t) { + return $fn(this, n, Yx(t, 56)); + }), + EF(xDn, "EObjectWithInverseResolvingEList/Unsettable", 750), + Wfn(1174, 750, JDn, $N), + (Fjn.Ck = function () { + return !0; + }), + EF(xDn, "EObjectWithInverseResolvingEList/Unsettable/ManyInverse", 1174), + Wfn(1164, 622, JDn), + (Fjn.ai = function () { + return 0 == (1792 & this.b); + }), + (Fjn.ci = function () { + this.b |= 1; + }), + (Fjn.Bk = function () { + return 0 != (4 & this.b); + }), + (Fjn.bj = function () { + return 0 != (40 & this.b); + }), + (Fjn.Ck = function () { + return 0 != (16 & this.b); + }), + (Fjn.Dk = function () { + return 0 != (8 & this.b); + }), + (Fjn.Ek = function () { + return 0 != (this.b & FDn); + }), + (Fjn.rk = function () { + return 0 != (32 & this.b); + }), + (Fjn.Fk = function () { + return 0 != (this.b & DNn); + }), + (Fjn.wj = function (n) { + return this.d ? _X(this.d, n) : this.ak().Yj().wj(n); + }), + (Fjn.fj = function () { + return 0 != (2 & this.b) ? 0 != (1 & this.b) : 0 != this.i; + }), + (Fjn.hi = function () { + return 0 != (128 & this.b); + }), + (Fjn.Xj = function () { + var n; + Hmn(this), + 0 != (2 & this.b) && + (gC(this.e) + ? ((n = 0 != (1 & this.b)), (this.b &= -2), Xp(this, new OV(this.e, 2, tnn(this.e.Tg(), this.ak()), n, !1))) + : (this.b &= -2)); + }), + (Fjn.ni = function () { + return 0 == (1536 & this.b); + }), + (Fjn.b = 0), + EF(xDn, "EcoreEList/Generic", 1164), + Wfn(1165, 1164, JDn, eq), + (Fjn.ak = function () { + return this.a; + }), + EF(xDn, "EcoreEList/Dynamic", 1165), + Wfn(747, 63, Mxn, Jg), + (Fjn.ri = function (n) { + return H1(this.a.a, n); + }), + EF(xDn, "EcoreEMap/1", 747), + Wfn(746, 85, JDn, g_), + (Fjn.bi = function (n, t) { + tin(this.b, Yx(t, 133)); + }), + (Fjn.di = function (n, t) { + A3(this.b); + }), + (Fjn.ei = function (n, t, e) { + var i; + ++((i = this.b), Yx(t, 133), i).e; + }), + (Fjn.fi = function (n, t) { + N9(this.b, Yx(t, 133)); + }), + (Fjn.gi = function (n, t, e) { + N9(this.b, Yx(e, 133)), + iI(e) === iI(t) && + Yx(e, 133).Th( + (function (n) { + return null == n ? 0 : W5(n); + })(Yx(t, 133).cd()), + ), + tin(this.b, Yx(t, 133)); + }), + EF(xDn, "EcoreEMap/DelegateEObjectContainmentEList", 746), + Wfn(1171, 151, RDn, j0), + EF(xDn, "EcoreEMap/Unsettable", 1171), + Wfn(1172, 746, JDn, LN), + (Fjn.ci = function () { + this.a = !0; + }), + (Fjn.fj = function () { + return this.a; + }), + (Fjn.Xj = function () { + var n; + Hmn(this), gC(this.e) ? ((n = this.a), (this.a = !1), K3(this.e, new OV(this.e, 2, this.c, n, !1))) : (this.a = !1); + }), + (Fjn.a = !1), + EF(xDn, "EcoreEMap/Unsettable/UnsettableDelegateEObjectContainmentEList", 1172), + Wfn(1168, 228, gMn, pF), + (Fjn.a = !1), + (Fjn.b = !1), + EF(xDn, "EcoreUtil/Copier", 1168), + Wfn(745, 1, fEn, hX), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Ob = function () { + return jnn(this); + }), + (Fjn.Pb = function () { + var n; + return jnn(this), (n = this.b), (this.b = null), n; + }), + (Fjn.Qb = function () { + this.a.Qb(); + }), + EF(xDn, "EcoreUtil/ProperContentIterator", 745), + Wfn(1382, 1381, {}, Kf), + EF(xDn, "EcoreValidator", 1382), + aR(xDn, "FeatureMapUtil/Validator"), + Wfn(1260, 1, { 1942: 1 }, xs), + (Fjn.rl = function (n) { + return !0; + }), + EF(xDn, "FeatureMapUtil/1", 1260), + Wfn(757, 1, { 1942: 1 }, ykn), + (Fjn.rl = function (n) { + var t; + return ( + this.c == n || + (null == (t = hL(BF(this.a, n))) + ? (function (n, t) { + var e; + return n.f == jut + ? ((e = TB(PJ((wsn(), wut), t))), + n.e ? 4 == e && t != (dfn(), Put) && t != (dfn(), Tut) && t != (dfn(), Mut) && t != (dfn(), Sut) : 2 == e) + : !(!n.d || !(n.d.Hc(t) || n.d.Hc(Bz(PJ((wsn(), wut), t))) || n.d.Hc(iyn((wsn(), wut), n.b, t)))) || + (!(!n.f || !Kbn((wsn(), n.f), tH(PJ(wut, t)))) && ((e = TB(PJ(wut, t))), n.e ? 4 == e : 2 == e)); + })(this, n) + ? (LV(this.a, n, (TA(), L_n)), !0) + : (LV(this.a, n, (TA(), $_n)), !1) + : t == (TA(), L_n)) + ); + }), + (Fjn.e = !1), + EF(xDn, "FeatureMapUtil/BasicValidator", 757), + Wfn(758, 43, gMn, yO), + EF(xDn, "FeatureMapUtil/BasicValidator/Cache", 758), + Wfn(501, 52, { 20: 1, 28: 1, 52: 1, 14: 1, 15: 1, 58: 1, 76: 1, 69: 1, 95: 1 }, VP), + (Fjn.Vc = function (n, t) { + $wn(this.c, this.b, n, t); + }), + (Fjn.Fc = function (n) { + return Rgn(this.c, this.b, n); + }), + (Fjn.Wc = function (n, t) { + return (function (n, t, e, i) { + var r, c, a, u, o, s, h, f; + if (0 == i.gc()) return !1; + if ((TT(), (a = (o = Yx(t, 66).Oj()) ? i : new FZ(i.gc())), Lwn(n.e, t))) { + if (t.hi()) + for (h = i.Kc(); h.Ob(); ) fvn(n, t, (s = h.Pb()), CO(t, 99) && 0 != (Yx(t, 18).Bb & eMn)) || ((c = VX(t, s)), a.Fc(c)); + else if (!o) for (h = i.Kc(); h.Ob(); ) (c = VX(t, (s = h.Pb()))), a.Fc(c); + } else { + for (f = dwn(n.e.Tg(), t), r = Yx(n.g, 119), u = 0; u < n.i; ++u) if (((c = r[u]), f.rl(c.ak()))) throw hp(new Qm(GRn)); + if (i.gc() > 1) throw hp(new Qm(GRn)); + o || ((c = VX(t, i.Kc().Pb())), a.Fc(c)); + } + return f5(n, fsn(n, t, e), a); + })(this.c, this.b, n, t); + }), + (Fjn.Gc = function (n) { + return TO(this, n); + }), + (Fjn.Xh = function (n, t) { + !(function (n, t, e, i) { + (n.j = -1), Afn(n, fsn(n, t, e), (TT(), Yx(t, 66).Mj().Ok(i))); + })(this.c, this.b, n, t); + }), + (Fjn.lk = function (n, t) { + return Ydn(this.c, this.b, n, t); + }), + (Fjn.pi = function (n) { + return amn(this.c, this.b, n, !1); + }), + (Fjn.Zh = function () { + return mC(this.c, this.b); + }), + (Fjn.$h = function () { + return (n = this.c), new Y3(this.b, n); + var n; + }), + (Fjn._h = function (n) { + return (function (n, t, e) { + var i, r; + for (r = new Y3(t, n), i = 0; i < e; ++i) Den(r); + return r; + })(this.c, this.b, n); + }), + (Fjn.mk = function (n, t) { + return RL(this, n, t); + }), + (Fjn.$b = function () { + Wp(this); + }), + (Fjn.Hc = function (n) { + return HX(this.c, this.b, n); + }), + (Fjn.Ic = function (n) { + return (function (n, t, e) { + var i; + for (i = e.Kc(); i.Ob(); ) if (!HX(n, t, i.Pb())) return !1; + return !0; + })(this.c, this.b, n); + }), + (Fjn.Xb = function (n) { + return amn(this.c, this.b, n, !0); + }), + (Fjn.Wj = function (n) { + return this; + }), + (Fjn.Xc = function (n) { + return (function (n, t, e) { + return $vn(n, t, e, CO(t, 99) && 0 != (Yx(t, 18).Bb & eMn)); + })(this.c, this.b, n); + }), + (Fjn.dc = function () { + return tI(this); + }), + (Fjn.fj = function () { + return !knn(this.c, this.b); + }), + (Fjn.Kc = function () { + return (n = this.c), CO((t = this.b), 99) && 0 != (Yx(t, 18).Bb & eMn) ? new qI(t, n) : new Y3(t, n); + var n, t; + }), + (Fjn.Yc = function () { + return (n = this.c), CO((t = this.b), 99) && 0 != (Yx(t, 18).Bb & eMn) ? new qI(t, n) : new Y3(t, n); + var n, t; + }), + (Fjn.Zc = function (n) { + return (function (n, t, e) { + var i, r; + for (r = CO(t, 99) && 0 != (Yx(t, 18).Bb & eMn) ? new qI(t, n) : new Y3(t, n), i = 0; i < e; ++i) Den(r); + return r; + })(this.c, this.b, n); + }), + (Fjn.ii = function (n, t) { + return Upn(this.c, this.b, n, t); + }), + (Fjn.ji = function (n, t) { + !(function (n, t, e, i) { + Upn(n, t, e, $vn(n, t, i, CO(t, 99) && 0 != (Yx(t, 18).Bb & eMn))); + })(this.c, this.b, n, t); + }), + (Fjn.$c = function (n) { + return Yon(this.c, this.b, n); + }), + (Fjn.Mc = function (n) { + return (function (n, t, e) { + var i, r, c, a; + if (((a = dwn(n.e.Tg(), t)), (i = Yx(n.g, 119)), TT(), Yx(t, 66).Oj())) { + for (c = 0; c < n.i; ++c) if (((r = i[c]), a.rl(r.ak()) && Q8(r, e))) return tdn(n, c), !0; + } else if (null != e) { + for (c = 0; c < n.i; ++c) if (((r = i[c]), a.rl(r.ak()) && Q8(e, r.dd()))) return tdn(n, c), !0; + } else for (c = 0; c < n.i; ++c) if (((r = i[c]), a.rl(r.ak()) && null == r.dd())) return tdn(n, c), !0; + return !1; + })(this.c, this.b, n); + }), + (Fjn._c = function (n, t) { + return lvn(this.c, this.b, n, t); + }), + (Fjn.Wb = function (n) { + kfn(this.c, this.b), TO(this, Yx(n, 15)); + }), + (Fjn.gc = function () { + return (function (n, t) { + var e, i, r, c, a; + for (a = dwn(n.e.Tg(), t), c = 0, e = Yx(n.g, 119), r = 0; r < n.i; ++r) (i = e[r]), a.rl(i.ak()) && ++c; + return c; + })(this.c, this.b); + }), + (Fjn.Pc = function () { + return Rz(this.c, this.b); + }), + (Fjn.Qc = function (n) { + return qX(this.c, this.b, n); + }), + (Fjn.Ib = function () { + var n, t; + for ((t = new Cy()).a += "[", n = mC(this.c, this.b); T6(n); ) pI(t, xA(Den(n))), T6(n) && (t.a += tEn); + return (t.a += "]"), t.a; + }), + (Fjn.Xj = function () { + kfn(this.c, this.b); + }), + EF(xDn, "FeatureMapUtil/FeatureEList", 501), + Wfn(627, 36, gDn, oW), + (Fjn.yi = function (n) { + return w9(this, n); + }), + (Fjn.Di = function (n) { + var t, e, i, r; + switch (this.d) { + case 1: + case 2: + if (iI(n.Ai()) === iI(this.c) && w9(this, null) == n.yi(null)) return (this.g = n.zi()), 1 == n.xi() && (this.d = 1), !0; + break; + case 3: + if (3 === n.xi() && iI(n.Ai()) === iI(this.c) && w9(this, null) == n.yi(null)) + return (this.d = 5), fY((t = new FZ(2)), this.g), fY(t, n.zi()), (this.g = t), !0; + break; + case 5: + if (3 === n.xi() && iI(n.Ai()) === iI(this.c) && w9(this, null) == n.yi(null)) return Yx(this.g, 14).Fc(n.zi()), !0; + break; + case 4: + switch (n.xi()) { + case 3: + if (iI(n.Ai()) === iI(this.c) && w9(this, null) == n.yi(null)) return (this.d = 1), (this.g = n.zi()), !0; + break; + case 4: + if (iI(n.Ai()) === iI(this.c) && w9(this, null) == n.yi(null)) + return ( + (this.d = 6), + fY((r = new FZ(2)), this.n), + fY(r, n.Bi()), + (this.n = r), + (i = x4(Gy(Wot, 1), MTn, 25, 15, [this.o, n.Ci()])), + (this.g = i), + !0 + ); + } + break; + case 6: + if (4 === n.xi() && iI(n.Ai()) === iI(this.c) && w9(this, null) == n.yi(null)) + return ( + Yx(this.n, 14).Fc(n.Bi()), + smn((i = Yx(this.g, 48)), 0, (e = VQ(Wot, MTn, 25, i.length + 1, 15, 1)), 0, i.length), + (e[i.length] = n.Ci()), + (this.g = e), + !0 + ); + } + return !1; + }), + EF(xDn, "FeatureMapUtil/FeatureENotificationImpl", 627), + Wfn( + 552, + 501, + { + 20: 1, + 28: 1, + 52: 1, + 14: 1, + 15: 1, + 58: 1, + 76: 1, + 153: 1, + 215: 1, + 1937: 1, + 69: 1, + 95: 1, + }, + cR, + ), + (Fjn.dl = function (n, t) { + return Rgn(this.c, n, t); + }), + (Fjn.el = function (n, t, e) { + return Ydn(this.c, n, t, e); + }), + (Fjn.fl = function (n, t, e) { + return rmn(this.c, n, t, e); + }), + (Fjn.gl = function () { + return this; + }), + (Fjn.hl = function (n, t) { + return umn(this.c, n, t); + }), + (Fjn.il = function (n) { + return Yx(amn(this.c, this.b, n, !1), 72).ak(); + }), + (Fjn.jl = function (n) { + return Yx(amn(this.c, this.b, n, !1), 72).dd(); + }), + (Fjn.kl = function () { + return this.a; + }), + (Fjn.ll = function (n) { + return !knn(this.c, n); + }), + (Fjn.ml = function (n, t) { + kmn(this.c, n, t); + }), + (Fjn.nl = function (n) { + return G0(this.c, n); + }), + (Fjn.ol = function (n) { + Qin(this.c, n); + }), + EF(xDn, "FeatureMapUtil/FeatureFeatureMap", 552), + Wfn(1259, 1, DDn, JP), + (Fjn.Wj = function (n) { + return amn(this.b, this.a, -1, n); + }), + (Fjn.fj = function () { + return !knn(this.b, this.a); + }), + (Fjn.Wb = function (n) { + kmn(this.b, this.a, n); + }), + (Fjn.Xj = function () { + kfn(this.b, this.a); + }), + EF(xDn, "FeatureMapUtil/FeatureValue", 1259); + var Tut, + Mut, + Sut, + Put, + Iut, + Cut = aR(zRn, "AnyType"); + Wfn(666, 60, eTn, fy), EF(zRn, "InvalidDatatypeValueException", 666); + var Out, + Aut, + $ut, + Lut, + Nut, + xut, + Dut, + Rut, + Kut, + _ut, + Fut, + But, + Hut, + qut, + Gut, + zut, + Uut, + Xut, + Wut, + Vut, + Qut, + Yut, + Jut, + Zut, + not, + tot, + eot, + iot, + rot, + cot, + aot = aR(zRn, URn), + uot = aR(zRn, XRn), + oot = aR(zRn, WRn); + Wfn(830, 506, { 105: 1, 92: 1, 90: 1, 56: 1, 49: 1, 97: 1, 843: 1 }, Qv), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return e ? (!this.c && (this.c = new e3(this, 0)), this.c) : (!this.c && (this.c = new e3(this, 0)), this.c.b); + case 1: + return e + ? (!this.c && (this.c = new e3(this, 0)), Yx(jz(this.c, (ayn(), Lut)), 153)) + : (!this.c && (this.c = new e3(this, 0)), Yx(Yx(jz(this.c, (ayn(), Lut)), 153), 215)).kl(); + case 2: + return e ? (!this.b && (this.b = new e3(this, 2)), this.b) : (!this.b && (this.b = new e3(this, 2)), this.b.b); + } + return RY(this, n - vF(this.zh()), CZ(0 == (2 & this.j) ? this.zh() : (!this.k && (this.k = new Df()), this.k).ck(), n), t, e); + }), + (Fjn.jh = function (n, t, e) { + switch (t) { + case 0: + return !this.c && (this.c = new e3(this, 0)), Lgn(this.c, n, e); + case 1: + return (!this.c && (this.c = new e3(this, 0)), Yx(Yx(jz(this.c, (ayn(), Lut)), 153), 69)).mk(n, e); + case 2: + return !this.b && (this.b = new e3(this, 2)), Lgn(this.b, n, e); + } + return Yx(CZ(0 == (2 & this.j) ? this.zh() : (!this.k && (this.k = new Df()), this.k).ck(), t), 66) + .Nj() + .Rj(this, DJ(this), t - vF(this.zh()), n, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return !!this.c && 0 != this.c.i; + case 1: + return !(!this.c && (this.c = new e3(this, 0)), Yx(jz(this.c, (ayn(), Lut)), 153)).dc(); + case 2: + return !!this.b && 0 != this.b.i; + } + return xX(this, n - vF(this.zh()), CZ(0 == (2 & this.j) ? this.zh() : (!this.k && (this.k = new Df()), this.k).ck(), n)); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 0: + return !this.c && (this.c = new e3(this, 0)), void sF(this.c, t); + case 1: + return void (!this.c && (this.c = new e3(this, 0)), Yx(Yx(jz(this.c, (ayn(), Lut)), 153), 215)).Wb(t); + case 2: + return !this.b && (this.b = new e3(this, 2)), void sF(this.b, t); + } + E7(this, n - vF(this.zh()), CZ(0 == (2 & this.j) ? this.zh() : (!this.k && (this.k = new Df()), this.k).ck(), n), t); + }), + (Fjn.zh = function () { + return ayn(), $ut; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 0: + return !this.c && (this.c = new e3(this, 0)), void Hmn(this.c); + case 1: + return void (!this.c && (this.c = new e3(this, 0)), Yx(jz(this.c, (ayn(), Lut)), 153)).$b(); + case 2: + return !this.b && (this.b = new e3(this, 2)), void Hmn(this.b); + } + r9(this, n - vF(this.zh()), CZ(0 == (2 & this.j) ? this.zh() : (!this.k && (this.k = new Df()), this.k).ck(), n)); + }), + (Fjn.Ib = function () { + var n; + return 0 != (4 & this.j) + ? Kln(this) + : (((n = new MA(Kln(this))).a += " (mixed: "), gI(n, this.c), (n.a += ", anyAttribute: "), gI(n, this.b), (n.a += ")"), n.a); + }), + EF(VRn, "AnyTypeImpl", 830), + Wfn(667, 506, { 105: 1, 92: 1, 90: 1, 56: 1, 49: 1, 97: 1, 2021: 1, 667: 1 }, Rs), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return this.a; + case 1: + return this.b; + } + return RY(this, n - vF((ayn(), zut)), CZ(0 == (2 & this.j) ? zut : (!this.k && (this.k = new Df()), this.k).ck(), n), t, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return null != this.a; + case 1: + return null != this.b; + } + return xX(this, n - vF((ayn(), zut)), CZ(0 == (2 & this.j) ? zut : (!this.k && (this.k = new Df()), this.k).ck(), n)); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 0: + return void (function (n, t) { + n.a = t; + })(this, lL(t)); + case 1: + return void (function (n, t) { + n.b = t; + })(this, lL(t)); + } + E7(this, n - vF((ayn(), zut)), CZ(0 == (2 & this.j) ? zut : (!this.k && (this.k = new Df()), this.k).ck(), n), t); + }), + (Fjn.zh = function () { + return ayn(), zut; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 0: + return void (this.a = null); + case 1: + return void (this.b = null); + } + r9(this, n - vF((ayn(), zut)), CZ(0 == (2 & this.j) ? zut : (!this.k && (this.k = new Df()), this.k).ck(), n)); + }), + (Fjn.Ib = function () { + var n; + return 0 != (4 & this.j) + ? Kln(this) + : (((n = new MA(Kln(this))).a += " (data: "), pI(n, this.a), (n.a += ", target: "), pI(n, this.b), (n.a += ")"), n.a); + }), + (Fjn.a = null), + (Fjn.b = null), + EF(VRn, "ProcessingInstructionImpl", 667), + Wfn(668, 830, { 105: 1, 92: 1, 90: 1, 56: 1, 49: 1, 97: 1, 843: 1, 2022: 1, 668: 1 }, Jv), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return e ? (!this.c && (this.c = new e3(this, 0)), this.c) : (!this.c && (this.c = new e3(this, 0)), this.c.b); + case 1: + return e + ? (!this.c && (this.c = new e3(this, 0)), Yx(jz(this.c, (ayn(), Lut)), 153)) + : (!this.c && (this.c = new e3(this, 0)), Yx(Yx(jz(this.c, (ayn(), Lut)), 153), 215)).kl(); + case 2: + return e ? (!this.b && (this.b = new e3(this, 2)), this.b) : (!this.b && (this.b = new e3(this, 2)), this.b.b); + case 3: + return !this.c && (this.c = new e3(this, 0)), lL(umn(this.c, (ayn(), Wut), !0)); + case 4: + return DN(this.a, (!this.c && (this.c = new e3(this, 0)), lL(umn(this.c, (ayn(), Wut), !0)))); + case 5: + return this.a; + } + return RY(this, n - vF((ayn(), Xut)), CZ(0 == (2 & this.j) ? Xut : (!this.k && (this.k = new Df()), this.k).ck(), n), t, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return !!this.c && 0 != this.c.i; + case 1: + return !(!this.c && (this.c = new e3(this, 0)), Yx(jz(this.c, (ayn(), Lut)), 153)).dc(); + case 2: + return !!this.b && 0 != this.b.i; + case 3: + return !this.c && (this.c = new e3(this, 0)), null != lL(umn(this.c, (ayn(), Wut), !0)); + case 4: + return null != DN(this.a, (!this.c && (this.c = new e3(this, 0)), lL(umn(this.c, (ayn(), Wut), !0)))); + case 5: + return !!this.a; + } + return xX(this, n - vF((ayn(), Xut)), CZ(0 == (2 & this.j) ? Xut : (!this.k && (this.k = new Df()), this.k).ck(), n)); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 0: + return !this.c && (this.c = new e3(this, 0)), void sF(this.c, t); + case 1: + return void (!this.c && (this.c = new e3(this, 0)), Yx(Yx(jz(this.c, (ayn(), Lut)), 153), 215)).Wb(t); + case 2: + return !this.b && (this.b = new e3(this, 2)), void sF(this.b, t); + case 3: + return void yU(this, lL(t)); + case 4: + return void yU(this, RN(this.a, t)); + case 5: + return void (function (n, t) { + n.a = t; + })(this, Yx(t, 148)); + } + E7(this, n - vF((ayn(), Xut)), CZ(0 == (2 & this.j) ? Xut : (!this.k && (this.k = new Df()), this.k).ck(), n), t); + }), + (Fjn.zh = function () { + return ayn(), Xut; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 0: + return !this.c && (this.c = new e3(this, 0)), void Hmn(this.c); + case 1: + return void (!this.c && (this.c = new e3(this, 0)), Yx(jz(this.c, (ayn(), Lut)), 153)).$b(); + case 2: + return !this.b && (this.b = new e3(this, 2)), void Hmn(this.b); + case 3: + return !this.c && (this.c = new e3(this, 0)), void kmn(this.c, (ayn(), Wut), null); + case 4: + return void yU(this, RN(this.a, null)); + case 5: + return void (this.a = null); + } + r9(this, n - vF((ayn(), Xut)), CZ(0 == (2 & this.j) ? Xut : (!this.k && (this.k = new Df()), this.k).ck(), n)); + }), + EF(VRn, "SimpleAnyTypeImpl", 668), + Wfn(669, 506, { 105: 1, 92: 1, 90: 1, 56: 1, 49: 1, 97: 1, 2023: 1, 669: 1 }, Yv), + (Fjn._g = function (n, t, e) { + switch (n) { + case 0: + return e ? (!this.a && (this.a = new e3(this, 0)), this.a) : (!this.a && (this.a = new e3(this, 0)), this.a.b); + case 1: + return e + ? (!this.b && (this.b = new yY((xjn(), Dat), out, this, 1)), this.b) + : (!this.b && (this.b = new yY((xjn(), Dat), out, this, 1)), UQ(this.b)); + case 2: + return e + ? (!this.c && (this.c = new yY((xjn(), Dat), out, this, 2)), this.c) + : (!this.c && (this.c = new yY((xjn(), Dat), out, this, 2)), UQ(this.c)); + case 3: + return !this.a && (this.a = new e3(this, 0)), jz(this.a, (ayn(), Yut)); + case 4: + return !this.a && (this.a = new e3(this, 0)), jz(this.a, (ayn(), Jut)); + case 5: + return !this.a && (this.a = new e3(this, 0)), jz(this.a, (ayn(), not)); + case 6: + return !this.a && (this.a = new e3(this, 0)), jz(this.a, (ayn(), tot)); + } + return RY(this, n - vF((ayn(), Qut)), CZ(0 == (2 & this.j) ? Qut : (!this.k && (this.k = new Df()), this.k).ck(), n), t, e); + }), + (Fjn.jh = function (n, t, e) { + switch (t) { + case 0: + return !this.a && (this.a = new e3(this, 0)), Lgn(this.a, n, e); + case 1: + return !this.b && (this.b = new yY((xjn(), Dat), out, this, 1)), YN(this.b, n, e); + case 2: + return !this.c && (this.c = new yY((xjn(), Dat), out, this, 2)), YN(this.c, n, e); + case 5: + return !this.a && (this.a = new e3(this, 0)), RL(jz(this.a, (ayn(), not)), n, e); + } + return Yx(CZ(0 == (2 & this.j) ? (ayn(), Qut) : (!this.k && (this.k = new Df()), this.k).ck(), t), 66) + .Nj() + .Rj(this, DJ(this), t - vF((ayn(), Qut)), n, e); + }), + (Fjn.lh = function (n) { + switch (n) { + case 0: + return !!this.a && 0 != this.a.i; + case 1: + return !!this.b && 0 != this.b.f; + case 2: + return !!this.c && 0 != this.c.f; + case 3: + return !this.a && (this.a = new e3(this, 0)), !tI(jz(this.a, (ayn(), Yut))); + case 4: + return !this.a && (this.a = new e3(this, 0)), !tI(jz(this.a, (ayn(), Jut))); + case 5: + return !this.a && (this.a = new e3(this, 0)), !tI(jz(this.a, (ayn(), not))); + case 6: + return !this.a && (this.a = new e3(this, 0)), !tI(jz(this.a, (ayn(), tot))); + } + return xX(this, n - vF((ayn(), Qut)), CZ(0 == (2 & this.j) ? Qut : (!this.k && (this.k = new Df()), this.k).ck(), n)); + }), + (Fjn.sh = function (n, t) { + switch (n) { + case 0: + return !this.a && (this.a = new e3(this, 0)), void sF(this.a, t); + case 1: + return !this.b && (this.b = new yY((xjn(), Dat), out, this, 1)), void P3(this.b, t); + case 2: + return !this.c && (this.c = new yY((xjn(), Dat), out, this, 2)), void P3(this.c, t); + case 3: + return ( + !this.a && (this.a = new e3(this, 0)), + Wp(jz(this.a, (ayn(), Yut))), + !this.a && (this.a = new e3(this, 0)), + void TO(jz(this.a, Yut), Yx(t, 14)) + ); + case 4: + return ( + !this.a && (this.a = new e3(this, 0)), + Wp(jz(this.a, (ayn(), Jut))), + !this.a && (this.a = new e3(this, 0)), + void TO(jz(this.a, Jut), Yx(t, 14)) + ); + case 5: + return ( + !this.a && (this.a = new e3(this, 0)), + Wp(jz(this.a, (ayn(), not))), + !this.a && (this.a = new e3(this, 0)), + void TO(jz(this.a, not), Yx(t, 14)) + ); + case 6: + return ( + !this.a && (this.a = new e3(this, 0)), + Wp(jz(this.a, (ayn(), tot))), + !this.a && (this.a = new e3(this, 0)), + void TO(jz(this.a, tot), Yx(t, 14)) + ); + } + E7(this, n - vF((ayn(), Qut)), CZ(0 == (2 & this.j) ? Qut : (!this.k && (this.k = new Df()), this.k).ck(), n), t); + }), + (Fjn.zh = function () { + return ayn(), Qut; + }), + (Fjn.Bh = function (n) { + switch (n) { + case 0: + return !this.a && (this.a = new e3(this, 0)), void Hmn(this.a); + case 1: + return !this.b && (this.b = new yY((xjn(), Dat), out, this, 1)), void this.b.c.$b(); + case 2: + return !this.c && (this.c = new yY((xjn(), Dat), out, this, 2)), void this.c.c.$b(); + case 3: + return !this.a && (this.a = new e3(this, 0)), void Wp(jz(this.a, (ayn(), Yut))); + case 4: + return !this.a && (this.a = new e3(this, 0)), void Wp(jz(this.a, (ayn(), Jut))); + case 5: + return !this.a && (this.a = new e3(this, 0)), void Wp(jz(this.a, (ayn(), not))); + case 6: + return !this.a && (this.a = new e3(this, 0)), void Wp(jz(this.a, (ayn(), tot))); + } + r9(this, n - vF((ayn(), Qut)), CZ(0 == (2 & this.j) ? Qut : (!this.k && (this.k = new Df()), this.k).ck(), n)); + }), + (Fjn.Ib = function () { + var n; + return 0 != (4 & this.j) ? Kln(this) : (((n = new MA(Kln(this))).a += " (mixed: "), gI(n, this.a), (n.a += ")"), n.a); + }), + EF(VRn, "XMLTypeDocumentRootImpl", 669), + Wfn( + 1919, + 704, + { + 105: 1, + 92: 1, + 90: 1, + 471: 1, + 147: 1, + 56: 1, + 108: 1, + 49: 1, + 97: 1, + 150: 1, + 114: 1, + 115: 1, + 2024: 1, + }, + Ds, + ), + (Fjn.Ih = function (n, t) { + switch (n.yj()) { + case 7: + case 8: + case 9: + case 10: + case 16: + case 22: + case 23: + case 24: + case 25: + case 26: + case 32: + case 33: + case 34: + case 36: + case 37: + case 44: + case 45: + case 50: + case 51: + case 53: + case 55: + case 56: + case 57: + case 58: + case 60: + case 61: + case 4: + return null == t ? null : I7(t); + case 19: + case 28: + case 29: + case 35: + case 38: + case 39: + case 41: + case 46: + case 52: + case 54: + case 5: + return lL(t); + case 6: + return uL(Yx(t, 190)); + case 12: + case 47: + case 49: + case 11: + return Dyn(this, n, t); + case 13: + return null == t + ? null + : (function (n) { + var t, i, r, c; + if (((r = pjn((!n.c && (n.c = J6(n.f)), n.c), 0)), 0 == n.e || (0 == n.a && -1 != n.f && n.e < 0))) return r; + if ( + ((t = u0(n) < 0 ? 1 : 0), (i = n.e), r.length, e.Math.abs(oG(n.e)), (c = new $y()), 1 == t && (c.a += "-"), n.e > 0) + ) + if ((i -= r.length - t) >= 0) { + for (c.a += "0."; i > rFn.length; i -= rFn.length) ER(c, rFn); + QL(c, rFn, oG(i)), yI(c, r.substr(t)); + } else yI(c, l$(r, t, oG((i = t - i)))), (c.a += "."), yI(c, lI(r, oG(i))); + else { + for (yI(c, r.substr(t)); i < -rFn.length; i += rFn.length) ER(c, rFn); + QL(c, rFn, oG(-i)); + } + return c.a; + })(Yx(t, 240)); + case 15: + case 14: + return null == t + ? null + : (function (n) { + return n == JTn ? QRn : n == ZTn ? "-INF" : "" + n; + })(ty(fL(t))); + case 17: + return yan((ayn(), t)); + case 18: + return yan(t); + case 21: + case 20: + return null == t + ? null + : (function (n) { + return n == JTn ? QRn : n == ZTn ? "-INF" : "" + n; + })(Yx(t, 155).a); + case 27: + return oL(Yx(t, 190)); + case 30: + return Yin((ayn(), Yx(t, 15))); + case 31: + return Yin(Yx(t, 15)); + case 40: + case 59: + case 48: + return (function (n) { + return null == n ? null : I7(n); + })((ayn(), t)); + case 42: + return kan((ayn(), t)); + case 43: + return kan(t); + default: + throw hp(new Qm(ONn + n.ne() + ANn)); + } + }), + (Fjn.Jh = function (n) { + var t; + switch ((-1 == n.G && (n.G = (t = i1(n)) ? Ren(t.Mh(), n) : -1), n.G)) { + case 0: + return new Qv(); + case 1: + return new Rs(); + case 2: + return new Jv(); + case 3: + return new Yv(); + default: + throw hp(new Qm(NNn + n.zb + ANn)); + } + }), + (Fjn.Kh = function (n, t) { + var e, i, r, c, a, u, o, s, h, f, l, b, w, d, g, p; + switch (n.yj()) { + case 5: + case 52: + case 4: + return t; + case 6: + return sen(t); + case 8: + case 7: + return null == t + ? null + : (function (n) { + if (((n = Vvn(n, !0)), _N(kLn, n) || _N("1", n))) return TA(), L_n; + if (_N(jLn, n) || _N("0", n)) return TA(), $_n; + throw hp(new fy("Invalid boolean value: '" + n + "'")); + })(t); + case 9: + return null == t + ? null + : iZ( + (ipn((i = Vvn(t, !0)).length > 0 && (Lz(0, i.length), 43 == i.charCodeAt(0)) ? i.substr(1) : i, -128, 127) << 24) >> + 24, + ); + case 10: + return null == t + ? null + : iZ( + (ipn((r = Vvn(t, !0)).length > 0 && (Lz(0, r.length), 43 == r.charCodeAt(0)) ? r.substr(1) : r, -128, 127) << 24) >> + 24, + ); + case 11: + return lL(fjn(this, (ayn(), Dut), t)); + case 12: + return lL(fjn(this, (ayn(), Rut), t)); + case 13: + return null == t ? null : new Wk(Vvn(t, !0)); + case 15: + case 14: + return (function (n) { + var t, e, i, r; + if (null == n) return null; + if (((i = Vvn(n, !0)), (r = QRn.length), _N(i.substr(i.length - r, r), QRn))) + if (4 == (e = i.length)) { + if ((Lz(0, i.length), 43 == (t = i.charCodeAt(0)))) return iot; + if (45 == t) return eot; + } else if (3 == e) return iot; + return gon(i); + })(t); + case 16: + return lL(fjn(this, (ayn(), Kut), t)); + case 17: + return Qnn((ayn(), t)); + case 18: + return Qnn(t); + case 28: + case 29: + case 35: + case 38: + case 39: + case 41: + case 54: + case 19: + return Vvn(t, !0); + case 21: + case 20: + return (function (n) { + var t, e, i, r; + if (null == n) return null; + if (((i = Vvn(n, !0)), (r = QRn.length), _N(i.substr(i.length - r, r), QRn))) + if (4 == (e = i.length)) { + if ((Lz(0, i.length), 43 == (t = i.charCodeAt(0)))) return cot; + if (45 == t) return rot; + } else if (3 == e) return cot; + return new Vp(i); + })(t); + case 22: + return lL(fjn(this, (ayn(), _ut), t)); + case 23: + return lL(fjn(this, (ayn(), Fut), t)); + case 24: + return lL(fjn(this, (ayn(), But), t)); + case 25: + return lL(fjn(this, (ayn(), Hut), t)); + case 26: + return lL(fjn(this, (ayn(), qut), t)); + case 27: + return ztn(t); + case 30: + return Ynn((ayn(), t)); + case 31: + return Ynn(t); + case 32: + return null == t + ? null + : d9(ipn((h = Vvn(t, !0)).length > 0 && (Lz(0, h.length), 43 == h.charCodeAt(0)) ? h.substr(1) : h, nTn, Yjn)); + case 33: + return null == t ? null : new IC((f = Vvn(t, !0)).length > 0 && (Lz(0, f.length), 43 == f.charCodeAt(0)) ? f.substr(1) : f); + case 34: + return null == t + ? null + : d9(ipn((l = Vvn(t, !0)).length > 0 && (Lz(0, l.length), 43 == l.charCodeAt(0)) ? l.substr(1) : l, nTn, Yjn)); + case 36: + return null == t + ? null + : ytn(mkn((b = Vvn(t, !0)).length > 0 && (Lz(0, b.length), 43 == b.charCodeAt(0)) ? b.substr(1) : b)); + case 37: + return null == t + ? null + : ytn(mkn((w = Vvn(t, !0)).length > 0 && (Lz(0, w.length), 43 == w.charCodeAt(0)) ? w.substr(1) : w)); + case 40: + case 59: + case 48: + return (function (n) { + var t; + return null == n + ? null + : new IC((t = Vvn(n, !0)).length > 0 && (Lz(0, t.length), 43 == t.charCodeAt(0)) ? t.substr(1) : t); + })((ayn(), t)); + case 42: + return Jnn((ayn(), t)); + case 43: + return Jnn(t); + case 44: + return null == t ? null : new IC((d = Vvn(t, !0)).length > 0 && (Lz(0, d.length), 43 == d.charCodeAt(0)) ? d.substr(1) : d); + case 45: + return null == t ? null : new IC((g = Vvn(t, !0)).length > 0 && (Lz(0, g.length), 43 == g.charCodeAt(0)) ? g.substr(1) : g); + case 46: + return Vvn(t, !1); + case 47: + return lL(fjn(this, (ayn(), Gut), t)); + case 49: + return lL(fjn(this, (ayn(), Uut), t)); + case 50: + return null == t + ? null + : g9( + (ipn((p = Vvn(t, !0)).length > 0 && (Lz(0, p.length), 43 == p.charCodeAt(0)) ? p.substr(1) : p, fRn, 32767) << 16) >> + 16, + ); + case 51: + return null == t + ? null + : g9( + (ipn((c = Vvn(t, !0)).length > 0 && (Lz(0, c.length), 43 == c.charCodeAt(0)) ? c.substr(1) : c, fRn, 32767) << 16) >> + 16, + ); + case 53: + return lL(fjn(this, (ayn(), Vut), t)); + case 55: + return null == t + ? null + : g9( + (ipn((a = Vvn(t, !0)).length > 0 && (Lz(0, a.length), 43 == a.charCodeAt(0)) ? a.substr(1) : a, fRn, 32767) << 16) >> + 16, + ); + case 56: + return null == t + ? null + : g9( + (ipn((u = Vvn(t, !0)).length > 0 && (Lz(0, u.length), 43 == u.charCodeAt(0)) ? u.substr(1) : u, fRn, 32767) << 16) >> + 16, + ); + case 57: + return null == t + ? null + : ytn(mkn((o = Vvn(t, !0)).length > 0 && (Lz(0, o.length), 43 == o.charCodeAt(0)) ? o.substr(1) : o)); + case 58: + return null == t + ? null + : ytn(mkn((s = Vvn(t, !0)).length > 0 && (Lz(0, s.length), 43 == s.charCodeAt(0)) ? s.substr(1) : s)); + case 60: + return null == t + ? null + : d9(ipn((e = Vvn(t, !0)).length > 0 && (Lz(0, e.length), 43 == e.charCodeAt(0)) ? e.substr(1) : e, nTn, Yjn)); + case 61: + return null == t ? null : d9(ipn(Vvn(t, !0), nTn, Yjn)); + default: + throw hp(new Qm(ONn + n.ne() + ANn)); + } + }), + EF(VRn, "XMLTypeFactoryImpl", 1919), + Wfn( + 586, + 179, + { + 105: 1, + 92: 1, + 90: 1, + 147: 1, + 191: 1, + 56: 1, + 235: 1, + 108: 1, + 49: 1, + 97: 1, + 150: 1, + 179: 1, + 114: 1, + 115: 1, + 675: 1, + 1945: 1, + 586: 1, + }, + AB, + ), + (Fjn.N = !1), + (Fjn.O = !1); + var sot, + hot, + fot, + lot, + bot, + wot = !1; + EF(VRn, "XMLTypePackageImpl", 586), + Wfn(1852, 1, { 837: 1 }, Ks), + (Fjn._j = function () { + return Fpn(), _ot; + }), + EF(VRn, "XMLTypePackageImpl/1", 1852), + Wfn(1861, 1, TRn, _s), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/10", 1861), + Wfn(1862, 1, TRn, Fs), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/11", 1862), + Wfn(1863, 1, TRn, Bs), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/12", 1863), + Wfn(1864, 1, TRn, Hs), + (Fjn.wj = function (n) { + return cI(n); + }), + (Fjn.xj = function (n) { + return VQ(H_n, TEn, 333, n, 7, 1); + }), + EF(VRn, "XMLTypePackageImpl/13", 1864), + Wfn(1865, 1, TRn, qs), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/14", 1865), + Wfn(1866, 1, TRn, Gs), + (Fjn.wj = function (n) { + return CO(n, 15); + }), + (Fjn.xj = function (n) { + return VQ(JKn, dPn, 15, n, 0, 1); + }), + EF(VRn, "XMLTypePackageImpl/15", 1866), + Wfn(1867, 1, TRn, zs), + (Fjn.wj = function (n) { + return CO(n, 15); + }), + (Fjn.xj = function (n) { + return VQ(JKn, dPn, 15, n, 0, 1); + }), + EF(VRn, "XMLTypePackageImpl/16", 1867), + Wfn(1868, 1, TRn, Us), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/17", 1868), + Wfn(1869, 1, TRn, Xs), + (Fjn.wj = function (n) { + return CO(n, 155); + }), + (Fjn.xj = function (n) { + return VQ(q_n, TEn, 155, n, 0, 1); + }), + EF(VRn, "XMLTypePackageImpl/18", 1869), + Wfn(1870, 1, TRn, Ws), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/19", 1870), + Wfn(1853, 1, TRn, Vs), + (Fjn.wj = function (n) { + return CO(n, 843); + }), + (Fjn.xj = function (n) { + return VQ(Cut, iEn, 843, n, 0, 1); + }), + EF(VRn, "XMLTypePackageImpl/2", 1853), + Wfn(1871, 1, TRn, Qs), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/20", 1871), + Wfn(1872, 1, TRn, Ys), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/21", 1872), + Wfn(1873, 1, TRn, Js), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/22", 1873), + Wfn(1874, 1, TRn, Zs), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/23", 1874), + Wfn(1875, 1, TRn, nh), + (Fjn.wj = function (n) { + return CO(n, 190); + }), + (Fjn.xj = function (n) { + return VQ(Yot, TEn, 190, n, 0, 2); + }), + EF(VRn, "XMLTypePackageImpl/24", 1875), + Wfn(1876, 1, TRn, th), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/25", 1876), + Wfn(1877, 1, TRn, eh), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/26", 1877), + Wfn(1878, 1, TRn, ih), + (Fjn.wj = function (n) { + return CO(n, 15); + }), + (Fjn.xj = function (n) { + return VQ(JKn, dPn, 15, n, 0, 1); + }), + EF(VRn, "XMLTypePackageImpl/27", 1878), + Wfn(1879, 1, TRn, rh), + (Fjn.wj = function (n) { + return CO(n, 15); + }), + (Fjn.xj = function (n) { + return VQ(JKn, dPn, 15, n, 0, 1); + }), + EF(VRn, "XMLTypePackageImpl/28", 1879), + Wfn(1880, 1, TRn, ch), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/29", 1880), + Wfn(1854, 1, TRn, ah), + (Fjn.wj = function (n) { + return CO(n, 667); + }), + (Fjn.xj = function (n) { + return VQ(aot, iEn, 2021, n, 0, 1); + }), + EF(VRn, "XMLTypePackageImpl/3", 1854), + Wfn(1881, 1, TRn, uh), + (Fjn.wj = function (n) { + return CO(n, 19); + }), + (Fjn.xj = function (n) { + return VQ(U_n, TEn, 19, n, 0, 1); + }), + EF(VRn, "XMLTypePackageImpl/30", 1881), + Wfn(1882, 1, TRn, oh), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/31", 1882), + Wfn(1883, 1, TRn, sh), + (Fjn.wj = function (n) { + return CO(n, 162); + }), + (Fjn.xj = function (n) { + return VQ(J_n, TEn, 162, n, 0, 1); + }), + EF(VRn, "XMLTypePackageImpl/32", 1883), + Wfn(1884, 1, TRn, hh), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/33", 1884), + Wfn(1885, 1, TRn, fh), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/34", 1885), + Wfn(1886, 1, TRn, lh), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/35", 1886), + Wfn(1887, 1, TRn, bh), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/36", 1887), + Wfn(1888, 1, TRn, wh), + (Fjn.wj = function (n) { + return CO(n, 15); + }), + (Fjn.xj = function (n) { + return VQ(JKn, dPn, 15, n, 0, 1); + }), + EF(VRn, "XMLTypePackageImpl/37", 1888), + Wfn(1889, 1, TRn, dh), + (Fjn.wj = function (n) { + return CO(n, 15); + }), + (Fjn.xj = function (n) { + return VQ(JKn, dPn, 15, n, 0, 1); + }), + EF(VRn, "XMLTypePackageImpl/38", 1889), + Wfn(1890, 1, TRn, gh), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/39", 1890), + Wfn(1855, 1, TRn, ph), + (Fjn.wj = function (n) { + return CO(n, 668); + }), + (Fjn.xj = function (n) { + return VQ(uot, iEn, 2022, n, 0, 1); + }), + EF(VRn, "XMLTypePackageImpl/4", 1855), + Wfn(1891, 1, TRn, vh), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/40", 1891), + Wfn(1892, 1, TRn, mh), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/41", 1892), + Wfn(1893, 1, TRn, yh), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/42", 1893), + Wfn(1894, 1, TRn, kh), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/43", 1894), + Wfn(1895, 1, TRn, jh), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/44", 1895), + Wfn(1896, 1, TRn, Eh), + (Fjn.wj = function (n) { + return CO(n, 184); + }), + (Fjn.xj = function (n) { + return VQ(nFn, TEn, 184, n, 0, 1); + }), + EF(VRn, "XMLTypePackageImpl/45", 1896), + Wfn(1897, 1, TRn, Th), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/46", 1897), + Wfn(1898, 1, TRn, Mh), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/47", 1898), + Wfn(1899, 1, TRn, Sh), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/48", 1899), + Wfn(TTn, 1, TRn, Ph), + (Fjn.wj = function (n) { + return CO(n, 184); + }), + (Fjn.xj = function (n) { + return VQ(nFn, TEn, 184, n, 0, 1); + }), + EF(VRn, "XMLTypePackageImpl/49", TTn), + Wfn(1856, 1, TRn, Ih), + (Fjn.wj = function (n) { + return CO(n, 669); + }), + (Fjn.xj = function (n) { + return VQ(oot, iEn, 2023, n, 0, 1); + }), + EF(VRn, "XMLTypePackageImpl/5", 1856), + Wfn(1901, 1, TRn, Ch), + (Fjn.wj = function (n) { + return CO(n, 162); + }), + (Fjn.xj = function (n) { + return VQ(J_n, TEn, 162, n, 0, 1); + }), + EF(VRn, "XMLTypePackageImpl/50", 1901), + Wfn(1902, 1, TRn, Oh), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/51", 1902), + Wfn(1903, 1, TRn, Ah), + (Fjn.wj = function (n) { + return CO(n, 19); + }), + (Fjn.xj = function (n) { + return VQ(U_n, TEn, 19, n, 0, 1); + }), + EF(VRn, "XMLTypePackageImpl/52", 1903), + Wfn(1857, 1, TRn, $h), + (Fjn.wj = function (n) { + return aI(n); + }), + (Fjn.xj = function (n) { + return VQ(fFn, TEn, 2, n, 6, 1); + }), + EF(VRn, "XMLTypePackageImpl/6", 1857), + Wfn(1858, 1, TRn, Lh), + (Fjn.wj = function (n) { + return CO(n, 190); + }), + (Fjn.xj = function (n) { + return VQ(Yot, TEn, 190, n, 0, 2); + }), + EF(VRn, "XMLTypePackageImpl/7", 1858), + Wfn(1859, 1, TRn, Nh), + (Fjn.wj = function (n) { + return rI(n); + }), + (Fjn.xj = function (n) { + return VQ(D_n, TEn, 476, n, 8, 1); + }), + EF(VRn, "XMLTypePackageImpl/8", 1859), + Wfn(1860, 1, TRn, xh), + (Fjn.wj = function (n) { + return CO(n, 217); + }), + (Fjn.xj = function (n) { + return VQ(__n, TEn, 217, n, 0, 1); + }), + EF(VRn, "XMLTypePackageImpl/9", 1860), + Wfn(50, 60, eTn, wy), + EF(kKn, "RegEx/ParseException", 50), + Wfn(820, 1, {}, Dh), + (Fjn.sl = function (n) { + return n < this.j && 63 == XB(this.i, n); + }), + (Fjn.tl = function () { + var n, t, e, i, r; + if (10 != this.c) throw hp(new wy(Kjn((GC(), Axn)))); + switch ((n = this.a)) { + case 101: + n = 27; + break; + case 102: + n = 12; + break; + case 110: + n = 10; + break; + case 114: + n = 13; + break; + case 116: + n = 9; + break; + case 120: + if ((kjn(this), 0 != this.c)) throw hp(new wy(Kjn((GC(), eDn)))); + if (123 == this.a) { + for (r = 0, e = 0; ; ) { + if ((kjn(this), 0 != this.c)) throw hp(new wy(Kjn((GC(), eDn)))); + if ((r = din(this.a)) < 0) break; + if (e > 16 * e) throw hp(new wy(Kjn((GC(), iDn)))); + e = 16 * e + r; + } + if (125 != this.a) throw hp(new wy(Kjn((GC(), rDn)))); + if (e > jKn) throw hp(new wy(Kjn((GC(), cDn)))); + n = e; + } else { + if (((r = 0), 0 != this.c || (r = din(this.a)) < 0)) throw hp(new wy(Kjn((GC(), eDn)))); + if (((e = r), kjn(this), 0 != this.c || (r = din(this.a)) < 0)) throw hp(new wy(Kjn((GC(), eDn)))); + n = e = 16 * e + r; + } + break; + case 117: + if (((i = 0), kjn(this), 0 != this.c || (i = din(this.a)) < 0)) throw hp(new wy(Kjn((GC(), eDn)))); + if (((t = i), kjn(this), 0 != this.c || (i = din(this.a)) < 0)) throw hp(new wy(Kjn((GC(), eDn)))); + if (((t = 16 * t + i), kjn(this), 0 != this.c || (i = din(this.a)) < 0)) throw hp(new wy(Kjn((GC(), eDn)))); + if (((t = 16 * t + i), kjn(this), 0 != this.c || (i = din(this.a)) < 0)) throw hp(new wy(Kjn((GC(), eDn)))); + n = t = 16 * t + i; + break; + case 118: + if ((kjn(this), 0 != this.c || (i = din(this.a)) < 0)) throw hp(new wy(Kjn((GC(), eDn)))); + if (((t = i), kjn(this), 0 != this.c || (i = din(this.a)) < 0)) throw hp(new wy(Kjn((GC(), eDn)))); + if (((t = 16 * t + i), kjn(this), 0 != this.c || (i = din(this.a)) < 0)) throw hp(new wy(Kjn((GC(), eDn)))); + if (((t = 16 * t + i), kjn(this), 0 != this.c || (i = din(this.a)) < 0)) throw hp(new wy(Kjn((GC(), eDn)))); + if (((t = 16 * t + i), kjn(this), 0 != this.c || (i = din(this.a)) < 0)) throw hp(new wy(Kjn((GC(), eDn)))); + if (((t = 16 * t + i), kjn(this), 0 != this.c || (i = din(this.a)) < 0)) throw hp(new wy(Kjn((GC(), eDn)))); + if ((t = 16 * t + i) > jKn) throw hp(new wy(Kjn((GC(), "parser.descappe.4")))); + n = t; + break; + case 65: + case 90: + case 122: + throw hp(new wy(Kjn((GC(), aDn)))); + } + return n; + }), + (Fjn.ul = function (n) { + var t; + switch (n) { + case 100: + t = 32 == (32 & this.e) ? Gkn("Nd", !0) : (Ljn(), jot); + break; + case 68: + t = 32 == (32 & this.e) ? Gkn("Nd", !1) : (Ljn(), Pot); + break; + case 119: + t = 32 == (32 & this.e) ? Gkn("IsWord", !0) : (Ljn(), Dot); + break; + case 87: + t = 32 == (32 & this.e) ? Gkn("IsWord", !1) : (Ljn(), Cot); + break; + case 115: + t = 32 == (32 & this.e) ? Gkn("IsSpace", !0) : (Ljn(), Aot); + break; + case 83: + t = 32 == (32 & this.e) ? Gkn("IsSpace", !1) : (Ljn(), Iot); + break; + default: + throw hp(new Im(EKn + n.toString(16))); + } + return t; + }), + (Fjn.vl = function (n) { + var t, e, i, r, c, a, u, o, s, h, f; + for ( + this.b = 1, + kjn(this), + t = null, + 0 == this.c && 94 == this.a + ? (kjn(this), n ? (Ljn(), Ljn(), (s = new cU(5))) : (Ljn(), Ljn(), zwn((t = new cU(4)), 0, jKn), (s = new cU(4)))) + : (Ljn(), Ljn(), (s = new cU(4))), + r = !0; + 1 != (f = this.c) && (0 != f || 93 != this.a || r); + + ) { + if (((r = !1), (e = this.a), (i = !1), 10 == f)) + switch (e) { + case 100: + case 68: + case 119: + case 87: + case 115: + case 83: + fmn(s, this.ul(e)), (i = !0); + break; + case 105: + case 73: + case 99: + case 67: + (e = this.Ll(s, e)) < 0 && (i = !0); + break; + case 112: + case 80: + if (!(h = Hhn(this, e))) throw hp(new wy(Kjn((GC(), zxn)))); + fmn(s, h), (i = !0); + break; + default: + e = this.tl(); + } + else if (20 == f) { + if ((c = b$(this.i, 58, this.d)) < 0) throw hp(new wy(Kjn((GC(), Uxn)))); + if ( + ((a = !0), 94 == XB(this.i, this.d) && (++this.d, (a = !1)), !(u = bY(l$(this.i, this.d, c), a, 512 == (512 & this.e)))) + ) + throw hp(new wy(Kjn((GC(), Wxn)))); + if ((fmn(s, u), (i = !0), c + 1 >= this.j || 93 != XB(this.i, c + 1))) throw hp(new wy(Kjn((GC(), Uxn)))); + this.d = c + 2; + } + if ((kjn(this), !i)) + if (0 != this.c || 45 != this.a) zwn(s, e, e); + else { + if ((kjn(this), 1 == (f = this.c))) throw hp(new wy(Kjn((GC(), Xxn)))); + 0 == f && 93 == this.a + ? (zwn(s, e, e), zwn(s, 45, 45)) + : ((o = this.a), 10 == f && (o = this.tl()), kjn(this), zwn(s, e, o)); + } + (this.e & DNn) == DNn && 0 == this.c && 44 == this.a && kjn(this); + } + if (1 == this.c) throw hp(new wy(Kjn((GC(), Xxn)))); + return t && (_yn(t, s), (s = t)), xln(s), Lmn(s), (this.b = 0), kjn(this), s; + }), + (Fjn.wl = function () { + var n, t, e, i; + for (e = this.vl(!1); 7 != (i = this.c); ) { + if (((n = this.a), (0 != i || (45 != n && 38 != n)) && 4 != i)) throw hp(new wy(Kjn((GC(), nDn)))); + if ((kjn(this), 9 != this.c)) throw hp(new wy(Kjn((GC(), Zxn)))); + if (((t = this.vl(!1)), 4 == i)) fmn(e, t); + else if (45 == n) _yn(e, t); + else { + if (38 != n) throw hp(new Im("ASSERT")); + Eyn(e, t); + } + } + return kjn(this), e; + }), + (Fjn.xl = function () { + var n, t; + return ( + (n = this.a - 48), + Ljn(), + Ljn(), + (t = new nG(12, null, n)), + !this.g && (this.g = new Jp()), + Up(this.g, new Zg(n)), + kjn(this), + t + ); + }), + (Fjn.yl = function () { + return kjn(this), Ljn(), $ot; + }), + (Fjn.zl = function () { + return kjn(this), Ljn(), Oot; + }), + (Fjn.Al = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.Bl = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.Cl = function () { + return kjn(this), r6(); + }), + (Fjn.Dl = function () { + return kjn(this), Ljn(), Not; + }), + (Fjn.El = function () { + return kjn(this), Ljn(), Rot; + }), + (Fjn.Fl = function () { + var n; + if (this.d >= this.j || 64 != (65504 & (n = XB(this.i, this.d++)))) throw hp(new wy(Kjn((GC(), Bxn)))); + return kjn(this), Ljn(), Ljn(), new BR(0, n - 64); + }), + (Fjn.Gl = function () { + return ( + kjn(this), + (function () { + var n, t, e, i, r, c; + if ((Ljn(), qot)) return qot; + for (fmn((n = new cU(4)), Gkn($Kn, !0)), _yn(n, Gkn("M", !0)), _yn(n, Gkn("C", !0)), c = new cU(4), i = 0; i < 11; i++) + zwn(c, i, i); + return ( + fmn((t = new cU(4)), Gkn("M", !0)), + zwn(t, 4448, 4607), + zwn(t, 65438, 65439), + Rmn((r = new HC(2)), n), + Rmn(r, Tot), + (e = new HC(2)).$l(VR(c, Gkn("L", !0))), + e.$l(t), + (e = new tF(r, (e = new cW(3, e)))), + (qot = e) + ); + })() + ); + }), + (Fjn.Hl = function () { + return kjn(this), Ljn(), Kot; + }), + (Fjn.Il = function () { + var n; + return Ljn(), Ljn(), (n = new BR(0, 105)), kjn(this), n; + }), + (Fjn.Jl = function () { + return kjn(this), Ljn(), xot; + }), + (Fjn.Kl = function () { + return kjn(this), Ljn(), Lot; + }), + (Fjn.Ll = function (n, t) { + return this.tl(); + }), + (Fjn.Ml = function () { + return kjn(this), Ljn(), Mot; + }), + (Fjn.Nl = function () { + var n, t, e, i, r; + if (this.d + 1 >= this.j) throw hp(new wy(Kjn((GC(), Kxn)))); + if (((i = -1), (t = null), 49 <= (n = XB(this.i, this.d)) && n <= 57)) { + if (((i = n - 48), !this.g && (this.g = new Jp()), Up(this.g, new Zg(i)), ++this.d, 41 != XB(this.i, this.d))) + throw hp(new wy(Kjn((GC(), xxn)))); + ++this.d; + } else + switch ((63 == n && --this.d, kjn(this), (t = ujn(this)).e)) { + case 20: + case 21: + case 22: + case 23: + break; + case 8: + if (7 != this.c) throw hp(new wy(Kjn((GC(), xxn)))); + break; + default: + throw hp(new wy(Kjn((GC(), _xn)))); + } + if ((kjn(this), (e = null), 2 == (r = etn(this)).e)) { + if (2 != r.em()) throw hp(new wy(Kjn((GC(), Fxn)))); + (e = r.am(1)), (r = r.am(0)); + } + if (7 != this.c) throw hp(new wy(Kjn((GC(), xxn)))); + return kjn(this), Ljn(), Ljn(), new nZ(i, t, r, e); + }), + (Fjn.Ol = function () { + return kjn(this), Ljn(), Sot; + }), + (Fjn.Pl = function () { + var n; + if ((kjn(this), (n = T_(24, etn(this))), 7 != this.c)) throw hp(new wy(Kjn((GC(), xxn)))); + return kjn(this), n; + }), + (Fjn.Ql = function () { + var n; + if ((kjn(this), (n = T_(20, etn(this))), 7 != this.c)) throw hp(new wy(Kjn((GC(), xxn)))); + return kjn(this), n; + }), + (Fjn.Rl = function () { + var n; + if ((kjn(this), (n = T_(22, etn(this))), 7 != this.c)) throw hp(new wy(Kjn((GC(), xxn)))); + return kjn(this), n; + }), + (Fjn.Sl = function () { + var n, t, e, i, r; + for (n = 0, e = 0, t = -1; this.d < this.j && 0 != (r = xfn((t = XB(this.i, this.d)))); ) (n |= r), ++this.d; + if (this.d >= this.j) throw hp(new wy(Kjn((GC(), Dxn)))); + if (45 == t) { + for (++this.d; this.d < this.j && 0 != (r = xfn((t = XB(this.i, this.d)))); ) (e |= r), ++this.d; + if (this.d >= this.j) throw hp(new wy(Kjn((GC(), Dxn)))); + } + if (58 == t) { + if ((++this.d, kjn(this), (i = xF(etn(this), n, e)), 7 != this.c)) throw hp(new wy(Kjn((GC(), xxn)))); + kjn(this); + } else { + if (41 != t) throw hp(new wy(Kjn((GC(), Rxn)))); + ++this.d, kjn(this), (i = xF(etn(this), n, e)); + } + return i; + }), + (Fjn.Tl = function () { + var n; + if ((kjn(this), (n = T_(21, etn(this))), 7 != this.c)) throw hp(new wy(Kjn((GC(), xxn)))); + return kjn(this), n; + }), + (Fjn.Ul = function () { + var n; + if ((kjn(this), (n = T_(23, etn(this))), 7 != this.c)) throw hp(new wy(Kjn((GC(), xxn)))); + return kjn(this), n; + }), + (Fjn.Vl = function () { + var n, t; + if ((kjn(this), (n = this.f++), (t = M_(etn(this), n)), 7 != this.c)) throw hp(new wy(Kjn((GC(), xxn)))); + return kjn(this), t; + }), + (Fjn.Wl = function () { + var n; + if ((kjn(this), (n = M_(etn(this), 0)), 7 != this.c)) throw hp(new wy(Kjn((GC(), xxn)))); + return kjn(this), n; + }), + (Fjn.Xl = function (n) { + return kjn(this), 5 == this.c ? (kjn(this), VR(n, (Ljn(), Ljn(), new cW(9, n)))) : VR(n, (Ljn(), Ljn(), new cW(3, n))); + }), + (Fjn.Yl = function (n) { + var t; + return ( + kjn(this), Ljn(), Ljn(), (t = new HC(2)), 5 == this.c ? (kjn(this), Rmn(t, Tot), Rmn(t, n)) : (Rmn(t, n), Rmn(t, Tot)), t + ); + }), + (Fjn.Zl = function (n) { + return kjn(this), 5 == this.c ? (kjn(this), Ljn(), Ljn(), new cW(9, n)) : (Ljn(), Ljn(), new cW(3, n)); + }), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.c = 0), + (Fjn.d = 0), + (Fjn.e = 0), + (Fjn.f = 1), + (Fjn.g = null), + (Fjn.j = 0), + EF(kKn, "RegEx/RegexParser", 820), + Wfn(1824, 820, {}, Zv), + (Fjn.sl = function (n) { + return !1; + }), + (Fjn.tl = function () { + return Tdn(this); + }), + (Fjn.ul = function (n) { + return rpn(n); + }), + (Fjn.vl = function (n) { + return Ejn(this); + }), + (Fjn.wl = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.xl = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.yl = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.zl = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.Al = function () { + return kjn(this), rpn(67); + }), + (Fjn.Bl = function () { + return kjn(this), rpn(73); + }), + (Fjn.Cl = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.Dl = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.El = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.Fl = function () { + return kjn(this), rpn(99); + }), + (Fjn.Gl = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.Hl = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.Il = function () { + return kjn(this), rpn(105); + }), + (Fjn.Jl = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.Kl = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.Ll = function (n, t) { + return fmn(n, rpn(t)), -1; + }), + (Fjn.Ml = function () { + return kjn(this), Ljn(), Ljn(), new BR(0, 94); + }), + (Fjn.Nl = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.Ol = function () { + return kjn(this), Ljn(), Ljn(), new BR(0, 36); + }), + (Fjn.Pl = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.Ql = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.Rl = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.Sl = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.Tl = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.Ul = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.Vl = function () { + var n; + if ((kjn(this), (n = M_(etn(this), 0)), 7 != this.c)) throw hp(new wy(Kjn((GC(), xxn)))); + return kjn(this), n; + }), + (Fjn.Wl = function () { + throw hp(new wy(Kjn((GC(), uDn)))); + }), + (Fjn.Xl = function (n) { + return kjn(this), VR(n, (Ljn(), Ljn(), new cW(3, n))); + }), + (Fjn.Yl = function (n) { + var t; + return kjn(this), Ljn(), Ljn(), Rmn((t = new HC(2)), n), Rmn(t, Tot), t; + }), + (Fjn.Zl = function (n) { + return kjn(this), Ljn(), Ljn(), new cW(3, n); + }); + var dot = null, + got = null; + EF(kKn, "RegEx/ParserForXMLSchema", 1824), + Wfn(117, 1, xKn, np), + (Fjn.$l = function (n) { + throw hp(new Im("Not supported.")); + }), + (Fjn._l = function () { + return -1; + }), + (Fjn.am = function (n) { + return null; + }), + (Fjn.bm = function () { + return null; + }), + (Fjn.cm = function (n) {}), + (Fjn.dm = function (n) {}), + (Fjn.em = function () { + return 0; + }), + (Fjn.Ib = function () { + return this.fm(0); + }), + (Fjn.fm = function (n) { + return 11 == this.e ? "." : ""; + }), + (Fjn.e = 0); + var pot, + vot, + mot, + yot, + kot, + jot, + Eot, + Tot, + Mot, + Sot, + Pot, + Iot, + Cot, + Oot, + Aot, + $ot, + Lot, + Not, + xot, + Dot, + Rot, + Kot, + _ot, + Fot, + Bot = null, + Hot = null, + qot = null, + Got = EF(kKn, "RegEx/Token", 117); + Wfn(136, 117, { 3: 1, 136: 1, 117: 1 }, cU), + (Fjn.fm = function (n) { + var t, e, i; + if (4 == this.e) + if (this == Eot) e = "."; + else if (this == jot) e = "\\d"; + else if (this == Dot) e = "\\w"; + else if (this == Aot) e = "\\s"; + else { + for ((i = new Cy()).a += "[", t = 0; t < this.b.length; t += 2) + 0 != (n & DNn) && t > 0 && (i.a += ","), + this.b[t] === this.b[t + 1] ? pI(i, jvn(this.b[t])) : (pI(i, jvn(this.b[t])), (i.a += "-"), pI(i, jvn(this.b[t + 1]))); + (i.a += "]"), (e = i.a); + } + else if (this == Pot) e = "\\D"; + else if (this == Cot) e = "\\W"; + else if (this == Iot) e = "\\S"; + else { + for ((i = new Cy()).a += "[^", t = 0; t < this.b.length; t += 2) + 0 != (n & DNn) && t > 0 && (i.a += ","), + this.b[t] === this.b[t + 1] ? pI(i, jvn(this.b[t])) : (pI(i, jvn(this.b[t])), (i.a += "-"), pI(i, jvn(this.b[t + 1]))); + (i.a += "]"), (e = i.a); + } + return e; + }), + (Fjn.a = !1), + (Fjn.c = !1), + EF(kKn, "RegEx/RangeToken", 136), + Wfn(584, 1, { 584: 1 }, Zg), + (Fjn.a = 0), + EF(kKn, "RegEx/RegexParser/ReferencePosition", 584), + Wfn(583, 1, { 3: 1, 583: 1 }, Mj), + (Fjn.Fb = function (n) { + var t; + return null != n && !!CO(n, 583) && ((t = Yx(n, 583)), _N(this.b, t.b) && this.a == t.a); + }), + (Fjn.Hb = function () { + return Xen(this.b + "/" + fwn(this.a)); + }), + (Fjn.Ib = function () { + return this.c.fm(this.a); + }), + (Fjn.a = 0), + EF(kKn, "RegEx/RegularExpression", 583), + Wfn(223, 117, xKn, BR), + (Fjn._l = function () { + return this.a; + }), + (Fjn.fm = function (n) { + var t, e; + switch (this.e) { + case 0: + switch (this.a) { + case 124: + case 42: + case 43: + case 63: + case 40: + case 41: + case 46: + case 91: + case 123: + case 92: + e = "\\" + iN(this.a & fTn); + break; + case 12: + e = "\\f"; + break; + case 10: + e = "\\n"; + break; + case 13: + e = "\\r"; + break; + case 9: + e = "\\t"; + break; + case 27: + e = "\\e"; + break; + default: + e = this.a >= eMn ? "\\v" + l$((t = "0" + (this.a >>> 0).toString(16)), t.length - 6, t.length) : "" + iN(this.a & fTn); + } + break; + case 8: + e = this == Mot || this == Sot ? "" + iN(this.a & fTn) : "\\" + iN(this.a & fTn); + break; + default: + e = null; + } + return e; + }), + (Fjn.a = 0), + EF(kKn, "RegEx/Token/CharToken", 223), + Wfn(309, 117, xKn, cW), + (Fjn.am = function (n) { + return this.a; + }), + (Fjn.cm = function (n) { + this.b = n; + }), + (Fjn.dm = function (n) { + this.c = n; + }), + (Fjn.em = function () { + return 1; + }), + (Fjn.fm = function (n) { + var t; + if (3 == this.e) + if (this.c < 0 && this.b < 0) t = this.a.fm(n) + "*"; + else if (this.c == this.b) t = this.a.fm(n) + "{" + this.c + "}"; + else if (this.c >= 0 && this.b >= 0) t = this.a.fm(n) + "{" + this.c + "," + this.b + "}"; + else { + if (!(this.c >= 0 && this.b < 0)) throw hp(new Im("Token#toString(): CLOSURE " + this.c + tEn + this.b)); + t = this.a.fm(n) + "{" + this.c + ",}"; + } + else if (this.c < 0 && this.b < 0) t = this.a.fm(n) + "*?"; + else if (this.c == this.b) t = this.a.fm(n) + "{" + this.c + "}?"; + else if (this.c >= 0 && this.b >= 0) t = this.a.fm(n) + "{" + this.c + "," + this.b + "}?"; + else { + if (!(this.c >= 0 && this.b < 0)) throw hp(new Im("Token#toString(): NONGREEDYCLOSURE " + this.c + tEn + this.b)); + t = this.a.fm(n) + "{" + this.c + ",}?"; + } + return t; + }), + (Fjn.b = 0), + (Fjn.c = 0), + EF(kKn, "RegEx/Token/ClosureToken", 309), + Wfn(821, 117, xKn, tF), + (Fjn.am = function (n) { + return 0 == n ? this.a : this.b; + }), + (Fjn.em = function () { + return 2; + }), + (Fjn.fm = function (n) { + return 3 == this.b.e && this.b.am(0) == this.a + ? this.a.fm(n) + "+" + : 9 == this.b.e && this.b.am(0) == this.a + ? this.a.fm(n) + "+?" + : this.a.fm(n) + "" + this.b.fm(n); + }), + EF(kKn, "RegEx/Token/ConcatToken", 821), + Wfn(1822, 117, xKn, nZ), + (Fjn.am = function (n) { + if (0 == n) return this.d; + if (1 == n) return this.b; + throw hp(new Im("Internal Error: " + n)); + }), + (Fjn.em = function () { + return this.b ? 2 : 1; + }), + (Fjn.fm = function (n) { + var t; + return ( + (t = this.c > 0 ? "(?(" + this.c + ")" : 8 == this.a.e ? "(?(" + this.a + ")" : "(?" + this.a), + this.b ? (t += this.d + "|" + this.b + ")") : (t += this.d + ")"), + t + ); + }), + (Fjn.c = 0), + EF(kKn, "RegEx/Token/ConditionToken", 1822), + Wfn(1823, 117, xKn, rU), + (Fjn.am = function (n) { + return this.b; + }), + (Fjn.em = function () { + return 1; + }), + (Fjn.fm = function (n) { + return "(?" + (0 == this.a ? "" : fwn(this.a)) + (0 == this.c ? "" : fwn(this.c)) + ":" + this.b.fm(n) + ")"; + }), + (Fjn.a = 0), + (Fjn.c = 0), + EF(kKn, "RegEx/Token/ModifierToken", 1823), + Wfn(822, 117, xKn, rB), + (Fjn.am = function (n) { + return this.a; + }), + (Fjn.em = function () { + return 1; + }), + (Fjn.fm = function (n) { + var t; + switch (((t = null), this.e)) { + case 6: + t = 0 == this.b ? "(?:" + this.a.fm(n) + ")" : "(" + this.a.fm(n) + ")"; + break; + case 20: + t = "(?=" + this.a.fm(n) + ")"; + break; + case 21: + t = "(?!" + this.a.fm(n) + ")"; + break; + case 22: + t = "(?<=" + this.a.fm(n) + ")"; + break; + case 23: + t = "(?" + this.a.fm(n) + ")"; + } + return t; + }), + (Fjn.b = 0), + EF(kKn, "RegEx/Token/ParenToken", 822), + Wfn(521, 117, { 3: 1, 117: 1, 521: 1 }, nG), + (Fjn.bm = function () { + return this.b; + }), + (Fjn.fm = function (n) { + return 12 == this.e + ? "\\" + this.a + : (function (n) { + var t, e, i, r; + for (r = n.length, t = null, i = 0; i < r; i++) + Lz(i, n.length), + VI(".*+?{[()|\\^$", gun((e = n.charCodeAt(i)))) >= 0 + ? (t || ((t = new Oy()), i > 0 && pI(t, n.substr(0, i))), (t.a += "\\"), KF(t, e & fTn)) + : t && KF(t, e & fTn); + return t ? t.a : n; + })(this.b); + }), + (Fjn.a = 0), + EF(kKn, "RegEx/Token/StringToken", 521), + Wfn(465, 117, xKn, HC), + (Fjn.$l = function (n) { + Rmn(this, n); + }), + (Fjn.am = function (n) { + return Yx(lB(this.a, n), 117); + }), + (Fjn.em = function () { + return this.a ? this.a.a.c.length : 0; + }), + (Fjn.fm = function (n) { + var t, e, i, r, c; + if (1 == this.e) { + if (2 == this.a.a.c.length) + (t = Yx(lB(this.a, 0), 117)), + (r = + 3 == (e = Yx(lB(this.a, 1), 117)).e && e.am(0) == t + ? t.fm(n) + "+" + : 9 == e.e && e.am(0) == t + ? t.fm(n) + "+?" + : t.fm(n) + "" + e.fm(n)); + else { + for (c = new Cy(), i = 0; i < this.a.a.c.length; i++) pI(c, Yx(lB(this.a, i), 117).fm(n)); + r = c.a; + } + return r; + } + if (2 == this.a.a.c.length && 7 == Yx(lB(this.a, 1), 117).e) r = Yx(lB(this.a, 0), 117).fm(n) + "?"; + else if (2 == this.a.a.c.length && 7 == Yx(lB(this.a, 0), 117).e) r = Yx(lB(this.a, 1), 117).fm(n) + "??"; + else { + for (pI((c = new Cy()), Yx(lB(this.a, 0), 117).fm(n)), i = 1; i < this.a.a.c.length; i++) + (c.a += "|"), pI(c, Yx(lB(this.a, i), 117).fm(n)); + r = c.a; + } + return r; + }), + EF(kKn, "RegEx/Token/UnionToken", 465), + Wfn(518, 1, { 592: 1 }, Tj), + (Fjn.Ib = function () { + return this.a.b; + }), + EF(DKn, "XMLTypeUtil/PatternMatcherImpl", 518), + Wfn(1622, 1381, {}, Rh), + EF(DKn, "XMLTypeValidator", 1622), + Wfn(264, 1, $En, NK), + (Fjn.Jc = function (n) { + XW(this, n); + }), + (Fjn.Kc = function () { + return (this.b - this.a) * this.c < 0 ? Fot : new oA(this); + }), + (Fjn.a = 0), + (Fjn.b = 0), + (Fjn.c = 0), + EF(KKn, "ExclusiveRange", 264), + Wfn(1068, 1, yEn, Kh), + (Fjn.Rb = function (n) { + Yx(n, 19), + (function () { + throw hp(new sy(_Kn)); + })(); + }), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Pb = function () { + return (function () { + throw hp(new Kp()); + })(); + }), + (Fjn.Ub = function () { + return (function () { + throw hp(new Kp()); + })(); + }), + (Fjn.Wb = function (n) { + Yx(n, 19), + (function () { + throw hp(new sy(FKn)); + })(); + }), + (Fjn.Ob = function () { + return !1; + }), + (Fjn.Sb = function () { + return !1; + }), + (Fjn.Tb = function () { + return -1; + }), + (Fjn.Vb = function () { + return -1; + }), + (Fjn.Qb = function () { + throw hp(new sy(BKn)); + }), + EF(KKn, "ExclusiveRange/1", 1068), + Wfn(254, 1, yEn, oA), + (Fjn.Rb = function (n) { + Yx(n, 19), + (function () { + throw hp(new sy(_Kn)); + })(); + }), + (Fjn.Nb = function (n) { + I_(this, n); + }), + (Fjn.Pb = function () { + return (function (n) { + var t; + if (!(n.c.c < 0 ? n.a >= n.c.b : n.a <= n.c.b)) throw hp(new Kp()); + return (t = n.a), (n.a += n.c.c), ++n.b, d9(t); + })(this); + }), + (Fjn.Ub = function () { + return (function (n) { + if (n.b <= 0) throw hp(new Kp()); + return --n.b, (n.a -= n.c.c), d9(n.a); + })(this); + }), + (Fjn.Wb = function (n) { + Yx(n, 19), + (function () { + throw hp(new sy(FKn)); + })(); + }), + (Fjn.Ob = function () { + return this.c.c < 0 ? this.a >= this.c.b : this.a <= this.c.b; + }), + (Fjn.Sb = function () { + return this.b > 0; + }), + (Fjn.Tb = function () { + return this.b; + }), + (Fjn.Vb = function () { + return this.b - 1; + }), + (Fjn.Qb = function () { + throw hp(new sy(BKn)); + }), + (Fjn.a = 0), + (Fjn.b = 0), + EF(KKn, "ExclusiveRange/RangeIterator", 254); + var zot, + Uot, + Xot = MB(HDn, "C"), + Wot = MB(zDn, "I"), + Vot = MB(Xjn, "Z"), + Qot = MB(UDn, "J"), + Yot = MB(BDn, "B"), + Jot = MB(qDn, "D"), + Zot = MB(GDn, "F"), + nst = MB(XDn, "S"), + tst = aR("org.eclipse.elk.core.labels", "ILabelManager"), + est = aR(exn, "DiagnosticChain"), + ist = aR(SRn, "ResourceSet"), + rst = EF(exn, "InvocationTargetException", null), + cst = + (_y(), + function (n) { + return ( + _y(), + function () { + return sX(n, this, arguments); + } + ); + }), + ast = (ast = function (n, t, e, i) { + Cj(); + var r = Hjn; + function c() { + for (var n = 0; n < r.length; n++) r[n](); + } + if (n) + try { + cst(c)(); + } catch (e) { + n(t, e); + } + else cst(c)(); + }); + (function () { + Cj(); + for (var n = Hjn, t = 0; t < arguments.length; t++) n.push(arguments[t]); + })(function () { + Fk(), + (function () { + function n(n) { + var t = this; + (this.dispatch = function (t) { + var e = t.data; + switch (e.cmd) { + case "algorithms": + var i = J7((XH(), new fb(new Zl(Pct.b)))); + n.postMessage({ id: e.id, data: i }); + break; + case "categories": + var r = J7((XH(), new fb(new Zl(Pct.c)))); + n.postMessage({ id: e.id, data: r }); + break; + case "options": + var c = J7((XH(), new fb(new Zl(Pct.d)))); + n.postMessage({ id: e.id, data: c }); + break; + case "register": + (function (n) { + var t, e, i; + for (h6(Pct, x4(Gy(ZBn, 1), iEn, 130, 0, [new $f()])), e = new jl(n), i = 0; i < e.a.length; ++i) + _N((t = VJ(e, i).je().a), "layered") + ? h6(Pct, x4(Gy(ZBn, 1), iEn, 130, 0, [new of()])) + : _N(t, "force") + ? h6(Pct, x4(Gy(ZBn, 1), iEn, 130, 0, [new qh()])) + : _N(t, "stress") + ? h6(Pct, x4(Gy(ZBn, 1), iEn, 130, 0, [new zh()])) + : _N(t, "mrtree") + ? h6(Pct, x4(Gy(ZBn, 1), iEn, 130, 0, [new Mf()])) + : _N(t, "radial") + ? h6(Pct, x4(Gy(ZBn, 1), iEn, 130, 0, [new vf()])) + : _N(t, "disco") + ? h6(Pct, x4(Gy(ZBn, 1), iEn, 130, 0, [new Hh(), new Fh()])) + : _N(t, "sporeOverlap") || _N(t, "sporeCompaction") + ? h6(Pct, x4(Gy(ZBn, 1), iEn, 130, 0, [new jf()])) + : _N(t, "rectpacking") && h6(Pct, x4(Gy(ZBn, 1), iEn, 130, 0, [new If()])); + })(e.algorithms), + n.postMessage({ id: e.id }); + break; + case "layout": + (function (n, t, e) { + var i, r, c, a, u, o, s, h, f, l, b; + (c = new Ml(n)), + tV((a = new icn()).g), + tV(a.j), + U_(a.b), + tV(a.d), + tV(a.i), + U_(a.k), + U_(a.c), + U_(a.e), + (b = Ohn(a, c, null)), + Fln(a, c), + (r = b), + t && + ((u = (function (n) { + var t, e, i, r, c, a; + for ( + (function (n, t) { + eD(n.c, t); + })((r = new pU()), (H4(), l7n)), + i = new Vl(new ay(new nE(n, l2(n, VQ(fFn, TEn, 2, 0, 6, 1))).b)); + i.b < i.d.gc(); + + ) + S$(i.b < i.d.gc()), + (e = lL(i.d.Xb((i.c = i.b++)))), + (c = yyn(Pct, e)) && + null != + (a = oyn( + c, + (t = jG(n, e)).je() ? t.je().a : t.ge() ? "" + t.ge().a : t.he() ? "" + t.he().a : t.Ib(), + )) && + ((KA(c.j, (Qtn(), E7n)) || KA(c.j, T7n)) && l5(EZ(r, uct), c, a), + KA(c.j, k7n) && l5(EZ(r, nct), c, a), + KA(c.j, M7n) && l5(EZ(r, oct), c, a), + KA(c.j, j7n) && l5(EZ(r, act), c, a)); + return r; + })((s = new Ml(t)))), + mon(r, x4(Gy(w7n, 1), iEn, 527, 0, [u]))), + (l = !1), + (f = !1), + e && ((s = new Ml(e)), Pxn in s.a && (l = jG(s, Pxn).ge().a), Ixn in s.a && (f = jG(s, Ixn).ge().a)), + (h = pk(U1(new am(), l), f)), + (function (n, t, e) { + run(e, "Recursive Graph Layout", ndn(n, t, !0)), + mon(t, x4(Gy(w7n, 1), iEn, 527, 0, [new Of()])), + zQ(t, (Cjn(), Ltt)) || mon(t, x4(Gy(w7n, 1), iEn, 527, 0, [new gu()])), + Ykn(n, t, null, e), + Ron(e); + })(new su(), r, h), + Pxn in c.a && OZ(c, Pxn, null), + (l || f) && (vvn(h, (o = new Om()), l, f), OZ(c, Pxn, o)), + (i = new gg(a)), + (function (n, t) { + for (; null != n.g || n.c ? null == n.g || (0 != n.i && Yx(n.g[n.i - 1], 47).Ob()) : AG(n); ) LP(t, abn(n)); + })(new SC(r), i); + })(e.graph, e.layoutOptions || {}, e.options || {}), + n.postMessage({ id: e.id, data: e.graph }); + } + }), + (this.saveDispatch = function (e) { + try { + t.dispatch(e); + } catch (t) { + n.postMessage({ id: e.data.id, error: t }); + } + }); + } + function e(t) { + var e = this; + (this.dispatcher = new n({ + postMessage: function (n) { + e.onmessage({ data: n }); + }, + })), + (this.postMessage = function (n) { + setTimeout(function () { + e.dispatcher.saveDispatch({ data: n }); + }, 0); + }); + } + if ((Fk(), typeof document === AMn && typeof self !== AMn)) { + var r = new n(self); + self.onmessage = r.saveDispatch; + } else + typeof t !== AMn && + t.exports && + (Object.defineProperty(i, "__esModule", { value: !0 }), (t.exports = { default: e, Worker: e })); + })(); + }), + (zot = "permProps"), + (Uot = [ + [ + [HKn, qKn], + [GKn, "gecko1_8"], + ], + [ + [HKn, qKn], + [GKn, "ie10"], + ], + [ + [HKn, qKn], + [GKn, "ie8"], + ], + [ + [HKn, qKn], + [GKn, "ie9"], + ], + [ + [HKn, qKn], + [GKn, "safari"], + ], + ]), + typeof window === Ujn && typeof window.$gwt === Ujn && (window.$gwt[zot] = Uot), + ast(null, "elk", null); + }).call(this); + }).call(this, void 0 !== e.g ? e.g : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}); + }, + {}, + ], + 3: [ + function (n, t, e) { + "use strict"; + var i = (function (t) { + function e() { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + !(function (n, t) { + if (!(n instanceof t)) throw new TypeError("Cannot call a class as a function"); + })(this, e); + var i = Object.assign({}, t), + r = !1; + try { + n.resolve("web-worker"), (r = !0); + } catch (n) {} + if (t.workerUrl) + if (r) { + var c = n("web-worker"); + i.workerFactory = function (n) { + return new c(n); + }; + } else + console.warn( + "Web worker requested but 'web-worker' package not installed. \nConsider installing the package or pass your own 'workerFactory' to ELK's constructor.\n... Falling back to non-web worker version.", + ); + if (!i.workerFactory) { + var a = n("./elk-worker.min.js").Worker; + i.workerFactory = function (n) { + return new a(n); + }; + } + return (function (n, t) { + if (!n) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return !t || ("object" != typeof t && "function" != typeof t) ? n : t; + })(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, i)); + } + return ( + (function (n, t) { + if ("function" != typeof t && null !== t) + throw new TypeError("Super expression must either be null or a function, not " + typeof t); + (n.prototype = Object.create(t && t.prototype, { + constructor: { value: n, enumerable: !1, writable: !0, configurable: !0 }, + })), + t && (Object.setPrototypeOf ? Object.setPrototypeOf(n, t) : (n.__proto__ = t)); + })(e, t), + e + ); + })(n("./elk-api.js").default); + Object.defineProperty(t.exports, "__esModule", { value: !0 }), (t.exports = i), (i.default = i); + }, + { "./elk-api.js": 1, "./elk-worker.min.js": 2, "web-worker": 4 }, + ], + 4: [ + function (n, t, e) { + t.exports = Worker; + }, + {}, + ], + }, + {}, + [3], + )(3); + }, + 1639: function (n, t, e) { + "use strict"; + e.d(t, { + diagram: function () { + return v; + }, + }); + var i = e(1813), + r = e(7274), + c = e(6076), + a = e(9339), + u = e(7295); + e(7484), e(7967), e(7856); + const o = new u(); + let s = {}; + const h = {}; + let f = {}; + const l = (n, t, e) => { + const i = { + TB: { in: { north: "north" }, out: { south: "west", west: "east", east: "south" } }, + LR: { in: { west: "west" }, out: { east: "south", south: "north", north: "east" } }, + RL: { in: { east: "east" }, out: { west: "north", north: "south", south: "west" } }, + BT: { in: { south: "south" }, out: { north: "east", east: "west", west: "north" } }, + }; + return (i.TD = i.TB), a.l.info("abc88", e, t, n), i[e][t][n]; + }, + b = (n, t, e) => { + if ((a.l.info("getNextPort abc88", { node: n, edgeDirection: t, graphDirection: e }), !s[n])) + switch (e) { + case "TB": + case "TD": + s[n] = { inPosition: "north", outPosition: "south" }; + break; + case "BT": + s[n] = { inPosition: "south", outPosition: "north" }; + break; + case "RL": + s[n] = { inPosition: "east", outPosition: "west" }; + break; + case "LR": + s[n] = { inPosition: "west", outPosition: "east" }; + } + const i = "in" === t ? s[n].inPosition : s[n].outPosition; + return "in" === t ? (s[n].inPosition = l(s[n].inPosition, t, e)) : (s[n].outPosition = l(s[n].outPosition, t, e)), i; + }, + w = function (n, t, e, i, c) { + const a = (function (n, t, e) { + const i = ((n, t, e) => { + const { parentById: i } = e, + r = new Set(); + let c = n; + for (; c; ) { + if ((r.add(c), c === t)) return c; + c = i[c]; + } + for (c = t; c; ) { + if (r.has(c)) return c; + c = i[c]; + } + return "root"; + })(n, t, e); + if (void 0 === i || "root" === i) return { x: 0, y: 0 }; + const r = f[i].offset; + return { x: r.posX, y: r.posY }; + })(t.sourceId, t.targetId, c), + u = t.sections[0].startPoint, + o = t.sections[0].endPoint, + s = (t.sections[0].bendPoints ? t.sections[0].bendPoints : []).map((n) => [n.x + a.x, n.y + a.y]), + h = [[u.x + a.x, u.y + a.y], ...s, [o.x + a.x, o.y + a.y]], + l = (0, r.jvg)().curve(r.c_6), + b = n + .insert("path") + .attr("d", l(h)) + .attr("class", "path " + e.classes) + .attr("fill", "none"), + w = n.insert("g").attr("class", "edgeLabel"), + d = (0, r.Ys)(w.node().appendChild(t.labelEl)), + g = d.node().firstChild.getBoundingClientRect(); + d.attr("width", g.width), + d.attr("height", g.height), + w.attr("transform", `translate(${t.labels[0].x + a.x}, ${t.labels[0].y + a.y})`), + (function (n, t, e, i) { + let r = ""; + switch ( + (i && + ((r = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search), + (r = r.replace(/\(/g, "\\(")), + (r = r.replace(/\)/g, "\\)"))), + t.arrowTypeStart) + ) { + case "arrow_cross": + n.attr("marker-start", "url(" + r + "#" + e + "-crossStart)"); + break; + case "arrow_point": + n.attr("marker-start", "url(" + r + "#" + e + "-pointStart)"); + break; + case "arrow_barb": + n.attr("marker-start", "url(" + r + "#" + e + "-barbStart)"); + break; + case "arrow_circle": + n.attr("marker-start", "url(" + r + "#" + e + "-circleStart)"); + break; + case "aggregation": + n.attr("marker-start", "url(" + r + "#" + e + "-aggregationStart)"); + break; + case "extension": + n.attr("marker-start", "url(" + r + "#" + e + "-extensionStart)"); + break; + case "composition": + n.attr("marker-start", "url(" + r + "#" + e + "-compositionStart)"); + break; + case "dependency": + n.attr("marker-start", "url(" + r + "#" + e + "-dependencyStart)"); + break; + case "lollipop": + n.attr("marker-start", "url(" + r + "#" + e + "-lollipopStart)"); + } + switch (t.arrowTypeEnd) { + case "arrow_cross": + n.attr("marker-end", "url(" + r + "#" + e + "-crossEnd)"); + break; + case "arrow_point": + n.attr("marker-end", "url(" + r + "#" + e + "-pointEnd)"); + break; + case "arrow_barb": + n.attr("marker-end", "url(" + r + "#" + e + "-barbEnd)"); + break; + case "arrow_circle": + n.attr("marker-end", "url(" + r + "#" + e + "-circleEnd)"); + break; + case "aggregation": + n.attr("marker-end", "url(" + r + "#" + e + "-aggregationEnd)"); + break; + case "extension": + n.attr("marker-end", "url(" + r + "#" + e + "-extensionEnd)"); + break; + case "composition": + n.attr("marker-end", "url(" + r + "#" + e + "-compositionEnd)"); + break; + case "dependency": + n.attr("marker-end", "url(" + r + "#" + e + "-dependencyEnd)"); + break; + case "lollipop": + n.attr("marker-end", "url(" + r + "#" + e + "-lollipopEnd)"); + } + })(b, e, i.type, i.arrowMarkerAbsolute); + }, + d = (n, t) => { + n.forEach((n) => { + n.children || (n.children = []); + const e = t.childrenById[n.id]; + e && + e.forEach((t) => { + n.children.push(f[t]); + }), + d(n.children, t); + }); + }, + g = (n, t, e, i, r, c, u) => { + e.forEach(function (e) { + if (e) + if ( + ((f[e.id].offset = { + posX: e.x + n, + posY: e.y + t, + x: n, + y: t, + depth: u, + width: e.width, + height: e.height, + }), + "group" === e.type) + ) { + const i = r.insert("g").attr("class", "subgraph"); + i.insert("rect") + .attr("class", "subgraph subgraph-lvl-" + (u % 5) + " node") + .attr("x", e.x + n) + .attr("y", e.y + t) + .attr("width", e.width) + .attr("height", e.height); + const c = i.insert("g").attr("class", "label"), + o = (0, a.c)().flowchart.htmlLabels ? e.labelData.width / 2 : 0; + c.attr("transform", `translate(${e.labels[0].x + n + e.x + o}, ${e.labels[0].y + t + e.y + 3})`), + c.node().appendChild(e.labelData.labelNode), + a.l.info("Id (UGH)= ", e.type, e.labels); + } else a.l.info("Id (UGH)= ", e.id), e.el.attr("transform", `translate(${e.x + n + e.width / 2}, ${e.y + t + e.height / 2})`); + }), + e.forEach(function (e) { + e && "group" === e.type && g(n + e.x, t + e.y, e.children, i, r, c, u + 1); + }); + }, + p = { + getClasses: function (n, t) { + return a.l.info("Extracting classes"), t.db.getClasses(); + }, + draw: async function (n, t, e, i) { + var u; + (f = {}), (s = {}); + const l = (0, r.Ys)("body").append("div").attr("style", "height:400px").attr("id", "cy"); + let p = { + id: "root", + layoutOptions: { + "elk.hierarchyHandling": "INCLUDE_CHILDREN", + "org.eclipse.elk.padding": "[top=100, left=100, bottom=110, right=110]", + "elk.layered.spacing.edgeNodeBetweenLayers": "30", + "elk.direction": "DOWN", + }, + children: [], + edges: [], + }; + switch ((a.l.info("Drawing flowchart using v3 renderer", o), i.db.getDirection())) { + case "BT": + p.layoutOptions["elk.direction"] = "UP"; + break; + case "TB": + p.layoutOptions["elk.direction"] = "DOWN"; + break; + case "LR": + p.layoutOptions["elk.direction"] = "RIGHT"; + break; + case "RL": + p.layoutOptions["elk.direction"] = "LEFT"; + } + const { securityLevel: v, flowchart: m } = (0, a.c)(); + let y; + "sandbox" === v && (y = (0, r.Ys)("#i" + t)); + const k = "sandbox" === v ? (0, r.Ys)(y.nodes()[0].contentDocument.body) : (0, r.Ys)("body"), + j = "sandbox" === v ? y.nodes()[0].contentDocument : document, + E = k.select(`[id="${t}"]`); + (0, c.a)(E, ["point", "circle", "cross"], i.type, i.arrowMarkerAbsolute); + const T = i.db.getVertices(); + let M; + const S = i.db.getSubGraphs(); + a.l.info("Subgraphs - ", S); + for (let n = S.length - 1; n >= 0; n--) + (M = S[n]), i.db.addVertex(M.id, { text: M.title, type: M.labelType }, "group", void 0, M.classes, M.dir); + const P = E.insert("g").attr("class", "subgraphs"), + I = (function (n) { + const t = { parentById: {}, childrenById: {} }, + e = n.getSubGraphs(); + return ( + a.l.info("Subgraphs - ", e), + e.forEach(function (n) { + n.nodes.forEach(function (e) { + (t.parentById[e] = n.id), void 0 === t.childrenById[n.id] && (t.childrenById[n.id] = []), t.childrenById[n.id].push(e); + }); + }), + e.forEach(function (n) { + n.id, void 0 !== t.parentById[n.id] && t.parentById[n.id]; + }), + t + ); + })(i.db); + p = await (async function (n, t, e, i, r, u, o) { + const s = e.select(`[id="${t}"]`).insert("g").attr("class", "nodes"), + h = Object.keys(n); + return ( + await Promise.all( + h.map(async function (t) { + const e = n[t]; + let o = "default"; + e.classes.length > 0 && (o = e.classes.join(" ")), (o += " flowchart-label"); + const h = (0, a.k)(e.styles); + let l = void 0 !== e.text ? e.text : e.id; + const b = { width: 0, height: 0 }, + w = [ + { id: e.id + "-west", layoutOptions: { "port.side": "WEST" } }, + { id: e.id + "-east", layoutOptions: { "port.side": "EAST" } }, + { id: e.id + "-south", layoutOptions: { "port.side": "SOUTH" } }, + { id: e.id + "-north", layoutOptions: { "port.side": "NORTH" } }, + ]; + let d = 0, + g = "", + p = {}; + switch (e.type) { + case "round": + (d = 5), (g = "rect"); + break; + case "square": + case "group": + default: + g = "rect"; + break; + case "diamond": + (g = "question"), (p = { portConstraints: "FIXED_SIDE" }); + break; + case "hexagon": + g = "hexagon"; + break; + case "odd": + case "odd_right": + g = "rect_left_inv_arrow"; + break; + case "lean_right": + g = "lean_right"; + break; + case "lean_left": + g = "lean_left"; + break; + case "trapezoid": + g = "trapezoid"; + break; + case "inv_trapezoid": + g = "inv_trapezoid"; + break; + case "circle": + g = "circle"; + break; + case "ellipse": + g = "ellipse"; + break; + case "stadium": + g = "stadium"; + break; + case "subroutine": + g = "subroutine"; + break; + case "cylinder": + g = "cylinder"; + break; + case "doublecircle": + g = "doublecircle"; + } + const v = { + labelStyle: h.labelStyle, + shape: g, + labelText: l, + labelType: e.labelType, + rx: d, + ry: d, + class: o, + style: h.style, + id: e.id, + link: e.link, + linkTarget: e.linkTarget, + tooltip: r.db.getTooltip(e.id) || "", + domId: r.db.lookUpDomId(e.id), + haveCallback: e.haveCallback, + width: "group" === e.type ? 500 : void 0, + dir: e.dir, + type: e.type, + props: e.props, + padding: (0, a.c)().flowchart.padding, + }; + let m, y; + if ("group" !== v.type) (y = await (0, c.e)(s, v, e.dir)), (m = y.node().getBBox()); + else { + i.createElementNS("http://www.w3.org/2000/svg", "text"); + const { shapeSvg: n, bbox: t } = await (0, c.l)(s, v, void 0, !0); + (b.width = t.width), + (b.wrappingWidth = (0, a.c)().flowchart.wrappingWidth), + (b.height = t.height), + (b.labelNode = n.node()), + (v.labelData = b); + } + const k = { + id: e.id, + ports: "diamond" === e.type ? w : [], + layoutOptions: p, + labelText: l, + labelData: b, + domId: r.db.lookUpDomId(e.id), + width: null == m ? void 0 : m.width, + height: null == m ? void 0 : m.height, + type: e.type, + el: y, + parent: u.parentById[e.id], + }; + f[v.id] = k; + }), + ), + o + ); + })(T, t, k, j, i, I, p); + const C = E.insert("g").attr("class", "edges edgePath"), + O = i.db.getEdges(); + (p = (function (n, t, e, i) { + a.l.info("abc78 edges = ", n); + const u = i.insert("g").attr("class", "edgeLabels"); + let o, + s, + l = {}, + w = t.db.getDirection(); + if (void 0 !== n.defaultStyle) { + const t = (0, a.k)(n.defaultStyle); + (o = t.style), (s = t.labelStyle); + } + return ( + n.forEach(function (t) { + const i = "L-" + t.start + "-" + t.end; + void 0 === l[i] ? ((l[i] = 0), a.l.info("abc78 new entry", i, l[i])) : (l[i]++, a.l.info("abc78 new entry", i, l[i])); + let d = i + "-" + l[i]; + a.l.info("abc78 new link id to be used is", i, d, l[i]); + const g = "LS-" + t.start, + p = "LE-" + t.end, + v = { style: "", labelStyle: "" }; + switch ( + ((v.minlen = t.length || 1), + "arrow_open" === t.type ? (v.arrowhead = "none") : (v.arrowhead = "normal"), + (v.arrowTypeStart = "arrow_open"), + (v.arrowTypeEnd = "arrow_open"), + t.type) + ) { + case "double_arrow_cross": + v.arrowTypeStart = "arrow_cross"; + case "arrow_cross": + v.arrowTypeEnd = "arrow_cross"; + break; + case "double_arrow_point": + v.arrowTypeStart = "arrow_point"; + case "arrow_point": + v.arrowTypeEnd = "arrow_point"; + break; + case "double_arrow_circle": + v.arrowTypeStart = "arrow_circle"; + case "arrow_circle": + v.arrowTypeEnd = "arrow_circle"; + } + let m = "", + y = ""; + switch (t.stroke) { + case "normal": + (m = "fill:none;"), void 0 !== o && (m = o), void 0 !== s && (y = s), (v.thickness = "normal"), (v.pattern = "solid"); + break; + case "dotted": + (v.thickness = "normal"), (v.pattern = "dotted"), (v.style = "fill:none;stroke-width:2px;stroke-dasharray:3;"); + break; + case "thick": + (v.thickness = "thick"), (v.pattern = "solid"), (v.style = "stroke-width: 3.5px;fill:none;"); + } + if (void 0 !== t.style) { + const n = (0, a.k)(t.style); + (m = n.style), (y = n.labelStyle); + } + (v.style = v.style += m), + (v.labelStyle = v.labelStyle += y), + void 0 !== t.interpolate + ? (v.curve = (0, a.o)(t.interpolate, r.c_6)) + : void 0 !== n.defaultInterpolate + ? (v.curve = (0, a.o)(n.defaultInterpolate, r.c_6)) + : (v.curve = (0, a.o)(h.curve, r.c_6)), + void 0 === t.text + ? void 0 !== t.style && (v.arrowheadStyle = "fill: #333") + : ((v.arrowheadStyle = "fill: #333"), (v.labelpos = "c")), + (v.labelType = t.labelType), + (v.label = t.text.replace(a.e.lineBreakRegex, "\n")), + void 0 === t.style && (v.style = v.style || "stroke: #333; stroke-width: 1.5px;fill:none;"), + (v.labelStyle = v.labelStyle.replace("color:", "fill:")), + (v.id = d), + (v.classes = "flowchart-link " + g + " " + p); + const k = (0, c.f)(u, v), + { + source: j, + target: E, + sourceId: T, + targetId: M, + } = ((n, t) => { + let e = n.start, + i = n.end; + const r = e, + c = i, + a = f[e], + u = f[i]; + return a && u + ? ("diamond" === a.type && (e = `${e}-${b(e, "out", t)}`), + "diamond" === u.type && (i = `${i}-${b(i, "in", t)}`), + { source: e, target: i, sourceId: r, targetId: c }) + : { source: e, target: i }; + })(t, w); + a.l.debug("abc78 source and target", j, E), + e.edges.push({ + id: "e" + t.start + t.end, + sources: [j], + targets: [E], + sourceId: T, + targetId: M, + labelEl: k, + labels: [ + { + width: v.width, + height: v.height, + orgWidth: v.width, + orgHeight: v.height, + text: v.label, + layoutOptions: { + "edgeLabels.inline": "true", + "edgeLabels.placement": "CENTER", + }, + }, + ], + edgeData: v, + }); + }), + e + ); + })(O, i, p, E)), + Object.keys(f).forEach((n) => { + const t = f[n]; + t.parent || p.children.push(t), + void 0 !== I.childrenById[n] && + ((t.labels = [ + { + text: t.labelText, + layoutOptions: { "nodeLabels.placement": "[H_CENTER, V_TOP, INSIDE]" }, + width: t.labelData.width, + height: t.labelData.height, + }, + ]), + delete t.x, + delete t.y, + delete t.width, + delete t.height); + }), + d(p.children, I), + a.l.info("after layout", JSON.stringify(p, null, 2)); + const A = await o.layout(p); + g(0, 0, A.children, E, P, i, 0), + a.l.info("after layout", A), + null == (u = A.edges) || + u.map((n) => { + w(C, n, n.edgeData, i, I); + }), + (0, a.p)({}, E, m.diagramPadding, m.useMaxWidth), + l.remove(); + }, + }, + v = { + db: i.d, + renderer: p, + parser: i.p, + styles: (n) => + `.label {\n font-family: ${n.fontFamily};\n color: ${n.nodeTextColor || n.textColor};\n }\n .cluster-label text {\n fill: ${n.titleColor};\n }\n .cluster-label span {\n color: ${n.titleColor};\n }\n\n .label text,span {\n fill: ${n.nodeTextColor || n.textColor};\n color: ${n.nodeTextColor || n.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${n.mainBkg};\n stroke: ${n.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${n.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${n.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${n.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${n.edgeLabelBackground};\n rect {\n opacity: 0.85;\n background-color: ${n.edgeLabelBackground};\n fill: ${n.edgeLabelBackground};\n }\n text-align: center;\n }\n\n .cluster rect {\n fill: ${n.clusterBkg};\n stroke: ${n.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${n.titleColor};\n }\n\n .cluster span {\n color: ${n.titleColor};\n }\n /* .cluster div {\n color: ${n.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${n.fontFamily};\n font-size: 12px;\n background: ${n.tertiaryColor};\n border: 1px solid ${n.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${n.textColor};\n }\n .subgraph {\n stroke-width:2;\n rx:3;\n }\n // .subgraph-lvl-1 {\n // fill:#ccc;\n // // stroke:black;\n // }\n\n .flowchart-label text {\n text-anchor: middle;\n }\n\n ${(( + n, + ) => { + let t = ""; + for (let e = 0; e < 5; e++) + t += `\n .subgraph-lvl-${e} {\n fill: ${n[`surface${e}`]};\n stroke: ${n[`surfacePeer${e}`]};\n }\n `; + return t; + })(n)}\n`, + }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/642-12e7dea2.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/642-12e7dea2.chunk.min.js new file mode 100644 index 000000000..74f75dc98 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/642-12e7dea2.chunk.min.js @@ -0,0 +1,458 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [642], + { + 7642: function (t, e, a) { + a.d(e, { + diagram: function () { + return f; + }, + }); + var i = a(1535), + n = a(7274), + d = a(3771), + r = a(5625), + s = a(9339); + a(7484), a(7967), a(7856); + const o = {}, + c = (t, e, a) => { + const i = (0, s.c)().state.padding, + n = 2 * (0, s.c)().state.padding, + d = t.node().getBBox(), + r = d.width, + o = d.x, + c = t + .append("text") + .attr("x", 0) + .attr("y", (0, s.c)().state.titleShift) + .attr("font-size", (0, s.c)().state.fontSize) + .attr("class", "state-title") + .text(e.id), + g = c.node().getBBox().width + n; + let p, + h = Math.max(g, r); + h === r && (h += n); + const l = t.node().getBBox(); + e.doc, (p = o - i), g > r && (p = (r - h) / 2 + i), Math.abs(o - l.x) < i && g > r && (p = o - (g - r) / 2); + const x = 1 - (0, s.c)().state.textHeight; + return ( + t + .insert("rect", ":first-child") + .attr("x", p) + .attr("y", x) + .attr("class", a ? "alt-composit" : "composit") + .attr("width", h) + .attr("height", l.height + (0, s.c)().state.textHeight + (0, s.c)().state.titleShift + 1) + .attr("rx", "0"), + c.attr("x", p + i), + g <= r && c.attr("x", o + (h - n) / 2 - g / 2 + i), + t + .insert("rect", ":first-child") + .attr("x", p) + .attr("y", (0, s.c)().state.titleShift - (0, s.c)().state.textHeight - (0, s.c)().state.padding) + .attr("width", h) + .attr("height", 3 * (0, s.c)().state.textHeight) + .attr("rx", (0, s.c)().state.radius), + t + .insert("rect", ":first-child") + .attr("x", p) + .attr("y", (0, s.c)().state.titleShift - (0, s.c)().state.textHeight - (0, s.c)().state.padding) + .attr("width", h) + .attr("height", l.height + 3 + 2 * (0, s.c)().state.textHeight) + .attr("rx", (0, s.c)().state.radius), + t + ); + }, + g = function (t, e) { + const a = e.id, + i = { id: a, label: e.id, width: 0, height: 0 }, + n = t.append("g").attr("id", a).attr("class", "stateGroup"); + "start" === e.type && + ((t) => { + t.append("circle") + .attr("class", "start-state") + .attr("r", (0, s.c)().state.sizeUnit) + .attr("cx", (0, s.c)().state.padding + (0, s.c)().state.sizeUnit) + .attr("cy", (0, s.c)().state.padding + (0, s.c)().state.sizeUnit); + })(n), + "end" === e.type && + ((t) => { + t + .append("circle") + .attr("class", "end-state-outer") + .attr("r", (0, s.c)().state.sizeUnit + (0, s.c)().state.miniPadding) + .attr("cx", (0, s.c)().state.padding + (0, s.c)().state.sizeUnit + (0, s.c)().state.miniPadding) + .attr("cy", (0, s.c)().state.padding + (0, s.c)().state.sizeUnit + (0, s.c)().state.miniPadding), + t + .append("circle") + .attr("class", "end-state-inner") + .attr("r", (0, s.c)().state.sizeUnit) + .attr("cx", (0, s.c)().state.padding + (0, s.c)().state.sizeUnit + 2) + .attr("cy", (0, s.c)().state.padding + (0, s.c)().state.sizeUnit + 2); + })(n), + ("fork" !== e.type && "join" !== e.type) || + ((t, e) => { + let a = (0, s.c)().state.forkWidth, + i = (0, s.c)().state.forkHeight; + if (e.parentId) { + let t = a; + (a = i), (i = t); + } + t.append("rect") + .style("stroke", "black") + .style("fill", "black") + .attr("width", a) + .attr("height", i) + .attr("x", (0, s.c)().state.padding) + .attr("y", (0, s.c)().state.padding); + })(n, e), + "note" === e.type && + ((t, e) => { + e.attr("class", "state-note"); + const a = e + .append("rect") + .attr("x", 0) + .attr("y", (0, s.c)().state.padding), + i = e.append("g"), + { textWidth: n, textHeight: d } = ((t, e, a, i) => { + let n = 0; + const d = i.append("text"); + d.style("text-anchor", "start"), d.attr("class", "noteText"); + let r = t.replace(/\r\n/g, "
    "); + r = r.replace(/\n/g, "
    "); + const o = r.split(s.e.lineBreakRegex); + let c = 1.25 * (0, s.c)().state.noteMargin; + for (const t of o) { + const e = t.trim(); + if (e.length > 0) { + const t = d.append("tspan"); + t.text(e), + 0 === c && (c += t.node().getBBox().height), + (n += c), + t.attr("x", 0 + (0, s.c)().state.noteMargin), + t.attr("y", 0 + n + 1.25 * (0, s.c)().state.noteMargin); + } + } + return { textWidth: d.node().getBBox().width, textHeight: n }; + })(t, 0, 0, i); + a.attr("height", d + 2 * (0, s.c)().state.noteMargin), a.attr("width", n + 2 * (0, s.c)().state.noteMargin); + })(e.note.text, n), + "divider" === e.type && + ((t) => { + t.append("line") + .style("stroke", "grey") + .style("stroke-dasharray", "3") + .attr("x1", (0, s.c)().state.textHeight) + .attr("class", "divider") + .attr("x2", 2 * (0, s.c)().state.textHeight) + .attr("y1", 0) + .attr("y2", 0); + })(n), + "default" === e.type && + 0 === e.descriptions.length && + ((t, e) => { + const a = t + .append("text") + .attr("x", 2 * (0, s.c)().state.padding) + .attr("y", (0, s.c)().state.textHeight + 2 * (0, s.c)().state.padding) + .attr("font-size", (0, s.c)().state.fontSize) + .attr("class", "state-title") + .text(e.id) + .node() + .getBBox(); + t.insert("rect", ":first-child") + .attr("x", (0, s.c)().state.padding) + .attr("y", (0, s.c)().state.padding) + .attr("width", a.width + 2 * (0, s.c)().state.padding) + .attr("height", a.height + 2 * (0, s.c)().state.padding) + .attr("rx", (0, s.c)().state.radius); + })(n, e), + "default" === e.type && + e.descriptions.length > 0 && + ((t, e) => { + const a = t + .append("text") + .attr("x", 2 * (0, s.c)().state.padding) + .attr("y", (0, s.c)().state.textHeight + 1.3 * (0, s.c)().state.padding) + .attr("font-size", (0, s.c)().state.fontSize) + .attr("class", "state-title") + .text(e.descriptions[0]) + .node() + .getBBox(), + i = a.height, + n = t + .append("text") + .attr("x", (0, s.c)().state.padding) + .attr("y", i + 0.4 * (0, s.c)().state.padding + (0, s.c)().state.dividerMargin + (0, s.c)().state.textHeight) + .attr("class", "state-description"); + let d = !0, + r = !0; + e.descriptions.forEach(function (t) { + d || + ((function (t, e, a) { + const i = t + .append("tspan") + .attr("x", 2 * (0, s.c)().state.padding) + .text(e); + a || i.attr("dy", (0, s.c)().state.textHeight); + })(n, t, r), + (r = !1)), + (d = !1); + }); + const o = t + .append("line") + .attr("x1", (0, s.c)().state.padding) + .attr("y1", (0, s.c)().state.padding + i + (0, s.c)().state.dividerMargin / 2) + .attr("y2", (0, s.c)().state.padding + i + (0, s.c)().state.dividerMargin / 2) + .attr("class", "descr-divider"), + c = n.node().getBBox(), + g = Math.max(c.width, a.width); + o.attr("x2", g + 3 * (0, s.c)().state.padding), + t + .insert("rect", ":first-child") + .attr("x", (0, s.c)().state.padding) + .attr("y", (0, s.c)().state.padding) + .attr("width", g + 2 * (0, s.c)().state.padding) + .attr("height", c.height + i + 2 * (0, s.c)().state.padding) + .attr("rx", (0, s.c)().state.radius); + })(n, e); + const d = n.node().getBBox(); + return (i.width = d.width + 2 * (0, s.c)().state.padding), (i.height = d.height + 2 * (0, s.c)().state.padding), (r = i), (o[a] = r), i; + var r; + }; + let p, + h = 0; + const l = {}, + x = (t, e, a, o, u, f, y) => { + const w = new r.k({ compound: !0, multigraph: !0 }); + let b, + B = !0; + for (b = 0; b < t.length; b++) + if ("relation" === t[b].stmt) { + B = !1; + break; + } + a + ? w.setGraph({ + rankdir: "LR", + multigraph: !0, + compound: !0, + ranker: "tight-tree", + ranksep: B ? 1 : p.edgeLengthFactor, + nodeSep: B ? 1 : 50, + isMultiGraph: !0, + }) + : w.setGraph({ + rankdir: "TB", + multigraph: !0, + compound: !0, + ranksep: B ? 1 : p.edgeLengthFactor, + nodeSep: B ? 1 : 50, + ranker: "tight-tree", + isMultiGraph: !0, + }), + w.setDefaultEdgeLabel(function () { + return {}; + }), + y.db.extract(t); + const m = y.db.getStates(), + k = y.db.getRelations(), + N = Object.keys(m); + for (const t of N) { + const i = m[t]; + let n; + if ((a && (i.parentId = a), i.doc)) { + let t = e.append("g").attr("id", i.id).attr("class", "stateGroup"); + n = x(i.doc, t, i.id, !o, u, f, y); + { + t = c(t, i, o); + let e = t.node().getBBox(); + (n.width = e.width), (n.height = e.height + p.padding / 2), (l[i.id] = { y: p.compositTitleSize }); + } + } else n = g(e, i); + if (i.note) { + const t = { descriptions: [], id: i.id + "-note", note: i.note, type: "note" }, + a = g(e, t); + "left of" === i.note.position ? (w.setNode(n.id + "-note", a), w.setNode(n.id, n)) : (w.setNode(n.id, n), w.setNode(n.id + "-note", a)), + w.setParent(n.id, n.id + "-group"), + w.setParent(n.id + "-note", n.id + "-group"); + } else w.setNode(n.id, n); + } + s.l.debug("Count=", w.nodeCount(), w); + let E = 0; + k.forEach(function (t) { + var e; + E++, + s.l.debug("Setting edge", t), + w.setEdge( + t.id1, + t.id2, + { + relation: t, + width: ((e = t.title), e ? e.length * p.fontSizeFactor : 1), + height: p.labelHeight * s.e.getRows(t.title).length, + labelpos: "c", + }, + "id" + E, + ); + }), + (0, d.bK)(w), + s.l.debug("Graph after layout", w.nodes()); + const v = e.node(); + w.nodes().forEach(function (t) { + void 0 !== t && void 0 !== w.node(t) + ? (s.l.warn("Node " + t + ": " + JSON.stringify(w.node(t))), + u + .select("#" + v.id + " #" + t) + .attr( + "transform", + "translate(" + (w.node(t).x - w.node(t).width / 2) + "," + (w.node(t).y + (l[t] ? l[t].y : 0) - w.node(t).height / 2) + " )", + ), + u.select("#" + v.id + " #" + t).attr("data-x-shift", w.node(t).x - w.node(t).width / 2), + f.querySelectorAll("#" + v.id + " #" + t + " .divider").forEach((t) => { + const e = t.parentElement; + let a = 0, + i = 0; + e && + (e.parentElement && (a = e.parentElement.getBBox().width), + (i = parseInt(e.getAttribute("data-x-shift"), 10)), + Number.isNaN(i) && (i = 0)), + t.setAttribute("x1", 0 - i + 8), + t.setAttribute("x2", a - i - 8); + })) + : s.l.debug("No Node " + t + ": " + JSON.stringify(w.node(t))); + }); + let M = v.getBBox(); + w.edges().forEach(function (t) { + void 0 !== t && + void 0 !== w.edge(t) && + (s.l.debug("Edge " + t.v + " -> " + t.w + ": " + JSON.stringify(w.edge(t))), + (function (t, e, a) { + e.points = e.points.filter((t) => !Number.isNaN(t.y)); + const d = e.points, + r = (0, n.jvg)() + .x(function (t) { + return t.x; + }) + .y(function (t) { + return t.y; + }) + .curve(n.$0Z), + o = t + .append("path") + .attr("d", r(d)) + .attr("id", "edge" + h) + .attr("class", "transition"); + let c = ""; + if ( + ((0, s.c)().state.arrowMarkerAbsolute && + ((c = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search), + (c = c.replace(/\(/g, "\\(")), + (c = c.replace(/\)/g, "\\)"))), + o.attr( + "marker-end", + "url(" + + c + + "#" + + (function (t) { + switch (t) { + case i.d.relationType.AGGREGATION: + return "aggregation"; + case i.d.relationType.EXTENSION: + return "extension"; + case i.d.relationType.COMPOSITION: + return "composition"; + case i.d.relationType.DEPENDENCY: + return "dependency"; + } + })(i.d.relationType.DEPENDENCY) + + "End)", + ), + void 0 !== a.title) + ) { + const i = t.append("g").attr("class", "stateLabel"), + { x: n, y: d } = s.u.calcLabelPosition(e.points), + r = s.e.getRows(a.title); + let o = 0; + const c = []; + let g = 0, + p = 0; + for (let t = 0; t <= r.length; t++) { + const e = i + .append("text") + .attr("text-anchor", "middle") + .text(r[t]) + .attr("x", n) + .attr("y", d + o), + a = e.node().getBBox(); + if (((g = Math.max(g, a.width)), (p = Math.min(p, a.x)), s.l.info(a.x, n, d + o), 0 === o)) { + const t = e.node().getBBox(); + (o = t.height), s.l.info("Title height", o, d); + } + c.push(e); + } + let h = o * r.length; + if (r.length > 1) { + const t = (r.length - 1) * o * 0.5; + c.forEach((e, a) => e.attr("y", d + a * o - t)), (h = o * r.length); + } + const l = i.node().getBBox(); + i + .insert("rect", ":first-child") + .attr("class", "box") + .attr("x", n - g / 2 - (0, s.c)().state.padding / 2) + .attr("y", d - h / 2 - (0, s.c)().state.padding / 2 - 3.5) + .attr("width", g + (0, s.c)().state.padding) + .attr("height", h + (0, s.c)().state.padding), + s.l.info(l); + } + h++; + })(e, w.edge(t), w.edge(t).relation)); + }), + (M = v.getBBox()); + const S = { id: a || "root", label: a || "root", width: 0, height: 0 }; + return (S.width = M.width + 2 * p.padding), (S.height = M.height + 2 * p.padding), s.l.debug("Doc rendered", S, w), S; + }, + u = { + setConf: function () {}, + draw: function (t, e, a, i) { + p = (0, s.c)().state; + const d = (0, s.c)().securityLevel; + let r; + "sandbox" === d && (r = (0, n.Ys)("#i" + e)); + const o = "sandbox" === d ? (0, n.Ys)(r.nodes()[0].contentDocument.body) : (0, n.Ys)("body"), + c = "sandbox" === d ? r.nodes()[0].contentDocument : document; + s.l.debug("Rendering diagram " + t); + const g = o.select(`[id='${e}']`); + g.append("defs") + .append("marker") + .attr("id", "dependencyEnd") + .attr("refX", 19) + .attr("refY", 7) + .attr("markerWidth", 20) + .attr("markerHeight", 28) + .attr("orient", "auto") + .append("path") + .attr("d", "M 19,7 L9,13 L14,7 L9,1 Z"); + const h = i.db.getRootDoc(); + x(h, g, void 0, !1, o, c, i); + const l = p.padding, + u = g.node().getBBox(), + f = u.width + 2 * l, + y = u.height + 2 * l, + w = 1.75 * f; + (0, s.i)(g, y, w, p.useMaxWidth), g.attr("viewBox", `${u.x - p.padding} ${u.y - p.padding} ` + f + " " + y); + }, + }, + f = { + parser: i.p, + db: i.d, + renderer: u, + styles: i.s, + init: (t) => { + t.state || (t.state = {}), (t.state.arrowMarkerAbsolute = t.arrowMarkerAbsolute), i.d.clear(); + }, + }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/662-17acb8f4.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/662-17acb8f4.chunk.min.js new file mode 100644 index 000000000..d0cc794a6 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/662-17acb8f4.chunk.min.js @@ -0,0 +1,21856 @@ +/*! For license information please see 662-17acb8f4.chunk.min.js.LICENSE.txt */ +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [662], + { + 4182: function (e, t, n) { + var r; + (r = function (e) { + return (function (e) { + var t = {}; + function n(r) { + if (t[r]) return t[r].exports; + var i = (t[r] = { i: r, l: !1, exports: {} }); + return e[r].call(i.exports, i, i.exports, n), (i.l = !0), i.exports; + } + return ( + (n.m = e), + (n.c = t), + (n.i = function (e) { + return e; + }), + (n.d = function (e, t, r) { + n.o(e, t) || Object.defineProperty(e, t, { configurable: !1, enumerable: !0, get: r }); + }), + (n.n = function (e) { + var t = + e && e.__esModule + ? function () { + return e.default; + } + : function () { + return e; + }; + return n.d(t, "a", t), t; + }), + (n.o = function (e, t) { + return Object.prototype.hasOwnProperty.call(e, t); + }), + (n.p = ""), + n((n.s = 7)) + ); + })([ + function (t, n) { + t.exports = e; + }, + function (e, t, n) { + "use strict"; + var r = n(0).FDLayoutConstants; + function i() {} + for (var a in r) i[a] = r[a]; + (i.DEFAULT_USE_MULTI_LEVEL_SCALING = !1), + (i.DEFAULT_RADIAL_SEPARATION = r.DEFAULT_EDGE_LENGTH), + (i.DEFAULT_COMPONENT_SEPERATION = 60), + (i.TILE = !0), + (i.TILING_PADDING_VERTICAL = 10), + (i.TILING_PADDING_HORIZONTAL = 10), + (i.TREE_REDUCTION_ON_INCREMENTAL = !1), + (e.exports = i); + }, + function (e, t, n) { + "use strict"; + var r = n(0).FDLayoutEdge; + function i(e, t, n) { + r.call(this, e, t, n); + } + for (var a in ((i.prototype = Object.create(r.prototype)), r)) i[a] = r[a]; + e.exports = i; + }, + function (e, t, n) { + "use strict"; + var r = n(0).LGraph; + function i(e, t, n) { + r.call(this, e, t, n); + } + for (var a in ((i.prototype = Object.create(r.prototype)), r)) i[a] = r[a]; + e.exports = i; + }, + function (e, t, n) { + "use strict"; + var r = n(0).LGraphManager; + function i(e) { + r.call(this, e); + } + for (var a in ((i.prototype = Object.create(r.prototype)), r)) i[a] = r[a]; + e.exports = i; + }, + function (e, t, n) { + "use strict"; + var r = n(0).FDLayoutNode, + i = n(0).IMath; + function a(e, t, n, i) { + r.call(this, e, t, n, i); + } + for (var o in ((a.prototype = Object.create(r.prototype)), r)) a[o] = r[o]; + (a.prototype.move = function () { + var e = this.graphManager.getLayout(); + (this.displacementX = (e.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX)) / this.noOfChildren), + (this.displacementY = (e.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY)) / this.noOfChildren), + Math.abs(this.displacementX) > e.coolingFactor * e.maxNodeDisplacement && + (this.displacementX = e.coolingFactor * e.maxNodeDisplacement * i.sign(this.displacementX)), + Math.abs(this.displacementY) > e.coolingFactor * e.maxNodeDisplacement && + (this.displacementY = e.coolingFactor * e.maxNodeDisplacement * i.sign(this.displacementY)), + null == this.child || 0 == this.child.getNodes().length + ? this.moveBy(this.displacementX, this.displacementY) + : this.propogateDisplacementToChildren(this.displacementX, this.displacementY), + (e.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY)), + (this.springForceX = 0), + (this.springForceY = 0), + (this.repulsionForceX = 0), + (this.repulsionForceY = 0), + (this.gravitationForceX = 0), + (this.gravitationForceY = 0), + (this.displacementX = 0), + (this.displacementY = 0); + }), + (a.prototype.propogateDisplacementToChildren = function (e, t) { + for (var n, r = this.getChild().getNodes(), i = 0; i < r.length; i++) + null == (n = r[i]).getChild() + ? (n.moveBy(e, t), (n.displacementX += e), (n.displacementY += t)) + : n.propogateDisplacementToChildren(e, t); + }), + (a.prototype.setPred1 = function (e) { + this.pred1 = e; + }), + (a.prototype.getPred1 = function () { + return pred1; + }), + (a.prototype.getPred2 = function () { + return pred2; + }), + (a.prototype.setNext = function (e) { + this.next = e; + }), + (a.prototype.getNext = function () { + return next; + }), + (a.prototype.setProcessed = function (e) { + this.processed = e; + }), + (a.prototype.isProcessed = function () { + return processed; + }), + (e.exports = a); + }, + function (e, t, n) { + "use strict"; + var r = n(0).FDLayout, + i = n(4), + a = n(3), + o = n(5), + s = n(2), + l = n(1), + u = n(0).FDLayoutConstants, + c = n(0).LayoutConstants, + h = n(0).Point, + d = n(0).PointD, + p = n(0).Layout, + g = n(0).Integer, + f = n(0).IGeometry, + v = n(0).LGraph, + y = n(0).Transform; + function m() { + r.call(this), (this.toBeTiled = {}); + } + for (var b in ((m.prototype = Object.create(r.prototype)), r)) m[b] = r[b]; + (m.prototype.newGraphManager = function () { + var e = new i(this); + return (this.graphManager = e), e; + }), + (m.prototype.newGraph = function (e) { + return new a(null, this.graphManager, e); + }), + (m.prototype.newNode = function (e) { + return new o(this.graphManager, e); + }), + (m.prototype.newEdge = function (e) { + return new s(null, null, e); + }), + (m.prototype.initParameters = function () { + r.prototype.initParameters.call(this, arguments), + this.isSubLayout || + (l.DEFAULT_EDGE_LENGTH < 10 ? (this.idealEdgeLength = 10) : (this.idealEdgeLength = l.DEFAULT_EDGE_LENGTH), + (this.useSmartIdealEdgeLengthCalculation = l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION), + (this.springConstant = u.DEFAULT_SPRING_STRENGTH), + (this.repulsionConstant = u.DEFAULT_REPULSION_STRENGTH), + (this.gravityConstant = u.DEFAULT_GRAVITY_STRENGTH), + (this.compoundGravityConstant = u.DEFAULT_COMPOUND_GRAVITY_STRENGTH), + (this.gravityRangeFactor = u.DEFAULT_GRAVITY_RANGE_FACTOR), + (this.compoundGravityRangeFactor = u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR), + (this.prunedNodesAll = []), + (this.growTreeIterations = 0), + (this.afterGrowthIterations = 0), + (this.isTreeGrowing = !1), + (this.isGrowthFinished = !1), + (this.coolingCycle = 0), + (this.maxCoolingCycle = this.maxIterations / u.CONVERGENCE_CHECK_PERIOD), + (this.finalTemperature = u.CONVERGENCE_CHECK_PERIOD / this.maxIterations), + (this.coolingAdjuster = 1)); + }), + (m.prototype.layout = function () { + return ( + c.DEFAULT_CREATE_BENDS_AS_NEEDED && (this.createBendpoints(), this.graphManager.resetAllEdges()), + (this.level = 0), + this.classicLayout() + ); + }), + (m.prototype.classicLayout = function () { + if ( + ((this.nodesWithGravity = this.calculateNodesToApplyGravitationTo()), + this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity), + this.calcNoOfChildrenForAllNodes(), + this.graphManager.calcLowestCommonAncestors(), + this.graphManager.calcInclusionTreeDepths(), + this.graphManager.getRoot().calcEstimatedSize(), + this.calcIdealEdgeLengths(), + this.incremental) + ) + l.TREE_REDUCTION_ON_INCREMENTAL && + (this.reduceTrees(), + this.graphManager.resetAllNodesToApplyGravitation(), + (t = new Set(this.getAllNodes())), + (n = this.nodesWithGravity.filter(function (e) { + return t.has(e); + })), + this.graphManager.setAllNodesToApplyGravitation(n)); + else { + var e = this.getFlatForest(); + if (e.length > 0) this.positionNodesRadially(e); + else { + this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation(); + var t = new Set(this.getAllNodes()), + n = this.nodesWithGravity.filter(function (e) { + return t.has(e); + }); + this.graphManager.setAllNodesToApplyGravitation(n), this.positionNodesRandomly(); + } + } + return this.initSpringEmbedder(), this.runSpringEmbedder(), !0; + }), + (m.prototype.tick = function () { + if ((this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished)) { + if (!(this.prunedNodesAll.length > 0)) return !0; + this.isTreeGrowing = !0; + } + if (this.totalIterations % u.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) { + if (this.isConverged()) { + if (!(this.prunedNodesAll.length > 0)) return !0; + this.isTreeGrowing = !0; + } + this.coolingCycle++, + 0 == this.layoutQuality + ? (this.coolingAdjuster = this.coolingCycle) + : 1 == this.layoutQuality && (this.coolingAdjuster = this.coolingCycle / 3), + (this.coolingFactor = Math.max( + this.initialCoolingFactor - + (Math.pow( + this.coolingCycle, + Math.log(100 * (this.initialCoolingFactor - this.finalTemperature)) / Math.log(this.maxCoolingCycle), + ) / + 100) * + this.coolingAdjuster, + this.finalTemperature, + )), + (this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor))); + } + if (this.isTreeGrowing) { + if (this.growTreeIterations % 10 == 0) + if (this.prunedNodesAll.length > 0) { + this.graphManager.updateBounds(), + this.updateGrid(), + this.growTree(this.prunedNodesAll), + this.graphManager.resetAllNodesToApplyGravitation(); + var e = new Set(this.getAllNodes()), + t = this.nodesWithGravity.filter(function (t) { + return e.has(t); + }); + this.graphManager.setAllNodesToApplyGravitation(t), + this.graphManager.updateBounds(), + this.updateGrid(), + (this.coolingFactor = u.DEFAULT_COOLING_FACTOR_INCREMENTAL); + } else (this.isTreeGrowing = !1), (this.isGrowthFinished = !0); + this.growTreeIterations++; + } + if (this.isGrowthFinished) { + if (this.isConverged()) return !0; + this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), + (this.coolingFactor = u.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100)), + this.afterGrowthIterations++; + } + var n = !this.isTreeGrowing && !this.isGrowthFinished, + r = (this.growTreeIterations % 10 == 1 && this.isTreeGrowing) || (this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished); + return ( + (this.totalDisplacement = 0), + this.graphManager.updateBounds(), + this.calcSpringForces(), + this.calcRepulsionForces(n, r), + this.calcGravitationalForces(), + this.moveNodes(), + this.animate(), + !1 + ); + }), + (m.prototype.getPositionsData = function () { + for (var e = this.graphManager.getAllNodes(), t = {}, n = 0; n < e.length; n++) { + var r = e[n].rect, + i = e[n].id; + t[i] = { id: i, x: r.getCenterX(), y: r.getCenterY(), w: r.width, h: r.height }; + } + return t; + }), + (m.prototype.runSpringEmbedder = function () { + (this.initialAnimationPeriod = 25), (this.animationPeriod = this.initialAnimationPeriod); + var e = !1; + if ("during" === u.ANIMATE) this.emit("layoutstarted"); + else { + for (; !e; ) e = this.tick(); + this.graphManager.updateBounds(); + } + }), + (m.prototype.calculateNodesToApplyGravitationTo = function () { + var e, + t, + n = [], + r = this.graphManager.getGraphs(), + i = r.length; + for (t = 0; t < i; t++) (e = r[t]).updateConnected(), e.isConnected || (n = n.concat(e.getNodes())); + return n; + }), + (m.prototype.createBendpoints = function () { + var e = []; + e = e.concat(this.graphManager.getAllEdges()); + var t, + n = new Set(); + for (t = 0; t < e.length; t++) { + var r = e[t]; + if (!n.has(r)) { + var i = r.getSource(), + a = r.getTarget(); + if (i == a) r.getBendpoints().push(new d()), r.getBendpoints().push(new d()), this.createDummyNodesForBendpoints(r), n.add(r); + else { + var o = []; + if (((o = (o = o.concat(i.getEdgeListToNode(a))).concat(a.getEdgeListToNode(i))), !n.has(o[0]))) { + var s; + if (o.length > 1) + for (s = 0; s < o.length; s++) { + var l = o[s]; + l.getBendpoints().push(new d()), this.createDummyNodesForBendpoints(l); + } + o.forEach(function (e) { + n.add(e); + }); + } + } + } + if (n.size == e.length) break; + } + }), + (m.prototype.positionNodesRadially = function (e) { + for (var t = new h(0, 0), n = Math.ceil(Math.sqrt(e.length)), r = 0, i = 0, a = 0, o = new d(0, 0), s = 0; s < e.length; s++) { + s % n == 0 && ((a = 0), (i = r), 0 != s && (i += l.DEFAULT_COMPONENT_SEPERATION), (r = 0)); + var u = e[s], + g = p.findCenterOfTree(u); + (t.x = a), + (t.y = i), + (o = m.radialLayout(u, g, t)).y > r && (r = Math.floor(o.y)), + (a = Math.floor(o.x + l.DEFAULT_COMPONENT_SEPERATION)); + } + this.transform(new d(c.WORLD_CENTER_X - o.x / 2, c.WORLD_CENTER_Y - o.y / 2)); + }), + (m.radialLayout = function (e, t, n) { + var r = Math.max(this.maxDiagonalInTree(e), l.DEFAULT_RADIAL_SEPARATION); + m.branchRadialLayout(t, null, 0, 359, 0, r); + var i = v.calculateBounds(e), + a = new y(); + a.setDeviceOrgX(i.getMinX()), a.setDeviceOrgY(i.getMinY()), a.setWorldOrgX(n.x), a.setWorldOrgY(n.y); + for (var o = 0; o < e.length; o++) e[o].transform(a); + var s = new d(i.getMaxX(), i.getMaxY()); + return a.inverseTransformPoint(s); + }), + (m.branchRadialLayout = function (e, t, n, r, i, a) { + var o = (r - n + 1) / 2; + o < 0 && (o += 180); + var s = (((o + n) % 360) * f.TWO_PI) / 360, + l = (Math.cos(s), i * Math.cos(s)), + u = i * Math.sin(s); + e.setCenter(l, u); + var c = [], + h = (c = c.concat(e.getEdges())).length; + null != t && h--; + for (var d, p = 0, g = c.length, v = e.getEdgesBetween(t); v.length > 1; ) { + var y = v[0]; + v.splice(0, 1); + var b = c.indexOf(y); + b >= 0 && c.splice(b, 1), g--, h--; + } + d = null != t ? (c.indexOf(v[0]) + 1) % g : 0; + for (var x = Math.abs(r - n) / h, w = d; p != h; w = ++w % g) { + var E = c[w].getOtherEnd(e); + if (E != t) { + var _ = (n + p * x) % 360, + T = (_ + x) % 360; + m.branchRadialLayout(E, e, _, T, i + a, a), p++; + } + } + }), + (m.maxDiagonalInTree = function (e) { + for (var t = g.MIN_VALUE, n = 0; n < e.length; n++) { + var r = e[n].getDiagonal(); + r > t && (t = r); + } + return t; + }), + (m.prototype.calcRepulsionRange = function () { + return 2 * (this.level + 1) * this.idealEdgeLength; + }), + (m.prototype.groupZeroDegreeMembers = function () { + var e = this, + t = {}; + (this.memberGroups = {}), (this.idToDummyNode = {}); + for (var n = [], r = this.graphManager.getAllNodes(), i = 0; i < r.length; i++) { + var a = (s = r[i]).getParent(); + 0 !== this.getNodeDegreeWithChildren(s) || (null != a.id && this.getToBeTiled(a)) || n.push(s); + } + for (i = 0; i < n.length; i++) { + var s, + l = (s = n[i]).getParent().id; + void 0 === t[l] && (t[l] = []), (t[l] = t[l].concat(s)); + } + Object.keys(t).forEach(function (n) { + if (t[n].length > 1) { + var r = "DummyCompound_" + n; + e.memberGroups[r] = t[n]; + var i = t[n][0].getParent(), + a = new o(e.graphManager); + (a.id = r), + (a.paddingLeft = i.paddingLeft || 0), + (a.paddingRight = i.paddingRight || 0), + (a.paddingBottom = i.paddingBottom || 0), + (a.paddingTop = i.paddingTop || 0), + (e.idToDummyNode[r] = a); + var s = e.getGraphManager().add(e.newGraph(), a), + l = i.getChild(); + l.add(a); + for (var u = 0; u < t[n].length; u++) { + var c = t[n][u]; + l.remove(c), s.add(c); + } + } + }); + }), + (m.prototype.clearCompounds = function () { + var e = {}, + t = {}; + this.performDFSOnCompounds(); + for (var n = 0; n < this.compoundOrder.length; n++) + (t[this.compoundOrder[n].id] = this.compoundOrder[n]), + (e[this.compoundOrder[n].id] = [].concat(this.compoundOrder[n].getChild().getNodes())), + this.graphManager.remove(this.compoundOrder[n].getChild()), + (this.compoundOrder[n].child = null); + this.graphManager.resetAllNodes(), this.tileCompoundMembers(e, t); + }), + (m.prototype.clearZeroDegreeMembers = function () { + var e = this, + t = (this.tiledZeroDegreePack = []); + Object.keys(this.memberGroups).forEach(function (n) { + var r = e.idToDummyNode[n]; + (t[n] = e.tileNodes(e.memberGroups[n], r.paddingLeft + r.paddingRight)), (r.rect.width = t[n].width), (r.rect.height = t[n].height); + }); + }), + (m.prototype.repopulateCompounds = function () { + for (var e = this.compoundOrder.length - 1; e >= 0; e--) { + var t = this.compoundOrder[e], + n = t.id, + r = t.paddingLeft, + i = t.paddingTop; + this.adjustLocations(this.tiledMemberPack[n], t.rect.x, t.rect.y, r, i); + } + }), + (m.prototype.repopulateZeroDegreeMembers = function () { + var e = this, + t = this.tiledZeroDegreePack; + Object.keys(t).forEach(function (n) { + var r = e.idToDummyNode[n], + i = r.paddingLeft, + a = r.paddingTop; + e.adjustLocations(t[n], r.rect.x, r.rect.y, i, a); + }); + }), + (m.prototype.getToBeTiled = function (e) { + var t = e.id; + if (null != this.toBeTiled[t]) return this.toBeTiled[t]; + var n = e.getChild(); + if (null == n) return (this.toBeTiled[t] = !1), !1; + for (var r = n.getNodes(), i = 0; i < r.length; i++) { + var a = r[i]; + if (this.getNodeDegree(a) > 0) return (this.toBeTiled[t] = !1), !1; + if (null != a.getChild()) { + if (!this.getToBeTiled(a)) return (this.toBeTiled[t] = !1), !1; + } else this.toBeTiled[a.id] = !1; + } + return (this.toBeTiled[t] = !0), !0; + }), + (m.prototype.getNodeDegree = function (e) { + e.id; + for (var t = e.getEdges(), n = 0, r = 0; r < t.length; r++) { + var i = t[r]; + i.getSource().id !== i.getTarget().id && (n += 1); + } + return n; + }), + (m.prototype.getNodeDegreeWithChildren = function (e) { + var t = this.getNodeDegree(e); + if (null == e.getChild()) return t; + for (var n = e.getChild().getNodes(), r = 0; r < n.length; r++) { + var i = n[r]; + t += this.getNodeDegreeWithChildren(i); + } + return t; + }), + (m.prototype.performDFSOnCompounds = function () { + (this.compoundOrder = []), this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes()); + }), + (m.prototype.fillCompexOrderByDFS = function (e) { + for (var t = 0; t < e.length; t++) { + var n = e[t]; + null != n.getChild() && this.fillCompexOrderByDFS(n.getChild().getNodes()), this.getToBeTiled(n) && this.compoundOrder.push(n); + } + }), + (m.prototype.adjustLocations = function (e, t, n, r, i) { + n += i; + for (var a = (t += r), o = 0; o < e.rows.length; o++) { + var s = e.rows[o]; + t = a; + for (var l = 0, u = 0; u < s.length; u++) { + var c = s[u]; + (c.rect.x = t), (c.rect.y = n), (t += c.rect.width + e.horizontalPadding), c.rect.height > l && (l = c.rect.height); + } + n += l + e.verticalPadding; + } + }), + (m.prototype.tileCompoundMembers = function (e, t) { + var n = this; + (this.tiledMemberPack = []), + Object.keys(e).forEach(function (r) { + var i = t[r]; + (n.tiledMemberPack[r] = n.tileNodes(e[r], i.paddingLeft + i.paddingRight)), + (i.rect.width = n.tiledMemberPack[r].width), + (i.rect.height = n.tiledMemberPack[r].height); + }); + }), + (m.prototype.tileNodes = function (e, t) { + var n = { + rows: [], + rowWidth: [], + rowHeight: [], + width: 0, + height: t, + verticalPadding: l.TILING_PADDING_VERTICAL, + horizontalPadding: l.TILING_PADDING_HORIZONTAL, + }; + e.sort(function (e, t) { + return e.rect.width * e.rect.height > t.rect.width * t.rect.height + ? -1 + : e.rect.width * e.rect.height < t.rect.width * t.rect.height + ? 1 + : 0; + }); + for (var r = 0; r < e.length; r++) { + var i = e[r]; + 0 == n.rows.length + ? this.insertNodeToRow(n, i, 0, t) + : this.canAddHorizontal(n, i.rect.width, i.rect.height) + ? this.insertNodeToRow(n, i, this.getShortestRowIndex(n), t) + : this.insertNodeToRow(n, i, n.rows.length, t), + this.shiftToLastRow(n); + } + return n; + }), + (m.prototype.insertNodeToRow = function (e, t, n, r) { + var i = r; + n == e.rows.length && (e.rows.push([]), e.rowWidth.push(i), e.rowHeight.push(0)); + var a = e.rowWidth[n] + t.rect.width; + e.rows[n].length > 0 && (a += e.horizontalPadding), (e.rowWidth[n] = a), e.width < a && (e.width = a); + var o = t.rect.height; + n > 0 && (o += e.verticalPadding); + var s = 0; + o > e.rowHeight[n] && ((s = e.rowHeight[n]), (e.rowHeight[n] = o), (s = e.rowHeight[n] - s)), (e.height += s), e.rows[n].push(t); + }), + (m.prototype.getShortestRowIndex = function (e) { + for (var t = -1, n = Number.MAX_VALUE, r = 0; r < e.rows.length; r++) e.rowWidth[r] < n && ((t = r), (n = e.rowWidth[r])); + return t; + }), + (m.prototype.getLongestRowIndex = function (e) { + for (var t = -1, n = Number.MIN_VALUE, r = 0; r < e.rows.length; r++) e.rowWidth[r] > n && ((t = r), (n = e.rowWidth[r])); + return t; + }), + (m.prototype.canAddHorizontal = function (e, t, n) { + var r = this.getShortestRowIndex(e); + if (r < 0) return !0; + var i = e.rowWidth[r]; + if (i + e.horizontalPadding + t <= e.width) return !0; + var a, + o, + s = 0; + return ( + e.rowHeight[r] < n && r > 0 && (s = n + e.verticalPadding - e.rowHeight[r]), + (a = e.width - i >= t + e.horizontalPadding ? (e.height + s) / (i + t + e.horizontalPadding) : (e.height + s) / e.width), + (s = n + e.verticalPadding), + (o = e.width < t ? (e.height + s) / t : (e.height + s) / e.width) < 1 && (o = 1 / o), + a < 1 && (a = 1 / a), + a < o + ); + }), + (m.prototype.shiftToLastRow = function (e) { + var t = this.getLongestRowIndex(e), + n = e.rowWidth.length - 1, + r = e.rows[t], + i = r[r.length - 1], + a = i.width + e.horizontalPadding; + if (e.width - e.rowWidth[n] > a && t != n) { + r.splice(-1, 1), + e.rows[n].push(i), + (e.rowWidth[t] = e.rowWidth[t] - a), + (e.rowWidth[n] = e.rowWidth[n] + a), + (e.width = e.rowWidth[instance.getLongestRowIndex(e)]); + for (var o = Number.MIN_VALUE, s = 0; s < r.length; s++) r[s].height > o && (o = r[s].height); + t > 0 && (o += e.verticalPadding); + var l = e.rowHeight[t] + e.rowHeight[n]; + (e.rowHeight[t] = o), e.rowHeight[n] < i.height + e.verticalPadding && (e.rowHeight[n] = i.height + e.verticalPadding); + var u = e.rowHeight[t] + e.rowHeight[n]; + (e.height += u - l), this.shiftToLastRow(e); + } + }), + (m.prototype.tilingPreLayout = function () { + l.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers()); + }), + (m.prototype.tilingPostLayout = function () { + l.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds()); + }), + (m.prototype.reduceTrees = function () { + for (var e, t = [], n = !0; n; ) { + var r = this.graphManager.getAllNodes(), + i = []; + n = !1; + for (var a = 0; a < r.length; a++) + 1 != (e = r[a]).getEdges().length || + e.getEdges()[0].isInterGraph || + null != e.getChild() || + (i.push([e, e.getEdges()[0], e.getOwner()]), (n = !0)); + if (1 == n) { + for (var o = [], s = 0; s < i.length; s++) 1 == i[s][0].getEdges().length && (o.push(i[s]), i[s][0].getOwner().remove(i[s][0])); + t.push(o), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges(); + } + } + this.prunedNodesAll = t; + }), + (m.prototype.growTree = function (e) { + for (var t, n = e[e.length - 1], r = 0; r < n.length; r++) + (t = n[r]), this.findPlaceforPrunedNode(t), t[2].add(t[0]), t[2].add(t[1], t[1].source, t[1].target); + e.splice(e.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges(); + }), + (m.prototype.findPlaceforPrunedNode = function (e) { + var t, + n, + r = e[0], + i = (n = r == e[1].source ? e[1].target : e[1].source).startX, + a = n.finishX, + o = n.startY, + s = n.finishY, + l = [0, 0, 0, 0]; + if (o > 0) for (var c = i; c <= a; c++) l[0] += this.grid[c][o - 1].length + this.grid[c][o].length - 1; + if (a < this.grid.length - 1) for (c = o; c <= s; c++) l[1] += this.grid[a + 1][c].length + this.grid[a][c].length - 1; + if (s < this.grid[0].length - 1) for (c = i; c <= a; c++) l[2] += this.grid[c][s + 1].length + this.grid[c][s].length - 1; + if (i > 0) for (c = o; c <= s; c++) l[3] += this.grid[i - 1][c].length + this.grid[i][c].length - 1; + for (var h, d, p = g.MAX_VALUE, f = 0; f < l.length; f++) l[f] < p ? ((p = l[f]), (h = 1), (d = f)) : l[f] == p && h++; + if (3 == h && 0 == p) + 0 == l[0] && 0 == l[1] && 0 == l[2] + ? (t = 1) + : 0 == l[0] && 0 == l[1] && 0 == l[3] + ? (t = 0) + : 0 == l[0] && 0 == l[2] && 0 == l[3] + ? (t = 3) + : 0 == l[1] && 0 == l[2] && 0 == l[3] && (t = 2); + else if (2 == h && 0 == p) { + var v = Math.floor(2 * Math.random()); + t = + 0 == l[0] && 0 == l[1] + ? 0 == v + ? 0 + : 1 + : 0 == l[0] && 0 == l[2] + ? 0 == v + ? 0 + : 2 + : 0 == l[0] && 0 == l[3] + ? 0 == v + ? 0 + : 3 + : 0 == l[1] && 0 == l[2] + ? 0 == v + ? 1 + : 2 + : 0 == l[1] && 0 == l[3] + ? 0 == v + ? 1 + : 3 + : 0 == v + ? 2 + : 3; + } else t = 4 == h && 0 == p ? (v = Math.floor(4 * Math.random())) : d; + 0 == t + ? r.setCenter(n.getCenterX(), n.getCenterY() - n.getHeight() / 2 - u.DEFAULT_EDGE_LENGTH - r.getHeight() / 2) + : 1 == t + ? r.setCenter(n.getCenterX() + n.getWidth() / 2 + u.DEFAULT_EDGE_LENGTH + r.getWidth() / 2, n.getCenterY()) + : 2 == t + ? r.setCenter(n.getCenterX(), n.getCenterY() + n.getHeight() / 2 + u.DEFAULT_EDGE_LENGTH + r.getHeight() / 2) + : r.setCenter(n.getCenterX() - n.getWidth() / 2 - u.DEFAULT_EDGE_LENGTH - r.getWidth() / 2, n.getCenterY()); + }), + (e.exports = m); + }, + function (e, t, n) { + "use strict"; + var r = {}; + (r.layoutBase = n(0)), + (r.CoSEConstants = n(1)), + (r.CoSEEdge = n(2)), + (r.CoSEGraph = n(3)), + (r.CoSEGraphManager = n(4)), + (r.CoSELayout = n(6)), + (r.CoSENode = n(5)), + (e.exports = r); + }, + ]); + }), + (e.exports = r(n(2241))); + }, + 4607: function (e, t, n) { + var r; + (r = function (e) { + return (function (e) { + var t = {}; + function n(r) { + if (t[r]) return t[r].exports; + var i = (t[r] = { i: r, l: !1, exports: {} }); + return e[r].call(i.exports, i, i.exports, n), (i.l = !0), i.exports; + } + return ( + (n.m = e), + (n.c = t), + (n.i = function (e) { + return e; + }), + (n.d = function (e, t, r) { + n.o(e, t) || Object.defineProperty(e, t, { configurable: !1, enumerable: !0, get: r }); + }), + (n.n = function (e) { + var t = + e && e.__esModule + ? function () { + return e.default; + } + : function () { + return e; + }; + return n.d(t, "a", t), t; + }), + (n.o = function (e, t) { + return Object.prototype.hasOwnProperty.call(e, t); + }), + (n.p = ""), + n((n.s = 1)) + ); + })([ + function (t, n) { + t.exports = e; + }, + function (e, t, n) { + "use strict"; + var r = n(0).layoutBase.LayoutConstants, + i = n(0).layoutBase.FDLayoutConstants, + a = n(0).CoSEConstants, + o = n(0).CoSELayout, + s = n(0).CoSENode, + l = n(0).layoutBase.PointD, + u = n(0).layoutBase.DimensionD, + c = { + ready: function () {}, + stop: function () {}, + quality: "default", + nodeDimensionsIncludeLabels: !1, + refresh: 30, + fit: !0, + padding: 10, + randomize: !0, + nodeRepulsion: 4500, + idealEdgeLength: 50, + edgeElasticity: 0.45, + nestingFactor: 0.1, + gravity: 0.25, + numIter: 2500, + tile: !0, + animate: "end", + animationDuration: 500, + tilingPaddingVertical: 10, + tilingPaddingHorizontal: 10, + gravityRangeCompound: 1.5, + gravityCompound: 1, + gravityRange: 3.8, + initialEnergyOnIncremental: 0.5, + }; + function h(e) { + (this.options = (function (e, t) { + var n = {}; + for (var r in e) n[r] = e[r]; + for (var r in t) n[r] = t[r]; + return n; + })(c, e)), + d(this.options); + } + var d = function (e) { + null != e.nodeRepulsion && (a.DEFAULT_REPULSION_STRENGTH = i.DEFAULT_REPULSION_STRENGTH = e.nodeRepulsion), + null != e.idealEdgeLength && (a.DEFAULT_EDGE_LENGTH = i.DEFAULT_EDGE_LENGTH = e.idealEdgeLength), + null != e.edgeElasticity && (a.DEFAULT_SPRING_STRENGTH = i.DEFAULT_SPRING_STRENGTH = e.edgeElasticity), + null != e.nestingFactor && (a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = e.nestingFactor), + null != e.gravity && (a.DEFAULT_GRAVITY_STRENGTH = i.DEFAULT_GRAVITY_STRENGTH = e.gravity), + null != e.numIter && (a.MAX_ITERATIONS = i.MAX_ITERATIONS = e.numIter), + null != e.gravityRange && (a.DEFAULT_GRAVITY_RANGE_FACTOR = i.DEFAULT_GRAVITY_RANGE_FACTOR = e.gravityRange), + null != e.gravityCompound && (a.DEFAULT_COMPOUND_GRAVITY_STRENGTH = i.DEFAULT_COMPOUND_GRAVITY_STRENGTH = e.gravityCompound), + null != e.gravityRangeCompound && + (a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = e.gravityRangeCompound), + null != e.initialEnergyOnIncremental && + (a.DEFAULT_COOLING_FACTOR_INCREMENTAL = i.DEFAULT_COOLING_FACTOR_INCREMENTAL = e.initialEnergyOnIncremental), + "draft" == e.quality ? (r.QUALITY = 0) : "proof" == e.quality ? (r.QUALITY = 2) : (r.QUALITY = 1), + (a.NODE_DIMENSIONS_INCLUDE_LABELS = + i.NODE_DIMENSIONS_INCLUDE_LABELS = + r.NODE_DIMENSIONS_INCLUDE_LABELS = + e.nodeDimensionsIncludeLabels), + (a.DEFAULT_INCREMENTAL = i.DEFAULT_INCREMENTAL = r.DEFAULT_INCREMENTAL = !e.randomize), + (a.ANIMATE = i.ANIMATE = r.ANIMATE = e.animate), + (a.TILE = e.tile), + (a.TILING_PADDING_VERTICAL = "function" == typeof e.tilingPaddingVertical ? e.tilingPaddingVertical.call() : e.tilingPaddingVertical), + (a.TILING_PADDING_HORIZONTAL = + "function" == typeof e.tilingPaddingHorizontal ? e.tilingPaddingHorizontal.call() : e.tilingPaddingHorizontal); + }; + (h.prototype.run = function () { + var e, + t, + n = this.options, + r = ((this.idToLNode = {}), (this.layout = new o())), + i = this; + (i.stopped = !1), (this.cy = this.options.cy), this.cy.trigger({ type: "layoutstart", layout: this }); + var a = r.newGraphManager(); + this.gm = a; + var s = this.options.eles.nodes(), + l = this.options.eles.edges(); + (this.root = a.addRoot()), this.processChildrenList(this.root, this.getTopMostNodes(s), r); + for (var u = 0; u < l.length; u++) { + var c = l[u], + h = this.idToLNode[c.data("source")], + d = this.idToLNode[c.data("target")]; + h !== d && 0 == h.getEdgesBetween(d).length && (a.add(r.newEdge(), h, d).id = c.id()); + } + var p = function (e, t) { + "number" == typeof e && (e = t); + var n = e.data("id"), + r = i.idToLNode[n]; + return { x: r.getRect().getCenterX(), y: r.getRect().getCenterY() }; + }, + g = function a() { + for ( + var o, + s = function () { + n.fit && n.cy.fit(n.eles, n.padding), + e || ((e = !0), i.cy.one("layoutready", n.ready), i.cy.trigger({ type: "layoutready", layout: i })); + }, + l = i.options.refresh, + u = 0; + u < l && !o; + u++ + ) + o = i.stopped || i.layout.tick(); + if (o) + return ( + r.checkLayoutSuccess() && !r.isSubLayout && r.doPostLayout(), + r.tilingPostLayout && r.tilingPostLayout(), + (r.isLayoutFinished = !0), + i.options.eles.nodes().positions(p), + s(), + i.cy.one("layoutstop", i.options.stop), + i.cy.trigger({ type: "layoutstop", layout: i }), + t && cancelAnimationFrame(t), + void (e = !1) + ); + var c = i.layout.getPositionsData(); + n.eles.nodes().positions(function (e, t) { + if (("number" == typeof e && (e = t), !e.isParent())) { + for ( + var n = e.id(), r = c[n], i = e; + null == r && ((r = c[i.data("parent")] || c["DummyCompound_" + i.data("parent")]), (c[n] = r), null != (i = i.parent()[0])); + + ); + return null != r ? { x: r.x, y: r.y } : { x: e.position("x"), y: e.position("y") }; + } + }), + s(), + (t = requestAnimationFrame(a)); + }; + return ( + r.addListener("layoutstarted", function () { + "during" === i.options.animate && (t = requestAnimationFrame(g)); + }), + r.runLayout(), + "during" !== this.options.animate && (i.options.eles.nodes().not(":parent").layoutPositions(i, i.options, p), (e = !1)), + this + ); + }), + (h.prototype.getTopMostNodes = function (e) { + for (var t = {}, n = 0; n < e.length; n++) t[e[n].id()] = !0; + var r = e.filter(function (e, n) { + "number" == typeof e && (e = n); + for (var r = e.parent()[0]; null != r; ) { + if (t[r.id()]) return !1; + r = r.parent()[0]; + } + return !0; + }); + return r; + }), + (h.prototype.processChildrenList = function (e, t, n) { + for (var r = t.length, i = 0; i < r; i++) { + var a, + o, + c = t[i], + h = c.children(), + d = c.layoutDimensions({ + nodeDimensionsIncludeLabels: this.options.nodeDimensionsIncludeLabels, + }); + if ( + (((a = + null != c.outerWidth() && null != c.outerHeight() + ? e.add( + new s( + n.graphManager, + new l(c.position("x") - d.w / 2, c.position("y") - d.h / 2), + new u(parseFloat(d.w), parseFloat(d.h)), + ), + ) + : e.add(new s(this.graphManager))).id = c.data("id")), + (a.paddingLeft = parseInt(c.css("padding"))), + (a.paddingTop = parseInt(c.css("padding"))), + (a.paddingRight = parseInt(c.css("padding"))), + (a.paddingBottom = parseInt(c.css("padding"))), + this.options.nodeDimensionsIncludeLabels && c.isParent()) + ) { + var p = c.boundingBox({ includeLabels: !0, includeNodes: !1 }).w, + g = c.boundingBox({ includeLabels: !0, includeNodes: !1 }).h, + f = c.css("text-halign"); + (a.labelWidth = p), (a.labelHeight = g), (a.labelPos = f); + } + (this.idToLNode[c.data("id")] = a), + isNaN(a.rect.x) && (a.rect.x = 0), + isNaN(a.rect.y) && (a.rect.y = 0), + null != h && h.length > 0 && ((o = n.getGraphManager().add(n.newGraph(), a)), this.processChildrenList(o, h, n)); + } + }), + (h.prototype.stop = function () { + return (this.stopped = !0), this; + }); + var p = function (e) { + e("layout", "cose-bilkent", h); + }; + "undefined" != typeof cytoscape && p(cytoscape), (e.exports = p); + }, + ]); + }), + (e.exports = r(n(4182))); + }, + 1377: function (e, t, n) { + e.exports = (function () { + "use strict"; + function e(t) { + return ( + (e = + "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; + }), + e(t) + ); + } + function t(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + } + function r(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n]; + (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + } + function i(e, t, n) { + return t && r(e.prototype, t), n && r(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e; + } + function a(e, t, n) { + return ( + t in e + ? Object.defineProperty(e, t, { + value: n, + enumerable: !0, + configurable: !0, + writable: !0, + }) + : (e[t] = n), + e + ); + } + function o(e, t) { + return ( + (function (e) { + if (Array.isArray(e)) return e; + })(e) || + (function (e, t) { + var n = null == e ? null : ("undefined" != typeof Symbol && e[Symbol.iterator]) || e["@@iterator"]; + if (null != n) { + var r, + i, + a = [], + o = !0, + s = !1; + try { + for (n = n.call(e); !(o = (r = n.next()).done) && (a.push(r.value), !t || a.length !== t); o = !0); + } catch (e) { + (s = !0), (i = e); + } finally { + try { + o || null == n.return || n.return(); + } finally { + if (s) throw i; + } + } + return a; + } + })(e, t) || + (function (e, t) { + if (e) { + if ("string" == typeof e) return s(e, t); + var n = Object.prototype.toString.call(e).slice(8, -1); + return ( + "Object" === n && e.constructor && (n = e.constructor.name), + "Map" === n || "Set" === n + ? Array.from(e) + : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) + ? s(e, t) + : void 0 + ); + } + })(e, t) || + (function () { + throw new TypeError( + "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.", + ); + })() + ); + } + function s(e, t) { + (null == t || t > e.length) && (t = e.length); + for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n]; + return r; + } + var l = "undefined" == typeof window ? null : window, + u = l ? l.navigator : null; + l && l.document; + var c = e(""), + h = e({}), + d = e(function () {}), + p = "undefined" == typeof HTMLElement ? "undefined" : e(HTMLElement), + g = function (e) { + return e && e.instanceString && v(e.instanceString) ? e.instanceString() : null; + }, + f = function (t) { + return null != t && e(t) == c; + }, + v = function (t) { + return null != t && e(t) === d; + }, + y = function (e) { + return !w(e) && (Array.isArray ? Array.isArray(e) : null != e && e instanceof Array); + }, + m = function (t) { + return null != t && e(t) === h && !y(t) && t.constructor === Object; + }, + b = function (t) { + return null != t && e(t) === e(1) && !isNaN(t); + }, + x = function (e) { + return "undefined" === p ? void 0 : null != e && e instanceof HTMLElement; + }, + w = function (e) { + return E(e) || _(e); + }, + E = function (e) { + return "collection" === g(e) && e._private.single; + }, + _ = function (e) { + return "collection" === g(e) && !e._private.single; + }, + T = function (e) { + return "core" === g(e); + }, + D = function (e) { + return "stylesheet" === g(e); + }, + C = function (e) { + return null == e || !("" !== e && !e.match(/^\s+$/)); + }, + N = function (t) { + return ( + (function (t) { + return null != t && e(t) === h; + })(t) && v(t.then) + ); + }, + A = function (e, t) { + t || + (t = function () { + if (1 === arguments.length) return arguments[0]; + if (0 === arguments.length) return "undefined"; + for (var e = [], t = 0; t < arguments.length; t++) e.push(arguments[t]); + return e.join("$"); + }); + var n = function n() { + var r, + i = arguments, + a = t.apply(this, i), + o = n.cache; + return (r = o[a]) || (r = o[a] = e.apply(this, i)), r; + }; + return (n.cache = {}), n; + }, + L = A(function (e) { + return e.replace(/([A-Z])/g, function (e) { + return "-" + e.toLowerCase(); + }); + }), + k = A(function (e) { + return e.replace(/(-\w)/g, function (e) { + return e[1].toUpperCase(); + }); + }), + S = A( + function (e, t) { + return e + t[0].toUpperCase() + t.substring(1); + }, + function (e, t) { + return e + "$" + t; + }, + ), + I = function (e) { + return C(e) ? e : e.charAt(0).toUpperCase() + e.substring(1); + }, + M = "(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))", + O = "rgb[a]?\\((" + M + "[%]?)\\s*,\\s*(" + M + "[%]?)\\s*,\\s*(" + M + "[%]?)(?:\\s*,\\s*(" + M + "))?\\)", + P = "rgb[a]?\\((?:" + M + "[%]?)\\s*,\\s*(?:" + M + "[%]?)\\s*,\\s*(?:" + M + "[%]?)(?:\\s*,\\s*(?:" + M + "))?\\)", + R = "hsl[a]?\\((" + M + ")\\s*,\\s*(" + M + "[%])\\s*,\\s*(" + M + "[%])(?:\\s*,\\s*(" + M + "))?\\)", + B = "hsl[a]?\\((?:" + M + ")\\s*,\\s*(?:" + M + "[%])\\s*,\\s*(?:" + M + "[%])(?:\\s*,\\s*(?:" + M + "))?\\)", + F = function (e, t) { + return e < t ? -1 : e > t ? 1 : 0; + }, + z = + null != Object.assign + ? Object.assign.bind(Object) + : function (e) { + for (var t = arguments, n = 1; n < t.length; n++) { + var r = t[n]; + if (null != r) + for (var i = Object.keys(r), a = 0; a < i.length; a++) { + var o = i[a]; + e[o] = r[o]; + } + } + return e; + }, + G = function (e) { + return ( + (y(e) ? e : null) || + (function (e) { + return Y[e.toLowerCase()]; + })(e) || + (function (e) { + if ((4 === e.length || 7 === e.length) && "#" === e[0]) { + var t, + n, + r, + i = 16; + return ( + 4 === e.length + ? ((t = parseInt(e[1] + e[1], i)), (n = parseInt(e[2] + e[2], i)), (r = parseInt(e[3] + e[3], i))) + : ((t = parseInt(e[1] + e[2], i)), (n = parseInt(e[3] + e[4], i)), (r = parseInt(e[5] + e[6], i))), + [t, n, r] + ); + } + })(e) || + (function (e) { + var t, + n = new RegExp("^" + O + "$").exec(e); + if (n) { + t = []; + for (var r = [], i = 1; i <= 3; i++) { + var a = n[i]; + if (("%" === a[a.length - 1] && (r[i] = !0), (a = parseFloat(a)), r[i] && (a = (a / 100) * 255), a < 0 || a > 255)) return; + t.push(Math.floor(a)); + } + var o = r[1] || r[2] || r[3], + s = r[1] && r[2] && r[3]; + if (o && !s) return; + var l = n[4]; + if (void 0 !== l) { + if ((l = parseFloat(l)) < 0 || l > 1) return; + t.push(l); + } + } + return t; + })(e) || + (function (e) { + var t, n, r, i, a, o, s, l; + function u(e, t, n) { + return ( + n < 0 && (n += 1), + n > 1 && (n -= 1), + n < 1 / 6 ? e + 6 * (t - e) * n : n < 0.5 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e + ); + } + var c = new RegExp("^" + R + "$").exec(e); + if (c) { + if ( + ((n = parseInt(c[1])) < 0 ? (n = (360 - ((-1 * n) % 360)) % 360) : n > 360 && (n %= 360), + (n /= 360), + (r = parseFloat(c[2])) < 0 || r > 100) + ) + return; + if (((r /= 100), (i = parseFloat(c[3])) < 0 || i > 100)) return; + if (((i /= 100), void 0 !== (a = c[4]) && ((a = parseFloat(a)) < 0 || a > 1))) return; + if (0 === r) o = s = l = Math.round(255 * i); + else { + var h = i < 0.5 ? i * (1 + r) : i + r - i * r, + d = 2 * i - h; + (o = Math.round(255 * u(d, h, n + 1 / 3))), (s = Math.round(255 * u(d, h, n))), (l = Math.round(255 * u(d, h, n - 1 / 3))); + } + t = [o, s, l, a]; + } + return t; + })(e) + ); + }, + Y = { + transparent: [0, 0, 0, 0], + aliceblue: [240, 248, 255], + antiquewhite: [250, 235, 215], + aqua: [0, 255, 255], + aquamarine: [127, 255, 212], + azure: [240, 255, 255], + beige: [245, 245, 220], + bisque: [255, 228, 196], + black: [0, 0, 0], + blanchedalmond: [255, 235, 205], + blue: [0, 0, 255], + blueviolet: [138, 43, 226], + brown: [165, 42, 42], + burlywood: [222, 184, 135], + cadetblue: [95, 158, 160], + chartreuse: [127, 255, 0], + chocolate: [210, 105, 30], + coral: [255, 127, 80], + cornflowerblue: [100, 149, 237], + cornsilk: [255, 248, 220], + crimson: [220, 20, 60], + cyan: [0, 255, 255], + darkblue: [0, 0, 139], + darkcyan: [0, 139, 139], + darkgoldenrod: [184, 134, 11], + darkgray: [169, 169, 169], + darkgreen: [0, 100, 0], + darkgrey: [169, 169, 169], + darkkhaki: [189, 183, 107], + darkmagenta: [139, 0, 139], + darkolivegreen: [85, 107, 47], + darkorange: [255, 140, 0], + darkorchid: [153, 50, 204], + darkred: [139, 0, 0], + darksalmon: [233, 150, 122], + darkseagreen: [143, 188, 143], + darkslateblue: [72, 61, 139], + darkslategray: [47, 79, 79], + darkslategrey: [47, 79, 79], + darkturquoise: [0, 206, 209], + darkviolet: [148, 0, 211], + deeppink: [255, 20, 147], + deepskyblue: [0, 191, 255], + dimgray: [105, 105, 105], + dimgrey: [105, 105, 105], + dodgerblue: [30, 144, 255], + firebrick: [178, 34, 34], + floralwhite: [255, 250, 240], + forestgreen: [34, 139, 34], + fuchsia: [255, 0, 255], + gainsboro: [220, 220, 220], + ghostwhite: [248, 248, 255], + gold: [255, 215, 0], + goldenrod: [218, 165, 32], + gray: [128, 128, 128], + grey: [128, 128, 128], + green: [0, 128, 0], + greenyellow: [173, 255, 47], + honeydew: [240, 255, 240], + hotpink: [255, 105, 180], + indianred: [205, 92, 92], + indigo: [75, 0, 130], + ivory: [255, 255, 240], + khaki: [240, 230, 140], + lavender: [230, 230, 250], + lavenderblush: [255, 240, 245], + lawngreen: [124, 252, 0], + lemonchiffon: [255, 250, 205], + lightblue: [173, 216, 230], + lightcoral: [240, 128, 128], + lightcyan: [224, 255, 255], + lightgoldenrodyellow: [250, 250, 210], + lightgray: [211, 211, 211], + lightgreen: [144, 238, 144], + lightgrey: [211, 211, 211], + lightpink: [255, 182, 193], + lightsalmon: [255, 160, 122], + lightseagreen: [32, 178, 170], + lightskyblue: [135, 206, 250], + lightslategray: [119, 136, 153], + lightslategrey: [119, 136, 153], + lightsteelblue: [176, 196, 222], + lightyellow: [255, 255, 224], + lime: [0, 255, 0], + limegreen: [50, 205, 50], + linen: [250, 240, 230], + magenta: [255, 0, 255], + maroon: [128, 0, 0], + mediumaquamarine: [102, 205, 170], + mediumblue: [0, 0, 205], + mediumorchid: [186, 85, 211], + mediumpurple: [147, 112, 219], + mediumseagreen: [60, 179, 113], + mediumslateblue: [123, 104, 238], + mediumspringgreen: [0, 250, 154], + mediumturquoise: [72, 209, 204], + mediumvioletred: [199, 21, 133], + midnightblue: [25, 25, 112], + mintcream: [245, 255, 250], + mistyrose: [255, 228, 225], + moccasin: [255, 228, 181], + navajowhite: [255, 222, 173], + navy: [0, 0, 128], + oldlace: [253, 245, 230], + olive: [128, 128, 0], + olivedrab: [107, 142, 35], + orange: [255, 165, 0], + orangered: [255, 69, 0], + orchid: [218, 112, 214], + palegoldenrod: [238, 232, 170], + palegreen: [152, 251, 152], + paleturquoise: [175, 238, 238], + palevioletred: [219, 112, 147], + papayawhip: [255, 239, 213], + peachpuff: [255, 218, 185], + peru: [205, 133, 63], + pink: [255, 192, 203], + plum: [221, 160, 221], + powderblue: [176, 224, 230], + purple: [128, 0, 128], + red: [255, 0, 0], + rosybrown: [188, 143, 143], + royalblue: [65, 105, 225], + saddlebrown: [139, 69, 19], + salmon: [250, 128, 114], + sandybrown: [244, 164, 96], + seagreen: [46, 139, 87], + seashell: [255, 245, 238], + sienna: [160, 82, 45], + silver: [192, 192, 192], + skyblue: [135, 206, 235], + slateblue: [106, 90, 205], + slategray: [112, 128, 144], + slategrey: [112, 128, 144], + snow: [255, 250, 250], + springgreen: [0, 255, 127], + steelblue: [70, 130, 180], + tan: [210, 180, 140], + teal: [0, 128, 128], + thistle: [216, 191, 216], + tomato: [255, 99, 71], + turquoise: [64, 224, 208], + violet: [238, 130, 238], + wheat: [245, 222, 179], + white: [255, 255, 255], + whitesmoke: [245, 245, 245], + yellow: [255, 255, 0], + yellowgreen: [154, 205, 50], + }, + X = function (e) { + for (var t = e.map, n = e.keys, r = n.length, i = 0; i < r; i++) { + var a = n[i]; + if (m(a)) throw Error("Tried to set map with object key"); + i < n.length - 1 ? (null == t[a] && (t[a] = {}), (t = t[a])) : (t[a] = e.value); + } + }, + V = function (e) { + for (var t = e.map, n = e.keys, r = n.length, i = 0; i < r; i++) { + var a = n[i]; + if (m(a)) throw Error("Tried to get map with object key"); + if (null == (t = t[a])) return t; + } + return t; + }; + var U = function (e) { + var t = typeof e; + return null != e && ("object" == t || "function" == t); + }, + j = + "undefined" != typeof globalThis + ? globalThis + : "undefined" != typeof window + ? window + : void 0 !== n.g + ? n.g + : "undefined" != typeof self + ? self + : {}; + var q = "object" == typeof j && j && j.Object === Object && j, + H = "object" == typeof self && self && self.Object === Object && self, + W = q || H || Function("return this")(), + $ = function () { + return W.Date.now(); + }, + K = /\s/; + var Z = function (e) { + for (var t = e.length; t-- && K.test(e.charAt(t)); ); + return t; + }, + Q = /^\s+/; + var J = function (e) { + return e ? e.slice(0, Z(e) + 1).replace(Q, "") : e; + }, + ee = W.Symbol, + te = Object.prototype, + ne = te.hasOwnProperty, + re = te.toString, + ie = ee ? ee.toStringTag : void 0; + var ae = function (e) { + var t = ne.call(e, ie), + n = e[ie]; + try { + e[ie] = void 0; + var r = !0; + } catch (e) {} + var i = re.call(e); + return r && (t ? (e[ie] = n) : delete e[ie]), i; + }, + oe = Object.prototype.toString; + var se = function (e) { + return oe.call(e); + }, + le = ee ? ee.toStringTag : void 0; + var ue = function (e) { + return null == e ? (void 0 === e ? "[object Undefined]" : "[object Null]") : le && le in Object(e) ? ae(e) : se(e); + }; + var ce = function (e) { + return null != e && "object" == typeof e; + }; + var he = function (e) { + return "symbol" == typeof e || (ce(e) && "[object Symbol]" == ue(e)); + }, + de = /^[-+]0x[0-9a-f]+$/i, + pe = /^0b[01]+$/i, + ge = /^0o[0-7]+$/i, + fe = parseInt; + var ve = function (e) { + if ("number" == typeof e) return e; + if (he(e)) return NaN; + if (U(e)) { + var t = "function" == typeof e.valueOf ? e.valueOf() : e; + e = U(t) ? t + "" : t; + } + if ("string" != typeof e) return 0 === e ? e : +e; + e = J(e); + var n = pe.test(e); + return n || ge.test(e) ? fe(e.slice(2), n ? 2 : 8) : de.test(e) ? NaN : +e; + }, + ye = Math.max, + me = Math.min; + var be = function (e, t, n) { + var r, + i, + a, + o, + s, + l, + u = 0, + c = !1, + h = !1, + d = !0; + if ("function" != typeof e) throw new TypeError("Expected a function"); + function p(t) { + var n = r, + a = i; + return (r = i = void 0), (u = t), (o = e.apply(a, n)); + } + function g(e) { + var n = e - l; + return void 0 === l || n >= t || n < 0 || (h && e - u >= a); + } + function f() { + var e = $(); + if (g(e)) return v(e); + s = setTimeout( + f, + (function (e) { + var n = t - (e - l); + return h ? me(n, a - (e - u)) : n; + })(e), + ); + } + function v(e) { + return (s = void 0), d && r ? p(e) : ((r = i = void 0), o); + } + function y() { + var e = $(), + n = g(e); + if (((r = arguments), (i = this), (l = e), n)) { + if (void 0 === s) + return (function (e) { + return (u = e), (s = setTimeout(f, t)), c ? p(e) : o; + })(l); + if (h) return clearTimeout(s), (s = setTimeout(f, t)), p(l); + } + return void 0 === s && (s = setTimeout(f, t)), o; + } + return ( + (t = ve(t) || 0), + U(n) && ((c = !!n.leading), (a = (h = "maxWait" in n) ? ye(ve(n.maxWait) || 0, t) : a), (d = "trailing" in n ? !!n.trailing : d)), + (y.cancel = function () { + void 0 !== s && clearTimeout(s), (u = 0), (r = l = i = s = void 0); + }), + (y.flush = function () { + return void 0 === s ? o : v($()); + }), + y + ); + }, + xe = l ? l.performance : null, + we = + xe && xe.now + ? function () { + return xe.now(); + } + : function () { + return Date.now(); + }, + Ee = (function () { + if (l) { + if (l.requestAnimationFrame) + return function (e) { + l.requestAnimationFrame(e); + }; + if (l.mozRequestAnimationFrame) + return function (e) { + l.mozRequestAnimationFrame(e); + }; + if (l.webkitRequestAnimationFrame) + return function (e) { + l.webkitRequestAnimationFrame(e); + }; + if (l.msRequestAnimationFrame) + return function (e) { + l.msRequestAnimationFrame(e); + }; + } + return function (e) { + e && + setTimeout(function () { + e(we()); + }, 1e3 / 60); + }; + })(), + _e = function (e) { + return Ee(e); + }, + Te = we, + De = 9261, + Ce = 5381, + Ne = function (e) { + for (var t, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : De; !(t = e.next()).done; ) + n = (65599 * n + t.value) | 0; + return n; + }, + Ae = function (e) { + return (65599 * (arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : De) + e) | 0; + }, + Le = function (e) { + var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Ce; + return ((t << 5) + t + e) | 0; + }, + ke = function (e) { + return 2097152 * e[0] + e[1]; + }, + Se = function (e, t) { + return [Ae(e[0], t[0]), Le(e[1], t[1])]; + }, + Ie = function (e, t) { + var n = { value: 0, done: !1 }, + r = 0, + i = e.length; + return Ne( + { + next: function () { + return r < i ? (n.value = e.charCodeAt(r++)) : (n.done = !0), n; + }, + }, + t, + ); + }, + Me = function () { + return Oe(arguments); + }, + Oe = function (e) { + for (var t, n = 0; n < e.length; n++) { + var r = e[n]; + t = 0 === n ? Ie(r) : Ie(r, t); + } + return t; + }, + Pe = !0, + Re = null != console.warn, + Be = null != console.trace, + Fe = Number.MAX_SAFE_INTEGER || 9007199254740991, + ze = function () { + return !0; + }, + Ge = function () { + return !1; + }, + Ye = function () { + return 0; + }, + Xe = function () {}, + Ve = function (e) { + throw new Error(e); + }, + Ue = function (e) { + if (void 0 === e) return Pe; + Pe = !!e; + }, + je = function (e) { + Ue() && (Re ? console.warn(e) : (console.log(e), Be && console.trace())); + }, + qe = function (e) { + return null == e + ? e + : y(e) + ? e.slice() + : m(e) + ? (function (e) { + return z({}, e); + })(e) + : e; + }, + He = function (e, t) { + for (t = e = ""; e++ < 36; t += (51 * e) & 52 ? (15 ^ e ? 8 ^ (Math.random() * (20 ^ e ? 16 : 4)) : 4).toString(16) : "-"); + return t; + }, + We = {}, + $e = function () { + return We; + }, + Ke = function (e) { + var t = Object.keys(e); + return function (n) { + for (var r = {}, i = 0; i < t.length; i++) { + var a = t[i], + o = null == n ? void 0 : n[a]; + r[a] = void 0 === o ? e[a] : o; + } + return r; + }; + }, + Ze = function (e, t, n) { + for (var r = e.length - 1; r >= 0 && (e[r] !== t || (e.splice(r, 1), !n)); r--); + }, + Qe = function (e) { + e.splice(0, e.length); + }, + Je = function (e, t, n) { + return n && (t = S(n, t)), e[t]; + }, + et = function (e, t, n, r) { + n && (t = S(n, t)), (e[t] = r); + }, + tt = + "undefined" != typeof Map + ? Map + : (function () { + function e() { + t(this, e), (this._obj = {}); + } + return ( + i(e, [ + { + key: "set", + value: function (e, t) { + return (this._obj[e] = t), this; + }, + }, + { + key: "delete", + value: function (e) { + return (this._obj[e] = void 0), this; + }, + }, + { + key: "clear", + value: function () { + this._obj = {}; + }, + }, + { + key: "has", + value: function (e) { + return void 0 !== this._obj[e]; + }, + }, + { + key: "get", + value: function (e) { + return this._obj[e]; + }, + }, + ]), + e + ); + })(), + nt = (function () { + function e(n) { + if ((t(this, e), (this._obj = Object.create(null)), (this.size = 0), null != n)) { + var r; + r = null != n.instanceString && n.instanceString() === this.instanceString() ? n.toArray() : n; + for (var i = 0; i < r.length; i++) this.add(r[i]); + } + } + return ( + i(e, [ + { + key: "instanceString", + value: function () { + return "set"; + }, + }, + { + key: "add", + value: function (e) { + var t = this._obj; + 1 !== t[e] && ((t[e] = 1), this.size++); + }, + }, + { + key: "delete", + value: function (e) { + var t = this._obj; + 1 === t[e] && ((t[e] = 0), this.size--); + }, + }, + { + key: "clear", + value: function () { + this._obj = Object.create(null); + }, + }, + { + key: "has", + value: function (e) { + return 1 === this._obj[e]; + }, + }, + { + key: "toArray", + value: function () { + var e = this; + return Object.keys(this._obj).filter(function (t) { + return e.has(t); + }); + }, + }, + { + key: "forEach", + value: function (e, t) { + return this.toArray().forEach(e, t); + }, + }, + ]), + e + ); + })(), + rt = "undefined" !== ("undefined" == typeof Set ? "undefined" : e(Set)) ? Set : nt, + it = function (e, t) { + var n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2]; + if (void 0 !== e && void 0 !== t && T(e)) { + var r = t.group; + if ((null == r && (r = t.data && null != t.data.source && null != t.data.target ? "edges" : "nodes"), "nodes" === r || "edges" === r)) { + (this.length = 1), (this[0] = this); + var i = (this._private = { + cy: e, + single: !0, + data: t.data || {}, + position: t.position || { x: 0, y: 0 }, + autoWidth: void 0, + autoHeight: void 0, + autoPadding: void 0, + compoundBoundsClean: !1, + listeners: [], + group: r, + style: {}, + rstyle: {}, + styleCxts: [], + styleKeys: {}, + removed: !0, + selected: !!t.selected, + selectable: void 0 === t.selectable || !!t.selectable, + locked: !!t.locked, + grabbed: !1, + grabbable: void 0 === t.grabbable || !!t.grabbable, + pannable: void 0 === t.pannable ? "edges" === r : !!t.pannable, + active: !1, + classes: new rt(), + animation: { current: [], queue: [] }, + rscratch: {}, + scratch: t.scratch || {}, + edges: [], + children: [], + parent: t.parent && t.parent.isNode() ? t.parent : null, + traversalCache: {}, + backgrounding: !1, + bbCache: null, + bbCacheShift: { x: 0, y: 0 }, + bodyBounds: null, + overlayBounds: null, + labelBounds: { all: null, source: null, target: null, main: null }, + arrowBounds: { + source: null, + target: null, + "mid-source": null, + "mid-target": null, + }, + }); + if ((null == i.position.x && (i.position.x = 0), null == i.position.y && (i.position.y = 0), t.renderedPosition)) { + var a = t.renderedPosition, + o = e.pan(), + s = e.zoom(); + i.position = { x: (a.x - o.x) / s, y: (a.y - o.y) / s }; + } + var l = []; + y(t.classes) ? (l = t.classes) : f(t.classes) && (l = t.classes.split(/\s+/)); + for (var u = 0, c = l.length; u < c; u++) { + var h = l[u]; + h && "" !== h && i.classes.add(h); + } + this.createEmitter(); + var d = t.style || t.css; + d && + (je( + "Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead.", + ), + this.style(d)), + (void 0 === n || n) && this.restore(); + } else Ve("An element must be of type `nodes` or `edges`; you specified `" + r + "`"); + } else Ve("An element must have a core reference and parameters set"); + }, + at = function (e) { + return ( + (e = { bfs: e.bfs || !e.dfs, dfs: e.dfs || !e.bfs }), + function (t, n, r) { + var i; + m(t) && !w(t) && ((t = (i = t).roots || i.root), (n = i.visit), (r = i.directed)), + (r = 2 !== arguments.length || v(n) ? r : n), + (n = v(n) ? n : function () {}); + for ( + var a, + o = this._private.cy, + s = (t = f(t) ? this.filter(t) : t), + l = [], + u = [], + c = {}, + h = {}, + d = {}, + p = 0, + g = this.byGroup(), + y = g.nodes, + b = g.edges, + x = 0; + x < s.length; + x++ + ) { + var E = s[x], + _ = E.id(); + E.isNode() && (l.unshift(E), e.bfs && ((d[_] = !0), u.push(E)), (h[_] = 0)); + } + for ( + var T = function () { + var t = e.bfs ? l.shift() : l.pop(), + i = t.id(); + if (e.dfs) { + if (d[i]) return "continue"; + (d[i] = !0), u.push(t); + } + var o, + s = h[i], + g = c[i], + f = null != g ? g.source() : null, + v = null != g ? g.target() : null, + m = null == g ? void 0 : t.same(f) ? v[0] : f[0]; + if (!0 === (o = n(t, g, m, p++, s))) return (a = t), "break"; + if (!1 === o) return "break"; + for ( + var x = t.connectedEdges().filter(function (e) { + return (!r || e.source().same(t)) && b.has(e); + }), + w = 0; + w < x.length; + w++ + ) { + var E = x[w], + _ = E.connectedNodes().filter(function (e) { + return !e.same(t) && y.has(e); + }), + T = _.id(); + 0 === _.length || d[T] || ((_ = _[0]), l.push(_), e.bfs && ((d[T] = !0), u.push(_)), (c[T] = E), (h[T] = h[i] + 1)); + } + }; + 0 !== l.length; + + ) { + var D = T(); + if ("continue" !== D && "break" === D) break; + } + for (var C = o.collection(), N = 0; N < u.length; N++) { + var A = u[N], + L = c[A.id()]; + null != L && C.push(L), C.push(A); + } + return { path: o.collection(C), found: o.collection(a) }; + } + ); + }, + ot = { breadthFirstSearch: at({ bfs: !0 }), depthFirstSearch: at({ dfs: !0 }) }; + (ot.bfs = ot.breadthFirstSearch), (ot.dfs = ot.depthFirstSearch); + var st = (function (e, t) { + return e((t = { exports: {} }), t.exports), t.exports; + })(function (e, t) { + (function () { + var t, n, r, i, a, o, s, l, u, c, h, d, p, g, f; + (r = Math.floor), + (c = Math.min), + (n = function (e, t) { + return e < t ? -1 : e > t ? 1 : 0; + }), + (u = function (e, t, i, a, o) { + var s; + if ((null == i && (i = 0), null == o && (o = n), i < 0)) throw new Error("lo must be non-negative"); + for (null == a && (a = e.length); i < a; ) o(t, e[(s = r((i + a) / 2))]) < 0 ? (a = s) : (i = s + 1); + return [].splice.apply(e, [i, i - i].concat(t)), t; + }), + (o = function (e, t, r) { + return null == r && (r = n), e.push(t), g(e, 0, e.length - 1, r); + }), + (a = function (e, t) { + var r, i; + return null == t && (t = n), (r = e.pop()), e.length ? ((i = e[0]), (e[0] = r), f(e, 0, t)) : (i = r), i; + }), + (l = function (e, t, r) { + var i; + return null == r && (r = n), (i = e[0]), (e[0] = t), f(e, 0, r), i; + }), + (s = function (e, t, r) { + var i; + return null == r && (r = n), e.length && r(e[0], t) < 0 && ((t = (i = [e[0], t])[0]), (e[0] = i[1]), f(e, 0, r)), t; + }), + (i = function (e, t) { + var i, a, o, s, l, u; + for ( + null == t && (t = n), + l = [], + a = 0, + o = (s = function () { + u = []; + for (var t = 0, n = r(e.length / 2); 0 <= n ? t < n : t > n; 0 <= n ? t++ : t--) u.push(t); + return u; + } + .apply(this) + .reverse()).length; + a < o; + a++ + ) + (i = s[a]), l.push(f(e, i, t)); + return l; + }), + (p = function (e, t, r) { + var i; + if ((null == r && (r = n), -1 !== (i = e.indexOf(t)))) return g(e, 0, i, r), f(e, i, r); + }), + (h = function (e, t, r) { + var a, o, l, u, c; + if ((null == r && (r = n), !(o = e.slice(0, t)).length)) return o; + for (i(o, r), l = 0, u = (c = e.slice(t)).length; l < u; l++) (a = c[l]), s(o, a, r); + return o.sort(r).reverse(); + }), + (d = function (e, t, r) { + var o, s, l, h, d, p, g, f, v; + if ((null == r && (r = n), 10 * t <= e.length)) { + if (!(l = e.slice(0, t).sort(r)).length) return l; + for (s = l[l.length - 1], h = 0, p = (g = e.slice(t)).length; h < p; h++) + r((o = g[h]), s) < 0 && (u(l, o, 0, null, r), l.pop(), (s = l[l.length - 1])); + return l; + } + for (i(e, r), v = [], d = 0, f = c(t, e.length); 0 <= f ? d < f : d > f; 0 <= f ? ++d : --d) v.push(a(e, r)); + return v; + }), + (g = function (e, t, r, i) { + var a, o, s; + for (null == i && (i = n), a = e[r]; r > t && i(a, (o = e[(s = (r - 1) >> 1)])) < 0; ) (e[r] = o), (r = s); + return (e[r] = a); + }), + (f = function (e, t, r) { + var i, a, o, s, l; + for (null == r && (r = n), a = e.length, l = t, o = e[t], i = 2 * t + 1; i < a; ) + (s = i + 1) < a && !(r(e[i], e[s]) < 0) && (i = s), (e[t] = e[i]), (i = 2 * (t = i) + 1); + return (e[t] = o), g(e, l, t, r); + }), + (t = (function () { + function e(e) { + (this.cmp = null != e ? e : n), (this.nodes = []); + } + return ( + (e.push = o), + (e.pop = a), + (e.replace = l), + (e.pushpop = s), + (e.heapify = i), + (e.updateItem = p), + (e.nlargest = h), + (e.nsmallest = d), + (e.prototype.push = function (e) { + return o(this.nodes, e, this.cmp); + }), + (e.prototype.pop = function () { + return a(this.nodes, this.cmp); + }), + (e.prototype.peek = function () { + return this.nodes[0]; + }), + (e.prototype.contains = function (e) { + return -1 !== this.nodes.indexOf(e); + }), + (e.prototype.replace = function (e) { + return l(this.nodes, e, this.cmp); + }), + (e.prototype.pushpop = function (e) { + return s(this.nodes, e, this.cmp); + }), + (e.prototype.heapify = function () { + return i(this.nodes, this.cmp); + }), + (e.prototype.updateItem = function (e) { + return p(this.nodes, e, this.cmp); + }), + (e.prototype.clear = function () { + return (this.nodes = []); + }), + (e.prototype.empty = function () { + return 0 === this.nodes.length; + }), + (e.prototype.size = function () { + return this.nodes.length; + }), + (e.prototype.clone = function () { + var t; + return ((t = new e()).nodes = this.nodes.slice(0)), t; + }), + (e.prototype.toArray = function () { + return this.nodes.slice(0); + }), + (e.prototype.insert = e.prototype.push), + (e.prototype.top = e.prototype.peek), + (e.prototype.front = e.prototype.peek), + (e.prototype.has = e.prototype.contains), + (e.prototype.copy = e.prototype.clone), + e + ); + })()), + (e.exports = t); + }).call(j); + }), + lt = st, + ut = Ke({ + root: null, + weight: function (e) { + return 1; + }, + directed: !1, + }), + ct = { + dijkstra: function (e) { + if (!m(e)) { + var t = arguments; + e = { root: t[0], weight: t[1], directed: t[2] }; + } + var n = ut(e), + r = n.root, + i = n.weight, + a = n.directed, + o = this, + s = i, + l = f(r) ? this.filter(r)[0] : r[0], + u = {}, + c = {}, + h = {}, + d = this.byGroup(), + p = d.nodes, + g = d.edges; + g.unmergeBy(function (e) { + return e.isLoop(); + }); + for ( + var v = function (e) { + return u[e.id()]; + }, + y = function (e, t) { + (u[e.id()] = t), b.updateItem(e); + }, + b = new lt(function (e, t) { + return v(e) - v(t); + }), + x = 0; + x < p.length; + x++ + ) { + var w = p[x]; + (u[w.id()] = w.same(l) ? 0 : 1 / 0), b.push(w); + } + for ( + var E = function (e, t) { + for (var n, r = (a ? e.edgesTo(t) : e.edgesWith(t)).intersect(g), i = 1 / 0, o = 0; o < r.length; o++) { + var l = r[o], + u = s(l); + (u < i || !n) && ((i = u), (n = l)); + } + return { edge: n, dist: i }; + }; + b.size() > 0; + + ) { + var _ = b.pop(), + T = v(_), + D = _.id(); + if (((h[D] = T), T !== 1 / 0)) + for (var C = _.neighborhood().intersect(p), N = 0; N < C.length; N++) { + var A = C[N], + L = A.id(), + k = E(_, A), + S = T + k.dist; + S < v(A) && (y(A, S), (c[L] = { node: _, edge: k.edge })); + } + } + return { + distanceTo: function (e) { + var t = f(e) ? p.filter(e)[0] : e[0]; + return h[t.id()]; + }, + pathTo: function (e) { + var t = f(e) ? p.filter(e)[0] : e[0], + n = [], + r = t, + i = r.id(); + if (t.length > 0) + for (n.unshift(t); c[i]; ) { + var a = c[i]; + n.unshift(a.edge), n.unshift(a.node), (i = (r = a.node).id()); + } + return o.spawn(n); + }, + }; + }, + }, + ht = { + kruskal: function (e) { + e = + e || + function (e) { + return 1; + }; + for ( + var t = this.byGroup(), + n = t.nodes, + r = t.edges, + i = n.length, + a = new Array(i), + o = n, + s = function (e) { + for (var t = 0; t < a.length; t++) if (a[t].has(e)) return t; + }, + l = 0; + l < i; + l++ + ) + a[l] = this.spawn(n[l]); + for ( + var u = r.sort(function (t, n) { + return e(t) - e(n); + }), + c = 0; + c < u.length; + c++ + ) { + var h = u[c], + d = h.source()[0], + p = h.target()[0], + g = s(d), + f = s(p), + v = a[g], + y = a[f]; + g !== f && (o.merge(h), v.merge(y), a.splice(f, 1)); + } + return o; + }, + }, + dt = Ke({ + root: null, + goal: null, + weight: function (e) { + return 1; + }, + heuristic: function (e) { + return 0; + }, + directed: !1, + }), + pt = { + aStar: function (e) { + var t = this.cy(), + n = dt(e), + r = n.root, + i = n.goal, + a = n.heuristic, + o = n.directed, + s = n.weight; + (r = t.collection(r)[0]), (i = t.collection(i)[0]); + var l, + u, + c, + h = r.id(), + d = i.id(), + p = {}, + g = {}, + f = {}, + v = new lt(function (e, t) { + return g[e.id()] - g[t.id()]; + }), + y = new rt(), + m = {}, + b = {}, + x = function (e, t) { + v.push(e), y.add(t); + }; + x(r, h), (p[h] = 0), (g[h] = a(r)); + for (var w = 0; v.size() > 0; ) { + if (((l = v.pop()), (u = l.id()), y.delete(u), w++, u === d)) { + for (var E = [], _ = i, T = d, D = b[T]; E.unshift(_), null != D && E.unshift(D), null != (_ = m[T]); ) D = b[(T = _.id())]; + return { found: !0, distance: p[u], path: this.spawn(E), steps: w }; + } + f[u] = !0; + for (var C = l._private.edges, N = 0; N < C.length; N++) { + var A = C[N]; + if (this.hasElementWithId(A.id()) && (!o || A.data("source") === u)) { + var L = A.source(), + k = A.target(), + S = L.id() !== u ? L : k, + I = S.id(); + if (this.hasElementWithId(I) && !f[I]) { + var M = p[u] + s(A); + (c = I), + y.has(c) + ? M < p[I] && ((p[I] = M), (g[I] = M + a(S)), (m[I] = l), (b[I] = A)) + : ((p[I] = M), (g[I] = M + a(S)), x(S, I), (m[I] = l), (b[I] = A)); + } + } + } + } + return { found: !1, distance: void 0, path: void 0, steps: w }; + }, + }, + gt = Ke({ + weight: function (e) { + return 1; + }, + directed: !1, + }), + ft = { + floydWarshall: function (e) { + for ( + var t = this.cy(), + n = gt(e), + r = n.weight, + i = n.directed, + a = r, + o = this.byGroup(), + s = o.nodes, + l = o.edges, + u = s.length, + c = u * u, + h = function (e) { + return s.indexOf(e); + }, + d = function (e) { + return s[e]; + }, + p = new Array(c), + g = 0; + g < c; + g++ + ) { + var v = g % u, + y = (g - v) / u; + p[g] = y === v ? 0 : 1 / 0; + } + for (var m = new Array(c), b = new Array(c), x = 0; x < l.length; x++) { + var w = l[x], + E = w.source()[0], + _ = w.target()[0]; + if (E !== _) { + var T = h(E), + D = h(_), + C = T * u + D, + N = a(w); + if ((p[C] > N && ((p[C] = N), (m[C] = D), (b[C] = w)), !i)) { + var A = D * u + T; + !i && p[A] > N && ((p[A] = N), (m[A] = T), (b[A] = w)); + } + } + } + for (var L = 0; L < u; L++) + for (var k = 0; k < u; k++) + for (var S = k * u + L, I = 0; I < u; I++) { + var M = k * u + I, + O = L * u + I; + p[S] + p[O] < p[M] && ((p[M] = p[S] + p[O]), (m[M] = m[S])); + } + var P = function (e) { + return h( + (function (e) { + return (f(e) ? t.filter(e) : e)[0]; + })(e), + ); + }, + R = { + distance: function (e, t) { + var n = P(e), + r = P(t); + return p[n * u + r]; + }, + path: function (e, n) { + var r = P(e), + i = P(n), + a = d(r); + if (r === i) return a.collection(); + if (null == m[r * u + i]) return t.collection(); + var o, + s = t.collection(), + l = r; + for (s.merge(a); r !== i; ) (l = r), (r = m[r * u + i]), (o = b[l * u + r]), s.merge(o), s.merge(d(r)); + return s; + }, + }; + return R; + }, + }, + vt = Ke({ + weight: function (e) { + return 1; + }, + directed: !1, + root: null, + }), + yt = { + bellmanFord: function (e) { + var t = this, + n = vt(e), + r = n.weight, + i = n.directed, + a = n.root, + o = r, + s = this, + l = this.cy(), + u = this.byGroup(), + c = u.edges, + h = u.nodes, + d = h.length, + p = new tt(), + g = !1, + v = []; + (a = l.collection(a)[0]), + c.unmergeBy(function (e) { + return e.isLoop(); + }); + for ( + var y = c.length, + m = function (e) { + var t = p.get(e.id()); + return t || ((t = {}), p.set(e.id(), t)), t; + }, + b = function (e) { + return (f(e) ? l.$(e) : e)[0]; + }, + x = 0; + x < d; + x++ + ) { + var w = h[x], + E = m(w); + w.same(a) ? (E.dist = 0) : (E.dist = 1 / 0), (E.pred = null), (E.edge = null); + } + for ( + var _ = !1, + T = function (e, t, n, r, i, a) { + var o = r.dist + a; + o < i.dist && !n.same(r.edge) && ((i.dist = o), (i.pred = e), (i.edge = n), (_ = !0)); + }, + D = 1; + D < d; + D++ + ) { + _ = !1; + for (var C = 0; C < y; C++) { + var N = c[C], + A = N.source(), + L = N.target(), + k = o(N), + S = m(A), + I = m(L); + T(A, 0, N, S, I, k), i || T(L, 0, N, I, S, k); + } + if (!_) break; + } + if (_) + for (var M = [], O = 0; O < y; O++) { + var P = c[O], + R = P.source(), + B = P.target(), + F = o(P), + z = m(R).dist, + G = m(B).dist; + if (z + F < G || (!i && G + F < z)) { + if ((g || (je("Graph contains a negative weight cycle for Bellman-Ford"), (g = !0)), !1 === e.findNegativeWeightCycles)) break; + var Y = []; + z + F < G && Y.push(R), !i && G + F < z && Y.push(B); + for (var X = Y.length, V = 0; V < X; V++) { + var U = Y[V], + j = [U]; + j.push(m(U).edge); + for (var q = m(U).pred; -1 === j.indexOf(q); ) j.push(q), j.push(m(q).edge), (q = m(q).pred); + for (var H = (j = j.slice(j.indexOf(q)))[0].id(), W = 0, $ = 2; $ < j.length; $ += 2) + j[$].id() < H && ((H = j[$].id()), (W = $)); + (j = j.slice(W).concat(j.slice(0, W))).push(j[0]); + var K = j + .map(function (e) { + return e.id(); + }) + .join(","); + -1 === M.indexOf(K) && (v.push(s.spawn(j)), M.push(K)); + } + } + } + return { + distanceTo: function (e) { + return m(b(e)).dist; + }, + pathTo: function (e) { + for (var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : a, r = [], i = b(e); ; ) { + if (null == i) return t.spawn(); + var o = m(i), + l = o.edge, + u = o.pred; + if ((r.unshift(i[0]), i.same(n) && r.length > 0)) break; + null != l && r.unshift(l), (i = u); + } + return s.spawn(r); + }, + hasNegativeWeightCycle: g, + negativeWeightCycles: v, + }; + }, + }, + mt = Math.sqrt(2), + bt = function (e, t, n) { + 0 === n.length && Ve("Karger-Stein must be run on a connected (sub)graph"); + for (var r = n[e], i = r[1], a = r[2], o = t[i], s = t[a], l = n, u = l.length - 1; u >= 0; u--) { + var c = l[u], + h = c[1], + d = c[2]; + ((t[h] === o && t[d] === s) || (t[h] === s && t[d] === o)) && l.splice(u, 1); + } + for (var p = 0; p < l.length; p++) { + var g = l[p]; + g[1] === s ? ((l[p] = g.slice()), (l[p][1] = o)) : g[2] === s && ((l[p] = g.slice()), (l[p][2] = o)); + } + for (var f = 0; f < t.length; f++) t[f] === s && (t[f] = o); + return l; + }, + xt = function (e, t, n, r) { + for (; n > r; ) { + var i = Math.floor(Math.random() * t.length); + (t = bt(i, e, t)), n--; + } + return t; + }, + wt = { + kargerStein: function () { + var e = this, + t = this.byGroup(), + n = t.nodes, + r = t.edges; + r.unmergeBy(function (e) { + return e.isLoop(); + }); + var i = n.length, + a = r.length, + o = Math.ceil(Math.pow(Math.log(i) / Math.LN2, 2)), + s = Math.floor(i / mt); + if (!(i < 2)) { + for (var l = [], u = 0; u < a; u++) { + var c = r[u]; + l.push([u, n.indexOf(c.source()), n.indexOf(c.target())]); + } + for ( + var h = 1 / 0, + d = [], + p = new Array(i), + g = new Array(i), + f = new Array(i), + v = function (e, t) { + for (var n = 0; n < i; n++) t[n] = e[n]; + }, + y = 0; + y <= o; + y++ + ) { + for (var m = 0; m < i; m++) g[m] = m; + var b = xt(g, l.slice(), i, s), + x = b.slice(); + v(g, f); + var w = xt(g, b, s, 2), + E = xt(f, x, s, 2); + w.length <= E.length && w.length < h + ? ((h = w.length), (d = w), v(g, p)) + : E.length <= w.length && E.length < h && ((h = E.length), (d = E), v(f, p)); + } + for ( + var _ = this.spawn( + d.map(function (e) { + return r[e[0]]; + }), + ), + T = this.spawn(), + D = this.spawn(), + C = p[0], + N = 0; + N < p.length; + N++ + ) { + var A = p[N], + L = n[N]; + A === C ? T.merge(L) : D.merge(L); + } + var k = function (t) { + var n = e.spawn(); + return ( + t.forEach(function (t) { + n.merge(t), + t.connectedEdges().forEach(function (t) { + e.contains(t) && !_.contains(t) && n.merge(t); + }); + }), + n + ); + }, + S = [k(T), k(D)]; + return { cut: _, components: S, partition1: T, partition2: D }; + } + Ve("At least 2 nodes are required for Karger-Stein algorithm"); + }, + }, + Et = function (e, t, n) { + return { x: e.x * t + n.x, y: e.y * t + n.y }; + }, + _t = function (e, t, n) { + return { x: (e.x - n.x) / t, y: (e.y - n.y) / t }; + }, + Tt = function (e) { + return { x: e[0], y: e[1] }; + }, + Dt = function (e, t) { + return Math.atan2(t, e) - Math.PI / 2; + }, + Ct = + Math.log2 || + function (e) { + return Math.log(e) / Math.log(2); + }, + Nt = function (e) { + return e > 0 ? 1 : e < 0 ? -1 : 0; + }, + At = function (e, t) { + return Math.sqrt(Lt(e, t)); + }, + Lt = function (e, t) { + var n = t.x - e.x, + r = t.y - e.y; + return n * n + r * r; + }, + kt = function (e) { + for (var t = e.length, n = 0, r = 0; r < t; r++) n += e[r]; + for (var i = 0; i < t; i++) e[i] = e[i] / n; + return e; + }, + St = function (e, t, n, r) { + return (1 - r) * (1 - r) * e + 2 * (1 - r) * r * t + r * r * n; + }, + It = function (e, t, n, r) { + return { x: St(e.x, t.x, n.x, r), y: St(e.y, t.y, n.y, r) }; + }, + Mt = function (e, t, n) { + return Math.max(e, Math.min(n, t)); + }, + Ot = function (e) { + if (null == e) return { x1: 1 / 0, y1: 1 / 0, x2: -1 / 0, y2: -1 / 0, w: 0, h: 0 }; + if (null != e.x1 && null != e.y1) { + if (null != e.x2 && null != e.y2 && e.x2 >= e.x1 && e.y2 >= e.y1) + return { x1: e.x1, y1: e.y1, x2: e.x2, y2: e.y2, w: e.x2 - e.x1, h: e.y2 - e.y1 }; + if (null != e.w && null != e.h && e.w >= 0 && e.h >= 0) return { x1: e.x1, y1: e.y1, x2: e.x1 + e.w, y2: e.y1 + e.h, w: e.w, h: e.h }; + } + }, + Pt = function (e, t, n) { + (e.x1 = Math.min(e.x1, t)), + (e.x2 = Math.max(e.x2, t)), + (e.w = e.x2 - e.x1), + (e.y1 = Math.min(e.y1, n)), + (e.y2 = Math.max(e.y2, n)), + (e.h = e.y2 - e.y1); + }, + Rt = function (e) { + var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; + return (e.x1 -= t), (e.x2 += t), (e.y1 -= t), (e.y2 += t), (e.w = e.x2 - e.x1), (e.h = e.y2 - e.y1), e; + }, + Bt = function (e) { + var t, + n, + r, + i, + a = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [0]; + if (1 === a.length) t = n = r = i = a[0]; + else if (2 === a.length) (t = r = a[0]), (i = n = a[1]); + else if (4 === a.length) { + var s = o(a, 4); + (t = s[0]), (n = s[1]), (r = s[2]), (i = s[3]); + } + return (e.x1 -= i), (e.x2 += n), (e.y1 -= t), (e.y2 += r), (e.w = e.x2 - e.x1), (e.h = e.y2 - e.y1), e; + }, + Ft = function (e, t) { + (e.x1 = t.x1), (e.y1 = t.y1), (e.x2 = t.x2), (e.y2 = t.y2), (e.w = e.x2 - e.x1), (e.h = e.y2 - e.y1); + }, + zt = function (e, t) { + return !(e.x1 > t.x2 || t.x1 > e.x2 || e.x2 < t.x1 || t.x2 < e.x1 || e.y2 < t.y1 || t.y2 < e.y1 || e.y1 > t.y2 || t.y1 > e.y2); + }, + Gt = function (e, t, n) { + return e.x1 <= t && t <= e.x2 && e.y1 <= n && n <= e.y2; + }, + Yt = function (e, t) { + return Gt(e, t.x1, t.y1) && Gt(e, t.x2, t.y2); + }, + Xt = function (e, t, n, r, i, a, o) { + var s, + l = sn(i, a), + u = i / 2, + c = a / 2, + h = r - c - o; + if ((s = en(e, t, n, r, n - u + l - o, h, n + u - l + o, h, !1)).length > 0) return s; + var d = n + u + o; + if ((s = en(e, t, n, r, d, r - c + l - o, d, r + c - l + o, !1)).length > 0) return s; + var p = r + c + o; + if ((s = en(e, t, n, r, n - u + l - o, p, n + u - l + o, p, !1)).length > 0) return s; + var g, + f = n - u - o; + if ((s = en(e, t, n, r, f, r - c + l - o, f, r + c - l + o, !1)).length > 0) return s; + var v = n - u + l, + y = r - c + l; + if ((g = Qt(e, t, n, r, v, y, l + o)).length > 0 && g[0] <= v && g[1] <= y) return [g[0], g[1]]; + var m = n + u - l, + b = r - c + l; + if ((g = Qt(e, t, n, r, m, b, l + o)).length > 0 && g[0] >= m && g[1] <= b) return [g[0], g[1]]; + var x = n + u - l, + w = r + c - l; + if ((g = Qt(e, t, n, r, x, w, l + o)).length > 0 && g[0] >= x && g[1] >= w) return [g[0], g[1]]; + var E = n - u + l, + _ = r + c - l; + return (g = Qt(e, t, n, r, E, _, l + o)).length > 0 && g[0] <= E && g[1] >= _ ? [g[0], g[1]] : []; + }, + Vt = function (e, t, n, r, i, a, o) { + var s = o, + l = Math.min(n, i), + u = Math.max(n, i), + c = Math.min(r, a), + h = Math.max(r, a); + return l - s <= e && e <= u + s && c - s <= t && t <= h + s; + }, + Ut = function (e, t, n, r, i, a, o, s, l) { + var u = Math.min(n, o, i) - l, + c = Math.max(n, o, i) + l, + h = Math.min(r, s, a) - l, + d = Math.max(r, s, a) + l; + return !(e < u || e > c || t < h || t > d); + }, + jt = function (e, t, n, r, i, a, o, s) { + var l, + u, + c, + h, + d, + p, + g, + f, + v, + y, + m, + b, + x, + w = []; + (u = 9 * n * i - 3 * n * n - 3 * n * o - 6 * i * i + 3 * i * o + 9 * r * a - 3 * r * r - 3 * r * s - 6 * a * a + 3 * a * s), + (c = + 3 * n * n - + 6 * n * i + + n * o - + n * e + + 2 * i * i + + 2 * i * e - + o * e + + 3 * r * r - + 6 * r * a + + r * s - + r * t + + 2 * a * a + + 2 * a * t - + s * t), + (h = 1 * n * i - n * n + n * e - i * e + r * a - r * r + r * t - a * t), + 0 === + (l = + 1 * n * n - + 4 * n * i + + 2 * n * o + + 4 * i * i - + 4 * i * o + + o * o + + r * r - + 4 * r * a + + 2 * r * s + + 4 * a * a - + 4 * a * s + + s * s) && (l = 1e-5), + (f = -27 * (h /= l) + (u /= l) * (9 * (c /= l) - u * u * 2)), + (p = (g = (3 * c - u * u) / 9) * g * g + (f /= 54) * f), + ((d = w)[1] = 0), + (b = u / 3), + p > 0 + ? ((y = (y = f + Math.sqrt(p)) < 0 ? -Math.pow(-y, 1 / 3) : Math.pow(y, 1 / 3)), + (m = (m = f - Math.sqrt(p)) < 0 ? -Math.pow(-m, 1 / 3) : Math.pow(m, 1 / 3)), + (d[0] = -b + y + m), + (b += (y + m) / 2), + (d[4] = d[2] = -b), + (b = (Math.sqrt(3) * (-m + y)) / 2), + (d[3] = b), + (d[5] = -b)) + : ((d[5] = d[3] = 0), + 0 === p + ? ((x = f < 0 ? -Math.pow(-f, 1 / 3) : Math.pow(f, 1 / 3)), (d[0] = 2 * x - b), (d[4] = d[2] = -(x + b))) + : ((v = (g = -g) * g * g), + (v = Math.acos(f / Math.sqrt(v))), + (x = 2 * Math.sqrt(g)), + (d[0] = -b + x * Math.cos(v / 3)), + (d[2] = -b + x * Math.cos((v + 2 * Math.PI) / 3)), + (d[4] = -b + x * Math.cos((v + 4 * Math.PI) / 3)))); + for (var E = [], _ = 0; _ < 6; _ += 2) Math.abs(w[_ + 1]) < 1e-7 && w[_] >= 0 && w[_] <= 1 && E.push(w[_]); + E.push(1), E.push(0); + for (var T, D, C, N = -1, A = 0; A < E.length; A++) + (T = Math.pow(1 - E[A], 2) * n + 2 * (1 - E[A]) * E[A] * i + E[A] * E[A] * o), + (D = Math.pow(1 - E[A], 2) * r + 2 * (1 - E[A]) * E[A] * a + E[A] * E[A] * s), + (C = Math.pow(T - e, 2) + Math.pow(D - t, 2)), + N >= 0 ? C < N && (N = C) : (N = C); + return N; + }, + qt = function (e, t, n, r, i, a) { + var o = [e - n, t - r], + s = [i - n, a - r], + l = s[0] * s[0] + s[1] * s[1], + u = o[0] * o[0] + o[1] * o[1], + c = o[0] * s[0] + o[1] * s[1], + h = (c * c) / l; + return c < 0 ? u : h > l ? (e - i) * (e - i) + (t - a) * (t - a) : u - h; + }, + Ht = function (e, t, n) { + for (var r, i, a, o, s = 0, l = 0; l < n.length / 2; l++) + if ( + ((r = n[2 * l]), + (i = n[2 * l + 1]), + l + 1 < n.length / 2 + ? ((a = n[2 * (l + 1)]), (o = n[2 * (l + 1) + 1])) + : ((a = n[2 * (l + 1 - n.length / 2)]), (o = n[2 * (l + 1 - n.length / 2) + 1])), + r == e && a == e) + ); + else { + if (!((r >= e && e >= a) || (r <= e && e <= a))) continue; + ((e - r) / (a - r)) * (o - i) + i > t && s++; + } + return s % 2 != 0; + }, + Wt = function (e, t, n, r, i, a, o, s, l) { + var u, + c = new Array(n.length); + null != s[0] ? ((u = Math.atan(s[1] / s[0])), s[0] < 0 ? (u += Math.PI / 2) : (u = -u - Math.PI / 2)) : (u = s); + for (var h, d = Math.cos(-u), p = Math.sin(-u), g = 0; g < c.length / 2; g++) + (c[2 * g] = (a / 2) * (n[2 * g] * d - n[2 * g + 1] * p)), + (c[2 * g + 1] = (o / 2) * (n[2 * g + 1] * d + n[2 * g] * p)), + (c[2 * g] += r), + (c[2 * g + 1] += i); + if (l > 0) { + var f = Kt(c, -l); + h = $t(f); + } else h = c; + return Ht(e, t, h); + }, + $t = function (e) { + for (var t, n, r, i, a, o, s, l, u = new Array(e.length / 2), c = 0; c < e.length / 4; c++) { + (t = e[4 * c]), + (n = e[4 * c + 1]), + (r = e[4 * c + 2]), + (i = e[4 * c + 3]), + c < e.length / 4 - 1 + ? ((a = e[4 * (c + 1)]), (o = e[4 * (c + 1) + 1]), (s = e[4 * (c + 1) + 2]), (l = e[4 * (c + 1) + 3])) + : ((a = e[0]), (o = e[1]), (s = e[2]), (l = e[3])); + var h = en(t, n, r, i, a, o, s, l, !0); + (u[2 * c] = h[0]), (u[2 * c + 1] = h[1]); + } + return u; + }, + Kt = function (e, t) { + for (var n, r, i, a, o = new Array(2 * e.length), s = 0; s < e.length / 2; s++) { + (n = e[2 * s]), (r = e[2 * s + 1]), s < e.length / 2 - 1 ? ((i = e[2 * (s + 1)]), (a = e[2 * (s + 1) + 1])) : ((i = e[0]), (a = e[1])); + var l = a - r, + u = -(i - n), + c = Math.sqrt(l * l + u * u), + h = l / c, + d = u / c; + (o[4 * s] = n + h * t), (o[4 * s + 1] = r + d * t), (o[4 * s + 2] = i + h * t), (o[4 * s + 3] = a + d * t); + } + return o; + }, + Zt = function (e, t, n, r, i, a, o) { + return (e -= i), (t -= a), (e /= n / 2 + o) * e + (t /= r / 2 + o) * t <= 1; + }, + Qt = function (e, t, n, r, i, a, o) { + var s = [n - e, r - t], + l = [e - i, t - a], + u = s[0] * s[0] + s[1] * s[1], + c = 2 * (l[0] * s[0] + l[1] * s[1]), + h = c * c - 4 * u * (l[0] * l[0] + l[1] * l[1] - o * o); + if (h < 0) return []; + var d = (-c + Math.sqrt(h)) / (2 * u), + p = (-c - Math.sqrt(h)) / (2 * u), + g = Math.min(d, p), + f = Math.max(d, p), + v = []; + if ((g >= 0 && g <= 1 && v.push(g), f >= 0 && f <= 1 && v.push(f), 0 === v.length)) return []; + var y = v[0] * s[0] + e, + m = v[0] * s[1] + t; + return v.length > 1 ? (v[0] == v[1] ? [y, m] : [y, m, v[1] * s[0] + e, v[1] * s[1] + t]) : [y, m]; + }, + Jt = function (e, t, n) { + return (t <= e && e <= n) || (n <= e && e <= t) ? e : (e <= t && t <= n) || (n <= t && t <= e) ? t : n; + }, + en = function (e, t, n, r, i, a, o, s, l) { + var u = e - i, + c = n - e, + h = o - i, + d = t - a, + p = r - t, + g = s - a, + f = h * d - g * u, + v = c * d - p * u, + y = g * c - h * p; + if (0 !== y) { + var m = f / y, + b = v / y, + x = -0.001; + return (x <= m && m <= 1.001 && x <= b && b <= 1.001) || l ? [e + m * c, t + m * p] : []; + } + return 0 === f || 0 === v ? (Jt(e, n, o) === o ? [o, s] : Jt(e, n, i) === i ? [i, a] : Jt(i, o, n) === n ? [n, r] : []) : []; + }, + tn = function (e, t, n, r, i, a, o, s) { + var l, + u, + c, + h, + d, + p, + g = [], + f = new Array(n.length), + v = !0; + if ((null == a && (v = !1), v)) { + for (var y = 0; y < f.length / 2; y++) (f[2 * y] = n[2 * y] * a + r), (f[2 * y + 1] = n[2 * y + 1] * o + i); + if (s > 0) { + var m = Kt(f, -s); + u = $t(m); + } else u = f; + } else u = n; + for (var b = 0; b < u.length / 2; b++) + (c = u[2 * b]), + (h = u[2 * b + 1]), + b < u.length / 2 - 1 ? ((d = u[2 * (b + 1)]), (p = u[2 * (b + 1) + 1])) : ((d = u[0]), (p = u[1])), + 0 !== (l = en(e, t, r, i, c, h, d, p)).length && g.push(l[0], l[1]); + return g; + }, + nn = function (e, t, n) { + var r = [e[0] - t[0], e[1] - t[1]], + i = Math.sqrt(r[0] * r[0] + r[1] * r[1]), + a = (i - n) / i; + return a < 0 && (a = 1e-5), [t[0] + a * r[0], t[1] + a * r[1]]; + }, + rn = function (e, t) { + var n = on(e, t); + return an(n); + }, + an = function (e) { + for (var t, n, r = e.length / 2, i = 1 / 0, a = 1 / 0, o = -1 / 0, s = -1 / 0, l = 0; l < r; l++) + (t = e[2 * l]), (n = e[2 * l + 1]), (i = Math.min(i, t)), (o = Math.max(o, t)), (a = Math.min(a, n)), (s = Math.max(s, n)); + for (var u = 2 / (o - i), c = 2 / (s - a), h = 0; h < r; h++) + (t = e[2 * h] = e[2 * h] * u), + (n = e[2 * h + 1] = e[2 * h + 1] * c), + (i = Math.min(i, t)), + (o = Math.max(o, t)), + (a = Math.min(a, n)), + (s = Math.max(s, n)); + if (a < -1) for (var d = 0; d < r; d++) n = e[2 * d + 1] = e[2 * d + 1] + (-1 - a); + return e; + }, + on = function (e, t) { + var n = (1 / e) * 2 * Math.PI, + r = e % 2 == 0 ? Math.PI / 2 + n / 2 : Math.PI / 2; + r += t; + for (var i, a = new Array(2 * e), o = 0; o < e; o++) (i = o * n + r), (a[2 * o] = Math.cos(i)), (a[2 * o + 1] = Math.sin(-i)); + return a; + }, + sn = function (e, t) { + return Math.min(e / 4, t / 4, 8); + }, + ln = function (e, t) { + return Math.min(e / 10, t / 10, 8); + }, + un = function (e, t) { + return { + heightOffset: Math.min(15, 0.05 * t), + widthOffset: Math.min(100, 0.25 * e), + ctrlPtOffsetPct: 0.05, + }; + }, + cn = Ke({ + dampingFactor: 0.8, + precision: 1e-6, + iterations: 200, + weight: function (e) { + return 1; + }, + }), + hn = { + pageRank: function (e) { + for ( + var t = cn(e), + n = t.dampingFactor, + r = t.precision, + i = t.iterations, + a = t.weight, + o = this._private.cy, + s = this.byGroup(), + l = s.nodes, + u = s.edges, + c = l.length, + h = c * c, + d = u.length, + p = new Array(h), + g = new Array(c), + f = (1 - n) / c, + v = 0; + v < c; + v++ + ) { + for (var y = 0; y < c; y++) p[v * c + y] = 0; + g[v] = 0; + } + for (var m = 0; m < d; m++) { + var b = u[m], + x = b.data("source"), + w = b.data("target"); + if (x !== w) { + var E = l.indexOfId(x), + _ = l.indexOfId(w), + T = a(b); + (p[_ * c + E] += T), (g[E] += T); + } + } + for (var D = 1 / c + f, C = 0; C < c; C++) + if (0 === g[C]) for (var N = 0; N < c; N++) p[N * c + C] = D; + else + for (var A = 0; A < c; A++) { + var L = A * c + C; + p[L] = p[L] / g[C] + f; + } + for (var k, S = new Array(c), I = new Array(c), M = 0; M < c; M++) S[M] = 1; + for (var O = 0; O < i; O++) { + for (var P = 0; P < c; P++) I[P] = 0; + for (var R = 0; R < c; R++) + for (var B = 0; B < c; B++) { + var F = R * c + B; + I[R] += p[F] * S[B]; + } + kt(I), (k = S), (S = I), (I = k); + for (var z = 0, G = 0; G < c; G++) { + var Y = k[G] - S[G]; + z += Y * Y; + } + if (z < r) break; + } + return { + rank: function (e) { + return (e = o.collection(e)[0]), S[l.indexOf(e)]; + }, + }; + }, + }, + dn = Ke({ + root: null, + weight: function (e) { + return 1; + }, + directed: !1, + alpha: 0, + }), + pn = { + degreeCentralityNormalized: function (e) { + e = dn(e); + var t = this.cy(), + n = this.nodes(), + r = n.length; + if (e.directed) { + for (var i = {}, a = {}, o = 0, s = 0, l = 0; l < r; l++) { + var u = n[l], + c = u.id(); + e.root = u; + var h = this.degreeCentrality(e); + o < h.indegree && (o = h.indegree), s < h.outdegree && (s = h.outdegree), (i[c] = h.indegree), (a[c] = h.outdegree); + } + return { + indegree: function (e) { + return 0 == o ? 0 : (f(e) && (e = t.filter(e)), i[e.id()] / o); + }, + outdegree: function (e) { + return 0 === s ? 0 : (f(e) && (e = t.filter(e)), a[e.id()] / s); + }, + }; + } + for (var d = {}, p = 0, g = 0; g < r; g++) { + var v = n[g]; + e.root = v; + var y = this.degreeCentrality(e); + p < y.degree && (p = y.degree), (d[v.id()] = y.degree); + } + return { + degree: function (e) { + return 0 === p ? 0 : (f(e) && (e = t.filter(e)), d[e.id()] / p); + }, + }; + }, + degreeCentrality: function (e) { + e = dn(e); + var t = this.cy(), + n = this, + r = e, + i = r.root, + a = r.weight, + o = r.directed, + s = r.alpha; + if (((i = t.collection(i)[0]), o)) { + for ( + var l = i.connectedEdges(), + u = l.filter(function (e) { + return e.target().same(i) && n.has(e); + }), + c = l.filter(function (e) { + return e.source().same(i) && n.has(e); + }), + h = u.length, + d = c.length, + p = 0, + g = 0, + f = 0; + f < u.length; + f++ + ) + p += a(u[f]); + for (var v = 0; v < c.length; v++) g += a(c[v]); + return { + indegree: Math.pow(h, 1 - s) * Math.pow(p, s), + outdegree: Math.pow(d, 1 - s) * Math.pow(g, s), + }; + } + for (var y = i.connectedEdges().intersection(n), m = y.length, b = 0, x = 0; x < y.length; x++) b += a(y[x]); + return { degree: Math.pow(m, 1 - s) * Math.pow(b, s) }; + }, + }; + (pn.dc = pn.degreeCentrality), (pn.dcn = pn.degreeCentralityNormalised = pn.degreeCentralityNormalized); + var gn = Ke({ + harmonic: !0, + weight: function () { + return 1; + }, + directed: !1, + root: null, + }), + fn = { + closenessCentralityNormalized: function (e) { + for ( + var t = gn(e), + n = t.harmonic, + r = t.weight, + i = t.directed, + a = this.cy(), + o = {}, + s = 0, + l = this.nodes(), + u = this.floydWarshall({ weight: r, directed: i }), + c = 0; + c < l.length; + c++ + ) { + for (var h = 0, d = l[c], p = 0; p < l.length; p++) + if (c !== p) { + var g = u.distance(d, l[p]); + h += n ? 1 / g : g; + } + n || (h = 1 / h), s < h && (s = h), (o[d.id()] = h); + } + return { + closeness: function (e) { + return 0 == s ? 0 : ((e = f(e) ? a.filter(e)[0].id() : e.id()), o[e] / s); + }, + }; + }, + closenessCentrality: function (e) { + var t = gn(e), + n = t.root, + r = t.weight, + i = t.directed, + a = t.harmonic; + n = this.filter(n)[0]; + for (var o = this.dijkstra({ root: n, weight: r, directed: i }), s = 0, l = this.nodes(), u = 0; u < l.length; u++) { + var c = l[u]; + if (!c.same(n)) { + var h = o.distanceTo(c); + s += a ? 1 / h : h; + } + } + return a ? s : 1 / s; + }, + }; + (fn.cc = fn.closenessCentrality), (fn.ccn = fn.closenessCentralityNormalised = fn.closenessCentralityNormalized); + var vn = Ke({ weight: null, directed: !1 }), + yn = { + betweennessCentrality: function (e) { + for ( + var t = vn(e), + n = t.directed, + r = t.weight, + i = null != r, + a = this.cy(), + o = this.nodes(), + s = {}, + l = {}, + u = 0, + c = { + set: function (e, t) { + (l[e] = t), t > u && (u = t); + }, + get: function (e) { + return l[e]; + }, + }, + h = 0; + h < o.length; + h++ + ) { + var d = o[h], + p = d.id(); + (s[p] = n ? d.outgoers().nodes() : d.openNeighborhood().nodes()), c.set(p, 0); + } + for ( + var g = function (e) { + for ( + var t = o[e].id(), + n = [], + l = {}, + u = {}, + h = {}, + d = new lt(function (e, t) { + return h[e] - h[t]; + }), + p = 0; + p < o.length; + p++ + ) { + var g = o[p].id(); + (l[g] = []), (u[g] = 0), (h[g] = 1 / 0); + } + for (u[t] = 1, h[t] = 0, d.push(t); !d.empty(); ) { + var f = d.pop(); + if ((n.push(f), i)) + for (var v = 0; v < s[f].length; v++) { + var y, + m = s[f][v], + b = a.getElementById(f); + y = b.edgesTo(m).length > 0 ? b.edgesTo(m)[0] : m.edgesTo(b)[0]; + var x = r(y); + (m = m.id()), + h[m] > h[f] + x && ((h[m] = h[f] + x), d.nodes.indexOf(m) < 0 ? d.push(m) : d.updateItem(m), (u[m] = 0), (l[m] = [])), + h[m] == h[f] + x && ((u[m] = u[m] + u[f]), l[m].push(f)); + } + else + for (var w = 0; w < s[f].length; w++) { + var E = s[f][w].id(); + h[E] == 1 / 0 && (d.push(E), (h[E] = h[f] + 1)), h[E] == h[f] + 1 && ((u[E] = u[E] + u[f]), l[E].push(f)); + } + } + for (var _ = {}, T = 0; T < o.length; T++) _[o[T].id()] = 0; + for (; n.length > 0; ) { + for (var D = n.pop(), C = 0; C < l[D].length; C++) { + var N = l[D][C]; + _[N] = _[N] + (u[N] / u[D]) * (1 + _[D]); + } + D != o[e].id() && c.set(D, c.get(D) + _[D]); + } + }, + f = 0; + f < o.length; + f++ + ) + g(f); + var v = { + betweenness: function (e) { + var t = a.collection(e).id(); + return c.get(t); + }, + betweennessNormalized: function (e) { + if (0 == u) return 0; + var t = a.collection(e).id(); + return c.get(t) / u; + }, + }; + return (v.betweennessNormalised = v.betweennessNormalized), v; + }, + }; + yn.bc = yn.betweennessCentrality; + var mn = Ke({ + expandFactor: 2, + inflateFactor: 2, + multFactor: 1, + maxIterations: 20, + attributes: [ + function (e) { + return 1; + }, + ], + }), + bn = function (e, t) { + for (var n = 0, r = 0; r < t.length; r++) n += t[r](e); + return n; + }, + xn = function (e, t) { + for (var n, r = 0; r < t; r++) { + n = 0; + for (var i = 0; i < t; i++) n += e[i * t + r]; + for (var a = 0; a < t; a++) e[a * t + r] = e[a * t + r] / n; + } + }, + wn = function (e, t, n) { + for (var r = new Array(n * n), i = 0; i < n; i++) { + for (var a = 0; a < n; a++) r[i * n + a] = 0; + for (var o = 0; o < n; o++) for (var s = 0; s < n; s++) r[i * n + s] += e[i * n + o] * t[o * n + s]; + } + return r; + }, + En = function (e, t, n) { + for (var r = e.slice(0), i = 1; i < n; i++) e = wn(e, r, t); + return e; + }, + _n = function (e, t, n) { + for (var r = new Array(t * t), i = 0; i < t * t; i++) r[i] = Math.pow(e[i], n); + return xn(r, t), r; + }, + Tn = function (e, t, n, r) { + for (var i = 0; i < n; i++) + if (Math.round(e[i] * Math.pow(10, r)) / Math.pow(10, r) != Math.round(t[i] * Math.pow(10, r)) / Math.pow(10, r)) return !1; + return !0; + }, + Dn = function (e, t) { + for (var n = 0; n < e.length; n++) if (!t[n] || e[n].id() !== t[n].id()) return !1; + return !0; + }, + Cn = function (e) { + for ( + var t = this.nodes(), + n = this.edges(), + r = this.cy(), + i = (function (e) { + return mn(e); + })(e), + a = {}, + o = 0; + o < t.length; + o++ + ) + a[t[o].id()] = o; + for (var s, l = t.length, u = l * l, c = new Array(u), h = 0; h < u; h++) c[h] = 0; + for (var d = 0; d < n.length; d++) { + var p = n[d], + g = a[p.source().id()], + f = a[p.target().id()], + v = bn(p, i.attributes); + (c[g * l + f] += v), (c[f * l + g] += v); + } + (function (e, t, n) { + for (var r = 0; r < t; r++) e[r * t + r] = n; + })(c, l, i.multFactor), + xn(c, l); + for (var y = !0, m = 0; y && m < i.maxIterations; ) + (y = !1), (s = En(c, l, i.expandFactor)), (c = _n(s, l, i.inflateFactor)), Tn(c, s, u, 4) || (y = !0), m++; + var b = (function (e, t, n, r) { + for (var i = [], a = 0; a < t; a++) { + for (var o = [], s = 0; s < t; s++) Math.round(1e3 * e[a * t + s]) / 1e3 > 0 && o.push(n[s]); + 0 !== o.length && i.push(r.collection(o)); + } + return i; + })(c, l, t, r); + return (function (e) { + for (var t = 0; t < e.length; t++) for (var n = 0; n < e.length; n++) t != n && Dn(e[t], e[n]) && e.splice(n, 1); + return e; + })(b); + }, + Nn = { markovClustering: Cn, mcl: Cn }, + An = function (e) { + return e; + }, + Ln = function (e, t) { + return Math.abs(t - e); + }, + kn = function (e, t, n) { + return e + Ln(t, n); + }, + Sn = function (e, t, n) { + return e + Math.pow(n - t, 2); + }, + In = function (e) { + return Math.sqrt(e); + }, + Mn = function (e, t, n) { + return Math.max(e, Ln(t, n)); + }, + On = function (e, t, n, r, i) { + for (var a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : An, o = r, s = 0; s < e; s++) o = i(o, t(s), n(s)); + return a(o); + }, + Pn = { + euclidean: function (e, t, n) { + return e >= 2 ? On(e, t, n, 0, Sn, In) : On(e, t, n, 0, kn); + }, + squaredEuclidean: function (e, t, n) { + return On(e, t, n, 0, Sn); + }, + manhattan: function (e, t, n) { + return On(e, t, n, 0, kn); + }, + max: function (e, t, n) { + return On(e, t, n, -1 / 0, Mn); + }, + }; + function Rn(e, t, n, r, i, a) { + var o; + return (o = v(e) ? e : Pn[e] || Pn.euclidean), 0 === t && v(e) ? o(i, a) : o(t, n, r, i, a); + } + (Pn["squared-euclidean"] = Pn.squaredEuclidean), (Pn.squaredeuclidean = Pn.squaredEuclidean); + var Bn = Ke({ + k: 2, + m: 2, + sensitivityThreshold: 1e-4, + distance: "euclidean", + maxIterations: 10, + attributes: [], + testMode: !1, + testCentroids: null, + }), + Fn = function (e) { + return Bn(e); + }, + zn = function (e, t, n, r, i) { + var a = + "kMedoids" !== i + ? function (e) { + return n[e]; + } + : function (e) { + return r[e](n); + }, + o = n, + s = t; + return Rn( + e, + r.length, + a, + function (e) { + return r[e](t); + }, + o, + s, + ); + }, + Gn = function (e, t, n) { + for (var r = n.length, i = new Array(r), a = new Array(r), o = new Array(t), s = null, l = 0; l < r; l++) + (i[l] = e.min(n[l]).value), (a[l] = e.max(n[l]).value); + for (var u = 0; u < t; u++) { + s = []; + for (var c = 0; c < r; c++) s[c] = Math.random() * (a[c] - i[c]) + i[c]; + o[u] = s; + } + return o; + }, + Yn = function (e, t, n, r, i) { + for (var a = 1 / 0, o = 0, s = 0; s < t.length; s++) { + var l = zn(n, e, t[s], r, i); + l < a && ((a = l), (o = s)); + } + return o; + }, + Xn = function (e, t, n) { + for (var r = [], i = null, a = 0; a < t.length; a++) n[(i = t[a]).id()] === e && r.push(i); + return r; + }, + Vn = function (e, t, n) { + for (var r = 0; r < e.length; r++) for (var i = 0; i < e[r].length; i++) if (Math.abs(e[r][i] - t[r][i]) > n) return !1; + return !0; + }, + Un = function (e, t, n) { + for (var r = 0; r < n; r++) if (e === t[r]) return !0; + return !1; + }, + jn = function (e, t) { + var n = new Array(t); + if (e.length < 50) + for (var r = 0; r < t; r++) { + for (var i = e[Math.floor(Math.random() * e.length)]; Un(i, n, r); ) i = e[Math.floor(Math.random() * e.length)]; + n[r] = i; + } + else for (var a = 0; a < t; a++) n[a] = e[Math.floor(Math.random() * e.length)]; + return n; + }, + qn = function (e, t, n) { + for (var r = 0, i = 0; i < t.length; i++) r += zn("manhattan", t[i], e, n, "kMedoids"); + return r; + }, + Hn = function (e, t, n, r, i) { + for (var a, o, s = 0; s < t.length; s++) for (var l = 0; l < e.length; l++) r[s][l] = Math.pow(n[s][l], i.m); + for (var u = 0; u < e.length; u++) + for (var c = 0; c < i.attributes.length; c++) { + (a = 0), (o = 0); + for (var h = 0; h < t.length; h++) (a += r[h][u] * i.attributes[c](t[h])), (o += r[h][u]); + e[u][c] = a / o; + } + }, + Wn = function (e, t, n, r, i) { + for (var a = 0; a < e.length; a++) t[a] = e[a].slice(); + for (var o, s, l, u = 2 / (i.m - 1), c = 0; c < n.length; c++) + for (var h = 0; h < r.length; h++) { + o = 0; + for (var d = 0; d < n.length; d++) + (s = zn(i.distance, r[h], n[c], i.attributes, "cmeans")), + (l = zn(i.distance, r[h], n[d], i.attributes, "cmeans")), + (o += Math.pow(s / l, u)); + e[h][c] = 1 / o; + } + }, + $n = function (e, t, n, r) { + for (var i, a, o = new Array(n.k), s = 0; s < o.length; s++) o[s] = []; + for (var l = 0; l < t.length; l++) { + (i = -1 / 0), (a = -1); + for (var u = 0; u < t[0].length; u++) t[l][u] > i && ((i = t[l][u]), (a = u)); + o[a].push(e[l]); + } + for (var c = 0; c < o.length; c++) o[c] = r.collection(o[c]); + return o; + }, + Kn = function (e) { + var t, + n, + r, + i, + a = this.cy(), + o = this.nodes(), + s = Fn(e); + r = new Array(o.length); + for (var l = 0; l < o.length; l++) r[l] = new Array(s.k); + n = new Array(o.length); + for (var u = 0; u < o.length; u++) n[u] = new Array(s.k); + for (var c = 0; c < o.length; c++) { + for (var h = 0, d = 0; d < s.k; d++) (n[c][d] = Math.random()), (h += n[c][d]); + for (var p = 0; p < s.k; p++) n[c][p] = n[c][p] / h; + } + t = new Array(s.k); + for (var g = 0; g < s.k; g++) t[g] = new Array(s.attributes.length); + i = new Array(o.length); + for (var f = 0; f < o.length; f++) i[f] = new Array(s.k); + for (var v = !0, y = 0; v && y < s.maxIterations; ) + (v = !1), Hn(t, o, n, i, s), Wn(n, r, t, o, s), Vn(n, r, s.sensitivityThreshold) || (v = !0), y++; + return { clusters: $n(o, n, s, a), degreeOfMembership: n }; + }, + Zn = { + kMeans: function (t) { + var n, + r, + i, + a, + o = this.cy(), + s = this.nodes(), + l = null, + u = Fn(t), + c = new Array(u.k), + h = {}; + u.testMode + ? "number" == typeof u.testCentroids + ? (u.testCentroids, (n = Gn(s, u.k, u.attributes))) + : (n = "object" === e(u.testCentroids) ? u.testCentroids : Gn(s, u.k, u.attributes)) + : (n = Gn(s, u.k, u.attributes)); + for (var d = !0, p = 0; d && p < u.maxIterations; ) { + for (var g = 0; g < s.length; g++) h[(l = s[g]).id()] = Yn(l, n, u.distance, u.attributes, "kMeans"); + d = !1; + for (var f = 0; f < u.k; f++) { + var v = Xn(f, s, h); + if (0 !== v.length) { + for (var y = u.attributes.length, m = n[f], b = new Array(y), x = new Array(y), w = 0; w < y; w++) { + x[w] = 0; + for (var E = 0; E < v.length; E++) (l = v[E]), (x[w] += u.attributes[w](l)); + (b[w] = x[w] / v.length), (r = b[w]), (i = m[w]), (a = u.sensitivityThreshold), Math.abs(i - r) <= a || (d = !0); + } + (n[f] = b), (c[f] = o.collection(v)); + } + } + p++; + } + return c; + }, + kMedoids: function (t) { + var n, + r, + i = this.cy(), + a = this.nodes(), + o = null, + s = Fn(t), + l = new Array(s.k), + u = {}, + c = new Array(s.k); + s.testMode + ? "number" == typeof s.testCentroids || (n = "object" === e(s.testCentroids) ? s.testCentroids : jn(a, s.k)) + : (n = jn(a, s.k)); + for (var h = !0, d = 0; h && d < s.maxIterations; ) { + for (var p = 0; p < a.length; p++) u[(o = a[p]).id()] = Yn(o, n, s.distance, s.attributes, "kMedoids"); + h = !1; + for (var g = 0; g < n.length; g++) { + var f = Xn(g, a, u); + if (0 !== f.length) { + c[g] = qn(n[g], f, s.attributes); + for (var v = 0; v < f.length; v++) (r = qn(f[v], f, s.attributes)) < c[g] && ((c[g] = r), (n[g] = f[v]), (h = !0)); + l[g] = i.collection(f); + } + } + d++; + } + return l; + }, + fuzzyCMeans: Kn, + fcm: Kn, + }, + Qn = Ke({ + distance: "euclidean", + linkage: "min", + mode: "threshold", + threshold: 1 / 0, + addDendrogram: !1, + dendrogramDepth: 0, + attributes: [], + }), + Jn = { single: "min", complete: "max" }, + er = function (e, t, n, r, i) { + for ( + var a, + o = 0, + s = 1 / 0, + l = i.attributes, + u = function (e, t) { + return Rn( + i.distance, + l.length, + function (t) { + return l[t](e); + }, + function (e) { + return l[e](t); + }, + e, + t, + ); + }, + c = 0; + c < e.length; + c++ + ) { + var h = e[c].key, + d = n[h][r[h]]; + d < s && ((o = h), (s = d)); + } + if (("threshold" === i.mode && s >= i.threshold) || ("dendrogram" === i.mode && 1 === e.length)) return !1; + var p, + g = t[o], + f = t[r[o]]; + (p = "dendrogram" === i.mode ? { left: g, right: f, key: g.key } : { value: g.value.concat(f.value), key: g.key }), + (e[g.index] = p), + e.splice(f.index, 1), + (t[g.key] = p); + for (var v = 0; v < e.length; v++) { + var y = e[v]; + g.key === y.key + ? (a = 1 / 0) + : "min" === i.linkage + ? ((a = n[g.key][y.key]), n[g.key][y.key] > n[f.key][y.key] && (a = n[f.key][y.key])) + : "max" === i.linkage + ? ((a = n[g.key][y.key]), n[g.key][y.key] < n[f.key][y.key] && (a = n[f.key][y.key])) + : (a = + "mean" === i.linkage + ? (n[g.key][y.key] * g.size + n[f.key][y.key] * f.size) / (g.size + f.size) + : "dendrogram" === i.mode + ? u(y.value, g.value) + : u(y.value[0], g.value[0])), + (n[g.key][y.key] = n[y.key][g.key] = a); + } + for (var m = 0; m < e.length; m++) { + var b = e[m].key; + if (r[b] === g.key || r[b] === f.key) { + for (var x = b, w = 0; w < e.length; w++) { + var E = e[w].key; + n[b][E] < n[b][x] && (x = E); + } + r[b] = x; + } + e[m].index = m; + } + return (g.key = f.key = g.index = f.index = null), !0; + }, + tr = function e(t, n, r) { + t && (t.value ? n.push(t.value) : (t.left && e(t.left, n), t.right && e(t.right, n))); + }, + nr = function e(t, n) { + if (!t) return ""; + if (t.left && t.right) { + var r = e(t.left, n), + i = e(t.right, n), + a = n.add({ group: "nodes", data: { id: r + "," + i } }); + return ( + n.add({ group: "edges", data: { source: r, target: a.id() } }), n.add({ group: "edges", data: { source: i, target: a.id() } }), a.id() + ); + } + return t.value ? t.value.id() : void 0; + }, + rr = function e(t, n, r) { + if (!t) return []; + var i = [], + a = [], + o = []; + return 0 === n + ? (t.left && tr(t.left, i), t.right && tr(t.right, a), (o = i.concat(a)), [r.collection(o)]) + : 1 === n + ? t.value + ? [r.collection(t.value)] + : (t.left && tr(t.left, i), t.right && tr(t.right, a), [r.collection(i), r.collection(a)]) + : t.value + ? [r.collection(t.value)] + : (t.left && (i = e(t.left, n - 1, r)), t.right && (a = e(t.right, n - 1, r)), i.concat(a)); + }, + ir = function (e) { + for ( + var t = this.cy(), + n = this.nodes(), + r = (function (e) { + var t = Qn(e), + n = Jn[t.linkage]; + return null != n && (t.linkage = n), t; + })(e), + i = r.attributes, + a = function (e, t) { + return Rn( + r.distance, + i.length, + function (t) { + return i[t](e); + }, + function (e) { + return i[e](t); + }, + e, + t, + ); + }, + o = [], + s = [], + l = [], + u = [], + c = 0; + c < n.length; + c++ + ) { + var h = { value: "dendrogram" === r.mode ? n[c] : [n[c]], key: c, index: c }; + (o[c] = h), (u[c] = h), (s[c] = []), (l[c] = 0); + } + for (var d = 0; d < o.length; d++) + for (var p = 0; p <= d; p++) { + var g; + (g = "dendrogram" === r.mode ? (d === p ? 1 / 0 : a(o[d].value, o[p].value)) : d === p ? 1 / 0 : a(o[d].value[0], o[p].value[0])), + (s[d][p] = g), + (s[p][d] = g), + g < s[d][l[d]] && (l[d] = p); + } + for (var f, v = er(o, u, s, l, r); v; ) v = er(o, u, s, l, r); + return ( + "dendrogram" === r.mode + ? ((f = rr(o[0], r.dendrogramDepth, t)), r.addDendrogram && nr(o[0], t)) + : ((f = new Array(o.length)), + o.forEach(function (e, n) { + (e.key = e.index = null), (f[n] = t.collection(e.value)); + })), + f + ); + }, + ar = { hierarchicalClustering: ir, hca: ir }, + or = Ke({ + distance: "euclidean", + preference: "median", + damping: 0.8, + maxIterations: 1e3, + minIterations: 100, + attributes: [], + }), + sr = function (e, t, n, r) { + var i = function (e, t) { + return r[t](e); + }; + return -Rn( + e, + r.length, + function (e) { + return i(t, e); + }, + function (e) { + return i(n, e); + }, + t, + n, + ); + }, + lr = function (e, t) { + return "median" === t + ? (function (e) { + var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, + n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : e.length, + r = !(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4], + i = !(arguments.length > 5 && void 0 !== arguments[5]) || arguments[5]; + arguments.length > 3 && void 0 !== arguments[3] && !arguments[3] + ? (n < e.length && e.splice(n, e.length - n), t > 0 && e.splice(0, t)) + : (e = e.slice(t, n)); + for (var a = 0, o = e.length - 1; o >= 0; o--) { + var s = e[o]; + i ? isFinite(s) || ((e[o] = -1 / 0), a++) : e.splice(o, 1); + } + r && + e.sort(function (e, t) { + return e - t; + }); + var l = e.length, + u = Math.floor(l / 2); + return l % 2 != 0 ? e[u + 1 + a] : (e[u - 1 + a] + e[u + a]) / 2; + })(e) + : "mean" === t + ? (function (e) { + for ( + var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, + n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : e.length, + r = 0, + i = 0, + a = t; + a < n; + a++ + ) { + var o = e[a]; + isFinite(o) && ((r += o), i++); + } + return r / i; + })(e) + : "min" === t + ? (function (e) { + for ( + var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, + n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : e.length, + r = 1 / 0, + i = t; + i < n; + i++ + ) { + var a = e[i]; + isFinite(a) && (r = Math.min(a, r)); + } + return r; + })(e) + : "max" === t + ? (function (e) { + for ( + var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, + n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : e.length, + r = -1 / 0, + i = t; + i < n; + i++ + ) { + var a = e[i]; + isFinite(a) && (r = Math.max(a, r)); + } + return r; + })(e) + : t; + }, + ur = function (e, t, n) { + for (var r = [], i = 0; i < e; i++) { + for (var a = -1, o = -1 / 0, s = 0; s < n.length; s++) { + var l = n[s]; + t[i * e + l] > o && ((a = l), (o = t[i * e + l])); + } + a > 0 && r.push(a); + } + for (var u = 0; u < n.length; u++) r[n[u]] = n[u]; + return r; + }, + cr = function (e) { + for ( + var t, + n, + r, + i, + a, + o, + s = this.cy(), + l = this.nodes(), + u = (function (e) { + var t = e.damping, + n = e.preference; + (0.5 <= t && t < 1) || Ve("Damping must range on [0.5, 1). Got: ".concat(t)); + var r = ["median", "mean", "min", "max"]; + return ( + r.some(function (e) { + return e === n; + }) || + b(n) || + Ve( + "Preference must be one of [" + .concat( + r + .map(function (e) { + return "'".concat(e, "'"); + }) + .join(", "), + "] or a number. Got: ", + ) + .concat(n), + ), + or(e) + ); + })(e), + c = {}, + h = 0; + h < l.length; + h++ + ) + c[l[h].id()] = h; + (n = (t = l.length) * t), (r = new Array(n)); + for (var d = 0; d < n; d++) r[d] = -1 / 0; + for (var p = 0; p < t; p++) for (var g = 0; g < t; g++) p !== g && (r[p * t + g] = sr(u.distance, l[p], l[g], u.attributes)); + i = lr(r, u.preference); + for (var f = 0; f < t; f++) r[f * t + f] = i; + a = new Array(n); + for (var v = 0; v < n; v++) a[v] = 0; + o = new Array(n); + for (var y = 0; y < n; y++) o[y] = 0; + for (var m = new Array(t), x = new Array(t), w = new Array(t), E = 0; E < t; E++) (m[E] = 0), (x[E] = 0), (w[E] = 0); + for (var _, T = new Array(t * u.minIterations), D = 0; D < T.length; D++) T[D] = 0; + for (_ = 0; _ < u.maxIterations; _++) { + for (var C = 0; C < t; C++) { + for (var N = -1 / 0, A = -1 / 0, L = -1, k = 0, S = 0; S < t; S++) + (m[S] = a[C * t + S]), (k = o[C * t + S] + r[C * t + S]) >= N ? ((A = N), (N = k), (L = S)) : k > A && (A = k); + for (var I = 0; I < t; I++) a[C * t + I] = (1 - u.damping) * (r[C * t + I] - N) + u.damping * m[I]; + a[C * t + L] = (1 - u.damping) * (r[C * t + L] - A) + u.damping * m[L]; + } + for (var M = 0; M < t; M++) { + for (var O = 0, P = 0; P < t; P++) (m[P] = o[P * t + M]), (x[P] = Math.max(0, a[P * t + M])), (O += x[P]); + (O -= x[M]), (x[M] = a[M * t + M]), (O += x[M]); + for (var R = 0; R < t; R++) o[R * t + M] = (1 - u.damping) * Math.min(0, O - x[R]) + u.damping * m[R]; + o[M * t + M] = (1 - u.damping) * (O - x[M]) + u.damping * m[M]; + } + for (var B = 0, F = 0; F < t; F++) { + var z = o[F * t + F] + a[F * t + F] > 0 ? 1 : 0; + (T[(_ % u.minIterations) * t + F] = z), (B += z); + } + if (B > 0 && (_ >= u.minIterations - 1 || _ == u.maxIterations - 1)) { + for (var G = 0, Y = 0; Y < t; Y++) { + w[Y] = 0; + for (var X = 0; X < u.minIterations; X++) w[Y] += T[X * t + Y]; + (0 !== w[Y] && w[Y] !== u.minIterations) || G++; + } + if (G === t) break; + } + } + for ( + var V = (function (e, t, n) { + for (var r = [], i = 0; i < e; i++) t[i * e + i] + n[i * e + i] > 0 && r.push(i); + return r; + })(t, a, o), + U = (function (e, t, n) { + for (var r = ur(e, t, n), i = 0; i < n.length; i++) { + for (var a = [], o = 0; o < r.length; o++) r[o] === n[i] && a.push(o); + for (var s = -1, l = -1 / 0, u = 0; u < a.length; u++) { + for (var c = 0, h = 0; h < a.length; h++) c += t[a[h] * e + a[u]]; + c > l && ((s = u), (l = c)); + } + n[i] = a[s]; + } + return ur(e, t, n); + })(t, r, V), + j = {}, + q = 0; + q < V.length; + q++ + ) + j[V[q]] = []; + for (var H = 0; H < l.length; H++) { + var W = U[c[l[H].id()]]; + null != W && j[W].push(l[H]); + } + for (var $ = new Array(V.length), K = 0; K < V.length; K++) $[K] = s.collection(j[V[K]]); + return $; + }, + hr = { affinityPropagation: cr, ap: cr }, + dr = Ke({ root: void 0, directed: !1 }), + pr = { + hierholzer: function (e) { + if (!m(e)) { + var t = arguments; + e = { root: t[0], directed: t[1] }; + } + var n, + r, + i, + a = dr(e), + o = a.root, + s = a.directed, + l = this, + u = !1; + o && (i = f(o) ? this.filter(o)[0].id() : o[0].id()); + var c = {}, + h = {}; + s + ? l.forEach(function (e) { + var t = e.id(); + if (e.isNode()) { + var i = e.indegree(!0), + a = e.outdegree(!0), + o = i - a, + s = a - i; + 1 == o ? (n ? (u = !0) : (n = t)) : 1 == s ? (r ? (u = !0) : (r = t)) : (s > 1 || o > 1) && (u = !0), + (c[t] = []), + e.outgoers().forEach(function (e) { + e.isEdge() && c[t].push(e.id()); + }); + } else h[t] = [void 0, e.target().id()]; + }) + : l.forEach(function (e) { + var t = e.id(); + e.isNode() + ? (e.degree(!0) % 2 && (n ? (r ? (u = !0) : (r = t)) : (n = t)), + (c[t] = []), + e.connectedEdges().forEach(function (e) { + return c[t].push(e.id()); + })) + : (h[t] = [e.source().id(), e.target().id()]); + }); + var d = { found: !1, trail: void 0 }; + if (u) return d; + if (r && n) + if (s) { + if (i && r != i) return d; + i = r; + } else { + if (i && r != i && n != i) return d; + i || (i = r); + } + else i || (i = l[0].id()); + var p = function (e) { + for (var t, n, r, i = e, a = [e]; c[i].length; ) + (t = c[i].shift()), + (n = h[t][0]), + i != (r = h[t][1]) + ? ((c[r] = c[r].filter(function (e) { + return e != t; + })), + (i = r)) + : s || + i == n || + ((c[n] = c[n].filter(function (e) { + return e != t; + })), + (i = n)), + a.unshift(t), + a.unshift(i); + return a; + }, + g = [], + v = []; + for (v = p(i); 1 != v.length; ) + 0 == c[v[0]].length ? (g.unshift(l.getElementById(v.shift())), g.unshift(l.getElementById(v.shift()))) : (v = p(v.shift()).concat(v)); + for (var y in (g.unshift(l.getElementById(v.shift())), c)) if (c[y].length) return d; + return (d.found = !0), (d.trail = this.spawn(g, !0)), d; + }, + }, + gr = function () { + var e = this, + t = {}, + n = 0, + r = 0, + i = [], + a = [], + o = {}, + s = function s(l, u, c) { + l === c && (r += 1), (t[u] = { id: n, low: n++, cutVertex: !1 }); + var h, + d, + p, + g, + f = e.getElementById(u).connectedEdges().intersection(e); + 0 === f.size() + ? i.push(e.spawn(e.getElementById(u))) + : f.forEach(function (n) { + (h = n.source().id()), + (d = n.target().id()), + (p = h === u ? d : h) !== c && + ((g = n.id()), + o[g] || ((o[g] = !0), a.push({ x: u, y: p, edge: n })), + p in t + ? (t[u].low = Math.min(t[u].low, t[p].id)) + : (s(l, p, u), + (t[u].low = Math.min(t[u].low, t[p].low)), + t[u].id <= t[p].low && + ((t[u].cutVertex = !0), + (function (n, r) { + for (var o = a.length - 1, s = [], l = e.spawn(); a[o].x != n || a[o].y != r; ) s.push(a.pop().edge), o--; + s.push(a.pop().edge), + s.forEach(function (n) { + var r = n.connectedNodes().intersection(e); + l.merge(n), + r.forEach(function (n) { + var r = n.id(), + i = n.connectedEdges().intersection(e); + l.merge(n), + t[r].cutVertex + ? l.merge( + i.filter(function (e) { + return e.isLoop(); + }), + ) + : l.merge(i); + }); + }), + i.push(l); + })(u, p)))); + }); + }; + e.forEach(function (e) { + if (e.isNode()) { + var n = e.id(); + n in t || ((r = 0), s(n, n), (t[n].cutVertex = r > 1)); + } + }); + var l = Object.keys(t) + .filter(function (e) { + return t[e].cutVertex; + }) + .map(function (t) { + return e.getElementById(t); + }); + return { cut: e.spawn(l), components: i }; + }, + fr = function () { + var e = this, + t = {}, + n = 0, + r = [], + i = [], + a = e.spawn(e), + o = function o(s) { + if ( + (i.push(s), + (t[s] = { index: n, low: n++, explored: !1 }), + e + .getElementById(s) + .connectedEdges() + .intersection(e) + .forEach(function (e) { + var n = e.target().id(); + n !== s && (n in t || o(n), t[n].explored || (t[s].low = Math.min(t[s].low, t[n].low))); + }), + t[s].index === t[s].low) + ) { + for (var l = e.spawn(); ; ) { + var u = i.pop(); + if ((l.merge(e.getElementById(u)), (t[u].low = t[s].index), (t[u].explored = !0), u === s)) break; + } + var c = l.edgesWith(l), + h = l.merge(c); + r.push(h), (a = a.difference(h)); + } + }; + return ( + e.forEach(function (e) { + if (e.isNode()) { + var n = e.id(); + n in t || o(n); + } + }), + { cut: a, components: r } + ); + }, + vr = {}; + [ + ot, + ct, + ht, + pt, + ft, + yt, + wt, + hn, + pn, + fn, + yn, + Nn, + Zn, + ar, + hr, + pr, + { + hopcroftTarjanBiconnected: gr, + htbc: gr, + htb: gr, + hopcroftTarjanBiconnectedComponents: gr, + }, + { tarjanStronglyConnected: fr, tsc: fr, tscc: fr, tarjanStronglyConnectedComponents: fr }, + ].forEach(function (e) { + z(vr, e); + }); + var yr = function e(t) { + if (!(this instanceof e)) return new e(t); + (this.id = "Thenable/1.0.7"), + (this.state = 0), + (this.fulfillValue = void 0), + (this.rejectReason = void 0), + (this.onFulfilled = []), + (this.onRejected = []), + (this.proxy = { then: this.then.bind(this) }), + "function" == typeof t && t.call(this, this.fulfill.bind(this), this.reject.bind(this)); + }; + yr.prototype = { + fulfill: function (e) { + return mr(this, 1, "fulfillValue", e); + }, + reject: function (e) { + return mr(this, 2, "rejectReason", e); + }, + then: function (e, t) { + var n = this, + r = new yr(); + return n.onFulfilled.push(wr(e, r, "fulfill")), n.onRejected.push(wr(t, r, "reject")), br(n), r.proxy; + }, + }; + var mr = function (e, t, n, r) { + return 0 === e.state && ((e.state = t), (e[n] = r), br(e)), e; + }, + br = function (e) { + 1 === e.state ? xr(e, "onFulfilled", e.fulfillValue) : 2 === e.state && xr(e, "onRejected", e.rejectReason); + }, + xr = function (e, t, n) { + if (0 !== e[t].length) { + var r = e[t]; + e[t] = []; + var i = function () { + for (var e = 0; e < r.length; e++) r[e](n); + }; + "function" == typeof setImmediate ? setImmediate(i) : setTimeout(i, 0); + } + }, + wr = function (e, t, n) { + return function (r) { + if ("function" != typeof e) t[n].call(t, r); + else { + var i; + try { + i = e(r); + } catch (e) { + return void t.reject(e); + } + Er(t, i); + } + }; + }, + Er = function t(n, r) { + if (n !== r && n.proxy !== r) { + var i; + if (("object" === e(r) && null !== r) || "function" == typeof r) + try { + i = r.then; + } catch (e) { + return void n.reject(e); + } + if ("function" != typeof i) n.fulfill(r); + else { + var a = !1; + try { + i.call( + r, + function (e) { + a || ((a = !0), e === r ? n.reject(new TypeError("circular thenable chain")) : t(n, e)); + }, + function (e) { + a || ((a = !0), n.reject(e)); + }, + ); + } catch (e) { + a || n.reject(e); + } + } + } else n.reject(new TypeError("cannot resolve promise with itself")); + }; + (yr.all = function (e) { + return new yr(function (t, n) { + for ( + var r = new Array(e.length), + i = 0, + a = function (n, a) { + (r[n] = a), ++i === e.length && t(r); + }, + o = 0; + o < e.length; + o++ + ) + !(function (t) { + var r = e[t]; + null != r && null != r.then + ? r.then( + function (e) { + a(t, e); + }, + function (e) { + n(e); + }, + ) + : a(t, r); + })(o); + }); + }), + (yr.resolve = function (e) { + return new yr(function (t, n) { + t(e); + }); + }), + (yr.reject = function (e) { + return new yr(function (t, n) { + n(e); + }); + }); + var _r = "undefined" != typeof Promise ? Promise : yr, + Tr = function (e, t, n) { + var r = T(e), + i = !r, + a = (this._private = z({ duration: 1e3 }, t, n)); + if ( + ((a.target = e), + (a.style = a.style || a.css), + (a.started = !1), + (a.playing = !1), + (a.hooked = !1), + (a.applying = !1), + (a.progress = 0), + (a.completes = []), + (a.frames = []), + a.complete && v(a.complete) && a.completes.push(a.complete), + i) + ) { + var o = e.position(); + (a.startPosition = a.startPosition || { x: o.x, y: o.y }), + (a.startStyle = a.startStyle || e.cy().style().getAnimationStartStyle(e, a.style)); + } + if (r) { + var s = e.pan(); + (a.startPan = { x: s.x, y: s.y }), (a.startZoom = e.zoom()); + } + (this.length = 1), (this[0] = this); + }, + Dr = Tr.prototype; + z(Dr, { + instanceString: function () { + return "animation"; + }, + hook: function () { + var e = this._private; + if (!e.hooked) { + var t = e.target._private.animation; + (e.queue ? t.queue : t.current).push(this), w(e.target) && e.target.cy().addToAnimationPool(e.target), (e.hooked = !0); + } + return this; + }, + play: function () { + var e = this._private; + return 1 === e.progress && (e.progress = 0), (e.playing = !0), (e.started = !1), (e.stopped = !1), this.hook(), this; + }, + playing: function () { + return this._private.playing; + }, + apply: function () { + var e = this._private; + return (e.applying = !0), (e.started = !1), (e.stopped = !1), this.hook(), this; + }, + applying: function () { + return this._private.applying; + }, + pause: function () { + var e = this._private; + return (e.playing = !1), (e.started = !1), this; + }, + stop: function () { + var e = this._private; + return (e.playing = !1), (e.started = !1), (e.stopped = !0), this; + }, + rewind: function () { + return this.progress(0); + }, + fastforward: function () { + return this.progress(1); + }, + time: function (e) { + var t = this._private; + return void 0 === e ? t.progress * t.duration : this.progress(e / t.duration); + }, + progress: function (e) { + var t = this._private, + n = t.playing; + return void 0 === e ? t.progress : (n && this.pause(), (t.progress = e), (t.started = !1), n && this.play(), this); + }, + completed: function () { + return 1 === this._private.progress; + }, + reverse: function () { + var e = this._private, + t = e.playing; + t && this.pause(), (e.progress = 1 - e.progress), (e.started = !1); + var n = function (t, n) { + var r = e[t]; + null != r && ((e[t] = e[n]), (e[n] = r)); + }; + if ((n("zoom", "startZoom"), n("pan", "startPan"), n("position", "startPosition"), e.style)) + for (var r = 0; r < e.style.length; r++) { + var i = e.style[r], + a = i.name, + o = e.startStyle[a]; + (e.startStyle[a] = i), (e.style[r] = o); + } + return t && this.play(), this; + }, + promise: function (e) { + var t, + n = this._private; + return ( + (t = "frame" === e ? n.frames : n.completes), + new _r(function (e, n) { + t.push(function () { + e(); + }); + }) + ); + }, + }), + (Dr.complete = Dr.completed), + (Dr.run = Dr.play), + (Dr.running = Dr.playing); + var Cr = { + animated: function () { + return function () { + var e = this, + t = void 0 !== e.length ? e : [e]; + if (!(this._private.cy || this).styleEnabled()) return !1; + var n = t[0]; + return n ? n._private.animation.current.length > 0 : void 0; + }; + }, + clearQueue: function () { + return function () { + var e = this, + t = void 0 !== e.length ? e : [e]; + if (!(this._private.cy || this).styleEnabled()) return this; + for (var n = 0; n < t.length; n++) t[n]._private.animation.queue = []; + return this; + }; + }, + delay: function () { + return function (e, t) { + return (this._private.cy || this).styleEnabled() ? this.animate({ delay: e, duration: e, complete: t }) : this; + }; + }, + delayAnimation: function () { + return function (e, t) { + return (this._private.cy || this).styleEnabled() ? this.animation({ delay: e, duration: e, complete: t }) : this; + }; + }, + animation: function () { + return function (e, t) { + var n = this, + r = void 0 !== n.length, + i = r ? n : [n], + a = this._private.cy || this, + o = !r, + s = !o; + if (!a.styleEnabled()) return this; + var l = a.style(); + if (((e = z({}, e, t)), 0 === Object.keys(e).length)) return new Tr(i[0], e); + switch ((void 0 === e.duration && (e.duration = 400), e.duration)) { + case "slow": + e.duration = 600; + break; + case "fast": + e.duration = 200; + } + if ((s && ((e.style = l.getPropsList(e.style || e.css)), (e.css = void 0)), s && null != e.renderedPosition)) { + var u = e.renderedPosition, + c = a.pan(), + h = a.zoom(); + e.position = _t(u, h, c); + } + if (o && null != e.panBy) { + var d = e.panBy, + p = a.pan(); + e.pan = { x: p.x + d.x, y: p.y + d.y }; + } + var g = e.center || e.centre; + if (o && null != g) { + var f = a.getCenterPan(g.eles, e.zoom); + null != f && (e.pan = f); + } + if (o && null != e.fit) { + var v = e.fit, + y = a.getFitViewport(v.eles || v.boundingBox, v.padding); + null != y && ((e.pan = y.pan), (e.zoom = y.zoom)); + } + if (o && m(e.zoom)) { + var b = a.getZoomedViewport(e.zoom); + null != b ? (b.zoomed && (e.zoom = b.zoom), b.panned && (e.pan = b.pan)) : (e.zoom = null); + } + return new Tr(i[0], e); + }; + }, + animate: function () { + return function (e, t) { + var n = this, + r = void 0 !== n.length ? n : [n]; + if (!(this._private.cy || this).styleEnabled()) return this; + t && (e = z({}, e, t)); + for (var i = 0; i < r.length; i++) { + var a = r[i], + o = a.animated() && (void 0 === e.queue || e.queue); + a.animation(e, o ? { queue: !0 } : void 0).play(); + } + return this; + }; + }, + stop: function () { + return function (e, t) { + var n = this, + r = void 0 !== n.length ? n : [n], + i = this._private.cy || this; + if (!i.styleEnabled()) return this; + for (var a = 0; a < r.length; a++) { + for (var o = r[a]._private, s = o.animation.current, l = 0; l < s.length; l++) { + var u = s[l]._private; + t && (u.duration = 0); + } + e && (o.animation.queue = []), t || (o.animation.current = []); + } + return i.notify("draw"), this; + }; + }, + }, + Nr = Array.isArray, + Ar = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + Lr = /^\w*$/; + var kr = function (e, t) { + if (Nr(e)) return !1; + var n = typeof e; + return ( + !("number" != n && "symbol" != n && "boolean" != n && null != e && !he(e)) || Lr.test(e) || !Ar.test(e) || (null != t && e in Object(t)) + ); + }; + var Sr, + Ir = function (e) { + if (!U(e)) return !1; + var t = ue(e); + return "[object Function]" == t || "[object GeneratorFunction]" == t || "[object AsyncFunction]" == t || "[object Proxy]" == t; + }, + Mr = W["__core-js_shared__"], + Or = (Sr = /[^.]+$/.exec((Mr && Mr.keys && Mr.keys.IE_PROTO) || "")) ? "Symbol(src)_1." + Sr : ""; + var Pr = function (e) { + return !!Or && Or in e; + }, + Rr = Function.prototype.toString; + var Br = function (e) { + if (null != e) { + try { + return Rr.call(e); + } catch (e) {} + try { + return e + ""; + } catch (e) {} + } + return ""; + }, + Fr = /^\[object .+?Constructor\]$/, + zr = Function.prototype, + Gr = Object.prototype, + Yr = zr.toString, + Xr = Gr.hasOwnProperty, + Vr = RegExp( + "^" + + Yr.call(Xr) + .replace(/[\\^$.*+?()[\]{}|]/g, "\\$&") + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + + "$", + ); + var Ur = function (e) { + return !(!U(e) || Pr(e)) && (Ir(e) ? Vr : Fr).test(Br(e)); + }; + var jr = function (e, t) { + return null == e ? void 0 : e[t]; + }; + var qr = function (e, t) { + var n = jr(e, t); + return Ur(n) ? n : void 0; + }, + Hr = qr(Object, "create"); + var Wr = function () { + (this.__data__ = Hr ? Hr(null) : {}), (this.size = 0); + }; + var $r = function (e) { + var t = this.has(e) && delete this.__data__[e]; + return (this.size -= t ? 1 : 0), t; + }, + Kr = Object.prototype.hasOwnProperty; + var Zr = function (e) { + var t = this.__data__; + if (Hr) { + var n = t[e]; + return "__lodash_hash_undefined__" === n ? void 0 : n; + } + return Kr.call(t, e) ? t[e] : void 0; + }, + Qr = Object.prototype.hasOwnProperty; + var Jr = function (e) { + var t = this.__data__; + return Hr ? void 0 !== t[e] : Qr.call(t, e); + }; + var ei = function (e, t) { + var n = this.__data__; + return (this.size += this.has(e) ? 0 : 1), (n[e] = Hr && void 0 === t ? "__lodash_hash_undefined__" : t), this; + }; + function ti(e) { + var t = -1, + n = null == e ? 0 : e.length; + for (this.clear(); ++t < n; ) { + var r = e[t]; + this.set(r[0], r[1]); + } + } + (ti.prototype.clear = Wr), (ti.prototype.delete = $r), (ti.prototype.get = Zr), (ti.prototype.has = Jr), (ti.prototype.set = ei); + var ni = ti; + var ri = function () { + (this.__data__ = []), (this.size = 0); + }; + var ii = function (e, t) { + return e === t || (e != e && t != t); + }; + var ai = function (e, t) { + for (var n = e.length; n--; ) if (ii(e[n][0], t)) return n; + return -1; + }, + oi = Array.prototype.splice; + var si = function (e) { + var t = this.__data__, + n = ai(t, e); + return !(n < 0 || (n == t.length - 1 ? t.pop() : oi.call(t, n, 1), --this.size, 0)); + }; + var li = function (e) { + var t = this.__data__, + n = ai(t, e); + return n < 0 ? void 0 : t[n][1]; + }; + var ui = function (e) { + return ai(this.__data__, e) > -1; + }; + var ci = function (e, t) { + var n = this.__data__, + r = ai(n, e); + return r < 0 ? (++this.size, n.push([e, t])) : (n[r][1] = t), this; + }; + function hi(e) { + var t = -1, + n = null == e ? 0 : e.length; + for (this.clear(); ++t < n; ) { + var r = e[t]; + this.set(r[0], r[1]); + } + } + (hi.prototype.clear = ri), (hi.prototype.delete = si), (hi.prototype.get = li), (hi.prototype.has = ui), (hi.prototype.set = ci); + var di = hi, + pi = qr(W, "Map"); + var gi = function () { + (this.size = 0), (this.__data__ = { hash: new ni(), map: new (pi || di)(), string: new ni() }); + }; + var fi = function (e) { + var t = typeof e; + return "string" == t || "number" == t || "symbol" == t || "boolean" == t ? "__proto__" !== e : null === e; + }; + var vi = function (e, t) { + var n = e.__data__; + return fi(t) ? n["string" == typeof t ? "string" : "hash"] : n.map; + }; + var yi = function (e) { + var t = vi(this, e).delete(e); + return (this.size -= t ? 1 : 0), t; + }; + var mi = function (e) { + return vi(this, e).get(e); + }; + var bi = function (e) { + return vi(this, e).has(e); + }; + var xi = function (e, t) { + var n = vi(this, e), + r = n.size; + return n.set(e, t), (this.size += n.size == r ? 0 : 1), this; + }; + function wi(e) { + var t = -1, + n = null == e ? 0 : e.length; + for (this.clear(); ++t < n; ) { + var r = e[t]; + this.set(r[0], r[1]); + } + } + (wi.prototype.clear = gi), (wi.prototype.delete = yi), (wi.prototype.get = mi), (wi.prototype.has = bi), (wi.prototype.set = xi); + var Ei = wi; + function _i(e, t) { + if ("function" != typeof e || (null != t && "function" != typeof t)) throw new TypeError("Expected a function"); + var n = function () { + var r = arguments, + i = t ? t.apply(this, r) : r[0], + a = n.cache; + if (a.has(i)) return a.get(i); + var o = e.apply(this, r); + return (n.cache = a.set(i, o) || a), o; + }; + return (n.cache = new (_i.Cache || Ei)()), n; + } + _i.Cache = Ei; + var Ti = _i; + var Di = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, + Ci = /\\(\\)?/g, + Ni = (function (e) { + var t = Ti(e, function (e) { + return 500 === n.size && n.clear(), e; + }), + n = t.cache; + return t; + })(function (e) { + var t = []; + return ( + 46 === e.charCodeAt(0) && t.push(""), + e.replace(Di, function (e, n, r, i) { + t.push(r ? i.replace(Ci, "$1") : n || e); + }), + t + ); + }); + var Ai = function (e, t) { + for (var n = -1, r = null == e ? 0 : e.length, i = Array(r); ++n < r; ) i[n] = t(e[n], n, e); + return i; + }, + Li = ee ? ee.prototype : void 0, + ki = Li ? Li.toString : void 0; + var Si = function e(t) { + if ("string" == typeof t) return t; + if (Nr(t)) return Ai(t, e) + ""; + if (he(t)) return ki ? ki.call(t) : ""; + var n = t + ""; + return "0" == n && 1 / t == -Infinity ? "-0" : n; + }; + var Ii = function (e) { + return null == e ? "" : Si(e); + }; + var Mi = function (e, t) { + return Nr(e) ? e : kr(e, t) ? [e] : Ni(Ii(e)); + }; + var Oi = function (e) { + if ("string" == typeof e || he(e)) return e; + var t = e + ""; + return "0" == t && 1 / e == -Infinity ? "-0" : t; + }; + var Pi = function (e, t) { + for (var n = 0, r = (t = Mi(t, e)).length; null != e && n < r; ) e = e[Oi(t[n++])]; + return n && n == r ? e : void 0; + }; + var Ri = function (e, t, n) { + var r = null == e ? void 0 : Pi(e, t); + return void 0 === r ? n : r; + }, + Bi = (function () { + try { + var e = qr(Object, "defineProperty"); + return e({}, "", {}), e; + } catch (e) {} + })(); + var Fi = function (e, t, n) { + "__proto__" == t && Bi ? Bi(e, t, { configurable: !0, enumerable: !0, value: n, writable: !0 }) : (e[t] = n); + }, + zi = Object.prototype.hasOwnProperty; + var Gi = function (e, t, n) { + var r = e[t]; + (zi.call(e, t) && ii(r, n) && (void 0 !== n || t in e)) || Fi(e, t, n); + }, + Yi = /^(?:0|[1-9]\d*)$/; + var Xi = function (e, t) { + var n = typeof e; + return !!(t = null == t ? 9007199254740991 : t) && ("number" == n || ("symbol" != n && Yi.test(e))) && e > -1 && e % 1 == 0 && e < t; + }; + var Vi = function (e, t, n, r) { + if (!U(e)) return e; + for (var i = -1, a = (t = Mi(t, e)).length, o = a - 1, s = e; null != s && ++i < a; ) { + var l = Oi(t[i]), + u = n; + if ("__proto__" === l || "constructor" === l || "prototype" === l) return e; + if (i != o) { + var c = s[l]; + void 0 === (u = r ? r(c, l, s) : void 0) && (u = U(c) ? c : Xi(t[i + 1]) ? [] : {}); + } + Gi(s, l, u), (s = s[l]); + } + return e; + }; + var Ui = function (e, t, n) { + return null == e ? e : Vi(e, t, n); + }; + var ji = function (e, t) { + var n = -1, + r = e.length; + for (t || (t = Array(r)); ++n < r; ) t[n] = e[n]; + return t; + }; + var qi = function (e) { + return Nr(e) ? Ai(e, Oi) : he(e) ? [e] : ji(Ni(Ii(e))); + }, + Hi = { + eventAliasesOn: function (e) { + var t = e; + (t.addListener = t.listen = t.bind = t.on), + (t.unlisten = t.unbind = t.off = t.removeListener), + (t.trigger = t.emit), + (t.pon = t.promiseOn = + function (e, t) { + var n = this, + r = Array.prototype.slice.call(arguments, 0); + return new _r(function (e, t) { + var i = r.concat([ + function (t) { + n.off.apply(n, a), e(t); + }, + ]), + a = i.concat([]); + n.on.apply(n, i); + }); + }); + }, + }, + Wi = {}; + [ + Cr, + { + data: function (e) { + return ( + (e = z( + {}, + { + field: "data", + bindingEvent: "data", + allowBinding: !1, + allowSetting: !1, + allowGetting: !1, + settingEvent: "data", + settingTriggersEvent: !1, + triggerFnName: "trigger", + immutableKeys: {}, + updateStyle: !1, + beforeGet: function (e) {}, + beforeSet: function (e, t) {}, + onSet: function (e) {}, + canSet: function (e) { + return !0; + }, + }, + e, + )), + function (t, n) { + var r = e, + i = this, + o = void 0 !== i.length, + s = o ? i : [i], + l = o ? i[0] : i; + if (f(t)) { + var u, + c = -1 !== t.indexOf(".") && qi(t); + if (r.allowGetting && void 0 === n) + return ( + l && (r.beforeGet(l), (u = c && void 0 === l._private[r.field][t] ? Ri(l._private[r.field], c) : l._private[r.field][t])), u + ); + if (r.allowSetting && void 0 !== n && !r.immutableKeys[t]) { + var h = a({}, t, n); + r.beforeSet(i, h); + for (var d = 0, p = s.length; d < p; d++) { + var g = s[d]; + r.canSet(g) && (c && void 0 === l._private[r.field][t] ? Ui(g._private[r.field], c, n) : (g._private[r.field][t] = n)); + } + r.updateStyle && i.updateStyle(), r.onSet(i), r.settingTriggersEvent && i[r.triggerFnName](r.settingEvent); + } + } else if (r.allowSetting && m(t)) { + var y, + b, + x = t, + w = Object.keys(x); + r.beforeSet(i, x); + for (var E = 0; E < w.length; E++) + if (((b = x[(y = w[E])]), !r.immutableKeys[y])) + for (var _ = 0; _ < s.length; _++) { + var T = s[_]; + r.canSet(T) && (T._private[r.field][y] = b); + } + r.updateStyle && i.updateStyle(), r.onSet(i), r.settingTriggersEvent && i[r.triggerFnName](r.settingEvent); + } else if (r.allowBinding && v(t)) { + var D = t; + i.on(r.bindingEvent, D); + } else if (r.allowGetting && void 0 === t) { + var C; + return l && (r.beforeGet(l), (C = l._private[r.field])), C; + } + return i; + } + ); + }, + removeData: function (e) { + return ( + (e = z( + {}, + { + field: "data", + event: "data", + triggerFnName: "trigger", + triggerEvent: !1, + immutableKeys: {}, + }, + e, + )), + function (t) { + var n = e, + r = this, + i = void 0 !== r.length ? r : [r]; + if (f(t)) { + for (var a = t.split(/\s+/), o = a.length, s = 0; s < o; s++) { + var l = a[s]; + if (!C(l) && !n.immutableKeys[l]) for (var u = 0, c = i.length; u < c; u++) i[u]._private[n.field][l] = void 0; + } + n.triggerEvent && r[n.triggerFnName](n.event); + } else if (void 0 === t) { + for (var h = 0, d = i.length; h < d; h++) + for (var p = i[h]._private[n.field], g = Object.keys(p), v = 0; v < g.length; v++) { + var y = g[v]; + !n.immutableKeys[y] && (p[y] = void 0); + } + n.triggerEvent && r[n.triggerFnName](n.event); + } + return r; + } + ); + }, + }, + Hi, + ].forEach(function (e) { + z(Wi, e); + }); + var $i = { + animate: Wi.animate(), + animation: Wi.animation(), + animated: Wi.animated(), + clearQueue: Wi.clearQueue(), + delay: Wi.delay(), + delayAnimation: Wi.delayAnimation(), + stop: Wi.stop(), + }, + Ki = { + classes: function (e) { + var t = this; + if (void 0 === e) { + var n = []; + return ( + t[0]._private.classes.forEach(function (e) { + return n.push(e); + }), + n + ); + } + y(e) || (e = (e || "").match(/\S+/g) || []); + for (var r = [], i = new rt(e), a = 0; a < t.length; a++) { + for (var o = t[a], s = o._private, l = s.classes, u = !1, c = 0; c < e.length; c++) { + var h = e[c]; + if (!l.has(h)) { + u = !0; + break; + } + } + u || (u = l.size !== e.length), u && ((s.classes = i), r.push(o)); + } + return r.length > 0 && this.spawn(r).updateStyle().emit("class"), t; + }, + addClass: function (e) { + return this.toggleClass(e, !0); + }, + hasClass: function (e) { + var t = this[0]; + return null != t && t._private.classes.has(e); + }, + toggleClass: function (e, t) { + y(e) || (e = e.match(/\S+/g) || []); + for (var n = this, r = void 0 === t, i = [], a = 0, o = n.length; a < o; a++) + for (var s = n[a], l = s._private.classes, u = !1, c = 0; c < e.length; c++) { + var h = e[c], + d = l.has(h), + p = !1; + t || (r && !d) ? (l.add(h), (p = !0)) : (!t || (r && d)) && (l.delete(h), (p = !0)), !u && p && (i.push(s), (u = !0)); + } + return i.length > 0 && this.spawn(i).updateStyle().emit("class"), n; + }, + removeClass: function (e) { + return this.toggleClass(e, !1); + }, + flashClass: function (e, t) { + var n = this; + if (null == t) t = 250; + else if (0 === t) return n; + return ( + n.addClass(e), + setTimeout(function () { + n.removeClass(e); + }, t), + n + ); + }, + }; + Ki.className = Ki.classNames = Ki.classes; + var Zi = { + metaChar: "[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]", + comparatorOp: "=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=", + boolOp: "\\?|\\!|\\^", + string: "\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'", + number: M, + meta: "degree|indegree|outdegree", + separator: "\\s*,\\s*", + descendant: "\\s+", + child: "\\s+>\\s+", + subject: "\\$", + group: "node|edge|\\*", + directedEdge: "\\s+->\\s+", + undirectedEdge: "\\s+<->\\s+", + }; + (Zi.variable = "(?:[\\w-.]|(?:\\\\" + Zi.metaChar + "))+"), + (Zi.className = "(?:[\\w-]|(?:\\\\" + Zi.metaChar + "))+"), + (Zi.value = Zi.string + "|" + Zi.number), + (Zi.id = Zi.variable), + (function () { + var e, t, n; + for (e = Zi.comparatorOp.split("|"), n = 0; n < e.length; n++) (t = e[n]), (Zi.comparatorOp += "|@" + t); + for (e = Zi.comparatorOp.split("|"), n = 0; n < e.length; n++) + (t = e[n]).indexOf("!") >= 0 || ("=" !== t && (Zi.comparatorOp += "|\\!" + t)); + })(); + var Qi = 0, + Ji = 1, + ea = 2, + ta = 3, + na = 4, + ra = 5, + ia = 6, + aa = 7, + oa = 8, + sa = 9, + la = 10, + ua = 11, + ca = 12, + ha = 13, + da = 14, + pa = 15, + ga = 16, + fa = 17, + va = 18, + ya = 19, + ma = 20, + ba = [ + { + selector: ":selected", + matches: function (e) { + return e.selected(); + }, + }, + { + selector: ":unselected", + matches: function (e) { + return !e.selected(); + }, + }, + { + selector: ":selectable", + matches: function (e) { + return e.selectable(); + }, + }, + { + selector: ":unselectable", + matches: function (e) { + return !e.selectable(); + }, + }, + { + selector: ":locked", + matches: function (e) { + return e.locked(); + }, + }, + { + selector: ":unlocked", + matches: function (e) { + return !e.locked(); + }, + }, + { + selector: ":visible", + matches: function (e) { + return e.visible(); + }, + }, + { + selector: ":hidden", + matches: function (e) { + return !e.visible(); + }, + }, + { + selector: ":transparent", + matches: function (e) { + return e.transparent(); + }, + }, + { + selector: ":grabbed", + matches: function (e) { + return e.grabbed(); + }, + }, + { + selector: ":free", + matches: function (e) { + return !e.grabbed(); + }, + }, + { + selector: ":removed", + matches: function (e) { + return e.removed(); + }, + }, + { + selector: ":inside", + matches: function (e) { + return !e.removed(); + }, + }, + { + selector: ":grabbable", + matches: function (e) { + return e.grabbable(); + }, + }, + { + selector: ":ungrabbable", + matches: function (e) { + return !e.grabbable(); + }, + }, + { + selector: ":animated", + matches: function (e) { + return e.animated(); + }, + }, + { + selector: ":unanimated", + matches: function (e) { + return !e.animated(); + }, + }, + { + selector: ":parent", + matches: function (e) { + return e.isParent(); + }, + }, + { + selector: ":childless", + matches: function (e) { + return e.isChildless(); + }, + }, + { + selector: ":child", + matches: function (e) { + return e.isChild(); + }, + }, + { + selector: ":orphan", + matches: function (e) { + return e.isOrphan(); + }, + }, + { + selector: ":nonorphan", + matches: function (e) { + return e.isChild(); + }, + }, + { + selector: ":compound", + matches: function (e) { + return e.isNode() ? e.isParent() : e.source().isParent() || e.target().isParent(); + }, + }, + { + selector: ":loop", + matches: function (e) { + return e.isLoop(); + }, + }, + { + selector: ":simple", + matches: function (e) { + return e.isSimple(); + }, + }, + { + selector: ":active", + matches: function (e) { + return e.active(); + }, + }, + { + selector: ":inactive", + matches: function (e) { + return !e.active(); + }, + }, + { + selector: ":backgrounding", + matches: function (e) { + return e.backgrounding(); + }, + }, + { + selector: ":nonbackgrounding", + matches: function (e) { + return !e.backgrounding(); + }, + }, + ].sort(function (e, t) { + return (function (e, t) { + return -1 * F(e, t); + })(e.selector, t.selector); + }), + xa = (function () { + for (var e, t = {}, n = 0; n < ba.length; n++) t[(e = ba[n]).selector] = e.matches; + return t; + })(), + wa = + "(" + + ba + .map(function (e) { + return e.selector; + }) + .join("|") + + ")", + Ea = function (e) { + return e.replace(new RegExp("\\\\(" + Zi.metaChar + ")", "g"), function (e, t) { + return t; + }); + }, + _a = function (e, t, n) { + e[e.length - 1] = n; + }, + Ta = [ + { + name: "group", + query: !0, + regex: "(" + Zi.group + ")", + populate: function (e, t, n) { + var r = o(n, 1)[0]; + t.checks.push({ type: Qi, value: "*" === r ? r : r + "s" }); + }, + }, + { + name: "state", + query: !0, + regex: wa, + populate: function (e, t, n) { + var r = o(n, 1)[0]; + t.checks.push({ type: aa, value: r }); + }, + }, + { + name: "id", + query: !0, + regex: "\\#(" + Zi.id + ")", + populate: function (e, t, n) { + var r = o(n, 1)[0]; + t.checks.push({ type: oa, value: Ea(r) }); + }, + }, + { + name: "className", + query: !0, + regex: "\\.(" + Zi.className + ")", + populate: function (e, t, n) { + var r = o(n, 1)[0]; + t.checks.push({ type: sa, value: Ea(r) }); + }, + }, + { + name: "dataExists", + query: !0, + regex: "\\[\\s*(" + Zi.variable + ")\\s*\\]", + populate: function (e, t, n) { + var r = o(n, 1)[0]; + t.checks.push({ type: na, field: Ea(r) }); + }, + }, + { + name: "dataCompare", + query: !0, + regex: "\\[\\s*(" + Zi.variable + ")\\s*(" + Zi.comparatorOp + ")\\s*(" + Zi.value + ")\\s*\\]", + populate: function (e, t, n) { + var r = o(n, 3), + i = r[0], + a = r[1], + s = r[2]; + (s = null != new RegExp("^" + Zi.string + "$").exec(s) ? s.substring(1, s.length - 1) : parseFloat(s)), + t.checks.push({ type: ta, field: Ea(i), operator: a, value: s }); + }, + }, + { + name: "dataBool", + query: !0, + regex: "\\[\\s*(" + Zi.boolOp + ")\\s*(" + Zi.variable + ")\\s*\\]", + populate: function (e, t, n) { + var r = o(n, 2), + i = r[0], + a = r[1]; + t.checks.push({ type: ra, field: Ea(a), operator: i }); + }, + }, + { + name: "metaCompare", + query: !0, + regex: "\\[\\[\\s*(" + Zi.meta + ")\\s*(" + Zi.comparatorOp + ")\\s*(" + Zi.number + ")\\s*\\]\\]", + populate: function (e, t, n) { + var r = o(n, 3), + i = r[0], + a = r[1], + s = r[2]; + t.checks.push({ type: ia, field: Ea(i), operator: a, value: parseFloat(s) }); + }, + }, + { + name: "nextQuery", + separator: !0, + regex: Zi.separator, + populate: function (e, t) { + var n = e.currentSubject, + r = e.edgeCount, + i = e.compoundCount, + a = e[e.length - 1]; + return ( + null != n && ((a.subject = n), (e.currentSubject = null)), + (a.edgeCount = r), + (a.compoundCount = i), + (e.edgeCount = 0), + (e.compoundCount = 0), + (e[e.length++] = { checks: [] }) + ); + }, + }, + { + name: "directedEdge", + separator: !0, + regex: Zi.directedEdge, + populate: function (e, t) { + if (null == e.currentSubject) { + var n = { checks: [] }, + r = t, + i = { checks: [] }; + return n.checks.push({ type: ua, source: r, target: i }), _a(e, 0, n), e.edgeCount++, i; + } + var a = { checks: [] }, + o = t, + s = { checks: [] }; + return a.checks.push({ type: ca, source: o, target: s }), _a(e, 0, a), e.edgeCount++, s; + }, + }, + { + name: "undirectedEdge", + separator: !0, + regex: Zi.undirectedEdge, + populate: function (e, t) { + if (null == e.currentSubject) { + var n = { checks: [] }, + r = t, + i = { checks: [] }; + return n.checks.push({ type: la, nodes: [r, i] }), _a(e, 0, n), e.edgeCount++, i; + } + var a = { checks: [] }, + o = t, + s = { checks: [] }; + return a.checks.push({ type: da, node: o, neighbor: s }), _a(e, 0, a), s; + }, + }, + { + name: "child", + separator: !0, + regex: Zi.child, + populate: function (e, t) { + if (null == e.currentSubject) { + var n = { checks: [] }, + r = { checks: [] }, + i = e[e.length - 1]; + return n.checks.push({ type: pa, parent: i, child: r }), _a(e, 0, n), e.compoundCount++, r; + } + if (e.currentSubject === t) { + var a = { checks: [] }, + o = e[e.length - 1], + s = { checks: [] }, + l = { checks: [] }, + u = { checks: [] }, + c = { checks: [] }; + return ( + a.checks.push({ type: ya, left: o, right: s, subject: l }), + (l.checks = t.checks), + (t.checks = [{ type: ma }]), + c.checks.push({ type: ma }), + s.checks.push({ type: fa, parent: c, child: u }), + _a(e, 0, a), + (e.currentSubject = l), + e.compoundCount++, + u + ); + } + var h = { checks: [] }, + d = { checks: [] }, + p = [{ type: fa, parent: h, child: d }]; + return (h.checks = t.checks), (t.checks = p), e.compoundCount++, d; + }, + }, + { + name: "descendant", + separator: !0, + regex: Zi.descendant, + populate: function (e, t) { + if (null == e.currentSubject) { + var n = { checks: [] }, + r = { checks: [] }, + i = e[e.length - 1]; + return n.checks.push({ type: ga, ancestor: i, descendant: r }), _a(e, 0, n), e.compoundCount++, r; + } + if (e.currentSubject === t) { + var a = { checks: [] }, + o = e[e.length - 1], + s = { checks: [] }, + l = { checks: [] }, + u = { checks: [] }, + c = { checks: [] }; + return ( + a.checks.push({ type: ya, left: o, right: s, subject: l }), + (l.checks = t.checks), + (t.checks = [{ type: ma }]), + c.checks.push({ type: ma }), + s.checks.push({ type: va, ancestor: c, descendant: u }), + _a(e, 0, a), + (e.currentSubject = l), + e.compoundCount++, + u + ); + } + var h = { checks: [] }, + d = { checks: [] }, + p = [{ type: va, ancestor: h, descendant: d }]; + return (h.checks = t.checks), (t.checks = p), e.compoundCount++, d; + }, + }, + { + name: "subject", + modifier: !0, + regex: Zi.subject, + populate: function (e, t) { + if (null != e.currentSubject && e.currentSubject !== t) return je("Redefinition of subject in selector `" + e.toString() + "`"), !1; + e.currentSubject = t; + var n = e[e.length - 1].checks[0], + r = null == n ? null : n.type; + r === ua ? (n.type = ha) : r === la && ((n.type = da), (n.node = n.nodes[1]), (n.neighbor = n.nodes[0]), (n.nodes = null)); + }, + }, + ]; + Ta.forEach(function (e) { + return (e.regexObj = new RegExp("^" + e.regex)); + }); + var Da = function (e) { + for (var t, n, r, i = 0; i < Ta.length; i++) { + var a = Ta[i], + o = a.name, + s = e.match(a.regexObj); + if (null != s) { + (n = s), (t = a), (r = o); + var l = s[0]; + e = e.substring(l.length); + break; + } + } + return { expr: t, match: n, name: r, remaining: e }; + }, + Ca = { + parse: function (e) { + var t = this, + n = (t.inputText = e), + r = (t[0] = { checks: [] }); + for ( + t.length = 1, + n = (function (e) { + var t = e.match(/^\s+/); + if (t) { + var n = t[0]; + e = e.substring(n.length); + } + return e; + })(n); + ; + + ) { + var i = Da(n); + if (null == i.expr) return je("The selector `" + e + "`is invalid"), !1; + var a = i.match.slice(1), + o = i.expr.populate(t, r, a); + if (!1 === o) return !1; + if ((null != o && (r = o), (n = i.remaining).match(/^\s*$/))) break; + } + var s = t[t.length - 1]; + null != t.currentSubject && (s.subject = t.currentSubject), (s.edgeCount = t.edgeCount), (s.compoundCount = t.compoundCount); + for (var l = 0; l < t.length; l++) { + var u = t[l]; + if (u.compoundCount > 0 && u.edgeCount > 0) + return je("The selector `" + e + "` is invalid because it uses both a compound selector and an edge selector"), !1; + if (u.edgeCount > 1) return je("The selector `" + e + "` is invalid because it uses multiple edge selectors"), !1; + 1 === u.edgeCount && + je( + "The selector `" + + e + + "` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.", + ); + } + return !0; + }, + toString: function () { + if (null != this.toStringCache) return this.toStringCache; + for ( + var e = function (e) { + return null == e ? "" : e; + }, + t = function (t) { + return f(t) ? '"' + t + '"' : e(t); + }, + n = function (e) { + return " " + e + " "; + }, + r = function (i, a) { + return i.checks.reduce(function (o, s, l) { + return ( + o + + (a === i && 0 === l ? "$" : "") + + (function (i, a) { + var o = i.type, + s = i.value; + switch (o) { + case Qi: + var l = e(s); + return l.substring(0, l.length - 1); + case ta: + var u = i.field, + c = i.operator; + return "[" + u + n(e(c)) + t(s) + "]"; + case ra: + var h = i.operator, + d = i.field; + return "[" + e(h) + d + "]"; + case na: + return "[" + i.field + "]"; + case ia: + var p = i.operator; + return "[[" + i.field + n(e(p)) + t(s) + "]]"; + case aa: + return s; + case oa: + return "#" + s; + case sa: + return "." + s; + case fa: + case pa: + return r(i.parent, a) + n(">") + r(i.child, a); + case va: + case ga: + return r(i.ancestor, a) + " " + r(i.descendant, a); + case ya: + var g = r(i.left, a), + f = r(i.subject, a), + v = r(i.right, a); + return g + (g.length > 0 ? " " : "") + f + v; + case ma: + return ""; + } + })(s, a) + ); + }, ""); + }, + i = "", + a = 0; + a < this.length; + a++ + ) { + var o = this[a]; + (i += r(o, o.subject)), this.length > 1 && a < this.length - 1 && (i += ", "); + } + return (this.toStringCache = i), i; + }, + }, + Na = function (e, t, n) { + var r, + i, + a, + o = f(e), + s = b(e), + l = f(n), + u = !1, + c = !1, + h = !1; + switch ( + (t.indexOf("!") >= 0 && ((t = t.replace("!", "")), (c = !0)), + t.indexOf("@") >= 0 && ((t = t.replace("@", "")), (u = !0)), + (o || l || u) && ((i = o || s ? "" + e : ""), (a = "" + n)), + u && ((e = i = i.toLowerCase()), (n = a = a.toLowerCase())), + t) + ) { + case "*=": + r = i.indexOf(a) >= 0; + break; + case "$=": + r = i.indexOf(a, i.length - a.length) >= 0; + break; + case "^=": + r = 0 === i.indexOf(a); + break; + case "=": + r = e === n; + break; + case ">": + (h = !0), (r = e > n); + break; + case ">=": + (h = !0), (r = e >= n); + break; + case "<": + (h = !0), (r = e < n); + break; + case "<=": + (h = !0), (r = e <= n); + break; + default: + r = !1; + } + return !c || (null == e && h) || (r = !r), r; + }, + Aa = function (e, t) { + return e.data(t); + }, + La = [], + ka = function (e, t) { + return e.checks.every(function (e) { + return La[e.type](e, t); + }); + }; + (La[Qi] = function (e, t) { + var n = e.value; + return "*" === n || n === t.group(); + }), + (La[aa] = function (e, t) { + return (function (e, t) { + return xa[e](t); + })(e.value, t); + }), + (La[oa] = function (e, t) { + var n = e.value; + return t.id() === n; + }), + (La[sa] = function (e, t) { + var n = e.value; + return t.hasClass(n); + }), + (La[ia] = function (e, t) { + var n = e.field, + r = e.operator, + i = e.value; + return Na( + (function (e, t) { + return e[t](); + })(t, n), + r, + i, + ); + }), + (La[ta] = function (e, t) { + var n = e.field, + r = e.operator, + i = e.value; + return Na(Aa(t, n), r, i); + }), + (La[ra] = function (e, t) { + var n = e.field, + r = e.operator; + return (function (e, t) { + switch (t) { + case "?": + return !!e; + case "!": + return !e; + case "^": + return void 0 === e; + } + })(Aa(t, n), r); + }), + (La[na] = function (e, t) { + var n = e.field; + return e.operator, void 0 !== Aa(t, n); + }), + (La[la] = function (e, t) { + var n = e.nodes[0], + r = e.nodes[1], + i = t.source(), + a = t.target(); + return (ka(n, i) && ka(r, a)) || (ka(r, i) && ka(n, a)); + }), + (La[da] = function (e, t) { + return ( + ka(e.node, t) && + t.neighborhood().some(function (t) { + return t.isNode() && ka(e.neighbor, t); + }) + ); + }), + (La[ua] = function (e, t) { + return ka(e.source, t.source()) && ka(e.target, t.target()); + }), + (La[ca] = function (e, t) { + return ( + ka(e.source, t) && + t.outgoers().some(function (t) { + return t.isNode() && ka(e.target, t); + }) + ); + }), + (La[ha] = function (e, t) { + return ( + ka(e.target, t) && + t.incomers().some(function (t) { + return t.isNode() && ka(e.source, t); + }) + ); + }), + (La[pa] = function (e, t) { + return ka(e.child, t) && ka(e.parent, t.parent()); + }), + (La[fa] = function (e, t) { + return ( + ka(e.parent, t) && + t.children().some(function (t) { + return ka(e.child, t); + }) + ); + }), + (La[ga] = function (e, t) { + return ( + ka(e.descendant, t) && + t.ancestors().some(function (t) { + return ka(e.ancestor, t); + }) + ); + }), + (La[va] = function (e, t) { + return ( + ka(e.ancestor, t) && + t.descendants().some(function (t) { + return ka(e.descendant, t); + }) + ); + }), + (La[ya] = function (e, t) { + return ka(e.subject, t) && ka(e.left, t) && ka(e.right, t); + }), + (La[ma] = function () { + return !0; + }), + (La[Ji] = function (e, t) { + return e.value.has(t); + }), + (La[ea] = function (e, t) { + return (0, e.value)(t); + }); + var Sa = { + matches: function (e) { + for (var t = 0; t < this.length; t++) { + var n = this[t]; + if (ka(n, e)) return !0; + } + return !1; + }, + filter: function (e) { + var t = this; + if (1 === t.length && 1 === t[0].checks.length && t[0].checks[0].type === oa) + return e.getElementById(t[0].checks[0].value).collection(); + var n = function (e) { + for (var n = 0; n < t.length; n++) { + var r = t[n]; + if (ka(r, e)) return !0; + } + return !1; + }; + return ( + null == t.text() && + (n = function () { + return !0; + }), + e.filter(n) + ); + }, + }, + Ia = function (e) { + (this.inputText = e), + (this.currentSubject = null), + (this.compoundCount = 0), + (this.edgeCount = 0), + (this.length = 0), + null == e || + (f(e) && e.match(/^\s*$/)) || + (w(e) + ? this.addQuery({ checks: [{ type: Ji, value: e.collection() }] }) + : v(e) + ? this.addQuery({ checks: [{ type: ea, value: e }] }) + : f(e) + ? this.parse(e) || (this.invalid = !0) + : Ve("A selector must be created from a string; found ")); + }, + Ma = Ia.prototype; + [Ca, Sa].forEach(function (e) { + return z(Ma, e); + }), + (Ma.text = function () { + return this.inputText; + }), + (Ma.size = function () { + return this.length; + }), + (Ma.eq = function (e) { + return this[e]; + }), + (Ma.sameText = function (e) { + return !this.invalid && !e.invalid && this.text() === e.text(); + }), + (Ma.addQuery = function (e) { + this[this.length++] = e; + }), + (Ma.selector = Ma.toString); + var Oa = { + allAre: function (e) { + var t = new Ia(e); + return this.every(function (e) { + return t.matches(e); + }); + }, + is: function (e) { + var t = new Ia(e); + return this.some(function (e) { + return t.matches(e); + }); + }, + some: function (e, t) { + for (var n = 0; n < this.length; n++) if (t ? e.apply(t, [this[n], n, this]) : e(this[n], n, this)) return !0; + return !1; + }, + every: function (e, t) { + for (var n = 0; n < this.length; n++) if (!(t ? e.apply(t, [this[n], n, this]) : e(this[n], n, this))) return !1; + return !0; + }, + same: function (e) { + if (this === e) return !0; + e = this.cy().collection(e); + var t = this.length; + return ( + t === e.length && + (1 === t + ? this[0] === e[0] + : this.every(function (t) { + return e.hasElementWithId(t.id()); + })) + ); + }, + anySame: function (e) { + return ( + (e = this.cy().collection(e)), + this.some(function (t) { + return e.hasElementWithId(t.id()); + }) + ); + }, + allAreNeighbors: function (e) { + e = this.cy().collection(e); + var t = this.neighborhood(); + return e.every(function (e) { + return t.hasElementWithId(e.id()); + }); + }, + contains: function (e) { + e = this.cy().collection(e); + var t = this; + return e.every(function (e) { + return t.hasElementWithId(e.id()); + }); + }, + }; + (Oa.allAreNeighbours = Oa.allAreNeighbors), (Oa.has = Oa.contains), (Oa.equal = Oa.equals = Oa.same); + var Pa, + Ra, + Ba = function (e, t) { + return function (n, r, i, a) { + var o, + s = n, + l = this; + if ((null == s ? (o = "") : w(s) && 1 === s.length && (o = s.id()), 1 === l.length && o)) { + var u = l[0]._private, + c = (u.traversalCache = u.traversalCache || {}), + h = (c[t] = c[t] || []), + d = Ie(o); + return h[d] || (h[d] = e.call(l, n, r, i, a)); + } + return e.call(l, n, r, i, a); + }; + }, + Fa = { + parent: function (e) { + var t = []; + if (1 === this.length) { + var n = this[0]._private.parent; + if (n) return n; + } + for (var r = 0; r < this.length; r++) { + var i = this[r]._private.parent; + i && t.push(i); + } + return this.spawn(t, !0).filter(e); + }, + parents: function (e) { + for (var t = [], n = this.parent(); n.nonempty(); ) { + for (var r = 0; r < n.length; r++) { + var i = n[r]; + t.push(i); + } + n = n.parent(); + } + return this.spawn(t, !0).filter(e); + }, + commonAncestors: function (e) { + for (var t, n = 0; n < this.length; n++) { + var r = this[n].parents(); + t = (t = t || r).intersect(r); + } + return t.filter(e); + }, + orphans: function (e) { + return this.stdFilter(function (e) { + return e.isOrphan(); + }).filter(e); + }, + nonorphans: function (e) { + return this.stdFilter(function (e) { + return e.isChild(); + }).filter(e); + }, + children: Ba(function (e) { + for (var t = [], n = 0; n < this.length; n++) for (var r = this[n]._private.children, i = 0; i < r.length; i++) t.push(r[i]); + return this.spawn(t, !0).filter(e); + }, "children"), + siblings: function (e) { + return this.parent().children().not(this).filter(e); + }, + isParent: function () { + var e = this[0]; + if (e) return e.isNode() && 0 !== e._private.children.length; + }, + isChildless: function () { + var e = this[0]; + if (e) return e.isNode() && 0 === e._private.children.length; + }, + isChild: function () { + var e = this[0]; + if (e) return e.isNode() && null != e._private.parent; + }, + isOrphan: function () { + var e = this[0]; + if (e) return e.isNode() && null == e._private.parent; + }, + descendants: function (e) { + var t = []; + return ( + (function e(n) { + for (var r = 0; r < n.length; r++) { + var i = n[r]; + t.push(i), i.children().nonempty() && e(i.children()); + } + })(this.children()), + this.spawn(t, !0).filter(e) + ); + }, + }; + function za(e, t, n, r) { + for (var i = [], a = new rt(), o = e.cy().hasCompoundNodes(), s = 0; s < e.length; s++) { + var l = e[s]; + n ? i.push(l) : o && r(i, a, l); + } + for (; i.length > 0; ) { + var u = i.shift(); + t(u), a.add(u.id()), o && r(i, a, u); + } + return e; + } + function Ga(e, t, n) { + if (n.isParent()) + for (var r = n._private.children, i = 0; i < r.length; i++) { + var a = r[i]; + t.has(a.id()) || e.push(a); + } + } + function Ya(e, t, n) { + if (n.isChild()) { + var r = n._private.parent; + t.has(r.id()) || e.push(r); + } + } + function Xa(e, t, n) { + Ya(e, t, n), Ga(e, t, n); + } + (Fa.forEachDown = function (e) { + return za(this, e, !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], Ga); + }), + (Fa.forEachUp = function (e) { + return za(this, e, !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], Ya); + }), + (Fa.forEachUpAndDown = function (e) { + return za(this, e, !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], Xa); + }), + (Fa.ancestors = Fa.parents), + ((Pa = Ra = + { + data: Wi.data({ + field: "data", + bindingEvent: "data", + allowBinding: !0, + allowSetting: !0, + settingEvent: "data", + settingTriggersEvent: !0, + triggerFnName: "trigger", + allowGetting: !0, + immutableKeys: { id: !0, source: !0, target: !0, parent: !0 }, + updateStyle: !0, + }), + removeData: Wi.removeData({ + field: "data", + event: "data", + triggerFnName: "trigger", + triggerEvent: !0, + immutableKeys: { id: !0, source: !0, target: !0, parent: !0 }, + updateStyle: !0, + }), + scratch: Wi.data({ + field: "scratch", + bindingEvent: "scratch", + allowBinding: !0, + allowSetting: !0, + settingEvent: "scratch", + settingTriggersEvent: !0, + triggerFnName: "trigger", + allowGetting: !0, + updateStyle: !0, + }), + removeScratch: Wi.removeData({ + field: "scratch", + event: "scratch", + triggerFnName: "trigger", + triggerEvent: !0, + updateStyle: !0, + }), + rscratch: Wi.data({ + field: "rscratch", + allowBinding: !1, + allowSetting: !0, + settingTriggersEvent: !1, + allowGetting: !0, + }), + removeRscratch: Wi.removeData({ field: "rscratch", triggerEvent: !1 }), + id: function () { + var e = this[0]; + if (e) return e._private.data.id; + }, + }).attr = Pa.data), + (Pa.removeAttr = Pa.removeData); + var Va, + Ua, + ja = Ra, + qa = {}; + function Ha(e) { + return function (t) { + var n = this; + if ((void 0 === t && (t = !0), 0 !== n.length && n.isNode() && !n.removed())) { + for (var r = 0, i = n[0], a = i._private.edges, o = 0; o < a.length; o++) { + var s = a[o]; + (!t && s.isLoop()) || (r += e(i, s)); + } + return r; + } + }; + } + function Wa(e, t) { + return function (n) { + for (var r, i = this.nodes(), a = 0; a < i.length; a++) { + var o = i[a][e](n); + void 0 === o || (void 0 !== r && !t(o, r)) || (r = o); + } + return r; + }; + } + z(qa, { + degree: Ha(function (e, t) { + return t.source().same(t.target()) ? 2 : 1; + }), + indegree: Ha(function (e, t) { + return t.target().same(e) ? 1 : 0; + }), + outdegree: Ha(function (e, t) { + return t.source().same(e) ? 1 : 0; + }), + }), + z(qa, { + minDegree: Wa("degree", function (e, t) { + return e < t; + }), + maxDegree: Wa("degree", function (e, t) { + return e > t; + }), + minIndegree: Wa("indegree", function (e, t) { + return e < t; + }), + maxIndegree: Wa("indegree", function (e, t) { + return e > t; + }), + minOutdegree: Wa("outdegree", function (e, t) { + return e < t; + }), + maxOutdegree: Wa("outdegree", function (e, t) { + return e > t; + }), + }), + z(qa, { + totalDegree: function (e) { + for (var t = 0, n = this.nodes(), r = 0; r < n.length; r++) t += n[r].degree(e); + return t; + }, + }); + var $a = function (e, t, n) { + for (var r = 0; r < e.length; r++) { + var i = e[r]; + if (!i.locked()) { + var a = i._private.position, + o = { x: null != t.x ? t.x - a.x : 0, y: null != t.y ? t.y - a.y : 0 }; + !i.isParent() || (0 === o.x && 0 === o.y) || i.children().shift(o, n), i.dirtyBoundingBoxCache(); + } + } + }, + Ka = { + field: "position", + bindingEvent: "position", + allowBinding: !0, + allowSetting: !0, + settingEvent: "position", + settingTriggersEvent: !0, + triggerFnName: "emitAndNotify", + allowGetting: !0, + validKeys: ["x", "y"], + beforeGet: function (e) { + e.updateCompoundBounds(); + }, + beforeSet: function (e, t) { + $a(e, t, !1); + }, + onSet: function (e) { + e.dirtyCompoundBoundsCache(); + }, + canSet: function (e) { + return !e.locked(); + }, + }; + ((Va = Ua = + { + position: Wi.data(Ka), + silentPosition: Wi.data( + z({}, Ka, { + allowBinding: !1, + allowSetting: !0, + settingTriggersEvent: !1, + allowGetting: !1, + beforeSet: function (e, t) { + $a(e, t, !0); + }, + onSet: function (e) { + e.dirtyCompoundBoundsCache(); + }, + }), + ), + positions: function (e, t) { + if (m(e)) t ? this.silentPosition(e) : this.position(e); + else if (v(e)) { + var n = e, + r = this.cy(); + r.startBatch(); + for (var i = 0; i < this.length; i++) { + var a, + o = this[i]; + (a = n(o, i)) && (t ? o.silentPosition(a) : o.position(a)); + } + r.endBatch(); + } + return this; + }, + silentPositions: function (e) { + return this.positions(e, !0); + }, + shift: function (e, t, n) { + var r; + if ((m(e) ? ((r = { x: b(e.x) ? e.x : 0, y: b(e.y) ? e.y : 0 }), (n = t)) : f(e) && b(t) && ((r = { x: 0, y: 0 })[e] = t), null != r)) { + var i = this.cy(); + i.startBatch(); + for (var a = 0; a < this.length; a++) { + var o = this[a]; + if (!(i.hasCompoundNodes() && o.isChild() && o.ancestors().anySame(this))) { + var s = o.position(), + l = { x: s.x + r.x, y: s.y + r.y }; + n ? o.silentPosition(l) : o.position(l); + } + } + i.endBatch(); + } + return this; + }, + silentShift: function (e, t) { + return m(e) ? this.shift(e, !0) : f(e) && b(t) && this.shift(e, t, !0), this; + }, + renderedPosition: function (e, t) { + var n = this[0], + r = this.cy(), + i = r.zoom(), + a = r.pan(), + o = m(e) ? e : void 0, + s = void 0 !== o || (void 0 !== t && f(e)); + if (n && n.isNode()) { + if (!s) { + var l = n.position(); + return (o = Et(l, i, a)), void 0 === e ? o : o[e]; + } + for (var u = 0; u < this.length; u++) { + var c = this[u]; + void 0 !== t ? c.position(e, (t - a[e]) / i) : void 0 !== o && c.position(_t(o, i, a)); + } + } else if (!s) return; + return this; + }, + relativePosition: function (e, t) { + var n = this[0], + r = this.cy(), + i = m(e) ? e : void 0, + a = void 0 !== i || (void 0 !== t && f(e)), + o = r.hasCompoundNodes(); + if (n && n.isNode()) { + if (!a) { + var s = n.position(), + l = o ? n.parent() : null, + u = l && l.length > 0, + c = u; + u && (l = l[0]); + var h = c ? l.position() : { x: 0, y: 0 }; + return (i = { x: s.x - h.x, y: s.y - h.y }), void 0 === e ? i : i[e]; + } + for (var d = 0; d < this.length; d++) { + var p = this[d], + g = o ? p.parent() : null, + v = g && g.length > 0, + y = v; + v && (g = g[0]); + var b = y ? g.position() : { x: 0, y: 0 }; + void 0 !== t ? p.position(e, t + b[e]) : void 0 !== i && p.position({ x: i.x + b.x, y: i.y + b.y }); + } + } else if (!a) return; + return this; + }, + }).modelPosition = Va.point = + Va.position), + (Va.modelPositions = Va.points = Va.positions), + (Va.renderedPoint = Va.renderedPosition), + (Va.relativePoint = Va.relativePosition); + var Za, + Qa, + Ja = Ua; + (Za = Qa = {}), + (Qa.renderedBoundingBox = function (e) { + var t = this.boundingBox(e), + n = this.cy(), + r = n.zoom(), + i = n.pan(), + a = t.x1 * r + i.x, + o = t.x2 * r + i.x, + s = t.y1 * r + i.y, + l = t.y2 * r + i.y; + return { x1: a, x2: o, y1: s, y2: l, w: o - a, h: l - s }; + }), + (Qa.dirtyCompoundBoundsCache = function () { + var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], + t = this.cy(); + return t.styleEnabled() && t.hasCompoundNodes() + ? (this.forEachUp(function (t) { + if (t.isParent()) { + var n = t._private; + (n.compoundBoundsClean = !1), (n.bbCache = null), e || t.emitAndNotify("bounds"); + } + }), + this) + : this; + }), + (Qa.updateCompoundBounds = function () { + var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], + t = this.cy(); + if (!t.styleEnabled() || !t.hasCompoundNodes()) return this; + if (!e && t.batching()) return this; + function n(e) { + if (e.isParent()) { + var t = e._private, + n = e.children(), + r = "include" === e.pstyle("compound-sizing-wrt-labels").value, + i = { + width: { + val: e.pstyle("min-width").pfValue, + left: e.pstyle("min-width-bias-left"), + right: e.pstyle("min-width-bias-right"), + }, + height: { + val: e.pstyle("min-height").pfValue, + top: e.pstyle("min-height-bias-top"), + bottom: e.pstyle("min-height-bias-bottom"), + }, + }, + a = n.boundingBox({ includeLabels: r, includeOverlays: !1, useCache: !1 }), + o = t.position; + (0 !== a.w && 0 !== a.h) || + (((a = { w: e.pstyle("width").pfValue, h: e.pstyle("height").pfValue }).x1 = o.x - a.w / 2), + (a.x2 = o.x + a.w / 2), + (a.y1 = o.y - a.h / 2), + (a.y2 = o.y + a.h / 2)); + var s = i.width.left.value; + "px" === i.width.left.units && i.width.val > 0 && (s = (100 * s) / i.width.val); + var l = i.width.right.value; + "px" === i.width.right.units && i.width.val > 0 && (l = (100 * l) / i.width.val); + var u = i.height.top.value; + "px" === i.height.top.units && i.height.val > 0 && (u = (100 * u) / i.height.val); + var c = i.height.bottom.value; + "px" === i.height.bottom.units && i.height.val > 0 && (c = (100 * c) / i.height.val); + var h = y(i.width.val - a.w, s, l), + d = h.biasDiff, + p = h.biasComplementDiff, + g = y(i.height.val - a.h, u, c), + f = g.biasDiff, + v = g.biasComplementDiff; + (t.autoPadding = (function (e, t, n, r) { + if ("%" !== n.units) return "px" === n.units ? n.pfValue : 0; + switch (r) { + case "width": + return e > 0 ? n.pfValue * e : 0; + case "height": + return t > 0 ? n.pfValue * t : 0; + case "average": + return e > 0 && t > 0 ? (n.pfValue * (e + t)) / 2 : 0; + case "min": + return e > 0 && t > 0 ? (e > t ? n.pfValue * t : n.pfValue * e) : 0; + case "max": + return e > 0 && t > 0 ? (e > t ? n.pfValue * e : n.pfValue * t) : 0; + default: + return 0; + } + })(a.w, a.h, e.pstyle("padding"), e.pstyle("padding-relative-to").value)), + (t.autoWidth = Math.max(a.w, i.width.val)), + (o.x = (-d + a.x1 + a.x2 + p) / 2), + (t.autoHeight = Math.max(a.h, i.height.val)), + (o.y = (-f + a.y1 + a.y2 + v) / 2); + } + function y(e, t, n) { + var r = 0, + i = 0, + a = t + n; + return e > 0 && a > 0 && ((r = (t / a) * e), (i = (n / a) * e)), { biasDiff: r, biasComplementDiff: i }; + } + } + for (var r = 0; r < this.length; r++) { + var i = this[r], + a = i._private; + (a.compoundBoundsClean && !e) || (n(i), t.batching() || (a.compoundBoundsClean = !0)); + } + return this; + }); + var eo = function (e) { + return e === 1 / 0 || e === -1 / 0 ? 0 : e; + }, + to = function (e, t, n, r, i) { + r - t != 0 && + i - n != 0 && + null != t && + null != n && + null != r && + null != i && + ((e.x1 = t < e.x1 ? t : e.x1), + (e.x2 = r > e.x2 ? r : e.x2), + (e.y1 = n < e.y1 ? n : e.y1), + (e.y2 = i > e.y2 ? i : e.y2), + (e.w = e.x2 - e.x1), + (e.h = e.y2 - e.y1)); + }, + no = function (e, t) { + return null == t ? e : to(e, t.x1, t.y1, t.x2, t.y2); + }, + ro = function (e, t, n) { + return Je(e, t, n); + }, + io = function (e, t, n) { + if (!t.cy().headless()) { + var r, + i, + a = t._private, + o = a.rstyle, + s = o.arrowWidth / 2; + if ("none" !== t.pstyle(n + "-arrow-shape").value) { + "source" === n ? ((r = o.srcX), (i = o.srcY)) : "target" === n ? ((r = o.tgtX), (i = o.tgtY)) : ((r = o.midX), (i = o.midY)); + var l = (a.arrowBounds = a.arrowBounds || {}), + u = (l[n] = l[n] || {}); + (u.x1 = r - s), + (u.y1 = i - s), + (u.x2 = r + s), + (u.y2 = i + s), + (u.w = u.x2 - u.x1), + (u.h = u.y2 - u.y1), + Rt(u, 1), + to(e, u.x1, u.y1, u.x2, u.y2); + } + } + }, + ao = function (e, t, n) { + if (!t.cy().headless()) { + var r; + r = n ? n + "-" : ""; + var i = t._private, + a = i.rstyle; + if (t.pstyle(r + "label").strValue) { + var o, + s, + l, + u, + c = t.pstyle("text-halign"), + h = t.pstyle("text-valign"), + d = ro(a, "labelWidth", n), + p = ro(a, "labelHeight", n), + g = ro(a, "labelX", n), + f = ro(a, "labelY", n), + v = t.pstyle(r + "text-margin-x").pfValue, + y = t.pstyle(r + "text-margin-y").pfValue, + m = t.isEdge(), + b = t.pstyle(r + "text-rotation"), + x = t.pstyle("text-outline-width").pfValue, + w = t.pstyle("text-border-width").pfValue / 2, + E = t.pstyle("text-background-padding").pfValue, + _ = p, + T = d, + D = T / 2, + C = _ / 2; + if (m) (o = g - D), (s = g + D), (l = f - C), (u = f + C); + else { + switch (c.value) { + case "left": + (o = g - T), (s = g); + break; + case "center": + (o = g - D), (s = g + D); + break; + case "right": + (o = g), (s = g + T); + } + switch (h.value) { + case "top": + (l = f - _), (u = f); + break; + case "center": + (l = f - C), (u = f + C); + break; + case "bottom": + (l = f), (u = f + _); + } + } + (o += v - Math.max(x, w) - E - 2), + (s += v + Math.max(x, w) + E + 2), + (l += y - Math.max(x, w) - E - 2), + (u += y + Math.max(x, w) + E + 2); + var N = n || "main", + A = i.labelBounds, + L = (A[N] = A[N] || {}); + (L.x1 = o), (L.y1 = l), (L.x2 = s), (L.y2 = u), (L.w = s - o), (L.h = u - l); + var k = m && "autorotate" === b.strValue, + S = null != b.pfValue && 0 !== b.pfValue; + if (k || S) { + var I = k ? ro(i.rstyle, "labelAngle", n) : b.pfValue, + M = Math.cos(I), + O = Math.sin(I), + P = (o + s) / 2, + R = (l + u) / 2; + if (!m) { + switch (c.value) { + case "left": + P = s; + break; + case "right": + P = o; + } + switch (h.value) { + case "top": + R = u; + break; + case "bottom": + R = l; + } + } + var B = function (e, t) { + return { x: (e -= P) * M - (t -= R) * O + P, y: e * O + t * M + R }; + }, + F = B(o, l), + z = B(o, u), + G = B(s, l), + Y = B(s, u); + (o = Math.min(F.x, z.x, G.x, Y.x)), + (s = Math.max(F.x, z.x, G.x, Y.x)), + (l = Math.min(F.y, z.y, G.y, Y.y)), + (u = Math.max(F.y, z.y, G.y, Y.y)); + } + var X = N + "Rot", + V = (A[X] = A[X] || {}); + (V.x1 = o), (V.y1 = l), (V.x2 = s), (V.y2 = u), (V.w = s - o), (V.h = u - l), to(e, o, l, s, u), to(i.labelBounds.all, o, l, s, u); + } + return e; + } + }, + oo = function (e) { + var t = 0, + n = function (e) { + return (e ? 1 : 0) << t++; + }, + r = 0; + return ( + (r += n(e.incudeNodes)), + (r += n(e.includeEdges)), + (r += n(e.includeLabels)), + (r += n(e.includeMainLabels)), + (r += n(e.includeSourceLabels)), + (r += n(e.includeTargetLabels)) + n(e.includeOverlays) + ); + }, + so = function (e) { + if (e.isEdge()) { + var t = e.source().position(), + n = e.target().position(), + r = function (e) { + return Math.round(e); + }; + return (function (e, t) { + var n = { value: 0, done: !1 }, + r = 0, + i = e.length; + return Ne( + { + next: function () { + return r < i ? (n.value = e[r++]) : (n.done = !0), n; + }, + }, + t, + ); + })([r(t.x), r(t.y), r(n.x), r(n.y)]); + } + return 0; + }, + lo = function (e, t) { + var n, + r = e._private, + i = e.isEdge(), + a = (null == t ? co : oo(t)) === co, + o = so(e), + s = r.bbCachePosKey === o, + l = t.useCache && s, + u = function (e) { + return null == e._private.bbCache || e._private.styleDirty; + }; + if ( + (!l || u(e) || (i && u(e.source())) || u(e.target()) + ? (s || e.recalculateRenderedStyle(l), + (n = (function (e, t) { + var n, + r, + i, + a, + o, + s, + l, + u = e._private.cy, + c = u.styleEnabled(), + h = u.headless(), + d = Ot(), + p = e._private, + g = e.isNode(), + f = e.isEdge(), + v = p.rstyle, + y = g && c ? e.pstyle("bounds-expansion").pfValue : [0], + m = function (e) { + return "none" !== e.pstyle("display").value; + }, + b = !c || (m(e) && (!f || (m(e.source()) && m(e.target())))); + if (b) { + var x = 0; + c && t.includeOverlays && 0 !== e.pstyle("overlay-opacity").value && (x = e.pstyle("overlay-padding").value); + var w = 0; + c && t.includeUnderlays && 0 !== e.pstyle("underlay-opacity").value && (w = e.pstyle("underlay-padding").value); + var E = Math.max(x, w), + _ = 0; + if ((c && (_ = e.pstyle("width").pfValue / 2), g && t.includeNodes)) { + var T = e.position(); + (o = T.x), (s = T.y); + var D = e.outerWidth() / 2, + C = e.outerHeight() / 2; + to(d, (n = o - D), (i = s - C), (r = o + D), (a = s + C)); + } else if (f && t.includeEdges) + if (c && !h) { + var N = e.pstyle("curve-style").strValue; + if ( + ((n = Math.min(v.srcX, v.midX, v.tgtX)), + (r = Math.max(v.srcX, v.midX, v.tgtX)), + (i = Math.min(v.srcY, v.midY, v.tgtY)), + (a = Math.max(v.srcY, v.midY, v.tgtY)), + to(d, (n -= _), (i -= _), (r += _), (a += _)), + "haystack" === N) + ) { + var A = v.haystackPts; + if (A && 2 === A.length) { + if (((n = A[0].x), (i = A[0].y), n > (r = A[1].x))) { + var L = n; + (n = r), (r = L); + } + if (i > (a = A[1].y)) { + var k = i; + (i = a), (a = k); + } + to(d, n - _, i - _, r + _, a + _); + } + } else if ("bezier" === N || "unbundled-bezier" === N || "segments" === N || "taxi" === N) { + var S; + switch (N) { + case "bezier": + case "unbundled-bezier": + S = v.bezierPts; + break; + case "segments": + case "taxi": + S = v.linePts; + } + if (null != S) + for (var I = 0; I < S.length; I++) { + var M = S[I]; + (n = M.x - _), (r = M.x + _), (i = M.y - _), (a = M.y + _), to(d, n, i, r, a); + } + } + } else { + var O = e.source().position(), + P = e.target().position(); + if ((n = O.x) > (r = P.x)) { + var R = n; + (n = r), (r = R); + } + if ((i = O.y) > (a = P.y)) { + var B = i; + (i = a), (a = B); + } + to(d, (n -= _), (i -= _), (r += _), (a += _)); + } + if ( + (c && t.includeEdges && f && (io(d, e, "mid-source"), io(d, e, "mid-target"), io(d, e, "source"), io(d, e, "target")), + c && "yes" === e.pstyle("ghost").value) + ) { + var F = e.pstyle("ghost-offset-x").pfValue, + z = e.pstyle("ghost-offset-y").pfValue; + to(d, d.x1 + F, d.y1 + z, d.x2 + F, d.y2 + z); + } + var G = (p.bodyBounds = p.bodyBounds || {}); + Ft(G, d), Bt(G, y), Rt(G, 1), c && ((n = d.x1), (r = d.x2), (i = d.y1), (a = d.y2), to(d, n - E, i - E, r + E, a + E)); + var Y = (p.overlayBounds = p.overlayBounds || {}); + Ft(Y, d), Bt(Y, y), Rt(Y, 1); + var X = (p.labelBounds = p.labelBounds || {}); + null != X.all + ? (((l = X.all).x1 = 1 / 0), (l.y1 = 1 / 0), (l.x2 = -1 / 0), (l.y2 = -1 / 0), (l.w = 0), (l.h = 0)) + : (X.all = Ot()), + c && + t.includeLabels && + (t.includeMainLabels && ao(d, e, null), + f && (t.includeSourceLabels && ao(d, e, "source"), t.includeTargetLabels && ao(d, e, "target"))); + } + return ( + (d.x1 = eo(d.x1)), + (d.y1 = eo(d.y1)), + (d.x2 = eo(d.x2)), + (d.y2 = eo(d.y2)), + (d.w = eo(d.x2 - d.x1)), + (d.h = eo(d.y2 - d.y1)), + d.w > 0 && d.h > 0 && b && (Bt(d, y), Rt(d, 1)), + d + ); + })(e, uo)), + (r.bbCache = n), + (r.bbCachePosKey = o)) + : (n = r.bbCache), + !a) + ) { + var c = e.isNode(); + (n = Ot()), + ((t.includeNodes && c) || (t.includeEdges && !c)) && (t.includeOverlays ? no(n, r.overlayBounds) : no(n, r.bodyBounds)), + t.includeLabels && + (t.includeMainLabels && (!i || (t.includeSourceLabels && t.includeTargetLabels)) + ? no(n, r.labelBounds.all) + : (t.includeMainLabels && no(n, r.labelBounds.mainRot), + t.includeSourceLabels && no(n, r.labelBounds.sourceRot), + t.includeTargetLabels && no(n, r.labelBounds.targetRot))), + (n.w = n.x2 - n.x1), + (n.h = n.y2 - n.y1); + } + return n; + }, + uo = { + includeNodes: !0, + includeEdges: !0, + includeLabels: !0, + includeMainLabels: !0, + includeSourceLabels: !0, + includeTargetLabels: !0, + includeOverlays: !0, + includeUnderlays: !0, + useCache: !0, + }, + co = oo(uo), + ho = Ke(uo); + (Qa.boundingBox = function (e) { + var t; + if ( + 1 !== this.length || + null == this[0]._private.bbCache || + this[0]._private.styleDirty || + (void 0 !== e && void 0 !== e.useCache && !0 !== e.useCache) + ) { + t = Ot(); + var n = ho((e = e || uo)), + r = this; + if (r.cy().styleEnabled()) + for (var i = 0; i < r.length; i++) { + var a = r[i], + o = a._private, + s = so(a), + l = o.bbCachePosKey === s, + u = n.useCache && l && !o.styleDirty; + a.recalculateRenderedStyle(u); + } + this.updateCompoundBounds(!e.useCache); + for (var c = 0; c < r.length; c++) { + var h = r[c]; + no(t, lo(h, n)); + } + } else (e = void 0 === e ? uo : ho(e)), (t = lo(this[0], e)); + return (t.x1 = eo(t.x1)), (t.y1 = eo(t.y1)), (t.x2 = eo(t.x2)), (t.y2 = eo(t.y2)), (t.w = eo(t.x2 - t.x1)), (t.h = eo(t.y2 - t.y1)), t; + }), + (Qa.dirtyBoundingBoxCache = function () { + for (var e = 0; e < this.length; e++) { + var t = this[e]._private; + (t.bbCache = null), + (t.bbCachePosKey = null), + (t.bodyBounds = null), + (t.overlayBounds = null), + (t.labelBounds.all = null), + (t.labelBounds.source = null), + (t.labelBounds.target = null), + (t.labelBounds.main = null), + (t.labelBounds.sourceRot = null), + (t.labelBounds.targetRot = null), + (t.labelBounds.mainRot = null), + (t.arrowBounds.source = null), + (t.arrowBounds.target = null), + (t.arrowBounds["mid-source"] = null), + (t.arrowBounds["mid-target"] = null); + } + return this.emitAndNotify("bounds"), this; + }), + (Qa.boundingBoxAt = function (e) { + var t = this.nodes(), + n = this.cy(), + r = n.hasCompoundNodes(), + i = n.collection(); + if ( + (r && + ((i = t.filter(function (e) { + return e.isParent(); + })), + (t = t.not(i))), + m(e)) + ) { + var a = e; + e = function () { + return a; + }; + } + n.startBatch(), + t + .forEach(function (t, n) { + return (t._private.bbAtOldPos = e(t, n)); + }) + .silentPositions(e), + r && (i.dirtyCompoundBoundsCache(), i.dirtyBoundingBoxCache(), i.updateCompoundBounds(!0)); + var o = (function (e) { + return { x1: e.x1, x2: e.x2, w: e.w, y1: e.y1, y2: e.y2, h: e.h }; + })(this.boundingBox({ useCache: !1 })); + return ( + t.silentPositions(function (e) { + return e._private.bbAtOldPos; + }), + r && (i.dirtyCompoundBoundsCache(), i.dirtyBoundingBoxCache(), i.updateCompoundBounds(!0)), + n.endBatch(), + o + ); + }), + (Za.boundingbox = Za.bb = Za.boundingBox), + (Za.renderedBoundingbox = Za.renderedBoundingBox); + var po, + go, + fo = Qa; + po = go = {}; + var vo = function (e) { + (e.uppercaseName = I(e.name)), + (e.autoName = "auto" + e.uppercaseName), + (e.labelName = "label" + e.uppercaseName), + (e.outerName = "outer" + e.uppercaseName), + (e.uppercaseOuterName = I(e.outerName)), + (po[e.name] = function () { + var t = this[0], + n = t._private, + r = n.cy._private.styleEnabled; + if (t) { + if (r) { + if (t.isParent()) return t.updateCompoundBounds(), n[e.autoName] || 0; + var i = t.pstyle(e.name); + return "label" === i.strValue ? (t.recalculateRenderedStyle(), n.rstyle[e.labelName] || 0) : i.pfValue; + } + return 1; + } + }), + (po["outer" + e.uppercaseName] = function () { + var t = this[0], + n = t._private.cy._private.styleEnabled; + if (t) return n ? t[e.name]() + t.pstyle("border-width").pfValue + 2 * t.padding() : 1; + }), + (po["rendered" + e.uppercaseName] = function () { + var t = this[0]; + if (t) return t[e.name]() * this.cy().zoom(); + }), + (po["rendered" + e.uppercaseOuterName] = function () { + var t = this[0]; + if (t) return t[e.outerName]() * this.cy().zoom(); + }); + }; + vo({ name: "width" }), + vo({ name: "height" }), + (go.padding = function () { + var e = this[0], + t = e._private; + return e.isParent() + ? (e.updateCompoundBounds(), void 0 !== t.autoPadding ? t.autoPadding : e.pstyle("padding").pfValue) + : e.pstyle("padding").pfValue; + }), + (go.paddedHeight = function () { + var e = this[0]; + return e.height() + 2 * e.padding(); + }), + (go.paddedWidth = function () { + var e = this[0]; + return e.width() + 2 * e.padding(); + }); + var yo = go, + mo = { + controlPoints: { + get: function (e) { + return e.renderer().getControlPoints(e); + }, + mult: !0, + }, + segmentPoints: { + get: function (e) { + return e.renderer().getSegmentPoints(e); + }, + mult: !0, + }, + sourceEndpoint: { + get: function (e) { + return e.renderer().getSourceEndpoint(e); + }, + }, + targetEndpoint: { + get: function (e) { + return e.renderer().getTargetEndpoint(e); + }, + }, + midpoint: { + get: function (e) { + return e.renderer().getEdgeMidpoint(e); + }, + }, + }, + bo = Object.keys(mo).reduce(function (e, t) { + var n = mo[t], + r = (function (e) { + return "rendered" + e[0].toUpperCase() + e.substr(1); + })(t); + return ( + (e[t] = function () { + return (function (e, t) { + if (e.isEdge()) return t(e); + })(this, n.get); + }), + n.mult + ? (e[r] = function () { + return (function (e, t) { + if (e.isEdge()) { + var n = e.cy(), + r = n.pan(), + i = n.zoom(); + return t(e).map(function (e) { + return Et(e, i, r); + }); + } + })(this, n.get); + }) + : (e[r] = function () { + return (function (e, t) { + if (e.isEdge()) { + var n = e.cy(); + return Et(t(e), n.zoom(), n.pan()); + } + })(this, n.get); + }), + e + ); + }, {}), + xo = z({}, Ja, fo, yo, bo), + wo = function (e, t) { + this.recycle(e, t); + }; + function Eo() { + return !1; + } + function _o() { + return !0; + } + wo.prototype = { + instanceString: function () { + return "event"; + }, + recycle: function (e, t) { + if ( + ((this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = Eo), + null != e && e.preventDefault + ? ((this.type = e.type), (this.isDefaultPrevented = e.defaultPrevented ? _o : Eo)) + : null != e && e.type + ? (t = e) + : (this.type = e), + null != t && + ((this.originalEvent = t.originalEvent), + (this.type = null != t.type ? t.type : this.type), + (this.cy = t.cy), + (this.target = t.target), + (this.position = t.position), + (this.renderedPosition = t.renderedPosition), + (this.namespace = t.namespace), + (this.layout = t.layout)), + null != this.cy && null != this.position && null == this.renderedPosition) + ) { + var n = this.position, + r = this.cy.zoom(), + i = this.cy.pan(); + this.renderedPosition = { x: n.x * r + i.x, y: n.y * r + i.y }; + } + this.timeStamp = (e && e.timeStamp) || Date.now(); + }, + preventDefault: function () { + this.isDefaultPrevented = _o; + var e = this.originalEvent; + e && e.preventDefault && e.preventDefault(); + }, + stopPropagation: function () { + this.isPropagationStopped = _o; + var e = this.originalEvent; + e && e.stopPropagation && e.stopPropagation(); + }, + stopImmediatePropagation: function () { + (this.isImmediatePropagationStopped = _o), this.stopPropagation(); + }, + isDefaultPrevented: Eo, + isPropagationStopped: Eo, + isImmediatePropagationStopped: Eo, + }; + var To = /^([^.]+)(\.(?:[^.]+))?$/, + Do = { + qualifierCompare: function (e, t) { + return e === t; + }, + eventMatches: function () { + return !0; + }, + addEventFields: function () {}, + callbackContext: function (e) { + return e; + }, + beforeEmit: function () {}, + afterEmit: function () {}, + bubble: function () { + return !1; + }, + parent: function () { + return null; + }, + context: null, + }, + Co = Object.keys(Do), + No = {}; + function Ao() { + for ( + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : No, t = arguments.length > 1 ? arguments[1] : void 0, n = 0; + n < Co.length; + n++ + ) { + var r = Co[n]; + this[r] = e[r] || Do[r]; + } + (this.context = t || this.context), (this.listeners = []), (this.emitting = 0); + } + var Lo = Ao.prototype, + ko = function (e, t, n, r, i, a, o) { + v(r) && ((i = r), (r = null)), o && (a = null == a ? o : z({}, a, o)); + for (var s = y(n) ? n : n.split(/\s+/), l = 0; l < s.length; l++) { + var u = s[l]; + if (!C(u)) { + var c = u.match(To); + if (c && !1 === t(e, u, c[1], c[2] ? c[2] : null, r, i, a)) break; + } + } + }, + So = function (e, t) { + return e.addEventFields(e.context, t), new wo(t.type, t); + }, + Io = function (e, t, n) { + if ("event" === g(n)) t(e, n); + else if (m(n)) t(e, So(e, n)); + else + for (var r = y(n) ? n : n.split(/\s+/), i = 0; i < r.length; i++) { + var a = r[i]; + if (!C(a)) { + var o = a.match(To); + if (o) { + var s = o[1], + l = o[2] ? o[2] : null; + t(e, So(e, { type: s, namespace: l, target: e.context })); + } + } + } + }; + (Lo.on = Lo.addListener = + function (e, t, n, r, i) { + return ( + ko( + this, + function (e, t, n, r, i, a, o) { + v(a) && + e.listeners.push({ + event: t, + callback: a, + type: n, + namespace: r, + qualifier: i, + conf: o, + }); + }, + e, + t, + n, + r, + i, + ), + this + ); + }), + (Lo.one = function (e, t, n, r) { + return this.on(e, t, n, r, { one: !0 }); + }), + (Lo.removeListener = Lo.off = + function (e, t, n, r) { + var i = this; + 0 !== this.emitting && (this.listeners = this.listeners.slice()); + for ( + var a = this.listeners, + o = function (o) { + var s = a[o]; + ko( + i, + function (t, n, r, i, l, u) { + if ( + (s.type === r || "*" === e) && + ((!i && ".*" !== s.namespace) || s.namespace === i) && + (!l || t.qualifierCompare(s.qualifier, l)) && + (!u || s.callback === u) + ) + return a.splice(o, 1), !1; + }, + e, + t, + n, + r, + ); + }, + s = a.length - 1; + s >= 0; + s-- + ) + o(s); + return this; + }), + (Lo.removeAllListeners = function () { + return this.removeListener("*"); + }), + (Lo.emit = Lo.trigger = + function (e, t, n) { + var r = this.listeners, + i = r.length; + return ( + this.emitting++, + y(t) || (t = [t]), + Io( + this, + function (e, a) { + null != n && ((r = [{ event: a.event, type: a.type, namespace: a.namespace, callback: n }]), (i = r.length)); + for ( + var o = function (n) { + var i = r[n]; + if ( + i.type === a.type && + (!i.namespace || i.namespace === a.namespace || ".*" === i.namespace) && + e.eventMatches(e.context, i, a) + ) { + var o = [a]; + null != t && + (function (e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n]; + e.push(r); + } + })(o, t), + e.beforeEmit(e.context, i, a), + i.conf && + i.conf.one && + (e.listeners = e.listeners.filter(function (e) { + return e !== i; + })); + var s = e.callbackContext(e.context, i, a), + l = i.callback.apply(s, o); + e.afterEmit(e.context, i, a), !1 === l && (a.stopPropagation(), a.preventDefault()); + } + }, + s = 0; + s < i; + s++ + ) + o(s); + e.bubble(e.context) && !a.isPropagationStopped() && e.parent(e.context).emit(a, t); + }, + e, + ), + this.emitting--, + this + ); + }); + var Mo = { + qualifierCompare: function (e, t) { + return null == e || null == t ? null == e && null == t : e.sameText(t); + }, + eventMatches: function (e, t, n) { + var r = t.qualifier; + return null == r || (e !== n.target && E(n.target) && r.matches(n.target)); + }, + addEventFields: function (e, t) { + (t.cy = e.cy()), (t.target = e); + }, + callbackContext: function (e, t, n) { + return null != t.qualifier ? n.target : e; + }, + beforeEmit: function (e, t) { + t.conf && t.conf.once && t.conf.onceCollection.removeListener(t.event, t.qualifier, t.callback); + }, + bubble: function () { + return !0; + }, + parent: function (e) { + return e.isChild() ? e.parent() : e.cy(); + }, + }, + Oo = function (e) { + return f(e) ? new Ia(e) : e; + }, + Po = { + createEmitter: function () { + for (var e = 0; e < this.length; e++) { + var t = this[e], + n = t._private; + n.emitter || (n.emitter = new Ao(Mo, t)); + } + return this; + }, + emitter: function () { + return this._private.emitter; + }, + on: function (e, t, n) { + for (var r = Oo(t), i = 0; i < this.length; i++) this[i].emitter().on(e, r, n); + return this; + }, + removeListener: function (e, t, n) { + for (var r = Oo(t), i = 0; i < this.length; i++) this[i].emitter().removeListener(e, r, n); + return this; + }, + removeAllListeners: function () { + for (var e = 0; e < this.length; e++) this[e].emitter().removeAllListeners(); + return this; + }, + one: function (e, t, n) { + for (var r = Oo(t), i = 0; i < this.length; i++) this[i].emitter().one(e, r, n); + return this; + }, + once: function (e, t, n) { + for (var r = Oo(t), i = 0; i < this.length; i++) this[i].emitter().on(e, r, n, { once: !0, onceCollection: this }); + }, + emit: function (e, t) { + for (var n = 0; n < this.length; n++) this[n].emitter().emit(e, t); + return this; + }, + emitAndNotify: function (e, t) { + if (0 !== this.length) return this.cy().notify(e, this), this.emit(e, t), this; + }, + }; + Wi.eventAliasesOn(Po); + var Ro = { + nodes: function (e) { + return this.filter(function (e) { + return e.isNode(); + }).filter(e); + }, + edges: function (e) { + return this.filter(function (e) { + return e.isEdge(); + }).filter(e); + }, + byGroup: function () { + for (var e = this.spawn(), t = this.spawn(), n = 0; n < this.length; n++) { + var r = this[n]; + r.isNode() ? e.push(r) : t.push(r); + } + return { nodes: e, edges: t }; + }, + filter: function (e, t) { + if (void 0 === e) return this; + if (f(e) || w(e)) return new Ia(e).filter(this); + if (v(e)) { + for (var n = this.spawn(), r = this, i = 0; i < r.length; i++) { + var a = r[i]; + (t ? e.apply(t, [a, i, r]) : e(a, i, r)) && n.push(a); + } + return n; + } + return this.spawn(); + }, + not: function (e) { + if (e) { + f(e) && (e = this.filter(e)); + for (var t = this.spawn(), n = 0; n < this.length; n++) { + var r = this[n]; + e.has(r) || t.push(r); + } + return t; + } + return this; + }, + absoluteComplement: function () { + return this.cy().mutableElements().not(this); + }, + intersect: function (e) { + if (f(e)) { + var t = e; + return this.filter(t); + } + for (var n = this.spawn(), r = e, i = this.length < e.length, a = i ? this : r, o = i ? r : this, s = 0; s < a.length; s++) { + var l = a[s]; + o.has(l) && n.push(l); + } + return n; + }, + xor: function (e) { + var t = this._private.cy; + f(e) && (e = t.$(e)); + var n = this.spawn(), + r = e, + i = function (e, t) { + for (var r = 0; r < e.length; r++) { + var i = e[r], + a = i._private.data.id; + t.hasElementWithId(a) || n.push(i); + } + }; + return i(this, r), i(r, this), n; + }, + diff: function (e) { + var t = this._private.cy; + f(e) && (e = t.$(e)); + var n = this.spawn(), + r = this.spawn(), + i = this.spawn(), + a = e, + o = function (e, t, n) { + for (var r = 0; r < e.length; r++) { + var a = e[r], + o = a._private.data.id; + t.hasElementWithId(o) ? i.merge(a) : n.push(a); + } + }; + return o(this, a, n), o(a, this, r), { left: n, right: r, both: i }; + }, + add: function (e) { + var t = this._private.cy; + if (!e) return this; + if (f(e)) { + var n = e; + e = t.mutableElements().filter(n); + } + for (var r = this.spawnSelf(), i = 0; i < e.length; i++) { + var a = e[i]; + !this.has(a) && r.push(a); + } + return r; + }, + merge: function (e) { + var t = this._private, + n = t.cy; + if (!e) return this; + if (e && f(e)) { + var r = e; + e = n.mutableElements().filter(r); + } + for (var i = t.map, a = 0; a < e.length; a++) { + var o = e[a], + s = o._private.data.id; + if (!i.has(s)) { + var l = this.length++; + (this[l] = o), i.set(s, { ele: o, index: l }); + } + } + return this; + }, + unmergeAt: function (e) { + var t = this[e].id(), + n = this._private.map; + (this[e] = void 0), n.delete(t); + var r = e === this.length - 1; + if (this.length > 1 && !r) { + var i = this.length - 1, + a = this[i], + o = a._private.data.id; + (this[i] = void 0), (this[e] = a), n.set(o, { ele: a, index: e }); + } + return this.length--, this; + }, + unmergeOne: function (e) { + e = e[0]; + var t = this._private, + n = e._private.data.id, + r = t.map.get(n); + if (!r) return this; + var i = r.index; + return this.unmergeAt(i), this; + }, + unmerge: function (e) { + var t = this._private.cy; + if (!e) return this; + if (e && f(e)) { + var n = e; + e = t.mutableElements().filter(n); + } + for (var r = 0; r < e.length; r++) this.unmergeOne(e[r]); + return this; + }, + unmergeBy: function (e) { + for (var t = this.length - 1; t >= 0; t--) e(this[t]) && this.unmergeAt(t); + return this; + }, + map: function (e, t) { + for (var n = [], r = this, i = 0; i < r.length; i++) { + var a = r[i], + o = t ? e.apply(t, [a, i, r]) : e(a, i, r); + n.push(o); + } + return n; + }, + reduce: function (e, t) { + for (var n = t, r = this, i = 0; i < r.length; i++) n = e(n, r[i], i, r); + return n; + }, + max: function (e, t) { + for (var n, r = -1 / 0, i = this, a = 0; a < i.length; a++) { + var o = i[a], + s = t ? e.apply(t, [o, a, i]) : e(o, a, i); + s > r && ((r = s), (n = o)); + } + return { value: r, ele: n }; + }, + min: function (e, t) { + for (var n, r = 1 / 0, i = this, a = 0; a < i.length; a++) { + var o = i[a], + s = t ? e.apply(t, [o, a, i]) : e(o, a, i); + s < r && ((r = s), (n = o)); + } + return { value: r, ele: n }; + }, + }, + Bo = Ro; + (Bo.u = Bo["|"] = Bo["+"] = Bo.union = Bo.or = Bo.add), + (Bo["\\"] = Bo["!"] = Bo["-"] = Bo.difference = Bo.relativeComplement = Bo.subtract = Bo.not), + (Bo.n = Bo["&"] = Bo["."] = Bo.and = Bo.intersection = Bo.intersect), + (Bo["^"] = Bo["(+)"] = Bo["(-)"] = Bo.symmetricDifference = Bo.symdiff = Bo.xor), + (Bo.fnFilter = Bo.filterFn = Bo.stdFilter = Bo.filter), + (Bo.complement = Bo.abscomp = Bo.absoluteComplement); + var Fo, + zo = function (e, t) { + var n = e.cy().hasCompoundNodes(); + function r(e) { + var t = e.pstyle("z-compound-depth"); + return "auto" === t.value ? (n ? e.zDepth() : 0) : "bottom" === t.value ? -1 : "top" === t.value ? Fe : 0; + } + var i = r(e) - r(t); + if (0 !== i) return i; + function a(e) { + return "auto" === e.pstyle("z-index-compare").value && e.isNode() ? 1 : 0; + } + var o = a(e) - a(t); + if (0 !== o) return o; + var s = e.pstyle("z-index").value - t.pstyle("z-index").value; + return 0 !== s ? s : e.poolIndex() - t.poolIndex(); + }, + Go = { + forEach: function (e, t) { + if (v(e)) + for (var n = this.length, r = 0; r < n; r++) { + var i = this[r]; + if (!1 === (t ? e.apply(t, [i, r, this]) : e(i, r, this))) break; + } + return this; + }, + toArray: function () { + for (var e = [], t = 0; t < this.length; t++) e.push(this[t]); + return e; + }, + slice: function (e, t) { + var n = [], + r = this.length; + null == t && (t = r), null == e && (e = 0), e < 0 && (e = r + e), t < 0 && (t = r + t); + for (var i = e; i >= 0 && i < t && i < r; i++) n.push(this[i]); + return this.spawn(n); + }, + size: function () { + return this.length; + }, + eq: function (e) { + return this[e] || this.spawn(); + }, + first: function () { + return this[0] || this.spawn(); + }, + last: function () { + return this[this.length - 1] || this.spawn(); + }, + empty: function () { + return 0 === this.length; + }, + nonempty: function () { + return !this.empty(); + }, + sort: function (e) { + if (!v(e)) return this; + var t = this.toArray().sort(e); + return this.spawn(t); + }, + sortByZIndex: function () { + return this.sort(zo); + }, + zDepth: function () { + var e = this[0]; + if (e) { + var t = e._private; + if ("nodes" === t.group) { + var n = t.data.parent ? e.parents().size() : 0; + return e.isParent() ? n : Fe - 1; + } + var r = t.source, + i = t.target, + a = r.zDepth(), + o = i.zDepth(); + return Math.max(a, o, 0); + } + }, + }; + (Go.each = Go.forEach), + (Fo = "undefined"), + ("undefined" == typeof Symbol ? "undefined" : e(Symbol)) != Fo && + e(Symbol.iterator) != Fo && + (Go[Symbol.iterator] = function () { + var e = this, + t = { value: void 0, done: !1 }, + n = 0, + r = this.length; + return a( + { + next: function () { + return n < r ? (t.value = e[n++]) : ((t.value = void 0), (t.done = !0)), t; + }, + }, + Symbol.iterator, + function () { + return this; + }, + ); + }); + var Yo = Ke({ nodeDimensionsIncludeLabels: !1 }), + Xo = { + layoutDimensions: function (e) { + var t; + if (((e = Yo(e)), this.takesUpSpace())) + if (e.nodeDimensionsIncludeLabels) { + var n = this.boundingBox(); + t = { w: n.w, h: n.h }; + } else t = { w: this.outerWidth(), h: this.outerHeight() }; + else t = { w: 0, h: 0 }; + return (0 !== t.w && 0 !== t.h) || (t.w = t.h = 1), t; + }, + layoutPositions: function (e, t, n) { + var r = this.nodes().filter(function (e) { + return !e.isParent(); + }), + i = this.cy(), + a = t.eles, + o = function (e) { + return e.id(); + }, + s = A(n, o); + e.emit({ type: "layoutstart", layout: e }), (e.animations = []); + var l = t.spacingFactor && 1 !== t.spacingFactor, + u = (function () { + if (!l) return null; + for (var e = Ot(), t = 0; t < r.length; t++) { + var n = r[t], + i = s(n, t); + Pt(e, i.x, i.y); + } + return e; + })(), + c = A(function (e, n) { + var r = s(e, n); + l && + (r = (function (e, t, n) { + var r = t.x1 + t.w / 2, + i = t.y1 + t.h / 2; + return { x: r + (n.x - r) * e, y: i + (n.y - i) * e }; + })(Math.abs(t.spacingFactor), u, r)); + return null != t.transform && (r = t.transform(e, r)), r; + }, o); + if (t.animate) { + for (var h = 0; h < r.length; h++) { + var d = r[h], + p = c(d, h); + if (null == t.animateFilter || t.animateFilter(d, h)) { + var g = d.animation({ + position: p, + duration: t.animationDuration, + easing: t.animationEasing, + }); + e.animations.push(g); + } else d.position(p); + } + if (t.fit) { + var f = i.animation({ + fit: { boundingBox: a.boundingBoxAt(c), padding: t.padding }, + duration: t.animationDuration, + easing: t.animationEasing, + }); + e.animations.push(f); + } else if (void 0 !== t.zoom && void 0 !== t.pan) { + var v = i.animation({ + zoom: t.zoom, + pan: t.pan, + duration: t.animationDuration, + easing: t.animationEasing, + }); + e.animations.push(v); + } + e.animations.forEach(function (e) { + return e.play(); + }), + e.one("layoutready", t.ready), + e.emit({ type: "layoutready", layout: e }), + _r + .all( + e.animations.map(function (e) { + return e.promise(); + }), + ) + .then(function () { + e.one("layoutstop", t.stop), e.emit({ type: "layoutstop", layout: e }); + }); + } else + r.positions(c), + t.fit && i.fit(t.eles, t.padding), + null != t.zoom && i.zoom(t.zoom), + t.pan && i.pan(t.pan), + e.one("layoutready", t.ready), + e.emit({ type: "layoutready", layout: e }), + e.one("layoutstop", t.stop), + e.emit({ type: "layoutstop", layout: e }); + return this; + }, + layout: function (e) { + return this.cy().makeLayout(z({}, e, { eles: this })); + }, + }; + function Vo(e, t, n) { + var r, + i = n._private, + a = (i.styleCache = i.styleCache || []); + return null != (r = a[e]) ? r : (r = a[e] = t(n)); + } + function Uo(e, t) { + return ( + (e = Ie(e)), + function (n) { + return Vo(e, t, n); + } + ); + } + function jo(e, t) { + e = Ie(e); + var n = function (e) { + return t.call(e); + }; + return function () { + var t = this[0]; + if (t) return Vo(e, n, t); + }; + } + Xo.createLayout = Xo.makeLayout = Xo.layout; + var qo = { + recalculateRenderedStyle: function (e) { + var t = this.cy(), + n = t.renderer(), + r = t.styleEnabled(); + return n && r && n.recalculateRenderedStyle(this, e), this; + }, + dirtyStyleCache: function () { + var e, + t = this.cy(), + n = function (e) { + return (e._private.styleCache = null); + }; + return ( + t.hasCompoundNodes() + ? ((e = this.spawnSelf().merge(this.descendants()).merge(this.parents())).merge(e.connectedEdges()), e.forEach(n)) + : this.forEach(function (e) { + n(e), e.connectedEdges().forEach(n); + }), + this + ); + }, + updateStyle: function (e) { + var t = this._private.cy; + if (!t.styleEnabled()) return this; + if (t.batching()) return t._private.batchStyleEles.merge(this), this; + var n = this; + (e = !(!e && void 0 !== e)), t.hasCompoundNodes() && (n = this.spawnSelf().merge(this.descendants()).merge(this.parents())); + var r = n; + return ( + e ? r.emitAndNotify("style") : r.emit("style"), + n.forEach(function (e) { + return (e._private.styleDirty = !0); + }), + this + ); + }, + cleanStyle: function () { + var e = this.cy(); + if (e.styleEnabled()) + for (var t = 0; t < this.length; t++) { + var n = this[t]; + n._private.styleDirty && ((n._private.styleDirty = !1), e.style().apply(n)); + } + }, + parsedStyle: function (e) { + var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], + n = this[0], + r = n.cy(); + if (r.styleEnabled() && n) { + this.cleanStyle(); + var i = n._private.style[e]; + return null != i ? i : t ? r.style().getDefaultProperty(e) : null; + } + }, + numericStyle: function (e) { + var t = this[0]; + if (t.cy().styleEnabled() && t) { + var n = t.pstyle(e); + return void 0 !== n.pfValue ? n.pfValue : n.value; + } + }, + numericStyleUnits: function (e) { + var t = this[0]; + if (t.cy().styleEnabled()) return t ? t.pstyle(e).units : void 0; + }, + renderedStyle: function (e) { + var t = this.cy(); + if (!t.styleEnabled()) return this; + var n = this[0]; + return n ? t.style().getRenderedStyle(n, e) : void 0; + }, + style: function (e, t) { + var n = this.cy(); + if (!n.styleEnabled()) return this; + var r = n.style(); + if (m(e)) { + var i = e; + r.applyBypass(this, i, false), this.emitAndNotify("style"); + } else if (f(e)) { + if (void 0 === t) { + var a = this[0]; + return a ? r.getStylePropertyValue(a, e) : void 0; + } + r.applyBypass(this, e, t, false), this.emitAndNotify("style"); + } else if (void 0 === e) { + var o = this[0]; + return o ? r.getRawStyle(o) : void 0; + } + return this; + }, + removeStyle: function (e) { + var t = this.cy(); + if (!t.styleEnabled()) return this; + var n = t.style(), + r = this; + if (void 0 === e) + for (var i = 0; i < r.length; i++) { + var a = r[i]; + n.removeAllBypasses(a, false); + } + else { + e = e.split(/\s+/); + for (var o = 0; o < r.length; o++) { + var s = r[o]; + n.removeBypasses(s, e, false); + } + } + return this.emitAndNotify("style"), this; + }, + show: function () { + return this.css("display", "element"), this; + }, + hide: function () { + return this.css("display", "none"), this; + }, + effectiveOpacity: function () { + var e = this.cy(); + if (!e.styleEnabled()) return 1; + var t = e.hasCompoundNodes(), + n = this[0]; + if (n) { + var r = n._private, + i = n.pstyle("opacity").value; + if (!t) return i; + var a = r.data.parent ? n.parents() : null; + if (a) for (var o = 0; o < a.length; o++) i *= a[o].pstyle("opacity").value; + return i; + } + }, + transparent: function () { + if (!this.cy().styleEnabled()) return !1; + var e = this[0], + t = e.cy().hasCompoundNodes(); + return e ? (t ? 0 === e.effectiveOpacity() : 0 === e.pstyle("opacity").value) : void 0; + }, + backgrounding: function () { + return !!this.cy().styleEnabled() && !!this[0]._private.backgrounding; + }, + }; + function Ho(e, t) { + var n = e._private.data.parent ? e.parents() : null; + if (n) for (var r = 0; r < n.length; r++) if (!t(n[r])) return !1; + return !0; + } + function Wo(e) { + var t = e.ok, + n = e.edgeOkViaNode || e.ok, + r = e.parentOk || e.ok; + return function () { + var e = this.cy(); + if (!e.styleEnabled()) return !0; + var i = this[0], + a = e.hasCompoundNodes(); + if (i) { + var o = i._private; + if (!t(i)) return !1; + if (i.isNode()) return !a || Ho(i, r); + var s = o.source, + l = o.target; + return n(s) && (!a || Ho(s, n)) && (s === l || (n(l) && (!a || Ho(l, n)))); + } + }; + } + var $o = Uo("eleTakesUpSpace", function (e) { + return "element" === e.pstyle("display").value && 0 !== e.width() && (!e.isNode() || 0 !== e.height()); + }); + qo.takesUpSpace = jo("takesUpSpace", Wo({ ok: $o })); + var Ko = Uo("eleInteractive", function (e) { + return "yes" === e.pstyle("events").value && "visible" === e.pstyle("visibility").value && $o(e); + }), + Zo = Uo("parentInteractive", function (e) { + return "visible" === e.pstyle("visibility").value && $o(e); + }); + (qo.interactive = jo("interactive", Wo({ ok: Ko, parentOk: Zo, edgeOkViaNode: $o }))), + (qo.noninteractive = function () { + var e = this[0]; + if (e) return !e.interactive(); + }); + var Qo = Uo("eleVisible", function (e) { + return "visible" === e.pstyle("visibility").value && 0 !== e.pstyle("opacity").pfValue && $o(e); + }), + Jo = $o; + (qo.visible = jo("visible", Wo({ ok: Qo, edgeOkViaNode: Jo }))), + (qo.hidden = function () { + var e = this[0]; + if (e) return !e.visible(); + }), + (qo.isBundledBezier = jo("isBundledBezier", function () { + return !!this.cy().styleEnabled() && !this.removed() && "bezier" === this.pstyle("curve-style").value && this.takesUpSpace(); + })), + (qo.bypass = qo.css = qo.style), + (qo.renderedCss = qo.renderedStyle), + (qo.removeBypass = qo.removeCss = qo.removeStyle), + (qo.pstyle = qo.parsedStyle); + var es = {}; + function ts(e) { + return function () { + var t = arguments, + n = []; + if (2 === t.length) { + var r = t[0], + i = t[1]; + this.on(e.event, r, i); + } else if (1 === t.length && v(t[0])) { + var a = t[0]; + this.on(e.event, a); + } else if (0 === t.length || (1 === t.length && y(t[0]))) { + for (var o = 1 === t.length ? t[0] : null, s = 0; s < this.length; s++) { + var l = this[s], + u = !e.ableField || l._private[e.ableField], + c = l._private[e.field] != e.value; + if (e.overrideAble) { + var h = e.overrideAble(l); + if (void 0 !== h && ((u = h), !h)) return this; + } + u && ((l._private[e.field] = e.value), c && n.push(l)); + } + var d = this.spawn(n); + d.updateStyle(), d.emit(e.event), o && d.emit(o); + } + return this; + }; + } + function ns(e) { + (es[e.field] = function () { + var t = this[0]; + if (t) { + if (e.overrideField) { + var n = e.overrideField(t); + if (void 0 !== n) return n; + } + return t._private[e.field]; + } + }), + (es[e.on] = ts({ + event: e.on, + field: e.field, + ableField: e.ableField, + overrideAble: e.overrideAble, + value: !0, + })), + (es[e.off] = ts({ + event: e.off, + field: e.field, + ableField: e.ableField, + overrideAble: e.overrideAble, + value: !1, + })); + } + ns({ + field: "locked", + overrideField: function (e) { + return !!e.cy().autolock() || void 0; + }, + on: "lock", + off: "unlock", + }), + ns({ + field: "grabbable", + overrideField: function (e) { + return !e.cy().autoungrabify() && !e.pannable() && void 0; + }, + on: "grabify", + off: "ungrabify", + }), + ns({ + field: "selected", + ableField: "selectable", + overrideAble: function (e) { + return !e.cy().autounselectify() && void 0; + }, + on: "select", + off: "unselect", + }), + ns({ + field: "selectable", + overrideField: function (e) { + return !e.cy().autounselectify() && void 0; + }, + on: "selectify", + off: "unselectify", + }), + (es.deselect = es.unselect), + (es.grabbed = function () { + var e = this[0]; + if (e) return e._private.grabbed; + }), + ns({ field: "active", on: "activate", off: "unactivate" }), + ns({ field: "pannable", on: "panify", off: "unpanify" }), + (es.inactive = function () { + var e = this[0]; + if (e) return !e._private.active; + }); + var rs = {}, + is = function (e) { + return function (t) { + for (var n = [], r = 0; r < this.length; r++) { + var i = this[r]; + if (i.isNode()) { + for (var a = !1, o = i.connectedEdges(), s = 0; s < o.length; s++) { + var l = o[s], + u = l.source(), + c = l.target(); + if ((e.noIncomingEdges && c === i && u !== i) || (e.noOutgoingEdges && u === i && c !== i)) { + a = !0; + break; + } + } + a || n.push(i); + } + } + return this.spawn(n, !0).filter(t); + }; + }, + as = function (e) { + return function (t) { + for (var n = [], r = 0; r < this.length; r++) { + var i = this[r]; + if (i.isNode()) + for (var a = i.connectedEdges(), o = 0; o < a.length; o++) { + var s = a[o], + l = s.source(), + u = s.target(); + e.outgoing && l === i ? (n.push(s), n.push(u)) : e.incoming && u === i && (n.push(s), n.push(l)); + } + } + return this.spawn(n, !0).filter(t); + }; + }, + os = function (e) { + return function (t) { + for (var n = this, r = [], i = {}; ; ) { + var a = e.outgoing ? n.outgoers() : n.incomers(); + if (0 === a.length) break; + for (var o = !1, s = 0; s < a.length; s++) { + var l = a[s], + u = l.id(); + i[u] || ((i[u] = !0), r.push(l), (o = !0)); + } + if (!o) break; + n = a; + } + return this.spawn(r, !0).filter(t); + }; + }; + function ss(e) { + return function (t) { + for (var n = [], r = 0; r < this.length; r++) { + var i = this[r]._private[e.attr]; + i && n.push(i); + } + return this.spawn(n, !0).filter(t); + }; + } + function ls(e) { + return function (t) { + var n = [], + r = this._private.cy, + i = e || {}; + f(t) && (t = r.$(t)); + for (var a = 0; a < t.length; a++) + for (var o = t[a]._private.edges, s = 0; s < o.length; s++) { + var l = o[s], + u = l._private.data, + c = this.hasElementWithId(u.source) && t.hasElementWithId(u.target), + h = t.hasElementWithId(u.source) && this.hasElementWithId(u.target); + if (c || h) { + if (i.thisIsSrc || i.thisIsTgt) { + if (i.thisIsSrc && !c) continue; + if (i.thisIsTgt && !h) continue; + } + n.push(l); + } + } + return this.spawn(n, !0); + }; + } + function us(e) { + return ( + (e = z({}, { codirected: !1 }, e)), + function (t) { + for (var n = [], r = this.edges(), i = e, a = 0; a < r.length; a++) + for (var o = r[a]._private, s = o.source, l = s._private.data.id, u = o.data.target, c = s._private.edges, h = 0; h < c.length; h++) { + var d = c[h], + p = d._private.data, + g = p.target, + f = p.source, + v = g === u && f === l, + y = l === g && u === f; + ((i.codirected && v) || (!i.codirected && (v || y))) && n.push(d); + } + return this.spawn(n, !0).filter(t); + } + ); + } + (rs.clearTraversalCache = function () { + for (var e = 0; e < this.length; e++) this[e]._private.traversalCache = null; + }), + z(rs, { + roots: is({ noIncomingEdges: !0 }), + leaves: is({ noOutgoingEdges: !0 }), + outgoers: Ba(as({ outgoing: !0 }), "outgoers"), + successors: os({ outgoing: !0 }), + incomers: Ba(as({ incoming: !0 }), "incomers"), + predecessors: os({ incoming: !0 }), + }), + z(rs, { + neighborhood: Ba(function (e) { + for (var t = [], n = this.nodes(), r = 0; r < n.length; r++) + for (var i = n[r], a = i.connectedEdges(), o = 0; o < a.length; o++) { + var s = a[o], + l = s.source(), + u = s.target(), + c = i === l ? u : l; + c.length > 0 && t.push(c[0]), t.push(s[0]); + } + return this.spawn(t, !0).filter(e); + }, "neighborhood"), + closedNeighborhood: function (e) { + return this.neighborhood().add(this).filter(e); + }, + openNeighborhood: function (e) { + return this.neighborhood(e); + }, + }), + (rs.neighbourhood = rs.neighborhood), + (rs.closedNeighbourhood = rs.closedNeighborhood), + (rs.openNeighbourhood = rs.openNeighborhood), + z(rs, { + source: Ba(function (e) { + var t, + n = this[0]; + return n && (t = n._private.source || n.cy().collection()), t && e ? t.filter(e) : t; + }, "source"), + target: Ba(function (e) { + var t, + n = this[0]; + return n && (t = n._private.target || n.cy().collection()), t && e ? t.filter(e) : t; + }, "target"), + sources: ss({ attr: "source" }), + targets: ss({ attr: "target" }), + }), + z(rs, { + edgesWith: Ba(ls(), "edgesWith"), + edgesTo: Ba(ls({ thisIsSrc: !0 }), "edgesTo"), + }), + z(rs, { + connectedEdges: Ba(function (e) { + for (var t = [], n = 0; n < this.length; n++) { + var r = this[n]; + if (r.isNode()) + for (var i = r._private.edges, a = 0; a < i.length; a++) { + var o = i[a]; + t.push(o); + } + } + return this.spawn(t, !0).filter(e); + }, "connectedEdges"), + connectedNodes: Ba(function (e) { + for (var t = [], n = 0; n < this.length; n++) { + var r = this[n]; + r.isEdge() && (t.push(r.source()[0]), t.push(r.target()[0])); + } + return this.spawn(t, !0).filter(e); + }, "connectedNodes"), + parallelEdges: Ba(us(), "parallelEdges"), + codirectedEdges: Ba(us({ codirected: !0 }), "codirectedEdges"), + }), + z(rs, { + components: function (e) { + var t = this, + n = t.cy(), + r = n.collection(), + i = null == e ? t.nodes() : e.nodes(), + a = []; + null != e && i.empty() && (i = e.sources()); + var o = function (e, t) { + r.merge(e), i.unmerge(e), t.merge(e); + }; + if (i.empty()) return t.spawn(); + var s = function () { + var e = n.collection(); + a.push(e); + var r = i[0]; + o(r, e), + t.bfs({ + directed: !1, + roots: r, + visit: function (t) { + return o(t, e); + }, + }), + e.forEach(function (n) { + n.connectedEdges().forEach(function (n) { + t.has(n) && e.has(n.source()) && e.has(n.target()) && e.merge(n); + }); + }); + }; + do { + s(); + } while (i.length > 0); + return a; + }, + component: function () { + var e = this[0]; + return e.cy().mutableElements().components(e)[0]; + }, + }), + (rs.componentsOf = rs.components); + var cs = function (e, t) { + var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], + r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3]; + if (void 0 !== e) { + var i = new tt(), + a = !1; + if (t) { + if (t.length > 0 && m(t[0]) && !E(t[0])) { + a = !0; + for (var o = [], s = new rt(), l = 0, u = t.length; l < u; l++) { + var c = t[l]; + null == c.data && (c.data = {}); + var h = c.data; + if (null == h.id) h.id = He(); + else if (e.hasElementWithId(h.id) || s.has(h.id)) continue; + var d = new it(e, c, !1); + o.push(d), s.add(h.id); + } + t = o; + } + } else t = []; + this.length = 0; + for (var p = 0, g = t.length; p < g; p++) { + var f = t[p][0]; + if (null != f) { + var v = f._private.data.id; + (n && i.has(v)) || (n && i.set(v, { index: this.length, ele: f }), (this[this.length] = f), this.length++); + } + } + (this._private = { + eles: this, + cy: e, + get map() { + return null == this.lazyMap && this.rebuildMap(), this.lazyMap; + }, + set map(e) { + this.lazyMap = e; + }, + rebuildMap: function () { + for (var e = (this.lazyMap = new tt()), t = this.eles, n = 0; n < t.length; n++) { + var r = t[n]; + e.set(r.id(), { index: n, ele: r }); + } + }, + }), + n && (this._private.map = i), + a && !r && this.restore(); + } else Ve("A collection must have a reference to the core"); + }, + hs = (it.prototype = cs.prototype = Object.create(Array.prototype)); + (hs.instanceString = function () { + return "collection"; + }), + (hs.spawn = function (e, t) { + return new cs(this.cy(), e, t); + }), + (hs.spawnSelf = function () { + return this.spawn(this); + }), + (hs.cy = function () { + return this._private.cy; + }), + (hs.renderer = function () { + return this._private.cy.renderer(); + }), + (hs.element = function () { + return this[0]; + }), + (hs.collection = function () { + return _(this) ? this : new cs(this._private.cy, [this]); + }), + (hs.unique = function () { + return new cs(this._private.cy, this, !0); + }), + (hs.hasElementWithId = function (e) { + return (e = "" + e), this._private.map.has(e); + }), + (hs.getElementById = function (e) { + e = "" + e; + var t = this._private.cy, + n = this._private.map.get(e); + return n ? n.ele : new cs(t); + }), + (hs.$id = hs.getElementById), + (hs.poolIndex = function () { + var e = this._private.cy._private.elements, + t = this[0]._private.data.id; + return e._private.map.get(t).index; + }), + (hs.indexOf = function (e) { + var t = e[0]._private.data.id; + return this._private.map.get(t).index; + }), + (hs.indexOfId = function (e) { + return (e = "" + e), this._private.map.get(e).index; + }), + (hs.json = function (e) { + var t = this.element(), + n = this.cy(); + if (null == t && e) return this; + if (null != t) { + var r = t._private; + if (m(e)) { + if ((n.startBatch(), e.data)) { + t.data(e.data); + var i = r.data; + if (t.isEdge()) { + var a = !1, + o = {}, + s = e.data.source, + l = e.data.target; + null != s && s != i.source && ((o.source = "" + s), (a = !0)), + null != l && l != i.target && ((o.target = "" + l), (a = !0)), + a && (t = t.move(o)); + } else { + var u = "parent" in e.data, + c = e.data.parent; + !u || + (null == c && null == i.parent) || + c == i.parent || + (void 0 === c && (c = null), null != c && (c = "" + c), (t = t.move({ parent: c }))); + } + } + e.position && t.position(e.position); + var h = function (n, i, a) { + var o = e[n]; + null != o && o !== r[n] && (o ? t[i]() : t[a]()); + }; + return ( + h("removed", "remove", "restore"), + h("selected", "select", "unselect"), + h("selectable", "selectify", "unselectify"), + h("locked", "lock", "unlock"), + h("grabbable", "grabify", "ungrabify"), + h("pannable", "panify", "unpanify"), + null != e.classes && t.classes(e.classes), + n.endBatch(), + this + ); + } + if (void 0 === e) { + var d = { + data: qe(r.data), + position: qe(r.position), + group: r.group, + removed: r.removed, + selected: r.selected, + selectable: r.selectable, + locked: r.locked, + grabbable: r.grabbable, + pannable: r.pannable, + classes: null, + }; + d.classes = ""; + var p = 0; + return ( + r.classes.forEach(function (e) { + return (d.classes += 0 == p++ ? e : " " + e); + }), + d + ); + } + } + }), + (hs.jsons = function () { + for (var e = [], t = 0; t < this.length; t++) { + var n = this[t].json(); + e.push(n); + } + return e; + }), + (hs.clone = function () { + for (var e = this.cy(), t = [], n = 0; n < this.length; n++) { + var r = this[n].json(), + i = new it(e, r, !1); + t.push(i); + } + return new cs(e, t); + }), + (hs.copy = hs.clone), + (hs.restore = function () { + for ( + var e, + t, + n = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0], + r = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], + i = this, + a = i.cy(), + o = a._private, + s = [], + l = [], + u = 0, + c = i.length; + u < c; + u++ + ) { + var h = i[u]; + (r && !h.removed()) || (h.isNode() ? s.push(h) : l.push(h)); + } + e = s.concat(l); + var d = function () { + e.splice(t, 1), t--; + }; + for (t = 0; t < e.length; t++) { + var p = e[t], + g = p._private, + v = g.data; + if ((p.clearTraversalCache(), r || g.removed)) + if (void 0 === v.id) v.id = He(); + else if (b(v.id)) v.id = "" + v.id; + else { + if (C(v.id) || !f(v.id)) { + Ve("Can not create element with invalid string ID `" + v.id + "`"), d(); + continue; + } + if (a.hasElementWithId(v.id)) { + Ve("Can not create second element with ID `" + v.id + "`"), d(); + continue; + } + } + var y = v.id; + if (p.isNode()) { + var m = g.position; + null == m.x && (m.x = 0), null == m.y && (m.y = 0); + } + if (p.isEdge()) { + for (var x = p, w = ["source", "target"], E = w.length, _ = !1, T = 0; T < E; T++) { + var D = w[T], + N = v[D]; + b(N) && (N = v[D] = "" + v[D]), + null == N || "" === N + ? (Ve("Can not create edge `" + y + "` with unspecified " + D), (_ = !0)) + : a.hasElementWithId(N) || (Ve("Can not create edge `" + y + "` with nonexistant " + D + " `" + N + "`"), (_ = !0)); + } + if (_) { + d(); + continue; + } + var A = a.getElementById(v.source), + L = a.getElementById(v.target); + A.same(L) ? A._private.edges.push(x) : (A._private.edges.push(x), L._private.edges.push(x)), + (x._private.source = A), + (x._private.target = L); + } + (g.map = new tt()), g.map.set(y, { ele: p, index: 0 }), (g.removed = !1), r && a.addToPool(p); + } + for (var k = 0; k < s.length; k++) { + var S = s[k], + I = S._private.data; + b(I.parent) && (I.parent = "" + I.parent); + var M = I.parent; + if (null != M || S._private.parent) { + var O = S._private.parent ? a.collection().merge(S._private.parent) : a.getElementById(M); + if (O.empty()) I.parent = void 0; + else if (O[0].removed()) + je("Node added with missing parent, reference to parent removed"), (I.parent = void 0), (S._private.parent = null); + else { + for (var P = !1, R = O; !R.empty(); ) { + if (S.same(R)) { + (P = !0), (I.parent = void 0); + break; + } + R = R.parent(); + } + P || (O[0]._private.children.push(S), (S._private.parent = O[0]), (o.hasCompoundNodes = !0)); + } + } + } + if (e.length > 0) { + for (var B = e.length === i.length ? i : new cs(a, e), F = 0; F < B.length; F++) { + var z = B[F]; + z.isNode() || (z.parallelEdges().clearTraversalCache(), z.source().clearTraversalCache(), z.target().clearTraversalCache()); + } + (o.hasCompoundNodes ? a.collection().merge(B).merge(B.connectedNodes()).merge(B.parent()) : B) + .dirtyCompoundBoundsCache() + .dirtyBoundingBoxCache() + .updateStyle(n), + n ? B.emitAndNotify("add") : r && B.emit("add"); + } + return i; + }), + (hs.removed = function () { + var e = this[0]; + return e && e._private.removed; + }), + (hs.inside = function () { + var e = this[0]; + return e && !e._private.removed; + }), + (hs.remove = function () { + var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0], + t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], + n = this, + r = [], + i = {}, + a = n._private.cy; + function o(e) { + var n = i[e.id()]; + (t && e.removed()) || + n || + ((i[e.id()] = !0), + e.isNode() + ? (r.push(e), + (function (e) { + for (var t = e._private.edges, n = 0; n < t.length; n++) o(t[n]); + })(e), + (function (e) { + for (var t = e._private.children, n = 0; n < t.length; n++) o(t[n]); + })(e)) + : r.unshift(e)); + } + for (var s = 0, l = n.length; s < l; s++) o(n[s]); + function u(e, t) { + var n = e._private.edges; + Ze(n, t), e.clearTraversalCache(); + } + function c(e) { + e.clearTraversalCache(); + } + var h = []; + function d(e, t) { + t = t[0]; + var n = (e = e[0])._private.children, + r = e.id(); + Ze(n, t), (t._private.parent = null), h.ids[r] || ((h.ids[r] = !0), h.push(e)); + } + (h.ids = {}), n.dirtyCompoundBoundsCache(), t && a.removeFromPool(r); + for (var p = 0; p < r.length; p++) { + var g = r[p]; + if (g.isEdge()) { + var f = g.source()[0], + v = g.target()[0]; + u(f, g), u(v, g); + for (var y = g.parallelEdges(), m = 0; m < y.length; m++) { + var b = y[m]; + c(b), b.isBundledBezier() && b.dirtyBoundingBoxCache(); + } + } else { + var x = g.parent(); + 0 !== x.length && d(x, g); + } + t && (g._private.removed = !0); + } + var w = a._private.elements; + a._private.hasCompoundNodes = !1; + for (var E = 0; E < w.length; E++) + if (w[E].isParent()) { + a._private.hasCompoundNodes = !0; + break; + } + var _ = new cs(this.cy(), r); + _.size() > 0 && (e ? _.emitAndNotify("remove") : t && _.emit("remove")); + for (var T = 0; T < h.length; T++) { + var D = h[T]; + (t && D.removed()) || D.updateStyle(); + } + return _; + }), + (hs.move = function (e) { + var t = this._private.cy, + n = this, + r = !1, + i = !1, + a = function (e) { + return null == e ? e : "" + e; + }; + if (void 0 !== e.source || void 0 !== e.target) { + var o = a(e.source), + s = a(e.target), + l = null != o && t.hasElementWithId(o), + u = null != s && t.hasElementWithId(s); + (l || u) && + (t.batch(function () { + n.remove(r, i), n.emitAndNotify("moveout"); + for (var e = 0; e < n.length; e++) { + var t = n[e], + a = t._private.data; + t.isEdge() && (l && (a.source = o), u && (a.target = s)); + } + n.restore(r, i); + }), + n.emitAndNotify("move")); + } else if (void 0 !== e.parent) { + var c = a(e.parent); + if (null === c || t.hasElementWithId(c)) { + var h = null === c ? void 0 : c; + t.batch(function () { + var e = n.remove(r, i); + e.emitAndNotify("moveout"); + for (var t = 0; t < n.length; t++) { + var a = n[t], + o = a._private.data; + a.isNode() && (o.parent = h); + } + e.restore(r, i); + }), + n.emitAndNotify("move"); + } + } + return this; + }), + [ + vr, + $i, + Ki, + Oa, + Fa, + ja, + qa, + xo, + Po, + Ro, + { + isNode: function () { + return "nodes" === this.group(); + }, + isEdge: function () { + return "edges" === this.group(); + }, + isLoop: function () { + return this.isEdge() && this.source()[0] === this.target()[0]; + }, + isSimple: function () { + return this.isEdge() && this.source()[0] !== this.target()[0]; + }, + group: function () { + var e = this[0]; + if (e) return e._private.group; + }, + }, + Go, + Xo, + qo, + es, + rs, + ].forEach(function (e) { + z(hs, e); + }); + var ds = { + add: function (e) { + var t, + n = this; + if (w(e)) { + var r = e; + if (r._private.cy === n) t = r.restore(); + else { + for (var i = [], a = 0; a < r.length; a++) { + var o = r[a]; + i.push(o.json()); + } + t = new cs(n, i); + } + } else if (y(e)) t = new cs(n, e); + else if (m(e) && (y(e.nodes) || y(e.edges))) { + for (var s = e, l = [], u = ["nodes", "edges"], c = 0, h = u.length; c < h; c++) { + var d = u[c], + p = s[d]; + if (y(p)) + for (var g = 0, f = p.length; g < f; g++) { + var v = z({ group: d }, p[g]); + l.push(v); + } + } + t = new cs(n, l); + } else t = new it(n, e).collection(); + return t; + }, + remove: function (e) { + if (w(e)); + else if (f(e)) { + var t = e; + e = this.$(t); + } + return e.remove(); + }, + }; + function ps(e, t, n, r) { + var i = 4, + a = 1e-7, + o = 10, + s = 11, + l = 1 / (s - 1), + u = "undefined" != typeof Float32Array; + if (4 !== arguments.length) return !1; + for (var c = 0; c < 4; ++c) if ("number" != typeof arguments[c] || isNaN(arguments[c]) || !isFinite(arguments[c])) return !1; + (e = Math.min(e, 1)), (n = Math.min(n, 1)), (e = Math.max(e, 0)), (n = Math.max(n, 0)); + var h = u ? new Float32Array(s) : new Array(s); + function d(e, t) { + return 1 - 3 * t + 3 * e; + } + function p(e, t) { + return 3 * t - 6 * e; + } + function g(e) { + return 3 * e; + } + function f(e, t, n) { + return ((d(t, n) * e + p(t, n)) * e + g(t)) * e; + } + function v(e, t, n) { + return 3 * d(t, n) * e * e + 2 * p(t, n) * e + g(t); + } + function y(t) { + for (var r = 0, u = 1, c = s - 1; u !== c && h[u] <= t; ++u) r += l; + --u; + var d = r + ((t - h[u]) / (h[u + 1] - h[u])) * l, + p = v(d, e, n); + return p >= 0.001 + ? (function (t, r) { + for (var a = 0; a < i; ++a) { + var o = v(r, e, n); + if (0 === o) return r; + r -= (f(r, e, n) - t) / o; + } + return r; + })(t, d) + : 0 === p + ? d + : (function (t, r, i) { + var s, + l, + u = 0; + do { + (s = f((l = r + (i - r) / 2), e, n) - t) > 0 ? (i = l) : (r = l); + } while (Math.abs(s) > a && ++u < o); + return l; + })(t, r, r + l); + } + var m = !1; + function b() { + (m = !0), + (e === t && n === r) || + (function () { + for (var t = 0; t < s; ++t) h[t] = f(t * l, e, n); + })(); + } + var x = function (i) { + return m || b(), e === t && n === r ? i : 0 === i ? 0 : 1 === i ? 1 : f(y(i), t, r); + }; + x.getControlPoints = function () { + return [ + { x: e, y: t }, + { x: n, y: r }, + ]; + }; + var w = "generateBezier(" + [e, t, n, r] + ")"; + return ( + (x.toString = function () { + return w; + }), + x + ); + } + var gs = (function () { + function e(e) { + return -e.tension * e.x - e.friction * e.v; + } + function t(t, n, r) { + var i = { + x: t.x + r.dx * n, + v: t.v + r.dv * n, + tension: t.tension, + friction: t.friction, + }; + return { dx: i.v, dv: e(i) }; + } + function n(n, r) { + var i = { dx: n.v, dv: e(n) }, + a = t(n, 0.5 * r, i), + o = t(n, 0.5 * r, a), + s = t(n, r, o), + l = (1 / 6) * (i.dx + 2 * (a.dx + o.dx) + s.dx), + u = (1 / 6) * (i.dv + 2 * (a.dv + o.dv) + s.dv); + return (n.x = n.x + l * r), (n.v = n.v + u * r), n; + } + return function e(t, r, i) { + var a, + o, + s, + l = { x: -1, v: 0, tension: null, friction: null }, + u = [0], + c = 0, + h = 1e-4; + for ( + t = parseFloat(t) || 500, + r = parseFloat(r) || 20, + i = i || null, + l.tension = t, + l.friction = r, + o = (a = null !== i) ? ((c = e(t, r)) / i) * 0.016 : 0.016; + (s = n(s || l, o)), u.push(1 + s.x), (c += 16), Math.abs(s.x) > h && Math.abs(s.v) > h; + + ); + return a + ? function (e) { + return u[(e * (u.length - 1)) | 0]; + } + : c; + }; + })(), + fs = function (e, t, n, r) { + var i = ps(e, t, n, r); + return function (e, t, n) { + return e + (t - e) * i(n); + }; + }, + vs = { + linear: function (e, t, n) { + return e + (t - e) * n; + }, + ease: fs(0.25, 0.1, 0.25, 1), + "ease-in": fs(0.42, 0, 1, 1), + "ease-out": fs(0, 0, 0.58, 1), + "ease-in-out": fs(0.42, 0, 0.58, 1), + "ease-in-sine": fs(0.47, 0, 0.745, 0.715), + "ease-out-sine": fs(0.39, 0.575, 0.565, 1), + "ease-in-out-sine": fs(0.445, 0.05, 0.55, 0.95), + "ease-in-quad": fs(0.55, 0.085, 0.68, 0.53), + "ease-out-quad": fs(0.25, 0.46, 0.45, 0.94), + "ease-in-out-quad": fs(0.455, 0.03, 0.515, 0.955), + "ease-in-cubic": fs(0.55, 0.055, 0.675, 0.19), + "ease-out-cubic": fs(0.215, 0.61, 0.355, 1), + "ease-in-out-cubic": fs(0.645, 0.045, 0.355, 1), + "ease-in-quart": fs(0.895, 0.03, 0.685, 0.22), + "ease-out-quart": fs(0.165, 0.84, 0.44, 1), + "ease-in-out-quart": fs(0.77, 0, 0.175, 1), + "ease-in-quint": fs(0.755, 0.05, 0.855, 0.06), + "ease-out-quint": fs(0.23, 1, 0.32, 1), + "ease-in-out-quint": fs(0.86, 0, 0.07, 1), + "ease-in-expo": fs(0.95, 0.05, 0.795, 0.035), + "ease-out-expo": fs(0.19, 1, 0.22, 1), + "ease-in-out-expo": fs(1, 0, 0, 1), + "ease-in-circ": fs(0.6, 0.04, 0.98, 0.335), + "ease-out-circ": fs(0.075, 0.82, 0.165, 1), + "ease-in-out-circ": fs(0.785, 0.135, 0.15, 0.86), + spring: function (e, t, n) { + if (0 === n) return vs.linear; + var r = gs(e, t, n); + return function (e, t, n) { + return e + (t - e) * r(n); + }; + }, + "cubic-bezier": fs, + }; + function ys(e, t, n, r, i) { + if (1 === r) return n; + if (t === n) return n; + var a = i(t, n, r); + return ( + null == e || + ((e.roundValue || e.color) && (a = Math.round(a)), + void 0 !== e.min && (a = Math.max(a, e.min)), + void 0 !== e.max && (a = Math.min(a, e.max))), + a + ); + } + function ms(e, t) { + return null != e.pfValue || null != e.value ? (null == e.pfValue || (null != t && "%" === t.type.units) ? e.value : e.pfValue) : e; + } + function bs(e, t, n, r, i) { + var a = null != i ? i.type : null; + n < 0 ? (n = 0) : n > 1 && (n = 1); + var o = ms(e, i), + s = ms(t, i); + if (b(o) && b(s)) return ys(a, o, s, n, r); + if (y(o) && y(s)) { + for (var l = [], u = 0; u < s.length; u++) { + var c = o[u], + h = s[u]; + if (null != c && null != h) { + var d = ys(a, c, h, n, r); + l.push(d); + } else l.push(h); + } + return l; + } + } + function xs(e, t, n, r) { + var i = !r, + a = e._private, + o = t._private, + s = o.easing, + l = o.startTime, + u = (r ? e : e.cy()).style(); + if (!o.easingImpl) + if (null == s) o.easingImpl = vs.linear; + else { + var c, h, d; + (c = f(s) ? u.parse("transition-timing-function", s).value : s), + f(c) + ? ((h = c), (d = [])) + : ((h = c[1]), + (d = c.slice(2).map(function (e) { + return +e; + }))), + d.length > 0 ? ("spring" === h && d.push(o.duration), (o.easingImpl = vs[h].apply(null, d))) : (o.easingImpl = vs[h]); + } + var p, + g = o.easingImpl; + if ( + ((p = 0 === o.duration ? 1 : (n - l) / o.duration), o.applying && (p = o.progress), p < 0 ? (p = 0) : p > 1 && (p = 1), null == o.delay) + ) { + var v = o.startPosition, + y = o.position; + if (y && i && !e.locked()) { + var m = {}; + ws(v.x, y.x) && (m.x = bs(v.x, y.x, p, g)), ws(v.y, y.y) && (m.y = bs(v.y, y.y, p, g)), e.position(m); + } + var b = o.startPan, + x = o.pan, + w = a.pan, + E = null != x && r; + E && (ws(b.x, x.x) && (w.x = bs(b.x, x.x, p, g)), ws(b.y, x.y) && (w.y = bs(b.y, x.y, p, g)), e.emit("pan")); + var _ = o.startZoom, + T = o.zoom, + D = null != T && r; + D && (ws(_, T) && (a.zoom = Mt(a.minZoom, bs(_, T, p, g), a.maxZoom)), e.emit("zoom")), (E || D) && e.emit("viewport"); + var C = o.style; + if (C && C.length > 0 && i) { + for (var N = 0; N < C.length; N++) { + var A = C[N], + L = A.name, + k = A, + S = o.startStyle[L], + I = bs(S, k, p, g, u.properties[S.name]); + u.overrideBypass(e, L, I); + } + e.emit("style"); + } + } + return (o.progress = p), p; + } + function ws(e, t) { + return !(null == e || null == t || !((b(e) && b(t)) || (e && t))); + } + function Es(e, t, n, r) { + var i = t._private; + (i.started = !0), (i.startTime = n - i.progress * i.duration); + } + function _s(e, t) { + var n = t._private.aniEles, + r = []; + function i(t, n) { + var i = t._private, + a = i.animation.current, + o = i.animation.queue, + s = !1; + if (0 === a.length) { + var l = o.shift(); + l && a.push(l); + } + for ( + var u = function (e) { + for (var t = e.length - 1; t >= 0; t--) (0, e[t])(); + e.splice(0, e.length); + }, + c = a.length - 1; + c >= 0; + c-- + ) { + var h = a[c], + d = h._private; + d.stopped + ? (a.splice(c, 1), (d.hooked = !1), (d.playing = !1), (d.started = !1), u(d.frames)) + : (d.playing || d.applying) && + (d.playing && d.applying && (d.applying = !1), + d.started || Es(0, h, e), + xs(t, h, e, n), + d.applying && (d.applying = !1), + u(d.frames), + null != d.step && d.step(e), + h.completed() && (a.splice(c, 1), (d.hooked = !1), (d.playing = !1), (d.started = !1), u(d.completes)), + (s = !0)); + } + return n || 0 !== a.length || 0 !== o.length || r.push(t), s; + } + for (var a = !1, o = 0; o < n.length; o++) { + var s = i(n[o]); + a = a || s; + } + var l = i(t, !0); + (a || l) && (n.length > 0 ? t.notify("draw", n) : t.notify("draw")), n.unmerge(r), t.emit("step"); + } + var Ts = { + animate: Wi.animate(), + animation: Wi.animation(), + animated: Wi.animated(), + clearQueue: Wi.clearQueue(), + delay: Wi.delay(), + delayAnimation: Wi.delayAnimation(), + stop: Wi.stop(), + addToAnimationPool: function (e) { + this.styleEnabled() && this._private.aniEles.merge(e); + }, + stopAnimationLoop: function () { + this._private.animationsRunning = !1; + }, + startAnimationLoop: function () { + var e = this; + if (((e._private.animationsRunning = !0), e.styleEnabled())) { + var t = e.renderer(); + t && t.beforeRender + ? t.beforeRender(function (t, n) { + _s(n, e); + }, t.beforeRenderPriorities.animations) + : (function t() { + e._private.animationsRunning && + _e(function (n) { + _s(n, e), t(); + }); + })(); + } + }, + }, + Ds = { + qualifierCompare: function (e, t) { + return null == e || null == t ? null == e && null == t : e.sameText(t); + }, + eventMatches: function (e, t, n) { + var r = t.qualifier; + return null == r || (e !== n.target && E(n.target) && r.matches(n.target)); + }, + addEventFields: function (e, t) { + (t.cy = e), (t.target = e); + }, + callbackContext: function (e, t, n) { + return null != t.qualifier ? n.target : e; + }, + }, + Cs = function (e) { + return f(e) ? new Ia(e) : e; + }, + Ns = { + createEmitter: function () { + var e = this._private; + return e.emitter || (e.emitter = new Ao(Ds, this)), this; + }, + emitter: function () { + return this._private.emitter; + }, + on: function (e, t, n) { + return this.emitter().on(e, Cs(t), n), this; + }, + removeListener: function (e, t, n) { + return this.emitter().removeListener(e, Cs(t), n), this; + }, + removeAllListeners: function () { + return this.emitter().removeAllListeners(), this; + }, + one: function (e, t, n) { + return this.emitter().one(e, Cs(t), n), this; + }, + once: function (e, t, n) { + return this.emitter().one(e, Cs(t), n), this; + }, + emit: function (e, t) { + return this.emitter().emit(e, t), this; + }, + emitAndNotify: function (e, t) { + return this.emit(e), this.notify(e, t), this; + }, + }; + Wi.eventAliasesOn(Ns); + var As = { + png: function (e) { + return (e = e || {}), this._private.renderer.png(e); + }, + jpg: function (e) { + var t = this._private.renderer; + return ((e = e || {}).bg = e.bg || "#fff"), t.jpg(e); + }, + }; + As.jpeg = As.jpg; + var Ls = { + layout: function (e) { + var t = this; + if (null != e) + if (null != e.name) { + var n, + r = e.name, + i = t.extension("layout", r); + if (null != i) return (n = f(e.eles) ? t.$(e.eles) : null != e.eles ? e.eles : t.$()), new i(z({}, e, { cy: t, eles: n })); + Ve("No such layout `" + r + "` found. Did you forget to import it and `cytoscape.use()` it?"); + } else Ve("A `name` must be specified to make a layout"); + else Ve("Layout options must be specified to make a layout"); + }, + }; + Ls.createLayout = Ls.makeLayout = Ls.layout; + var ks = { + notify: function (e, t) { + var n = this._private; + if (this.batching()) { + n.batchNotifications = n.batchNotifications || {}; + var r = (n.batchNotifications[e] = n.batchNotifications[e] || this.collection()); + null != t && r.merge(t); + } else if (n.notificationsEnabled) { + var i = this.renderer(); + !this.destroyed() && i && i.notify(e, t); + } + }, + notifications: function (e) { + var t = this._private; + return void 0 === e ? t.notificationsEnabled : ((t.notificationsEnabled = !!e), this); + }, + noNotifications: function (e) { + this.notifications(!1), e(), this.notifications(!0); + }, + batching: function () { + return this._private.batchCount > 0; + }, + startBatch: function () { + var e = this._private; + return ( + null == e.batchCount && (e.batchCount = 0), + 0 === e.batchCount && ((e.batchStyleEles = this.collection()), (e.batchNotifications = {})), + e.batchCount++, + this + ); + }, + endBatch: function () { + var e = this._private; + if (0 === e.batchCount) return this; + if ((e.batchCount--, 0 === e.batchCount)) { + e.batchStyleEles.updateStyle(); + var t = this.renderer(); + Object.keys(e.batchNotifications).forEach(function (n) { + var r = e.batchNotifications[n]; + r.empty() ? t.notify(n) : t.notify(n, r); + }); + } + return this; + }, + batch: function (e) { + return this.startBatch(), e(), this.endBatch(), this; + }, + batchData: function (e) { + var t = this; + return this.batch(function () { + for (var n = Object.keys(e), r = 0; r < n.length; r++) { + var i = n[r], + a = e[i]; + t.getElementById(i).data(a); + } + }); + }, + }, + Ss = Ke({ + hideEdgesOnViewport: !1, + textureOnViewport: !1, + motionBlur: !1, + motionBlurOpacity: 0.05, + pixelRatio: void 0, + desktopTapThreshold: 4, + touchTapThreshold: 8, + wheelSensitivity: 1, + debug: !1, + showFps: !1, + }), + Is = { + renderTo: function (e, t, n, r) { + return this._private.renderer.renderTo(e, t, n, r), this; + }, + renderer: function () { + return this._private.renderer; + }, + forceRender: function () { + return this.notify("draw"), this; + }, + resize: function () { + return this.invalidateSize(), this.emitAndNotify("resize"), this; + }, + initRenderer: function (e) { + var t = this, + n = t.extension("renderer", e.name); + if (null != n) { + void 0 !== e.wheelSensitivity && + je( + "You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.", + ); + var r = Ss(e); + (r.cy = t), (t._private.renderer = new n(r)), this.notify("init"); + } else Ve("Can not initialise: No such renderer `".concat(e.name, "` found. Did you forget to import it and `cytoscape.use()` it?")); + }, + destroyRenderer: function () { + var e = this; + e.notify("destroy"); + var t = e.container(); + if (t) for (t._cyreg = null; t.childNodes.length > 0; ) t.removeChild(t.childNodes[0]); + (e._private.renderer = null), + e.mutableElements().forEach(function (e) { + var t = e._private; + (t.rscratch = {}), (t.rstyle = {}), (t.animation.current = []), (t.animation.queue = []); + }); + }, + onRender: function (e) { + return this.on("render", e); + }, + offRender: function (e) { + return this.off("render", e); + }, + }; + Is.invalidateDimensions = Is.resize; + var Ms = { + collection: function (e, t) { + return f(e) ? this.$(e) : w(e) ? e.collection() : y(e) ? (t || (t = {}), new cs(this, e, t.unique, t.removed)) : new cs(this); + }, + nodes: function (e) { + var t = this.$(function (e) { + return e.isNode(); + }); + return e ? t.filter(e) : t; + }, + edges: function (e) { + var t = this.$(function (e) { + return e.isEdge(); + }); + return e ? t.filter(e) : t; + }, + $: function (e) { + var t = this._private.elements; + return e ? t.filter(e) : t.spawnSelf(); + }, + mutableElements: function () { + return this._private.elements; + }, + }; + Ms.elements = Ms.filter = Ms.$; + var Os = {}, + Ps = "t"; + (Os.apply = function (e) { + for (var t = this, n = t._private.cy.collection(), r = 0; r < e.length; r++) { + var i = e[r], + a = t.getContextMeta(i); + if (!a.empty) { + var o = t.getContextStyle(a), + s = t.applyContextStyle(a, o, i); + i._private.appliedInitStyle ? t.updateTransitions(i, s.diffProps) : (i._private.appliedInitStyle = !0), + t.updateStyleHints(i) && n.push(i); + } + } + return n; + }), + (Os.getPropertiesDiff = function (e, t) { + var n = this, + r = (n._private.propDiffs = n._private.propDiffs || {}), + i = e + "-" + t, + a = r[i]; + if (a) return a; + for (var o = [], s = {}, l = 0; l < n.length; l++) { + var u = n[l], + c = e[l] === Ps, + h = t[l] === Ps, + d = c !== h, + p = u.mappedProperties.length > 0; + if (d || (h && p)) { + var g = void 0; + (d && p) || d ? (g = u.properties) : p && (g = u.mappedProperties); + for (var f = 0; f < g.length; f++) { + for (var v = g[f], y = v.name, m = !1, b = l + 1; b < n.length; b++) { + var x = n[b]; + if (t[b] === Ps && (m = null != x.properties[v.name])) break; + } + s[y] || m || ((s[y] = !0), o.push(y)); + } + } + } + return (r[i] = o), o; + }), + (Os.getContextMeta = function (e) { + for (var t, n = this, r = "", i = e._private.styleCxtKey || "", a = 0; a < n.length; a++) { + var o = n[a]; + r += o.selector && o.selector.matches(e) ? Ps : "f"; + } + return (t = n.getPropertiesDiff(i, r)), (e._private.styleCxtKey = r), { key: r, diffPropNames: t, empty: 0 === t.length }; + }), + (Os.getContextStyle = function (e) { + var t = e.key, + n = (this._private.contextStyles = this._private.contextStyles || {}); + if (n[t]) return n[t]; + for (var r = { _private: { key: t } }, i = 0; i < this.length; i++) { + var a = this[i]; + if (t[i] === Ps) + for (var o = 0; o < a.properties.length; o++) { + var s = a.properties[o]; + r[s.name] = s; + } + } + return (n[t] = r), r; + }), + (Os.applyContextStyle = function (e, t, n) { + for (var r = e.diffPropNames, i = {}, a = this.types, o = 0; o < r.length; o++) { + var s = r[o], + l = t[s], + u = n.pstyle(s); + if (!l) { + if (!u) continue; + l = u.bypass ? { name: s, deleteBypassed: !0 } : { name: s, delete: !0 }; + } + if (u !== l) { + if (l.mapped === a.fn && null != u && null != u.mapping && u.mapping.value === l.value) { + var c = u.mapping; + if ((c.fnValue = l.value(n)) === c.prevFnValue) continue; + } + var h = (i[s] = { prev: u }); + this.applyParsedProperty(n, l), (h.next = n.pstyle(s)), h.next && h.next.bypass && (h.next = h.next.bypassed); + } + } + return { diffProps: i }; + }), + (Os.updateStyleHints = function (e) { + var t = e._private, + n = this, + r = n.propertyGroupNames, + i = n.propertyGroupKeys, + a = function (e, t, r) { + return n.getPropertiesHash(e, t, r); + }, + o = t.styleKey; + if (e.removed()) return !1; + var s, + l, + u, + c = "nodes" === t.group, + h = e._private.style; + r = Object.keys(h); + for (var d = 0; d < i.length; d++) { + var p = i[d]; + t.styleKeys[p] = [De, Ce]; + } + for ( + var g = function (e, n) { + return (t.styleKeys[n][0] = Ae(e, t.styleKeys[n][0])); + }, + f = function (e, n) { + return (t.styleKeys[n][1] = Le(e, t.styleKeys[n][1])); + }, + v = function (e, t) { + g(e, t), f(e, t); + }, + y = function (e, t) { + for (var n = 0; n < e.length; n++) { + var r = e.charCodeAt(n); + g(r, t), f(r, t); + } + }, + m = 0; + m < r.length; + m++ + ) { + var b = r[m], + x = h[b]; + if (null != x) { + var w = this.properties[b], + E = w.type, + _ = w.groupKey, + T = void 0; + null != w.hashOverride ? (T = w.hashOverride(e, x)) : null != x.pfValue && (T = x.pfValue); + var D = null == w.enums ? x.value : null, + C = null != T, + N = C || null != D, + A = x.units; + E.number && N && !E.multiple + ? (v(-128 < (s = C ? T : D) && s < 128 && Math.floor(s) !== s ? 2e9 - ((1024 * s) | 0) : s, _), C || null == A || y(A, _)) + : y(x.strValue, _); + } + } + for (var L = [De, Ce], k = 0; k < i.length; k++) { + var S = i[k], + I = t.styleKeys[S]; + (L[0] = Ae(I[0], L[0])), (L[1] = Le(I[1], L[1])); + } + t.styleKey = ((l = L[0]), (u = L[1]), 2097152 * l + u); + var M = t.styleKeys; + t.labelDimsKey = ke(M.labelDimensions); + var O = a(e, ["label"], M.labelDimensions); + if (((t.labelKey = ke(O)), (t.labelStyleKey = ke(Se(M.commonLabel, O))), !c)) { + var P = a(e, ["source-label"], M.labelDimensions); + (t.sourceLabelKey = ke(P)), (t.sourceLabelStyleKey = ke(Se(M.commonLabel, P))); + var R = a(e, ["target-label"], M.labelDimensions); + (t.targetLabelKey = ke(R)), (t.targetLabelStyleKey = ke(Se(M.commonLabel, R))); + } + if (c) { + var B = t.styleKeys, + F = B.nodeBody, + z = B.nodeBorder, + G = B.backgroundImage, + Y = B.compound, + X = B.pie, + V = [F, z, G, Y, X] + .filter(function (e) { + return null != e; + }) + .reduce(Se, [De, Ce]); + (t.nodeKey = ke(V)), (t.hasPie = null != X && X[0] !== De && X[1] !== Ce); + } + return o !== t.styleKey; + }), + (Os.clearStyleHints = function (e) { + var t = e._private; + (t.styleCxtKey = ""), + (t.styleKeys = {}), + (t.styleKey = null), + (t.labelKey = null), + (t.labelStyleKey = null), + (t.sourceLabelKey = null), + (t.sourceLabelStyleKey = null), + (t.targetLabelKey = null), + (t.targetLabelStyleKey = null), + (t.nodeKey = null), + (t.hasPie = null); + }), + (Os.applyParsedProperty = function (e, t) { + var n, + r = this, + i = t, + a = e._private.style, + o = r.types, + s = r.properties[i.name].type, + l = i.bypass, + u = a[i.name], + c = u && u.bypass, + h = e._private, + d = "mapping", + p = function (e) { + return null == e ? null : null != e.pfValue ? e.pfValue : e.value; + }, + g = function () { + var t = p(u), + n = p(i); + r.checkTriggers(e, i.name, t, n); + }; + if ( + (i && "pie" === i.name.substr(0, 3) && je("The pie style properties are deprecated. Create charts using background images instead."), + "curve-style" === t.name && + e.isEdge() && + (("bezier" !== t.value && e.isLoop()) || ("haystack" === t.value && (e.source().isParent() || e.target().isParent()))) && + (i = t = this.parse(t.name, "bezier", l)), + i.delete) + ) + return (a[i.name] = void 0), g(), !0; + if (i.deleteBypassed) return u ? !!u.bypass && ((u.bypassed = void 0), g(), !0) : (g(), !0); + if (i.deleteBypass) return u ? !!u.bypass && ((a[i.name] = u.bypassed), g(), !0) : (g(), !0); + var f = function () { + je( + "Do not assign mappings to elements without corresponding data (i.e. ele `" + + e.id() + + "` has no mapping for property `" + + i.name + + "` with data field `" + + i.field + + "`); try a `[" + + i.field + + "]` selector to limit scope to elements with `" + + i.field + + "` defined", + ); + }; + switch (i.mapped) { + case o.mapData: + for (var v, y = i.field.split("."), m = h.data, x = 0; x < y.length && m; x++) m = m[y[x]]; + if (null == m) return f(), !1; + if (!b(m)) + return ( + je( + "Do not use continuous mappers without specifying numeric data (i.e. `" + + i.field + + ": " + + m + + "` for `" + + e.id() + + "` is non-numeric)", + ), + !1 + ); + var w = i.fieldMax - i.fieldMin; + if (((v = 0 === w ? 0 : (m - i.fieldMin) / w) < 0 ? (v = 0) : v > 1 && (v = 1), s.color)) { + var E = i.valueMin[0], + _ = i.valueMax[0], + T = i.valueMin[1], + D = i.valueMax[1], + C = i.valueMin[2], + N = i.valueMax[2], + A = null == i.valueMin[3] ? 1 : i.valueMin[3], + L = null == i.valueMax[3] ? 1 : i.valueMax[3], + k = [Math.round(E + (_ - E) * v), Math.round(T + (D - T) * v), Math.round(C + (N - C) * v), Math.round(A + (L - A) * v)]; + n = { + bypass: i.bypass, + name: i.name, + value: k, + strValue: "rgb(" + k[0] + ", " + k[1] + ", " + k[2] + ")", + }; + } else { + if (!s.number) return !1; + var S = i.valueMin + (i.valueMax - i.valueMin) * v; + n = this.parse(i.name, S, i.bypass, d); + } + if (!n) return f(), !1; + (n.mapping = i), (i = n); + break; + case o.data: + for (var I = i.field.split("."), M = h.data, O = 0; O < I.length && M; O++) M = M[I[O]]; + if ((null != M && (n = this.parse(i.name, M, i.bypass, d)), !n)) return f(), !1; + (n.mapping = i), (i = n); + break; + case o.fn: + var P = i.value, + R = null != i.fnValue ? i.fnValue : P(e); + if (((i.prevFnValue = R), null == R)) + return je("Custom function mappers may not return null (i.e. `" + i.name + "` for ele `" + e.id() + "` is null)"), !1; + if (!(n = this.parse(i.name, R, i.bypass, d))) + return ( + je( + "Custom function mappers may not return invalid values for the property type (i.e. `" + + i.name + + "` for ele `" + + e.id() + + "` is invalid)", + ), + !1 + ); + (n.mapping = qe(i)), (i = n); + break; + case void 0: + break; + default: + return !1; + } + return l ? ((i.bypassed = c ? u.bypassed : u), (a[i.name] = i)) : c ? (u.bypassed = i) : (a[i.name] = i), g(), !0; + }), + (Os.cleanElements = function (e, t) { + for (var n = 0; n < e.length; n++) { + var r = e[n]; + if ((this.clearStyleHints(r), r.dirtyCompoundBoundsCache(), r.dirtyBoundingBoxCache(), t)) + for (var i = r._private.style, a = Object.keys(i), o = 0; o < a.length; o++) { + var s = a[o], + l = i[s]; + null != l && (l.bypass ? (l.bypassed = null) : (i[s] = null)); + } + else r._private.style = {}; + } + }), + (Os.update = function () { + this._private.cy.mutableElements().updateStyle(); + }), + (Os.updateTransitions = function (e, t) { + var n = this, + r = e._private, + i = e.pstyle("transition-property").value, + a = e.pstyle("transition-duration").pfValue, + o = e.pstyle("transition-delay").pfValue; + if (i.length > 0 && a > 0) { + for (var s = {}, l = !1, u = 0; u < i.length; u++) { + var c = i[u], + h = e.pstyle(c), + d = t[c]; + if (d) { + var p = d.prev, + g = null != d.next ? d.next : h, + f = !1, + v = void 0, + m = 1e-6; + p && + (b(p.pfValue) && b(g.pfValue) + ? ((f = g.pfValue - p.pfValue), (v = p.pfValue + m * f)) + : b(p.value) && b(g.value) + ? ((f = g.value - p.value), (v = p.value + m * f)) + : y(p.value) && + y(g.value) && + ((f = p.value[0] !== g.value[0] || p.value[1] !== g.value[1] || p.value[2] !== g.value[2]), (v = p.strValue)), + f && ((s[c] = g.strValue), this.applyBypass(e, c, v), (l = !0))); + } + } + if (!l) return; + (r.transitioning = !0), + new _r(function (t) { + o > 0 ? e.delayAnimation(o).play().promise().then(t) : t(); + }) + .then(function () { + return e + .animation({ + style: s, + duration: a, + easing: e.pstyle("transition-timing-function").value, + queue: !1, + }) + .play() + .promise(); + }) + .then(function () { + n.removeBypasses(e, i), e.emitAndNotify("style"), (r.transitioning = !1); + }); + } else r.transitioning && (this.removeBypasses(e, i), e.emitAndNotify("style"), (r.transitioning = !1)); + }), + (Os.checkTrigger = function (e, t, n, r, i, a) { + var o = this.properties[t], + s = i(o); + null != s && s(n, r) && a(o); + }), + (Os.checkZOrderTrigger = function (e, t, n, r) { + var i = this; + this.checkTrigger( + e, + t, + n, + r, + function (e) { + return e.triggersZOrder; + }, + function () { + i._private.cy.notify("zorder", e); + }, + ); + }), + (Os.checkBoundsTrigger = function (e, t, n, r) { + this.checkTrigger( + e, + t, + n, + r, + function (e) { + return e.triggersBounds; + }, + function (i) { + e.dirtyCompoundBoundsCache(), + e.dirtyBoundingBoxCache(), + !i.triggersBoundsOfParallelBeziers || + (("curve-style" !== t || ("bezier" !== n && "bezier" !== r)) && ("display" !== t || ("none" !== n && "none" !== r))) || + e.parallelEdges().forEach(function (e) { + e.isBundledBezier() && e.dirtyBoundingBoxCache(); + }); + }, + ); + }), + (Os.checkTriggers = function (e, t, n, r) { + e.dirtyStyleCache(), this.checkZOrderTrigger(e, t, n, r), this.checkBoundsTrigger(e, t, n, r); + }); + var Rs = { + applyBypass: function (e, t, n, r) { + var i = []; + if ("*" === t || "**" === t) { + if (void 0 !== n) + for (var a = 0; a < this.properties.length; a++) { + var o = this.properties[a].name, + s = this.parse(o, n, !0); + s && i.push(s); + } + } else if (f(t)) { + var l = this.parse(t, n, !0); + l && i.push(l); + } else { + if (!m(t)) return !1; + var u = t; + r = n; + for (var c = Object.keys(u), h = 0; h < c.length; h++) { + var d = c[h], + p = u[d]; + if ((void 0 === p && (p = u[k(d)]), void 0 !== p)) { + var g = this.parse(d, p, !0); + g && i.push(g); + } + } + } + if (0 === i.length) return !1; + for (var v = !1, y = 0; y < e.length; y++) { + for (var b = e[y], x = {}, w = void 0, E = 0; E < i.length; E++) { + var _ = i[E]; + if (r) { + var T = b.pstyle(_.name); + w = x[_.name] = { prev: T }; + } + (v = this.applyParsedProperty(b, qe(_)) || v), r && (w.next = b.pstyle(_.name)); + } + v && this.updateStyleHints(b), r && this.updateTransitions(b, x, true); + } + return v; + }, + overrideBypass: function (e, t, n) { + t = L(t); + for (var r = 0; r < e.length; r++) { + var i = e[r], + a = i._private.style[t], + o = this.properties[t].type, + s = o.color, + l = o.mutiple, + u = a ? (null != a.pfValue ? a.pfValue : a.value) : null; + a && a.bypass + ? ((a.value = n), + null != a.pfValue && (a.pfValue = n), + (a.strValue = s ? "rgb(" + n.join(",") + ")" : l ? n.join(" ") : "" + n), + this.updateStyleHints(i)) + : this.applyBypass(i, t, n), + this.checkTriggers(i, t, u, n); + } + }, + removeAllBypasses: function (e, t) { + return this.removeBypasses(e, this.propertyNames, t); + }, + removeBypasses: function (e, t, n) { + for (var r = 0; r < e.length; r++) { + for (var i = e[r], a = {}, o = 0; o < t.length; o++) { + var s = t[o], + l = this.properties[s], + u = i.pstyle(l.name); + if (u && u.bypass) { + var c = this.parse(s, "", !0), + h = (a[l.name] = { prev: u }); + this.applyParsedProperty(i, c), (h.next = i.pstyle(l.name)); + } + } + this.updateStyleHints(i), n && this.updateTransitions(i, a, true); + } + }, + }, + Bs = { + getEmSizeInPixels: function () { + var e = this.containerCss("font-size"); + return null != e ? parseFloat(e) : 1; + }, + containerCss: function (e) { + var t = this._private.cy, + n = t.container(), + r = t.window(); + if (r && n && r.getComputedStyle) return r.getComputedStyle(n).getPropertyValue(e); + }, + }, + Fs = { + getRenderedStyle: function (e, t) { + return t ? this.getStylePropertyValue(e, t, !0) : this.getRawStyle(e, !0); + }, + getRawStyle: function (e, t) { + var n = this; + if ((e = e[0])) { + for (var r = {}, i = 0; i < n.properties.length; i++) { + var a = n.properties[i], + o = n.getStylePropertyValue(e, a.name, t); + null != o && ((r[a.name] = o), (r[k(a.name)] = o)); + } + return r; + } + }, + getIndexedStyle: function (e, t, n, r) { + var i = e.pstyle(t)[n][r]; + return null != i ? i : e.cy().style().getDefaultProperty(t)[n][0]; + }, + getStylePropertyValue: function (e, t, n) { + if ((e = e[0])) { + var r = this.properties[t]; + r.alias && (r = r.pointsTo); + var i = r.type, + a = e.pstyle(r.name); + if (a) { + var o = a.value, + s = a.units, + l = a.strValue; + if (n && i.number && null != o && b(o)) { + var u = e.cy().zoom(), + c = function (e) { + return e * u; + }, + h = function (e, t) { + return c(e) + t; + }, + d = y(o); + return ( + d + ? s.every(function (e) { + return null != e; + }) + : null != s + ) + ? d + ? o + .map(function (e, t) { + return h(e, s[t]); + }) + .join(" ") + : h(o, s) + : d + ? o + .map(function (e) { + return f(e) ? e : "" + c(e); + }) + .join(" ") + : "" + c(o); + } + if (null != l) return l; + } + return null; + } + }, + getAnimationStartStyle: function (e, t) { + for (var n = {}, r = 0; r < t.length; r++) { + var i = t[r].name, + a = e.pstyle(i); + void 0 !== a && (a = m(a) ? this.parse(i, a.strValue) : this.parse(i, a)), a && (n[i] = a); + } + return n; + }, + getPropsList: function (e) { + var t = [], + n = e, + r = this.properties; + if (n) + for (var i = Object.keys(n), a = 0; a < i.length; a++) { + var o = i[a], + s = n[o], + l = r[o] || r[L(o)], + u = this.parse(l.name, s); + u && t.push(u); + } + return t; + }, + getNonDefaultPropertiesHash: function (e, t, n) { + var r, + i, + a, + o, + s, + l, + u = n.slice(); + for (s = 0; s < t.length; s++) + if (((r = t[s]), null != (i = e.pstyle(r, !1)))) + if (null != i.pfValue) (u[0] = Ae(o, u[0])), (u[1] = Le(o, u[1])); + else for (a = i.strValue, l = 0; l < a.length; l++) (o = a.charCodeAt(l)), (u[0] = Ae(o, u[0])), (u[1] = Le(o, u[1])); + return u; + }, + }; + Fs.getPropertiesHash = Fs.getNonDefaultPropertiesHash; + var zs = { + appendFromJson: function (e) { + for (var t = this, n = 0; n < e.length; n++) { + var r = e[n], + i = r.selector, + a = r.style || r.css, + o = Object.keys(a); + t.selector(i); + for (var s = 0; s < o.length; s++) { + var l = o[s], + u = a[l]; + t.css(l, u); + } + } + return t; + }, + fromJson: function (e) { + var t = this; + return t.resetToDefault(), t.appendFromJson(e), t; + }, + json: function () { + for (var e = [], t = this.defaultLength; t < this.length; t++) { + for (var n = this[t], r = n.selector, i = n.properties, a = {}, o = 0; o < i.length; o++) { + var s = i[o]; + a[s.name] = s.strValue; + } + e.push({ selector: r ? r.toString() : "core", style: a }); + } + return e; + }, + }, + Gs = { + appendFromString: function (e) { + var t, + n, + r, + i = this, + a = "" + e; + function o() { + a = a.length > t.length ? a.substr(t.length) : ""; + } + function s() { + n = n.length > r.length ? n.substr(r.length) : ""; + } + for (a = a.replace(/[/][*](\s|.)+?[*][/]/g, ""); !a.match(/^\s*$/); ) { + var l = a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/); + if (!l) { + je("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: " + a); + break; + } + t = l[0]; + var u = l[1]; + if ("core" !== u && new Ia(u).invalid) je("Skipping parsing of block: Invalid selector found in string stylesheet: " + u), o(); + else { + var c = l[2], + h = !1; + n = c; + for (var d = []; !n.match(/^\s*$/); ) { + var p = n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/); + if (!p) { + je("Skipping parsing of block: Invalid formatting of style property and value definitions found in:" + c), (h = !0); + break; + } + r = p[0]; + var g = p[1], + f = p[2]; + this.properties[g] + ? i.parse(g, f) + ? (d.push({ name: g, val: f }), s()) + : (je("Skipping property: Invalid property definition in: " + r), s()) + : (je("Skipping property: Invalid property name in: " + r), s()); + } + if (h) { + o(); + break; + } + i.selector(u); + for (var v = 0; v < d.length; v++) { + var y = d[v]; + i.css(y.name, y.val); + } + o(); + } + } + return i; + }, + fromString: function (e) { + var t = this; + return t.resetToDefault(), t.appendFromString(e), t; + }, + }, + Ys = {}; + (function () { + var e = M, + t = P, + n = B, + r = function (e) { + return "^" + e + "\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"; + }, + i = function (r) { + var i = e + "|\\w+|" + t + "|" + n + "|\\#[0-9a-fA-F]{3}|\\#[0-9a-fA-F]{6}"; + return "^" + r + "\\s*\\(([\\w\\.]+)\\s*\\,\\s*(" + e + ")\\s*\\,\\s*(" + e + ")\\s*,\\s*(" + i + ")\\s*\\,\\s*(" + i + ")\\)$"; + }, + a = ["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$", "^(none)$", "^(.+)$"]; + Ys.types = { + time: { number: !0, min: 0, units: "s|ms", implicitUnits: "ms" }, + percent: { number: !0, min: 0, max: 100, units: "%", implicitUnits: "%" }, + percentages: { + number: !0, + min: 0, + max: 100, + units: "%", + implicitUnits: "%", + multiple: !0, + }, + zeroOneNumber: { number: !0, min: 0, max: 1, unitless: !0 }, + zeroOneNumbers: { number: !0, min: 0, max: 1, unitless: !0, multiple: !0 }, + nOneOneNumber: { number: !0, min: -1, max: 1, unitless: !0 }, + nonNegativeInt: { number: !0, min: 0, integer: !0, unitless: !0 }, + position: { enums: ["parent", "origin"] }, + nodeSize: { number: !0, min: 0, enums: ["label"] }, + number: { number: !0, unitless: !0 }, + numbers: { number: !0, unitless: !0, multiple: !0 }, + positiveNumber: { number: !0, unitless: !0, min: 0, strictMin: !0 }, + size: { number: !0, min: 0 }, + bidirectionalSize: { number: !0 }, + bidirectionalSizeMaybePercent: { number: !0, allowPercent: !0 }, + bidirectionalSizes: { number: !0, multiple: !0 }, + sizeMaybePercent: { number: !0, min: 0, allowPercent: !0 }, + axisDirection: { + enums: ["horizontal", "leftward", "rightward", "vertical", "upward", "downward", "auto"], + }, + paddingRelativeTo: { enums: ["width", "height", "average", "min", "max"] }, + bgWH: { number: !0, min: 0, allowPercent: !0, enums: ["auto"], multiple: !0 }, + bgPos: { number: !0, allowPercent: !0, multiple: !0 }, + bgRelativeTo: { enums: ["inner", "include-padding"], multiple: !0 }, + bgRepeat: { enums: ["repeat", "repeat-x", "repeat-y", "no-repeat"], multiple: !0 }, + bgFit: { enums: ["none", "contain", "cover"], multiple: !0 }, + bgCrossOrigin: { enums: ["anonymous", "use-credentials", "null"], multiple: !0 }, + bgClip: { enums: ["none", "node"], multiple: !0 }, + bgContainment: { enums: ["inside", "over"], multiple: !0 }, + color: { color: !0 }, + colors: { color: !0, multiple: !0 }, + fill: { enums: ["solid", "linear-gradient", "radial-gradient"] }, + bool: { enums: ["yes", "no"] }, + bools: { enums: ["yes", "no"], multiple: !0 }, + lineStyle: { enums: ["solid", "dotted", "dashed"] }, + lineCap: { enums: ["butt", "round", "square"] }, + borderStyle: { enums: ["solid", "dotted", "dashed", "double"] }, + curveStyle: { + enums: ["bezier", "unbundled-bezier", "haystack", "segments", "straight", "straight-triangle", "taxi"], + }, + fontFamily: { regex: '^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$' }, + fontStyle: { enums: ["italic", "normal", "oblique"] }, + fontWeight: { + enums: [ + "normal", + "bold", + "bolder", + "lighter", + "100", + "200", + "300", + "400", + "500", + "600", + "800", + "900", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + }, + textDecoration: { enums: ["none", "underline", "overline", "line-through"] }, + textTransform: { enums: ["none", "uppercase", "lowercase"] }, + textWrap: { enums: ["none", "wrap", "ellipsis"] }, + textOverflowWrap: { enums: ["whitespace", "anywhere"] }, + textBackgroundShape: { enums: ["rectangle", "roundrectangle", "round-rectangle"] }, + nodeShape: { + enums: [ + "rectangle", + "roundrectangle", + "round-rectangle", + "cutrectangle", + "cut-rectangle", + "bottomroundrectangle", + "bottom-round-rectangle", + "barrel", + "ellipse", + "triangle", + "round-triangle", + "square", + "pentagon", + "round-pentagon", + "hexagon", + "round-hexagon", + "concavehexagon", + "concave-hexagon", + "heptagon", + "round-heptagon", + "octagon", + "round-octagon", + "tag", + "round-tag", + "star", + "diamond", + "round-diamond", + "vee", + "rhomboid", + "right-rhomboid", + "polygon", + ], + }, + overlayShape: { enums: ["roundrectangle", "round-rectangle", "ellipse"] }, + compoundIncludeLabels: { enums: ["include", "exclude"] }, + arrowShape: { + enums: [ + "tee", + "triangle", + "triangle-tee", + "circle-triangle", + "triangle-cross", + "triangle-backcurve", + "vee", + "square", + "circle", + "diamond", + "chevron", + "none", + ], + }, + arrowFill: { enums: ["filled", "hollow"] }, + display: { enums: ["element", "none"] }, + visibility: { enums: ["hidden", "visible"] }, + zCompoundDepth: { enums: ["bottom", "orphan", "auto", "top"] }, + zIndexCompare: { enums: ["auto", "manual"] }, + valign: { enums: ["top", "center", "bottom"] }, + halign: { enums: ["left", "center", "right"] }, + justification: { enums: ["left", "center", "right", "auto"] }, + text: { string: !0 }, + data: { mapping: !0, regex: r("data") }, + layoutData: { mapping: !0, regex: r("layoutData") }, + scratch: { mapping: !0, regex: r("scratch") }, + mapData: { mapping: !0, regex: i("mapData") }, + mapLayoutData: { mapping: !0, regex: i("mapLayoutData") }, + mapScratch: { mapping: !0, regex: i("mapScratch") }, + fn: { mapping: !0, fn: !0 }, + url: { regexes: a, singleRegexMatchValue: !0 }, + urls: { regexes: a, singleRegexMatchValue: !0, multiple: !0 }, + propList: { propList: !0 }, + angle: { number: !0, units: "deg|rad", implicitUnits: "rad" }, + textRotation: { + number: !0, + units: "deg|rad", + implicitUnits: "rad", + enums: ["none", "autorotate"], + }, + polygonPointList: { + number: !0, + multiple: !0, + evenMultiple: !0, + min: -1, + max: 1, + unitless: !0, + }, + edgeDistances: { enums: ["intersection", "node-position"] }, + edgeEndpoint: { + number: !0, + multiple: !0, + units: "%|px|em|deg|rad", + implicitUnits: "px", + enums: ["inside-to-node", "outside-to-node", "outside-to-node-or-label", "outside-to-line", "outside-to-line-or-label"], + singleEnum: !0, + validate: function (e, t) { + switch (e.length) { + case 2: + return "deg" !== t[0] && "rad" !== t[0] && "deg" !== t[1] && "rad" !== t[1]; + case 1: + return f(e[0]) || "deg" === t[0] || "rad" === t[0]; + default: + return !1; + } + }, + }, + easing: { + regexes: [ + "^(spring)\\s*\\(\\s*(" + e + ")\\s*,\\s*(" + e + ")\\s*\\)$", + "^(cubic-bezier)\\s*\\(\\s*(" + e + ")\\s*,\\s*(" + e + ")\\s*,\\s*(" + e + ")\\s*,\\s*(" + e + ")\\s*\\)$", + ], + enums: [ + "linear", + "ease", + "ease-in", + "ease-out", + "ease-in-out", + "ease-in-sine", + "ease-out-sine", + "ease-in-out-sine", + "ease-in-quad", + "ease-out-quad", + "ease-in-out-quad", + "ease-in-cubic", + "ease-out-cubic", + "ease-in-out-cubic", + "ease-in-quart", + "ease-out-quart", + "ease-in-out-quart", + "ease-in-quint", + "ease-out-quint", + "ease-in-out-quint", + "ease-in-expo", + "ease-out-expo", + "ease-in-out-expo", + "ease-in-circ", + "ease-out-circ", + "ease-in-out-circ", + ], + }, + gradientDirection: { + enums: [ + "to-bottom", + "to-top", + "to-left", + "to-right", + "to-bottom-right", + "to-bottom-left", + "to-top-right", + "to-top-left", + "to-right-bottom", + "to-left-bottom", + "to-right-top", + "to-left-top", + ], + }, + boundsExpansion: { + number: !0, + multiple: !0, + min: 0, + validate: function (e) { + var t = e.length; + return 1 === t || 2 === t || 4 === t; + }, + }, + }; + var o = { + zeroNonZero: function (e, t) { + return ((null == e || null == t) && e !== t) || (0 == e && 0 != t) || (0 != e && 0 == t); + }, + any: function (e, t) { + return e != t; + }, + emptyNonEmpty: function (e, t) { + var n = C(e), + r = C(t); + return (n && !r) || (!n && r); + }, + }, + s = Ys.types, + l = [ + { + name: "label", + type: s.text, + triggersBounds: o.any, + triggersZOrder: o.emptyNonEmpty, + }, + { name: "text-rotation", type: s.textRotation, triggersBounds: o.any }, + { name: "text-margin-x", type: s.bidirectionalSize, triggersBounds: o.any }, + { name: "text-margin-y", type: s.bidirectionalSize, triggersBounds: o.any }, + ], + u = [ + { name: "source-label", type: s.text, triggersBounds: o.any }, + { name: "source-text-rotation", type: s.textRotation, triggersBounds: o.any }, + { name: "source-text-margin-x", type: s.bidirectionalSize, triggersBounds: o.any }, + { name: "source-text-margin-y", type: s.bidirectionalSize, triggersBounds: o.any }, + { name: "source-text-offset", type: s.size, triggersBounds: o.any }, + ], + c = [ + { name: "target-label", type: s.text, triggersBounds: o.any }, + { name: "target-text-rotation", type: s.textRotation, triggersBounds: o.any }, + { name: "target-text-margin-x", type: s.bidirectionalSize, triggersBounds: o.any }, + { name: "target-text-margin-y", type: s.bidirectionalSize, triggersBounds: o.any }, + { name: "target-text-offset", type: s.size, triggersBounds: o.any }, + ], + h = [ + { name: "font-family", type: s.fontFamily, triggersBounds: o.any }, + { name: "font-style", type: s.fontStyle, triggersBounds: o.any }, + { name: "font-weight", type: s.fontWeight, triggersBounds: o.any }, + { name: "font-size", type: s.size, triggersBounds: o.any }, + { name: "text-transform", type: s.textTransform, triggersBounds: o.any }, + { name: "text-wrap", type: s.textWrap, triggersBounds: o.any }, + { name: "text-overflow-wrap", type: s.textOverflowWrap, triggersBounds: o.any }, + { name: "text-max-width", type: s.size, triggersBounds: o.any }, + { name: "text-outline-width", type: s.size, triggersBounds: o.any }, + { name: "line-height", type: s.positiveNumber, triggersBounds: o.any }, + ], + d = [ + { name: "text-valign", type: s.valign, triggersBounds: o.any }, + { name: "text-halign", type: s.halign, triggersBounds: o.any }, + { name: "color", type: s.color }, + { name: "text-outline-color", type: s.color }, + { name: "text-outline-opacity", type: s.zeroOneNumber }, + { name: "text-background-color", type: s.color }, + { name: "text-background-opacity", type: s.zeroOneNumber }, + { name: "text-background-padding", type: s.size, triggersBounds: o.any }, + { name: "text-border-opacity", type: s.zeroOneNumber }, + { name: "text-border-color", type: s.color }, + { name: "text-border-width", type: s.size, triggersBounds: o.any }, + { name: "text-border-style", type: s.borderStyle, triggersBounds: o.any }, + { name: "text-background-shape", type: s.textBackgroundShape, triggersBounds: o.any }, + { name: "text-justification", type: s.justification }, + ], + p = [ + { name: "events", type: s.bool }, + { name: "text-events", type: s.bool }, + ], + g = [ + { + name: "display", + type: s.display, + triggersZOrder: o.any, + triggersBounds: o.any, + triggersBoundsOfParallelBeziers: !0, + }, + { name: "visibility", type: s.visibility, triggersZOrder: o.any }, + { name: "opacity", type: s.zeroOneNumber, triggersZOrder: o.zeroNonZero }, + { name: "text-opacity", type: s.zeroOneNumber }, + { name: "min-zoomed-font-size", type: s.size }, + { name: "z-compound-depth", type: s.zCompoundDepth, triggersZOrder: o.any }, + { name: "z-index-compare", type: s.zIndexCompare, triggersZOrder: o.any }, + { name: "z-index", type: s.nonNegativeInt, triggersZOrder: o.any }, + ], + v = [ + { name: "overlay-padding", type: s.size, triggersBounds: o.any }, + { name: "overlay-color", type: s.color }, + { name: "overlay-opacity", type: s.zeroOneNumber, triggersBounds: o.zeroNonZero }, + { name: "overlay-shape", type: s.overlayShape, triggersBounds: o.any }, + ], + y = [ + { name: "underlay-padding", type: s.size, triggersBounds: o.any }, + { name: "underlay-color", type: s.color }, + { name: "underlay-opacity", type: s.zeroOneNumber, triggersBounds: o.zeroNonZero }, + { name: "underlay-shape", type: s.overlayShape, triggersBounds: o.any }, + ], + m = [ + { name: "transition-property", type: s.propList }, + { name: "transition-duration", type: s.time }, + { name: "transition-delay", type: s.time }, + { name: "transition-timing-function", type: s.easing }, + ], + b = function (e, t) { + return "label" === t.value ? -e.poolIndex() : t.pfValue; + }, + x = [ + { name: "height", type: s.nodeSize, triggersBounds: o.any, hashOverride: b }, + { name: "width", type: s.nodeSize, triggersBounds: o.any, hashOverride: b }, + { name: "shape", type: s.nodeShape, triggersBounds: o.any }, + { name: "shape-polygon-points", type: s.polygonPointList, triggersBounds: o.any }, + { name: "background-color", type: s.color }, + { name: "background-fill", type: s.fill }, + { name: "background-opacity", type: s.zeroOneNumber }, + { name: "background-blacken", type: s.nOneOneNumber }, + { name: "background-gradient-stop-colors", type: s.colors }, + { name: "background-gradient-stop-positions", type: s.percentages }, + { name: "background-gradient-direction", type: s.gradientDirection }, + { name: "padding", type: s.sizeMaybePercent, triggersBounds: o.any }, + { name: "padding-relative-to", type: s.paddingRelativeTo, triggersBounds: o.any }, + { name: "bounds-expansion", type: s.boundsExpansion, triggersBounds: o.any }, + ], + w = [ + { name: "border-color", type: s.color }, + { name: "border-opacity", type: s.zeroOneNumber }, + { name: "border-width", type: s.size, triggersBounds: o.any }, + { name: "border-style", type: s.borderStyle }, + ], + E = [ + { name: "background-image", type: s.urls }, + { name: "background-image-crossorigin", type: s.bgCrossOrigin }, + { name: "background-image-opacity", type: s.zeroOneNumbers }, + { name: "background-image-containment", type: s.bgContainment }, + { name: "background-image-smoothing", type: s.bools }, + { name: "background-position-x", type: s.bgPos }, + { name: "background-position-y", type: s.bgPos }, + { name: "background-width-relative-to", type: s.bgRelativeTo }, + { name: "background-height-relative-to", type: s.bgRelativeTo }, + { name: "background-repeat", type: s.bgRepeat }, + { name: "background-fit", type: s.bgFit }, + { name: "background-clip", type: s.bgClip }, + { name: "background-width", type: s.bgWH }, + { name: "background-height", type: s.bgWH }, + { name: "background-offset-x", type: s.bgPos }, + { name: "background-offset-y", type: s.bgPos }, + ], + _ = [ + { name: "position", type: s.position, triggersBounds: o.any }, + { + name: "compound-sizing-wrt-labels", + type: s.compoundIncludeLabels, + triggersBounds: o.any, + }, + { name: "min-width", type: s.size, triggersBounds: o.any }, + { name: "min-width-bias-left", type: s.sizeMaybePercent, triggersBounds: o.any }, + { name: "min-width-bias-right", type: s.sizeMaybePercent, triggersBounds: o.any }, + { name: "min-height", type: s.size, triggersBounds: o.any }, + { name: "min-height-bias-top", type: s.sizeMaybePercent, triggersBounds: o.any }, + { name: "min-height-bias-bottom", type: s.sizeMaybePercent, triggersBounds: o.any }, + ], + T = [ + { name: "line-style", type: s.lineStyle }, + { name: "line-color", type: s.color }, + { name: "line-fill", type: s.fill }, + { name: "line-cap", type: s.lineCap }, + { name: "line-opacity", type: s.zeroOneNumber }, + { name: "line-dash-pattern", type: s.numbers }, + { name: "line-dash-offset", type: s.number }, + { name: "line-gradient-stop-colors", type: s.colors }, + { name: "line-gradient-stop-positions", type: s.percentages }, + { + name: "curve-style", + type: s.curveStyle, + triggersBounds: o.any, + triggersBoundsOfParallelBeziers: !0, + }, + { name: "haystack-radius", type: s.zeroOneNumber, triggersBounds: o.any }, + { name: "source-endpoint", type: s.edgeEndpoint, triggersBounds: o.any }, + { name: "target-endpoint", type: s.edgeEndpoint, triggersBounds: o.any }, + { name: "control-point-step-size", type: s.size, triggersBounds: o.any }, + { + name: "control-point-distances", + type: s.bidirectionalSizes, + triggersBounds: o.any, + }, + { name: "control-point-weights", type: s.numbers, triggersBounds: o.any }, + { name: "segment-distances", type: s.bidirectionalSizes, triggersBounds: o.any }, + { name: "segment-weights", type: s.numbers, triggersBounds: o.any }, + { name: "taxi-turn", type: s.bidirectionalSizeMaybePercent, triggersBounds: o.any }, + { name: "taxi-turn-min-distance", type: s.size, triggersBounds: o.any }, + { name: "taxi-direction", type: s.axisDirection, triggersBounds: o.any }, + { name: "edge-distances", type: s.edgeDistances, triggersBounds: o.any }, + { name: "arrow-scale", type: s.positiveNumber, triggersBounds: o.any }, + { name: "loop-direction", type: s.angle, triggersBounds: o.any }, + { name: "loop-sweep", type: s.angle, triggersBounds: o.any }, + { name: "source-distance-from-node", type: s.size, triggersBounds: o.any }, + { name: "target-distance-from-node", type: s.size, triggersBounds: o.any }, + ], + D = [ + { name: "ghost", type: s.bool, triggersBounds: o.any }, + { name: "ghost-offset-x", type: s.bidirectionalSize, triggersBounds: o.any }, + { name: "ghost-offset-y", type: s.bidirectionalSize, triggersBounds: o.any }, + { name: "ghost-opacity", type: s.zeroOneNumber }, + ], + N = [ + { name: "selection-box-color", type: s.color }, + { name: "selection-box-opacity", type: s.zeroOneNumber }, + { name: "selection-box-border-color", type: s.color }, + { name: "selection-box-border-width", type: s.size }, + { name: "active-bg-color", type: s.color }, + { name: "active-bg-opacity", type: s.zeroOneNumber }, + { name: "active-bg-size", type: s.size }, + { name: "outside-texture-bg-color", type: s.color }, + { name: "outside-texture-bg-opacity", type: s.zeroOneNumber }, + ], + A = []; + (Ys.pieBackgroundN = 16), A.push({ name: "pie-size", type: s.sizeMaybePercent }); + for (var L = 1; L <= Ys.pieBackgroundN; L++) + A.push({ name: "pie-" + L + "-background-color", type: s.color }), + A.push({ name: "pie-" + L + "-background-size", type: s.percent }), + A.push({ name: "pie-" + L + "-background-opacity", type: s.zeroOneNumber }); + var k = [], + S = (Ys.arrowPrefixes = ["source", "mid-source", "target", "mid-target"]); + [ + { name: "arrow-shape", type: s.arrowShape, triggersBounds: o.any }, + { name: "arrow-color", type: s.color }, + { name: "arrow-fill", type: s.arrowFill }, + ].forEach(function (e) { + S.forEach(function (t) { + var n = t + "-" + e.name, + r = e.type, + i = e.triggersBounds; + k.push({ name: n, type: r, triggersBounds: i }); + }); + }, {}); + var I = (Ys.properties = [].concat(p, m, g, v, y, D, d, h, l, u, c, x, w, E, A, _, T, k, N)), + O = (Ys.propertyGroups = { + behavior: p, + transition: m, + visibility: g, + overlay: v, + underlay: y, + ghost: D, + commonLabel: d, + labelDimensions: h, + mainLabel: l, + sourceLabel: u, + targetLabel: c, + nodeBody: x, + nodeBorder: w, + backgroundImage: E, + pie: A, + compound: _, + edgeLine: T, + edgeArrow: k, + core: N, + }), + R = (Ys.propertyGroupNames = {}); + (Ys.propertyGroupKeys = Object.keys(O)).forEach(function (e) { + (R[e] = O[e].map(function (e) { + return e.name; + })), + O[e].forEach(function (t) { + return (t.groupKey = e); + }); + }); + var F = (Ys.aliases = [ + { name: "content", pointsTo: "label" }, + { name: "control-point-distance", pointsTo: "control-point-distances" }, + { name: "control-point-weight", pointsTo: "control-point-weights" }, + { name: "edge-text-rotation", pointsTo: "text-rotation" }, + { name: "padding-left", pointsTo: "padding" }, + { name: "padding-right", pointsTo: "padding" }, + { name: "padding-top", pointsTo: "padding" }, + { name: "padding-bottom", pointsTo: "padding" }, + ]); + Ys.propertyNames = I.map(function (e) { + return e.name; + }); + for (var z = 0; z < I.length; z++) { + var G = I[z]; + I[G.name] = G; + } + for (var Y = 0; Y < F.length; Y++) { + var X = F[Y], + V = I[X.pointsTo], + U = { name: X.name, alias: !0, pointsTo: V }; + I.push(U), (I[X.name] = U); + } + })(), + (Ys.getDefaultProperty = function (e) { + return this.getDefaultProperties()[e]; + }), + (Ys.getDefaultProperties = function () { + var e = this._private; + if (null != e.defaultProperties) return e.defaultProperties; + for ( + var t = z( + { + "selection-box-color": "#ddd", + "selection-box-opacity": 0.65, + "selection-box-border-color": "#aaa", + "selection-box-border-width": 1, + "active-bg-color": "black", + "active-bg-opacity": 0.15, + "active-bg-size": 30, + "outside-texture-bg-color": "#000", + "outside-texture-bg-opacity": 0.125, + events: "yes", + "text-events": "no", + "text-valign": "top", + "text-halign": "center", + "text-justification": "auto", + "line-height": 1, + color: "#000", + "text-outline-color": "#000", + "text-outline-width": 0, + "text-outline-opacity": 1, + "text-opacity": 1, + "text-decoration": "none", + "text-transform": "none", + "text-wrap": "none", + "text-overflow-wrap": "whitespace", + "text-max-width": 9999, + "text-background-color": "#000", + "text-background-opacity": 0, + "text-background-shape": "rectangle", + "text-background-padding": 0, + "text-border-opacity": 0, + "text-border-width": 0, + "text-border-style": "solid", + "text-border-color": "#000", + "font-family": "Helvetica Neue, Helvetica, sans-serif", + "font-style": "normal", + "font-weight": "normal", + "font-size": 16, + "min-zoomed-font-size": 0, + "text-rotation": "none", + "source-text-rotation": "none", + "target-text-rotation": "none", + visibility: "visible", + display: "element", + opacity: 1, + "z-compound-depth": "auto", + "z-index-compare": "auto", + "z-index": 0, + label: "", + "text-margin-x": 0, + "text-margin-y": 0, + "source-label": "", + "source-text-offset": 0, + "source-text-margin-x": 0, + "source-text-margin-y": 0, + "target-label": "", + "target-text-offset": 0, + "target-text-margin-x": 0, + "target-text-margin-y": 0, + "overlay-opacity": 0, + "overlay-color": "#000", + "overlay-padding": 10, + "overlay-shape": "round-rectangle", + "underlay-opacity": 0, + "underlay-color": "#000", + "underlay-padding": 10, + "underlay-shape": "round-rectangle", + "transition-property": "none", + "transition-duration": 0, + "transition-delay": 0, + "transition-timing-function": "linear", + "background-blacken": 0, + "background-color": "#999", + "background-fill": "solid", + "background-opacity": 1, + "background-image": "none", + "background-image-crossorigin": "anonymous", + "background-image-opacity": 1, + "background-image-containment": "inside", + "background-image-smoothing": "yes", + "background-position-x": "50%", + "background-position-y": "50%", + "background-offset-x": 0, + "background-offset-y": 0, + "background-width-relative-to": "include-padding", + "background-height-relative-to": "include-padding", + "background-repeat": "no-repeat", + "background-fit": "none", + "background-clip": "node", + "background-width": "auto", + "background-height": "auto", + "border-color": "#000", + "border-opacity": 1, + "border-width": 0, + "border-style": "solid", + height: 30, + width: 30, + shape: "ellipse", + "shape-polygon-points": "-1, -1, 1, -1, 1, 1, -1, 1", + "bounds-expansion": 0, + "background-gradient-direction": "to-bottom", + "background-gradient-stop-colors": "#999", + "background-gradient-stop-positions": "0%", + ghost: "no", + "ghost-offset-y": 0, + "ghost-offset-x": 0, + "ghost-opacity": 0, + padding: 0, + "padding-relative-to": "width", + position: "origin", + "compound-sizing-wrt-labels": "include", + "min-width": 0, + "min-width-bias-left": 0, + "min-width-bias-right": 0, + "min-height": 0, + "min-height-bias-top": 0, + "min-height-bias-bottom": 0, + }, + { "pie-size": "100%" }, + [ + { name: "pie-{{i}}-background-color", value: "black" }, + { name: "pie-{{i}}-background-size", value: "0%" }, + { name: "pie-{{i}}-background-opacity", value: 1 }, + ].reduce(function (e, t) { + for (var n = 1; n <= Ys.pieBackgroundN; n++) { + var r = t.name.replace("{{i}}", n), + i = t.value; + e[r] = i; + } + return e; + }, {}), + { + "line-style": "solid", + "line-color": "#999", + "line-fill": "solid", + "line-cap": "butt", + "line-opacity": 1, + "line-gradient-stop-colors": "#999", + "line-gradient-stop-positions": "0%", + "control-point-step-size": 40, + "control-point-weights": 0.5, + "segment-weights": 0.5, + "segment-distances": 20, + "taxi-turn": "50%", + "taxi-turn-min-distance": 10, + "taxi-direction": "auto", + "edge-distances": "intersection", + "curve-style": "haystack", + "haystack-radius": 0, + "arrow-scale": 1, + "loop-direction": "-45deg", + "loop-sweep": "-90deg", + "source-distance-from-node": 0, + "target-distance-from-node": 0, + "source-endpoint": "outside-to-node", + "target-endpoint": "outside-to-node", + "line-dash-pattern": [6, 3], + "line-dash-offset": 0, + }, + [ + { name: "arrow-shape", value: "none" }, + { name: "arrow-color", value: "#999" }, + { name: "arrow-fill", value: "filled" }, + ].reduce(function (e, t) { + return ( + Ys.arrowPrefixes.forEach(function (n) { + var r = n + "-" + t.name, + i = t.value; + e[r] = i; + }), + e + ); + }, {}), + ), + n = {}, + r = 0; + r < this.properties.length; + r++ + ) { + var i = this.properties[r]; + if (!i.pointsTo) { + var a = i.name, + o = t[a], + s = this.parse(a, o); + n[a] = s; + } + } + return (e.defaultProperties = n), e.defaultProperties; + }), + (Ys.addDefaultStylesheet = function () { + this.selector(":parent") + .css({ + shape: "rectangle", + padding: 10, + "background-color": "#eee", + "border-color": "#ccc", + "border-width": 1, + }) + .selector("edge") + .css({ width: 3 }) + .selector(":loop") + .css({ "curve-style": "bezier" }) + .selector("edge:compound") + .css({ + "curve-style": "bezier", + "source-endpoint": "outside-to-line", + "target-endpoint": "outside-to-line", + }) + .selector(":selected") + .css({ + "background-color": "#0169D9", + "line-color": "#0169D9", + "source-arrow-color": "#0169D9", + "target-arrow-color": "#0169D9", + "mid-source-arrow-color": "#0169D9", + "mid-target-arrow-color": "#0169D9", + }) + .selector(":parent:selected") + .css({ "background-color": "#CCE1F9", "border-color": "#aec8e5" }) + .selector(":active") + .css({ "overlay-color": "black", "overlay-padding": 10, "overlay-opacity": 0.25 }), + (this.defaultLength = this.length); + }); + var Xs = { + parse: function (e, t, n, r) { + var i = this; + if (v(t)) return i.parseImplWarn(e, t, n, r); + var a, + o = Me(e, "" + t, n ? "t" : "f", "mapping" === r || !0 === r || !1 === r || null == r ? "dontcare" : r), + s = (i.propCache = i.propCache || []); + return (a = s[o]) || (a = s[o] = i.parseImplWarn(e, t, n, r)), (n || "mapping" === r) && (a = qe(a)) && (a.value = qe(a.value)), a; + }, + parseImplWarn: function (e, t, n, r) { + var i = this.parseImpl(e, t, n, r); + return ( + i || null == t || je("The style property `".concat(e, ": ").concat(t, "` is invalid")), + !i || + ("width" !== i.name && "height" !== i.name) || + "label" !== t || + je("The style value of `label` is deprecated for `" + i.name + "`"), + i + ); + }, + parseImpl: function (e, t, n, r) { + var i = this; + e = L(e); + var a = i.properties[e], + o = t, + s = i.types; + if (!a) return null; + if (void 0 === t) return null; + a.alias && ((a = a.pointsTo), (e = a.name)); + var l = f(t); + l && (t = t.trim()); + var u, + c, + h = a.type; + if (!h) return null; + if (n && ("" === t || null === t)) return { name: e, value: t, bypass: !0, deleteBypass: !0 }; + if (v(t)) return { name: e, value: t, strValue: "fn", mapped: s.fn, bypass: n }; + if (!l || r || t.length < 7 || "a" !== t[1]); + else { + if (t.length >= 7 && "d" === t[0] && (u = new RegExp(s.data.regex).exec(t))) { + if (n) return !1; + var d = s.data; + return { name: e, value: u, strValue: "" + t, mapped: d, field: u[1], bypass: n }; + } + if (t.length >= 10 && "m" === t[0] && (c = new RegExp(s.mapData.regex).exec(t))) { + if (n) return !1; + if (h.multiple) return !1; + var p = s.mapData; + if (!h.color && !h.number) return !1; + var g = this.parse(e, c[4]); + if (!g || g.mapped) return !1; + var m = this.parse(e, c[5]); + if (!m || m.mapped) return !1; + if (g.pfValue === m.pfValue || g.strValue === m.strValue) + return ( + je( + "`" + + e + + ": " + + t + + "` is not a valid mapper because the output range is zero; converting to `" + + e + + ": " + + g.strValue + + "`", + ), + this.parse(e, g.strValue) + ); + if (h.color) { + var x = g.value, + w = m.value; + if ( + !( + x[0] !== w[0] || + x[1] !== w[1] || + x[2] !== w[2] || + (x[3] !== w[3] && ((null != x[3] && 1 !== x[3]) || (null != w[3] && 1 !== w[3]))) + ) + ) + return !1; + } + return { + name: e, + value: c, + strValue: "" + t, + mapped: p, + field: c[1], + fieldMin: parseFloat(c[2]), + fieldMax: parseFloat(c[3]), + valueMin: g.value, + valueMax: m.value, + bypass: n, + }; + } + } + if (h.multiple && "multiple" !== r) { + var E; + if (((E = l ? t.split(/\s+/) : y(t) ? t : [t]), h.evenMultiple && E.length % 2 != 0)) return null; + for (var _ = [], T = [], D = [], C = "", N = !1, A = 0; A < E.length; A++) { + var k = i.parse(e, E[A], n, "multiple"); + (N = N || f(k.value)), + _.push(k.value), + D.push(null != k.pfValue ? k.pfValue : k.value), + T.push(k.units), + (C += (A > 0 ? " " : "") + k.strValue); + } + return h.validate && !h.validate(_, T) + ? null + : h.singleEnum && N + ? 1 === _.length && f(_[0]) + ? { name: e, value: _[0], strValue: _[0], bypass: n } + : null + : { name: e, value: _, pfValue: D, strValue: C, bypass: n, units: T }; + } + var S, + I, + O = function () { + for (var r = 0; r < h.enums.length; r++) if (h.enums[r] === t) return { name: e, value: t, strValue: "" + t, bypass: n }; + return null; + }; + if (h.number) { + var P, + R = "px"; + if ((h.units && (P = h.units), h.implicitUnits && (R = h.implicitUnits), !h.unitless)) + if (l) { + var B = "px|em" + (h.allowPercent ? "|\\%" : ""); + P && (B = P); + var F = t.match("^(" + M + ")(" + B + ")?$"); + F && ((t = F[1]), (P = F[2] || R)); + } else (P && !h.implicitUnits) || (P = R); + if (((t = parseFloat(t)), isNaN(t) && void 0 === h.enums)) return null; + if (isNaN(t) && void 0 !== h.enums) return (t = o), O(); + if (h.integer && (!b((I = t)) || Math.floor(I) !== I)) return null; + if ( + (void 0 !== h.min && (t < h.min || (h.strictMin && t === h.min))) || + (void 0 !== h.max && (t > h.max || (h.strictMax && t === h.max))) + ) + return null; + var z = { name: e, value: t, strValue: "" + t + (P || ""), units: P, bypass: n }; + return ( + h.unitless || ("px" !== P && "em" !== P) ? (z.pfValue = t) : (z.pfValue = "px" !== P && P ? this.getEmSizeInPixels() * t : t), + ("ms" !== P && "s" !== P) || (z.pfValue = "ms" === P ? t : 1e3 * t), + ("deg" !== P && "rad" !== P) || (z.pfValue = "rad" === P ? t : ((S = t), (Math.PI * S) / 180)), + "%" === P && (z.pfValue = t / 100), + z + ); + } + if (h.propList) { + var Y = [], + X = "" + t; + if ("none" === X); + else { + for (var V = X.split(/\s*,\s*|\s+/), U = 0; U < V.length; U++) { + var j = V[U].trim(); + i.properties[j] ? Y.push(j) : je("`" + j + "` is not a valid property name"); + } + if (0 === Y.length) return null; + } + return { + name: e, + value: Y, + strValue: 0 === Y.length ? "none" : Y.join(" "), + bypass: n, + }; + } + if (h.color) { + var q = G(t); + return q + ? { + name: e, + value: q, + pfValue: q, + strValue: "rgb(" + q[0] + "," + q[1] + "," + q[2] + ")", + bypass: n, + } + : null; + } + if (h.regex || h.regexes) { + if (h.enums) { + var H = O(); + if (H) return H; + } + for (var W = h.regexes ? h.regexes : [h.regex], $ = 0; $ < W.length; $++) { + var K = new RegExp(W[$]).exec(t); + if (K) + return { + name: e, + value: h.singleRegexMatchValue ? K[1] : K, + strValue: "" + t, + bypass: n, + }; + } + return null; + } + return h.string ? { name: e, value: "" + t, strValue: "" + t, bypass: n } : h.enums ? O() : null; + }, + }, + Vs = function e(t) { + if (!(this instanceof e)) return new e(t); + T(t) ? ((this._private = { cy: t, coreStyle: {} }), (this.length = 0), this.resetToDefault()) : Ve("A style must have a core reference"); + }, + Us = Vs.prototype; + (Us.instanceString = function () { + return "style"; + }), + (Us.clear = function () { + for (var e = this._private, t = e.cy.elements(), n = 0; n < this.length; n++) this[n] = void 0; + return ( + (this.length = 0), + (e.contextStyles = {}), + (e.propDiffs = {}), + this.cleanElements(t, !0), + t.forEach(function (e) { + var t = e[0]._private; + (t.styleDirty = !0), (t.appliedInitStyle = !1); + }), + this + ); + }), + (Us.resetToDefault = function () { + return this.clear(), this.addDefaultStylesheet(), this; + }), + (Us.core = function (e) { + return this._private.coreStyle[e] || this.getDefaultProperty(e); + }), + (Us.selector = function (e) { + var t = "core" === e ? null : new Ia(e), + n = this.length++; + return (this[n] = { selector: t, properties: [], mappedProperties: [], index: n }), this; + }), + (Us.css = function () { + var e = arguments; + if (1 === e.length) + for (var t = e[0], n = 0; n < this.properties.length; n++) { + var r = this.properties[n], + i = t[r.name]; + void 0 === i && (i = t[k(r.name)]), void 0 !== i && this.cssRule(r.name, i); + } + else 2 === e.length && this.cssRule(e[0], e[1]); + return this; + }), + (Us.style = Us.css), + (Us.cssRule = function (e, t) { + var n = this.parse(e, t); + if (n) { + var r = this.length - 1; + this[r].properties.push(n), + (this[r].properties[n.name] = n), + n.name.match(/pie-(\d+)-background-size/) && n.value && (this._private.hasPie = !0), + n.mapped && this[r].mappedProperties.push(n), + !this[r].selector && (this._private.coreStyle[n.name] = n); + } + return this; + }), + (Us.append = function (e) { + return D(e) ? e.appendToStyle(this) : y(e) ? this.appendFromJson(e) : f(e) && this.appendFromString(e), this; + }), + (Vs.fromJson = function (e, t) { + var n = new Vs(e); + return n.fromJson(t), n; + }), + (Vs.fromString = function (e, t) { + return new Vs(e).fromString(t); + }), + [Os, Rs, Bs, Fs, zs, Gs, Ys, Xs].forEach(function (e) { + z(Us, e); + }), + (Vs.types = Us.types), + (Vs.properties = Us.properties), + (Vs.propertyGroups = Us.propertyGroups), + (Vs.propertyGroupNames = Us.propertyGroupNames), + (Vs.propertyGroupKeys = Us.propertyGroupKeys); + var js = { + style: function (e) { + return e && this.setStyle(e).update(), this._private.style; + }, + setStyle: function (e) { + var t = this._private; + return ( + D(e) + ? (t.style = e.generateStyle(this)) + : y(e) + ? (t.style = Vs.fromJson(this, e)) + : f(e) + ? (t.style = Vs.fromString(this, e)) + : (t.style = Vs(this)), + t.style + ); + }, + updateStyle: function () { + this.mutableElements().updateStyle(); + }, + }, + qs = { + autolock: function (e) { + return void 0 === e ? this._private.autolock : ((this._private.autolock = !!e), this); + }, + autoungrabify: function (e) { + return void 0 === e ? this._private.autoungrabify : ((this._private.autoungrabify = !!e), this); + }, + autounselectify: function (e) { + return void 0 === e ? this._private.autounselectify : ((this._private.autounselectify = !!e), this); + }, + selectionType: function (e) { + var t = this._private; + return ( + null == t.selectionType && (t.selectionType = "single"), + void 0 === e ? t.selectionType : (("additive" !== e && "single" !== e) || (t.selectionType = e), this) + ); + }, + panningEnabled: function (e) { + return void 0 === e ? this._private.panningEnabled : ((this._private.panningEnabled = !!e), this); + }, + userPanningEnabled: function (e) { + return void 0 === e ? this._private.userPanningEnabled : ((this._private.userPanningEnabled = !!e), this); + }, + zoomingEnabled: function (e) { + return void 0 === e ? this._private.zoomingEnabled : ((this._private.zoomingEnabled = !!e), this); + }, + userZoomingEnabled: function (e) { + return void 0 === e ? this._private.userZoomingEnabled : ((this._private.userZoomingEnabled = !!e), this); + }, + boxSelectionEnabled: function (e) { + return void 0 === e ? this._private.boxSelectionEnabled : ((this._private.boxSelectionEnabled = !!e), this); + }, + pan: function () { + var e, + t, + n, + r, + i, + a = arguments, + o = this._private.pan; + switch (a.length) { + case 0: + return o; + case 1: + if (f(a[0])) return o[(e = a[0])]; + if (m(a[0])) { + if (!this._private.panningEnabled) return this; + (r = (n = a[0]).x), (i = n.y), b(r) && (o.x = r), b(i) && (o.y = i), this.emit("pan viewport"); + } + break; + case 2: + if (!this._private.panningEnabled) return this; + (t = a[1]), ("x" !== (e = a[0]) && "y" !== e) || !b(t) || (o[e] = t), this.emit("pan viewport"); + } + return this.notify("viewport"), this; + }, + panBy: function (e, t) { + var n, + r, + i, + a, + o, + s = arguments, + l = this._private.pan; + if (!this._private.panningEnabled) return this; + switch (s.length) { + case 1: + m(e) && ((a = (i = s[0]).x), (o = i.y), b(a) && (l.x += a), b(o) && (l.y += o), this.emit("pan viewport")); + break; + case 2: + (r = t), ("x" !== (n = e) && "y" !== n) || !b(r) || (l[n] += r), this.emit("pan viewport"); + } + return this.notify("viewport"), this; + }, + fit: function (e, t) { + var n = this.getFitViewport(e, t); + if (n) { + var r = this._private; + (r.zoom = n.zoom), (r.pan = n.pan), this.emit("pan zoom viewport"), this.notify("viewport"); + } + return this; + }, + getFitViewport: function (e, t) { + if ((b(e) && void 0 === t && ((t = e), (e = void 0)), this._private.panningEnabled && this._private.zoomingEnabled)) { + var n; + if (f(e)) { + var r = e; + e = this.$(r); + } else if (m((l = e)) && b(l.x1) && b(l.x2) && b(l.y1) && b(l.y2)) { + var i = e; + ((n = { x1: i.x1, y1: i.y1, x2: i.x2, y2: i.y2 }).w = n.x2 - n.x1), (n.h = n.y2 - n.y1); + } else w(e) || (e = this.mutableElements()); + if (!w(e) || !e.empty()) { + n = n || e.boundingBox(); + var a, + o = this.width(), + s = this.height(); + if (((t = b(t) ? t : 0), !isNaN(o) && !isNaN(s) && o > 0 && s > 0 && !isNaN(n.w) && !isNaN(n.h) && n.w > 0 && n.h > 0)) + return { + zoom: (a = + (a = (a = Math.min((o - 2 * t) / n.w, (s - 2 * t) / n.h)) > this._private.maxZoom ? this._private.maxZoom : a) < + this._private.minZoom + ? this._private.minZoom + : a), + pan: { x: (o - a * (n.x1 + n.x2)) / 2, y: (s - a * (n.y1 + n.y2)) / 2 }, + }; + } + } + var l; + }, + zoomRange: function (e, t) { + var n = this._private; + if (null == t) { + var r = e; + (e = r.min), (t = r.max); + } + return ( + b(e) && b(t) && e <= t + ? ((n.minZoom = e), (n.maxZoom = t)) + : b(e) && void 0 === t && e <= n.maxZoom + ? (n.minZoom = e) + : b(t) && void 0 === e && t >= n.minZoom && (n.maxZoom = t), + this + ); + }, + minZoom: function (e) { + return void 0 === e ? this._private.minZoom : this.zoomRange({ min: e }); + }, + maxZoom: function (e) { + return void 0 === e ? this._private.maxZoom : this.zoomRange({ max: e }); + }, + getZoomedViewport: function (e) { + var t, + n, + r = this._private, + i = r.pan, + a = r.zoom, + o = !1; + if ( + (r.zoomingEnabled || (o = !0), + b(e) + ? (n = e) + : m(e) && + ((n = e.level), + null != e.position ? (t = Et(e.position, a, i)) : null != e.renderedPosition && (t = e.renderedPosition), + null == t || r.panningEnabled || (o = !0)), + (n = (n = n > r.maxZoom ? r.maxZoom : n) < r.minZoom ? r.minZoom : n), + o || !b(n) || n === a || (null != t && (!b(t.x) || !b(t.y)))) + ) + return null; + if (null != t) { + var s = i, + l = a, + u = n; + return { + zoomed: !0, + panned: !0, + zoom: u, + pan: { x: (-u / l) * (t.x - s.x) + t.x, y: (-u / l) * (t.y - s.y) + t.y }, + }; + } + return { zoomed: !0, panned: !1, zoom: n, pan: i }; + }, + zoom: function (e) { + if (void 0 === e) return this._private.zoom; + var t = this.getZoomedViewport(e), + n = this._private; + return null != t && t.zoomed + ? ((n.zoom = t.zoom), + t.panned && ((n.pan.x = t.pan.x), (n.pan.y = t.pan.y)), + this.emit("zoom" + (t.panned ? " pan" : "") + " viewport"), + this.notify("viewport"), + this) + : this; + }, + viewport: function (e) { + var t = this._private, + n = !0, + r = !0, + i = [], + a = !1, + o = !1; + if (!e) return this; + if ((b(e.zoom) || (n = !1), m(e.pan) || (r = !1), !n && !r)) return this; + if (n) { + var s = e.zoom; + s < t.minZoom || s > t.maxZoom || !t.zoomingEnabled ? (a = !0) : ((t.zoom = s), i.push("zoom")); + } + if (r && (!a || !e.cancelOnFailedZoom) && t.panningEnabled) { + var l = e.pan; + b(l.x) && ((t.pan.x = l.x), (o = !1)), b(l.y) && ((t.pan.y = l.y), (o = !1)), o || i.push("pan"); + } + return i.length > 0 && (i.push("viewport"), this.emit(i.join(" ")), this.notify("viewport")), this; + }, + center: function (e) { + var t = this.getCenterPan(e); + return t && ((this._private.pan = t), this.emit("pan viewport"), this.notify("viewport")), this; + }, + getCenterPan: function (e, t) { + if (this._private.panningEnabled) { + if (f(e)) { + var n = e; + e = this.mutableElements().filter(n); + } else w(e) || (e = this.mutableElements()); + if (0 !== e.length) { + var r = e.boundingBox(), + i = this.width(), + a = this.height(); + return { + x: (i - (t = void 0 === t ? this._private.zoom : t) * (r.x1 + r.x2)) / 2, + y: (a - t * (r.y1 + r.y2)) / 2, + }; + } + } + }, + reset: function () { + return this._private.panningEnabled && this._private.zoomingEnabled ? (this.viewport({ pan: { x: 0, y: 0 }, zoom: 1 }), this) : this; + }, + invalidateSize: function () { + this._private.sizeCache = null; + }, + size: function () { + var e, + t, + n = this._private, + r = n.container; + return (n.sizeCache = + n.sizeCache || + (r + ? ((e = this.window().getComputedStyle(r)), + (t = function (t) { + return parseFloat(e.getPropertyValue(t)); + }), + { + width: r.clientWidth - t("padding-left") - t("padding-right"), + height: r.clientHeight - t("padding-top") - t("padding-bottom"), + }) + : { width: 1, height: 1 })); + }, + width: function () { + return this.size().width; + }, + height: function () { + return this.size().height; + }, + extent: function () { + var e = this._private.pan, + t = this._private.zoom, + n = this.renderedExtent(), + r = { + x1: (n.x1 - e.x) / t, + x2: (n.x2 - e.x) / t, + y1: (n.y1 - e.y) / t, + y2: (n.y2 - e.y) / t, + }; + return (r.w = r.x2 - r.x1), (r.h = r.y2 - r.y1), r; + }, + renderedExtent: function () { + var e = this.width(), + t = this.height(); + return { x1: 0, y1: 0, x2: e, y2: t, w: e, h: t }; + }, + multiClickDebounceTime: function (e) { + return e ? ((this._private.multiClickDebounceTime = e), this) : this._private.multiClickDebounceTime; + }, + }; + (qs.centre = qs.center), (qs.autolockNodes = qs.autolock), (qs.autoungrabifyNodes = qs.autoungrabify); + var Hs = { + data: Wi.data({ + field: "data", + bindingEvent: "data", + allowBinding: !0, + allowSetting: !0, + settingEvent: "data", + settingTriggersEvent: !0, + triggerFnName: "trigger", + allowGetting: !0, + updateStyle: !0, + }), + removeData: Wi.removeData({ + field: "data", + event: "data", + triggerFnName: "trigger", + triggerEvent: !0, + updateStyle: !0, + }), + scratch: Wi.data({ + field: "scratch", + bindingEvent: "scratch", + allowBinding: !0, + allowSetting: !0, + settingEvent: "scratch", + settingTriggersEvent: !0, + triggerFnName: "trigger", + allowGetting: !0, + updateStyle: !0, + }), + removeScratch: Wi.removeData({ + field: "scratch", + event: "scratch", + triggerFnName: "trigger", + triggerEvent: !0, + updateStyle: !0, + }), + }; + (Hs.attr = Hs.data), (Hs.removeAttr = Hs.removeData); + var Ws = function (e) { + var t = this, + n = (e = z({}, e)).container; + n && !x(n) && x(n[0]) && (n = n[0]); + var r = n ? n._cyreg : null; + (r = r || {}) && r.cy && (r.cy.destroy(), (r = {})); + var i = (r.readies = r.readies || []); + n && (n._cyreg = r), (r.cy = t); + var a = void 0 !== l && void 0 !== n && !e.headless, + o = e; + (o.layout = z({ name: a ? "grid" : "null" }, o.layout)), (o.renderer = z({ name: a ? "canvas" : "null" }, o.renderer)); + var s = function (e, t, n) { + return void 0 !== t ? t : void 0 !== n ? n : e; + }, + u = (this._private = { + container: n, + ready: !1, + options: o, + elements: new cs(this), + listeners: [], + aniEles: new cs(this), + data: o.data || {}, + scratch: {}, + layout: null, + renderer: null, + destroyed: !1, + notificationsEnabled: !0, + minZoom: 1e-50, + maxZoom: 1e50, + zoomingEnabled: s(!0, o.zoomingEnabled), + userZoomingEnabled: s(!0, o.userZoomingEnabled), + panningEnabled: s(!0, o.panningEnabled), + userPanningEnabled: s(!0, o.userPanningEnabled), + boxSelectionEnabled: s(!0, o.boxSelectionEnabled), + autolock: s(!1, o.autolock, o.autolockNodes), + autoungrabify: s(!1, o.autoungrabify, o.autoungrabifyNodes), + autounselectify: s(!1, o.autounselectify), + styleEnabled: void 0 === o.styleEnabled ? a : o.styleEnabled, + zoom: b(o.zoom) ? o.zoom : 1, + pan: { + x: m(o.pan) && b(o.pan.x) ? o.pan.x : 0, + y: m(o.pan) && b(o.pan.y) ? o.pan.y : 0, + }, + animation: { current: [], queue: [] }, + hasCompoundNodes: !1, + multiClickDebounceTime: s(250, o.multiClickDebounceTime), + }); + this.createEmitter(), this.selectionType(o.selectionType), this.zoomRange({ min: o.minZoom, max: o.maxZoom }); + u.styleEnabled && t.setStyle([]); + var c = z({}, o, o.renderer); + t.initRenderer(c); + !(function (e, t) { + if (e.some(N)) return _r.all(e).then(t); + t(e); + })([o.style, o.elements], function (e) { + var n = e[0], + a = e[1]; + u.styleEnabled && t.style().append(n), + (function (e, n, r) { + t.notifications(!1); + var i = t.mutableElements(); + i.length > 0 && i.remove(), + null != e && (m(e) || y(e)) && t.add(e), + t + .one("layoutready", function (e) { + t.notifications(!0), t.emit(e), t.one("load", n), t.emitAndNotify("load"); + }) + .one("layoutstop", function () { + t.one("done", r), t.emit("done"); + }); + var a = z({}, t._private.options.layout); + (a.eles = t.elements()), t.layout(a).run(); + })( + a, + function () { + t.startAnimationLoop(), (u.ready = !0), v(o.ready) && t.on("ready", o.ready); + for (var e = 0; e < i.length; e++) { + var n = i[e]; + t.on("ready", n); + } + r && (r.readies = []), t.emit("ready"); + }, + o.done, + ); + }); + }, + $s = Ws.prototype; + z($s, { + instanceString: function () { + return "core"; + }, + isReady: function () { + return this._private.ready; + }, + destroyed: function () { + return this._private.destroyed; + }, + ready: function (e) { + return this.isReady() ? this.emitter().emit("ready", [], e) : this.on("ready", e), this; + }, + destroy: function () { + var e = this; + if (!e.destroyed()) return e.stopAnimationLoop(), e.destroyRenderer(), this.emit("destroy"), (e._private.destroyed = !0), e; + }, + hasElementWithId: function (e) { + return this._private.elements.hasElementWithId(e); + }, + getElementById: function (e) { + return this._private.elements.getElementById(e); + }, + hasCompoundNodes: function () { + return this._private.hasCompoundNodes; + }, + headless: function () { + return this._private.renderer.isHeadless(); + }, + styleEnabled: function () { + return this._private.styleEnabled; + }, + addToPool: function (e) { + return this._private.elements.merge(e), this; + }, + removeFromPool: function (e) { + return this._private.elements.unmerge(e), this; + }, + container: function () { + return this._private.container || null; + }, + window: function () { + if (null == this._private.container) return l; + var e = this._private.container.ownerDocument; + return void 0 === e || null == e ? l : e.defaultView || l; + }, + mount: function (e) { + if (null != e) { + var t = this, + n = t._private, + r = n.options; + return ( + !x(e) && x(e[0]) && (e = e[0]), + t.stopAnimationLoop(), + t.destroyRenderer(), + (n.container = e), + (n.styleEnabled = !0), + t.invalidateSize(), + t.initRenderer( + z({}, r, r.renderer, { + name: "null" === r.renderer.name ? "canvas" : r.renderer.name, + }), + ), + t.startAnimationLoop(), + t.style(r.style), + t.emit("mount"), + t + ); + } + }, + unmount: function () { + var e = this; + return e.stopAnimationLoop(), e.destroyRenderer(), e.initRenderer({ name: "null" }), e.emit("unmount"), e; + }, + options: function () { + return qe(this._private.options); + }, + json: function (e) { + var t = this, + n = t._private, + r = t.mutableElements(); + if (m(e)) { + if ((t.startBatch(), e.elements)) { + var i = {}, + a = function (e, n) { + for (var r = [], a = [], o = 0; o < e.length; o++) { + var s = e[o]; + if (s.data.id) { + var l = "" + s.data.id, + u = t.getElementById(l); + (i[l] = !0), 0 !== u.length ? a.push({ ele: u, json: s }) : n ? ((s.group = n), r.push(s)) : r.push(s); + } else je("cy.json() cannot handle elements without an ID attribute"); + } + t.add(r); + for (var c = 0; c < a.length; c++) { + var h = a[c], + d = h.ele, + p = h.json; + d.json(p); + } + }; + if (y(e.elements)) a(e.elements); + else + for (var o = ["nodes", "edges"], s = 0; s < o.length; s++) { + var l = o[s], + u = e.elements[l]; + y(u) && a(u, l); + } + var c = t.collection(); + r + .filter(function (e) { + return !i[e.id()]; + }) + .forEach(function (e) { + e.isParent() ? c.merge(e) : e.remove(); + }), + c.forEach(function (e) { + return e.children().move({ parent: null }); + }), + c.forEach(function (e) { + return (function (e) { + return t.getElementById(e.id()); + })(e).remove(); + }); + } + e.style && t.style(e.style), + null != e.zoom && e.zoom !== n.zoom && t.zoom(e.zoom), + e.pan && ((e.pan.x === n.pan.x && e.pan.y === n.pan.y) || t.pan(e.pan)), + e.data && t.data(e.data); + for ( + var h = [ + "minZoom", + "maxZoom", + "zoomingEnabled", + "userZoomingEnabled", + "panningEnabled", + "userPanningEnabled", + "boxSelectionEnabled", + "autolock", + "autoungrabify", + "autounselectify", + "multiClickDebounceTime", + ], + d = 0; + d < h.length; + d++ + ) { + var p = h[d]; + null != e[p] && t[p](e[p]); + } + return t.endBatch(), this; + } + var g = {}; + e + ? (g.elements = this.elements().map(function (e) { + return e.json(); + })) + : ((g.elements = {}), + r.forEach(function (e) { + var t = e.group(); + g.elements[t] || (g.elements[t] = []), g.elements[t].push(e.json()); + })), + this._private.styleEnabled && (g.style = t.style().json()), + (g.data = qe(t.data())); + var f = n.options; + return ( + (g.zoomingEnabled = n.zoomingEnabled), + (g.userZoomingEnabled = n.userZoomingEnabled), + (g.zoom = n.zoom), + (g.minZoom = n.minZoom), + (g.maxZoom = n.maxZoom), + (g.panningEnabled = n.panningEnabled), + (g.userPanningEnabled = n.userPanningEnabled), + (g.pan = qe(n.pan)), + (g.boxSelectionEnabled = n.boxSelectionEnabled), + (g.renderer = qe(f.renderer)), + (g.hideEdgesOnViewport = f.hideEdgesOnViewport), + (g.textureOnViewport = f.textureOnViewport), + (g.wheelSensitivity = f.wheelSensitivity), + (g.motionBlur = f.motionBlur), + (g.multiClickDebounceTime = f.multiClickDebounceTime), + g + ); + }, + }), + ($s.$id = $s.getElementById), + [ds, Ts, Ns, As, Ls, ks, Is, Ms, js, qs, Hs].forEach(function (e) { + z($s, e); + }); + var Ks = { + fit: !0, + directed: !1, + padding: 30, + circle: !1, + grid: !1, + spacingFactor: 1.75, + boundingBox: void 0, + avoidOverlap: !0, + nodeDimensionsIncludeLabels: !1, + roots: void 0, + depthSort: void 0, + animate: !1, + animationDuration: 500, + animationEasing: void 0, + animateFilter: function (e, t) { + return !0; + }, + ready: void 0, + stop: void 0, + transform: function (e, t) { + return t; + }, + }, + Zs = { maximal: !1, acyclic: !1 }, + Qs = function (e) { + return e.scratch("breadthfirst"); + }, + Js = function (e, t) { + return e.scratch("breadthfirst", t); + }; + function el(e) { + this.options = z({}, Ks, Zs, e); + } + el.prototype.run = function () { + var e, + t = this.options, + n = t, + r = t.cy, + i = n.eles, + a = i.nodes().filter(function (e) { + return !e.isParent(); + }), + o = i, + s = n.directed, + l = n.acyclic || n.maximal || n.maximalAdjustments > 0, + u = Ot(n.boundingBox ? n.boundingBox : { x1: 0, y1: 0, w: r.width(), h: r.height() }); + if (w(n.roots)) e = n.roots; + else if (y(n.roots)) { + for (var c = [], h = 0; h < n.roots.length; h++) { + var d = n.roots[h], + p = r.getElementById(d); + c.push(p); + } + e = r.collection(c); + } else if (f(n.roots)) e = r.$(n.roots); + else if (s) e = a.roots(); + else { + var g = i.components(); + e = r.collection(); + for ( + var v = function (t) { + var n = g[t], + r = n.maxDegree(!1), + i = n.filter(function (e) { + return e.degree(!1) === r; + }); + e = e.add(i); + }, + m = 0; + m < g.length; + m++ + ) + v(m); + } + var b = [], + x = {}, + E = function (e, t) { + null == b[t] && (b[t] = []); + var n = b[t].length; + b[t].push(e), Js(e, { index: n, depth: t }); + }; + o.bfs({ + roots: e, + directed: n.directed, + visit: function (e, t, n, r, i) { + var a = e[0], + o = a.id(); + E(a, i), (x[o] = !0); + }, + }); + for (var _ = [], T = 0; T < a.length; T++) { + var D = a[T]; + x[D.id()] || _.push(D); + } + var C = function (e) { + for (var t = b[e], n = 0; n < t.length; n++) { + var r = t[n]; + null != r ? Js(r, { depth: e, index: n }) : (t.splice(n, 1), n--); + } + }, + N = function () { + for (var e = 0; e < b.length; e++) C(e); + }, + A = function (e, t) { + for ( + var r = Qs(e), + a = e.incomers().filter(function (e) { + return e.isNode() && i.has(e); + }), + o = -1, + s = e.id(), + l = 0; + l < a.length; + l++ + ) { + var u = a[l], + c = Qs(u); + o = Math.max(o, c.depth); + } + if (r.depth <= o) { + if (!n.acyclic && t[s]) return null; + var h = o + 1; + return ( + (function (e, t) { + var n = Qs(e), + r = n.depth, + i = n.index; + (b[r][i] = null), E(e, t); + })(e, h), + (t[s] = h), + !0 + ); + } + return !1; + }; + if (s && l) { + var L = [], + k = {}, + S = function (e) { + return L.push(e); + }; + for ( + a.forEach(function (e) { + return L.push(e); + }); + L.length > 0; + + ) { + var I = L.shift(), + M = A(I, k); + if (M) + I.outgoers() + .filter(function (e) { + return e.isNode() && i.has(e); + }) + .forEach(S); + else if (null === M) { + je( + "Detected double maximal shift for node `" + + I.id() + + "`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.", + ); + break; + } + } + } + N(); + var O = 0; + if (n.avoidOverlap) + for (var P = 0; P < a.length; P++) { + var R = a[P].layoutDimensions(n), + B = R.w, + z = R.h; + O = Math.max(O, B, z); + } + var G = {}, + Y = function (e) { + if (G[e.id()]) return G[e.id()]; + for (var t = Qs(e).depth, n = e.neighborhood(), r = 0, i = 0, o = 0; o < n.length; o++) { + var s = n[o]; + if (!s.isEdge() && !s.isParent() && a.has(s)) { + var l = Qs(s); + if (null != l) { + var u = l.index, + c = l.depth; + if (null != u && null != c) { + var h = b[c].length; + c < t && ((r += u / h), i++); + } + } + } + } + return (r /= i = Math.max(1, i)), 0 === i && (r = 0), (G[e.id()] = r), r; + }, + X = function (e, t) { + var n = Y(e) - Y(t); + return 0 === n ? F(e.id(), t.id()) : n; + }; + void 0 !== n.depthSort && (X = n.depthSort); + for (var V = 0; V < b.length; V++) b[V].sort(X), C(V); + for (var U = [], j = 0; j < _.length; j++) U.push(_[j]); + b.unshift(U), N(); + for (var q = 0, H = 0; H < b.length; H++) q = Math.max(b[H].length, q); + var W = u.x1 + u.w / 2, + $ = u.x1 + u.h / 2, + K = b.reduce(function (e, t) { + return Math.max(e, t.length); + }, 0); + return ( + i.nodes().layoutPositions(this, n, function (e) { + var t = Qs(e), + r = t.depth, + i = t.index, + a = b[r].length, + o = Math.max(u.w / ((n.grid ? K : a) + 1), O), + s = Math.max(u.h / (b.length + 1), O), + l = Math.min(u.w / 2 / b.length, u.h / 2 / b.length); + if (((l = Math.max(l, O)), n.circle)) { + var c = l * r + l - (b.length > 0 && b[0].length <= 3 ? l / 2 : 0), + h = ((2 * Math.PI) / b[r].length) * i; + return 0 === r && 1 === b[0].length && (c = 1), { x: W + c * Math.cos(h), y: $ + c * Math.sin(h) }; + } + return { x: W + (i + 1 - (a + 1) / 2) * o, y: (r + 1) * s }; + }), + this + ); + }; + var tl = { + fit: !0, + padding: 30, + boundingBox: void 0, + avoidOverlap: !0, + nodeDimensionsIncludeLabels: !1, + spacingFactor: void 0, + radius: void 0, + startAngle: 1.5 * Math.PI, + sweep: void 0, + clockwise: !0, + sort: void 0, + animate: !1, + animationDuration: 500, + animationEasing: void 0, + animateFilter: function (e, t) { + return !0; + }, + ready: void 0, + stop: void 0, + transform: function (e, t) { + return t; + }, + }; + function nl(e) { + this.options = z({}, tl, e); + } + nl.prototype.run = function () { + var e = this.options, + t = e, + n = e.cy, + r = t.eles, + i = void 0 !== t.counterclockwise ? !t.counterclockwise : t.clockwise, + a = r.nodes().not(":parent"); + t.sort && (a = a.sort(t.sort)); + for ( + var o, + s = Ot(t.boundingBox ? t.boundingBox : { x1: 0, y1: 0, w: n.width(), h: n.height() }), + l = { x: s.x1 + s.w / 2, y: s.y1 + s.h / 2 }, + u = (void 0 === t.sweep ? 2 * Math.PI - (2 * Math.PI) / a.length : t.sweep) / Math.max(1, a.length - 1), + c = 0, + h = 0; + h < a.length; + h++ + ) { + var d = a[h].layoutDimensions(t), + p = d.w, + g = d.h; + c = Math.max(c, p, g); + } + if (((o = b(t.radius) ? t.radius : a.length <= 1 ? 0 : Math.min(s.h, s.w) / 2 - c), a.length > 1 && t.avoidOverlap)) { + c *= 1.75; + var f = Math.cos(u) - Math.cos(0), + v = Math.sin(u) - Math.sin(0), + y = Math.sqrt((c * c) / (f * f + v * v)); + o = Math.max(y, o); + } + return ( + r.nodes().layoutPositions(this, t, function (e, n) { + var r = t.startAngle + n * u * (i ? 1 : -1), + a = o * Math.cos(r), + s = o * Math.sin(r); + return { x: l.x + a, y: l.y + s }; + }), + this + ); + }; + var rl, + il = { + fit: !0, + padding: 30, + startAngle: 1.5 * Math.PI, + sweep: void 0, + clockwise: !0, + equidistant: !1, + minNodeSpacing: 10, + boundingBox: void 0, + avoidOverlap: !0, + nodeDimensionsIncludeLabels: !1, + height: void 0, + width: void 0, + spacingFactor: void 0, + concentric: function (e) { + return e.degree(); + }, + levelWidth: function (e) { + return e.maxDegree() / 4; + }, + animate: !1, + animationDuration: 500, + animationEasing: void 0, + animateFilter: function (e, t) { + return !0; + }, + ready: void 0, + stop: void 0, + transform: function (e, t) { + return t; + }, + }; + function al(e) { + this.options = z({}, il, e); + } + al.prototype.run = function () { + for ( + var e = this.options, + t = e, + n = void 0 !== t.counterclockwise ? !t.counterclockwise : t.clockwise, + r = e.cy, + i = t.eles, + a = i.nodes().not(":parent"), + o = Ot(t.boundingBox ? t.boundingBox : { x1: 0, y1: 0, w: r.width(), h: r.height() }), + s = { x: o.x1 + o.w / 2, y: o.y1 + o.h / 2 }, + l = [], + u = 0, + c = 0; + c < a.length; + c++ + ) { + var h, + d = a[c]; + (h = t.concentric(d)), l.push({ value: h, node: d }), (d._private.scratch.concentric = h); + } + a.updateStyle(); + for (var p = 0; p < a.length; p++) { + var g = a[p].layoutDimensions(t); + u = Math.max(u, g.w, g.h); + } + l.sort(function (e, t) { + return t.value - e.value; + }); + for (var f = t.levelWidth(a), v = [[]], y = v[0], m = 0; m < l.length; m++) { + var b = l[m]; + y.length > 0 && Math.abs(y[0].value - b.value) >= f && ((y = []), v.push(y)), y.push(b); + } + var x = u + t.minNodeSpacing; + if (!t.avoidOverlap) { + var w = v.length > 0 && v[0].length > 1, + E = (Math.min(o.w, o.h) / 2 - x) / (v.length + w ? 1 : 0); + x = Math.min(x, E); + } + for (var _ = 0, T = 0; T < v.length; T++) { + var D = v[T], + C = void 0 === t.sweep ? 2 * Math.PI - (2 * Math.PI) / D.length : t.sweep, + N = (D.dTheta = C / Math.max(1, D.length - 1)); + if (D.length > 1 && t.avoidOverlap) { + var A = Math.cos(N) - Math.cos(0), + L = Math.sin(N) - Math.sin(0), + k = Math.sqrt((x * x) / (A * A + L * L)); + _ = Math.max(k, _); + } + (D.r = _), (_ += x); + } + if (t.equidistant) { + for (var S = 0, I = 0, M = 0; M < v.length; M++) { + var O = v[M].r - I; + S = Math.max(S, O); + } + I = 0; + for (var P = 0; P < v.length; P++) { + var R = v[P]; + 0 === P && (I = R.r), (R.r = I), (I += S); + } + } + for (var B = {}, F = 0; F < v.length; F++) + for (var z = v[F], G = z.dTheta, Y = z.r, X = 0; X < z.length; X++) { + var V = z[X], + U = t.startAngle + (n ? 1 : -1) * G * X, + j = { x: s.x + Y * Math.cos(U), y: s.y + Y * Math.sin(U) }; + B[V.node.id()] = j; + } + return ( + i.nodes().layoutPositions(this, t, function (e) { + var t = e.id(); + return B[t]; + }), + this + ); + }; + var ol = { + ready: function () {}, + stop: function () {}, + animate: !0, + animationEasing: void 0, + animationDuration: void 0, + animateFilter: function (e, t) { + return !0; + }, + animationThreshold: 250, + refresh: 20, + fit: !0, + padding: 30, + boundingBox: void 0, + nodeDimensionsIncludeLabels: !1, + randomize: !1, + componentSpacing: 40, + nodeRepulsion: function (e) { + return 2048; + }, + nodeOverlap: 4, + idealEdgeLength: function (e) { + return 32; + }, + edgeElasticity: function (e) { + return 32; + }, + nestingFactor: 1.2, + gravity: 1, + numIter: 1e3, + initialTemp: 1e3, + coolingFactor: 0.99, + minTemp: 1, + }; + function sl(e) { + (this.options = z({}, ol, e)), (this.options.layout = this); + } + (sl.prototype.run = function () { + var e = this.options, + t = e.cy, + n = this; + (n.stopped = !1), (!0 !== e.animate && !1 !== e.animate) || n.emit({ type: "layoutstart", layout: n }), (rl = !0 === e.debug); + var r = ll(t, n, e); + rl && undefined(r), e.randomize && hl(r); + var i = Te(), + a = function () { + pl(r, t, e), !0 === e.fit && t.fit(e.padding); + }, + o = function (t) { + return !(n.stopped || t >= e.numIter || (gl(r, e), (r.temperature = r.temperature * e.coolingFactor), r.temperature < e.minTemp)); + }, + s = function () { + if (!0 === e.animate || !1 === e.animate) a(), n.one("layoutstop", e.stop), n.emit({ type: "layoutstop", layout: n }); + else { + var t = e.eles.nodes(), + i = dl(r, e, t); + t.layoutPositions(n, e, i); + } + }, + l = 0, + u = !0; + if (!0 === e.animate) + !(function t() { + for (var n = 0; u && n < e.refresh; ) (u = o(l)), l++, n++; + u ? (Te() - i >= e.animationThreshold && a(), _e(t)) : (Cl(r, e), s()); + })(); + else { + for (; u; ) (u = o(l)), l++; + Cl(r, e), s(); + } + return this; + }), + (sl.prototype.stop = function () { + return (this.stopped = !0), this.thread && this.thread.stop(), this.emit("layoutstop"), this; + }), + (sl.prototype.destroy = function () { + return this.thread && this.thread.stop(), this; + }); + var ll = function (e, t, n) { + for ( + var r = n.eles.edges(), + i = n.eles.nodes(), + a = Ot(n.boundingBox ? n.boundingBox : { x1: 0, y1: 0, w: e.width(), h: e.height() }), + o = { + isCompound: e.hasCompoundNodes(), + layoutNodes: [], + idToIndex: {}, + nodeSize: i.size(), + graphSet: [], + indexToGraph: [], + layoutEdges: [], + edgeSize: r.size(), + temperature: n.initialTemp, + clientWidth: a.w, + clientHeight: a.h, + boundingBox: a, + }, + s = n.eles.components(), + l = {}, + u = 0; + u < s.length; + u++ + ) + for (var c = s[u], h = 0; h < c.length; h++) l[c[h].id()] = u; + for (u = 0; u < o.nodeSize; u++) { + var d = (m = i[u]).layoutDimensions(n); + ((O = {}).isLocked = m.locked()), + (O.id = m.data("id")), + (O.parentId = m.data("parent")), + (O.cmptId = l[m.id()]), + (O.children = []), + (O.positionX = m.position("x")), + (O.positionY = m.position("y")), + (O.offsetX = 0), + (O.offsetY = 0), + (O.height = d.w), + (O.width = d.h), + (O.maxX = O.positionX + O.width / 2), + (O.minX = O.positionX - O.width / 2), + (O.maxY = O.positionY + O.height / 2), + (O.minY = O.positionY - O.height / 2), + (O.padLeft = parseFloat(m.style("padding"))), + (O.padRight = parseFloat(m.style("padding"))), + (O.padTop = parseFloat(m.style("padding"))), + (O.padBottom = parseFloat(m.style("padding"))), + (O.nodeRepulsion = v(n.nodeRepulsion) ? n.nodeRepulsion(m) : n.nodeRepulsion), + o.layoutNodes.push(O), + (o.idToIndex[O.id] = u); + } + var p = [], + g = 0, + f = -1, + y = []; + for (u = 0; u < o.nodeSize; u++) { + var m, + b = (m = o.layoutNodes[u]).parentId; + null != b ? o.layoutNodes[o.idToIndex[b]].children.push(m.id) : ((p[++f] = m.id), y.push(m.id)); + } + for (o.graphSet.push(y); g <= f; ) { + var x = p[g++], + w = o.idToIndex[x], + E = o.layoutNodes[w].children; + if (E.length > 0) for (o.graphSet.push(E), u = 0; u < E.length; u++) p[++f] = E[u]; + } + for (u = 0; u < o.graphSet.length; u++) { + var _ = o.graphSet[u]; + for (h = 0; h < _.length; h++) { + var T = o.idToIndex[_[h]]; + o.indexToGraph[T] = u; + } + } + for (u = 0; u < o.edgeSize; u++) { + var D = r[u], + C = {}; + (C.id = D.data("id")), (C.sourceId = D.data("source")), (C.targetId = D.data("target")); + var N = v(n.idealEdgeLength) ? n.idealEdgeLength(D) : n.idealEdgeLength, + A = v(n.edgeElasticity) ? n.edgeElasticity(D) : n.edgeElasticity, + L = o.idToIndex[C.sourceId], + k = o.idToIndex[C.targetId]; + if (o.indexToGraph[L] != o.indexToGraph[k]) { + for (var S = ul(C.sourceId, C.targetId, o), I = o.graphSet[S], M = 0, O = o.layoutNodes[L]; -1 === I.indexOf(O.id); ) + (O = o.layoutNodes[o.idToIndex[O.parentId]]), M++; + for (O = o.layoutNodes[k]; -1 === I.indexOf(O.id); ) (O = o.layoutNodes[o.idToIndex[O.parentId]]), M++; + N *= M * n.nestingFactor; + } + (C.idealLength = N), (C.elasticity = A), o.layoutEdges.push(C); + } + return o; + }, + ul = function (e, t, n) { + var r = cl(e, t, 0, n); + return 2 > r.count ? 0 : r.graph; + }, + cl = function e(t, n, r, i) { + var a = i.graphSet[r]; + if (-1 < a.indexOf(t) && -1 < a.indexOf(n)) return { count: 2, graph: r }; + for (var o = 0, s = 0; s < a.length; s++) { + var l = a[s], + u = i.idToIndex[l], + c = i.layoutNodes[u].children; + if (0 !== c.length) { + var h = e(t, n, i.indexToGraph[i.idToIndex[c[0]]], i); + if (0 !== h.count) { + if (1 !== h.count) return h; + if (2 == ++o) break; + } + } + } + return { count: o, graph: r }; + }, + hl = function (e, t) { + for (var n = e.clientWidth, r = e.clientHeight, i = 0; i < e.nodeSize; i++) { + var a = e.layoutNodes[i]; + 0 !== a.children.length || a.isLocked || ((a.positionX = Math.random() * n), (a.positionY = Math.random() * r)); + } + }, + dl = function (e, t, n) { + var r = e.boundingBox, + i = { x1: 1 / 0, x2: -1 / 0, y1: 1 / 0, y2: -1 / 0 }; + return ( + t.boundingBox && + (n.forEach(function (t) { + var n = e.layoutNodes[e.idToIndex[t.data("id")]]; + (i.x1 = Math.min(i.x1, n.positionX)), + (i.x2 = Math.max(i.x2, n.positionX)), + (i.y1 = Math.min(i.y1, n.positionY)), + (i.y2 = Math.max(i.y2, n.positionY)); + }), + (i.w = i.x2 - i.x1), + (i.h = i.y2 - i.y1)), + function (n, a) { + var o = e.layoutNodes[e.idToIndex[n.data("id")]]; + if (t.boundingBox) { + var s = (o.positionX - i.x1) / i.w, + l = (o.positionY - i.y1) / i.h; + return { x: r.x1 + s * r.w, y: r.y1 + l * r.h }; + } + return { x: o.positionX, y: o.positionY }; + } + ); + }, + pl = function (e, t, n) { + var r = n.layout, + i = n.eles.nodes(), + a = dl(e, n, i); + i.positions(a), !0 !== e.ready && ((e.ready = !0), r.one("layoutready", n.ready), r.emit({ type: "layoutready", layout: this })); + }, + gl = function (e, t, n) { + fl(e, t), xl(e), wl(e, t), El(e), _l(e); + }, + fl = function (e, t) { + for (var n = 0; n < e.graphSet.length; n++) + for (var r = e.graphSet[n], i = r.length, a = 0; a < i; a++) + for (var o = e.layoutNodes[e.idToIndex[r[a]]], s = a + 1; s < i; s++) { + var l = e.layoutNodes[e.idToIndex[r[s]]]; + yl(o, l, e, t); + } + }, + vl = function (e) { + return -e + 2 * e * Math.random(); + }, + yl = function (e, t, n, r) { + if (e.cmptId === t.cmptId || n.isCompound) { + var i = t.positionX - e.positionX, + a = t.positionY - e.positionY; + 0 === i && 0 === a && ((i = vl(1)), (a = vl(1))); + var o = ml(e, t, i, a); + if (o > 0) + var s = ((u = r.nodeOverlap * o) * i) / (f = Math.sqrt(i * i + a * a)), + l = (u * a) / f; + else { + var u, + c = bl(e, i, a), + h = bl(t, -1 * i, -1 * a), + d = h.x - c.x, + p = h.y - c.y, + g = d * d + p * p, + f = Math.sqrt(g); + (s = ((u = (e.nodeRepulsion + t.nodeRepulsion) / g) * d) / f), (l = (u * p) / f); + } + e.isLocked || ((e.offsetX -= s), (e.offsetY -= l)), t.isLocked || ((t.offsetX += s), (t.offsetY += l)); + } + }, + ml = function (e, t, n, r) { + if (n > 0) var i = e.maxX - t.minX; + else i = t.maxX - e.minX; + if (r > 0) var a = e.maxY - t.minY; + else a = t.maxY - e.minY; + return i >= 0 && a >= 0 ? Math.sqrt(i * i + a * a) : 0; + }, + bl = function (e, t, n) { + var r = e.positionX, + i = e.positionY, + a = e.height || 1, + o = e.width || 1, + s = n / t, + l = a / o, + u = {}; + return (0 === t && 0 < n) || (0 === t && 0 > n) + ? ((u.x = r), (u.y = i + a / 2), u) + : 0 < t && -1 * l <= s && s <= l + ? ((u.x = r + o / 2), (u.y = i + (o * n) / 2 / t), u) + : 0 > t && -1 * l <= s && s <= l + ? ((u.x = r - o / 2), (u.y = i - (o * n) / 2 / t), u) + : 0 < n && (s <= -1 * l || s >= l) + ? ((u.x = r + (a * t) / 2 / n), (u.y = i + a / 2), u) + : 0 > n && (s <= -1 * l || s >= l) + ? ((u.x = r - (a * t) / 2 / n), (u.y = i - a / 2), u) + : u; + }, + xl = function (e, t) { + for (var n = 0; n < e.edgeSize; n++) { + var r = e.layoutEdges[n], + i = e.idToIndex[r.sourceId], + a = e.layoutNodes[i], + o = e.idToIndex[r.targetId], + s = e.layoutNodes[o], + l = s.positionX - a.positionX, + u = s.positionY - a.positionY; + if (0 !== l || 0 !== u) { + var c = bl(a, l, u), + h = bl(s, -1 * l, -1 * u), + d = h.x - c.x, + p = h.y - c.y, + g = Math.sqrt(d * d + p * p), + f = Math.pow(r.idealLength - g, 2) / r.elasticity; + if (0 !== g) + var v = (f * d) / g, + y = (f * p) / g; + else (v = 0), (y = 0); + a.isLocked || ((a.offsetX += v), (a.offsetY += y)), s.isLocked || ((s.offsetX -= v), (s.offsetY -= y)); + } + } + }, + wl = function (e, t) { + if (0 !== t.gravity) + for (var n = 0; n < e.graphSet.length; n++) { + var r = e.graphSet[n], + i = r.length; + if (0 === n) + var a = e.clientHeight / 2, + o = e.clientWidth / 2; + else { + var s = e.layoutNodes[e.idToIndex[r[0]]], + l = e.layoutNodes[e.idToIndex[s.parentId]]; + (a = l.positionX), (o = l.positionY); + } + for (var u = 0; u < i; u++) { + var c = e.layoutNodes[e.idToIndex[r[u]]]; + if (!c.isLocked) { + var h = a - c.positionX, + d = o - c.positionY, + p = Math.sqrt(h * h + d * d); + if (p > 1) { + var g = (t.gravity * h) / p, + f = (t.gravity * d) / p; + (c.offsetX += g), (c.offsetY += f); + } + } + } + } + }, + El = function (e, t) { + var n = [], + r = 0, + i = -1; + for (n.push.apply(n, e.graphSet[0]), i += e.graphSet[0].length; r <= i; ) { + var a = n[r++], + o = e.idToIndex[a], + s = e.layoutNodes[o], + l = s.children; + if (0 < l.length && !s.isLocked) { + for (var u = s.offsetX, c = s.offsetY, h = 0; h < l.length; h++) { + var d = e.layoutNodes[e.idToIndex[l[h]]]; + (d.offsetX += u), (d.offsetY += c), (n[++i] = l[h]); + } + (s.offsetX = 0), (s.offsetY = 0); + } + } + }, + _l = function (e, t) { + for (var n = 0; n < e.nodeSize; n++) + 0 < (i = e.layoutNodes[n]).children.length && ((i.maxX = void 0), (i.minX = void 0), (i.maxY = void 0), (i.minY = void 0)); + for (n = 0; n < e.nodeSize; n++) + if (!(0 < (i = e.layoutNodes[n]).children.length || i.isLocked)) { + var r = Tl(i.offsetX, i.offsetY, e.temperature); + (i.positionX += r.x), + (i.positionY += r.y), + (i.offsetX = 0), + (i.offsetY = 0), + (i.minX = i.positionX - i.width), + (i.maxX = i.positionX + i.width), + (i.minY = i.positionY - i.height), + (i.maxY = i.positionY + i.height), + Dl(i, e); + } + for (n = 0; n < e.nodeSize; n++) { + var i; + 0 < (i = e.layoutNodes[n]).children.length && + !i.isLocked && + ((i.positionX = (i.maxX + i.minX) / 2), + (i.positionY = (i.maxY + i.minY) / 2), + (i.width = i.maxX - i.minX), + (i.height = i.maxY - i.minY)); + } + }, + Tl = function (e, t, n) { + var r = Math.sqrt(e * e + t * t); + if (r > n) var i = { x: (n * e) / r, y: (n * t) / r }; + else i = { x: e, y: t }; + return i; + }, + Dl = function e(t, n) { + var r = t.parentId; + if (null != r) { + var i = n.layoutNodes[n.idToIndex[r]], + a = !1; + return ( + (null == i.maxX || t.maxX + i.padRight > i.maxX) && ((i.maxX = t.maxX + i.padRight), (a = !0)), + (null == i.minX || t.minX - i.padLeft < i.minX) && ((i.minX = t.minX - i.padLeft), (a = !0)), + (null == i.maxY || t.maxY + i.padBottom > i.maxY) && ((i.maxY = t.maxY + i.padBottom), (a = !0)), + (null == i.minY || t.minY - i.padTop < i.minY) && ((i.minY = t.minY - i.padTop), (a = !0)), + a ? e(i, n) : void 0 + ); + } + }, + Cl = function (e, t) { + for (var n = e.layoutNodes, r = [], i = 0; i < n.length; i++) { + var a = n[i], + o = a.cmptId; + (r[o] = r[o] || []).push(a); + } + var s = 0; + for (i = 0; i < r.length; i++) + if ((f = r[i])) { + (f.x1 = 1 / 0), (f.x2 = -1 / 0), (f.y1 = 1 / 0), (f.y2 = -1 / 0); + for (var l = 0; l < f.length; l++) { + var u = f[l]; + (f.x1 = Math.min(f.x1, u.positionX - u.width / 2)), + (f.x2 = Math.max(f.x2, u.positionX + u.width / 2)), + (f.y1 = Math.min(f.y1, u.positionY - u.height / 2)), + (f.y2 = Math.max(f.y2, u.positionY + u.height / 2)); + } + (f.w = f.x2 - f.x1), (f.h = f.y2 - f.y1), (s += f.w * f.h); + } + r.sort(function (e, t) { + return t.w * t.h - e.w * e.h; + }); + var c = 0, + h = 0, + d = 0, + p = 0, + g = (Math.sqrt(s) * e.clientWidth) / e.clientHeight; + for (i = 0; i < r.length; i++) { + var f; + if ((f = r[i])) { + for (l = 0; l < f.length; l++) (u = f[l]).isLocked || ((u.positionX += c - f.x1), (u.positionY += h - f.y1)); + (c += f.w + t.componentSpacing), + (d += f.w + t.componentSpacing), + (p = Math.max(p, f.h)), + d > g && ((h += p + t.componentSpacing), (c = 0), (d = 0), (p = 0)); + } + } + }, + Nl = { + fit: !0, + padding: 30, + boundingBox: void 0, + avoidOverlap: !0, + avoidOverlapPadding: 10, + nodeDimensionsIncludeLabels: !1, + spacingFactor: void 0, + condense: !1, + rows: void 0, + cols: void 0, + position: function (e) {}, + sort: void 0, + animate: !1, + animationDuration: 500, + animationEasing: void 0, + animateFilter: function (e, t) { + return !0; + }, + ready: void 0, + stop: void 0, + transform: function (e, t) { + return t; + }, + }; + function Al(e) { + this.options = z({}, Nl, e); + } + Al.prototype.run = function () { + var e = this.options, + t = e, + n = e.cy, + r = t.eles, + i = r.nodes().not(":parent"); + t.sort && (i = i.sort(t.sort)); + var a = Ot(t.boundingBox ? t.boundingBox : { x1: 0, y1: 0, w: n.width(), h: n.height() }); + if (0 === a.h || 0 === a.w) + r.nodes().layoutPositions(this, t, function (e) { + return { x: a.x1, y: a.y1 }; + }); + else { + var o = i.size(), + s = Math.sqrt((o * a.h) / a.w), + l = Math.round(s), + u = Math.round((a.w / a.h) * s), + c = function (e) { + if (null == e) return Math.min(l, u); + Math.min(l, u) == l ? (l = e) : (u = e); + }, + h = function (e) { + if (null == e) return Math.max(l, u); + Math.max(l, u) == l ? (l = e) : (u = e); + }, + d = t.rows, + p = null != t.cols ? t.cols : t.columns; + if (null != d && null != p) (l = d), (u = p); + else if (null != d && null == p) (l = d), (u = Math.ceil(o / l)); + else if (null == d && null != p) (u = p), (l = Math.ceil(o / u)); + else if (u * l > o) { + var g = c(), + f = h(); + (g - 1) * f >= o ? c(g - 1) : (f - 1) * g >= o && h(f - 1); + } else + for (; u * l < o; ) { + var v = c(), + y = h(); + (y + 1) * v >= o ? h(y + 1) : c(v + 1); + } + var m = a.w / u, + b = a.h / l; + if ((t.condense && ((m = 0), (b = 0)), t.avoidOverlap)) + for (var x = 0; x < i.length; x++) { + var w = i[x], + E = w._private.position; + (null != E.x && null != E.y) || ((E.x = 0), (E.y = 0)); + var _ = w.layoutDimensions(t), + T = t.avoidOverlapPadding, + D = _.w + T, + C = _.h + T; + (m = Math.max(m, D)), (b = Math.max(b, C)); + } + for ( + var N = {}, + A = function (e, t) { + return !!N["c-" + e + "-" + t]; + }, + L = function (e, t) { + N["c-" + e + "-" + t] = !0; + }, + k = 0, + S = 0, + I = function () { + ++S >= u && ((S = 0), k++); + }, + M = {}, + O = 0; + O < i.length; + O++ + ) { + var P = i[O], + R = t.position(P); + if (R && (void 0 !== R.row || void 0 !== R.col)) { + var B = { row: R.row, col: R.col }; + if (void 0 === B.col) for (B.col = 0; A(B.row, B.col); ) B.col++; + else if (void 0 === B.row) for (B.row = 0; A(B.row, B.col); ) B.row++; + (M[P.id()] = B), L(B.row, B.col); + } + } + i.layoutPositions(this, t, function (e, t) { + var n, r; + if (e.locked() || e.isParent()) return !1; + var i = M[e.id()]; + if (i) (n = i.col * m + m / 2 + a.x1), (r = i.row * b + b / 2 + a.y1); + else { + for (; A(k, S); ) I(); + (n = S * m + m / 2 + a.x1), (r = k * b + b / 2 + a.y1), L(k, S), I(); + } + return { x: n, y: r }; + }); + } + return this; + }; + var Ll = { ready: function () {}, stop: function () {} }; + function kl(e) { + this.options = z({}, Ll, e); + } + (kl.prototype.run = function () { + var e = this.options, + t = e.eles, + n = this; + return ( + e.cy, + n.emit("layoutstart"), + t.nodes().positions(function () { + return { x: 0, y: 0 }; + }), + n.one("layoutready", e.ready), + n.emit("layoutready"), + n.one("layoutstop", e.stop), + n.emit("layoutstop"), + this + ); + }), + (kl.prototype.stop = function () { + return this; + }); + var Sl = { + positions: void 0, + zoom: void 0, + pan: void 0, + fit: !0, + padding: 30, + animate: !1, + animationDuration: 500, + animationEasing: void 0, + animateFilter: function (e, t) { + return !0; + }, + ready: void 0, + stop: void 0, + transform: function (e, t) { + return t; + }, + }; + function Il(e) { + this.options = z({}, Sl, e); + } + Il.prototype.run = function () { + var e = this.options, + t = e.eles.nodes(), + n = v(e.positions); + return ( + t.layoutPositions(this, e, function (t, r) { + var i = (function (t) { + if (null == e.positions) + return (function (e) { + return { x: e.x, y: e.y }; + })(t.position()); + if (n) return e.positions(t); + var r = e.positions[t._private.data.id]; + return null == r ? null : r; + })(t); + return !t.locked() && null != i && i; + }), + this + ); + }; + var Ml = { + fit: !0, + padding: 30, + boundingBox: void 0, + animate: !1, + animationDuration: 500, + animationEasing: void 0, + animateFilter: function (e, t) { + return !0; + }, + ready: void 0, + stop: void 0, + transform: function (e, t) { + return t; + }, + }; + function Ol(e) { + this.options = z({}, Ml, e); + } + Ol.prototype.run = function () { + var e = this.options, + t = e.cy, + n = e.eles, + r = Ot(e.boundingBox ? e.boundingBox : { x1: 0, y1: 0, w: t.width(), h: t.height() }); + return ( + n.nodes().layoutPositions(this, e, function (e, t) { + return { + x: r.x1 + Math.round(Math.random() * r.w), + y: r.y1 + Math.round(Math.random() * r.h), + }; + }), + this + ); + }; + var Pl = [ + { name: "breadthfirst", impl: el }, + { name: "circle", impl: nl }, + { name: "concentric", impl: al }, + { name: "cose", impl: sl }, + { name: "grid", impl: Al }, + { name: "null", impl: kl }, + { name: "preset", impl: Il }, + { name: "random", impl: Ol }, + ]; + function Rl(e) { + (this.options = e), (this.notifications = 0); + } + var Bl = function () {}, + Fl = function () { + throw new Error("A headless instance can not render images"); + }; + Rl.prototype = { + recalculateRenderedStyle: Bl, + notify: function () { + this.notifications++; + }, + init: Bl, + isHeadless: function () { + return !0; + }, + png: Fl, + jpg: Fl, + }; + var zl = { + arrowShapeWidth: 0.3, + registerArrowShapes: function () { + var e = (this.arrowShapes = {}), + t = this, + n = function (e, t, n, r, i, a, o) { + var s = i.x - n / 2 - o, + l = i.x + n / 2 + o, + u = i.y - n / 2 - o, + c = i.y + n / 2 + o; + return s <= e && e <= l && u <= t && t <= c; + }, + r = function (e, t, n, r, i) { + var a = e * Math.cos(r) - t * Math.sin(r), + o = (e * Math.sin(r) + t * Math.cos(r)) * n; + return { x: a * n + i.x, y: o + i.y }; + }, + i = function (e, t, n, i) { + for (var a = [], o = 0; o < e.length; o += 2) { + var s = e[o], + l = e[o + 1]; + a.push(r(s, l, t, n, i)); + } + return a; + }, + a = function (e) { + for (var t = [], n = 0; n < e.length; n++) { + var r = e[n]; + t.push(r.x, r.y); + } + return t; + }, + o = function (e) { + return e.pstyle("width").pfValue * e.pstyle("arrow-scale").pfValue * 2; + }, + s = function (r, s) { + f(s) && (s = e[s]), + (e[r] = z( + { + name: r, + points: [-0.15, -0.3, 0.15, -0.3, 0.15, 0.3, -0.15, 0.3], + collide: function (e, t, n, r, o, s) { + var l = a(i(this.points, n + 2 * s, r, o)); + return Ht(e, t, l); + }, + roughCollide: n, + draw: function (e, n, r, a) { + var o = i(this.points, n, r, a); + t.arrowShapeImpl("polygon")(e, o); + }, + spacing: function (e) { + return 0; + }, + gap: o, + }, + s, + )); + }; + s("none", { collide: Ge, roughCollide: Ge, draw: Xe, spacing: Ye, gap: Ye }), + s("triangle", { points: [-0.15, -0.3, 0, 0, 0.15, -0.3] }), + s("arrow", "triangle"), + s("triangle-backcurve", { + points: e.triangle.points, + controlPoint: [0, -0.15], + roughCollide: n, + draw: function (e, n, a, o, s) { + var l = i(this.points, n, a, o), + u = this.controlPoint, + c = r(u[0], u[1], n, a, o); + t.arrowShapeImpl(this.name)(e, l, c); + }, + gap: function (e) { + return 0.8 * o(e); + }, + }), + s("triangle-tee", { + points: [0, 0, 0.15, -0.3, -0.15, -0.3, 0, 0], + pointsTee: [-0.15, -0.4, -0.15, -0.5, 0.15, -0.5, 0.15, -0.4], + collide: function (e, t, n, r, o, s, l) { + var u = a(i(this.points, n + 2 * l, r, o)), + c = a(i(this.pointsTee, n + 2 * l, r, o)); + return Ht(e, t, u) || Ht(e, t, c); + }, + draw: function (e, n, r, a, o) { + var s = i(this.points, n, r, a), + l = i(this.pointsTee, n, r, a); + t.arrowShapeImpl(this.name)(e, s, l); + }, + }), + s("circle-triangle", { + radius: 0.15, + pointsTr: [0, -0.15, 0.15, -0.45, -0.15, -0.45, 0, -0.15], + collide: function (e, t, n, r, o, s, l) { + var u = o, + c = Math.pow(u.x - e, 2) + Math.pow(u.y - t, 2) <= Math.pow((n + 2 * l) * this.radius, 2), + h = a(i(this.points, n + 2 * l, r, o)); + return Ht(e, t, h) || c; + }, + draw: function (e, n, r, a, o) { + var s = i(this.pointsTr, n, r, a); + t.arrowShapeImpl(this.name)(e, s, a.x, a.y, this.radius * n); + }, + spacing: function (e) { + return t.getArrowWidth(e.pstyle("width").pfValue, e.pstyle("arrow-scale").value) * this.radius; + }, + }), + s("triangle-cross", { + points: [0, 0, 0.15, -0.3, -0.15, -0.3, 0, 0], + baseCrossLinePts: [-0.15, -0.4, -0.15, -0.4, 0.15, -0.4, 0.15, -0.4], + crossLinePts: function (e, t) { + var n = this.baseCrossLinePts.slice(), + r = t / e; + return (n[3] = n[3] - r), (n[5] = n[5] - r), n; + }, + collide: function (e, t, n, r, o, s, l) { + var u = a(i(this.points, n + 2 * l, r, o)), + c = a(i(this.crossLinePts(n, s), n + 2 * l, r, o)); + return Ht(e, t, u) || Ht(e, t, c); + }, + draw: function (e, n, r, a, o) { + var s = i(this.points, n, r, a), + l = i(this.crossLinePts(n, o), n, r, a); + t.arrowShapeImpl(this.name)(e, s, l); + }, + }), + s("vee", { + points: [-0.15, -0.3, 0, 0, 0.15, -0.3, 0, -0.15], + gap: function (e) { + return 0.525 * o(e); + }, + }), + s("circle", { + radius: 0.15, + collide: function (e, t, n, r, i, a, o) { + var s = i; + return Math.pow(s.x - e, 2) + Math.pow(s.y - t, 2) <= Math.pow((n + 2 * o) * this.radius, 2); + }, + draw: function (e, n, r, i, a) { + t.arrowShapeImpl(this.name)(e, i.x, i.y, this.radius * n); + }, + spacing: function (e) { + return t.getArrowWidth(e.pstyle("width").pfValue, e.pstyle("arrow-scale").value) * this.radius; + }, + }), + s("tee", { + points: [-0.15, 0, -0.15, -0.1, 0.15, -0.1, 0.15, 0], + spacing: function (e) { + return 1; + }, + gap: function (e) { + return 1; + }, + }), + s("square", { points: [-0.15, 0, 0.15, 0, 0.15, -0.3, -0.15, -0.3] }), + s("diamond", { + points: [-0.15, -0.15, 0, -0.3, 0.15, -0.15, 0, 0], + gap: function (e) { + return e.pstyle("width").pfValue * e.pstyle("arrow-scale").value; + }, + }), + s("chevron", { + points: [0, 0, -0.15, -0.15, -0.1, -0.2, 0, -0.1, 0.1, -0.2, 0.15, -0.15], + gap: function (e) { + return 0.95 * e.pstyle("width").pfValue * e.pstyle("arrow-scale").value; + }, + }); + }, + }, + Gl = { + projectIntoViewport: function (e, t) { + var n = this.cy, + r = this.findContainerClientCoords(), + i = r[0], + a = r[1], + o = r[4], + s = n.pan(), + l = n.zoom(); + return [((e - i) / o - s.x) / l, ((t - a) / o - s.y) / l]; + }, + findContainerClientCoords: function () { + if (this.containerBB) return this.containerBB; + var e = this.container, + t = e.getBoundingClientRect(), + n = this.cy.window().getComputedStyle(e), + r = function (e) { + return parseFloat(n.getPropertyValue(e)); + }, + i = r("padding-left"), + a = r("padding-right"), + o = r("padding-top"), + s = r("padding-bottom"), + l = r("border-left-width"), + u = r("border-right-width"), + c = r("border-top-width"), + h = (r("border-bottom-width"), e.clientWidth), + d = e.clientHeight, + p = i + a, + g = o + s, + f = l + u, + v = t.width / (h + f), + y = h - p, + m = d - g, + b = t.left + i + l, + x = t.top + o + c; + return (this.containerBB = [b, x, y, m, v]); + }, + invalidateContainerClientCoordsCache: function () { + this.containerBB = null; + }, + findNearestElement: function (e, t, n, r) { + return this.findNearestElements(e, t, n, r)[0]; + }, + findNearestElements: function (e, t, n, r) { + var i, + a, + o = this, + s = this, + l = s.getCachedZSortedEles(), + u = [], + c = s.cy.zoom(), + h = s.cy.hasCompoundNodes(), + d = (r ? 24 : 8) / c, + p = (r ? 8 : 2) / c, + g = (r ? 8 : 2) / c, + f = 1 / 0; + function v(e, t) { + if (e.isNode()) { + if (a) return; + (a = e), u.push(e); + } + if (e.isEdge() && (null == t || t < f)) + if (i) { + if ( + i.pstyle("z-compound-depth").value === e.pstyle("z-compound-depth").value && + i.pstyle("z-compound-depth").value === e.pstyle("z-compound-depth").value + ) + for (var n = 0; n < u.length; n++) + if (u[n].isEdge()) { + (u[n] = e), (i = e), (f = null != t ? t : f); + break; + } + } else u.push(e), (i = e), (f = null != t ? t : f); + } + function y(n) { + var r = n.outerWidth() + 2 * p, + i = n.outerHeight() + 2 * p, + a = r / 2, + l = i / 2, + u = n.position(); + if ( + u.x - a <= e && + e <= u.x + a && + u.y - l <= t && + t <= u.y + l && + s.nodeShapes[o.getNodeShape(n)].checkPoint(e, t, 0, r, i, u.x, u.y) + ) + return v(n, 0), !0; + } + function m(n) { + var r, + i = n._private, + a = i.rscratch, + l = n.pstyle("width").pfValue, + c = n.pstyle("arrow-scale").value, + p = l / 2 + d, + g = p * p, + f = 2 * p, + m = i.source, + b = i.target; + if ("segments" === a.edgeType || "straight" === a.edgeType || "haystack" === a.edgeType) { + for (var x = a.allpts, w = 0; w + 3 < x.length; w += 2) + if (Vt(e, t, x[w], x[w + 1], x[w + 2], x[w + 3], f) && g > (r = qt(e, t, x[w], x[w + 1], x[w + 2], x[w + 3]))) return v(n, r), !0; + } else if ("bezier" === a.edgeType || "multibezier" === a.edgeType || "self" === a.edgeType || "compound" === a.edgeType) + for (x = a.allpts, w = 0; w + 5 < a.allpts.length; w += 4) + if ( + Ut(e, t, x[w], x[w + 1], x[w + 2], x[w + 3], x[w + 4], x[w + 5], f) && + g > (r = jt(e, t, x[w], x[w + 1], x[w + 2], x[w + 3], x[w + 4], x[w + 5])) + ) + return v(n, r), !0; + (m = m || i.source), (b = b || i.target); + var E = o.getArrowWidth(l, c), + _ = [ + { name: "source", x: a.arrowStartX, y: a.arrowStartY, angle: a.srcArrowAngle }, + { name: "target", x: a.arrowEndX, y: a.arrowEndY, angle: a.tgtArrowAngle }, + { name: "mid-source", x: a.midX, y: a.midY, angle: a.midsrcArrowAngle }, + { name: "mid-target", x: a.midX, y: a.midY, angle: a.midtgtArrowAngle }, + ]; + for (w = 0; w < _.length; w++) { + var T = _[w], + D = s.arrowShapes[n.pstyle(T.name + "-arrow-shape").value], + C = n.pstyle("width").pfValue; + if (D.roughCollide(e, t, E, T.angle, { x: T.x, y: T.y }, C, d) && D.collide(e, t, E, T.angle, { x: T.x, y: T.y }, C, d)) + return v(n), !0; + } + h && u.length > 0 && (y(m), y(b)); + } + function b(e, t, n) { + return Je(e, t, n); + } + function x(n, r) { + var i, + a = n._private, + o = g; + (i = r ? r + "-" : ""), n.boundingBox(); + var s = a.labelBounds[r || "main"], + l = n.pstyle(i + "label").value; + if ("yes" === n.pstyle("text-events").strValue && l) { + var u = b(a.rscratch, "labelX", r), + c = b(a.rscratch, "labelY", r), + h = b(a.rscratch, "labelAngle", r), + d = n.pstyle(i + "text-margin-x").pfValue, + p = n.pstyle(i + "text-margin-y").pfValue, + f = s.x1 - o - d, + y = s.x2 + o - d, + m = s.y1 - o - p, + x = s.y2 + o - p; + if (h) { + var w = Math.cos(h), + E = Math.sin(h), + _ = function (e, t) { + return { x: (e -= u) * w - (t -= c) * E + u, y: e * E + t * w + c }; + }, + T = _(f, m), + D = _(f, x), + C = _(y, m), + N = _(y, x), + A = [T.x + d, T.y + p, C.x + d, C.y + p, N.x + d, N.y + p, D.x + d, D.y + p]; + if (Ht(e, t, A)) return v(n), !0; + } else if (Gt(s, e, t)) return v(n), !0; + } + } + n && (l = l.interactive); + for (var w = l.length - 1; w >= 0; w--) { + var E = l[w]; + E.isNode() ? y(E) || x(E) : m(E) || x(E) || x(E, "source") || x(E, "target"); + } + return u; + }, + getAllInBox: function (e, t, n, r) { + for ( + var i = this.getCachedZSortedEles().interactive, + a = [], + o = Math.min(e, n), + s = Math.max(e, n), + l = Math.min(t, r), + u = Math.max(t, r), + c = Ot({ x1: (e = o), y1: (t = l), x2: (n = s), y2: (r = u) }), + h = 0; + h < i.length; + h++ + ) { + var d = i[h]; + if (d.isNode()) { + var p = d, + g = p.boundingBox({ includeNodes: !0, includeEdges: !1, includeLabels: !1 }); + zt(c, g) && !Yt(g, c) && a.push(p); + } else { + var f = d, + v = f._private, + y = v.rscratch; + if (null != y.startX && null != y.startY && !Gt(c, y.startX, y.startY)) continue; + if (null != y.endX && null != y.endY && !Gt(c, y.endX, y.endY)) continue; + if ( + "bezier" === y.edgeType || + "multibezier" === y.edgeType || + "self" === y.edgeType || + "compound" === y.edgeType || + "segments" === y.edgeType || + "haystack" === y.edgeType + ) { + for (var m = v.rstyle.bezierPts || v.rstyle.linePts || v.rstyle.haystackPts, b = !0, x = 0; x < m.length; x++) + if (((w = c), (E = m[x]), !Gt(w, E.x, E.y))) { + b = !1; + break; + } + b && a.push(f); + } else ("haystack" !== y.edgeType && "straight" !== y.edgeType) || a.push(f); + } + } + var w, E; + return a; + }, + }, + Yl = { + calculateArrowAngles: function (e) { + var t, + n, + r, + i, + a, + o, + s = e._private.rscratch, + l = "haystack" === s.edgeType, + u = "bezier" === s.edgeType, + c = "multibezier" === s.edgeType, + h = "segments" === s.edgeType, + d = "compound" === s.edgeType, + p = "self" === s.edgeType; + if ( + (l + ? ((r = s.haystackPts[0]), (i = s.haystackPts[1]), (a = s.haystackPts[2]), (o = s.haystackPts[3])) + : ((r = s.arrowStartX), (i = s.arrowStartY), (a = s.arrowEndX), (o = s.arrowEndY)), + (f = s.midX), + (v = s.midY), + h) + ) + (t = r - s.segpts[0]), (n = i - s.segpts[1]); + else if (c || d || p || u) { + var g = s.allpts; + (t = r - St(g[0], g[2], g[4], 0.1)), (n = i - St(g[1], g[3], g[5], 0.1)); + } else (t = r - f), (n = i - v); + s.srcArrowAngle = Dt(t, n); + var f = s.midX, + v = s.midY; + if ((l && ((f = (r + a) / 2), (v = (i + o) / 2)), (t = a - r), (n = o - i), h)) + if (((g = s.allpts).length / 2) % 2 == 0) { + var y = (m = g.length / 2) - 2; + (t = g[m] - g[y]), (n = g[m + 1] - g[y + 1]); + } else { + y = (m = g.length / 2 - 1) - 2; + var m, + b = m + 2; + (t = g[m] - g[y]), (n = g[m + 1] - g[y + 1]); + } + else if (c || d || p) { + var x, w, E, _; + g = s.allpts; + if ((s.ctrlpts.length / 2) % 2 == 0) { + var T = 2 + (D = 2 + (C = g.length / 2 - 1)); + (x = St(g[C], g[D], g[T], 0)), + (w = St(g[C + 1], g[D + 1], g[T + 1], 0)), + (E = St(g[C], g[D], g[T], 1e-4)), + (_ = St(g[C + 1], g[D + 1], g[T + 1], 1e-4)); + } else { + var D, C; + (T = 2 + (D = g.length / 2 - 1)), + (x = St(g[(C = D - 2)], g[D], g[T], 0.4999)), + (w = St(g[C + 1], g[D + 1], g[T + 1], 0.4999)), + (E = St(g[C], g[D], g[T], 0.5)), + (_ = St(g[C + 1], g[D + 1], g[T + 1], 0.5)); + } + (t = E - x), (n = _ - w); + } + if ( + ((s.midtgtArrowAngle = Dt(t, n)), + (s.midDispX = t), + (s.midDispY = n), + (t *= -1), + (n *= -1), + h && (((g = s.allpts).length / 2) % 2 == 0 || ((t = -(g[(b = 2 + (m = g.length / 2 - 1))] - g[m])), (n = -(g[b + 1] - g[m + 1])))), + (s.midsrcArrowAngle = Dt(t, n)), + h) + ) + (t = a - s.segpts[s.segpts.length - 2]), (n = o - s.segpts[s.segpts.length - 1]); + else if (c || d || p || u) { + var N = (g = s.allpts).length; + (t = a - St(g[N - 6], g[N - 4], g[N - 2], 0.9)), (n = o - St(g[N - 5], g[N - 3], g[N - 1], 0.9)); + } else (t = a - f), (n = o - v); + s.tgtArrowAngle = Dt(t, n); + }, + }; + Yl.getArrowWidth = Yl.getArrowHeight = function (e, t) { + var n = (this.arrowWidthCache = this.arrowWidthCache || {}), + r = n[e + ", " + t]; + return r || ((r = Math.max(Math.pow(13.37 * e, 0.9), 29) * t), (n[e + ", " + t] = r), r); + }; + var Xl = {}; + function Vl(e) { + var t = []; + if (null != e) { + for (var n = 0; n < e.length; n += 2) { + var r = e[n], + i = e[n + 1]; + t.push({ x: r, y: i }); + } + return t; + } + } + (Xl.findHaystackPoints = function (e) { + for (var t = 0; t < e.length; t++) { + var n = e[t], + r = n._private, + i = r.rscratch; + if (!i.haystack) { + var a = 2 * Math.random() * Math.PI; + (i.source = { x: Math.cos(a), y: Math.sin(a) }), (a = 2 * Math.random() * Math.PI), (i.target = { x: Math.cos(a), y: Math.sin(a) }); + } + var o = r.source, + s = r.target, + l = o.position(), + u = s.position(), + c = o.width(), + h = s.width(), + d = o.height(), + p = s.height(), + g = n.pstyle("haystack-radius").value / 2; + (i.haystackPts = i.allpts = [i.source.x * c * g + l.x, i.source.y * d * g + l.y, i.target.x * h * g + u.x, i.target.y * p * g + u.y]), + (i.midX = (i.allpts[0] + i.allpts[2]) / 2), + (i.midY = (i.allpts[1] + i.allpts[3]) / 2), + (i.edgeType = "haystack"), + (i.haystack = !0), + this.storeEdgeProjections(n), + this.calculateArrowAngles(n), + this.recalculateEdgeLabelProjections(n), + this.calculateLabelAngles(n); + } + }), + (Xl.findSegmentsPoints = function (e, t) { + var n = e._private.rscratch, + r = t.posPts, + i = t.intersectionPts, + a = t.vectorNormInverse, + o = e.pstyle("edge-distances").value, + s = e.pstyle("segment-weights"), + l = e.pstyle("segment-distances"), + u = Math.min(s.pfValue.length, l.pfValue.length); + (n.edgeType = "segments"), (n.segpts = []); + for (var c = 0; c < u; c++) { + var h = s.pfValue[c], + d = l.pfValue[c], + p = 1 - h, + g = h, + f = "node-position" === o ? r : i, + v = { x: f.x1 * p + f.x2 * g, y: f.y1 * p + f.y2 * g }; + n.segpts.push(v.x + a.x * d, v.y + a.y * d); + } + }), + (Xl.findLoopPoints = function (e, t, n, r) { + var i = e._private.rscratch, + a = t.dirCounts, + o = t.srcPos, + s = e.pstyle("control-point-distances"), + l = s ? s.pfValue[0] : void 0, + u = e.pstyle("loop-direction").pfValue, + c = e.pstyle("loop-sweep").pfValue, + h = e.pstyle("control-point-step-size").pfValue; + i.edgeType = "self"; + var d = n, + p = h; + r && ((d = 0), (p = l)); + var g = u - Math.PI / 2, + f = g - c / 2, + v = g + c / 2, + y = String(u + "_" + c); + (d = void 0 === a[y] ? (a[y] = 0) : ++a[y]), + (i.ctrlpts = [ + o.x + 1.4 * Math.cos(f) * p * (d / 3 + 1), + o.y + 1.4 * Math.sin(f) * p * (d / 3 + 1), + o.x + 1.4 * Math.cos(v) * p * (d / 3 + 1), + o.y + 1.4 * Math.sin(v) * p * (d / 3 + 1), + ]); + }), + (Xl.findCompoundLoopPoints = function (e, t, n, r) { + var i = e._private.rscratch; + i.edgeType = "compound"; + var a = t.srcPos, + o = t.tgtPos, + s = t.srcW, + l = t.srcH, + u = t.tgtW, + c = t.tgtH, + h = e.pstyle("control-point-step-size").pfValue, + d = e.pstyle("control-point-distances"), + p = d ? d.pfValue[0] : void 0, + g = n, + f = h; + r && ((g = 0), (f = p)); + var v = { x: a.x - s / 2, y: a.y - l / 2 }, + y = { x: o.x - u / 2, y: o.y - c / 2 }, + m = { x: Math.min(v.x, y.x), y: Math.min(v.y, y.y) }, + b = Math.max(0.5, Math.log(0.01 * s)), + x = Math.max(0.5, Math.log(0.01 * u)); + i.ctrlpts = [ + m.x, + m.y - (1 + Math.pow(50, 1.12) / 100) * f * (g / 3 + 1) * b, + m.x - (1 + Math.pow(50, 1.12) / 100) * f * (g / 3 + 1) * x, + m.y, + ]; + }), + (Xl.findStraightEdgePoints = function (e) { + e._private.rscratch.edgeType = "straight"; + }), + (Xl.findBezierPoints = function (e, t, n, r, i) { + var a = e._private.rscratch, + o = t.vectorNormInverse, + s = t.posPts, + l = t.intersectionPts, + u = e.pstyle("edge-distances").value, + c = e.pstyle("control-point-step-size").pfValue, + h = e.pstyle("control-point-distances"), + d = e.pstyle("control-point-weights"), + p = h && d ? Math.min(h.value.length, d.value.length) : 1, + g = h ? h.pfValue[0] : void 0, + f = d.value[0], + v = r; + (a.edgeType = v ? "multibezier" : "bezier"), (a.ctrlpts = []); + for (var y = 0; y < p; y++) { + var m, + b = (0.5 - t.eles.length / 2 + n) * c * (i ? -1 : 1), + x = Nt(b); + v && ((g = h ? h.pfValue[y] : c), (f = d.value[y])); + var w = void 0 !== (m = r ? g : void 0 !== g ? x * g : void 0) ? m : b, + E = 1 - f, + _ = f, + T = "node-position" === u ? s : l, + D = { x: T.x1 * E + T.x2 * _, y: T.y1 * E + T.y2 * _ }; + a.ctrlpts.push(D.x + o.x * w, D.y + o.y * w); + } + }), + (Xl.findTaxiPoints = function (e, t) { + var n = e._private.rscratch; + n.edgeType = "segments"; + var r = "vertical", + i = "horizontal", + a = "leftward", + o = "rightward", + s = "downward", + l = "upward", + u = t.posPts, + c = t.srcW, + h = t.srcH, + d = t.tgtW, + p = t.tgtH, + g = "node-position" !== e.pstyle("edge-distances").value, + f = e.pstyle("taxi-direction").value, + v = f, + y = e.pstyle("taxi-turn"), + m = "%" === y.units, + b = y.pfValue, + x = b < 0, + w = e.pstyle("taxi-turn-min-distance").pfValue, + E = g ? (c + d) / 2 : 0, + _ = g ? (h + p) / 2 : 0, + T = u.x2 - u.x1, + D = u.y2 - u.y1, + C = function (e, t) { + return e > 0 ? Math.max(e - t, 0) : Math.min(e + t, 0); + }, + N = C(T, E), + A = C(D, _), + L = !1; + "auto" === v + ? (f = Math.abs(N) > Math.abs(A) ? i : r) + : v === l || v === s + ? ((f = r), (L = !0)) + : (v !== a && v !== o) || ((f = i), (L = !0)); + var k, + S = f === r, + I = S ? A : N, + M = S ? D : T, + O = Nt(M), + P = !1; + (L && (m || x)) || + !((v === s && M < 0) || (v === l && M > 0) || (v === a && M > 0) || (v === o && M < 0)) || + ((I = (O *= -1) * Math.abs(I)), (P = !0)); + var R = function (e) { + return Math.abs(e) < w || Math.abs(e) >= Math.abs(I); + }, + B = R((k = m ? (b < 0 ? 1 + b : b) * I : (b < 0 ? I : 0) + b * O)), + F = R(Math.abs(I) - Math.abs(k)); + if ((!B && !F) || P) + if (S) { + var z = u.y1 + k + (g ? (h / 2) * O : 0), + G = u.x1, + Y = u.x2; + n.segpts = [G, z, Y, z]; + } else { + var X = u.x1 + k + (g ? (c / 2) * O : 0), + V = u.y1, + U = u.y2; + n.segpts = [X, V, X, U]; + } + else if (S) { + var j = Math.abs(M) <= h / 2, + q = Math.abs(T) <= d / 2; + if (j) { + var H = (u.x1 + u.x2) / 2, + W = u.y1, + $ = u.y2; + n.segpts = [H, W, H, $]; + } else if (q) { + var K = (u.y1 + u.y2) / 2, + Z = u.x1, + Q = u.x2; + n.segpts = [Z, K, Q, K]; + } else n.segpts = [u.x1, u.y2]; + } else { + var J = Math.abs(M) <= c / 2, + ee = Math.abs(D) <= p / 2; + if (J) { + var te = (u.y1 + u.y2) / 2, + ne = u.x1, + re = u.x2; + n.segpts = [ne, te, re, te]; + } else if (ee) { + var ie = (u.x1 + u.x2) / 2, + ae = u.y1, + oe = u.y2; + n.segpts = [ie, ae, ie, oe]; + } else n.segpts = [u.x2, u.y1]; + } + }), + (Xl.tryToCorrectInvalidPoints = function (e, t) { + var n = e._private.rscratch; + if ("bezier" === n.edgeType) { + var r = t.srcPos, + i = t.tgtPos, + a = t.srcW, + o = t.srcH, + s = t.tgtW, + l = t.tgtH, + u = t.srcShape, + c = t.tgtShape, + h = !b(n.startX) || !b(n.startY), + d = !b(n.arrowStartX) || !b(n.arrowStartY), + p = !b(n.endX) || !b(n.endY), + g = !b(n.arrowEndX) || !b(n.arrowEndY), + f = this.getArrowWidth(e.pstyle("width").pfValue, e.pstyle("arrow-scale").value) * this.arrowShapeWidth * 3, + v = At({ x: n.ctrlpts[0], y: n.ctrlpts[1] }, { x: n.startX, y: n.startY }), + y = v < f, + m = At({ x: n.ctrlpts[0], y: n.ctrlpts[1] }, { x: n.endX, y: n.endY }), + x = m < f, + w = !1; + if (h || d || y) { + w = !0; + var E = { x: n.ctrlpts[0] - r.x, y: n.ctrlpts[1] - r.y }, + _ = Math.sqrt(E.x * E.x + E.y * E.y), + T = { x: E.x / _, y: E.y / _ }, + D = Math.max(a, o), + C = { x: n.ctrlpts[0] + 2 * T.x * D, y: n.ctrlpts[1] + 2 * T.y * D }, + N = u.intersectLine(r.x, r.y, a, o, C.x, C.y, 0); + y + ? ((n.ctrlpts[0] = n.ctrlpts[0] + T.x * (f - v)), (n.ctrlpts[1] = n.ctrlpts[1] + T.y * (f - v))) + : ((n.ctrlpts[0] = N[0] + T.x * f), (n.ctrlpts[1] = N[1] + T.y * f)); + } + if (p || g || x) { + w = !0; + var A = { x: n.ctrlpts[0] - i.x, y: n.ctrlpts[1] - i.y }, + L = Math.sqrt(A.x * A.x + A.y * A.y), + k = { x: A.x / L, y: A.y / L }, + S = Math.max(a, o), + I = { x: n.ctrlpts[0] + 2 * k.x * S, y: n.ctrlpts[1] + 2 * k.y * S }, + M = c.intersectLine(i.x, i.y, s, l, I.x, I.y, 0); + x + ? ((n.ctrlpts[0] = n.ctrlpts[0] + k.x * (f - m)), (n.ctrlpts[1] = n.ctrlpts[1] + k.y * (f - m))) + : ((n.ctrlpts[0] = M[0] + k.x * f), (n.ctrlpts[1] = M[1] + k.y * f)); + } + w && this.findEndpoints(e); + } + }), + (Xl.storeAllpts = function (e) { + var t = e._private.rscratch; + if ("multibezier" === t.edgeType || "bezier" === t.edgeType || "self" === t.edgeType || "compound" === t.edgeType) { + (t.allpts = []), t.allpts.push(t.startX, t.startY); + for (var n = 0; n + 1 < t.ctrlpts.length; n += 2) + t.allpts.push(t.ctrlpts[n], t.ctrlpts[n + 1]), + n + 3 < t.ctrlpts.length && t.allpts.push((t.ctrlpts[n] + t.ctrlpts[n + 2]) / 2, (t.ctrlpts[n + 1] + t.ctrlpts[n + 3]) / 2); + var r; + t.allpts.push(t.endX, t.endY), + (t.ctrlpts.length / 2) % 2 == 0 + ? ((r = t.allpts.length / 2 - 1), (t.midX = t.allpts[r]), (t.midY = t.allpts[r + 1])) + : ((r = t.allpts.length / 2 - 3), + 0.5, + (t.midX = St(t.allpts[r], t.allpts[r + 2], t.allpts[r + 4], 0.5)), + (t.midY = St(t.allpts[r + 1], t.allpts[r + 3], t.allpts[r + 5], 0.5))); + } else if ("straight" === t.edgeType) + (t.allpts = [t.startX, t.startY, t.endX, t.endY]), + (t.midX = (t.startX + t.endX + t.arrowStartX + t.arrowEndX) / 4), + (t.midY = (t.startY + t.endY + t.arrowStartY + t.arrowEndY) / 4); + else if ("segments" === t.edgeType) + if ( + ((t.allpts = []), + t.allpts.push(t.startX, t.startY), + t.allpts.push.apply(t.allpts, t.segpts), + t.allpts.push(t.endX, t.endY), + t.segpts.length % 4 == 0) + ) { + var i = t.segpts.length / 2, + a = i - 2; + (t.midX = (t.segpts[a] + t.segpts[i]) / 2), (t.midY = (t.segpts[a + 1] + t.segpts[i + 1]) / 2); + } else { + var o = t.segpts.length / 2 - 1; + (t.midX = t.segpts[o]), (t.midY = t.segpts[o + 1]); + } + }), + (Xl.checkForInvalidEdgeWarning = function (e) { + var t = e[0]._private.rscratch; + t.nodesOverlap || (b(t.startX) && b(t.startY) && b(t.endX) && b(t.endY)) + ? (t.loggedErr = !1) + : t.loggedErr || + ((t.loggedErr = !0), + je( + "Edge `" + + e.id() + + "` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap.", + )); + }), + (Xl.findEdgeControlPoints = function (e) { + var t = this; + if (e && 0 !== e.length) { + for ( + var n = this, + r = n.cy.hasCompoundNodes(), + i = { + map: new tt(), + get: function (e) { + var t = this.map.get(e[0]); + return null != t ? t.get(e[1]) : null; + }, + set: function (e, t) { + var n = this.map.get(e[0]); + null == n && ((n = new tt()), this.map.set(e[0], n)), n.set(e[1], t); + }, + }, + a = [], + o = [], + s = 0; + s < e.length; + s++ + ) { + var l = e[s], + u = l._private, + c = l.pstyle("curve-style").value; + if (!l.removed() && l.takesUpSpace()) + if ("haystack" !== c) { + var h = "unbundled-bezier" === c || "segments" === c || "straight" === c || "straight-triangle" === c || "taxi" === c, + d = "unbundled-bezier" === c || "bezier" === c, + p = u.source, + g = u.target, + f = [p.poolIndex(), g.poolIndex()].sort(), + v = i.get(f); + null == v && ((v = { eles: [] }), i.set(f, v), a.push(f)), v.eles.push(l), h && (v.hasUnbundled = !0), d && (v.hasBezier = !0); + } else o.push(l); + } + for ( + var y = function (e) { + var o = a[e], + s = i.get(o), + l = void 0; + if (!s.hasUnbundled) { + var u = s.eles[0].parallelEdges().filter(function (e) { + return e.isBundledBezier(); + }); + Qe(s.eles), + u.forEach(function (e) { + return s.eles.push(e); + }), + s.eles.sort(function (e, t) { + return e.poolIndex() - t.poolIndex(); + }); + } + var c = s.eles[0], + h = c.source(), + d = c.target(); + if (h.poolIndex() > d.poolIndex()) { + var p = h; + (h = d), (d = p); + } + var g = (s.srcPos = h.position()), + f = (s.tgtPos = d.position()), + v = (s.srcW = h.outerWidth()), + y = (s.srcH = h.outerHeight()), + m = (s.tgtW = d.outerWidth()), + x = (s.tgtH = d.outerHeight()), + w = (s.srcShape = n.nodeShapes[t.getNodeShape(h)]), + E = (s.tgtShape = n.nodeShapes[t.getNodeShape(d)]); + s.dirCounts = { + north: 0, + west: 0, + south: 0, + east: 0, + northwest: 0, + southwest: 0, + northeast: 0, + southeast: 0, + }; + for (var _ = 0; _ < s.eles.length; _++) { + var T = s.eles[_], + D = T[0]._private.rscratch, + C = T.pstyle("curve-style").value, + N = "unbundled-bezier" === C || "segments" === C || "taxi" === C, + A = !h.same(T.source()); + if (!s.calculatedIntersection && h !== d && (s.hasBezier || s.hasUnbundled)) { + s.calculatedIntersection = !0; + var L = w.intersectLine(g.x, g.y, v, y, f.x, f.y, 0), + k = (s.srcIntn = L), + S = E.intersectLine(f.x, f.y, m, x, g.x, g.y, 0), + I = (s.tgtIntn = S), + M = (s.intersectionPts = { x1: L[0], x2: S[0], y1: L[1], y2: S[1] }), + O = (s.posPts = { x1: g.x, x2: f.x, y1: g.y, y2: f.y }), + P = S[1] - L[1], + R = S[0] - L[0], + B = Math.sqrt(R * R + P * P), + F = (s.vector = { x: R, y: P }), + z = (s.vectorNorm = { x: F.x / B, y: F.y / B }), + G = { x: -z.y, y: z.x }; + (s.nodesOverlap = !b(B) || E.checkPoint(L[0], L[1], 0, m, x, f.x, f.y) || w.checkPoint(S[0], S[1], 0, v, y, g.x, g.y)), + (s.vectorNormInverse = G), + (l = { + nodesOverlap: s.nodesOverlap, + dirCounts: s.dirCounts, + calculatedIntersection: !0, + hasBezier: s.hasBezier, + hasUnbundled: s.hasUnbundled, + eles: s.eles, + srcPos: f, + tgtPos: g, + srcW: m, + srcH: x, + tgtW: v, + tgtH: y, + srcIntn: I, + tgtIntn: k, + srcShape: E, + tgtShape: w, + posPts: { x1: O.x2, y1: O.y2, x2: O.x1, y2: O.y1 }, + intersectionPts: { x1: M.x2, y1: M.y2, x2: M.x1, y2: M.y1 }, + vector: { x: -F.x, y: -F.y }, + vectorNorm: { x: -z.x, y: -z.y }, + vectorNormInverse: { x: -G.x, y: -G.y }, + }); + } + var Y = A ? l : s; + (D.nodesOverlap = Y.nodesOverlap), + (D.srcIntn = Y.srcIntn), + (D.tgtIntn = Y.tgtIntn), + r && + (h.isParent() || h.isChild() || d.isParent() || d.isChild()) && + (h.parents().anySame(d) || d.parents().anySame(h) || (h.same(d) && h.isParent())) + ? t.findCompoundLoopPoints(T, Y, _, N) + : h === d + ? t.findLoopPoints(T, Y, _, N) + : "segments" === C + ? t.findSegmentsPoints(T, Y) + : "taxi" === C + ? t.findTaxiPoints(T, Y) + : "straight" === C || (!N && s.eles.length % 2 == 1 && _ === Math.floor(s.eles.length / 2)) + ? t.findStraightEdgePoints(T) + : t.findBezierPoints(T, Y, _, N, A), + t.findEndpoints(T), + t.tryToCorrectInvalidPoints(T, Y), + t.checkForInvalidEdgeWarning(T), + t.storeAllpts(T), + t.storeEdgeProjections(T), + t.calculateArrowAngles(T), + t.recalculateEdgeLabelProjections(T), + t.calculateLabelAngles(T); + } + }, + m = 0; + m < a.length; + m++ + ) + y(m); + this.findHaystackPoints(o); + } + }), + (Xl.getSegmentPoints = function (e) { + var t = e[0]._private.rscratch; + if ("segments" === t.edgeType) return this.recalculateRenderedStyle(e), Vl(t.segpts); + }), + (Xl.getControlPoints = function (e) { + var t = e[0]._private.rscratch, + n = t.edgeType; + if ("bezier" === n || "multibezier" === n || "self" === n || "compound" === n) return this.recalculateRenderedStyle(e), Vl(t.ctrlpts); + }), + (Xl.getEdgeMidpoint = function (e) { + var t = e[0]._private.rscratch; + return this.recalculateRenderedStyle(e), { x: t.midX, y: t.midY }; + }); + var Ul = { + manualEndptToPx: function (e, t) { + var n = e.position(), + r = e.outerWidth(), + i = e.outerHeight(); + if (2 === t.value.length) { + var a = [t.pfValue[0], t.pfValue[1]]; + return "%" === t.units[0] && (a[0] = a[0] * r), "%" === t.units[1] && (a[1] = a[1] * i), (a[0] += n.x), (a[1] += n.y), a; + } + var o = t.pfValue[0]; + o = -Math.PI / 2 + o; + var s = 2 * Math.max(r, i), + l = [n.x + Math.cos(o) * s, n.y + Math.sin(o) * s]; + return this.nodeShapes[this.getNodeShape(e)].intersectLine(n.x, n.y, r, i, l[0], l[1], 0); + }, + findEndpoints: function (e) { + var t, + n, + r, + i, + a, + o = this, + s = e.source()[0], + l = e.target()[0], + u = s.position(), + c = l.position(), + h = e.pstyle("target-arrow-shape").value, + d = e.pstyle("source-arrow-shape").value, + p = e.pstyle("target-distance-from-node").pfValue, + g = e.pstyle("source-distance-from-node").pfValue, + f = e.pstyle("curve-style").value, + v = e._private.rscratch, + y = v.edgeType, + m = "self" === y || "compound" === y, + x = "bezier" === y || "multibezier" === y || m, + w = "bezier" !== y, + E = "straight" === y || "segments" === y, + _ = "segments" === y, + T = x || w || E, + D = m || "taxi" === f, + C = e.pstyle("source-endpoint"), + N = D ? "outside-to-node" : C.value, + A = e.pstyle("target-endpoint"), + L = D ? "outside-to-node" : A.value; + if (((v.srcManEndpt = C), (v.tgtManEndpt = A), x)) { + var k = [v.ctrlpts[0], v.ctrlpts[1]]; + (n = w ? [v.ctrlpts[v.ctrlpts.length - 2], v.ctrlpts[v.ctrlpts.length - 1]] : k), (r = k); + } else if (E) { + var S = _ ? v.segpts.slice(0, 2) : [c.x, c.y]; + (n = _ ? v.segpts.slice(v.segpts.length - 2) : [u.x, u.y]), (r = S); + } + if ("inside-to-node" === L) t = [c.x, c.y]; + else if (A.units) t = this.manualEndptToPx(l, A); + else if ("outside-to-line" === L) t = v.tgtIntn; + else if ( + ("outside-to-node" === L || "outside-to-node-or-label" === L + ? (i = n) + : ("outside-to-line" !== L && "outside-to-line-or-label" !== L) || (i = [u.x, u.y]), + (t = o.nodeShapes[this.getNodeShape(l)].intersectLine(c.x, c.y, l.outerWidth(), l.outerHeight(), i[0], i[1], 0)), + "outside-to-node-or-label" === L || "outside-to-line-or-label" === L) + ) { + var I = l._private.rscratch, + M = I.labelWidth, + O = I.labelHeight, + P = I.labelX, + R = I.labelY, + B = M / 2, + F = O / 2, + z = l.pstyle("text-valign").value; + "top" === z ? (R -= F) : "bottom" === z && (R += F); + var G = l.pstyle("text-halign").value; + "left" === G ? (P -= B) : "right" === G && (P += B); + var Y = tn(i[0], i[1], [P - B, R - F, P + B, R - F, P + B, R + F, P - B, R + F], c.x, c.y); + if (Y.length > 0) { + var X = u, + V = Lt(X, Tt(t)), + U = Lt(X, Tt(Y)), + j = V; + U < V && ((t = Y), (j = U)), Y.length > 2 && Lt(X, { x: Y[2], y: Y[3] }) < j && (t = [Y[2], Y[3]]); + } + } + var q = nn(t, n, o.arrowShapes[h].spacing(e) + p), + H = nn(t, n, o.arrowShapes[h].gap(e) + p); + if (((v.endX = H[0]), (v.endY = H[1]), (v.arrowEndX = q[0]), (v.arrowEndY = q[1]), "inside-to-node" === N)) t = [u.x, u.y]; + else if (C.units) t = this.manualEndptToPx(s, C); + else if ("outside-to-line" === N) t = v.srcIntn; + else if ( + ("outside-to-node" === N || "outside-to-node-or-label" === N + ? (a = r) + : ("outside-to-line" !== N && "outside-to-line-or-label" !== N) || (a = [c.x, c.y]), + (t = o.nodeShapes[this.getNodeShape(s)].intersectLine(u.x, u.y, s.outerWidth(), s.outerHeight(), a[0], a[1], 0)), + "outside-to-node-or-label" === N || "outside-to-line-or-label" === N) + ) { + var W = s._private.rscratch, + $ = W.labelWidth, + K = W.labelHeight, + Z = W.labelX, + Q = W.labelY, + J = $ / 2, + ee = K / 2, + te = s.pstyle("text-valign").value; + "top" === te ? (Q -= ee) : "bottom" === te && (Q += ee); + var ne = s.pstyle("text-halign").value; + "left" === ne ? (Z -= J) : "right" === ne && (Z += J); + var re = tn(a[0], a[1], [Z - J, Q - ee, Z + J, Q - ee, Z + J, Q + ee, Z - J, Q + ee], u.x, u.y); + if (re.length > 0) { + var ie = c, + ae = Lt(ie, Tt(t)), + oe = Lt(ie, Tt(re)), + se = ae; + oe < ae && ((t = [re[0], re[1]]), (se = oe)), re.length > 2 && Lt(ie, { x: re[2], y: re[3] }) < se && (t = [re[2], re[3]]); + } + } + var le = nn(t, r, o.arrowShapes[d].spacing(e) + g), + ue = nn(t, r, o.arrowShapes[d].gap(e) + g); + (v.startX = ue[0]), + (v.startY = ue[1]), + (v.arrowStartX = le[0]), + (v.arrowStartY = le[1]), + T && (b(v.startX) && b(v.startY) && b(v.endX) && b(v.endY) ? (v.badLine = !1) : (v.badLine = !0)); + }, + getSourceEndpoint: function (e) { + var t = e[0]._private.rscratch; + return ( + this.recalculateRenderedStyle(e), + "haystack" === t.edgeType ? { x: t.haystackPts[0], y: t.haystackPts[1] } : { x: t.arrowStartX, y: t.arrowStartY } + ); + }, + getTargetEndpoint: function (e) { + var t = e[0]._private.rscratch; + return ( + this.recalculateRenderedStyle(e), + "haystack" === t.edgeType ? { x: t.haystackPts[2], y: t.haystackPts[3] } : { x: t.arrowEndX, y: t.arrowEndY } + ); + }, + }, + jl = {}; + function ql(e, t, n) { + for ( + var r = function (e, t, n, r) { + return St(e, t, n, r); + }, + i = t._private.rstyle.bezierPts, + a = 0; + a < e.bezierProjPcts.length; + a++ + ) { + var o = e.bezierProjPcts[a]; + i.push({ x: r(n[0], n[2], n[4], o), y: r(n[1], n[3], n[5], o) }); + } + } + (jl.storeEdgeProjections = function (e) { + var t = e._private, + n = t.rscratch, + r = n.edgeType; + if ( + ((t.rstyle.bezierPts = null), + (t.rstyle.linePts = null), + (t.rstyle.haystackPts = null), + "multibezier" === r || "bezier" === r || "self" === r || "compound" === r) + ) { + t.rstyle.bezierPts = []; + for (var i = 0; i + 5 < n.allpts.length; i += 4) ql(this, e, n.allpts.slice(i, i + 6)); + } else if ("segments" === r) { + var a = (t.rstyle.linePts = []); + for (i = 0; i + 1 < n.allpts.length; i += 2) a.push({ x: n.allpts[i], y: n.allpts[i + 1] }); + } else if ("haystack" === r) { + var o = n.haystackPts; + t.rstyle.haystackPts = [ + { x: o[0], y: o[1] }, + { x: o[2], y: o[3] }, + ]; + } + t.rstyle.arrowWidth = this.getArrowWidth(e.pstyle("width").pfValue, e.pstyle("arrow-scale").value) * this.arrowShapeWidth; + }), + (jl.recalculateEdgeProjections = function (e) { + this.findEdgeControlPoints(e); + }); + var Hl = { + recalculateNodeLabelProjection: function (e) { + var t = e.pstyle("label").strValue; + if (!C(t)) { + var n, + r, + i = e._private, + a = e.width(), + o = e.height(), + s = e.padding(), + l = e.position(), + u = e.pstyle("text-halign").strValue, + c = e.pstyle("text-valign").strValue, + h = i.rscratch, + d = i.rstyle; + switch (u) { + case "left": + n = l.x - a / 2 - s; + break; + case "right": + n = l.x + a / 2 + s; + break; + default: + n = l.x; + } + switch (c) { + case "top": + r = l.y - o / 2 - s; + break; + case "bottom": + r = l.y + o / 2 + s; + break; + default: + r = l.y; + } + (h.labelX = n), (h.labelY = r), (d.labelX = n), (d.labelY = r), this.calculateLabelAngles(e), this.applyLabelDimensions(e); + } + }, + }, + Wl = function (e, t) { + var n = Math.atan(t / e); + return 0 === e && n < 0 && (n *= -1), n; + }, + $l = function (e, t) { + var n = t.x - e.x, + r = t.y - e.y; + return Wl(n, r); + }; + (Hl.recalculateEdgeLabelProjections = function (e) { + var t, + n = e._private, + r = n.rscratch, + i = this, + a = { + mid: e.pstyle("label").strValue, + source: e.pstyle("source-label").strValue, + target: e.pstyle("target-label").strValue, + }; + if (a.mid || a.source || a.target) { + t = { x: r.midX, y: r.midY }; + var o = function (e, t, r) { + et(n.rscratch, e, t, r), et(n.rstyle, e, t, r); + }; + o("labelX", null, t.x), o("labelY", null, t.y); + var s = Wl(r.midDispX, r.midDispY); + o("labelAutoAngle", null, s); + var l = function e() { + if (e.cache) return e.cache; + for (var t = [], a = 0; a + 5 < r.allpts.length; a += 4) { + var o = { x: r.allpts[a], y: r.allpts[a + 1] }, + s = { x: r.allpts[a + 2], y: r.allpts[a + 3] }, + l = { x: r.allpts[a + 4], y: r.allpts[a + 5] }; + t.push({ p0: o, p1: s, p2: l, startDist: 0, length: 0, segments: [] }); + } + var u = n.rstyle.bezierPts, + c = i.bezierProjPcts.length; + function h(e, t, n, r, i) { + var a = At(t, n), + o = e.segments[e.segments.length - 1], + s = { + p0: t, + p1: n, + t0: r, + t1: i, + startDist: o ? o.startDist + o.length : 0, + length: a, + }; + e.segments.push(s), (e.length += a); + } + for (var d = 0; d < t.length; d++) { + var p = t[d], + g = t[d - 1]; + g && (p.startDist = g.startDist + g.length), h(p, p.p0, u[d * c], 0, i.bezierProjPcts[0]); + for (var f = 0; f < c - 1; f++) h(p, u[d * c + f], u[d * c + f + 1], i.bezierProjPcts[f], i.bezierProjPcts[f + 1]); + h(p, u[d * c + c - 1], p.p2, i.bezierProjPcts[c - 1], 1); + } + return (e.cache = t); + }, + u = function (n) { + var i, + s = "source" === n; + if (a[n]) { + var u = e.pstyle(n + "-text-offset").pfValue; + switch (r.edgeType) { + case "self": + case "compound": + case "bezier": + case "multibezier": + for (var c, h = l(), d = 0, p = 0, g = 0; g < h.length; g++) { + for (var f = h[s ? g : h.length - 1 - g], v = 0; v < f.segments.length; v++) { + var y = f.segments[s ? v : f.segments.length - 1 - v], + m = g === h.length - 1 && v === f.segments.length - 1; + if (((d = p), (p += y.length) >= u || m)) { + c = { cp: f, segment: y }; + break; + } + } + if (c) break; + } + var b = c.cp, + x = c.segment, + w = (u - d) / x.length, + E = x.t1 - x.t0, + _ = s ? x.t0 + E * w : x.t1 - E * w; + (_ = Mt(0, _, 1)), + (t = It(b.p0, b.p1, b.p2, _)), + (i = (function (e, t, n, r) { + var i = Mt(0, r - 0.001, 1), + a = Mt(0, r + 0.001, 1), + o = It(e, t, n, i), + s = It(e, t, n, a); + return $l(o, s); + })(b.p0, b.p1, b.p2, _)); + break; + case "straight": + case "segments": + case "haystack": + for ( + var T, D, C, N, A = 0, L = r.allpts.length, k = 0; + k + 3 < L && + (s + ? ((C = { x: r.allpts[k], y: r.allpts[k + 1] }), (N = { x: r.allpts[k + 2], y: r.allpts[k + 3] })) + : ((C = { x: r.allpts[L - 2 - k], y: r.allpts[L - 1 - k] }), (N = { x: r.allpts[L - 4 - k], y: r.allpts[L - 3 - k] })), + (D = A), + !((A += T = At(C, N)) >= u)); + k += 2 + ); + var S = (u - D) / T; + (S = Mt(0, S, 1)), + (t = (function (e, t, n, r) { + var i = t.x - e.x, + a = t.y - e.y, + o = At(e, t), + s = i / o, + l = a / o; + return (n = null == n ? 0 : n), (r = null != r ? r : n * o), { x: e.x + s * r, y: e.y + l * r }; + })(C, N, S)), + (i = $l(C, N)); + } + o("labelX", n, t.x), o("labelY", n, t.y), o("labelAutoAngle", n, i); + } + }; + u("source"), u("target"), this.applyLabelDimensions(e); + } + }), + (Hl.applyLabelDimensions = function (e) { + this.applyPrefixedLabelDimensions(e), + e.isEdge() && (this.applyPrefixedLabelDimensions(e, "source"), this.applyPrefixedLabelDimensions(e, "target")); + }), + (Hl.applyPrefixedLabelDimensions = function (e, t) { + var n = e._private, + r = this.getLabelText(e, t), + i = this.calculateLabelDimensions(e, r), + a = e.pstyle("line-height").pfValue, + o = e.pstyle("text-wrap").strValue, + s = Je(n.rscratch, "labelWrapCachedLines", t) || [], + l = "wrap" !== o ? 1 : Math.max(s.length, 1), + u = i.height / l, + c = u * a, + h = i.width, + d = i.height + (l - 1) * (a - 1) * u; + et(n.rstyle, "labelWidth", t, h), + et(n.rscratch, "labelWidth", t, h), + et(n.rstyle, "labelHeight", t, d), + et(n.rscratch, "labelHeight", t, d), + et(n.rscratch, "labelLineHeight", t, c); + }), + (Hl.getLabelText = function (e, t) { + var n = e._private, + r = t ? t + "-" : "", + i = e.pstyle(r + "label").strValue, + a = e.pstyle("text-transform").value, + o = function (e, r) { + return r ? (et(n.rscratch, e, t, r), r) : Je(n.rscratch, e, t); + }; + if (!i) return ""; + "none" == a || ("uppercase" == a ? (i = i.toUpperCase()) : "lowercase" == a && (i = i.toLowerCase())); + var s = e.pstyle("text-wrap").value; + if ("wrap" === s) { + var l = o("labelKey"); + if (null != l && o("labelWrapKey") === l) return o("labelWrapCachedText"); + for ( + var u = i.split("\n"), + c = e.pstyle("text-max-width").pfValue, + h = "anywhere" === e.pstyle("text-overflow-wrap").value, + d = [], + p = /[\s\u200b]+/, + g = h ? "" : " ", + f = 0; + f < u.length; + f++ + ) { + var v = u[f], + y = this.calculateLabelDimensions(e, v).width; + if (h) { + var m = v.split("").join("​"); + v = m; + } + if (y > c) { + for (var b = v.split(p), x = "", w = 0; w < b.length; w++) { + var E = b[w], + _ = 0 === x.length ? E : x + g + E; + this.calculateLabelDimensions(e, _).width <= c ? (x += E + g) : (x && d.push(x), (x = E + g)); + } + x.match(/^[\s\u200b]+$/) || d.push(x); + } else d.push(v); + } + o("labelWrapCachedLines", d), (i = o("labelWrapCachedText", d.join("\n"))), o("labelWrapKey", l); + } else if ("ellipsis" === s) { + var T = e.pstyle("text-max-width").pfValue, + D = "", + C = !1; + if (this.calculateLabelDimensions(e, i).width < T) return i; + for (var N = 0; N < i.length && !(this.calculateLabelDimensions(e, D + i[N] + "…").width > T); N++) + (D += i[N]), N === i.length - 1 && (C = !0); + return C || (D += "…"), D; + } + return i; + }), + (Hl.getLabelJustification = function (e) { + var t = e.pstyle("text-justification").strValue, + n = e.pstyle("text-halign").strValue; + if ("auto" !== t) return t; + if (!e.isNode()) return "center"; + switch (n) { + case "left": + return "right"; + case "right": + return "left"; + default: + return "center"; + } + }), + (Hl.calculateLabelDimensions = function (e, t) { + var n = Ie(t, e._private.labelDimsKey), + r = this.labelDimCache || (this.labelDimCache = []), + i = r[n]; + if (null != i) return i; + var a = e.pstyle("font-style").strValue, + o = e.pstyle("font-size").pfValue, + s = e.pstyle("font-family").strValue, + l = e.pstyle("font-weight").strValue, + u = this.labelCalcCanvas, + c = this.labelCalcCanvasContext; + if (!u) { + (u = this.labelCalcCanvas = document.createElement("canvas")), (c = this.labelCalcCanvasContext = u.getContext("2d")); + var h = u.style; + (h.position = "absolute"), + (h.left = "-9999px"), + (h.top = "-9999px"), + (h.zIndex = "-1"), + (h.visibility = "hidden"), + (h.pointerEvents = "none"); + } + c.font = "".concat(a, " ").concat(l, " ").concat(o, "px ").concat(s); + for (var d = 0, p = 0, g = t.split("\n"), f = 0; f < g.length; f++) { + var v = g[f], + y = c.measureText(v), + m = Math.ceil(y.width), + b = o; + (d = Math.max(m, d)), (p += b); + } + return (d += 0), (p += 0), (r[n] = { width: d, height: p }); + }), + (Hl.calculateLabelAngle = function (e, t) { + var n = e._private.rscratch, + r = e.isEdge(), + i = t ? t + "-" : "", + a = e.pstyle(i + "text-rotation"), + o = a.strValue; + return "none" === o ? 0 : r && "autorotate" === o ? n.labelAutoAngle : "autorotate" === o ? 0 : a.pfValue; + }), + (Hl.calculateLabelAngles = function (e) { + var t = this, + n = e.isEdge(), + r = e._private.rscratch; + (r.labelAngle = t.calculateLabelAngle(e)), + n && ((r.sourceLabelAngle = t.calculateLabelAngle(e, "source")), (r.targetLabelAngle = t.calculateLabelAngle(e, "target"))); + }); + var Kl = {}, + Zl = !1; + Kl.getNodeShape = function (e) { + var t = e.pstyle("shape").value; + if ("cutrectangle" === t && (e.width() < 28 || e.height() < 28)) + return Zl || (je("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"), (Zl = !0)), "rectangle"; + if (e.isParent()) + return "rectangle" === t || + "roundrectangle" === t || + "round-rectangle" === t || + "cutrectangle" === t || + "cut-rectangle" === t || + "barrel" === t + ? t + : "rectangle"; + if ("polygon" === t) { + var n = e.pstyle("shape-polygon-points").value; + return this.nodeShapes.makePolygon(n).name; + } + return t; + }; + var Ql = { + updateCachedGrabbedEles: function () { + var e = this.cachedZSortedEles; + if (e) { + (e.drag = []), (e.nondrag = []); + for (var t = [], n = 0; n < e.length; n++) { + var r = (i = e[n])._private.rscratch; + i.grabbed() && !i.isParent() ? t.push(i) : r.inDragLayer ? e.drag.push(i) : e.nondrag.push(i); + } + for (n = 0; n < t.length; n++) { + var i = t[n]; + e.drag.push(i); + } + } + }, + invalidateCachedZSortedEles: function () { + this.cachedZSortedEles = null; + }, + getCachedZSortedEles: function (e) { + if (e || !this.cachedZSortedEles) { + var t = this.cy.mutableElements().toArray(); + t.sort(zo), + (t.interactive = t.filter(function (e) { + return e.interactive(); + })), + (this.cachedZSortedEles = t), + this.updateCachedGrabbedEles(); + } else t = this.cachedZSortedEles; + return t; + }, + }, + Jl = {}; + [ + Gl, + Yl, + Xl, + Ul, + jl, + Hl, + Kl, + { + registerCalculationListeners: function () { + var e = this.cy, + t = e.collection(), + n = this, + r = function (e) { + var n = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; + if ((t.merge(e), n)) + for (var r = 0; r < e.length; r++) { + var i = e[r]._private.rstyle; + (i.clean = !1), (i.cleanConnected = !1); + } + }; + n.binder(e) + .on("bounds.* dirty.*", function (e) { + var t = e.target; + r(t); + }) + .on("style.* background.*", function (e) { + var t = e.target; + r(t, !1); + }); + var i = function (i) { + if (i) { + var a = n.onUpdateEleCalcsFns; + t.cleanStyle(); + for (var o = 0; o < t.length; o++) { + var s = t[o], + l = s._private.rstyle; + s.isNode() && !l.cleanConnected && (r(s.connectedEdges()), (l.cleanConnected = !0)); + } + if (a) for (var u = 0; u < a.length; u++) (0, a[u])(i, t); + n.recalculateRenderedStyle(t), (t = e.collection()); + } + }; + (n.flushRenderedStyleQueue = function () { + i(!0); + }), + n.beforeRender(i, n.beforeRenderPriorities.eleCalcs); + }, + onUpdateEleCalcs: function (e) { + (this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || []).push(e); + }, + recalculateRenderedStyle: function (e, t) { + var n = function (e) { + return e._private.rstyle.cleanConnected; + }, + r = [], + i = []; + if (!this.destroyed) { + void 0 === t && (t = !0); + for (var a = 0; a < e.length; a++) { + var o = e[a], + s = o._private, + l = s.rstyle; + !o.isEdge() || (n(o.source()) && n(o.target())) || (l.clean = !1), + (t && l.clean) || + o.removed() || + ("none" !== o.pstyle("display").value && ("nodes" === s.group ? i.push(o) : r.push(o), (l.clean = !0))); + } + for (var u = 0; u < i.length; u++) { + var c = i[u], + h = c._private.rstyle, + d = c.position(); + this.recalculateNodeLabelProjection(c), + (h.nodeX = d.x), + (h.nodeY = d.y), + (h.nodeW = c.pstyle("width").pfValue), + (h.nodeH = c.pstyle("height").pfValue); + } + this.recalculateEdgeProjections(r); + for (var p = 0; p < r.length; p++) { + var g = r[p]._private, + f = g.rstyle, + v = g.rscratch; + (f.srcX = v.arrowStartX), + (f.srcY = v.arrowStartY), + (f.tgtX = v.arrowEndX), + (f.tgtY = v.arrowEndY), + (f.midX = v.midX), + (f.midY = v.midY), + (f.labelAngle = v.labelAngle), + (f.sourceLabelAngle = v.sourceLabelAngle), + (f.targetLabelAngle = v.targetLabelAngle); + } + } + }, + }, + Ql, + ].forEach(function (e) { + z(Jl, e); + }); + var eu = { + getCachedImage: function (e, t, n) { + var r = (this.imageCache = this.imageCache || {}), + i = r[e]; + if (i) return i.image.complete || i.image.addEventListener("load", n), i.image; + var a = ((i = r[e] = r[e] || {}).image = new Image()); + a.addEventListener("load", n), + a.addEventListener("error", function () { + a.error = !0; + }); + var o = "data:"; + return e.substring(0, 5).toLowerCase() === o || ((t = "null" === t ? null : t), (a.crossOrigin = t)), (a.src = e), a; + }, + }, + tu = { + registerBinding: function (e, t, n, r) { + var i = Array.prototype.slice.apply(arguments, [1]), + a = this.binder(e); + return a.on.apply(a, i); + }, + binder: function (e) { + var t, + n = this, + r = n.cy.window(), + i = e === r || e === r.document || e === r.document.body || ((t = e), "undefined" != typeof HTMLElement && t instanceof HTMLElement); + if (null == n.supportsPassiveEvents) { + var a = !1; + try { + var o = Object.defineProperty({}, "passive", { + get: function () { + return (a = !0), !0; + }, + }); + r.addEventListener("test", null, o); + } catch (e) {} + n.supportsPassiveEvents = a; + } + var s = function (t, r, a) { + var o = Array.prototype.slice.call(arguments); + return ( + i && n.supportsPassiveEvents && (o[2] = { capture: null != a && a, passive: !1, once: !1 }), + n.bindings.push({ target: e, args: o }), + (e.addEventListener || e.on).apply(e, o), + this + ); + }; + return { on: s, addEventListener: s, addListener: s, bind: s }; + }, + nodeIsDraggable: function (e) { + return e && e.isNode() && !e.locked() && e.grabbable(); + }, + nodeIsGrabbable: function (e) { + return this.nodeIsDraggable(e) && e.interactive(); + }, + load: function () { + var e = this, + t = e.cy.window(), + n = function (e) { + return e.selected(); + }, + r = function (t, n, r, i) { + null == t && (t = e.cy); + for (var a = 0; a < n.length; a++) { + var o = n[a]; + t.emit({ originalEvent: r, type: o, position: i }); + } + }, + i = function (e) { + return e.shiftKey || e.metaKey || e.ctrlKey; + }, + a = function (t, n) { + var r = !0; + if (e.cy.hasCompoundNodes() && t && t.pannable()) { + for (var i = 0; n && i < n.length; i++) + if ((t = n[i]).isNode() && t.isParent() && !t.pannable()) { + r = !1; + break; + } + } else r = !0; + return r; + }, + o = function (e) { + e[0]._private.rscratch.inDragLayer = !0; + }, + s = function (e) { + e[0]._private.rscratch.isGrabTarget = !0; + }, + l = function (e, t) { + var n = t.addToList; + n.has(e) || + !e.grabbable() || + e.locked() || + (n.merge(e), + (function (e) { + e[0]._private.grabbed = !0; + })(e)); + }, + u = function (t, n) { + n = n || {}; + var r = t.cy().hasCompoundNodes(); + n.inDragLayer && + (t.forEach(o), + t + .neighborhood() + .stdFilter(function (e) { + return !r || e.isEdge(); + }) + .forEach(o)), + n.addToList && + t.forEach(function (e) { + l(e, n); + }), + (function (e, t) { + if (e.cy().hasCompoundNodes() && (null != t.inDragLayer || null != t.addToList)) { + var n = e.descendants(); + t.inDragLayer && (n.forEach(o), n.connectedEdges().forEach(o)), t.addToList && l(n, t); + } + })(t, n), + d(t, { inDragLayer: n.inDragLayer }), + e.updateCachedGrabbedEles(); + }, + c = u, + h = function (t) { + t && + (e.getCachedZSortedEles().forEach(function (e) { + (function (e) { + e[0]._private.grabbed = !1; + })(e), + (function (e) { + e[0]._private.rscratch.inDragLayer = !1; + })(e), + (function (e) { + e[0]._private.rscratch.isGrabTarget = !1; + })(e); + }), + e.updateCachedGrabbedEles()); + }, + d = function (e, t) { + if ((null != t.inDragLayer || null != t.addToList) && e.cy().hasCompoundNodes()) { + var n = e.ancestors().orphans(); + if (!n.same(e)) { + var r = n.descendants().spawnSelf().merge(n).unmerge(e).unmerge(e.descendants()), + i = r.connectedEdges(); + t.inDragLayer && (i.forEach(o), r.forEach(o)), + t.addToList && + r.forEach(function (e) { + l(e, t); + }); + } + } + }, + p = function () { + null != document.activeElement && null != document.activeElement.blur && document.activeElement.blur(); + }, + g = "undefined" != typeof MutationObserver, + f = "undefined" != typeof ResizeObserver; + g + ? ((e.removeObserver = new MutationObserver(function (t) { + for (var n = 0; n < t.length; n++) { + var r = t[n].removedNodes; + if (r) + for (var i = 0; i < r.length; i++) + if (r[i] === e.container) { + e.destroy(); + break; + } + } + })), + e.container.parentNode && e.removeObserver.observe(e.container.parentNode, { childList: !0 })) + : e.registerBinding(e.container, "DOMNodeRemoved", function (t) { + e.destroy(); + }); + var v = be(function () { + e.cy.resize(); + }, 100); + g && ((e.styleObserver = new MutationObserver(v)), e.styleObserver.observe(e.container, { attributes: !0 })), + e.registerBinding(t, "resize", v), + f && ((e.resizeObserver = new ResizeObserver(v)), e.resizeObserver.observe(e.container)); + var y = function () { + e.invalidateContainerClientCoordsCache(); + }; + (function (e, t) { + for (; null != e; ) t(e), (e = e.parentNode); + })(e.container, function (t) { + e.registerBinding(t, "transitionend", y), e.registerBinding(t, "animationend", y), e.registerBinding(t, "scroll", y); + }), + e.registerBinding(e.container, "contextmenu", function (e) { + e.preventDefault(); + }); + var m, + x, + w, + E = function (t) { + for ( + var n = e.findContainerClientCoords(), r = n[0], i = n[1], a = n[2], o = n[3], s = t.touches ? t.touches : [t], l = !1, u = 0; + u < s.length; + u++ + ) { + var c = s[u]; + if (r <= c.clientX && c.clientX <= r + a && i <= c.clientY && c.clientY <= i + o) { + l = !0; + break; + } + } + if (!l) return !1; + for (var h = e.container, d = t.target.parentNode, p = !1; d; ) { + if (d === h) { + p = !0; + break; + } + d = d.parentNode; + } + return !!p; + }; + e.registerBinding( + e.container, + "mousedown", + function (t) { + if (E(t)) { + t.preventDefault(), p(), (e.hoverData.capture = !0), (e.hoverData.which = t.which); + var n = e.cy, + i = [t.clientX, t.clientY], + a = e.projectIntoViewport(i[0], i[1]), + o = e.selection, + l = e.findNearestElements(a[0], a[1], !0, !1), + h = l[0], + d = e.dragData.possibleDragElements; + (e.hoverData.mdownPos = a), (e.hoverData.mdownGPos = i); + if (3 == t.which) { + e.hoverData.cxtStarted = !0; + var g = { + originalEvent: t, + type: "cxttapstart", + position: { x: a[0], y: a[1] }, + }; + h ? (h.activate(), h.emit(g), (e.hoverData.down = h)) : n.emit(g), + (e.hoverData.downTime = new Date().getTime()), + (e.hoverData.cxtDragged = !1); + } else if (1 == t.which) { + if ((h && h.activate(), null != h && e.nodeIsGrabbable(h))) { + var f = function (e) { + return { originalEvent: t, type: e, position: { x: a[0], y: a[1] } }; + }; + if ((s(h), h.selected())) { + d = e.dragData.possibleDragElements = n.collection(); + var v = n.$(function (t) { + return t.isNode() && t.selected() && e.nodeIsGrabbable(t); + }); + u(v, { addToList: d }), + h.emit(f("grabon")), + v.forEach(function (e) { + e.emit(f("grab")); + }); + } else (d = e.dragData.possibleDragElements = n.collection()), c(h, { addToList: d }), h.emit(f("grabon")).emit(f("grab")); + e.redrawHint("eles", !0), e.redrawHint("drag", !0); + } + (e.hoverData.down = h), + (e.hoverData.downs = l), + (e.hoverData.downTime = new Date().getTime()), + r(h, ["mousedown", "tapstart", "vmousedown"], t, { x: a[0], y: a[1] }), + null == h + ? ((o[4] = 1), (e.data.bgActivePosistion = { x: a[0], y: a[1] }), e.redrawHint("select", !0), e.redraw()) + : h.pannable() && (o[4] = 1), + (e.hoverData.tapholdCancelled = !1), + clearTimeout(e.hoverData.tapholdTimeout), + (e.hoverData.tapholdTimeout = setTimeout(function () { + if (!e.hoverData.tapholdCancelled) { + var r = e.hoverData.down; + r + ? r.emit({ + originalEvent: t, + type: "taphold", + position: { x: a[0], y: a[1] }, + }) + : n.emit({ + originalEvent: t, + type: "taphold", + position: { x: a[0], y: a[1] }, + }); + } + }, e.tapholdDuration)); + } + (o[0] = o[2] = a[0]), (o[1] = o[3] = a[1]); + } + }, + !1, + ), + e.registerBinding( + t, + "mousemove", + function (t) { + if (e.hoverData.capture || E(t)) { + var n = !1, + o = e.cy, + s = o.zoom(), + l = [t.clientX, t.clientY], + c = e.projectIntoViewport(l[0], l[1]), + d = e.hoverData.mdownPos, + p = e.hoverData.mdownGPos, + g = e.selection, + f = null; + e.hoverData.draggingEles || e.hoverData.dragging || e.hoverData.selecting || (f = e.findNearestElement(c[0], c[1], !0, !1)); + var v, + y = e.hoverData.last, + m = e.hoverData.down, + x = [c[0] - g[2], c[1] - g[3]], + w = e.dragData.possibleDragElements; + if (p) { + var _ = l[0] - p[0], + T = _ * _, + D = l[1] - p[1], + C = T + D * D; + e.hoverData.isOverThresholdDrag = v = C >= e.desktopTapThreshold2; + } + var N = i(t); + v && (e.hoverData.tapholdCancelled = !0); + (n = !0), r(f, ["mousemove", "vmousemove", "tapdrag"], t, { x: c[0], y: c[1] }); + var A = function () { + (e.data.bgActivePosistion = void 0), + e.hoverData.selecting || + o.emit({ + originalEvent: t, + type: "boxstart", + position: { x: c[0], y: c[1] }, + }), + (g[4] = 1), + (e.hoverData.selecting = !0), + e.redrawHint("select", !0), + e.redraw(); + }; + if (3 === e.hoverData.which) { + if (v) { + var L = { + originalEvent: t, + type: "cxtdrag", + position: { x: c[0], y: c[1] }, + }; + m ? m.emit(L) : o.emit(L), + (e.hoverData.cxtDragged = !0), + (e.hoverData.cxtOver && f === e.hoverData.cxtOver) || + (e.hoverData.cxtOver && + e.hoverData.cxtOver.emit({ + originalEvent: t, + type: "cxtdragout", + position: { x: c[0], y: c[1] }, + }), + (e.hoverData.cxtOver = f), + f && + f.emit({ + originalEvent: t, + type: "cxtdragover", + position: { x: c[0], y: c[1] }, + })); + } + } else if (e.hoverData.dragging) { + if (((n = !0), o.panningEnabled() && o.userPanningEnabled())) { + var k; + if (e.hoverData.justStartedPan) { + var S = e.hoverData.mdownPos; + (k = { x: (c[0] - S[0]) * s, y: (c[1] - S[1]) * s }), (e.hoverData.justStartedPan = !1); + } else k = { x: x[0] * s, y: x[1] * s }; + o.panBy(k), o.emit("dragpan"), (e.hoverData.dragged = !0); + } + c = e.projectIntoViewport(t.clientX, t.clientY); + } else if (1 != g[4] || (null != m && !m.pannable())) { + if ( + (m && m.pannable() && m.active() && m.unactivate(), + (m && m.grabbed()) || + f == y || + (y && r(y, ["mouseout", "tapdragout"], t, { x: c[0], y: c[1] }), + f && r(f, ["mouseover", "tapdragover"], t, { x: c[0], y: c[1] }), + (e.hoverData.last = f)), + m) + ) + if (v) { + if (o.boxSelectionEnabled() && N) + m && + m.grabbed() && + (h(w), m.emit("freeon"), w.emit("free"), e.dragData.didDrag && (m.emit("dragfreeon"), w.emit("dragfree"))), + A(); + else if (m && m.grabbed() && e.nodeIsDraggable(m)) { + var I = !e.dragData.didDrag; + I && e.redrawHint("eles", !0), (e.dragData.didDrag = !0), e.hoverData.draggingEles || u(w, { inDragLayer: !0 }); + var M = { x: 0, y: 0 }; + if (b(x[0]) && b(x[1]) && ((M.x += x[0]), (M.y += x[1]), I)) { + var O = e.hoverData.dragDelta; + O && b(O[0]) && b(O[1]) && ((M.x += O[0]), (M.y += O[1])); + } + (e.hoverData.draggingEles = !0), w.silentShift(M).emit("position drag"), e.redrawHint("drag", !0), e.redraw(); + } + } else + !(function () { + var t = (e.hoverData.dragDelta = e.hoverData.dragDelta || []); + 0 === t.length ? (t.push(x[0]), t.push(x[1])) : ((t[0] += x[0]), (t[1] += x[1])); + })(); + n = !0; + } else + v && + (e.hoverData.dragging || !o.boxSelectionEnabled() || (!N && o.panningEnabled() && o.userPanningEnabled()) + ? !e.hoverData.selecting && + o.panningEnabled() && + o.userPanningEnabled() && + a(m, e.hoverData.downs) && + ((e.hoverData.dragging = !0), + (e.hoverData.justStartedPan = !0), + (g[4] = 0), + (e.data.bgActivePosistion = Tt(d)), + e.redrawHint("select", !0), + e.redraw()) + : A(), + m && m.pannable() && m.active() && m.unactivate()); + return ( + (g[2] = c[0]), + (g[3] = c[1]), + n ? (t.stopPropagation && t.stopPropagation(), t.preventDefault && t.preventDefault(), !1) : void 0 + ); + } + }, + !1, + ), + e.registerBinding( + t, + "mouseup", + function (t) { + if (e.hoverData.capture) { + e.hoverData.capture = !1; + var a = e.cy, + o = e.projectIntoViewport(t.clientX, t.clientY), + s = e.selection, + l = e.findNearestElement(o[0], o[1], !0, !1), + u = e.dragData.possibleDragElements, + c = e.hoverData.down, + d = i(t); + if ( + (e.data.bgActivePosistion && (e.redrawHint("select", !0), e.redraw()), + (e.hoverData.tapholdCancelled = !0), + (e.data.bgActivePosistion = void 0), + c && c.unactivate(), + 3 === e.hoverData.which) + ) { + var p = { + originalEvent: t, + type: "cxttapend", + position: { x: o[0], y: o[1] }, + }; + if ((c ? c.emit(p) : a.emit(p), !e.hoverData.cxtDragged)) { + var g = { + originalEvent: t, + type: "cxttap", + position: { x: o[0], y: o[1] }, + }; + c ? c.emit(g) : a.emit(g); + } + (e.hoverData.cxtDragged = !1), (e.hoverData.which = null); + } else if (1 === e.hoverData.which) { + if ( + (r(l, ["mouseup", "tapend", "vmouseup"], t, { x: o[0], y: o[1] }), + e.dragData.didDrag || + e.hoverData.dragged || + e.hoverData.selecting || + e.hoverData.isOverThresholdDrag || + (r(c, ["click", "tap", "vclick"], t, { x: o[0], y: o[1] }), + (x = !1), + t.timeStamp - w <= a.multiClickDebounceTime() + ? (m && clearTimeout(m), (x = !0), (w = null), r(c, ["dblclick", "dbltap", "vdblclick"], t, { x: o[0], y: o[1] })) + : ((m = setTimeout(function () { + x || + r(c, ["oneclick", "onetap", "voneclick"], t, { + x: o[0], + y: o[1], + }); + }, a.multiClickDebounceTime())), + (w = t.timeStamp))), + null != c || + e.dragData.didDrag || + e.hoverData.selecting || + e.hoverData.dragged || + i(t) || + (a.$(n).unselect(["tapunselect"]), + u.length > 0 && e.redrawHint("eles", !0), + (e.dragData.possibleDragElements = u = a.collection())), + l != c || + e.dragData.didDrag || + e.hoverData.selecting || + (null != l && + l._private.selectable && + (e.hoverData.dragging || + ("additive" === a.selectionType() || d + ? l.selected() + ? l.unselect(["tapunselect"]) + : l.select(["tapselect"]) + : d || (a.$(n).unmerge(l).unselect(["tapunselect"]), l.select(["tapselect"]))), + e.redrawHint("eles", !0))), + e.hoverData.selecting) + ) { + var f = a.collection(e.getAllInBox(s[0], s[1], s[2], s[3])); + e.redrawHint("select", !0), + f.length > 0 && e.redrawHint("eles", !0), + a.emit({ + type: "boxend", + originalEvent: t, + position: { x: o[0], y: o[1] }, + }); + "additive" === a.selectionType() || d || a.$(n).unmerge(f).unselect(), + f + .emit("box") + .stdFilter(function (e) { + return e.selectable() && !e.selected(); + }) + .select() + .emit("boxselect"), + e.redraw(); + } + if ( + (e.hoverData.dragging && ((e.hoverData.dragging = !1), e.redrawHint("select", !0), e.redrawHint("eles", !0), e.redraw()), + !s[4]) + ) { + e.redrawHint("drag", !0), e.redrawHint("eles", !0); + var v = c && c.grabbed(); + h(u), v && (c.emit("freeon"), u.emit("free"), e.dragData.didDrag && (c.emit("dragfreeon"), u.emit("dragfree"))); + } + } + (s[4] = 0), + (e.hoverData.down = null), + (e.hoverData.cxtStarted = !1), + (e.hoverData.draggingEles = !1), + (e.hoverData.selecting = !1), + (e.hoverData.isOverThresholdDrag = !1), + (e.dragData.didDrag = !1), + (e.hoverData.dragged = !1), + (e.hoverData.dragDelta = []), + (e.hoverData.mdownPos = null), + (e.hoverData.mdownGPos = null); + } + }, + !1, + ); + var _, + T, + D, + C, + N, + A, + L, + k, + S, + I, + M, + O, + P, + R = function (t) { + if (!e.scrollingPage) { + var n = e.cy, + r = n.zoom(), + i = n.pan(), + a = e.projectIntoViewport(t.clientX, t.clientY), + o = [a[0] * r + i.x, a[1] * r + i.y]; + if (e.hoverData.draggingEles || e.hoverData.dragging || e.hoverData.cxtStarted || 0 !== e.selection[4]) t.preventDefault(); + else if (n.panningEnabled() && n.userPanningEnabled() && n.zoomingEnabled() && n.userZoomingEnabled()) { + var s; + t.preventDefault(), + (e.data.wheelZooming = !0), + clearTimeout(e.data.wheelTimeout), + (e.data.wheelTimeout = setTimeout(function () { + (e.data.wheelZooming = !1), e.redrawHint("eles", !0), e.redraw(); + }, 150)), + (s = null != t.deltaY ? t.deltaY / -250 : null != t.wheelDeltaY ? t.wheelDeltaY / 1e3 : t.wheelDelta / 1e3), + (s *= e.wheelSensitivity), + 1 === t.deltaMode && (s *= 33); + var l = n.zoom() * Math.pow(10, s); + "gesturechange" === t.type && (l = e.gestureStartZoom * t.scale), + n.zoom({ level: l, renderedPosition: { x: o[0], y: o[1] } }), + n.emit("gesturechange" === t.type ? "pinchzoom" : "scrollzoom"); + } + } + }; + e.registerBinding(e.container, "wheel", R, !0), + e.registerBinding( + t, + "scroll", + function (t) { + (e.scrollingPage = !0), + clearTimeout(e.scrollingPageTimeout), + (e.scrollingPageTimeout = setTimeout(function () { + e.scrollingPage = !1; + }, 250)); + }, + !0, + ), + e.registerBinding( + e.container, + "gesturestart", + function (t) { + (e.gestureStartZoom = e.cy.zoom()), e.hasTouchStarted || t.preventDefault(); + }, + !0, + ), + e.registerBinding( + e.container, + "gesturechange", + function (t) { + e.hasTouchStarted || R(t); + }, + !0, + ), + e.registerBinding( + e.container, + "mouseout", + function (t) { + var n = e.projectIntoViewport(t.clientX, t.clientY); + e.cy.emit({ + originalEvent: t, + type: "mouseout", + position: { x: n[0], y: n[1] }, + }); + }, + !1, + ), + e.registerBinding( + e.container, + "mouseover", + function (t) { + var n = e.projectIntoViewport(t.clientX, t.clientY); + e.cy.emit({ + originalEvent: t, + type: "mouseover", + position: { x: n[0], y: n[1] }, + }); + }, + !1, + ); + var B, + F, + z, + G, + Y, + X, + V, + U = function (e, t, n, r) { + return Math.sqrt((n - e) * (n - e) + (r - t) * (r - t)); + }, + j = function (e, t, n, r) { + return (n - e) * (n - e) + (r - t) * (r - t); + }; + if ( + (e.registerBinding( + e.container, + "touchstart", + (B = function (t) { + if (((e.hasTouchStarted = !0), E(t))) { + p(), (e.touchData.capture = !0), (e.data.bgActivePosistion = void 0); + var n = e.cy, + i = e.touchData.now, + a = e.touchData.earlier; + if (t.touches[0]) { + var o = e.projectIntoViewport(t.touches[0].clientX, t.touches[0].clientY); + (i[0] = o[0]), (i[1] = o[1]); + } + if ( + (t.touches[1] && ((o = e.projectIntoViewport(t.touches[1].clientX, t.touches[1].clientY)), (i[2] = o[0]), (i[3] = o[1])), + t.touches[2] && ((o = e.projectIntoViewport(t.touches[2].clientX, t.touches[2].clientY)), (i[4] = o[0]), (i[5] = o[1])), + t.touches[1]) + ) { + (e.touchData.singleTouchMoved = !0), h(e.dragData.touchDragEles); + var l = e.findContainerClientCoords(); + (S = l[0]), + (I = l[1]), + (M = l[2]), + (O = l[3]), + (_ = t.touches[0].clientX - S), + (T = t.touches[0].clientY - I), + (D = t.touches[1].clientX - S), + (C = t.touches[1].clientY - I), + (P = 0 <= _ && _ <= M && 0 <= D && D <= M && 0 <= T && T <= O && 0 <= C && C <= O); + var d = n.pan(), + g = n.zoom(); + (N = U(_, T, D, C)), (A = j(_, T, D, C)), (k = [((L = [(_ + D) / 2, (T + C) / 2])[0] - d.x) / g, (L[1] - d.y) / g]); + if (A < 4e4 && !t.touches[2]) { + var f = e.findNearestElement(i[0], i[1], !0, !0), + v = e.findNearestElement(i[2], i[3], !0, !0); + return ( + f && f.isNode() + ? (f.activate().emit({ + originalEvent: t, + type: "cxttapstart", + position: { x: i[0], y: i[1] }, + }), + (e.touchData.start = f)) + : v && v.isNode() + ? (v.activate().emit({ + originalEvent: t, + type: "cxttapstart", + position: { x: i[0], y: i[1] }, + }), + (e.touchData.start = v)) + : n.emit({ + originalEvent: t, + type: "cxttapstart", + position: { x: i[0], y: i[1] }, + }), + e.touchData.start && (e.touchData.start._private.grabbed = !1), + (e.touchData.cxt = !0), + (e.touchData.cxtDragged = !1), + (e.data.bgActivePosistion = void 0), + void e.redraw() + ); + } + } + if (t.touches[2]) n.boxSelectionEnabled() && t.preventDefault(); + else if (t.touches[1]); + else if (t.touches[0]) { + var y = e.findNearestElements(i[0], i[1], !0, !0), + m = y[0]; + if (null != m && (m.activate(), (e.touchData.start = m), (e.touchData.starts = y), e.nodeIsGrabbable(m))) { + var b = (e.dragData.touchDragEles = n.collection()), + x = null; + e.redrawHint("eles", !0), + e.redrawHint("drag", !0), + m.selected() + ? ((x = n.$(function (t) { + return t.selected() && e.nodeIsGrabbable(t); + })), + u(x, { addToList: b })) + : c(m, { addToList: b }), + s(m); + var w = function (e) { + return { originalEvent: t, type: e, position: { x: i[0], y: i[1] } }; + }; + m.emit(w("grabon")), + x + ? x.forEach(function (e) { + e.emit(w("grab")); + }) + : m.emit(w("grab")); + } + r(m, ["touchstart", "tapstart", "vmousedown"], t, { x: i[0], y: i[1] }), + null == m && ((e.data.bgActivePosistion = { x: o[0], y: o[1] }), e.redrawHint("select", !0), e.redraw()), + (e.touchData.singleTouchMoved = !1), + (e.touchData.singleTouchStartTime = +new Date()), + clearTimeout(e.touchData.tapholdTimeout), + (e.touchData.tapholdTimeout = setTimeout(function () { + !1 !== e.touchData.singleTouchMoved || + e.pinching || + e.touchData.selecting || + r(e.touchData.start, ["taphold"], t, { x: i[0], y: i[1] }); + }, e.tapholdDuration)); + } + if (t.touches.length >= 1) { + for (var R = (e.touchData.startPosition = [null, null, null, null, null, null]), B = 0; B < i.length; B++) R[B] = a[B] = i[B]; + var F = t.touches[0]; + e.touchData.startGPosition = [F.clientX, F.clientY]; + } + } + }), + !1, + ), + e.registerBinding( + window, + "touchmove", + (F = function (t) { + var n = e.touchData.capture; + if (n || E(t)) { + var i = e.selection, + o = e.cy, + s = e.touchData.now, + l = e.touchData.earlier, + c = o.zoom(); + if (t.touches[0]) { + var d = e.projectIntoViewport(t.touches[0].clientX, t.touches[0].clientY); + (s[0] = d[0]), (s[1] = d[1]); + } + t.touches[1] && ((d = e.projectIntoViewport(t.touches[1].clientX, t.touches[1].clientY)), (s[2] = d[0]), (s[3] = d[1])), + t.touches[2] && ((d = e.projectIntoViewport(t.touches[2].clientX, t.touches[2].clientY)), (s[4] = d[0]), (s[5] = d[1])); + var p, + g = e.touchData.startGPosition; + if (n && t.touches[0] && g) { + for (var f = [], v = 0; v < s.length; v++) f[v] = s[v] - l[v]; + var y = t.touches[0].clientX - g[0], + m = y * y, + x = t.touches[0].clientY - g[1]; + p = m + x * x >= e.touchTapThreshold2; + } + if (n && e.touchData.cxt) { + t.preventDefault(); + var w = t.touches[0].clientX - S, + L = t.touches[0].clientY - I, + M = t.touches[1].clientX - S, + O = t.touches[1].clientY - I, + R = j(w, L, M, O); + if (R / A >= 2.25 || R >= 22500) { + (e.touchData.cxt = !1), (e.data.bgActivePosistion = void 0), e.redrawHint("select", !0); + var B = { + originalEvent: t, + type: "cxttapend", + position: { x: s[0], y: s[1] }, + }; + e.touchData.start ? (e.touchData.start.unactivate().emit(B), (e.touchData.start = null)) : o.emit(B); + } + } + if (n && e.touchData.cxt) { + (B = { originalEvent: t, type: "cxtdrag", position: { x: s[0], y: s[1] } }), + (e.data.bgActivePosistion = void 0), + e.redrawHint("select", !0), + e.touchData.start ? e.touchData.start.emit(B) : o.emit(B), + e.touchData.start && (e.touchData.start._private.grabbed = !1), + (e.touchData.cxtDragged = !0); + var F = e.findNearestElement(s[0], s[1], !0, !0); + (e.touchData.cxtOver && F === e.touchData.cxtOver) || + (e.touchData.cxtOver && + e.touchData.cxtOver.emit({ + originalEvent: t, + type: "cxtdragout", + position: { x: s[0], y: s[1] }, + }), + (e.touchData.cxtOver = F), + F && + F.emit({ + originalEvent: t, + type: "cxtdragover", + position: { x: s[0], y: s[1] }, + })); + } else if (n && t.touches[2] && o.boxSelectionEnabled()) + t.preventDefault(), + (e.data.bgActivePosistion = void 0), + (this.lastThreeTouch = +new Date()), + e.touchData.selecting || + o.emit({ + originalEvent: t, + type: "boxstart", + position: { x: s[0], y: s[1] }, + }), + (e.touchData.selecting = !0), + (e.touchData.didSelect = !0), + (i[4] = 1), + i && 0 !== i.length && void 0 !== i[0] + ? ((i[2] = (s[0] + s[2] + s[4]) / 3), (i[3] = (s[1] + s[3] + s[5]) / 3)) + : ((i[0] = (s[0] + s[2] + s[4]) / 3), + (i[1] = (s[1] + s[3] + s[5]) / 3), + (i[2] = (s[0] + s[2] + s[4]) / 3 + 1), + (i[3] = (s[1] + s[3] + s[5]) / 3 + 1)), + e.redrawHint("select", !0), + e.redraw(); + else if ( + n && + t.touches[1] && + !e.touchData.didSelect && + o.zoomingEnabled() && + o.panningEnabled() && + o.userZoomingEnabled() && + o.userPanningEnabled() + ) { + if ((t.preventDefault(), (e.data.bgActivePosistion = void 0), e.redrawHint("select", !0), (ee = e.dragData.touchDragEles))) { + e.redrawHint("drag", !0); + for (var z = 0; z < ee.length; z++) { + var G = ee[z]._private; + (G.grabbed = !1), (G.rscratch.inDragLayer = !1); + } + } + var Y = e.touchData.start, + X = + ((w = t.touches[0].clientX - S), + (L = t.touches[0].clientY - I), + (M = t.touches[1].clientX - S), + (O = t.touches[1].clientY - I), + U(w, L, M, O)), + V = X / N; + if (P) { + var q = (w - _ + (M - D)) / 2, + H = (L - T + (O - C)) / 2, + W = o.zoom(), + $ = W * V, + K = o.pan(), + Z = k[0] * W + K.x, + Q = k[1] * W + K.y, + J = { + x: (-$ / W) * (Z - K.x - q) + Z, + y: (-$ / W) * (Q - K.y - H) + Q, + }; + if (Y && Y.active()) { + var ee = e.dragData.touchDragEles; + h(ee), + e.redrawHint("drag", !0), + e.redrawHint("eles", !0), + Y.unactivate().emit("freeon"), + ee.emit("free"), + e.dragData.didDrag && (Y.emit("dragfreeon"), ee.emit("dragfree")); + } + o.viewport({ zoom: $, pan: J, cancelOnFailedZoom: !0 }), + o.emit("pinchzoom"), + (N = X), + (_ = w), + (T = L), + (D = M), + (C = O), + (e.pinching = !0); + } + t.touches[0] && ((d = e.projectIntoViewport(t.touches[0].clientX, t.touches[0].clientY)), (s[0] = d[0]), (s[1] = d[1])), + t.touches[1] && ((d = e.projectIntoViewport(t.touches[1].clientX, t.touches[1].clientY)), (s[2] = d[0]), (s[3] = d[1])), + t.touches[2] && ((d = e.projectIntoViewport(t.touches[2].clientX, t.touches[2].clientY)), (s[4] = d[0]), (s[5] = d[1])); + } else if (t.touches[0] && !e.touchData.didSelect) { + var te = e.touchData.start, + ne = e.touchData.last; + if ( + (e.hoverData.draggingEles || e.swipePanning || (F = e.findNearestElement(s[0], s[1], !0, !0)), + n && null != te && t.preventDefault(), + n && null != te && e.nodeIsDraggable(te)) + ) + if (p) { + ee = e.dragData.touchDragEles; + var re = !e.dragData.didDrag; + re && u(ee, { inDragLayer: !0 }), (e.dragData.didDrag = !0); + var ie = { x: 0, y: 0 }; + b(f[0]) && + b(f[1]) && + ((ie.x += f[0]), + (ie.y += f[1]), + re && + (e.redrawHint("eles", !0), + (ae = e.touchData.dragDelta) && b(ae[0]) && b(ae[1]) && ((ie.x += ae[0]), (ie.y += ae[1])))), + (e.hoverData.draggingEles = !0), + ee.silentShift(ie).emit("position drag"), + e.redrawHint("drag", !0), + e.touchData.startPosition[0] == l[0] && e.touchData.startPosition[1] == l[1] && e.redrawHint("eles", !0), + e.redraw(); + } else { + var ae; + 0 === (ae = e.touchData.dragDelta = e.touchData.dragDelta || []).length + ? (ae.push(f[0]), ae.push(f[1])) + : ((ae[0] += f[0]), (ae[1] += f[1])); + } + if ( + (r(te || F, ["touchmove", "tapdrag", "vmousemove"], t, { + x: s[0], + y: s[1], + }), + (te && te.grabbed()) || + F == ne || + (ne && + ne.emit({ + originalEvent: t, + type: "tapdragout", + position: { x: s[0], y: s[1] }, + }), + F && + F.emit({ + originalEvent: t, + type: "tapdragover", + position: { x: s[0], y: s[1] }, + })), + (e.touchData.last = F), + n) + ) + for (z = 0; z < s.length; z++) s[z] && e.touchData.startPosition[z] && p && (e.touchData.singleTouchMoved = !0); + n && + (null == te || te.pannable()) && + o.panningEnabled() && + o.userPanningEnabled() && + (a(te, e.touchData.starts) && + (t.preventDefault(), + e.data.bgActivePosistion || (e.data.bgActivePosistion = Tt(e.touchData.startPosition)), + e.swipePanning + ? (o.panBy({ x: f[0] * c, y: f[1] * c }), o.emit("dragpan")) + : p && + ((e.swipePanning = !0), + o.panBy({ x: y * c, y: x * c }), + o.emit("dragpan"), + te && (te.unactivate(), e.redrawHint("select", !0), (e.touchData.start = null)))), + (d = e.projectIntoViewport(t.touches[0].clientX, t.touches[0].clientY)), + (s[0] = d[0]), + (s[1] = d[1])); + } + for (v = 0; v < s.length; v++) l[v] = s[v]; + n && + t.touches.length > 0 && + !e.hoverData.draggingEles && + !e.swipePanning && + null != e.data.bgActivePosistion && + ((e.data.bgActivePosistion = void 0), e.redrawHint("select", !0), e.redraw()); + } + }), + !1, + ), + e.registerBinding( + t, + "touchcancel", + (z = function (t) { + var n = e.touchData.start; + (e.touchData.capture = !1), n && n.unactivate(); + }), + ), + e.registerBinding( + t, + "touchend", + (G = function (t) { + var i = e.touchData.start; + if (e.touchData.capture) { + 0 === t.touches.length && (e.touchData.capture = !1), t.preventDefault(); + var a = e.selection; + (e.swipePanning = !1), (e.hoverData.draggingEles = !1); + var o, + s = e.cy, + l = s.zoom(), + u = e.touchData.now, + c = e.touchData.earlier; + if (t.touches[0]) { + var d = e.projectIntoViewport(t.touches[0].clientX, t.touches[0].clientY); + (u[0] = d[0]), (u[1] = d[1]); + } + if ( + (t.touches[1] && ((d = e.projectIntoViewport(t.touches[1].clientX, t.touches[1].clientY)), (u[2] = d[0]), (u[3] = d[1])), + t.touches[2] && ((d = e.projectIntoViewport(t.touches[2].clientX, t.touches[2].clientY)), (u[4] = d[0]), (u[5] = d[1])), + i && i.unactivate(), + e.touchData.cxt) + ) { + if ( + ((o = { + originalEvent: t, + type: "cxttapend", + position: { x: u[0], y: u[1] }, + }), + i ? i.emit(o) : s.emit(o), + !e.touchData.cxtDragged) + ) { + var p = { + originalEvent: t, + type: "cxttap", + position: { x: u[0], y: u[1] }, + }; + i ? i.emit(p) : s.emit(p); + } + return ( + e.touchData.start && (e.touchData.start._private.grabbed = !1), + (e.touchData.cxt = !1), + (e.touchData.start = null), + void e.redraw() + ); + } + if (!t.touches[2] && s.boxSelectionEnabled() && e.touchData.selecting) { + e.touchData.selecting = !1; + var g = s.collection(e.getAllInBox(a[0], a[1], a[2], a[3])); + (a[0] = void 0), + (a[1] = void 0), + (a[2] = void 0), + (a[3] = void 0), + (a[4] = 0), + e.redrawHint("select", !0), + s.emit({ + type: "boxend", + originalEvent: t, + position: { x: u[0], y: u[1] }, + }); + g + .emit("box") + .stdFilter(function (e) { + return e.selectable() && !e.selected(); + }) + .select() + .emit("boxselect"), + g.nonempty() && e.redrawHint("eles", !0), + e.redraw(); + } + if ((null != i && i.unactivate(), t.touches[2])) (e.data.bgActivePosistion = void 0), e.redrawHint("select", !0); + else if (t.touches[1]); + else if (t.touches[0]); + else if (!t.touches[0]) { + (e.data.bgActivePosistion = void 0), e.redrawHint("select", !0); + var f = e.dragData.touchDragEles; + if (null != i) { + var v = i._private.grabbed; + h(f), + e.redrawHint("drag", !0), + e.redrawHint("eles", !0), + v && (i.emit("freeon"), f.emit("free"), e.dragData.didDrag && (i.emit("dragfreeon"), f.emit("dragfree"))), + r(i, ["touchend", "tapend", "vmouseup", "tapdragout"], t, { + x: u[0], + y: u[1], + }), + i.unactivate(), + (e.touchData.start = null); + } else { + var y = e.findNearestElement(u[0], u[1], !0, !0); + r(y, ["touchend", "tapend", "vmouseup", "tapdragout"], t, { + x: u[0], + y: u[1], + }); + } + var m = e.touchData.startPosition[0] - u[0], + b = m * m, + x = e.touchData.startPosition[1] - u[1], + w = (b + x * x) * l * l; + e.touchData.singleTouchMoved || + (i || s.$(":selected").unselect(["tapunselect"]), + r(i, ["tap", "vclick"], t, { x: u[0], y: u[1] }), + (Y = !1), + t.timeStamp - V <= s.multiClickDebounceTime() + ? (X && clearTimeout(X), (Y = !0), (V = null), r(i, ["dbltap", "vdblclick"], t, { x: u[0], y: u[1] })) + : ((X = setTimeout(function () { + Y || r(i, ["onetap", "voneclick"], t, { x: u[0], y: u[1] }); + }, s.multiClickDebounceTime())), + (V = t.timeStamp))), + null != i && + !e.dragData.didDrag && + i._private.selectable && + w < e.touchTapThreshold2 && + !e.pinching && + ("single" === s.selectionType() + ? (s.$(n).unmerge(i).unselect(["tapunselect"]), i.select(["tapselect"])) + : i.selected() + ? i.unselect(["tapunselect"]) + : i.select(["tapselect"]), + e.redrawHint("eles", !0)), + (e.touchData.singleTouchMoved = !0); + } + for (var E = 0; E < u.length; E++) c[E] = u[E]; + (e.dragData.didDrag = !1), + 0 === t.touches.length && + ((e.touchData.dragDelta = []), + (e.touchData.startPosition = [null, null, null, null, null, null]), + (e.touchData.startGPosition = null), + (e.touchData.didSelect = !1)), + t.touches.length < 2 && + (1 === t.touches.length && (e.touchData.startGPosition = [t.touches[0].clientX, t.touches[0].clientY]), + (e.pinching = !1), + e.redrawHint("eles", !0), + e.redraw()); + } + }), + !1, + ), + "undefined" == typeof TouchEvent) + ) { + var q = [], + H = function (e) { + return { + clientX: e.clientX, + clientY: e.clientY, + force: 1, + identifier: e.pointerId, + pageX: e.pageX, + pageY: e.pageY, + radiusX: e.width / 2, + radiusY: e.height / 2, + screenX: e.screenX, + screenY: e.screenY, + target: e.target, + }; + }, + W = function (e) { + q.push( + (function (e) { + return { event: e, touch: H(e) }; + })(e), + ); + }, + $ = function (e) { + for (var t = 0; t < q.length; t++) if (q[t].event.pointerId === e.pointerId) return void q.splice(t, 1); + }, + K = function (e) { + e.touches = q.map(function (e) { + return e.touch; + }); + }, + Z = function (e) { + return "mouse" === e.pointerType || 4 === e.pointerType; + }; + e.registerBinding(e.container, "pointerdown", function (e) { + Z(e) || (e.preventDefault(), W(e), K(e), B(e)); + }), + e.registerBinding(e.container, "pointerup", function (e) { + Z(e) || ($(e), K(e), G(e)); + }), + e.registerBinding(e.container, "pointercancel", function (e) { + Z(e) || ($(e), K(e), z()); + }), + e.registerBinding(e.container, "pointermove", function (e) { + Z(e) || + (e.preventDefault(), + (function (e) { + var t = q.filter(function (t) { + return t.event.pointerId === e.pointerId; + })[0]; + (t.event = e), (t.touch = H(e)); + })(e), + K(e), + F(e)); + }); + } + }, + }, + nu = { + generatePolygon: function (e, t) { + return (this.nodeShapes[e] = { + renderer: this, + name: e, + points: t, + draw: function (e, t, n, r, i) { + this.renderer.nodeShapeImpl("polygon", e, t, n, r, i, this.points); + }, + intersectLine: function (e, t, n, r, i, a, o) { + return tn(i, a, this.points, e, t, n / 2, r / 2, o); + }, + checkPoint: function (e, t, n, r, i, a, o) { + return Wt(e, t, this.points, a, o, r, i, [0, -1], n); + }, + }); + }, + generateEllipse: function () { + return (this.nodeShapes.ellipse = { + renderer: this, + name: "ellipse", + draw: function (e, t, n, r, i) { + this.renderer.nodeShapeImpl(this.name, e, t, n, r, i); + }, + intersectLine: function (e, t, n, r, i, a, o) { + return (function (e, t, n, r, i, a) { + var o = n - e, + s = r - t; + (o /= i), (s /= a); + var l = Math.sqrt(o * o + s * s), + u = l - 1; + if (u < 0) return []; + var c = u / l; + return [(n - e) * c + e, (r - t) * c + t]; + })(i, a, e, t, n / 2 + o, r / 2 + o); + }, + checkPoint: function (e, t, n, r, i, a, o) { + return Zt(e, t, r, i, a, o, n); + }, + }); + }, + generateRoundPolygon: function (e, t) { + for (var n = new Array(2 * t.length), r = 0; r < t.length / 2; r++) { + var i, + a = 2 * r; + (i = r < t.length / 2 - 1 ? 2 * (r + 1) : 0), (n[4 * r] = t[a]), (n[4 * r + 1] = t[a + 1]); + var o = t[i] - t[a], + s = t[i + 1] - t[a + 1], + l = Math.sqrt(o * o + s * s); + (n[4 * r + 2] = o / l), (n[4 * r + 3] = s / l); + } + return (this.nodeShapes[e] = { + renderer: this, + name: e, + points: n, + draw: function (e, t, n, r, i) { + this.renderer.nodeShapeImpl("round-polygon", e, t, n, r, i, this.points); + }, + intersectLine: function (e, t, n, r, i, a, o) { + return (function (e, t, n, r, i, a, o, s) { + for (var l, u = [], c = new Array(n.length), h = a / 2, d = o / 2, p = ln(a, o), g = 0; g < n.length / 4; g++) { + var f, v; + (f = 0 === g ? n.length - 2 : 4 * g - 2), (v = 4 * g + 2); + var y = r + h * n[4 * g], + m = i + d * n[4 * g + 1], + b = -n[f] * n[v] - n[f + 1] * n[v + 1], + x = p / Math.tan(Math.acos(b) / 2), + w = y - x * n[f], + E = m - x * n[f + 1], + _ = y + x * n[v], + T = m + x * n[v + 1]; + 0 === g ? ((c[n.length - 2] = w), (c[n.length - 1] = E)) : ((c[4 * g - 2] = w), (c[4 * g - 1] = E)), + (c[4 * g] = _), + (c[4 * g + 1] = T); + var D = n[f + 1], + C = -n[f]; + D * n[v] + C * n[v + 1] < 0 && ((D *= -1), (C *= -1)), + 0 !== (l = Qt(e, t, r, i, w + D * p, E + C * p, p)).length && u.push(l[0], l[1]); + } + for (var N = 0; N < c.length / 4; N++) + 0 !== (l = en(e, t, r, i, c[4 * N], c[4 * N + 1], c[4 * N + 2], c[4 * N + 3], !1)).length && u.push(l[0], l[1]); + if (u.length > 2) { + for (var A = [u[0], u[1]], L = Math.pow(A[0] - e, 2) + Math.pow(A[1] - t, 2), k = 1; k < u.length / 2; k++) { + var S = Math.pow(u[2 * k] - e, 2) + Math.pow(u[2 * k + 1] - t, 2); + S <= L && ((A[0] = u[2 * k]), (A[1] = u[2 * k + 1]), (L = S)); + } + return A; + } + return u; + })(i, a, this.points, e, t, n, r); + }, + checkPoint: function (e, t, n, r, i, a, o) { + return (function (e, t, n, r, i, a, o) { + for (var s = new Array(n.length), l = a / 2, u = o / 2, c = ln(a, o), h = c * c, d = 0; d < n.length / 4; d++) { + var p, g; + (p = 0 === d ? n.length - 2 : 4 * d - 2), (g = 4 * d + 2); + var f = r + l * n[4 * d], + v = i + u * n[4 * d + 1], + y = -n[p] * n[g] - n[p + 1] * n[g + 1], + m = c / Math.tan(Math.acos(y) / 2), + b = f - m * n[p], + x = v - m * n[p + 1], + w = f + m * n[g], + E = v + m * n[g + 1]; + (s[4 * d] = b), (s[4 * d + 1] = x), (s[4 * d + 2] = w), (s[4 * d + 3] = E); + var _ = n[p + 1], + T = -n[p]; + _ * n[g] + T * n[g + 1] < 0 && ((_ *= -1), (T *= -1)); + var D = b + _ * c, + C = x + T * c; + if (Math.pow(D - e, 2) + Math.pow(C - t, 2) <= h) return !0; + } + return Ht(e, t, s); + })(e, t, this.points, a, o, r, i); + }, + }); + }, + generateRoundRectangle: function () { + return (this.nodeShapes["round-rectangle"] = this.nodeShapes.roundrectangle = + { + renderer: this, + name: "round-rectangle", + points: rn(4, 0), + draw: function (e, t, n, r, i) { + this.renderer.nodeShapeImpl(this.name, e, t, n, r, i); + }, + intersectLine: function (e, t, n, r, i, a, o) { + return Xt(i, a, e, t, n, r, o); + }, + checkPoint: function (e, t, n, r, i, a, o) { + var s = sn(r, i), + l = 2 * s; + return !!( + Wt(e, t, this.points, a, o, r, i - l, [0, -1], n) || + Wt(e, t, this.points, a, o, r - l, i, [0, -1], n) || + Zt(e, t, l, l, a - r / 2 + s, o - i / 2 + s, n) || + Zt(e, t, l, l, a + r / 2 - s, o - i / 2 + s, n) || + Zt(e, t, l, l, a + r / 2 - s, o + i / 2 - s, n) || + Zt(e, t, l, l, a - r / 2 + s, o + i / 2 - s, n) + ); + }, + }); + }, + generateCutRectangle: function () { + return (this.nodeShapes["cut-rectangle"] = this.nodeShapes.cutrectangle = + { + renderer: this, + name: "cut-rectangle", + cornerLength: 8, + points: rn(4, 0), + draw: function (e, t, n, r, i) { + this.renderer.nodeShapeImpl(this.name, e, t, n, r, i); + }, + generateCutTrianglePts: function (e, t, n, r) { + var i = this.cornerLength, + a = t / 2, + o = e / 2, + s = n - o, + l = n + o, + u = r - a, + c = r + a; + return { + topLeft: [s, u + i, s + i, u, s + i, u + i], + topRight: [l - i, u, l, u + i, l - i, u + i], + bottomRight: [l, c - i, l - i, c, l - i, c - i], + bottomLeft: [s + i, c, s, c - i, s + i, c - i], + }; + }, + intersectLine: function (e, t, n, r, i, a, o) { + var s = this.generateCutTrianglePts(n + 2 * o, r + 2 * o, e, t), + l = [].concat.apply( + [], + [s.topLeft.splice(0, 4), s.topRight.splice(0, 4), s.bottomRight.splice(0, 4), s.bottomLeft.splice(0, 4)], + ); + return tn(i, a, l, e, t); + }, + checkPoint: function (e, t, n, r, i, a, o) { + if (Wt(e, t, this.points, a, o, r, i - 2 * this.cornerLength, [0, -1], n)) return !0; + if (Wt(e, t, this.points, a, o, r - 2 * this.cornerLength, i, [0, -1], n)) return !0; + var s = this.generateCutTrianglePts(r, i, a, o); + return Ht(e, t, s.topLeft) || Ht(e, t, s.topRight) || Ht(e, t, s.bottomRight) || Ht(e, t, s.bottomLeft); + }, + }); + }, + generateBarrel: function () { + return (this.nodeShapes.barrel = { + renderer: this, + name: "barrel", + points: rn(4, 0), + draw: function (e, t, n, r, i) { + this.renderer.nodeShapeImpl(this.name, e, t, n, r, i); + }, + intersectLine: function (e, t, n, r, i, a, o) { + var s = this.generateBarrelBezierPts(n + 2 * o, r + 2 * o, e, t), + l = function (e) { + var t = It({ x: e[0], y: e[1] }, { x: e[2], y: e[3] }, { x: e[4], y: e[5] }, 0.15), + n = It({ x: e[0], y: e[1] }, { x: e[2], y: e[3] }, { x: e[4], y: e[5] }, 0.5), + r = It({ x: e[0], y: e[1] }, { x: e[2], y: e[3] }, { x: e[4], y: e[5] }, 0.85); + return [e[0], e[1], t.x, t.y, n.x, n.y, r.x, r.y, e[4], e[5]]; + }, + u = [].concat(l(s.topLeft), l(s.topRight), l(s.bottomRight), l(s.bottomLeft)); + return tn(i, a, u, e, t); + }, + generateBarrelBezierPts: function (e, t, n, r) { + var i = t / 2, + a = e / 2, + o = n - a, + s = n + a, + l = r - i, + u = r + i, + c = un(e, t), + h = c.heightOffset, + d = c.widthOffset, + p = c.ctrlPtOffsetPct * e, + g = { + topLeft: [o, l + h, o + p, l, o + d, l], + topRight: [s - d, l, s - p, l, s, l + h], + bottomRight: [s, u - h, s - p, u, s - d, u], + bottomLeft: [o + d, u, o + p, u, o, u - h], + }; + return (g.topLeft.isTop = !0), (g.topRight.isTop = !0), (g.bottomLeft.isBottom = !0), (g.bottomRight.isBottom = !0), g; + }, + checkPoint: function (e, t, n, r, i, a, o) { + var s = un(r, i), + l = s.heightOffset, + u = s.widthOffset; + if (Wt(e, t, this.points, a, o, r, i - 2 * l, [0, -1], n)) return !0; + if (Wt(e, t, this.points, a, o, r - 2 * u, i, [0, -1], n)) return !0; + for ( + var c = this.generateBarrelBezierPts(r, i, a, o), + h = function (e, t, n) { + var r, + i, + a = n[4], + o = n[2], + s = n[0], + l = n[5], + u = n[1], + c = Math.min(a, s), + h = Math.max(a, s), + d = Math.min(l, u), + p = Math.max(l, u); + if (c <= e && e <= h && d <= t && t <= p) { + var g = [(r = a) - 2 * (i = o) + s, 2 * (i - r), r], + f = (function (e, t, n, r) { + var i = t * t - 4 * e * (n -= r); + if (i < 0) return []; + var a = Math.sqrt(i), + o = 2 * e; + return [(-t + a) / o, (-t - a) / o]; + })(g[0], g[1], g[2], e).filter(function (e) { + return 0 <= e && e <= 1; + }); + if (f.length > 0) return f[0]; + } + return null; + }, + d = Object.keys(c), + p = 0; + p < d.length; + p++ + ) { + var g = c[d[p]], + f = h(e, t, g); + if (null != f) { + var v = g[5], + y = g[3], + m = g[1], + b = St(v, y, m, f); + if (g.isTop && b <= t) return !0; + if (g.isBottom && t <= b) return !0; + } + } + return !1; + }, + }); + }, + generateBottomRoundrectangle: function () { + return (this.nodeShapes["bottom-round-rectangle"] = this.nodeShapes.bottomroundrectangle = + { + renderer: this, + name: "bottom-round-rectangle", + points: rn(4, 0), + draw: function (e, t, n, r, i) { + this.renderer.nodeShapeImpl(this.name, e, t, n, r, i); + }, + intersectLine: function (e, t, n, r, i, a, o) { + var s = t - (r / 2 + o), + l = en(i, a, e, t, e - (n / 2 + o), s, e + (n / 2 + o), s, !1); + return l.length > 0 ? l : Xt(i, a, e, t, n, r, o); + }, + checkPoint: function (e, t, n, r, i, a, o) { + var s = sn(r, i), + l = 2 * s; + if (Wt(e, t, this.points, a, o, r, i - l, [0, -1], n)) return !0; + if (Wt(e, t, this.points, a, o, r - l, i, [0, -1], n)) return !0; + var u = r / 2 + 2 * n, + c = i / 2 + 2 * n; + return ( + !!Ht(e, t, [a - u, o - c, a - u, o, a + u, o, a + u, o - c]) || + !!Zt(e, t, l, l, a + r / 2 - s, o + i / 2 - s, n) || + !!Zt(e, t, l, l, a - r / 2 + s, o + i / 2 - s, n) + ); + }, + }); + }, + registerNodeShapes: function () { + var e = (this.nodeShapes = {}), + t = this; + this.generateEllipse(), + this.generatePolygon("triangle", rn(3, 0)), + this.generateRoundPolygon("round-triangle", rn(3, 0)), + this.generatePolygon("rectangle", rn(4, 0)), + (e.square = e.rectangle), + this.generateRoundRectangle(), + this.generateCutRectangle(), + this.generateBarrel(), + this.generateBottomRoundrectangle(); + var n = [0, 1, 1, 0, 0, -1, -1, 0]; + this.generatePolygon("diamond", n), + this.generateRoundPolygon("round-diamond", n), + this.generatePolygon("pentagon", rn(5, 0)), + this.generateRoundPolygon("round-pentagon", rn(5, 0)), + this.generatePolygon("hexagon", rn(6, 0)), + this.generateRoundPolygon("round-hexagon", rn(6, 0)), + this.generatePolygon("heptagon", rn(7, 0)), + this.generateRoundPolygon("round-heptagon", rn(7, 0)), + this.generatePolygon("octagon", rn(8, 0)), + this.generateRoundPolygon("round-octagon", rn(8, 0)); + var r = new Array(20), + i = on(5, 0), + a = on(5, Math.PI / 5), + o = 0.5 * (3 - Math.sqrt(5)); + o *= 1.57; + for (var s = 0; s < a.length / 2; s++) (a[2 * s] *= o), (a[2 * s + 1] *= o); + for (s = 0; s < 5; s++) (r[4 * s] = i[2 * s]), (r[4 * s + 1] = i[2 * s + 1]), (r[4 * s + 2] = a[2 * s]), (r[4 * s + 3] = a[2 * s + 1]); + (r = an(r)), + this.generatePolygon("star", r), + this.generatePolygon("vee", [-1, -1, 0, -0.333, 1, -1, 0, 1]), + this.generatePolygon("rhomboid", [-1, -1, 0.333, -1, 1, 1, -0.333, 1]), + this.generatePolygon("right-rhomboid", [-0.333, -1, 1, -1, 0.333, 1, -1, 1]), + (this.nodeShapes.concavehexagon = this.generatePolygon( + "concave-hexagon", + [-1, -0.95, -0.75, 0, -1, 0.95, 1, 0.95, 0.75, 0, 1, -0.95], + )); + var l = [-1, -1, 0.25, -1, 1, 0, 0.25, 1, -1, 1]; + this.generatePolygon("tag", l), + this.generateRoundPolygon("round-tag", l), + (e.makePolygon = function (e) { + var n, + r = "polygon-" + e.join("$"); + return (n = this[r]) ? n : t.generatePolygon(r, e); + }); + }, + }, + ru = { + timeToRender: function () { + return this.redrawTotalTime / this.redrawCount; + }, + redraw: function (e) { + e = e || $e(); + var t = this; + void 0 === t.averageRedrawTime && (t.averageRedrawTime = 0), + void 0 === t.lastRedrawTime && (t.lastRedrawTime = 0), + void 0 === t.lastDrawTime && (t.lastDrawTime = 0), + (t.requestedFrame = !0), + (t.renderOptions = e); + }, + beforeRender: function (e, t) { + if (!this.destroyed) { + null == t && Ve("Priority is not optional for beforeRender"); + var n = this.beforeRenderCallbacks; + n.push({ fn: e, priority: t }), + n.sort(function (e, t) { + return t.priority - e.priority; + }); + } + }, + }, + iu = function (e, t, n) { + for (var r = e.beforeRenderCallbacks, i = 0; i < r.length; i++) r[i].fn(t, n); + }; + ru.startRenderLoop = function () { + var e = this, + t = e.cy; + if (!e.renderLoopStarted) { + e.renderLoopStarted = !0; + _e(function n(r) { + if (!e.destroyed) { + if (t.batching()); + else if (e.requestedFrame && !e.skipFrame) { + iu(e, !0, r); + var i = Te(); + e.render(e.renderOptions); + var a = (e.lastDrawTime = Te()); + void 0 === e.averageRedrawTime && (e.averageRedrawTime = a - i), + void 0 === e.redrawCount && (e.redrawCount = 0), + e.redrawCount++, + void 0 === e.redrawTotalTime && (e.redrawTotalTime = 0); + var o = a - i; + (e.redrawTotalTime += o), (e.lastRedrawTime = o), (e.averageRedrawTime = e.averageRedrawTime / 2 + o / 2), (e.requestedFrame = !1); + } else iu(e, !1, r); + (e.skipFrame = !1), _e(n); + } + }); + } + }; + var au = function (e) { + this.init(e); + }, + ou = au.prototype; + (ou.clientFunctions = ["redrawHint", "render", "renderTo", "matchCanvasSize", "nodeShapeImpl", "arrowShapeImpl"]), + (ou.init = function (e) { + var t = this; + (t.options = e), (t.cy = e.cy); + var n = (t.container = e.cy.container()), + r = t.cy.window(); + if (r) { + var i = r.document, + a = i.head, + o = "__________cytoscape_stylesheet", + s = "__________cytoscape_container", + l = null != i.getElementById(o); + if ((n.className.indexOf(s) < 0 && (n.className = (n.className || "") + " " + s), !l)) { + var u = i.createElement("style"); + (u.id = o), (u.textContent = "." + s + " { position: relative; }"), a.insertBefore(u, a.children[0]); + } + "static" === r.getComputedStyle(n).getPropertyValue("position") && + je("A Cytoscape container has style position:static and so can not use UI extensions properly"); + } + (t.selection = [void 0, void 0, void 0, void 0, 0]), + (t.bezierProjPcts = [0.05, 0.225, 0.4, 0.5, 0.6, 0.775, 0.95]), + (t.hoverData = { + down: null, + last: null, + downTime: null, + triggerMode: null, + dragging: !1, + initialPan: [null, null], + capture: !1, + }), + (t.dragData = { possibleDragElements: [] }), + (t.touchData = { + start: null, + capture: !1, + startPosition: [null, null, null, null, null, null], + singleTouchStartTime: null, + singleTouchMoved: !0, + now: [null, null, null, null, null, null], + earlier: [null, null, null, null, null, null], + }), + (t.redraws = 0), + (t.showFps = e.showFps), + (t.debug = e.debug), + (t.hideEdgesOnViewport = e.hideEdgesOnViewport), + (t.textureOnViewport = e.textureOnViewport), + (t.wheelSensitivity = e.wheelSensitivity), + (t.motionBlurEnabled = e.motionBlur), + (t.forcedPixelRatio = b(e.pixelRatio) ? e.pixelRatio : null), + (t.motionBlur = e.motionBlur), + (t.motionBlurOpacity = e.motionBlurOpacity), + (t.motionBlurTransparency = 1 - t.motionBlurOpacity), + (t.motionBlurPxRatio = 1), + (t.mbPxRBlurry = 1), + (t.minMbLowQualFrames = 4), + (t.fullQualityMb = !1), + (t.clearedForMotionBlur = []), + (t.desktopTapThreshold = e.desktopTapThreshold), + (t.desktopTapThreshold2 = e.desktopTapThreshold * e.desktopTapThreshold), + (t.touchTapThreshold = e.touchTapThreshold), + (t.touchTapThreshold2 = e.touchTapThreshold * e.touchTapThreshold), + (t.tapholdDuration = 500), + (t.bindings = []), + (t.beforeRenderCallbacks = []), + (t.beforeRenderPriorities = { + animations: 400, + eleCalcs: 300, + eleTxrDeq: 200, + lyrTxrDeq: 150, + lyrTxrSkip: 100, + }), + t.registerNodeShapes(), + t.registerArrowShapes(), + t.registerCalculationListeners(); + }), + (ou.notify = function (e, t) { + var n = this, + r = n.cy; + this.destroyed || + ("init" !== e + ? "destroy" !== e + ? (("add" === e || "remove" === e || ("move" === e && r.hasCompoundNodes()) || "load" === e || "zorder" === e || "mount" === e) && + n.invalidateCachedZSortedEles(), + "viewport" === e && n.redrawHint("select", !0), + ("load" !== e && "resize" !== e && "mount" !== e) || (n.invalidateContainerClientCoordsCache(), n.matchCanvasSize(n.container)), + n.redrawHint("eles", !0), + n.redrawHint("drag", !0), + this.startRenderLoop(), + this.redraw()) + : n.destroy() + : n.load()); + }), + (ou.destroy = function () { + var e = this; + (e.destroyed = !0), e.cy.stopAnimationLoop(); + for (var t = 0; t < e.bindings.length; t++) { + var n = e.bindings[t], + r = n.target; + (r.off || r.removeEventListener).apply(r, n.args); + } + if ( + ((e.bindings = []), + (e.beforeRenderCallbacks = []), + (e.onUpdateEleCalcsFns = []), + e.removeObserver && e.removeObserver.disconnect(), + e.styleObserver && e.styleObserver.disconnect(), + e.resizeObserver && e.resizeObserver.disconnect(), + e.labelCalcDiv) + ) + try { + document.body.removeChild(e.labelCalcDiv); + } catch (e) {} + }), + (ou.isHeadless = function () { + return !1; + }), + [zl, Jl, eu, tu, nu, ru].forEach(function (e) { + z(ou, e); + }); + var su = 1e3 / 60, + lu = function (e) { + return function () { + var t = this, + n = this.renderer; + if (!t.dequeueingSetup) { + t.dequeueingSetup = !0; + var r = be(function () { + n.redrawHint("eles", !0), n.redrawHint("drag", !0), n.redraw(); + }, e.deqRedrawThreshold), + i = e.priority || Xe; + n.beforeRender(function (i, a) { + var o = Te(), + s = n.averageRedrawTime, + l = n.lastRedrawTime, + u = [], + c = n.cy.extent(), + h = n.getPixelRatio(); + for (i || n.flushRenderedStyleQueue(); ; ) { + var d = Te(), + p = d - o, + g = d - a; + if (l < su) { + var f = su - (i ? s : 0); + if (g >= e.deqFastCost * f) break; + } else if (i) { + if (p >= e.deqCost * l || p >= e.deqAvgCost * s) break; + } else if (g >= e.deqNoDrawCost * su) break; + var v = e.deq(t, h, c); + if (!(v.length > 0)) break; + for (var y = 0; y < v.length; y++) u.push(v[y]); + } + u.length > 0 && (e.onDeqd(t, u), !i && e.shouldRedraw(t, u, h, c) && r()); + }, i(t)); + } + }; + }, + uu = (function () { + function e(n) { + var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Ge; + t(this, e), + (this.idsByKey = new tt()), + (this.keyForId = new tt()), + (this.cachesByLvl = new tt()), + (this.lvls = []), + (this.getKey = n), + (this.doesEleInvalidateKey = r); + } + return ( + i(e, [ + { + key: "getIdsFor", + value: function (e) { + null == e && Ve("Can not get id list for null key"); + var t = this.idsByKey, + n = this.idsByKey.get(e); + return n || ((n = new rt()), t.set(e, n)), n; + }, + }, + { + key: "addIdForKey", + value: function (e, t) { + null != e && this.getIdsFor(e).add(t); + }, + }, + { + key: "deleteIdForKey", + value: function (e, t) { + null != e && this.getIdsFor(e).delete(t); + }, + }, + { + key: "getNumberOfIdsForKey", + value: function (e) { + return null == e ? 0 : this.getIdsFor(e).size; + }, + }, + { + key: "updateKeyMappingFor", + value: function (e) { + var t = e.id(), + n = this.keyForId.get(t), + r = this.getKey(e); + this.deleteIdForKey(n, t), this.addIdForKey(r, t), this.keyForId.set(t, r); + }, + }, + { + key: "deleteKeyMappingFor", + value: function (e) { + var t = e.id(), + n = this.keyForId.get(t); + this.deleteIdForKey(n, t), this.keyForId.delete(t); + }, + }, + { + key: "keyHasChangedFor", + value: function (e) { + var t = e.id(); + return this.keyForId.get(t) !== this.getKey(e); + }, + }, + { + key: "isInvalid", + value: function (e) { + return this.keyHasChangedFor(e) || this.doesEleInvalidateKey(e); + }, + }, + { + key: "getCachesAt", + value: function (e) { + var t = this.cachesByLvl, + n = this.lvls, + r = t.get(e); + return r || ((r = new tt()), t.set(e, r), n.push(e)), r; + }, + }, + { + key: "getCache", + value: function (e, t) { + return this.getCachesAt(t).get(e); + }, + }, + { + key: "get", + value: function (e, t) { + var n = this.getKey(e), + r = this.getCache(n, t); + return null != r && this.updateKeyMappingFor(e), r; + }, + }, + { + key: "getForCachedKey", + value: function (e, t) { + var n = this.keyForId.get(e.id()); + return this.getCache(n, t); + }, + }, + { + key: "hasCache", + value: function (e, t) { + return this.getCachesAt(t).has(e); + }, + }, + { + key: "has", + value: function (e, t) { + var n = this.getKey(e); + return this.hasCache(n, t); + }, + }, + { + key: "setCache", + value: function (e, t, n) { + (n.key = e), this.getCachesAt(t).set(e, n); + }, + }, + { + key: "set", + value: function (e, t, n) { + var r = this.getKey(e); + this.setCache(r, t, n), this.updateKeyMappingFor(e); + }, + }, + { + key: "deleteCache", + value: function (e, t) { + this.getCachesAt(t).delete(e); + }, + }, + { + key: "delete", + value: function (e, t) { + var n = this.getKey(e); + this.deleteCache(n, t); + }, + }, + { + key: "invalidateKey", + value: function (e) { + var t = this; + this.lvls.forEach(function (n) { + return t.deleteCache(e, n); + }); + }, + }, + { + key: "invalidate", + value: function (e) { + var t = e.id(), + n = this.keyForId.get(t); + this.deleteKeyMappingFor(e); + var r = this.doesEleInvalidateKey(e); + return r && this.invalidateKey(n), r || 0 === this.getNumberOfIdsForKey(n); + }, + }, + ]), + e + ); + })(), + cu = { dequeue: "dequeue", downscale: "downscale", highQuality: "highQuality" }, + hu = Ke({ + getKey: null, + doesEleInvalidateKey: Ge, + drawElement: null, + getBoundingBox: null, + getRotationPoint: null, + getRotationOffset: null, + isVisible: ze, + allowEdgeTxrCaching: !0, + allowParentTxrCaching: !0, + }), + du = function (e, t) { + var n = this; + (n.renderer = e), (n.onDequeues = []); + var r = hu(t); + z(n, r), (n.lookup = new uu(r.getKey, r.doesEleInvalidateKey)), n.setupDequeueing(); + }, + pu = du.prototype; + (pu.reasons = cu), + (pu.getTextureQueue = function (e) { + var t = this; + return (t.eleImgCaches = t.eleImgCaches || {}), (t.eleImgCaches[e] = t.eleImgCaches[e] || []); + }), + (pu.getRetiredTextureQueue = function (e) { + var t = (this.eleImgCaches.retired = this.eleImgCaches.retired || {}); + return (t[e] = t[e] || []); + }), + (pu.getElementQueue = function () { + return (this.eleCacheQueue = + this.eleCacheQueue || + new lt(function (e, t) { + return t.reqs - e.reqs; + })); + }), + (pu.getElementKeyToQueue = function () { + return (this.eleKeyToCacheQueue = this.eleKeyToCacheQueue || {}); + }), + (pu.getElement = function (e, t, n, r, i) { + var a = this, + o = this.renderer, + s = o.cy.zoom(), + l = this.lookup; + if (!t || 0 === t.w || 0 === t.h || isNaN(t.w) || isNaN(t.h) || !e.visible() || e.removed()) return null; + if ((!a.allowEdgeTxrCaching && e.isEdge()) || (!a.allowParentTxrCaching && e.isParent())) return null; + if ((null == r && (r = Math.ceil(Ct(s * n))), r < -4)) r = -4; + else if (s >= 7.99 || r > 3) return null; + var u = Math.pow(2, r), + c = t.h * u, + h = t.w * u, + d = o.eleTextBiggerThanMin(e, u); + if (!this.isVisible(e, d)) return null; + var p, + g = l.get(e, r); + if ((g && g.invalidated && ((g.invalidated = !1), (g.texture.invalidatedWidth -= g.width)), g)) return g; + if (((p = c <= 25 ? 25 : c <= 50 ? 50 : 50 * Math.ceil(c / 50)), c > 1024 || h > 1024)) return null; + var f = a.getTextureQueue(p), + v = f[f.length - 2], + y = function () { + return a.recycleTexture(p, h) || a.addTexture(p, h); + }; + v || (v = f[f.length - 1]), v || (v = y()), v.width - v.usedWidth < h && (v = y()); + for ( + var m, + b = function (e) { + return e && e.scaledLabelShown === d; + }, + x = i && i === cu.dequeue, + w = i && i === cu.highQuality, + E = i && i === cu.downscale, + _ = r + 1; + _ <= 3; + _++ + ) { + var T = l.get(e, _); + if (T) { + m = T; + break; + } + } + var D = m && m.level === r + 1 ? m : null, + C = function () { + v.context.drawImage(D.texture.canvas, D.x, 0, D.width, D.height, v.usedWidth, 0, h, c); + }; + if ((v.context.setTransform(1, 0, 0, 1, 0, 0), v.context.clearRect(v.usedWidth, 0, h, p), b(D))) C(); + else if (b(m)) { + if (!w) return a.queueElement(e, m.level - 1), m; + for (var N = m.level; N > r; N--) D = a.getElement(e, t, n, N, cu.downscale); + C(); + } else { + var A; + if (!x && !w && !E) + for (var L = r - 1; L >= -4; L--) { + var k = l.get(e, L); + if (k) { + A = k; + break; + } + } + if (b(A)) return a.queueElement(e, r), A; + v.context.translate(v.usedWidth, 0), + v.context.scale(u, u), + this.drawElement(v.context, e, t, d, !1), + v.context.scale(1 / u, 1 / u), + v.context.translate(-v.usedWidth, 0); + } + return ( + (g = { + x: v.usedWidth, + texture: v, + level: r, + scale: u, + width: h, + height: c, + scaledLabelShown: d, + }), + (v.usedWidth += Math.ceil(h + 8)), + v.eleCaches.push(g), + l.set(e, r, g), + a.checkTextureFullness(v), + g + ); + }), + (pu.invalidateElements = function (e) { + for (var t = 0; t < e.length; t++) this.invalidateElement(e[t]); + }), + (pu.invalidateElement = function (e) { + var t = this, + n = t.lookup, + r = []; + if (n.isInvalid(e)) { + for (var i = -4; i <= 3; i++) { + var a = n.getForCachedKey(e, i); + a && r.push(a); + } + if (n.invalidate(e)) + for (var o = 0; o < r.length; o++) { + var s = r[o], + l = s.texture; + (l.invalidatedWidth += s.width), (s.invalidated = !0), t.checkTextureUtility(l); + } + t.removeFromQueue(e); + } + }), + (pu.checkTextureUtility = function (e) { + e.invalidatedWidth >= 0.2 * e.width && this.retireTexture(e); + }), + (pu.checkTextureFullness = function (e) { + var t = this.getTextureQueue(e.height); + e.usedWidth / e.width > 0.8 && e.fullnessChecks >= 10 ? Ze(t, e) : e.fullnessChecks++; + }), + (pu.retireTexture = function (e) { + var t = e.height, + n = this.getTextureQueue(t), + r = this.lookup; + Ze(n, e), (e.retired = !0); + for (var i = e.eleCaches, a = 0; a < i.length; a++) { + var o = i[a]; + r.deleteCache(o.key, o.level); + } + Qe(i), this.getRetiredTextureQueue(t).push(e); + }), + (pu.addTexture = function (e, t) { + var n = {}; + return ( + this.getTextureQueue(e).push(n), + (n.eleCaches = []), + (n.height = e), + (n.width = Math.max(1024, t)), + (n.usedWidth = 0), + (n.invalidatedWidth = 0), + (n.fullnessChecks = 0), + (n.canvas = this.renderer.makeOffscreenCanvas(n.width, n.height)), + (n.context = n.canvas.getContext("2d")), + n + ); + }), + (pu.recycleTexture = function (e, t) { + for (var n = this.getTextureQueue(e), r = this.getRetiredTextureQueue(e), i = 0; i < r.length; i++) { + var a = r[i]; + if (a.width >= t) + return ( + (a.retired = !1), + (a.usedWidth = 0), + (a.invalidatedWidth = 0), + (a.fullnessChecks = 0), + Qe(a.eleCaches), + a.context.setTransform(1, 0, 0, 1, 0, 0), + a.context.clearRect(0, 0, a.width, a.height), + Ze(r, a), + n.push(a), + a + ); + } + }), + (pu.queueElement = function (e, t) { + var n = this.getElementQueue(), + r = this.getElementKeyToQueue(), + i = this.getKey(e), + a = r[i]; + if (a) (a.level = Math.max(a.level, t)), a.eles.merge(e), a.reqs++, n.updateItem(a); + else { + var o = { eles: e.spawn().merge(e), level: t, reqs: 1, key: i }; + n.push(o), (r[i] = o); + } + }), + (pu.dequeue = function (e) { + for (var t = this, n = t.getElementQueue(), r = t.getElementKeyToQueue(), i = [], a = t.lookup, o = 0; o < 1 && n.size() > 0; o++) { + var s = n.pop(), + l = s.key, + u = s.eles[0], + c = a.hasCache(u, s.level); + if (((r[l] = null), !c)) { + i.push(s); + var h = t.getBoundingBox(u); + t.getElement(u, h, e, s.level, cu.dequeue); + } + } + return i; + }), + (pu.removeFromQueue = function (e) { + var t = this.getElementQueue(), + n = this.getElementKeyToQueue(), + r = this.getKey(e), + i = n[r]; + null != i && (1 === i.eles.length ? ((i.reqs = Fe), t.updateItem(i), t.pop(), (n[r] = null)) : i.eles.unmerge(e)); + }), + (pu.onDequeue = function (e) { + this.onDequeues.push(e); + }), + (pu.offDequeue = function (e) { + Ze(this.onDequeues, e); + }), + (pu.setupDequeueing = lu({ + deqRedrawThreshold: 100, + deqCost: 0.15, + deqAvgCost: 0.1, + deqNoDrawCost: 0.9, + deqFastCost: 0.9, + deq: function (e, t, n) { + return e.dequeue(t, n); + }, + onDeqd: function (e, t) { + for (var n = 0; n < e.onDequeues.length; n++) (0, e.onDequeues[n])(t); + }, + shouldRedraw: function (e, t, n, r) { + for (var i = 0; i < t.length; i++) + for (var a = t[i].eles, o = 0; o < a.length; o++) { + var s = a[o].boundingBox(); + if (zt(s, r)) return !0; + } + return !1; + }, + priority: function (e) { + return e.renderer.beforeRenderPriorities.eleTxrDeq; + }, + })); + var gu = function (e) { + var t = this, + n = (t.renderer = e), + r = n.cy; + (t.layersByLevel = {}), + (t.firstGet = !0), + (t.lastInvalidationTime = Te() - 500), + (t.skipping = !1), + (t.eleTxrDeqs = r.collection()), + (t.scheduleElementRefinement = be(function () { + t.refineElementTextures(t.eleTxrDeqs), t.eleTxrDeqs.unmerge(t.eleTxrDeqs); + }, 50)), + n.beforeRender(function (e, n) { + n - t.lastInvalidationTime <= 250 ? (t.skipping = !0) : (t.skipping = !1); + }, n.beforeRenderPriorities.lyrTxrSkip); + (t.layersQueue = new lt(function (e, t) { + return t.reqs - e.reqs; + })), + t.setupDequeueing(); + }, + fu = gu.prototype, + vu = 0, + yu = Math.pow(2, 53) - 1; + (fu.makeLayer = function (e, t) { + var n = Math.pow(2, t), + r = Math.ceil(e.w * n), + i = Math.ceil(e.h * n), + a = this.renderer.makeOffscreenCanvas(r, i), + o = { + id: (vu = ++vu % yu), + bb: e, + level: t, + width: r, + height: i, + canvas: a, + context: a.getContext("2d"), + eles: [], + elesQueue: [], + reqs: 0, + }, + s = o.context, + l = -o.bb.x1, + u = -o.bb.y1; + return s.scale(n, n), s.translate(l, u), o; + }), + (fu.getLayers = function (e, t, n) { + var r = this, + i = r.renderer.cy.zoom(), + a = r.firstGet; + if (((r.firstGet = !1), null == n)) + if ((n = Math.ceil(Ct(i * t))) < -4) n = -4; + else if (i >= 3.99 || n > 2) return null; + r.validateLayersElesOrdering(n, e); + var o, + s, + l = r.layersByLevel, + u = Math.pow(2, n), + c = (l[n] = l[n] || []); + if (r.levelIsComplete(n, e)) return c; + !(function () { + var t = function (t) { + if ((r.validateLayersElesOrdering(t, e), r.levelIsComplete(t, e))) return (s = l[t]), !0; + }, + i = function (e) { + if (!s) for (var r = n + e; -4 <= r && r <= 2 && !t(r); r += e); + }; + i(1), i(-1); + for (var a = c.length - 1; a >= 0; a--) { + var o = c[a]; + o.invalid && Ze(c, o); + } + })(); + var h = function (t) { + var i = (t = t || {}).after; + if ( + ((function () { + if (!o) { + o = Ot(); + for (var t = 0; t < e.length; t++) + (n = o), + (r = e[t].boundingBox()), + (n.x1 = Math.min(n.x1, r.x1)), + (n.x2 = Math.max(n.x2, r.x2)), + (n.w = n.x2 - n.x1), + (n.y1 = Math.min(n.y1, r.y1)), + (n.y2 = Math.max(n.y2, r.y2)), + (n.h = n.y2 - n.y1); + } + var n, r; + })(), + o.w * u * (o.h * u) > 16e6) + ) + return null; + var a = r.makeLayer(o, n); + if (null != i) { + var s = c.indexOf(i) + 1; + c.splice(s, 0, a); + } else (void 0 === t.insert || t.insert) && c.unshift(a); + return a; + }; + if (r.skipping && !a) return null; + for (var d = null, p = e.length / 1, g = !a, f = 0; f < e.length; f++) { + var v = e[f], + y = v._private.rscratch, + m = (y.imgLayerCaches = y.imgLayerCaches || {}), + b = m[n]; + if (b) d = b; + else { + if ((!d || d.eles.length >= p || !Yt(d.bb, v.boundingBox())) && !(d = h({ insert: !0, after: d }))) return null; + s || g ? r.queueLayer(d, v) : r.drawEleInLayer(d, v, n, t), d.eles.push(v), (m[n] = d); + } + } + return s || (g ? null : c); + }), + (fu.getEleLevelForLayerLevel = function (e, t) { + return e; + }), + (fu.drawEleInLayer = function (e, t, n, r) { + var i = this.renderer, + a = e.context, + o = t.boundingBox(); + 0 !== o.w && + 0 !== o.h && + t.visible() && + ((n = this.getEleLevelForLayerLevel(n, r)), + i.setImgSmoothing(a, !1), + i.drawCachedElement(a, t, null, null, n, true), + i.setImgSmoothing(a, !0)); + }), + (fu.levelIsComplete = function (e, t) { + var n = this.layersByLevel[e]; + if (!n || 0 === n.length) return !1; + for (var r = 0, i = 0; i < n.length; i++) { + var a = n[i]; + if (a.reqs > 0) return !1; + if (a.invalid) return !1; + r += a.eles.length; + } + return r === t.length; + }), + (fu.validateLayersElesOrdering = function (e, t) { + var n = this.layersByLevel[e]; + if (n) + for (var r = 0; r < n.length; r++) { + for (var i = n[r], a = -1, o = 0; o < t.length; o++) + if (i.eles[0] === t[o]) { + a = o; + break; + } + if (a < 0) this.invalidateLayer(i); + else { + var s = a; + for (o = 0; o < i.eles.length; o++) + if (i.eles[o] !== t[s + o]) { + this.invalidateLayer(i); + break; + } + } + } + }), + (fu.updateElementsInLayers = function (e, t) { + for (var n = E(e[0]), r = 0; r < e.length; r++) + for ( + var i = n ? null : e[r], a = n ? e[r] : e[r].ele, o = a._private.rscratch, s = (o.imgLayerCaches = o.imgLayerCaches || {}), l = -4; + l <= 2; + l++ + ) { + var u = s[l]; + u && ((i && this.getEleLevelForLayerLevel(u.level) !== i.level) || t(u, a, i)); + } + }), + (fu.haveLayers = function () { + for (var e = !1, t = -4; t <= 2; t++) { + var n = this.layersByLevel[t]; + if (n && n.length > 0) { + e = !0; + break; + } + } + return e; + }), + (fu.invalidateElements = function (e) { + var t = this; + 0 !== e.length && + ((t.lastInvalidationTime = Te()), + 0 !== e.length && + t.haveLayers() && + t.updateElementsInLayers(e, function (e, n, r) { + t.invalidateLayer(e); + })); + }), + (fu.invalidateLayer = function (e) { + if (((this.lastInvalidationTime = Te()), !e.invalid)) { + var t = e.level, + n = e.eles, + r = this.layersByLevel[t]; + Ze(r, e), (e.elesQueue = []), (e.invalid = !0), e.replacement && (e.replacement.invalid = !0); + for (var i = 0; i < n.length; i++) { + var a = n[i]._private.rscratch.imgLayerCaches; + a && (a[t] = null); + } + } + }), + (fu.refineElementTextures = function (e) { + var t = this; + t.updateElementsInLayers(e, function (e, n, r) { + var i = e.replacement; + if ((i || (((i = e.replacement = t.makeLayer(e.bb, e.level)).replaces = e), (i.eles = e.eles)), !i.reqs)) + for (var a = 0; a < i.eles.length; a++) t.queueLayer(i, i.eles[a]); + }); + }), + (fu.enqueueElementRefinement = function (e) { + this.eleTxrDeqs.merge(e), this.scheduleElementRefinement(); + }), + (fu.queueLayer = function (e, t) { + var n = this.layersQueue, + r = e.elesQueue, + i = (r.hasId = r.hasId || {}); + if (!e.replacement) { + if (t) { + if (i[t.id()]) return; + r.push(t), (i[t.id()] = !0); + } + e.reqs ? (e.reqs++, n.updateItem(e)) : ((e.reqs = 1), n.push(e)); + } + }), + (fu.dequeue = function (e) { + for (var t = this, n = t.layersQueue, r = [], i = 0; i < 1 && 0 !== n.size(); ) { + var a = n.peek(); + if (a.replacement) n.pop(); + else if (a.replaces && a !== a.replaces.replacement) n.pop(); + else if (a.invalid) n.pop(); + else { + var o = a.elesQueue.shift(); + o && (t.drawEleInLayer(a, o, a.level, e), i++), + 0 === r.length && r.push(!0), + 0 === a.elesQueue.length && (n.pop(), (a.reqs = 0), a.replaces && t.applyLayerReplacement(a), t.requestRedraw()); + } + } + return r; + }), + (fu.applyLayerReplacement = function (e) { + var t = this.layersByLevel[e.level], + n = e.replaces, + r = t.indexOf(n); + if (!(r < 0 || n.invalid)) { + t[r] = e; + for (var i = 0; i < e.eles.length; i++) { + var a = e.eles[i]._private, + o = (a.imgLayerCaches = a.imgLayerCaches || {}); + o && (o[e.level] = e); + } + this.requestRedraw(); + } + }), + (fu.requestRedraw = be(function () { + var e = this.renderer; + e.redrawHint("eles", !0), e.redrawHint("drag", !0), e.redraw(); + }, 100)), + (fu.setupDequeueing = lu({ + deqRedrawThreshold: 50, + deqCost: 0.15, + deqAvgCost: 0.1, + deqNoDrawCost: 0.9, + deqFastCost: 0.9, + deq: function (e, t) { + return e.dequeue(t); + }, + onDeqd: Xe, + shouldRedraw: ze, + priority: function (e) { + return e.renderer.beforeRenderPriorities.lyrTxrDeq; + }, + })); + var mu, + bu = {}; + function xu(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n]; + e.lineTo(r.x, r.y); + } + } + function wu(e, t, n) { + for (var r, i = 0; i < t.length; i++) { + var a = t[i]; + 0 === i && (r = a), e.lineTo(a.x, a.y); + } + e.quadraticCurveTo(n.x, n.y, r.x, r.y); + } + function Eu(e, t, n) { + e.beginPath && e.beginPath(); + for (var r = t, i = 0; i < r.length; i++) { + var a = r[i]; + e.lineTo(a.x, a.y); + } + var o = n, + s = n[0]; + for (e.moveTo(s.x, s.y), i = 1; i < o.length; i++) (a = o[i]), e.lineTo(a.x, a.y); + e.closePath && e.closePath(); + } + function _u(e, t, n, r, i) { + e.beginPath && e.beginPath(), e.arc(n, r, i, 0, 2 * Math.PI, !1); + var a = t, + o = a[0]; + e.moveTo(o.x, o.y); + for (var s = 0; s < a.length; s++) { + var l = a[s]; + e.lineTo(l.x, l.y); + } + e.closePath && e.closePath(); + } + function Tu(e, t, n, r) { + e.arc(t, n, r, 0, 2 * Math.PI, !1); + } + bu.arrowShapeImpl = function (e) { + return (mu || + (mu = { + polygon: xu, + "triangle-backcurve": wu, + "triangle-tee": Eu, + "circle-triangle": _u, + "triangle-cross": Eu, + circle: Tu, + }))[e]; + }; + var Du = { + drawElement: function (e, t, n, r, i, a) { + t.isNode() ? this.drawNode(e, t, n, r, i, a) : this.drawEdge(e, t, n, r, i, a); + }, + drawElementOverlay: function (e, t) { + t.isNode() ? this.drawNodeOverlay(e, t) : this.drawEdgeOverlay(e, t); + }, + drawElementUnderlay: function (e, t) { + t.isNode() ? this.drawNodeUnderlay(e, t) : this.drawEdgeUnderlay(e, t); + }, + drawCachedElementPortion: function (e, t, n, r, i, a, o, s) { + var l = this, + u = n.getBoundingBox(t); + if (0 !== u.w && 0 !== u.h) { + var c = n.getElement(t, u, r, i, a); + if (null != c) { + var h = s(l, t); + if (0 === h) return; + var d, + p, + g, + f, + v, + y, + m = o(l, t), + b = u.x1, + x = u.y1, + w = u.w, + E = u.h; + if (0 !== m) { + var _ = n.getRotationPoint(t); + (g = _.x), (f = _.y), e.translate(g, f), e.rotate(m), (v = l.getImgSmoothing(e)) || l.setImgSmoothing(e, !0); + var T = n.getRotationOffset(t); + (d = T.x), (p = T.y); + } else (d = b), (p = x); + 1 !== h && ((y = e.globalAlpha), (e.globalAlpha = y * h)), + e.drawImage(c.texture.canvas, c.x, 0, c.width, c.height, d, p, w, E), + 1 !== h && (e.globalAlpha = y), + 0 !== m && (e.rotate(-m), e.translate(-g, -f), v || l.setImgSmoothing(e, !1)); + } else n.drawElement(e, t); + } + }, + }, + Cu = function () { + return 0; + }, + Nu = function (e, t) { + return e.getTextAngle(t, null); + }, + Au = function (e, t) { + return e.getTextAngle(t, "source"); + }, + Lu = function (e, t) { + return e.getTextAngle(t, "target"); + }, + ku = function (e, t) { + return t.effectiveOpacity(); + }, + Su = function (e, t) { + return t.pstyle("text-opacity").pfValue * t.effectiveOpacity(); + }; + (Du.drawCachedElement = function (e, t, n, r, i, a) { + var o = this, + s = o.data, + l = s.eleTxrCache, + u = s.lblTxrCache, + c = s.slbTxrCache, + h = s.tlbTxrCache, + d = t.boundingBox(), + p = !0 === a ? l.reasons.highQuality : null; + if (0 !== d.w && 0 !== d.h && t.visible() && (!r || zt(d, r))) { + var g = t.isEdge(), + f = t.element()._private.rscratch.badLine; + o.drawElementUnderlay(e, t), + o.drawCachedElementPortion(e, t, l, n, i, p, Cu, ku), + (g && f) || o.drawCachedElementPortion(e, t, u, n, i, p, Nu, Su), + g && !f && (o.drawCachedElementPortion(e, t, c, n, i, p, Au, Su), o.drawCachedElementPortion(e, t, h, n, i, p, Lu, Su)), + o.drawElementOverlay(e, t); + } + }), + (Du.drawElements = function (e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n]; + this.drawElement(e, r); + } + }), + (Du.drawCachedElements = function (e, t, n, r) { + for (var i = 0; i < t.length; i++) { + var a = t[i]; + this.drawCachedElement(e, a, n, r); + } + }), + (Du.drawCachedNodes = function (e, t, n, r) { + for (var i = 0; i < t.length; i++) { + var a = t[i]; + a.isNode() && this.drawCachedElement(e, a, n, r); + } + }), + (Du.drawLayeredElements = function (e, t, n, r) { + var i = this.data.lyrTxrCache.getLayers(t, n); + if (i) + for (var a = 0; a < i.length; a++) { + var o = i[a], + s = o.bb; + 0 !== s.w && 0 !== s.h && e.drawImage(o.canvas, s.x1, s.y1, s.w, s.h); + } + else this.drawCachedElements(e, t, n, r); + }); + var Iu = { + drawEdge: function (e, t, n) { + var r = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3], + i = !(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4], + a = !(arguments.length > 5 && void 0 !== arguments[5]) || arguments[5], + o = this, + s = t._private.rscratch; + if ((!a || t.visible()) && !s.badLine && null != s.allpts && !isNaN(s.allpts[0])) { + var l; + n && ((l = n), e.translate(-l.x1, -l.y1)); + var u = a ? t.pstyle("opacity").value : 1, + c = a ? t.pstyle("line-opacity").value : 1, + h = t.pstyle("curve-style").value, + d = t.pstyle("line-style").value, + p = t.pstyle("width").pfValue, + g = t.pstyle("line-cap").value, + f = u * c, + v = u * c, + y = function () { + var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : f; + "straight-triangle" === h + ? (o.eleStrokeStyle(e, t, n), o.drawEdgeTrianglePath(t, e, s.allpts)) + : ((e.lineWidth = p), (e.lineCap = g), o.eleStrokeStyle(e, t, n), o.drawEdgePath(t, e, s.allpts, d), (e.lineCap = "butt")); + }, + m = function () { + var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : v; + o.drawArrowheads(e, t, n); + }; + if (((e.lineJoin = "round"), "yes" === t.pstyle("ghost").value)) { + var b = t.pstyle("ghost-offset-x").pfValue, + x = t.pstyle("ghost-offset-y").pfValue, + w = t.pstyle("ghost-opacity").value, + E = f * w; + e.translate(b, x), y(E), m(E), e.translate(-b, -x); + } + i && o.drawEdgeUnderlay(e, t), y(), m(), i && o.drawEdgeOverlay(e, t), o.drawElementText(e, t, null, r), n && e.translate(l.x1, l.y1); + } + }, + }, + Mu = function (e) { + if (!["overlay", "underlay"].includes(e)) throw new Error("Invalid state"); + return function (t, n) { + if (n.visible()) { + var r = n.pstyle("".concat(e, "-opacity")).value; + if (0 !== r) { + var i = this, + a = i.usePaths(), + o = n._private.rscratch, + s = 2 * n.pstyle("".concat(e, "-padding")).pfValue, + l = n.pstyle("".concat(e, "-color")).value; + (t.lineWidth = s), + "self" !== o.edgeType || a ? (t.lineCap = "round") : (t.lineCap = "butt"), + i.colorStrokeStyle(t, l[0], l[1], l[2], r), + i.drawEdgePath(n, t, o.allpts, "solid"); + } + } + }; + }; + (Iu.drawEdgeOverlay = Mu("overlay")), + (Iu.drawEdgeUnderlay = Mu("underlay")), + (Iu.drawEdgePath = function (e, t, n, r) { + var i, + a = e._private.rscratch, + o = t, + s = !1, + l = this.usePaths(), + u = e.pstyle("line-dash-pattern").pfValue, + c = e.pstyle("line-dash-offset").pfValue; + if (l) { + var h = n.join("$"); + a.pathCacheKey && a.pathCacheKey === h + ? ((i = t = a.pathCache), (s = !0)) + : ((i = t = new Path2D()), (a.pathCacheKey = h), (a.pathCache = i)); + } + if (o.setLineDash) + switch (r) { + case "dotted": + o.setLineDash([1, 1]); + break; + case "dashed": + o.setLineDash(u), (o.lineDashOffset = c); + break; + case "solid": + o.setLineDash([]); + } + if (!s && !a.badLine) + switch ((t.beginPath && t.beginPath(), t.moveTo(n[0], n[1]), a.edgeType)) { + case "bezier": + case "self": + case "compound": + case "multibezier": + for (var d = 2; d + 3 < n.length; d += 4) t.quadraticCurveTo(n[d], n[d + 1], n[d + 2], n[d + 3]); + break; + case "straight": + case "segments": + case "haystack": + for (var p = 2; p + 1 < n.length; p += 2) t.lineTo(n[p], n[p + 1]); + } + (t = o), l ? t.stroke(i) : t.stroke(), t.setLineDash && t.setLineDash([]); + }), + (Iu.drawEdgeTrianglePath = function (e, t, n) { + t.fillStyle = t.strokeStyle; + for (var r = e.pstyle("width").pfValue, i = 0; i + 1 < n.length; i += 2) { + var a = [n[i + 2] - n[i], n[i + 3] - n[i + 1]], + o = Math.sqrt(a[0] * a[0] + a[1] * a[1]), + s = [a[1] / o, -a[0] / o], + l = [(s[0] * r) / 2, (s[1] * r) / 2]; + t.beginPath(), + t.moveTo(n[i] - l[0], n[i + 1] - l[1]), + t.lineTo(n[i] + l[0], n[i + 1] + l[1]), + t.lineTo(n[i + 2], n[i + 3]), + t.closePath(), + t.fill(); + } + }), + (Iu.drawArrowheads = function (e, t, n) { + var r = t._private.rscratch, + i = "haystack" === r.edgeType; + i || this.drawArrowhead(e, t, "source", r.arrowStartX, r.arrowStartY, r.srcArrowAngle, n), + this.drawArrowhead(e, t, "mid-target", r.midX, r.midY, r.midtgtArrowAngle, n), + this.drawArrowhead(e, t, "mid-source", r.midX, r.midY, r.midsrcArrowAngle, n), + i || this.drawArrowhead(e, t, "target", r.arrowEndX, r.arrowEndY, r.tgtArrowAngle, n); + }), + (Iu.drawArrowhead = function (e, t, n, r, i, a, o) { + if (!(isNaN(r) || null == r || isNaN(i) || null == i || isNaN(a) || null == a)) { + var s = this, + l = t.pstyle(n + "-arrow-shape").value; + if ("none" !== l) { + var u = "hollow" === t.pstyle(n + "-arrow-fill").value ? "both" : "filled", + c = t.pstyle(n + "-arrow-fill").value, + h = t.pstyle("width").pfValue, + d = t.pstyle("opacity").value; + void 0 === o && (o = d); + var p = e.globalCompositeOperation; + (1 === o && "hollow" !== c) || + ((e.globalCompositeOperation = "destination-out"), + s.colorFillStyle(e, 255, 255, 255, 1), + s.colorStrokeStyle(e, 255, 255, 255, 1), + s.drawArrowShape(t, e, u, h, l, r, i, a), + (e.globalCompositeOperation = p)); + var g = t.pstyle(n + "-arrow-color").value; + s.colorFillStyle(e, g[0], g[1], g[2], o), s.colorStrokeStyle(e, g[0], g[1], g[2], o), s.drawArrowShape(t, e, c, h, l, r, i, a); + } + } + }), + (Iu.drawArrowShape = function (e, t, n, r, i, a, o, s) { + var l, + u = this, + c = this.usePaths() && "triangle-cross" !== i, + h = !1, + d = t, + p = { x: a, y: o }, + g = e.pstyle("arrow-scale").value, + f = this.getArrowWidth(r, g), + v = u.arrowShapes[i]; + if (c) { + var y = (u.arrowPathCache = u.arrowPathCache || []), + m = Ie(i), + b = y[m]; + null != b ? ((l = t = b), (h = !0)) : ((l = t = new Path2D()), (y[m] = l)); + } + h || (t.beginPath && t.beginPath(), c ? v.draw(t, 1, 0, { x: 0, y: 0 }, 1) : v.draw(t, f, s, p, r), t.closePath && t.closePath()), + (t = d), + c && (t.translate(a, o), t.rotate(s), t.scale(f, f)), + ("filled" !== n && "both" !== n) || (c ? t.fill(l) : t.fill()), + ("hollow" !== n && "both" !== n) || + ((t.lineWidth = (v.matchEdgeWidth ? r : 1) / (c ? f : 1)), (t.lineJoin = "miter"), c ? t.stroke(l) : t.stroke()), + c && (t.scale(1 / f, 1 / f), t.rotate(-s), t.translate(-a, -o)); + }); + var Ou = { + safeDrawImage: function (e, t, n, r, i, a, o, s, l, u) { + if (!(i <= 0 || a <= 0 || l <= 0 || u <= 0)) + try { + e.drawImage(t, n, r, i, a, o, s, l, u); + } catch (e) { + je(e); + } + }, + drawInscribedImage: function (e, t, n, r, i) { + var a = this, + o = n.position(), + s = o.x, + l = o.y, + u = n.cy().style(), + c = u.getIndexedStyle.bind(u), + h = c(n, "background-fit", "value", r), + d = c(n, "background-repeat", "value", r), + p = n.width(), + g = n.height(), + f = 2 * n.padding(), + v = p + ("inner" === c(n, "background-width-relative-to", "value", r) ? 0 : f), + y = g + ("inner" === c(n, "background-height-relative-to", "value", r) ? 0 : f), + m = n._private.rscratch, + b = "node" === c(n, "background-clip", "value", r), + x = c(n, "background-image-opacity", "value", r) * i, + w = c(n, "background-image-smoothing", "value", r), + E = t.width || t.cachedW, + _ = t.height || t.cachedH; + (null != E && null != _) || + (document.body.appendChild(t), + (E = t.cachedW = t.width || t.offsetWidth), + (_ = t.cachedH = t.height || t.offsetHeight), + document.body.removeChild(t)); + var T = E, + D = _; + if ( + ("auto" !== c(n, "background-width", "value", r) && + (T = + "%" === c(n, "background-width", "units", r) + ? c(n, "background-width", "pfValue", r) * v + : c(n, "background-width", "pfValue", r)), + "auto" !== c(n, "background-height", "value", r) && + (D = + "%" === c(n, "background-height", "units", r) + ? c(n, "background-height", "pfValue", r) * y + : c(n, "background-height", "pfValue", r)), + 0 !== T && 0 !== D) + ) { + if ("contain" === h) (T *= C = Math.min(v / T, y / D)), (D *= C); + else if ("cover" === h) { + var C; + (T *= C = Math.max(v / T, y / D)), (D *= C); + } + var N = s - v / 2, + A = c(n, "background-position-x", "units", r), + L = c(n, "background-position-x", "pfValue", r); + N += "%" === A ? (v - T) * L : L; + var k = c(n, "background-offset-x", "units", r), + S = c(n, "background-offset-x", "pfValue", r); + N += "%" === k ? (v - T) * S : S; + var I = l - y / 2, + M = c(n, "background-position-y", "units", r), + O = c(n, "background-position-y", "pfValue", r); + I += "%" === M ? (y - D) * O : O; + var P = c(n, "background-offset-y", "units", r), + R = c(n, "background-offset-y", "pfValue", r); + (I += "%" === P ? (y - D) * R : R), m.pathCache && ((N -= s), (I -= l), (s = 0), (l = 0)); + var B = e.globalAlpha; + e.globalAlpha = x; + var F = a.getImgSmoothing(e), + z = !1; + if ( + ("no" === w && F ? (a.setImgSmoothing(e, !1), (z = !0)) : "yes" !== w || F || (a.setImgSmoothing(e, !0), (z = !0)), + "no-repeat" === d) + ) + b && (e.save(), m.pathCache ? e.clip(m.pathCache) : (a.nodeShapes[a.getNodeShape(n)].draw(e, s, l, v, y), e.clip())), + a.safeDrawImage(e, t, 0, 0, E, _, N, I, T, D), + b && e.restore(); + else { + var G = e.createPattern(t, d); + (e.fillStyle = G), a.nodeShapes[a.getNodeShape(n)].draw(e, s, l, v, y), e.translate(N, I), e.fill(), e.translate(-N, -I); + } + (e.globalAlpha = B), z && a.setImgSmoothing(e, F); + } + }, + }, + Pu = {}; + (Pu.eleTextBiggerThanMin = function (e, t) { + if (!t) { + var n = e.cy().zoom(), + r = this.getPixelRatio(), + i = Math.ceil(Ct(n * r)); + t = Math.pow(2, i); + } + return !(e.pstyle("font-size").pfValue * t < e.pstyle("min-zoomed-font-size").pfValue); + }), + (Pu.drawElementText = function (e, t, n, r, i) { + var a = !(arguments.length > 5 && void 0 !== arguments[5]) || arguments[5], + o = this; + if (null == r) { + if (a && !o.eleTextBiggerThanMin(t)) return; + } else if (!1 === r) return; + if (t.isNode()) { + var s = t.pstyle("label"); + if (!s || !s.value) return; + var l = o.getLabelJustification(t); + (e.textAlign = l), (e.textBaseline = "bottom"); + } else { + var u = t.element()._private.rscratch.badLine, + c = t.pstyle("label"), + h = t.pstyle("source-label"), + d = t.pstyle("target-label"); + if (u || ((!c || !c.value) && (!h || !h.value) && (!d || !d.value))) return; + (e.textAlign = "center"), (e.textBaseline = "bottom"); + } + var p, + g = !n; + n && ((p = n), e.translate(-p.x1, -p.y1)), + null == i + ? (o.drawText(e, t, null, g, a), t.isEdge() && (o.drawText(e, t, "source", g, a), o.drawText(e, t, "target", g, a))) + : o.drawText(e, t, i, g, a), + n && e.translate(p.x1, p.y1); + }), + (Pu.getFontCache = function (e) { + var t; + this.fontCaches = this.fontCaches || []; + for (var n = 0; n < this.fontCaches.length; n++) if ((t = this.fontCaches[n]).context === e) return t; + return (t = { context: e }), this.fontCaches.push(t), t; + }), + (Pu.setupTextStyle = function (e, t) { + var n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], + r = t.pstyle("font-style").strValue, + i = t.pstyle("font-size").pfValue + "px", + a = t.pstyle("font-family").strValue, + o = t.pstyle("font-weight").strValue, + s = n ? t.effectiveOpacity() * t.pstyle("text-opacity").value : 1, + l = t.pstyle("text-outline-opacity").value * s, + u = t.pstyle("color").value, + c = t.pstyle("text-outline-color").value; + (e.font = r + " " + o + " " + i + " " + a), + (e.lineJoin = "round"), + this.colorFillStyle(e, u[0], u[1], u[2], s), + this.colorStrokeStyle(e, c[0], c[1], c[2], l); + }), + (Pu.getTextAngle = function (e, t) { + var n = e._private.rscratch, + r = t ? t + "-" : "", + i = e.pstyle(r + "text-rotation"), + a = Je(n, "labelAngle", t); + return "autorotate" === i.strValue ? (e.isEdge() ? a : 0) : "none" === i.strValue ? 0 : i.pfValue; + }), + (Pu.drawText = function (e, t, n) { + var r = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3], + i = !(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4], + a = t._private.rscratch, + o = i ? t.effectiveOpacity() : 1; + if (!i || (0 !== o && 0 !== t.pstyle("text-opacity").value)) { + "main" === n && (n = null); + var s, + l, + u = Je(a, "labelX", n), + c = Je(a, "labelY", n), + h = this.getLabelText(t, n); + if (null != h && "" !== h && !isNaN(u) && !isNaN(c)) { + this.setupTextStyle(e, t, i); + var d, + p = n ? n + "-" : "", + g = Je(a, "labelWidth", n), + f = Je(a, "labelHeight", n), + v = t.pstyle(p + "text-margin-x").pfValue, + y = t.pstyle(p + "text-margin-y").pfValue, + m = t.isEdge(), + b = t.pstyle("text-halign").value, + x = t.pstyle("text-valign").value; + switch ( + (m && ((b = "center"), (x = "center")), + (u += v), + (c += y), + 0 !== (d = r ? this.getTextAngle(t, n) : 0) && ((s = u), (l = c), e.translate(s, l), e.rotate(d), (u = 0), (c = 0)), + x) + ) { + case "top": + break; + case "center": + c += f / 2; + break; + case "bottom": + c += f; + } + var w = t.pstyle("text-background-opacity").value, + E = t.pstyle("text-border-opacity").value, + _ = t.pstyle("text-border-width").pfValue, + T = t.pstyle("text-background-padding").pfValue; + if (w > 0 || (_ > 0 && E > 0)) { + var D = u - T; + switch (b) { + case "left": + D -= g; + break; + case "center": + D -= g / 2; + } + var C = c - f - T, + N = g + 2 * T, + A = f + 2 * T; + if (w > 0) { + var L = e.fillStyle, + k = t.pstyle("text-background-color").value; + (e.fillStyle = "rgba(" + k[0] + "," + k[1] + "," + k[2] + "," + w * o + ")"), + 0 === t.pstyle("text-background-shape").strValue.indexOf("round") + ? (function (e, t, n, r, i) { + var a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 5; + e.beginPath(), + e.moveTo(t + a, n), + e.lineTo(t + r - a, n), + e.quadraticCurveTo(t + r, n, t + r, n + a), + e.lineTo(t + r, n + i - a), + e.quadraticCurveTo(t + r, n + i, t + r - a, n + i), + e.lineTo(t + a, n + i), + e.quadraticCurveTo(t, n + i, t, n + i - a), + e.lineTo(t, n + a), + e.quadraticCurveTo(t, n, t + a, n), + e.closePath(), + e.fill(); + })(e, D, C, N, A, 2) + : e.fillRect(D, C, N, A), + (e.fillStyle = L); + } + if (_ > 0 && E > 0) { + var S = e.strokeStyle, + I = e.lineWidth, + M = t.pstyle("text-border-color").value, + O = t.pstyle("text-border-style").value; + if (((e.strokeStyle = "rgba(" + M[0] + "," + M[1] + "," + M[2] + "," + E * o + ")"), (e.lineWidth = _), e.setLineDash)) + switch (O) { + case "dotted": + e.setLineDash([1, 1]); + break; + case "dashed": + e.setLineDash([4, 2]); + break; + case "double": + (e.lineWidth = _ / 4), e.setLineDash([]); + break; + case "solid": + e.setLineDash([]); + } + if ((e.strokeRect(D, C, N, A), "double" === O)) { + var P = _ / 2; + e.strokeRect(D + P, C + P, N - 2 * P, A - 2 * P); + } + e.setLineDash && e.setLineDash([]), (e.lineWidth = I), (e.strokeStyle = S); + } + } + var R = 2 * t.pstyle("text-outline-width").pfValue; + if ((R > 0 && (e.lineWidth = R), "wrap" === t.pstyle("text-wrap").value)) { + var B = Je(a, "labelWrapCachedLines", n), + F = Je(a, "labelLineHeight", n), + z = g / 2, + G = this.getLabelJustification(t); + switch ( + ("auto" === G || + ("left" === b + ? "left" === G + ? (u += -g) + : "center" === G && (u += -z) + : "center" === b + ? "left" === G + ? (u += -z) + : "right" === G && (u += z) + : "right" === b && ("center" === G ? (u += z) : "right" === G && (u += g))), + x) + ) { + case "top": + case "center": + case "bottom": + c -= (B.length - 1) * F; + } + for (var Y = 0; Y < B.length; Y++) R > 0 && e.strokeText(B[Y], u, c), e.fillText(B[Y], u, c), (c += F); + } else R > 0 && e.strokeText(h, u, c), e.fillText(h, u, c); + 0 !== d && (e.rotate(-d), e.translate(-s, -l)); + } + } + }); + var Ru = { + drawNode: function (e, t, n) { + var r, + i, + a = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3], + o = !(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4], + s = !(arguments.length > 5 && void 0 !== arguments[5]) || arguments[5], + l = this, + u = t._private, + c = u.rscratch, + h = t.position(); + if (b(h.x) && b(h.y) && (!s || t.visible())) { + var d, + p, + g = s ? t.effectiveOpacity() : 1, + f = l.usePaths(), + v = !1, + y = t.padding(); + (r = t.width() + 2 * y), (i = t.height() + 2 * y), n && ((p = n), e.translate(-p.x1, -p.y1)); + for (var m = t.pstyle("background-image").value, x = new Array(m.length), w = new Array(m.length), E = 0, _ = 0; _ < m.length; _++) { + var T = m[_]; + if ((x[_] = null != T && "none" !== T)) { + var D = t.cy().style().getIndexedStyle(t, "background-image-crossorigin", "value", _); + E++, + (w[_] = l.getCachedImage(T, D, function () { + (u.backgroundTimestamp = Date.now()), t.emitAndNotify("background"); + })); + } + } + var C = t.pstyle("background-blacken").value, + N = t.pstyle("border-width").pfValue, + A = t.pstyle("background-opacity").value * g, + L = t.pstyle("border-color").value, + k = t.pstyle("border-style").value, + S = t.pstyle("border-opacity").value * g; + e.lineJoin = "miter"; + var I = function () { + var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : A; + l.eleFillStyle(e, t, n); + }, + M = function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : S; + l.colorStrokeStyle(e, L[0], L[1], L[2], t); + }, + O = t.pstyle("shape").strValue, + P = t.pstyle("shape-polygon-points").pfValue; + if (f) { + e.translate(h.x, h.y); + var R = (l.nodePathCache = l.nodePathCache || []), + B = Me("polygon" === O ? O + "," + P.join(",") : O, "" + i, "" + r), + F = R[B]; + null != F ? ((d = F), (v = !0), (c.pathCache = d)) : ((d = new Path2D()), (R[B] = c.pathCache = d)); + } + var z = function () { + if (!v) { + var n = h; + f && (n = { x: 0, y: 0 }), l.nodeShapes[l.getNodeShape(t)].draw(d || e, n.x, n.y, r, i); + } + f ? e.fill(d) : e.fill(); + }, + G = function () { + for ( + var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : g, + r = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], + i = u.backgrounding, + a = 0, + o = 0; + o < w.length; + o++ + ) { + var s = t.cy().style().getIndexedStyle(t, "background-image-containment", "value", o); + (r && "over" === s) || (!r && "inside" === s) + ? a++ + : x[o] && w[o].complete && !w[o].error && (a++, l.drawInscribedImage(e, w[o], t, o, n)); + } + (u.backgrounding = !(a === E)), i !== u.backgrounding && t.updateStyle(!1); + }, + Y = function () { + var n = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], + a = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : g; + l.hasPie(t) && (l.drawPie(e, t, a), n && (f || l.nodeShapes[l.getNodeShape(t)].draw(e, h.x, h.y, r, i))); + }, + X = function () { + var t = (C > 0 ? C : -C) * (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : g), + n = C > 0 ? 0 : 255; + 0 !== C && (l.colorFillStyle(e, n, n, n, t), f ? e.fill(d) : e.fill()); + }, + V = function () { + if (N > 0) { + if (((e.lineWidth = N), (e.lineCap = "butt"), e.setLineDash)) + switch (k) { + case "dotted": + e.setLineDash([1, 1]); + break; + case "dashed": + e.setLineDash([4, 2]); + break; + case "solid": + case "double": + e.setLineDash([]); + } + if ((f ? e.stroke(d) : e.stroke(), "double" === k)) { + e.lineWidth = N / 3; + var t = e.globalCompositeOperation; + (e.globalCompositeOperation = "destination-out"), f ? e.stroke(d) : e.stroke(), (e.globalCompositeOperation = t); + } + e.setLineDash && e.setLineDash([]); + } + }; + if ("yes" === t.pstyle("ghost").value) { + var U = t.pstyle("ghost-offset-x").pfValue, + j = t.pstyle("ghost-offset-y").pfValue, + q = t.pstyle("ghost-opacity").value, + H = q * g; + e.translate(U, j), I(q * A), z(), G(H, !0), M(q * S), V(), Y(0 !== C || 0 !== N), G(H, !1), X(H), e.translate(-U, -j); + } + f && e.translate(-h.x, -h.y), + o && l.drawNodeUnderlay(e, t, h, r, i), + f && e.translate(h.x, h.y), + I(), + z(), + G(g, !0), + M(), + V(), + Y(0 !== C || 0 !== N), + G(g, !1), + X(), + f && e.translate(-h.x, -h.y), + l.drawElementText(e, t, null, a), + o && l.drawNodeOverlay(e, t, h, r, i), + n && e.translate(p.x1, p.y1); + } + }, + }, + Bu = function (e) { + if (!["overlay", "underlay"].includes(e)) throw new Error("Invalid state"); + return function (t, n, r, i, a) { + if (n.visible()) { + var o = n.pstyle("".concat(e, "-padding")).pfValue, + s = n.pstyle("".concat(e, "-opacity")).value, + l = n.pstyle("".concat(e, "-color")).value, + u = n.pstyle("".concat(e, "-shape")).value; + if (s > 0) { + if (((r = r || n.position()), null == i || null == a)) { + var c = n.padding(); + (i = n.width() + 2 * c), (a = n.height() + 2 * c); + } + this.colorFillStyle(t, l[0], l[1], l[2], s), this.nodeShapes[u].draw(t, r.x, r.y, i + 2 * o, a + 2 * o), t.fill(); + } + } + }; + }; + (Ru.drawNodeOverlay = Bu("overlay")), + (Ru.drawNodeUnderlay = Bu("underlay")), + (Ru.hasPie = function (e) { + return (e = e[0])._private.hasPie; + }), + (Ru.drawPie = function (e, t, n, r) { + (t = t[0]), (r = r || t.position()); + var i = t.cy().style(), + a = t.pstyle("pie-size"), + o = r.x, + s = r.y, + l = t.width(), + u = t.height(), + c = Math.min(l, u) / 2, + h = 0; + this.usePaths() && ((o = 0), (s = 0)), "%" === a.units ? (c *= a.pfValue) : void 0 !== a.pfValue && (c = a.pfValue / 2); + for (var d = 1; d <= i.pieBackgroundN; d++) { + var p = t.pstyle("pie-" + d + "-background-size").value, + g = t.pstyle("pie-" + d + "-background-color").value, + f = t.pstyle("pie-" + d + "-background-opacity").value * n, + v = p / 100; + v + h > 1 && (v = 1 - h); + var y = 1.5 * Math.PI + 2 * Math.PI * h, + m = y + 2 * Math.PI * v; + 0 === p || + h >= 1 || + h + v > 1 || + (e.beginPath(), e.moveTo(o, s), e.arc(o, s, c, y, m), e.closePath(), this.colorFillStyle(e, g[0], g[1], g[2], f), e.fill(), (h += v)); + } + }); + var Fu = {}; + (Fu.getPixelRatio = function () { + var e = this.data.contexts[0]; + if (null != this.forcedPixelRatio) return this.forcedPixelRatio; + var t = + e.backingStorePixelRatio || + e.webkitBackingStorePixelRatio || + e.mozBackingStorePixelRatio || + e.msBackingStorePixelRatio || + e.oBackingStorePixelRatio || + e.backingStorePixelRatio || + 1; + return (window.devicePixelRatio || 1) / t; + }), + (Fu.paintCache = function (e) { + for (var t, n = (this.paintCaches = this.paintCaches || []), r = !0, i = 0; i < n.length; i++) + if ((t = n[i]).context === e) { + r = !1; + break; + } + return r && ((t = { context: e }), n.push(t)), t; + }), + (Fu.createGradientStyleFor = function (e, t, n, r, i) { + var a, + o = this.usePaths(), + s = n.pstyle(t + "-gradient-stop-colors").value, + l = n.pstyle(t + "-gradient-stop-positions").pfValue; + if ("radial-gradient" === r) + if (n.isEdge()) { + var u = n.sourceEndpoint(), + c = n.targetEndpoint(), + h = n.midpoint(), + d = At(u, h), + p = At(c, h); + a = e.createRadialGradient(h.x, h.y, 0, h.x, h.y, Math.max(d, p)); + } else { + var g = o ? { x: 0, y: 0 } : n.position(), + f = n.paddedWidth(), + v = n.paddedHeight(); + a = e.createRadialGradient(g.x, g.y, 0, g.x, g.y, Math.max(f, v)); + } + else if (n.isEdge()) { + var y = n.sourceEndpoint(), + m = n.targetEndpoint(); + a = e.createLinearGradient(y.x, y.y, m.x, m.y); + } else { + var b = o ? { x: 0, y: 0 } : n.position(), + x = n.paddedWidth() / 2, + w = n.paddedHeight() / 2; + switch (n.pstyle("background-gradient-direction").value) { + case "to-bottom": + a = e.createLinearGradient(b.x, b.y - w, b.x, b.y + w); + break; + case "to-top": + a = e.createLinearGradient(b.x, b.y + w, b.x, b.y - w); + break; + case "to-left": + a = e.createLinearGradient(b.x + x, b.y, b.x - x, b.y); + break; + case "to-right": + a = e.createLinearGradient(b.x - x, b.y, b.x + x, b.y); + break; + case "to-bottom-right": + case "to-right-bottom": + a = e.createLinearGradient(b.x - x, b.y - w, b.x + x, b.y + w); + break; + case "to-top-right": + case "to-right-top": + a = e.createLinearGradient(b.x - x, b.y + w, b.x + x, b.y - w); + break; + case "to-bottom-left": + case "to-left-bottom": + a = e.createLinearGradient(b.x + x, b.y - w, b.x - x, b.y + w); + break; + case "to-top-left": + case "to-left-top": + a = e.createLinearGradient(b.x + x, b.y + w, b.x - x, b.y - w); + } + } + if (!a) return null; + for (var E = l.length === s.length, _ = s.length, T = 0; T < _; T++) + a.addColorStop(E ? l[T] : T / (_ - 1), "rgba(" + s[T][0] + "," + s[T][1] + "," + s[T][2] + "," + i + ")"); + return a; + }), + (Fu.gradientFillStyle = function (e, t, n, r) { + var i = this.createGradientStyleFor(e, "background", t, n, r); + if (!i) return null; + e.fillStyle = i; + }), + (Fu.colorFillStyle = function (e, t, n, r, i) { + e.fillStyle = "rgba(" + t + "," + n + "," + r + "," + i + ")"; + }), + (Fu.eleFillStyle = function (e, t, n) { + var r = t.pstyle("background-fill").value; + if ("linear-gradient" === r || "radial-gradient" === r) this.gradientFillStyle(e, t, r, n); + else { + var i = t.pstyle("background-color").value; + this.colorFillStyle(e, i[0], i[1], i[2], n); + } + }), + (Fu.gradientStrokeStyle = function (e, t, n, r) { + var i = this.createGradientStyleFor(e, "line", t, n, r); + if (!i) return null; + e.strokeStyle = i; + }), + (Fu.colorStrokeStyle = function (e, t, n, r, i) { + e.strokeStyle = "rgba(" + t + "," + n + "," + r + "," + i + ")"; + }), + (Fu.eleStrokeStyle = function (e, t, n) { + var r = t.pstyle("line-fill").value; + if ("linear-gradient" === r || "radial-gradient" === r) this.gradientStrokeStyle(e, t, r, n); + else { + var i = t.pstyle("line-color").value; + this.colorStrokeStyle(e, i[0], i[1], i[2], n); + } + }), + (Fu.matchCanvasSize = function (e) { + var t = this, + n = t.data, + r = t.findContainerClientCoords(), + i = r[2], + a = r[3], + o = t.getPixelRatio(), + s = t.motionBlurPxRatio; + (e !== t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE] && e !== t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG]) || (o = s); + var l, + u = i * o, + c = a * o; + if (u !== t.canvasWidth || c !== t.canvasHeight) { + t.fontCaches = null; + var h = n.canvasContainer; + (h.style.width = i + "px"), (h.style.height = a + "px"); + for (var d = 0; d < t.CANVAS_LAYERS; d++) + ((l = n.canvases[d]).width = u), (l.height = c), (l.style.width = i + "px"), (l.style.height = a + "px"); + for (d = 0; d < t.BUFFER_COUNT; d++) + ((l = n.bufferCanvases[d]).width = u), (l.height = c), (l.style.width = i + "px"), (l.style.height = a + "px"); + (t.textureMult = 1), + o <= 1 && + ((l = n.bufferCanvases[t.TEXTURE_BUFFER]), (t.textureMult = 2), (l.width = u * t.textureMult), (l.height = c * t.textureMult)), + (t.canvasWidth = u), + (t.canvasHeight = c); + } + }), + (Fu.renderTo = function (e, t, n, r) { + this.render({ + forcedContext: e, + forcedZoom: t, + forcedPan: n, + drawAllLayers: !0, + forcedPxRatio: r, + }); + }), + (Fu.render = function (e) { + var t = (e = e || $e()).forcedContext, + n = e.drawAllLayers, + r = e.drawOnlyNodeLayer, + i = e.forcedZoom, + a = e.forcedPan, + o = this, + s = void 0 === e.forcedPxRatio ? this.getPixelRatio() : e.forcedPxRatio, + l = o.cy, + u = o.data, + c = u.canvasNeedsRedraw, + h = o.textureOnViewport && !t && (o.pinching || o.hoverData.dragging || o.swipePanning || o.data.wheelZooming), + d = void 0 !== e.motionBlur ? e.motionBlur : o.motionBlur, + p = o.motionBlurPxRatio, + g = l.hasCompoundNodes(), + f = o.hoverData.draggingEles, + v = !(!o.hoverData.selecting && !o.touchData.selecting), + y = (d = d && !t && o.motionBlurEnabled && !v); + t || + (o.prevPxRatio !== s && + (o.invalidateContainerClientCoordsCache(), o.matchCanvasSize(o.container), o.redrawHint("eles", !0), o.redrawHint("drag", !0)), + (o.prevPxRatio = s)), + !t && o.motionBlurTimeout && clearTimeout(o.motionBlurTimeout), + d && + (null == o.mbFrames && (o.mbFrames = 0), + o.mbFrames++, + o.mbFrames < 3 && (y = !1), + o.mbFrames > o.minMbLowQualFrames && (o.motionBlurPxRatio = o.mbPxRBlurry)), + o.clearingMotionBlur && (o.motionBlurPxRatio = 1), + o.textureDrawLastFrame && !h && ((c[o.NODE] = !0), (c[o.SELECT_BOX] = !0)); + var m = l.style(), + b = l.zoom(), + x = void 0 !== i ? i : b, + w = l.pan(), + E = { x: w.x, y: w.y }, + _ = { zoom: b, pan: { x: w.x, y: w.y } }, + T = o.prevViewport; + void 0 === T || _.zoom !== T.zoom || _.pan.x !== T.pan.x || _.pan.y !== T.pan.y || (f && !g) || (o.motionBlurPxRatio = 1), + a && (E = a), + (x *= s), + (E.x *= s), + (E.y *= s); + var D = o.getCachedZSortedEles(); + function C(e, t, n, r, i) { + var a = e.globalCompositeOperation; + (e.globalCompositeOperation = "destination-out"), + o.colorFillStyle(e, 255, 255, 255, o.motionBlurTransparency), + e.fillRect(t, n, r, i), + (e.globalCompositeOperation = a); + } + function N(e, r) { + var s, l, c, h; + o.clearingMotionBlur || (e !== u.bufferContexts[o.MOTIONBLUR_BUFFER_NODE] && e !== u.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]) + ? ((s = E), (l = x), (c = o.canvasWidth), (h = o.canvasHeight)) + : ((s = { x: w.x * p, y: w.y * p }), (l = b * p), (c = o.canvasWidth * p), (h = o.canvasHeight * p)), + e.setTransform(1, 0, 0, 1, 0, 0), + "motionBlur" === r ? C(e, 0, 0, c, h) : t || (void 0 !== r && !r) || e.clearRect(0, 0, c, h), + n || (e.translate(s.x, s.y), e.scale(l, l)), + a && e.translate(a.x, a.y), + i && e.scale(i, i); + } + if ((h || (o.textureDrawLastFrame = !1), h)) { + if (((o.textureDrawLastFrame = !0), !o.textureCache)) { + (o.textureCache = {}), + (o.textureCache.bb = l.mutableElements().boundingBox()), + (o.textureCache.texture = o.data.bufferCanvases[o.TEXTURE_BUFFER]); + var A = o.data.bufferContexts[o.TEXTURE_BUFFER]; + A.setTransform(1, 0, 0, 1, 0, 0), + A.clearRect(0, 0, o.canvasWidth * o.textureMult, o.canvasHeight * o.textureMult), + o.render({ + forcedContext: A, + drawOnlyNodeLayer: !0, + forcedPxRatio: s * o.textureMult, + }), + ((_ = o.textureCache.viewport = + { + zoom: l.zoom(), + pan: l.pan(), + width: o.canvasWidth, + height: o.canvasHeight, + }).mpan = { x: (0 - _.pan.x) / _.zoom, y: (0 - _.pan.y) / _.zoom }); + } + (c[o.DRAG] = !1), (c[o.NODE] = !1); + var L = u.contexts[o.NODE], + k = o.textureCache.texture; + (_ = o.textureCache.viewport), + L.setTransform(1, 0, 0, 1, 0, 0), + d ? C(L, 0, 0, _.width, _.height) : L.clearRect(0, 0, _.width, _.height); + var S = m.core("outside-texture-bg-color").value, + I = m.core("outside-texture-bg-opacity").value; + o.colorFillStyle(L, S[0], S[1], S[2], I), + L.fillRect(0, 0, _.width, _.height), + (b = l.zoom()), + N(L, !1), + L.clearRect(_.mpan.x, _.mpan.y, _.width / _.zoom / s, _.height / _.zoom / s), + L.drawImage(k, _.mpan.x, _.mpan.y, _.width / _.zoom / s, _.height / _.zoom / s); + } else o.textureOnViewport && !t && (o.textureCache = null); + var M = l.extent(), + O = o.pinching || o.hoverData.dragging || o.swipePanning || o.data.wheelZooming || o.hoverData.draggingEles || o.cy.animated(), + P = o.hideEdgesOnViewport && O, + R = []; + if ( + ((R[o.NODE] = (!c[o.NODE] && d && !o.clearedForMotionBlur[o.NODE]) || o.clearingMotionBlur), + R[o.NODE] && (o.clearedForMotionBlur[o.NODE] = !0), + (R[o.DRAG] = (!c[o.DRAG] && d && !o.clearedForMotionBlur[o.DRAG]) || o.clearingMotionBlur), + R[o.DRAG] && (o.clearedForMotionBlur[o.DRAG] = !0), + c[o.NODE] || n || r || R[o.NODE]) + ) { + var B = d && !R[o.NODE] && 1 !== p; + N((L = t || (B ? o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE] : u.contexts[o.NODE])), d && !B ? "motionBlur" : void 0), + P ? o.drawCachedNodes(L, D.nondrag, s, M) : o.drawLayeredElements(L, D.nondrag, s, M), + o.debug && o.drawDebugPoints(L, D.nondrag), + n || d || (c[o.NODE] = !1); + } + if ( + (!r && + (c[o.DRAG] || n || R[o.DRAG]) && + ((B = d && !R[o.DRAG] && 1 !== p), + N((L = t || (B ? o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG] : u.contexts[o.DRAG])), d && !B ? "motionBlur" : void 0), + P ? o.drawCachedNodes(L, D.drag, s, M) : o.drawCachedElements(L, D.drag, s, M), + o.debug && o.drawDebugPoints(L, D.drag), + n || d || (c[o.DRAG] = !1)), + o.showFps || (!r && c[o.SELECT_BOX] && !n)) + ) { + if ((N((L = t || u.contexts[o.SELECT_BOX])), 1 == o.selection[4] && (o.hoverData.selecting || o.touchData.selecting))) { + b = o.cy.zoom(); + var F = m.core("selection-box-border-width").value / b; + (L.lineWidth = F), + (L.fillStyle = + "rgba(" + + m.core("selection-box-color").value[0] + + "," + + m.core("selection-box-color").value[1] + + "," + + m.core("selection-box-color").value[2] + + "," + + m.core("selection-box-opacity").value + + ")"), + L.fillRect(o.selection[0], o.selection[1], o.selection[2] - o.selection[0], o.selection[3] - o.selection[1]), + F > 0 && + ((L.strokeStyle = + "rgba(" + + m.core("selection-box-border-color").value[0] + + "," + + m.core("selection-box-border-color").value[1] + + "," + + m.core("selection-box-border-color").value[2] + + "," + + m.core("selection-box-opacity").value + + ")"), + L.strokeRect(o.selection[0], o.selection[1], o.selection[2] - o.selection[0], o.selection[3] - o.selection[1])); + } + if (u.bgActivePosistion && !o.hoverData.selecting) { + b = o.cy.zoom(); + var z = u.bgActivePosistion; + (L.fillStyle = + "rgba(" + + m.core("active-bg-color").value[0] + + "," + + m.core("active-bg-color").value[1] + + "," + + m.core("active-bg-color").value[2] + + "," + + m.core("active-bg-opacity").value + + ")"), + L.beginPath(), + L.arc(z.x, z.y, m.core("active-bg-size").pfValue / b, 0, 2 * Math.PI), + L.fill(); + } + var G = o.lastRedrawTime; + if (o.showFps && G) { + G = Math.round(G); + var Y = Math.round(1e3 / G); + L.setTransform(1, 0, 0, 1, 0, 0), + (L.fillStyle = "rgba(255, 0, 0, 0.75)"), + (L.strokeStyle = "rgba(255, 0, 0, 0.75)"), + (L.lineWidth = 1), + L.fillText("1 frame = " + G + " ms = " + Y + " fps", 0, 20); + L.strokeRect(0, 30, 250, 20), L.fillRect(0, 30, 250 * Math.min(Y / 60, 1), 20); + } + n || (c[o.SELECT_BOX] = !1); + } + if (d && 1 !== p) { + var X = u.contexts[o.NODE], + V = o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE], + U = u.contexts[o.DRAG], + j = o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG], + q = function (e, t, n) { + e.setTransform(1, 0, 0, 1, 0, 0), + n || !y ? e.clearRect(0, 0, o.canvasWidth, o.canvasHeight) : C(e, 0, 0, o.canvasWidth, o.canvasHeight); + var r = p; + e.drawImage(t, 0, 0, o.canvasWidth * r, o.canvasHeight * r, 0, 0, o.canvasWidth, o.canvasHeight); + }; + (c[o.NODE] || R[o.NODE]) && (q(X, V, R[o.NODE]), (c[o.NODE] = !1)), (c[o.DRAG] || R[o.DRAG]) && (q(U, j, R[o.DRAG]), (c[o.DRAG] = !1)); + } + (o.prevViewport = _), + o.clearingMotionBlur && ((o.clearingMotionBlur = !1), (o.motionBlurCleared = !0), (o.motionBlur = !0)), + d && + (o.motionBlurTimeout = setTimeout(function () { + (o.motionBlurTimeout = null), + (o.clearedForMotionBlur[o.NODE] = !1), + (o.clearedForMotionBlur[o.DRAG] = !1), + (o.motionBlur = !1), + (o.clearingMotionBlur = !h), + (o.mbFrames = 0), + (c[o.NODE] = !0), + (c[o.DRAG] = !0), + o.redraw(); + }, 100)), + t || l.emit("render"); + }); + for ( + var zu = { + drawPolygonPath: function (e, t, n, r, i, a) { + var o = r / 2, + s = i / 2; + e.beginPath && e.beginPath(), e.moveTo(t + o * a[0], n + s * a[1]); + for (var l = 1; l < a.length / 2; l++) e.lineTo(t + o * a[2 * l], n + s * a[2 * l + 1]); + e.closePath(); + }, + drawRoundPolygonPath: function (e, t, n, r, i, a) { + var o = r / 2, + s = i / 2, + l = ln(r, i); + e.beginPath && e.beginPath(); + for (var u = 0; u < a.length / 4; u++) { + var c, h; + (c = 0 === u ? a.length - 2 : 4 * u - 2), (h = 4 * u + 2); + var d = t + o * a[4 * u], + p = n + s * a[4 * u + 1], + g = -a[c] * a[h] - a[c + 1] * a[h + 1], + f = l / Math.tan(Math.acos(g) / 2), + v = d - f * a[c], + y = p - f * a[c + 1], + m = d + f * a[h], + b = p + f * a[h + 1]; + 0 === u ? e.moveTo(v, y) : e.lineTo(v, y), e.arcTo(d, p, m, b, l); + } + e.closePath(); + }, + drawRoundRectanglePath: function (e, t, n, r, i) { + var a = r / 2, + o = i / 2, + s = sn(r, i); + e.beginPath && e.beginPath(), + e.moveTo(t, n - o), + e.arcTo(t + a, n - o, t + a, n, s), + e.arcTo(t + a, n + o, t, n + o, s), + e.arcTo(t - a, n + o, t - a, n, s), + e.arcTo(t - a, n - o, t, n - o, s), + e.lineTo(t, n - o), + e.closePath(); + }, + drawBottomRoundRectanglePath: function (e, t, n, r, i) { + var a = r / 2, + o = i / 2, + s = sn(r, i); + e.beginPath && e.beginPath(), + e.moveTo(t, n - o), + e.lineTo(t + a, n - o), + e.lineTo(t + a, n), + e.arcTo(t + a, n + o, t, n + o, s), + e.arcTo(t - a, n + o, t - a, n, s), + e.lineTo(t - a, n - o), + e.lineTo(t, n - o), + e.closePath(); + }, + drawCutRectanglePath: function (e, t, n, r, i) { + var a = r / 2, + o = i / 2; + e.beginPath && e.beginPath(), + e.moveTo(t - a + 8, n - o), + e.lineTo(t + a - 8, n - o), + e.lineTo(t + a, n - o + 8), + e.lineTo(t + a, n + o - 8), + e.lineTo(t + a - 8, n + o), + e.lineTo(t - a + 8, n + o), + e.lineTo(t - a, n + o - 8), + e.lineTo(t - a, n - o + 8), + e.closePath(); + }, + drawBarrelPath: function (e, t, n, r, i) { + var a = r / 2, + o = i / 2, + s = t - a, + l = t + a, + u = n - o, + c = n + o, + h = un(r, i), + d = h.widthOffset, + p = h.heightOffset, + g = h.ctrlPtOffsetPct * d; + e.beginPath && e.beginPath(), + e.moveTo(s, u + p), + e.lineTo(s, c - p), + e.quadraticCurveTo(s + g, c, s + d, c), + e.lineTo(l - d, c), + e.quadraticCurveTo(l - g, c, l, c - p), + e.lineTo(l, u + p), + e.quadraticCurveTo(l - g, u, l - d, u), + e.lineTo(s + d, u), + e.quadraticCurveTo(s + g, u, s, u + p), + e.closePath(); + }, + }, + Gu = Math.sin(0), + Yu = Math.cos(0), + Xu = {}, + Vu = {}, + Uu = Math.PI / 40, + ju = 0 * Math.PI; + ju < 2 * Math.PI; + ju += Uu + ) + (Xu[ju] = Math.sin(ju)), (Vu[ju] = Math.cos(ju)); + zu.drawEllipsePath = function (e, t, n, r, i) { + if ((e.beginPath && e.beginPath(), e.ellipse)) e.ellipse(t, n, r / 2, i / 2, 0, 0, 2 * Math.PI); + else + for (var a, o, s = r / 2, l = i / 2, u = 0 * Math.PI; u < 2 * Math.PI; u += Uu) + (a = t - s * Xu[u] * Gu + s * Vu[u] * Yu), (o = n + l * Vu[u] * Gu + l * Xu[u] * Yu), 0 === u ? e.moveTo(a, o) : e.lineTo(a, o); + e.closePath(); + }; + var qu = {}; + function Hu(e) { + var t = e.indexOf(","); + return e.substr(t + 1); + } + function Wu(e, t, n) { + var r = function () { + return t.toDataURL(n, e.quality); + }; + switch (e.output) { + case "blob-promise": + return new _r(function (r, i) { + try { + t.toBlob( + function (e) { + null != e ? r(e) : i(new Error("`canvas.toBlob()` sent a null value in its callback")); + }, + n, + e.quality, + ); + } catch (e) { + i(e); + } + }); + case "blob": + return (function (e, t) { + for (var n = atob(e), r = new ArrayBuffer(n.length), i = new Uint8Array(r), a = 0; a < n.length; a++) i[a] = n.charCodeAt(a); + return new Blob([r], { type: t }); + })(Hu(r()), n); + case "base64": + return Hu(r()); + default: + return r(); + } + } + (qu.createBuffer = function (e, t) { + var n = document.createElement("canvas"); + return (n.width = e), (n.height = t), [n, n.getContext("2d")]; + }), + (qu.bufferCanvasImage = function (e) { + var t = this.cy, + n = t.mutableElements().boundingBox(), + r = this.findContainerClientCoords(), + i = e.full ? Math.ceil(n.w) : r[2], + a = e.full ? Math.ceil(n.h) : r[3], + o = b(e.maxWidth) || b(e.maxHeight), + s = this.getPixelRatio(), + l = 1; + if (void 0 !== e.scale) (i *= e.scale), (a *= e.scale), (l = e.scale); + else if (o) { + var u = 1 / 0, + c = 1 / 0; + b(e.maxWidth) && (u = (l * e.maxWidth) / i), b(e.maxHeight) && (c = (l * e.maxHeight) / a), (i *= l = Math.min(u, c)), (a *= l); + } + o || ((i *= s), (a *= s), (l *= s)); + var h = document.createElement("canvas"); + (h.width = i), (h.height = a), (h.style.width = i + "px"), (h.style.height = a + "px"); + var d = h.getContext("2d"); + if (i > 0 && a > 0) { + d.clearRect(0, 0, i, a), (d.globalCompositeOperation = "source-over"); + var p = this.getCachedZSortedEles(); + if (e.full) + d.translate(-n.x1 * l, -n.y1 * l), d.scale(l, l), this.drawElements(d, p), d.scale(1 / l, 1 / l), d.translate(n.x1 * l, n.y1 * l); + else { + var g = t.pan(), + f = { x: g.x * l, y: g.y * l }; + (l *= t.zoom()), d.translate(f.x, f.y), d.scale(l, l), this.drawElements(d, p), d.scale(1 / l, 1 / l), d.translate(-f.x, -f.y); + } + e.bg && ((d.globalCompositeOperation = "destination-over"), (d.fillStyle = e.bg), d.rect(0, 0, i, a), d.fill()); + } + return h; + }), + (qu.png = function (e) { + return Wu(e, this.bufferCanvasImage(e), "image/png"); + }), + (qu.jpg = function (e) { + return Wu(e, this.bufferCanvasImage(e), "image/jpeg"); + }); + var $u = Zu, + Ku = Zu.prototype; + function Zu(e) { + var t = this; + t.data = { + canvases: new Array(Ku.CANVAS_LAYERS), + contexts: new Array(Ku.CANVAS_LAYERS), + canvasNeedsRedraw: new Array(Ku.CANVAS_LAYERS), + bufferCanvases: new Array(Ku.BUFFER_COUNT), + bufferContexts: new Array(Ku.CANVAS_LAYERS), + }; + var n = "-webkit-tap-highlight-color", + r = "rgba(0,0,0,0)"; + t.data.canvasContainer = document.createElement("div"); + var i = t.data.canvasContainer.style; + (t.data.canvasContainer.style[n] = r), (i.position = "relative"), (i.zIndex = "0"), (i.overflow = "hidden"); + var a = e.cy.container(); + a.appendChild(t.data.canvasContainer), (a.style[n] = r); + var o = { + "-webkit-user-select": "none", + "-moz-user-select": "-moz-none", + "user-select": "none", + "-webkit-tap-highlight-color": "rgba(0,0,0,0)", + "outline-style": "none", + }; + u && u.userAgent.match(/msie|trident|edge/i) && ((o["-ms-touch-action"] = "none"), (o["touch-action"] = "none")); + for (var s = 0; s < Ku.CANVAS_LAYERS; s++) { + var l = (t.data.canvases[s] = document.createElement("canvas")); + (t.data.contexts[s] = l.getContext("2d")), + Object.keys(o).forEach(function (e) { + l.style[e] = o[e]; + }), + (l.style.position = "absolute"), + l.setAttribute("data-id", "layer" + s), + (l.style.zIndex = String(Ku.CANVAS_LAYERS - s)), + t.data.canvasContainer.appendChild(l), + (t.data.canvasNeedsRedraw[s] = !1); + } + for ( + t.data.topCanvas = t.data.canvases[0], + t.data.canvases[Ku.NODE].setAttribute("data-id", "layer" + Ku.NODE + "-node"), + t.data.canvases[Ku.SELECT_BOX].setAttribute("data-id", "layer" + Ku.SELECT_BOX + "-selectbox"), + t.data.canvases[Ku.DRAG].setAttribute("data-id", "layer" + Ku.DRAG + "-drag"), + s = 0; + s < Ku.BUFFER_COUNT; + s++ + ) + (t.data.bufferCanvases[s] = document.createElement("canvas")), + (t.data.bufferContexts[s] = t.data.bufferCanvases[s].getContext("2d")), + (t.data.bufferCanvases[s].style.position = "absolute"), + t.data.bufferCanvases[s].setAttribute("data-id", "buffer" + s), + (t.data.bufferCanvases[s].style.zIndex = String(-s - 1)), + (t.data.bufferCanvases[s].style.visibility = "hidden"); + t.pathsEnabled = !0; + var c = Ot(), + h = function (e) { + return { x: -e.w / 2, y: -e.h / 2 }; + }, + d = function (e) { + return e.boundingBox(), e[0]._private.bodyBounds; + }, + p = function (e) { + return e.boundingBox(), e[0]._private.labelBounds.main || c; + }, + g = function (e) { + return e.boundingBox(), e[0]._private.labelBounds.source || c; + }, + f = function (e) { + return e.boundingBox(), e[0]._private.labelBounds.target || c; + }, + v = function (e, t) { + return t; + }, + y = function (e, t, n) { + var r = e ? e + "-" : ""; + return { + x: t.x + n.pstyle(r + "text-margin-x").pfValue, + y: t.y + n.pstyle(r + "text-margin-y").pfValue, + }; + }, + m = function (e, t, n) { + var r = e[0]._private.rscratch; + return { x: r[t], y: r[n] }; + }, + b = (t.data.eleTxrCache = new du(t, { + getKey: function (e) { + return e[0]._private.nodeKey; + }, + doesEleInvalidateKey: function (e) { + var t = e[0]._private; + return !(t.oldBackgroundTimestamp === t.backgroundTimestamp); + }, + drawElement: function (e, n, r, i, a) { + return t.drawElement(e, n, r, !1, !1, a); + }, + getBoundingBox: d, + getRotationPoint: function (e) { + return { x: ((t = d(e)).x1 + t.x2) / 2, y: (t.y1 + t.y2) / 2 }; + var t; + }, + getRotationOffset: function (e) { + return h(d(e)); + }, + allowEdgeTxrCaching: !1, + allowParentTxrCaching: !1, + })), + x = (t.data.lblTxrCache = new du(t, { + getKey: function (e) { + return e[0]._private.labelStyleKey; + }, + drawElement: function (e, n, r, i, a) { + return t.drawElementText(e, n, r, i, "main", a); + }, + getBoundingBox: p, + getRotationPoint: function (e) { + return y("", m(e, "labelX", "labelY"), e); + }, + getRotationOffset: function (e) { + var t = p(e), + n = h(p(e)); + if (e.isNode()) { + switch (e.pstyle("text-halign").value) { + case "left": + n.x = -t.w; + break; + case "right": + n.x = 0; + } + switch (e.pstyle("text-valign").value) { + case "top": + n.y = -t.h; + break; + case "bottom": + n.y = 0; + } + } + return n; + }, + isVisible: v, + })), + w = (t.data.slbTxrCache = new du(t, { + getKey: function (e) { + return e[0]._private.sourceLabelStyleKey; + }, + drawElement: function (e, n, r, i, a) { + return t.drawElementText(e, n, r, i, "source", a); + }, + getBoundingBox: g, + getRotationPoint: function (e) { + return y("source", m(e, "sourceLabelX", "sourceLabelY"), e); + }, + getRotationOffset: function (e) { + return h(g(e)); + }, + isVisible: v, + })), + E = (t.data.tlbTxrCache = new du(t, { + getKey: function (e) { + return e[0]._private.targetLabelStyleKey; + }, + drawElement: function (e, n, r, i, a) { + return t.drawElementText(e, n, r, i, "target", a); + }, + getBoundingBox: f, + getRotationPoint: function (e) { + return y("target", m(e, "targetLabelX", "targetLabelY"), e); + }, + getRotationOffset: function (e) { + return h(f(e)); + }, + isVisible: v, + })), + _ = (t.data.lyrTxrCache = new gu(t)); + t.onUpdateEleCalcs(function (e, t) { + b.invalidateElements(t), x.invalidateElements(t), w.invalidateElements(t), E.invalidateElements(t), _.invalidateElements(t); + for (var n = 0; n < t.length; n++) { + var r = t[n]._private; + r.oldBackgroundTimestamp = r.backgroundTimestamp; + } + }); + var T = function (e) { + for (var t = 0; t < e.length; t++) _.enqueueElementRefinement(e[t].ele); + }; + b.onDequeue(T), x.onDequeue(T), w.onDequeue(T), E.onDequeue(T); + } + (Ku.CANVAS_LAYERS = 3), + (Ku.SELECT_BOX = 0), + (Ku.DRAG = 1), + (Ku.NODE = 2), + (Ku.BUFFER_COUNT = 3), + (Ku.TEXTURE_BUFFER = 0), + (Ku.MOTIONBLUR_BUFFER_NODE = 1), + (Ku.MOTIONBLUR_BUFFER_DRAG = 2), + (Ku.redrawHint = function (e, t) { + var n = this; + switch (e) { + case "eles": + n.data.canvasNeedsRedraw[Ku.NODE] = t; + break; + case "drag": + n.data.canvasNeedsRedraw[Ku.DRAG] = t; + break; + case "select": + n.data.canvasNeedsRedraw[Ku.SELECT_BOX] = t; + } + }); + var Qu = "undefined" != typeof Path2D; + (Ku.path2dEnabled = function (e) { + if (void 0 === e) return this.pathsEnabled; + this.pathsEnabled = !!e; + }), + (Ku.usePaths = function () { + return Qu && this.pathsEnabled; + }), + (Ku.setImgSmoothing = function (e, t) { + null != e.imageSmoothingEnabled + ? (e.imageSmoothingEnabled = t) + : ((e.webkitImageSmoothingEnabled = t), (e.mozImageSmoothingEnabled = t), (e.msImageSmoothingEnabled = t)); + }), + (Ku.getImgSmoothing = function (e) { + return null != e.imageSmoothingEnabled + ? e.imageSmoothingEnabled + : e.webkitImageSmoothingEnabled || e.mozImageSmoothingEnabled || e.msImageSmoothingEnabled; + }), + (Ku.makeOffscreenCanvas = function (t, n) { + var r; + return ( + "undefined" !== ("undefined" == typeof OffscreenCanvas ? "undefined" : e(OffscreenCanvas)) + ? (r = new OffscreenCanvas(t, n)) + : (((r = document.createElement("canvas")).width = t), (r.height = n)), + r + ); + }), + [ + bu, + Du, + Iu, + Ou, + Pu, + Ru, + Fu, + zu, + qu, + { + nodeShapeImpl: function (e, t, n, r, i, a, o) { + switch (e) { + case "ellipse": + return this.drawEllipsePath(t, n, r, i, a); + case "polygon": + return this.drawPolygonPath(t, n, r, i, a, o); + case "round-polygon": + return this.drawRoundPolygonPath(t, n, r, i, a, o); + case "roundrectangle": + case "round-rectangle": + return this.drawRoundRectanglePath(t, n, r, i, a); + case "cutrectangle": + case "cut-rectangle": + return this.drawCutRectanglePath(t, n, r, i, a); + case "bottomroundrectangle": + case "bottom-round-rectangle": + return this.drawBottomRoundRectanglePath(t, n, r, i, a); + case "barrel": + return this.drawBarrelPath(t, n, r, i, a); + } + }, + }, + ].forEach(function (e) { + z(Ku, e); + }); + var Ju = [ + { type: "layout", extensions: Pl }, + { + type: "renderer", + extensions: [ + { name: "null", impl: Rl }, + { name: "base", impl: au }, + { name: "canvas", impl: $u }, + ], + }, + ], + ec = {}, + tc = {}; + function nc(e, t, n) { + var r = n, + i = function (n) { + je("Can not register `" + t + "` for `" + e + "` since `" + n + "` already exists in the prototype and can not be overridden"); + }; + if ("core" === e) { + if (Ws.prototype[t]) return i(t); + Ws.prototype[t] = n; + } else if ("collection" === e) { + if (cs.prototype[t]) return i(t); + cs.prototype[t] = n; + } else if ("layout" === e) { + for ( + var a = function (e) { + (this.options = e), + n.call(this, e), + m(this._private) || (this._private = {}), + (this._private.cy = e.cy), + (this._private.listeners = []), + this.createEmitter(); + }, + o = (a.prototype = Object.create(n.prototype)), + s = [], + l = 0; + l < s.length; + l++ + ) { + var u = s[l]; + o[u] = + o[u] || + function () { + return this; + }; + } + o.start && !o.run + ? (o.run = function () { + return this.start(), this; + }) + : !o.start && + o.run && + (o.start = function () { + return this.run(), this; + }); + var c = n.prototype.stop; + (o.stop = function () { + var e = this.options; + if (e && e.animate) { + var t = this.animations; + if (t) for (var n = 0; n < t.length; n++) t[n].stop(); + } + return c ? c.call(this) : this.emit("layoutstop"), this; + }), + o.destroy || + (o.destroy = function () { + return this; + }), + (o.cy = function () { + return this._private.cy; + }); + var h = function (e) { + return e._private.cy; + }, + d = { + addEventFields: function (e, t) { + (t.layout = e), (t.cy = h(e)), (t.target = e); + }, + bubble: function () { + return !0; + }, + parent: function (e) { + return h(e); + }, + }; + z(o, { + createEmitter: function () { + return (this._private.emitter = new Ao(d, this)), this; + }, + emitter: function () { + return this._private.emitter; + }, + on: function (e, t) { + return this.emitter().on(e, t), this; + }, + one: function (e, t) { + return this.emitter().one(e, t), this; + }, + once: function (e, t) { + return this.emitter().one(e, t), this; + }, + removeListener: function (e, t) { + return this.emitter().removeListener(e, t), this; + }, + removeAllListeners: function () { + return this.emitter().removeAllListeners(), this; + }, + emit: function (e, t) { + return this.emitter().emit(e, t), this; + }, + }), + Wi.eventAliasesOn(o), + (r = a); + } else if ("renderer" === e && "null" !== t && "base" !== t) { + var p = rc("renderer", "base"), + g = p.prototype, + f = n, + v = n.prototype, + y = function () { + p.apply(this, arguments), f.apply(this, arguments); + }, + b = y.prototype; + for (var x in g) { + var w = g[x]; + if (null != v[x]) return i(x); + b[x] = w; + } + for (var E in v) b[E] = v[E]; + g.clientFunctions.forEach(function (e) { + b[e] = + b[e] || + function () { + Ve("Renderer does not implement `renderer." + e + "()` on its prototype"); + }; + }), + (r = y); + } else if ("__proto__" === e || "constructor" === e || "prototype" === e) + return Ve(e + " is an illegal type to be registered, possibly lead to prototype pollutions"); + return X({ map: ec, keys: [e, t], value: r }); + } + function rc(e, t) { + return V({ map: ec, keys: [e, t] }); + } + function ic(e, t, n, r, i) { + return X({ map: tc, keys: [e, t, n, r], value: i }); + } + function ac(e, t, n, r) { + return V({ map: tc, keys: [e, t, n, r] }); + } + var oc = function () { + return 2 === arguments.length + ? rc.apply(null, arguments) + : 3 === arguments.length + ? nc.apply(null, arguments) + : 4 === arguments.length + ? ac.apply(null, arguments) + : 5 === arguments.length + ? ic.apply(null, arguments) + : void Ve("Invalid extension access syntax"); + }; + (Ws.prototype.extension = oc), + Ju.forEach(function (e) { + e.extensions.forEach(function (t) { + nc(e.type, t.name, t.impl); + }); + }); + var sc = function e() { + if (!(this instanceof e)) return new e(); + this.length = 0; + }, + lc = sc.prototype; + (lc.instanceString = function () { + return "stylesheet"; + }), + (lc.selector = function (e) { + return (this[this.length++] = { selector: e, properties: [] }), this; + }), + (lc.css = function (e, t) { + var n = this.length - 1; + if (f(e)) this[n].properties.push({ name: e, value: t }); + else if (m(e)) + for (var r = e, i = Object.keys(r), a = 0; a < i.length; a++) { + var o = i[a], + s = r[o]; + if (null != s) { + var l = Vs.properties[o] || Vs.properties[k(o)]; + if (null != l) { + var u = l.name, + c = s; + this[n].properties.push({ name: u, value: c }); + } + } + } + return this; + }), + (lc.style = lc.css), + (lc.generateStyle = function (e) { + var t = new Vs(e); + return this.appendToStyle(t); + }), + (lc.appendToStyle = function (e) { + for (var t = 0; t < this.length; t++) { + var n = this[t], + r = n.selector, + i = n.properties; + e.selector(r); + for (var a = 0; a < i.length; a++) { + var o = i[a]; + e.css(o.name, o.value); + } + } + return e; + }); + var uc = function (e) { + return void 0 === e && (e = {}), m(e) ? new Ws(e) : f(e) ? oc.apply(oc, arguments) : void 0; + }; + return ( + (uc.use = function (e) { + var t = Array.prototype.slice.call(arguments, 1); + return t.unshift(uc), e.apply(null, t), this; + }), + (uc.warnings = function (e) { + return Ue(e); + }), + (uc.version = "3.26.0"), + (uc.stylesheet = uc.Stylesheet = sc), + uc + ); + })(); + }, + 2241: function (e) { + var t; + (t = function () { + return (function (e) { + var t = {}; + function n(r) { + if (t[r]) return t[r].exports; + var i = (t[r] = { i: r, l: !1, exports: {} }); + return e[r].call(i.exports, i, i.exports, n), (i.l = !0), i.exports; + } + return ( + (n.m = e), + (n.c = t), + (n.i = function (e) { + return e; + }), + (n.d = function (e, t, r) { + n.o(e, t) || Object.defineProperty(e, t, { configurable: !1, enumerable: !0, get: r }); + }), + (n.n = function (e) { + var t = + e && e.__esModule + ? function () { + return e.default; + } + : function () { + return e; + }; + return n.d(t, "a", t), t; + }), + (n.o = function (e, t) { + return Object.prototype.hasOwnProperty.call(e, t); + }), + (n.p = ""), + n((n.s = 26)) + ); + })([ + function (e, t, n) { + "use strict"; + function r() {} + (r.QUALITY = 1), + (r.DEFAULT_CREATE_BENDS_AS_NEEDED = !1), + (r.DEFAULT_INCREMENTAL = !1), + (r.DEFAULT_ANIMATION_ON_LAYOUT = !0), + (r.DEFAULT_ANIMATION_DURING_LAYOUT = !1), + (r.DEFAULT_ANIMATION_PERIOD = 50), + (r.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1), + (r.DEFAULT_GRAPH_MARGIN = 15), + (r.NODE_DIMENSIONS_INCLUDE_LABELS = !1), + (r.SIMPLE_NODE_SIZE = 40), + (r.SIMPLE_NODE_HALF_SIZE = r.SIMPLE_NODE_SIZE / 2), + (r.EMPTY_COMPOUND_NODE_SIZE = 40), + (r.MIN_EDGE_LENGTH = 1), + (r.WORLD_BOUNDARY = 1e6), + (r.INITIAL_WORLD_BOUNDARY = r.WORLD_BOUNDARY / 1e3), + (r.WORLD_CENTER_X = 1200), + (r.WORLD_CENTER_Y = 900), + (e.exports = r); + }, + function (e, t, n) { + "use strict"; + var r = n(2), + i = n(8), + a = n(9); + function o(e, t, n) { + r.call(this, n), + (this.isOverlapingSourceAndTarget = !1), + (this.vGraphObject = n), + (this.bendpoints = []), + (this.source = e), + (this.target = t); + } + for (var s in ((o.prototype = Object.create(r.prototype)), r)) o[s] = r[s]; + (o.prototype.getSource = function () { + return this.source; + }), + (o.prototype.getTarget = function () { + return this.target; + }), + (o.prototype.isInterGraph = function () { + return this.isInterGraph; + }), + (o.prototype.getLength = function () { + return this.length; + }), + (o.prototype.isOverlapingSourceAndTarget = function () { + return this.isOverlapingSourceAndTarget; + }), + (o.prototype.getBendpoints = function () { + return this.bendpoints; + }), + (o.prototype.getLca = function () { + return this.lca; + }), + (o.prototype.getSourceInLca = function () { + return this.sourceInLca; + }), + (o.prototype.getTargetInLca = function () { + return this.targetInLca; + }), + (o.prototype.getOtherEnd = function (e) { + if (this.source === e) return this.target; + if (this.target === e) return this.source; + throw "Node is not incident with this edge"; + }), + (o.prototype.getOtherEndInGraph = function (e, t) { + for (var n = this.getOtherEnd(e), r = t.getGraphManager().getRoot(); ; ) { + if (n.getOwner() == t) return n; + if (n.getOwner() == r) break; + n = n.getOwner().getParent(); + } + return null; + }), + (o.prototype.updateLength = function () { + var e = new Array(4); + (this.isOverlapingSourceAndTarget = i.getIntersection(this.target.getRect(), this.source.getRect(), e)), + this.isOverlapingSourceAndTarget || + ((this.lengthX = e[0] - e[2]), + (this.lengthY = e[1] - e[3]), + Math.abs(this.lengthX) < 1 && (this.lengthX = a.sign(this.lengthX)), + Math.abs(this.lengthY) < 1 && (this.lengthY = a.sign(this.lengthY)), + (this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY))); + }), + (o.prototype.updateLengthSimple = function () { + (this.lengthX = this.target.getCenterX() - this.source.getCenterX()), + (this.lengthY = this.target.getCenterY() - this.source.getCenterY()), + Math.abs(this.lengthX) < 1 && (this.lengthX = a.sign(this.lengthX)), + Math.abs(this.lengthY) < 1 && (this.lengthY = a.sign(this.lengthY)), + (this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY)); + }), + (e.exports = o); + }, + function (e, t, n) { + "use strict"; + e.exports = function (e) { + this.vGraphObject = e; + }; + }, + function (e, t, n) { + "use strict"; + var r = n(2), + i = n(10), + a = n(13), + o = n(0), + s = n(16), + l = n(4); + function u(e, t, n, o) { + null == n && null == o && (o = t), + r.call(this, o), + null != e.graphManager && (e = e.graphManager), + (this.estimatedSize = i.MIN_VALUE), + (this.inclusionTreeDepth = i.MAX_VALUE), + (this.vGraphObject = o), + (this.edges = []), + (this.graphManager = e), + (this.rect = null != n && null != t ? new a(t.x, t.y, n.width, n.height) : new a()); + } + for (var c in ((u.prototype = Object.create(r.prototype)), r)) u[c] = r[c]; + (u.prototype.getEdges = function () { + return this.edges; + }), + (u.prototype.getChild = function () { + return this.child; + }), + (u.prototype.getOwner = function () { + return this.owner; + }), + (u.prototype.getWidth = function () { + return this.rect.width; + }), + (u.prototype.setWidth = function (e) { + this.rect.width = e; + }), + (u.prototype.getHeight = function () { + return this.rect.height; + }), + (u.prototype.setHeight = function (e) { + this.rect.height = e; + }), + (u.prototype.getCenterX = function () { + return this.rect.x + this.rect.width / 2; + }), + (u.prototype.getCenterY = function () { + return this.rect.y + this.rect.height / 2; + }), + (u.prototype.getCenter = function () { + return new l(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2); + }), + (u.prototype.getLocation = function () { + return new l(this.rect.x, this.rect.y); + }), + (u.prototype.getRect = function () { + return this.rect; + }), + (u.prototype.getDiagonal = function () { + return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height); + }), + (u.prototype.getHalfTheDiagonal = function () { + return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2; + }), + (u.prototype.setRect = function (e, t) { + (this.rect.x = e.x), (this.rect.y = e.y), (this.rect.width = t.width), (this.rect.height = t.height); + }), + (u.prototype.setCenter = function (e, t) { + (this.rect.x = e - this.rect.width / 2), (this.rect.y = t - this.rect.height / 2); + }), + (u.prototype.setLocation = function (e, t) { + (this.rect.x = e), (this.rect.y = t); + }), + (u.prototype.moveBy = function (e, t) { + (this.rect.x += e), (this.rect.y += t); + }), + (u.prototype.getEdgeListToNode = function (e) { + var t = [], + n = this; + return ( + n.edges.forEach(function (r) { + if (r.target == e) { + if (r.source != n) throw "Incorrect edge source!"; + t.push(r); + } + }), + t + ); + }), + (u.prototype.getEdgesBetween = function (e) { + var t = [], + n = this; + return ( + n.edges.forEach(function (r) { + if (r.source != n && r.target != n) throw "Incorrect edge source and/or target"; + (r.target != e && r.source != e) || t.push(r); + }), + t + ); + }), + (u.prototype.getNeighborsList = function () { + var e = new Set(), + t = this; + return ( + t.edges.forEach(function (n) { + if (n.source == t) e.add(n.target); + else { + if (n.target != t) throw "Incorrect incidency!"; + e.add(n.source); + } + }), + e + ); + }), + (u.prototype.withChildren = function () { + var e = new Set(); + if ((e.add(this), null != this.child)) + for (var t = this.child.getNodes(), n = 0; n < t.length; n++) + t[n].withChildren().forEach(function (t) { + e.add(t); + }); + return e; + }), + (u.prototype.getNoOfChildren = function () { + var e = 0; + if (null == this.child) e = 1; + else for (var t = this.child.getNodes(), n = 0; n < t.length; n++) e += t[n].getNoOfChildren(); + return 0 == e && (e = 1), e; + }), + (u.prototype.getEstimatedSize = function () { + if (this.estimatedSize == i.MIN_VALUE) throw "assert failed"; + return this.estimatedSize; + }), + (u.prototype.calcEstimatedSize = function () { + return null == this.child + ? (this.estimatedSize = (this.rect.width + this.rect.height) / 2) + : ((this.estimatedSize = this.child.calcEstimatedSize()), + (this.rect.width = this.estimatedSize), + (this.rect.height = this.estimatedSize), + this.estimatedSize); + }), + (u.prototype.scatter = function () { + var e, + t, + n = -o.INITIAL_WORLD_BOUNDARY, + r = o.INITIAL_WORLD_BOUNDARY; + e = o.WORLD_CENTER_X + s.nextDouble() * (r - n) + n; + var i = -o.INITIAL_WORLD_BOUNDARY, + a = o.INITIAL_WORLD_BOUNDARY; + (t = o.WORLD_CENTER_Y + s.nextDouble() * (a - i) + i), (this.rect.x = e), (this.rect.y = t); + }), + (u.prototype.updateBounds = function () { + if (null == this.getChild()) throw "assert failed"; + if (0 != this.getChild().getNodes().length) { + var e = this.getChild(); + if ( + (e.updateBounds(!0), + (this.rect.x = e.getLeft()), + (this.rect.y = e.getTop()), + this.setWidth(e.getRight() - e.getLeft()), + this.setHeight(e.getBottom() - e.getTop()), + o.NODE_DIMENSIONS_INCLUDE_LABELS) + ) { + var t = e.getRight() - e.getLeft(), + n = e.getBottom() - e.getTop(); + this.labelWidth > t && ((this.rect.x -= (this.labelWidth - t) / 2), this.setWidth(this.labelWidth)), + this.labelHeight > n && + ("center" == this.labelPos + ? (this.rect.y -= (this.labelHeight - n) / 2) + : "top" == this.labelPos && (this.rect.y -= this.labelHeight - n), + this.setHeight(this.labelHeight)); + } + } + }), + (u.prototype.getInclusionTreeDepth = function () { + if (this.inclusionTreeDepth == i.MAX_VALUE) throw "assert failed"; + return this.inclusionTreeDepth; + }), + (u.prototype.transform = function (e) { + var t = this.rect.x; + t > o.WORLD_BOUNDARY ? (t = o.WORLD_BOUNDARY) : t < -o.WORLD_BOUNDARY && (t = -o.WORLD_BOUNDARY); + var n = this.rect.y; + n > o.WORLD_BOUNDARY ? (n = o.WORLD_BOUNDARY) : n < -o.WORLD_BOUNDARY && (n = -o.WORLD_BOUNDARY); + var r = new l(t, n), + i = e.inverseTransformPoint(r); + this.setLocation(i.x, i.y); + }), + (u.prototype.getLeft = function () { + return this.rect.x; + }), + (u.prototype.getRight = function () { + return this.rect.x + this.rect.width; + }), + (u.prototype.getTop = function () { + return this.rect.y; + }), + (u.prototype.getBottom = function () { + return this.rect.y + this.rect.height; + }), + (u.prototype.getParent = function () { + return null == this.owner ? null : this.owner.getParent(); + }), + (e.exports = u); + }, + function (e, t, n) { + "use strict"; + function r(e, t) { + null == e && null == t ? ((this.x = 0), (this.y = 0)) : ((this.x = e), (this.y = t)); + } + (r.prototype.getX = function () { + return this.x; + }), + (r.prototype.getY = function () { + return this.y; + }), + (r.prototype.setX = function (e) { + this.x = e; + }), + (r.prototype.setY = function (e) { + this.y = e; + }), + (r.prototype.getDifference = function (e) { + return new DimensionD(this.x - e.x, this.y - e.y); + }), + (r.prototype.getCopy = function () { + return new r(this.x, this.y); + }), + (r.prototype.translate = function (e) { + return (this.x += e.width), (this.y += e.height), this; + }), + (e.exports = r); + }, + function (e, t, n) { + "use strict"; + var r = n(2), + i = n(10), + a = n(0), + o = n(6), + s = n(3), + l = n(1), + u = n(13), + c = n(12), + h = n(11); + function d(e, t, n) { + r.call(this, n), + (this.estimatedSize = i.MIN_VALUE), + (this.margin = a.DEFAULT_GRAPH_MARGIN), + (this.edges = []), + (this.nodes = []), + (this.isConnected = !1), + (this.parent = e), + null != t && t instanceof o ? (this.graphManager = t) : null != t && t instanceof Layout && (this.graphManager = t.graphManager); + } + for (var p in ((d.prototype = Object.create(r.prototype)), r)) d[p] = r[p]; + (d.prototype.getNodes = function () { + return this.nodes; + }), + (d.prototype.getEdges = function () { + return this.edges; + }), + (d.prototype.getGraphManager = function () { + return this.graphManager; + }), + (d.prototype.getParent = function () { + return this.parent; + }), + (d.prototype.getLeft = function () { + return this.left; + }), + (d.prototype.getRight = function () { + return this.right; + }), + (d.prototype.getTop = function () { + return this.top; + }), + (d.prototype.getBottom = function () { + return this.bottom; + }), + (d.prototype.isConnected = function () { + return this.isConnected; + }), + (d.prototype.add = function (e, t, n) { + if (null == t && null == n) { + var r = e; + if (null == this.graphManager) throw "Graph has no graph mgr!"; + if (this.getNodes().indexOf(r) > -1) throw "Node already in graph!"; + return (r.owner = this), this.getNodes().push(r), r; + } + var i = e; + if (!(this.getNodes().indexOf(t) > -1 && this.getNodes().indexOf(n) > -1)) throw "Source or target not in graph!"; + if (t.owner != n.owner || t.owner != this) throw "Both owners must be this graph!"; + return t.owner != n.owner + ? null + : ((i.source = t), (i.target = n), (i.isInterGraph = !1), this.getEdges().push(i), t.edges.push(i), n != t && n.edges.push(i), i); + }), + (d.prototype.remove = function (e) { + var t = e; + if (e instanceof s) { + if (null == t) throw "Node is null!"; + if (null == t.owner || t.owner != this) throw "Owner graph is invalid!"; + if (null == this.graphManager) throw "Owner graph manager is invalid!"; + for (var n = t.edges.slice(), r = n.length, i = 0; i < r; i++) + (a = n[i]).isInterGraph ? this.graphManager.remove(a) : a.source.owner.remove(a); + if (-1 == (o = this.nodes.indexOf(t))) throw "Node not in owner node list!"; + this.nodes.splice(o, 1); + } else if (e instanceof l) { + var a; + if (null == (a = e)) throw "Edge is null!"; + if (null == a.source || null == a.target) throw "Source and/or target is null!"; + if (null == a.source.owner || null == a.target.owner || a.source.owner != this || a.target.owner != this) + throw "Source and/or target owner is invalid!"; + var o, + u = a.source.edges.indexOf(a), + c = a.target.edges.indexOf(a); + if (!(u > -1 && c > -1)) throw "Source and/or target doesn't know this edge!"; + if ( + (a.source.edges.splice(u, 1), + a.target != a.source && a.target.edges.splice(c, 1), + -1 == (o = a.source.owner.getEdges().indexOf(a))) + ) + throw "Not in owner's edge list!"; + a.source.owner.getEdges().splice(o, 1); + } + }), + (d.prototype.updateLeftTop = function () { + for (var e, t, n, r = i.MAX_VALUE, a = i.MAX_VALUE, o = this.getNodes(), s = o.length, l = 0; l < s; l++) { + var u = o[l]; + r > (e = u.getTop()) && (r = e), a > (t = u.getLeft()) && (a = t); + } + return r == i.MAX_VALUE + ? null + : ((n = null != o[0].getParent().paddingLeft ? o[0].getParent().paddingLeft : this.margin), + (this.left = a - n), + (this.top = r - n), + new c(this.left, this.top)); + }), + (d.prototype.updateBounds = function (e) { + for ( + var t, n, r, a, o, s = i.MAX_VALUE, l = -i.MAX_VALUE, c = i.MAX_VALUE, h = -i.MAX_VALUE, d = this.nodes, p = d.length, g = 0; + g < p; + g++ + ) { + var f = d[g]; + e && null != f.child && f.updateBounds(), + s > (t = f.getLeft()) && (s = t), + l < (n = f.getRight()) && (l = n), + c > (r = f.getTop()) && (c = r), + h < (a = f.getBottom()) && (h = a); + } + var v = new u(s, c, l - s, h - c); + s == i.MAX_VALUE && + ((this.left = this.parent.getLeft()), + (this.right = this.parent.getRight()), + (this.top = this.parent.getTop()), + (this.bottom = this.parent.getBottom())), + (o = null != d[0].getParent().paddingLeft ? d[0].getParent().paddingLeft : this.margin), + (this.left = v.x - o), + (this.right = v.x + v.width + o), + (this.top = v.y - o), + (this.bottom = v.y + v.height + o); + }), + (d.calculateBounds = function (e) { + for (var t, n, r, a, o = i.MAX_VALUE, s = -i.MAX_VALUE, l = i.MAX_VALUE, c = -i.MAX_VALUE, h = e.length, d = 0; d < h; d++) { + var p = e[d]; + o > (t = p.getLeft()) && (o = t), + s < (n = p.getRight()) && (s = n), + l > (r = p.getTop()) && (l = r), + c < (a = p.getBottom()) && (c = a); + } + return new u(o, l, s - o, c - l); + }), + (d.prototype.getInclusionTreeDepth = function () { + return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth(); + }), + (d.prototype.getEstimatedSize = function () { + if (this.estimatedSize == i.MIN_VALUE) throw "assert failed"; + return this.estimatedSize; + }), + (d.prototype.calcEstimatedSize = function () { + for (var e = 0, t = this.nodes, n = t.length, r = 0; r < n; r++) e += t[r].calcEstimatedSize(); + return (this.estimatedSize = 0 == e ? a.EMPTY_COMPOUND_NODE_SIZE : e / Math.sqrt(this.nodes.length)), this.estimatedSize; + }), + (d.prototype.updateConnected = function () { + var e = this; + if (0 != this.nodes.length) { + var t, + n, + r = new h(), + i = new Set(), + a = this.nodes[0]; + for ( + a.withChildren().forEach(function (e) { + r.push(e), i.add(e); + }); + 0 !== r.length; + + ) + for (var o = (t = (a = r.shift()).getEdges()).length, s = 0; s < o; s++) + null == (n = t[s].getOtherEndInGraph(a, this)) || + i.has(n) || + n.withChildren().forEach(function (e) { + r.push(e), i.add(e); + }); + if (((this.isConnected = !1), i.size >= this.nodes.length)) { + var l = 0; + i.forEach(function (t) { + t.owner == e && l++; + }), + l == this.nodes.length && (this.isConnected = !0); + } + } else this.isConnected = !0; + }), + (e.exports = d); + }, + function (e, t, n) { + "use strict"; + var r, + i = n(1); + function a(e) { + (r = n(5)), (this.layout = e), (this.graphs = []), (this.edges = []); + } + (a.prototype.addRoot = function () { + var e = this.layout.newGraph(), + t = this.layout.newNode(null), + n = this.add(e, t); + return this.setRootGraph(n), this.rootGraph; + }), + (a.prototype.add = function (e, t, n, r, i) { + if (null == n && null == r && null == i) { + if (null == e) throw "Graph is null!"; + if (null == t) throw "Parent node is null!"; + if (this.graphs.indexOf(e) > -1) throw "Graph already in this graph mgr!"; + if ((this.graphs.push(e), null != e.parent)) throw "Already has a parent!"; + if (null != t.child) throw "Already has a child!"; + return (e.parent = t), (t.child = e), e; + } + (i = n), (n = e); + var a = (r = t).getOwner(), + o = i.getOwner(); + if (null == a || a.getGraphManager() != this) throw "Source not in this graph mgr!"; + if (null == o || o.getGraphManager() != this) throw "Target not in this graph mgr!"; + if (a == o) return (n.isInterGraph = !1), a.add(n, r, i); + if (((n.isInterGraph = !0), (n.source = r), (n.target = i), this.edges.indexOf(n) > -1)) + throw "Edge already in inter-graph edge list!"; + if ((this.edges.push(n), null == n.source || null == n.target)) throw "Edge source and/or target is null!"; + if (-1 != n.source.edges.indexOf(n) || -1 != n.target.edges.indexOf(n)) throw "Edge already in source and/or target incidency list!"; + return n.source.edges.push(n), n.target.edges.push(n), n; + }), + (a.prototype.remove = function (e) { + if (e instanceof r) { + var t = e; + if (t.getGraphManager() != this) throw "Graph not in this graph mgr"; + if (t != this.rootGraph && (null == t.parent || t.parent.graphManager != this)) throw "Invalid parent node!"; + for (var n, a = [], o = (a = a.concat(t.getEdges())).length, s = 0; s < o; s++) (n = a[s]), t.remove(n); + var l, + u = []; + for (o = (u = u.concat(t.getNodes())).length, s = 0; s < o; s++) (l = u[s]), t.remove(l); + t == this.rootGraph && this.setRootGraph(null); + var c = this.graphs.indexOf(t); + this.graphs.splice(c, 1), (t.parent = null); + } else if (e instanceof i) { + if (null == (n = e)) throw "Edge is null!"; + if (!n.isInterGraph) throw "Not an inter-graph edge!"; + if (null == n.source || null == n.target) throw "Source and/or target is null!"; + if (-1 == n.source.edges.indexOf(n) || -1 == n.target.edges.indexOf(n)) throw "Source and/or target doesn't know this edge!"; + if ( + ((c = n.source.edges.indexOf(n)), + n.source.edges.splice(c, 1), + (c = n.target.edges.indexOf(n)), + n.target.edges.splice(c, 1), + null == n.source.owner || null == n.source.owner.getGraphManager()) + ) + throw "Edge owner graph or owner graph manager is null!"; + if (-1 == n.source.owner.getGraphManager().edges.indexOf(n)) throw "Not in owner graph manager's edge list!"; + (c = n.source.owner.getGraphManager().edges.indexOf(n)), n.source.owner.getGraphManager().edges.splice(c, 1); + } + }), + (a.prototype.updateBounds = function () { + this.rootGraph.updateBounds(!0); + }), + (a.prototype.getGraphs = function () { + return this.graphs; + }), + (a.prototype.getAllNodes = function () { + if (null == this.allNodes) { + for (var e = [], t = this.getGraphs(), n = t.length, r = 0; r < n; r++) e = e.concat(t[r].getNodes()); + this.allNodes = e; + } + return this.allNodes; + }), + (a.prototype.resetAllNodes = function () { + this.allNodes = null; + }), + (a.prototype.resetAllEdges = function () { + this.allEdges = null; + }), + (a.prototype.resetAllNodesToApplyGravitation = function () { + this.allNodesToApplyGravitation = null; + }), + (a.prototype.getAllEdges = function () { + if (null == this.allEdges) { + for (var e = [], t = this.getGraphs(), n = (t.length, 0); n < t.length; n++) e = e.concat(t[n].getEdges()); + (e = e.concat(this.edges)), (this.allEdges = e); + } + return this.allEdges; + }), + (a.prototype.getAllNodesToApplyGravitation = function () { + return this.allNodesToApplyGravitation; + }), + (a.prototype.setAllNodesToApplyGravitation = function (e) { + if (null != this.allNodesToApplyGravitation) throw "assert failed"; + this.allNodesToApplyGravitation = e; + }), + (a.prototype.getRoot = function () { + return this.rootGraph; + }), + (a.prototype.setRootGraph = function (e) { + if (e.getGraphManager() != this) throw "Root not in this graph mgr!"; + (this.rootGraph = e), null == e.parent && (e.parent = this.layout.newNode("Root node")); + }), + (a.prototype.getLayout = function () { + return this.layout; + }), + (a.prototype.isOneAncestorOfOther = function (e, t) { + if (null == e || null == t) throw "assert failed"; + if (e == t) return !0; + for (var n, r = e.getOwner(); null != (n = r.getParent()); ) { + if (n == t) return !0; + if (null == (r = n.getOwner())) break; + } + for (r = t.getOwner(); null != (n = r.getParent()); ) { + if (n == e) return !0; + if (null == (r = n.getOwner())) break; + } + return !1; + }), + (a.prototype.calcLowestCommonAncestors = function () { + for (var e, t, n, r, i, a = this.getAllEdges(), o = a.length, s = 0; s < o; s++) + if (((t = (e = a[s]).source), (n = e.target), (e.lca = null), (e.sourceInLca = t), (e.targetInLca = n), t != n)) { + for (r = t.getOwner(); null == e.lca; ) { + for (e.targetInLca = n, i = n.getOwner(); null == e.lca; ) { + if (i == r) { + e.lca = i; + break; + } + if (i == this.rootGraph) break; + if (null != e.lca) throw "assert failed"; + (e.targetInLca = i.getParent()), (i = e.targetInLca.getOwner()); + } + if (r == this.rootGraph) break; + null == e.lca && ((e.sourceInLca = r.getParent()), (r = e.sourceInLca.getOwner())); + } + if (null == e.lca) throw "assert failed"; + } else e.lca = t.getOwner(); + }), + (a.prototype.calcLowestCommonAncestor = function (e, t) { + if (e == t) return e.getOwner(); + for (var n = e.getOwner(); null != n; ) { + for (var r = t.getOwner(); null != r; ) { + if (r == n) return r; + r = r.getParent().getOwner(); + } + n = n.getParent().getOwner(); + } + return n; + }), + (a.prototype.calcInclusionTreeDepths = function (e, t) { + var n; + null == e && null == t && ((e = this.rootGraph), (t = 1)); + for (var r = e.getNodes(), i = r.length, a = 0; a < i; a++) + ((n = r[a]).inclusionTreeDepth = t), null != n.child && this.calcInclusionTreeDepths(n.child, t + 1); + }), + (a.prototype.includesInvalidEdge = function () { + for (var e, t = this.edges.length, n = 0; n < t; n++) + if (((e = this.edges[n]), this.isOneAncestorOfOther(e.source, e.target))) return !0; + return !1; + }), + (e.exports = a); + }, + function (e, t, n) { + "use strict"; + var r = n(0); + function i() {} + for (var a in r) i[a] = r[a]; + (i.MAX_ITERATIONS = 2500), + (i.DEFAULT_EDGE_LENGTH = 50), + (i.DEFAULT_SPRING_STRENGTH = 0.45), + (i.DEFAULT_REPULSION_STRENGTH = 4500), + (i.DEFAULT_GRAVITY_STRENGTH = 0.4), + (i.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1), + (i.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8), + (i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5), + (i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0), + (i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0), + (i.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3), + (i.COOLING_ADAPTATION_FACTOR = 0.33), + (i.ADAPTATION_LOWER_NODE_LIMIT = 1e3), + (i.ADAPTATION_UPPER_NODE_LIMIT = 5e3), + (i.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100), + (i.MAX_NODE_DISPLACEMENT = 3 * i.MAX_NODE_DISPLACEMENT_INCREMENTAL), + (i.MIN_REPULSION_DIST = i.DEFAULT_EDGE_LENGTH / 10), + (i.CONVERGENCE_CHECK_PERIOD = 100), + (i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1), + (i.MIN_EDGE_LENGTH = 1), + (i.GRID_CALCULATION_CHECK_PERIOD = 10), + (e.exports = i); + }, + function (e, t, n) { + "use strict"; + var r = n(12); + function i() {} + (i.calcSeparationAmount = function (e, t, n, r) { + if (!e.intersects(t)) throw "assert failed"; + var i = new Array(2); + this.decideDirectionsForOverlappingNodes(e, t, i), + (n[0] = Math.min(e.getRight(), t.getRight()) - Math.max(e.x, t.x)), + (n[1] = Math.min(e.getBottom(), t.getBottom()) - Math.max(e.y, t.y)), + e.getX() <= t.getX() && e.getRight() >= t.getRight() + ? (n[0] += Math.min(t.getX() - e.getX(), e.getRight() - t.getRight())) + : t.getX() <= e.getX() && t.getRight() >= e.getRight() && (n[0] += Math.min(e.getX() - t.getX(), t.getRight() - e.getRight())), + e.getY() <= t.getY() && e.getBottom() >= t.getBottom() + ? (n[1] += Math.min(t.getY() - e.getY(), e.getBottom() - t.getBottom())) + : t.getY() <= e.getY() && t.getBottom() >= e.getBottom() && (n[1] += Math.min(e.getY() - t.getY(), t.getBottom() - e.getBottom())); + var a = Math.abs((t.getCenterY() - e.getCenterY()) / (t.getCenterX() - e.getCenterX())); + t.getCenterY() === e.getCenterY() && t.getCenterX() === e.getCenterX() && (a = 1); + var o = a * n[0], + s = n[1] / a; + n[0] < s ? (s = n[0]) : (o = n[1]), (n[0] = -1 * i[0] * (s / 2 + r)), (n[1] = -1 * i[1] * (o / 2 + r)); + }), + (i.decideDirectionsForOverlappingNodes = function (e, t, n) { + e.getCenterX() < t.getCenterX() ? (n[0] = -1) : (n[0] = 1), e.getCenterY() < t.getCenterY() ? (n[1] = -1) : (n[1] = 1); + }), + (i.getIntersection2 = function (e, t, n) { + var r = e.getCenterX(), + i = e.getCenterY(), + a = t.getCenterX(), + o = t.getCenterY(); + if (e.intersects(t)) return (n[0] = r), (n[1] = i), (n[2] = a), (n[3] = o), !0; + var s = e.getX(), + l = e.getY(), + u = e.getRight(), + c = e.getX(), + h = e.getBottom(), + d = e.getRight(), + p = e.getWidthHalf(), + g = e.getHeightHalf(), + f = t.getX(), + v = t.getY(), + y = t.getRight(), + m = t.getX(), + b = t.getBottom(), + x = t.getRight(), + w = t.getWidthHalf(), + E = t.getHeightHalf(), + _ = !1, + T = !1; + if (r === a) { + if (i > o) return (n[0] = r), (n[1] = l), (n[2] = a), (n[3] = b), !1; + if (i < o) return (n[0] = r), (n[1] = h), (n[2] = a), (n[3] = v), !1; + } else if (i === o) { + if (r > a) return (n[0] = s), (n[1] = i), (n[2] = y), (n[3] = o), !1; + if (r < a) return (n[0] = u), (n[1] = i), (n[2] = f), (n[3] = o), !1; + } else { + var D = e.height / e.width, + C = t.height / t.width, + N = (o - i) / (a - r), + A = void 0, + L = void 0, + k = void 0, + S = void 0, + I = void 0, + M = void 0; + if ( + (-D === N + ? r > a + ? ((n[0] = c), (n[1] = h), (_ = !0)) + : ((n[0] = u), (n[1] = l), (_ = !0)) + : D === N && (r > a ? ((n[0] = s), (n[1] = l), (_ = !0)) : ((n[0] = d), (n[1] = h), (_ = !0))), + -C === N + ? a > r + ? ((n[2] = m), (n[3] = b), (T = !0)) + : ((n[2] = y), (n[3] = v), (T = !0)) + : C === N && (a > r ? ((n[2] = f), (n[3] = v), (T = !0)) : ((n[2] = x), (n[3] = b), (T = !0))), + _ && T) + ) + return !1; + if ( + (r > a + ? i > o + ? ((A = this.getCardinalDirection(D, N, 4)), (L = this.getCardinalDirection(C, N, 2))) + : ((A = this.getCardinalDirection(-D, N, 3)), (L = this.getCardinalDirection(-C, N, 1))) + : i > o + ? ((A = this.getCardinalDirection(-D, N, 1)), (L = this.getCardinalDirection(-C, N, 3))) + : ((A = this.getCardinalDirection(D, N, 2)), (L = this.getCardinalDirection(C, N, 4))), + !_) + ) + switch (A) { + case 1: + (S = l), (k = r + -g / N), (n[0] = k), (n[1] = S); + break; + case 2: + (k = d), (S = i + p * N), (n[0] = k), (n[1] = S); + break; + case 3: + (S = h), (k = r + g / N), (n[0] = k), (n[1] = S); + break; + case 4: + (k = c), (S = i + -p * N), (n[0] = k), (n[1] = S); + } + if (!T) + switch (L) { + case 1: + (M = v), (I = a + -E / N), (n[2] = I), (n[3] = M); + break; + case 2: + (I = x), (M = o + w * N), (n[2] = I), (n[3] = M); + break; + case 3: + (M = b), (I = a + E / N), (n[2] = I), (n[3] = M); + break; + case 4: + (I = m), (M = o + -w * N), (n[2] = I), (n[3] = M); + } + } + return !1; + }), + (i.getCardinalDirection = function (e, t, n) { + return e > t ? n : 1 + (n % 4); + }), + (i.getIntersection = function (e, t, n, i) { + if (null == i) return this.getIntersection2(e, t, n); + var a, + o, + s, + l, + u, + c, + h, + d = e.x, + p = e.y, + g = t.x, + f = t.y, + v = n.x, + y = n.y, + m = i.x, + b = i.y; + return 0 == (h = (a = f - p) * (l = v - m) - (o = b - y) * (s = d - g)) + ? null + : new r((s * (c = m * y - v * b) - l * (u = g * p - d * f)) / h, (o * u - a * c) / h); + }), + (i.angleOfVector = function (e, t, n, r) { + var i = void 0; + return ( + e !== n + ? ((i = Math.atan((r - t) / (n - e))), n < e ? (i += Math.PI) : r < t && (i += this.TWO_PI)) + : (i = r < t ? this.ONE_AND_HALF_PI : this.HALF_PI), + i + ); + }), + (i.doIntersect = function (e, t, n, r) { + var i = e.x, + a = e.y, + o = t.x, + s = t.y, + l = n.x, + u = n.y, + c = r.x, + h = r.y, + d = (o - i) * (h - u) - (c - l) * (s - a); + if (0 === d) return !1; + var p = ((h - u) * (c - i) + (l - c) * (h - a)) / d, + g = ((a - s) * (c - i) + (o - i) * (h - a)) / d; + return 0 < p && p < 1 && 0 < g && g < 1; + }), + (i.HALF_PI = 0.5 * Math.PI), + (i.ONE_AND_HALF_PI = 1.5 * Math.PI), + (i.TWO_PI = 2 * Math.PI), + (i.THREE_PI = 3 * Math.PI), + (e.exports = i); + }, + function (e, t, n) { + "use strict"; + function r() {} + (r.sign = function (e) { + return e > 0 ? 1 : e < 0 ? -1 : 0; + }), + (r.floor = function (e) { + return e < 0 ? Math.ceil(e) : Math.floor(e); + }), + (r.ceil = function (e) { + return e < 0 ? Math.floor(e) : Math.ceil(e); + }), + (e.exports = r); + }, + function (e, t, n) { + "use strict"; + function r() {} + (r.MAX_VALUE = 2147483647), (r.MIN_VALUE = -2147483648), (e.exports = r); + }, + function (e, t, n) { + "use strict"; + var r = (function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n]; + (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + } + return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + })(), + i = function (e) { + return { value: e, next: null, prev: null }; + }, + a = function (e, t, n, r) { + return null !== e ? (e.next = t) : (r.head = t), null !== n ? (n.prev = t) : (r.tail = t), (t.prev = e), (t.next = n), r.length++, t; + }, + o = function (e, t) { + var n = e.prev, + r = e.next; + return null !== n ? (n.next = r) : (t.head = r), null !== r ? (r.prev = n) : (t.tail = n), (e.prev = e.next = null), t.length--, e; + }, + s = (function () { + function e(t) { + var n = this; + !(function (e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + })(this, e), + (this.length = 0), + (this.head = null), + (this.tail = null), + null != t && + t.forEach(function (e) { + return n.push(e); + }); + } + return ( + r(e, [ + { + key: "size", + value: function () { + return this.length; + }, + }, + { + key: "insertBefore", + value: function (e, t) { + return a(t.prev, i(e), t, this); + }, + }, + { + key: "insertAfter", + value: function (e, t) { + return a(t, i(e), t.next, this); + }, + }, + { + key: "insertNodeBefore", + value: function (e, t) { + return a(t.prev, e, t, this); + }, + }, + { + key: "insertNodeAfter", + value: function (e, t) { + return a(t, e, t.next, this); + }, + }, + { + key: "push", + value: function (e) { + return a(this.tail, i(e), null, this); + }, + }, + { + key: "unshift", + value: function (e) { + return a(null, i(e), this.head, this); + }, + }, + { + key: "remove", + value: function (e) { + return o(e, this); + }, + }, + { + key: "pop", + value: function () { + return o(this.tail, this).value; + }, + }, + { + key: "popNode", + value: function () { + return o(this.tail, this); + }, + }, + { + key: "shift", + value: function () { + return o(this.head, this).value; + }, + }, + { + key: "shiftNode", + value: function () { + return o(this.head, this); + }, + }, + { + key: "get_object_at", + value: function (e) { + if (e <= this.length()) { + for (var t = 1, n = this.head; t < e; ) (n = n.next), t++; + return n.value; + } + }, + }, + { + key: "set_object_at", + value: function (e, t) { + if (e <= this.length()) { + for (var n = 1, r = this.head; n < e; ) (r = r.next), n++; + r.value = t; + } + }, + }, + ]), + e + ); + })(); + e.exports = s; + }, + function (e, t, n) { + "use strict"; + function r(e, t, n) { + (this.x = null), + (this.y = null), + null == e && null == t && null == n + ? ((this.x = 0), (this.y = 0)) + : "number" == typeof e && "number" == typeof t && null == n + ? ((this.x = e), (this.y = t)) + : "Point" == e.constructor.name && null == t && null == n && ((n = e), (this.x = n.x), (this.y = n.y)); + } + (r.prototype.getX = function () { + return this.x; + }), + (r.prototype.getY = function () { + return this.y; + }), + (r.prototype.getLocation = function () { + return new r(this.x, this.y); + }), + (r.prototype.setLocation = function (e, t, n) { + "Point" == e.constructor.name && null == t && null == n + ? ((n = e), this.setLocation(n.x, n.y)) + : "number" == typeof e && + "number" == typeof t && + null == n && + (parseInt(e) == e && parseInt(t) == t ? this.move(e, t) : ((this.x = Math.floor(e + 0.5)), (this.y = Math.floor(t + 0.5)))); + }), + (r.prototype.move = function (e, t) { + (this.x = e), (this.y = t); + }), + (r.prototype.translate = function (e, t) { + (this.x += e), (this.y += t); + }), + (r.prototype.equals = function (e) { + if ("Point" == e.constructor.name) { + var t = e; + return this.x == t.x && this.y == t.y; + } + return this == e; + }), + (r.prototype.toString = function () { + return new r().constructor.name + "[x=" + this.x + ",y=" + this.y + "]"; + }), + (e.exports = r); + }, + function (e, t, n) { + "use strict"; + function r(e, t, n, r) { + (this.x = 0), + (this.y = 0), + (this.width = 0), + (this.height = 0), + null != e && null != t && null != n && null != r && ((this.x = e), (this.y = t), (this.width = n), (this.height = r)); + } + (r.prototype.getX = function () { + return this.x; + }), + (r.prototype.setX = function (e) { + this.x = e; + }), + (r.prototype.getY = function () { + return this.y; + }), + (r.prototype.setY = function (e) { + this.y = e; + }), + (r.prototype.getWidth = function () { + return this.width; + }), + (r.prototype.setWidth = function (e) { + this.width = e; + }), + (r.prototype.getHeight = function () { + return this.height; + }), + (r.prototype.setHeight = function (e) { + this.height = e; + }), + (r.prototype.getRight = function () { + return this.x + this.width; + }), + (r.prototype.getBottom = function () { + return this.y + this.height; + }), + (r.prototype.intersects = function (e) { + return !(this.getRight() < e.x || this.getBottom() < e.y || e.getRight() < this.x || e.getBottom() < this.y); + }), + (r.prototype.getCenterX = function () { + return this.x + this.width / 2; + }), + (r.prototype.getMinX = function () { + return this.getX(); + }), + (r.prototype.getMaxX = function () { + return this.getX() + this.width; + }), + (r.prototype.getCenterY = function () { + return this.y + this.height / 2; + }), + (r.prototype.getMinY = function () { + return this.getY(); + }), + (r.prototype.getMaxY = function () { + return this.getY() + this.height; + }), + (r.prototype.getWidthHalf = function () { + return this.width / 2; + }), + (r.prototype.getHeightHalf = function () { + return this.height / 2; + }), + (e.exports = r); + }, + function (e, t, n) { + "use strict"; + var r = + "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; + }; + function i() {} + (i.lastID = 0), + (i.createID = function (e) { + return i.isPrimitive(e) ? e : (null != e.uniqueID || ((e.uniqueID = i.getString()), i.lastID++), e.uniqueID); + }), + (i.getString = function (e) { + return null == e && (e = i.lastID), "Object#" + e; + }), + (i.isPrimitive = function (e) { + var t = void 0 === e ? "undefined" : r(e); + return null == e || ("object" != t && "function" != t); + }), + (e.exports = i); + }, + function (e, t, n) { + "use strict"; + function r(e) { + if (Array.isArray(e)) { + for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t]; + return n; + } + return Array.from(e); + } + var i = n(0), + a = n(6), + o = n(3), + s = n(1), + l = n(5), + u = n(4), + c = n(17), + h = n(27); + function d(e) { + h.call(this), + (this.layoutQuality = i.QUALITY), + (this.createBendsAsNeeded = i.DEFAULT_CREATE_BENDS_AS_NEEDED), + (this.incremental = i.DEFAULT_INCREMENTAL), + (this.animationOnLayout = i.DEFAULT_ANIMATION_ON_LAYOUT), + (this.animationDuringLayout = i.DEFAULT_ANIMATION_DURING_LAYOUT), + (this.animationPeriod = i.DEFAULT_ANIMATION_PERIOD), + (this.uniformLeafNodeSizes = i.DEFAULT_UNIFORM_LEAF_NODE_SIZES), + (this.edgeToDummyNodes = new Map()), + (this.graphManager = new a(this)), + (this.isLayoutFinished = !1), + (this.isSubLayout = !1), + (this.isRemoteUse = !1), + null != e && (this.isRemoteUse = e); + } + (d.RANDOM_SEED = 1), + (d.prototype = Object.create(h.prototype)), + (d.prototype.getGraphManager = function () { + return this.graphManager; + }), + (d.prototype.getAllNodes = function () { + return this.graphManager.getAllNodes(); + }), + (d.prototype.getAllEdges = function () { + return this.graphManager.getAllEdges(); + }), + (d.prototype.getAllNodesToApplyGravitation = function () { + return this.graphManager.getAllNodesToApplyGravitation(); + }), + (d.prototype.newGraphManager = function () { + var e = new a(this); + return (this.graphManager = e), e; + }), + (d.prototype.newGraph = function (e) { + return new l(null, this.graphManager, e); + }), + (d.prototype.newNode = function (e) { + return new o(this.graphManager, e); + }), + (d.prototype.newEdge = function (e) { + return new s(null, null, e); + }), + (d.prototype.checkLayoutSuccess = function () { + return ( + null == this.graphManager.getRoot() || 0 == this.graphManager.getRoot().getNodes().length || this.graphManager.includesInvalidEdge() + ); + }), + (d.prototype.runLayout = function () { + var e; + return ( + (this.isLayoutFinished = !1), + this.tilingPreLayout && this.tilingPreLayout(), + this.initParameters(), + (e = !this.checkLayoutSuccess() && this.layout()), + "during" !== i.ANIMATE && + (e && (this.isSubLayout || this.doPostLayout()), + this.tilingPostLayout && this.tilingPostLayout(), + (this.isLayoutFinished = !0), + e) + ); + }), + (d.prototype.doPostLayout = function () { + this.incremental || this.transform(), this.update(); + }), + (d.prototype.update2 = function () { + if ((this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse)) { + for (var e = this.graphManager.getAllEdges(), t = 0; t < e.length; t++) e[t]; + var n = this.graphManager.getRoot().getNodes(); + for (t = 0; t < n.length; t++) n[t]; + this.update(this.graphManager.getRoot()); + } + }), + (d.prototype.update = function (e) { + if (null == e) this.update2(); + else if (e instanceof o) { + var t = e; + if (null != t.getChild()) for (var n = t.getChild().getNodes(), r = 0; r < n.length; r++) update(n[r]); + null != t.vGraphObject && t.vGraphObject.update(t); + } else if (e instanceof s) { + var i = e; + null != i.vGraphObject && i.vGraphObject.update(i); + } else if (e instanceof l) { + var a = e; + null != a.vGraphObject && a.vGraphObject.update(a); + } + }), + (d.prototype.initParameters = function () { + this.isSubLayout || + ((this.layoutQuality = i.QUALITY), + (this.animationDuringLayout = i.DEFAULT_ANIMATION_DURING_LAYOUT), + (this.animationPeriod = i.DEFAULT_ANIMATION_PERIOD), + (this.animationOnLayout = i.DEFAULT_ANIMATION_ON_LAYOUT), + (this.incremental = i.DEFAULT_INCREMENTAL), + (this.createBendsAsNeeded = i.DEFAULT_CREATE_BENDS_AS_NEEDED), + (this.uniformLeafNodeSizes = i.DEFAULT_UNIFORM_LEAF_NODE_SIZES)), + this.animationDuringLayout && (this.animationOnLayout = !1); + }), + (d.prototype.transform = function (e) { + if (null == e) this.transform(new u(0, 0)); + else { + var t = new c(), + n = this.graphManager.getRoot().updateLeftTop(); + if (null != n) { + t.setWorldOrgX(e.x), t.setWorldOrgY(e.y), t.setDeviceOrgX(n.x), t.setDeviceOrgY(n.y); + for (var r = this.getAllNodes(), i = 0; i < r.length; i++) r[i].transform(t); + } + } + }), + (d.prototype.positionNodesRandomly = function (e) { + if (null == e) this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0); + else + for (var t, n, r = e.getNodes(), i = 0; i < r.length; i++) + null == (n = (t = r[i]).getChild()) || 0 == n.getNodes().length ? t.scatter() : (this.positionNodesRandomly(n), t.updateBounds()); + }), + (d.prototype.getFlatForest = function () { + for (var e = [], t = !0, n = this.graphManager.getRoot().getNodes(), i = !0, a = 0; a < n.length; a++) + null != n[a].getChild() && (i = !1); + if (!i) return e; + var o = new Set(), + s = [], + l = new Map(), + u = []; + for (u = u.concat(n); u.length > 0 && t; ) { + for (s.push(u[0]); s.length > 0 && t; ) { + var c = s[0]; + s.splice(0, 1), o.add(c); + var h = c.getEdges(); + for (a = 0; a < h.length; a++) { + var d = h[a].getOtherEnd(c); + if (l.get(c) != d) { + if (o.has(d)) { + t = !1; + break; + } + s.push(d), l.set(d, c); + } + } + } + if (t) { + var p = [].concat(r(o)); + for (e.push(p), a = 0; a < p.length; a++) { + var g = p[a], + f = u.indexOf(g); + f > -1 && u.splice(f, 1); + } + (o = new Set()), (l = new Map()); + } else e = []; + } + return e; + }), + (d.prototype.createDummyNodesForBendpoints = function (e) { + for ( + var t = [], n = e.source, r = this.graphManager.calcLowestCommonAncestor(e.source, e.target), i = 0; + i < e.bendpoints.length; + i++ + ) { + var a = this.newNode(null); + a.setRect(new Point(0, 0), new Dimension(1, 1)), r.add(a); + var o = this.newEdge(null); + this.graphManager.add(o, n, a), t.add(a), (n = a); + } + return ( + (o = this.newEdge(null)), + this.graphManager.add(o, n, e.target), + this.edgeToDummyNodes.set(e, t), + e.isInterGraph() ? this.graphManager.remove(e) : r.remove(e), + t + ); + }), + (d.prototype.createBendpointsFromDummyNodes = function () { + var e = []; + (e = e.concat(this.graphManager.getAllEdges())), (e = [].concat(r(this.edgeToDummyNodes.keys())).concat(e)); + for (var t = 0; t < e.length; t++) { + var n = e[t]; + if (n.bendpoints.length > 0) { + for (var i = this.edgeToDummyNodes.get(n), a = 0; a < i.length; a++) { + var o = i[a], + s = new u(o.getCenterX(), o.getCenterY()), + l = n.bendpoints.get(a); + (l.x = s.x), (l.y = s.y), o.getOwner().remove(o); + } + this.graphManager.add(n, n.source, n.target); + } + } + }), + (d.transform = function (e, t, n, r) { + if (null != n && null != r) { + var i = t; + return e <= 50 ? (i -= ((t - t / n) / 50) * (50 - e)) : (i += ((t * r - t) / 50) * (e - 50)), i; + } + var a, o; + return e <= 50 ? ((a = (9 * t) / 500), (o = t / 10)) : ((a = (9 * t) / 50), (o = -8 * t)), a * e + o; + }), + (d.findCenterOfTree = function (e) { + var t = []; + t = t.concat(e); + var n = [], + r = new Map(), + i = !1, + a = null; + (1 != t.length && 2 != t.length) || ((i = !0), (a = t[0])); + for (var o = 0; o < t.length; o++) { + var s = (c = t[o]).getNeighborsList().size; + r.set(c, c.getNeighborsList().size), 1 == s && n.push(c); + } + var l = []; + for (l = l.concat(n); !i; ) { + var u = []; + for (u = u.concat(l), l = [], o = 0; o < t.length; o++) { + var c = t[o], + h = t.indexOf(c); + h >= 0 && t.splice(h, 1), + c.getNeighborsList().forEach(function (e) { + if (n.indexOf(e) < 0) { + var t = r.get(e) - 1; + 1 == t && l.push(e), r.set(e, t); + } + }); + } + (n = n.concat(l)), (1 != t.length && 2 != t.length) || ((i = !0), (a = t[0])); + } + return a; + }), + (d.prototype.setGraphManager = function (e) { + this.graphManager = e; + }), + (e.exports = d); + }, + function (e, t, n) { + "use strict"; + function r() {} + (r.seed = 1), + (r.x = 0), + (r.nextDouble = function () { + return (r.x = 1e4 * Math.sin(r.seed++)), r.x - Math.floor(r.x); + }), + (e.exports = r); + }, + function (e, t, n) { + "use strict"; + var r = n(4); + function i(e, t) { + (this.lworldOrgX = 0), + (this.lworldOrgY = 0), + (this.ldeviceOrgX = 0), + (this.ldeviceOrgY = 0), + (this.lworldExtX = 1), + (this.lworldExtY = 1), + (this.ldeviceExtX = 1), + (this.ldeviceExtY = 1); + } + (i.prototype.getWorldOrgX = function () { + return this.lworldOrgX; + }), + (i.prototype.setWorldOrgX = function (e) { + this.lworldOrgX = e; + }), + (i.prototype.getWorldOrgY = function () { + return this.lworldOrgY; + }), + (i.prototype.setWorldOrgY = function (e) { + this.lworldOrgY = e; + }), + (i.prototype.getWorldExtX = function () { + return this.lworldExtX; + }), + (i.prototype.setWorldExtX = function (e) { + this.lworldExtX = e; + }), + (i.prototype.getWorldExtY = function () { + return this.lworldExtY; + }), + (i.prototype.setWorldExtY = function (e) { + this.lworldExtY = e; + }), + (i.prototype.getDeviceOrgX = function () { + return this.ldeviceOrgX; + }), + (i.prototype.setDeviceOrgX = function (e) { + this.ldeviceOrgX = e; + }), + (i.prototype.getDeviceOrgY = function () { + return this.ldeviceOrgY; + }), + (i.prototype.setDeviceOrgY = function (e) { + this.ldeviceOrgY = e; + }), + (i.prototype.getDeviceExtX = function () { + return this.ldeviceExtX; + }), + (i.prototype.setDeviceExtX = function (e) { + this.ldeviceExtX = e; + }), + (i.prototype.getDeviceExtY = function () { + return this.ldeviceExtY; + }), + (i.prototype.setDeviceExtY = function (e) { + this.ldeviceExtY = e; + }), + (i.prototype.transformX = function (e) { + var t = 0, + n = this.lworldExtX; + return 0 != n && (t = this.ldeviceOrgX + ((e - this.lworldOrgX) * this.ldeviceExtX) / n), t; + }), + (i.prototype.transformY = function (e) { + var t = 0, + n = this.lworldExtY; + return 0 != n && (t = this.ldeviceOrgY + ((e - this.lworldOrgY) * this.ldeviceExtY) / n), t; + }), + (i.prototype.inverseTransformX = function (e) { + var t = 0, + n = this.ldeviceExtX; + return 0 != n && (t = this.lworldOrgX + ((e - this.ldeviceOrgX) * this.lworldExtX) / n), t; + }), + (i.prototype.inverseTransformY = function (e) { + var t = 0, + n = this.ldeviceExtY; + return 0 != n && (t = this.lworldOrgY + ((e - this.ldeviceOrgY) * this.lworldExtY) / n), t; + }), + (i.prototype.inverseTransformPoint = function (e) { + return new r(this.inverseTransformX(e.x), this.inverseTransformY(e.y)); + }), + (e.exports = i); + }, + function (e, t, n) { + "use strict"; + var r = n(15), + i = n(7), + a = n(0), + o = n(8), + s = n(9); + function l() { + r.call(this), + (this.useSmartIdealEdgeLengthCalculation = i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION), + (this.idealEdgeLength = i.DEFAULT_EDGE_LENGTH), + (this.springConstant = i.DEFAULT_SPRING_STRENGTH), + (this.repulsionConstant = i.DEFAULT_REPULSION_STRENGTH), + (this.gravityConstant = i.DEFAULT_GRAVITY_STRENGTH), + (this.compoundGravityConstant = i.DEFAULT_COMPOUND_GRAVITY_STRENGTH), + (this.gravityRangeFactor = i.DEFAULT_GRAVITY_RANGE_FACTOR), + (this.compoundGravityRangeFactor = i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR), + (this.displacementThresholdPerNode = (3 * i.DEFAULT_EDGE_LENGTH) / 100), + (this.coolingFactor = i.DEFAULT_COOLING_FACTOR_INCREMENTAL), + (this.initialCoolingFactor = i.DEFAULT_COOLING_FACTOR_INCREMENTAL), + (this.totalDisplacement = 0), + (this.oldTotalDisplacement = 0), + (this.maxIterations = i.MAX_ITERATIONS); + } + for (var u in ((l.prototype = Object.create(r.prototype)), r)) l[u] = r[u]; + (l.prototype.initParameters = function () { + r.prototype.initParameters.call(this, arguments), + (this.totalIterations = 0), + (this.notAnimatedIterations = 0), + (this.useFRGridVariant = i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION), + (this.grid = []); + }), + (l.prototype.calcIdealEdgeLengths = function () { + for (var e, t, n, r, o, s, l = this.getGraphManager().getAllEdges(), u = 0; u < l.length; u++) + ((e = l[u]).idealLength = this.idealEdgeLength), + e.isInterGraph && + ((n = e.getSource()), + (r = e.getTarget()), + (o = e.getSourceInLca().getEstimatedSize()), + (s = e.getTargetInLca().getEstimatedSize()), + this.useSmartIdealEdgeLengthCalculation && (e.idealLength += o + s - 2 * a.SIMPLE_NODE_SIZE), + (t = e.getLca().getInclusionTreeDepth()), + (e.idealLength += + i.DEFAULT_EDGE_LENGTH * + i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * + (n.getInclusionTreeDepth() + r.getInclusionTreeDepth() - 2 * t))); + }), + (l.prototype.initSpringEmbedder = function () { + var e = this.getAllNodes().length; + this.incremental + ? (e > i.ADAPTATION_LOWER_NODE_LIMIT && + (this.coolingFactor = Math.max( + this.coolingFactor * i.COOLING_ADAPTATION_FACTOR, + this.coolingFactor - + ((e - i.ADAPTATION_LOWER_NODE_LIMIT) / (i.ADAPTATION_UPPER_NODE_LIMIT - i.ADAPTATION_LOWER_NODE_LIMIT)) * + this.coolingFactor * + (1 - i.COOLING_ADAPTATION_FACTOR), + )), + (this.maxNodeDisplacement = i.MAX_NODE_DISPLACEMENT_INCREMENTAL)) + : (e > i.ADAPTATION_LOWER_NODE_LIMIT + ? (this.coolingFactor = Math.max( + i.COOLING_ADAPTATION_FACTOR, + 1 - + ((e - i.ADAPTATION_LOWER_NODE_LIMIT) / (i.ADAPTATION_UPPER_NODE_LIMIT - i.ADAPTATION_LOWER_NODE_LIMIT)) * + (1 - i.COOLING_ADAPTATION_FACTOR), + )) + : (this.coolingFactor = 1), + (this.initialCoolingFactor = this.coolingFactor), + (this.maxNodeDisplacement = i.MAX_NODE_DISPLACEMENT)), + (this.maxIterations = Math.max(5 * this.getAllNodes().length, this.maxIterations)), + (this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length), + (this.repulsionRange = this.calcRepulsionRange()); + }), + (l.prototype.calcSpringForces = function () { + for (var e, t = this.getAllEdges(), n = 0; n < t.length; n++) (e = t[n]), this.calcSpringForce(e, e.idealLength); + }), + (l.prototype.calcRepulsionForces = function () { + var e, + t, + n, + r, + a, + o = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0], + s = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], + l = this.getAllNodes(); + if (this.useFRGridVariant) + for (this.totalIterations % i.GRID_CALCULATION_CHECK_PERIOD == 1 && o && this.updateGrid(), a = new Set(), e = 0; e < l.length; e++) + (n = l[e]), this.calculateRepulsionForceOfANode(n, a, o, s), a.add(n); + else + for (e = 0; e < l.length; e++) + for (n = l[e], t = e + 1; t < l.length; t++) (r = l[t]), n.getOwner() == r.getOwner() && this.calcRepulsionForce(n, r); + }), + (l.prototype.calcGravitationalForces = function () { + for (var e, t = this.getAllNodesToApplyGravitation(), n = 0; n < t.length; n++) (e = t[n]), this.calcGravitationalForce(e); + }), + (l.prototype.moveNodes = function () { + for (var e = this.getAllNodes(), t = 0; t < e.length; t++) e[t].move(); + }), + (l.prototype.calcSpringForce = function (e, t) { + var n, + r, + i, + a, + o = e.getSource(), + s = e.getTarget(); + if (this.uniformLeafNodeSizes && null == o.getChild() && null == s.getChild()) e.updateLengthSimple(); + else if ((e.updateLength(), e.isOverlapingSourceAndTarget)) return; + 0 != (n = e.getLength()) && + ((i = (r = this.springConstant * (n - t)) * (e.lengthX / n)), + (a = r * (e.lengthY / n)), + (o.springForceX += i), + (o.springForceY += a), + (s.springForceX -= i), + (s.springForceY -= a)); + }), + (l.prototype.calcRepulsionForce = function (e, t) { + var n, + r, + a, + l, + u, + c, + h, + d = e.getRect(), + p = t.getRect(), + g = new Array(2), + f = new Array(4); + if (d.intersects(p)) { + o.calcSeparationAmount(d, p, g, i.DEFAULT_EDGE_LENGTH / 2), (c = 2 * g[0]), (h = 2 * g[1]); + var v = (e.noOfChildren * t.noOfChildren) / (e.noOfChildren + t.noOfChildren); + (e.repulsionForceX -= v * c), (e.repulsionForceY -= v * h), (t.repulsionForceX += v * c), (t.repulsionForceY += v * h); + } else + this.uniformLeafNodeSizes && null == e.getChild() && null == t.getChild() + ? ((n = p.getCenterX() - d.getCenterX()), (r = p.getCenterY() - d.getCenterY())) + : (o.getIntersection(d, p, f), (n = f[2] - f[0]), (r = f[3] - f[1])), + Math.abs(n) < i.MIN_REPULSION_DIST && (n = s.sign(n) * i.MIN_REPULSION_DIST), + Math.abs(r) < i.MIN_REPULSION_DIST && (r = s.sign(r) * i.MIN_REPULSION_DIST), + (a = n * n + r * r), + (l = Math.sqrt(a)), + (c = ((u = (this.repulsionConstant * e.noOfChildren * t.noOfChildren) / a) * n) / l), + (h = (u * r) / l), + (e.repulsionForceX -= c), + (e.repulsionForceY -= h), + (t.repulsionForceX += c), + (t.repulsionForceY += h); + }), + (l.prototype.calcGravitationalForce = function (e) { + var t, n, r, i, a, o, s, l; + (n = ((t = e.getOwner()).getRight() + t.getLeft()) / 2), + (r = (t.getTop() + t.getBottom()) / 2), + (i = e.getCenterX() - n), + (a = e.getCenterY() - r), + (o = Math.abs(i) + e.getWidth() / 2), + (s = Math.abs(a) + e.getHeight() / 2), + e.getOwner() == this.graphManager.getRoot() + ? (o > (l = t.getEstimatedSize() * this.gravityRangeFactor) || s > l) && + ((e.gravitationForceX = -this.gravityConstant * i), (e.gravitationForceY = -this.gravityConstant * a)) + : (o > (l = t.getEstimatedSize() * this.compoundGravityRangeFactor) || s > l) && + ((e.gravitationForceX = -this.gravityConstant * i * this.compoundGravityConstant), + (e.gravitationForceY = -this.gravityConstant * a * this.compoundGravityConstant)); + }), + (l.prototype.isConverged = function () { + var e, + t = !1; + return ( + this.totalIterations > this.maxIterations / 3 && (t = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), + (e = this.totalDisplacement < this.totalDisplacementThreshold), + (this.oldTotalDisplacement = this.totalDisplacement), + e || t + ); + }), + (l.prototype.animate = function () { + this.animationDuringLayout && + !this.isSubLayout && + (this.notAnimatedIterations == this.animationPeriod + ? (this.update(), (this.notAnimatedIterations = 0)) + : this.notAnimatedIterations++); + }), + (l.prototype.calcNoOfChildrenForAllNodes = function () { + for (var e, t = this.graphManager.getAllNodes(), n = 0; n < t.length; n++) (e = t[n]).noOfChildren = e.getNoOfChildren(); + }), + (l.prototype.calcGrid = function (e) { + var t, n; + (t = parseInt(Math.ceil((e.getRight() - e.getLeft()) / this.repulsionRange))), + (n = parseInt(Math.ceil((e.getBottom() - e.getTop()) / this.repulsionRange))); + for (var r = new Array(t), i = 0; i < t; i++) r[i] = new Array(n); + for (i = 0; i < t; i++) for (var a = 0; a < n; a++) r[i][a] = new Array(); + return r; + }), + (l.prototype.addNodeToGrid = function (e, t, n) { + var r, i, a, o; + (r = parseInt(Math.floor((e.getRect().x - t) / this.repulsionRange))), + (i = parseInt(Math.floor((e.getRect().width + e.getRect().x - t) / this.repulsionRange))), + (a = parseInt(Math.floor((e.getRect().y - n) / this.repulsionRange))), + (o = parseInt(Math.floor((e.getRect().height + e.getRect().y - n) / this.repulsionRange))); + for (var s = r; s <= i; s++) for (var l = a; l <= o; l++) this.grid[s][l].push(e), e.setGridCoordinates(r, i, a, o); + }), + (l.prototype.updateGrid = function () { + var e, + t, + n = this.getAllNodes(); + for (this.grid = this.calcGrid(this.graphManager.getRoot()), e = 0; e < n.length; e++) + (t = n[e]), this.addNodeToGrid(t, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop()); + }), + (l.prototype.calculateRepulsionForceOfANode = function (e, t, n, r) { + if ((this.totalIterations % i.GRID_CALCULATION_CHECK_PERIOD == 1 && n) || r) { + var a, + o = new Set(); + e.surrounding = new Array(); + for (var s = this.grid, l = e.startX - 1; l < e.finishX + 2; l++) + for (var u = e.startY - 1; u < e.finishY + 2; u++) + if (!(l < 0 || u < 0 || l >= s.length || u >= s[0].length)) + for (var c = 0; c < s[l][u].length; c++) + if (((a = s[l][u][c]), e.getOwner() == a.getOwner() && e != a && !t.has(a) && !o.has(a))) { + var h = Math.abs(e.getCenterX() - a.getCenterX()) - (e.getWidth() / 2 + a.getWidth() / 2), + d = Math.abs(e.getCenterY() - a.getCenterY()) - (e.getHeight() / 2 + a.getHeight() / 2); + h <= this.repulsionRange && d <= this.repulsionRange && o.add(a); + } + e.surrounding = [].concat( + (function (e) { + if (Array.isArray(e)) { + for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t]; + return n; + } + return Array.from(e); + })(o), + ); + } + for (l = 0; l < e.surrounding.length; l++) this.calcRepulsionForce(e, e.surrounding[l]); + }), + (l.prototype.calcRepulsionRange = function () { + return 0; + }), + (e.exports = l); + }, + function (e, t, n) { + "use strict"; + var r = n(1), + i = n(7); + function a(e, t, n) { + r.call(this, e, t, n), (this.idealLength = i.DEFAULT_EDGE_LENGTH); + } + for (var o in ((a.prototype = Object.create(r.prototype)), r)) a[o] = r[o]; + e.exports = a; + }, + function (e, t, n) { + "use strict"; + var r = n(3); + function i(e, t, n, i) { + r.call(this, e, t, n, i), + (this.springForceX = 0), + (this.springForceY = 0), + (this.repulsionForceX = 0), + (this.repulsionForceY = 0), + (this.gravitationForceX = 0), + (this.gravitationForceY = 0), + (this.displacementX = 0), + (this.displacementY = 0), + (this.startX = 0), + (this.finishX = 0), + (this.startY = 0), + (this.finishY = 0), + (this.surrounding = []); + } + for (var a in ((i.prototype = Object.create(r.prototype)), r)) i[a] = r[a]; + (i.prototype.setGridCoordinates = function (e, t, n, r) { + (this.startX = e), (this.finishX = t), (this.startY = n), (this.finishY = r); + }), + (e.exports = i); + }, + function (e, t, n) { + "use strict"; + function r(e, t) { + (this.width = 0), (this.height = 0), null !== e && null !== t && ((this.height = t), (this.width = e)); + } + (r.prototype.getWidth = function () { + return this.width; + }), + (r.prototype.setWidth = function (e) { + this.width = e; + }), + (r.prototype.getHeight = function () { + return this.height; + }), + (r.prototype.setHeight = function (e) { + this.height = e; + }), + (e.exports = r); + }, + function (e, t, n) { + "use strict"; + var r = n(14); + function i() { + (this.map = {}), (this.keys = []); + } + (i.prototype.put = function (e, t) { + var n = r.createID(e); + this.contains(n) || ((this.map[n] = t), this.keys.push(e)); + }), + (i.prototype.contains = function (e) { + return r.createID(e), null != this.map[e]; + }), + (i.prototype.get = function (e) { + var t = r.createID(e); + return this.map[t]; + }), + (i.prototype.keySet = function () { + return this.keys; + }), + (e.exports = i); + }, + function (e, t, n) { + "use strict"; + var r = n(14); + function i() { + this.set = {}; + } + (i.prototype.add = function (e) { + var t = r.createID(e); + this.contains(t) || (this.set[t] = e); + }), + (i.prototype.remove = function (e) { + delete this.set[r.createID(e)]; + }), + (i.prototype.clear = function () { + this.set = {}; + }), + (i.prototype.contains = function (e) { + return this.set[r.createID(e)] == e; + }), + (i.prototype.isEmpty = function () { + return 0 === this.size(); + }), + (i.prototype.size = function () { + return Object.keys(this.set).length; + }), + (i.prototype.addAllTo = function (e) { + for (var t = Object.keys(this.set), n = t.length, r = 0; r < n; r++) e.push(this.set[t[r]]); + }), + (i.prototype.size = function () { + return Object.keys(this.set).length; + }), + (i.prototype.addAll = function (e) { + for (var t = e.length, n = 0; n < t; n++) { + var r = e[n]; + this.add(r); + } + }), + (e.exports = i); + }, + function (e, t, n) { + "use strict"; + var r = (function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n]; + (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + } + return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + })(), + i = n(11), + a = (function () { + function e(t, n) { + !(function (e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + })(this, e), + (null === n && void 0 === n) || (this.compareFunction = this._defaultCompareFunction); + var r; + (r = t instanceof i ? t.size() : t.length), this._quicksort(t, 0, r - 1); + } + return ( + r(e, [ + { + key: "_quicksort", + value: function (e, t, n) { + if (t < n) { + var r = this._partition(e, t, n); + this._quicksort(e, t, r), this._quicksort(e, r + 1, n); + } + }, + }, + { + key: "_partition", + value: function (e, t, n) { + for (var r = this._get(e, t), i = t, a = n; ; ) { + for (; this.compareFunction(r, this._get(e, a)); ) a--; + for (; this.compareFunction(this._get(e, i), r); ) i++; + if (!(i < a)) return a; + this._swap(e, i, a), i++, a--; + } + }, + }, + { + key: "_get", + value: function (e, t) { + return e instanceof i ? e.get_object_at(t) : e[t]; + }, + }, + { + key: "_set", + value: function (e, t, n) { + e instanceof i ? e.set_object_at(t, n) : (e[t] = n); + }, + }, + { + key: "_swap", + value: function (e, t, n) { + var r = this._get(e, t); + this._set(e, t, this._get(e, n)), this._set(e, n, r); + }, + }, + { + key: "_defaultCompareFunction", + value: function (e, t) { + return t > e; + }, + }, + ]), + e + ); + })(); + e.exports = a; + }, + function (e, t, n) { + "use strict"; + var r = (function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n]; + (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r); + } + } + return function (t, n, r) { + return n && e(t.prototype, n), r && e(t, r), t; + }; + })(), + i = (function () { + function e(t, n) { + var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1, + i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : -1, + a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : -1; + !(function (e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); + })(this, e), + (this.sequence1 = t), + (this.sequence2 = n), + (this.match_score = r), + (this.mismatch_penalty = i), + (this.gap_penalty = a), + (this.iMax = t.length + 1), + (this.jMax = n.length + 1), + (this.grid = new Array(this.iMax)); + for (var o = 0; o < this.iMax; o++) { + this.grid[o] = new Array(this.jMax); + for (var s = 0; s < this.jMax; s++) this.grid[o][s] = 0; + } + this.tracebackGrid = new Array(this.iMax); + for (var l = 0; l < this.iMax; l++) { + this.tracebackGrid[l] = new Array(this.jMax); + for (var u = 0; u < this.jMax; u++) this.tracebackGrid[l][u] = [null, null, null]; + } + (this.alignments = []), (this.score = -1), this.computeGrids(); + } + return ( + r(e, [ + { + key: "getScore", + value: function () { + return this.score; + }, + }, + { + key: "getAlignments", + value: function () { + return this.alignments; + }, + }, + { + key: "computeGrids", + value: function () { + for (var e = 1; e < this.jMax; e++) + (this.grid[0][e] = this.grid[0][e - 1] + this.gap_penalty), (this.tracebackGrid[0][e] = [!1, !1, !0]); + for (var t = 1; t < this.iMax; t++) + (this.grid[t][0] = this.grid[t - 1][0] + this.gap_penalty), (this.tracebackGrid[t][0] = [!1, !0, !1]); + for (var n = 1; n < this.iMax; n++) + for (var r = 1; r < this.jMax; r++) { + var i = [ + this.sequence1[n - 1] === this.sequence2[r - 1] + ? this.grid[n - 1][r - 1] + this.match_score + : this.grid[n - 1][r - 1] + this.mismatch_penalty, + this.grid[n - 1][r] + this.gap_penalty, + this.grid[n][r - 1] + this.gap_penalty, + ], + a = this.arrayAllMaxIndexes(i); + (this.grid[n][r] = i[a[0]]), (this.tracebackGrid[n][r] = [a.includes(0), a.includes(1), a.includes(2)]); + } + this.score = this.grid[this.iMax - 1][this.jMax - 1]; + }, + }, + { + key: "alignmentTraceback", + value: function () { + var e = []; + for ( + e.push({ + pos: [this.sequence1.length, this.sequence2.length], + seq1: "", + seq2: "", + }); + e[0]; + + ) { + var t = e[0], + n = this.tracebackGrid[t.pos[0]][t.pos[1]]; + n[0] && + e.push({ + pos: [t.pos[0] - 1, t.pos[1] - 1], + seq1: this.sequence1[t.pos[0] - 1] + t.seq1, + seq2: this.sequence2[t.pos[1] - 1] + t.seq2, + }), + n[1] && + e.push({ + pos: [t.pos[0] - 1, t.pos[1]], + seq1: this.sequence1[t.pos[0] - 1] + t.seq1, + seq2: "-" + t.seq2, + }), + n[2] && + e.push({ + pos: [t.pos[0], t.pos[1] - 1], + seq1: "-" + t.seq1, + seq2: this.sequence2[t.pos[1] - 1] + t.seq2, + }), + 0 === t.pos[0] && 0 === t.pos[1] && this.alignments.push({ sequence1: t.seq1, sequence2: t.seq2 }), + e.shift(); + } + return this.alignments; + }, + }, + { + key: "getAllIndexes", + value: function (e, t) { + for (var n = [], r = -1; -1 !== (r = e.indexOf(t, r + 1)); ) n.push(r); + return n; + }, + }, + { + key: "arrayAllMaxIndexes", + value: function (e) { + return this.getAllIndexes(e, Math.max.apply(null, e)); + }, + }, + ]), + e + ); + })(); + e.exports = i; + }, + function (e, t, n) { + "use strict"; + var r = function () {}; + (r.FDLayout = n(18)), + (r.FDLayoutConstants = n(7)), + (r.FDLayoutEdge = n(19)), + (r.FDLayoutNode = n(20)), + (r.DimensionD = n(21)), + (r.HashMap = n(22)), + (r.HashSet = n(23)), + (r.IGeometry = n(8)), + (r.IMath = n(9)), + (r.Integer = n(10)), + (r.Point = n(12)), + (r.PointD = n(4)), + (r.RandomSeed = n(16)), + (r.RectangleD = n(13)), + (r.Transform = n(17)), + (r.UniqueIDGeneretor = n(14)), + (r.Quicksort = n(24)), + (r.LinkedList = n(11)), + (r.LGraphObject = n(2)), + (r.LGraph = n(5)), + (r.LEdge = n(1)), + (r.LGraphManager = n(6)), + (r.LNode = n(3)), + (r.Layout = n(15)), + (r.LayoutConstants = n(0)), + (r.NeedlemanWunsch = n(25)), + (e.exports = r); + }, + function (e, t, n) { + "use strict"; + function r() { + this.listeners = []; + } + var i = r.prototype; + (i.addListener = function (e, t) { + this.listeners.push({ event: e, callback: t }); + }), + (i.removeListener = function (e, t) { + for (var n = this.listeners.length; n >= 0; n--) { + var r = this.listeners[n]; + r.event === e && r.callback === t && this.listeners.splice(n, 1); + } + }), + (i.emit = function (e, t) { + for (var n = 0; n < this.listeners.length; n++) { + var r = this.listeners[n]; + e === r.event && r.callback(t); + } + }), + (e.exports = r); + }, + ]); + }), + (e.exports = t()); + }, + 4662: function (e, t, n) { + "use strict"; + n.d(t, { + diagram: function () { + return C; + }, + }); + var r = n(9339), + i = n(7274), + a = n(3506), + o = n(1377), + s = n(4607), + l = n(6500), + u = n(2281), + c = n(7201), + h = + (n(7484), + n(7967), + n(7856), + (function () { + var e = function (e, t, n, r) { + for (n = n || {}, r = e.length; r--; n[e[r]] = t); + return n; + }, + t = [1, 4], + n = [1, 13], + r = [1, 12], + i = [1, 15], + a = [1, 16], + o = [1, 20], + s = [1, 19], + l = [6, 7, 8], + u = [1, 26], + c = [1, 24], + h = [1, 25], + d = [6, 7, 11], + p = [1, 6, 13, 15, 16, 19, 22], + g = [1, 33], + f = [1, 34], + v = [1, 6, 7, 11, 13, 15, 16, 19, 22], + y = { + trace: function () {}, + yy: {}, + symbols_: { + error: 2, + start: 3, + mindMap: 4, + spaceLines: 5, + SPACELINE: 6, + NL: 7, + MINDMAP: 8, + document: 9, + stop: 10, + EOF: 11, + statement: 12, + SPACELIST: 13, + node: 14, + ICON: 15, + CLASS: 16, + nodeWithId: 17, + nodeWithoutId: 18, + NODE_DSTART: 19, + NODE_DESCR: 20, + NODE_DEND: 21, + NODE_ID: 22, + $accept: 0, + $end: 1, + }, + terminals_: { + 2: "error", + 6: "SPACELINE", + 7: "NL", + 8: "MINDMAP", + 11: "EOF", + 13: "SPACELIST", + 15: "ICON", + 16: "CLASS", + 19: "NODE_DSTART", + 20: "NODE_DESCR", + 21: "NODE_DEND", + 22: "NODE_ID", + }, + productions_: [ + 0, + [3, 1], + [3, 2], + [5, 1], + [5, 2], + [5, 2], + [4, 2], + [4, 3], + [10, 1], + [10, 1], + [10, 1], + [10, 2], + [10, 2], + [9, 3], + [9, 2], + [12, 2], + [12, 2], + [12, 2], + [12, 1], + [12, 1], + [12, 1], + [12, 1], + [12, 1], + [14, 1], + [14, 1], + [18, 3], + [17, 1], + [17, 4], + ], + performAction: function (e, t, n, r, i, a, o) { + var s = a.length - 1; + switch (i) { + case 6: + case 7: + return r; + case 8: + r.getLogger().trace("Stop NL "); + break; + case 9: + r.getLogger().trace("Stop EOF "); + break; + case 11: + r.getLogger().trace("Stop NL2 "); + break; + case 12: + r.getLogger().trace("Stop EOF2 "); + break; + case 15: + r.getLogger().info("Node: ", a[s].id), r.addNode(a[s - 1].length, a[s].id, a[s].descr, a[s].type); + break; + case 16: + r.getLogger().trace("Icon: ", a[s]), r.decorateNode({ icon: a[s] }); + break; + case 17: + case 21: + r.decorateNode({ class: a[s] }); + break; + case 18: + r.getLogger().trace("SPACELIST"); + break; + case 19: + r.getLogger().trace("Node: ", a[s].id), r.addNode(0, a[s].id, a[s].descr, a[s].type); + break; + case 20: + r.decorateNode({ icon: a[s] }); + break; + case 25: + r.getLogger().trace("node found ..", a[s - 2]), + (this.$ = { + id: a[s - 1], + descr: a[s - 1], + type: r.getType(a[s - 2], a[s]), + }); + break; + case 26: + this.$ = { id: a[s], descr: a[s], type: r.nodeType.DEFAULT }; + break; + case 27: + r.getLogger().trace("node found ..", a[s - 3]), + (this.$ = { + id: a[s - 3], + descr: a[s - 1], + type: r.getType(a[s - 2], a[s]), + }); + } + }, + table: [ + { 3: 1, 4: 2, 5: 3, 6: [1, 5], 8: t }, + { 1: [3] }, + { 1: [2, 1] }, + { 4: 6, 6: [1, 7], 7: [1, 8], 8: t }, + { + 6: n, + 7: [1, 10], + 9: 9, + 12: 11, + 13: r, + 14: 14, + 15: i, + 16: a, + 17: 17, + 18: 18, + 19: o, + 22: s, + }, + e(l, [2, 3]), + { 1: [2, 2] }, + e(l, [2, 4]), + e(l, [2, 5]), + { + 1: [2, 6], + 6: n, + 12: 21, + 13: r, + 14: 14, + 15: i, + 16: a, + 17: 17, + 18: 18, + 19: o, + 22: s, + }, + { + 6: n, + 9: 22, + 12: 11, + 13: r, + 14: 14, + 15: i, + 16: a, + 17: 17, + 18: 18, + 19: o, + 22: s, + }, + { 6: u, 7: c, 10: 23, 11: h }, + e(d, [2, 22], { 17: 17, 18: 18, 14: 27, 15: [1, 28], 16: [1, 29], 19: o, 22: s }), + e(d, [2, 18]), + e(d, [2, 19]), + e(d, [2, 20]), + e(d, [2, 21]), + e(d, [2, 23]), + e(d, [2, 24]), + e(d, [2, 26], { 19: [1, 30] }), + { 20: [1, 31] }, + { 6: u, 7: c, 10: 32, 11: h }, + { + 1: [2, 7], + 6: n, + 12: 21, + 13: r, + 14: 14, + 15: i, + 16: a, + 17: 17, + 18: 18, + 19: o, + 22: s, + }, + e(p, [2, 14], { 7: g, 11: f }), + e(v, [2, 8]), + e(v, [2, 9]), + e(v, [2, 10]), + e(d, [2, 15]), + e(d, [2, 16]), + e(d, [2, 17]), + { 20: [1, 35] }, + { 21: [1, 36] }, + e(p, [2, 13], { 7: g, 11: f }), + e(v, [2, 11]), + e(v, [2, 12]), + { 21: [1, 37] }, + e(d, [2, 25]), + e(d, [2, 27]), + ], + defaultActions: { 2: [2, 1], 6: [2, 2] }, + parseError: function (e, t) { + if (!t.recoverable) { + var n = new Error(e); + throw ((n.hash = t), n); + } + this.trace(e); + }, + parse: function (e) { + var t = [0], + n = [], + r = [null], + i = [], + a = this.table, + o = "", + s = 0, + l = 0, + u = i.slice.call(arguments, 1), + c = Object.create(this.lexer), + h = { yy: {} }; + for (var d in this.yy) Object.prototype.hasOwnProperty.call(this.yy, d) && (h.yy[d] = this.yy[d]); + c.setInput(e, h.yy), (h.yy.lexer = c), (h.yy.parser = this), void 0 === c.yylloc && (c.yylloc = {}); + var p = c.yylloc; + i.push(p); + var g = c.options && c.options.ranges; + "function" == typeof h.yy.parseError + ? (this.parseError = h.yy.parseError) + : (this.parseError = Object.getPrototypeOf(this).parseError); + for (var f, v, y, m, b, x, w, E, _, T = {}; ; ) { + if ( + ((v = t[t.length - 1]), + this.defaultActions[v] + ? (y = this.defaultActions[v]) + : (null == f && + ((_ = void 0), + "number" != typeof (_ = n.pop() || c.lex() || 1) && + (_ instanceof Array && (_ = (n = _).pop()), (_ = this.symbols_[_] || _)), + (f = _)), + (y = a[v] && a[v][f])), + void 0 === y || !y.length || !y[0]) + ) { + var D; + for (b in ((E = []), a[v])) this.terminals_[b] && b > 2 && E.push("'" + this.terminals_[b] + "'"); + (D = c.showPosition + ? "Parse error on line " + + (s + 1) + + ":\n" + + c.showPosition() + + "\nExpecting " + + E.join(", ") + + ", got '" + + (this.terminals_[f] || f) + + "'" + : "Parse error on line " + (s + 1) + ": Unexpected " + (1 == f ? "end of input" : "'" + (this.terminals_[f] || f) + "'")), + this.parseError(D, { + text: c.match, + token: this.terminals_[f] || f, + line: c.yylineno, + loc: p, + expected: E, + }); + } + if (y[0] instanceof Array && y.length > 1) + throw new Error("Parse Error: multiple actions possible at state: " + v + ", token: " + f); + switch (y[0]) { + case 1: + t.push(f), + r.push(c.yytext), + i.push(c.yylloc), + t.push(y[1]), + (f = null), + (l = c.yyleng), + (o = c.yytext), + (s = c.yylineno), + (p = c.yylloc); + break; + case 2: + if ( + ((x = this.productions_[y[1]][1]), + (T.$ = r[r.length - x]), + (T._$ = { + first_line: i[i.length - (x || 1)].first_line, + last_line: i[i.length - 1].last_line, + first_column: i[i.length - (x || 1)].first_column, + last_column: i[i.length - 1].last_column, + }), + g && (T._$.range = [i[i.length - (x || 1)].range[0], i[i.length - 1].range[1]]), + void 0 !== (m = this.performAction.apply(T, [o, l, s, h.yy, y[1], r, i].concat(u)))) + ) + return m; + x && ((t = t.slice(0, -1 * x * 2)), (r = r.slice(0, -1 * x)), (i = i.slice(0, -1 * x))), + t.push(this.productions_[y[1]][0]), + r.push(T.$), + i.push(T._$), + (w = a[t[t.length - 2]][t[t.length - 1]]), + t.push(w); + break; + case 3: + return !0; + } + } + return !0; + }, + }, + m = { + EOF: 1, + parseError: function (e, t) { + if (!this.yy.parser) throw new Error(e); + this.yy.parser.parseError(e, t); + }, + setInput: function (e, t) { + return ( + (this.yy = t || this.yy || {}), + (this._input = e), + (this._more = this._backtrack = this.done = !1), + (this.yylineno = this.yyleng = 0), + (this.yytext = this.matched = this.match = ""), + (this.conditionStack = ["INITIAL"]), + (this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0, + }), + this.options.ranges && (this.yylloc.range = [0, 0]), + (this.offset = 0), + this + ); + }, + input: function () { + var e = this._input[0]; + return ( + (this.yytext += e), + this.yyleng++, + this.offset++, + (this.match += e), + (this.matched += e), + e.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, + this.options.ranges && this.yylloc.range[1]++, + (this._input = this._input.slice(1)), + e + ); + }, + unput: function (e) { + var t = e.length, + n = e.split(/(?:\r\n?|\n)/g); + (this._input = e + this._input), (this.yytext = this.yytext.substr(0, this.yytext.length - t)), (this.offset -= t); + var r = this.match.split(/(?:\r\n?|\n)/g); + (this.match = this.match.substr(0, this.match.length - 1)), + (this.matched = this.matched.substr(0, this.matched.length - 1)), + n.length - 1 && (this.yylineno -= n.length - 1); + var i = this.yylloc.range; + return ( + (this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: n + ? (n.length === r.length ? this.yylloc.first_column : 0) + r[r.length - n.length].length - n[0].length + : this.yylloc.first_column - t, + }), + this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - t]), + (this.yyleng = this.yytext.length), + this + ); + }, + more: function () { + return (this._more = !0), this; + }, + reject: function () { + return this.options.backtrack_lexer + ? ((this._backtrack = !0), this) + : this.parseError( + "Lexical error on line " + + (this.yylineno + 1) + + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + + this.showPosition(), + { text: "", token: null, line: this.yylineno }, + ); + }, + less: function (e) { + this.unput(this.match.slice(e)); + }, + pastInput: function () { + var e = this.matched.substr(0, this.matched.length - this.match.length); + return (e.length > 20 ? "..." : "") + e.substr(-20).replace(/\n/g, ""); + }, + upcomingInput: function () { + var e = this.match; + return ( + e.length < 20 && (e += this._input.substr(0, 20 - e.length)), (e.substr(0, 20) + (e.length > 20 ? "..." : "")).replace(/\n/g, "") + ); + }, + showPosition: function () { + var e = this.pastInput(), + t = new Array(e.length + 1).join("-"); + return e + this.upcomingInput() + "\n" + t + "^"; + }, + test_match: function (e, t) { + var n, r, i; + if ( + (this.options.backtrack_lexer && + ((i = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column, + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done, + }), + this.options.ranges && (i.yylloc.range = this.yylloc.range.slice(0))), + (r = e[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += r.length), + (this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length, + }), + (this.yytext += e[0]), + (this.match += e[0]), + (this.matches = e), + (this.yyleng = this.yytext.length), + this.options.ranges && (this.yylloc.range = [this.offset, (this.offset += this.yyleng)]), + (this._more = !1), + (this._backtrack = !1), + (this._input = this._input.slice(e[0].length)), + (this.matched += e[0]), + (n = this.performAction.call(this, this.yy, this, t, this.conditionStack[this.conditionStack.length - 1])), + this.done && this._input && (this.done = !1), + n) + ) + return n; + if (this._backtrack) { + for (var a in i) this[a] = i[a]; + return !1; + } + return !1; + }, + next: function () { + if (this.done) return this.EOF; + var e, t, n, r; + this._input || (this.done = !0), this._more || ((this.yytext = ""), (this.match = "")); + for (var i = this._currentRules(), a = 0; a < i.length; a++) + if ((n = this._input.match(this.rules[i[a]])) && (!t || n[0].length > t[0].length)) { + if (((t = n), (r = a), this.options.backtrack_lexer)) { + if (!1 !== (e = this.test_match(n, i[a]))) return e; + if (this._backtrack) { + t = !1; + continue; + } + return !1; + } + if (!this.options.flex) break; + } + return t + ? !1 !== (e = this.test_match(t, i[r])) && e + : "" === this._input + ? this.EOF + : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno, + }); + }, + lex: function () { + return this.next() || this.lex(); + }, + begin: function (e) { + this.conditionStack.push(e); + }, + popState: function () { + return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]; + }, + _currentRules: function () { + return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] + ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules + : this.conditions.INITIAL.rules; + }, + topState: function (e) { + return (e = this.conditionStack.length - 1 - Math.abs(e || 0)) >= 0 ? this.conditionStack[e] : "INITIAL"; + }, + pushState: function (e) { + this.begin(e); + }, + stateStackSize: function () { + return this.conditionStack.length; + }, + options: { "case-insensitive": !0 }, + performAction: function (e, t, n, r) { + switch (n) { + case 0: + return e.getLogger().trace("Found comment", t.yytext), 6; + case 1: + return 8; + case 2: + this.begin("CLASS"); + break; + case 3: + return this.popState(), 16; + case 4: + case 23: + case 26: + this.popState(); + break; + case 5: + e.getLogger().trace("Begin icon"), this.begin("ICON"); + break; + case 6: + return e.getLogger().trace("SPACELINE"), 6; + case 7: + return 7; + case 8: + return 15; + case 9: + e.getLogger().trace("end icon"), this.popState(); + break; + case 10: + return e.getLogger().trace("Exploding node"), this.begin("NODE"), 19; + case 11: + return e.getLogger().trace("Cloud"), this.begin("NODE"), 19; + case 12: + return e.getLogger().trace("Explosion Bang"), this.begin("NODE"), 19; + case 13: + return e.getLogger().trace("Cloud Bang"), this.begin("NODE"), 19; + case 14: + case 15: + case 16: + case 17: + return this.begin("NODE"), 19; + case 18: + return 13; + case 19: + return 22; + case 20: + return 11; + case 21: + this.begin("NSTR2"); + break; + case 22: + return "NODE_DESCR"; + case 24: + e.getLogger().trace("Starting NSTR"), this.begin("NSTR"); + break; + case 25: + return e.getLogger().trace("description:", t.yytext), "NODE_DESCR"; + case 27: + return this.popState(), e.getLogger().trace("node end ))"), "NODE_DEND"; + case 28: + return this.popState(), e.getLogger().trace("node end )"), "NODE_DEND"; + case 29: + return this.popState(), e.getLogger().trace("node end ...", t.yytext), "NODE_DEND"; + case 30: + case 33: + case 34: + return this.popState(), e.getLogger().trace("node end (("), "NODE_DEND"; + case 31: + case 32: + return this.popState(), e.getLogger().trace("node end (-"), "NODE_DEND"; + case 35: + case 36: + return e.getLogger().trace("Long description:", t.yytext), 20; + } + }, + rules: [ + /^(?:\s*%%.*)/i, + /^(?:mindmap\b)/i, + /^(?::::)/i, + /^(?:.+)/i, + /^(?:\n)/i, + /^(?:::icon\()/i, + /^(?:[\s]+[\n])/i, + /^(?:[\n]+)/i, + /^(?:[^\)]+)/i, + /^(?:\))/i, + /^(?:-\))/i, + /^(?:\(-)/i, + /^(?:\)\))/i, + /^(?:\))/i, + /^(?:\(\()/i, + /^(?:\{\{)/i, + /^(?:\()/i, + /^(?:\[)/i, + /^(?:[\s]+)/i, + /^(?:[^\(\[\n\)\{\}]+)/i, + /^(?:$)/i, + /^(?:["][`])/i, + /^(?:[^`"]+)/i, + /^(?:[`]["])/i, + /^(?:["])/i, + /^(?:[^"]+)/i, + /^(?:["])/i, + /^(?:[\)]\))/i, + /^(?:[\)])/i, + /^(?:[\]])/i, + /^(?:\}\})/i, + /^(?:\(-)/i, + /^(?:-\))/i, + /^(?:\(\()/i, + /^(?:\()/i, + /^(?:[^\)\]\(\}]+)/i, + /^(?:.+(?!\(\())/i, + ], + conditions: { + CLASS: { rules: [3, 4], inclusive: !1 }, + ICON: { rules: [8, 9], inclusive: !1 }, + NSTR2: { rules: [22, 23], inclusive: !1 }, + NSTR: { rules: [25, 26], inclusive: !1 }, + NODE: { rules: [21, 24, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36], inclusive: !1 }, + INITIAL: { + rules: [0, 1, 2, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], + inclusive: !0, + }, + }, + }; + function b() { + this.yy = {}; + } + return (y.lexer = m), (b.prototype = y), (y.Parser = b), new b(); + })()); + h.parser = h; + const d = h, + p = (e) => (0, r.d)(e, (0, r.c)()); + let g = [], + f = 0, + v = {}; + const y = { + DEFAULT: 0, + NO_BORDER: 0, + ROUNDED_RECT: 1, + RECT: 2, + CIRCLE: 3, + CLOUD: 4, + BANG: 5, + HEXAGON: 6, + }, + m = (e, t) => { + v[e] = t; + }, + b = (e) => { + switch (e) { + case y.DEFAULT: + return "no-border"; + case y.RECT: + return "rect"; + case y.ROUNDED_RECT: + return "rounded-rect"; + case y.CIRCLE: + return "circle"; + case y.CLOUD: + return "cloud"; + case y.BANG: + return "bang"; + case y.HEXAGON: + return "hexgon"; + default: + return "no-border"; + } + }; + let x; + const w = (e) => v[e], + E = Object.freeze( + Object.defineProperty( + { + __proto__: null, + addNode: (e, t, n, i) => { + r.l.info("addNode", e, t, n, i); + const a = (0, r.c)(), + o = { + id: f++, + nodeId: p(t), + level: e, + descr: p(n), + type: i, + children: [], + width: (0, r.c)().mindmap.maxNodeWidth, + }; + switch (o.type) { + case y.ROUNDED_RECT: + case y.RECT: + case y.HEXAGON: + o.padding = 2 * a.mindmap.padding; + break; + default: + o.padding = a.mindmap.padding; + } + const s = (function (e) { + for (let t = g.length - 1; t >= 0; t--) if (g[t].level < e) return g[t]; + return null; + })(e); + if (s) s.children.push(o), g.push(o); + else { + if (0 !== g.length) { + let e = new Error('There can be only one root. No parent could be found for ("' + o.descr + '")'); + throw ( + ((e.hash = { + text: "branch " + name, + token: "branch " + name, + line: "1", + loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, + expected: ['"checkout ' + name + '"'], + }), + e) + ); + } + g.push(o); + } + }, + clear: () => { + (g = []), (f = 0), (v = {}); + }, + decorateNode: (e) => { + const t = g[g.length - 1]; + e && e.icon && (t.icon = p(e.icon)), e && e.class && (t.class = p(e.class)); + }, + getElementById: w, + getLogger: () => r.l, + getMindmap: () => (g.length > 0 ? g[0] : null), + getNodeById: (e) => g[e], + getType: (e, t) => { + switch ((r.l.debug("In get type", e, t), e)) { + case "[": + return y.RECT; + case "(": + return ")" === t ? y.ROUNDED_RECT : y.CLOUD; + case "((": + return y.CIRCLE; + case ")": + return y.CLOUD; + case "))": + return y.BANG; + case "{{": + return y.HEXAGON; + default: + return y.DEFAULT; + } + }, + nodeType: y, + get parseError() { + return x; + }, + sanitizeText: p, + setElementForId: m, + setErrorHandler: (e) => { + x = e; + }, + type2Str: b, + }, + Symbol.toStringTag, + { value: "Module" }, + ), + ); + function _(e, t, n, r) { + (function (e, t, n, r) { + const i = r.htmlLabels, + o = n % 11, + s = e.append("g"); + t.section = o; + let l = "section-" + o; + o < 0 && (l += " section-root"), s.attr("class", (t.class ? t.class + " " : "") + "mindmap-node " + l); + const u = s.append("g"), + c = s.append("g"), + h = t.descr.replace(/()/g, "\n"); + (0, a.c)(c, h, { useHtmlLabels: i, width: t.width, classes: "mindmap-node-label" }), + i || c.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"); + const d = c.node().getBBox(), + p = r.fontSize.replace ? r.fontSize.replace("px", "") : r.fontSize; + if (((t.height = d.height + 1.1 * p * 0.5 + t.padding), (t.width = d.width + 2 * t.padding), t.icon)) + if (t.type === y.CIRCLE) + (t.height += 50), + (t.width += 50), + s + .append("foreignObject") + .attr("height", "50px") + .attr("width", t.width) + .attr("style", "text-align: center;") + .append("div") + .attr("class", "icon-container") + .append("i") + .attr("class", "node-icon-" + o + " " + t.icon), + c.attr("transform", "translate(" + t.width / 2 + ", " + (t.height / 2 - 1.5 * t.padding) + ")"); + else { + t.width += 50; + const e = t.height; + t.height = Math.max(e, 60); + const n = Math.abs(t.height - e); + s + .append("foreignObject") + .attr("width", "60px") + .attr("height", t.height) + .attr("style", "text-align: center;margin-top:" + n / 2 + "px;") + .append("div") + .attr("class", "icon-container") + .append("i") + .attr("class", "node-icon-" + o + " " + t.icon), + c.attr("transform", "translate(" + (25 + t.width / 2) + ", " + (n / 2 + t.padding / 2) + ")"); + } + else if (i) { + const e = (t.width - d.width) / 2, + n = (t.height - d.height) / 2; + c.attr("transform", "translate(" + e + ", " + n + ")"); + } else { + const e = t.width / 2, + n = t.padding / 2; + c.attr("transform", "translate(" + e + ", " + n + ")"); + } + switch (t.type) { + case y.DEFAULT: + !(function (e, t, n) { + e + .append("path") + .attr("id", "node-" + t.id) + .attr("class", "node-bkg node-" + b(t.type)) + .attr("d", `M0 ${t.height - 5} v${10 - t.height} q0,-5 5,-5 h${t.width - 10} q5,0 5,5 v${t.height - 5} H0 Z`), + e + .append("line") + .attr("class", "node-line-" + n) + .attr("x1", 0) + .attr("y1", t.height) + .attr("x2", t.width) + .attr("y2", t.height); + })(u, t, o); + break; + case y.ROUNDED_RECT: + !(function (e, t) { + e.append("rect") + .attr("id", "node-" + t.id) + .attr("class", "node-bkg node-" + b(t.type)) + .attr("height", t.height) + .attr("rx", t.padding) + .attr("ry", t.padding) + .attr("width", t.width); + })(u, t); + break; + case y.RECT: + !(function (e, t) { + e.append("rect") + .attr("id", "node-" + t.id) + .attr("class", "node-bkg node-" + b(t.type)) + .attr("height", t.height) + .attr("width", t.width); + })(u, t); + break; + case y.CIRCLE: + u.attr("transform", "translate(" + t.width / 2 + ", " + +t.height / 2 + ")"), + (function (e, t) { + e.append("circle") + .attr("id", "node-" + t.id) + .attr("class", "node-bkg node-" + b(t.type)) + .attr("r", t.width / 2); + })(u, t); + break; + case y.CLOUD: + !(function (e, t) { + const n = t.width, + r = t.height, + i = 0.15 * n, + a = 0.25 * n, + o = 0.35 * n, + s = 0.2 * n; + e.append("path") + .attr("id", "node-" + t.id) + .attr("class", "node-bkg node-" + b(t.type)) + .attr( + "d", + `M0 0 a${i},${i} 0 0,1 ${0.25 * n},${-1 * n * 0.1}\n a${o},${o} 1 0,1 ${0.4 * n},${-1 * n * 0.1}\n a${a},${a} 1 0,1 ${0.35 * n},${1 * n * 0.2}\n\n a${i},${i} 1 0,1 ${0.15 * n},${1 * r * 0.35}\n a${s},${s} 1 0,1 ${-1 * n * 0.15},${1 * r * 0.65}\n\n a${a},${i} 1 0,1 ${-1 * n * 0.25},${0.15 * n}\n a${o},${o} 1 0,1 ${-1 * n * 0.5},0\n a${i},${i} 1 0,1 ${-1 * n * 0.25},${-1 * n * 0.15}\n\n a${i},${i} 1 0,1 ${-1 * n * 0.1},${-1 * r * 0.35}\n a${s},${s} 1 0,1 ${0.1 * n},${-1 * r * 0.65}\n\n H0 V0 Z`, + ); + })(u, t); + break; + case y.BANG: + !(function (e, t) { + const n = t.width, + r = t.height, + i = 0.15 * n; + e.append("path") + .attr("id", "node-" + t.id) + .attr("class", "node-bkg node-" + b(t.type)) + .attr( + "d", + `M0 0 a${i},${i} 1 0,0 ${0.25 * n},${-1 * r * 0.1}\n a${i},${i} 1 0,0 ${0.25 * n},0\n a${i},${i} 1 0,0 ${0.25 * n},0\n a${i},${i} 1 0,0 ${0.25 * n},${1 * r * 0.1}\n\n a${i},${i} 1 0,0 ${0.15 * n},${1 * r * 0.33}\n a${0.8 * i},${0.8 * i} 1 0,0 0,${1 * r * 0.34}\n a${i},${i} 1 0,0 ${-1 * n * 0.15},${1 * r * 0.33}\n\n a${i},${i} 1 0,0 ${-1 * n * 0.25},${0.15 * r}\n a${i},${i} 1 0,0 ${-1 * n * 0.25},0\n a${i},${i} 1 0,0 ${-1 * n * 0.25},0\n a${i},${i} 1 0,0 ${-1 * n * 0.25},${-1 * r * 0.15}\n\n a${i},${i} 1 0,0 ${-1 * n * 0.1},${-1 * r * 0.33}\n a${0.8 * i},${0.8 * i} 1 0,0 0,${-1 * r * 0.34}\n a${i},${i} 1 0,0 ${0.1 * n},${-1 * r * 0.33}\n\n H0 V0 Z`, + ); + })(u, t); + break; + case y.HEXAGON: + !(function (e, t) { + const n = t.height, + r = n / 4, + i = t.width - t.padding + 2 * r; + !(function (e, t, n, r, i) { + e.insert("polygon", ":first-child") + .attr( + "points", + r + .map(function (e) { + return e.x + "," + e.y; + }) + .join(" "), + ) + .attr("transform", "translate(" + (i.width - t) / 2 + ", " + n + ")"); + })( + e, + i, + n, + [ + { x: r, y: 0 }, + { x: i - r, y: 0 }, + { x: i, y: -n / 2 }, + { x: i - r, y: -n }, + { x: r, y: -n }, + { x: 0, y: -n / 2 }, + ], + t, + ); + })(u, t); + } + m(t.id, s), t.height; + })(e, t, n, r), + t.children && + t.children.forEach((t, i) => { + _(e, t, n < 0 ? i : n, r); + }); + } + function T(e, t, n, r) { + t.add({ + group: "nodes", + data: { + id: e.id, + labelText: e.descr, + height: e.height, + width: e.width, + level: r, + nodeId: e.id, + padding: e.padding, + type: e.type, + }, + position: { x: e.x, y: e.y }, + }), + e.children && + e.children.forEach((i) => { + T(i, t, n, r + 1), + t.add({ + group: "edges", + data: { + id: `${e.id}_${i.id}`, + source: e.id, + target: i.id, + depth: r, + section: i.section, + }, + }); + }); + } + function D(e, t) { + return new Promise((n) => { + const a = (0, i.Ys)("body").append("div").attr("id", "cy").attr("style", "display:none"), + s = o({ + container: document.getElementById("cy"), + style: [{ selector: "edge", style: { "curve-style": "bezier" } }], + }); + a.remove(), + T(e, s, t, 0), + s.nodes().forEach(function (e) { + e.layoutDimensions = () => { + const t = e.data(); + return { w: t.width, h: t.height }; + }; + }), + s.layout({ name: "cose-bilkent", quality: "proof", styleEnabled: !1, animate: !1 }).run(), + s.ready((e) => { + r.l.info("Ready", e), n(s); + }); + }); + } + o.use(s); + const C = { + db: E, + renderer: { + draw: async (e, t, n, a) => { + const o = (0, r.c)(); + (o.htmlLabels = !1), r.l.debug("Rendering mindmap diagram\n" + e, a.parser); + const s = (0, r.c)().securityLevel; + let l; + "sandbox" === s && (l = (0, i.Ys)("#i" + t)); + const u = ("sandbox" === s ? (0, i.Ys)(l.nodes()[0].contentDocument.body) : (0, i.Ys)("body")).select("#" + t); + u.append("g"); + const c = a.db.getMindmap(), + h = u.append("g"); + h.attr("class", "mindmap-edges"); + const d = u.append("g"); + d.attr("class", "mindmap-nodes"), _(d, c, -1, o); + const p = await D(c, o); + !(function (e, t) { + t.edges().map((t, n) => { + const i = t.data(); + if (t[0]._private.bodyBounds) { + const a = t[0]._private.rscratch; + r.l.trace("Edge: ", n, i), + e + .insert("path") + .attr("d", `M ${a.startX},${a.startY} L ${a.midX},${a.midY} L${a.endX},${a.endY} `) + .attr("class", "edge section-edge-" + i.section + " edge-depth-" + i.depth); + } + }); + })(h, p), + (function (e) { + e.nodes().map((e, t) => { + const n = e.data(); + (n.x = e.position().x), + (n.y = e.position().y), + (function (e) { + const t = w(e.id), + n = e.x || 0, + r = e.y || 0; + t.attr("transform", "translate(" + n + "," + r + ")"); + })(n); + const i = w(n.nodeId); + r.l.info("Id:", t, "Position: (", e.position().x, ", ", e.position().y, ")", n), + i.attr("transform", `translate(${e.position().x - n.width / 2}, ${e.position().y - n.height / 2})`), + i.attr("attr", `apa-${t})`); + }); + })(p), + (0, r.p)(void 0, u, o.mindmap.padding, o.mindmap.useMaxWidth); + }, + }, + parser: d, + styles: (e) => + `\n .edge {\n stroke-width: 3;\n }\n ${((e) => { + let t = ""; + for (let t = 0; t < e.THEME_COLOR_LIMIT; t++) + (e["lineColor" + t] = e["lineColor" + t] || e["cScaleInv" + t]), + (0, l.Z)(e["lineColor" + t]) + ? (e["lineColor" + t] = (0, u.Z)(e["lineColor" + t], 20)) + : (e["lineColor" + t] = (0, c.Z)(e["lineColor" + t], 20)); + for (let n = 0; n < e.THEME_COLOR_LIMIT; n++) { + const r = "" + (17 - 3 * n); + t += `\n .section-${n - 1} rect, .section-${n - 1} path, .section-${n - 1} circle, .section-${n - 1} polygon, .section-${n - 1} path {\n fill: ${e["cScale" + n]};\n }\n .section-${n - 1} text {\n fill: ${e["cScaleLabel" + n]};\n }\n .node-icon-${n - 1} {\n font-size: 40px;\n color: ${e["cScaleLabel" + n]};\n }\n .section-edge-${n - 1}{\n stroke: ${e["cScale" + n]};\n }\n .edge-depth-${n - 1}{\n stroke-width: ${r};\n }\n .section-${n - 1} line {\n stroke: ${e["cScaleInv" + n]} ;\n stroke-width: 3;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n `; + } + return t; + })( + e, + )}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${e.git0};\n }\n .section-root text {\n fill: ${e.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .mindmap-node-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`, + }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/662-17acb8f4.chunk.min.js.LICENSE.txt b/docs/themes/hugo-geekdoc/static/js/662-17acb8f4.chunk.min.js.LICENSE.txt new file mode 100644 index 000000000..a58daed49 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/662-17acb8f4.chunk.min.js.LICENSE.txt @@ -0,0 +1,9 @@ +/*! + Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable + Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) + Licensed under The MIT License (http://opensource.org/licenses/MIT) + */ + +/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */ + +/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */ diff --git a/docs/themes/hugo-geekdoc/static/js/728-5df4a5e5.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/728-5df4a5e5.chunk.min.js new file mode 100644 index 000000000..56ad876f7 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/728-5df4a5e5.chunk.min.js @@ -0,0 +1,429 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [728], + { + 3349: function (e, t, n) { + n.d(t, { + a: function () { + return l; + }, + }); + var r = n(6225); + function l(e, t) { + var n = e.append("foreignObject").attr("width", "100000"), + l = n.append("xhtml:div"); + l.attr("xmlns", "http://www.w3.org/1999/xhtml"); + var o = t.label; + switch (typeof o) { + case "function": + l.insert(o); + break; + case "object": + l.insert(function () { + return o; + }); + break; + default: + l.html(o); + } + r.bg(l, t.labelStyle), l.style("display", "inline-block"), l.style("white-space", "nowrap"); + var a = l.node().getBoundingClientRect(); + return n.attr("width", a.width).attr("height", a.height), n; + } + }, + 6225: function (e, t, n) { + n.d(t, { + $p: function () { + return d; + }, + O1: function () { + return a; + }, + WR: function () { + return p; + }, + bF: function () { + return o; + }, + bg: function () { + return c; + }, + }); + var r = n(7514), + l = n(3234); + function o(e, t) { + return !!e.children(t).length; + } + function a(e) { + return s(e.v) + ":" + s(e.w) + ":" + s(e.name); + } + var i = /:/g; + function s(e) { + return e ? String(e).replace(i, "\\:") : ""; + } + function c(e, t) { + t && e.attr("style", t); + } + function d(e, t, n) { + t && e.attr("class", t).attr("class", n + " " + e.attr("class")); + } + function p(e, t) { + var n = t.graph(); + if (r.Z(n)) { + var o = n.transition; + if (l.Z(o)) return o(e); + } + return e; + } + }, + 8728: function (e, t, n) { + n.d(t, { + diagram: function () { + return i; + }, + }); + var r = n(1813), + l = (n(5625), n(7274)); + n(9339), n(3402), n(3688), n(870), n(3771), n(6225), n(3349), n(6749), n(6446), n(3032), l.c_6; + var o = n(8912); + n(7484), n(7967), n(7856), n(9368); + const a = {}, + i = { + parser: r.p, + db: r.f, + renderer: o.f, + styles: o.a, + init: (e) => { + e.flowchart || (e.flowchart = {}), + (e.flowchart.arrowMarkerAbsolute = e.arrowMarkerAbsolute), + (function (e) { + const t = Object.keys(e); + for (const n of t) a[n] = e[n]; + })(e.flowchart), + r.f.clear(), + r.f.setGen("gen-1"); + }, + }; + }, + 8912: function (e, t, n) { + n.d(t, { + a: function () { + return g; + }, + f: function () { + return w; + }, + }); + var r = n(5625), + l = n(7274), + o = n(9339), + a = n(6476), + i = n(3349), + s = n(5971), + c = n(1767), + d = (e, t) => s.Z.lang.round(c.Z.parse(e)[t]), + p = n(1117); + const b = {}, + u = function (e, t, n, r, l, a) { + const s = r.select(`[id="${n}"]`); + Object.keys(e).forEach(function (n) { + const r = e[n]; + let c = "default"; + r.classes.length > 0 && (c = r.classes.join(" ")), (c += " flowchart-label"); + const d = (0, o.k)(r.styles); + let p, + b = void 0 !== r.text ? r.text : r.id; + if ((o.l.info("vertex", r, r.labelType), "markdown" === r.labelType)) o.l.info("vertex", r, r.labelType); + else if ((0, o.n)((0, o.c)().flowchart.htmlLabels)) { + const e = { + label: b.replace(/fa[blrs]?:fa-[\w-]+/g, (e) => ``), + }; + (p = (0, i.a)(s, e).node()), p.parentNode.removeChild(p); + } else { + const e = l.createElementNS("http://www.w3.org/2000/svg", "text"); + e.setAttribute("style", d.labelStyle.replace("color:", "fill:")); + const t = b.split(o.e.lineBreakRegex); + for (const n of t) { + const t = l.createElementNS("http://www.w3.org/2000/svg", "tspan"); + t.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), + t.setAttribute("dy", "1em"), + t.setAttribute("x", "1"), + (t.textContent = n), + e.appendChild(t); + } + p = e; + } + let u = 0, + f = ""; + switch (r.type) { + case "round": + (u = 5), (f = "rect"); + break; + case "square": + case "group": + default: + f = "rect"; + break; + case "diamond": + f = "question"; + break; + case "hexagon": + f = "hexagon"; + break; + case "odd": + case "odd_right": + f = "rect_left_inv_arrow"; + break; + case "lean_right": + f = "lean_right"; + break; + case "lean_left": + f = "lean_left"; + break; + case "trapezoid": + f = "trapezoid"; + break; + case "inv_trapezoid": + f = "inv_trapezoid"; + break; + case "circle": + f = "circle"; + break; + case "ellipse": + f = "ellipse"; + break; + case "stadium": + f = "stadium"; + break; + case "subroutine": + f = "subroutine"; + break; + case "cylinder": + f = "cylinder"; + break; + case "doublecircle": + f = "doublecircle"; + } + t.setNode(r.id, { + labelStyle: d.labelStyle, + shape: f, + labelText: b, + labelType: r.labelType, + rx: u, + ry: u, + class: c, + style: d.style, + id: r.id, + link: r.link, + linkTarget: r.linkTarget, + tooltip: a.db.getTooltip(r.id) || "", + domId: a.db.lookUpDomId(r.id), + haveCallback: r.haveCallback, + width: "group" === r.type ? 500 : void 0, + dir: r.dir, + type: r.type, + props: r.props, + padding: (0, o.c)().flowchart.padding, + }), + o.l.info("setNode", { + labelStyle: d.labelStyle, + labelType: r.labelType, + shape: f, + labelText: b, + rx: u, + ry: u, + class: c, + style: d.style, + id: r.id, + domId: a.db.lookUpDomId(r.id), + width: "group" === r.type ? 500 : void 0, + type: r.type, + dir: r.dir, + props: r.props, + padding: (0, o.c)().flowchart.padding, + }); + }); + }, + f = function (e, t, n) { + o.l.info("abc78 edges = ", e); + let r, + a, + i = 0, + s = {}; + if (void 0 !== e.defaultStyle) { + const t = (0, o.k)(e.defaultStyle); + (r = t.style), (a = t.labelStyle); + } + e.forEach(function (n) { + i++; + const c = "L-" + n.start + "-" + n.end; + void 0 === s[c] ? ((s[c] = 0), o.l.info("abc78 new entry", c, s[c])) : (s[c]++, o.l.info("abc78 new entry", c, s[c])); + let d = c + "-" + s[c]; + o.l.info("abc78 new link id to be used is", c, d, s[c]); + const p = "LS-" + n.start, + u = "LE-" + n.end, + f = { style: "", labelStyle: "" }; + switch ( + ((f.minlen = n.length || 1), + "arrow_open" === n.type ? (f.arrowhead = "none") : (f.arrowhead = "normal"), + (f.arrowTypeStart = "arrow_open"), + (f.arrowTypeEnd = "arrow_open"), + n.type) + ) { + case "double_arrow_cross": + f.arrowTypeStart = "arrow_cross"; + case "arrow_cross": + f.arrowTypeEnd = "arrow_cross"; + break; + case "double_arrow_point": + f.arrowTypeStart = "arrow_point"; + case "arrow_point": + f.arrowTypeEnd = "arrow_point"; + break; + case "double_arrow_circle": + f.arrowTypeStart = "arrow_circle"; + case "arrow_circle": + f.arrowTypeEnd = "arrow_circle"; + } + let w = "", + g = ""; + switch (n.stroke) { + case "normal": + (w = "fill:none;"), void 0 !== r && (w = r), void 0 !== a && (g = a), (f.thickness = "normal"), (f.pattern = "solid"); + break; + case "dotted": + (f.thickness = "normal"), (f.pattern = "dotted"), (f.style = "fill:none;stroke-width:2px;stroke-dasharray:3;"); + break; + case "thick": + (f.thickness = "thick"), (f.pattern = "solid"), (f.style = "stroke-width: 3.5px;fill:none;"); + break; + case "invisible": + (f.thickness = "invisible"), (f.pattern = "solid"), (f.style = "stroke-width: 0;fill:none;"); + } + if (void 0 !== n.style) { + const e = (0, o.k)(n.style); + (w = e.style), (g = e.labelStyle); + } + (f.style = f.style += w), + (f.labelStyle = f.labelStyle += g), + void 0 !== n.interpolate + ? (f.curve = (0, o.o)(n.interpolate, l.c_6)) + : void 0 !== e.defaultInterpolate + ? (f.curve = (0, o.o)(e.defaultInterpolate, l.c_6)) + : (f.curve = (0, o.o)(b.curve, l.c_6)), + void 0 === n.text ? void 0 !== n.style && (f.arrowheadStyle = "fill: #333") : ((f.arrowheadStyle = "fill: #333"), (f.labelpos = "c")), + (f.labelType = n.labelType), + (f.label = n.text.replace(o.e.lineBreakRegex, "\n")), + void 0 === n.style && (f.style = f.style || "stroke: #333; stroke-width: 1.5px;fill:none;"), + (f.labelStyle = f.labelStyle.replace("color:", "fill:")), + (f.id = d), + (f.classes = "flowchart-link " + p + " " + u), + t.setEdge(n.start, n.end, f, i); + }); + }, + w = { + setConf: function (e) { + const t = Object.keys(e); + for (const n of t) b[n] = e[n]; + }, + addVertices: u, + addEdges: f, + getClasses: function (e, t) { + return t.db.getClasses(); + }, + draw: async function (e, t, n, i) { + o.l.info("Drawing flowchart"); + let s = i.db.getDirection(); + void 0 === s && (s = "TD"); + const { securityLevel: c, flowchart: d } = (0, o.c)(), + p = d.nodeSpacing || 50, + b = d.rankSpacing || 50; + let w; + "sandbox" === c && (w = (0, l.Ys)("#i" + t)); + const g = "sandbox" === c ? (0, l.Ys)(w.nodes()[0].contentDocument.body) : (0, l.Ys)("body"), + h = "sandbox" === c ? w.nodes()[0].contentDocument : document, + y = new r.k({ multigraph: !0, compound: !0 }) + .setGraph({ rankdir: s, nodesep: p, ranksep: b, marginx: 0, marginy: 0 }) + .setDefaultEdgeLabel(function () { + return {}; + }); + let k; + const x = i.db.getSubGraphs(); + o.l.info("Subgraphs - ", x); + for (let e = x.length - 1; e >= 0; e--) + (k = x[e]), o.l.info("Subgraph - ", k), i.db.addVertex(k.id, { text: k.title, type: k.labelType }, "group", void 0, k.classes, k.dir); + const v = i.db.getVertices(), + m = i.db.getEdges(); + o.l.info("Edges", m); + let S = 0; + for (S = x.length - 1; S >= 0; S--) { + (k = x[S]), (0, l.td_)("cluster").append("text"); + for (let e = 0; e < k.nodes.length; e++) o.l.info("Setting up subgraphs", k.nodes[e], k.id), y.setParent(k.nodes[e], k.id); + } + u(v, y, t, g, h, i), f(m, y); + const T = g.select(`[id="${t}"]`), + _ = g.select("#" + t + " g"); + if ( + (await (0, a.r)(_, y, ["point", "circle", "cross"], "flowchart", t), + o.u.insertTitle(T, "flowchartTitleText", d.titleTopMargin, i.db.getDiagramTitle()), + (0, o.p)(y, T, d.diagramPadding, d.useMaxWidth), + i.db.indexNodes("subGraph" + S), + !d.htmlLabels) + ) { + const e = h.querySelectorAll('[id="' + t + '"] .edgeLabel .label'); + for (const t of e) { + const e = t.getBBox(), + n = h.createElementNS("http://www.w3.org/2000/svg", "rect"); + n.setAttribute("rx", 0), + n.setAttribute("ry", 0), + n.setAttribute("width", e.width), + n.setAttribute("height", e.height), + t.insertBefore(n, t.firstChild); + } + } + Object.keys(v).forEach(function (e) { + const n = v[e]; + if (n.link) { + const r = (0, l.Ys)("#" + t + ' [id="' + e + '"]'); + if (r) { + const e = h.createElementNS("http://www.w3.org/2000/svg", "a"); + e.setAttributeNS("http://www.w3.org/2000/svg", "class", n.classes.join(" ")), + e.setAttributeNS("http://www.w3.org/2000/svg", "href", n.link), + e.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"), + "sandbox" === c + ? e.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") + : n.linkTarget && e.setAttributeNS("http://www.w3.org/2000/svg", "target", n.linkTarget); + const t = r.insert(function () { + return e; + }, ":first-child"), + l = r.select(".label-container"); + l && + t.append(function () { + return l.node(); + }); + const o = r.select(".label"); + o && + t.append(function () { + return o.node(); + }); + } + } + }); + }, + }, + g = (e) => + `.label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor || e.textColor};\n }\n .cluster-label text {\n fill: ${e.titleColor};\n }\n .cluster-label span,p {\n color: ${e.titleColor};\n }\n\n .label text,span,p {\n fill: ${e.nodeTextColor || e.textColor};\n color: ${e.nodeTextColor || e.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${(( + e, + t, + ) => { + const n = d, + r = n(e, "r"), + l = n(e, "g"), + o = n(e, "b"); + return p.Z(r, l, o, 0.5); + })( + e.edgeLabelBackground, + )};\n // background-color: \n }\n\n .cluster rect {\n fill: ${e.clusterBkg};\n stroke: ${e.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span,p {\n color: ${e.titleColor};\n }\n /* .cluster div {\n color: ${e.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n`; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/729-32b017b3.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/729-32b017b3.chunk.min.js new file mode 100644 index 000000000..a16d48503 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/729-32b017b3.chunk.min.js @@ -0,0 +1,2020 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [729], + { + 7729: function (t, e, r) { + r.d(e, { + diagram: function () { + return C; + }, + }); + var i = r(9339), + n = r(7274), + c = + (r(7484), + r(7967), + r(7856), + (function () { + var t = function (t, e, r, i) { + for (r = r || {}, i = t.length; i--; r[t[i]] = e); + return r; + }, + e = [1, 4], + r = [1, 7], + i = [1, 5], + n = [1, 9], + c = [1, 6], + a = [2, 6], + s = [1, 16], + o = [6, 8, 14, 20, 22, 24, 25, 27, 29, 32, 37, 40, 50, 55], + l = [8, 14, 20, 22, 24, 25, 27, 29, 32, 37, 40], + h = [8, 13, 14, 20, 22, 24, 25, 27, 29, 32, 37, 40], + m = [1, 26], + u = [6, 8, 14, 50, 55], + y = [8, 14, 55], + p = [1, 53], + g = [1, 52], + d = [8, 14, 30, 33, 35, 38, 55], + b = [1, 67], + f = [1, 68], + k = [1, 69], + $ = [8, 14, 33, 35, 42, 55], + _ = { + trace: function () {}, + yy: {}, + symbols_: { + error: 2, + start: 3, + eol: 4, + directive: 5, + GG: 6, + document: 7, + EOF: 8, + ":": 9, + DIR: 10, + options: 11, + body: 12, + OPT: 13, + NL: 14, + line: 15, + statement: 16, + commitStatement: 17, + mergeStatement: 18, + cherryPickStatement: 19, + acc_title: 20, + acc_title_value: 21, + acc_descr: 22, + acc_descr_value: 23, + acc_descr_multiline_value: 24, + section: 25, + branchStatement: 26, + CHECKOUT: 27, + ref: 28, + BRANCH: 29, + ORDER: 30, + NUM: 31, + CHERRY_PICK: 32, + COMMIT_ID: 33, + STR: 34, + COMMIT_TAG: 35, + EMPTYSTR: 36, + MERGE: 37, + COMMIT_TYPE: 38, + commitType: 39, + COMMIT: 40, + commit_arg: 41, + COMMIT_MSG: 42, + NORMAL: 43, + REVERSE: 44, + HIGHLIGHT: 45, + openDirective: 46, + typeDirective: 47, + closeDirective: 48, + argDirective: 49, + open_directive: 50, + type_directive: 51, + arg_directive: 52, + close_directive: 53, + ID: 54, + ";": 55, + $accept: 0, + $end: 1, + }, + terminals_: { + 2: "error", + 6: "GG", + 8: "EOF", + 9: ":", + 10: "DIR", + 13: "OPT", + 14: "NL", + 20: "acc_title", + 21: "acc_title_value", + 22: "acc_descr", + 23: "acc_descr_value", + 24: "acc_descr_multiline_value", + 25: "section", + 27: "CHECKOUT", + 29: "BRANCH", + 30: "ORDER", + 31: "NUM", + 32: "CHERRY_PICK", + 33: "COMMIT_ID", + 34: "STR", + 35: "COMMIT_TAG", + 36: "EMPTYSTR", + 37: "MERGE", + 38: "COMMIT_TYPE", + 40: "COMMIT", + 42: "COMMIT_MSG", + 43: "NORMAL", + 44: "REVERSE", + 45: "HIGHLIGHT", + 50: "open_directive", + 51: "type_directive", + 52: "arg_directive", + 53: "close_directive", + 54: "ID", + 55: ";", + }, + productions_: [ + 0, + [3, 2], + [3, 2], + [3, 3], + [3, 4], + [3, 5], + [7, 0], + [7, 2], + [11, 2], + [11, 1], + [12, 0], + [12, 2], + [15, 2], + [15, 1], + [16, 1], + [16, 1], + [16, 1], + [16, 2], + [16, 2], + [16, 1], + [16, 1], + [16, 1], + [16, 2], + [26, 2], + [26, 4], + [19, 3], + [19, 5], + [19, 5], + [19, 5], + [19, 5], + [18, 2], + [18, 4], + [18, 4], + [18, 4], + [18, 6], + [18, 6], + [18, 6], + [18, 6], + [18, 6], + [18, 6], + [18, 8], + [18, 8], + [18, 8], + [18, 8], + [18, 8], + [18, 8], + [17, 2], + [17, 3], + [17, 3], + [17, 5], + [17, 5], + [17, 3], + [17, 5], + [17, 5], + [17, 5], + [17, 5], + [17, 7], + [17, 7], + [17, 7], + [17, 7], + [17, 7], + [17, 7], + [17, 3], + [17, 5], + [17, 5], + [17, 5], + [17, 5], + [17, 5], + [17, 5], + [17, 7], + [17, 7], + [17, 7], + [17, 7], + [17, 7], + [17, 7], + [17, 7], + [17, 7], + [17, 7], + [17, 7], + [17, 7], + [17, 7], + [17, 7], + [17, 7], + [17, 7], + [17, 7], + [17, 7], + [17, 7], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [17, 9], + [41, 0], + [41, 1], + [39, 1], + [39, 1], + [39, 1], + [5, 3], + [5, 5], + [46, 1], + [47, 1], + [49, 1], + [48, 1], + [28, 1], + [28, 1], + [4, 1], + [4, 1], + [4, 1], + ], + performAction: function (t, e, r, i, n, c, a) { + var s = c.length - 1; + switch (n) { + case 3: + return c[s]; + case 4: + return c[s - 1]; + case 5: + return i.setDirection(c[s - 3]), c[s - 1]; + case 7: + i.setOptions(c[s - 1]), (this.$ = c[s]); + break; + case 8: + (c[s - 1] += c[s]), (this.$ = c[s - 1]); + break; + case 10: + this.$ = []; + break; + case 11: + c[s - 1].push(c[s]), (this.$ = c[s - 1]); + break; + case 12: + this.$ = c[s - 1]; + break; + case 17: + (this.$ = c[s].trim()), i.setAccTitle(this.$); + break; + case 18: + case 19: + (this.$ = c[s].trim()), i.setAccDescription(this.$); + break; + case 20: + i.addSection(c[s].substr(8)), (this.$ = c[s].substr(8)); + break; + case 22: + i.checkout(c[s]); + break; + case 23: + i.branch(c[s]); + break; + case 24: + i.branch(c[s - 2], c[s]); + break; + case 25: + i.cherryPick(c[s], "", void 0); + break; + case 26: + i.cherryPick(c[s - 2], "", c[s]); + break; + case 27: + case 29: + i.cherryPick(c[s - 2], "", ""); + break; + case 28: + i.cherryPick(c[s], "", c[s - 2]); + break; + case 30: + i.merge(c[s], "", "", ""); + break; + case 31: + i.merge(c[s - 2], c[s], "", ""); + break; + case 32: + i.merge(c[s - 2], "", c[s], ""); + break; + case 33: + i.merge(c[s - 2], "", "", c[s]); + break; + case 34: + i.merge(c[s - 4], c[s], "", c[s - 2]); + break; + case 35: + i.merge(c[s - 4], "", c[s], c[s - 2]); + break; + case 36: + i.merge(c[s - 4], "", c[s - 2], c[s]); + break; + case 37: + i.merge(c[s - 4], c[s - 2], c[s], ""); + break; + case 38: + i.merge(c[s - 4], c[s - 2], "", c[s]); + break; + case 39: + i.merge(c[s - 4], c[s], c[s - 2], ""); + break; + case 40: + i.merge(c[s - 6], c[s - 4], c[s - 2], c[s]); + break; + case 41: + i.merge(c[s - 6], c[s], c[s - 4], c[s - 2]); + break; + case 42: + i.merge(c[s - 6], c[s - 4], c[s], c[s - 2]); + break; + case 43: + i.merge(c[s - 6], c[s - 2], c[s - 4], c[s]); + break; + case 44: + i.merge(c[s - 6], c[s], c[s - 2], c[s - 4]); + break; + case 45: + i.merge(c[s - 6], c[s - 2], c[s], c[s - 4]); + break; + case 46: + i.commit(c[s]); + break; + case 47: + i.commit("", "", i.commitType.NORMAL, c[s]); + break; + case 48: + i.commit("", "", c[s], ""); + break; + case 49: + i.commit("", "", c[s], c[s - 2]); + break; + case 50: + i.commit("", "", c[s - 2], c[s]); + break; + case 51: + i.commit("", c[s], i.commitType.NORMAL, ""); + break; + case 52: + i.commit("", c[s - 2], i.commitType.NORMAL, c[s]); + break; + case 53: + i.commit("", c[s], i.commitType.NORMAL, c[s - 2]); + break; + case 54: + i.commit("", c[s - 2], c[s], ""); + break; + case 55: + i.commit("", c[s], c[s - 2], ""); + break; + case 56: + i.commit("", c[s - 4], c[s - 2], c[s]); + break; + case 57: + i.commit("", c[s - 4], c[s], c[s - 2]); + break; + case 58: + i.commit("", c[s - 2], c[s - 4], c[s]); + break; + case 59: + i.commit("", c[s], c[s - 4], c[s - 2]); + break; + case 60: + i.commit("", c[s], c[s - 2], c[s - 4]); + break; + case 61: + i.commit("", c[s - 2], c[s], c[s - 4]); + break; + case 62: + i.commit(c[s], "", i.commitType.NORMAL, ""); + break; + case 63: + i.commit(c[s], "", i.commitType.NORMAL, c[s - 2]); + break; + case 64: + i.commit(c[s - 2], "", i.commitType.NORMAL, c[s]); + break; + case 65: + i.commit(c[s - 2], "", c[s], ""); + break; + case 66: + i.commit(c[s], "", c[s - 2], ""); + break; + case 67: + i.commit(c[s], c[s - 2], i.commitType.NORMAL, ""); + break; + case 68: + i.commit(c[s - 2], c[s], i.commitType.NORMAL, ""); + break; + case 69: + i.commit(c[s - 4], "", c[s - 2], c[s]); + break; + case 70: + i.commit(c[s - 4], "", c[s], c[s - 2]); + break; + case 71: + i.commit(c[s - 2], "", c[s - 4], c[s]); + break; + case 72: + i.commit(c[s], "", c[s - 4], c[s - 2]); + break; + case 73: + i.commit(c[s], "", c[s - 2], c[s - 4]); + break; + case 74: + i.commit(c[s - 2], "", c[s], c[s - 4]); + break; + case 75: + i.commit(c[s - 4], c[s], c[s - 2], ""); + break; + case 76: + i.commit(c[s - 4], c[s - 2], c[s], ""); + break; + case 77: + i.commit(c[s - 2], c[s], c[s - 4], ""); + break; + case 78: + i.commit(c[s], c[s - 2], c[s - 4], ""); + break; + case 79: + i.commit(c[s], c[s - 4], c[s - 2], ""); + break; + case 80: + i.commit(c[s - 2], c[s - 4], c[s], ""); + break; + case 81: + i.commit(c[s - 4], c[s], i.commitType.NORMAL, c[s - 2]); + break; + case 82: + i.commit(c[s - 4], c[s - 2], i.commitType.NORMAL, c[s]); + break; + case 83: + i.commit(c[s - 2], c[s], i.commitType.NORMAL, c[s - 4]); + break; + case 84: + i.commit(c[s], c[s - 2], i.commitType.NORMAL, c[s - 4]); + break; + case 85: + i.commit(c[s], c[s - 4], i.commitType.NORMAL, c[s - 2]); + break; + case 86: + i.commit(c[s - 2], c[s - 4], i.commitType.NORMAL, c[s]); + break; + case 87: + i.commit(c[s - 6], c[s - 4], c[s - 2], c[s]); + break; + case 88: + i.commit(c[s - 6], c[s - 4], c[s], c[s - 2]); + break; + case 89: + i.commit(c[s - 6], c[s - 2], c[s - 4], c[s]); + break; + case 90: + i.commit(c[s - 6], c[s], c[s - 4], c[s - 2]); + break; + case 91: + i.commit(c[s - 6], c[s - 2], c[s], c[s - 4]); + break; + case 92: + i.commit(c[s - 6], c[s], c[s - 2], c[s - 4]); + break; + case 93: + i.commit(c[s - 4], c[s - 6], c[s - 2], c[s]); + break; + case 94: + i.commit(c[s - 4], c[s - 6], c[s], c[s - 2]); + break; + case 95: + i.commit(c[s - 2], c[s - 6], c[s - 4], c[s]); + break; + case 96: + i.commit(c[s], c[s - 6], c[s - 4], c[s - 2]); + break; + case 97: + i.commit(c[s - 2], c[s - 6], c[s], c[s - 4]); + break; + case 98: + i.commit(c[s], c[s - 6], c[s - 2], c[s - 4]); + break; + case 99: + i.commit(c[s], c[s - 4], c[s - 2], c[s - 6]); + break; + case 100: + i.commit(c[s - 2], c[s - 4], c[s], c[s - 6]); + break; + case 101: + i.commit(c[s], c[s - 2], c[s - 4], c[s - 6]); + break; + case 102: + i.commit(c[s - 2], c[s], c[s - 4], c[s - 6]); + break; + case 103: + i.commit(c[s - 4], c[s - 2], c[s], c[s - 6]); + break; + case 104: + i.commit(c[s - 4], c[s], c[s - 2], c[s - 6]); + break; + case 105: + i.commit(c[s - 2], c[s - 4], c[s - 6], c[s]); + break; + case 106: + i.commit(c[s], c[s - 4], c[s - 6], c[s - 2]); + break; + case 107: + i.commit(c[s - 2], c[s], c[s - 6], c[s - 4]); + break; + case 108: + i.commit(c[s], c[s - 2], c[s - 6], c[s - 4]); + break; + case 109: + i.commit(c[s - 4], c[s - 2], c[s - 6], c[s]); + break; + case 110: + i.commit(c[s - 4], c[s], c[s - 6], c[s - 2]); + break; + case 111: + this.$ = ""; + break; + case 112: + this.$ = c[s]; + break; + case 113: + this.$ = i.commitType.NORMAL; + break; + case 114: + this.$ = i.commitType.REVERSE; + break; + case 115: + this.$ = i.commitType.HIGHLIGHT; + break; + case 118: + i.parseDirective("%%{", "open_directive"); + break; + case 119: + i.parseDirective(c[s], "type_directive"); + break; + case 120: + (c[s] = c[s].trim().replace(/'/g, '"')), i.parseDirective(c[s], "arg_directive"); + break; + case 121: + i.parseDirective("}%%", "close_directive", "gitGraph"); + } + }, + table: [ + { 3: 1, 4: 2, 5: 3, 6: e, 8: r, 14: i, 46: 8, 50: n, 55: c }, + { 1: [3] }, + { 3: 10, 4: 2, 5: 3, 6: e, 8: r, 14: i, 46: 8, 50: n, 55: c }, + { 3: 11, 4: 2, 5: 3, 6: e, 8: r, 14: i, 46: 8, 50: n, 55: c }, + { 7: 12, 8: a, 9: [1, 13], 10: [1, 14], 11: 15, 14: s }, + t(o, [2, 124]), + t(o, [2, 125]), + t(o, [2, 126]), + { 47: 17, 51: [1, 18] }, + { 51: [2, 118] }, + { 1: [2, 1] }, + { 1: [2, 2] }, + { 8: [1, 19] }, + { 7: 20, 8: a, 11: 15, 14: s }, + { 9: [1, 21] }, + t(l, [2, 10], { 12: 22, 13: [1, 23] }), + t(h, [2, 9]), + { 9: [1, 25], 48: 24, 53: m }, + t([9, 53], [2, 119]), + { 1: [2, 3] }, + { 8: [1, 27] }, + { 7: 28, 8: a, 11: 15, 14: s }, + { + 8: [2, 7], + 14: [1, 31], + 15: 29, + 16: 30, + 17: 32, + 18: 33, + 19: 34, + 20: [1, 35], + 22: [1, 36], + 24: [1, 37], + 25: [1, 38], + 26: 39, + 27: [1, 40], + 29: [1, 44], + 32: [1, 43], + 37: [1, 42], + 40: [1, 41], + }, + t(h, [2, 8]), + t(u, [2, 116]), + { 49: 45, 52: [1, 46] }, + t(u, [2, 121]), + { 1: [2, 4] }, + { 8: [1, 47] }, + t(l, [2, 11]), + { 4: 48, 8: r, 14: i, 55: c }, + t(l, [2, 13]), + t(y, [2, 14]), + t(y, [2, 15]), + t(y, [2, 16]), + { 21: [1, 49] }, + { 23: [1, 50] }, + t(y, [2, 19]), + t(y, [2, 20]), + t(y, [2, 21]), + { 28: 51, 34: p, 54: g }, + t(y, [2, 111], { + 41: 54, + 33: [1, 57], + 34: [1, 59], + 35: [1, 55], + 38: [1, 56], + 42: [1, 58], + }), + { 28: 60, 34: p, 54: g }, + { 33: [1, 61], 35: [1, 62] }, + { 28: 63, 34: p, 54: g }, + { 48: 64, 53: m }, + { 53: [2, 120] }, + { 1: [2, 5] }, + t(l, [2, 12]), + t(y, [2, 17]), + t(y, [2, 18]), + t(y, [2, 22]), + t(d, [2, 122]), + t(d, [2, 123]), + t(y, [2, 46]), + { 34: [1, 65] }, + { 39: 66, 43: b, 44: f, 45: k }, + { 34: [1, 70] }, + { 34: [1, 71] }, + t(y, [2, 112]), + t(y, [2, 30], { 33: [1, 72], 35: [1, 74], 38: [1, 73] }), + { 34: [1, 75] }, + { 34: [1, 76], 36: [1, 77] }, + t(y, [2, 23], { 30: [1, 78] }), + t(u, [2, 117]), + t(y, [2, 47], { 33: [1, 80], 38: [1, 79], 42: [1, 81] }), + t(y, [2, 48], { 33: [1, 83], 35: [1, 82], 42: [1, 84] }), + t($, [2, 113]), + t($, [2, 114]), + t($, [2, 115]), + t(y, [2, 51], { 35: [1, 85], 38: [1, 86], 42: [1, 87] }), + t(y, [2, 62], { 33: [1, 90], 35: [1, 88], 38: [1, 89] }), + { 34: [1, 91] }, + { 39: 92, 43: b, 44: f, 45: k }, + { 34: [1, 93] }, + t(y, [2, 25], { 35: [1, 94] }), + { 33: [1, 95] }, + { 33: [1, 96] }, + { 31: [1, 97] }, + { 39: 98, 43: b, 44: f, 45: k }, + { 34: [1, 99] }, + { 34: [1, 100] }, + { 34: [1, 101] }, + { 34: [1, 102] }, + { 34: [1, 103] }, + { 34: [1, 104] }, + { 39: 105, 43: b, 44: f, 45: k }, + { 34: [1, 106] }, + { 34: [1, 107] }, + { 39: 108, 43: b, 44: f, 45: k }, + { 34: [1, 109] }, + t(y, [2, 31], { 35: [1, 111], 38: [1, 110] }), + t(y, [2, 32], { 33: [1, 113], 35: [1, 112] }), + t(y, [2, 33], { 33: [1, 114], 38: [1, 115] }), + { 34: [1, 116], 36: [1, 117] }, + { 34: [1, 118] }, + { 34: [1, 119] }, + t(y, [2, 24]), + t(y, [2, 49], { 33: [1, 120], 42: [1, 121] }), + t(y, [2, 53], { 38: [1, 122], 42: [1, 123] }), + t(y, [2, 63], { 33: [1, 125], 38: [1, 124] }), + t(y, [2, 50], { 33: [1, 126], 42: [1, 127] }), + t(y, [2, 55], { 35: [1, 128], 42: [1, 129] }), + t(y, [2, 66], { 33: [1, 131], 35: [1, 130] }), + t(y, [2, 52], { 38: [1, 132], 42: [1, 133] }), + t(y, [2, 54], { 35: [1, 134], 42: [1, 135] }), + t(y, [2, 67], { 35: [1, 137], 38: [1, 136] }), + t(y, [2, 64], { 33: [1, 139], 38: [1, 138] }), + t(y, [2, 65], { 33: [1, 141], 35: [1, 140] }), + t(y, [2, 68], { 35: [1, 143], 38: [1, 142] }), + { 39: 144, 43: b, 44: f, 45: k }, + { 34: [1, 145] }, + { 34: [1, 146] }, + { 34: [1, 147] }, + { 34: [1, 148] }, + { 39: 149, 43: b, 44: f, 45: k }, + t(y, [2, 26]), + t(y, [2, 27]), + t(y, [2, 28]), + t(y, [2, 29]), + { 34: [1, 150] }, + { 34: [1, 151] }, + { 39: 152, 43: b, 44: f, 45: k }, + { 34: [1, 153] }, + { 39: 154, 43: b, 44: f, 45: k }, + { 34: [1, 155] }, + { 34: [1, 156] }, + { 34: [1, 157] }, + { 34: [1, 158] }, + { 34: [1, 159] }, + { 34: [1, 160] }, + { 34: [1, 161] }, + { 39: 162, 43: b, 44: f, 45: k }, + { 34: [1, 163] }, + { 34: [1, 164] }, + { 34: [1, 165] }, + { 39: 166, 43: b, 44: f, 45: k }, + { 34: [1, 167] }, + { 39: 168, 43: b, 44: f, 45: k }, + { 34: [1, 169] }, + { 34: [1, 170] }, + { 34: [1, 171] }, + { 39: 172, 43: b, 44: f, 45: k }, + { 34: [1, 173] }, + t(y, [2, 37], { 35: [1, 174] }), + t(y, [2, 38], { 38: [1, 175] }), + t(y, [2, 36], { 33: [1, 176] }), + t(y, [2, 39], { 35: [1, 177] }), + t(y, [2, 34], { 38: [1, 178] }), + t(y, [2, 35], { 33: [1, 179] }), + t(y, [2, 60], { 42: [1, 180] }), + t(y, [2, 73], { 33: [1, 181] }), + t(y, [2, 61], { 42: [1, 182] }), + t(y, [2, 84], { 38: [1, 183] }), + t(y, [2, 74], { 33: [1, 184] }), + t(y, [2, 83], { 38: [1, 185] }), + t(y, [2, 59], { 42: [1, 186] }), + t(y, [2, 72], { 33: [1, 187] }), + t(y, [2, 58], { 42: [1, 188] }), + t(y, [2, 78], { 35: [1, 189] }), + t(y, [2, 71], { 33: [1, 190] }), + t(y, [2, 77], { 35: [1, 191] }), + t(y, [2, 57], { 42: [1, 192] }), + t(y, [2, 85], { 38: [1, 193] }), + t(y, [2, 56], { 42: [1, 194] }), + t(y, [2, 79], { 35: [1, 195] }), + t(y, [2, 80], { 35: [1, 196] }), + t(y, [2, 86], { 38: [1, 197] }), + t(y, [2, 70], { 33: [1, 198] }), + t(y, [2, 81], { 38: [1, 199] }), + t(y, [2, 69], { 33: [1, 200] }), + t(y, [2, 75], { 35: [1, 201] }), + t(y, [2, 76], { 35: [1, 202] }), + t(y, [2, 82], { 38: [1, 203] }), + { 34: [1, 204] }, + { 39: 205, 43: b, 44: f, 45: k }, + { 34: [1, 206] }, + { 34: [1, 207] }, + { 39: 208, 43: b, 44: f, 45: k }, + { 34: [1, 209] }, + { 34: [1, 210] }, + { 34: [1, 211] }, + { 34: [1, 212] }, + { 39: 213, 43: b, 44: f, 45: k }, + { 34: [1, 214] }, + { 39: 215, 43: b, 44: f, 45: k }, + { 34: [1, 216] }, + { 34: [1, 217] }, + { 34: [1, 218] }, + { 34: [1, 219] }, + { 34: [1, 220] }, + { 34: [1, 221] }, + { 34: [1, 222] }, + { 39: 223, 43: b, 44: f, 45: k }, + { 34: [1, 224] }, + { 34: [1, 225] }, + { 34: [1, 226] }, + { 39: 227, 43: b, 44: f, 45: k }, + { 34: [1, 228] }, + { 39: 229, 43: b, 44: f, 45: k }, + { 34: [1, 230] }, + { 34: [1, 231] }, + { 34: [1, 232] }, + { 39: 233, 43: b, 44: f, 45: k }, + t(y, [2, 40]), + t(y, [2, 42]), + t(y, [2, 41]), + t(y, [2, 43]), + t(y, [2, 45]), + t(y, [2, 44]), + t(y, [2, 101]), + t(y, [2, 102]), + t(y, [2, 99]), + t(y, [2, 100]), + t(y, [2, 104]), + t(y, [2, 103]), + t(y, [2, 108]), + t(y, [2, 107]), + t(y, [2, 106]), + t(y, [2, 105]), + t(y, [2, 110]), + t(y, [2, 109]), + t(y, [2, 98]), + t(y, [2, 97]), + t(y, [2, 96]), + t(y, [2, 95]), + t(y, [2, 93]), + t(y, [2, 94]), + t(y, [2, 92]), + t(y, [2, 91]), + t(y, [2, 90]), + t(y, [2, 89]), + t(y, [2, 87]), + t(y, [2, 88]), + ], + defaultActions: { + 9: [2, 118], + 10: [2, 1], + 11: [2, 2], + 19: [2, 3], + 27: [2, 4], + 46: [2, 120], + 47: [2, 5], + }, + parseError: function (t, e) { + if (!e.recoverable) { + var r = new Error(t); + throw ((r.hash = e), r); + } + this.trace(t); + }, + parse: function (t) { + var e = [0], + r = [], + i = [null], + n = [], + c = this.table, + a = "", + s = 0, + o = 0, + l = n.slice.call(arguments, 1), + h = Object.create(this.lexer), + m = { yy: {} }; + for (var u in this.yy) Object.prototype.hasOwnProperty.call(this.yy, u) && (m.yy[u] = this.yy[u]); + h.setInput(t, m.yy), (m.yy.lexer = h), (m.yy.parser = this), void 0 === h.yylloc && (h.yylloc = {}); + var y = h.yylloc; + n.push(y); + var p = h.options && h.options.ranges; + "function" == typeof m.yy.parseError + ? (this.parseError = m.yy.parseError) + : (this.parseError = Object.getPrototypeOf(this).parseError); + for (var g, d, b, f, k, $, _, x, v, w = {}; ; ) { + if ( + ((d = e[e.length - 1]), + this.defaultActions[d] + ? (b = this.defaultActions[d]) + : (null == g && + ((v = void 0), + "number" != typeof (v = r.pop() || h.lex() || 1) && + (v instanceof Array && (v = (r = v).pop()), (v = this.symbols_[v] || v)), + (g = v)), + (b = c[d] && c[d][g])), + void 0 === b || !b.length || !b[0]) + ) { + var T; + for (k in ((x = []), c[d])) this.terminals_[k] && k > 2 && x.push("'" + this.terminals_[k] + "'"); + (T = h.showPosition + ? "Parse error on line " + + (s + 1) + + ":\n" + + h.showPosition() + + "\nExpecting " + + x.join(", ") + + ", got '" + + (this.terminals_[g] || g) + + "'" + : "Parse error on line " + (s + 1) + ": Unexpected " + (1 == g ? "end of input" : "'" + (this.terminals_[g] || g) + "'")), + this.parseError(T, { + text: h.match, + token: this.terminals_[g] || g, + line: h.yylineno, + loc: y, + expected: x, + }); + } + if (b[0] instanceof Array && b.length > 1) + throw new Error("Parse Error: multiple actions possible at state: " + d + ", token: " + g); + switch (b[0]) { + case 1: + e.push(g), + i.push(h.yytext), + n.push(h.yylloc), + e.push(b[1]), + (g = null), + (o = h.yyleng), + (a = h.yytext), + (s = h.yylineno), + (y = h.yylloc); + break; + case 2: + if ( + (($ = this.productions_[b[1]][1]), + (w.$ = i[i.length - $]), + (w._$ = { + first_line: n[n.length - ($ || 1)].first_line, + last_line: n[n.length - 1].last_line, + first_column: n[n.length - ($ || 1)].first_column, + last_column: n[n.length - 1].last_column, + }), + p && (w._$.range = [n[n.length - ($ || 1)].range[0], n[n.length - 1].range[1]]), + void 0 !== (f = this.performAction.apply(w, [a, o, s, m.yy, b[1], i, n].concat(l)))) + ) + return f; + $ && ((e = e.slice(0, -1 * $ * 2)), (i = i.slice(0, -1 * $)), (n = n.slice(0, -1 * $))), + e.push(this.productions_[b[1]][0]), + i.push(w.$), + n.push(w._$), + (_ = c[e[e.length - 2]][e[e.length - 1]]), + e.push(_); + break; + case 3: + return !0; + } + } + return !0; + }, + }, + x = { + EOF: 1, + parseError: function (t, e) { + if (!this.yy.parser) throw new Error(t); + this.yy.parser.parseError(t, e); + }, + setInput: function (t, e) { + return ( + (this.yy = e || this.yy || {}), + (this._input = t), + (this._more = this._backtrack = this.done = !1), + (this.yylineno = this.yyleng = 0), + (this.yytext = this.matched = this.match = ""), + (this.conditionStack = ["INITIAL"]), + (this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0, + }), + this.options.ranges && (this.yylloc.range = [0, 0]), + (this.offset = 0), + this + ); + }, + input: function () { + var t = this._input[0]; + return ( + (this.yytext += t), + this.yyleng++, + this.offset++, + (this.match += t), + (this.matched += t), + t.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, + this.options.ranges && this.yylloc.range[1]++, + (this._input = this._input.slice(1)), + t + ); + }, + unput: function (t) { + var e = t.length, + r = t.split(/(?:\r\n?|\n)/g); + (this._input = t + this._input), (this.yytext = this.yytext.substr(0, this.yytext.length - e)), (this.offset -= e); + var i = this.match.split(/(?:\r\n?|\n)/g); + (this.match = this.match.substr(0, this.match.length - 1)), + (this.matched = this.matched.substr(0, this.matched.length - 1)), + r.length - 1 && (this.yylineno -= r.length - 1); + var n = this.yylloc.range; + return ( + (this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: r + ? (r.length === i.length ? this.yylloc.first_column : 0) + i[i.length - r.length].length - r[0].length + : this.yylloc.first_column - e, + }), + this.options.ranges && (this.yylloc.range = [n[0], n[0] + this.yyleng - e]), + (this.yyleng = this.yytext.length), + this + ); + }, + more: function () { + return (this._more = !0), this; + }, + reject: function () { + return this.options.backtrack_lexer + ? ((this._backtrack = !0), this) + : this.parseError( + "Lexical error on line " + + (this.yylineno + 1) + + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + + this.showPosition(), + { text: "", token: null, line: this.yylineno }, + ); + }, + less: function (t) { + this.unput(this.match.slice(t)); + }, + pastInput: function () { + var t = this.matched.substr(0, this.matched.length - this.match.length); + return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, ""); + }, + upcomingInput: function () { + var t = this.match; + return ( + t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "") + ); + }, + showPosition: function () { + var t = this.pastInput(), + e = new Array(t.length + 1).join("-"); + return t + this.upcomingInput() + "\n" + e + "^"; + }, + test_match: function (t, e) { + var r, i, n; + if ( + (this.options.backtrack_lexer && + ((n = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column, + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done, + }), + this.options.ranges && (n.yylloc.range = this.yylloc.range.slice(0))), + (i = t[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += i.length), + (this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: i ? i[i.length - 1].length - i[i.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length, + }), + (this.yytext += t[0]), + (this.match += t[0]), + (this.matches = t), + (this.yyleng = this.yytext.length), + this.options.ranges && (this.yylloc.range = [this.offset, (this.offset += this.yyleng)]), + (this._more = !1), + (this._backtrack = !1), + (this._input = this._input.slice(t[0].length)), + (this.matched += t[0]), + (r = this.performAction.call(this, this.yy, this, e, this.conditionStack[this.conditionStack.length - 1])), + this.done && this._input && (this.done = !1), + r) + ) + return r; + if (this._backtrack) { + for (var c in n) this[c] = n[c]; + return !1; + } + return !1; + }, + next: function () { + if (this.done) return this.EOF; + var t, e, r, i; + this._input || (this.done = !0), this._more || ((this.yytext = ""), (this.match = "")); + for (var n = this._currentRules(), c = 0; c < n.length; c++) + if ((r = this._input.match(this.rules[n[c]])) && (!e || r[0].length > e[0].length)) { + if (((e = r), (i = c), this.options.backtrack_lexer)) { + if (!1 !== (t = this.test_match(r, n[c]))) return t; + if (this._backtrack) { + e = !1; + continue; + } + return !1; + } + if (!this.options.flex) break; + } + return e + ? !1 !== (t = this.test_match(e, n[i])) && t + : "" === this._input + ? this.EOF + : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno, + }); + }, + lex: function () { + return this.next() || this.lex(); + }, + begin: function (t) { + this.conditionStack.push(t); + }, + popState: function () { + return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]; + }, + _currentRules: function () { + return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] + ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules + : this.conditions.INITIAL.rules; + }, + topState: function (t) { + return (t = this.conditionStack.length - 1 - Math.abs(t || 0)) >= 0 ? this.conditionStack[t] : "INITIAL"; + }, + pushState: function (t) { + this.begin(t); + }, + stateStackSize: function () { + return this.conditionStack.length; + }, + options: { "case-insensitive": !0 }, + performAction: function (t, e, r, i) { + switch (r) { + case 0: + return this.begin("open_directive"), 50; + case 1: + return this.begin("type_directive"), 51; + case 2: + return this.popState(), this.begin("arg_directive"), 9; + case 3: + return this.popState(), this.popState(), 53; + case 4: + return 52; + case 5: + return this.begin("acc_title"), 20; + case 6: + return this.popState(), "acc_title_value"; + case 7: + return this.begin("acc_descr"), 22; + case 8: + return this.popState(), "acc_descr_value"; + case 9: + this.begin("acc_descr_multiline"); + break; + case 10: + case 34: + case 38: + this.popState(); + break; + case 11: + return "acc_descr_multiline_value"; + case 12: + return 14; + case 13: + case 14: + break; + case 15: + return 6; + case 16: + return 40; + case 17: + return 33; + case 18: + return 38; + case 19: + return 42; + case 20: + return 43; + case 21: + return 44; + case 22: + return 45; + case 23: + return 35; + case 24: + return 29; + case 25: + return 30; + case 26: + return 37; + case 27: + return 32; + case 28: + return 27; + case 29: + case 30: + return 10; + case 31: + return 9; + case 32: + return "CARET"; + case 33: + this.begin("options"); + break; + case 35: + return 13; + case 36: + return 36; + case 37: + this.begin("string"); + break; + case 39: + return 34; + case 40: + return 31; + case 41: + return 54; + case 42: + return 8; + } + }, + rules: [ + /^(?:%%\{)/i, + /^(?:((?:(?!\}%%)[^:.])*))/i, + /^(?::)/i, + /^(?:\}%%)/i, + /^(?:((?:(?!\}%%).|\n)*))/i, + /^(?:accTitle\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*\{\s*)/i, + /^(?:[\}])/i, + /^(?:[^\}]*)/i, + /^(?:(\r?\n)+)/i, + /^(?:#[^\n]*)/i, + /^(?:%[^\n]*)/i, + /^(?:gitGraph\b)/i, + /^(?:commit(?=\s|$))/i, + /^(?:id:)/i, + /^(?:type:)/i, + /^(?:msg:)/i, + /^(?:NORMAL\b)/i, + /^(?:REVERSE\b)/i, + /^(?:HIGHLIGHT\b)/i, + /^(?:tag:)/i, + /^(?:branch(?=\s|$))/i, + /^(?:order:)/i, + /^(?:merge(?=\s|$))/i, + /^(?:cherry-pick(?=\s|$))/i, + /^(?:checkout(?=\s|$))/i, + /^(?:LR\b)/i, + /^(?:TB\b)/i, + /^(?::)/i, + /^(?:\^)/i, + /^(?:options\r?\n)/i, + /^(?:[ \r\n\t]+end\b)/i, + /^(?:[\s\S]+(?=[ \r\n\t]+end))/i, + /^(?:["]["])/i, + /^(?:["])/i, + /^(?:["])/i, + /^(?:[^"]*)/i, + /^(?:[0-9]+(?=\s|$))/i, + /^(?:\w([-\./\w]*[-\w])?)/i, + /^(?:$)/i, + /^(?:\s+)/i, + ], + conditions: { + acc_descr_multiline: { rules: [10, 11], inclusive: !1 }, + acc_descr: { rules: [8], inclusive: !1 }, + acc_title: { rules: [6], inclusive: !1 }, + close_directive: { rules: [], inclusive: !1 }, + arg_directive: { rules: [3, 4], inclusive: !1 }, + type_directive: { rules: [2, 3], inclusive: !1 }, + open_directive: { rules: [1], inclusive: !1 }, + options: { rules: [34, 35], inclusive: !1 }, + string: { rules: [38, 39], inclusive: !1 }, + INITIAL: { + rules: [ + 0, 5, 7, 9, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 36, 37, 40, 41, 42, 43, + ], + inclusive: !0, + }, + }, + }; + function v() { + this.yy = {}; + } + return (_.lexer = x), (v.prototype = _), (_.Parser = v), new v(); + })()); + c.parser = c; + const a = c; + let s = (0, i.c)().gitGraph.mainBranchName, + o = (0, i.c)().gitGraph.mainBranchOrder, + l = {}, + h = null, + m = {}; + m[s] = { name: s, order: o }; + let u = {}; + u[s] = h; + let y = s, + p = "LR", + g = 0; + function d() { + return (0, i.y)({ length: 7 }); + } + let b = {}; + const f = function (t) { + if (((t = i.e.sanitizeText(t, (0, i.c)())), void 0 === u[t])) { + let e = new Error('Trying to checkout branch which is not yet created. (Help try using "branch ' + t + '")'); + throw ( + ((e.hash = { + text: "checkout " + t, + token: "checkout " + t, + line: "1", + loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, + expected: ['"branch ' + t + '"'], + }), + e) + ); + } + { + y = t; + const e = u[y]; + h = l[e]; + } + }; + function k(t, e, r) { + const i = t.indexOf(e); + -1 === i ? t.push(r) : t.splice(i, 1, r); + } + function $(t) { + const e = t.reduce((t, e) => (t.seq > e.seq ? t : e), t[0]); + let r = ""; + t.forEach(function (t) { + r += t === e ? "\t*" : "\t|"; + }); + const n = [r, e.id, e.seq]; + for (let t in u) u[t] === e.id && n.push(t); + if ((i.l.debug(n.join(" ")), e.parents && 2 == e.parents.length)) { + const r = l[e.parents[0]]; + k(t, e, r), t.push(l[e.parents[1]]); + } else { + if (0 == e.parents.length) return; + { + const r = l[e.parents]; + k(t, e, r); + } + } + $( + (t = (function (t, e) { + const r = Object.create(null); + return t.reduce((t, e) => { + const i = e.id; + return r[i] || ((r[i] = !0), t.push(e)), t; + }, []); + })(t)), + ); + } + const _ = function () { + const t = Object.keys(l).map(function (t) { + return l[t]; + }); + return ( + t.forEach(function (t) { + i.l.debug(t.id); + }), + t.sort((t, e) => t.seq - e.seq), + t + ); + }, + x = { NORMAL: 0, REVERSE: 1, HIGHLIGHT: 2, MERGE: 3, CHERRY_PICK: 4 }, + v = { + parseDirective: function (t, e, r) { + i.m.parseDirective(this, t, e, r); + }, + getConfig: () => (0, i.c)().gitGraph, + setDirection: function (t) { + p = t; + }, + setOptions: function (t) { + i.l.debug("options str", t), (t = (t = t && t.trim()) || "{}"); + try { + b = JSON.parse(t); + } catch (t) { + i.l.error("error while parsing gitGraph options", t.message); + } + }, + getOptions: function () { + return b; + }, + commit: function (t, e, r, n) { + i.l.debug("Entering commit:", t, e, r, n), + (e = i.e.sanitizeText(e, (0, i.c)())), + (t = i.e.sanitizeText(t, (0, i.c)())), + (n = i.e.sanitizeText(n, (0, i.c)())); + const c = { + id: e || g + "-" + d(), + message: t, + seq: g++, + type: r || x.NORMAL, + tag: n || "", + parents: null == h ? [] : [h.id], + branch: y, + }; + (h = c), (l[c.id] = c), (u[y] = c.id), i.l.debug("in pushCommit " + c.id); + }, + branch: function (t, e) { + if (((t = i.e.sanitizeText(t, (0, i.c)())), void 0 !== u[t])) { + let e = new Error( + 'Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ' + + t + + '")', + ); + throw ( + ((e.hash = { + text: "branch " + t, + token: "branch " + t, + line: "1", + loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, + expected: ['"checkout ' + t + '"'], + }), + e) + ); + } + (u[t] = null != h ? h.id : null), (m[t] = { name: t, order: e ? parseInt(e, 10) : null }), f(t), i.l.debug("in createBranch"); + }, + merge: function (t, e, r, n) { + (t = i.e.sanitizeText(t, (0, i.c)())), (e = i.e.sanitizeText(e, (0, i.c)())); + const c = l[u[y]], + a = l[u[t]]; + if (y === t) { + let e = new Error('Incorrect usage of "merge". Cannot merge a branch to itself'); + throw ( + ((e.hash = { + text: "merge " + t, + token: "merge " + t, + line: "1", + loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, + expected: ["branch abc"], + }), + e) + ); + } + if (void 0 === c || !c) { + let e = new Error('Incorrect usage of "merge". Current branch (' + y + ")has no commits"); + throw ( + ((e.hash = { + text: "merge " + t, + token: "merge " + t, + line: "1", + loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, + expected: ["commit"], + }), + e) + ); + } + if (void 0 === u[t]) { + let e = new Error('Incorrect usage of "merge". Branch to be merged (' + t + ") does not exist"); + throw ( + ((e.hash = { + text: "merge " + t, + token: "merge " + t, + line: "1", + loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, + expected: ["branch " + t], + }), + e) + ); + } + if (void 0 === a || !a) { + let e = new Error('Incorrect usage of "merge". Branch to be merged (' + t + ") has no commits"); + throw ( + ((e.hash = { + text: "merge " + t, + token: "merge " + t, + line: "1", + loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, + expected: ['"commit"'], + }), + e) + ); + } + if (c === a) { + let e = new Error('Incorrect usage of "merge". Both branches have same head'); + throw ( + ((e.hash = { + text: "merge " + t, + token: "merge " + t, + line: "1", + loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, + expected: ["branch abc"], + }), + e) + ); + } + if (e && void 0 !== l[e]) { + let i = new Error('Incorrect usage of "merge". Commit with id:' + e + " already exists, use different custom Id"); + throw ( + ((i.hash = { + text: "merge " + t + e + r + n, + token: "merge " + t + e + r + n, + line: "1", + loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, + expected: ["merge " + t + " " + e + "_UNIQUE " + r + " " + n], + }), + i) + ); + } + const s = { + id: e || g + "-" + d(), + message: "merged branch " + t + " into " + y, + seq: g++, + parents: [null == h ? null : h.id, u[t]], + branch: y, + type: x.MERGE, + customType: r, + customId: !!e, + tag: n || "", + }; + (h = s), (l[s.id] = s), (u[y] = s.id), i.l.debug(u), i.l.debug("in mergeBranch"); + }, + cherryPick: function (t, e, r) { + if ( + (i.l.debug("Entering cherryPick:", t, e, r), + (t = i.e.sanitizeText(t, (0, i.c)())), + (e = i.e.sanitizeText(e, (0, i.c)())), + (r = i.e.sanitizeText(r, (0, i.c)())), + !t || void 0 === l[t]) + ) { + let r = new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided'); + throw ( + ((r.hash = { + text: "cherryPick " + t + " " + e, + token: "cherryPick " + t + " " + e, + line: "1", + loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, + expected: ["cherry-pick abc"], + }), + r) + ); + } + let n = l[t], + c = n.branch; + if (n.type === x.MERGE) { + let r = new Error('Incorrect usage of "cherryPick". Source commit should not be a merge commit'); + throw ( + ((r.hash = { + text: "cherryPick " + t + " " + e, + token: "cherryPick " + t + " " + e, + line: "1", + loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, + expected: ["cherry-pick abc"], + }), + r) + ); + } + if (!e || void 0 === l[e]) { + if (c === y) { + let r = new Error('Incorrect usage of "cherryPick". Source commit is already on current branch'); + throw ( + ((r.hash = { + text: "cherryPick " + t + " " + e, + token: "cherryPick " + t + " " + e, + line: "1", + loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, + expected: ["cherry-pick abc"], + }), + r) + ); + } + const a = l[u[y]]; + if (void 0 === a || !a) { + let r = new Error('Incorrect usage of "cherry-pick". Current branch (' + y + ")has no commits"); + throw ( + ((r.hash = { + text: "cherryPick " + t + " " + e, + token: "cherryPick " + t + " " + e, + line: "1", + loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, + expected: ["cherry-pick abc"], + }), + r) + ); + } + const s = { + id: g + "-" + d(), + message: "cherry-picked " + n + " into " + y, + seq: g++, + parents: [null == h ? null : h.id, n.id], + branch: y, + type: x.CHERRY_PICK, + tag: r ?? "cherry-pick:" + n.id, + }; + (h = s), (l[s.id] = s), (u[y] = s.id), i.l.debug(u), i.l.debug("in cherryPick"); + } + }, + checkout: f, + prettyPrint: function () { + i.l.debug(l), $([_()[0]]); + }, + clear: function () { + (l = {}), (h = null); + let t = (0, i.c)().gitGraph.mainBranchName, + e = (0, i.c)().gitGraph.mainBranchOrder; + (u = {}), (u[t] = null), (m = {}), (m[t] = { name: t, order: e }), (y = t), (g = 0), (0, i.v)(); + }, + getBranchesAsObjArray: function () { + return Object.values(m) + .map((t, e) => (null !== t.order ? t : { ...t, order: parseFloat(`0.${e}`, 10) })) + .sort((t, e) => t.order - e.order) + .map(({ name: t }) => ({ name: t })); + }, + getBranches: function () { + return u; + }, + getCommits: function () { + return l; + }, + getCommitsArray: _, + getCurrentBranch: function () { + return y; + }, + getDirection: function () { + return p; + }, + getHead: function () { + return h; + }, + setAccTitle: i.s, + getAccTitle: i.g, + getAccDescription: i.a, + setAccDescription: i.b, + setDiagramTitle: i.r, + getDiagramTitle: i.t, + commitType: x, + }; + let w = {}; + let T = {}, + E = {}, + L = [], + M = 0, + A = "LR"; + const I = (t) => { + const e = document.createElementNS("http://www.w3.org/2000/svg", "text"); + let r = []; + r = "string" == typeof t ? t.split(/\\n|\n|/gi) : Array.isArray(t) ? t : []; + for (const t of r) { + const r = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + r.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), + r.setAttribute("dy", "1em"), + r.setAttribute("x", "0"), + r.setAttribute("class", "row"), + (r.textContent = t.trim()), + e.appendChild(r); + } + return e; + }, + R = (t, e, r) => { + const n = (0, i.z)().gitGraph, + c = t.append("g").attr("class", "commit-bullets"), + a = t.append("g").attr("class", "commit-labels"); + let s = 0; + "TB" === A && (s = 30), + Object.keys(e) + .sort((t, r) => e[t].seq - e[r].seq) + .forEach((t) => { + const i = e[t], + o = "TB" === A ? s + 10 : T[i.branch].pos, + l = "TB" === A ? T[i.branch].pos : s + 10; + if (r) { + let t, + e = void 0 !== i.customType && "" !== i.customType ? i.customType : i.type; + switch (e) { + case 0: + default: + t = "commit-normal"; + break; + case 1: + t = "commit-reverse"; + break; + case 2: + t = "commit-highlight"; + break; + case 3: + t = "commit-merge"; + break; + case 4: + t = "commit-cherry-pick"; + } + if (2 === e) { + const e = c.append("rect"); + e.attr("x", l - 10), + e.attr("y", o - 10), + e.attr("height", 20), + e.attr("width", 20), + e.attr("class", `commit ${i.id} commit-highlight${T[i.branch].index % 8} ${t}-outer`), + c + .append("rect") + .attr("x", l - 6) + .attr("y", o - 6) + .attr("height", 12) + .attr("width", 12) + .attr("class", `commit ${i.id} commit${T[i.branch].index % 8} ${t}-inner`); + } else if (4 === e) + c.append("circle").attr("cx", l).attr("cy", o).attr("r", 10).attr("class", `commit ${i.id} ${t}`), + c + .append("circle") + .attr("cx", l - 3) + .attr("cy", o + 2) + .attr("r", 2.75) + .attr("fill", "#fff") + .attr("class", `commit ${i.id} ${t}`), + c + .append("circle") + .attr("cx", l + 3) + .attr("cy", o + 2) + .attr("r", 2.75) + .attr("fill", "#fff") + .attr("class", `commit ${i.id} ${t}`), + c + .append("line") + .attr("x1", l + 3) + .attr("y1", o + 1) + .attr("x2", l) + .attr("y2", o - 5) + .attr("stroke", "#fff") + .attr("class", `commit ${i.id} ${t}`), + c + .append("line") + .attr("x1", l - 3) + .attr("y1", o + 1) + .attr("x2", l) + .attr("y2", o - 5) + .attr("stroke", "#fff") + .attr("class", `commit ${i.id} ${t}`); + else { + const r = c.append("circle"); + if ( + (r.attr("cx", l), + r.attr("cy", o), + r.attr("r", 3 === i.type ? 9 : 10), + r.attr("class", `commit ${i.id} commit${T[i.branch].index % 8}`), + 3 === e) + ) { + const e = c.append("circle"); + e.attr("cx", l), e.attr("cy", o), e.attr("r", 6), e.attr("class", `commit ${t} ${i.id} commit${T[i.branch].index % 8}`); + } + 1 === e && + c + .append("path") + .attr("d", `M ${l - 5},${o - 5}L${l + 5},${o + 5}M${l - 5},${o + 5}L${l + 5},${o - 5}`) + .attr("class", `commit ${t} ${i.id} commit${T[i.branch].index % 8}`); + } + } + if (((E[i.id] = "TB" === A ? { x: l, y: s + 10 } : { x: s + 10, y: o }), r)) { + const t = 4, + e = 2; + if (4 !== i.type && ((i.customId && 3 === i.type) || 3 !== i.type) && n.showCommitLabel) { + const r = a.append("g"), + c = r.insert("rect").attr("class", "commit-label-bkg"), + h = r + .append("text") + .attr("x", s) + .attr("y", o + 25) + .attr("class", "commit-label") + .text(i.id); + let m = h.node().getBBox(); + if ( + (c + .attr("x", s + 10 - m.width / 2 - e) + .attr("y", o + 13.5) + .attr("width", m.width + 2 * e) + .attr("height", m.height + 2 * e), + "TB" === A && + (c.attr("x", l - (m.width + 4 * t + 5)).attr("y", o - 12), h.attr("x", l - (m.width + 4 * t)).attr("y", o + m.height - 12)), + "TB" !== A && h.attr("x", s + 10 - m.width / 2), + n.rotateCommitLabel) + ) + if ("TB" === A) + h.attr("transform", "rotate(-45, " + l + ", " + o + ")"), c.attr("transform", "rotate(-45, " + l + ", " + o + ")"); + else { + let t = -7.5 - ((m.width + 10) / 25) * 9.5, + e = 10 + (m.width / 25) * 8.5; + r.attr("transform", "translate(" + t + ", " + e + ") rotate(-45, " + s + ", " + o + ")"); + } + } + if (i.tag) { + const r = a.insert("polygon"), + n = a.append("circle"), + c = a + .append("text") + .attr("y", o - 16) + .attr("class", "tag-label") + .text(i.tag); + let h = c.node().getBBox(); + c.attr("x", s + 10 - h.width / 2); + const m = h.height / 2, + u = o - 19.2; + r + .attr("class", "tag-label-bkg") + .attr( + "points", + `\n ${s - h.width / 2 - t / 2},${u + e}\n ${s - h.width / 2 - t / 2},${u - e}\n ${s + 10 - h.width / 2 - t},${u - m - e}\n ${s + 10 + h.width / 2 + t},${u - m - e}\n ${s + 10 + h.width / 2 + t},${u + m + e}\n ${s + 10 - h.width / 2 - t},${u + m + e}`, + ), + n + .attr("cx", s - h.width / 2 + t / 2) + .attr("cy", u) + .attr("r", 1.5) + .attr("class", "tag-hole"), + "TB" === A && + (r + .attr("class", "tag-label-bkg") + .attr( + "points", + `\n ${l},${s + e}\n ${l},${s - e}\n ${l + 10},${s - m - e}\n ${l + 10 + h.width + t},${s - m - e}\n ${l + 10 + h.width + t},${s + m + e}\n ${l + 10},${s + m + e}`, + ) + .attr("transform", "translate(12,12) rotate(45, " + l + "," + s + ")"), + n + .attr("cx", l + t / 2) + .attr("cy", s) + .attr("transform", "translate(12,12) rotate(45, " + l + "," + s + ")"), + c + .attr("x", l + 5) + .attr("y", s + 3) + .attr("transform", "translate(14,14) rotate(45, " + l + "," + s + ")")); + } + } + (s += 50), s > M && (M = s); + }); + }, + O = (t, e, r = 0) => { + const i = t + Math.abs(t - e) / 2; + if (r > 5) return i; + if (L.every((t) => Math.abs(t - i) >= 10)) return L.push(i), i; + const n = Math.abs(t - e); + return O(t, e - n / 5, r + 1); + }, + C = { + parser: a, + db: v, + renderer: { + draw: function (t, e, r, c) { + (T = {}), (E = {}), (w = {}), (M = 0), (L = []), (A = "LR"); + const a = (0, i.z)(), + s = a.gitGraph; + i.l.debug("in gitgraph renderer", t + "\n", "id:", e, r), (w = c.db.getCommits()); + const o = c.db.getBranchesAsObjArray(); + A = c.db.getDirection(); + const l = (0, n.Ys)(`[id="${e}"]`); + let h = 0; + o.forEach((t, e) => { + const r = I(t.name), + i = l.append("g"), + n = i.insert("g").attr("class", "branchLabel"), + c = n.insert("g").attr("class", "label branch-label"); + c.node().appendChild(r); + let a = r.getBBox(); + (T[t.name] = { pos: h, index: e }), + (h += 50 + (s.rotateCommitLabel ? 40 : 0) + ("TB" === A ? a.width / 2 : 0)), + c.remove(), + n.remove(), + i.remove(); + }), + R(l, w, !1), + s.showBranches && + ((t, e) => { + const r = (0, i.z)().gitGraph, + n = t.append("g"); + e.forEach((t, e) => { + const i = e % 8, + c = T[t.name].pos, + a = n.append("line"); + a.attr("x1", 0), + a.attr("y1", c), + a.attr("x2", M), + a.attr("y2", c), + a.attr("class", "branch branch" + i), + "TB" === A && (a.attr("y1", 30), a.attr("x1", c), a.attr("y2", M), a.attr("x2", c)), + L.push(c); + let s = t.name; + const o = I(s), + l = n.insert("rect"), + h = n + .insert("g") + .attr("class", "branchLabel") + .insert("g") + .attr("class", "label branch-label" + i); + h.node().appendChild(o); + let m = o.getBBox(); + l + .attr("class", "branchLabelBkg label" + i) + .attr("rx", 4) + .attr("ry", 4) + .attr("x", -m.width - 4 - (!0 === r.rotateCommitLabel ? 30 : 0)) + .attr("y", -m.height / 2 + 8) + .attr("width", m.width + 18) + .attr("height", m.height + 4), + h.attr( + "transform", + "translate(" + (-m.width - 14 - (!0 === r.rotateCommitLabel ? 30 : 0)) + ", " + (c - m.height / 2 - 1) + ")", + ), + "TB" === A && + (l.attr("x", c - m.width / 2 - 10).attr("y", 0), h.attr("transform", "translate(" + (c - m.width / 2 - 5) + ", 0)")), + "TB" !== A && l.attr("transform", "translate(-19, " + (c - m.height / 2) + ")"); + }); + })(l, o), + ((t, e) => { + const r = t.append("g").attr("class", "commit-arrows"); + Object.keys(e).forEach((t) => { + const i = e[t]; + i.parents && + i.parents.length > 0 && + i.parents.forEach((t) => { + ((t, e, r, i) => { + const n = E[e.id], + c = E[r.id], + a = ((t, e, r) => + Object.keys(r).filter((i) => r[i].branch === e.branch && r[i].seq > t.seq && r[i].seq < e.seq).length > 0)(e, r, i); + let s, + o = "", + l = "", + h = 0, + m = 0, + u = T[r.branch].index; + if (a) { + (o = "A 10 10, 0, 0, 0,"), (l = "A 10 10, 0, 0, 1,"), (h = 10), (m = 10), (u = T[r.branch].index); + const t = n.y < c.y ? O(n.y, c.y) : O(c.y, n.y), + e = n.x < c.x ? O(n.x, c.x) : O(c.x, n.x); + s = + "TB" === A + ? n.x < c.x + ? `M ${n.x} ${n.y} L ${e - h} ${n.y} ${l} ${e} ${n.y + m} L ${e} ${c.y - h} ${o} ${e + m} ${c.y} L ${c.x} ${c.y}` + : `M ${n.x} ${n.y} L ${e + h} ${n.y} ${o} ${e} ${n.y + m} L ${e} ${c.y - h} ${l} ${e - m} ${c.y} L ${c.x} ${c.y}` + : n.y < c.y + ? `M ${n.x} ${n.y} L ${n.x} ${t - h} ${o} ${n.x + m} ${t} L ${c.x - h} ${t} ${l} ${c.x} ${t + m} L ${c.x} ${c.y}` + : `M ${n.x} ${n.y} L ${n.x} ${t + h} ${l} ${n.x + m} ${t} L ${c.x - h} ${t} ${o} ${c.x} ${t - m} L ${c.x} ${c.y}`; + } else + "TB" === A + ? (n.x < c.x && + ((o = "A 20 20, 0, 0, 0,"), + (l = "A 20 20, 0, 0, 1,"), + (h = 20), + (m = 20), + (u = T[r.branch].index), + (s = `M ${n.x} ${n.y} L ${c.x - h} ${n.y} ${l} ${c.x} ${n.y + m} L ${c.x} ${c.y}`)), + n.x > c.x && + ((o = "A 20 20, 0, 0, 0,"), + (l = "A 20 20, 0, 0, 1,"), + (h = 20), + (m = 20), + (u = T[e.branch].index), + (s = `M ${n.x} ${n.y} L ${n.x} ${c.y - h} ${l} ${n.x - m} ${c.y} L ${c.x} ${c.y}`)), + n.x === c.x && + ((u = T[e.branch].index), (s = `M ${n.x} ${n.y} L ${n.x + h} ${n.y} ${o} ${n.x + m} ${c.y + h} L ${c.x} ${c.y}`))) + : (n.y < c.y && + ((o = "A 20 20, 0, 0, 0,"), + (h = 20), + (m = 20), + (u = T[r.branch].index), + (s = `M ${n.x} ${n.y} L ${n.x} ${c.y - h} ${o} ${n.x + m} ${c.y} L ${c.x} ${c.y}`)), + n.y > c.y && + ((o = "A 20 20, 0, 0, 0,"), + (h = 20), + (m = 20), + (u = T[e.branch].index), + (s = `M ${n.x} ${n.y} L ${c.x - h} ${n.y} ${o} ${c.x} ${n.y - m} L ${c.x} ${c.y}`)), + n.y === c.y && + ((u = T[e.branch].index), (s = `M ${n.x} ${n.y} L ${n.x} ${c.y - h} ${o} ${n.x + m} ${c.y} L ${c.x} ${c.y}`))); + t.append("path") + .attr("d", s) + .attr("class", "arrow arrow" + (u % 8)); + })(r, e[t], i, e); + }); + }); + })(l, w), + R(l, w, !0), + i.u.insertTitle(l, "gitTitleText", s.titleTopMargin, c.db.getDiagramTitle()), + (0, i.A)(void 0, l, s.diagramPadding, s.useMaxWidth ?? a.useMaxWidth); + }, + }, + styles: (t) => + `\n .commit-id,\n .commit-msg,\n .branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n ${[0, 1, 2, 3, 4, 5, 6, 7].map((e) => `\n .branch-label${e} { fill: ${t["gitBranchLabel" + e]}; }\n .commit${e} { stroke: ${t["git" + e]}; fill: ${t["git" + e]}; }\n .commit-highlight${e} { stroke: ${t["gitInv" + e]}; fill: ${t["gitInv" + e]}; }\n .label${e} { fill: ${t["git" + e]}; }\n .arrow${e} { stroke: ${t["git" + e]}; }\n `).join("\n")}\n\n .branch {\n stroke-width: 1;\n stroke: ${t.lineColor};\n stroke-dasharray: 2;\n }\n .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}\n .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }\n .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}\n .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }\n .tag-hole { fill: ${t.textColor}; }\n\n .commit-merge {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n }\n .commit-reverse {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n stroke-width: 3;\n }\n .commit-highlight-outer {\n }\n .commit-highlight-inner {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n }\n\n .arrow { stroke-width: 8; stroke-linecap: round; fill: none}\n .gitTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n`, + }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/747-b55f0f97.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/747-b55f0f97.chunk.min.js new file mode 100644 index 000000000..1adafd0d2 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/747-b55f0f97.chunk.min.js @@ -0,0 +1,233 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [747], + { + 6747: function (e, t, l) { + l.d(t, { + diagram: function () { + return f; + }, + }); + var n = l(1423), + o = l(7274), + a = l(5625), + i = l(9339), + s = l(6476); + l(7484), l(7967), l(7856), l(3771), l(9368); + const d = (e) => i.e.sanitizeText(e, (0, i.c)()); + let r = { dividerMargin: 10, padding: 5, textHeight: 10, curve: void 0 }; + const c = function (e, t, l, n, o) { + const a = Object.keys(e); + i.l.info("keys:", a), + i.l.info(e), + a + .filter((t) => e[t].parent == o) + .forEach(function (l) { + var a, s; + const r = e[l], + c = r.cssClasses.join(" "), + p = r.label ?? r.id, + b = { + labelStyle: "", + shape: "class_box", + labelText: d(p), + classData: r, + rx: 0, + ry: 0, + class: c, + style: "", + id: r.id, + domId: r.domId, + tooltip: n.db.getTooltip(r.id, o) || "", + haveCallback: r.haveCallback, + link: r.link, + width: "group" === r.type ? 500 : void 0, + type: r.type, + padding: (null == (a = (0, i.c)().flowchart) ? void 0 : a.padding) ?? (null == (s = (0, i.c)().class) ? void 0 : s.padding), + }; + t.setNode(r.id, b), o && t.setParent(r.id, o), i.l.info("setNode", b); + }); + }; + function p(e) { + let t; + switch (e) { + case 0: + t = "aggregation"; + break; + case 1: + t = "extension"; + break; + case 2: + t = "composition"; + break; + case 3: + t = "dependency"; + break; + case 4: + t = "lollipop"; + break; + default: + t = "none"; + } + return t; + } + const b = { + setConf: function (e) { + r = { ...r, ...e }; + }, + draw: async function (e, t, l, n) { + i.l.info("Drawing class - ", t); + const b = (0, i.c)().flowchart ?? (0, i.c)().class, + f = (0, i.c)().securityLevel; + i.l.info("config:", b); + const u = (null == b ? void 0 : b.nodeSpacing) ?? 50, + g = (null == b ? void 0 : b.rankSpacing) ?? 50, + y = new a.k({ multigraph: !0, compound: !0 }) + .setGraph({ + rankdir: n.db.getDirection(), + nodesep: u, + ranksep: g, + marginx: 8, + marginy: 8, + }) + .setDefaultEdgeLabel(function () { + return {}; + }), + h = n.db.getNamespaces(), + v = n.db.getClasses(), + w = n.db.getRelations(), + k = n.db.getNotes(); + let x; + i.l.info(w), + (function (e, t, l, n) { + const o = Object.keys(e); + i.l.info("keys:", o), + i.l.info(e), + o.forEach(function (l) { + var o, a; + const s = e[l], + r = { + shape: "rect", + id: s.id, + domId: s.domId, + labelText: d(s.id), + labelStyle: "", + style: "fill: none; stroke: black", + padding: (null == (o = (0, i.c)().flowchart) ? void 0 : o.padding) ?? (null == (a = (0, i.c)().class) ? void 0 : a.padding), + }; + t.setNode(s.id, r), c(s.classes, t, 0, n, s.id), i.l.info("setNode", r); + }); + })(h, y, 0, n), + c(v, y, 0, n), + (function (e, t) { + const l = (0, i.c)().flowchart; + let n = 0; + e.forEach(function (e) { + var a; + n++; + const s = { + classes: "relation", + pattern: 1 == e.relation.lineType ? "dashed" : "solid", + id: "id" + n, + arrowhead: "arrow_open" === e.type ? "none" : "normal", + startLabelRight: "none" === e.relationTitle1 ? "" : e.relationTitle1, + endLabelLeft: "none" === e.relationTitle2 ? "" : e.relationTitle2, + arrowTypeStart: p(e.relation.type1), + arrowTypeEnd: p(e.relation.type2), + style: "fill:none", + labelStyle: "", + curve: (0, i.o)(null == l ? void 0 : l.curve, o.c_6), + }; + if ((i.l.info(s, e), void 0 !== e.style)) { + const t = (0, i.k)(e.style); + (s.style = t.style), (s.labelStyle = t.labelStyle); + } + (e.text = e.title), + void 0 === e.text + ? void 0 !== e.style && (s.arrowheadStyle = "fill: #333") + : ((s.arrowheadStyle = "fill: #333"), + (s.labelpos = "c"), + ((null == (a = (0, i.c)().flowchart) ? void 0 : a.htmlLabels) ?? (0, i.c)().htmlLabels) + ? ((s.labelType = "html"), (s.label = '' + e.text + "")) + : ((s.labelType = "text"), + (s.label = e.text.replace(i.e.lineBreakRegex, "\n")), + void 0 === e.style && (s.style = s.style || "stroke: #333; stroke-width: 1.5px;fill:none"), + (s.labelStyle = s.labelStyle.replace("color:", "fill:")))), + t.setEdge(e.id1, e.id2, s, n); + }); + })(w, y), + (function (e, t, l, n) { + i.l.info(e), + e.forEach(function (e, a) { + var s, c; + const p = e, + b = p.text, + f = { + labelStyle: "", + shape: "note", + labelText: d(b), + noteData: p, + rx: 0, + ry: 0, + class: "", + style: "", + id: p.id, + domId: p.id, + tooltip: "", + type: "note", + padding: (null == (s = (0, i.c)().flowchart) ? void 0 : s.padding) ?? (null == (c = (0, i.c)().class) ? void 0 : c.padding), + }; + if ((t.setNode(p.id, f), i.l.info("setNode", f), !p.class || !(p.class in n))) return; + const u = l + a, + g = { + id: `edgeNote${u}`, + classes: "relation", + pattern: "dotted", + arrowhead: "none", + startLabelRight: "", + endLabelLeft: "", + arrowTypeStart: "none", + arrowTypeEnd: "none", + style: "fill:none", + labelStyle: "", + curve: (0, i.o)(r.curve, o.c_6), + }; + t.setEdge(p.id, p.class, g, u); + }); + })(k, y, w.length + 1, v), + "sandbox" === f && (x = (0, o.Ys)("#i" + t)); + const m = "sandbox" === f ? (0, o.Ys)(x.nodes()[0].contentDocument.body) : (0, o.Ys)("body"), + T = m.select(`[id="${t}"]`), + S = m.select("#" + t + " g"); + if ( + (await (0, s.r)(S, y, ["aggregation", "extension", "composition", "dependency", "lollipop"], "classDiagram", t), + i.u.insertTitle(T, "classTitleText", (null == b ? void 0 : b.titleTopMargin) ?? 5, n.db.getDiagramTitle()), + (0, i.p)(y, T, null == b ? void 0 : b.diagramPadding, null == b ? void 0 : b.useMaxWidth), + !(null == b ? void 0 : b.htmlLabels)) + ) { + const e = "sandbox" === f ? x.nodes()[0].contentDocument : document, + l = e.querySelectorAll('[id="' + t + '"] .edgeLabel .label'); + for (const t of l) { + const l = t.getBBox(), + n = e.createElementNS("http://www.w3.org/2000/svg", "rect"); + n.setAttribute("rx", 0), + n.setAttribute("ry", 0), + n.setAttribute("width", l.width), + n.setAttribute("height", l.height), + t.insertBefore(n, t.firstChild); + } + } + }, + }, + f = { + parser: n.p, + db: n.d, + renderer: b, + styles: n.s, + init: (e) => { + e.class || (e.class = {}), (e.class.arrowMarkerAbsolute = e.arrowMarkerAbsolute), n.d.clear(); + }, + }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/76-732e78f1.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/76-732e78f1.chunk.min.js new file mode 100644 index 000000000..b8e9e3881 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/76-732e78f1.chunk.min.js @@ -0,0 +1,1824 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [76], + { + 6076: function (t, e, r) { + r.d(e, { + a: function () { + return o; + }, + b: function () { + return M; + }, + c: function () { + return d; + }, + d: function () { + return N; + }, + e: function () { + return T; + }, + f: function () { + return Y; + }, + g: function () { + return I; + }, + h: function () { + return H; + }, + i: function () { + return u; + }, + l: function () { + return c; + }, + p: function () { + return E; + }, + s: function () { + return B; + }, + u: function () { + return h; + }, + }); + var a = r(9339), + n = r(7274), + i = r(3506), + s = r(7863); + const l = { + extension: (t, e, r) => { + a.l.trace("Making markers for ", r), + t + .append("defs") + .append("marker") + .attr("id", e + "-extensionStart") + .attr("class", "marker extension " + e) + .attr("refX", 0) + .attr("refY", 7) + .attr("markerWidth", 190) + .attr("markerHeight", 240) + .attr("orient", "auto") + .append("path") + .attr("d", "M 1,7 L18,13 V 1 Z"), + t + .append("defs") + .append("marker") + .attr("id", e + "-extensionEnd") + .attr("class", "marker extension " + e) + .attr("refX", 19) + .attr("refY", 7) + .attr("markerWidth", 20) + .attr("markerHeight", 28) + .attr("orient", "auto") + .append("path") + .attr("d", "M 1,1 V 13 L18,7 Z"); + }, + composition: (t, e) => { + t + .append("defs") + .append("marker") + .attr("id", e + "-compositionStart") + .attr("class", "marker composition " + e) + .attr("refX", 0) + .attr("refY", 7) + .attr("markerWidth", 190) + .attr("markerHeight", 240) + .attr("orient", "auto") + .append("path") + .attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), + t + .append("defs") + .append("marker") + .attr("id", e + "-compositionEnd") + .attr("class", "marker composition " + e) + .attr("refX", 19) + .attr("refY", 7) + .attr("markerWidth", 20) + .attr("markerHeight", 28) + .attr("orient", "auto") + .append("path") + .attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); + }, + aggregation: (t, e) => { + t + .append("defs") + .append("marker") + .attr("id", e + "-aggregationStart") + .attr("class", "marker aggregation " + e) + .attr("refX", 0) + .attr("refY", 7) + .attr("markerWidth", 190) + .attr("markerHeight", 240) + .attr("orient", "auto") + .append("path") + .attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), + t + .append("defs") + .append("marker") + .attr("id", e + "-aggregationEnd") + .attr("class", "marker aggregation " + e) + .attr("refX", 19) + .attr("refY", 7) + .attr("markerWidth", 20) + .attr("markerHeight", 28) + .attr("orient", "auto") + .append("path") + .attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); + }, + dependency: (t, e) => { + t + .append("defs") + .append("marker") + .attr("id", e + "-dependencyStart") + .attr("class", "marker dependency " + e) + .attr("refX", 0) + .attr("refY", 7) + .attr("markerWidth", 190) + .attr("markerHeight", 240) + .attr("orient", "auto") + .append("path") + .attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), + t + .append("defs") + .append("marker") + .attr("id", e + "-dependencyEnd") + .attr("class", "marker dependency " + e) + .attr("refX", 19) + .attr("refY", 7) + .attr("markerWidth", 20) + .attr("markerHeight", 28) + .attr("orient", "auto") + .append("path") + .attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); + }, + lollipop: (t, e) => { + t.append("defs") + .append("marker") + .attr("id", e + "-lollipopStart") + .attr("class", "marker lollipop " + e) + .attr("refX", 0) + .attr("refY", 7) + .attr("markerWidth", 190) + .attr("markerHeight", 240) + .attr("orient", "auto") + .append("circle") + .attr("stroke", "black") + .attr("fill", "white") + .attr("cx", 6) + .attr("cy", 7) + .attr("r", 6); + }, + point: (t, e) => { + t + .append("marker") + .attr("id", e + "-pointEnd") + .attr("class", "marker " + e) + .attr("viewBox", "0 0 10 10") + .attr("refX", 10) + .attr("refY", 5) + .attr("markerUnits", "userSpaceOnUse") + .attr("markerWidth", 12) + .attr("markerHeight", 12) + .attr("orient", "auto") + .append("path") + .attr("d", "M 0 0 L 10 5 L 0 10 z") + .attr("class", "arrowMarkerPath") + .style("stroke-width", 1) + .style("stroke-dasharray", "1,0"), + t + .append("marker") + .attr("id", e + "-pointStart") + .attr("class", "marker " + e) + .attr("viewBox", "0 0 10 10") + .attr("refX", 0) + .attr("refY", 5) + .attr("markerUnits", "userSpaceOnUse") + .attr("markerWidth", 12) + .attr("markerHeight", 12) + .attr("orient", "auto") + .append("path") + .attr("d", "M 0 5 L 10 10 L 10 0 z") + .attr("class", "arrowMarkerPath") + .style("stroke-width", 1) + .style("stroke-dasharray", "1,0"); + }, + circle: (t, e) => { + t + .append("marker") + .attr("id", e + "-circleEnd") + .attr("class", "marker " + e) + .attr("viewBox", "0 0 10 10") + .attr("refX", 11) + .attr("refY", 5) + .attr("markerUnits", "userSpaceOnUse") + .attr("markerWidth", 11) + .attr("markerHeight", 11) + .attr("orient", "auto") + .append("circle") + .attr("cx", "5") + .attr("cy", "5") + .attr("r", "5") + .attr("class", "arrowMarkerPath") + .style("stroke-width", 1) + .style("stroke-dasharray", "1,0"), + t + .append("marker") + .attr("id", e + "-circleStart") + .attr("class", "marker " + e) + .attr("viewBox", "0 0 10 10") + .attr("refX", -1) + .attr("refY", 5) + .attr("markerUnits", "userSpaceOnUse") + .attr("markerWidth", 11) + .attr("markerHeight", 11) + .attr("orient", "auto") + .append("circle") + .attr("cx", "5") + .attr("cy", "5") + .attr("r", "5") + .attr("class", "arrowMarkerPath") + .style("stroke-width", 1) + .style("stroke-dasharray", "1,0"); + }, + cross: (t, e) => { + t + .append("marker") + .attr("id", e + "-crossEnd") + .attr("class", "marker cross " + e) + .attr("viewBox", "0 0 11 11") + .attr("refX", 12) + .attr("refY", 5.2) + .attr("markerUnits", "userSpaceOnUse") + .attr("markerWidth", 11) + .attr("markerHeight", 11) + .attr("orient", "auto") + .append("path") + .attr("d", "M 1,1 l 9,9 M 10,1 l -9,9") + .attr("class", "arrowMarkerPath") + .style("stroke-width", 2) + .style("stroke-dasharray", "1,0"), + t + .append("marker") + .attr("id", e + "-crossStart") + .attr("class", "marker cross " + e) + .attr("viewBox", "0 0 11 11") + .attr("refX", -1) + .attr("refY", 5.2) + .attr("markerUnits", "userSpaceOnUse") + .attr("markerWidth", 11) + .attr("markerHeight", 11) + .attr("orient", "auto") + .append("path") + .attr("d", "M 1,1 l 9,9 M 10,1 l -9,9") + .attr("class", "arrowMarkerPath") + .style("stroke-width", 2) + .style("stroke-dasharray", "1,0"); + }, + barb: (t, e) => { + t.append("defs") + .append("marker") + .attr("id", e + "-barbEnd") + .attr("refX", 19) + .attr("refY", 7) + .attr("markerWidth", 20) + .attr("markerHeight", 14) + .attr("markerUnits", "strokeWidth") + .attr("orient", "auto") + .append("path") + .attr("d", "M 19,7 L9,13 L14,7 L9,1 Z"); + }, + }, + o = (t, e, r, a) => { + e.forEach((e) => { + l[e](t, r, a); + }); + }, + d = (t, e, r, i) => { + let s = t || ""; + if (("object" == typeof s && (s = s[0]), (0, a.n)((0, a.c)().flowchart.htmlLabels))) { + return ( + (s = s.replace(/\\n|\n/g, "
    ")), + a.l.info("vertexText" + s), + (function (t) { + const e = (0, n.Ys)(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")), + r = e.append("xhtml:div"), + a = t.label, + i = t.isNode ? "nodeLabel" : "edgeLabel"; + var s; + return ( + r.html('" + a + ""), + (s = t.labelStyle) && r.attr("style", s), + r.style("display", "inline-block"), + r.style("white-space", "nowrap"), + r.attr("xmlns", "http://www.w3.org/1999/xhtml"), + e.node() + ); + })({ + isNode: i, + label: (0, a.L)(s).replace(/fa[blrs]?:fa-[\w-]+/g, (t) => ``), + labelStyle: e.replace("fill:", "color:"), + }) + ); + } + { + const t = document.createElementNS("http://www.w3.org/2000/svg", "text"); + t.setAttribute("style", e.replace("color:", "fill:")); + let a = []; + a = "string" == typeof s ? s.split(/\\n|\n|/gi) : Array.isArray(s) ? s : []; + for (const e of a) { + const a = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + a.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), + a.setAttribute("dy", "1em"), + a.setAttribute("x", "0"), + r ? a.setAttribute("class", "title-row") : a.setAttribute("class", "row"), + (a.textContent = e.trim()), + t.appendChild(a); + } + return t; + } + }, + c = async (t, e, r, s) => { + let l; + const o = e.useHtmlLabels || (0, a.n)((0, a.c)().flowchart.htmlLabels); + l = r || "node default"; + const c = t + .insert("g") + .attr("class", l) + .attr("id", e.domId || e.id), + h = c.insert("g").attr("class", "label").attr("style", e.labelStyle); + let p; + p = void 0 === e.labelText ? "" : "string" == typeof e.labelText ? e.labelText : e.labelText[0]; + const g = h.node(); + let y; + y = + "markdown" === e.labelType + ? (0, i.c)(h, (0, a.d)((0, a.L)(p), (0, a.c)()), { + useHtmlLabels: o, + width: e.width || (0, a.c)().flowchart.wrappingWidth, + classes: "markdown-node-label", + }) + : g.appendChild(d((0, a.d)((0, a.L)(p), (0, a.c)()), e.labelStyle, !1, s)); + let f = y.getBBox(); + const u = e.padding / 2; + if ((0, a.n)((0, a.c)().flowchart.htmlLabels)) { + const t = y.children[0], + e = (0, n.Ys)(y), + r = t.getElementsByTagName("img"); + if (r) { + const t = "" === p.replace(/]*>/g, "").trim(); + await Promise.all( + [...r].map( + (e) => + new Promise((r) => { + function n() { + if (((e.style.display = "flex"), (e.style.flexDirection = "column"), t)) { + const t = (0, a.c)().fontSize ? (0, a.c)().fontSize : window.getComputedStyle(document.body).fontSize, + r = 5; + e.style.width = parseInt(t, 10) * r + "px"; + } else e.style.width = "100%"; + r(e); + } + setTimeout(() => { + e.complete && n(); + }), + e.addEventListener("error", n), + e.addEventListener("load", n); + }), + ), + ); + } + (f = t.getBoundingClientRect()), e.attr("width", f.width), e.attr("height", f.height); + } + return ( + o + ? h.attr("transform", "translate(" + -f.width / 2 + ", " + -f.height / 2 + ")") + : h.attr("transform", "translate(0, " + -f.height / 2 + ")"), + e.centerLabel && h.attr("transform", "translate(" + -f.width / 2 + ", " + -f.height / 2 + ")"), + h.insert("rect", ":first-child"), + { shapeSvg: c, bbox: f, halfPadding: u, label: h } + ); + }, + h = (t, e) => { + const r = e.node().getBBox(); + (t.width = r.width), (t.height = r.height); + }; + function p(t, e, r, a) { + return t + .insert("polygon", ":first-child") + .attr( + "points", + a + .map(function (t) { + return t.x + "," + t.y; + }) + .join(" "), + ) + .attr("class", "label-container") + .attr("transform", "translate(" + -e / 2 + "," + r / 2 + ")"); + } + function g(t, e, r, a) { + var n = t.x, + i = t.y, + s = n - a.x, + l = i - a.y, + o = Math.sqrt(e * e * l * l + r * r * s * s), + d = Math.abs((e * r * s) / o); + a.x < n && (d = -d); + var c = Math.abs((e * r * l) / o); + return a.y < i && (c = -c), { x: n + d, y: i + c }; + } + function y(t, e, r, a) { + var n, i, s, l, o, d, c, h, p, g, y, u, x; + if ( + ((n = e.y - t.y), + (s = t.x - e.x), + (o = e.x * t.y - t.x * e.y), + (p = n * r.x + s * r.y + o), + (g = n * a.x + s * a.y + o), + !( + (0 !== p && 0 !== g && f(p, g)) || + ((i = a.y - r.y), + (l = r.x - a.x), + (d = a.x * r.y - r.x * a.y), + (c = i * t.x + l * t.y + d), + (h = i * e.x + l * e.y + d), + (0 !== c && 0 !== h && f(c, h)) || 0 == (y = n * l - i * s)) + )) + ) + return ( + (u = Math.abs(y / 2)), + { + x: (x = s * d - l * o) < 0 ? (x - u) / y : (x + u) / y, + y: (x = i * o - n * d) < 0 ? (x - u) / y : (x + u) / y, + } + ); + } + function f(t, e) { + return t * e > 0; + } + const u = (t, e) => { + var r, + a, + n = t.x, + i = t.y, + s = e.x - n, + l = e.y - i, + o = t.width / 2, + d = t.height / 2; + return ( + Math.abs(l) * o > Math.abs(s) * d + ? (l < 0 && (d = -d), (r = 0 === l ? 0 : (d * s) / l), (a = d)) + : (s < 0 && (o = -o), (r = o), (a = 0 === s ? 0 : (o * l) / s)), + { x: n + r, y: i + a } + ); + }, + x = { + node: function (t, e) { + return t.intersect(e); + }, + circle: function (t, e, r) { + return g(t, e, e, r); + }, + ellipse: g, + polygon: function (t, e, r) { + var a = t.x, + n = t.y, + i = [], + s = Number.POSITIVE_INFINITY, + l = Number.POSITIVE_INFINITY; + "function" == typeof e.forEach + ? e.forEach(function (t) { + (s = Math.min(s, t.x)), (l = Math.min(l, t.y)); + }) + : ((s = Math.min(s, e.x)), (l = Math.min(l, e.y))); + for (var o = a - t.width / 2 - s, d = n - t.height / 2 - l, c = 0; c < e.length; c++) { + var h = e[c], + p = e[c < e.length - 1 ? c + 1 : 0], + g = y(t, r, { x: o + h.x, y: d + h.y }, { x: o + p.x, y: d + p.y }); + g && i.push(g); + } + return i.length + ? (i.length > 1 && + i.sort(function (t, e) { + var a = t.x - r.x, + n = t.y - r.y, + i = Math.sqrt(a * a + n * n), + s = e.x - r.x, + l = e.y - r.y, + o = Math.sqrt(s * s + l * l); + return i < o ? -1 : i === o ? 0 : 1; + }), + i[0]) + : t; + }, + rect: u, + }, + b = (t) => (t ? " " + t : ""), + w = (t, e) => `${e || "node default"}${b(t.classes)} ${b(t.class)}`, + m = async (t, e) => { + const { shapeSvg: r, bbox: n } = await c(t, e, w(e, void 0), !0), + i = n.width + e.padding + (n.height + e.padding), + s = [ + { x: i / 2, y: 0 }, + { x: i, y: -i / 2 }, + { x: i / 2, y: -i }, + { x: 0, y: -i / 2 }, + ]; + a.l.info("Question main (Circle)"); + const l = p(r, i, i, s); + return ( + l.attr("style", e.style), + h(e, l), + (e.intersect = function (t) { + return a.l.warn("Intersect called"), x.polygon(e, s, t); + }), + r + ); + }; + function k(t, e, r, n) { + const i = [], + s = (t) => { + i.push(t, 0); + }, + l = (t) => { + i.push(0, t); + }; + e.includes("t") ? (a.l.debug("add top border"), s(r)) : l(r), + e.includes("r") ? (a.l.debug("add right border"), s(n)) : l(n), + e.includes("b") ? (a.l.debug("add bottom border"), s(r)) : l(r), + e.includes("l") ? (a.l.debug("add left border"), s(n)) : l(n), + t.attr("stroke-dasharray", i.join(" ")); + } + const L = (t, e, r) => { + const a = t + .insert("g") + .attr("class", "node default") + .attr("id", e.domId || e.id); + let n = 70, + i = 10; + "LR" === r && ((n = 10), (i = 70)); + const s = a + .append("rect") + .attr("x", (-1 * n) / 2) + .attr("y", (-1 * i) / 2) + .attr("width", n) + .attr("height", i) + .attr("class", "fork-join"); + return ( + h(e, s), + (e.height = e.height + e.padding / 2), + (e.width = e.width + e.padding / 2), + (e.intersect = function (t) { + return x.rect(e, t); + }), + a + ); + }, + v = { + rhombus: m, + question: m, + rect: async (t, e) => { + const { shapeSvg: r, bbox: n, halfPadding: i } = await c(t, e, "node " + e.classes + " " + e.class, !0), + s = r.insert("rect", ":first-child"), + l = n.width + e.padding, + o = n.height + e.padding; + if ( + (s + .attr("class", "basic label-container") + .attr("style", e.style) + .attr("rx", e.rx) + .attr("ry", e.ry) + .attr("x", -n.width / 2 - i) + .attr("y", -n.height / 2 - i) + .attr("width", l) + .attr("height", o), + e.props) + ) { + const t = new Set(Object.keys(e.props)); + e.props.borders && (k(s, e.props.borders, l, o), t.delete("borders")), + t.forEach((t) => { + a.l.warn(`Unknown node property ${t}`); + }); + } + return ( + h(e, s), + (e.intersect = function (t) { + return x.rect(e, t); + }), + r + ); + }, + labelRect: async (t, e) => { + const { shapeSvg: r } = await c(t, e, "label", !0); + a.l.trace("Classes = ", e.class); + const n = r.insert("rect", ":first-child"); + if ((n.attr("width", 0).attr("height", 0), r.attr("class", "label edgeLabel"), e.props)) { + const t = new Set(Object.keys(e.props)); + e.props.borders && (k(n, e.props.borders, 0, 0), t.delete("borders")), + t.forEach((t) => { + a.l.warn(`Unknown node property ${t}`); + }); + } + return ( + h(e, n), + (e.intersect = function (t) { + return x.rect(e, t); + }), + r + ); + }, + rectWithTitle: (t, e) => { + let r; + r = e.classes ? "node " + e.classes : "node default"; + const i = t + .insert("g") + .attr("class", r) + .attr("id", e.domId || e.id), + s = i.insert("rect", ":first-child"), + l = i.insert("line"), + o = i.insert("g").attr("class", "label"), + c = e.labelText.flat ? e.labelText.flat() : e.labelText; + let p = ""; + (p = "object" == typeof c ? c[0] : c), a.l.info("Label text abc79", p, c, "object" == typeof c); + const g = o.node().appendChild(d(p, e.labelStyle, !0, !0)); + let y = { width: 0, height: 0 }; + if ((0, a.n)((0, a.c)().flowchart.htmlLabels)) { + const t = g.children[0], + e = (0, n.Ys)(g); + (y = t.getBoundingClientRect()), e.attr("width", y.width), e.attr("height", y.height); + } + a.l.info("Text 2", c); + const f = c.slice(1, c.length); + let u = g.getBBox(); + const b = o.node().appendChild(d(f.join ? f.join("
    ") : f, e.labelStyle, !0, !0)); + if ((0, a.n)((0, a.c)().flowchart.htmlLabels)) { + const t = b.children[0], + e = (0, n.Ys)(b); + (y = t.getBoundingClientRect()), e.attr("width", y.width), e.attr("height", y.height); + } + const w = e.padding / 2; + return ( + (0, n.Ys)(b).attr("transform", "translate( " + (y.width > u.width ? 0 : (u.width - y.width) / 2) + ", " + (u.height + w + 5) + ")"), + (0, n.Ys)(g).attr("transform", "translate( " + (y.width < u.width ? 0 : -(u.width - y.width) / 2) + ", 0)"), + (y = o.node().getBBox()), + o.attr("transform", "translate(" + -y.width / 2 + ", " + (-y.height / 2 - w + 3) + ")"), + s + .attr("class", "outer title-state") + .attr("x", -y.width / 2 - w) + .attr("y", -y.height / 2 - w) + .attr("width", y.width + e.padding) + .attr("height", y.height + e.padding), + l + .attr("class", "divider") + .attr("x1", -y.width / 2 - w) + .attr("x2", y.width / 2 + w) + .attr("y1", -y.height / 2 - w + u.height + w) + .attr("y2", -y.height / 2 - w + u.height + w), + h(e, s), + (e.intersect = function (t) { + return x.rect(e, t); + }), + i + ); + }, + choice: (t, e) => { + const r = t + .insert("g") + .attr("class", "node default") + .attr("id", e.domId || e.id); + return ( + r + .insert("polygon", ":first-child") + .attr( + "points", + [ + { x: 0, y: 14 }, + { x: 14, y: 0 }, + { x: 0, y: -14 }, + { x: -14, y: 0 }, + ] + .map(function (t) { + return t.x + "," + t.y; + }) + .join(" "), + ) + .attr("class", "state-start") + .attr("r", 7) + .attr("width", 28) + .attr("height", 28), + (e.width = 28), + (e.height = 28), + (e.intersect = function (t) { + return x.circle(e, 14, t); + }), + r + ); + }, + circle: async (t, e) => { + const { shapeSvg: r, bbox: n, halfPadding: i } = await c(t, e, w(e, void 0), !0), + s = r.insert("circle", ":first-child"); + return ( + s + .attr("style", e.style) + .attr("rx", e.rx) + .attr("ry", e.ry) + .attr("r", n.width / 2 + i) + .attr("width", n.width + e.padding) + .attr("height", n.height + e.padding), + a.l.info("Circle main"), + h(e, s), + (e.intersect = function (t) { + return a.l.info("Circle intersect", e, n.width / 2 + i, t), x.circle(e, n.width / 2 + i, t); + }), + r + ); + }, + doublecircle: async (t, e) => { + const { shapeSvg: r, bbox: n, halfPadding: i } = await c(t, e, w(e, void 0), !0), + s = r.insert("g", ":first-child"), + l = s.insert("circle"), + o = s.insert("circle"); + return ( + s.attr("class", e.class), + l + .attr("style", e.style) + .attr("rx", e.rx) + .attr("ry", e.ry) + .attr("r", n.width / 2 + i + 5) + .attr("width", n.width + e.padding + 10) + .attr("height", n.height + e.padding + 10), + o + .attr("style", e.style) + .attr("rx", e.rx) + .attr("ry", e.ry) + .attr("r", n.width / 2 + i) + .attr("width", n.width + e.padding) + .attr("height", n.height + e.padding), + a.l.info("DoubleCircle main"), + h(e, l), + (e.intersect = function (t) { + return a.l.info("DoubleCircle intersect", e, n.width / 2 + i + 5, t), x.circle(e, n.width / 2 + i + 5, t); + }), + r + ); + }, + stadium: async (t, e) => { + const { shapeSvg: r, bbox: a } = await c(t, e, w(e, void 0), !0), + n = a.height + e.padding, + i = a.width + n / 4 + e.padding, + s = r + .insert("rect", ":first-child") + .attr("style", e.style) + .attr("rx", n / 2) + .attr("ry", n / 2) + .attr("x", -i / 2) + .attr("y", -n / 2) + .attr("width", i) + .attr("height", n); + return ( + h(e, s), + (e.intersect = function (t) { + return x.rect(e, t); + }), + r + ); + }, + hexagon: async (t, e) => { + const { shapeSvg: r, bbox: a } = await c(t, e, w(e, void 0), !0), + n = a.height + e.padding, + i = n / 4, + s = a.width + 2 * i + e.padding, + l = [ + { x: i, y: 0 }, + { x: s - i, y: 0 }, + { x: s, y: -n / 2 }, + { x: s - i, y: -n }, + { x: i, y: -n }, + { x: 0, y: -n / 2 }, + ], + o = p(r, s, n, l); + return ( + o.attr("style", e.style), + h(e, o), + (e.intersect = function (t) { + return x.polygon(e, l, t); + }), + r + ); + }, + rect_left_inv_arrow: async (t, e) => { + const { shapeSvg: r, bbox: a } = await c(t, e, w(e, void 0), !0), + n = a.width + e.padding, + i = a.height + e.padding, + s = [ + { x: -i / 2, y: 0 }, + { x: n, y: 0 }, + { x: n, y: -i }, + { x: -i / 2, y: -i }, + { x: 0, y: -i / 2 }, + ]; + return ( + p(r, n, i, s).attr("style", e.style), + (e.width = n + i), + (e.height = i), + (e.intersect = function (t) { + return x.polygon(e, s, t); + }), + r + ); + }, + lean_right: async (t, e) => { + const { shapeSvg: r, bbox: a } = await c(t, e, w(e), !0), + n = a.width + e.padding, + i = a.height + e.padding, + s = [ + { x: (-2 * i) / 6, y: 0 }, + { x: n - i / 6, y: 0 }, + { x: n + (2 * i) / 6, y: -i }, + { x: i / 6, y: -i }, + ], + l = p(r, n, i, s); + return ( + l.attr("style", e.style), + h(e, l), + (e.intersect = function (t) { + return x.polygon(e, s, t); + }), + r + ); + }, + lean_left: async (t, e) => { + const { shapeSvg: r, bbox: a } = await c(t, e, w(e, void 0), !0), + n = a.width + e.padding, + i = a.height + e.padding, + s = [ + { x: (2 * i) / 6, y: 0 }, + { x: n + i / 6, y: 0 }, + { x: n - (2 * i) / 6, y: -i }, + { x: -i / 6, y: -i }, + ], + l = p(r, n, i, s); + return ( + l.attr("style", e.style), + h(e, l), + (e.intersect = function (t) { + return x.polygon(e, s, t); + }), + r + ); + }, + trapezoid: async (t, e) => { + const { shapeSvg: r, bbox: a } = await c(t, e, w(e, void 0), !0), + n = a.width + e.padding, + i = a.height + e.padding, + s = [ + { x: (-2 * i) / 6, y: 0 }, + { x: n + (2 * i) / 6, y: 0 }, + { x: n - i / 6, y: -i }, + { x: i / 6, y: -i }, + ], + l = p(r, n, i, s); + return ( + l.attr("style", e.style), + h(e, l), + (e.intersect = function (t) { + return x.polygon(e, s, t); + }), + r + ); + }, + inv_trapezoid: async (t, e) => { + const { shapeSvg: r, bbox: a } = await c(t, e, w(e, void 0), !0), + n = a.width + e.padding, + i = a.height + e.padding, + s = [ + { x: i / 6, y: 0 }, + { x: n - i / 6, y: 0 }, + { x: n + (2 * i) / 6, y: -i }, + { x: (-2 * i) / 6, y: -i }, + ], + l = p(r, n, i, s); + return ( + l.attr("style", e.style), + h(e, l), + (e.intersect = function (t) { + return x.polygon(e, s, t); + }), + r + ); + }, + rect_right_inv_arrow: async (t, e) => { + const { shapeSvg: r, bbox: a } = await c(t, e, w(e, void 0), !0), + n = a.width + e.padding, + i = a.height + e.padding, + s = [ + { x: 0, y: 0 }, + { x: n + i / 2, y: 0 }, + { x: n, y: -i / 2 }, + { x: n + i / 2, y: -i }, + { x: 0, y: -i }, + ], + l = p(r, n, i, s); + return ( + l.attr("style", e.style), + h(e, l), + (e.intersect = function (t) { + return x.polygon(e, s, t); + }), + r + ); + }, + cylinder: async (t, e) => { + const { shapeSvg: r, bbox: a } = await c(t, e, w(e, void 0), !0), + n = a.width + e.padding, + i = n / 2, + s = i / (2.5 + n / 50), + l = a.height + s + e.padding, + o = + "M 0," + + s + + " a " + + i + + "," + + s + + " 0,0,0 " + + n + + " 0 a " + + i + + "," + + s + + " 0,0,0 " + + -n + + " 0 l 0," + + l + + " a " + + i + + "," + + s + + " 0,0,0 " + + n + + " 0 l 0," + + -l, + d = r + .attr("label-offset-y", s) + .insert("path", ":first-child") + .attr("style", e.style) + .attr("d", o) + .attr("transform", "translate(" + -n / 2 + "," + -(l / 2 + s) + ")"); + return ( + h(e, d), + (e.intersect = function (t) { + const r = x.rect(e, t), + a = r.x - e.x; + if (0 != i && (Math.abs(a) < e.width / 2 || (Math.abs(a) == e.width / 2 && Math.abs(r.y - e.y) > e.height / 2 - s))) { + let n = s * s * (1 - (a * a) / (i * i)); + 0 != n && (n = Math.sqrt(n)), (n = s - n), t.y - e.y > 0 && (n = -n), (r.y += n); + } + return r; + }), + r + ); + }, + start: (t, e) => { + const r = t + .insert("g") + .attr("class", "node default") + .attr("id", e.domId || e.id), + a = r.insert("circle", ":first-child"); + return ( + a.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), + h(e, a), + (e.intersect = function (t) { + return x.circle(e, 7, t); + }), + r + ); + }, + end: (t, e) => { + const r = t + .insert("g") + .attr("class", "node default") + .attr("id", e.domId || e.id), + a = r.insert("circle", ":first-child"), + n = r.insert("circle", ":first-child"); + return ( + n.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), + a.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), + h(e, n), + (e.intersect = function (t) { + return x.circle(e, 7, t); + }), + r + ); + }, + note: async (t, e) => { + e.useHtmlLabels || (0, a.c)().flowchart.htmlLabels || (e.centerLabel = !0); + const { shapeSvg: r, bbox: n, halfPadding: i } = await c(t, e, "node " + e.classes, !0); + a.l.info("Classes = ", e.classes); + const s = r.insert("rect", ":first-child"); + return ( + s + .attr("rx", e.rx) + .attr("ry", e.ry) + .attr("x", -n.width / 2 - i) + .attr("y", -n.height / 2 - i) + .attr("width", n.width + e.padding) + .attr("height", n.height + e.padding), + h(e, s), + (e.intersect = function (t) { + return x.rect(e, t); + }), + r + ); + }, + subroutine: async (t, e) => { + const { shapeSvg: r, bbox: a } = await c(t, e, w(e, void 0), !0), + n = a.width + e.padding, + i = a.height + e.padding, + s = [ + { x: 0, y: 0 }, + { x: n, y: 0 }, + { x: n, y: -i }, + { x: 0, y: -i }, + { x: 0, y: 0 }, + { x: -8, y: 0 }, + { x: n + 8, y: 0 }, + { x: n + 8, y: -i }, + { x: -8, y: -i }, + { x: -8, y: 0 }, + ], + l = p(r, n, i, s); + return ( + l.attr("style", e.style), + h(e, l), + (e.intersect = function (t) { + return x.polygon(e, s, t); + }), + r + ); + }, + fork: L, + join: L, + class_box: (t, e) => { + const r = e.padding / 2; + let i; + i = e.classes ? "node " + e.classes : "node default"; + const l = t + .insert("g") + .attr("class", i) + .attr("id", e.domId || e.id), + o = l.insert("rect", ":first-child"), + c = l.insert("line"), + p = l.insert("line"); + let g = 0, + y = 4; + const f = l.insert("g").attr("class", "label"); + let u = 0; + const b = e.classData.annotations && e.classData.annotations[0], + w = e.classData.annotations[0] ? "«" + e.classData.annotations[0] + "»" : "", + m = f.node().appendChild(d(w, e.labelStyle, !0, !0)); + let k = m.getBBox(); + if ((0, a.n)((0, a.c)().flowchart.htmlLabels)) { + const t = m.children[0], + e = (0, n.Ys)(m); + (k = t.getBoundingClientRect()), e.attr("width", k.width), e.attr("height", k.height); + } + e.classData.annotations[0] && ((y += k.height + 4), (g += k.width)); + let L = e.classData.label; + void 0 !== e.classData.type && + "" !== e.classData.type && + ((0, a.c)().flowchart.htmlLabels ? (L += "<" + e.classData.type + ">") : (L += "<" + e.classData.type + ">")); + const v = f.node().appendChild(d(L, e.labelStyle, !0, !0)); + (0, n.Ys)(v).attr("class", "classTitle"); + let S = v.getBBox(); + if ((0, a.n)((0, a.c)().flowchart.htmlLabels)) { + const t = v.children[0], + e = (0, n.Ys)(v); + (S = t.getBoundingClientRect()), e.attr("width", S.width), e.attr("height", S.height); + } + (y += S.height + 4), S.width > g && (g = S.width); + const T = []; + e.classData.members.forEach((t) => { + const r = (0, s.p)(t); + let i = r.displayText; + (0, a.c)().flowchart.htmlLabels && (i = i.replace(//g, ">")); + const l = f.node().appendChild(d(i, r.cssStyle ? r.cssStyle : e.labelStyle, !0, !0)); + let o = l.getBBox(); + if ((0, a.n)((0, a.c)().flowchart.htmlLabels)) { + const t = l.children[0], + e = (0, n.Ys)(l); + (o = t.getBoundingClientRect()), e.attr("width", o.width), e.attr("height", o.height); + } + o.width > g && (g = o.width), (y += o.height + 4), T.push(l); + }), + (y += 8); + const B = []; + if ( + (e.classData.methods.forEach((t) => { + const r = (0, s.p)(t); + let i = r.displayText; + (0, a.c)().flowchart.htmlLabels && (i = i.replace(//g, ">")); + const l = f.node().appendChild(d(i, r.cssStyle ? r.cssStyle : e.labelStyle, !0, !0)); + let o = l.getBBox(); + if ((0, a.n)((0, a.c)().flowchart.htmlLabels)) { + const t = l.children[0], + e = (0, n.Ys)(l); + (o = t.getBoundingClientRect()), e.attr("width", o.width), e.attr("height", o.height); + } + o.width > g && (g = o.width), (y += o.height + 4), B.push(l); + }), + (y += 8), + b) + ) { + let t = (g - k.width) / 2; + (0, n.Ys)(m).attr("transform", "translate( " + ((-1 * g) / 2 + t) + ", " + (-1 * y) / 2 + ")"), (u = k.height + 4); + } + let M = (g - S.width) / 2; + return ( + (0, n.Ys)(v).attr("transform", "translate( " + ((-1 * g) / 2 + M) + ", " + ((-1 * y) / 2 + u) + ")"), + (u += S.height + 4), + c + .attr("class", "divider") + .attr("x1", -g / 2 - r) + .attr("x2", g / 2 + r) + .attr("y1", -y / 2 - r + 8 + u) + .attr("y2", -y / 2 - r + 8 + u), + (u += 8), + T.forEach((t) => { + (0, n.Ys)(t).attr("transform", "translate( " + -g / 2 + ", " + ((-1 * y) / 2 + u + 4) + ")"); + const e = null == t ? void 0 : t.getBBox(); + u += ((null == e ? void 0 : e.height) ?? 0) + 4; + }), + (u += 8), + p + .attr("class", "divider") + .attr("x1", -g / 2 - r) + .attr("x2", g / 2 + r) + .attr("y1", -y / 2 - r + 8 + u) + .attr("y2", -y / 2 - r + 8 + u), + (u += 8), + B.forEach((t) => { + (0, n.Ys)(t).attr("transform", "translate( " + -g / 2 + ", " + ((-1 * y) / 2 + u) + ")"); + const e = null == t ? void 0 : t.getBBox(); + u += ((null == e ? void 0 : e.height) ?? 0) + 4; + }), + o + .attr("class", "outer title-state") + .attr("x", -g / 2 - r) + .attr("y", -y / 2 - r) + .attr("width", g + e.padding) + .attr("height", y + e.padding), + h(e, o), + (e.intersect = function (t) { + return x.rect(e, t); + }), + l + ); + }, + }; + let S = {}; + const T = async (t, e, r) => { + let n, i; + if (e.link) { + let s; + "sandbox" === (0, a.c)().securityLevel ? (s = "_top") : e.linkTarget && (s = e.linkTarget || "_blank"), + (n = t.insert("svg:a").attr("xlink:href", e.link).attr("target", s)), + (i = await v[e.shape](n, e, r)); + } else (i = await v[e.shape](t, e, r)), (n = i); + return ( + e.tooltip && i.attr("title", e.tooltip), + e.class && i.attr("class", "node default " + e.class), + (S[e.id] = n), + e.haveCallback && S[e.id].attr("class", S[e.id].attr("class") + " clickable"), + n + ); + }, + B = (t, e) => { + S[e.id] = t; + }, + M = () => { + S = {}; + }, + E = (t) => { + const e = S[t.id]; + a.l.trace("Transforming node", t.diff, t, "translate(" + (t.x - t.width / 2 - 5) + ", " + t.width / 2 + ")"); + const r = t.diff || 0; + return ( + t.clusterNode + ? e.attr("transform", "translate(" + (t.x + r - t.width / 2) + ", " + (t.y - t.height / 2 - 8) + ")") + : e.attr("transform", "translate(" + t.x + ", " + t.y + ")"), + r + ); + }; + let C = {}, + P = {}; + const N = () => { + (C = {}), (P = {}); + }, + Y = (t, e) => { + const r = (0, a.n)((0, a.c)().flowchart.htmlLabels), + s = + "markdown" === e.labelType + ? (0, i.c)(t, e.label, { + style: e.labelStyle, + useHtmlLabels: r, + addSvgBackground: !0, + }) + : d(e.label, e.labelStyle); + a.l.info("abc82", e, e.labelType); + const l = t.insert("g").attr("class", "edgeLabel"), + o = l.insert("g").attr("class", "label"); + o.node().appendChild(s); + let c, + h = s.getBBox(); + if (r) { + const t = s.children[0], + e = (0, n.Ys)(s); + (h = t.getBoundingClientRect()), e.attr("width", h.width), e.attr("height", h.height); + } + if ( + (o.attr("transform", "translate(" + -h.width / 2 + ", " + -h.height / 2 + ")"), + (C[e.id] = l), + (e.width = h.width), + (e.height = h.height), + e.startLabelLeft) + ) { + const r = d(e.startLabelLeft, e.labelStyle), + a = t.insert("g").attr("class", "edgeTerminals"), + n = a.insert("g").attr("class", "inner"); + c = n.node().appendChild(r); + const i = r.getBBox(); + n.attr("transform", "translate(" + -i.width / 2 + ", " + -i.height / 2 + ")"), + P[e.id] || (P[e.id] = {}), + (P[e.id].startLeft = a), + _(c, e.startLabelLeft); + } + if (e.startLabelRight) { + const r = d(e.startLabelRight, e.labelStyle), + a = t.insert("g").attr("class", "edgeTerminals"), + n = a.insert("g").attr("class", "inner"); + (c = a.node().appendChild(r)), n.node().appendChild(r); + const i = r.getBBox(); + n.attr("transform", "translate(" + -i.width / 2 + ", " + -i.height / 2 + ")"), + P[e.id] || (P[e.id] = {}), + (P[e.id].startRight = a), + _(c, e.startLabelRight); + } + if (e.endLabelLeft) { + const r = d(e.endLabelLeft, e.labelStyle), + a = t.insert("g").attr("class", "edgeTerminals"), + n = a.insert("g").attr("class", "inner"); + c = n.node().appendChild(r); + const i = r.getBBox(); + n.attr("transform", "translate(" + -i.width / 2 + ", " + -i.height / 2 + ")"), + a.node().appendChild(r), + P[e.id] || (P[e.id] = {}), + (P[e.id].endLeft = a), + _(c, e.endLabelLeft); + } + if (e.endLabelRight) { + const r = d(e.endLabelRight, e.labelStyle), + a = t.insert("g").attr("class", "edgeTerminals"), + n = a.insert("g").attr("class", "inner"); + c = n.node().appendChild(r); + const i = r.getBBox(); + n.attr("transform", "translate(" + -i.width / 2 + ", " + -i.height / 2 + ")"), + a.node().appendChild(r), + P[e.id] || (P[e.id] = {}), + (P[e.id].endRight = a), + _(c, e.endLabelRight); + } + return s; + }; + function _(t, e) { + (0, a.c)().flowchart.htmlLabels && t && ((t.style.width = 9 * e.length + "px"), (t.style.height = "12px")); + } + const H = (t, e) => { + a.l.info("Moving label abc78 ", t.id, t.label, C[t.id]); + let r = e.updatedPath ? e.updatedPath : e.originalPath; + if (t.label) { + const n = C[t.id]; + let i = t.x, + s = t.y; + if (r) { + const n = a.u.calcLabelPosition(r); + a.l.info("Moving label " + t.label + " from (", i, ",", s, ") to (", n.x, ",", n.y, ") abc78"), e.updatedPath && ((i = n.x), (s = n.y)); + } + n.attr("transform", "translate(" + i + ", " + s + ")"); + } + if (t.startLabelLeft) { + const e = P[t.id].startLeft; + let n = t.x, + i = t.y; + if (r) { + const e = a.u.calcTerminalLabelPosition(t.arrowTypeStart ? 10 : 0, "start_left", r); + (n = e.x), (i = e.y); + } + e.attr("transform", "translate(" + n + ", " + i + ")"); + } + if (t.startLabelRight) { + const e = P[t.id].startRight; + let n = t.x, + i = t.y; + if (r) { + const e = a.u.calcTerminalLabelPosition(t.arrowTypeStart ? 10 : 0, "start_right", r); + (n = e.x), (i = e.y); + } + e.attr("transform", "translate(" + n + ", " + i + ")"); + } + if (t.endLabelLeft) { + const e = P[t.id].endLeft; + let n = t.x, + i = t.y; + if (r) { + const e = a.u.calcTerminalLabelPosition(t.arrowTypeEnd ? 10 : 0, "end_left", r); + (n = e.x), (i = e.y); + } + e.attr("transform", "translate(" + n + ", " + i + ")"); + } + if (t.endLabelRight) { + const e = P[t.id].endRight; + let n = t.x, + i = t.y; + if (r) { + const e = a.u.calcTerminalLabelPosition(t.arrowTypeEnd ? 10 : 0, "end_right", r); + (n = e.x), (i = e.y); + } + e.attr("transform", "translate(" + n + ", " + i + ")"); + } + }, + R = (t, e) => { + a.l.warn("abc88 cutPathAtIntersect", t, e); + let r = [], + n = t[0], + i = !1; + return ( + t.forEach((t) => { + if ( + (a.l.info("abc88 checking point", t, e), + ((t, e) => { + const r = t.x, + a = t.y, + n = Math.abs(e.x - r), + i = Math.abs(e.y - a), + s = t.width / 2, + l = t.height / 2; + return n >= s || i >= l; + })(e, t) || i) + ) + a.l.warn("abc88 outside", t, n), (n = t), i || r.push(t); + else { + const s = ((t, e, r) => { + a.l.warn( + `intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(r)}\n node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`, + ); + const n = t.x, + i = t.y, + s = Math.abs(n - r.x), + l = t.width / 2; + let o = r.x < e.x ? l - s : l + s; + const d = t.height / 2, + c = Math.abs(e.y - r.y), + h = Math.abs(e.x - r.x); + if (Math.abs(i - e.y) * l > Math.abs(n - e.x) * d) { + let t = r.y < e.y ? e.y - d - i : i - d - e.y; + o = (h * t) / c; + const n = { + x: r.x < e.x ? r.x + o : r.x - h + o, + y: r.y < e.y ? r.y + c - t : r.y - c + t, + }; + return ( + 0 === o && ((n.x = e.x), (n.y = e.y)), + 0 === h && (n.x = e.x), + 0 === c && (n.y = e.y), + a.l.warn(`abc89 topp/bott calc, Q ${c}, q ${t}, R ${h}, r ${o}`, n), + n + ); + } + { + o = r.x < e.x ? e.x - l - n : n - l - e.x; + let t = (c * o) / h, + i = r.x < e.x ? r.x + h - o : r.x - h + o, + s = r.y < e.y ? r.y + t : r.y - t; + return ( + a.l.warn(`sides calc abc89, Q ${c}, q ${t}, R ${h}, r ${o}`, { + _x: i, + _y: s, + }), + 0 === o && ((i = e.x), (s = e.y)), + 0 === h && (i = e.x), + 0 === c && (s = e.y), + { x: i, y: s } + ); + } + })(e, n, t); + a.l.warn("abc88 inside", t, n, s), a.l.warn("abc88 intersection", s); + let l = !1; + r.forEach((t) => { + l = l || (t.x === s.x && t.y === s.y); + }), + r.some((t) => t.x === s.x && t.y === s.y) ? a.l.warn("abc88 no intersect", s, r) : r.push(s), + (i = !0); + } + }), + a.l.warn("abc88 returning points", r), + r + ); + }, + I = function (t, e, r, i, s, l) { + let o = r.points, + d = !1; + const c = l.node(e.v); + var h = l.node(e.w); + a.l.info("abc88 InsertEdge: ", r), + h.intersect && + c.intersect && + ((o = o.slice(1, r.points.length - 1)), + o.unshift(c.intersect(o[0])), + a.l.info("Last point", o[o.length - 1], h, h.intersect(o[o.length - 1])), + o.push(h.intersect(o[o.length - 1]))), + r.toCluster && (a.l.info("to cluster abc88", i[r.toCluster]), (o = R(r.points, i[r.toCluster].node)), (d = !0)), + r.fromCluster && (a.l.info("from cluster abc88", i[r.fromCluster]), (o = R(o.reverse(), i[r.fromCluster].node).reverse()), (d = !0)); + const p = o.filter((t) => !Number.isNaN(t.y)); + let g; + g = (("graph" === s || "flowchart" === s) && r.curve) || n.$0Z; + const y = (0, n.jvg)() + .x(function (t) { + return t.x; + }) + .y(function (t) { + return t.y; + }) + .curve(g); + let f; + switch (r.thickness) { + case "normal": + f = "edge-thickness-normal"; + break; + case "thick": + case "invisible": + f = "edge-thickness-thick"; + break; + default: + f = ""; + } + switch (r.pattern) { + case "solid": + f += " edge-pattern-solid"; + break; + case "dotted": + f += " edge-pattern-dotted"; + break; + case "dashed": + f += " edge-pattern-dashed"; + } + const u = t + .append("path") + .attr("d", y(p)) + .attr("id", r.id) + .attr("class", " " + f + (r.classes ? " " + r.classes : "")) + .attr("style", r.style); + let x = ""; + switch ( + (((0, a.c)().flowchart.arrowMarkerAbsolute || (0, a.c)().state.arrowMarkerAbsolute) && + ((x = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search), + (x = x.replace(/\(/g, "\\(")), + (x = x.replace(/\)/g, "\\)"))), + a.l.info("arrowTypeStart", r.arrowTypeStart), + a.l.info("arrowTypeEnd", r.arrowTypeEnd), + r.arrowTypeStart) + ) { + case "arrow_cross": + u.attr("marker-start", "url(" + x + "#" + s + "-crossStart)"); + break; + case "arrow_point": + u.attr("marker-start", "url(" + x + "#" + s + "-pointStart)"); + break; + case "arrow_barb": + u.attr("marker-start", "url(" + x + "#" + s + "-barbStart)"); + break; + case "arrow_circle": + u.attr("marker-start", "url(" + x + "#" + s + "-circleStart)"); + break; + case "aggregation": + u.attr("marker-start", "url(" + x + "#" + s + "-aggregationStart)"); + break; + case "extension": + u.attr("marker-start", "url(" + x + "#" + s + "-extensionStart)"); + break; + case "composition": + u.attr("marker-start", "url(" + x + "#" + s + "-compositionStart)"); + break; + case "dependency": + u.attr("marker-start", "url(" + x + "#" + s + "-dependencyStart)"); + break; + case "lollipop": + u.attr("marker-start", "url(" + x + "#" + s + "-lollipopStart)"); + } + switch (r.arrowTypeEnd) { + case "arrow_cross": + u.attr("marker-end", "url(" + x + "#" + s + "-crossEnd)"); + break; + case "arrow_point": + u.attr("marker-end", "url(" + x + "#" + s + "-pointEnd)"); + break; + case "arrow_barb": + u.attr("marker-end", "url(" + x + "#" + s + "-barbEnd)"); + break; + case "arrow_circle": + u.attr("marker-end", "url(" + x + "#" + s + "-circleEnd)"); + break; + case "aggregation": + u.attr("marker-end", "url(" + x + "#" + s + "-aggregationEnd)"); + break; + case "extension": + u.attr("marker-end", "url(" + x + "#" + s + "-extensionEnd)"); + break; + case "composition": + u.attr("marker-end", "url(" + x + "#" + s + "-compositionEnd)"); + break; + case "dependency": + u.attr("marker-end", "url(" + x + "#" + s + "-dependencyEnd)"); + break; + case "lollipop": + u.attr("marker-end", "url(" + x + "#" + s + "-lollipopEnd)"); + } + let b = {}; + return d && (b.updatedPath = o), (b.originalPath = r.points), b; + }; + }, + 7863: function (t, e, r) { + r.d(e, { + p: function () { + return l; + }, + s: function () { + return c; + }, + }); + var a = r(7274), + n = r(9339); + let i = 0; + const s = function (t) { + let e = t.id; + return t.type && (e += "<" + t.type + ">"), e; + }, + l = function (t) { + let e = "", + r = "", + a = "", + i = "", + s = t.substring(0, 1), + l = t.substring(t.length - 1, t.length); + s.match(/[#+~-]/) && (i = s); + let o = /[\s\w)~]/; + l.match(o) || (r = d(l)); + const c = "" === i ? 0 : 1; + let h = "" === r ? t.length : t.length - 1; + const p = (t = t.substring(c, h)).indexOf("("), + g = t.indexOf(")"); + if (p > 1 && g > p && g <= t.length) { + let s = t.substring(0, p).trim(); + const l = t.substring(p + 1, g); + if (((e = i + s + "(" + (0, n.x)(l.trim()) + ")"), g < t.length)) { + let i = t.substring(g + 1, g + 2); + "" !== r || i.match(o) ? (a = t.substring(g + 1).trim()) : ((r = d(i)), (a = t.substring(g + 2).trim())), + "" !== a && (":" === a.charAt(0) && (a = a.substring(1).trim()), (a = " : " + (0, n.x)(a)), (e += a)); + } + } else e = i + (0, n.x)(t); + return { displayText: e, cssStyle: r }; + }, + o = function (t, e, r, a) { + let n = l(e); + const i = t.append("tspan").attr("x", a.padding).text(n.displayText); + "" !== n.cssStyle && i.attr("style", n.cssStyle), r || i.attr("dy", a.textHeight); + }, + d = function (t) { + switch (t) { + case "*": + return "font-style:italic;"; + case "$": + return "text-decoration:underline;"; + default: + return ""; + } + }, + c = { + getClassTitleString: s, + drawClass: function (t, e, r, a) { + n.l.debug("Rendering class ", e, r); + const i = e.id, + l = { id: i, label: e.id, width: 0, height: 0 }, + d = t.append("g").attr("id", a.db.lookUpDomId(i)).attr("class", "classGroup"); + let c; + c = e.link + ? d + .append("svg:a") + .attr("xlink:href", e.link) + .attr("target", e.linkTarget) + .append("text") + .attr("y", r.textHeight + r.padding) + .attr("x", 0) + : d + .append("text") + .attr("y", r.textHeight + r.padding) + .attr("x", 0); + let h = !0; + e.annotations.forEach(function (t) { + const e = c.append("tspan").text("«" + t + "»"); + h || e.attr("dy", r.textHeight), (h = !1); + }); + let p = s(e); + const g = c.append("tspan").text(p).attr("class", "title"); + h || g.attr("dy", r.textHeight); + const y = c.node().getBBox().height, + f = d + .append("line") + .attr("x1", 0) + .attr("y1", r.padding + y + r.dividerMargin / 2) + .attr("y2", r.padding + y + r.dividerMargin / 2), + u = d + .append("text") + .attr("x", r.padding) + .attr("y", y + r.dividerMargin + r.textHeight) + .attr("fill", "white") + .attr("class", "classText"); + (h = !0), + e.members.forEach(function (t) { + o(u, t, h, r), (h = !1); + }); + const x = u.node().getBBox(), + b = d + .append("line") + .attr("x1", 0) + .attr("y1", r.padding + y + r.dividerMargin + x.height) + .attr("y2", r.padding + y + r.dividerMargin + x.height), + w = d + .append("text") + .attr("x", r.padding) + .attr("y", y + 2 * r.dividerMargin + x.height + r.textHeight) + .attr("fill", "white") + .attr("class", "classText"); + (h = !0), + e.methods.forEach(function (t) { + o(w, t, h, r), (h = !1); + }); + const m = d.node().getBBox(); + var k = " "; + e.cssClasses.length > 0 && (k += e.cssClasses.join(" ")); + const L = d + .insert("rect", ":first-child") + .attr("x", 0) + .attr("y", 0) + .attr("width", m.width + 2 * r.padding) + .attr("height", m.height + r.padding + 0.5 * r.dividerMargin) + .attr("class", k) + .node() + .getBBox().width; + return ( + c.node().childNodes.forEach(function (t) { + t.setAttribute("x", (L - t.getBBox().width) / 2); + }), + e.tooltip && c.insert("title").text(e.tooltip), + f.attr("x2", L), + b.attr("x2", L), + (l.width = L), + (l.height = m.height + r.padding + 0.5 * r.dividerMargin), + l + ); + }, + drawEdge: function (t, e, r, s, l) { + const o = function (t) { + switch (t) { + case l.db.relationType.AGGREGATION: + return "aggregation"; + case l.db.relationType.EXTENSION: + return "extension"; + case l.db.relationType.COMPOSITION: + return "composition"; + case l.db.relationType.DEPENDENCY: + return "dependency"; + case l.db.relationType.LOLLIPOP: + return "lollipop"; + } + }; + e.points = e.points.filter((t) => !Number.isNaN(t.y)); + const d = e.points, + c = (0, a.jvg)() + .x(function (t) { + return t.x; + }) + .y(function (t) { + return t.y; + }) + .curve(a.$0Z), + h = t + .append("path") + .attr("d", c(d)) + .attr("id", "edge" + i) + .attr("class", "relation"); + let p, + g, + y = ""; + s.arrowMarkerAbsolute && + ((y = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search), + (y = y.replace(/\(/g, "\\(")), + (y = y.replace(/\)/g, "\\)"))), + 1 == r.relation.lineType && h.attr("class", "relation dashed-line"), + 10 == r.relation.lineType && h.attr("class", "relation dotted-line"), + "none" !== r.relation.type1 && h.attr("marker-start", "url(" + y + "#" + o(r.relation.type1) + "Start)"), + "none" !== r.relation.type2 && h.attr("marker-end", "url(" + y + "#" + o(r.relation.type2) + "End)"); + const f = e.points.length; + let u, + x, + b, + w, + m = n.u.calcLabelPosition(e.points); + if (((p = m.x), (g = m.y), f % 2 != 0 && f > 1)) { + let t = n.u.calcCardinalityPosition("none" !== r.relation.type1, e.points, e.points[0]), + a = n.u.calcCardinalityPosition("none" !== r.relation.type2, e.points, e.points[f - 1]); + n.l.debug("cardinality_1_point " + JSON.stringify(t)), + n.l.debug("cardinality_2_point " + JSON.stringify(a)), + (u = t.x), + (x = t.y), + (b = a.x), + (w = a.y); + } + if (void 0 !== r.title) { + const e = t.append("g").attr("class", "classLabel"), + a = e.append("text").attr("class", "label").attr("x", p).attr("y", g).attr("fill", "red").attr("text-anchor", "middle").text(r.title); + window.label = a; + const n = a.node().getBBox(); + e.insert("rect", ":first-child") + .attr("class", "box") + .attr("x", n.x - s.padding / 2) + .attr("y", n.y - s.padding / 2) + .attr("width", n.width + s.padding) + .attr("height", n.height + s.padding); + } + n.l.info("Rendering relation " + JSON.stringify(r)), + void 0 !== r.relationTitle1 && + "none" !== r.relationTitle1 && + t + .append("g") + .attr("class", "cardinality") + .append("text") + .attr("class", "type1") + .attr("x", u) + .attr("y", x) + .attr("fill", "black") + .attr("font-size", "6") + .text(r.relationTitle1), + void 0 !== r.relationTitle2 && + "none" !== r.relationTitle2 && + t + .append("g") + .attr("class", "cardinality") + .append("text") + .attr("class", "type2") + .attr("x", b) + .attr("y", w) + .attr("fill", "black") + .attr("font-size", "6") + .text(r.relationTitle2), + i++; + }, + drawNote: function (t, e, r, a) { + n.l.debug("Rendering note ", e, r); + const i = e.id, + s = { id: i, text: e.text, width: 0, height: 0 }, + l = t.append("g").attr("id", i).attr("class", "classGroup"); + let o = l + .append("text") + .attr("y", r.textHeight + r.padding) + .attr("x", 0); + const d = JSON.parse(`"${e.text}"`).split("\n"); + d.forEach(function (t) { + n.l.debug(`Adding line: ${t}`), o.append("tspan").text(t).attr("class", "title").attr("dy", r.textHeight); + }); + const c = l.node().getBBox(), + h = l + .insert("rect", ":first-child") + .attr("x", 0) + .attr("y", 0) + .attr("width", c.width + 2 * r.padding) + .attr("height", c.height + d.length * r.textHeight + r.padding + 0.5 * r.dividerMargin) + .node() + .getBBox().width; + return ( + o.node().childNodes.forEach(function (t) { + t.setAttribute("x", (h - t.getBBox().width) / 2); + }), + (s.width = h), + (s.height = c.height + d.length * r.textHeight + r.padding + 0.5 * r.dividerMargin), + s + ); + }, + parseMember: l, + }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/771-942a62df.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/771-942a62df.chunk.min.js new file mode 100644 index 000000000..11e45a8e5 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/771-942a62df.chunk.min.js @@ -0,0 +1,3176 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [771], + { + 3771: function (n, e, t) { + t.d(e, { + bK: function () { + return ge; + }, + }); + var r = t(870), + o = t(6749), + i = t(3402), + u = t(2002), + a = t(7961), + c = t(3836), + f = t(6446), + s = t(5625); + class d { + constructor() { + var n = {}; + (n._next = n._prev = n), (this._sentinel = n); + } + dequeue() { + var n = this._sentinel, + e = n._prev; + if (e !== n) return h(e), e; + } + enqueue(n) { + var e = this._sentinel; + n._prev && n._next && h(n), (n._next = e._next), (e._next._prev = n), (e._next = n), (n._prev = e); + } + toString() { + for (var n = [], e = this._sentinel, t = e._prev; t !== e; ) n.push(JSON.stringify(t, v)), (t = t._prev); + return "[" + n.join(", ") + "]"; + } + } + function h(n) { + (n._prev._next = n._next), (n._next._prev = n._prev), delete n._next, delete n._prev; + } + function v(n, e) { + if ("_next" !== n && "_prev" !== n) return e; + } + var l = u.Z(1); + function Z(n, e, t, o, i) { + var u = i ? [] : void 0; + return ( + r.Z(n.inEdges(o.v), function (r) { + var o = n.edge(r), + a = n.node(r.v); + i && u.push({ v: r.v, w: r.w }), (a.out -= o), g(e, t, a); + }), + r.Z(n.outEdges(o.v), function (r) { + var o = n.edge(r), + i = r.w, + u = n.node(i); + (u.in -= o), g(e, t, u); + }), + n.removeNode(o.v), + u + ); + } + function g(n, e, t) { + t.out ? (t.in ? n[t.out - t.in + e].enqueue(t) : n[n.length - 1].enqueue(t)) : n[0].enqueue(t); + } + function p(n) { + var e = + "greedy" === n.graph().acyclicer + ? (function (n, e) { + if (n.nodeCount() <= 1) return []; + var t = (function (n, e) { + var t = new s.k(), + o = 0, + i = 0; + r.Z(n.nodes(), function (n) { + t.setNode(n, { v: n, in: 0, out: 0 }); + }), + r.Z(n.edges(), function (n) { + var r = t.edge(n.v, n.w) || 0, + u = e(n), + a = r + u; + t.setEdge(n.v, n.w, a), (i = Math.max(i, (t.node(n.v).out += u))), (o = Math.max(o, (t.node(n.w).in += u))); + }); + var u = f.Z(i + o + 3).map(function () { + return new d(); + }), + a = o + 1; + return ( + r.Z(t.nodes(), function (n) { + g(u, a, t.node(n)); + }), + { graph: t, buckets: u, zeroIdx: a } + ); + })(n, e || l), + o = (function (n, e, t) { + for (var r, o = [], i = e[e.length - 1], u = e[0]; n.nodeCount(); ) { + for (; (r = u.dequeue()); ) Z(n, e, t, r); + for (; (r = i.dequeue()); ) Z(n, e, t, r); + if (n.nodeCount()) + for (var a = e.length - 2; a > 0; --a) + if ((r = e[a].dequeue())) { + o = o.concat(Z(n, e, t, r, !0)); + break; + } + } + return o; + })(t.graph, t.buckets, t.zeroIdx); + return a.Z( + c.Z(o, function (e) { + return n.outEdges(e.v, e.w); + }), + ); + })( + n, + (function (n) { + return function (e) { + return n.edge(e).weight; + }; + })(n), + ) + : (function (n) { + var e = [], + t = {}, + o = {}; + return ( + r.Z(n.nodes(), function u(a) { + i.Z(o, a) || + ((o[a] = !0), + (t[a] = !0), + r.Z(n.outEdges(a), function (n) { + i.Z(t, n.w) ? e.push(n) : u(n.w); + }), + delete t[a]); + }), + e + ); + })(n); + r.Z(e, function (e) { + var t = n.edge(e); + n.removeEdge(e), (t.forwardName = e.name), (t.reversed = !0), n.setEdge(e.w, e.v, t, o.Z("rev")); + }); + } + var b = t(6841), + w = t(3032), + m = t(3688), + y = t(2714), + _ = function (n, e, t) { + for (var r = -1, o = n.length; ++r < o; ) { + var i = n[r], + u = e(i); + if (null != u && (void 0 === a ? u == u && !(0, y.Z)(u) : t(u, a))) + var a = u, + c = i; + } + return c; + }, + E = function (n, e) { + return n > e; + }, + k = t(9203), + j = function (n) { + return n && n.length ? _(n, k.Z, E) : void 0; + }, + x = function (n) { + var e = null == n ? 0 : n.length; + return e ? n[e - 1] : void 0; + }, + N = t(4752), + C = t(2693), + I = t(7058), + O = function (n, e) { + var t = {}; + return ( + (e = (0, I.Z)(e, 3)), + (0, C.Z)(n, function (n, r, o) { + (0, N.Z)(t, r, e(n, r, o)); + }), + t + ); + }, + L = t(9360), + M = function (n, e) { + return n < e; + }, + A = function (n) { + return n && n.length ? _(n, k.Z, M) : void 0; + }, + R = t(6092), + S = function () { + return R.Z.Date.now(); + }; + function P(n, e, t, r) { + var i; + do { + i = o.Z(r); + } while (n.hasNode(i)); + return (t.dummy = e), n.setNode(i, t), i; + } + function T(n) { + var e = new s.k({ multigraph: n.isMultigraph() }).setGraph(n.graph()); + return ( + r.Z(n.nodes(), function (t) { + n.children(t).length || e.setNode(t, n.node(t)); + }), + r.Z(n.edges(), function (t) { + e.setEdge(t, n.edge(t)); + }), + e + ); + } + function F(n, e) { + var t, + r, + o = n.x, + i = n.y, + u = e.x - o, + a = e.y - i, + c = n.width / 2, + f = n.height / 2; + if (!u && !a) throw new Error("Not possible to find intersection inside of the rectangle"); + return ( + Math.abs(a) * c > Math.abs(u) * f ? (a < 0 && (f = -f), (t = (f * u) / a), (r = f)) : (u < 0 && (c = -c), (t = c), (r = (c * a) / u)), + { x: o + t, y: i + r } + ); + } + function D(n) { + var e = c.Z(f.Z(G(n) + 1), function () { + return []; + }); + return ( + r.Z(n.nodes(), function (t) { + var r = n.node(t), + o = r.rank; + L.Z(o) || (e[o][r.order] = t); + }), + e + ); + } + function B(n, e, t, r) { + var o = { width: 0, height: 0 }; + return arguments.length >= 4 && ((o.rank = t), (o.order = r)), P(n, "border", o, e); + } + function G(n) { + return j( + c.Z(n.nodes(), function (e) { + var t = n.node(e).rank; + if (!L.Z(t)) return t; + }), + ); + } + function V(n, e) { + var t = S(); + try { + return e(); + } finally { + console.log(n + " time: " + (S() - t) + "ms"); + } + } + function z(n, e) { + return e(); + } + function q(n, e, t, r, o, i) { + var u = { width: 0, height: 0, rank: i, borderType: e }, + a = o[e][i - 1], + c = P(n, "border", u, t); + (o[e][i] = c), n.setParent(c, r), a && n.setEdge(a, c, { weight: 1 }); + } + function U(n) { + r.Z(n.nodes(), function (e) { + Y(n.node(e)); + }), + r.Z(n.edges(), function (e) { + Y(n.edge(e)); + }); + } + function Y(n) { + var e = n.width; + (n.width = n.height), (n.height = e); + } + function $(n) { + n.y = -n.y; + } + function J(n) { + var e = n.x; + (n.x = n.y), (n.y = e); + } + var K = function (n, e) { + return n && n.length ? _(n, (0, I.Z)(e, 2), M) : void 0; + }; + function W(n) { + var e = {}; + r.Z(n.sources(), function t(r) { + var o = n.node(r); + if (i.Z(e, r)) return o.rank; + e[r] = !0; + var u = A( + c.Z(n.outEdges(r), function (e) { + return t(e.w) - n.edge(e).minlen; + }), + ); + return (u !== Number.POSITIVE_INFINITY && null != u) || (u = 0), (o.rank = u); + }); + } + function H(n, e) { + return n.node(e.w).rank - n.node(e.v).rank - n.edge(e).minlen; + } + function Q(n) { + var e, + t, + r = new s.k({ directed: !1 }), + o = n.nodes()[0], + i = n.nodeCount(); + for (r.setNode(o, {}); X(r, n) < i; ) (e = nn(r, n)), (t = r.hasNode(e.v) ? H(n, e) : -H(n, e)), en(r, n, t); + return r; + } + function X(n, e) { + return ( + r.Z(n.nodes(), function t(o) { + r.Z(e.nodeEdges(o), function (r) { + var i = r.v, + u = o === i ? r.w : i; + n.hasNode(u) || H(e, r) || (n.setNode(u, {}), n.setEdge(o, u, {}), t(u)); + }); + }), + n.nodeCount() + ); + } + function nn(n, e) { + return K(e.edges(), function (t) { + if (n.hasNode(t.v) !== n.hasNode(t.w)) return H(e, t); + }); + } + function en(n, e, t) { + r.Z(n.nodes(), function (n) { + e.node(n).rank += t; + }); + } + var tn, + rn = t(585), + on = t(7179), + un = t(1692), + an = t(6770), + cn = Math.max, + fn = + ((tn = function (n, e, t) { + var r = null == n ? 0 : n.length; + if (!r) return -1; + var o, + i, + u, + a = null == t ? 0 : ((o = t), (i = (0, an.Z)(o)), (u = i % 1), i == i ? (u ? i - u : i) : 0); + return a < 0 && (a = cn(r + a, 0)), (0, un.Z)(n, (0, I.Z)(e, 3), a); + }), + function (n, e, t) { + var r = Object(n); + if (!(0, rn.Z)(n)) { + var o = (0, I.Z)(e, 3); + (n = (0, on.Z)(n)), + (e = function (n) { + return o(r[n], n, r); + }); + } + var i = tn(n, e, t); + return i > -1 ? r[o ? n[i] : i] : void 0; + }), + sn = t(2489); + u.Z(1), u.Z(1), t(8448), t(6155), t(1922); + var dn = t(7771); + t(8533), (0, t(4193).Z)("length"), RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"); + var hn = "\\ud800-\\udfff", + vn = "[" + hn + "]", + ln = "[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", + Zn = "\\ud83c[\\udffb-\\udfff]", + gn = "[^" + hn + "]", + pn = "(?:\\ud83c[\\udde6-\\uddff]){2}", + bn = "[\\ud800-\\udbff][\\udc00-\\udfff]", + wn = "(?:" + ln + "|" + Zn + ")?", + mn = "[\\ufe0e\\ufe0f]?", + yn = mn + wn + "(?:\\u200d(?:" + [gn, pn, bn].join("|") + ")" + mn + wn + ")*", + _n = "(?:" + [gn + ln + "?", ln, pn, bn, vn].join("|") + ")"; + function En(n, e, t) { + dn.Z(e) || (e = [e]); + var o = (n.isDirected() ? n.successors : n.neighbors).bind(n), + i = [], + u = {}; + return ( + r.Z(e, function (e) { + if (!n.hasNode(e)) throw new Error("Graph does not have node: " + e); + kn(n, e, "post" === t, u, o, i); + }), + i + ); + } + function kn(n, e, t, o, u, a) { + i.Z(o, e) || + ((o[e] = !0), + t || a.push(e), + r.Z(u(e), function (e) { + kn(n, e, t, o, u, a); + }), + t && a.push(e)); + } + function jn(n) { + (n = (function (n) { + var e = new s.k().setGraph(n.graph()); + return ( + r.Z(n.nodes(), function (t) { + e.setNode(t, n.node(t)); + }), + r.Z(n.edges(), function (t) { + var r = e.edge(t.v, t.w) || { weight: 0, minlen: 1 }, + o = n.edge(t); + e.setEdge(t.v, t.w, { + weight: r.weight + o.weight, + minlen: Math.max(r.minlen, o.minlen), + }); + }), + e + ); + })(n)), + W(n); + var e, + t = Q(n); + for (Cn(t), xn(t, n); (e = On(t)); ) Mn(t, n, e, Ln(t, n, e)); + } + function xn(n, e) { + var t = (function (n, e) { + return En(n, e, "post"); + })(n, n.nodes()); + (t = t.slice(0, t.length - 1)), + r.Z(t, function (t) { + !(function (n, e, t) { + var r = n.node(t).parent; + n.edge(t, r).cutvalue = Nn(n, e, t); + })(n, e, t); + }); + } + function Nn(n, e, t) { + var o = n.node(t).parent, + i = !0, + u = e.edge(t, o), + a = 0; + return ( + u || ((i = !1), (u = e.edge(o, t))), + (a = u.weight), + r.Z(e.nodeEdges(t), function (r) { + var u, + c, + f = r.v === t, + s = f ? r.w : r.v; + if (s !== o) { + var d = f === i, + h = e.edge(r).weight; + if (((a += d ? h : -h), (u = t), (c = s), n.hasEdge(u, c))) { + var v = n.edge(t, s).cutvalue; + a += d ? -v : v; + } + } + }), + a + ); + } + function Cn(n, e) { + arguments.length < 2 && (e = n.nodes()[0]), In(n, {}, 1, e); + } + function In(n, e, t, o, u) { + var a = t, + c = n.node(o); + return ( + (e[o] = !0), + r.Z(n.neighbors(o), function (r) { + i.Z(e, r) || (t = In(n, e, t, r, o)); + }), + (c.low = a), + (c.lim = t++), + u ? (c.parent = u) : delete c.parent, + t + ); + } + function On(n) { + return fn(n.edges(), function (e) { + return n.edge(e).cutvalue < 0; + }); + } + function Ln(n, e, t) { + var r = t.v, + o = t.w; + e.hasEdge(r, o) || ((r = t.w), (o = t.v)); + var i = n.node(r), + u = n.node(o), + a = i, + c = !1; + i.lim > u.lim && ((a = u), (c = !0)); + var f = sn.Z(e.edges(), function (e) { + return c === An(0, n.node(e.v), a) && c !== An(0, n.node(e.w), a); + }); + return K(f, function (n) { + return H(e, n); + }); + } + function Mn(n, e, t, o) { + var i = t.v, + u = t.w; + n.removeEdge(i, u), + n.setEdge(o.v, o.w, {}), + Cn(n), + xn(n, e), + (function (n, e) { + var t = fn(n.nodes(), function (n) { + return !e.node(n).parent; + }), + o = (function (n, e) { + return En(n, e, "pre"); + })(n, t); + (o = o.slice(1)), + r.Z(o, function (t) { + var r = n.node(t).parent, + o = e.edge(t, r), + i = !1; + o || ((o = e.edge(r, t)), (i = !0)), (e.node(t).rank = e.node(r).rank + (i ? o.minlen : -o.minlen)); + }); + })(n, e); + } + function An(n, e, t) { + return t.low <= e.lim && e.lim <= t.lim; + } + function Rn(n) { + switch (n.graph().ranker) { + case "network-simplex": + default: + !(function (n) { + jn(n); + })(n); + break; + case "tight-tree": + !(function (n) { + W(n), Q(n); + })(n); + break; + case "longest-path": + Sn(n); + } + } + RegExp(Zn + "(?=" + Zn + ")|" + _n + yn, "g"), + new Error(), + t(5351), + (jn.initLowLimValues = Cn), + (jn.initCutValues = xn), + (jn.calcCutValue = Nn), + (jn.leaveEdge = On), + (jn.enterEdge = Ln), + (jn.exchangeEdges = Mn); + var Sn = W; + var Pn = t(4657), + Tn = t(4283); + function Fn(n) { + var e = P(n, "root", {}, "_root"), + t = (function (n) { + var e = {}; + function t(o, i) { + var u = n.children(o); + u && + u.length && + r.Z(u, function (n) { + t(n, i + 1); + }), + (e[o] = i); + } + return ( + r.Z(n.children(), function (n) { + t(n, 1); + }), + e + ); + })(n), + o = j(Pn.Z(t)) - 1, + i = 2 * o + 1; + (n.graph().nestingRoot = e), + r.Z(n.edges(), function (e) { + n.edge(e).minlen *= i; + }); + var u = + (function (n) { + return Tn.Z( + n.edges(), + function (e, t) { + return e + n.edge(t).weight; + }, + 0, + ); + })(n) + 1; + r.Z(n.children(), function (r) { + Dn(n, e, i, u, o, t, r); + }), + (n.graph().nodeRankFactor = i); + } + function Dn(n, e, t, o, i, u, a) { + var c = n.children(a); + if (c.length) { + var f = B(n, "_bt"), + s = B(n, "_bb"), + d = n.node(a); + n.setParent(f, a), + (d.borderTop = f), + n.setParent(s, a), + (d.borderBottom = s), + r.Z(c, function (r) { + Dn(n, e, t, o, i, u, r); + var c = n.node(r), + d = c.borderTop ? c.borderTop : r, + h = c.borderBottom ? c.borderBottom : r, + v = c.borderTop ? o : 2 * o, + l = d !== h ? 1 : i - u[a] + 1; + n.setEdge(f, d, { weight: v, minlen: l, nestingEdge: !0 }), n.setEdge(h, s, { weight: v, minlen: l, nestingEdge: !0 }); + }), + n.parent(a) || n.setEdge(e, f, { weight: 0, minlen: i + u[a] }); + } else a !== e && n.setEdge(e, a, { weight: 0, minlen: t }); + } + var Bn = t(9103), + Gn = function (n) { + return (0, Bn.Z)(n, 5); + }; + var Vn = t(2954), + zn = function (n, e) { + return (function (n, e, t) { + for (var r = -1, o = n.length, i = e.length, u = {}; ++r < o; ) { + var a = r < i ? e[r] : void 0; + t(u, n[r], a); + } + return u; + })(n || [], e || [], Vn.Z); + }, + qn = t(5140), + Un = t(7679), + Yn = t(3317), + $n = t(1018), + Jn = t(1162), + Kn = function (n, e) { + if (n !== e) { + var t = void 0 !== n, + r = null === n, + o = n == n, + i = (0, y.Z)(n), + u = void 0 !== e, + a = null === e, + c = e == e, + f = (0, y.Z)(e); + if ((!a && !f && !i && n > e) || (i && u && c && !a && !f) || (r && u && c) || (!t && c) || !o) return 1; + if ((!r && !i && !f && n < e) || (f && t && o && !r && !i) || (a && t && o) || (!u && o) || !c) return -1; + } + return 0; + }, + Wn = function (n, e, t) { + e = e.length + ? (0, Un.Z)(e, function (n) { + return (0, dn.Z)(n) + ? function (e) { + return (0, Yn.Z)(e, 1 === n.length ? n[0] : n); + } + : n; + }) + : [k.Z]; + var r = -1; + return ( + (e = (0, Un.Z)(e, (0, Jn.Z)(I.Z))), + (function (n, e) { + var t = n.length; + for (n.sort(e); t--; ) n[t] = n[t].value; + return n; + })( + (0, $n.Z)(n, function (n, t, o) { + return { + criteria: (0, Un.Z)(e, function (e) { + return e(n); + }), + index: ++r, + value: n, + }; + }), + function (n, e) { + return (function (n, e, t) { + for (var r = -1, o = n.criteria, i = e.criteria, u = o.length, a = t.length; ++r < u; ) { + var c = Kn(o[r], i[r]); + if (c) return r >= a ? c : c * ("desc" == t[r] ? -1 : 1); + } + return n.index - e.index; + })(n, e, t); + }, + ) + ); + }, + Hn = t(9581), + Qn = t(439), + Xn = (0, Hn.Z)(function (n, e) { + if (null == n) return []; + var t = e.length; + return t > 1 && (0, Qn.Z)(n, e[0], e[1]) ? (e = []) : t > 2 && (0, Qn.Z)(e[0], e[1], e[2]) && (e = [e[0]]), Wn(n, (0, qn.Z)(e, 1), []); + }); + function ne(n, e) { + for (var t = 0, r = 1; r < e.length; ++r) t += ee(n, e[r - 1], e[r]); + return t; + } + function ee(n, e, t) { + for ( + var o = zn( + t, + c.Z(t, function (n, e) { + return e; + }), + ), + i = a.Z( + c.Z(e, function (e) { + return Xn( + c.Z(n.outEdges(e), function (e) { + return { pos: o[e.w], weight: n.edge(e).weight }; + }), + "pos", + ); + }), + ), + u = 1; + u < t.length; + + ) + u <<= 1; + var f = 2 * u - 1; + u -= 1; + var s = c.Z(new Array(f), function () { + return 0; + }), + d = 0; + return ( + r.Z( + i.forEach(function (n) { + var e = n.pos + u; + s[e] += n.weight; + for (var t = 0; e > 0; ) e % 2 && (t += s[e + 1]), (s[(e = (e - 1) >> 1)] += n.weight); + d += n.weight * t; + }), + ), + d + ); + } + function te(n, e) { + var t, + o = (function (n, e) { + var t = { lhs: [], rhs: [] }; + return ( + r.Z(n, function (n) { + var e; + (e = n), i.Z(e, "barycenter") ? t.lhs.push(n) : t.rhs.push(n); + }), + t + ); + })(n), + u = o.lhs, + c = Xn(o.rhs, function (n) { + return -n.i; + }), + f = [], + s = 0, + d = 0, + h = 0; + u.sort( + ((t = !!e), + function (n, e) { + return n.barycenter < e.barycenter ? -1 : n.barycenter > e.barycenter ? 1 : t ? e.i - n.i : n.i - e.i; + }), + ), + (h = re(f, c, h)), + r.Z(u, function (n) { + (h += n.vs.length), f.push(n.vs), (s += n.barycenter * n.weight), (d += n.weight), (h = re(f, c, h)); + }); + var v = { vs: a.Z(f) }; + return d && ((v.barycenter = s / d), (v.weight = d)), v; + } + function re(n, e, t) { + for (var r; e.length && (r = x(e)).i <= t; ) e.pop(), n.push(r.vs), t++; + return t; + } + function oe(n, e, t, o) { + var u = n.children(e), + f = n.node(e), + s = f ? f.borderLeft : void 0, + d = f ? f.borderRight : void 0, + h = {}; + s && + (u = sn.Z(u, function (n) { + return n !== s && n !== d; + })); + var v = (function (n, e) { + return c.Z(e, function (e) { + var t = n.inEdges(e); + if (t.length) { + var r = Tn.Z( + t, + function (e, t) { + var r = n.edge(t), + o = n.node(t.v); + return { sum: e.sum + r.weight * o.order, weight: e.weight + r.weight }; + }, + { sum: 0, weight: 0 }, + ); + return { v: e, barycenter: r.sum / r.weight, weight: r.weight }; + } + return { v: e }; + }); + })(n, u); + r.Z(v, function (e) { + if (n.children(e.v).length) { + var r = oe(n, e.v, t, o); + (h[e.v] = r), + i.Z(r, "barycenter") && + ((u = e), + (a = r), + L.Z(u.barycenter) + ? ((u.barycenter = a.barycenter), (u.weight = a.weight)) + : ((u.barycenter = (u.barycenter * u.weight + a.barycenter * a.weight) / (u.weight + a.weight)), (u.weight += a.weight))); + } + var u, a; + }); + var l = (function (n, e) { + var t = {}; + return ( + r.Z(n, function (n, e) { + var r = (t[n.v] = { indegree: 0, in: [], out: [], vs: [n.v], i: e }); + L.Z(n.barycenter) || ((r.barycenter = n.barycenter), (r.weight = n.weight)); + }), + r.Z(e.edges(), function (n) { + var e = t[n.v], + r = t[n.w]; + L.Z(e) || L.Z(r) || (r.indegree++, e.out.push(t[n.w])); + }), + (function (n) { + var e = []; + function t(n) { + return function (e) { + var t, r, o, i; + e.merged || + ((L.Z(e.barycenter) || L.Z(n.barycenter) || e.barycenter >= n.barycenter) && + ((r = e), + (o = 0), + (i = 0), + (t = n).weight && ((o += t.barycenter * t.weight), (i += t.weight)), + r.weight && ((o += r.barycenter * r.weight), (i += r.weight)), + (t.vs = r.vs.concat(t.vs)), + (t.barycenter = o / i), + (t.weight = i), + (t.i = Math.min(r.i, t.i)), + (r.merged = !0))); + }; + } + function o(e) { + return function (t) { + t.in.push(e), 0 == --t.indegree && n.push(t); + }; + } + for (; n.length; ) { + var i = n.pop(); + e.push(i), r.Z(i.in.reverse(), t(i)), r.Z(i.out, o(i)); + } + return c.Z( + sn.Z(e, function (n) { + return !n.merged; + }), + function (n) { + return w.Z(n, ["vs", "i", "barycenter", "weight"]); + }, + ); + })( + sn.Z(t, function (n) { + return !n.indegree; + }), + ) + ); + })(v, t); + !(function (n, e) { + r.Z(n, function (n) { + n.vs = a.Z( + n.vs.map(function (n) { + return e[n] ? e[n].vs : n; + }), + ); + }); + })(l, h); + var Z = te(l, o); + if (s && ((Z.vs = a.Z([s, Z.vs, d])), n.predecessors(s).length)) { + var g = n.node(n.predecessors(s)[0]), + p = n.node(n.predecessors(d)[0]); + i.Z(Z, "barycenter") || ((Z.barycenter = 0), (Z.weight = 0)), + (Z.barycenter = (Z.barycenter * Z.weight + g.order + p.order) / (Z.weight + 2)), + (Z.weight += 2); + } + return Z; + } + function ie(n, e, t) { + return c.Z(e, function (e) { + return (function (n, e, t) { + var u = (function (n) { + for (var e; n.hasNode((e = o.Z("_root"))); ); + return e; + })(n), + a = new s.k({ compound: !0 }).setGraph({ root: u }).setDefaultNodeLabel(function (e) { + return n.node(e); + }); + return ( + r.Z(n.nodes(), function (o) { + var c = n.node(o), + f = n.parent(o); + (c.rank === e || (c.minRank <= e && e <= c.maxRank)) && + (a.setNode(o), + a.setParent(o, f || u), + r.Z(n[t](o), function (e) { + var t = e.v === o ? e.w : e.v, + r = a.edge(t, o), + i = L.Z(r) ? 0 : r.weight; + a.setEdge(t, o, { weight: n.edge(e).weight + i }); + }), + i.Z(c, "minRank") && a.setNode(o, { borderLeft: c.borderLeft[e], borderRight: c.borderRight[e] })); + }), + a + ); + })(n, e, t); + }); + } + function ue(n, e) { + var t = new s.k(); + r.Z(n, function (n) { + var o = n.graph().root, + i = oe(n, o, t, e); + r.Z(i.vs, function (e, t) { + n.node(e).order = t; + }), + (function (n, e, t) { + var o, + i = {}; + r.Z(t, function (t) { + for (var r, u, a = n.parent(t); a; ) { + if (((r = n.parent(a)) ? ((u = i[r]), (i[r] = a)) : ((u = o), (o = a)), u && u !== a)) return void e.setEdge(u, a); + a = r; + } + }); + })(n, t, i.vs); + }); + } + function ae(n, e) { + r.Z(e, function (e) { + r.Z(e, function (e, t) { + n.node(e).order = t; + }); + }); + } + var ce = t(8882), + fe = function (n, e) { + return n && (0, C.Z)(n, (0, ce.Z)(e)); + }, + se = t(5381), + de = t(7590), + he = function (n, e) { + return null == n ? n : (0, se.Z)(n, (0, ce.Z)(e), de.Z); + }; + function ve(n, e, t) { + if (e > t) { + var r = e; + (e = t), (t = r); + } + var o = n[e]; + o || (n[e] = o = {}), (o[t] = !0); + } + function le(n, e, t) { + if (e > t) { + var r = e; + (e = t), (t = r); + } + return i.Z(n[e], t); + } + function Ze(n) { + var e, + t = D(n), + o = b.Z( + (function (n, e) { + var t = {}; + return ( + Tn.Z(e, function (e, o) { + var i = 0, + u = 0, + a = e.length, + c = x(o); + return ( + r.Z(o, function (e, f) { + var s = (function (n, e) { + if (n.node(e).dummy) + return fn(n.predecessors(e), function (e) { + return n.node(e).dummy; + }); + })(n, e), + d = s ? n.node(s).order : a; + (s || e === c) && + (r.Z(o.slice(u, f + 1), function (e) { + r.Z(n.predecessors(e), function (r) { + var o = n.node(r), + u = o.order; + !(u < i || d < u) || (o.dummy && n.node(e).dummy) || ve(t, r, e); + }); + }), + (u = f + 1), + (i = d)); + }), + o + ); + }), + t + ); + })(n, t), + (function (n, e) { + var t = {}; + function o(e, o, i, u, a) { + var c; + r.Z(f.Z(o, i), function (o) { + (c = e[o]), + n.node(c).dummy && + r.Z(n.predecessors(c), function (e) { + var r = n.node(e); + r.dummy && (r.order < u || r.order > a) && ve(t, e, c); + }); + }); + } + return ( + Tn.Z(e, function (e, t) { + var i, + u = -1, + a = 0; + return ( + r.Z(t, function (r, c) { + if ("border" === n.node(r).dummy) { + var f = n.predecessors(r); + f.length && ((i = n.node(f[0]).order), o(t, a, c, u, i), (a = c), (u = i)); + } + o(t, a, t.length, i, e.length); + }), + t + ); + }), + t + ); + })(n, t), + ), + u = {}; + r.Z(["u", "d"], function (a) { + (e = "u" === a ? t : Pn.Z(t).reverse()), + r.Z(["l", "r"], function (t) { + "r" === t && + (e = c.Z(e, function (n) { + return Pn.Z(n).reverse(); + })); + var f = ("u" === a ? n.predecessors : n.successors).bind(n), + d = (function (n, e, t, o) { + var i = {}, + u = {}, + a = {}; + return ( + r.Z(e, function (n) { + r.Z(n, function (n, e) { + (i[n] = n), (u[n] = n), (a[n] = e); + }); + }), + r.Z(e, function (n) { + var e = -1; + r.Z(n, function (n) { + var r = o(n); + if (r.length) { + r = Xn(r, function (n) { + return a[n]; + }); + for (var c = (r.length - 1) / 2, f = Math.floor(c), s = Math.ceil(c); f <= s; ++f) { + var d = r[f]; + u[n] === n && e < a[d] && !le(t, n, d) && ((u[d] = n), (u[n] = i[n] = i[d]), (e = a[d])); + } + } + }); + }), + { root: i, align: u } + ); + })(0, e, o, f), + h = (function (n, e, t, o, u) { + var a = {}, + c = (function (n, e, t, o) { + var u = new s.k(), + a = n.graph(), + c = (function (n, e, t) { + return function (r, o, u) { + var a, + c = r.node(o), + f = r.node(u), + s = 0; + if (((s += c.width / 2), i.Z(c, "labelpos"))) + switch (c.labelpos.toLowerCase()) { + case "l": + a = -c.width / 2; + break; + case "r": + a = c.width / 2; + } + if ( + (a && (s += t ? a : -a), + (a = 0), + (s += (c.dummy ? e : n) / 2), + (s += (f.dummy ? e : n) / 2), + (s += f.width / 2), + i.Z(f, "labelpos")) + ) + switch (f.labelpos.toLowerCase()) { + case "l": + a = f.width / 2; + break; + case "r": + a = -f.width / 2; + } + return a && (s += t ? a : -a), (a = 0), s; + }; + })(a.nodesep, a.edgesep, o); + return ( + r.Z(e, function (e) { + var o; + r.Z(e, function (e) { + var r = t[e]; + if ((u.setNode(r), o)) { + var i = t[o], + a = u.edge(i, r); + u.setEdge(i, r, Math.max(c(n, e, o), a || 0)); + } + o = e; + }); + }), + u + ); + })(n, e, t, u), + f = u ? "borderLeft" : "borderRight"; + function d(n, e) { + for (var t = c.nodes(), r = t.pop(), o = {}; r; ) o[r] ? n(r) : ((o[r] = !0), t.push(r), (t = t.concat(e(r)))), (r = t.pop()); + } + return ( + d(function (n) { + a[n] = c.inEdges(n).reduce(function (n, e) { + return Math.max(n, a[e.v] + c.edge(e)); + }, 0); + }, c.predecessors.bind(c)), + d(function (e) { + var t = c.outEdges(e).reduce(function (n, e) { + return Math.min(n, a[e.w] - c.edge(e)); + }, Number.POSITIVE_INFINITY), + r = n.node(e); + t !== Number.POSITIVE_INFINITY && r.borderType !== f && (a[e] = Math.max(a[e], t)); + }, c.successors.bind(c)), + r.Z(o, function (n) { + a[n] = a[t[n]]; + }), + a + ); + })(n, e, d.root, d.align, "r" === t); + "r" === t && + (h = O(h, function (n) { + return -n; + })), + (u[a + t] = h); + }); + }); + var a = (function (n, e) { + return K(Pn.Z(e), function (e) { + var t = Number.NEGATIVE_INFINITY, + r = Number.POSITIVE_INFINITY; + return ( + he(e, function (e, o) { + var i = + (function (n, e) { + return n.node(e).width; + })(n, o) / 2; + (t = Math.max(e + i, t)), (r = Math.min(e - i, r)); + }), + t - r + ); + }); + })(n, u); + return ( + (function (n, e) { + var t = Pn.Z(e), + o = A(t), + i = j(t); + r.Z(["u", "d"], function (t) { + r.Z(["l", "r"], function (r) { + var u, + a = t + r, + c = n[a]; + if (c !== e) { + var f = Pn.Z(c); + (u = "l" === r ? o - A(f) : i - j(f)) && + (n[a] = O(c, function (n) { + return n + u; + })); + } + }); + }); + })(u, a), + (function (n, e) { + return O(n.ul, function (t, r) { + if (e) return n[e.toLowerCase()][r]; + var o = Xn(c.Z(n, r)); + return (o[1] + o[2]) / 2; + }); + })(u, n.graph().align) + ); + } + function ge(n, e) { + var t = e && e.debugTiming ? V : z; + t("layout", function () { + var e = t(" buildLayoutGraph", function () { + return (function (n) { + var e = new s.k({ multigraph: !0, compound: !0 }), + t = xe(n.graph()); + return ( + e.setGraph(b.Z({}, be, je(t, pe), w.Z(t, we))), + r.Z(n.nodes(), function (t) { + var r = xe(n.node(t)); + e.setNode(t, m.Z(je(r, me), ye)), e.setParent(t, n.parent(t)); + }), + r.Z(n.edges(), function (t) { + var r = xe(n.edge(t)); + e.setEdge(t, b.Z({}, Ee, je(r, _e), w.Z(r, ke))); + }), + e + ); + })(n); + }); + t(" runLayout", function () { + !(function (n, e) { + e(" makeSpaceForEdgeLabels", function () { + !(function (n) { + var e = n.graph(); + (e.ranksep /= 2), + r.Z(n.edges(), function (t) { + var r = n.edge(t); + (r.minlen *= 2), + "c" !== r.labelpos.toLowerCase() && + ("TB" === e.rankdir || "BT" === e.rankdir ? (r.width += r.labeloffset) : (r.height += r.labeloffset)); + }); + })(n); + }), + e(" removeSelfEdges", function () { + !(function (n) { + r.Z(n.edges(), function (e) { + if (e.v === e.w) { + var t = n.node(e.v); + t.selfEdges || (t.selfEdges = []), t.selfEdges.push({ e: e, label: n.edge(e) }), n.removeEdge(e); + } + }); + })(n); + }), + e(" acyclic", function () { + p(n); + }), + e(" nestingGraph.run", function () { + Fn(n); + }), + e(" rank", function () { + Rn(T(n)); + }), + e(" injectEdgeLabelProxies", function () { + !(function (n) { + r.Z(n.edges(), function (e) { + var t = n.edge(e); + if (t.width && t.height) { + var r = n.node(e.v), + o = { rank: (n.node(e.w).rank - r.rank) / 2 + r.rank, e: e }; + P(n, "edge-proxy", o, "_ep"); + } + }); + })(n); + }), + e(" removeEmptyRanks", function () { + !(function (n) { + var e = A( + c.Z(n.nodes(), function (e) { + return n.node(e).rank; + }), + ), + t = []; + r.Z(n.nodes(), function (r) { + var o = n.node(r).rank - e; + t[o] || (t[o] = []), t[o].push(r); + }); + var o = 0, + i = n.graph().nodeRankFactor; + r.Z(t, function (e, t) { + L.Z(e) && t % i != 0 + ? --o + : o && + r.Z(e, function (e) { + n.node(e).rank += o; + }); + }); + })(n); + }), + e(" nestingGraph.cleanup", function () { + !(function (n) { + var e = n.graph(); + n.removeNode(e.nestingRoot), + delete e.nestingRoot, + r.Z(n.edges(), function (e) { + n.edge(e).nestingEdge && n.removeEdge(e); + }); + })(n); + }), + e(" normalizeRanks", function () { + !(function (n) { + var e = A( + c.Z(n.nodes(), function (e) { + return n.node(e).rank; + }), + ); + r.Z(n.nodes(), function (t) { + var r = n.node(t); + i.Z(r, "rank") && (r.rank -= e); + }); + })(n); + }), + e(" assignRankMinMax", function () { + !(function (n) { + var e = 0; + r.Z(n.nodes(), function (t) { + var r = n.node(t); + r.borderTop && ((r.minRank = n.node(r.borderTop).rank), (r.maxRank = n.node(r.borderBottom).rank), (e = j(e, r.maxRank))); + }), + (n.graph().maxRank = e); + })(n); + }), + e(" removeEdgeLabelProxies", function () { + !(function (n) { + r.Z(n.nodes(), function (e) { + var t = n.node(e); + "edge-proxy" === t.dummy && ((n.edge(t.e).labelRank = t.rank), n.removeNode(e)); + }); + })(n); + }), + e(" normalize.run", function () { + !(function (n) { + (n.graph().dummyChains = []), + r.Z(n.edges(), function (e) { + !(function (n, e) { + var t, + r, + o, + i = e.v, + u = n.node(i).rank, + a = e.w, + c = n.node(a).rank, + f = e.name, + s = n.edge(e), + d = s.labelRank; + if (c !== u + 1) { + for (n.removeEdge(e), o = 0, ++u; u < c; ++o, ++u) + (s.points = []), + (t = P(n, "edge", (r = { width: 0, height: 0, edgeLabel: s, edgeObj: e, rank: u }), "_d")), + u === d && ((r.width = s.width), (r.height = s.height), (r.dummy = "edge-label"), (r.labelpos = s.labelpos)), + n.setEdge(i, t, { weight: s.weight }, f), + 0 === o && n.graph().dummyChains.push(t), + (i = t); + n.setEdge(i, a, { weight: s.weight }, f); + } + })(n, e); + }); + })(n); + }), + e(" parentDummyChains", function () { + !(function (n) { + var e = (function (n) { + var e = {}, + t = 0; + return ( + r.Z(n.children(), function o(i) { + var u = t; + r.Z(n.children(i), o), (e[i] = { low: u, lim: t++ }); + }), + e + ); + })(n); + r.Z(n.graph().dummyChains, function (t) { + for ( + var r = n.node(t), + o = r.edgeObj, + i = (function (n, e, t, r) { + var o, + i, + u = [], + a = [], + c = Math.min(e[t].low, e[r].low), + f = Math.max(e[t].lim, e[r].lim); + o = t; + do { + (o = n.parent(o)), u.push(o); + } while (o && (e[o].low > c || f > e[o].lim)); + for (i = o, o = r; (o = n.parent(o)) !== i; ) a.push(o); + return { path: u.concat(a.reverse()), lca: i }; + })(n, e, o.v, o.w), + u = i.path, + a = i.lca, + c = 0, + f = u[c], + s = !0; + t !== o.w; + + ) { + if (((r = n.node(t)), s)) { + for (; (f = u[c]) !== a && n.node(f).maxRank < r.rank; ) c++; + f === a && (s = !1); + } + if (!s) { + for (; c < u.length - 1 && n.node((f = u[c + 1])).minRank <= r.rank; ) c++; + f = u[c]; + } + n.setParent(t, f), (t = n.successors(t)[0]); + } + }); + })(n); + }), + e(" addBorderSegments", function () { + !(function (n) { + r.Z(n.children(), function e(t) { + var o = n.children(t), + u = n.node(t); + if ((o.length && r.Z(o, e), i.Z(u, "minRank"))) { + (u.borderLeft = []), (u.borderRight = []); + for (var a = u.minRank, c = u.maxRank + 1; a < c; ++a) + q(n, "borderLeft", "_bl", t, u, a), q(n, "borderRight", "_br", t, u, a); + } + }); + })(n); + }), + e(" order", function () { + !(function (n) { + var e = G(n), + t = ie(n, f.Z(1, e + 1), "inEdges"), + o = ie(n, f.Z(e - 1, -1, -1), "outEdges"), + u = (function (n) { + var e = {}, + t = sn.Z(n.nodes(), function (e) { + return !n.children(e).length; + }), + o = j( + c.Z(t, function (e) { + return n.node(e).rank; + }), + ), + u = c.Z(f.Z(o + 1), function () { + return []; + }), + a = Xn(t, function (e) { + return n.node(e).rank; + }); + return ( + r.Z(a, function t(o) { + if (!i.Z(e, o)) { + e[o] = !0; + var a = n.node(o); + u[a.rank].push(o), r.Z(n.successors(o), t); + } + }), + u + ); + })(n); + ae(n, u); + for (var a, s = Number.POSITIVE_INFINITY, d = 0, h = 0; h < 4; ++d, ++h) { + ue(d % 2 ? t : o, d % 4 >= 2); + var v = ne(n, (u = D(n))); + v < s && ((h = 0), (a = Gn(u)), (s = v)); + } + ae(n, a); + })(n); + }), + e(" insertSelfEdges", function () { + !(function (n) { + var e = D(n); + r.Z(e, function (e) { + var t = 0; + r.Z(e, function (e, o) { + var i = n.node(e); + (i.order = o + t), + r.Z(i.selfEdges, function (e) { + P( + n, + "selfedge", + { + width: e.label.width, + height: e.label.height, + rank: i.rank, + order: o + ++t, + e: e.e, + label: e.label, + }, + "_se", + ); + }), + delete i.selfEdges; + }); + }); + })(n); + }), + e(" adjustCoordinateSystem", function () { + !(function (n) { + var e = n.graph().rankdir.toLowerCase(); + ("lr" !== e && "rl" !== e) || U(n); + })(n); + }), + e(" position", function () { + !(function (n) { + (function (n) { + var e = D(n), + t = n.graph().ranksep, + o = 0; + r.Z(e, function (e) { + var i = j( + c.Z(e, function (e) { + return n.node(e).height; + }), + ); + r.Z(e, function (e) { + n.node(e).y = o + i / 2; + }), + (o += i + t); + }); + })((n = T(n))), + fe(Ze(n), function (e, t) { + n.node(t).x = e; + }); + })(n); + }), + e(" positionSelfEdges", function () { + !(function (n) { + r.Z(n.nodes(), function (e) { + var t = n.node(e); + if ("selfedge" === t.dummy) { + var r = n.node(t.e.v), + o = r.x + r.width / 2, + i = r.y, + u = t.x - o, + a = r.height / 2; + n.setEdge(t.e, t.label), + n.removeNode(e), + (t.label.points = [ + { x: o + (2 * u) / 3, y: i - a }, + { x: o + (5 * u) / 6, y: i - a }, + { x: o + u, y: i }, + { x: o + (5 * u) / 6, y: i + a }, + { x: o + (2 * u) / 3, y: i + a }, + ]), + (t.label.x = t.x), + (t.label.y = t.y); + } + }); + })(n); + }), + e(" removeBorderNodes", function () { + !(function (n) { + r.Z(n.nodes(), function (e) { + if (n.children(e).length) { + var t = n.node(e), + r = n.node(t.borderTop), + o = n.node(t.borderBottom), + i = n.node(x(t.borderLeft)), + u = n.node(x(t.borderRight)); + (t.width = Math.abs(u.x - i.x)), (t.height = Math.abs(o.y - r.y)), (t.x = i.x + t.width / 2), (t.y = r.y + t.height / 2); + } + }), + r.Z(n.nodes(), function (e) { + "border" === n.node(e).dummy && n.removeNode(e); + }); + })(n); + }), + e(" normalize.undo", function () { + !(function (n) { + r.Z(n.graph().dummyChains, function (e) { + var t, + r = n.node(e), + o = r.edgeLabel; + for (n.setEdge(r.edgeObj, o); r.dummy; ) + (t = n.successors(e)[0]), + n.removeNode(e), + o.points.push({ x: r.x, y: r.y }), + "edge-label" === r.dummy && ((o.x = r.x), (o.y = r.y), (o.width = r.width), (o.height = r.height)), + (e = t), + (r = n.node(e)); + }); + })(n); + }), + e(" fixupEdgeLabelCoords", function () { + !(function (n) { + r.Z(n.edges(), function (e) { + var t = n.edge(e); + if (i.Z(t, "x")) + switch ((("l" !== t.labelpos && "r" !== t.labelpos) || (t.width -= t.labeloffset), t.labelpos)) { + case "l": + t.x -= t.width / 2 + t.labeloffset; + break; + case "r": + t.x += t.width / 2 + t.labeloffset; + } + }); + })(n); + }), + e(" undoCoordinateSystem", function () { + !(function (n) { + var e = n.graph().rankdir.toLowerCase(); + ("bt" !== e && "rl" !== e) || + (function (n) { + r.Z(n.nodes(), function (e) { + $(n.node(e)); + }), + r.Z(n.edges(), function (e) { + var t = n.edge(e); + r.Z(t.points, $), i.Z(t, "y") && $(t); + }); + })(n), + ("lr" !== e && "rl" !== e) || + ((function (n) { + r.Z(n.nodes(), function (e) { + J(n.node(e)); + }), + r.Z(n.edges(), function (e) { + var t = n.edge(e); + r.Z(t.points, J), i.Z(t, "x") && J(t); + }); + })(n), + U(n)); + })(n); + }), + e(" translateGraph", function () { + !(function (n) { + var e = Number.POSITIVE_INFINITY, + t = 0, + o = Number.POSITIVE_INFINITY, + u = 0, + a = n.graph(), + c = a.marginx || 0, + f = a.marginy || 0; + function s(n) { + var r = n.x, + i = n.y, + a = n.width, + c = n.height; + (e = Math.min(e, r - a / 2)), (t = Math.max(t, r + a / 2)), (o = Math.min(o, i - c / 2)), (u = Math.max(u, i + c / 2)); + } + r.Z(n.nodes(), function (e) { + s(n.node(e)); + }), + r.Z(n.edges(), function (e) { + var t = n.edge(e); + i.Z(t, "x") && s(t); + }), + (e -= c), + (o -= f), + r.Z(n.nodes(), function (t) { + var r = n.node(t); + (r.x -= e), (r.y -= o); + }), + r.Z(n.edges(), function (t) { + var u = n.edge(t); + r.Z(u.points, function (n) { + (n.x -= e), (n.y -= o); + }), + i.Z(u, "x") && (u.x -= e), + i.Z(u, "y") && (u.y -= o); + }), + (a.width = t - e + c), + (a.height = u - o + f); + })(n); + }), + e(" assignNodeIntersects", function () { + !(function (n) { + r.Z(n.edges(), function (e) { + var t, + r, + o = n.edge(e), + i = n.node(e.v), + u = n.node(e.w); + o.points ? ((t = o.points[0]), (r = o.points[o.points.length - 1])) : ((o.points = []), (t = u), (r = i)), + o.points.unshift(F(i, t)), + o.points.push(F(u, r)); + }); + })(n); + }), + e(" reversePoints", function () { + !(function (n) { + r.Z(n.edges(), function (e) { + var t = n.edge(e); + t.reversed && t.points.reverse(); + }); + })(n); + }), + e(" acyclic.undo", function () { + !(function (n) { + r.Z(n.edges(), function (e) { + var t = n.edge(e); + if (t.reversed) { + n.removeEdge(e); + var r = t.forwardName; + delete t.reversed, delete t.forwardName, n.setEdge(e.w, e.v, t, r); + } + }); + })(n); + }); + })(e, t); + }), + t(" updateInputGraph", function () { + !(function (n, e) { + r.Z(n.nodes(), function (t) { + var r = n.node(t), + o = e.node(t); + r && ((r.x = o.x), (r.y = o.y), e.children(t).length && ((r.width = o.width), (r.height = o.height))); + }), + r.Z(n.edges(), function (t) { + var r = n.edge(t), + o = e.edge(t); + (r.points = o.points), i.Z(o, "x") && ((r.x = o.x), (r.y = o.y)); + }), + (n.graph().width = e.graph().width), + (n.graph().height = e.graph().height); + })(n, e); + }); + }); + } + var pe = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], + be = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, + we = ["acyclicer", "ranker", "rankdir", "align"], + me = ["width", "height"], + ye = { width: 0, height: 0 }, + _e = ["minlen", "weight", "width", "height", "labeloffset"], + Ee = { minlen: 1, weight: 1, width: 0, height: 0, labeloffset: 10, labelpos: "r" }, + ke = ["labelpos"]; + function je(n, e) { + return O(w.Z(n, e), Number); + } + function xe(n) { + var e = {}; + return ( + r.Z(n, function (n, t) { + e[t.toLowerCase()] = n; + }), + e + ); + } + }, + 5351: function (n, e, t) { + t.d(e, { + k: function () { + return O; + }, + }); + var r = t(3402), + o = t(2002), + i = t(3234), + u = t(7179), + a = t(2489), + c = t(9697), + f = t(870), + s = t(9360), + d = t(5140), + h = t(9581), + v = t(5084), + l = t(1692), + Z = function (n) { + return n != n; + }, + g = function (n, e) { + return ( + !(null == n || !n.length) && + (function (n, e, t) { + return e == e + ? (function (n, e, t) { + for (var r = t - 1, o = n.length; ++r < o; ) if (n[r] === e) return r; + return -1; + })(n, e, t) + : (0, l.Z)(n, Z, t); + })(n, e, 0) > -1 + ); + }, + p = function (n, e, t) { + for (var r = -1, o = null == n ? 0 : n.length; ++r < o; ) if (t(e, n[r])) return !0; + return !1; + }, + b = t(9548), + w = t(3203), + m = t(6545), + y = + w.Z && 1 / (0, m.Z)(new w.Z([, -0]))[1] == 1 / 0 + ? function (n) { + return new w.Z(n); + } + : function () {}, + _ = y, + E = t(836), + k = (0, h.Z)(function (n) { + return (function (n, e, t) { + var r = -1, + o = g, + i = n.length, + u = !0, + a = [], + c = a; + if (t) (u = !1), (o = p); + else if (i >= 200) { + var f = e ? null : _(n); + if (f) return (0, m.Z)(f); + (u = !1), (o = b.Z), (c = new v.Z()); + } else c = e ? [] : a; + n: for (; ++r < i; ) { + var s = n[r], + d = e ? e(s) : s; + if (((s = t || 0 !== s ? s : 0), u && d == d)) { + for (var h = c.length; h--; ) if (c[h] === d) continue n; + e && c.push(d), a.push(s); + } else o(c, d, t) || (c !== a && c.push(d), a.push(s)); + } + return a; + })((0, d.Z)(n, 1, E.Z, !0)); + }), + j = t(4657), + x = t(4283), + N = "\0", + C = "\0", + I = ""; + class O { + constructor(n = {}) { + (this._isDirected = !r.Z(n, "directed") || n.directed), + (this._isMultigraph = !!r.Z(n, "multigraph") && n.multigraph), + (this._isCompound = !!r.Z(n, "compound") && n.compound), + (this._label = void 0), + (this._defaultNodeLabelFn = o.Z(void 0)), + (this._defaultEdgeLabelFn = o.Z(void 0)), + (this._nodes = {}), + this._isCompound && ((this._parent = {}), (this._children = {}), (this._children[C] = {})), + (this._in = {}), + (this._preds = {}), + (this._out = {}), + (this._sucs = {}), + (this._edgeObjs = {}), + (this._edgeLabels = {}); + } + isDirected() { + return this._isDirected; + } + isMultigraph() { + return this._isMultigraph; + } + isCompound() { + return this._isCompound; + } + setGraph(n) { + return (this._label = n), this; + } + graph() { + return this._label; + } + setDefaultNodeLabel(n) { + return i.Z(n) || (n = o.Z(n)), (this._defaultNodeLabelFn = n), this; + } + nodeCount() { + return this._nodeCount; + } + nodes() { + return u.Z(this._nodes); + } + sources() { + var n = this; + return a.Z(this.nodes(), function (e) { + return c.Z(n._in[e]); + }); + } + sinks() { + var n = this; + return a.Z(this.nodes(), function (e) { + return c.Z(n._out[e]); + }); + } + setNodes(n, e) { + var t = arguments, + r = this; + return ( + f.Z(n, function (n) { + t.length > 1 ? r.setNode(n, e) : r.setNode(n); + }), + this + ); + } + setNode(n, e) { + return r.Z(this._nodes, n) + ? (arguments.length > 1 && (this._nodes[n] = e), this) + : ((this._nodes[n] = arguments.length > 1 ? e : this._defaultNodeLabelFn(n)), + this._isCompound && ((this._parent[n] = C), (this._children[n] = {}), (this._children[C][n] = !0)), + (this._in[n] = {}), + (this._preds[n] = {}), + (this._out[n] = {}), + (this._sucs[n] = {}), + ++this._nodeCount, + this); + } + node(n) { + return this._nodes[n]; + } + hasNode(n) { + return r.Z(this._nodes, n); + } + removeNode(n) { + var e = this; + if (r.Z(this._nodes, n)) { + var t = function (n) { + e.removeEdge(e._edgeObjs[n]); + }; + delete this._nodes[n], + this._isCompound && + (this._removeFromParentsChildList(n), + delete this._parent[n], + f.Z(this.children(n), function (n) { + e.setParent(n); + }), + delete this._children[n]), + f.Z(u.Z(this._in[n]), t), + delete this._in[n], + delete this._preds[n], + f.Z(u.Z(this._out[n]), t), + delete this._out[n], + delete this._sucs[n], + --this._nodeCount; + } + return this; + } + setParent(n, e) { + if (!this._isCompound) throw new Error("Cannot set parent in a non-compound graph"); + if (s.Z(e)) e = C; + else { + for (var t = (e += ""); !s.Z(t); t = this.parent(t)) + if (t === n) throw new Error("Setting " + e + " as parent of " + n + " would create a cycle"); + this.setNode(e); + } + return this.setNode(n), this._removeFromParentsChildList(n), (this._parent[n] = e), (this._children[e][n] = !0), this; + } + _removeFromParentsChildList(n) { + delete this._children[this._parent[n]][n]; + } + parent(n) { + if (this._isCompound) { + var e = this._parent[n]; + if (e !== C) return e; + } + } + children(n) { + if ((s.Z(n) && (n = C), this._isCompound)) { + var e = this._children[n]; + if (e) return u.Z(e); + } else { + if (n === C) return this.nodes(); + if (this.hasNode(n)) return []; + } + } + predecessors(n) { + var e = this._preds[n]; + if (e) return u.Z(e); + } + successors(n) { + var e = this._sucs[n]; + if (e) return u.Z(e); + } + neighbors(n) { + var e = this.predecessors(n); + if (e) return k(e, this.successors(n)); + } + isLeaf(n) { + return 0 === (this.isDirected() ? this.successors(n) : this.neighbors(n)).length; + } + filterNodes(n) { + var e = new this.constructor({ + directed: this._isDirected, + multigraph: this._isMultigraph, + compound: this._isCompound, + }); + e.setGraph(this.graph()); + var t = this; + f.Z(this._nodes, function (t, r) { + n(r) && e.setNode(r, t); + }), + f.Z(this._edgeObjs, function (n) { + e.hasNode(n.v) && e.hasNode(n.w) && e.setEdge(n, t.edge(n)); + }); + var r = {}; + function o(n) { + var i = t.parent(n); + return void 0 === i || e.hasNode(i) ? ((r[n] = i), i) : i in r ? r[i] : o(i); + } + return ( + this._isCompound && + f.Z(e.nodes(), function (n) { + e.setParent(n, o(n)); + }), + e + ); + } + setDefaultEdgeLabel(n) { + return i.Z(n) || (n = o.Z(n)), (this._defaultEdgeLabelFn = n), this; + } + edgeCount() { + return this._edgeCount; + } + edges() { + return j.Z(this._edgeObjs); + } + setPath(n, e) { + var t = this, + r = arguments; + return ( + x.Z(n, function (n, o) { + return r.length > 1 ? t.setEdge(n, o, e) : t.setEdge(n, o), o; + }), + this + ); + } + setEdge() { + var n, + e, + t, + o, + i = !1, + u = arguments[0]; + "object" == typeof u && null !== u && "v" in u + ? ((n = u.v), (e = u.w), (t = u.name), 2 === arguments.length && ((o = arguments[1]), (i = !0))) + : ((n = u), (e = arguments[1]), (t = arguments[3]), arguments.length > 2 && ((o = arguments[2]), (i = !0))), + (n = "" + n), + (e = "" + e), + s.Z(t) || (t = "" + t); + var a = A(this._isDirected, n, e, t); + if (r.Z(this._edgeLabels, a)) return i && (this._edgeLabels[a] = o), this; + if (!s.Z(t) && !this._isMultigraph) throw new Error("Cannot set a named edge when isMultigraph = false"); + this.setNode(n), this.setNode(e), (this._edgeLabels[a] = i ? o : this._defaultEdgeLabelFn(n, e, t)); + var c = (function (n, e, t, r) { + var o = "" + e, + i = "" + t; + if (!n && o > i) { + var u = o; + (o = i), (i = u); + } + var a = { v: o, w: i }; + return r && (a.name = r), a; + })(this._isDirected, n, e, t); + return ( + (n = c.v), + (e = c.w), + Object.freeze(c), + (this._edgeObjs[a] = c), + L(this._preds[e], n), + L(this._sucs[n], e), + (this._in[e][a] = c), + (this._out[n][a] = c), + this._edgeCount++, + this + ); + } + edge(n, e, t) { + var r = 1 === arguments.length ? R(this._isDirected, arguments[0]) : A(this._isDirected, n, e, t); + return this._edgeLabels[r]; + } + hasEdge(n, e, t) { + var o = 1 === arguments.length ? R(this._isDirected, arguments[0]) : A(this._isDirected, n, e, t); + return r.Z(this._edgeLabels, o); + } + removeEdge(n, e, t) { + var r = 1 === arguments.length ? R(this._isDirected, arguments[0]) : A(this._isDirected, n, e, t), + o = this._edgeObjs[r]; + return ( + o && + ((n = o.v), + (e = o.w), + delete this._edgeLabels[r], + delete this._edgeObjs[r], + M(this._preds[e], n), + M(this._sucs[n], e), + delete this._in[e][r], + delete this._out[n][r], + this._edgeCount--), + this + ); + } + inEdges(n, e) { + var t = this._in[n]; + if (t) { + var r = j.Z(t); + return e + ? a.Z(r, function (n) { + return n.v === e; + }) + : r; + } + } + outEdges(n, e) { + var t = this._out[n]; + if (t) { + var r = j.Z(t); + return e + ? a.Z(r, function (n) { + return n.w === e; + }) + : r; + } + } + nodeEdges(n, e) { + var t = this.inEdges(n, e); + if (t) return t.concat(this.outEdges(n, e)); + } + } + function L(n, e) { + n[e] ? n[e]++ : (n[e] = 1); + } + function M(n, e) { + --n[e] || delete n[e]; + } + function A(n, e, t, r) { + var o = "" + e, + i = "" + t; + if (!n && o > i) { + var u = o; + (o = i), (i = u); + } + return o + I + i + I + (s.Z(r) ? N : r); + } + function R(n, e) { + return A(n, e.v, e.w, e.name); + } + (O.prototype._nodeCount = 0), (O.prototype._edgeCount = 0); + }, + 5625: function (n, e, t) { + t.d(e, { + k: function () { + return r.k; + }, + }); + var r = t(5351); + }, + 5084: function (n, e, t) { + t.d(e, { + Z: function () { + return i; + }, + }); + var r = t(520); + function o(n) { + var e = -1, + t = null == n ? 0 : n.length; + for (this.__data__ = new r.Z(); ++e < t; ) this.add(n[e]); + } + (o.prototype.add = o.prototype.push = + function (n) { + return this.__data__.set(n, "__lodash_hash_undefined__"), this; + }), + (o.prototype.has = function (n) { + return this.__data__.has(n); + }); + var i = o; + }, + 6579: function (n, e) { + e.Z = function (n, e) { + for (var t = -1, r = null == n ? 0 : n.length; ++t < r && !1 !== e(n[t], t, n); ); + return n; + }; + }, + 8774: function (n, e) { + e.Z = function (n, e) { + for (var t = -1, r = null == n ? 0 : n.length, o = 0, i = []; ++t < r; ) { + var u = n[t]; + e(u, t, n) && (i[o++] = u); + } + return i; + }; + }, + 7679: function (n, e) { + e.Z = function (n, e) { + for (var t = -1, r = null == n ? 0 : n.length, o = Array(r); ++t < r; ) o[t] = e(n[t], t, n); + return o; + }; + }, + 8694: function (n, e) { + e.Z = function (n, e) { + for (var t = -1, r = e.length, o = n.length; ++t < r; ) n[o + t] = e[t]; + return n; + }; + }, + 9103: function (n, e, t) { + t.d(e, { + Z: function () { + return z; + }, + }); + var r = t(5365), + o = t(6579), + i = t(2954), + u = t(1899), + a = t(7179), + c = t(7590), + f = t(1050), + s = t(7215), + d = t(5695), + h = t(8694), + v = t(2513), + l = t(532), + Z = Object.getOwnPropertySymbols + ? function (n) { + for (var e = []; n; ) (0, h.Z)(e, (0, d.Z)(n)), (n = (0, v.Z)(n)); + return e; + } + : l.Z, + g = t(1808), + p = t(3327), + b = function (n) { + return (0, p.Z)(n, c.Z, Z); + }, + w = t(6155), + m = Object.prototype.hasOwnProperty, + y = t(1884), + _ = /\w*$/, + E = t(7685), + k = E.Z ? E.Z.prototype : void 0, + j = k ? k.valueOf : void 0, + x = t(2701), + N = function (n, e, t) { + var r, + o, + i, + u = n.constructor; + switch (e) { + case "[object ArrayBuffer]": + return (0, y.Z)(n); + case "[object Boolean]": + case "[object Date]": + return new u(+n); + case "[object DataView]": + return (function (n, e) { + var t = e ? (0, y.Z)(n.buffer) : n.buffer; + return new n.constructor(t, n.byteOffset, n.byteLength); + })(n, t); + case "[object Float32Array]": + case "[object Float64Array]": + case "[object Int8Array]": + case "[object Int16Array]": + case "[object Int32Array]": + case "[object Uint8Array]": + case "[object Uint8ClampedArray]": + case "[object Uint16Array]": + case "[object Uint32Array]": + return (0, x.Z)(n, t); + case "[object Map]": + case "[object Set]": + return new u(); + case "[object Number]": + case "[object String]": + return new u(n); + case "[object RegExp]": + return ((i = new (o = n).constructor(o.source, _.exec(o))).lastIndex = o.lastIndex), i; + case "[object Symbol]": + return (r = n), j ? Object(j.call(r)) : {}; + } + }, + C = t(5418), + I = t(7771), + O = t(6706), + L = t(8533), + M = t(1162), + A = t(4254), + R = A.Z && A.Z.isMap, + S = R + ? (0, M.Z)(R) + : function (n) { + return (0, L.Z)(n) && "[object Map]" == (0, w.Z)(n); + }, + P = t(7226), + T = A.Z && A.Z.isSet, + F = T + ? (0, M.Z)(T) + : function (n) { + return (0, L.Z)(n) && "[object Set]" == (0, w.Z)(n); + }, + D = "[object Arguments]", + B = "[object Function]", + G = "[object Object]", + V = {}; + (V[D] = + V["[object Array]"] = + V["[object ArrayBuffer]"] = + V["[object DataView]"] = + V["[object Boolean]"] = + V["[object Date]"] = + V["[object Float32Array]"] = + V["[object Float64Array]"] = + V["[object Int8Array]"] = + V["[object Int16Array]"] = + V["[object Int32Array]"] = + V["[object Map]"] = + V["[object Number]"] = + V[G] = + V["[object RegExp]"] = + V["[object Set]"] = + V["[object String]"] = + V["[object Symbol]"] = + V["[object Uint8Array]"] = + V["[object Uint8ClampedArray]"] = + V["[object Uint16Array]"] = + V["[object Uint32Array]"] = + !0), + (V["[object Error]"] = V[B] = V["[object WeakMap]"] = !1); + var z = function n(e, t, h, v, l, p) { + var y, + _ = 1 & t, + E = 2 & t, + k = 4 & t; + if ((h && (y = l ? h(e, v, l, p) : h(e)), void 0 !== y)) return y; + if (!(0, P.Z)(e)) return e; + var j = (0, I.Z)(e); + if (j) { + if ( + ((y = (function (n) { + var e = n.length, + t = new n.constructor(e); + return e && "string" == typeof n[0] && m.call(n, "index") && ((t.index = n.index), (t.input = n.input)), t; + })(e)), + !_) + ) + return (0, s.Z)(e, y); + } else { + var x = (0, w.Z)(e), + L = x == B || "[object GeneratorFunction]" == x; + if ((0, O.Z)(e)) return (0, f.Z)(e, _); + if (x == G || x == D || (L && !l)) { + if (((y = E || L ? {} : (0, C.Z)(e)), !_)) + return E + ? (function (n, e) { + return (0, u.Z)(n, Z(n), e); + })( + e, + (function (n, e) { + return n && (0, u.Z)(e, (0, c.Z)(e), n); + })(y, e), + ) + : (function (n, e) { + return (0, u.Z)(n, (0, d.Z)(n), e); + })( + e, + (function (n, e) { + return n && (0, u.Z)(e, (0, a.Z)(e), n); + })(y, e), + ); + } else { + if (!V[x]) return l ? e : {}; + y = N(e, x, _); + } + } + p || (p = new r.Z()); + var M = p.get(e); + if (M) return M; + p.set(e, y), + F(e) + ? e.forEach(function (r) { + y.add(n(r, t, h, r, e, p)); + }) + : S(e) && + e.forEach(function (r, o) { + y.set(o, n(r, t, h, o, e, p)); + }); + var A = k ? (E ? b : g.Z) : E ? c.Z : a.Z, + R = j ? void 0 : A(e); + return ( + (0, o.Z)(R || e, function (r, o) { + R && (r = e[(o = r)]), (0, i.Z)(y, o, n(r, t, h, o, e, p)); + }), + y + ); + }; + }, + 8640: function (n, e, t) { + t.d(e, { + Z: function () { + return u; + }, + }); + var r, + o = t(2693), + i = t(585), + u = + ((r = o.Z), + function (n, e) { + if (null == n) return n; + if (!(0, i.Z)(n)) return r(n, e); + for (var t = n.length, o = -1, u = Object(n); ++o < t && !1 !== e(u[o], o, u); ); + return n; + }); + }, + 1692: function (n, e) { + e.Z = function (n, e, t, r) { + for (var o = n.length, i = t + (r ? 1 : -1); r ? i-- : ++i < o; ) if (e(n[i], i, n)) return i; + return -1; + }; + }, + 5140: function (n, e, t) { + t.d(e, { + Z: function () { + return f; + }, + }); + var r = t(8694), + o = t(7685), + i = t(4732), + u = t(7771), + a = o.Z ? o.Z.isConcatSpreadable : void 0, + c = function (n) { + return (0, u.Z)(n) || (0, i.Z)(n) || !!(a && n && n[a]); + }, + f = function n(e, t, o, i, u) { + var a = -1, + f = e.length; + for (o || (o = c), u || (u = []); ++a < f; ) { + var s = e[a]; + t > 0 && o(s) ? (t > 1 ? n(s, t - 1, o, i, u) : (0, r.Z)(u, s)) : i || (u[u.length] = s); + } + return u; + }; + }, + 2693: function (n, e, t) { + var r = t(5381), + o = t(7179); + e.Z = function (n, e) { + return n && (0, r.Z)(n, e, o.Z); + }; + }, + 3317: function (n, e, t) { + var r = t(1036), + o = t(2656); + e.Z = function (n, e) { + for (var t = 0, i = (e = (0, r.Z)(e, n)).length; null != n && t < i; ) n = n[(0, o.Z)(e[t++])]; + return t && t == i ? n : void 0; + }; + }, + 3327: function (n, e, t) { + var r = t(8694), + o = t(7771); + e.Z = function (n, e, t) { + var i = e(n); + return (0, o.Z)(n) ? i : (0, r.Z)(i, t(n)); + }; + }, + 7058: function (n, e, t) { + t.d(e, { + Z: function () { + return G; + }, + }); + var r = t(5365), + o = t(5084), + i = function (n, e) { + for (var t = -1, r = null == n ? 0 : n.length; ++t < r; ) if (e(n[t], t, n)) return !0; + return !1; + }, + u = t(9548), + a = function (n, e, t, r, a, c) { + var f = 1 & t, + s = n.length, + d = e.length; + if (s != d && !(f && d > s)) return !1; + var h = c.get(n), + v = c.get(e); + if (h && v) return h == e && v == n; + var l = -1, + Z = !0, + g = 2 & t ? new o.Z() : void 0; + for (c.set(n, e), c.set(e, n); ++l < s; ) { + var p = n[l], + b = e[l]; + if (r) var w = f ? r(b, p, l, e, n, c) : r(p, b, l, n, e, c); + if (void 0 !== w) { + if (w) continue; + Z = !1; + break; + } + if (g) { + if ( + !i(e, function (n, e) { + if (!(0, u.Z)(g, e) && (p === n || a(p, n, t, r, c))) return g.push(e); + }) + ) { + Z = !1; + break; + } + } else if (p !== b && !a(p, b, t, r, c)) { + Z = !1; + break; + } + } + return c.delete(n), c.delete(e), Z; + }, + c = t(7685), + f = t(4073), + s = t(9651), + d = function (n) { + var e = -1, + t = Array(n.size); + return ( + n.forEach(function (n, r) { + t[++e] = [r, n]; + }), + t + ); + }, + h = t(6545), + v = c.Z ? c.Z.prototype : void 0, + l = v ? v.valueOf : void 0, + Z = t(1808), + g = Object.prototype.hasOwnProperty, + p = t(6155), + b = t(7771), + w = t(6706), + m = t(7212), + y = "[object Arguments]", + _ = "[object Array]", + E = "[object Object]", + k = Object.prototype.hasOwnProperty, + j = function (n, e, t, o, i, u) { + var c = (0, b.Z)(n), + v = (0, b.Z)(e), + j = c ? _ : (0, p.Z)(n), + x = v ? _ : (0, p.Z)(e), + N = (j = j == y ? E : j) == E, + C = (x = x == y ? E : x) == E, + I = j == x; + if (I && (0, w.Z)(n)) { + if (!(0, w.Z)(e)) return !1; + (c = !0), (N = !1); + } + if (I && !N) + return ( + u || (u = new r.Z()), + c || (0, m.Z)(n) + ? a(n, e, t, o, i, u) + : (function (n, e, t, r, o, i, u) { + switch (t) { + case "[object DataView]": + if (n.byteLength != e.byteLength || n.byteOffset != e.byteOffset) return !1; + (n = n.buffer), (e = e.buffer); + case "[object ArrayBuffer]": + return !(n.byteLength != e.byteLength || !i(new f.Z(n), new f.Z(e))); + case "[object Boolean]": + case "[object Date]": + case "[object Number]": + return (0, s.Z)(+n, +e); + case "[object Error]": + return n.name == e.name && n.message == e.message; + case "[object RegExp]": + case "[object String]": + return n == e + ""; + case "[object Map]": + var c = d; + case "[object Set]": + var v = 1 & r; + if ((c || (c = h.Z), n.size != e.size && !v)) return !1; + var Z = u.get(n); + if (Z) return Z == e; + (r |= 2), u.set(n, e); + var g = a(c(n), c(e), r, o, i, u); + return u.delete(n), g; + case "[object Symbol]": + if (l) return l.call(n) == l.call(e); + } + return !1; + })(n, e, j, t, o, i, u) + ); + if (!(1 & t)) { + var O = N && k.call(n, "__wrapped__"), + L = C && k.call(e, "__wrapped__"); + if (O || L) { + var M = O ? n.value() : n, + A = L ? e.value() : e; + return u || (u = new r.Z()), i(M, A, t, o, u); + } + } + return ( + !!I && + (u || (u = new r.Z()), + (function (n, e, t, r, o, i) { + var u = 1 & t, + a = (0, Z.Z)(n), + c = a.length; + if (c != (0, Z.Z)(e).length && !u) return !1; + for (var f = c; f--; ) { + var s = a[f]; + if (!(u ? s in e : g.call(e, s))) return !1; + } + var d = i.get(n), + h = i.get(e); + if (d && h) return d == e && h == n; + var v = !0; + i.set(n, e), i.set(e, n); + for (var l = u; ++f < c; ) { + var p = n[(s = a[f])], + b = e[s]; + if (r) var w = u ? r(b, p, s, e, n, i) : r(p, b, s, n, e, i); + if (!(void 0 === w ? p === b || o(p, b, t, r, i) : w)) { + v = !1; + break; + } + l || (l = "constructor" == s); + } + if (v && !l) { + var m = n.constructor, + y = e.constructor; + m == y || + !("constructor" in n) || + !("constructor" in e) || + ("function" == typeof m && m instanceof m && "function" == typeof y && y instanceof y) || + (v = !1); + } + return i.delete(n), i.delete(e), v; + })(n, e, t, o, i, u)) + ); + }, + x = t(8533), + N = function n(e, t, r, o, i) { + return e === t || (null == e || null == t || (!(0, x.Z)(e) && !(0, x.Z)(t)) ? e != e && t != t : j(e, t, r, o, n, i)); + }, + C = t(7226), + I = function (n) { + return n == n && !(0, C.Z)(n); + }, + O = t(7179), + L = function (n, e) { + return function (t) { + return null != t && t[n] === e && (void 0 !== e || n in Object(t)); + }; + }, + M = function (n) { + var e = (function (n) { + for (var e = (0, O.Z)(n), t = e.length; t--; ) { + var r = e[t], + o = n[r]; + e[t] = [r, o, I(o)]; + } + return e; + })(n); + return 1 == e.length && e[0][2] + ? L(e[0][0], e[0][1]) + : function (t) { + return ( + t === n || + (function (n, e, t, o) { + var i = t.length, + u = i, + a = !o; + if (null == n) return !u; + for (n = Object(n); i--; ) { + var c = t[i]; + if (a && c[2] ? c[1] !== n[c[0]] : !(c[0] in n)) return !1; + } + for (; ++i < u; ) { + var f = (c = t[i])[0], + s = n[f], + d = c[1]; + if (a && c[2]) { + if (void 0 === s && !(f in n)) return !1; + } else { + var h = new r.Z(); + if (o) var v = o(s, d, f, n, e, h); + if (!(void 0 === v ? N(d, s, 3, o, h) : v)) return !1; + } + } + return !0; + })(t, n, e) + ); + }; + }, + A = t(3317), + R = t(1910), + S = t(9365), + P = t(2656), + T = function (n, e) { + return (0, S.Z)(n) && I(e) + ? L((0, P.Z)(n), e) + : function (t) { + var r = (function (n, e, t) { + var r = null == n ? void 0 : (0, A.Z)(n, e); + return void 0 === r ? t : r; + })(t, n); + return void 0 === r && r === e ? (0, R.Z)(t, n) : N(e, r, 3); + }; + }, + F = t(9203), + D = t(4193), + B = function (n) { + return (0, S.Z)(n) + ? (0, D.Z)((0, P.Z)(n)) + : (function (n) { + return function (e) { + return (0, A.Z)(e, n); + }; + })(n); + }, + G = function (n) { + return "function" == typeof n ? n : null == n ? F.Z : "object" == typeof n ? ((0, b.Z)(n) ? T(n[0], n[1]) : M(n)) : B(n); + }; + }, + 1018: function (n, e, t) { + var r = t(8640), + o = t(585); + e.Z = function (n, e) { + var t = -1, + i = (0, o.Z)(n) ? Array(n.length) : []; + return ( + (0, r.Z)(n, function (n, r, o) { + i[++t] = e(n, r, o); + }), + i + ); + }; + }, + 4193: function (n, e) { + e.Z = function (n) { + return function (e) { + return null == e ? void 0 : e[n]; + }; + }; + }, + 9548: function (n, e) { + e.Z = function (n, e) { + return n.has(e); + }; + }, + 8882: function (n, e, t) { + var r = t(9203); + e.Z = function (n) { + return "function" == typeof n ? n : r.Z; + }; + }, + 1036: function (n, e, t) { + t.d(e, { + Z: function () { + return h; + }, + }); + var r, + o, + i = t(7771), + u = t(9365), + a = t(2454), + c = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, + f = /\\(\\)?/g, + s = + ((r = (0, a.Z)( + function (n) { + var e = []; + return ( + 46 === n.charCodeAt(0) && e.push(""), + n.replace(c, function (n, t, r, o) { + e.push(r ? o.replace(f, "$1") : t || n); + }), + e + ); + }, + function (n) { + return 500 === o.size && o.clear(), n; + }, + )), + (o = r.cache), + r), + d = t(2402), + h = function (n, e) { + return (0, i.Z)(n) ? n : (0, u.Z)(n, e) ? [n] : s((0, d.Z)(n)); + }; + }, + 1808: function (n, e, t) { + var r = t(3327), + o = t(5695), + i = t(7179); + e.Z = function (n) { + return (0, r.Z)(n, i.Z, o.Z); + }; + }, + 5695: function (n, e, t) { + var r = t(8774), + o = t(532), + i = Object.prototype.propertyIsEnumerable, + u = Object.getOwnPropertySymbols, + a = u + ? function (n) { + return null == n + ? [] + : ((n = Object(n)), + (0, r.Z)(u(n), function (e) { + return i.call(n, e); + })); + } + : o.Z; + e.Z = a; + }, + 5196: function (n, e, t) { + var r = t(1036), + o = t(4732), + i = t(7771), + u = t(6009), + a = t(1656), + c = t(2656); + e.Z = function (n, e, t) { + for (var f = -1, s = (e = (0, r.Z)(e, n)).length, d = !1; ++f < s; ) { + var h = (0, c.Z)(e[f]); + if (!(d = null != n && t(n, h))) break; + n = n[h]; + } + return d || ++f != s ? d : !!(s = null == n ? 0 : n.length) && (0, a.Z)(s) && (0, u.Z)(h, s) && ((0, i.Z)(n) || (0, o.Z)(n)); + }; + }, + 9365: function (n, e, t) { + var r = t(7771), + o = t(2714), + i = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + u = /^\w*$/; + e.Z = function (n, e) { + if ((0, r.Z)(n)) return !1; + var t = typeof n; + return ( + !("number" != t && "symbol" != t && "boolean" != t && null != n && !(0, o.Z)(n)) || u.test(n) || !i.test(n) || (null != e && n in Object(e)) + ); + }; + }, + 6545: function (n, e) { + e.Z = function (n) { + var e = -1, + t = Array(n.size); + return ( + n.forEach(function (n) { + t[++e] = n; + }), + t + ); + }; + }, + 2656: function (n, e, t) { + var r = t(2714); + e.Z = function (n) { + if ("string" == typeof n || (0, r.Z)(n)) return n; + var e = n + ""; + return "0" == e && 1 / n == -1 / 0 ? "-0" : e; + }; + }, + 3688: function (n, e, t) { + var r = t(9581), + o = t(9651), + i = t(439), + u = t(7590), + a = Object.prototype, + c = a.hasOwnProperty, + f = (0, r.Z)(function (n, e) { + n = Object(n); + var t = -1, + r = e.length, + f = r > 2 ? e[2] : void 0; + for (f && (0, i.Z)(e[0], e[1], f) && (r = 1); ++t < r; ) + for (var s = e[t], d = (0, u.Z)(s), h = -1, v = d.length; ++h < v; ) { + var l = d[h], + Z = n[l]; + (void 0 === Z || ((0, o.Z)(Z, a[l]) && !c.call(n, l))) && (n[l] = s[l]); + } + return n; + }); + e.Z = f; + }, + 2489: function (n, e, t) { + t.d(e, { + Z: function () { + return c; + }, + }); + var r = t(8774), + o = t(8640), + i = function (n, e) { + var t = []; + return ( + (0, o.Z)(n, function (n, r, o) { + e(n, r, o) && t.push(n); + }), + t + ); + }, + u = t(7058), + a = t(7771), + c = function (n, e) { + return ((0, a.Z)(n) ? r.Z : i)(n, (0, u.Z)(e, 3)); + }; + }, + 7961: function (n, e, t) { + var r = t(5140); + e.Z = function (n) { + return null != n && n.length ? (0, r.Z)(n, 1) : []; + }; + }, + 870: function (n, e, t) { + var r = t(6579), + o = t(8640), + i = t(8882), + u = t(7771); + e.Z = function (n, e) { + return ((0, u.Z)(n) ? r.Z : o.Z)(n, (0, i.Z)(e)); + }; + }, + 3402: function (n, e, t) { + t.d(e, { + Z: function () { + return u; + }, + }); + var r = Object.prototype.hasOwnProperty, + o = function (n, e) { + return null != n && r.call(n, e); + }, + i = t(5196), + u = function (n, e) { + return null != n && (0, i.Z)(n, e, o); + }; + }, + 1910: function (n, e, t) { + t.d(e, { + Z: function () { + return i; + }, + }); + var r = function (n, e) { + return null != n && e in Object(n); + }, + o = t(5196), + i = function (n, e) { + return null != n && (0, o.Z)(n, e, r); + }; + }, + 2714: function (n, e, t) { + var r = t(1922), + o = t(8533); + e.Z = function (n) { + return "symbol" == typeof n || ((0, o.Z)(n) && "[object Symbol]" == (0, r.Z)(n)); + }; + }, + 9360: function (n, e) { + e.Z = function (n) { + return void 0 === n; + }; + }, + 7179: function (n, e, t) { + var r = t(9001), + o = t(8448), + i = t(585); + e.Z = function (n) { + return (0, i.Z)(n) ? (0, r.Z)(n) : (0, o.Z)(n); + }; + }, + 3836: function (n, e, t) { + var r = t(7679), + o = t(7058), + i = t(1018), + u = t(7771); + e.Z = function (n, e) { + return ((0, u.Z)(n) ? r.Z : i.Z)(n, (0, o.Z)(e, 3)); + }; + }, + 3032: function (n, e, t) { + t.d(e, { + Z: function () { + return g; + }, + }); + var r, + o = t(3317), + i = t(2954), + u = t(1036), + a = t(6009), + c = t(7226), + f = t(2656), + s = function (n, e, t, r) { + if (!(0, c.Z)(n)) return n; + for (var o = -1, s = (e = (0, u.Z)(e, n)).length, d = s - 1, h = n; null != h && ++o < s; ) { + var v = (0, f.Z)(e[o]), + l = t; + if ("__proto__" === v || "constructor" === v || "prototype" === v) return n; + if (o != d) { + var Z = h[v]; + void 0 === (l = r ? r(Z, v, h) : void 0) && (l = (0, c.Z)(Z) ? Z : (0, a.Z)(e[o + 1]) ? [] : {}); + } + (0, i.Z)(h, v, l), (h = h[v]); + } + return n; + }, + d = t(1910), + h = function (n, e) { + return (function (n, e, t) { + for (var r = -1, i = e.length, a = {}; ++r < i; ) { + var c = e[r], + f = (0, o.Z)(n, c); + t(f, c) && s(a, (0, u.Z)(c, n), f); + } + return a; + })(n, e, function (e, t) { + return (0, d.Z)(n, t); + }); + }, + v = t(7961), + l = t(3948), + Z = t(3626), + g = + ((r = function (n, e) { + return null == n ? {} : h(n, e); + }), + (0, Z.Z)((0, l.Z)(r, void 0, v.Z), r + "")); + }, + 6446: function (n, e, t) { + t.d(e, { + Z: function () { + return a; + }, + }); + var r = Math.ceil, + o = Math.max, + i = t(439), + u = t(6770), + a = function (n, e, t) { + return ( + t && "number" != typeof t && (0, i.Z)(n, e, t) && (e = t = void 0), + (n = (0, u.Z)(n)), + void 0 === e ? ((e = n), (n = 0)) : (e = (0, u.Z)(e)), + (function (n, e, t, i) { + for (var u = -1, a = o(r((e - n) / (t || 1)), 0), c = Array(a); a--; ) (c[i ? a : ++u] = n), (n += t); + return c; + })(n, e, (t = void 0 === t ? (n < e ? 1 : -1) : (0, u.Z)(t)), void 0) + ); + }; + }, + 4283: function (n, e, t) { + t.d(e, { + Z: function () { + return c; + }, + }); + var r = function (n, e, t, r) { + var o = -1, + i = null == n ? 0 : n.length; + for (r && i && (t = n[++o]); ++o < i; ) t = e(t, n[o], o, n); + return t; + }, + o = t(8640), + i = t(7058), + u = function (n, e, t, r, o) { + return ( + o(n, function (n, o, i) { + t = r ? ((r = !1), n) : e(t, n, o, i); + }), + t + ); + }, + a = t(7771), + c = function (n, e, t) { + var c = (0, a.Z)(n) ? r : u, + f = arguments.length < 3; + return c(n, (0, i.Z)(e, 4), t, f, o.Z); + }; + }, + 532: function (n, e) { + e.Z = function () { + return []; + }; + }, + 6770: function (n, e, t) { + t.d(e, { + Z: function () { + return h; + }, + }); + var r = /\s/, + o = /^\s+/, + i = function (n) { + return n + ? n + .slice( + 0, + (function (n) { + for (var e = n.length; e-- && r.test(n.charAt(e)); ); + return e; + })(n) + 1, + ) + .replace(o, "") + : n; + }, + u = t(7226), + a = t(2714), + c = /^[-+]0x[0-9a-f]+$/i, + f = /^0b[01]+$/i, + s = /^0o[0-7]+$/i, + d = parseInt, + h = function (n) { + return n + ? Infinity === + (n = (function (n) { + if ("number" == typeof n) return n; + if ((0, a.Z)(n)) return NaN; + if ((0, u.Z)(n)) { + var e = "function" == typeof n.valueOf ? n.valueOf() : n; + n = (0, u.Z)(e) ? e + "" : e; + } + if ("string" != typeof n) return 0 === n ? n : +n; + n = i(n); + var t = f.test(n); + return t || s.test(n) ? d(n.slice(2), t ? 2 : 8) : c.test(n) ? NaN : +n; + })(n)) || n === -1 / 0 + ? 17976931348623157e292 * (n < 0 ? -1 : 1) + : n == n + ? n + : 0 + : 0 === n + ? n + : 0; + }; + }, + 2402: function (n, e, t) { + t.d(e, { + Z: function () { + return s; + }, + }); + var r = t(7685), + o = t(7679), + i = t(7771), + u = t(2714), + a = r.Z ? r.Z.prototype : void 0, + c = a ? a.toString : void 0, + f = function n(e) { + if ("string" == typeof e) return e; + if ((0, i.Z)(e)) return (0, o.Z)(e, n) + ""; + if ((0, u.Z)(e)) return c ? c.call(e) : ""; + var t = e + ""; + return "0" == t && 1 / e == -1 / 0 ? "-0" : t; + }, + s = function (n) { + return null == n ? "" : f(n); + }; + }, + 6749: function (n, e, t) { + var r = t(2402), + o = 0; + e.Z = function (n) { + var e = ++o; + return (0, r.Z)(n) + e; + }; + }, + 4657: function (n, e, t) { + t.d(e, { + Z: function () { + return i; + }, + }); + var r = t(7679), + o = t(7179), + i = function (n) { + return null == n + ? [] + : (function (n, e) { + return (0, r.Z)(e, function (e) { + return n[e]; + }); + })(n, (0, o.Z)(n)); + }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/773-8f0c4fb8.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/773-8f0c4fb8.chunk.min.js new file mode 100644 index 000000000..a30b1e706 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/773-8f0c4fb8.chunk.min.js @@ -0,0 +1,2052 @@ +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [773], + { + 8734: function (t) { + t.exports = (function () { + "use strict"; + return function (t, e) { + var n = e.prototype, + i = n.format; + n.format = function (t) { + var e = this, + n = this.$locale(); + if (!this.isValid()) return i.bind(this)(t); + var s = this.$utils(), + r = (t || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, function (t) { + switch (t) { + case "Q": + return Math.ceil((e.$M + 1) / 3); + case "Do": + return n.ordinal(e.$D); + case "gggg": + return e.weekYear(); + case "GGGG": + return e.isoWeekYear(); + case "wo": + return n.ordinal(e.week(), "W"); + case "w": + case "ww": + return s.s(e.week(), "w" === t ? 1 : 2, "0"); + case "W": + case "WW": + return s.s(e.isoWeek(), "W" === t ? 1 : 2, "0"); + case "k": + case "kk": + return s.s(String(0 === e.$H ? 24 : e.$H), "k" === t ? 1 : 2, "0"); + case "X": + return Math.floor(e.$d.getTime() / 1e3); + case "x": + return e.$d.getTime(); + case "z": + return "[" + e.offsetName() + "]"; + case "zzz": + return "[" + e.offsetName("long") + "]"; + default: + return t; + } + }); + return i.bind(this)(r); + }; + }; + })(); + }, + 285: function (t) { + t.exports = (function () { + "use strict"; + var t = { + LTS: "h:mm:ss A", + LT: "h:mm A", + L: "MM/DD/YYYY", + LL: "MMMM D, YYYY", + LLL: "MMMM D, YYYY h:mm A", + LLLL: "dddd, MMMM D, YYYY h:mm A", + }, + e = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, + n = /\d\d/, + i = /\d\d?/, + s = /\d*[^-_:/,()\s\d]+/, + r = {}, + a = function (t) { + return (t = +t) + (t > 68 ? 1900 : 2e3); + }, + o = function (t) { + return function (e) { + this[t] = +e; + }; + }, + c = [ + /[+-]\d\d:?(\d\d)?|Z/, + function (t) { + (this.zone || (this.zone = {})).offset = (function (t) { + if (!t) return 0; + if ("Z" === t) return 0; + var e = t.match(/([+-]|\d\d)/g), + n = 60 * e[1] + (+e[2] || 0); + return 0 === n ? 0 : "+" === e[0] ? -n : n; + })(t); + }, + ], + l = function (t) { + var e = r[t]; + return e && (e.indexOf ? e : e.s.concat(e.f)); + }, + d = function (t, e) { + var n, + i = r.meridiem; + if (i) { + for (var s = 1; s <= 24; s += 1) + if (t.indexOf(i(s, 0, e)) > -1) { + n = s > 12; + break; + } + } else n = t === (e ? "pm" : "PM"); + return n; + }, + u = { + A: [ + s, + function (t) { + this.afternoon = d(t, !1); + }, + ], + a: [ + s, + function (t) { + this.afternoon = d(t, !0); + }, + ], + S: [ + /\d/, + function (t) { + this.milliseconds = 100 * +t; + }, + ], + SS: [ + n, + function (t) { + this.milliseconds = 10 * +t; + }, + ], + SSS: [ + /\d{3}/, + function (t) { + this.milliseconds = +t; + }, + ], + s: [i, o("seconds")], + ss: [i, o("seconds")], + m: [i, o("minutes")], + mm: [i, o("minutes")], + H: [i, o("hours")], + h: [i, o("hours")], + HH: [i, o("hours")], + hh: [i, o("hours")], + D: [i, o("day")], + DD: [n, o("day")], + Do: [ + s, + function (t) { + var e = r.ordinal, + n = t.match(/\d+/); + if (((this.day = n[0]), e)) for (var i = 1; i <= 31; i += 1) e(i).replace(/\[|\]/g, "") === t && (this.day = i); + }, + ], + M: [i, o("month")], + MM: [n, o("month")], + MMM: [ + s, + function (t) { + var e = l("months"), + n = + ( + l("monthsShort") || + e.map(function (t) { + return t.slice(0, 3); + }) + ).indexOf(t) + 1; + if (n < 1) throw new Error(); + this.month = n % 12 || n; + }, + ], + MMMM: [ + s, + function (t) { + var e = l("months").indexOf(t) + 1; + if (e < 1) throw new Error(); + this.month = e % 12 || e; + }, + ], + Y: [/[+-]?\d+/, o("year")], + YY: [ + n, + function (t) { + this.year = a(t); + }, + ], + YYYY: [/\d{4}/, o("year")], + Z: c, + ZZ: c, + }; + function h(n) { + var i, s; + (i = n), (s = r && r.formats); + for ( + var a = (n = i.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function (e, n, i) { + var r = i && i.toUpperCase(); + return ( + n || + s[i] || + t[i] || + s[r].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function (t, e, n) { + return e || n.slice(1); + }) + ); + })).match(e), + o = a.length, + c = 0; + c < o; + c += 1 + ) { + var l = a[c], + d = u[l], + h = d && d[0], + f = d && d[1]; + a[c] = f ? { regex: h, parser: f } : l.replace(/^\[|\]$/g, ""); + } + return function (t) { + for (var e = {}, n = 0, i = 0; n < o; n += 1) { + var s = a[n]; + if ("string" == typeof s) i += s.length; + else { + var r = s.regex, + c = s.parser, + l = t.slice(i), + d = r.exec(l)[0]; + c.call(e, d), (t = t.replace(d, "")); + } + } + return ( + (function (t) { + var e = t.afternoon; + if (void 0 !== e) { + var n = t.hours; + e ? n < 12 && (t.hours += 12) : 12 === n && (t.hours = 0), delete t.afternoon; + } + })(e), + e + ); + }; + } + return function (t, e, n) { + (n.p.customParseFormat = !0), t && t.parseTwoDigitYear && (a = t.parseTwoDigitYear); + var i = e.prototype, + s = i.parse; + i.parse = function (t) { + var e = t.date, + i = t.utc, + a = t.args; + this.$u = i; + var o = a[1]; + if ("string" == typeof o) { + var c = !0 === a[2], + l = !0 === a[3], + d = c || l, + u = a[2]; + l && (u = a[2]), + (r = this.$locale()), + !c && u && (r = n.Ls[u]), + (this.$d = (function (t, e, n) { + try { + if (["x", "X"].indexOf(e) > -1) return new Date(("X" === e ? 1e3 : 1) * t); + var i = h(e)(t), + s = i.year, + r = i.month, + a = i.day, + o = i.hours, + c = i.minutes, + l = i.seconds, + d = i.milliseconds, + u = i.zone, + f = new Date(), + y = a || (s || r ? 1 : f.getDate()), + m = s || f.getFullYear(), + k = 0; + (s && !r) || (k = r > 0 ? r - 1 : f.getMonth()); + var p = o || 0, + g = c || 0, + b = l || 0, + v = d || 0; + return u + ? new Date(Date.UTC(m, k, y, p, g, b, v + 60 * u.offset * 1e3)) + : n + ? new Date(Date.UTC(m, k, y, p, g, b, v)) + : new Date(m, k, y, p, g, b, v); + } catch (t) { + return new Date(""); + } + })(e, o, i)), + this.init(), + u && !0 !== u && (this.$L = this.locale(u).$L), + d && e != this.format(o) && (this.$d = new Date("")), + (r = {}); + } else if (o instanceof Array) + for (var f = o.length, y = 1; y <= f; y += 1) { + a[1] = o[y - 1]; + var m = n.apply(this, a); + if (m.isValid()) { + (this.$d = m.$d), (this.$L = m.$L), this.init(); + break; + } + y === f && (this.$d = new Date("")); + } + else s.call(this, t); + }; + }; + })(); + }, + 9542: function (t) { + t.exports = (function () { + "use strict"; + var t = "day"; + return function (e, n, i) { + var s = function (e) { + return e.add(4 - e.isoWeekday(), t); + }, + r = n.prototype; + (r.isoWeekYear = function () { + return s(this).year(); + }), + (r.isoWeek = function (e) { + if (!this.$utils().u(e)) return this.add(7 * (e - this.isoWeek()), t); + var n, + r, + a, + o = s(this), + c = + ((n = this.isoWeekYear()), + (a = 4 - (r = (this.$u ? i.utc : i)().year(n).startOf("year")).isoWeekday()), + r.isoWeekday() > 4 && (a += 7), + r.add(a, t)); + return o.diff(c, "week") + 1; + }), + (r.isoWeekday = function (t) { + return this.$utils().u(t) ? this.day() || 7 : this.day(this.day() % 7 ? t : t - 7); + }); + var a = r.startOf; + r.startOf = function (t, e) { + var n = this.$utils(), + i = !!n.u(e) || e; + return "isoweek" === n.p(t) + ? i + ? this.date(this.date() - (this.isoWeekday() - 1)).startOf("day") + : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf("day") + : a.bind(this)(t, e); + }; + }; + })(); + }, + 9773: function (t, e, n) { + "use strict"; + n.d(e, { + diagram: function () { + return X; + }, + }); + var i = n(7967), + s = n(7484), + r = n(9542), + a = n(285), + o = n(8734), + c = n(9339), + l = n(7274), + d = + (n(7856), + (function () { + var t = function (t, e, n, i) { + for (n = n || {}, i = t.length; i--; n[t[i]] = e); + return n; + }, + e = [1, 3], + n = [1, 5], + i = [7, 9, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 33, 34, 36, 43, 48], + s = [1, 32], + r = [1, 33], + a = [1, 34], + o = [1, 35], + c = [1, 36], + l = [1, 37], + d = [1, 38], + u = [1, 15], + h = [1, 16], + f = [1, 17], + y = [1, 18], + m = [1, 19], + k = [1, 20], + p = [1, 21], + g = [1, 22], + b = [1, 24], + v = [1, 25], + x = [1, 26], + T = [1, 27], + _ = [1, 28], + w = [1, 30], + $ = [1, 39], + D = [1, 42], + S = [5, 7, 9, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 33, 34, 36, 43, 48], + C = { + trace: function () {}, + yy: {}, + symbols_: { + error: 2, + start: 3, + directive: 4, + gantt: 5, + document: 6, + EOF: 7, + line: 8, + SPACE: 9, + statement: 10, + NL: 11, + weekday: 12, + weekday_monday: 13, + weekday_tuesday: 14, + weekday_wednesday: 15, + weekday_thursday: 16, + weekday_friday: 17, + weekday_saturday: 18, + weekday_sunday: 19, + dateFormat: 20, + inclusiveEndDates: 21, + topAxis: 22, + axisFormat: 23, + tickInterval: 24, + excludes: 25, + includes: 26, + todayMarker: 27, + title: 28, + acc_title: 29, + acc_title_value: 30, + acc_descr: 31, + acc_descr_value: 32, + acc_descr_multiline_value: 33, + section: 34, + clickStatement: 35, + taskTxt: 36, + taskData: 37, + openDirective: 38, + typeDirective: 39, + closeDirective: 40, + ":": 41, + argDirective: 42, + click: 43, + callbackname: 44, + callbackargs: 45, + href: 46, + clickStatementDebug: 47, + open_directive: 48, + type_directive: 49, + arg_directive: 50, + close_directive: 51, + $accept: 0, + $end: 1, + }, + terminals_: { + 2: "error", + 5: "gantt", + 7: "EOF", + 9: "SPACE", + 11: "NL", + 13: "weekday_monday", + 14: "weekday_tuesday", + 15: "weekday_wednesday", + 16: "weekday_thursday", + 17: "weekday_friday", + 18: "weekday_saturday", + 19: "weekday_sunday", + 20: "dateFormat", + 21: "inclusiveEndDates", + 22: "topAxis", + 23: "axisFormat", + 24: "tickInterval", + 25: "excludes", + 26: "includes", + 27: "todayMarker", + 28: "title", + 29: "acc_title", + 30: "acc_title_value", + 31: "acc_descr", + 32: "acc_descr_value", + 33: "acc_descr_multiline_value", + 34: "section", + 36: "taskTxt", + 37: "taskData", + 41: ":", + 43: "click", + 44: "callbackname", + 45: "callbackargs", + 46: "href", + 48: "open_directive", + 49: "type_directive", + 50: "arg_directive", + 51: "close_directive", + }, + productions_: [ + 0, + [3, 2], + [3, 3], + [6, 0], + [6, 2], + [8, 2], + [8, 1], + [8, 1], + [8, 1], + [12, 1], + [12, 1], + [12, 1], + [12, 1], + [12, 1], + [12, 1], + [12, 1], + [10, 1], + [10, 1], + [10, 1], + [10, 1], + [10, 1], + [10, 1], + [10, 1], + [10, 1], + [10, 1], + [10, 1], + [10, 2], + [10, 2], + [10, 1], + [10, 1], + [10, 1], + [10, 2], + [10, 1], + [4, 4], + [4, 6], + [35, 2], + [35, 3], + [35, 3], + [35, 4], + [35, 3], + [35, 4], + [35, 2], + [47, 2], + [47, 3], + [47, 3], + [47, 4], + [47, 3], + [47, 4], + [47, 2], + [38, 1], + [39, 1], + [42, 1], + [40, 1], + ], + performAction: function (t, e, n, i, s, r, a) { + var o = r.length - 1; + switch (s) { + case 2: + return r[o - 1]; + case 3: + case 7: + case 8: + this.$ = []; + break; + case 4: + r[o - 1].push(r[o]), (this.$ = r[o - 1]); + break; + case 5: + case 6: + this.$ = r[o]; + break; + case 9: + i.setWeekday("monday"); + break; + case 10: + i.setWeekday("tuesday"); + break; + case 11: + i.setWeekday("wednesday"); + break; + case 12: + i.setWeekday("thursday"); + break; + case 13: + i.setWeekday("friday"); + break; + case 14: + i.setWeekday("saturday"); + break; + case 15: + i.setWeekday("sunday"); + break; + case 16: + i.setDateFormat(r[o].substr(11)), (this.$ = r[o].substr(11)); + break; + case 17: + i.enableInclusiveEndDates(), (this.$ = r[o].substr(18)); + break; + case 18: + i.TopAxis(), (this.$ = r[o].substr(8)); + break; + case 19: + i.setAxisFormat(r[o].substr(11)), (this.$ = r[o].substr(11)); + break; + case 20: + i.setTickInterval(r[o].substr(13)), (this.$ = r[o].substr(13)); + break; + case 21: + i.setExcludes(r[o].substr(9)), (this.$ = r[o].substr(9)); + break; + case 22: + i.setIncludes(r[o].substr(9)), (this.$ = r[o].substr(9)); + break; + case 23: + i.setTodayMarker(r[o].substr(12)), (this.$ = r[o].substr(12)); + break; + case 25: + i.setDiagramTitle(r[o].substr(6)), (this.$ = r[o].substr(6)); + break; + case 26: + (this.$ = r[o].trim()), i.setAccTitle(this.$); + break; + case 27: + case 28: + (this.$ = r[o].trim()), i.setAccDescription(this.$); + break; + case 29: + i.addSection(r[o].substr(8)), (this.$ = r[o].substr(8)); + break; + case 31: + i.addTask(r[o - 1], r[o]), (this.$ = "task"); + break; + case 35: + (this.$ = r[o - 1]), i.setClickEvent(r[o - 1], r[o], null); + break; + case 36: + (this.$ = r[o - 2]), i.setClickEvent(r[o - 2], r[o - 1], r[o]); + break; + case 37: + (this.$ = r[o - 2]), i.setClickEvent(r[o - 2], r[o - 1], null), i.setLink(r[o - 2], r[o]); + break; + case 38: + (this.$ = r[o - 3]), i.setClickEvent(r[o - 3], r[o - 2], r[o - 1]), i.setLink(r[o - 3], r[o]); + break; + case 39: + (this.$ = r[o - 2]), i.setClickEvent(r[o - 2], r[o], null), i.setLink(r[o - 2], r[o - 1]); + break; + case 40: + (this.$ = r[o - 3]), i.setClickEvent(r[o - 3], r[o - 1], r[o]), i.setLink(r[o - 3], r[o - 2]); + break; + case 41: + (this.$ = r[o - 1]), i.setLink(r[o - 1], r[o]); + break; + case 42: + case 48: + this.$ = r[o - 1] + " " + r[o]; + break; + case 43: + case 44: + case 46: + this.$ = r[o - 2] + " " + r[o - 1] + " " + r[o]; + break; + case 45: + case 47: + this.$ = r[o - 3] + " " + r[o - 2] + " " + r[o - 1] + " " + r[o]; + break; + case 49: + i.parseDirective("%%{", "open_directive"); + break; + case 50: + i.parseDirective(r[o], "type_directive"); + break; + case 51: + (r[o] = r[o].trim().replace(/'/g, '"')), i.parseDirective(r[o], "arg_directive"); + break; + case 52: + i.parseDirective("}%%", "close_directive", "gantt"); + } + }, + table: [ + { 3: 1, 4: 2, 5: e, 38: 4, 48: n }, + { 1: [3] }, + { 3: 6, 4: 2, 5: e, 38: 4, 48: n }, + t(i, [2, 3], { 6: 7 }), + { 39: 8, 49: [1, 9] }, + { 49: [2, 49] }, + { 1: [2, 1] }, + { + 4: 31, + 7: [1, 10], + 8: 11, + 9: [1, 12], + 10: 13, + 11: [1, 14], + 12: 23, + 13: s, + 14: r, + 15: a, + 16: o, + 17: c, + 18: l, + 19: d, + 20: u, + 21: h, + 22: f, + 23: y, + 24: m, + 25: k, + 26: p, + 27: g, + 28: b, + 29: v, + 31: x, + 33: T, + 34: _, + 35: 29, + 36: w, + 38: 4, + 43: $, + 48: n, + }, + { 40: 40, 41: [1, 41], 51: D }, + t([41, 51], [2, 50]), + t(i, [2, 8], { 1: [2, 2] }), + t(i, [2, 4]), + { + 4: 31, + 10: 43, + 12: 23, + 13: s, + 14: r, + 15: a, + 16: o, + 17: c, + 18: l, + 19: d, + 20: u, + 21: h, + 22: f, + 23: y, + 24: m, + 25: k, + 26: p, + 27: g, + 28: b, + 29: v, + 31: x, + 33: T, + 34: _, + 35: 29, + 36: w, + 38: 4, + 43: $, + 48: n, + }, + t(i, [2, 6]), + t(i, [2, 7]), + t(i, [2, 16]), + t(i, [2, 17]), + t(i, [2, 18]), + t(i, [2, 19]), + t(i, [2, 20]), + t(i, [2, 21]), + t(i, [2, 22]), + t(i, [2, 23]), + t(i, [2, 24]), + t(i, [2, 25]), + { 30: [1, 44] }, + { 32: [1, 45] }, + t(i, [2, 28]), + t(i, [2, 29]), + t(i, [2, 30]), + { 37: [1, 46] }, + t(i, [2, 32]), + t(i, [2, 9]), + t(i, [2, 10]), + t(i, [2, 11]), + t(i, [2, 12]), + t(i, [2, 13]), + t(i, [2, 14]), + t(i, [2, 15]), + { 44: [1, 47], 46: [1, 48] }, + { 11: [1, 49] }, + { 42: 50, 50: [1, 51] }, + { 11: [2, 52] }, + t(i, [2, 5]), + t(i, [2, 26]), + t(i, [2, 27]), + t(i, [2, 31]), + t(i, [2, 35], { 45: [1, 52], 46: [1, 53] }), + t(i, [2, 41], { 44: [1, 54] }), + t(S, [2, 33]), + { 40: 55, 51: D }, + { 51: [2, 51] }, + t(i, [2, 36], { 46: [1, 56] }), + t(i, [2, 37]), + t(i, [2, 39], { 45: [1, 57] }), + { 11: [1, 58] }, + t(i, [2, 38]), + t(i, [2, 40]), + t(S, [2, 34]), + ], + defaultActions: { 5: [2, 49], 6: [2, 1], 42: [2, 52], 51: [2, 51] }, + parseError: function (t, e) { + if (!e.recoverable) { + var n = new Error(t); + throw ((n.hash = e), n); + } + this.trace(t); + }, + parse: function (t) { + var e = [0], + n = [], + i = [null], + s = [], + r = this.table, + a = "", + o = 0, + c = 0, + l = s.slice.call(arguments, 1), + d = Object.create(this.lexer), + u = { yy: {} }; + for (var h in this.yy) Object.prototype.hasOwnProperty.call(this.yy, h) && (u.yy[h] = this.yy[h]); + d.setInput(t, u.yy), (u.yy.lexer = d), (u.yy.parser = this), void 0 === d.yylloc && (d.yylloc = {}); + var f = d.yylloc; + s.push(f); + var y = d.options && d.options.ranges; + "function" == typeof u.yy.parseError + ? (this.parseError = u.yy.parseError) + : (this.parseError = Object.getPrototypeOf(this).parseError); + for (var m, k, p, g, b, v, x, T, _, w = {}; ; ) { + if ( + ((k = e[e.length - 1]), + this.defaultActions[k] + ? (p = this.defaultActions[k]) + : (null == m && + ((_ = void 0), + "number" != typeof (_ = n.pop() || d.lex() || 1) && + (_ instanceof Array && (_ = (n = _).pop()), (_ = this.symbols_[_] || _)), + (m = _)), + (p = r[k] && r[k][m])), + void 0 === p || !p.length || !p[0]) + ) { + var $; + for (b in ((T = []), r[k])) this.terminals_[b] && b > 2 && T.push("'" + this.terminals_[b] + "'"); + ($ = d.showPosition + ? "Parse error on line " + + (o + 1) + + ":\n" + + d.showPosition() + + "\nExpecting " + + T.join(", ") + + ", got '" + + (this.terminals_[m] || m) + + "'" + : "Parse error on line " + (o + 1) + ": Unexpected " + (1 == m ? "end of input" : "'" + (this.terminals_[m] || m) + "'")), + this.parseError($, { + text: d.match, + token: this.terminals_[m] || m, + line: d.yylineno, + loc: f, + expected: T, + }); + } + if (p[0] instanceof Array && p.length > 1) + throw new Error("Parse Error: multiple actions possible at state: " + k + ", token: " + m); + switch (p[0]) { + case 1: + e.push(m), + i.push(d.yytext), + s.push(d.yylloc), + e.push(p[1]), + (m = null), + (c = d.yyleng), + (a = d.yytext), + (o = d.yylineno), + (f = d.yylloc); + break; + case 2: + if ( + ((v = this.productions_[p[1]][1]), + (w.$ = i[i.length - v]), + (w._$ = { + first_line: s[s.length - (v || 1)].first_line, + last_line: s[s.length - 1].last_line, + first_column: s[s.length - (v || 1)].first_column, + last_column: s[s.length - 1].last_column, + }), + y && (w._$.range = [s[s.length - (v || 1)].range[0], s[s.length - 1].range[1]]), + void 0 !== (g = this.performAction.apply(w, [a, c, o, u.yy, p[1], i, s].concat(l)))) + ) + return g; + v && ((e = e.slice(0, -1 * v * 2)), (i = i.slice(0, -1 * v)), (s = s.slice(0, -1 * v))), + e.push(this.productions_[p[1]][0]), + i.push(w.$), + s.push(w._$), + (x = r[e[e.length - 2]][e[e.length - 1]]), + e.push(x); + break; + case 3: + return !0; + } + } + return !0; + }, + }, + E = { + EOF: 1, + parseError: function (t, e) { + if (!this.yy.parser) throw new Error(t); + this.yy.parser.parseError(t, e); + }, + setInput: function (t, e) { + return ( + (this.yy = e || this.yy || {}), + (this._input = t), + (this._more = this._backtrack = this.done = !1), + (this.yylineno = this.yyleng = 0), + (this.yytext = this.matched = this.match = ""), + (this.conditionStack = ["INITIAL"]), + (this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0, + }), + this.options.ranges && (this.yylloc.range = [0, 0]), + (this.offset = 0), + this + ); + }, + input: function () { + var t = this._input[0]; + return ( + (this.yytext += t), + this.yyleng++, + this.offset++, + (this.match += t), + (this.matched += t), + t.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, + this.options.ranges && this.yylloc.range[1]++, + (this._input = this._input.slice(1)), + t + ); + }, + unput: function (t) { + var e = t.length, + n = t.split(/(?:\r\n?|\n)/g); + (this._input = t + this._input), (this.yytext = this.yytext.substr(0, this.yytext.length - e)), (this.offset -= e); + var i = this.match.split(/(?:\r\n?|\n)/g); + (this.match = this.match.substr(0, this.match.length - 1)), + (this.matched = this.matched.substr(0, this.matched.length - 1)), + n.length - 1 && (this.yylineno -= n.length - 1); + var s = this.yylloc.range; + return ( + (this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: n + ? (n.length === i.length ? this.yylloc.first_column : 0) + i[i.length - n.length].length - n[0].length + : this.yylloc.first_column - e, + }), + this.options.ranges && (this.yylloc.range = [s[0], s[0] + this.yyleng - e]), + (this.yyleng = this.yytext.length), + this + ); + }, + more: function () { + return (this._more = !0), this; + }, + reject: function () { + return this.options.backtrack_lexer + ? ((this._backtrack = !0), this) + : this.parseError( + "Lexical error on line " + + (this.yylineno + 1) + + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + + this.showPosition(), + { text: "", token: null, line: this.yylineno }, + ); + }, + less: function (t) { + this.unput(this.match.slice(t)); + }, + pastInput: function () { + var t = this.matched.substr(0, this.matched.length - this.match.length); + return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, ""); + }, + upcomingInput: function () { + var t = this.match; + return ( + t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "") + ); + }, + showPosition: function () { + var t = this.pastInput(), + e = new Array(t.length + 1).join("-"); + return t + this.upcomingInput() + "\n" + e + "^"; + }, + test_match: function (t, e) { + var n, i, s; + if ( + (this.options.backtrack_lexer && + ((s = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column, + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done, + }), + this.options.ranges && (s.yylloc.range = this.yylloc.range.slice(0))), + (i = t[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += i.length), + (this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: i ? i[i.length - 1].length - i[i.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length, + }), + (this.yytext += t[0]), + (this.match += t[0]), + (this.matches = t), + (this.yyleng = this.yytext.length), + this.options.ranges && (this.yylloc.range = [this.offset, (this.offset += this.yyleng)]), + (this._more = !1), + (this._backtrack = !1), + (this._input = this._input.slice(t[0].length)), + (this.matched += t[0]), + (n = this.performAction.call(this, this.yy, this, e, this.conditionStack[this.conditionStack.length - 1])), + this.done && this._input && (this.done = !1), + n) + ) + return n; + if (this._backtrack) { + for (var r in s) this[r] = s[r]; + return !1; + } + return !1; + }, + next: function () { + if (this.done) return this.EOF; + var t, e, n, i; + this._input || (this.done = !0), this._more || ((this.yytext = ""), (this.match = "")); + for (var s = this._currentRules(), r = 0; r < s.length; r++) + if ((n = this._input.match(this.rules[s[r]])) && (!e || n[0].length > e[0].length)) { + if (((e = n), (i = r), this.options.backtrack_lexer)) { + if (!1 !== (t = this.test_match(n, s[r]))) return t; + if (this._backtrack) { + e = !1; + continue; + } + return !1; + } + if (!this.options.flex) break; + } + return e + ? !1 !== (t = this.test_match(e, s[i])) && t + : "" === this._input + ? this.EOF + : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno, + }); + }, + lex: function () { + return this.next() || this.lex(); + }, + begin: function (t) { + this.conditionStack.push(t); + }, + popState: function () { + return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]; + }, + _currentRules: function () { + return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] + ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules + : this.conditions.INITIAL.rules; + }, + topState: function (t) { + return (t = this.conditionStack.length - 1 - Math.abs(t || 0)) >= 0 ? this.conditionStack[t] : "INITIAL"; + }, + pushState: function (t) { + this.begin(t); + }, + stateStackSize: function () { + return this.conditionStack.length; + }, + options: { "case-insensitive": !0 }, + performAction: function (t, e, n, i) { + switch (n) { + case 0: + return this.begin("open_directive"), 48; + case 1: + return this.begin("type_directive"), 49; + case 2: + return this.popState(), this.begin("arg_directive"), 41; + case 3: + return this.popState(), this.popState(), 51; + case 4: + return 50; + case 5: + return this.begin("acc_title"), 29; + case 6: + return this.popState(), "acc_title_value"; + case 7: + return this.begin("acc_descr"), 31; + case 8: + return this.popState(), "acc_descr_value"; + case 9: + this.begin("acc_descr_multiline"); + break; + case 10: + case 20: + case 23: + case 26: + case 29: + this.popState(); + break; + case 11: + return "acc_descr_multiline_value"; + case 12: + case 13: + case 14: + case 16: + case 17: + case 18: + break; + case 15: + return 11; + case 19: + this.begin("href"); + break; + case 21: + return 46; + case 22: + this.begin("callbackname"); + break; + case 24: + this.popState(), this.begin("callbackargs"); + break; + case 25: + return 44; + case 27: + return 45; + case 28: + this.begin("click"); + break; + case 30: + return 43; + case 31: + return 5; + case 32: + return 20; + case 33: + return 21; + case 34: + return 22; + case 35: + return 23; + case 36: + return 24; + case 37: + return 26; + case 38: + return 25; + case 39: + return 27; + case 40: + return 13; + case 41: + return 14; + case 42: + return 15; + case 43: + return 16; + case 44: + return 17; + case 45: + return 18; + case 46: + return 19; + case 47: + return "date"; + case 48: + return 28; + case 49: + return "accDescription"; + case 50: + return 34; + case 51: + return 36; + case 52: + return 37; + case 53: + return 41; + case 54: + return 7; + case 55: + return "INVALID"; + } + }, + rules: [ + /^(?:%%\{)/i, + /^(?:((?:(?!\}%%)[^:.])*))/i, + /^(?::)/i, + /^(?:\}%%)/i, + /^(?:((?:(?!\}%%).|\n)*))/i, + /^(?:accTitle\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*\{\s*)/i, + /^(?:[\}])/i, + /^(?:[^\}]*)/i, + /^(?:%%(?!\{)*[^\n]*)/i, + /^(?:[^\}]%%*[^\n]*)/i, + /^(?:%%*[^\n]*[\n]*)/i, + /^(?:[\n]+)/i, + /^(?:\s+)/i, + /^(?:#[^\n]*)/i, + /^(?:%[^\n]*)/i, + /^(?:href[\s]+["])/i, + /^(?:["])/i, + /^(?:[^"]*)/i, + /^(?:call[\s]+)/i, + /^(?:\([\s]*\))/i, + /^(?:\()/i, + /^(?:[^(]*)/i, + /^(?:\))/i, + /^(?:[^)]*)/i, + /^(?:click[\s]+)/i, + /^(?:[\s\n])/i, + /^(?:[^\s\n]*)/i, + /^(?:gantt\b)/i, + /^(?:dateFormat\s[^#\n;]+)/i, + /^(?:inclusiveEndDates\b)/i, + /^(?:topAxis\b)/i, + /^(?:axisFormat\s[^#\n;]+)/i, + /^(?:tickInterval\s[^#\n;]+)/i, + /^(?:includes\s[^#\n;]+)/i, + /^(?:excludes\s[^#\n;]+)/i, + /^(?:todayMarker\s[^\n;]+)/i, + /^(?:weekday\s+monday\b)/i, + /^(?:weekday\s+tuesday\b)/i, + /^(?:weekday\s+wednesday\b)/i, + /^(?:weekday\s+thursday\b)/i, + /^(?:weekday\s+friday\b)/i, + /^(?:weekday\s+saturday\b)/i, + /^(?:weekday\s+sunday\b)/i, + /^(?:\d\d\d\d-\d\d-\d\d\b)/i, + /^(?:title\s[^#\n;]+)/i, + /^(?:accDescription\s[^#\n;]+)/i, + /^(?:section\s[^#:\n;]+)/i, + /^(?:[^#:\n;]+)/i, + /^(?::[^#\n;]+)/i, + /^(?::)/i, + /^(?:$)/i, + /^(?:.)/i, + ], + conditions: { + acc_descr_multiline: { rules: [10, 11], inclusive: !1 }, + acc_descr: { rules: [8], inclusive: !1 }, + acc_title: { rules: [6], inclusive: !1 }, + close_directive: { rules: [], inclusive: !1 }, + arg_directive: { rules: [3, 4], inclusive: !1 }, + type_directive: { rules: [2, 3], inclusive: !1 }, + open_directive: { rules: [1], inclusive: !1 }, + callbackargs: { rules: [26, 27], inclusive: !1 }, + callbackname: { rules: [23, 24, 25], inclusive: !1 }, + href: { rules: [20, 21], inclusive: !1 }, + click: { rules: [29, 30], inclusive: !1 }, + INITIAL: { + rules: [ + 0, 5, 7, 9, 12, 13, 14, 15, 16, 17, 18, 19, 22, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, + ], + inclusive: !0, + }, + }, + }; + function M() { + this.yy = {}; + } + return (C.lexer = E), (M.prototype = C), (C.Parser = M), new M(); + })()); + d.parser = d; + const u = d; + s.extend(r), s.extend(a), s.extend(o); + let h, + f = "", + y = "", + m = "", + k = [], + p = [], + g = {}, + b = [], + v = [], + x = "", + T = ""; + const _ = ["active", "done", "crit", "milestone"]; + let w = [], + $ = !1, + D = !1, + S = "sunday", + C = 0; + const E = function (t, e, n, i) { + return ( + !i.includes(t.format(e.trim())) && + (!!(t.isoWeekday() >= 6 && n.includes("weekends")) || !!n.includes(t.format("dddd").toLowerCase()) || n.includes(t.format(e.trim()))) + ); + }, + M = function (t, e, n, i) { + if (!n.length || t.manualEndTime) return; + let r, a; + (r = t.startTime instanceof Date ? s(t.startTime) : s(t.startTime, e, !0)), + (r = r.add(1, "d")), + (a = t.endTime instanceof Date ? s(t.endTime) : s(t.endTime, e, !0)); + const [o, c] = Y(r, a, e, n, i); + (t.endTime = o.toDate()), (t.renderEndTime = c); + }, + Y = function (t, e, n, i, s) { + let r = !1, + a = null; + for (; t <= e; ) r || (a = e.toDate()), (r = E(t, n, i, s)), r && (e = e.add(1, "d")), (t = t.add(1, "d")); + return [e, a]; + }, + A = function (t, e, n) { + n = n.trim(); + const i = /^after\s+([\d\w- ]+)/.exec(n.trim()); + if (null !== i) { + let t = null; + if ( + (i[1].split(" ").forEach(function (e) { + let n = N(e); + void 0 !== n && (t ? n.endTime > t.endTime && (t = n) : (t = n)); + }), + t) + ) + return t.endTime; + { + const t = new Date(); + return t.setHours(0, 0, 0, 0), t; + } + } + let r = s(n, e.trim(), !0); + if (r.isValid()) return r.toDate(); + { + c.l.debug("Invalid date:" + n), c.l.debug("With date format:" + e.trim()); + const t = new Date(n); + if (void 0 === t || isNaN(t.getTime()) || t.getFullYear() < -1e4 || t.getFullYear() > 1e4) throw new Error("Invalid date:" + n); + return t; + } + }, + L = function (t) { + const e = /^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim()); + return null !== e ? [Number.parseFloat(e[1]), e[2]] : [NaN, "ms"]; + }, + F = function (t, e, n, i = !1) { + n = n.trim(); + let r = s(n, e.trim(), !0); + if (r.isValid()) return i && (r = r.add(1, "d")), r.toDate(); + let a = s(t); + const [o, c] = L(n); + if (!Number.isNaN(o)) { + const t = a.add(o, c); + t.isValid() && (a = t); + } + return a.toDate(); + }; + let I = 0; + const O = function (t) { + return void 0 === t ? ((I += 1), "task" + I) : t; + }; + let W, + z, + B = []; + const P = {}, + N = function (t) { + const e = P[t]; + return B[e]; + }, + H = function () { + const t = function (t) { + const e = B[t]; + let n = ""; + switch (B[t].raw.startTime.type) { + case "prevTaskEnd": { + const t = N(e.prevTaskId); + e.startTime = t.endTime; + break; + } + case "getStartDate": + (n = A(0, f, B[t].raw.startTime.startData)), n && (B[t].startTime = n); + } + return ( + B[t].startTime && + ((B[t].endTime = F(B[t].startTime, f, B[t].raw.endTime.data, $)), + B[t].endTime && + ((B[t].processed = !0), (B[t].manualEndTime = s(B[t].raw.endTime.data, "YYYY-MM-DD", !0).isValid()), M(B[t], f, p, k))), + B[t].processed + ); + }; + let e = !0; + for (const [n, i] of B.entries()) t(n), (e = e && i.processed); + return e; + }, + j = function (t, e) { + t.split(",").forEach(function (t) { + let n = N(t); + void 0 !== n && n.classes.push(e); + }); + }, + Z = function (t, e) { + w.push( + function () { + const n = document.querySelector(`[id="${t}"]`); + null !== n && + n.addEventListener("click", function () { + e(); + }); + }, + function () { + const n = document.querySelector(`[id="${t}-text"]`); + null !== n && + n.addEventListener("click", function () { + e(); + }); + }, + ); + }, + G = { + parseDirective: function (t, e, n) { + c.m.parseDirective(this, t, e, n); + }, + getConfig: () => (0, c.c)().gantt, + clear: function () { + (b = []), + (v = []), + (x = ""), + (w = []), + (I = 0), + (W = void 0), + (z = void 0), + (B = []), + (f = ""), + (y = ""), + (T = ""), + (h = void 0), + (m = ""), + (k = []), + (p = []), + ($ = !1), + (D = !1), + (C = 0), + (g = {}), + (0, c.v)(), + (S = "sunday"); + }, + setDateFormat: function (t) { + f = t; + }, + getDateFormat: function () { + return f; + }, + enableInclusiveEndDates: function () { + $ = !0; + }, + endDatesAreInclusive: function () { + return $; + }, + enableTopAxis: function () { + D = !0; + }, + topAxisEnabled: function () { + return D; + }, + setAxisFormat: function (t) { + y = t; + }, + getAxisFormat: function () { + return y; + }, + setTickInterval: function (t) { + h = t; + }, + getTickInterval: function () { + return h; + }, + setTodayMarker: function (t) { + m = t; + }, + getTodayMarker: function () { + return m; + }, + setAccTitle: c.s, + getAccTitle: c.g, + setDiagramTitle: c.r, + getDiagramTitle: c.t, + setDisplayMode: function (t) { + T = t; + }, + getDisplayMode: function () { + return T; + }, + setAccDescription: c.b, + getAccDescription: c.a, + addSection: function (t) { + (x = t), b.push(t); + }, + getSections: function () { + return b; + }, + getTasks: function () { + let t = H(), + e = 0; + for (; !t && e < 10; ) (t = H()), e++; + return (v = B), v; + }, + addTask: function (t, e) { + const n = { + section: x, + type: x, + processed: !1, + manualEndTime: !1, + renderEndTime: null, + raw: { data: e }, + task: t, + classes: [], + }, + i = (function (t, e) { + let n; + n = ":" === e.substr(0, 1) ? e.substr(1, e.length) : e; + const i = n.split(","), + s = {}; + V(i, s, _); + for (let t = 0; t < i.length; t++) i[t] = i[t].trim(); + switch (i.length) { + case 1: + (s.id = O()), (s.startTime = { type: "prevTaskEnd", id: t }), (s.endTime = { data: i[0] }); + break; + case 2: + (s.id = O()), (s.startTime = { type: "getStartDate", startData: i[0] }), (s.endTime = { data: i[1] }); + break; + case 3: + (s.id = O(i[0])), (s.startTime = { type: "getStartDate", startData: i[1] }), (s.endTime = { data: i[2] }); + } + return s; + })(z, e); + (n.raw.startTime = i.startTime), + (n.raw.endTime = i.endTime), + (n.id = i.id), + (n.prevTaskId = z), + (n.active = i.active), + (n.done = i.done), + (n.crit = i.crit), + (n.milestone = i.milestone), + (n.order = C), + C++; + const s = B.push(n); + (z = n.id), (P[n.id] = s - 1); + }, + findTaskById: N, + addTaskOrg: function (t, e) { + const n = { section: x, type: x, description: t, task: t, classes: [] }, + i = (function (t, e) { + let n; + n = ":" === e.substr(0, 1) ? e.substr(1, e.length) : e; + const i = n.split(","), + r = {}; + V(i, r, _); + for (let t = 0; t < i.length; t++) i[t] = i[t].trim(); + let a = ""; + switch (i.length) { + case 1: + (r.id = O()), (r.startTime = t.endTime), (a = i[0]); + break; + case 2: + (r.id = O()), (r.startTime = A(0, f, i[0])), (a = i[1]); + break; + case 3: + (r.id = O(i[0])), (r.startTime = A(0, f, i[1])), (a = i[2]); + } + return a && ((r.endTime = F(r.startTime, f, a, $)), (r.manualEndTime = s(a, "YYYY-MM-DD", !0).isValid()), M(r, f, p, k)), r; + })(W, e); + (n.startTime = i.startTime), + (n.endTime = i.endTime), + (n.id = i.id), + (n.active = i.active), + (n.done = i.done), + (n.crit = i.crit), + (n.milestone = i.milestone), + (W = n), + v.push(n); + }, + setIncludes: function (t) { + k = t.toLowerCase().split(/[\s,]+/); + }, + getIncludes: function () { + return k; + }, + setExcludes: function (t) { + p = t.toLowerCase().split(/[\s,]+/); + }, + getExcludes: function () { + return p; + }, + setClickEvent: function (t, e, n) { + t.split(",").forEach(function (t) { + !(function (t, e, n) { + if ("loose" !== (0, c.c)().securityLevel) return; + if (void 0 === e) return; + let i = []; + if ("string" == typeof n) { + i = n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); + for (let t = 0; t < i.length; t++) { + let e = i[t].trim(); + '"' === e.charAt(0) && '"' === e.charAt(e.length - 1) && (e = e.substr(1, e.length - 2)), (i[t] = e); + } + } + 0 === i.length && i.push(t), + void 0 !== N(t) && + Z(t, () => { + c.u.runFunc(e, ...i); + }); + })(t, e, n); + }), + j(t, "clickable"); + }, + setLink: function (t, e) { + let n = e; + "loose" !== (0, c.c)().securityLevel && (n = (0, i.Nm)(e)), + t.split(",").forEach(function (t) { + void 0 !== N(t) && + (Z(t, () => { + window.open(n, "_self"); + }), + (g[t] = n)); + }), + j(t, "clickable"); + }, + getLinks: function () { + return g; + }, + bindFunctions: function (t) { + w.forEach(function (e) { + e(t); + }); + }, + parseDuration: L, + isInvalidDate: E, + setWeekday: function (t) { + S = t; + }, + getWeekday: function () { + return S; + }, + }; + function V(t, e, n) { + let i = !0; + for (; i; ) + (i = !1), + n.forEach(function (n) { + const s = new RegExp("^\\s*" + n + "\\s*$"); + t[0].match(s) && ((e[n] = !0), t.shift(1), (i = !0)); + }); + } + const R = { + monday: l.Ox9, + tuesday: l.YDX, + wednesday: l.EFj, + thursday: l.Igq, + friday: l.y2j, + saturday: l.LqH, + sunday: l.Zyz, + }, + q = (t, e) => { + let n = [...t].map(() => -1 / 0), + i = [...t].sort((t, e) => t.startTime - e.startTime || t.order - e.order), + s = 0; + for (const t of i) + for (let i = 0; i < n.length; i++) + if (t.startTime >= n[i]) { + (n[i] = t.endTime), (t.order = i + e), i > s && (s = i); + break; + } + return s; + }; + let U; + const X = { + parser: u, + db: G, + renderer: { + setConf: function () { + c.l.debug("Something is calling, setConf, remove the call"); + }, + draw: function (t, e, n, i) { + const r = (0, c.c)().gantt, + a = (0, c.c)().securityLevel; + let o; + "sandbox" === a && (o = (0, l.Ys)("#i" + e)); + const d = "sandbox" === a ? (0, l.Ys)(o.nodes()[0].contentDocument.body) : (0, l.Ys)("body"), + u = "sandbox" === a ? o.nodes()[0].contentDocument : document, + h = u.getElementById(e); + (U = h.parentElement.offsetWidth), void 0 === U && (U = 1200), void 0 !== r.useWidth && (U = r.useWidth); + const f = i.db.getTasks(); + let y = []; + for (const t of f) y.push(t.type); + y = (function (t) { + const e = {}, + n = []; + for (let i = 0, s = t.length; i < s; ++i) Object.prototype.hasOwnProperty.call(e, t[i]) || ((e[t[i]] = !0), n.push(t[i])); + return n; + })(y); + const m = {}; + let k = 2 * r.topPadding; + if ("compact" === i.db.getDisplayMode() || "compact" === r.displayMode) { + const t = {}; + for (const e of f) void 0 === t[e.section] ? (t[e.section] = [e]) : t[e.section].push(e); + let e = 0; + for (const n of Object.keys(t)) { + const i = q(t[n], e) + 1; + (e += i), (k += i * (r.barHeight + r.barGap)), (m[n] = i); + } + } else { + k += f.length * (r.barHeight + r.barGap); + for (const t of y) m[t] = f.filter((e) => e.type === t).length; + } + h.setAttribute("viewBox", "0 0 " + U + " " + k); + const p = d.select(`[id="${e}"]`), + g = (0, l.Xf)() + .domain([ + (0, l.VV$)(f, function (t) { + return t.startTime; + }), + (0, l.Fp7)(f, function (t) { + return t.endTime; + }), + ]) + .rangeRound([0, U - r.leftPadding - r.rightPadding]); + f.sort(function (t, e) { + const n = t.startTime, + i = e.startTime; + let s = 0; + return n > i ? (s = 1) : n < i && (s = -1), s; + }), + (function (t, n, a) { + const o = r.barHeight, + d = o + r.barGap, + h = r.topPadding, + f = r.leftPadding; + (0, l.BYU)().domain([0, y.length]).range(["#00B9FA", "#F95002"]).interpolate(l.JHv), + (function (t, e, n, a, o, c, l, d) { + const u = c.reduce((t, { startTime: e }) => (t ? Math.min(t, e) : e), 0), + h = c.reduce((t, { endTime: e }) => (t ? Math.max(t, e) : e), 0), + f = i.db.getDateFormat(); + if (!u || !h) return; + const y = []; + let m = null, + k = s(u); + for (; k.valueOf() <= h; ) + i.db.isInvalidDate(k, f, l, d) ? (m ? (m.end = k) : (m = { start: k, end: k })) : m && (y.push(m), (m = null)), + (k = k.add(1, "d")); + p.append("g") + .selectAll("rect") + .data(y) + .enter() + .append("rect") + .attr("id", function (t) { + return "exclude-" + t.start.format("YYYY-MM-DD"); + }) + .attr("x", function (t) { + return g(t.start) + n; + }) + .attr("y", r.gridLineStartPadding) + .attr("width", function (t) { + const e = t.end.add(1, "day"); + return g(e) - g(t.start); + }) + .attr("height", o - e - r.gridLineStartPadding) + .attr("transform-origin", function (e, i) { + return (g(e.start) + n + 0.5 * (g(e.end) - g(e.start))).toString() + "px " + (i * t + 0.5 * o).toString() + "px"; + }) + .attr("class", "exclude-range"); + })(d, h, f, 0, a, t, i.db.getExcludes(), i.db.getIncludes()), + (function (t, e, n, s) { + let a = (0, l.LLu)(g) + .tickSize(-s + e + r.gridLineStartPadding) + .tickFormat((0, l.i$Z)(i.db.getAxisFormat() || r.axisFormat || "%Y-%m-%d")); + const o = /^([1-9]\d*)(minute|hour|day|week|month)$/.exec(i.db.getTickInterval() || r.tickInterval); + if (null !== o) { + const t = o[1], + e = o[2], + n = i.db.getWeekday() || r.weekday; + switch (e) { + case "minute": + a.ticks(l.Z_i.every(t)); + break; + case "hour": + a.ticks(l.WQD.every(t)); + break; + case "day": + a.ticks(l.rr1.every(t)); + break; + case "week": + a.ticks(R[n].every(t)); + break; + case "month": + a.ticks(l.F0B.every(t)); + } + } + if ( + (p + .append("g") + .attr("class", "grid") + .attr("transform", "translate(" + t + ", " + (s - 50) + ")") + .call(a) + .selectAll("text") + .style("text-anchor", "middle") + .attr("fill", "#000") + .attr("stroke", "none") + .attr("font-size", 10) + .attr("dy", "1em"), + i.db.topAxisEnabled() || r.topAxis) + ) { + let n = (0, l.F5q)(g) + .tickSize(-s + e + r.gridLineStartPadding) + .tickFormat((0, l.i$Z)(i.db.getAxisFormat() || r.axisFormat || "%Y-%m-%d")); + if (null !== o) { + const t = o[1], + e = o[2], + s = i.db.getWeekday() || r.weekday; + switch (e) { + case "minute": + n.ticks(l.Z_i.every(t)); + break; + case "hour": + n.ticks(l.WQD.every(t)); + break; + case "day": + n.ticks(l.rr1.every(t)); + break; + case "week": + n.ticks(R[s].every(t)); + break; + case "month": + n.ticks(l.F0B.every(t)); + } + } + p.append("g") + .attr("class", "grid") + .attr("transform", "translate(" + t + ", " + e + ")") + .call(n) + .selectAll("text") + .style("text-anchor", "middle") + .attr("fill", "#000") + .attr("stroke", "none") + .attr("font-size", 10); + } + })(f, h, 0, a), + (function (t, n, s, a, o, d, u) { + const h = [...new Set(t.map((t) => t.order))].map((e) => t.find((t) => t.order === e)); + p.append("g") + .selectAll("rect") + .data(h) + .enter() + .append("rect") + .attr("x", 0) + .attr("y", function (t, e) { + return t.order * n + s - 2; + }) + .attr("width", function () { + return u - r.rightPadding / 2; + }) + .attr("height", n) + .attr("class", function (t) { + for (const [e, n] of y.entries()) if (t.type === n) return "section section" + (e % r.numberSectionStyles); + return "section section0"; + }); + const f = p.append("g").selectAll("rect").data(t).enter(), + m = i.db.getLinks(); + if ( + (f + .append("rect") + .attr("id", function (t) { + return t.id; + }) + .attr("rx", 3) + .attr("ry", 3) + .attr("x", function (t) { + return t.milestone ? g(t.startTime) + a + 0.5 * (g(t.endTime) - g(t.startTime)) - 0.5 * o : g(t.startTime) + a; + }) + .attr("y", function (t, e) { + return t.order * n + s; + }) + .attr("width", function (t) { + return t.milestone ? o : g(t.renderEndTime || t.endTime) - g(t.startTime); + }) + .attr("height", o) + .attr("transform-origin", function (t, e) { + return ( + (e = t.order), + (g(t.startTime) + a + 0.5 * (g(t.endTime) - g(t.startTime))).toString() + "px " + (e * n + s + 0.5 * o).toString() + "px" + ); + }) + .attr("class", function (t) { + let e = ""; + t.classes.length > 0 && (e = t.classes.join(" ")); + let n = 0; + for (const [e, i] of y.entries()) t.type === i && (n = e % r.numberSectionStyles); + let i = ""; + return ( + t.active + ? t.crit + ? (i += " activeCrit") + : (i = " active") + : t.done + ? (i = t.crit ? " doneCrit" : " done") + : t.crit && (i += " crit"), + 0 === i.length && (i = " task"), + t.milestone && (i = " milestone " + i), + (i += n), + (i += " " + e), + "task" + i + ); + }), + f + .append("text") + .attr("id", function (t) { + return t.id + "-text"; + }) + .text(function (t) { + return t.task; + }) + .attr("font-size", r.fontSize) + .attr("x", function (t) { + let e = g(t.startTime), + n = g(t.renderEndTime || t.endTime); + t.milestone && (e += 0.5 * (g(t.endTime) - g(t.startTime)) - 0.5 * o), t.milestone && (n = e + o); + const i = this.getBBox().width; + return i > n - e ? (n + i + 1.5 * r.leftPadding > u ? e + a - 5 : n + a + 5) : (n - e) / 2 + e + a; + }) + .attr("y", function (t, e) { + return t.order * n + r.barHeight / 2 + (r.fontSize / 2 - 2) + s; + }) + .attr("text-height", o) + .attr("class", function (t) { + const e = g(t.startTime); + let n = g(t.endTime); + t.milestone && (n = e + o); + const i = this.getBBox().width; + let s = ""; + t.classes.length > 0 && (s = t.classes.join(" ")); + let a = 0; + for (const [e, n] of y.entries()) t.type === n && (a = e % r.numberSectionStyles); + let c = ""; + return ( + t.active && (c = t.crit ? "activeCritText" + a : "activeText" + a), + t.done ? (c = t.crit ? c + " doneCritText" + a : c + " doneText" + a) : t.crit && (c = c + " critText" + a), + t.milestone && (c += " milestoneText"), + i > n - e + ? n + i + 1.5 * r.leftPadding > u + ? s + " taskTextOutsideLeft taskTextOutside" + a + " " + c + : s + " taskTextOutsideRight taskTextOutside" + a + " " + c + " width-" + i + : s + " taskText taskText" + a + " " + c + " width-" + i + ); + }), + "sandbox" === (0, c.c)().securityLevel) + ) { + let t; + t = (0, l.Ys)("#i" + e); + const n = t.nodes()[0].contentDocument; + f.filter(function (t) { + return void 0 !== m[t.id]; + }).each(function (t) { + var e = n.querySelector("#" + t.id), + i = n.querySelector("#" + t.id + "-text"); + const s = e.parentNode; + var r = n.createElement("a"); + r.setAttribute("xlink:href", m[t.id]), r.setAttribute("target", "_top"), s.appendChild(r), r.appendChild(e), r.appendChild(i); + }); + } + })(t, d, h, f, o, 0, n), + (function (t, e) { + let n = 0; + const i = Object.keys(m).map((t) => [t, m[t]]); + p.append("g") + .selectAll("text") + .data(i) + .enter() + .append(function (t) { + const e = t[0].split(c.e.lineBreakRegex), + n = -(e.length - 1) / 2, + i = u.createElementNS("http://www.w3.org/2000/svg", "text"); + i.setAttribute("dy", n + "em"); + for (const [t, n] of e.entries()) { + const e = u.createElementNS("http://www.w3.org/2000/svg", "tspan"); + e.setAttribute("alignment-baseline", "central"), + e.setAttribute("x", "10"), + t > 0 && e.setAttribute("dy", "1em"), + (e.textContent = n), + i.appendChild(e); + } + return i; + }) + .attr("x", 10) + .attr("y", function (s, r) { + if (!(r > 0)) return (s[1] * t) / 2 + e; + for (let a = 0; a < r; a++) return (n += i[r - 1][1]), (s[1] * t) / 2 + n * t + e; + }) + .attr("font-size", r.sectionFontSize) + .attr("class", function (t) { + for (const [e, n] of y.entries()) if (t[0] === n) return "sectionTitle sectionTitle" + (e % r.numberSectionStyles); + return "sectionTitle"; + }); + })(d, h), + (function (t, e, n, s) { + const a = i.db.getTodayMarker(); + if ("off" === a) return; + const o = p.append("g").attr("class", "today"), + c = new Date(), + l = o.append("line"); + l + .attr("x1", g(c) + t) + .attr("x2", g(c) + t) + .attr("y1", r.titleTopMargin) + .attr("y2", s - r.titleTopMargin) + .attr("class", "today"), + "" !== a && l.attr("style", a.replace(/,/g, ";")); + })(f, 0, 0, a); + })(f, U, k), + (0, c.i)(p, k, U, r.useMaxWidth), + p + .append("text") + .text(i.db.getDiagramTitle()) + .attr("x", U / 2) + .attr("y", r.titleTopMargin) + .attr("class", "titleText"); + }, + }, + styles: (t) => + `\n .mermaid-main-font {\n font-family: "trebuchet ms", verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n .exclude-range {\n fill: ${t.excludeBkgColor};\n }\n\n .section {\n stroke: none;\n opacity: 0.2;\n }\n\n .section0 {\n fill: ${t.sectionBkgColor};\n }\n\n .section2 {\n fill: ${t.sectionBkgColor2};\n }\n\n .section1,\n .section3 {\n fill: ${t.altSectionBkgColor};\n opacity: 0.2;\n }\n\n .sectionTitle0 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle1 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle2 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle3 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle {\n text-anchor: start;\n // font-size: ${t.ganttFontSize};\n // text-height: 14px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n\n }\n\n\n /* Grid and axis */\n\n .grid .tick {\n stroke: ${t.gridColor};\n opacity: 0.8;\n shape-rendering: crispEdges;\n text {\n font-family: ${t.fontFamily};\n fill: ${t.textColor};\n }\n }\n\n .grid path {\n stroke-width: 0;\n }\n\n\n /* Today line */\n\n .today {\n fill: none;\n stroke: ${t.todayLineColor};\n stroke-width: 2px;\n }\n\n\n /* Task styling */\n\n /* Default task */\n\n .task {\n stroke-width: 2;\n }\n\n .taskText {\n text-anchor: middle;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n\n // .taskText:not([font-size]) {\n // font-size: ${t.ganttFontSize};\n // }\n\n .taskTextOutsideRight {\n fill: ${t.taskTextDarkColor};\n text-anchor: start;\n // font-size: ${t.ganttFontSize};\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n\n }\n\n .taskTextOutsideLeft {\n fill: ${t.taskTextDarkColor};\n text-anchor: end;\n // font-size: ${t.ganttFontSize};\n }\n\n /* Special case clickable */\n .task.clickable {\n cursor: pointer;\n }\n .taskText.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n /* Specific task settings for the sections*/\n\n .taskText0,\n .taskText1,\n .taskText2,\n .taskText3 {\n fill: ${t.taskTextColor};\n }\n\n .task0,\n .task1,\n .task2,\n .task3 {\n fill: ${t.taskBkgColor};\n stroke: ${t.taskBorderColor};\n }\n\n .taskTextOutside0,\n .taskTextOutside2\n {\n fill: ${t.taskTextOutsideColor};\n }\n\n .taskTextOutside1,\n .taskTextOutside3 {\n fill: ${t.taskTextOutsideColor};\n }\n\n\n /* Active task */\n\n .active0,\n .active1,\n .active2,\n .active3 {\n fill: ${t.activeTaskBkgColor};\n stroke: ${t.activeTaskBorderColor};\n }\n\n .activeText0,\n .activeText1,\n .activeText2,\n .activeText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n\n /* Completed task */\n\n .done0,\n .done1,\n .done2,\n .done3 {\n stroke: ${t.doneTaskBorderColor};\n fill: ${t.doneTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneText0,\n .doneText1,\n .doneText2,\n .doneText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n\n /* Tasks on the critical line */\n\n .crit0,\n .crit1,\n .crit2,\n .crit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.critBkgColor};\n stroke-width: 2;\n }\n\n .activeCrit0,\n .activeCrit1,\n .activeCrit2,\n .activeCrit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.activeTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneCrit0,\n .doneCrit1,\n .doneCrit2,\n .doneCrit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.doneTaskBkgColor};\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges;\n }\n\n .milestone {\n transform: rotate(45deg) scale(0.8,0.8);\n }\n\n .milestoneText {\n font-style: italic;\n }\n .doneCritText0,\n .doneCritText1,\n .doneCritText2,\n .doneCritText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n .activeCritText0,\n .activeCritText1,\n .activeCritText2,\n .activeCritText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n .titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor} ;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n`, + }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/81-4e653aac.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/81-4e653aac.chunk.min.js new file mode 100644 index 000000000..69700462a --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/81-4e653aac.chunk.min.js @@ -0,0 +1,425 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [81], + { + 3349: function (e, t, n) { + n.d(t, { + a: function () { + return l; + }, + }); + var r = n(6225); + function l(e, t) { + var n = e.append("foreignObject").attr("width", "100000"), + l = n.append("xhtml:div"); + l.attr("xmlns", "http://www.w3.org/1999/xhtml"); + var o = t.label; + switch (typeof o) { + case "function": + l.insert(o); + break; + case "object": + l.insert(function () { + return o; + }); + break; + default: + l.html(o); + } + r.bg(l, t.labelStyle), l.style("display", "inline-block"), l.style("white-space", "nowrap"); + var a = l.node().getBoundingClientRect(); + return n.attr("width", a.width).attr("height", a.height), n; + } + }, + 6225: function (e, t, n) { + n.d(t, { + $p: function () { + return d; + }, + O1: function () { + return a; + }, + WR: function () { + return p; + }, + bF: function () { + return o; + }, + bg: function () { + return c; + }, + }); + var r = n(7514), + l = n(3234); + function o(e, t) { + return !!e.children(t).length; + } + function a(e) { + return s(e.v) + ":" + s(e.w) + ":" + s(e.name); + } + var i = /:/g; + function s(e) { + return e ? String(e).replace(i, "\\:") : ""; + } + function c(e, t) { + t && e.attr("style", t); + } + function d(e, t, n) { + t && e.attr("class", t).attr("class", n + " " + e.attr("class")); + } + function p(e, t) { + var n = t.graph(); + if (r.Z(n)) { + var o = n.transition; + if (l.Z(o)) return o(e); + } + return e; + } + }, + 3081: function (e, t, n) { + n.d(t, { + diagram: function () { + return a; + }, + }); + var r = n(1813), + l = n(8912), + o = n(9339); + n(7274), n(5625), n(3771), n(9368), n(7484), n(7967), n(7856); + const a = { + parser: r.p, + db: r.f, + renderer: l.f, + styles: l.a, + init: (e) => { + e.flowchart || (e.flowchart = {}), + (e.flowchart.arrowMarkerAbsolute = e.arrowMarkerAbsolute), + (0, o.q)({ flowchart: { arrowMarkerAbsolute: e.arrowMarkerAbsolute } }), + l.f.setConf(e.flowchart), + r.f.clear(), + r.f.setGen("gen-2"); + }, + }; + }, + 8912: function (e, t, n) { + n.d(t, { + a: function () { + return h; + }, + f: function () { + return w; + }, + }); + var r = n(5625), + l = n(7274), + o = n(9339), + a = n(6476), + i = n(3349), + s = n(5971), + c = n(1767), + d = (e, t) => s.Z.lang.round(c.Z.parse(e)[t]), + p = n(1117); + const b = {}, + u = function (e, t, n, r, l, a) { + const s = r.select(`[id="${n}"]`); + Object.keys(e).forEach(function (n) { + const r = e[n]; + let c = "default"; + r.classes.length > 0 && (c = r.classes.join(" ")), (c += " flowchart-label"); + const d = (0, o.k)(r.styles); + let p, + b = void 0 !== r.text ? r.text : r.id; + if ((o.l.info("vertex", r, r.labelType), "markdown" === r.labelType)) o.l.info("vertex", r, r.labelType); + else if ((0, o.n)((0, o.c)().flowchart.htmlLabels)) { + const e = { + label: b.replace(/fa[blrs]?:fa-[\w-]+/g, (e) => ``), + }; + (p = (0, i.a)(s, e).node()), p.parentNode.removeChild(p); + } else { + const e = l.createElementNS("http://www.w3.org/2000/svg", "text"); + e.setAttribute("style", d.labelStyle.replace("color:", "fill:")); + const t = b.split(o.e.lineBreakRegex); + for (const n of t) { + const t = l.createElementNS("http://www.w3.org/2000/svg", "tspan"); + t.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), + t.setAttribute("dy", "1em"), + t.setAttribute("x", "1"), + (t.textContent = n), + e.appendChild(t); + } + p = e; + } + let u = 0, + f = ""; + switch (r.type) { + case "round": + (u = 5), (f = "rect"); + break; + case "square": + case "group": + default: + f = "rect"; + break; + case "diamond": + f = "question"; + break; + case "hexagon": + f = "hexagon"; + break; + case "odd": + case "odd_right": + f = "rect_left_inv_arrow"; + break; + case "lean_right": + f = "lean_right"; + break; + case "lean_left": + f = "lean_left"; + break; + case "trapezoid": + f = "trapezoid"; + break; + case "inv_trapezoid": + f = "inv_trapezoid"; + break; + case "circle": + f = "circle"; + break; + case "ellipse": + f = "ellipse"; + break; + case "stadium": + f = "stadium"; + break; + case "subroutine": + f = "subroutine"; + break; + case "cylinder": + f = "cylinder"; + break; + case "doublecircle": + f = "doublecircle"; + } + t.setNode(r.id, { + labelStyle: d.labelStyle, + shape: f, + labelText: b, + labelType: r.labelType, + rx: u, + ry: u, + class: c, + style: d.style, + id: r.id, + link: r.link, + linkTarget: r.linkTarget, + tooltip: a.db.getTooltip(r.id) || "", + domId: a.db.lookUpDomId(r.id), + haveCallback: r.haveCallback, + width: "group" === r.type ? 500 : void 0, + dir: r.dir, + type: r.type, + props: r.props, + padding: (0, o.c)().flowchart.padding, + }), + o.l.info("setNode", { + labelStyle: d.labelStyle, + labelType: r.labelType, + shape: f, + labelText: b, + rx: u, + ry: u, + class: c, + style: d.style, + id: r.id, + domId: a.db.lookUpDomId(r.id), + width: "group" === r.type ? 500 : void 0, + type: r.type, + dir: r.dir, + props: r.props, + padding: (0, o.c)().flowchart.padding, + }); + }); + }, + f = function (e, t, n) { + o.l.info("abc78 edges = ", e); + let r, + a, + i = 0, + s = {}; + if (void 0 !== e.defaultStyle) { + const t = (0, o.k)(e.defaultStyle); + (r = t.style), (a = t.labelStyle); + } + e.forEach(function (n) { + i++; + const c = "L-" + n.start + "-" + n.end; + void 0 === s[c] ? ((s[c] = 0), o.l.info("abc78 new entry", c, s[c])) : (s[c]++, o.l.info("abc78 new entry", c, s[c])); + let d = c + "-" + s[c]; + o.l.info("abc78 new link id to be used is", c, d, s[c]); + const p = "LS-" + n.start, + u = "LE-" + n.end, + f = { style: "", labelStyle: "" }; + switch ( + ((f.minlen = n.length || 1), + "arrow_open" === n.type ? (f.arrowhead = "none") : (f.arrowhead = "normal"), + (f.arrowTypeStart = "arrow_open"), + (f.arrowTypeEnd = "arrow_open"), + n.type) + ) { + case "double_arrow_cross": + f.arrowTypeStart = "arrow_cross"; + case "arrow_cross": + f.arrowTypeEnd = "arrow_cross"; + break; + case "double_arrow_point": + f.arrowTypeStart = "arrow_point"; + case "arrow_point": + f.arrowTypeEnd = "arrow_point"; + break; + case "double_arrow_circle": + f.arrowTypeStart = "arrow_circle"; + case "arrow_circle": + f.arrowTypeEnd = "arrow_circle"; + } + let w = "", + h = ""; + switch (n.stroke) { + case "normal": + (w = "fill:none;"), void 0 !== r && (w = r), void 0 !== a && (h = a), (f.thickness = "normal"), (f.pattern = "solid"); + break; + case "dotted": + (f.thickness = "normal"), (f.pattern = "dotted"), (f.style = "fill:none;stroke-width:2px;stroke-dasharray:3;"); + break; + case "thick": + (f.thickness = "thick"), (f.pattern = "solid"), (f.style = "stroke-width: 3.5px;fill:none;"); + break; + case "invisible": + (f.thickness = "invisible"), (f.pattern = "solid"), (f.style = "stroke-width: 0;fill:none;"); + } + if (void 0 !== n.style) { + const e = (0, o.k)(n.style); + (w = e.style), (h = e.labelStyle); + } + (f.style = f.style += w), + (f.labelStyle = f.labelStyle += h), + void 0 !== n.interpolate + ? (f.curve = (0, o.o)(n.interpolate, l.c_6)) + : void 0 !== e.defaultInterpolate + ? (f.curve = (0, o.o)(e.defaultInterpolate, l.c_6)) + : (f.curve = (0, o.o)(b.curve, l.c_6)), + void 0 === n.text ? void 0 !== n.style && (f.arrowheadStyle = "fill: #333") : ((f.arrowheadStyle = "fill: #333"), (f.labelpos = "c")), + (f.labelType = n.labelType), + (f.label = n.text.replace(o.e.lineBreakRegex, "\n")), + void 0 === n.style && (f.style = f.style || "stroke: #333; stroke-width: 1.5px;fill:none;"), + (f.labelStyle = f.labelStyle.replace("color:", "fill:")), + (f.id = d), + (f.classes = "flowchart-link " + p + " " + u), + t.setEdge(n.start, n.end, f, i); + }); + }, + w = { + setConf: function (e) { + const t = Object.keys(e); + for (const n of t) b[n] = e[n]; + }, + addVertices: u, + addEdges: f, + getClasses: function (e, t) { + return t.db.getClasses(); + }, + draw: async function (e, t, n, i) { + o.l.info("Drawing flowchart"); + let s = i.db.getDirection(); + void 0 === s && (s = "TD"); + const { securityLevel: c, flowchart: d } = (0, o.c)(), + p = d.nodeSpacing || 50, + b = d.rankSpacing || 50; + let w; + "sandbox" === c && (w = (0, l.Ys)("#i" + t)); + const h = "sandbox" === c ? (0, l.Ys)(w.nodes()[0].contentDocument.body) : (0, l.Ys)("body"), + g = "sandbox" === c ? w.nodes()[0].contentDocument : document, + y = new r.k({ multigraph: !0, compound: !0 }) + .setGraph({ rankdir: s, nodesep: p, ranksep: b, marginx: 0, marginy: 0 }) + .setDefaultEdgeLabel(function () { + return {}; + }); + let k; + const x = i.db.getSubGraphs(); + o.l.info("Subgraphs - ", x); + for (let e = x.length - 1; e >= 0; e--) + (k = x[e]), o.l.info("Subgraph - ", k), i.db.addVertex(k.id, { text: k.title, type: k.labelType }, "group", void 0, k.classes, k.dir); + const v = i.db.getVertices(), + m = i.db.getEdges(); + o.l.info("Edges", m); + let S = 0; + for (S = x.length - 1; S >= 0; S--) { + (k = x[S]), (0, l.td_)("cluster").append("text"); + for (let e = 0; e < k.nodes.length; e++) o.l.info("Setting up subgraphs", k.nodes[e], k.id), y.setParent(k.nodes[e], k.id); + } + u(v, y, t, h, g, i), f(m, y); + const T = h.select(`[id="${t}"]`), + _ = h.select("#" + t + " g"); + if ( + (await (0, a.r)(_, y, ["point", "circle", "cross"], "flowchart", t), + o.u.insertTitle(T, "flowchartTitleText", d.titleTopMargin, i.db.getDiagramTitle()), + (0, o.p)(y, T, d.diagramPadding, d.useMaxWidth), + i.db.indexNodes("subGraph" + S), + !d.htmlLabels) + ) { + const e = g.querySelectorAll('[id="' + t + '"] .edgeLabel .label'); + for (const t of e) { + const e = t.getBBox(), + n = g.createElementNS("http://www.w3.org/2000/svg", "rect"); + n.setAttribute("rx", 0), + n.setAttribute("ry", 0), + n.setAttribute("width", e.width), + n.setAttribute("height", e.height), + t.insertBefore(n, t.firstChild); + } + } + Object.keys(v).forEach(function (e) { + const n = v[e]; + if (n.link) { + const r = (0, l.Ys)("#" + t + ' [id="' + e + '"]'); + if (r) { + const e = g.createElementNS("http://www.w3.org/2000/svg", "a"); + e.setAttributeNS("http://www.w3.org/2000/svg", "class", n.classes.join(" ")), + e.setAttributeNS("http://www.w3.org/2000/svg", "href", n.link), + e.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"), + "sandbox" === c + ? e.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") + : n.linkTarget && e.setAttributeNS("http://www.w3.org/2000/svg", "target", n.linkTarget); + const t = r.insert(function () { + return e; + }, ":first-child"), + l = r.select(".label-container"); + l && + t.append(function () { + return l.node(); + }); + const o = r.select(".label"); + o && + t.append(function () { + return o.node(); + }); + } + } + }); + }, + }, + h = (e) => + `.label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor || e.textColor};\n }\n .cluster-label text {\n fill: ${e.titleColor};\n }\n .cluster-label span,p {\n color: ${e.titleColor};\n }\n\n .label text,span,p {\n fill: ${e.nodeTextColor || e.textColor};\n color: ${e.nodeTextColor || e.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${(( + e, + t, + ) => { + const n = d, + r = n(e, "r"), + l = n(e, "g"), + o = n(e, "b"); + return p.Z(r, l, o, 0.5); + })( + e.edgeLabelBackground, + )};\n // background-color: \n }\n\n .cluster rect {\n fill: ${e.clusterBkg};\n stroke: ${e.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span,p {\n color: ${e.titleColor};\n }\n /* .cluster div {\n color: ${e.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n`; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/813-0d3c16f5.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/813-0d3c16f5.chunk.min.js new file mode 100644 index 000000000..ffb81e1ab --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/813-0d3c16f5.chunk.min.js @@ -0,0 +1,2893 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [813], + { + 1813: function (t, e, s) { + s.d(e, { + d: function () { + return ut; + }, + f: function () { + return st; + }, + p: function () { + return n; + }, + }); + var u = s(7274), + i = s(9339), + r = (function () { + var t = function (t, e, s, u) { + for (s = s || {}, u = t.length; u--; s[t[u]] = e); + return s; + }, + e = [1, 9], + s = [1, 7], + u = [1, 6], + i = [1, 8], + r = [1, 20, 21, 22, 23, 38, 45, 47, 49, 53, 69, 92, 93, 94, 95, 96, 97, 110, 113, 114, 117, 119, 122, 123, 124, 129, 130, 131, 132], + n = [2, 10], + a = [1, 20], + c = [1, 21], + o = [1, 22], + l = [1, 23], + h = [1, 30], + A = [1, 32], + d = [1, 33], + p = [1, 34], + y = [1, 56], + E = [1, 55], + f = [1, 36], + k = [1, 37], + D = [1, 38], + g = [1, 39], + b = [1, 40], + _ = [1, 51], + F = [1, 53], + T = [1, 49], + C = [1, 54], + S = [1, 50], + B = [1, 57], + m = [1, 52], + v = [1, 58], + x = [1, 59], + L = [1, 41], + I = [1, 42], + R = [1, 43], + N = [1, 44], + $ = [1, 62], + O = [1, 67], + P = [1, 20, 21, 22, 23, 38, 43, 45, 47, 49, 53, 69, 92, 93, 94, 95, 96, 97, 110, 113, 114, 117, 119, 122, 123, 124, 129, 130, 131, 132], + w = [1, 71], + U = [1, 70], + V = [1, 72], + G = [20, 21, 23, 84, 86], + M = [1, 98], + K = [1, 103], + Y = [1, 102], + j = [1, 99], + X = [1, 95], + z = [1, 101], + H = [1, 97], + W = [1, 104], + Q = [1, 100], + q = [1, 105], + Z = [1, 96], + J = [20, 21, 22, 23, 84, 86], + tt = [20, 21, 22, 23, 55, 84, 86], + et = [20, 21, 22, 23, 40, 53, 55, 57, 59, 61, 63, 65, 67, 69, 72, 74, 76, 77, 79, 84, 86, 97, 110, 113, 114, 117, 119, 122, 123, 124], + st = [20, 21, 23], + ut = [20, 21, 23, 53, 69, 84, 86, 97, 110, 113, 114, 117, 119, 122, 123, 124], + it = [ + 1, 12, 20, 21, 22, 23, 24, 38, 43, 45, 47, 49, 53, 69, 92, 93, 94, 95, 96, 97, 110, 113, 114, 117, 119, 122, 123, 124, 129, 130, 131, + 132, + ], + rt = [53, 69, 97, 110, 113, 114, 117, 119, 122, 123, 124], + nt = [1, 134], + at = [1, 133], + ct = [1, 141], + ot = [1, 155], + lt = [1, 156], + ht = [1, 157], + At = [1, 158], + dt = [1, 143], + pt = [1, 145], + yt = [1, 149], + Et = [1, 150], + ft = [1, 151], + kt = [1, 152], + Dt = [1, 153], + gt = [1, 154], + bt = [1, 159], + _t = [1, 160], + Ft = [1, 139], + Tt = [1, 140], + Ct = [1, 147], + St = [1, 142], + Bt = [1, 146], + mt = [1, 144], + vt = [20, 21, 22, 23, 38, 43, 45, 47, 49, 53, 69, 92, 93, 94, 95, 96, 97, 110, 113, 114, 117, 119, 122, 123, 124, 129, 130, 131, 132], + xt = [1, 162], + Lt = [20, 21, 22, 23, 26, 53, 69, 97, 113, 114, 117, 119, 122, 123, 124], + It = [1, 182], + Rt = [1, 178], + Nt = [1, 179], + $t = [1, 183], + Ot = [1, 180], + Pt = [1, 181], + wt = [12, 21, 22, 24], + Ut = [86, 124, 127], + Vt = [20, 21, 22, 23, 24, 26, 38, 40, 43, 53, 69, 84, 92, 93, 94, 95, 96, 97, 98, 113, 117, 119, 122, 123, 124], + Gt = [22, 114], + Mt = [42, 58, 60, 62, 64, 66, 71, 73, 75, 76, 78, 80, 124, 125, 126], + Kt = [1, 250], + Yt = [1, 248], + jt = [1, 252], + Xt = [1, 246], + zt = [1, 247], + Ht = [1, 249], + Wt = [1, 251], + Qt = [1, 253], + qt = [1, 270], + Zt = [20, 21, 23, 114], + Jt = [20, 21, 22, 23, 69, 92, 113, 114, 117, 118, 119, 120], + te = { + trace: function () {}, + yy: {}, + symbols_: { + error: 2, + start: 3, + mermaidDoc: 4, + directive: 5, + openDirective: 6, + typeDirective: 7, + closeDirective: 8, + separator: 9, + ":": 10, + argDirective: 11, + open_directive: 12, + type_directive: 13, + arg_directive: 14, + close_directive: 15, + graphConfig: 16, + document: 17, + line: 18, + statement: 19, + SEMI: 20, + NEWLINE: 21, + SPACE: 22, + EOF: 23, + GRAPH: 24, + NODIR: 25, + DIR: 26, + FirstStmtSeperator: 27, + ending: 28, + endToken: 29, + spaceList: 30, + spaceListNewline: 31, + verticeStatement: 32, + styleStatement: 33, + linkStyleStatement: 34, + classDefStatement: 35, + classStatement: 36, + clickStatement: 37, + subgraph: 38, + textNoTags: 39, + SQS: 40, + text: 41, + SQE: 42, + end: 43, + direction: 44, + acc_title: 45, + acc_title_value: 46, + acc_descr: 47, + acc_descr_value: 48, + acc_descr_multiline_value: 49, + link: 50, + node: 51, + styledVertex: 52, + AMP: 53, + vertex: 54, + STYLE_SEPARATOR: 55, + idString: 56, + DOUBLECIRCLESTART: 57, + DOUBLECIRCLEEND: 58, + PS: 59, + PE: 60, + "(-": 61, + "-)": 62, + STADIUMSTART: 63, + STADIUMEND: 64, + SUBROUTINESTART: 65, + SUBROUTINEEND: 66, + VERTEX_WITH_PROPS_START: 67, + "NODE_STRING[field]": 68, + COLON: 69, + "NODE_STRING[value]": 70, + PIPE: 71, + CYLINDERSTART: 72, + CYLINDEREND: 73, + DIAMOND_START: 74, + DIAMOND_STOP: 75, + TAGEND: 76, + TRAPSTART: 77, + TRAPEND: 78, + INVTRAPSTART: 79, + INVTRAPEND: 80, + linkStatement: 81, + arrowText: 82, + TESTSTR: 83, + START_LINK: 84, + edgeText: 85, + LINK: 86, + edgeTextToken: 87, + STR: 88, + MD_STR: 89, + textToken: 90, + keywords: 91, + STYLE: 92, + LINKSTYLE: 93, + CLASSDEF: 94, + CLASS: 95, + CLICK: 96, + DOWN: 97, + UP: 98, + textNoTagsToken: 99, + stylesOpt: 100, + "idString[vertex]": 101, + "idString[class]": 102, + CALLBACKNAME: 103, + CALLBACKARGS: 104, + HREF: 105, + LINK_TARGET: 106, + "STR[link]": 107, + "STR[tooltip]": 108, + alphaNum: 109, + DEFAULT: 110, + numList: 111, + INTERPOLATE: 112, + NUM: 113, + COMMA: 114, + style: 115, + styleComponent: 116, + NODE_STRING: 117, + UNIT: 118, + BRKT: 119, + PCT: 120, + idStringToken: 121, + MINUS: 122, + MULT: 123, + UNICODE_TEXT: 124, + TEXT: 125, + TAGSTART: 126, + EDGE_TEXT: 127, + alphaNumToken: 128, + direction_tb: 129, + direction_bt: 130, + direction_rl: 131, + direction_lr: 132, + $accept: 0, + $end: 1, + }, + terminals_: { + 2: "error", + 10: ":", + 12: "open_directive", + 13: "type_directive", + 14: "arg_directive", + 15: "close_directive", + 20: "SEMI", + 21: "NEWLINE", + 22: "SPACE", + 23: "EOF", + 24: "GRAPH", + 25: "NODIR", + 26: "DIR", + 38: "subgraph", + 40: "SQS", + 42: "SQE", + 43: "end", + 45: "acc_title", + 46: "acc_title_value", + 47: "acc_descr", + 48: "acc_descr_value", + 49: "acc_descr_multiline_value", + 53: "AMP", + 55: "STYLE_SEPARATOR", + 57: "DOUBLECIRCLESTART", + 58: "DOUBLECIRCLEEND", + 59: "PS", + 60: "PE", + 61: "(-", + 62: "-)", + 63: "STADIUMSTART", + 64: "STADIUMEND", + 65: "SUBROUTINESTART", + 66: "SUBROUTINEEND", + 67: "VERTEX_WITH_PROPS_START", + 68: "NODE_STRING[field]", + 69: "COLON", + 70: "NODE_STRING[value]", + 71: "PIPE", + 72: "CYLINDERSTART", + 73: "CYLINDEREND", + 74: "DIAMOND_START", + 75: "DIAMOND_STOP", + 76: "TAGEND", + 77: "TRAPSTART", + 78: "TRAPEND", + 79: "INVTRAPSTART", + 80: "INVTRAPEND", + 83: "TESTSTR", + 84: "START_LINK", + 86: "LINK", + 88: "STR", + 89: "MD_STR", + 92: "STYLE", + 93: "LINKSTYLE", + 94: "CLASSDEF", + 95: "CLASS", + 96: "CLICK", + 97: "DOWN", + 98: "UP", + 101: "idString[vertex]", + 102: "idString[class]", + 103: "CALLBACKNAME", + 104: "CALLBACKARGS", + 105: "HREF", + 106: "LINK_TARGET", + 107: "STR[link]", + 108: "STR[tooltip]", + 110: "DEFAULT", + 112: "INTERPOLATE", + 113: "NUM", + 114: "COMMA", + 117: "NODE_STRING", + 118: "UNIT", + 119: "BRKT", + 120: "PCT", + 122: "MINUS", + 123: "MULT", + 124: "UNICODE_TEXT", + 125: "TEXT", + 126: "TAGSTART", + 127: "EDGE_TEXT", + 129: "direction_tb", + 130: "direction_bt", + 131: "direction_rl", + 132: "direction_lr", + }, + productions_: [ + 0, + [3, 1], + [3, 2], + [5, 4], + [5, 6], + [6, 1], + [7, 1], + [11, 1], + [8, 1], + [4, 2], + [17, 0], + [17, 2], + [18, 1], + [18, 1], + [18, 1], + [18, 1], + [18, 1], + [16, 2], + [16, 2], + [16, 2], + [16, 3], + [28, 2], + [28, 1], + [29, 1], + [29, 1], + [29, 1], + [27, 1], + [27, 1], + [27, 2], + [31, 2], + [31, 2], + [31, 1], + [31, 1], + [30, 2], + [30, 1], + [19, 2], + [19, 2], + [19, 2], + [19, 2], + [19, 2], + [19, 2], + [19, 9], + [19, 6], + [19, 4], + [19, 1], + [19, 2], + [19, 2], + [19, 1], + [9, 1], + [9, 1], + [9, 1], + [32, 3], + [32, 4], + [32, 2], + [32, 1], + [51, 1], + [51, 5], + [52, 1], + [52, 3], + [54, 4], + [54, 4], + [54, 6], + [54, 4], + [54, 4], + [54, 4], + [54, 8], + [54, 4], + [54, 4], + [54, 4], + [54, 6], + [54, 4], + [54, 4], + [54, 4], + [54, 4], + [54, 4], + [54, 1], + [50, 2], + [50, 3], + [50, 3], + [50, 1], + [50, 3], + [85, 1], + [85, 2], + [85, 1], + [85, 1], + [81, 1], + [82, 3], + [41, 1], + [41, 2], + [41, 1], + [41, 1], + [91, 1], + [91, 1], + [91, 1], + [91, 1], + [91, 1], + [91, 1], + [91, 1], + [91, 1], + [91, 1], + [91, 1], + [91, 1], + [39, 1], + [39, 2], + [39, 1], + [39, 1], + [35, 5], + [36, 5], + [37, 2], + [37, 4], + [37, 3], + [37, 5], + [37, 3], + [37, 5], + [37, 5], + [37, 7], + [37, 2], + [37, 4], + [37, 2], + [37, 4], + [37, 4], + [37, 6], + [33, 5], + [34, 5], + [34, 5], + [34, 9], + [34, 9], + [34, 7], + [34, 7], + [111, 1], + [111, 3], + [100, 1], + [100, 3], + [115, 1], + [115, 2], + [116, 1], + [116, 1], + [116, 1], + [116, 1], + [116, 1], + [116, 1], + [116, 1], + [116, 1], + [121, 1], + [121, 1], + [121, 1], + [121, 1], + [121, 1], + [121, 1], + [121, 1], + [121, 1], + [121, 1], + [121, 1], + [121, 1], + [90, 1], + [90, 1], + [90, 1], + [90, 1], + [99, 1], + [99, 1], + [99, 1], + [99, 1], + [99, 1], + [99, 1], + [99, 1], + [99, 1], + [99, 1], + [99, 1], + [99, 1], + [87, 1], + [87, 1], + [128, 1], + [128, 1], + [128, 1], + [128, 1], + [128, 1], + [128, 1], + [128, 1], + [128, 1], + [128, 1], + [128, 1], + [128, 1], + [56, 1], + [56, 2], + [109, 1], + [109, 2], + [44, 1], + [44, 1], + [44, 1], + [44, 1], + ], + performAction: function (t, e, s, u, i, r, n) { + var a = r.length - 1; + switch (i) { + case 5: + u.parseDirective("%%{", "open_directive"); + break; + case 6: + u.parseDirective(r[a], "type_directive"); + break; + case 7: + (r[a] = r[a].trim().replace(/'/g, '"')), u.parseDirective(r[a], "arg_directive"); + break; + case 8: + u.parseDirective("}%%", "close_directive", "flowchart"); + break; + case 10: + case 36: + case 37: + case 38: + case 39: + case 40: + this.$ = []; + break; + case 11: + (!Array.isArray(r[a]) || r[a].length > 0) && r[a - 1].push(r[a]), (this.$ = r[a - 1]); + break; + case 12: + case 184: + case 57: + case 79: + case 182: + this.$ = r[a]; + break; + case 19: + u.setDirection("TB"), (this.$ = "TB"); + break; + case 20: + u.setDirection(r[a - 1]), (this.$ = r[a - 1]); + break; + case 35: + this.$ = r[a - 1].nodes; + break; + case 41: + this.$ = u.addSubGraph(r[a - 6], r[a - 1], r[a - 4]); + break; + case 42: + this.$ = u.addSubGraph(r[a - 3], r[a - 1], r[a - 3]); + break; + case 43: + this.$ = u.addSubGraph(void 0, r[a - 1], void 0); + break; + case 45: + (this.$ = r[a].trim()), u.setAccTitle(this.$); + break; + case 46: + case 47: + (this.$ = r[a].trim()), u.setAccDescription(this.$); + break; + case 51: + u.addLink(r[a - 2].stmt, r[a], r[a - 1]), (this.$ = { stmt: r[a], nodes: r[a].concat(r[a - 2].nodes) }); + break; + case 52: + u.addLink(r[a - 3].stmt, r[a - 1], r[a - 2]), (this.$ = { stmt: r[a - 1], nodes: r[a - 1].concat(r[a - 3].nodes) }); + break; + case 53: + this.$ = { stmt: r[a - 1], nodes: r[a - 1] }; + break; + case 54: + this.$ = { stmt: r[a], nodes: r[a] }; + break; + case 55: + case 129: + case 131: + this.$ = [r[a]]; + break; + case 56: + this.$ = r[a - 4].concat(r[a]); + break; + case 58: + (this.$ = r[a - 2]), u.setClass(r[a - 2], r[a]); + break; + case 59: + (this.$ = r[a - 3]), u.addVertex(r[a - 3], r[a - 1], "square"); + break; + case 60: + (this.$ = r[a - 3]), u.addVertex(r[a - 3], r[a - 1], "doublecircle"); + break; + case 61: + (this.$ = r[a - 5]), u.addVertex(r[a - 5], r[a - 2], "circle"); + break; + case 62: + (this.$ = r[a - 3]), u.addVertex(r[a - 3], r[a - 1], "ellipse"); + break; + case 63: + (this.$ = r[a - 3]), u.addVertex(r[a - 3], r[a - 1], "stadium"); + break; + case 64: + (this.$ = r[a - 3]), u.addVertex(r[a - 3], r[a - 1], "subroutine"); + break; + case 65: + (this.$ = r[a - 7]), u.addVertex(r[a - 7], r[a - 1], "rect", void 0, void 0, void 0, Object.fromEntries([[r[a - 5], r[a - 3]]])); + break; + case 66: + (this.$ = r[a - 3]), u.addVertex(r[a - 3], r[a - 1], "cylinder"); + break; + case 67: + (this.$ = r[a - 3]), u.addVertex(r[a - 3], r[a - 1], "round"); + break; + case 68: + (this.$ = r[a - 3]), u.addVertex(r[a - 3], r[a - 1], "diamond"); + break; + case 69: + (this.$ = r[a - 5]), u.addVertex(r[a - 5], r[a - 2], "hexagon"); + break; + case 70: + (this.$ = r[a - 3]), u.addVertex(r[a - 3], r[a - 1], "odd"); + break; + case 71: + (this.$ = r[a - 3]), u.addVertex(r[a - 3], r[a - 1], "trapezoid"); + break; + case 72: + (this.$ = r[a - 3]), u.addVertex(r[a - 3], r[a - 1], "inv_trapezoid"); + break; + case 73: + (this.$ = r[a - 3]), u.addVertex(r[a - 3], r[a - 1], "lean_right"); + break; + case 74: + (this.$ = r[a - 3]), u.addVertex(r[a - 3], r[a - 1], "lean_left"); + break; + case 75: + (this.$ = r[a]), u.addVertex(r[a]); + break; + case 76: + (r[a - 1].text = r[a]), (this.$ = r[a - 1]); + break; + case 77: + case 78: + (r[a - 2].text = r[a - 1]), (this.$ = r[a - 2]); + break; + case 80: + var c = u.destructLink(r[a], r[a - 2]); + this.$ = { type: c.type, stroke: c.stroke, length: c.length, text: r[a - 1] }; + break; + case 81: + case 87: + case 102: + case 104: + this.$ = { text: r[a], type: "text" }; + break; + case 82: + case 88: + case 103: + this.$ = { text: r[a - 1].text + "" + r[a], type: r[a - 1].type }; + break; + case 83: + case 89: + this.$ = { text: r[a], type: "string" }; + break; + case 84: + case 90: + case 105: + this.$ = { text: r[a], type: "markdown" }; + break; + case 85: + (c = u.destructLink(r[a])), (this.$ = { type: c.type, stroke: c.stroke, length: c.length }); + break; + case 86: + this.$ = r[a - 1]; + break; + case 106: + (this.$ = r[a - 4]), u.addClass(r[a - 2], r[a]); + break; + case 107: + (this.$ = r[a - 4]), u.setClass(r[a - 2], r[a]); + break; + case 108: + case 116: + (this.$ = r[a - 1]), u.setClickEvent(r[a - 1], r[a]); + break; + case 109: + case 117: + (this.$ = r[a - 3]), u.setClickEvent(r[a - 3], r[a - 2]), u.setTooltip(r[a - 3], r[a]); + break; + case 110: + (this.$ = r[a - 2]), u.setClickEvent(r[a - 2], r[a - 1], r[a]); + break; + case 111: + (this.$ = r[a - 4]), u.setClickEvent(r[a - 4], r[a - 3], r[a - 2]), u.setTooltip(r[a - 4], r[a]); + break; + case 112: + (this.$ = r[a - 2]), u.setLink(r[a - 2], r[a]); + break; + case 113: + (this.$ = r[a - 4]), u.setLink(r[a - 4], r[a - 2]), u.setTooltip(r[a - 4], r[a]); + break; + case 114: + (this.$ = r[a - 4]), u.setLink(r[a - 4], r[a - 2], r[a]); + break; + case 115: + (this.$ = r[a - 6]), u.setLink(r[a - 6], r[a - 4], r[a]), u.setTooltip(r[a - 6], r[a - 2]); + break; + case 118: + (this.$ = r[a - 1]), u.setLink(r[a - 1], r[a]); + break; + case 119: + (this.$ = r[a - 3]), u.setLink(r[a - 3], r[a - 2]), u.setTooltip(r[a - 3], r[a]); + break; + case 120: + (this.$ = r[a - 3]), u.setLink(r[a - 3], r[a - 2], r[a]); + break; + case 121: + (this.$ = r[a - 5]), u.setLink(r[a - 5], r[a - 4], r[a]), u.setTooltip(r[a - 5], r[a - 2]); + break; + case 122: + (this.$ = r[a - 4]), u.addVertex(r[a - 2], void 0, void 0, r[a]); + break; + case 123: + (this.$ = r[a - 4]), u.updateLink([r[a - 2]], r[a]); + break; + case 124: + (this.$ = r[a - 4]), u.updateLink(r[a - 2], r[a]); + break; + case 125: + (this.$ = r[a - 8]), u.updateLinkInterpolate([r[a - 6]], r[a - 2]), u.updateLink([r[a - 6]], r[a]); + break; + case 126: + (this.$ = r[a - 8]), u.updateLinkInterpolate(r[a - 6], r[a - 2]), u.updateLink(r[a - 6], r[a]); + break; + case 127: + (this.$ = r[a - 6]), u.updateLinkInterpolate([r[a - 4]], r[a]); + break; + case 128: + (this.$ = r[a - 6]), u.updateLinkInterpolate(r[a - 4], r[a]); + break; + case 130: + case 132: + r[a - 2].push(r[a]), (this.$ = r[a - 2]); + break; + case 134: + this.$ = r[a - 1] + r[a]; + break; + case 183: + case 185: + this.$ = r[a - 1] + "" + r[a]; + break; + case 186: + this.$ = { stmt: "dir", value: "TB" }; + break; + case 187: + this.$ = { stmt: "dir", value: "BT" }; + break; + case 188: + this.$ = { stmt: "dir", value: "RL" }; + break; + case 189: + this.$ = { stmt: "dir", value: "LR" }; + } + }, + table: [ + { 3: 1, 4: 2, 5: 3, 6: 5, 12: e, 16: 4, 21: s, 22: u, 24: i }, + { 1: [3] }, + { 1: [2, 1] }, + { 3: 10, 4: 2, 5: 3, 6: 5, 12: e, 16: 4, 21: s, 22: u, 24: i }, + t(r, n, { 17: 11 }), + { 7: 12, 13: [1, 13] }, + { 16: 14, 21: s, 22: u, 24: i }, + { 16: 15, 21: s, 22: u, 24: i }, + { 25: [1, 16], 26: [1, 17] }, + { 13: [2, 5] }, + { 1: [2, 2] }, + { + 1: [2, 9], + 18: 18, + 19: 19, + 20: a, + 21: c, + 22: o, + 23: l, + 32: 24, + 33: 25, + 34: 26, + 35: 27, + 36: 28, + 37: 29, + 38: h, + 44: 31, + 45: A, + 47: d, + 49: p, + 51: 35, + 52: 45, + 53: y, + 54: 46, + 56: 47, + 69: E, + 92: f, + 93: k, + 94: D, + 95: g, + 96: b, + 97: _, + 110: F, + 113: T, + 114: C, + 117: S, + 119: B, + 121: 48, + 122: m, + 123: v, + 124: x, + 129: L, + 130: I, + 131: R, + 132: N, + }, + { 8: 60, 10: [1, 61], 15: $ }, + t([10, 15], [2, 6]), + t(r, [2, 17]), + t(r, [2, 18]), + t(r, [2, 19]), + { 20: [1, 64], 21: [1, 65], 22: O, 27: 63, 30: 66 }, + t(P, [2, 11]), + t(P, [2, 12]), + t(P, [2, 13]), + t(P, [2, 14]), + t(P, [2, 15]), + t(P, [2, 16]), + { 9: 68, 20: w, 21: U, 23: V, 50: 69, 81: 73, 84: [1, 74], 86: [1, 75] }, + { 9: 76, 20: w, 21: U, 23: V }, + { 9: 77, 20: w, 21: U, 23: V }, + { 9: 78, 20: w, 21: U, 23: V }, + { 9: 79, 20: w, 21: U, 23: V }, + { 9: 80, 20: w, 21: U, 23: V }, + { 9: 82, 20: w, 21: U, 22: [1, 81], 23: V }, + t(P, [2, 44]), + { 46: [1, 83] }, + { 48: [1, 84] }, + t(P, [2, 47]), + t(G, [2, 54], { 30: 85, 22: O }), + { 22: [1, 86] }, + { 22: [1, 87] }, + { 22: [1, 88] }, + { 22: [1, 89] }, + { + 26: M, + 53: K, + 69: Y, + 88: [1, 93], + 97: j, + 103: [1, 90], + 105: [1, 91], + 109: 92, + 113: X, + 114: z, + 117: H, + 119: W, + 122: Q, + 123: q, + 124: Z, + 128: 94, + }, + t(P, [2, 186]), + t(P, [2, 187]), + t(P, [2, 188]), + t(P, [2, 189]), + t(J, [2, 55]), + t(J, [2, 57], { 55: [1, 106] }), + t(tt, [2, 75], { + 121: 119, + 40: [1, 107], + 53: y, + 57: [1, 108], + 59: [1, 109], + 61: [1, 110], + 63: [1, 111], + 65: [1, 112], + 67: [1, 113], + 69: E, + 72: [1, 114], + 74: [1, 115], + 76: [1, 116], + 77: [1, 117], + 79: [1, 118], + 97: _, + 110: F, + 113: T, + 114: C, + 117: S, + 119: B, + 122: m, + 123: v, + 124: x, + }), + t(et, [2, 182]), + t(et, [2, 143]), + t(et, [2, 144]), + t(et, [2, 145]), + t(et, [2, 146]), + t(et, [2, 147]), + t(et, [2, 148]), + t(et, [2, 149]), + t(et, [2, 150]), + t(et, [2, 151]), + t(et, [2, 152]), + t(et, [2, 153]), + { 9: 120, 20: w, 21: U, 23: V }, + { 11: 121, 14: [1, 122] }, + t(st, [2, 8]), + t(r, [2, 20]), + t(r, [2, 26]), + t(r, [2, 27]), + { 21: [1, 123] }, + t(ut, [2, 34], { 30: 124, 22: O }), + t(P, [2, 35]), + { + 51: 125, + 52: 45, + 53: y, + 54: 46, + 56: 47, + 69: E, + 97: _, + 110: F, + 113: T, + 114: C, + 117: S, + 119: B, + 121: 48, + 122: m, + 123: v, + 124: x, + }, + t(it, [2, 48]), + t(it, [2, 49]), + t(it, [2, 50]), + t(rt, [2, 79], { 82: 126, 71: [1, 128], 83: [1, 127] }), + { 85: 129, 87: 130, 88: [1, 131], 89: [1, 132], 124: nt, 127: at }, + t([53, 69, 71, 83, 97, 110, 113, 114, 117, 119, 122, 123, 124], [2, 85]), + t(P, [2, 36]), + t(P, [2, 37]), + t(P, [2, 38]), + t(P, [2, 39]), + t(P, [2, 40]), + { + 22: ct, + 24: ot, + 26: lt, + 38: ht, + 39: 135, + 43: At, + 53: dt, + 69: pt, + 84: yt, + 88: [1, 137], + 89: [1, 138], + 91: 148, + 92: Et, + 93: ft, + 94: kt, + 95: Dt, + 96: gt, + 97: bt, + 98: _t, + 99: 136, + 113: Ft, + 117: Tt, + 119: Ct, + 122: St, + 123: Bt, + 124: mt, + }, + t(vt, n, { 17: 161 }), + t(P, [2, 45]), + t(P, [2, 46]), + t(G, [2, 53], { 53: xt }), + { + 53: y, + 56: 163, + 69: E, + 97: _, + 110: F, + 113: T, + 114: C, + 117: S, + 119: B, + 121: 48, + 122: m, + 123: v, + 124: x, + }, + { 110: [1, 164], 111: 165, 113: [1, 166] }, + { + 53: y, + 56: 167, + 69: E, + 97: _, + 110: F, + 113: T, + 114: C, + 117: S, + 119: B, + 121: 48, + 122: m, + 123: v, + 124: x, + }, + { + 53: y, + 56: 168, + 69: E, + 97: _, + 110: F, + 113: T, + 114: C, + 117: S, + 119: B, + 121: 48, + 122: m, + 123: v, + 124: x, + }, + t(st, [2, 108], { 22: [1, 169], 104: [1, 170] }), + { 88: [1, 171] }, + t(st, [2, 116], { + 128: 173, + 22: [1, 172], + 26: M, + 53: K, + 69: Y, + 97: j, + 113: X, + 114: z, + 117: H, + 119: W, + 122: Q, + 123: q, + 124: Z, + }), + t(st, [2, 118], { 22: [1, 174] }), + t(Lt, [2, 184]), + t(Lt, [2, 171]), + t(Lt, [2, 172]), + t(Lt, [2, 173]), + t(Lt, [2, 174]), + t(Lt, [2, 175]), + t(Lt, [2, 176]), + t(Lt, [2, 177]), + t(Lt, [2, 178]), + t(Lt, [2, 179]), + t(Lt, [2, 180]), + t(Lt, [2, 181]), + { + 53: y, + 56: 175, + 69: E, + 97: _, + 110: F, + 113: T, + 114: C, + 117: S, + 119: B, + 121: 48, + 122: m, + 123: v, + 124: x, + }, + { 41: 176, 76: It, 88: Rt, 89: Nt, 90: 177, 124: $t, 125: Ot, 126: Pt }, + { 41: 184, 76: It, 88: Rt, 89: Nt, 90: 177, 124: $t, 125: Ot, 126: Pt }, + { + 41: 186, + 59: [1, 185], + 76: It, + 88: Rt, + 89: Nt, + 90: 177, + 124: $t, + 125: Ot, + 126: Pt, + }, + { 41: 187, 76: It, 88: Rt, 89: Nt, 90: 177, 124: $t, 125: Ot, 126: Pt }, + { 41: 188, 76: It, 88: Rt, 89: Nt, 90: 177, 124: $t, 125: Ot, 126: Pt }, + { 41: 189, 76: It, 88: Rt, 89: Nt, 90: 177, 124: $t, 125: Ot, 126: Pt }, + { 117: [1, 190] }, + { 41: 191, 76: It, 88: Rt, 89: Nt, 90: 177, 124: $t, 125: Ot, 126: Pt }, + { + 41: 192, + 74: [1, 193], + 76: It, + 88: Rt, + 89: Nt, + 90: 177, + 124: $t, + 125: Ot, + 126: Pt, + }, + { 41: 194, 76: It, 88: Rt, 89: Nt, 90: 177, 124: $t, 125: Ot, 126: Pt }, + { 41: 195, 76: It, 88: Rt, 89: Nt, 90: 177, 124: $t, 125: Ot, 126: Pt }, + { 41: 196, 76: It, 88: Rt, 89: Nt, 90: 177, 124: $t, 125: Ot, 126: Pt }, + t(et, [2, 183]), + t(wt, [2, 3]), + { 8: 197, 15: $ }, + { 15: [2, 7] }, + t(r, [2, 28]), + t(ut, [2, 33]), + t(G, [2, 51], { 30: 198, 22: O }), + t(rt, [2, 76], { 22: [1, 199] }), + { 22: [1, 200] }, + { 41: 201, 76: It, 88: Rt, 89: Nt, 90: 177, 124: $t, 125: Ot, 126: Pt }, + { 86: [1, 202], 87: 203, 124: nt, 127: at }, + t(Ut, [2, 81]), + t(Ut, [2, 83]), + t(Ut, [2, 84]), + t(Ut, [2, 169]), + t(Ut, [2, 170]), + { + 9: 205, + 20: w, + 21: U, + 22: ct, + 23: V, + 24: ot, + 26: lt, + 38: ht, + 40: [1, 204], + 43: At, + 53: dt, + 69: pt, + 84: yt, + 91: 148, + 92: Et, + 93: ft, + 94: kt, + 95: Dt, + 96: gt, + 97: bt, + 98: _t, + 99: 206, + 113: Ft, + 117: Tt, + 119: Ct, + 122: St, + 123: Bt, + 124: mt, + }, + t(Vt, [2, 102]), + t(Vt, [2, 104]), + t(Vt, [2, 105]), + t(Vt, [2, 158]), + t(Vt, [2, 159]), + t(Vt, [2, 160]), + t(Vt, [2, 161]), + t(Vt, [2, 162]), + t(Vt, [2, 163]), + t(Vt, [2, 164]), + t(Vt, [2, 165]), + t(Vt, [2, 166]), + t(Vt, [2, 167]), + t(Vt, [2, 168]), + t(Vt, [2, 91]), + t(Vt, [2, 92]), + t(Vt, [2, 93]), + t(Vt, [2, 94]), + t(Vt, [2, 95]), + t(Vt, [2, 96]), + t(Vt, [2, 97]), + t(Vt, [2, 98]), + t(Vt, [2, 99]), + t(Vt, [2, 100]), + t(Vt, [2, 101]), + { + 18: 18, + 19: 19, + 20: a, + 21: c, + 22: o, + 23: l, + 32: 24, + 33: 25, + 34: 26, + 35: 27, + 36: 28, + 37: 29, + 38: h, + 43: [1, 207], + 44: 31, + 45: A, + 47: d, + 49: p, + 51: 35, + 52: 45, + 53: y, + 54: 46, + 56: 47, + 69: E, + 92: f, + 93: k, + 94: D, + 95: g, + 96: b, + 97: _, + 110: F, + 113: T, + 114: C, + 117: S, + 119: B, + 121: 48, + 122: m, + 123: v, + 124: x, + 129: L, + 130: I, + 131: R, + 132: N, + }, + { 22: O, 30: 208 }, + { + 22: [1, 209], + 53: y, + 69: E, + 97: _, + 110: F, + 113: T, + 114: C, + 117: S, + 119: B, + 121: 119, + 122: m, + 123: v, + 124: x, + }, + { 22: [1, 210] }, + { 22: [1, 211], 114: [1, 212] }, + t(Gt, [2, 129]), + { + 22: [1, 213], + 53: y, + 69: E, + 97: _, + 110: F, + 113: T, + 114: C, + 117: S, + 119: B, + 121: 119, + 122: m, + 123: v, + 124: x, + }, + { + 22: [1, 214], + 53: y, + 69: E, + 97: _, + 110: F, + 113: T, + 114: C, + 117: S, + 119: B, + 121: 119, + 122: m, + 123: v, + 124: x, + }, + { 88: [1, 215] }, + t(st, [2, 110], { 22: [1, 216] }), + t(st, [2, 112], { 22: [1, 217] }), + { 88: [1, 218] }, + t(Lt, [2, 185]), + { 88: [1, 219], 106: [1, 220] }, + t(J, [2, 58], { + 121: 119, + 53: y, + 69: E, + 97: _, + 110: F, + 113: T, + 114: C, + 117: S, + 119: B, + 122: m, + 123: v, + 124: x, + }), + { 42: [1, 221], 76: It, 90: 222, 124: $t, 125: Ot, 126: Pt }, + t(Mt, [2, 87]), + t(Mt, [2, 89]), + t(Mt, [2, 90]), + t(Mt, [2, 154]), + t(Mt, [2, 155]), + t(Mt, [2, 156]), + t(Mt, [2, 157]), + { 58: [1, 223], 76: It, 90: 222, 124: $t, 125: Ot, 126: Pt }, + { 41: 224, 76: It, 88: Rt, 89: Nt, 90: 177, 124: $t, 125: Ot, 126: Pt }, + { 60: [1, 225], 76: It, 90: 222, 124: $t, 125: Ot, 126: Pt }, + { 62: [1, 226], 76: It, 90: 222, 124: $t, 125: Ot, 126: Pt }, + { 64: [1, 227], 76: It, 90: 222, 124: $t, 125: Ot, 126: Pt }, + { 66: [1, 228], 76: It, 90: 222, 124: $t, 125: Ot, 126: Pt }, + { 69: [1, 229] }, + { 73: [1, 230], 76: It, 90: 222, 124: $t, 125: Ot, 126: Pt }, + { 75: [1, 231], 76: It, 90: 222, 124: $t, 125: Ot, 126: Pt }, + { 41: 232, 76: It, 88: Rt, 89: Nt, 90: 177, 124: $t, 125: Ot, 126: Pt }, + { 42: [1, 233], 76: It, 90: 222, 124: $t, 125: Ot, 126: Pt }, + { 76: It, 78: [1, 234], 80: [1, 235], 90: 222, 124: $t, 125: Ot, 126: Pt }, + { 76: It, 78: [1, 237], 80: [1, 236], 90: 222, 124: $t, 125: Ot, 126: Pt }, + { 9: 238, 20: w, 21: U, 23: V }, + t(G, [2, 52], { 53: xt }), + t(rt, [2, 78]), + t(rt, [2, 77]), + { 71: [1, 239], 76: It, 90: 222, 124: $t, 125: Ot, 126: Pt }, + t(rt, [2, 80]), + t(Ut, [2, 82]), + { 41: 240, 76: It, 88: Rt, 89: Nt, 90: 177, 124: $t, 125: Ot, 126: Pt }, + t(vt, n, { 17: 241 }), + t(Vt, [2, 103]), + t(P, [2, 43]), + { + 52: 242, + 53: y, + 54: 46, + 56: 47, + 69: E, + 97: _, + 110: F, + 113: T, + 114: C, + 117: S, + 119: B, + 121: 48, + 122: m, + 123: v, + 124: x, + }, + { + 22: Kt, + 69: Yt, + 92: jt, + 100: 243, + 113: Xt, + 115: 244, + 116: 245, + 117: zt, + 118: Ht, + 119: Wt, + 120: Qt, + }, + { + 22: Kt, + 69: Yt, + 92: jt, + 100: 254, + 112: [1, 255], + 113: Xt, + 115: 244, + 116: 245, + 117: zt, + 118: Ht, + 119: Wt, + 120: Qt, + }, + { + 22: Kt, + 69: Yt, + 92: jt, + 100: 256, + 112: [1, 257], + 113: Xt, + 115: 244, + 116: 245, + 117: zt, + 118: Ht, + 119: Wt, + 120: Qt, + }, + { 113: [1, 258] }, + { + 22: Kt, + 69: Yt, + 92: jt, + 100: 259, + 113: Xt, + 115: 244, + 116: 245, + 117: zt, + 118: Ht, + 119: Wt, + 120: Qt, + }, + { + 53: y, + 56: 260, + 69: E, + 97: _, + 110: F, + 113: T, + 114: C, + 117: S, + 119: B, + 121: 48, + 122: m, + 123: v, + 124: x, + }, + t(st, [2, 109]), + { 88: [1, 261] }, + { 88: [1, 262], 106: [1, 263] }, + t(st, [2, 117]), + t(st, [2, 119], { 22: [1, 264] }), + t(st, [2, 120]), + t(tt, [2, 59]), + t(Mt, [2, 88]), + t(tt, [2, 60]), + { 60: [1, 265], 76: It, 90: 222, 124: $t, 125: Ot, 126: Pt }, + t(tt, [2, 67]), + t(tt, [2, 62]), + t(tt, [2, 63]), + t(tt, [2, 64]), + { 117: [1, 266] }, + t(tt, [2, 66]), + t(tt, [2, 68]), + { 75: [1, 267], 76: It, 90: 222, 124: $t, 125: Ot, 126: Pt }, + t(tt, [2, 70]), + t(tt, [2, 71]), + t(tt, [2, 73]), + t(tt, [2, 72]), + t(tt, [2, 74]), + t(wt, [2, 4]), + t([22, 53, 69, 97, 110, 113, 114, 117, 119, 122, 123, 124], [2, 86]), + { 42: [1, 268], 76: It, 90: 222, 124: $t, 125: Ot, 126: Pt }, + { + 18: 18, + 19: 19, + 20: a, + 21: c, + 22: o, + 23: l, + 32: 24, + 33: 25, + 34: 26, + 35: 27, + 36: 28, + 37: 29, + 38: h, + 43: [1, 269], + 44: 31, + 45: A, + 47: d, + 49: p, + 51: 35, + 52: 45, + 53: y, + 54: 46, + 56: 47, + 69: E, + 92: f, + 93: k, + 94: D, + 95: g, + 96: b, + 97: _, + 110: F, + 113: T, + 114: C, + 117: S, + 119: B, + 121: 48, + 122: m, + 123: v, + 124: x, + 129: L, + 130: I, + 131: R, + 132: N, + }, + t(J, [2, 56]), + t(st, [2, 122], { 114: qt }), + t(Zt, [2, 131], { + 116: 271, + 22: Kt, + 69: Yt, + 92: jt, + 113: Xt, + 117: zt, + 118: Ht, + 119: Wt, + 120: Qt, + }), + t(Jt, [2, 133]), + t(Jt, [2, 135]), + t(Jt, [2, 136]), + t(Jt, [2, 137]), + t(Jt, [2, 138]), + t(Jt, [2, 139]), + t(Jt, [2, 140]), + t(Jt, [2, 141]), + t(Jt, [2, 142]), + t(st, [2, 123], { 114: qt }), + { 22: [1, 272] }, + t(st, [2, 124], { 114: qt }), + { 22: [1, 273] }, + t(Gt, [2, 130]), + t(st, [2, 106], { 114: qt }), + t(st, [2, 107], { + 121: 119, + 53: y, + 69: E, + 97: _, + 110: F, + 113: T, + 114: C, + 117: S, + 119: B, + 122: m, + 123: v, + 124: x, + }), + t(st, [2, 111]), + t(st, [2, 113], { 22: [1, 274] }), + t(st, [2, 114]), + { 106: [1, 275] }, + { 60: [1, 276] }, + { 71: [1, 277] }, + { 75: [1, 278] }, + { 9: 279, 20: w, 21: U, 23: V }, + t(P, [2, 42]), + { + 22: Kt, + 69: Yt, + 92: jt, + 113: Xt, + 115: 280, + 116: 245, + 117: zt, + 118: Ht, + 119: Wt, + 120: Qt, + }, + t(Jt, [2, 134]), + { + 26: M, + 53: K, + 69: Y, + 97: j, + 109: 281, + 113: X, + 114: z, + 117: H, + 119: W, + 122: Q, + 123: q, + 124: Z, + 128: 94, + }, + { + 26: M, + 53: K, + 69: Y, + 97: j, + 109: 282, + 113: X, + 114: z, + 117: H, + 119: W, + 122: Q, + 123: q, + 124: Z, + 128: 94, + }, + { 106: [1, 283] }, + t(st, [2, 121]), + t(tt, [2, 61]), + { 41: 284, 76: It, 88: Rt, 89: Nt, 90: 177, 124: $t, 125: Ot, 126: Pt }, + t(tt, [2, 69]), + t(vt, n, { 17: 285 }), + t(Zt, [2, 132], { + 116: 271, + 22: Kt, + 69: Yt, + 92: jt, + 113: Xt, + 117: zt, + 118: Ht, + 119: Wt, + 120: Qt, + }), + t(st, [2, 127], { + 128: 173, + 22: [1, 286], + 26: M, + 53: K, + 69: Y, + 97: j, + 113: X, + 114: z, + 117: H, + 119: W, + 122: Q, + 123: q, + 124: Z, + }), + t(st, [2, 128], { + 128: 173, + 22: [1, 287], + 26: M, + 53: K, + 69: Y, + 97: j, + 113: X, + 114: z, + 117: H, + 119: W, + 122: Q, + 123: q, + 124: Z, + }), + t(st, [2, 115]), + { 42: [1, 288], 76: It, 90: 222, 124: $t, 125: Ot, 126: Pt }, + { + 18: 18, + 19: 19, + 20: a, + 21: c, + 22: o, + 23: l, + 32: 24, + 33: 25, + 34: 26, + 35: 27, + 36: 28, + 37: 29, + 38: h, + 43: [1, 289], + 44: 31, + 45: A, + 47: d, + 49: p, + 51: 35, + 52: 45, + 53: y, + 54: 46, + 56: 47, + 69: E, + 92: f, + 93: k, + 94: D, + 95: g, + 96: b, + 97: _, + 110: F, + 113: T, + 114: C, + 117: S, + 119: B, + 121: 48, + 122: m, + 123: v, + 124: x, + 129: L, + 130: I, + 131: R, + 132: N, + }, + { + 22: Kt, + 69: Yt, + 92: jt, + 100: 290, + 113: Xt, + 115: 244, + 116: 245, + 117: zt, + 118: Ht, + 119: Wt, + 120: Qt, + }, + { + 22: Kt, + 69: Yt, + 92: jt, + 100: 291, + 113: Xt, + 115: 244, + 116: 245, + 117: zt, + 118: Ht, + 119: Wt, + 120: Qt, + }, + t(tt, [2, 65]), + t(P, [2, 41]), + t(st, [2, 125], { 114: qt }), + t(st, [2, 126], { 114: qt }), + ], + defaultActions: { 2: [2, 1], 9: [2, 5], 10: [2, 2], 122: [2, 7] }, + parseError: function (t, e) { + if (!e.recoverable) { + var s = new Error(t); + throw ((s.hash = e), s); + } + this.trace(t); + }, + parse: function (t) { + var e = [0], + s = [], + u = [null], + i = [], + r = this.table, + n = "", + a = 0, + c = 0, + o = i.slice.call(arguments, 1), + l = Object.create(this.lexer), + h = { yy: {} }; + for (var A in this.yy) Object.prototype.hasOwnProperty.call(this.yy, A) && (h.yy[A] = this.yy[A]); + l.setInput(t, h.yy), (h.yy.lexer = l), (h.yy.parser = this), void 0 === l.yylloc && (l.yylloc = {}); + var d = l.yylloc; + i.push(d); + var p = l.options && l.options.ranges; + "function" == typeof h.yy.parseError + ? (this.parseError = h.yy.parseError) + : (this.parseError = Object.getPrototypeOf(this).parseError); + for (var y, E, f, k, D, g, b, _, F, T = {}; ; ) { + if ( + ((E = e[e.length - 1]), + this.defaultActions[E] + ? (f = this.defaultActions[E]) + : (null == y && + ((F = void 0), + "number" != typeof (F = s.pop() || l.lex() || 1) && + (F instanceof Array && (F = (s = F).pop()), (F = this.symbols_[F] || F)), + (y = F)), + (f = r[E] && r[E][y])), + void 0 === f || !f.length || !f[0]) + ) { + var C; + for (D in ((_ = []), r[E])) this.terminals_[D] && D > 2 && _.push("'" + this.terminals_[D] + "'"); + (C = l.showPosition + ? "Parse error on line " + + (a + 1) + + ":\n" + + l.showPosition() + + "\nExpecting " + + _.join(", ") + + ", got '" + + (this.terminals_[y] || y) + + "'" + : "Parse error on line " + (a + 1) + ": Unexpected " + (1 == y ? "end of input" : "'" + (this.terminals_[y] || y) + "'")), + this.parseError(C, { + text: l.match, + token: this.terminals_[y] || y, + line: l.yylineno, + loc: d, + expected: _, + }); + } + if (f[0] instanceof Array && f.length > 1) + throw new Error("Parse Error: multiple actions possible at state: " + E + ", token: " + y); + switch (f[0]) { + case 1: + e.push(y), + u.push(l.yytext), + i.push(l.yylloc), + e.push(f[1]), + (y = null), + (c = l.yyleng), + (n = l.yytext), + (a = l.yylineno), + (d = l.yylloc); + break; + case 2: + if ( + ((g = this.productions_[f[1]][1]), + (T.$ = u[u.length - g]), + (T._$ = { + first_line: i[i.length - (g || 1)].first_line, + last_line: i[i.length - 1].last_line, + first_column: i[i.length - (g || 1)].first_column, + last_column: i[i.length - 1].last_column, + }), + p && (T._$.range = [i[i.length - (g || 1)].range[0], i[i.length - 1].range[1]]), + void 0 !== (k = this.performAction.apply(T, [n, c, a, h.yy, f[1], u, i].concat(o)))) + ) + return k; + g && ((e = e.slice(0, -1 * g * 2)), (u = u.slice(0, -1 * g)), (i = i.slice(0, -1 * g))), + e.push(this.productions_[f[1]][0]), + u.push(T.$), + i.push(T._$), + (b = r[e[e.length - 2]][e[e.length - 1]]), + e.push(b); + break; + case 3: + return !0; + } + } + return !0; + }, + }, + ee = { + EOF: 1, + parseError: function (t, e) { + if (!this.yy.parser) throw new Error(t); + this.yy.parser.parseError(t, e); + }, + setInput: function (t, e) { + return ( + (this.yy = e || this.yy || {}), + (this._input = t), + (this._more = this._backtrack = this.done = !1), + (this.yylineno = this.yyleng = 0), + (this.yytext = this.matched = this.match = ""), + (this.conditionStack = ["INITIAL"]), + (this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }), + this.options.ranges && (this.yylloc.range = [0, 0]), + (this.offset = 0), + this + ); + }, + input: function () { + var t = this._input[0]; + return ( + (this.yytext += t), + this.yyleng++, + this.offset++, + (this.match += t), + (this.matched += t), + t.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, + this.options.ranges && this.yylloc.range[1]++, + (this._input = this._input.slice(1)), + t + ); + }, + unput: function (t) { + var e = t.length, + s = t.split(/(?:\r\n?|\n)/g); + (this._input = t + this._input), (this.yytext = this.yytext.substr(0, this.yytext.length - e)), (this.offset -= e); + var u = this.match.split(/(?:\r\n?|\n)/g); + (this.match = this.match.substr(0, this.match.length - 1)), + (this.matched = this.matched.substr(0, this.matched.length - 1)), + s.length - 1 && (this.yylineno -= s.length - 1); + var i = this.yylloc.range; + return ( + (this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: s + ? (s.length === u.length ? this.yylloc.first_column : 0) + u[u.length - s.length].length - s[0].length + : this.yylloc.first_column - e, + }), + this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - e]), + (this.yyleng = this.yytext.length), + this + ); + }, + more: function () { + return (this._more = !0), this; + }, + reject: function () { + return this.options.backtrack_lexer + ? ((this._backtrack = !0), this) + : this.parseError( + "Lexical error on line " + + (this.yylineno + 1) + + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + + this.showPosition(), + { text: "", token: null, line: this.yylineno }, + ); + }, + less: function (t) { + this.unput(this.match.slice(t)); + }, + pastInput: function () { + var t = this.matched.substr(0, this.matched.length - this.match.length); + return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, ""); + }, + upcomingInput: function () { + var t = this.match; + return ( + t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "") + ); + }, + showPosition: function () { + var t = this.pastInput(), + e = new Array(t.length + 1).join("-"); + return t + this.upcomingInput() + "\n" + e + "^"; + }, + test_match: function (t, e) { + var s, u, i; + if ( + (this.options.backtrack_lexer && + ((i = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column, + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done, + }), + this.options.ranges && (i.yylloc.range = this.yylloc.range.slice(0))), + (u = t[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += u.length), + (this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: u ? u[u.length - 1].length - u[u.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length, + }), + (this.yytext += t[0]), + (this.match += t[0]), + (this.matches = t), + (this.yyleng = this.yytext.length), + this.options.ranges && (this.yylloc.range = [this.offset, (this.offset += this.yyleng)]), + (this._more = !1), + (this._backtrack = !1), + (this._input = this._input.slice(t[0].length)), + (this.matched += t[0]), + (s = this.performAction.call(this, this.yy, this, e, this.conditionStack[this.conditionStack.length - 1])), + this.done && this._input && (this.done = !1), + s) + ) + return s; + if (this._backtrack) { + for (var r in i) this[r] = i[r]; + return !1; + } + return !1; + }, + next: function () { + if (this.done) return this.EOF; + var t, e, s, u; + this._input || (this.done = !0), this._more || ((this.yytext = ""), (this.match = "")); + for (var i = this._currentRules(), r = 0; r < i.length; r++) + if ((s = this._input.match(this.rules[i[r]])) && (!e || s[0].length > e[0].length)) { + if (((e = s), (u = r), this.options.backtrack_lexer)) { + if (!1 !== (t = this.test_match(s, i[r]))) return t; + if (this._backtrack) { + e = !1; + continue; + } + return !1; + } + if (!this.options.flex) break; + } + return e + ? !1 !== (t = this.test_match(e, i[u])) && t + : "" === this._input + ? this.EOF + : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno, + }); + }, + lex: function () { + return this.next() || this.lex(); + }, + begin: function (t) { + this.conditionStack.push(t); + }, + popState: function () { + return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]; + }, + _currentRules: function () { + return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] + ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules + : this.conditions.INITIAL.rules; + }, + topState: function (t) { + return (t = this.conditionStack.length - 1 - Math.abs(t || 0)) >= 0 ? this.conditionStack[t] : "INITIAL"; + }, + pushState: function (t) { + this.begin(t); + }, + stateStackSize: function () { + return this.conditionStack.length; + }, + options: {}, + performAction: function (t, e, s, u) { + switch (s) { + case 0: + return this.begin("open_directive"), 12; + case 1: + return this.begin("type_directive"), 13; + case 2: + return this.popState(), this.begin("arg_directive"), 10; + case 3: + return this.popState(), this.popState(), 15; + case 4: + return 14; + case 5: + return this.begin("acc_title"), 45; + case 6: + return this.popState(), "acc_title_value"; + case 7: + return this.begin("acc_descr"), 47; + case 8: + return this.popState(), "acc_descr_value"; + case 9: + this.begin("acc_descr_multiline"); + break; + case 10: + case 13: + case 16: + case 19: + case 22: + case 32: + this.popState(); + break; + case 11: + return "acc_descr_multiline_value"; + case 12: + this.begin("callbackname"); + break; + case 14: + this.popState(), this.begin("callbackargs"); + break; + case 15: + return 103; + case 17: + return 104; + case 18: + return "MD_STR"; + case 20: + this.begin("md_string"); + break; + case 21: + return "STR"; + case 23: + this.pushState("string"); + break; + case 24: + return 92; + case 25: + return 110; + case 26: + return 93; + case 27: + return 112; + case 28: + return 94; + case 29: + return 95; + case 30: + return 105; + case 31: + this.begin("click"); + break; + case 33: + return 96; + case 34: + case 35: + case 36: + return t.lex.firstGraph() && this.begin("dir"), 24; + case 37: + return 38; + case 38: + return 43; + case 39: + case 40: + case 41: + case 42: + return 106; + case 43: + return this.popState(), 25; + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + return this.popState(), 26; + case 54: + return 129; + case 55: + return 130; + case 56: + return 131; + case 57: + return 132; + case 58: + return 113; + case 59: + case 100: + return 119; + case 60: + return 55; + case 61: + return 69; + case 62: + case 101: + return 53; + case 63: + return 20; + case 64: + return 114; + case 65: + case 99: + return 123; + case 66: + case 69: + case 72: + return this.popState(), 86; + case 67: + return this.pushState("edgeText"), 84; + case 68: + case 71: + case 74: + return 127; + case 70: + return this.pushState("thickEdgeText"), 84; + case 73: + return this.pushState("dottedEdgeText"), 84; + case 75: + return 86; + case 76: + return this.popState(), 62; + case 77: + case 113: + return "TEXT"; + case 78: + return this.pushState("ellipseText"), 61; + case 79: + return this.popState(), 64; + case 80: + return this.pushState("text"), 63; + case 81: + return this.popState(), 66; + case 82: + return this.pushState("text"), 65; + case 83: + return 67; + case 84: + return this.pushState("text"), 76; + case 85: + return this.popState(), 73; + case 86: + return this.pushState("text"), 72; + case 87: + return this.popState(), 58; + case 88: + return this.pushState("text"), 57; + case 89: + return this.popState(), 78; + case 90: + return this.popState(), 80; + case 91: + return 125; + case 92: + return this.pushState("trapText"), 77; + case 93: + return this.pushState("trapText"), 79; + case 94: + return 126; + case 95: + return 76; + case 96: + return 98; + case 97: + return "SEP"; + case 98: + return 97; + case 102: + return 117; + case 103: + return 122; + case 104: + return 124; + case 105: + return this.popState(), 71; + case 106: + return this.pushState("text"), 71; + case 107: + return this.popState(), 60; + case 108: + return this.pushState("text"), 59; + case 109: + return this.popState(), 42; + case 110: + return this.pushState("text"), 40; + case 111: + return this.popState(), 75; + case 112: + return this.pushState("text"), 74; + case 114: + return "QUOTE"; + case 115: + return 21; + case 116: + return 22; + case 117: + return 23; + } + }, + rules: [ + /^(?:%%\{)/, + /^(?:((?:(?!\}%%)[^:.])*))/, + /^(?::)/, + /^(?:\}%%)/, + /^(?:((?:(?!\}%%).|\n)*))/, + /^(?:accTitle\s*:\s*)/, + /^(?:(?!\n||)*[^\n]*)/, + /^(?:accDescr\s*:\s*)/, + /^(?:(?!\n||)*[^\n]*)/, + /^(?:accDescr\s*\{\s*)/, + /^(?:[\}])/, + /^(?:[^\}]*)/, + /^(?:call[\s]+)/, + /^(?:\([\s]*\))/, + /^(?:\()/, + /^(?:[^(]*)/, + /^(?:\))/, + /^(?:[^)]*)/, + /^(?:[^`"]+)/, + /^(?:[`]["])/, + /^(?:["][`])/, + /^(?:[^"]+)/, + /^(?:["])/, + /^(?:["])/, + /^(?:style\b)/, + /^(?:default\b)/, + /^(?:linkStyle\b)/, + /^(?:interpolate\b)/, + /^(?:classDef\b)/, + /^(?:class\b)/, + /^(?:href[\s])/, + /^(?:click[\s]+)/, + /^(?:[\s\n])/, + /^(?:[^\s\n]*)/, + /^(?:flowchart-elk\b)/, + /^(?:graph\b)/, + /^(?:flowchart\b)/, + /^(?:subgraph\b)/, + /^(?:end\b\s*)/, + /^(?:_self\b)/, + /^(?:_blank\b)/, + /^(?:_parent\b)/, + /^(?:_top\b)/, + /^(?:(\r?\n)*\s*\n)/, + /^(?:\s*LR\b)/, + /^(?:\s*RL\b)/, + /^(?:\s*TB\b)/, + /^(?:\s*BT\b)/, + /^(?:\s*TD\b)/, + /^(?:\s*BR\b)/, + /^(?:\s*<)/, + /^(?:\s*>)/, + /^(?:\s*\^)/, + /^(?:\s*v\b)/, + /^(?:.*direction\s+TB[^\n]*)/, + /^(?:.*direction\s+BT[^\n]*)/, + /^(?:.*direction\s+RL[^\n]*)/, + /^(?:.*direction\s+LR[^\n]*)/, + /^(?:[0-9]+)/, + /^(?:#)/, + /^(?::::)/, + /^(?::)/, + /^(?:&)/, + /^(?:;)/, + /^(?:,)/, + /^(?:\*)/, + /^(?:\s*[xo<]?--+[-xo>]\s*)/, + /^(?:\s*[xo<]?--\s*)/, + /^(?:[^-]|-(?!-)+)/, + /^(?:\s*[xo<]?==+[=xo>]\s*)/, + /^(?:\s*[xo<]?==\s*)/, + /^(?:[^=]|=(?!))/, + /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, + /^(?:\s*[xo<]?-\.\s*)/, + /^(?:[^\.]|\.(?!))/, + /^(?:\s*~~[\~]+\s*)/, + /^(?:[-/\)][\)])/, + /^(?:[^\(\)\[\]\{\}]|(?!\)+))/, + /^(?:\(-)/, + /^(?:\]\))/, + /^(?:\(\[)/, + /^(?:\]\])/, + /^(?:\[\[)/, + /^(?:\[\|)/, + /^(?:>)/, + /^(?:\)\])/, + /^(?:\[\()/, + /^(?:\)\)\))/, + /^(?:\(\(\()/, + /^(?:[\\(?=\])][\]])/, + /^(?:\/(?=\])\])/, + /^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/, + /^(?:\[\/)/, + /^(?:\[\\)/, + /^(?:<)/, + /^(?:>)/, + /^(?:\^)/, + /^(?:\\\|)/, + /^(?:v\b)/, + /^(?:\*)/, + /^(?:#)/, + /^(?:&)/, + /^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/, + /^(?:-)/, + /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, + /^(?:\|)/, + /^(?:\|)/, + /^(?:\))/, + /^(?:\()/, + /^(?:\])/, + /^(?:\[)/, + /^(?:(\}))/, + /^(?:\{)/, + /^(?:[^\[\]\(\)\{\}\|\"]+)/, + /^(?:")/, + /^(?:(\r?\n)+)/, + /^(?:\s)/, + /^(?:$)/, + ], + conditions: { + close_directive: { + rules: [20, 23, 75, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + arg_directive: { + rules: [3, 4, 20, 23, 75, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + type_directive: { + rules: [2, 3, 20, 23, 75, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + open_directive: { + rules: [1, 20, 23, 75, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + callbackargs: { + rules: [16, 17, 20, 23, 75, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + callbackname: { + rules: [13, 14, 15, 20, 23, 75, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + href: { + rules: [20, 23, 75, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + click: { + rules: [20, 23, 32, 33, 75, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + dottedEdgeText: { + rules: [20, 23, 72, 74, 75, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + thickEdgeText: { + rules: [20, 23, 69, 71, 75, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + edgeText: { + rules: [20, 23, 66, 68, 75, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + trapText: { + rules: [20, 23, 75, 78, 80, 82, 86, 88, 89, 90, 91, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + ellipseText: { + rules: [20, 23, 75, 76, 77, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + text: { + rules: [20, 23, 75, 78, 79, 80, 81, 82, 85, 86, 87, 88, 92, 93, 105, 106, 107, 108, 109, 110, 111, 112, 113], + inclusive: !1, + }, + vertex: { + rules: [20, 23, 75, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + dir: { + rules: [20, 23, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 75, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + acc_descr_multiline: { + rules: [10, 11, 20, 23, 75, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + acc_descr: { + rules: [8, 20, 23, 75, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + acc_title: { + rules: [6, 20, 23, 75, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + md_string: { + rules: [18, 19, 20, 23, 75, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + string: { + rules: [20, 21, 22, 23, 75, 78, 80, 82, 86, 88, 92, 93, 106, 108, 110, 112], + inclusive: !1, + }, + INITIAL: { + rules: [ + 0, 5, 7, 9, 12, 20, 23, 24, 25, 26, 27, 28, 29, 30, 31, 34, 35, 36, 37, 38, 39, 40, 41, 42, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 69, 70, 72, 73, 75, 78, 80, 82, 83, 84, 86, 88, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 106, + 108, 110, 112, 114, 115, 116, 117, + ], + inclusive: !0, + }, + }, + }; + function se() { + this.yy = {}; + } + return (te.lexer = ee), (se.prototype = te), (te.Parser = se), new se(); + })(); + r.parser = r; + const n = r; + let a, + c, + o = 0, + l = (0, i.c)(), + h = {}, + A = [], + d = {}, + p = [], + y = {}, + E = {}, + f = 0, + k = !0, + D = []; + const g = (t) => i.e.sanitizeText(t, l), + b = function (t, e, s) { + i.m.parseDirective(this, t, e, s); + }, + _ = function (t) { + const e = Object.keys(h); + for (const s of e) if (h[s].id === t) return h[s].domId; + return t; + }, + F = function (t, e, s, u, r, n, a = {}) { + let c, + A = t; + void 0 !== A && + 0 !== A.trim().length && + (void 0 === h[A] && + (h[A] = { + id: A, + labelType: "text", + domId: "flowchart-" + A + "-" + o, + styles: [], + classes: [], + }), + o++, + void 0 !== e + ? ((l = (0, i.c)()), + (c = g(e.text.trim())), + (h[A].labelType = e.type), + '"' === c[0] && '"' === c[c.length - 1] && (c = c.substring(1, c.length - 1)), + (h[A].text = c)) + : void 0 === h[A].text && (h[A].text = t), + void 0 !== s && (h[A].type = s), + null != u && + u.forEach(function (t) { + h[A].styles.push(t); + }), + null != r && + r.forEach(function (t) { + h[A].classes.push(t); + }), + void 0 !== n && (h[A].dir = n), + void 0 === h[A].props ? (h[A].props = a) : void 0 !== a && Object.assign(h[A].props, a)); + }, + T = function (t, e, s) { + const u = { start: t, end: e, type: void 0, text: "", labelType: "text" }; + i.l.info("abc78 Got edge...", u); + const r = s.text; + void 0 !== r && + ((u.text = g(r.text.trim())), + '"' === u.text[0] && '"' === u.text[u.text.length - 1] && (u.text = u.text.substring(1, u.text.length - 1)), + (u.labelType = r.type)), + void 0 !== s && ((u.type = s.type), (u.stroke = s.stroke), (u.length = s.length)), + A.push(u); + }, + C = function (t, e, s) { + let u, r; + for (i.l.info("addLink (abc78)", t, e, s), u = 0; u < t.length; u++) for (r = 0; r < e.length; r++) T(t[u], e[r], s); + }, + S = function (t, e) { + t.forEach(function (t) { + "default" === t ? (A.defaultInterpolate = e) : (A[t].interpolate = e); + }); + }, + B = function (t, e) { + t.forEach(function (t) { + "default" === t ? (A.defaultStyle = e) : (-1 === i.u.isSubstringInArray("fill", e) && e.push("fill:none"), (A[t].style = e)); + }); + }, + m = function (t, e) { + t.split(",").forEach(function (t) { + void 0 === d[t] && (d[t] = { id: t, styles: [], textStyles: [] }), + null != e && + e.forEach(function (e) { + if (e.match("color")) { + const s = e.replace("fill", "bgFill").replace("color", "fill"); + d[t].textStyles.push(s); + } + d[t].styles.push(e); + }); + }); + }, + v = function (t) { + (a = t), + a.match(/.*/) && (a = "LR"), + a.match(/.*v/) && (a = "TB"), + "TD" === a && (a = "TB"); + }, + x = function (t, e) { + t.split(",").forEach(function (t) { + let s = t; + void 0 !== h[s] && h[s].classes.push(e), void 0 !== y[s] && y[s].classes.push(e); + }); + }, + L = function (t, e, s) { + t.split(",").forEach(function (t) { + void 0 !== h[t] && ((h[t].link = i.u.formatUrl(e, l)), (h[t].linkTarget = s)); + }), + x(t, "clickable"); + }, + I = function (t) { + if (E.hasOwnProperty(t)) return E[t]; + }, + R = function (t, e, s) { + t.split(",").forEach(function (t) { + !(function (t, e, s) { + let u = _(t); + if ("loose" !== (0, i.c)().securityLevel) return; + if (void 0 === e) return; + let r = []; + if ("string" == typeof s) { + r = s.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); + for (let t = 0; t < r.length; t++) { + let e = r[t].trim(); + '"' === e.charAt(0) && '"' === e.charAt(e.length - 1) && (e = e.substr(1, e.length - 2)), (r[t] = e); + } + } + 0 === r.length && r.push(t), + void 0 !== h[t] && + ((h[t].haveCallback = !0), + D.push(function () { + const t = document.querySelector(`[id="${u}"]`); + null !== t && + t.addEventListener( + "click", + function () { + i.u.runFunc(e, ...r); + }, + !1, + ); + })); + })(t, e, s); + }), + x(t, "clickable"); + }, + N = function (t) { + D.forEach(function (e) { + e(t); + }); + }, + $ = function () { + return a.trim(); + }, + O = function () { + return h; + }, + P = function () { + return A; + }, + w = function () { + return d; + }, + U = function (t) { + let e = (0, u.Ys)(".mermaidTooltip"); + null === (e._groups || e)[0][0] && (e = (0, u.Ys)("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0)), + (0, u.Ys)(t) + .select("svg") + .selectAll("g.node") + .on("mouseover", function () { + const t = (0, u.Ys)(this); + if (null === t.attr("title")) return; + const s = this.getBoundingClientRect(); + e.transition().duration(200).style("opacity", ".9"), + e + .text(t.attr("title")) + .style("left", window.scrollX + s.left + (s.right - s.left) / 2 + "px") + .style("top", window.scrollY + s.top - 14 + document.body.scrollTop + "px"), + e.html(e.html().replace(/<br\/>/g, "
    ")), + t.classed("hover", !0); + }) + .on("mouseout", function () { + e.transition().duration(500).style("opacity", 0), (0, u.Ys)(this).classed("hover", !1); + }); + }; + D.push(U); + const V = function (t = "gen-1") { + (h = {}), (d = {}), (A = []), (D = [U]), (p = []), (y = {}), (f = 0), (E = {}), (k = !0), (c = t), (0, i.v)(); + }, + G = (t) => { + c = t || "gen-2"; + }, + M = function () { + return "fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"; + }, + K = function (t, e, s) { + let u = t.text.trim(), + r = s.text; + t === s && s.text.match(/\s/) && (u = void 0); + let n = []; + const { nodeList: a, dir: o } = (function (t) { + const e = { boolean: {}, number: {}, string: {} }, + s = []; + let u; + return { + nodeList: t.filter(function (t) { + const i = typeof t; + return t.stmt && "dir" === t.stmt + ? ((u = t.value), !1) + : "" !== t.trim() && (i in e ? !e[i].hasOwnProperty(t) && (e[i][t] = !0) : !s.includes(t) && s.push(t)); + }), + dir: u, + }; + })(n.concat.apply(n, e)); + if (((n = a), "gen-1" === c)) for (let t = 0; t < n.length; t++) n[t] = _(n[t]); + (u = u || "subGraph" + f), (r = r || ""), (r = g(r)), (f += 1); + const l = { id: u, nodes: n, title: r.trim(), classes: [], dir: o, labelType: s.type }; + return i.l.info("Adding", l.id, l.nodes, l.dir), (l.nodes = tt(l, p).nodes), p.push(l), (y[u] = l), u; + }, + Y = function (t) { + for (const [e, s] of p.entries()) if (s.id === t) return e; + return -1; + }; + let j = -1; + const X = [], + z = function (t, e) { + const s = p[e].nodes; + if (((j += 1), j > 2e3)) return; + if (((X[j] = e), p[e].id === t)) return { result: !0, count: 0 }; + let u = 0, + i = 1; + for (; u < s.length; ) { + const e = Y(s[u]); + if (e >= 0) { + const s = z(t, e); + if (s.result) return { result: !0, count: i + s.count }; + i += s.count; + } + u += 1; + } + return { result: !1, count: i }; + }, + H = function (t) { + return X[t]; + }, + W = function () { + (j = -1), p.length > 0 && z("none", p.length - 1); + }, + Q = function () { + return p; + }, + q = () => !!k && ((k = !1), !0), + Z = (t, e) => { + const s = ((t) => { + const e = t.trim(); + let s = e.slice(0, -1), + u = "arrow_open"; + switch (e.slice(-1)) { + case "x": + (u = "arrow_cross"), "x" === e[0] && ((u = "double_" + u), (s = s.slice(1))); + break; + case ">": + (u = "arrow_point"), "<" === e[0] && ((u = "double_" + u), (s = s.slice(1))); + break; + case "o": + (u = "arrow_circle"), "o" === e[0] && ((u = "double_" + u), (s = s.slice(1))); + } + let i = "normal", + r = s.length - 1; + "=" === s[0] && (i = "thick"), "~" === s[0] && (i = "invisible"); + let n = ((t, e) => { + const s = e.length; + let u = 0; + for (let t = 0; t < s; ++t) "." === e[t] && ++u; + return u; + })(0, s); + return n && ((i = "dotted"), (r = n)), { type: u, stroke: i, length: r }; + })(t); + let u; + if (e) { + if ( + ((u = ((t) => { + let e = t.trim(), + s = "arrow_open"; + switch (e[0]) { + case "<": + (s = "arrow_point"), (e = e.slice(1)); + break; + case "x": + (s = "arrow_cross"), (e = e.slice(1)); + break; + case "o": + (s = "arrow_circle"), (e = e.slice(1)); + } + let u = "normal"; + return e.includes("=") && (u = "thick"), e.includes(".") && (u = "dotted"), { type: s, stroke: u }; + })(e)), + u.stroke !== s.stroke) + ) + return { type: "INVALID", stroke: "INVALID" }; + if ("arrow_open" === u.type) u.type = s.type; + else { + if (u.type !== s.type) return { type: "INVALID", stroke: "INVALID" }; + u.type = "double_" + u.type; + } + return "double_arrow" === u.type && (u.type = "double_arrow_point"), (u.length = s.length), u; + } + return s; + }, + J = (t, e) => { + let s = !1; + return ( + t.forEach((t) => { + t.nodes.indexOf(e) >= 0 && (s = !0); + }), + s + ); + }, + tt = (t, e) => { + const s = []; + return ( + t.nodes.forEach((u, i) => { + J(e, u) || s.push(t.nodes[i]); + }), + { nodes: s } + ); + }, + et = { firstGraph: q }, + st = { + parseDirective: b, + defaultConfig: () => i.K.flowchart, + setAccTitle: i.s, + getAccTitle: i.g, + getAccDescription: i.a, + setAccDescription: i.b, + addVertex: F, + lookUpDomId: _, + addLink: C, + updateLinkInterpolate: S, + updateLink: B, + addClass: m, + setDirection: v, + setClass: x, + setTooltip: function (t, e) { + t.split(",").forEach(function (t) { + void 0 !== e && (E["gen-1" === c ? _(t) : t] = g(e)); + }); + }, + getTooltip: I, + setClickEvent: R, + setLink: L, + bindFunctions: N, + getDirection: $, + getVertices: O, + getEdges: P, + getClasses: w, + clear: V, + setGen: G, + defaultStyle: M, + addSubGraph: K, + getDepthFirstPos: H, + indexNodes: W, + getSubGraphs: Q, + destructLink: Z, + lex: et, + exists: J, + makeUniq: tt, + setDiagramTitle: i.r, + getDiagramTitle: i.t, + }, + ut = Object.freeze( + Object.defineProperty( + { + __proto__: null, + addClass: m, + addLink: C, + addSingleLink: T, + addSubGraph: K, + addVertex: F, + bindFunctions: N, + clear: V, + default: st, + defaultStyle: M, + destructLink: Z, + firstGraph: q, + getClasses: w, + getDepthFirstPos: H, + getDirection: $, + getEdges: P, + getSubGraphs: Q, + getTooltip: I, + getVertices: O, + indexNodes: W, + lex: et, + lookUpDomId: _, + parseDirective: b, + setClass: x, + setClickEvent: R, + setDirection: v, + setGen: G, + setLink: L, + updateLink: B, + updateLinkInterpolate: S, + }, + Symbol.toStringTag, + { value: "Module" }, + ), + ); + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/940-25dfc794.chunk.min.js b/docs/themes/hugo-geekdoc/static/js/940-25dfc794.chunk.min.js new file mode 100644 index 000000000..200e209d9 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/940-25dfc794.chunk.min.js @@ -0,0 +1,979 @@ +"use strict"; +(self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []).push([ + [940], + { + 5940: function (t, e, n) { + n.d(e, { + diagram: function () { + return M; + }, + }); + var i = n(9339), + s = n(7274), + r = n(6500), + a = n(2281), + o = n(7201), + c = + (n(7484), + n(7967), + n(7856), + (function () { + var t = function (t, e, n, i) { + for (n = n || {}, i = t.length; i--; n[t[i]] = e); + return n; + }, + e = [1, 2], + n = [1, 5], + i = [6, 9, 11, 17, 18, 20, 22, 23, 26, 27, 28], + s = [1, 15], + r = [1, 16], + a = [1, 17], + o = [1, 18], + c = [1, 19], + l = [1, 23], + h = [1, 24], + d = [1, 27], + u = [4, 6, 9, 11, 17, 18, 20, 22, 23, 26, 27, 28], + p = { + trace: function () {}, + yy: {}, + symbols_: { + error: 2, + start: 3, + timeline: 4, + document: 5, + EOF: 6, + directive: 7, + line: 8, + SPACE: 9, + statement: 10, + NEWLINE: 11, + openDirective: 12, + typeDirective: 13, + closeDirective: 14, + ":": 15, + argDirective: 16, + title: 17, + acc_title: 18, + acc_title_value: 19, + acc_descr: 20, + acc_descr_value: 21, + acc_descr_multiline_value: 22, + section: 23, + period_statement: 24, + event_statement: 25, + period: 26, + event: 27, + open_directive: 28, + type_directive: 29, + arg_directive: 30, + close_directive: 31, + $accept: 0, + $end: 1, + }, + terminals_: { + 2: "error", + 4: "timeline", + 6: "EOF", + 9: "SPACE", + 11: "NEWLINE", + 15: ":", + 17: "title", + 18: "acc_title", + 19: "acc_title_value", + 20: "acc_descr", + 21: "acc_descr_value", + 22: "acc_descr_multiline_value", + 23: "section", + 26: "period", + 27: "event", + 28: "open_directive", + 29: "type_directive", + 30: "arg_directive", + 31: "close_directive", + }, + productions_: [ + 0, + [3, 3], + [3, 2], + [5, 0], + [5, 2], + [8, 2], + [8, 1], + [8, 1], + [8, 1], + [7, 4], + [7, 6], + [10, 1], + [10, 2], + [10, 2], + [10, 1], + [10, 1], + [10, 1], + [10, 1], + [10, 1], + [24, 1], + [25, 1], + [12, 1], + [13, 1], + [16, 1], + [14, 1], + ], + performAction: function (t, e, n, i, s, r, a) { + var o = r.length - 1; + switch (s) { + case 1: + return r[o - 1]; + case 3: + case 7: + case 8: + this.$ = []; + break; + case 4: + r[o - 1].push(r[o]), (this.$ = r[o - 1]); + break; + case 5: + case 6: + this.$ = r[o]; + break; + case 11: + i.getCommonDb().setDiagramTitle(r[o].substr(6)), (this.$ = r[o].substr(6)); + break; + case 12: + (this.$ = r[o].trim()), i.getCommonDb().setAccTitle(this.$); + break; + case 13: + case 14: + (this.$ = r[o].trim()), i.getCommonDb().setAccDescription(this.$); + break; + case 15: + i.addSection(r[o].substr(8)), (this.$ = r[o].substr(8)); + break; + case 19: + i.addTask(r[o], 0, ""), (this.$ = r[o]); + break; + case 20: + i.addEvent(r[o].substr(2)), (this.$ = r[o]); + break; + case 21: + i.parseDirective("%%{", "open_directive"); + break; + case 22: + i.parseDirective(r[o], "type_directive"); + break; + case 23: + (r[o] = r[o].trim().replace(/'/g, '"')), i.parseDirective(r[o], "arg_directive"); + break; + case 24: + i.parseDirective("}%%", "close_directive", "timeline"); + } + }, + table: [ + { 3: 1, 4: e, 7: 3, 12: 4, 28: n }, + { 1: [3] }, + t(i, [2, 3], { 5: 6 }), + { 3: 7, 4: e, 7: 3, 12: 4, 28: n }, + { 13: 8, 29: [1, 9] }, + { 29: [2, 21] }, + { + 6: [1, 10], + 7: 22, + 8: 11, + 9: [1, 12], + 10: 13, + 11: [1, 14], + 12: 4, + 17: s, + 18: r, + 20: a, + 22: o, + 23: c, + 24: 20, + 25: 21, + 26: l, + 27: h, + 28: n, + }, + { 1: [2, 2] }, + { 14: 25, 15: [1, 26], 31: d }, + t([15, 31], [2, 22]), + t(i, [2, 8], { 1: [2, 1] }), + t(i, [2, 4]), + { + 7: 22, + 10: 28, + 12: 4, + 17: s, + 18: r, + 20: a, + 22: o, + 23: c, + 24: 20, + 25: 21, + 26: l, + 27: h, + 28: n, + }, + t(i, [2, 6]), + t(i, [2, 7]), + t(i, [2, 11]), + { 19: [1, 29] }, + { 21: [1, 30] }, + t(i, [2, 14]), + t(i, [2, 15]), + t(i, [2, 16]), + t(i, [2, 17]), + t(i, [2, 18]), + t(i, [2, 19]), + t(i, [2, 20]), + { 11: [1, 31] }, + { 16: 32, 30: [1, 33] }, + { 11: [2, 24] }, + t(i, [2, 5]), + t(i, [2, 12]), + t(i, [2, 13]), + t(u, [2, 9]), + { 14: 34, 31: d }, + { 31: [2, 23] }, + { 11: [1, 35] }, + t(u, [2, 10]), + ], + defaultActions: { 5: [2, 21], 7: [2, 2], 27: [2, 24], 33: [2, 23] }, + parseError: function (t, e) { + if (!e.recoverable) { + var n = new Error(t); + throw ((n.hash = e), n); + } + this.trace(t); + }, + parse: function (t) { + var e = [0], + n = [], + i = [null], + s = [], + r = this.table, + a = "", + o = 0, + c = 0, + l = s.slice.call(arguments, 1), + h = Object.create(this.lexer), + d = { yy: {} }; + for (var u in this.yy) Object.prototype.hasOwnProperty.call(this.yy, u) && (d.yy[u] = this.yy[u]); + h.setInput(t, d.yy), (d.yy.lexer = h), (d.yy.parser = this), void 0 === h.yylloc && (h.yylloc = {}); + var p = h.yylloc; + s.push(p); + var g = h.options && h.options.ranges; + "function" == typeof d.yy.parseError + ? (this.parseError = d.yy.parseError) + : (this.parseError = Object.getPrototypeOf(this).parseError); + for (var y, f, m, _, b, v, k, x, S, w = {}; ; ) { + if ( + ((f = e[e.length - 1]), + this.defaultActions[f] + ? (m = this.defaultActions[f]) + : (null == y && + ((S = void 0), + "number" != typeof (S = n.pop() || h.lex() || 1) && + (S instanceof Array && (S = (n = S).pop()), (S = this.symbols_[S] || S)), + (y = S)), + (m = r[f] && r[f][y])), + void 0 === m || !m.length || !m[0]) + ) { + var $; + for (b in ((x = []), r[f])) this.terminals_[b] && b > 2 && x.push("'" + this.terminals_[b] + "'"); + ($ = h.showPosition + ? "Parse error on line " + + (o + 1) + + ":\n" + + h.showPosition() + + "\nExpecting " + + x.join(", ") + + ", got '" + + (this.terminals_[y] || y) + + "'" + : "Parse error on line " + (o + 1) + ": Unexpected " + (1 == y ? "end of input" : "'" + (this.terminals_[y] || y) + "'")), + this.parseError($, { + text: h.match, + token: this.terminals_[y] || y, + line: h.yylineno, + loc: p, + expected: x, + }); + } + if (m[0] instanceof Array && m.length > 1) + throw new Error("Parse Error: multiple actions possible at state: " + f + ", token: " + y); + switch (m[0]) { + case 1: + e.push(y), + i.push(h.yytext), + s.push(h.yylloc), + e.push(m[1]), + (y = null), + (c = h.yyleng), + (a = h.yytext), + (o = h.yylineno), + (p = h.yylloc); + break; + case 2: + if ( + ((v = this.productions_[m[1]][1]), + (w.$ = i[i.length - v]), + (w._$ = { + first_line: s[s.length - (v || 1)].first_line, + last_line: s[s.length - 1].last_line, + first_column: s[s.length - (v || 1)].first_column, + last_column: s[s.length - 1].last_column, + }), + g && (w._$.range = [s[s.length - (v || 1)].range[0], s[s.length - 1].range[1]]), + void 0 !== (_ = this.performAction.apply(w, [a, c, o, d.yy, m[1], i, s].concat(l)))) + ) + return _; + v && ((e = e.slice(0, -1 * v * 2)), (i = i.slice(0, -1 * v)), (s = s.slice(0, -1 * v))), + e.push(this.productions_[m[1]][0]), + i.push(w.$), + s.push(w._$), + (k = r[e[e.length - 2]][e[e.length - 1]]), + e.push(k); + break; + case 3: + return !0; + } + } + return !0; + }, + }, + g = { + EOF: 1, + parseError: function (t, e) { + if (!this.yy.parser) throw new Error(t); + this.yy.parser.parseError(t, e); + }, + setInput: function (t, e) { + return ( + (this.yy = e || this.yy || {}), + (this._input = t), + (this._more = this._backtrack = this.done = !1), + (this.yylineno = this.yyleng = 0), + (this.yytext = this.matched = this.match = ""), + (this.conditionStack = ["INITIAL"]), + (this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0, + }), + this.options.ranges && (this.yylloc.range = [0, 0]), + (this.offset = 0), + this + ); + }, + input: function () { + var t = this._input[0]; + return ( + (this.yytext += t), + this.yyleng++, + this.offset++, + (this.match += t), + (this.matched += t), + t.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, + this.options.ranges && this.yylloc.range[1]++, + (this._input = this._input.slice(1)), + t + ); + }, + unput: function (t) { + var e = t.length, + n = t.split(/(?:\r\n?|\n)/g); + (this._input = t + this._input), (this.yytext = this.yytext.substr(0, this.yytext.length - e)), (this.offset -= e); + var i = this.match.split(/(?:\r\n?|\n)/g); + (this.match = this.match.substr(0, this.match.length - 1)), + (this.matched = this.matched.substr(0, this.matched.length - 1)), + n.length - 1 && (this.yylineno -= n.length - 1); + var s = this.yylloc.range; + return ( + (this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: n + ? (n.length === i.length ? this.yylloc.first_column : 0) + i[i.length - n.length].length - n[0].length + : this.yylloc.first_column - e, + }), + this.options.ranges && (this.yylloc.range = [s[0], s[0] + this.yyleng - e]), + (this.yyleng = this.yytext.length), + this + ); + }, + more: function () { + return (this._more = !0), this; + }, + reject: function () { + return this.options.backtrack_lexer + ? ((this._backtrack = !0), this) + : this.parseError( + "Lexical error on line " + + (this.yylineno + 1) + + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + + this.showPosition(), + { text: "", token: null, line: this.yylineno }, + ); + }, + less: function (t) { + this.unput(this.match.slice(t)); + }, + pastInput: function () { + var t = this.matched.substr(0, this.matched.length - this.match.length); + return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, ""); + }, + upcomingInput: function () { + var t = this.match; + return ( + t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "") + ); + }, + showPosition: function () { + var t = this.pastInput(), + e = new Array(t.length + 1).join("-"); + return t + this.upcomingInput() + "\n" + e + "^"; + }, + test_match: function (t, e) { + var n, i, s; + if ( + (this.options.backtrack_lexer && + ((s = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column, + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done, + }), + this.options.ranges && (s.yylloc.range = this.yylloc.range.slice(0))), + (i = t[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += i.length), + (this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: i ? i[i.length - 1].length - i[i.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length, + }), + (this.yytext += t[0]), + (this.match += t[0]), + (this.matches = t), + (this.yyleng = this.yytext.length), + this.options.ranges && (this.yylloc.range = [this.offset, (this.offset += this.yyleng)]), + (this._more = !1), + (this._backtrack = !1), + (this._input = this._input.slice(t[0].length)), + (this.matched += t[0]), + (n = this.performAction.call(this, this.yy, this, e, this.conditionStack[this.conditionStack.length - 1])), + this.done && this._input && (this.done = !1), + n) + ) + return n; + if (this._backtrack) { + for (var r in s) this[r] = s[r]; + return !1; + } + return !1; + }, + next: function () { + if (this.done) return this.EOF; + var t, e, n, i; + this._input || (this.done = !0), this._more || ((this.yytext = ""), (this.match = "")); + for (var s = this._currentRules(), r = 0; r < s.length; r++) + if ((n = this._input.match(this.rules[s[r]])) && (!e || n[0].length > e[0].length)) { + if (((e = n), (i = r), this.options.backtrack_lexer)) { + if (!1 !== (t = this.test_match(n, s[r]))) return t; + if (this._backtrack) { + e = !1; + continue; + } + return !1; + } + if (!this.options.flex) break; + } + return e + ? !1 !== (t = this.test_match(e, s[i])) && t + : "" === this._input + ? this.EOF + : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { + text: "", + token: null, + line: this.yylineno, + }); + }, + lex: function () { + return this.next() || this.lex(); + }, + begin: function (t) { + this.conditionStack.push(t); + }, + popState: function () { + return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]; + }, + _currentRules: function () { + return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] + ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules + : this.conditions.INITIAL.rules; + }, + topState: function (t) { + return (t = this.conditionStack.length - 1 - Math.abs(t || 0)) >= 0 ? this.conditionStack[t] : "INITIAL"; + }, + pushState: function (t) { + this.begin(t); + }, + stateStackSize: function () { + return this.conditionStack.length; + }, + options: { "case-insensitive": !0 }, + performAction: function (t, e, n, i) { + switch (n) { + case 0: + return this.begin("open_directive"), 28; + case 1: + return this.begin("type_directive"), 29; + case 2: + return this.popState(), this.begin("arg_directive"), 15; + case 3: + return this.popState(), this.popState(), 31; + case 4: + return 30; + case 5: + case 6: + case 8: + case 9: + break; + case 7: + return 11; + case 10: + return 4; + case 11: + return 17; + case 12: + return this.begin("acc_title"), 18; + case 13: + return this.popState(), "acc_title_value"; + case 14: + return this.begin("acc_descr"), 20; + case 15: + return this.popState(), "acc_descr_value"; + case 16: + this.begin("acc_descr_multiline"); + break; + case 17: + this.popState(); + break; + case 18: + return "acc_descr_multiline_value"; + case 19: + return 23; + case 20: + return 27; + case 21: + return 26; + case 22: + return 6; + case 23: + return "INVALID"; + } + }, + rules: [ + /^(?:%%\{)/i, + /^(?:((?:(?!\}%%)[^:.])*))/i, + /^(?::)/i, + /^(?:\}%%)/i, + /^(?:((?:(?!\}%%).|\n)*))/i, + /^(?:%(?!\{)[^\n]*)/i, + /^(?:[^\}]%%[^\n]*)/i, + /^(?:[\n]+)/i, + /^(?:\s+)/i, + /^(?:#[^\n]*)/i, + /^(?:timeline\b)/i, + /^(?:title\s[^#\n;]+)/i, + /^(?:accTitle\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*:\s*)/i, + /^(?:(?!\n||)*[^\n]*)/i, + /^(?:accDescr\s*\{\s*)/i, + /^(?:[\}])/i, + /^(?:[^\}]*)/i, + /^(?:section\s[^#:\n;]+)/i, + /^(?::\s[^#:\n;]+)/i, + /^(?:[^#:\n;]+)/i, + /^(?:$)/i, + /^(?:.)/i, + ], + conditions: { + open_directive: { rules: [1], inclusive: !1 }, + type_directive: { rules: [2, 3], inclusive: !1 }, + arg_directive: { rules: [3, 4], inclusive: !1 }, + acc_descr_multiline: { rules: [17, 18], inclusive: !1 }, + acc_descr: { rules: [15], inclusive: !1 }, + acc_title: { rules: [13], inclusive: !1 }, + INITIAL: { + rules: [0, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 19, 20, 21, 22, 23], + inclusive: !0, + }, + }, + }; + function y() { + this.yy = {}; + } + return (p.lexer = g), (y.prototype = p), (p.Parser = y), new y(); + })()); + c.parser = c; + const l = c; + let h = "", + d = 0; + const u = [], + p = [], + g = [], + y = () => i.M, + f = (t, e, n) => { + (0, i.D)(globalThis, t, e, n); + }, + m = function () { + (u.length = 0), (p.length = 0), (h = ""), (g.length = 0), (0, i.v)(); + }, + _ = function (t) { + (h = t), u.push(t); + }, + b = function () { + return u; + }, + v = function () { + let t = w(), + e = 0; + for (; !t && e < 100; ) (t = w()), e++; + return p.push(...g), p; + }, + k = function (t, e, n) { + const i = { id: d++, section: h, type: h, task: t, score: e || 0, events: n ? [n] : [] }; + g.push(i); + }, + x = function (t) { + g.find((t) => t.id === d - 1).events.push(t); + }, + S = function (t) { + const e = { section: h, type: h, description: t, task: t, classes: [] }; + p.push(e); + }, + w = function () { + let t = !0; + for (const [e, n] of g.entries()) g[e].processed, (t = t && n.processed); + return t; + }, + $ = { + clear: m, + getCommonDb: y, + addSection: _, + getSections: b, + getTasks: v, + addTask: k, + addTaskOrg: S, + addEvent: x, + parseDirective: f, + }, + E = Object.freeze( + Object.defineProperty( + { + __proto__: null, + addEvent: x, + addSection: _, + addTask: k, + addTaskOrg: S, + clear: m, + default: $, + getCommonDb: y, + getSections: b, + getTasks: v, + parseDirective: f, + }, + Symbol.toStringTag, + { value: "Module" }, + ), + ); + function I(t, e) { + t.each(function () { + var t, + n = (0, s.Ys)(this), + i = n + .text() + .split(/(\s+|
    )/) + .reverse(), + r = [], + a = n.attr("y"), + o = parseFloat(n.attr("dy")), + c = n + .text(null) + .append("tspan") + .attr("x", 0) + .attr("y", a) + .attr("dy", o + "em"); + for (let s = 0; s < i.length; s++) + (t = i[i.length - 1 - s]), + r.push(t), + c.text(r.join(" ").trim()), + (c.node().getComputedTextLength() > e || "
    " === t) && + (r.pop(), + c.text(r.join(" ").trim()), + (r = "
    " === t ? [""] : [t]), + (c = n.append("tspan").attr("x", 0).attr("y", a).attr("dy", "1.1em").text(t))); + }); + } + const D = function (t, e, n, i) { + const s = (n % 12) - 1, + r = t.append("g"); + (e.section = s), r.attr("class", (e.class ? e.class + " " : "") + "timeline-node section-" + s); + const a = r.append("g"), + o = r.append("g"), + c = o + .append("text") + .text(e.descr) + .attr("dy", "1em") + .attr("alignment-baseline", "middle") + .attr("dominant-baseline", "middle") + .attr("text-anchor", "middle") + .call(I, e.width) + .node() + .getBBox(), + l = i.fontSize && i.fontSize.replace ? i.fontSize.replace("px", "") : i.fontSize; + return ( + (e.height = c.height + 1.1 * l * 0.5 + e.padding), + (e.height = Math.max(e.height, e.maxHeight)), + (e.width = e.width + 2 * e.padding), + o.attr("transform", "translate(" + e.width / 2 + ", " + e.padding / 2 + ")"), + (function (t, e, n) { + t + .append("path") + .attr("id", "node-" + e.id) + .attr("class", "node-bkg node-" + e.type) + .attr("d", `M0 ${e.height - 5} v${10 - e.height} q0,-5 5,-5 h${e.width - 10} q5,0 5,5 v${e.height - 5} H0 Z`), + t + .append("line") + .attr("class", "node-line-" + n) + .attr("x1", 0) + .attr("y1", e.height) + .attr("x2", e.width) + .attr("y2", e.height); + })(a, e, s), + e + ); + }, + T = function (t, e, n) { + const i = t.append("g"), + s = i + .append("text") + .text(e.descr) + .attr("dy", "1em") + .attr("alignment-baseline", "middle") + .attr("dominant-baseline", "middle") + .attr("text-anchor", "middle") + .call(I, e.width) + .node() + .getBBox(), + r = n.fontSize && n.fontSize.replace ? n.fontSize.replace("px", "") : n.fontSize; + return i.remove(), s.height + 1.1 * r * 0.5 + e.padding; + }, + C = function (t, e, n, s, r, a, o, c, l, h, d) { + var u; + for (const c of e) { + const e = { + descr: c.task, + section: n, + number: n, + width: 150, + padding: 20, + maxHeight: a, + }; + i.l.debug("taskNode", e); + const p = t.append("g").attr("class", "taskWrapper"), + g = D(p, e, n, o).height; + if ((i.l.debug("taskHeight after draw", g), p.attr("transform", `translate(${s}, ${r})`), (a = Math.max(a, g)), c.events)) { + const e = t.append("g").attr("class", "lineWrapper"); + let i = a; + (r += 100), + (i += L(t, c.events, n, s, r, o)), + (r -= 100), + e + .append("line") + .attr("x1", s + 95) + .attr("y1", r + a) + .attr("x2", s + 95) + .attr("y2", r + a + (d ? a : h) + l + 120) + .attr("stroke-width", 2) + .attr("stroke", "black") + .attr("marker-end", "url(#arrowhead)") + .attr("stroke-dasharray", "5,5"); + } + (s += 200), d && !(null == (u = o.timeline) ? void 0 : u.disableMulticolor) && n++; + } + r -= 10; + }, + L = function (t, e, n, s, r, a) { + let o = 0; + const c = r; + r += 100; + for (const c of e) { + const e = { descr: c, section: n, number: n, width: 150, padding: 20, maxHeight: 50 }; + i.l.debug("eventNode", e); + const l = t.append("g").attr("class", "eventWrapper"), + h = D(l, e, n, a).height; + (o += h), l.attr("transform", `translate(${s}, ${r})`), (r = r + 10 + h); + } + return (r = c), o; + }, + M = { + db: E, + renderer: { + setConf: () => {}, + draw: function (t, e, n, r) { + var a, o; + const c = (0, i.c)(), + l = c.leftMargin ?? 50; + i.l.debug("timeline", r.db); + const h = c.securityLevel; + let d; + "sandbox" === h && (d = (0, s.Ys)("#i" + e)); + const u = ("sandbox" === h ? (0, s.Ys)(d.nodes()[0].contentDocument.body) : (0, s.Ys)("body")).select("#" + e); + u.append("g"); + const p = r.db.getTasks(), + g = r.db.getCommonDb().getDiagramTitle(); + i.l.debug("task", p), + u + .append("defs") + .append("marker") + .attr("id", "arrowhead") + .attr("refX", 5) + .attr("refY", 2) + .attr("markerWidth", 6) + .attr("markerHeight", 4) + .attr("orient", "auto") + .append("path") + .attr("d", "M 0,0 V 4 L6,2 Z"); + const y = r.db.getSections(); + i.l.debug("sections", y); + let f = 0, + m = 0, + _ = 0, + b = 0, + v = 50 + l, + k = 50; + b = 50; + let x = 0, + S = !0; + y.forEach(function (t) { + const e = T(u, { number: x, descr: t, section: x, width: 150, padding: 20, maxHeight: f }, c); + i.l.debug("sectionHeight before draw", e), (f = Math.max(f, e + 20)); + }); + let w = 0, + $ = 0; + i.l.debug("tasks.length", p.length); + for (const [t, e] of p.entries()) { + const n = { + number: t, + descr: e, + section: e.section, + width: 150, + padding: 20, + maxHeight: m, + }, + s = T(u, n, c); + i.l.debug("taskHeight before draw", s), (m = Math.max(m, s + 20)), (w = Math.max(w, e.events.length)); + let r = 0; + for (let t = 0; t < e.events.length; t++) { + const n = { + descr: e.events[t], + section: e.section, + number: e.section, + width: 150, + padding: 20, + maxHeight: 50, + }; + r += T(u, n, c); + } + $ = Math.max($, r); + } + i.l.debug("maxSectionHeight before draw", f), + i.l.debug("maxTaskHeight before draw", m), + y && y.length > 0 + ? y.forEach((t) => { + const e = p.filter((e) => e.section === t), + n = { + number: x, + descr: t, + section: x, + width: 200 * Math.max(e.length, 1) - 50, + padding: 20, + maxHeight: f, + }; + i.l.debug("sectionNode", n); + const s = u.append("g"), + r = D(s, n, x, c); + i.l.debug("sectionNode output", r), + s.attr("transform", `translate(${v}, 50)`), + (k += f + 50), + e.length > 0 && C(u, e, x, v, k, m, c, 0, $, f, !1), + (v += 200 * Math.max(e.length, 1)), + (k = 50), + x++; + }) + : ((S = !1), C(u, p, x, v, k, m, c, 0, $, f, !0)); + const E = u.node().getBBox(); + i.l.debug("bounds", E), + g && + u + .append("text") + .text(g) + .attr("x", E.width / 2 - l) + .attr("font-size", "4ex") + .attr("font-weight", "bold") + .attr("y", 20), + (_ = S ? f + m + 150 : m + 100), + u + .append("g") + .attr("class", "lineWrapper") + .append("line") + .attr("x1", l) + .attr("y1", _) + .attr("x2", E.width + 3 * l) + .attr("y2", _) + .attr("stroke-width", 4) + .attr("stroke", "black") + .attr("marker-end", "url(#arrowhead)"), + (0, i.p)(void 0, u, (null == (a = c.timeline) ? void 0 : a.padding) ?? 50, (null == (o = c.timeline) ? void 0 : o.useMaxWidth) ?? !1); + }, + }, + parser: l, + styles: (t) => + `\n .edge {\n stroke-width: 3;\n }\n ${((t) => { + let e = ""; + for (let e = 0; e < t.THEME_COLOR_LIMIT; e++) + (t["lineColor" + e] = t["lineColor" + e] || t["cScaleInv" + e]), + (0, r.Z)(t["lineColor" + e]) + ? (t["lineColor" + e] = (0, a.Z)(t["lineColor" + e], 20)) + : (t["lineColor" + e] = (0, o.Z)(t["lineColor" + e], 20)); + for (let n = 0; n < t.THEME_COLOR_LIMIT; n++) { + const i = "" + (17 - 3 * n); + e += `\n .section-${n - 1} rect, .section-${n - 1} path, .section-${n - 1} circle, .section-${n - 1} path {\n fill: ${t["cScale" + n]};\n }\n .section-${n - 1} text {\n fill: ${t["cScaleLabel" + n]};\n }\n .node-icon-${n - 1} {\n font-size: 40px;\n color: ${t["cScaleLabel" + n]};\n }\n .section-edge-${n - 1}{\n stroke: ${t["cScale" + n]};\n }\n .edge-depth-${n - 1}{\n stroke-width: ${i};\n }\n .section-${n - 1} line {\n stroke: ${t["cScaleInv" + n]} ;\n stroke-width: 3;\n }\n\n .lineWrapper line{\n stroke: ${t["cScaleLabel" + n]} ;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n `; + } + return e; + })( + t, + )}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`, + }; + }, + }, +]); diff --git a/docs/themes/hugo-geekdoc/static/js/colortheme-d3e4d351.bundle.min.js b/docs/themes/hugo-geekdoc/static/js/colortheme-d3e4d351.bundle.min.js new file mode 100644 index 000000000..c487236de --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/colortheme-d3e4d351.bundle.min.js @@ -0,0 +1,300 @@ +!(function () { + var t = { + 1860: function (t) { + var e, n, r, i; + (e = this), + (n = this && this.define), + (r = { + version: "2.14.2", + areas: {}, + apis: {}, + nsdelim: ".", + inherit: function (t, e) { + for (var n in t) e.hasOwnProperty(n) || Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n)); + return e; + }, + stringify: function (t, e) { + return void 0 === t || "function" == typeof t ? t + "" : JSON.stringify(t, e || r.replace); + }, + parse: function (t, e) { + try { + return JSON.parse(t, e || r.revive); + } catch (e) { + return t; + } + }, + fn: function (t, e) { + for (var n in ((r.storeAPI[t] = e), r.apis)) r.apis[n][t] = e; + }, + get: function (t, e) { + return t.getItem(e); + }, + set: function (t, e, n) { + t.setItem(e, n); + }, + remove: function (t, e) { + t.removeItem(e); + }, + key: function (t, e) { + return t.key(e); + }, + length: function (t) { + return t.length; + }, + clear: function (t) { + t.clear(); + }, + Store: function (t, e, n) { + var i = r.inherit(r.storeAPI, function (t, e, n) { + return 0 === arguments.length + ? i.getAll() + : "function" == typeof e + ? i.transact(t, e, n) + : void 0 !== e + ? i.set(t, e, n) + : "string" == typeof t || "number" == typeof t + ? i.get(t) + : "function" == typeof t + ? i.each(t) + : t + ? i.setAll(t, e) + : i.clear(); + }); + i._id = t; + try { + var s = "__store2_test"; + e.setItem(s, "ok"), (i._area = e), e.removeItem(s); + } catch (t) { + i._area = r.storage("fake"); + } + return (i._ns = n || ""), r.areas[t] || (r.areas[t] = i._area), r.apis[i._ns + i._id] || (r.apis[i._ns + i._id] = i), i; + }, + storeAPI: { + area: function (t, e) { + var n = this[t]; + return (n && n.area) || ((n = r.Store(t, e, this._ns)), this[t] || (this[t] = n)), n; + }, + namespace: function (t, e, n) { + if (((n = n || this._delim || r.nsdelim), !t)) return this._ns ? this._ns.substring(0, this._ns.length - n.length) : ""; + var i = t, + s = this[i]; + if (!((s && s.namespace) || (((s = r.Store(this._id, this._area, this._ns + i + n))._delim = n), this[i] || (this[i] = s), e))) + for (var o in r.areas) s.area(o, r.areas[o]); + return s; + }, + isFake: function (t) { + return ( + t ? ((this._real = this._area), (this._area = r.storage("fake"))) : !1 === t && (this._area = this._real || this._area), + "fake" === this._area.name + ); + }, + toString: function () { + return "store" + (this._ns ? "." + this.namespace() : "") + "[" + this._id + "]"; + }, + has: function (t) { + return this._area.has ? this._area.has(this._in(t)) : !!(this._in(t) in this._area); + }, + size: function () { + return this.keys().length; + }, + each: function (t, e) { + for (var n = 0, i = r.length(this._area); n < i; n++) { + var s = this._out(r.key(this._area, n)); + if (void 0 !== s && !1 === t.call(this, s, this.get(s), e)) break; + i > r.length(this._area) && (i--, n--); + } + return e || this; + }, + keys: function (t) { + return this.each(function (t, e, n) { + n.push(t); + }, t || []); + }, + get: function (t, e) { + var n, + i = r.get(this._area, this._in(t)); + return "function" == typeof e && ((n = e), (e = null)), null !== i ? r.parse(i, n) : null != e ? e : i; + }, + getAll: function (t) { + return this.each(function (t, e, n) { + n[t] = e; + }, t || {}); + }, + transact: function (t, e, n) { + var r = this.get(t, n), + i = e(r); + return this.set(t, void 0 === i ? r : i), this; + }, + set: function (t, e, n) { + var i, + s = this.get(t); + return null != s && !1 === n + ? e + : ("function" == typeof n && ((i = n), (n = void 0)), r.set(this._area, this._in(t), r.stringify(e, i), n) || s); + }, + setAll: function (t, e) { + var n, r; + for (var i in t) (r = t[i]), this.set(i, r, e) !== r && (n = !0); + return n; + }, + add: function (t, e, n) { + var i = this.get(t); + if (i instanceof Array) e = i.concat(e); + else if (null !== i) { + var s = typeof i; + if (s === typeof e && "object" === s) { + for (var o in e) i[o] = e[o]; + e = i; + } else e = i + e; + } + return r.set(this._area, this._in(t), r.stringify(e, n)), e; + }, + remove: function (t, e) { + var n = this.get(t, e); + return r.remove(this._area, this._in(t)), n; + }, + clear: function () { + return ( + this._ns + ? this.each(function (t) { + r.remove(this._area, this._in(t)); + }, 1) + : r.clear(this._area), + this + ); + }, + clearAll: function () { + var t = this._area; + for (var e in r.areas) r.areas.hasOwnProperty(e) && ((this._area = r.areas[e]), this.clear()); + return (this._area = t), this; + }, + _in: function (t) { + return "string" != typeof t && (t = r.stringify(t)), this._ns ? this._ns + t : t; + }, + _out: function (t) { + return this._ns ? (t && 0 === t.indexOf(this._ns) ? t.substring(this._ns.length) : void 0) : t; + }, + }, + storage: function (t) { + return r.inherit(r.storageAPI, { items: {}, name: t }); + }, + storageAPI: { + length: 0, + has: function (t) { + return this.items.hasOwnProperty(t); + }, + key: function (t) { + var e = 0; + for (var n in this.items) if (this.has(n) && t === e++) return n; + }, + setItem: function (t, e) { + this.has(t) || this.length++, (this.items[t] = e); + }, + removeItem: function (t) { + this.has(t) && (delete this.items[t], this.length--); + }, + getItem: function (t) { + return this.has(t) ? this.items[t] : null; + }, + clear: function () { + for (var t in this.items) this.removeItem(t); + }, + }, + }), + ((i = r.Store( + "local", + (function () { + try { + return localStorage; + } catch (t) {} + })(), + )).local = i), + (i._ = r), + i.area( + "session", + (function () { + try { + return sessionStorage; + } catch (t) {} + })(), + ), + i.area("page", r.storage("page")), + "function" == typeof n && void 0 !== n.amd + ? n("store2", [], function () { + return i; + }) + : t.exports + ? (t.exports = i) + : (e.store && (r.conflict = e.store), (e.store = i)); + }, + 6914: function (t, e, n) { + "use strict"; + n.r(e), + n.d(e, { + COLOR_THEME_AUTO: function () { + return s; + }, + COLOR_THEME_DARK: function () { + return r; + }, + COLOR_THEME_LIGHT: function () { + return i; + }, + THEME: function () { + return o; + }, + TOGGLE_COLOR_THEMES: function () { + return a; + }, + }); + const r = "dark", + i = "light", + s = "auto", + o = "hugo-geekdoc", + a = [s, r, i]; + }, + }, + e = {}; + function n(r) { + var i = e[r]; + if (void 0 !== i) return i.exports; + var s = (e[r] = { exports: {} }); + return t[r].call(s.exports, s, s.exports, n), s.exports; + } + (n.d = function (t, e) { + for (var r in e) n.o(e, r) && !n.o(t, r) && Object.defineProperty(t, r, { enumerable: !0, get: e[r] }); + }), + (n.o = function (t, e) { + return Object.prototype.hasOwnProperty.call(t, e); + }), + (n.r = function (t) { + "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), + Object.defineProperty(t, "__esModule", { value: !0 }); + }), + (function () { + const t = n(1860), + { TOGGLE_COLOR_THEMES: e, THEME: r, COLOR_THEME_AUTO: i } = n(6914); + function s(n = !0) { + if (t.isFake()) return; + let s = t.namespace(r), + o = document.documentElement, + a = e.includes(s.get("color-theme")) ? s.get("color-theme") : i; + o.setAttribute("class", "color-toggle-" + a), + a === i ? o.removeAttribute("color-theme") : o.setAttribute("color-theme", a), + n || location.reload(); + } + s(), + document.addEventListener("DOMContentLoaded", (n) => { + document.getElementById("gdoc-color-theme").onclick = function () { + let n = t.namespace(r), + o = n.get("color-theme") || i, + a = (function (t = [], e) { + let n = t.indexOf(e), + r = 0; + return n < t.length - 1 && (r = n + 1), r; + })(e, o); + n.set("color-theme", e[a]), s(!1); + }; + }); + })(); +})(); diff --git a/docs/themes/hugo-geekdoc/static/js/katex-d4d5881d.bundle.min.js b/docs/themes/hugo-geekdoc/static/js/katex-d4d5881d.bundle.min.js new file mode 100644 index 000000000..144956213 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/katex-d4d5881d.bundle.min.js @@ -0,0 +1,355 @@ +!(function () { + "use strict"; + var t, + e, + o, + n, + r = { + 2657: function (t, e, o) { + o.p, + document.addEventListener("DOMContentLoaded", function () { + o.e(116) + .then(o.t.bind(o, 2116, 23)) + .then(({ default: t }) => { + t(document.body); + }) + .catch((t) => console.error(t)); + }); + }, + 3491: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_AMS-Regular.woff"; + }, + 5537: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_AMS-Regular.woff2"; + }, + 282: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Caligraphic-Bold.woff"; + }, + 4842: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Caligraphic-Bold.woff2"; + }, + 1420: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Caligraphic-Regular.woff"; + }, + 5148: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Caligraphic-Regular.woff2"; + }, + 3873: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Fraktur-Bold.woff"; + }, + 7925: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Fraktur-Bold.woff2"; + }, + 7206: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Fraktur-Regular.woff"; + }, + 1872: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Fraktur-Regular.woff2"; + }, + 7888: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Main-Bold.woff"; + }, + 7823: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Main-Bold.woff2"; + }, + 6062: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Main-BoldItalic.woff"; + }, + 8216: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Main-BoldItalic.woff2"; + }, + 1411: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Main-Italic.woff"; + }, + 4968: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Main-Italic.woff2"; + }, + 9430: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Main-Regular.woff"; + }, + 556: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Main-Regular.woff2"; + }, + 2379: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Math-BoldItalic.woff"; + }, + 7312: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Math-BoldItalic.woff2"; + }, + 8212: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Math-Italic.woff"; + }, + 621: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Math-Italic.woff2"; + }, + 3958: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_SansSerif-Bold.woff"; + }, + 8516: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_SansSerif-Bold.woff2"; + }, + 208: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_SansSerif-Italic.woff"; + }, + 9471: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_SansSerif-Italic.woff2"; + }, + 9229: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_SansSerif-Regular.woff"; + }, + 4671: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_SansSerif-Regular.woff2"; + }, + 2629: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Script-Regular.woff"; + }, + 9875: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Script-Regular.woff2"; + }, + 8493: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Size1-Regular.woff"; + }, + 2986: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Size1-Regular.woff2"; + }, + 8398: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Size2-Regular.woff"; + }, + 4118: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Size2-Regular.woff2"; + }, + 498: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Size3-Regular.woff"; + }, + 8932: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Size3-Regular.woff2"; + }, + 8718: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Size4-Regular.woff"; + }, + 7633: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Size4-Regular.woff2"; + }, + 2422: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Typewriter-Regular.woff"; + }, + 4313: function (t, e, o) { + t.exports = o.p + "fonts/KaTeX_Typewriter-Regular.woff2"; + }, + }, + f = {}; + function i(t) { + var e = f[t]; + if (void 0 !== e) return e.exports; + var o = (f[t] = { exports: {} }); + return r[t].call(o.exports, o, o.exports, i), o.exports; + } + (i.m = r), + (e = Object.getPrototypeOf + ? function (t) { + return Object.getPrototypeOf(t); + } + : function (t) { + return t.__proto__; + }), + (i.t = function (o, n) { + if ((1 & n && (o = this(o)), 8 & n)) return o; + if ("object" == typeof o && o) { + if (4 & n && o.__esModule) return o; + if (16 & n && "function" == typeof o.then) return o; + } + var r = Object.create(null); + i.r(r); + var f = {}; + t = t || [null, e({}), e([]), e(e)]; + for (var a = 2 & n && o; "object" == typeof a && !~t.indexOf(a); a = e(a)) + Object.getOwnPropertyNames(a).forEach(function (t) { + f[t] = function () { + return o[t]; + }; + }); + return ( + (f.default = function () { + return o; + }), + i.d(r, f), + r + ); + }), + (i.d = function (t, e) { + for (var o in e) i.o(e, o) && !i.o(t, o) && Object.defineProperty(t, o, { enumerable: !0, get: e[o] }); + }), + (i.f = {}), + (i.e = function (t) { + return Promise.all( + Object.keys(i.f).reduce(function (e, o) { + return i.f[o](t, e), e; + }, []), + ); + }), + (i.u = function (t) { + return "js/" + t + "-341f79d9.chunk.min.js"; + }), + (i.g = (function () { + if ("object" == typeof globalThis) return globalThis; + try { + return this || new Function("return this")(); + } catch (t) { + if ("object" == typeof window) return window; + } + })()), + (i.o = function (t, e) { + return Object.prototype.hasOwnProperty.call(t, e); + }), + (o = {}), + (n = "geekdoc:"), + (i.l = function (t, e, r, f) { + if (o[t]) o[t].push(e); + else { + var a, u; + if (void 0 !== r) + for (var c = document.getElementsByTagName("script"), s = 0; s < c.length; s++) { + var p = c[s]; + if (p.getAttribute("src") == t || p.getAttribute("data-webpack") == n + r) { + a = p; + break; + } + } + a || + ((u = !0), + ((a = document.createElement("script")).charset = "utf-8"), + (a.timeout = 120), + i.nc && a.setAttribute("nonce", i.nc), + a.setAttribute("data-webpack", n + r), + (a.src = t)), + (o[t] = [e]); + var l = function (e, n) { + (a.onerror = a.onload = null), clearTimeout(d); + var r = o[t]; + if ( + (delete o[t], + a.parentNode && a.parentNode.removeChild(a), + r && + r.forEach(function (t) { + return t(n); + }), + e) + ) + return e(n); + }, + d = setTimeout(l.bind(null, void 0, { type: "timeout", target: a }), 12e4); + (a.onerror = l.bind(null, a.onerror)), (a.onload = l.bind(null, a.onload)), u && document.head.appendChild(a); + } + }), + (i.r = function (t) { + "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), + Object.defineProperty(t, "__esModule", { value: !0 }); + }), + (function () { + var t; + i.g.importScripts && (t = i.g.location + ""); + var e = i.g.document; + if (!t && e && (e.currentScript && (t = e.currentScript.src), !t)) { + var o = e.getElementsByTagName("script"); + if (o.length) for (var n = o.length - 1; n > -1 && !t; ) t = o[n--].src; + } + if (!t) throw new Error("Automatic publicPath is not supported in this browser"); + (t = t + .replace(/#.*$/, "") + .replace(/\?.*$/, "") + .replace(/\/[^\/]+$/, "/")), + (i.p = t + "../"); + })(), + (function () { + var t = { 793: 0 }; + i.f.j = function (e, o) { + var n = i.o(t, e) ? t[e] : void 0; + if (0 !== n) + if (n) o.push(n[2]); + else { + var r = new Promise(function (o, r) { + n = t[e] = [o, r]; + }); + o.push((n[2] = r)); + var f = i.p + i.u(e), + a = new Error(); + i.l( + f, + function (o) { + if (i.o(t, e) && (0 !== (n = t[e]) && (t[e] = void 0), n)) { + var r = o && ("load" === o.type ? "missing" : o.type), + f = o && o.target && o.target.src; + (a.message = "Loading chunk " + e + " failed.\n(" + r + ": " + f + ")"), + (a.name = "ChunkLoadError"), + (a.type = r), + (a.request = f), + n[1](a); + } + }, + "chunk-" + e, + e, + ); + } + }; + var e = function (e, o) { + var n, + r, + f = o[0], + a = o[1], + u = o[2], + c = 0; + if ( + f.some(function (e) { + return 0 !== t[e]; + }) + ) { + for (n in a) i.o(a, n) && (i.m[n] = a[n]); + u && u(i); + } + for (e && e(o); c < f.length; c++) (r = f[c]), i.o(t, r) && t[r] && t[r][0](), (t[r] = 0); + }, + o = (self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []); + o.forEach(e.bind(null, 0)), (o.push = e.bind(null, o.push.bind(o))); + })(), + i(2657), + i(3491), + i(5537), + i(282), + i(4842), + i(1420), + i(5148), + i(3873), + i(7925), + i(7206), + i(1872), + i(7888), + i(7823), + i(6062), + i(8216), + i(1411), + i(4968), + i(9430), + i(556), + i(2379), + i(7312), + i(8212), + i(621), + i(3958), + i(8516), + i(208), + i(9471), + i(9229), + i(4671), + i(2629), + i(9875), + i(8493), + i(2986), + i(8398), + i(4118), + i(498), + i(8932), + i(8718), + i(7633), + i(2422), + i(4313); +})(); diff --git a/docs/themes/hugo-geekdoc/static/js/main-924a1933.bundle.min.js b/docs/themes/hugo-geekdoc/static/js/main-924a1933.bundle.min.js new file mode 100644 index 000000000..a77f09581 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/main-924a1933.bundle.min.js @@ -0,0 +1,543 @@ +/*! For license information please see main-924a1933.bundle.min.js.LICENSE.txt */ +!(function () { + var t = { + 2152: function (t) { + var e; + (e = function () { + return (function () { + var t = { + 686: function (t, e, n) { + "use strict"; + n.d(e, { + default: function () { + return S; + }, + }); + var o = n(279), + r = n.n(o), + c = n(370), + i = n.n(c), + u = n(817), + a = n.n(u); + function l(t) { + try { + return document.execCommand(t); + } catch (t) { + return !1; + } + } + var s = function (t) { + var e = a()(t); + return l("cut"), e; + }, + f = function (t, e) { + var n = (function (t) { + var e = "rtl" === document.documentElement.getAttribute("dir"), + n = document.createElement("textarea"); + (n.style.fontSize = "12pt"), + (n.style.border = "0"), + (n.style.padding = "0"), + (n.style.margin = "0"), + (n.style.position = "absolute"), + (n.style[e ? "right" : "left"] = "-9999px"); + var o = window.pageYOffset || document.documentElement.scrollTop; + return (n.style.top = "".concat(o, "px")), n.setAttribute("readonly", ""), (n.value = t), n; + })(t); + e.container.appendChild(n); + var o = a()(n); + return l("copy"), n.remove(), o; + }, + d = function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { container: document.body }, + n = ""; + return ( + "string" == typeof t + ? (n = f(t, e)) + : t instanceof HTMLInputElement && !["text", "search", "url", "tel", "password"].includes(null == t ? void 0 : t.type) + ? (n = f(t.value, e)) + : ((n = a()(t)), l("copy")), + n + ); + }; + function p(t) { + return ( + (p = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (t) { + return typeof t; + } + : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; + }), + p(t) + ); + } + function y(t) { + return ( + (y = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (t) { + return typeof t; + } + : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; + }), + y(t) + ); + } + function h(t, e) { + for (var n = 0; n < e.length; n++) { + var o = e[n]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(t, o.key, o); + } + } + function v(t, e) { + return ( + (v = + Object.setPrototypeOf || + function (t, e) { + return (t.__proto__ = e), t; + }), + v(t, e) + ); + } + function g(t) { + return ( + (g = Object.setPrototypeOf + ? Object.getPrototypeOf + : function (t) { + return t.__proto__ || Object.getPrototypeOf(t); + }), + g(t) + ); + } + function m(t, e) { + var n = "data-clipboard-".concat(t); + if (e.hasAttribute(n)) return e.getAttribute(n); + } + var b = (function (t) { + !(function (t, e) { + if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); + (t.prototype = Object.create(e && e.prototype, { + constructor: { value: t, writable: !0, configurable: !0 }, + })), + e && v(t, e); + })(a, t); + var e, + n, + o, + r, + c, + u = + ((r = a), + (c = (function () { + if ("undefined" == typeof Reflect || !Reflect.construct) return !1; + if (Reflect.construct.sham) return !1; + if ("function" == typeof Proxy) return !0; + try { + return Date.prototype.toString.call(Reflect.construct(Date, [], function () {})), !0; + } catch (t) { + return !1; + } + })()), + function () { + var t, + e, + n = g(r); + if (c) { + var o = g(this).constructor; + t = Reflect.construct(n, arguments, o); + } else t = n.apply(this, arguments); + return !(e = t) || ("object" !== y(e) && "function" != typeof e) + ? (function (t) { + if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return t; + })(this) + : e; + }); + function a(t, e) { + var n; + return ( + (function (t, e) { + if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); + })(this, a), + (n = u.call(this)).resolveOptions(e), + n.listenClick(t), + n + ); + } + return ( + (e = a), + (n = [ + { + key: "resolveOptions", + value: function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; + (this.action = "function" == typeof t.action ? t.action : this.defaultAction), + (this.target = "function" == typeof t.target ? t.target : this.defaultTarget), + (this.text = "function" == typeof t.text ? t.text : this.defaultText), + (this.container = "object" === y(t.container) ? t.container : document.body); + }, + }, + { + key: "listenClick", + value: function (t) { + var e = this; + this.listener = i()(t, "click", function (t) { + return e.onClick(t); + }); + }, + }, + { + key: "onClick", + value: function (t) { + var e = t.delegateTarget || t.currentTarget, + n = this.action(e) || "copy", + o = (function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, + e = t.action, + n = void 0 === e ? "copy" : e, + o = t.container, + r = t.target, + c = t.text; + if ("copy" !== n && "cut" !== n) throw new Error('Invalid "action" value, use either "copy" or "cut"'); + if (void 0 !== r) { + if (!r || "object" !== p(r) || 1 !== r.nodeType) throw new Error('Invalid "target" value, use a valid Element'); + if ("copy" === n && r.hasAttribute("disabled")) + throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); + if ("cut" === n && (r.hasAttribute("readonly") || r.hasAttribute("disabled"))) + throw new Error( + 'Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes', + ); + } + return c ? d(c, { container: o }) : r ? ("cut" === n ? s(r) : d(r, { container: o })) : void 0; + })({ + action: n, + container: this.container, + target: this.target(e), + text: this.text(e), + }); + this.emit(o ? "success" : "error", { + action: n, + text: o, + trigger: e, + clearSelection: function () { + e && e.focus(), window.getSelection().removeAllRanges(); + }, + }); + }, + }, + { + key: "defaultAction", + value: function (t) { + return m("action", t); + }, + }, + { + key: "defaultTarget", + value: function (t) { + var e = m("target", t); + if (e) return document.querySelector(e); + }, + }, + { + key: "defaultText", + value: function (t) { + return m("text", t); + }, + }, + { + key: "destroy", + value: function () { + this.listener.destroy(); + }, + }, + ]), + (o = [ + { + key: "copy", + value: function (t) { + var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { container: document.body }; + return d(t, e); + }, + }, + { + key: "cut", + value: function (t) { + return s(t); + }, + }, + { + key: "isSupported", + value: function () { + var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ["copy", "cut"], + e = "string" == typeof t ? [t] : t, + n = !!document.queryCommandSupported; + return ( + e.forEach(function (t) { + n = n && !!document.queryCommandSupported(t); + }), + n + ); + }, + }, + ]), + n && h(e.prototype, n), + o && h(e, o), + a + ); + })(r()), + S = b; + }, + 828: function (t) { + if ("undefined" != typeof Element && !Element.prototype.matches) { + var e = Element.prototype; + e.matches = e.matchesSelector || e.mozMatchesSelector || e.msMatchesSelector || e.oMatchesSelector || e.webkitMatchesSelector; + } + t.exports = function (t, e) { + for (; t && 9 !== t.nodeType; ) { + if ("function" == typeof t.matches && t.matches(e)) return t; + t = t.parentNode; + } + }; + }, + 438: function (t, e, n) { + var o = n(828); + function r(t, e, n, o, r) { + var i = c.apply(this, arguments); + return ( + t.addEventListener(n, i, r), + { + destroy: function () { + t.removeEventListener(n, i, r); + }, + } + ); + } + function c(t, e, n, r) { + return function (n) { + (n.delegateTarget = o(n.target, e)), n.delegateTarget && r.call(t, n); + }; + } + t.exports = function (t, e, n, o, c) { + return "function" == typeof t.addEventListener + ? r.apply(null, arguments) + : "function" == typeof n + ? r.bind(null, document).apply(null, arguments) + : ("string" == typeof t && (t = document.querySelectorAll(t)), + Array.prototype.map.call(t, function (t) { + return r(t, e, n, o, c); + })); + }; + }, + 879: function (t, e) { + (e.node = function (t) { + return void 0 !== t && t instanceof HTMLElement && 1 === t.nodeType; + }), + (e.nodeList = function (t) { + var n = Object.prototype.toString.call(t); + return ( + void 0 !== t && + ("[object NodeList]" === n || "[object HTMLCollection]" === n) && + "length" in t && + (0 === t.length || e.node(t[0])) + ); + }), + (e.string = function (t) { + return "string" == typeof t || t instanceof String; + }), + (e.fn = function (t) { + return "[object Function]" === Object.prototype.toString.call(t); + }); + }, + 370: function (t, e, n) { + var o = n(879), + r = n(438); + t.exports = function (t, e, n) { + if (!t && !e && !n) throw new Error("Missing required arguments"); + if (!o.string(e)) throw new TypeError("Second argument must be a String"); + if (!o.fn(n)) throw new TypeError("Third argument must be a Function"); + if (o.node(t)) + return (function (t, e, n) { + return ( + t.addEventListener(e, n), + { + destroy: function () { + t.removeEventListener(e, n); + }, + } + ); + })(t, e, n); + if (o.nodeList(t)) + return (function (t, e, n) { + return ( + Array.prototype.forEach.call(t, function (t) { + t.addEventListener(e, n); + }), + { + destroy: function () { + Array.prototype.forEach.call(t, function (t) { + t.removeEventListener(e, n); + }); + }, + } + ); + })(t, e, n); + if (o.string(t)) + return (function (t, e, n) { + return r(document.body, t, e, n); + })(t, e, n); + throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList"); + }; + }, + 817: function (t) { + t.exports = function (t) { + var e; + if ("SELECT" === t.nodeName) t.focus(), (e = t.value); + else if ("INPUT" === t.nodeName || "TEXTAREA" === t.nodeName) { + var n = t.hasAttribute("readonly"); + n || t.setAttribute("readonly", ""), + t.select(), + t.setSelectionRange(0, t.value.length), + n || t.removeAttribute("readonly"), + (e = t.value); + } else { + t.hasAttribute("contenteditable") && t.focus(); + var o = window.getSelection(), + r = document.createRange(); + r.selectNodeContents(t), o.removeAllRanges(), o.addRange(r), (e = o.toString()); + } + return e; + }; + }, + 279: function (t) { + function e() {} + (e.prototype = { + on: function (t, e, n) { + var o = this.e || (this.e = {}); + return (o[t] || (o[t] = [])).push({ fn: e, ctx: n }), this; + }, + once: function (t, e, n) { + var o = this; + function r() { + o.off(t, r), e.apply(n, arguments); + } + return (r._ = e), this.on(t, r, n); + }, + emit: function (t) { + for (var e = [].slice.call(arguments, 1), n = ((this.e || (this.e = {}))[t] || []).slice(), o = 0, r = n.length; o < r; o++) + n[o].fn.apply(n[o].ctx, e); + return this; + }, + off: function (t, e) { + var n = this.e || (this.e = {}), + o = n[t], + r = []; + if (o && e) for (var c = 0, i = o.length; c < i; c++) o[c].fn !== e && o[c].fn._ !== e && r.push(o[c]); + return r.length ? (n[t] = r) : delete n[t], this; + }, + }), + (t.exports = e), + (t.exports.TinyEmitter = e); + }, + }, + e = {}; + function n(o) { + if (e[o]) return e[o].exports; + var r = (e[o] = { exports: {} }); + return t[o](r, r.exports, n), r.exports; + } + return ( + (n.n = function (t) { + var e = + t && t.__esModule + ? function () { + return t.default; + } + : function () { + return t; + }; + return n.d(e, { a: e }), e; + }), + (n.d = function (t, e) { + for (var o in e) n.o(e, o) && !n.o(t, o) && Object.defineProperty(t, o, { enumerable: !0, get: e[o] }); + }), + (n.o = function (t, e) { + return Object.prototype.hasOwnProperty.call(t, e); + }), + n(686) + ); + })().default; + }), + (t.exports = e()); + }, + 3243: function (t, e, n) { + "use strict"; + function o(t) { + const e = document.createElement("span"); + let n = "pre > code"; + t.querySelector(".lntable") && (n = ".lntable .lntd:last-child pre > code"); + const o = t.querySelector(n); + if (null !== o) { + const n = o.innerText.trim(); + e.classList.add("flex", "align-center", "justify-center", "clip", "gdoc-post__codecopy"), + (e.type = "button"), + (e.innerHTML = + ''), + e.setAttribute("data-clipboard-text", n), + e.setAttribute("data-copy-feedback", "Copied!"), + e.setAttribute("role", "button"), + e.setAttribute("aria-label", "Copy"), + t.classList.add("gdoc-post__codecontainer"), + t.insertBefore(e, t.firstChild); + } + } + n.r(e), + n.d(e, { + createCopyButton: function () { + return o; + }, + }); + }, + }, + e = {}; + function n(o) { + var r = e[o]; + if (void 0 !== r) return r.exports; + var c = (e[o] = { exports: {} }); + return t[o].call(c.exports, c, c.exports, n), c.exports; + } + (n.d = function (t, e) { + for (var o in e) n.o(e, o) && !n.o(t, o) && Object.defineProperty(t, o, { enumerable: !0, get: e[o] }); + }), + (n.o = function (t, e) { + return Object.prototype.hasOwnProperty.call(t, e); + }), + (n.r = function (t) { + "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), + Object.defineProperty(t, "__esModule", { value: !0 }); + }), + (function () { + const { createCopyButton: t } = n(3243), + e = n(2152); + document.addEventListener("DOMContentLoaded", function (n) { + new e(".clip").on("success", function (t) { + const e = t.trigger; + e.hasAttribute("data-copy-feedback") && + (e.classList.add("gdoc-post__codecopy--success", "gdoc-post__codecopy--out"), + e.querySelector(".gdoc-icon.copy").classList.add("hidden"), + e.querySelector(".gdoc-icon.check").classList.remove("hidden"), + setTimeout(function () { + e.classList.remove("gdoc-post__codecopy--success", "gdoc-post__codecopy--out"), + e.querySelector(".gdoc-icon.copy").classList.remove("hidden"), + e.querySelector(".gdoc-icon.check").classList.add("hidden"); + }, 3e3)), + t.clearSelection(); + }), + document.querySelectorAll(".highlight").forEach((e) => t(e)); + }); + })(); +})(); diff --git a/docs/themes/hugo-geekdoc/static/js/main-924a1933.bundle.min.js.LICENSE.txt b/docs/themes/hugo-geekdoc/static/js/main-924a1933.bundle.min.js.LICENSE.txt new file mode 100644 index 000000000..5161813c4 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/main-924a1933.bundle.min.js.LICENSE.txt @@ -0,0 +1,6 @@ +/*! + * clipboard.js v2.0.11 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */ diff --git a/docs/themes/hugo-geekdoc/static/js/mermaid-d305d450.bundle.min.js b/docs/themes/hugo-geekdoc/static/js/mermaid-d305d450.bundle.min.js new file mode 100644 index 000000000..80bb030f3 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/mermaid-d305d450.bundle.min.js @@ -0,0 +1,459 @@ +!(function () { + var t, + e, + n = { + 1860: function (t) { + !(function (e, n) { + var r = { + version: "2.14.2", + areas: {}, + apis: {}, + nsdelim: ".", + inherit: function (t, e) { + for (var n in t) e.hasOwnProperty(n) || Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n)); + return e; + }, + stringify: function (t, e) { + return void 0 === t || "function" == typeof t ? t + "" : JSON.stringify(t, e || r.replace); + }, + parse: function (t, e) { + try { + return JSON.parse(t, e || r.revive); + } catch (e) { + return t; + } + }, + fn: function (t, e) { + for (var n in ((r.storeAPI[t] = e), r.apis)) r.apis[n][t] = e; + }, + get: function (t, e) { + return t.getItem(e); + }, + set: function (t, e, n) { + t.setItem(e, n); + }, + remove: function (t, e) { + t.removeItem(e); + }, + key: function (t, e) { + return t.key(e); + }, + length: function (t) { + return t.length; + }, + clear: function (t) { + t.clear(); + }, + Store: function (t, e, n) { + var i = r.inherit(r.storeAPI, function (t, e, n) { + return 0 === arguments.length + ? i.getAll() + : "function" == typeof e + ? i.transact(t, e, n) + : void 0 !== e + ? i.set(t, e, n) + : "string" == typeof t || "number" == typeof t + ? i.get(t) + : "function" == typeof t + ? i.each(t) + : t + ? i.setAll(t, e) + : i.clear(); + }); + i._id = t; + try { + var a = "__store2_test"; + e.setItem(a, "ok"), (i._area = e), e.removeItem(a); + } catch (t) { + i._area = r.storage("fake"); + } + return (i._ns = n || ""), r.areas[t] || (r.areas[t] = i._area), r.apis[i._ns + i._id] || (r.apis[i._ns + i._id] = i), i; + }, + storeAPI: { + area: function (t, e) { + var n = this[t]; + return (n && n.area) || ((n = r.Store(t, e, this._ns)), this[t] || (this[t] = n)), n; + }, + namespace: function (t, e, n) { + if (((n = n || this._delim || r.nsdelim), !t)) return this._ns ? this._ns.substring(0, this._ns.length - n.length) : ""; + var i = t, + a = this[i]; + if (!((a && a.namespace) || (((a = r.Store(this._id, this._area, this._ns + i + n))._delim = n), this[i] || (this[i] = a), e))) + for (var o in r.areas) a.area(o, r.areas[o]); + return a; + }, + isFake: function (t) { + return ( + t ? ((this._real = this._area), (this._area = r.storage("fake"))) : !1 === t && (this._area = this._real || this._area), + "fake" === this._area.name + ); + }, + toString: function () { + return "store" + (this._ns ? "." + this.namespace() : "") + "[" + this._id + "]"; + }, + has: function (t) { + return this._area.has ? this._area.has(this._in(t)) : !!(this._in(t) in this._area); + }, + size: function () { + return this.keys().length; + }, + each: function (t, e) { + for (var n = 0, i = r.length(this._area); n < i; n++) { + var a = this._out(r.key(this._area, n)); + if (void 0 !== a && !1 === t.call(this, a, this.get(a), e)) break; + i > r.length(this._area) && (i--, n--); + } + return e || this; + }, + keys: function (t) { + return this.each(function (t, e, n) { + n.push(t); + }, t || []); + }, + get: function (t, e) { + var n, + i = r.get(this._area, this._in(t)); + return "function" == typeof e && ((n = e), (e = null)), null !== i ? r.parse(i, n) : null != e ? e : i; + }, + getAll: function (t) { + return this.each(function (t, e, n) { + n[t] = e; + }, t || {}); + }, + transact: function (t, e, n) { + var r = this.get(t, n), + i = e(r); + return this.set(t, void 0 === i ? r : i), this; + }, + set: function (t, e, n) { + var i, + a = this.get(t); + return null != a && !1 === n + ? e + : ("function" == typeof n && ((i = n), (n = void 0)), r.set(this._area, this._in(t), r.stringify(e, i), n) || a); + }, + setAll: function (t, e) { + var n, r; + for (var i in t) (r = t[i]), this.set(i, r, e) !== r && (n = !0); + return n; + }, + add: function (t, e, n) { + var i = this.get(t); + if (i instanceof Array) e = i.concat(e); + else if (null !== i) { + var a = typeof i; + if (a === typeof e && "object" === a) { + for (var o in e) i[o] = e[o]; + e = i; + } else e = i + e; + } + return r.set(this._area, this._in(t), r.stringify(e, n)), e; + }, + remove: function (t, e) { + var n = this.get(t, e); + return r.remove(this._area, this._in(t)), n; + }, + clear: function () { + return ( + this._ns + ? this.each(function (t) { + r.remove(this._area, this._in(t)); + }, 1) + : r.clear(this._area), + this + ); + }, + clearAll: function () { + var t = this._area; + for (var e in r.areas) r.areas.hasOwnProperty(e) && ((this._area = r.areas[e]), this.clear()); + return (this._area = t), this; + }, + _in: function (t) { + return "string" != typeof t && (t = r.stringify(t)), this._ns ? this._ns + t : t; + }, + _out: function (t) { + return this._ns ? (t && 0 === t.indexOf(this._ns) ? t.substring(this._ns.length) : void 0) : t; + }, + }, + storage: function (t) { + return r.inherit(r.storageAPI, { items: {}, name: t }); + }, + storageAPI: { + length: 0, + has: function (t) { + return this.items.hasOwnProperty(t); + }, + key: function (t) { + var e = 0; + for (var n in this.items) if (this.has(n) && t === e++) return n; + }, + setItem: function (t, e) { + this.has(t) || this.length++, (this.items[t] = e); + }, + removeItem: function (t) { + this.has(t) && (delete this.items[t], this.length--); + }, + getItem: function (t) { + return this.has(t) ? this.items[t] : null; + }, + clear: function () { + for (var t in this.items) this.removeItem(t); + }, + }, + }, + i = r.Store( + "local", + (function () { + try { + return localStorage; + } catch (t) {} + })(), + ); + (i.local = i), + (i._ = r), + i.area( + "session", + (function () { + try { + return sessionStorage; + } catch (t) {} + })(), + ), + i.area("page", r.storage("page")), + "function" == typeof n && void 0 !== n.amd + ? n("store2", [], function () { + return i; + }) + : t.exports + ? (t.exports = i) + : (e.store && (r.conflict = e.store), (e.store = i)); + })(this, this && this.define); + }, + 6914: function (t, e, n) { + "use strict"; + n.r(e), + n.d(e, { + COLOR_THEME_AUTO: function () { + return a; + }, + COLOR_THEME_DARK: function () { + return r; + }, + COLOR_THEME_LIGHT: function () { + return i; + }, + THEME: function () { + return o; + }, + TOGGLE_COLOR_THEMES: function () { + return s; + }, + }); + const r = "dark", + i = "light", + a = "auto", + o = "hugo-geekdoc", + s = [a, r, i]; + }, + }, + r = {}; + function i(t) { + var e = r[t]; + if (void 0 !== e) return e.exports; + var a = (r[t] = { exports: {} }); + return n[t].call(a.exports, a, a.exports, i), a.exports; + } + (i.m = n), + (i.d = function (t, e) { + for (var n in e) i.o(e, n) && !i.o(t, n) && Object.defineProperty(t, n, { enumerable: !0, get: e[n] }); + }), + (i.f = {}), + (i.e = function (t) { + return Promise.all( + Object.keys(i.f).reduce(function (e, n) { + return i.f[n](t, e), e; + }, []), + ); + }), + (i.u = function (t) { + return ( + "js/" + + t + + "-" + + { + 19: "86f47ecd", + 76: "732e78f1", + 81: "4e653aac", + 118: "f1de6a20", + 361: "f7cd601a", + 423: "897d7f17", + 430: "cc171d93", + 433: "f2655a46", + 438: "760c9ed3", + 476: "86e5cf96", + 506: "6950d52c", + 519: "8d0cec7f", + 535: "dcead599", + 545: "8e970b03", + 546: "560b35c2", + 579: "9222afff", + 626: "1706197a", + 637: "86fbbecd", + 639: "88c6538a", + 642: "12e7dea2", + 662: "17acb8f4", + 728: "5df4a5e5", + 729: "32b017b3", + 747: "b55f0f97", + 771: "942a62df", + 773: "8f0c4fb8", + 813: "0d3c16f5", + 940: "25dfc794", + }[t] + + ".chunk.min.js" + ); + }), + (i.g = (function () { + if ("object" == typeof globalThis) return globalThis; + try { + return this || new Function("return this")(); + } catch (t) { + if ("object" == typeof window) return window; + } + })()), + (i.o = function (t, e) { + return Object.prototype.hasOwnProperty.call(t, e); + }), + (t = {}), + (e = "geekdoc:"), + (i.l = function (n, r, a, o) { + if (t[n]) t[n].push(r); + else { + var s, c; + if (void 0 !== a) + for (var u = document.getElementsByTagName("script"), f = 0; f < u.length; f++) { + var h = u[f]; + if (h.getAttribute("src") == n || h.getAttribute("data-webpack") == e + a) { + s = h; + break; + } + } + s || + ((c = !0), + ((s = document.createElement("script")).charset = "utf-8"), + (s.timeout = 120), + i.nc && s.setAttribute("nonce", i.nc), + s.setAttribute("data-webpack", e + a), + (s.src = n)), + (t[n] = [r]); + var l = function (e, r) { + (s.onerror = s.onload = null), clearTimeout(d); + var i = t[n]; + if ( + (delete t[n], + s.parentNode && s.parentNode.removeChild(s), + i && + i.forEach(function (t) { + return t(r); + }), + e) + ) + return e(r); + }, + d = setTimeout(l.bind(null, void 0, { type: "timeout", target: s }), 12e4); + (s.onerror = l.bind(null, s.onerror)), (s.onload = l.bind(null, s.onload)), c && document.head.appendChild(s); + } + }), + (i.r = function (t) { + "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), + Object.defineProperty(t, "__esModule", { value: !0 }); + }), + (function () { + var t; + i.g.importScripts && (t = i.g.location + ""); + var e = i.g.document; + if (!t && e && (e.currentScript && (t = e.currentScript.src), !t)) { + var n = e.getElementsByTagName("script"); + if (n.length) for (var r = n.length - 1; r > -1 && !t; ) t = n[r--].src; + } + if (!t) throw new Error("Automatic publicPath is not supported in this browser"); + (t = t + .replace(/#.*$/, "") + .replace(/\?.*$/, "") + .replace(/\/[^\/]+$/, "/")), + (i.p = t + "../"); + })(), + (function () { + var t = { 552: 0 }; + i.f.j = function (e, n) { + var r = i.o(t, e) ? t[e] : void 0; + if (0 !== r) + if (r) n.push(r[2]); + else { + var a = new Promise(function (n, i) { + r = t[e] = [n, i]; + }); + n.push((r[2] = a)); + var o = i.p + i.u(e), + s = new Error(); + i.l( + o, + function (n) { + if (i.o(t, e) && (0 !== (r = t[e]) && (t[e] = void 0), r)) { + var a = n && ("load" === n.type ? "missing" : n.type), + o = n && n.target && n.target.src; + (s.message = "Loading chunk " + e + " failed.\n(" + a + ": " + o + ")"), + (s.name = "ChunkLoadError"), + (s.type = a), + (s.request = o), + r[1](s); + } + }, + "chunk-" + e, + e, + ); + } + }; + var e = function (e, n) { + var r, + a, + o = n[0], + s = n[1], + c = n[2], + u = 0; + if ( + o.some(function (e) { + return 0 !== t[e]; + }) + ) { + for (r in s) i.o(s, r) && (i.m[r] = s[r]); + c && c(i); + } + for (e && e(n); u < o.length; u++) (a = o[u]), i.o(t, a) && t[a] && t[a][0](), (t[a] = 0); + }, + n = (self.webpackChunkgeekdoc = self.webpackChunkgeekdoc || []); + n.forEach(e.bind(null, 0)), (n.push = e.bind(null, n.push.bind(n))); + })(), + (function () { + const t = i(1860), + { COLOR_THEME_DARK: e, THEME: n, COLOR_THEME_AUTO: r } = i(6914); + document.addEventListener("DOMContentLoaded", function (a) { + let o = t.namespace(n).get("color-theme") || r, + s = window.matchMedia("(prefers-color-scheme: dark)"), + c = !1, + u = "default"; + (o === e || (o === r && s.matches)) && ((c = !0), (u = "dark")), + i + .e(637) + .then(i.bind(i, 6637)) + .then(({ default: t }) => { + t.initialize({ + flowchart: { useMaxWidth: !0 }, + theme: u, + themeVariables: { darkMode: c }, + }); + }) + .catch((t) => console.error(t)); + }); + })(); +})(); diff --git a/docs/themes/hugo-geekdoc/static/js/search-9719be99.bundle.min.js b/docs/themes/hugo-geekdoc/static/js/search-9719be99.bundle.min.js new file mode 100644 index 000000000..5978a637b --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/search-9719be99.bundle.min.js @@ -0,0 +1,3313 @@ +/*! For license information please see search-9719be99.bundle.min.js.LICENSE.txt */ +!(function () { + var t = { + 3129: function () { + !(function (t) { + "use strict"; + var e; + function n(t) { + return void 0 === t || t; + } + function r(t) { + const e = Array(t); + for (let n = 0; n < t; n++) e[n] = o(); + return e; + } + function o() { + return Object.create(null); + } + function i(t, e) { + return e.length - t.length; + } + function a(t) { + return "string" == typeof t; + } + function s(t) { + return "object" == typeof t; + } + function c(t, e) { + var n = u; + if (t && (e && (t = l(t, e)), this.G && (t = l(t, this.G)), this.H && 1 < t.length && (t = l(t, this.H)), n || "" === n)) { + if (((t = t.split(n)), this.filter)) { + (e = this.filter), (n = t.length); + const r = []; + for (let o = 0, i = 0; o < n; o++) { + const n = t[o]; + n && !e[n] && (r[i++] = n); + } + t = r; + } + return t; + } + return t; + } + const u = /[\p{Z}\p{S}\p{P}\p{C}]+/u, + f = /[\u0300-\u036f]/g; + function d(t, e) { + const n = Object.keys(t), + r = n.length, + o = []; + let i = "", + a = 0; + for (let s, c, u = 0; u < r; u++) + (s = n[u]), (c = t[s]) ? ((o[a++] = h(e ? "(?!\\b)" + s + "(\\b|_)" : s)), (o[a++] = c)) : (i += (i ? "|" : "") + s); + return i && ((o[a++] = h(e ? "(?!\\b)(" + i + ")(\\b|_)" : "(" + i + ")")), (o[a] = "")), o; + } + function l(t, e) { + for (let n = 0, r = e.length; n < r && (t = t.replace(e[n], e[n + 1])); n += 2); + return t; + } + function h(t) { + return new RegExp(t, "g"); + } + function p(t) { + let e = "", + n = ""; + for (let r, o = 0, i = t.length; o < i; o++) (r = t[o]) !== n && (e += n = r); + return e; + } + var v = { encode: y, B: !1, C: "" }; + function y(t) { + return c.call(this, ("" + t).toLowerCase(), !1); + } + const m = {}, + g = {}; + function x(t) { + $(t, "add"), $(t, "append"), $(t, "search"), $(t, "update"), $(t, "remove"); + } + function $(t, e) { + t[e + "Async"] = function () { + const t = this, + n = arguments; + var r = n[n.length - 1]; + let o; + return ( + "function" == typeof r && ((o = r), delete n[n.length - 1]), + (r = new Promise(function (r) { + setTimeout(function () { + t.async = !0; + const o = t[e].apply(t, n); + (t.async = !1), r(o); + }); + })), + o ? (r.then(o), this) : r + ); + }; + } + function b(t, e, n, r) { + const i = t.length; + let a, + s, + c = [], + u = 0; + r && (r = []); + for (let f = i - 1; 0 <= f; f--) { + const d = t[f], + l = d.length, + h = o(); + let p = !a; + for (let t = 0; t < l; t++) { + const o = d[t], + l = o.length; + if (l) + for (let t, d, v = 0; v < l; v++) + if (((d = o[v]), a)) { + if (a[d]) { + if (!f) + if (n) n--; + else if (((c[u++] = d), u === e)) return c; + (f || r) && (h[d] = 1), (p = !0); + } + if (r && ((t = (s[d] || 0) + 1), (s[d] = t), t < i)) { + const e = r[t - 2] || (r[t - 2] = []); + e[e.length] = d; + } + } else h[d] = 1; + } + if (r) a || (s = h); + else if (!p) return []; + a = h; + } + if (r) + for (let t, o, i = r.length - 1; 0 <= i; i--) { + (t = r[i]), (o = t.length); + for (let r, i = 0; i < o; i++) + if (((r = t[i]), !a[r])) { + if (n) n--; + else if (((c[u++] = r), u === e)) return c; + a[r] = 1; + } + } + return c; + } + function _(t, e) { + const n = o(), + r = o(), + i = []; + for (let e = 0; e < t.length; e++) n[t[e]] = 1; + for (let t, o = 0; o < e.length; o++) { + t = e[o]; + for (let e, o = 0; o < t.length; o++) (e = t[o]), n[e] && !r[e] && ((r[e] = 1), (i[i.length] = e)); + } + return i; + } + const w = { + memory: { charset: "latin:extra", A: 3, m: 4, D: !1 }, + performance: { A: 3, m: 3, s: !1, context: { depth: 2, A: 1 } }, + match: { charset: "latin:extra", C: "reverse" }, + score: { charset: "latin:advanced", A: 20, m: 3, context: { depth: 3, A: 9 } }, + default: {}, + }; + function k(t, e) { + if (!(this instanceof k)) return new k(t); + var i; + let s; + t + ? (a(t) ? (t = w[t]) : (i = t.preset) && (t = Object.assign({}, i[i], t)), + (i = t.charset), + (s = t.lang), + a(i) && (-1 === i.indexOf(":") && (i += ":default"), (i = g[i])), + a(s) && (s = m[s])) + : (t = {}); + let c, + u, + f = t.context || {}; + if ( + ((this.encode = t.encode || (i && i.encode) || y), + (this.register = e || o()), + (this.A = c = t.resolution || 9), + (this.C = e = (i && i.C) || t.tokenize || "strict"), + (this.depth = "strict" === e && f.depth), + (this.h = n(f.bidirectional)), + (this.s = u = n(t.optimize)), + (this.D = n(t.fastupdate)), + (this.m = t.minlength || 1), + (this.F = t.boost), + (this.map = u ? r(c) : o()), + (this.o = c = f.resolution || 1), + (this.l = u ? r(c) : o()), + (this.B = (i && i.B) || t.rtl), + (this.G = (e = t.matcher || (s && s.G)) && d(e, !1)), + (this.H = (e = t.stemmer || (s && s.H)) && d(e, !0)), + (t = e = t.filter || (s && s.filter))) + ) { + (t = e), (i = o()); + for (let e = 0, n = t.length; e < n; e++) i[t[e]] = 1; + t = i; + } + this.filter = t; + } + function j(t, e, n, r, o) { + return n && 1 < t ? (e + (r || 0) <= t ? n + (o || 0) : (((t - 1) / (e + (r || 0))) * (n + (o || 0)) + 1) | 0) : 0; + } + function L(t, e, n, r, i, a, s) { + let c = s ? t.l : t.map; + (!e[n] || (s && !e[n][s])) && + (t.s && (c = c[r]), + s ? (((e = e[n] || (e[n] = o()))[s] = 1), (c = c[s] || (c[s] = o()))) : (e[n] = 1), + (c = c[n] || (c[n] = [])), + t.s || (c = c[r] || (c[r] = [])), + (a && c.includes(i)) || ((c[c.length] = i), t.D && ((t = t.register[i] || (t.register[i] = []))[t.length] = c))); + } + function O(t, e, n, r, o, i, a, s) { + let c = [], + u = s ? t.l : t.map; + if ((t.s || (u = z(u, a, s, t.h)), u)) { + let n = 0; + const f = Math.min(u.length, s ? t.o : t.A); + for ( + let e, d, l = 0, h = 0; + l < f && + !( + (e = u[l]) && + (t.s && (e = z(e, a, s, t.h)), + o && e && i && ((d = e.length), d <= o ? ((o -= d), (e = null)) : ((e = e.slice(o)), (o = 0))), + e && ((c[n++] = e), i && ((h += e.length), h >= r))) + ); + l++ + ); + if (n) return i ? A(c, r, 0) : void (e[e.length] = c); + } + return !n && c; + } + function A(t, e, n) { + return (t = 1 === t.length ? t[0] : [].concat.apply([], t)), n || t.length > e ? t.slice(n, n + e) : t; + } + function z(t, e, n, r) { + return (t = n ? (t = t[(r = r && e > n) ? e : n]) && t[r ? n : e] : t[e]); + } + function I(t, e, n, r, o) { + let i = 0; + if (t.constructor === Array) + if (o) -1 !== (e = t.indexOf(e)) ? 1 < t.length && (t.splice(e, 1), i++) : i++; + else { + o = Math.min(t.length, n); + for (let a, s = 0; s < o; s++) (a = t[s]) && ((i = I(a, e, n, r, o)), r || i || delete t[s]); + } + else for (let a in t) (i = I(t[a], e, n, r, o)) || delete t[a]; + return i; + } + function P(t) { + if (!(this instanceof P)) return new P(t); + var e, + r = t.document || t.doc || t; + (this.F = []), + (this.h = []), + (this.o = []), + (this.register = o()), + (this.key = ((e = r.key || r.id) && E(e, this.o)) || "id"), + (this.D = n(t.fastupdate)), + (this.l = (e = r.store) && !0 !== e && []), + (this.store = e && o()), + (this.async = !1), + (e = o()); + let i = r.index || r.field || r; + a(i) && (i = [i]); + for (let n, r, o = 0; o < i.length; o++) + (n = i[o]), + a(n) || ((r = n), (n = n.field)), + (r = s(r) ? Object.assign({}, t, r) : t), + this.I || (e[n] = new k(r, this.register)), + (this.F[o] = E(n, this.o)), + (this.h[o] = n); + if (this.l) for (a((t = r.store)) && (t = [t]), r = 0; r < t.length; r++) this.l[r] = E(t[r], this.o); + this.index = e; + } + function E(t, e) { + const n = t.split(":"); + let r = 0; + for (let o = 0; o < n.length; o++) 0 <= (t = n[o]).indexOf("[]") && (t = t.substring(0, t.length - 2)) && (e[r] = !0), t && (n[r++] = t); + return r < n.length && (n.length = r), 1 < r ? n : n[0]; + } + function S(t, e) { + if (a(e)) t = t[e]; + else for (let n = 0; t && n < e.length; n++) t = t[e[n]]; + return t; + } + function C(t, e, n, r, i) { + if (((t = t[i]), r === n.length - 1)) e[i] = t; + else if (t) + if (t.constructor === Array) for (e = e[i] = Array(t.length), i = 0; i < t.length; i++) C(t, e, n, r, i); + else (e = e[i] || (e[i] = o())), (i = n[++r]), C(t, e, n, r, i); + } + function R(t, e, n, r, o, i, a, s) { + if ((t = t[a])) + if (r === e.length - 1) { + if (t.constructor === Array) { + if (n[r]) { + for (e = 0; e < t.length; e++) o.add(i, t[e], !0, !0); + return; + } + t = t.join(" "); + } + o.add(i, t, s, !0); + } else if (t.constructor === Array) for (a = 0; a < t.length; a++) R(t, e, n, r, o, i, a, s); + else (a = e[++r]), R(t, e, n, r, o, i, a, s); + } + function M(t, e, n, r) { + let o = this.J[t], + i = o && o.length - n; + if (i && 0 < i) return (i > e || n) && (o = o.slice(n, n + e)), r && (o = F.call(this, o)), { tag: t, result: o }; + } + function F(t) { + const e = Array(t.length); + for (let n, r = 0; r < t.length; r++) (n = t[r]), (e[r] = { id: n, doc: this.store[n] }); + return e; + } + ((e = k.prototype).append = function (t, e) { + return this.add(t, e, !0); + }), + (e.add = function (t, e, n, r) { + if (e && (t || 0 === t)) { + if (!r && !n && this.register[t]) return this.update(t, e); + if ((r = (e = this.encode(e)).length)) { + const f = o(), + d = o(), + l = this.depth, + h = this.A; + for (let p = 0; p < r; p++) { + let v = e[this.B ? r - 1 - p : p]; + var i = v.length; + if (v && i >= this.m && (l || !d[v])) { + var a = j(h, r, p), + s = ""; + switch (this.C) { + case "full": + if (2 < i) { + for (a = 0; a < i; a++) + for (var c = i; c > a; c--) + if (c - a >= this.m) { + var u = j(h, r, p, i, a); + L(this, d, (s = v.substring(a, c)), u, t, n); + } + break; + } + case "reverse": + if (1 < i) { + for (c = i - 1; 0 < c; c--) (s = v[c] + s).length >= this.m && L(this, d, s, j(h, r, p, i, c), t, n); + s = ""; + } + case "forward": + if (1 < i) { + for (c = 0; c < i; c++) (s += v[c]).length >= this.m && L(this, d, s, a, t, n); + break; + } + default: + if ((this.F && (a = Math.min((a / this.F(e, v, p)) | 0, h - 1)), L(this, d, v, a, t, n), l && 1 < r && p < r - 1)) + for (i = o(), s = this.o, a = v, c = Math.min(l + 1, r - p), i[a] = 1, u = 1; u < c; u++) + if ((v = e[this.B ? r - 1 - p - u : p + u]) && v.length >= this.m && !i[v]) { + i[v] = 1; + const e = this.h && v > a; + L(this, f, e ? a : v, j(s + (r / 2 > s ? 0 : 1), r, p, c - 1, u - 1), t, n, e ? v : a); + } + } + } + } + this.D || (this.register[t] = 1); + } + } + return this; + }), + (e.search = function (t, e, n) { + n || (!e && s(t) ? (t = (n = t).query) : s(e) && (n = e)); + let r, + a, + c, + u = [], + f = 0; + if (n) { + (t = n.query || t), (e = n.limit), (f = n.offset || 0); + var d = n.context; + a = n.suggest; + } + if (t && ((r = (t = this.encode("" + t)).length), 1 < r)) { + n = o(); + var l = []; + for (let e, o = 0, i = 0; o < r; o++) + if ((e = t[o]) && e.length >= this.m && !n[e]) { + if (!(this.s || a || this.map[e])) return u; + (l[i++] = e), (n[e] = 1); + } + r = (t = l).length; + } + if (!r) return u; + e || (e = 100), (n = 0), (d = this.depth && 1 < r && !1 !== d) ? ((c = t[0]), (n = 1)) : 1 < r && t.sort(i); + for (let o, i; n < r; n++) { + if ( + ((i = t[n]), + d ? ((o = O(this, u, a, e, f, 2 === r, i, c)), (a && !1 === o && u.length) || (c = i)) : (o = O(this, u, a, e, f, 1 === r, i)), + o) + ) + return o; + if (a && n === r - 1) { + if (!(l = u.length)) { + if (d) { + (d = 0), (n = -1); + continue; + } + return u; + } + if (1 === l) return A(u[0], e, f); + } + } + return b(u, e, f, a); + }), + (e.contain = function (t) { + return !!this.register[t]; + }), + (e.update = function (t, e) { + return this.remove(t).add(t, e); + }), + (e.remove = function (t, e) { + const n = this.register[t]; + if (n) { + if (this.D) for (let e, r = 0; r < n.length; r++) (e = n[r]), e.splice(e.indexOf(t), 1); + else I(this.map, t, this.A, this.s), this.depth && I(this.l, t, this.o, this.s); + e || delete this.register[t]; + } + return this; + }), + x(k.prototype), + ((e = P.prototype).add = function (t, e, n) { + if ((s(t) && (t = S((e = t), this.key)), e && (t || 0 === t))) { + if (!n && this.register[t]) return this.update(t, e); + for (let r, o, i = 0; i < this.h.length; i++) + (o = this.h[i]), (r = this.F[i]), a(r) && (r = [r]), R(e, r, this.o, 0, this.index[o], t, r[0], n); + if (this.store && (!n || !this.store[t])) { + let n; + if (this.l) { + n = o(); + for (let t, r = 0; r < this.l.length; r++) (t = this.l[r]), a(t) ? (n[t] = e[t]) : C(e, n, t, 0, t[0]); + } + this.store[t] = n || e; + } + } + return this; + }), + (e.append = function (t, e) { + return this.add(t, e, !0); + }), + (e.update = function (t, e) { + return this.remove(t).add(t, e); + }), + (e.remove = function (t) { + if ((s(t) && (t = S(t, this.key)), this.register[t])) { + for (let e = 0; e < this.h.length && (this.index[this.h[e]].remove(t, !this.I), !this.D); e++); + this.store && delete this.store[t], delete this.register[t]; + } + return this; + }), + (e.search = function (t, e, n, r) { + n || (!e && s(t) ? ((n = t), (t = "")) : s(e) && ((n = e), (e = 0))); + let o, + i, + c, + u, + f, + d, + l = [], + h = [], + p = 0; + if (n) + if (n.constructor === Array) (c = n), (n = null); + else { + if ( + ((t = n.query || t), + (c = (o = n.pluck) || n.index || n.field), + (u = !1), + (i = this.store && n.enrich), + (f = "and" === n.bool), + (e = n.limit || e || 100), + (d = n.offset || 0), + u && (a(u) && (u = [u]), !t)) + ) { + for (let t, n = 0; n < u.length; n++) (t = M.call(this, u[n], e, d, i)) && ((l[l.length] = t), p++); + return p ? l : []; + } + a(c) && (c = [c]); + } + c || (c = this.h), (f = f && (1 < c.length || (u && 1 < u.length))); + const v = !r && (this.I || this.async) && []; + for (let o, i, s, y = 0; y < c.length; y++) { + let m; + if (((i = c[y]), a(i) || ((m = i), (i = m.field), (t = m.query || t), (e = m.limit || e)), v)) + v[y] = this.index[i].searchAsync(t, e, m || n); + else { + if (((o = r ? r[y] : this.index[i].search(t, e, m || n)), (s = o && o.length), u && s)) { + const t = []; + let n = 0; + f && (t[0] = [o]); + for (let e, r, o = 0; o < u.length; o++) (e = u[o]), (s = (r = this.J[e]) && r.length) && (n++, (t[t.length] = f ? [r] : r)); + n && ((o = f ? b(t, e || 100, d || 0) : _(o, t)), (s = o.length)); + } + if (s) (h[p] = i), (l[p++] = o); + else if (f) return []; + } + } + if (v) { + const r = this; + return new Promise(function (o) { + Promise.all(v).then(function (i) { + o(r.search(t, e, n, i)); + }); + }); + } + if (!p) return []; + if (o && (!i || !this.store)) return l[0]; + for (let t, e = 0; e < h.length; e++) { + if (((t = l[e]), t.length && i && (t = F.call(this, t)), o)) return t; + l[e] = { field: h[e], result: t }; + } + return l; + }), + (e.contain = function (t) { + return !!this.register[t]; + }), + (e.get = function (t) { + return this.store[t]; + }), + (e.set = function (t, e) { + return (this.store[t] = e), this; + }), + x(P.prototype); + var D = { encode: N, B: !1, C: "" }; + const q = [ + h("[àáâãäå]"), + "a", + h("[èéêë]"), + "e", + h("[ìíîï]"), + "i", + h("[òóôõöő]"), + "o", + h("[ùúûüű]"), + "u", + h("[ýŷÿ]"), + "y", + h("ñ"), + "n", + h("[çc]"), + "k", + h("ß"), + "s", + h(" & "), + " and ", + ]; + function N(t) { + var e = (t = "" + t); + return e.normalize && (e = e.normalize("NFD").replace(f, "")), c.call(this, e.toLowerCase(), !t.normalize && q); + } + var T = { encode: V, B: !1, C: "strict" }; + const B = /[^a-z0-9]+/, + U = { + b: "p", + v: "f", + w: "f", + z: "s", + x: "s", + ß: "s", + d: "t", + n: "m", + c: "k", + g: "k", + j: "k", + q: "k", + i: "e", + y: "e", + u: "o", + }; + function V(t) { + const e = []; + if ((t = N.call(this, t).join(" "))) { + const n = t.split(B), + r = n.length; + for (let o, i = 0, a = 0; i < r; i++) + if ((t = n[i]) && (!this.filter || !this.filter[t])) { + o = t[0]; + let n = U[o] || o, + r = n; + for (let e = 1; e < t.length; e++) { + o = t[e]; + const i = U[o] || o; + i && i !== r && ((n += i), (r = i)); + } + e[a++] = n; + } + } + return e; + } + var G = { encode: J, B: !1, C: "" }; + const H = [ + h("ae"), + "a", + h("oe"), + "o", + h("sh"), + "s", + h("th"), + "t", + h("ph"), + "f", + h("pf"), + "f", + h("(?![aeo])h(?![aeo])"), + "", + h("(?!^[aeo])h(?!^[aeo])"), + "", + ]; + function J(t, e) { + return ( + t && (2 < (t = V.call(this, t).join(" ")).length && (t = l(t, H)), e || (1 < t.length && (t = p(t)), t && (t = t.split(" ")))), t || [] + ); + } + var W = { + encode: function (t) { + return ( + t && (1 < (t = J.call(this, t, !0)).length && (t = t.replace(K, "")), 1 < t.length && (t = p(t)), t && (t = t.split(" "))), t || [] + ); + }, + B: !1, + C: "", + }; + const K = h("(?!\\b)[aeo]"); + (g["latin:default"] = v), (g["latin:simple"] = D), (g["latin:balance"] = T), (g["latin:advanced"] = G), (g["latin:extra"] = W); + const Y = t; + let X; + const Z = { + Index: k, + Document: P, + Worker: null, + registerCharset: function (t, e) { + g[t] = e; + }, + registerLanguage: function (t, e) { + m[t] = e; + }, + }; + (X = Y.define) && X.amd + ? X([], function () { + return Z; + }) + : Y.exports + ? (Y.exports = Z) + : (Y.FlexSearch = Z); + })(this); + }, + 8552: function (t, e, n) { + var r = n(852)(n(5639), "DataView"); + t.exports = r; + }, + 1989: function (t, e, n) { + var r = n(1789), + o = n(401), + i = n(7667), + a = n(1327), + s = n(1866); + function c(t) { + var e = -1, + n = null == t ? 0 : t.length; + for (this.clear(); ++e < n; ) { + var r = t[e]; + this.set(r[0], r[1]); + } + } + (c.prototype.clear = r), (c.prototype.delete = o), (c.prototype.get = i), (c.prototype.has = a), (c.prototype.set = s), (t.exports = c); + }, + 8407: function (t, e, n) { + var r = n(7040), + o = n(4125), + i = n(2117), + a = n(7529), + s = n(4705); + function c(t) { + var e = -1, + n = null == t ? 0 : t.length; + for (this.clear(); ++e < n; ) { + var r = t[e]; + this.set(r[0], r[1]); + } + } + (c.prototype.clear = r), (c.prototype.delete = o), (c.prototype.get = i), (c.prototype.has = a), (c.prototype.set = s), (t.exports = c); + }, + 7071: function (t, e, n) { + var r = n(852)(n(5639), "Map"); + t.exports = r; + }, + 3369: function (t, e, n) { + var r = n(4785), + o = n(1285), + i = n(6e3), + a = n(9916), + s = n(5265); + function c(t) { + var e = -1, + n = null == t ? 0 : t.length; + for (this.clear(); ++e < n; ) { + var r = t[e]; + this.set(r[0], r[1]); + } + } + (c.prototype.clear = r), (c.prototype.delete = o), (c.prototype.get = i), (c.prototype.has = a), (c.prototype.set = s), (t.exports = c); + }, + 3818: function (t, e, n) { + var r = n(852)(n(5639), "Promise"); + t.exports = r; + }, + 8525: function (t, e, n) { + var r = n(852)(n(5639), "Set"); + t.exports = r; + }, + 8668: function (t, e, n) { + var r = n(3369), + o = n(619), + i = n(2385); + function a(t) { + var e = -1, + n = null == t ? 0 : t.length; + for (this.__data__ = new r(); ++e < n; ) this.add(t[e]); + } + (a.prototype.add = a.prototype.push = o), (a.prototype.has = i), (t.exports = a); + }, + 6384: function (t, e, n) { + var r = n(8407), + o = n(7465), + i = n(3779), + a = n(7599), + s = n(4758), + c = n(4309); + function u(t) { + var e = (this.__data__ = new r(t)); + this.size = e.size; + } + (u.prototype.clear = o), (u.prototype.delete = i), (u.prototype.get = a), (u.prototype.has = s), (u.prototype.set = c), (t.exports = u); + }, + 2705: function (t, e, n) { + var r = n(5639).Symbol; + t.exports = r; + }, + 1149: function (t, e, n) { + var r = n(5639).Uint8Array; + t.exports = r; + }, + 577: function (t, e, n) { + var r = n(852)(n(5639), "WeakMap"); + t.exports = r; + }, + 4174: function (t) { + t.exports = function (t, e, n, r) { + for (var o = -1, i = null == t ? 0 : t.length; ++o < i; ) { + var a = t[o]; + e(r, a, n(a), t); + } + return r; + }; + }, + 4963: function (t) { + t.exports = function (t, e) { + for (var n = -1, r = null == t ? 0 : t.length, o = 0, i = []; ++n < r; ) { + var a = t[n]; + e(a, n, t) && (i[o++] = a); + } + return i; + }; + }, + 4636: function (t, e, n) { + var r = n(2545), + o = n(5694), + i = n(1469), + a = n(4144), + s = n(5776), + c = n(6719), + u = Object.prototype.hasOwnProperty; + t.exports = function (t, e) { + var n = i(t), + f = !n && o(t), + d = !n && !f && a(t), + l = !n && !f && !d && c(t), + h = n || f || d || l, + p = h ? r(t.length, String) : [], + v = p.length; + for (var y in t) + (!e && !u.call(t, y)) || + (h && + ("length" == y || + (d && ("offset" == y || "parent" == y)) || + (l && ("buffer" == y || "byteLength" == y || "byteOffset" == y)) || + s(y, v))) || + p.push(y); + return p; + }; + }, + 9932: function (t) { + t.exports = function (t, e) { + for (var n = -1, r = null == t ? 0 : t.length, o = Array(r); ++n < r; ) o[n] = e(t[n], n, t); + return o; + }; + }, + 2488: function (t) { + t.exports = function (t, e) { + for (var n = -1, r = e.length, o = t.length; ++n < r; ) t[o + n] = e[n]; + return t; + }; + }, + 2908: function (t) { + t.exports = function (t, e) { + for (var n = -1, r = null == t ? 0 : t.length; ++n < r; ) if (e(t[n], n, t)) return !0; + return !1; + }; + }, + 8983: function (t, e, n) { + var r = n(371)("length"); + t.exports = r; + }, + 4286: function (t) { + t.exports = function (t) { + return t.split(""); + }; + }, + 8470: function (t, e, n) { + var r = n(7813); + t.exports = function (t, e) { + for (var n = t.length; n--; ) if (r(t[n][0], e)) return n; + return -1; + }; + }, + 1119: function (t, e, n) { + var r = n(9881); + t.exports = function (t, e, n, o) { + return ( + r(t, function (t, r, i) { + e(o, t, n(t), i); + }), + o + ); + }; + }, + 9465: function (t, e, n) { + var r = n(8777); + t.exports = function (t, e, n) { + "__proto__" == e && r ? r(t, e, { configurable: !0, enumerable: !0, value: n, writable: !0 }) : (t[e] = n); + }; + }, + 9881: function (t, e, n) { + var r = n(7816), + o = n(9291)(r); + t.exports = o; + }, + 8483: function (t, e, n) { + var r = n(5063)(); + t.exports = r; + }, + 7816: function (t, e, n) { + var r = n(8483), + o = n(3674); + t.exports = function (t, e) { + return t && r(t, e, o); + }; + }, + 7786: function (t, e, n) { + var r = n(1811), + o = n(327); + t.exports = function (t, e) { + for (var n = 0, i = (e = r(e, t)).length; null != t && n < i; ) t = t[o(e[n++])]; + return n && n == i ? t : void 0; + }; + }, + 8866: function (t, e, n) { + var r = n(2488), + o = n(1469); + t.exports = function (t, e, n) { + var i = e(t); + return o(t) ? i : r(i, n(t)); + }; + }, + 4239: function (t, e, n) { + var r = n(2705), + o = n(9607), + i = n(2333), + a = r ? r.toStringTag : void 0; + t.exports = function (t) { + return null == t ? (void 0 === t ? "[object Undefined]" : "[object Null]") : a && a in Object(t) ? o(t) : i(t); + }; + }, + 13: function (t) { + t.exports = function (t, e) { + return null != t && e in Object(t); + }; + }, + 9454: function (t, e, n) { + var r = n(4239), + o = n(7005); + t.exports = function (t) { + return o(t) && "[object Arguments]" == r(t); + }; + }, + 939: function (t, e, n) { + var r = n(2492), + o = n(7005); + t.exports = function t(e, n, i, a, s) { + return e === n || (null == e || null == n || (!o(e) && !o(n)) ? e != e && n != n : r(e, n, i, a, t, s)); + }; + }, + 2492: function (t, e, n) { + var r = n(6384), + o = n(7114), + i = n(8351), + a = n(6096), + s = n(4160), + c = n(1469), + u = n(4144), + f = n(6719), + d = "[object Arguments]", + l = "[object Array]", + h = "[object Object]", + p = Object.prototype.hasOwnProperty; + t.exports = function (t, e, n, v, y, m) { + var g = c(t), + x = c(e), + $ = g ? l : s(t), + b = x ? l : s(e), + _ = ($ = $ == d ? h : $) == h, + w = (b = b == d ? h : b) == h, + k = $ == b; + if (k && u(t)) { + if (!u(e)) return !1; + (g = !0), (_ = !1); + } + if (k && !_) return m || (m = new r()), g || f(t) ? o(t, e, n, v, y, m) : i(t, e, $, n, v, y, m); + if (!(1 & n)) { + var j = _ && p.call(t, "__wrapped__"), + L = w && p.call(e, "__wrapped__"); + if (j || L) { + var O = j ? t.value() : t, + A = L ? e.value() : e; + return m || (m = new r()), y(O, A, n, v, m); + } + } + return !!k && (m || (m = new r()), a(t, e, n, v, y, m)); + }; + }, + 2958: function (t, e, n) { + var r = n(6384), + o = n(939); + t.exports = function (t, e, n, i) { + var a = n.length, + s = a, + c = !i; + if (null == t) return !s; + for (t = Object(t); a--; ) { + var u = n[a]; + if (c && u[2] ? u[1] !== t[u[0]] : !(u[0] in t)) return !1; + } + for (; ++a < s; ) { + var f = (u = n[a])[0], + d = t[f], + l = u[1]; + if (c && u[2]) { + if (void 0 === d && !(f in t)) return !1; + } else { + var h = new r(); + if (i) var p = i(d, l, f, t, e, h); + if (!(void 0 === p ? o(l, d, 3, i, h) : p)) return !1; + } + } + return !0; + }; + }, + 8458: function (t, e, n) { + var r = n(3560), + o = n(5346), + i = n(3218), + a = n(346), + s = /^\[object .+?Constructor\]$/, + c = Function.prototype, + u = Object.prototype, + f = c.toString, + d = u.hasOwnProperty, + l = RegExp( + "^" + + f + .call(d) + .replace(/[\\^$.*+?()[\]{}|]/g, "\\$&") + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + + "$", + ); + t.exports = function (t) { + return !(!i(t) || o(t)) && (r(t) ? l : s).test(a(t)); + }; + }, + 3933: function (t, e, n) { + var r = n(4239), + o = n(7005); + t.exports = function (t) { + return o(t) && "[object RegExp]" == r(t); + }; + }, + 8749: function (t, e, n) { + var r = n(4239), + o = n(1780), + i = n(7005), + a = {}; + (a["[object Float32Array]"] = + a["[object Float64Array]"] = + a["[object Int8Array]"] = + a["[object Int16Array]"] = + a["[object Int32Array]"] = + a["[object Uint8Array]"] = + a["[object Uint8ClampedArray]"] = + a["[object Uint16Array]"] = + a["[object Uint32Array]"] = + !0), + (a["[object Arguments]"] = + a["[object Array]"] = + a["[object ArrayBuffer]"] = + a["[object Boolean]"] = + a["[object DataView]"] = + a["[object Date]"] = + a["[object Error]"] = + a["[object Function]"] = + a["[object Map]"] = + a["[object Number]"] = + a["[object Object]"] = + a["[object RegExp]"] = + a["[object Set]"] = + a["[object String]"] = + a["[object WeakMap]"] = + !1), + (t.exports = function (t) { + return i(t) && o(t.length) && !!a[r(t)]; + }); + }, + 1243: function (t, e, n) { + var r = n(1573), + o = n(6432), + i = n(6557), + a = n(1469), + s = n(9601); + t.exports = function (t) { + return "function" == typeof t ? t : null == t ? i : "object" == typeof t ? (a(t) ? o(t[0], t[1]) : r(t)) : s(t); + }; + }, + 280: function (t, e, n) { + var r = n(5726), + o = n(6916), + i = Object.prototype.hasOwnProperty; + t.exports = function (t) { + if (!r(t)) return o(t); + var e = []; + for (var n in Object(t)) i.call(t, n) && "constructor" != n && e.push(n); + return e; + }; + }, + 1573: function (t, e, n) { + var r = n(2958), + o = n(1499), + i = n(2634); + t.exports = function (t) { + var e = o(t); + return 1 == e.length && e[0][2] + ? i(e[0][0], e[0][1]) + : function (n) { + return n === t || r(n, t, e); + }; + }; + }, + 6432: function (t, e, n) { + var r = n(939), + o = n(7361), + i = n(9095), + a = n(5403), + s = n(9162), + c = n(2634), + u = n(327); + t.exports = function (t, e) { + return a(t) && s(e) + ? c(u(t), e) + : function (n) { + var a = o(n, t); + return void 0 === a && a === e ? i(n, t) : r(e, a, 3); + }; + }; + }, + 371: function (t) { + t.exports = function (t) { + return function (e) { + return null == e ? void 0 : e[t]; + }; + }; + }, + 9152: function (t, e, n) { + var r = n(7786); + t.exports = function (t) { + return function (e) { + return r(e, t); + }; + }; + }, + 4259: function (t) { + t.exports = function (t, e, n) { + var r = -1, + o = t.length; + e < 0 && (e = -e > o ? 0 : o + e), (n = n > o ? o : n) < 0 && (n += o), (o = e > n ? 0 : (n - e) >>> 0), (e >>>= 0); + for (var i = Array(o); ++r < o; ) i[r] = t[r + e]; + return i; + }; + }, + 2545: function (t) { + t.exports = function (t, e) { + for (var n = -1, r = Array(t); ++n < t; ) r[n] = e(n); + return r; + }; + }, + 531: function (t, e, n) { + var r = n(2705), + o = n(9932), + i = n(1469), + a = n(3448), + s = r ? r.prototype : void 0, + c = s ? s.toString : void 0; + t.exports = function t(e) { + if ("string" == typeof e) return e; + if (i(e)) return o(e, t) + ""; + if (a(e)) return c ? c.call(e) : ""; + var n = e + ""; + return "0" == n && 1 / e == -1 / 0 ? "-0" : n; + }; + }, + 7561: function (t, e, n) { + var r = n(7990), + o = /^\s+/; + t.exports = function (t) { + return t ? t.slice(0, r(t) + 1).replace(o, "") : t; + }; + }, + 7518: function (t) { + t.exports = function (t) { + return function (e) { + return t(e); + }; + }; + }, + 4757: function (t) { + t.exports = function (t, e) { + return t.has(e); + }; + }, + 1811: function (t, e, n) { + var r = n(1469), + o = n(5403), + i = n(5514), + a = n(9833); + t.exports = function (t, e) { + return r(t) ? t : o(t, e) ? [t] : i(a(t)); + }; + }, + 180: function (t, e, n) { + var r = n(4259); + t.exports = function (t, e, n) { + var o = t.length; + return (n = void 0 === n ? o : n), !e && n >= o ? t : r(t, e, n); + }; + }, + 4429: function (t, e, n) { + var r = n(5639)["__core-js_shared__"]; + t.exports = r; + }, + 5189: function (t, e, n) { + var r = n(4174), + o = n(1119), + i = n(1243), + a = n(1469); + t.exports = function (t, e) { + return function (n, s) { + var c = a(n) ? r : o, + u = e ? e() : {}; + return c(n, t, i(s, 2), u); + }; + }; + }, + 9291: function (t, e, n) { + var r = n(8612); + t.exports = function (t, e) { + return function (n, o) { + if (null == n) return n; + if (!r(n)) return t(n, o); + for (var i = n.length, a = e ? i : -1, s = Object(n); (e ? a-- : ++a < i) && !1 !== o(s[a], a, s); ); + return n; + }; + }; + }, + 5063: function (t) { + t.exports = function (t) { + return function (e, n, r) { + for (var o = -1, i = Object(e), a = r(e), s = a.length; s--; ) { + var c = a[t ? s : ++o]; + if (!1 === n(i[c], c, i)) break; + } + return e; + }; + }; + }, + 8777: function (t, e, n) { + var r = n(852), + o = (function () { + try { + var t = r(Object, "defineProperty"); + return t({}, "", {}), t; + } catch (t) {} + })(); + t.exports = o; + }, + 7114: function (t, e, n) { + var r = n(8668), + o = n(2908), + i = n(4757); + t.exports = function (t, e, n, a, s, c) { + var u = 1 & n, + f = t.length, + d = e.length; + if (f != d && !(u && d > f)) return !1; + var l = c.get(t), + h = c.get(e); + if (l && h) return l == e && h == t; + var p = -1, + v = !0, + y = 2 & n ? new r() : void 0; + for (c.set(t, e), c.set(e, t); ++p < f; ) { + var m = t[p], + g = e[p]; + if (a) var x = u ? a(g, m, p, e, t, c) : a(m, g, p, t, e, c); + if (void 0 !== x) { + if (x) continue; + v = !1; + break; + } + if (y) { + if ( + !o(e, function (t, e) { + if (!i(y, e) && (m === t || s(m, t, n, a, c))) return y.push(e); + }) + ) { + v = !1; + break; + } + } else if (m !== g && !s(m, g, n, a, c)) { + v = !1; + break; + } + } + return c.delete(t), c.delete(e), v; + }; + }, + 8351: function (t, e, n) { + var r = n(2705), + o = n(1149), + i = n(7813), + a = n(7114), + s = n(8776), + c = n(1814), + u = r ? r.prototype : void 0, + f = u ? u.valueOf : void 0; + t.exports = function (t, e, n, r, u, d, l) { + switch (n) { + case "[object DataView]": + if (t.byteLength != e.byteLength || t.byteOffset != e.byteOffset) return !1; + (t = t.buffer), (e = e.buffer); + case "[object ArrayBuffer]": + return !(t.byteLength != e.byteLength || !d(new o(t), new o(e))); + case "[object Boolean]": + case "[object Date]": + case "[object Number]": + return i(+t, +e); + case "[object Error]": + return t.name == e.name && t.message == e.message; + case "[object RegExp]": + case "[object String]": + return t == e + ""; + case "[object Map]": + var h = s; + case "[object Set]": + var p = 1 & r; + if ((h || (h = c), t.size != e.size && !p)) return !1; + var v = l.get(t); + if (v) return v == e; + (r |= 2), l.set(t, e); + var y = a(h(t), h(e), r, u, d, l); + return l.delete(t), y; + case "[object Symbol]": + if (f) return f.call(t) == f.call(e); + } + return !1; + }; + }, + 6096: function (t, e, n) { + var r = n(8234), + o = Object.prototype.hasOwnProperty; + t.exports = function (t, e, n, i, a, s) { + var c = 1 & n, + u = r(t), + f = u.length; + if (f != r(e).length && !c) return !1; + for (var d = f; d--; ) { + var l = u[d]; + if (!(c ? l in e : o.call(e, l))) return !1; + } + var h = s.get(t), + p = s.get(e); + if (h && p) return h == e && p == t; + var v = !0; + s.set(t, e), s.set(e, t); + for (var y = c; ++d < f; ) { + var m = t[(l = u[d])], + g = e[l]; + if (i) var x = c ? i(g, m, l, e, t, s) : i(m, g, l, t, e, s); + if (!(void 0 === x ? m === g || a(m, g, n, i, s) : x)) { + v = !1; + break; + } + y || (y = "constructor" == l); + } + if (v && !y) { + var $ = t.constructor, + b = e.constructor; + $ == b || + !("constructor" in t) || + !("constructor" in e) || + ("function" == typeof $ && $ instanceof $ && "function" == typeof b && b instanceof b) || + (v = !1); + } + return s.delete(t), s.delete(e), v; + }; + }, + 1957: function (t, e, n) { + var r = "object" == typeof n.g && n.g && n.g.Object === Object && n.g; + t.exports = r; + }, + 8234: function (t, e, n) { + var r = n(8866), + o = n(9551), + i = n(3674); + t.exports = function (t) { + return r(t, i, o); + }; + }, + 5050: function (t, e, n) { + var r = n(7019); + t.exports = function (t, e) { + var n = t.__data__; + return r(e) ? n["string" == typeof e ? "string" : "hash"] : n.map; + }; + }, + 1499: function (t, e, n) { + var r = n(9162), + o = n(3674); + t.exports = function (t) { + for (var e = o(t), n = e.length; n--; ) { + var i = e[n], + a = t[i]; + e[n] = [i, a, r(a)]; + } + return e; + }; + }, + 852: function (t, e, n) { + var r = n(8458), + o = n(7801); + t.exports = function (t, e) { + var n = o(t, e); + return r(n) ? n : void 0; + }; + }, + 9607: function (t, e, n) { + var r = n(2705), + o = Object.prototype, + i = o.hasOwnProperty, + a = o.toString, + s = r ? r.toStringTag : void 0; + t.exports = function (t) { + var e = i.call(t, s), + n = t[s]; + try { + t[s] = void 0; + var r = !0; + } catch (t) {} + var o = a.call(t); + return r && (e ? (t[s] = n) : delete t[s]), o; + }; + }, + 9551: function (t, e, n) { + var r = n(4963), + o = n(479), + i = Object.prototype.propertyIsEnumerable, + a = Object.getOwnPropertySymbols, + s = a + ? function (t) { + return null == t + ? [] + : ((t = Object(t)), + r(a(t), function (e) { + return i.call(t, e); + })); + } + : o; + t.exports = s; + }, + 4160: function (t, e, n) { + var r = n(8552), + o = n(7071), + i = n(3818), + a = n(8525), + s = n(577), + c = n(4239), + u = n(346), + f = "[object Map]", + d = "[object Promise]", + l = "[object Set]", + h = "[object WeakMap]", + p = "[object DataView]", + v = u(r), + y = u(o), + m = u(i), + g = u(a), + x = u(s), + $ = c; + ((r && $(new r(new ArrayBuffer(1))) != p) || + (o && $(new o()) != f) || + (i && $(i.resolve()) != d) || + (a && $(new a()) != l) || + (s && $(new s()) != h)) && + ($ = function (t) { + var e = c(t), + n = "[object Object]" == e ? t.constructor : void 0, + r = n ? u(n) : ""; + if (r) + switch (r) { + case v: + return p; + case y: + return f; + case m: + return d; + case g: + return l; + case x: + return h; + } + return e; + }), + (t.exports = $); + }, + 7801: function (t) { + t.exports = function (t, e) { + return null == t ? void 0 : t[e]; + }; + }, + 222: function (t, e, n) { + var r = n(1811), + o = n(5694), + i = n(1469), + a = n(5776), + s = n(1780), + c = n(327); + t.exports = function (t, e, n) { + for (var u = -1, f = (e = r(e, t)).length, d = !1; ++u < f; ) { + var l = c(e[u]); + if (!(d = null != t && n(t, l))) break; + t = t[l]; + } + return d || ++u != f ? d : !!(f = null == t ? 0 : t.length) && s(f) && a(l, f) && (i(t) || o(t)); + }; + }, + 2689: function (t) { + var e = RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"); + t.exports = function (t) { + return e.test(t); + }; + }, + 1789: function (t, e, n) { + var r = n(4536); + t.exports = function () { + (this.__data__ = r ? r(null) : {}), (this.size = 0); + }; + }, + 401: function (t) { + t.exports = function (t) { + var e = this.has(t) && delete this.__data__[t]; + return (this.size -= e ? 1 : 0), e; + }; + }, + 7667: function (t, e, n) { + var r = n(4536), + o = Object.prototype.hasOwnProperty; + t.exports = function (t) { + var e = this.__data__; + if (r) { + var n = e[t]; + return "__lodash_hash_undefined__" === n ? void 0 : n; + } + return o.call(e, t) ? e[t] : void 0; + }; + }, + 1327: function (t, e, n) { + var r = n(4536), + o = Object.prototype.hasOwnProperty; + t.exports = function (t) { + var e = this.__data__; + return r ? void 0 !== e[t] : o.call(e, t); + }; + }, + 1866: function (t, e, n) { + var r = n(4536); + t.exports = function (t, e) { + var n = this.__data__; + return (this.size += this.has(t) ? 0 : 1), (n[t] = r && void 0 === e ? "__lodash_hash_undefined__" : e), this; + }; + }, + 5776: function (t) { + var e = /^(?:0|[1-9]\d*)$/; + t.exports = function (t, n) { + var r = typeof t; + return !!(n = null == n ? 9007199254740991 : n) && ("number" == r || ("symbol" != r && e.test(t))) && t > -1 && t % 1 == 0 && t < n; + }; + }, + 5403: function (t, e, n) { + var r = n(1469), + o = n(3448), + i = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + a = /^\w*$/; + t.exports = function (t, e) { + if (r(t)) return !1; + var n = typeof t; + return ( + !("number" != n && "symbol" != n && "boolean" != n && null != t && !o(t)) || a.test(t) || !i.test(t) || (null != e && t in Object(e)) + ); + }; + }, + 7019: function (t) { + t.exports = function (t) { + var e = typeof t; + return "string" == e || "number" == e || "symbol" == e || "boolean" == e ? "__proto__" !== t : null === t; + }; + }, + 5346: function (t, e, n) { + var r, + o = n(4429), + i = (r = /[^.]+$/.exec((o && o.keys && o.keys.IE_PROTO) || "")) ? "Symbol(src)_1." + r : ""; + t.exports = function (t) { + return !!i && i in t; + }; + }, + 5726: function (t) { + var e = Object.prototype; + t.exports = function (t) { + var n = t && t.constructor; + return t === (("function" == typeof n && n.prototype) || e); + }; + }, + 9162: function (t, e, n) { + var r = n(3218); + t.exports = function (t) { + return t == t && !r(t); + }; + }, + 7040: function (t) { + t.exports = function () { + (this.__data__ = []), (this.size = 0); + }; + }, + 4125: function (t, e, n) { + var r = n(8470), + o = Array.prototype.splice; + t.exports = function (t) { + var e = this.__data__, + n = r(e, t); + return !(n < 0 || (n == e.length - 1 ? e.pop() : o.call(e, n, 1), --this.size, 0)); + }; + }, + 2117: function (t, e, n) { + var r = n(8470); + t.exports = function (t) { + var e = this.__data__, + n = r(e, t); + return n < 0 ? void 0 : e[n][1]; + }; + }, + 7529: function (t, e, n) { + var r = n(8470); + t.exports = function (t) { + return r(this.__data__, t) > -1; + }; + }, + 4705: function (t, e, n) { + var r = n(8470); + t.exports = function (t, e) { + var n = this.__data__, + o = r(n, t); + return o < 0 ? (++this.size, n.push([t, e])) : (n[o][1] = e), this; + }; + }, + 4785: function (t, e, n) { + var r = n(1989), + o = n(8407), + i = n(7071); + t.exports = function () { + (this.size = 0), (this.__data__ = { hash: new r(), map: new (i || o)(), string: new r() }); + }; + }, + 1285: function (t, e, n) { + var r = n(5050); + t.exports = function (t) { + var e = r(this, t).delete(t); + return (this.size -= e ? 1 : 0), e; + }; + }, + 6e3: function (t, e, n) { + var r = n(5050); + t.exports = function (t) { + return r(this, t).get(t); + }; + }, + 9916: function (t, e, n) { + var r = n(5050); + t.exports = function (t) { + return r(this, t).has(t); + }; + }, + 5265: function (t, e, n) { + var r = n(5050); + t.exports = function (t, e) { + var n = r(this, t), + o = n.size; + return n.set(t, e), (this.size += n.size == o ? 0 : 1), this; + }; + }, + 8776: function (t) { + t.exports = function (t) { + var e = -1, + n = Array(t.size); + return ( + t.forEach(function (t, r) { + n[++e] = [r, t]; + }), + n + ); + }; + }, + 2634: function (t) { + t.exports = function (t, e) { + return function (n) { + return null != n && n[t] === e && (void 0 !== e || t in Object(n)); + }; + }; + }, + 4523: function (t, e, n) { + var r = n(8306); + t.exports = function (t) { + var e = r(t, function (t) { + return 500 === n.size && n.clear(), t; + }), + n = e.cache; + return e; + }; + }, + 4536: function (t, e, n) { + var r = n(852)(Object, "create"); + t.exports = r; + }, + 6916: function (t, e, n) { + var r = n(5569)(Object.keys, Object); + t.exports = r; + }, + 1167: function (t, e, n) { + t = n.nmd(t); + var r = n(1957), + o = e && !e.nodeType && e, + i = o && t && !t.nodeType && t, + a = i && i.exports === o && r.process, + s = (function () { + try { + return (i && i.require && i.require("util").types) || (a && a.binding && a.binding("util")); + } catch (t) {} + })(); + t.exports = s; + }, + 2333: function (t) { + var e = Object.prototype.toString; + t.exports = function (t) { + return e.call(t); + }; + }, + 5569: function (t) { + t.exports = function (t, e) { + return function (n) { + return t(e(n)); + }; + }; + }, + 5639: function (t, e, n) { + var r = n(1957), + o = "object" == typeof self && self && self.Object === Object && self, + i = r || o || Function("return this")(); + t.exports = i; + }, + 619: function (t) { + t.exports = function (t) { + return this.__data__.set(t, "__lodash_hash_undefined__"), this; + }; + }, + 2385: function (t) { + t.exports = function (t) { + return this.__data__.has(t); + }; + }, + 1814: function (t) { + t.exports = function (t) { + var e = -1, + n = Array(t.size); + return ( + t.forEach(function (t) { + n[++e] = t; + }), + n + ); + }; + }, + 7465: function (t, e, n) { + var r = n(8407); + t.exports = function () { + (this.__data__ = new r()), (this.size = 0); + }; + }, + 3779: function (t) { + t.exports = function (t) { + var e = this.__data__, + n = e.delete(t); + return (this.size = e.size), n; + }; + }, + 7599: function (t) { + t.exports = function (t) { + return this.__data__.get(t); + }; + }, + 4758: function (t) { + t.exports = function (t) { + return this.__data__.has(t); + }; + }, + 4309: function (t, e, n) { + var r = n(8407), + o = n(7071), + i = n(3369); + t.exports = function (t, e) { + var n = this.__data__; + if (n instanceof r) { + var a = n.__data__; + if (!o || a.length < 199) return a.push([t, e]), (this.size = ++n.size), this; + n = this.__data__ = new i(a); + } + return n.set(t, e), (this.size = n.size), this; + }; + }, + 8016: function (t, e, n) { + var r = n(8983), + o = n(2689), + i = n(1903); + t.exports = function (t) { + return o(t) ? i(t) : r(t); + }; + }, + 3140: function (t, e, n) { + var r = n(4286), + o = n(2689), + i = n(676); + t.exports = function (t) { + return o(t) ? i(t) : r(t); + }; + }, + 5514: function (t, e, n) { + var r = n(4523), + o = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, + i = /\\(\\)?/g, + a = r(function (t) { + var e = []; + return ( + 46 === t.charCodeAt(0) && e.push(""), + t.replace(o, function (t, n, r, o) { + e.push(r ? o.replace(i, "$1") : n || t); + }), + e + ); + }); + t.exports = a; + }, + 327: function (t, e, n) { + var r = n(3448); + t.exports = function (t) { + if ("string" == typeof t || r(t)) return t; + var e = t + ""; + return "0" == e && 1 / t == -1 / 0 ? "-0" : e; + }; + }, + 346: function (t) { + var e = Function.prototype.toString; + t.exports = function (t) { + if (null != t) { + try { + return e.call(t); + } catch (t) {} + try { + return t + ""; + } catch (t) {} + } + return ""; + }; + }, + 7990: function (t) { + var e = /\s/; + t.exports = function (t) { + for (var n = t.length; n-- && e.test(t.charAt(n)); ); + return n; + }; + }, + 1903: function (t) { + var e = "\\ud800-\\udfff", + n = "[" + e + "]", + r = "[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", + o = "\\ud83c[\\udffb-\\udfff]", + i = "[^" + e + "]", + a = "(?:\\ud83c[\\udde6-\\uddff]){2}", + s = "[\\ud800-\\udbff][\\udc00-\\udfff]", + c = "(?:" + r + "|" + o + ")?", + u = "[\\ufe0e\\ufe0f]?", + f = u + c + "(?:\\u200d(?:" + [i, a, s].join("|") + ")" + u + c + ")*", + d = "(?:" + [i + r + "?", r, a, s, n].join("|") + ")", + l = RegExp(o + "(?=" + o + ")|" + d + f, "g"); + t.exports = function (t) { + for (var e = (l.lastIndex = 0); l.test(t); ) ++e; + return e; + }; + }, + 676: function (t) { + var e = "\\ud800-\\udfff", + n = "[" + e + "]", + r = "[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", + o = "\\ud83c[\\udffb-\\udfff]", + i = "[^" + e + "]", + a = "(?:\\ud83c[\\udde6-\\uddff]){2}", + s = "[\\ud800-\\udbff][\\udc00-\\udfff]", + c = "(?:" + r + "|" + o + ")?", + u = "[\\ufe0e\\ufe0f]?", + f = u + c + "(?:\\u200d(?:" + [i, a, s].join("|") + ")" + u + c + ")*", + d = "(?:" + [i + r + "?", r, a, s, n].join("|") + ")", + l = RegExp(o + "(?=" + o + ")|" + d + f, "g"); + t.exports = function (t) { + return t.match(l) || []; + }; + }, + 7813: function (t) { + t.exports = function (t, e) { + return t === e || (t != t && e != e); + }; + }, + 7361: function (t, e, n) { + var r = n(7786); + t.exports = function (t, e, n) { + var o = null == t ? void 0 : r(t, e); + return void 0 === o ? n : o; + }; + }, + 7739: function (t, e, n) { + var r = n(9465), + o = n(5189), + i = Object.prototype.hasOwnProperty, + a = o(function (t, e, n) { + i.call(t, n) ? t[n].push(e) : r(t, n, [e]); + }); + t.exports = a; + }, + 9095: function (t, e, n) { + var r = n(13), + o = n(222); + t.exports = function (t, e) { + return null != t && o(t, e, r); + }; + }, + 6557: function (t) { + t.exports = function (t) { + return t; + }; + }, + 5694: function (t, e, n) { + var r = n(9454), + o = n(7005), + i = Object.prototype, + a = i.hasOwnProperty, + s = i.propertyIsEnumerable, + c = r( + (function () { + return arguments; + })(), + ) + ? r + : function (t) { + return o(t) && a.call(t, "callee") && !s.call(t, "callee"); + }; + t.exports = c; + }, + 1469: function (t) { + var e = Array.isArray; + t.exports = e; + }, + 8612: function (t, e, n) { + var r = n(3560), + o = n(1780); + t.exports = function (t) { + return null != t && o(t.length) && !r(t); + }; + }, + 4144: function (t, e, n) { + t = n.nmd(t); + var r = n(5639), + o = n(5062), + i = e && !e.nodeType && e, + a = i && t && !t.nodeType && t, + s = a && a.exports === i ? r.Buffer : void 0, + c = (s ? s.isBuffer : void 0) || o; + t.exports = c; + }, + 3560: function (t, e, n) { + var r = n(4239), + o = n(3218); + t.exports = function (t) { + if (!o(t)) return !1; + var e = r(t); + return "[object Function]" == e || "[object GeneratorFunction]" == e || "[object AsyncFunction]" == e || "[object Proxy]" == e; + }; + }, + 1780: function (t) { + t.exports = function (t) { + return "number" == typeof t && t > -1 && t % 1 == 0 && t <= 9007199254740991; + }; + }, + 3218: function (t) { + t.exports = function (t) { + var e = typeof t; + return null != t && ("object" == e || "function" == e); + }; + }, + 7005: function (t) { + t.exports = function (t) { + return null != t && "object" == typeof t; + }; + }, + 6347: function (t, e, n) { + var r = n(3933), + o = n(7518), + i = n(1167), + a = i && i.isRegExp, + s = a ? o(a) : r; + t.exports = s; + }, + 3448: function (t, e, n) { + var r = n(4239), + o = n(7005); + t.exports = function (t) { + return "symbol" == typeof t || (o(t) && "[object Symbol]" == r(t)); + }; + }, + 6719: function (t, e, n) { + var r = n(8749), + o = n(7518), + i = n(1167), + a = i && i.isTypedArray, + s = a ? o(a) : r; + t.exports = s; + }, + 3674: function (t, e, n) { + var r = n(4636), + o = n(280), + i = n(8612); + t.exports = function (t) { + return i(t) ? r(t) : o(t); + }; + }, + 8306: function (t, e, n) { + var r = n(3369); + function o(t, e) { + if ("function" != typeof t || (null != e && "function" != typeof e)) throw new TypeError("Expected a function"); + var n = function () { + var r = arguments, + o = e ? e.apply(this, r) : r[0], + i = n.cache; + if (i.has(o)) return i.get(o); + var a = t.apply(this, r); + return (n.cache = i.set(o, a) || i), a; + }; + return (n.cache = new (o.Cache || r)()), n; + } + (o.Cache = r), (t.exports = o); + }, + 9601: function (t, e, n) { + var r = n(371), + o = n(9152), + i = n(5403), + a = n(327); + t.exports = function (t) { + return i(t) ? r(a(t)) : o(t); + }; + }, + 479: function (t) { + t.exports = function () { + return []; + }; + }, + 5062: function (t) { + t.exports = function () { + return !1; + }; + }, + 8601: function (t, e, n) { + var r = n(4841); + t.exports = function (t) { + return t ? (Infinity === (t = r(t)) || t === -1 / 0 ? 17976931348623157e292 * (t < 0 ? -1 : 1) : t == t ? t : 0) : 0 === t ? t : 0; + }; + }, + 554: function (t, e, n) { + var r = n(8601); + t.exports = function (t) { + var e = r(t), + n = e % 1; + return e == e ? (n ? e - n : e) : 0; + }; + }, + 4841: function (t, e, n) { + var r = n(7561), + o = n(3218), + i = n(3448), + a = /^[-+]0x[0-9a-f]+$/i, + s = /^0b[01]+$/i, + c = /^0o[0-7]+$/i, + u = parseInt; + t.exports = function (t) { + if ("number" == typeof t) return t; + if (i(t)) return NaN; + if (o(t)) { + var e = "function" == typeof t.valueOf ? t.valueOf() : t; + t = o(e) ? e + "" : e; + } + if ("string" != typeof t) return 0 === t ? t : +t; + t = r(t); + var n = s.test(t); + return n || c.test(t) ? u(t.slice(2), n ? 2 : 8) : a.test(t) ? NaN : +t; + }; + }, + 9833: function (t, e, n) { + var r = n(531); + t.exports = function (t) { + return null == t ? "" : r(t); + }; + }, + 9138: function (t, e, n) { + var r = n(531), + o = n(180), + i = n(2689), + a = n(3218), + s = n(6347), + c = n(8016), + u = n(3140), + f = n(554), + d = n(9833), + l = /\w*$/; + t.exports = function (t, e) { + var n = 30, + h = "..."; + if (a(e)) { + var p = "separator" in e ? e.separator : p; + (n = "length" in e ? f(e.length) : n), (h = "omission" in e ? r(e.omission) : h); + } + var v = (t = d(t)).length; + if (i(t)) { + var y = u(t); + v = y.length; + } + if (n >= v) return t; + var m = n - c(h); + if (m < 1) return h; + var g = y ? o(y, 0, m).join("") : t.slice(0, m); + if (void 0 === p) return g + h; + if ((y && (m += g.length - m), s(p))) { + if (t.slice(m).search(p)) { + var x, + $ = g; + for (p.global || (p = RegExp(p.source, d(l.exec(p)) + "g")), p.lastIndex = 0; (x = p.exec($)); ) var b = x.index; + g = g.slice(0, void 0 === b ? m : b); + } + } else if (t.indexOf(r(p), m) != m) { + var _ = g.lastIndexOf(p); + _ > -1 && (g = g.slice(0, _)); + } + return g + h; + }; + }, + 9707: function (t, e, n) { + "use strict"; + function r(t, e) { + const n = typeof t; + if (n !== typeof e) return !1; + if (Array.isArray(t)) { + if (!Array.isArray(e)) return !1; + const n = t.length; + if (n !== e.length) return !1; + for (let o = 0; o < n; o++) if (!r(t[o], e[o])) return !1; + return !0; + } + if ("object" === n) { + if (!t || !e) return t === e; + const n = Object.keys(t), + o = Object.keys(e); + if (n.length !== o.length) return !1; + for (const o of n) if (!r(t[o], e[o])) return !1; + return !0; + } + return t === e; + } + function o(t) { + return encodeURI(i(t)); + } + function i(t) { + return t.replace(/~/g, "~0").replace(/\//g, "~1"); + } + n.r(e), + n.d(e, { + Validator: function () { + return L; + }, + deepCompareStrict: function () { + return r; + }, + dereference: function () { + return d; + }, + encodePointer: function () { + return o; + }, + escapePointer: function () { + return i; + }, + fastFormat: function () { + return m; + }, + fullFormat: function () { + return y; + }, + ignoredKeyword: function () { + return u; + }, + initialBaseURI: function () { + return f; + }, + schemaArrayKeyword: function () { + return s; + }, + schemaKeyword: function () { + return a; + }, + schemaMapKeyword: function () { + return c; + }, + ucs2length: function () { + return k; + }, + validate: function () { + return j; + }, + }); + const a = { + additionalItems: !0, + unevaluatedItems: !0, + items: !0, + contains: !0, + additionalProperties: !0, + unevaluatedProperties: !0, + propertyNames: !0, + not: !0, + if: !0, + then: !0, + else: !0, + }, + s = { prefixItems: !0, items: !0, allOf: !0, anyOf: !0, oneOf: !0 }, + c = { + $defs: !0, + definitions: !0, + properties: !0, + patternProperties: !0, + dependentSchemas: !0, + }, + u = { + id: !0, + $id: !0, + $ref: !0, + $schema: !0, + $anchor: !0, + $vocabulary: !0, + $comment: !0, + default: !0, + enum: !0, + const: !0, + required: !0, + type: !0, + maximum: !0, + minimum: !0, + exclusiveMaximum: !0, + exclusiveMinimum: !0, + multipleOf: !0, + maxLength: !0, + minLength: !0, + pattern: !0, + format: !0, + maxItems: !0, + minItems: !0, + uniqueItems: !0, + maxProperties: !0, + minProperties: !0, + }; + let f = + "undefined" != typeof self && self.location && "null" !== self.location.origin + ? new URL(self.location.origin + self.location.pathname + location.search) + : new URL("https://github.com/cfworker"); + function d(t, e = Object.create(null), n = f, r = "") { + if (t && "object" == typeof t && !Array.isArray(t)) { + const o = t.$id || t.id; + if (o) { + const i = new URL(o, n.href); + i.hash.length > 1 ? (e[i.href] = t) : ((i.hash = ""), "" === r ? (n = i) : d(t, e, n)); + } + } else if (!0 !== t && !1 !== t) return e; + const i = n.href + (r ? "#" + r : ""); + if (void 0 !== e[i]) throw new Error(`Duplicate schema URI "${i}".`); + if (((e[i] = t), !0 === t || !1 === t)) return e; + if ( + (void 0 === t.__absolute_uri__ && Object.defineProperty(t, "__absolute_uri__", { enumerable: !1, value: i }), + t.$ref && void 0 === t.__absolute_ref__) + ) { + const e = new URL(t.$ref, n.href); + (e.hash = e.hash), Object.defineProperty(t, "__absolute_ref__", { enumerable: !1, value: e.href }); + } + if (t.$recursiveRef && void 0 === t.__absolute_recursive_ref__) { + const e = new URL(t.$recursiveRef, n.href); + (e.hash = e.hash), + Object.defineProperty(t, "__absolute_recursive_ref__", { + enumerable: !1, + value: e.href, + }); + } + t.$anchor && (e[new URL("#" + t.$anchor, n.href).href] = t); + for (let i in t) { + if (u[i]) continue; + const a = `${r}/${o(i)}`, + f = t[i]; + if (Array.isArray(f)) { + if (s[i]) { + const t = f.length; + for (let r = 0; r < t; r++) d(f[r], e, n, `${a}/${r}`); + } + } else if (c[i]) for (let t in f) d(f[t], e, n, `${a}/${o(t)}`); + else d(f, e, n, a); + } + return e; + } + const l = /^(\d\d\d\d)-(\d\d)-(\d\d)$/, + h = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], + p = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i; + function v(t) { + return t.test.bind(t); + } + const y = { + date: g, + time: x.bind(void 0, !1), + "date-time": function (t) { + const e = t.split($); + return 2 == e.length && g(e[0]) && x(!0, e[1]); + }, + duration: (t) => + t.length > 1 && + t.length < 80 && + (/^P\d+([.,]\d+)?W$/.test(t) || + (/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(t) && /^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(t))), + uri: function (t) { + return b.test(t) && _.test(t); + }, + "uri-reference": v( + /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i, + ), + "uri-template": v( + /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i, + ), + url: v( + /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu, + ), + email: (t) => { + if ('"' === t[0]) return !1; + const [e, n, ...r] = t.split("@"); + return ( + !(!e || !n || 0 !== r.length || e.length > 64 || n.length > 253) && + "." !== e[0] && + !e.endsWith(".") && + !e.includes("..") && + !(!/^[a-z0-9.-]+$/i.test(n) || !/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(e)) && + n.split(".").every((t) => /^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(t)) + ); + }, + hostname: v(/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i), + ipv4: v(/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/), + ipv6: v( + /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i, + ), + regex: function (t) { + if (w.test(t)) return !1; + try { + return new RegExp(t), !0; + } catch (t) { + return !1; + } + }, + uuid: v(/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i), + "json-pointer": v(/^(?:\/(?:[^~/]|~0|~1)*)*$/), + "json-pointer-uri-fragment": v(/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i), + "relative-json-pointer": v(/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/), + }, + m = { + ...y, + date: v(/^\d\d\d\d-[0-1]\d-[0-3]\d$/), + time: v(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i), + "date-time": v(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i), + "uri-reference": v(/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i), + }; + function g(t) { + const e = t.match(l); + if (!e) return !1; + const n = +e[1], + r = +e[2], + o = +e[3]; + return ( + r >= 1 && + r <= 12 && + o >= 1 && + o <= + (2 == r && + (function (t) { + return t % 4 == 0 && (t % 100 != 0 || t % 400 == 0); + })(n) + ? 29 + : h[r]) + ); + } + function x(t, e) { + const n = e.match(p); + if (!n) return !1; + const r = +n[1], + o = +n[2], + i = +n[3], + a = !!n[5]; + return ((r <= 23 && o <= 59 && i <= 59) || (23 == r && 59 == o && 60 == i)) && (!t || a); + } + const $ = /t|\s/i, + b = /\/|:/, + _ = + /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i, + w = /[^\\]\\Z/; + function k(t) { + let e, + n = 0, + r = t.length, + o = 0; + for (; o < r; ) n++, (e = t.charCodeAt(o++)), e >= 55296 && e <= 56319 && o < r && ((e = t.charCodeAt(o)), 56320 == (64512 & e) && o++); + return n; + } + function j(t, e, n = "2019-09", i = d(e), a = !0, s = null, c = "#", u = "#", f = Object.create(null)) { + if (!0 === e) return { valid: !0, errors: [] }; + if (!1 === e) + return { + valid: !1, + errors: [ + { + instanceLocation: c, + keyword: "false", + keywordLocation: c, + error: "False boolean schema.", + }, + ], + }; + const l = typeof t; + let h; + switch (l) { + case "boolean": + case "number": + case "string": + h = l; + break; + case "object": + h = null === t ? "null" : Array.isArray(t) ? "array" : "object"; + break; + default: + throw new Error(`Instances of "${l}" type are not supported.`); + } + const { + $ref: p, + $recursiveRef: v, + $recursiveAnchor: y, + type: g, + const: x, + enum: $, + required: b, + not: _, + anyOf: w, + allOf: L, + oneOf: O, + if: A, + then: z, + else: I, + format: P, + properties: E, + patternProperties: S, + additionalProperties: C, + unevaluatedProperties: R, + minProperties: M, + maxProperties: F, + propertyNames: D, + dependentRequired: q, + dependentSchemas: N, + dependencies: T, + prefixItems: B, + items: U, + additionalItems: V, + unevaluatedItems: G, + contains: H, + minContains: J, + maxContains: W, + minItems: K, + maxItems: Y, + uniqueItems: X, + minimum: Z, + maximum: Q, + exclusiveMinimum: tt, + exclusiveMaximum: et, + multipleOf: nt, + minLength: rt, + maxLength: ot, + pattern: it, + __absolute_ref__: at, + __absolute_recursive_ref__: st, + } = e, + ct = []; + if ((!0 === y && null === s && (s = e), "#" === v)) { + const r = null === s ? i[st] : s, + o = `${u}/$recursiveRef`, + d = j(t, null === s ? e : s, n, i, a, r, c, o, f); + d.valid || + ct.push( + { + instanceLocation: c, + keyword: "$recursiveRef", + keywordLocation: o, + error: "A subschema had errors.", + }, + ...d.errors, + ); + } + if (void 0 !== p) { + const e = i[at || p]; + if (void 0 === e) { + let t = `Unresolved $ref "${p}".`; + throw (at && at !== p && (t += ` Absolute URI "${at}".`), (t += `\nKnown schemas:\n- ${Object.keys(i).join("\n- ")}`), new Error(t)); + } + const r = `${u}/$ref`, + o = j(t, e, n, i, a, s, c, r, f); + if ( + (o.valid || + ct.push( + { + instanceLocation: c, + keyword: "$ref", + keywordLocation: r, + error: "A subschema had errors.", + }, + ...o.errors, + ), + "4" === n || "7" === n) + ) + return { valid: 0 === ct.length, errors: ct }; + } + if (Array.isArray(g)) { + let e = g.length, + n = !1; + for (let r = 0; r < e; r++) + if (h === g[r] || ("integer" === g[r] && "number" === h && t % 1 == 0 && t == t)) { + n = !0; + break; + } + n || + ct.push({ + instanceLocation: c, + keyword: "type", + keywordLocation: `${u}/type`, + error: `Instance type "${h}" is invalid. Expected "${g.join('", "')}".`, + }); + } else + "integer" === g + ? ("number" !== h || t % 1 || t != t) && + ct.push({ + instanceLocation: c, + keyword: "type", + keywordLocation: `${u}/type`, + error: `Instance type "${h}" is invalid. Expected "${g}".`, + }) + : void 0 !== g && + h !== g && + ct.push({ + instanceLocation: c, + keyword: "type", + keywordLocation: `${u}/type`, + error: `Instance type "${h}" is invalid. Expected "${g}".`, + }); + if ( + (void 0 !== x && + ("object" === h || "array" === h + ? r(t, x) || + ct.push({ + instanceLocation: c, + keyword: "const", + keywordLocation: `${u}/const`, + error: `Instance does not match ${JSON.stringify(x)}.`, + }) + : t !== x && + ct.push({ + instanceLocation: c, + keyword: "const", + keywordLocation: `${u}/const`, + error: `Instance does not match ${JSON.stringify(x)}.`, + })), + void 0 !== $ && + ("object" === h || "array" === h + ? $.some((e) => r(t, e)) || + ct.push({ + instanceLocation: c, + keyword: "enum", + keywordLocation: `${u}/enum`, + error: `Instance does not match any of ${JSON.stringify($)}.`, + }) + : $.some((e) => t === e) || + ct.push({ + instanceLocation: c, + keyword: "enum", + keywordLocation: `${u}/enum`, + error: `Instance does not match any of ${JSON.stringify($)}.`, + })), + void 0 !== _) + ) { + const e = `${u}/not`; + j(t, _, n, i, a, s, c, e).valid && + ct.push({ + instanceLocation: c, + keyword: "not", + keywordLocation: e, + error: 'Instance matched "not" schema.', + }); + } + let ut = []; + if (void 0 !== w) { + const e = `${u}/anyOf`, + r = ct.length; + let o = !1; + for (let r = 0; r < w.length; r++) { + const u = w[r], + d = Object.create(f), + l = j(t, u, n, i, a, !0 === y ? s : null, c, `${e}/${r}`, d); + ct.push(...l.errors), (o = o || l.valid), l.valid && ut.push(d); + } + o + ? (ct.length = r) + : ct.splice(r, 0, { + instanceLocation: c, + keyword: "anyOf", + keywordLocation: e, + error: "Instance does not match any subschemas.", + }); + } + if (void 0 !== L) { + const e = `${u}/allOf`, + r = ct.length; + let o = !0; + for (let r = 0; r < L.length; r++) { + const u = L[r], + d = Object.create(f), + l = j(t, u, n, i, a, !0 === y ? s : null, c, `${e}/${r}`, d); + ct.push(...l.errors), (o = o && l.valid), l.valid && ut.push(d); + } + o + ? (ct.length = r) + : ct.splice(r, 0, { + instanceLocation: c, + keyword: "allOf", + keywordLocation: e, + error: "Instance does not match every subschema.", + }); + } + if (void 0 !== O) { + const e = `${u}/oneOf`, + r = ct.length, + o = O.filter((r, o) => { + const u = Object.create(f), + d = j(t, r, n, i, a, !0 === y ? s : null, c, `${e}/${o}`, u); + return ct.push(...d.errors), d.valid && ut.push(u), d.valid; + }).length; + 1 === o + ? (ct.length = r) + : ct.splice(r, 0, { + instanceLocation: c, + keyword: "oneOf", + keywordLocation: e, + error: `Instance does not match exactly one subschema (${o} matches).`, + }); + } + if ((("object" !== h && "array" !== h) || Object.assign(f, ...ut), void 0 !== A)) { + const e = `${u}/if`; + if (j(t, A, n, i, a, s, c, e, f).valid) { + if (void 0 !== z) { + const r = j(t, z, n, i, a, s, c, `${u}/then`, f); + r.valid || + ct.push( + { + instanceLocation: c, + keyword: "if", + keywordLocation: e, + error: 'Instance does not match "then" schema.', + }, + ...r.errors, + ); + } + } else if (void 0 !== I) { + const r = j(t, I, n, i, a, s, c, `${u}/else`, f); + r.valid || + ct.push( + { + instanceLocation: c, + keyword: "if", + keywordLocation: e, + error: 'Instance does not match "else" schema.', + }, + ...r.errors, + ); + } + } + if ("object" === h) { + if (void 0 !== b) + for (const e of b) + e in t || + ct.push({ + instanceLocation: c, + keyword: "required", + keywordLocation: `${u}/required`, + error: `Instance does not have required property "${e}".`, + }); + const e = Object.keys(t); + if ( + (void 0 !== M && + e.length < M && + ct.push({ + instanceLocation: c, + keyword: "minProperties", + keywordLocation: `${u}/minProperties`, + error: `Instance does not have at least ${M} properties.`, + }), + void 0 !== F && + e.length > F && + ct.push({ + instanceLocation: c, + keyword: "maxProperties", + keywordLocation: `${u}/maxProperties`, + error: `Instance does not have at least ${F} properties.`, + }), + void 0 !== D) + ) { + const e = `${u}/propertyNames`; + for (const r in t) { + const t = `${c}/${o(r)}`, + u = j(r, D, n, i, a, s, t, e); + u.valid || + ct.push( + { + instanceLocation: c, + keyword: "propertyNames", + keywordLocation: e, + error: `Property name "${r}" does not match schema.`, + }, + ...u.errors, + ); + } + } + if (void 0 !== q) { + const e = `${u}/dependantRequired`; + for (const n in q) + if (n in t) { + const r = q[n]; + for (const o of r) + o in t || + ct.push({ + instanceLocation: c, + keyword: "dependentRequired", + keywordLocation: e, + error: `Instance has "${n}" but does not have "${o}".`, + }); + } + } + if (void 0 !== N) + for (const e in N) { + const r = `${u}/dependentSchemas`; + if (e in t) { + const u = j(t, N[e], n, i, a, s, c, `${r}/${o(e)}`, f); + u.valid || + ct.push( + { + instanceLocation: c, + keyword: "dependentSchemas", + keywordLocation: r, + error: `Instance has "${e}" but does not match dependant schema.`, + }, + ...u.errors, + ); + } + } + if (void 0 !== T) { + const e = `${u}/dependencies`; + for (const r in T) + if (r in t) { + const u = T[r]; + if (Array.isArray(u)) + for (const n of u) + n in t || + ct.push({ + instanceLocation: c, + keyword: "dependencies", + keywordLocation: e, + error: `Instance has "${r}" but does not have "${n}".`, + }); + else { + const f = j(t, u, n, i, a, s, c, `${e}/${o(r)}`); + f.valid || + ct.push( + { + instanceLocation: c, + keyword: "dependencies", + keywordLocation: e, + error: `Instance has "${r}" but does not match dependant schema.`, + }, + ...f.errors, + ); + } + } + } + const r = Object.create(null); + let d = !1; + if (void 0 !== E) { + const e = `${u}/properties`; + for (const u in E) { + if (!(u in t)) continue; + const l = `${c}/${o(u)}`, + h = j(t[u], E[u], n, i, a, s, l, `${e}/${o(u)}`); + if (h.valid) f[u] = r[u] = !0; + else if ( + ((d = a), + ct.push( + { + instanceLocation: c, + keyword: "properties", + keywordLocation: e, + error: `Property "${u}" does not match schema.`, + }, + ...h.errors, + ), + d) + ) + break; + } + } + if (!d && void 0 !== S) { + const e = `${u}/patternProperties`; + for (const u in S) { + const l = new RegExp(u), + h = S[u]; + for (const p in t) { + if (!l.test(p)) continue; + const v = `${c}/${o(p)}`, + y = j(t[p], h, n, i, a, s, v, `${e}/${o(u)}`); + y.valid + ? (f[p] = r[p] = !0) + : ((d = a), + ct.push( + { + instanceLocation: c, + keyword: "patternProperties", + keywordLocation: e, + error: `Property "${p}" matches pattern "${u}" but does not match associated schema.`, + }, + ...y.errors, + )); + } + } + } + if (d || void 0 === C) { + if (!d && void 0 !== R) { + const e = `${u}/unevaluatedProperties`; + for (const r in t) + if (!f[r]) { + const u = `${c}/${o(r)}`, + d = j(t[r], R, n, i, a, s, u, e); + d.valid + ? (f[r] = !0) + : ct.push( + { + instanceLocation: c, + keyword: "unevaluatedProperties", + keywordLocation: e, + error: `Property "${r}" does not match unevaluated properties schema.`, + }, + ...d.errors, + ); + } + } + } else { + const e = `${u}/additionalProperties`; + for (const u in t) { + if (r[u]) continue; + const l = `${c}/${o(u)}`, + h = j(t[u], C, n, i, a, s, l, e); + h.valid + ? (f[u] = !0) + : ((d = a), + ct.push( + { + instanceLocation: c, + keyword: "additionalProperties", + keywordLocation: e, + error: `Property "${u}" does not match additional properties schema.`, + }, + ...h.errors, + )); + } + } + } else if ("array" === h) { + void 0 !== Y && + t.length > Y && + ct.push({ + instanceLocation: c, + keyword: "maxItems", + keywordLocation: `${u}/maxItems`, + error: `Array has too many items (${t.length} > ${Y}).`, + }), + void 0 !== K && + t.length < K && + ct.push({ + instanceLocation: c, + keyword: "minItems", + keywordLocation: `${u}/minItems`, + error: `Array has too few items (${t.length} < ${K}).`, + }); + const e = t.length; + let o = 0, + d = !1; + if (void 0 !== B) { + const r = `${u}/prefixItems`, + l = Math.min(B.length, e); + for (; o < l; o++) { + const e = j(t[o], B[o], n, i, a, s, `${c}/${o}`, `${r}/${o}`); + if ( + ((f[o] = !0), + !e.valid && + ((d = a), + ct.push( + { + instanceLocation: c, + keyword: "prefixItems", + keywordLocation: r, + error: "Items did not match schema.", + }, + ...e.errors, + ), + d)) + ) + break; + } + } + if (void 0 !== U) { + const r = `${u}/items`; + if (Array.isArray(U)) { + const u = Math.min(U.length, e); + for (; o < u; o++) { + const e = j(t[o], U[o], n, i, a, s, `${c}/${o}`, `${r}/${o}`); + if ( + ((f[o] = !0), + !e.valid && + ((d = a), + ct.push( + { + instanceLocation: c, + keyword: "items", + keywordLocation: r, + error: "Items did not match schema.", + }, + ...e.errors, + ), + d)) + ) + break; + } + } else + for (; o < e; o++) { + const e = j(t[o], U, n, i, a, s, `${c}/${o}`, r); + if ( + ((f[o] = !0), + !e.valid && + ((d = a), + ct.push( + { + instanceLocation: c, + keyword: "items", + keywordLocation: r, + error: "Items did not match schema.", + }, + ...e.errors, + ), + d)) + ) + break; + } + if (!d && void 0 !== V) { + const r = `${u}/additionalItems`; + for (; o < e; o++) { + const e = j(t[o], V, n, i, a, s, `${c}/${o}`, r); + (f[o] = !0), + e.valid || + ((d = a), + ct.push( + { + instanceLocation: c, + keyword: "additionalItems", + keywordLocation: r, + error: "Items did not match additional items schema.", + }, + ...e.errors, + )); + } + } + } + if (void 0 !== H) + if (0 === e && void 0 === J) + ct.push({ + instanceLocation: c, + keyword: "contains", + keywordLocation: `${u}/contains`, + error: "Array is empty. It must contain at least one item matching the schema.", + }); + else if (void 0 !== J && e < J) + ct.push({ + instanceLocation: c, + keyword: "minContains", + keywordLocation: `${u}/minContains`, + error: `Array has less items (${e}) than minContains (${J}).`, + }); + else { + const r = `${u}/contains`, + o = ct.length; + let d = 0; + for (let o = 0; o < e; o++) { + const e = j(t[o], H, n, i, a, s, `${c}/${o}`, r); + e.valid ? ((f[o] = !0), d++) : ct.push(...e.errors); + } + d >= (J || 0) && (ct.length = o), + void 0 === J && void 0 === W && 0 === d + ? ct.splice(o, 0, { + instanceLocation: c, + keyword: "contains", + keywordLocation: r, + error: "Array does not contain item matching schema.", + }) + : void 0 !== J && d < J + ? ct.push({ + instanceLocation: c, + keyword: "minContains", + keywordLocation: `${u}/minContains`, + error: `Array must contain at least ${J} items matching schema. Only ${d} items were found.`, + }) + : void 0 !== W && + d > W && + ct.push({ + instanceLocation: c, + keyword: "maxContains", + keywordLocation: `${u}/maxContains`, + error: `Array may contain at most ${W} items matching schema. ${d} items were found.`, + }); + } + if (!d && void 0 !== G) { + const r = `${u}/unevaluatedItems`; + for (; o < e; o++) { + if (f[o]) continue; + const e = j(t[o], G, n, i, a, s, `${c}/${o}`, r); + (f[o] = !0), + e.valid || + ct.push( + { + instanceLocation: c, + keyword: "unevaluatedItems", + keywordLocation: r, + error: "Items did not match unevaluated items schema.", + }, + ...e.errors, + ); + } + } + if (X) + for (let n = 0; n < e; n++) { + const o = t[n], + i = "object" == typeof o && null !== o; + for (let a = 0; a < e; a++) { + if (n === a) continue; + const e = t[a]; + (o === e || (i && "object" == typeof e && null !== e && r(o, e))) && + (ct.push({ + instanceLocation: c, + keyword: "uniqueItems", + keywordLocation: `${u}/uniqueItems`, + error: `Duplicate items at indexes ${n} and ${a}.`, + }), + (n = Number.MAX_SAFE_INTEGER), + (a = Number.MAX_SAFE_INTEGER)); + } + } + } else if ("number" === h) { + if ( + ("4" === n + ? (void 0 !== Z && + ((!0 === tt && t <= Z) || t < Z) && + ct.push({ + instanceLocation: c, + keyword: "minimum", + keywordLocation: `${u}/minimum`, + error: `${t} is less than ${tt ? "or equal to " : ""} ${Z}.`, + }), + void 0 !== Q && + ((!0 === et && t >= Q) || t > Q) && + ct.push({ + instanceLocation: c, + keyword: "maximum", + keywordLocation: `${u}/maximum`, + error: `${t} is greater than ${et ? "or equal to " : ""} ${Q}.`, + })) + : (void 0 !== Z && + t < Z && + ct.push({ + instanceLocation: c, + keyword: "minimum", + keywordLocation: `${u}/minimum`, + error: `${t} is less than ${Z}.`, + }), + void 0 !== Q && + t > Q && + ct.push({ + instanceLocation: c, + keyword: "maximum", + keywordLocation: `${u}/maximum`, + error: `${t} is greater than ${Q}.`, + }), + void 0 !== tt && + t <= tt && + ct.push({ + instanceLocation: c, + keyword: "exclusiveMinimum", + keywordLocation: `${u}/exclusiveMinimum`, + error: `${t} is less than ${tt}.`, + }), + void 0 !== et && + t >= et && + ct.push({ + instanceLocation: c, + keyword: "exclusiveMaximum", + keywordLocation: `${u}/exclusiveMaximum`, + error: `${t} is greater than or equal to ${et}.`, + })), + void 0 !== nt) + ) { + const e = t % nt; + Math.abs(0 - e) >= 1.1920929e-7 && + Math.abs(nt - e) >= 1.1920929e-7 && + ct.push({ + instanceLocation: c, + keyword: "multipleOf", + keywordLocation: `${u}/multipleOf`, + error: `${t} is not a multiple of ${nt}.`, + }); + } + } else if ("string" === h) { + const e = void 0 === rt && void 0 === ot ? 0 : k(t); + void 0 !== rt && + e < rt && + ct.push({ + instanceLocation: c, + keyword: "minLength", + keywordLocation: `${u}/minLength`, + error: `String is too short (${e} < ${rt}).`, + }), + void 0 !== ot && + e > ot && + ct.push({ + instanceLocation: c, + keyword: "maxLength", + keywordLocation: `${u}/maxLength`, + error: `String is too long (${e} > ${ot}).`, + }), + void 0 === it || + new RegExp(it).test(t) || + ct.push({ + instanceLocation: c, + keyword: "pattern", + keywordLocation: `${u}/pattern`, + error: "String does not match pattern.", + }), + void 0 !== P && + m[P] && + !m[P](t) && + ct.push({ + instanceLocation: c, + keyword: "format", + keywordLocation: `${u}/format`, + error: `String does not match format "${P}".`, + }); + } + return { valid: 0 === ct.length, errors: ct }; + } + class L { + constructor(t, e = "2019-09", n = !0) { + (this.schema = t), (this.draft = e), (this.shortCircuit = n), (this.lookup = d(t)); + } + validate(t) { + return j(t, this.schema, this.draft, this.lookup, this.shortCircuit); + } + addSchema(t, e) { + e && (t = { ...t, $id: e }), d(t, this.lookup); + } + } + }, + }, + e = {}; + function n(r) { + var o = e[r]; + if (void 0 !== o) return o.exports; + var i = (e[r] = { id: r, loaded: !1, exports: {} }); + return t[r].call(i.exports, i, i.exports, n), (i.loaded = !0), i.exports; + } + (n.d = function (t, e) { + for (var r in e) n.o(e, r) && !n.o(t, r) && Object.defineProperty(t, r, { enumerable: !0, get: e[r] }); + }), + (n.g = (function () { + if ("object" == typeof globalThis) return globalThis; + try { + return this || new Function("return this")(); + } catch (t) { + if ("object" == typeof window) return window; + } + })()), + (n.o = function (t, e) { + return Object.prototype.hasOwnProperty.call(t, e); + }), + (n.r = function (t) { + "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), + Object.defineProperty(t, "__esModule", { value: !0 }); + }), + (n.nmd = function (t) { + return (t.paths = []), t.children || (t.children = []), t; + }), + (function () { + const t = n(7739), + e = n(9138), + { FlexSearch: r } = n(3129), + { Validator: o } = n(9707); + function i(t, e) { + t.removeEventListener("focus", i); + const n = e.indexConfig ? e.indexConfig : { tokenize: "forward" }, + o = e.dataFile; + n.document = { + key: "id", + index: ["title", "content", "description"], + store: ["title", "href", "parent", "description"], + }; + const a = new r.Document(n); + (window.geekdocSearchIndex = a), + c(o, function (t) { + t.forEach((t) => { + window.geekdocSearchIndex.add(t); + }); + }); + } + function a(t, n, r) { + const o = []; + for (const i of t) { + const t = document.createElement("li"), + a = t.appendChild(document.createElement("a")), + s = a.appendChild(document.createElement("span")); + if ( + ((a.href = i.href), + s.classList.add("gdoc-search__entry--title"), + (s.textContent = i.title), + a.classList.add("gdoc-search__entry"), + !0 === r) + ) { + const t = a.appendChild(document.createElement("span")); + t.classList.add("gdoc-search__entry--description"), (t.textContent = e(i.description, { length: 55, separator: " " })); + } + n ? n.appendChild(t) : o.push(t); + } + return o; + } + function s(t) { + if (!t.ok) throw Error("Failed to fetch '" + t.url + "': " + t.statusText); + return t; + } + function c(t, e) { + fetch(t) + .then(s) + .then((t) => t.json()) + .then((t) => e(t)) + .catch(function (t) { + t instanceof AggregateError + ? (console.error(t.message), + t.errors.forEach((t) => { + console.error(t); + })) + : console.error(t); + }); + } + document.addEventListener("DOMContentLoaded", function (e) { + const n = document.querySelector("#gdoc-search-input"), + r = document.querySelector("#gdoc-search-results"), + s = ((u = n ? n.dataset.siteBaseUrl : ""), ((f = document.createElement("a")).href = u), f.pathname); + var u, f; + const d = n ? n.dataset.siteLang : "", + l = new o({ + type: "object", + properties: { + dataFile: { type: "string" }, + indexConfig: { type: ["object", "null"] }, + showParent: { type: "boolean" }, + showDescription: { type: "boolean" }, + }, + additionalProperties: !1, + }); + var h, p; + n && + c(((h = s), (p = "/search/" + d + ".config.min.json") ? h.replace(/\/+$/, "") + "/" + p.replace(/^\/+/, "") : h), function (e) { + const o = l.validate(e); + if (!o.valid) + throw AggregateError( + o.errors.map((t) => new Error("Validation error: " + t.error)), + "Schema validation failed", + ); + n && + (n.addEventListener("focus", () => { + i(n, e); + }), + n.addEventListener("keyup", () => { + !(function (e, n, r) { + for (; n.firstChild; ) n.removeChild(n.firstChild); + if (!e.value) return n.classList.remove("has-hits"); + let o = (function (t) { + const e = [], + n = new Map(); + for (const r of t) for (const t of r.result) n.has(t.doc.href) || (n.set(t.doc.href, !0), e.push(t.doc)); + return e; + })(window.geekdocSearchIndex.search(e.value, { enrich: !0, limit: 5 })); + if (o.length < 1) return n.classList.remove("has-hits"); + n.classList.add("has-hits"), !0 === r.showParent && (o = t(o, (t) => t.parent)); + const i = []; + if (!0 === r.showParent) + for (const t in o) { + const e = document.createElement("li"), + n = e.appendChild(document.createElement("span")), + s = e.appendChild(document.createElement("ul")); + t || n.remove(), n.classList.add("gdoc-search__section"), (n.textContent = t), a(o[t], s, r.showDescription), i.push(e); + } + else { + const t = document.createElement("li"), + e = t.appendChild(document.createElement("span")), + n = t.appendChild(document.createElement("ul")); + (e.textContent = "Results"), a(o, n, r.showDescription), i.push(t); + } + i.forEach((t) => { + n.appendChild(t); + }); + })(n, r, e); + })); + }); + }); + })(); +})(); diff --git a/docs/themes/hugo-geekdoc/static/js/search-9719be99.bundle.min.js.LICENSE.txt b/docs/themes/hugo-geekdoc/static/js/search-9719be99.bundle.min.js.LICENSE.txt new file mode 100644 index 000000000..1c041611b --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/js/search-9719be99.bundle.min.js.LICENSE.txt @@ -0,0 +1,7 @@ +/**! + * FlexSearch.js v0.7.31 (Compact) + * Copyright 2018-2022 Nextapps GmbH + * Author: Thomas Wilkerling + * Licence: Apache-2.0 + * https://github.com/nextapps-de/flexsearch + */ diff --git a/docs/themes/hugo-geekdoc/static/katex-66092164.min.css b/docs/themes/hugo-geekdoc/static/katex-66092164.min.css new file mode 100644 index 000000000..ec20ebe3b --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/katex-66092164.min.css @@ -0,0 +1 @@ +@font-face{font-family:"KaTeX_AMS";src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff"),url(fonts/KaTeX_AMS-Regular.ttf) format("truetype");font-weight:normal;font-style:normal}@font-face{font-family:"KaTeX_Caligraphic";src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype");font-weight:bold;font-style:normal}@font-face{font-family:"KaTeX_Caligraphic";src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype");font-weight:normal;font-style:normal}@font-face{font-family:"KaTeX_Fraktur";src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff"),url(fonts/KaTeX_Fraktur-Bold.ttf) format("truetype");font-weight:bold;font-style:normal}@font-face{font-family:"KaTeX_Fraktur";src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff"),url(fonts/KaTeX_Fraktur-Regular.ttf) format("truetype");font-weight:normal;font-style:normal}@font-face{font-family:"KaTeX_Main";src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff"),url(fonts/KaTeX_Main-Bold.ttf) format("truetype");font-weight:bold;font-style:normal}@font-face{font-family:"KaTeX_Main";src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Main-BoldItalic.ttf) format("truetype");font-weight:bold;font-style:italic}@font-face{font-family:"KaTeX_Main";src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff"),url(fonts/KaTeX_Main-Italic.ttf) format("truetype");font-weight:normal;font-style:italic}@font-face{font-family:"KaTeX_Main";src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff"),url(fonts/KaTeX_Main-Regular.ttf) format("truetype");font-weight:normal;font-style:normal}@font-face{font-family:"KaTeX_Math";src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Math-BoldItalic.ttf) format("truetype");font-weight:bold;font-style:italic}@font-face{font-family:"KaTeX_Math";src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff"),url(fonts/KaTeX_Math-Italic.ttf) format("truetype");font-weight:normal;font-style:italic}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff"),url(fonts/KaTeX_SansSerif-Bold.ttf) format("truetype");font-weight:bold;font-style:normal}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff"),url(fonts/KaTeX_SansSerif-Italic.ttf) format("truetype");font-weight:normal;font-style:italic}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff"),url(fonts/KaTeX_SansSerif-Regular.ttf) format("truetype");font-weight:normal;font-style:normal}@font-face{font-family:"KaTeX_Script";src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff"),url(fonts/KaTeX_Script-Regular.ttf) format("truetype");font-weight:normal;font-style:normal}@font-face{font-family:"KaTeX_Size1";src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff"),url(fonts/KaTeX_Size1-Regular.ttf) format("truetype");font-weight:normal;font-style:normal}@font-face{font-family:"KaTeX_Size2";src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff"),url(fonts/KaTeX_Size2-Regular.ttf) format("truetype");font-weight:normal;font-style:normal}@font-face{font-family:"KaTeX_Size3";src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff"),url(fonts/KaTeX_Size3-Regular.ttf) format("truetype");font-weight:normal;font-style:normal}@font-face{font-family:"KaTeX_Size4";src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff"),url(fonts/KaTeX_Size4-Regular.ttf) format("truetype");font-weight:normal;font-style:normal}@font-face{font-family:"KaTeX_Typewriter";src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff"),url(fonts/KaTeX_Typewriter-Regular.ttf) format("truetype");font-weight:normal;font-style:normal}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none !important}.katex *{border-color:currentColor}.katex .katex-version::after{content:"0.16.8"}.katex .katex-mathml{position:absolute;clip:rect(1px, 1px, 1px, 1px);padding:0;border:0;height:1px;width:1px;overflow:hidden}.katex .katex-html>.newline{display:block}.katex .base{position:relative;display:inline-block;white-space:nowrap;width:-moz-min-content;width:min-content}.katex .strut{display:inline-block}.katex .textbf{font-weight:bold}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:bold}.katex .boldsymbol{font-family:KaTeX_Math;font-weight:bold;font-style:italic}.katex .amsrm{font-family:KaTeX_AMS}.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:bold}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{display:inline-table;table-layout:fixed;border-collapse:collapse}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;vertical-align:bottom;position:relative}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;vertical-align:bottom;font-size:1px;width:2px;min-width:2px}.katex .vbox{display:inline-flex;flex-direction:column;align-items:baseline}.katex .hbox{display:inline-flex;flex-direction:row;width:100%}.katex .thinbox{display:inline-flex;flex-direction:row;width:0;max-width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{display:inline-block;width:100%;border-bottom-style:solid}.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .underline .underline-line,.katex .hline,.katex .hdashline,.katex .rule{min-height:1px}.katex .mspace{display:inline-block}.katex .llap,.katex .rlap,.katex .clap{width:0;position:relative}.katex .llap>.inner,.katex .rlap>.inner,.katex .clap>.inner{position:absolute}.katex .llap>.fix,.katex .rlap>.fix,.katex .clap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .rlap>.inner,.katex .clap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{display:inline-block;border:solid 0;position:relative}.katex .overline .overline-line,.katex .underline .underline-line,.katex .hline{display:inline-block;width:100%;border-bottom-style:solid}.katex .hdashline{display:inline-block;width:100%;border-bottom-style:dashed}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-0.55555556em}.katex .sizing.reset-size1.size1,.katex .fontsize-ensurer.reset-size1.size1{font-size:1em}.katex .sizing.reset-size1.size2,.katex .fontsize-ensurer.reset-size1.size2{font-size:1.2em}.katex .sizing.reset-size1.size3,.katex .fontsize-ensurer.reset-size1.size3{font-size:1.4em}.katex .sizing.reset-size1.size4,.katex .fontsize-ensurer.reset-size1.size4{font-size:1.6em}.katex .sizing.reset-size1.size5,.katex .fontsize-ensurer.reset-size1.size5{font-size:1.8em}.katex .sizing.reset-size1.size6,.katex .fontsize-ensurer.reset-size1.size6{font-size:2em}.katex .sizing.reset-size1.size7,.katex .fontsize-ensurer.reset-size1.size7{font-size:2.4em}.katex .sizing.reset-size1.size8,.katex .fontsize-ensurer.reset-size1.size8{font-size:2.88em}.katex .sizing.reset-size1.size9,.katex .fontsize-ensurer.reset-size1.size9{font-size:3.456em}.katex .sizing.reset-size1.size10,.katex .fontsize-ensurer.reset-size1.size10{font-size:4.148em}.katex .sizing.reset-size1.size11,.katex .fontsize-ensurer.reset-size1.size11{font-size:4.976em}.katex .sizing.reset-size2.size1,.katex .fontsize-ensurer.reset-size2.size1{font-size:.83333333em}.katex .sizing.reset-size2.size2,.katex .fontsize-ensurer.reset-size2.size2{font-size:1em}.katex .sizing.reset-size2.size3,.katex .fontsize-ensurer.reset-size2.size3{font-size:1.16666667em}.katex .sizing.reset-size2.size4,.katex .fontsize-ensurer.reset-size2.size4{font-size:1.33333333em}.katex .sizing.reset-size2.size5,.katex .fontsize-ensurer.reset-size2.size5{font-size:1.5em}.katex .sizing.reset-size2.size6,.katex .fontsize-ensurer.reset-size2.size6{font-size:1.66666667em}.katex .sizing.reset-size2.size7,.katex .fontsize-ensurer.reset-size2.size7{font-size:2em}.katex .sizing.reset-size2.size8,.katex .fontsize-ensurer.reset-size2.size8{font-size:2.4em}.katex .sizing.reset-size2.size9,.katex .fontsize-ensurer.reset-size2.size9{font-size:2.88em}.katex .sizing.reset-size2.size10,.katex .fontsize-ensurer.reset-size2.size10{font-size:3.45666667em}.katex .sizing.reset-size2.size11,.katex .fontsize-ensurer.reset-size2.size11{font-size:4.14666667em}.katex .sizing.reset-size3.size1,.katex .fontsize-ensurer.reset-size3.size1{font-size:.71428571em}.katex .sizing.reset-size3.size2,.katex .fontsize-ensurer.reset-size3.size2{font-size:.85714286em}.katex .sizing.reset-size3.size3,.katex .fontsize-ensurer.reset-size3.size3{font-size:1em}.katex .sizing.reset-size3.size4,.katex .fontsize-ensurer.reset-size3.size4{font-size:1.14285714em}.katex .sizing.reset-size3.size5,.katex .fontsize-ensurer.reset-size3.size5{font-size:1.28571429em}.katex .sizing.reset-size3.size6,.katex .fontsize-ensurer.reset-size3.size6{font-size:1.42857143em}.katex .sizing.reset-size3.size7,.katex .fontsize-ensurer.reset-size3.size7{font-size:1.71428571em}.katex .sizing.reset-size3.size8,.katex .fontsize-ensurer.reset-size3.size8{font-size:2.05714286em}.katex .sizing.reset-size3.size9,.katex .fontsize-ensurer.reset-size3.size9{font-size:2.46857143em}.katex .sizing.reset-size3.size10,.katex .fontsize-ensurer.reset-size3.size10{font-size:2.96285714em}.katex .sizing.reset-size3.size11,.katex .fontsize-ensurer.reset-size3.size11{font-size:3.55428571em}.katex .sizing.reset-size4.size1,.katex .fontsize-ensurer.reset-size4.size1{font-size:.625em}.katex .sizing.reset-size4.size2,.katex .fontsize-ensurer.reset-size4.size2{font-size:.75em}.katex .sizing.reset-size4.size3,.katex .fontsize-ensurer.reset-size4.size3{font-size:.875em}.katex .sizing.reset-size4.size4,.katex .fontsize-ensurer.reset-size4.size4{font-size:1em}.katex .sizing.reset-size4.size5,.katex .fontsize-ensurer.reset-size4.size5{font-size:1.125em}.katex .sizing.reset-size4.size6,.katex .fontsize-ensurer.reset-size4.size6{font-size:1.25em}.katex .sizing.reset-size4.size7,.katex .fontsize-ensurer.reset-size4.size7{font-size:1.5em}.katex .sizing.reset-size4.size8,.katex .fontsize-ensurer.reset-size4.size8{font-size:1.8em}.katex .sizing.reset-size4.size9,.katex .fontsize-ensurer.reset-size4.size9{font-size:2.16em}.katex .sizing.reset-size4.size10,.katex .fontsize-ensurer.reset-size4.size10{font-size:2.5925em}.katex .sizing.reset-size4.size11,.katex .fontsize-ensurer.reset-size4.size11{font-size:3.11em}.katex .sizing.reset-size5.size1,.katex .fontsize-ensurer.reset-size5.size1{font-size:.55555556em}.katex .sizing.reset-size5.size2,.katex .fontsize-ensurer.reset-size5.size2{font-size:.66666667em}.katex .sizing.reset-size5.size3,.katex .fontsize-ensurer.reset-size5.size3{font-size:.77777778em}.katex .sizing.reset-size5.size4,.katex .fontsize-ensurer.reset-size5.size4{font-size:.88888889em}.katex .sizing.reset-size5.size5,.katex .fontsize-ensurer.reset-size5.size5{font-size:1em}.katex .sizing.reset-size5.size6,.katex .fontsize-ensurer.reset-size5.size6{font-size:1.11111111em}.katex .sizing.reset-size5.size7,.katex .fontsize-ensurer.reset-size5.size7{font-size:1.33333333em}.katex .sizing.reset-size5.size8,.katex .fontsize-ensurer.reset-size5.size8{font-size:1.6em}.katex .sizing.reset-size5.size9,.katex .fontsize-ensurer.reset-size5.size9{font-size:1.92em}.katex .sizing.reset-size5.size10,.katex .fontsize-ensurer.reset-size5.size10{font-size:2.30444444em}.katex .sizing.reset-size5.size11,.katex .fontsize-ensurer.reset-size5.size11{font-size:2.76444444em}.katex .sizing.reset-size6.size1,.katex .fontsize-ensurer.reset-size6.size1{font-size:.5em}.katex .sizing.reset-size6.size2,.katex .fontsize-ensurer.reset-size6.size2{font-size:.6em}.katex .sizing.reset-size6.size3,.katex .fontsize-ensurer.reset-size6.size3{font-size:.7em}.katex .sizing.reset-size6.size4,.katex .fontsize-ensurer.reset-size6.size4{font-size:.8em}.katex .sizing.reset-size6.size5,.katex .fontsize-ensurer.reset-size6.size5{font-size:.9em}.katex .sizing.reset-size6.size6,.katex .fontsize-ensurer.reset-size6.size6{font-size:1em}.katex .sizing.reset-size6.size7,.katex .fontsize-ensurer.reset-size6.size7{font-size:1.2em}.katex .sizing.reset-size6.size8,.katex .fontsize-ensurer.reset-size6.size8{font-size:1.44em}.katex .sizing.reset-size6.size9,.katex .fontsize-ensurer.reset-size6.size9{font-size:1.728em}.katex .sizing.reset-size6.size10,.katex .fontsize-ensurer.reset-size6.size10{font-size:2.074em}.katex .sizing.reset-size6.size11,.katex .fontsize-ensurer.reset-size6.size11{font-size:2.488em}.katex .sizing.reset-size7.size1,.katex .fontsize-ensurer.reset-size7.size1{font-size:.41666667em}.katex .sizing.reset-size7.size2,.katex .fontsize-ensurer.reset-size7.size2{font-size:.5em}.katex .sizing.reset-size7.size3,.katex .fontsize-ensurer.reset-size7.size3{font-size:.58333333em}.katex .sizing.reset-size7.size4,.katex .fontsize-ensurer.reset-size7.size4{font-size:.66666667em}.katex .sizing.reset-size7.size5,.katex .fontsize-ensurer.reset-size7.size5{font-size:.75em}.katex .sizing.reset-size7.size6,.katex .fontsize-ensurer.reset-size7.size6{font-size:.83333333em}.katex .sizing.reset-size7.size7,.katex .fontsize-ensurer.reset-size7.size7{font-size:1em}.katex .sizing.reset-size7.size8,.katex .fontsize-ensurer.reset-size7.size8{font-size:1.2em}.katex .sizing.reset-size7.size9,.katex .fontsize-ensurer.reset-size7.size9{font-size:1.44em}.katex .sizing.reset-size7.size10,.katex .fontsize-ensurer.reset-size7.size10{font-size:1.72833333em}.katex .sizing.reset-size7.size11,.katex .fontsize-ensurer.reset-size7.size11{font-size:2.07333333em}.katex .sizing.reset-size8.size1,.katex .fontsize-ensurer.reset-size8.size1{font-size:.34722222em}.katex .sizing.reset-size8.size2,.katex .fontsize-ensurer.reset-size8.size2{font-size:.41666667em}.katex .sizing.reset-size8.size3,.katex .fontsize-ensurer.reset-size8.size3{font-size:.48611111em}.katex .sizing.reset-size8.size4,.katex .fontsize-ensurer.reset-size8.size4{font-size:.55555556em}.katex .sizing.reset-size8.size5,.katex .fontsize-ensurer.reset-size8.size5{font-size:.625em}.katex .sizing.reset-size8.size6,.katex .fontsize-ensurer.reset-size8.size6{font-size:.69444444em}.katex .sizing.reset-size8.size7,.katex .fontsize-ensurer.reset-size8.size7{font-size:.83333333em}.katex .sizing.reset-size8.size8,.katex .fontsize-ensurer.reset-size8.size8{font-size:1em}.katex .sizing.reset-size8.size9,.katex .fontsize-ensurer.reset-size8.size9{font-size:1.2em}.katex .sizing.reset-size8.size10,.katex .fontsize-ensurer.reset-size8.size10{font-size:1.44027778em}.katex .sizing.reset-size8.size11,.katex .fontsize-ensurer.reset-size8.size11{font-size:1.72777778em}.katex .sizing.reset-size9.size1,.katex .fontsize-ensurer.reset-size9.size1{font-size:.28935185em}.katex .sizing.reset-size9.size2,.katex .fontsize-ensurer.reset-size9.size2{font-size:.34722222em}.katex .sizing.reset-size9.size3,.katex .fontsize-ensurer.reset-size9.size3{font-size:.40509259em}.katex .sizing.reset-size9.size4,.katex .fontsize-ensurer.reset-size9.size4{font-size:.46296296em}.katex .sizing.reset-size9.size5,.katex .fontsize-ensurer.reset-size9.size5{font-size:.52083333em}.katex .sizing.reset-size9.size6,.katex .fontsize-ensurer.reset-size9.size6{font-size:.5787037em}.katex .sizing.reset-size9.size7,.katex .fontsize-ensurer.reset-size9.size7{font-size:.69444444em}.katex .sizing.reset-size9.size8,.katex .fontsize-ensurer.reset-size9.size8{font-size:.83333333em}.katex .sizing.reset-size9.size9,.katex .fontsize-ensurer.reset-size9.size9{font-size:1em}.katex .sizing.reset-size9.size10,.katex .fontsize-ensurer.reset-size9.size10{font-size:1.20023148em}.katex .sizing.reset-size9.size11,.katex .fontsize-ensurer.reset-size9.size11{font-size:1.43981481em}.katex .sizing.reset-size10.size1,.katex .fontsize-ensurer.reset-size10.size1{font-size:.24108004em}.katex .sizing.reset-size10.size2,.katex .fontsize-ensurer.reset-size10.size2{font-size:.28929605em}.katex .sizing.reset-size10.size3,.katex .fontsize-ensurer.reset-size10.size3{font-size:.33751205em}.katex .sizing.reset-size10.size4,.katex .fontsize-ensurer.reset-size10.size4{font-size:.38572806em}.katex .sizing.reset-size10.size5,.katex .fontsize-ensurer.reset-size10.size5{font-size:.43394407em}.katex .sizing.reset-size10.size6,.katex .fontsize-ensurer.reset-size10.size6{font-size:.48216008em}.katex .sizing.reset-size10.size7,.katex .fontsize-ensurer.reset-size10.size7{font-size:.57859209em}.katex .sizing.reset-size10.size8,.katex .fontsize-ensurer.reset-size10.size8{font-size:.69431051em}.katex .sizing.reset-size10.size9,.katex .fontsize-ensurer.reset-size10.size9{font-size:.83317261em}.katex .sizing.reset-size10.size10,.katex .fontsize-ensurer.reset-size10.size10{font-size:1em}.katex .sizing.reset-size10.size11,.katex .fontsize-ensurer.reset-size10.size11{font-size:1.19961427em}.katex .sizing.reset-size11.size1,.katex .fontsize-ensurer.reset-size11.size1{font-size:.20096463em}.katex .sizing.reset-size11.size2,.katex .fontsize-ensurer.reset-size11.size2{font-size:.24115756em}.katex .sizing.reset-size11.size3,.katex .fontsize-ensurer.reset-size11.size3{font-size:.28135048em}.katex .sizing.reset-size11.size4,.katex .fontsize-ensurer.reset-size11.size4{font-size:.32154341em}.katex .sizing.reset-size11.size5,.katex .fontsize-ensurer.reset-size11.size5{font-size:.36173633em}.katex .sizing.reset-size11.size6,.katex .fontsize-ensurer.reset-size11.size6{font-size:.40192926em}.katex .sizing.reset-size11.size7,.katex .fontsize-ensurer.reset-size11.size7{font-size:.48231511em}.katex .sizing.reset-size11.size8,.katex .fontsize-ensurer.reset-size11.size8{font-size:.57877814em}.katex .sizing.reset-size11.size9,.katex .fontsize-ensurer.reset-size11.size9{font-size:.69453376em}.katex .sizing.reset-size11.size10,.katex .fontsize-ensurer.reset-size11.size10{font-size:.83360129em}.katex .sizing.reset-size11.size11,.katex .fontsize-ensurer.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter{position:relative}.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .op-limits>.vlist-t{text-align:center}.katex .accent>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{display:block;position:absolute;width:100%;height:inherit;fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex svg path{stroke:none}.katex img{border-style:none;min-width:0;min-height:0;max-width:none;max-height:none}.katex .stretchy{width:100%;display:block;position:relative;overflow:hidden}.katex .stretchy::before,.katex .stretchy::after{content:""}.katex .hide-tail{width:100%;position:relative;overflow:hidden}.katex .halfarrow-left{position:absolute;left:0;width:50.2%;overflow:hidden}.katex .halfarrow-right{position:absolute;right:0;width:50.2%;overflow:hidden}.katex .brace-left{position:absolute;left:0;width:25.1%;overflow:hidden}.katex .brace-center{position:absolute;left:25%;width:50%;overflow:hidden}.katex .brace-right{position:absolute;right:0;width:25.1%;overflow:hidden}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .x-arrow,.katex .mover,.katex .munder{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{box-sizing:border-box;border:.04em solid}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-0.2em;margin-right:-0.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{box-sizing:border-box;border-top:.049em solid;border-right:.049em solid;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num::before{counter-increment:katexEqnNo;content:"(" counter(katexEqnNo) ")"}.katex .mml-eqn-num::before{counter-increment:mmlEqnNo;content:"(" counter(mmlEqnNo) ")"}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;position:absolute;left:calc(50% + .3em);text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{text-align:left;padding-left:2em}body{counter-reset:katexEqnNo mmlEqnNo} \ No newline at end of file diff --git a/docs/themes/hugo-geekdoc/static/main-252d384c.min.css b/docs/themes/hugo-geekdoc/static/main-252d384c.min.css new file mode 100644 index 000000000..67aaa2047 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/main-252d384c.min.css @@ -0,0 +1 @@ +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0;line-height:1.2em}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.flex{display:flex}.flex-auto{flex:1 1 auto}.flex-25{flex:1 1 25%}.flex-inline{display:inline-flex}.flex-even{flex:1 1}.flex-wrap{flex-wrap:wrap}.flex-grid{flex-direction:column;border:1px solid var(--accent-color);border-radius:.15rem;background:var(--accent-color-lite)}.flex-gap{flex-wrap:wrap;gap:1rem}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.align-center{align-items:center}.mx-auto{margin:0 auto}.text-center{text-align:center}.text-right{text-align:right}.no-wrap{white-space:nowrap}.hidden{display:none !important}.svg-sprite{position:absolute;width:0;height:0;overflow:hidden}.table-wrap{overflow:auto;margin:1rem 0}.table-wrap>table{margin:0 !important}.badge-placeholder{display:inline-block;min-width:4rem}@font-face{font-family:"Liberation Sans";src:url("fonts/LiberationSans-Bold.woff2") format("woff2"),url("fonts/LiberationSans-Bold.woff") format("woff");font-weight:bold;font-style:normal;font-display:swap}@font-face{font-family:"Liberation Sans";src:url("fonts/LiberationSans-BoldItalic.woff2") format("woff2"),url("fonts/LiberationSans-BoldItalic.woff") format("woff");font-weight:bold;font-style:italic;font-display:swap}@font-face{font-family:"Liberation Sans";src:url("fonts/LiberationSans-Italic.woff2") format("woff2"),url("fonts/LiberationSans-Italic.woff") format("woff");font-weight:normal;font-style:italic;font-display:swap}@font-face{font-family:"Liberation Sans";src:url("fonts/LiberationSans.woff2") format("woff2"),url("fonts/LiberationSans.woff") format("woff");font-weight:normal;font-style:normal;font-display:swap}@font-face{font-family:"Liberation Mono";src:url("fonts/LiberationMono.woff2") format("woff2"),url("fonts/LiberationMono.woff") format("woff");font-weight:normal;font-style:normal;font-display:swap}@font-face{font-family:"Metropolis";src:url("fonts/Metropolis.woff2") format("woff2"),url("fonts/Metropolis.woff") format("woff");font-weight:normal;font-style:normal;font-display:swap}@font-face{font-family:"GeekdocIcons";src:url("fonts/GeekdocIcons.woff2") format("woff2"),url("fonts/GeekdocIcons.woff") format("woff");font-weight:normal;font-style:normal;font-display:swap}body{font-family:"Liberation Sans",sans-serif}code,.gdoc-error__title{font-family:"Liberation Mono",monospace}.gdoc-header{font-family:"Metropolis",sans-serif}:root,:root[color-theme=light]{--code-max-height: none;--header-background: rgb(32, 83, 117);--header-font-color: rgb(255, 255, 255);--body-background: white;--body-font-color: rgb(52, 58, 64);--mark-color: rgb(255, 171, 0);--button-background: #22597d;--button-border-color: rgb(32, 83, 117);--link-color: rgb(10, 83, 154);--link-color-visited: rgb(119, 73, 191);--hint-link-color: rgb(10, 83, 154);--hint-link-color-visited: rgb(119, 73, 191);--accent-color-dark: rgb(206, 212, 218);--accent-color: rgb(233, 236, 239);--accent-color-lite: rgb(248, 249, 250);--control-icons: #b2bac1;--footer-background: rgb(17, 43, 60);--footer-font-color: rgb(255, 255, 255);--footer-link-color: rgb(246, 107, 14);--footer-link-color-visited: rgb(246, 107, 14);--code-background: rgb(248, 249, 250);--code-accent-color: #e6eaed;--code-accent-color-lite: #f2f4f6;--code-font-color: rgb(70, 70, 70);--code-copy-background: rgb(248, 249, 250);--code-copy-font-color: #6c6c6c;--code-copy-border-color: #797979;--code-copy-success-color: rgb(0, 200, 83)}:root .dark-mode-dim .gdoc-markdown img,:root[color-theme=light] .dark-mode-dim .gdoc-markdown img{filter:none}:root .gdoc-markdown .gdoc-hint,:root .gdoc-markdown .gdoc-props__tag,:root .gdoc-markdown .admonitionblock,:root[color-theme=light] .gdoc-markdown .gdoc-hint,:root[color-theme=light] .gdoc-markdown .gdoc-props__tag,:root[color-theme=light] .gdoc-markdown .admonitionblock{filter:none}:root .gdoc-markdown .gdoc-hint__title,:root .gdoc-markdown .admonitionblock table td:first-child,:root[color-theme=light] .gdoc-markdown .gdoc-hint__title,:root[color-theme=light] .gdoc-markdown .admonitionblock table td:first-child{background-color:rgba(134,142,150,.05)}:root .chroma,:root[color-theme=light] .chroma{color:var(--code-font-color)}:root .chroma .lntable td:nth-child(2) code .hl,:root[color-theme=light] .chroma .lntable td:nth-child(2) code .hl{width:auto;margin-left:-0.5em;padding:0 .5em}:root .highlight pre.chroma,:root[color-theme=light] .highlight pre.chroma{width:100%;overflow:auto;max-height:var(--code-max-height)}:root .chroma .lntable,:root[color-theme=light] .chroma .lntable{border:1px solid var(--code-accent-color);border-radius:.15rem;border-spacing:0;padding:0;margin:0;width:100%;display:block;max-height:var(--code-max-height);overflow:auto}:root .chroma .lntable pre.chroma,:root[color-theme=light] .chroma .lntable pre.chroma{max-height:none;border-radius:0;margin:0}:root .chroma .lntable td:first-child code,:root[color-theme=light] .chroma .lntable td:first-child code{background-color:var(--code-accent-color-lite);border-right:1px solid var(--code-accent-color);padding-left:0;padding-right:0;border-radius:0}:root .chroma .lntable td:nth-child(2),:root[color-theme=light] .chroma .lntable td:nth-child(2){width:100%;margin-left:2rem}:root .chroma .x,:root[color-theme=light] .chroma .x{color:inherit}:root .chroma .err,:root[color-theme=light] .chroma .err{color:#a61717;background-color:#e3d2d2}:root .chroma .lntd,:root[color-theme=light] .chroma .lntd{vertical-align:top;padding:0;margin:0;border:0}:root .chroma .hl,:root[color-theme=light] .chroma .hl{display:block;width:100%;background-color:#ffc}:root .chroma .lnt,:root[color-theme=light] .chroma .lnt{padding:0 .8em}:root .chroma .ln,:root[color-theme=light] .chroma .ln{margin-right:.4em;padding:0 .4em 0 .4em}:root .chroma .k,:root[color-theme=light] .chroma .k{color:#000;font-weight:bold}:root .chroma .kc,:root[color-theme=light] .chroma .kc{color:#000;font-weight:bold}:root .chroma .kd,:root[color-theme=light] .chroma .kd{color:#000;font-weight:bold}:root .chroma .kn,:root[color-theme=light] .chroma .kn{color:#000;font-weight:bold}:root .chroma .kp,:root[color-theme=light] .chroma .kp{color:#000;font-weight:bold}:root .chroma .kr,:root[color-theme=light] .chroma .kr{color:#000;font-weight:bold}:root .chroma .kt,:root[color-theme=light] .chroma .kt{color:#458;font-weight:bold}:root .chroma .n,:root[color-theme=light] .chroma .n{color:inherit}:root .chroma .na,:root[color-theme=light] .chroma .na{color:#006767}:root .chroma .nb,:root[color-theme=light] .chroma .nb{color:#556165}:root .chroma .bp,:root[color-theme=light] .chroma .bp{color:#676767}:root .chroma .nc,:root[color-theme=light] .chroma .nc{color:#458;font-weight:bold}:root .chroma .no,:root[color-theme=light] .chroma .no{color:#006767}:root .chroma .nd,:root[color-theme=light] .chroma .nd{color:#3c5d5d;font-weight:bold}:root .chroma .ni,:root[color-theme=light] .chroma .ni{color:purple}:root .chroma .ne,:root[color-theme=light] .chroma .ne{color:#900;font-weight:bold}:root .chroma .nf,:root[color-theme=light] .chroma .nf{color:#900;font-weight:bold}:root .chroma .fm,:root[color-theme=light] .chroma .fm{color:inherit}:root .chroma .nl,:root[color-theme=light] .chroma .nl{color:#900;font-weight:bold}:root .chroma .nn,:root[color-theme=light] .chroma .nn{color:#555}:root .chroma .nx,:root[color-theme=light] .chroma .nx{color:inherit}:root .chroma .py,:root[color-theme=light] .chroma .py{color:inherit}:root .chroma .nt,:root[color-theme=light] .chroma .nt{color:navy}:root .chroma .nv,:root[color-theme=light] .chroma .nv{color:#006767}:root .chroma .vc,:root[color-theme=light] .chroma .vc{color:#006767}:root .chroma .vg,:root[color-theme=light] .chroma .vg{color:#006767}:root .chroma .vi,:root[color-theme=light] .chroma .vi{color:#006767}:root .chroma .vm,:root[color-theme=light] .chroma .vm{color:inherit}:root .chroma .l,:root[color-theme=light] .chroma .l{color:inherit}:root .chroma .ld,:root[color-theme=light] .chroma .ld{color:inherit}:root .chroma .s,:root[color-theme=light] .chroma .s{color:#d14}:root .chroma .sa,:root[color-theme=light] .chroma .sa{color:#d14}:root .chroma .sb,:root[color-theme=light] .chroma .sb{color:#d14}:root .chroma .sc,:root[color-theme=light] .chroma .sc{color:#d14}:root .chroma .dl,:root[color-theme=light] .chroma .dl{color:#d14}:root .chroma .sd,:root[color-theme=light] .chroma .sd{color:#d14}:root .chroma .s2,:root[color-theme=light] .chroma .s2{color:#d14}:root .chroma .se,:root[color-theme=light] .chroma .se{color:#d14}:root .chroma .sh,:root[color-theme=light] .chroma .sh{color:#d14}:root .chroma .si,:root[color-theme=light] .chroma .si{color:#d14}:root .chroma .sx,:root[color-theme=light] .chroma .sx{color:#d14}:root .chroma .sr,:root[color-theme=light] .chroma .sr{color:#009926}:root .chroma .s1,:root[color-theme=light] .chroma .s1{color:#d14}:root .chroma .ss,:root[color-theme=light] .chroma .ss{color:#990073}:root .chroma .m,:root[color-theme=light] .chroma .m{color:#027e83}:root .chroma .mb,:root[color-theme=light] .chroma .mb{color:#027e83}:root .chroma .mf,:root[color-theme=light] .chroma .mf{color:#027e83}:root .chroma .mh,:root[color-theme=light] .chroma .mh{color:#027e83}:root .chroma .mi,:root[color-theme=light] .chroma .mi{color:#027e83}:root .chroma .il,:root[color-theme=light] .chroma .il{color:#027e83}:root .chroma .mo,:root[color-theme=light] .chroma .mo{color:#027e83}:root .chroma .o,:root[color-theme=light] .chroma .o{color:#000;font-weight:bold}:root .chroma .ow,:root[color-theme=light] .chroma .ow{color:#000;font-weight:bold}:root .chroma .p,:root[color-theme=light] .chroma .p{color:inherit}:root .chroma .c,:root[color-theme=light] .chroma .c{color:#676765;font-style:italic}:root .chroma .ch,:root[color-theme=light] .chroma .ch{color:#676765;font-style:italic}:root .chroma .cm,:root[color-theme=light] .chroma .cm{color:#676765;font-style:italic}:root .chroma .c1,:root[color-theme=light] .chroma .c1{color:#676765;font-style:italic}:root .chroma .cs,:root[color-theme=light] .chroma .cs{color:#676767;font-weight:bold;font-style:italic}:root .chroma .cp,:root[color-theme=light] .chroma .cp{color:#676767;font-weight:bold;font-style:italic}:root .chroma .cpf,:root[color-theme=light] .chroma .cpf{color:#676767;font-weight:bold;font-style:italic}:root .chroma .g,:root[color-theme=light] .chroma .g{color:inherit}:root .chroma .gd,:root[color-theme=light] .chroma .gd{color:#000;background-color:#fdd}:root .chroma .ge,:root[color-theme=light] .chroma .ge{color:#000;font-style:italic}:root .chroma .gr,:root[color-theme=light] .chroma .gr{color:#a00}:root .chroma .gh,:root[color-theme=light] .chroma .gh{color:#676767}:root .chroma .gi,:root[color-theme=light] .chroma .gi{color:#000;background-color:#dfd}:root .chroma .go,:root[color-theme=light] .chroma .go{color:#6f6f6f}:root .chroma .gp,:root[color-theme=light] .chroma .gp{color:#555}:root .chroma .gs,:root[color-theme=light] .chroma .gs{font-weight:bold}:root .chroma .gu,:root[color-theme=light] .chroma .gu{color:#5f5f5f}:root .chroma .gt,:root[color-theme=light] .chroma .gt{color:#a00}:root .chroma .gl,:root[color-theme=light] .chroma .gl{text-decoration:underline}:root .chroma .w,:root[color-theme=light] .chroma .w{color:#bbb}@media(prefers-color-scheme: light){:root{--header-background: rgb(32, 83, 117);--header-font-color: rgb(255, 255, 255);--body-background: white;--body-font-color: rgb(52, 58, 64);--mark-color: rgb(255, 171, 0);--button-background: #22597d;--button-border-color: rgb(32, 83, 117);--link-color: rgb(10, 83, 154);--link-color-visited: rgb(119, 73, 191);--hint-link-color: rgb(10, 83, 154);--hint-link-color-visited: rgb(119, 73, 191);--accent-color-dark: rgb(206, 212, 218);--accent-color: rgb(233, 236, 239);--accent-color-lite: rgb(248, 249, 250);--control-icons: #b2bac1;--footer-background: rgb(17, 43, 60);--footer-font-color: rgb(255, 255, 255);--footer-link-color: rgb(246, 107, 14);--footer-link-color-visited: rgb(246, 107, 14);--code-background: rgb(248, 249, 250);--code-accent-color: #e6eaed;--code-accent-color-lite: #f2f4f6;--code-font-color: rgb(70, 70, 70);--code-copy-background: rgb(248, 249, 250);--code-copy-font-color: #6c6c6c;--code-copy-border-color: #797979;--code-copy-success-color: rgb(0, 200, 83)}:root .dark-mode-dim .gdoc-markdown img{filter:none}:root .gdoc-markdown .gdoc-hint,:root .gdoc-markdown .gdoc-props__tag,:root .gdoc-markdown .admonitionblock{filter:none}:root .gdoc-markdown .gdoc-hint__title,:root .gdoc-markdown .admonitionblock table td:first-child{background-color:rgba(134,142,150,.05)}:root .chroma{color:var(--code-font-color)}:root .chroma .lntable td:nth-child(2) code .hl{width:auto;margin-left:-0.5em;padding:0 .5em}:root .highlight pre.chroma{width:100%;overflow:auto;max-height:var(--code-max-height)}:root .chroma .lntable{border:1px solid var(--code-accent-color);border-radius:.15rem;border-spacing:0;padding:0;margin:0;width:100%;display:block;max-height:var(--code-max-height);overflow:auto}:root .chroma .lntable pre.chroma{max-height:none;border-radius:0;margin:0}:root .chroma .lntable td:first-child code{background-color:var(--code-accent-color-lite);border-right:1px solid var(--code-accent-color);padding-left:0;padding-right:0;border-radius:0}:root .chroma .lntable td:nth-child(2){width:100%;margin-left:2rem}:root .chroma .x{color:inherit}:root .chroma .err{color:#a61717;background-color:#e3d2d2}:root .chroma .lntd{vertical-align:top;padding:0;margin:0;border:0}:root .chroma .hl{display:block;width:100%;background-color:#ffc}:root .chroma .lnt{padding:0 .8em}:root .chroma .ln{margin-right:.4em;padding:0 .4em 0 .4em}:root .chroma .k{color:#000;font-weight:bold}:root .chroma .kc{color:#000;font-weight:bold}:root .chroma .kd{color:#000;font-weight:bold}:root .chroma .kn{color:#000;font-weight:bold}:root .chroma .kp{color:#000;font-weight:bold}:root .chroma .kr{color:#000;font-weight:bold}:root .chroma .kt{color:#458;font-weight:bold}:root .chroma .n{color:inherit}:root .chroma .na{color:#006767}:root .chroma .nb{color:#556165}:root .chroma .bp{color:#676767}:root .chroma .nc{color:#458;font-weight:bold}:root .chroma .no{color:#006767}:root .chroma .nd{color:#3c5d5d;font-weight:bold}:root .chroma .ni{color:purple}:root .chroma .ne{color:#900;font-weight:bold}:root .chroma .nf{color:#900;font-weight:bold}:root .chroma .fm{color:inherit}:root .chroma .nl{color:#900;font-weight:bold}:root .chroma .nn{color:#555}:root .chroma .nx{color:inherit}:root .chroma .py{color:inherit}:root .chroma .nt{color:navy}:root .chroma .nv{color:#006767}:root .chroma .vc{color:#006767}:root .chroma .vg{color:#006767}:root .chroma .vi{color:#006767}:root .chroma .vm{color:inherit}:root .chroma .l{color:inherit}:root .chroma .ld{color:inherit}:root .chroma .s{color:#d14}:root .chroma .sa{color:#d14}:root .chroma .sb{color:#d14}:root .chroma .sc{color:#d14}:root .chroma .dl{color:#d14}:root .chroma .sd{color:#d14}:root .chroma .s2{color:#d14}:root .chroma .se{color:#d14}:root .chroma .sh{color:#d14}:root .chroma .si{color:#d14}:root .chroma .sx{color:#d14}:root .chroma .sr{color:#009926}:root .chroma .s1{color:#d14}:root .chroma .ss{color:#990073}:root .chroma .m{color:#027e83}:root .chroma .mb{color:#027e83}:root .chroma .mf{color:#027e83}:root .chroma .mh{color:#027e83}:root .chroma .mi{color:#027e83}:root .chroma .il{color:#027e83}:root .chroma .mo{color:#027e83}:root .chroma .o{color:#000;font-weight:bold}:root .chroma .ow{color:#000;font-weight:bold}:root .chroma .p{color:inherit}:root .chroma .c{color:#676765;font-style:italic}:root .chroma .ch{color:#676765;font-style:italic}:root .chroma .cm{color:#676765;font-style:italic}:root .chroma .c1{color:#676765;font-style:italic}:root .chroma .cs{color:#676767;font-weight:bold;font-style:italic}:root .chroma .cp{color:#676767;font-weight:bold;font-style:italic}:root .chroma .cpf{color:#676767;font-weight:bold;font-style:italic}:root .chroma .g{color:inherit}:root .chroma .gd{color:#000;background-color:#fdd}:root .chroma .ge{color:#000;font-style:italic}:root .chroma .gr{color:#a00}:root .chroma .gh{color:#676767}:root .chroma .gi{color:#000;background-color:#dfd}:root .chroma .go{color:#6f6f6f}:root .chroma .gp{color:#555}:root .chroma .gs{font-weight:bold}:root .chroma .gu{color:#5f5f5f}:root .chroma .gt{color:#a00}:root .chroma .gl{text-decoration:underline}:root .chroma .w{color:#bbb}}:root[color-theme=dark]{--header-background: rgb(32, 83, 117);--header-font-color: rgb(255, 255, 255);--body-background: #29363e;--body-font-color: #c2cfd7;--mark-color: rgb(255, 171, 0);--button-background: #22597d;--button-border-color: rgb(32, 83, 117);--link-color: rgb(110, 168, 212);--link-color-visited: rgb(186, 142, 240);--hint-link-color: rgb(10, 83, 154);--hint-link-color-visited: rgb(119, 73, 191);--accent-color-dark: #192125;--accent-color: #212b32;--accent-color-lite: #253138;--control-icons: #b2bac1;--footer-background: rgb(17, 43, 60);--footer-font-color: rgb(255, 255, 255);--footer-link-color: rgb(246, 107, 14);--footer-link-color-visited: rgb(246, 107, 14);--code-background: #232e35;--code-accent-color: #1b2329;--code-accent-color-lite: #1f292f;--code-font-color: rgb(185, 185, 185);--code-copy-background: #232e35;--code-copy-font-color: #939393;--code-copy-border-color: #868686;--code-copy-success-color: rgba(0, 200, 83, 0.45)}:root[color-theme=dark] .dark-mode-dim .gdoc-markdown img{filter:brightness(0.75) grayscale(0.2)}:root[color-theme=dark] .gdoc-markdown .gdoc-hint,:root[color-theme=dark] .gdoc-markdown .gdoc-props__tag,:root[color-theme=dark] .gdoc-markdown .admonitionblock{filter:saturate(2.5) brightness(0.85)}:root[color-theme=dark] .gdoc-markdown .gdoc-hint a,:root[color-theme=dark] .gdoc-markdown .admonitionblock a{color:var(--hint-link-color)}:root[color-theme=dark] .gdoc-markdown .gdoc-hint a:visited,:root[color-theme=dark] .gdoc-markdown .admonitionblock a:visited{color:var(--hint-link-color-visited)}:root[color-theme=dark] .gdoc-markdown .gdoc-hint__title,:root[color-theme=dark] .gdoc-markdown .admonitionblock table td:first-child{background-color:rgba(134,142,150,.15)}:root[color-theme=dark] .chroma{color:var(--code-font-color)}:root[color-theme=dark] .chroma .lntable td:nth-child(2) code .hl{width:auto;margin-left:-0.5em;padding:0 .5em}:root[color-theme=dark] .highlight pre.chroma{width:100%;overflow:auto;max-height:var(--code-max-height)}:root[color-theme=dark] .chroma .lntable{border:1px solid var(--code-accent-color);border-radius:.15rem;border-spacing:0;padding:0;margin:0;width:100%;display:block;max-height:var(--code-max-height);overflow:auto}:root[color-theme=dark] .chroma .lntable pre.chroma{max-height:none;border-radius:0;margin:0}:root[color-theme=dark] .chroma .lntable td:first-child code{background-color:var(--code-accent-color-lite);border-right:1px solid var(--code-accent-color);padding-left:0;padding-right:0;border-radius:0}:root[color-theme=dark] .chroma .lntable td:nth-child(2){width:100%;margin-left:2rem}:root[color-theme=dark] .chroma .x{color:inherit}:root[color-theme=dark] .chroma .err{color:inherit}:root[color-theme=dark] .chroma .lntd{vertical-align:top;padding:0;margin:0;border:0}:root[color-theme=dark] .chroma .hl{display:block;width:100%;background-color:#4f1605}:root[color-theme=dark] .chroma .lnt{padding:0 .8em}:root[color-theme=dark] .chroma .ln{margin-right:.4em;padding:0 .4em 0 .4em;color:#b3b3b3}:root[color-theme=dark] .chroma .k{color:#ff79c6}:root[color-theme=dark] .chroma .kc{color:#ff79c6}:root[color-theme=dark] .chroma .kd{color:#8be9fd;font-style:italic}:root[color-theme=dark] .chroma .kn{color:#ff79c6}:root[color-theme=dark] .chroma .kp{color:#ff79c6}:root[color-theme=dark] .chroma .kr{color:#ff79c6}:root[color-theme=dark] .chroma .kt{color:#8be9fd}:root[color-theme=dark] .chroma .n{color:inherit}:root[color-theme=dark] .chroma .na{color:#50fa7b}:root[color-theme=dark] .chroma .nb{color:#8be9fd;font-style:italic}:root[color-theme=dark] .chroma .bp{color:inherit}:root[color-theme=dark] .chroma .nc{color:#50fa7b}:root[color-theme=dark] .chroma .no{color:inherit}:root[color-theme=dark] .chroma .nd{color:inherit}:root[color-theme=dark] .chroma .ni{color:inherit}:root[color-theme=dark] .chroma .ne{color:inherit}:root[color-theme=dark] .chroma .nf{color:#50fa7b}:root[color-theme=dark] .chroma .fm{color:inherit}:root[color-theme=dark] .chroma .nl{color:#8be9fd;font-style:italic}:root[color-theme=dark] .chroma .nn{color:inherit}:root[color-theme=dark] .chroma .nx{color:inherit}:root[color-theme=dark] .chroma .py{color:inherit}:root[color-theme=dark] .chroma .nt{color:#ff79c6}:root[color-theme=dark] .chroma .nv{color:#8be9fd;font-style:italic}:root[color-theme=dark] .chroma .vc{color:#8be9fd;font-style:italic}:root[color-theme=dark] .chroma .vg{color:#8be9fd;font-style:italic}:root[color-theme=dark] .chroma .vi{color:#8be9fd;font-style:italic}:root[color-theme=dark] .chroma .vm{color:inherit}:root[color-theme=dark] .chroma .l{color:inherit}:root[color-theme=dark] .chroma .ld{color:inherit}:root[color-theme=dark] .chroma .s{color:#f1fa8c}:root[color-theme=dark] .chroma .sa{color:#f1fa8c}:root[color-theme=dark] .chroma .sb{color:#f1fa8c}:root[color-theme=dark] .chroma .sc{color:#f1fa8c}:root[color-theme=dark] .chroma .dl{color:#f1fa8c}:root[color-theme=dark] .chroma .sd{color:#f1fa8c}:root[color-theme=dark] .chroma .s2{color:#f1fa8c}:root[color-theme=dark] .chroma .se{color:#f1fa8c}:root[color-theme=dark] .chroma .sh{color:#f1fa8c}:root[color-theme=dark] .chroma .si{color:#f1fa8c}:root[color-theme=dark] .chroma .sx{color:#f1fa8c}:root[color-theme=dark] .chroma .sr{color:#f1fa8c}:root[color-theme=dark] .chroma .s1{color:#f1fa8c}:root[color-theme=dark] .chroma .ss{color:#f1fa8c}:root[color-theme=dark] .chroma .m{color:#bd93f9}:root[color-theme=dark] .chroma .mb{color:#bd93f9}:root[color-theme=dark] .chroma .mf{color:#bd93f9}:root[color-theme=dark] .chroma .mh{color:#bd93f9}:root[color-theme=dark] .chroma .mi{color:#bd93f9}:root[color-theme=dark] .chroma .il{color:#bd93f9}:root[color-theme=dark] .chroma .mo{color:#bd93f9}:root[color-theme=dark] .chroma .o{color:#ff79c6}:root[color-theme=dark] .chroma .ow{color:#ff79c6}:root[color-theme=dark] .chroma .p{color:inherit}:root[color-theme=dark] .chroma .c{color:#96a6d8}:root[color-theme=dark] .chroma .ch{color:#96a6d8}:root[color-theme=dark] .chroma .cm{color:#96a6d8}:root[color-theme=dark] .chroma .c1{color:#96a6d8}:root[color-theme=dark] .chroma .cs{color:#96a6d8}:root[color-theme=dark] .chroma .cp{color:#ff79c6}:root[color-theme=dark] .chroma .cpf{color:#ff79c6}:root[color-theme=dark] .chroma .g{color:inherit}:root[color-theme=dark] .chroma .gd{color:#d98f90}:root[color-theme=dark] .chroma .ge{text-decoration:underline}:root[color-theme=dark] .chroma .gr{color:inherit}:root[color-theme=dark] .chroma .gh{font-weight:bold;color:inherit}:root[color-theme=dark] .chroma .gi{font-weight:bold}:root[color-theme=dark] .chroma .go{color:#8f9ea8}:root[color-theme=dark] .chroma .gp{color:inherit}:root[color-theme=dark] .chroma .gs{color:inherit}:root[color-theme=dark] .chroma .gu{font-weight:bold}:root[color-theme=dark] .chroma .gt{color:inherit}:root[color-theme=dark] .chroma .gl{text-decoration:underline}:root[color-theme=dark] .chroma .w{color:inherit}:root[code-theme=dark]{--code-background: #232e35;--code-accent-color: #1b2329;--code-accent-color-lite: #1f292f;--code-font-color: rgb(185, 185, 185);--code-copy-background: #232e35;--code-copy-font-color: #939393;--code-copy-border-color: #868686;--code-copy-success-color: rgba(0, 200, 83, 0.45)}:root[code-theme=dark] .chroma{color:var(--code-font-color)}:root[code-theme=dark] .chroma .lntable td:nth-child(2) code .hl{width:auto;margin-left:-0.5em;padding:0 .5em}:root[code-theme=dark] .highlight pre.chroma{width:100%;overflow:auto;max-height:var(--code-max-height)}:root[code-theme=dark] .chroma .lntable{border:1px solid var(--code-accent-color);border-radius:.15rem;border-spacing:0;padding:0;margin:0;width:100%;display:block;max-height:var(--code-max-height);overflow:auto}:root[code-theme=dark] .chroma .lntable pre.chroma{max-height:none;border-radius:0;margin:0}:root[code-theme=dark] .chroma .lntable td:first-child code{background-color:var(--code-accent-color-lite);border-right:1px solid var(--code-accent-color);padding-left:0;padding-right:0;border-radius:0}:root[code-theme=dark] .chroma .lntable td:nth-child(2){width:100%;margin-left:2rem}:root[code-theme=dark] .chroma .x{color:inherit}:root[code-theme=dark] .chroma .err{color:inherit}:root[code-theme=dark] .chroma .lntd{vertical-align:top;padding:0;margin:0;border:0}:root[code-theme=dark] .chroma .hl{display:block;width:100%;background-color:#4f1605}:root[code-theme=dark] .chroma .lnt{padding:0 .8em}:root[code-theme=dark] .chroma .ln{margin-right:.4em;padding:0 .4em 0 .4em;color:#b3b3b3}:root[code-theme=dark] .chroma .k{color:#ff79c6}:root[code-theme=dark] .chroma .kc{color:#ff79c6}:root[code-theme=dark] .chroma .kd{color:#8be9fd;font-style:italic}:root[code-theme=dark] .chroma .kn{color:#ff79c6}:root[code-theme=dark] .chroma .kp{color:#ff79c6}:root[code-theme=dark] .chroma .kr{color:#ff79c6}:root[code-theme=dark] .chroma .kt{color:#8be9fd}:root[code-theme=dark] .chroma .n{color:inherit}:root[code-theme=dark] .chroma .na{color:#50fa7b}:root[code-theme=dark] .chroma .nb{color:#8be9fd;font-style:italic}:root[code-theme=dark] .chroma .bp{color:inherit}:root[code-theme=dark] .chroma .nc{color:#50fa7b}:root[code-theme=dark] .chroma .no{color:inherit}:root[code-theme=dark] .chroma .nd{color:inherit}:root[code-theme=dark] .chroma .ni{color:inherit}:root[code-theme=dark] .chroma .ne{color:inherit}:root[code-theme=dark] .chroma .nf{color:#50fa7b}:root[code-theme=dark] .chroma .fm{color:inherit}:root[code-theme=dark] .chroma .nl{color:#8be9fd;font-style:italic}:root[code-theme=dark] .chroma .nn{color:inherit}:root[code-theme=dark] .chroma .nx{color:inherit}:root[code-theme=dark] .chroma .py{color:inherit}:root[code-theme=dark] .chroma .nt{color:#ff79c6}:root[code-theme=dark] .chroma .nv{color:#8be9fd;font-style:italic}:root[code-theme=dark] .chroma .vc{color:#8be9fd;font-style:italic}:root[code-theme=dark] .chroma .vg{color:#8be9fd;font-style:italic}:root[code-theme=dark] .chroma .vi{color:#8be9fd;font-style:italic}:root[code-theme=dark] .chroma .vm{color:inherit}:root[code-theme=dark] .chroma .l{color:inherit}:root[code-theme=dark] .chroma .ld{color:inherit}:root[code-theme=dark] .chroma .s{color:#f1fa8c}:root[code-theme=dark] .chroma .sa{color:#f1fa8c}:root[code-theme=dark] .chroma .sb{color:#f1fa8c}:root[code-theme=dark] .chroma .sc{color:#f1fa8c}:root[code-theme=dark] .chroma .dl{color:#f1fa8c}:root[code-theme=dark] .chroma .sd{color:#f1fa8c}:root[code-theme=dark] .chroma .s2{color:#f1fa8c}:root[code-theme=dark] .chroma .se{color:#f1fa8c}:root[code-theme=dark] .chroma .sh{color:#f1fa8c}:root[code-theme=dark] .chroma .si{color:#f1fa8c}:root[code-theme=dark] .chroma .sx{color:#f1fa8c}:root[code-theme=dark] .chroma .sr{color:#f1fa8c}:root[code-theme=dark] .chroma .s1{color:#f1fa8c}:root[code-theme=dark] .chroma .ss{color:#f1fa8c}:root[code-theme=dark] .chroma .m{color:#bd93f9}:root[code-theme=dark] .chroma .mb{color:#bd93f9}:root[code-theme=dark] .chroma .mf{color:#bd93f9}:root[code-theme=dark] .chroma .mh{color:#bd93f9}:root[code-theme=dark] .chroma .mi{color:#bd93f9}:root[code-theme=dark] .chroma .il{color:#bd93f9}:root[code-theme=dark] .chroma .mo{color:#bd93f9}:root[code-theme=dark] .chroma .o{color:#ff79c6}:root[code-theme=dark] .chroma .ow{color:#ff79c6}:root[code-theme=dark] .chroma .p{color:inherit}:root[code-theme=dark] .chroma .c{color:#96a6d8}:root[code-theme=dark] .chroma .ch{color:#96a6d8}:root[code-theme=dark] .chroma .cm{color:#96a6d8}:root[code-theme=dark] .chroma .c1{color:#96a6d8}:root[code-theme=dark] .chroma .cs{color:#96a6d8}:root[code-theme=dark] .chroma .cp{color:#ff79c6}:root[code-theme=dark] .chroma .cpf{color:#ff79c6}:root[code-theme=dark] .chroma .g{color:inherit}:root[code-theme=dark] .chroma .gd{color:#d98f90}:root[code-theme=dark] .chroma .ge{text-decoration:underline}:root[code-theme=dark] .chroma .gr{color:inherit}:root[code-theme=dark] .chroma .gh{font-weight:bold;color:inherit}:root[code-theme=dark] .chroma .gi{font-weight:bold}:root[code-theme=dark] .chroma .go{color:#8f9ea8}:root[code-theme=dark] .chroma .gp{color:inherit}:root[code-theme=dark] .chroma .gs{color:inherit}:root[code-theme=dark] .chroma .gu{font-weight:bold}:root[code-theme=dark] .chroma .gt{color:inherit}:root[code-theme=dark] .chroma .gl{text-decoration:underline}:root[code-theme=dark] .chroma .w{color:inherit}@media(prefers-color-scheme: dark){:root{--header-background: rgb(32, 83, 117);--header-font-color: rgb(255, 255, 255);--body-background: #29363e;--body-font-color: #c2cfd7;--mark-color: rgb(255, 171, 0);--button-background: #22597d;--button-border-color: rgb(32, 83, 117);--link-color: rgb(110, 168, 212);--link-color-visited: rgb(186, 142, 240);--hint-link-color: rgb(10, 83, 154);--hint-link-color-visited: rgb(119, 73, 191);--accent-color-dark: #192125;--accent-color: #212b32;--accent-color-lite: #253138;--control-icons: #b2bac1;--footer-background: rgb(17, 43, 60);--footer-font-color: rgb(255, 255, 255);--footer-link-color: rgb(246, 107, 14);--footer-link-color-visited: rgb(246, 107, 14);--code-background: #232e35;--code-accent-color: #1b2329;--code-accent-color-lite: #1f292f;--code-font-color: rgb(185, 185, 185);--code-copy-background: #232e35;--code-copy-font-color: #939393;--code-copy-border-color: #868686;--code-copy-success-color: rgba(0, 200, 83, 0.45)}:root .dark-mode-dim .gdoc-markdown img{filter:brightness(0.75) grayscale(0.2)}:root .gdoc-markdown .gdoc-hint,:root .gdoc-markdown .gdoc-props__tag,:root .gdoc-markdown .admonitionblock{filter:saturate(2.5) brightness(0.85)}:root .gdoc-markdown .gdoc-hint a,:root .gdoc-markdown .admonitionblock a{color:var(--hint-link-color)}:root .gdoc-markdown .gdoc-hint a:visited,:root .gdoc-markdown .admonitionblock a:visited{color:var(--hint-link-color-visited)}:root .gdoc-markdown .gdoc-hint__title,:root .gdoc-markdown .admonitionblock table td:first-child{background-color:rgba(134,142,150,.15)}:root .chroma{color:var(--code-font-color)}:root .chroma .lntable td:nth-child(2) code .hl{width:auto;margin-left:-0.5em;padding:0 .5em}:root .highlight pre.chroma{width:100%;overflow:auto;max-height:var(--code-max-height)}:root .chroma .lntable{border:1px solid var(--code-accent-color);border-radius:.15rem;border-spacing:0;padding:0;margin:0;width:100%;display:block;max-height:var(--code-max-height);overflow:auto}:root .chroma .lntable pre.chroma{max-height:none;border-radius:0;margin:0}:root .chroma .lntable td:first-child code{background-color:var(--code-accent-color-lite);border-right:1px solid var(--code-accent-color);padding-left:0;padding-right:0;border-radius:0}:root .chroma .lntable td:nth-child(2){width:100%;margin-left:2rem}:root .chroma .x{color:inherit}:root .chroma .err{color:inherit}:root .chroma .lntd{vertical-align:top;padding:0;margin:0;border:0}:root .chroma .hl{display:block;width:100%;background-color:#4f1605}:root .chroma .lnt{padding:0 .8em}:root .chroma .ln{margin-right:.4em;padding:0 .4em 0 .4em;color:#b3b3b3}:root .chroma .k{color:#ff79c6}:root .chroma .kc{color:#ff79c6}:root .chroma .kd{color:#8be9fd;font-style:italic}:root .chroma .kn{color:#ff79c6}:root .chroma .kp{color:#ff79c6}:root .chroma .kr{color:#ff79c6}:root .chroma .kt{color:#8be9fd}:root .chroma .n{color:inherit}:root .chroma .na{color:#50fa7b}:root .chroma .nb{color:#8be9fd;font-style:italic}:root .chroma .bp{color:inherit}:root .chroma .nc{color:#50fa7b}:root .chroma .no{color:inherit}:root .chroma .nd{color:inherit}:root .chroma .ni{color:inherit}:root .chroma .ne{color:inherit}:root .chroma .nf{color:#50fa7b}:root .chroma .fm{color:inherit}:root .chroma .nl{color:#8be9fd;font-style:italic}:root .chroma .nn{color:inherit}:root .chroma .nx{color:inherit}:root .chroma .py{color:inherit}:root .chroma .nt{color:#ff79c6}:root .chroma .nv{color:#8be9fd;font-style:italic}:root .chroma .vc{color:#8be9fd;font-style:italic}:root .chroma .vg{color:#8be9fd;font-style:italic}:root .chroma .vi{color:#8be9fd;font-style:italic}:root .chroma .vm{color:inherit}:root .chroma .l{color:inherit}:root .chroma .ld{color:inherit}:root .chroma .s{color:#f1fa8c}:root .chroma .sa{color:#f1fa8c}:root .chroma .sb{color:#f1fa8c}:root .chroma .sc{color:#f1fa8c}:root .chroma .dl{color:#f1fa8c}:root .chroma .sd{color:#f1fa8c}:root .chroma .s2{color:#f1fa8c}:root .chroma .se{color:#f1fa8c}:root .chroma .sh{color:#f1fa8c}:root .chroma .si{color:#f1fa8c}:root .chroma .sx{color:#f1fa8c}:root .chroma .sr{color:#f1fa8c}:root .chroma .s1{color:#f1fa8c}:root .chroma .ss{color:#f1fa8c}:root .chroma .m{color:#bd93f9}:root .chroma .mb{color:#bd93f9}:root .chroma .mf{color:#bd93f9}:root .chroma .mh{color:#bd93f9}:root .chroma .mi{color:#bd93f9}:root .chroma .il{color:#bd93f9}:root .chroma .mo{color:#bd93f9}:root .chroma .o{color:#ff79c6}:root .chroma .ow{color:#ff79c6}:root .chroma .p{color:inherit}:root .chroma .c{color:#96a6d8}:root .chroma .ch{color:#96a6d8}:root .chroma .cm{color:#96a6d8}:root .chroma .c1{color:#96a6d8}:root .chroma .cs{color:#96a6d8}:root .chroma .cp{color:#ff79c6}:root .chroma .cpf{color:#ff79c6}:root .chroma .g{color:inherit}:root .chroma .gd{color:#d98f90}:root .chroma .ge{text-decoration:underline}:root .chroma .gr{color:inherit}:root .chroma .gh{font-weight:bold;color:inherit}:root .chroma .gi{font-weight:bold}:root .chroma .go{color:#8f9ea8}:root .chroma .gp{color:inherit}:root .chroma .gs{color:inherit}:root .chroma .gu{font-weight:bold}:root .chroma .gt{color:inherit}:root .chroma .gl{text-decoration:underline}:root .chroma .w{color:inherit}}html{font-size:16px;letter-spacing:.33px;scroll-behavior:smooth}html.color-toggle-hidden #gdoc-color-theme{display:none}html.color-toggle-light #gdoc-color-theme .gdoc_brightness_light{display:inline-block}html.color-toggle-light #gdoc-color-theme .gdoc_brightness_auto,html.color-toggle-light #gdoc-color-theme .gdoc_brightness_dark{display:none}html.color-toggle-dark #gdoc-color-theme .gdoc_brightness_dark{display:inline-block}html.color-toggle-dark #gdoc-color-theme .gdoc_brightness_auto,html.color-toggle-dark #gdoc-color-theme .gdoc_brightness_light{display:none}html.color-toggle-auto #gdoc-color-theme .gdoc_brightness_light{display:none}html.color-toggle-auto #gdoc-color-theme .gdoc_brightness_dark{display:none}html.color-toggle-auto #gdoc-color-theme .gdoc_brightness_auto{display:inline-block}html,body{min-width:20rem;overflow-x:hidden}body{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;box-sizing:border-box}body *{box-sizing:inherit}h1,h2,h3,h4,h5,h6{font-weight:normal;display:flex;align-items:center}h4,h5,h6{font-size:1rem !important}a{text-decoration:none;color:var(--link-color)}a:hover{text-decoration:underline}a:visited{color:var(--link-color-visited)}i.gdoc-icon{font-family:"GeekdocIcons";font-style:normal}img{vertical-align:middle}#gdoc-color-theme{cursor:pointer}.fake-link:hover{background-image:linear-gradient(var(--link-color), var(--link-color));background-position:0 100%;background-size:100% 1px;background-repeat:no-repeat;text-decoration:none}.wrapper{display:flex;flex-direction:column;min-height:100vh;color:var(--body-font-color);background:var(--body-background);font-weight:normal}.container{width:100%;max-width:82rem;margin:0 auto;padding:1.25rem}svg.gdoc-icon{display:inline-block;width:1.25rem;height:1.25rem;vertical-align:middle;stroke-width:0;stroke:currentColor;fill:currentColor;position:relative}.gdoc-header{background:var(--header-background);color:var(--header-font-color);border-bottom:.3em solid var(--footer-background)}.gdoc-header__link,.gdoc-header__link:visited{color:var(--header-font-color)}.gdoc-header__link:hover{text-decoration:none}.gdoc-header svg.gdoc-icon{width:2rem;height:2rem}.gdoc-brand{font-size:2rem;line-height:2rem}.gdoc-brand__img{margin-right:1rem;width:2rem;height:2rem}.gdoc-menu-header__items{display:flex}.gdoc-menu-header__items>span{margin-left:.5rem}.gdoc-menu-header__control,.gdoc-menu-header__home{display:none}.gdoc-menu-header__control svg.gdoc-icon,.gdoc-menu-header__home svg.gdoc-icon{cursor:pointer}.gdoc-nav{flex:0 0 18rem}.gdoc-nav nav{width:18rem;padding:1rem 2rem 1rem 0}.gdoc-nav nav>ul>li>*{font-weight:normal}.gdoc-nav nav section{margin-top:2rem}.gdoc-nav__control{display:none;margin:0;padding:0}.gdoc-nav__control svg.gdoc-icon{cursor:pointer}.gdoc-nav__control svg.gdoc-icon.gdoc_menu{display:inline-block}.gdoc-nav__control svg.gdoc-icon.gdoc_arrow_back{display:none}.gdoc-nav__list{padding-left:1rem;margin:0;padding:0;list-style:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.gdoc-nav__list ul{padding-left:1rem}.gdoc-nav__list li{margin:.75rem 0}.gdoc-nav__list svg.gdoc-icon{margin-right:.25rem}.gdoc-nav__toggle{display:none}.gdoc-nav__toggle~label{cursor:pointer}.gdoc-nav__toggle~label svg.gdoc-icon.toggle{width:1rem;height:1rem}.gdoc-nav__toggle:not(:checked)~ul,.gdoc-nav__toggle:not(:checked)~label svg.gdoc-icon.gdoc_keyboard_arrow_down{display:none}.gdoc-nav__toggle:not(:checked)~label svg.gdoc-icon.gdoc_keyboard_arrow_left{display:block}.gdoc-nav__toggle:checked~ul,.gdoc-nav__toggle:checked~label svg.gdoc-icon.gdoc_keyboard_arrow_down{display:block}.gdoc-nav__toggle:checked~label svg.gdoc-icon.gdoc_keyboard_arrow_left{display:none}.gdoc-nav--main>ul>li>span,.gdoc-nav--main>ul>li>span>a,.gdoc-nav--main>ul>li>label,.gdoc-nav--main>ul>li>label>a{font-weight:bold}.gdoc-nav__entry,.gdoc-language__entry{flex:1;color:var(--body-font-color)}.gdoc-nav__entry:hover,.gdoc-nav__entry.is-active,.gdoc-language__entry:hover,.gdoc-language__entry.is-active{text-decoration:underline;text-decoration-style:dashed !important}.gdoc-nav__entry:visited,.gdoc-language__entry:visited{color:var(--body-font-color)}.gdoc-search__list,.gdoc-language__list{background:var(--body-background);border-radius:.15rem;box-shadow:0 1px 3px 0 var(--accent-color-dark),0 1px 2px 0 var(--accent-color);position:absolute;margin:0;padding:.5rem .25rem !important;list-style:none;top:calc(100% + 0.5rem);z-index:2}.gdoc-page{min-width:18rem;flex-grow:1;padding:1rem 0}.gdoc-page h1,.gdoc-page h2,.gdoc-page h3,.gdoc-page h4,.gdoc-page h5,.gdoc-page h6{font-weight:600}.gdoc-page__header,.gdoc-page__footer{margin-bottom:1.5rem}.gdoc-page__header svg.gdoc-icon,.gdoc-page__footer svg.gdoc-icon{color:var(--control-icons)}.gdoc-page__header a,.gdoc-page__header a:visited,.gdoc-page__footer a,.gdoc-page__footer a:visited{color:var(--link-color)}.gdoc-page__header{background:var(--accent-color-lite);padding:.5rem 1rem;border-radius:.15rem}.gdoc-page__nav:hover{background-image:linear-gradient(var(--link-color), var(--link-color));background-position:0 100%;background-size:100% 1px;background-repeat:no-repeat}.gdoc-page__anchorwrap{gap:.5em}.gdoc-page__anchorwrap:hover .gdoc-page__anchor svg.gdoc-icon{color:var(--control-icons)}.gdoc-page__anchor svg.gdoc-icon{width:1.85em;height:1.85em;color:rgba(0,0,0,0)}.gdoc-page__anchor:focus svg.gdoc-icon{color:var(--control-icons)}.gdoc-page__footer{margin-top:2rem}.gdoc-page__footer a:hover{text-decoration:none}.gdoc-post{word-wrap:break-word;border-top:1px dashed #868e96;padding:2rem 0}.gdoc-post:first-of-type{padding-top:0}.gdoc-post__header h1{margin-top:0}.gdoc-post__header a,.gdoc-post__header a:visited{color:var(--body-font-color);text-decoration:none}.gdoc-post__header a:hover{background:none;text-decoration:underline;color:var(--body-font-color)}.gdoc-post:first-child{border-top:0}.gdoc-post:first-child h1{margin-top:0}.gdoc-post__readmore{margin:2rem 0}.gdoc-post__readmore a,.gdoc-post__readmore a:hover,.gdoc-post__readmore a:visited{color:var(--link-color);text-decoration:none !important}.gdoc-post__meta span svg.gdoc-icon{margin-left:-5px}.gdoc-post__meta>span{margin:.25rem 0}.gdoc-post__meta>span:not(:last-child){margin-right:.5rem}.gdoc-post__meta svg.gdoc-icon{font-size:1.25rem}.gdoc-post__meta .gdoc-button{margin:0 .125rem 0 0}.gdoc-post__meta--head{margin-bottom:2rem}.gdoc-post__codecontainer{position:relative}.gdoc-post__codecontainer:hover>.gdoc-post__codecopy{visibility:visible}.gdoc-post__codecopy{visibility:hidden;position:absolute;top:.5rem;right:.5rem;border:1.5px solid var(--code-copy-border-color);border-radius:.15rem;background:var(--code-copy-background);width:2rem;height:2rem}.gdoc-post__codecopy svg.gdoc-icon{top:0;width:1.25rem;height:1.25rem;color:var(--code-copy-font-color)}.gdoc-post__codecopy:hover{cursor:pointer}.gdoc-post__codecopy--success{border-color:var(--code-copy-success-color)}.gdoc-post__codecopy--success svg.gdoc-icon{color:var(--code-copy-success-color)}.gdoc-post__codecopy--out{transition:visibility 2s ease-out}.gdoc-footer{background:var(--footer-background);color:var(--footer-font-color)}.gdoc-footer .fake-link:hover{background-image:linear-gradient(var(--footer-link-color), var(--footer-link-color))}.gdoc-footer__item{line-height:2rem}.gdoc-footer__item--row{margin-right:1rem}.gdoc-footer__link{color:var(--footer-link-color)}.gdoc-footer__link:visited{color:var(--footer-link-color-visited)}.gdoc-search{position:relative}.gdoc-search svg.gdoc-icon{position:absolute;left:.5rem;color:var(--control-icons);width:1.25rem;height:1.25rem}.gdoc-search::after{display:block;content:"";clear:both}.gdoc-search__input{width:100%;padding:.5rem;padding-left:2rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;border:1px solid rgba(0,0,0,0);border-radius:.15rem;background:var(--accent-color-lite);color:var(--body-font-color)}.gdoc-search__input:focus{outline:none !important;border:1px solid var(--accent-color)}.gdoc-search__list{visibility:hidden;left:0;width:100%}.gdoc-search__list ul{list-style:none;padding-left:0}.gdoc-search__list>li>span{font-weight:bold}.gdoc-search__list>li+li{margin-top:.25rem}.gdoc-search__list svg.gdoc-icon{margin-right:.25rem}.gdoc-search__section{display:flex;flex-direction:column;padding:.25rem !important}.gdoc-search__entry{display:flex;flex-direction:column;color:var(--body-font-color);padding:.25rem !important;border-radius:.15rem}.gdoc-search__entry:hover,.gdoc-search__entry.is-active{background:var(--accent-color-lite);text-decoration:none}.gdoc-search__entry:hover .gdoc-search__entry--title,.gdoc-search__entry.is-active .gdoc-search__entry--title{text-decoration-style:dashed !important;text-decoration:underline}.gdoc-search__entry:visited{color:var(--body-font-color)}.gdoc-search__entry--description{font-size:.875rem;font-style:italic}.gdoc-search:focus-within .gdoc-search__list.has-hits,.gdoc-search__list.has-hits:hover{visibility:visible}.gdoc-language__selector{position:relative;list-style:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer;margin:0;padding:0;width:100%}.gdoc-language__selector:focus .gdoc-language__list,.gdoc-language__selector:focus-within .gdoc-language__list,.gdoc-language__selector:active .gdoc-language__list{display:block}.gdoc-language__list{display:none;right:0;width:auto;white-space:nowrap}.gdoc-paging{padding:1rem 0}.gdoc-paging__item{flex:1 1 0}.gdoc-paging__item a:visited{color:var(--link-color)}.gdoc-paging__item a:hover,.gdoc-paging__item a:visited:hover{background:var(--link-color);color:#f8f9fa}.gdoc-paging__item--next{text-align:right}.gdoc-paging__item--prev{text-align:left}.gdoc-error{padding:6rem 1rem;margin:0 auto;max-width:45em}.gdoc-error svg.gdoc-icon{width:8rem;height:8rem;color:var(--body-font-color)}.gdoc-error__link,.gdoc-error__link:visited{color:var(--link-color)}.gdoc-error__message{padding-left:4rem}.gdoc-error__line{padding:.5rem 0}.gdoc-error__title{font-size:4rem}.gdoc-error__code{font-weight:bolder}.gdoc-toc{margin:1rem 0}.gdoc-toc li{margin:.25rem 0}.gdoc-toc__level--1 ul ul,.gdoc-toc__level--2 ul ul ul,.gdoc-toc__level--3 ul ul ul ul,.gdoc-toc__level--4 ul ul ul ul ul,.gdoc-toc__level--5 ul ul ul ul ul ul,.gdoc-toc__level--6 ul ul ul ul ul ul ul{display:none}.gdoc-toc a,.gdoc-toc a:visited{color:var(--link-color)}.gdoc-nav nav,.gdoc-page,.markdown{transition:.2s ease-in-out;transition-property:transform,margin-left,opacity;will-change:transform,margin-left}.breadcrumb{display:inline;padding:0;margin:0}.breadcrumb li{display:inline}.gdoc-markdown{line-height:1.6rem}.gdoc-markdown h1,.gdoc-markdown h2,.gdoc-markdown h3,.gdoc-markdown h4,.gdoc-markdown h5,.gdoc-markdown h6{font-weight:600}.gdoc-markdown h1>code,.gdoc-markdown h2>code,.gdoc-markdown h3>code,.gdoc-markdown h4>code,.gdoc-markdown h5>code,.gdoc-markdown h6>code{border-top:3px solid var(--accent-color);font-size:.75rem !important}.gdoc-markdown h4>code,.gdoc-markdown h5>code,.gdoc-markdown h6>code{font-size:.875rem !important}.gdoc-markdown b,.gdoc-markdown optgroup,.gdoc-markdown strong{font-weight:bolder}.gdoc-markdown a,.gdoc-markdown__link{text-decoration:none;border-bottom:1px solid rgba(0,0,0,0);line-height:normal}.gdoc-markdown a:hover,.gdoc-markdown__link:hover{text-decoration:underline}.gdoc-markdown__link--raw{text-decoration:none !important;color:#343a40 !important}.gdoc-markdown__link--raw:hover{text-decoration:none !important}.gdoc-markdown__link--raw:visited{color:#343a40 !important}.gdoc-markdown__link--code{text-decoration:none}.gdoc-markdown__link--code code{color:inherit !important}.gdoc-markdown__link--code:hover{background:none;color:var(--link-color) !important;text-decoration:underline}.gdoc-markdown__link--code:visited,.gdoc-markdown__link--code:visited:hover{color:var(--link-color-visited) !important}.gdoc-markdown__figure{padding:.25rem;margin:1rem 0;background-color:var(--accent-color);display:table;border-top-left-radius:.15rem;border-top-right-radius:.15rem}.gdoc-markdown__figure--round,.gdoc-markdown__figure--round img{border-radius:50% !important}.gdoc-markdown__figure figcaption{display:table-caption;caption-side:bottom;background-color:var(--accent-color);padding:0 .25rem .25rem;text-align:center;border-bottom-left-radius:.15rem;border-bottom-right-radius:.15rem}.gdoc-markdown__figure img{max-width:100%;height:auto}.gdoc-markdown img{max-width:100%;border-radius:.15rem}.gdoc-markdown blockquote{margin:1rem 0;padding:.5rem 1rem .5rem .75rem;border-left:3px solid var(--accent-color);border-radius:.15rem}.gdoc-markdown table:not(.lntable):not(.highlight){display:table;border-spacing:0;border-collapse:collapse;margin-top:1rem;margin-bottom:1rem;width:100%;text-align:left}.gdoc-markdown table:not(.lntable):not(.highlight) thead{border-bottom:3px solid var(--accent-color)}.gdoc-markdown table:not(.lntable):not(.highlight) tr th,.gdoc-markdown table:not(.lntable):not(.highlight) tr td{padding:.5rem 1rem}.gdoc-markdown table:not(.lntable):not(.highlight) tr{border-bottom:1.5px solid var(--accent-color)}.gdoc-markdown table:not(.lntable):not(.highlight) tr:nth-child(2n){background:var(--accent-color-lite)}.gdoc-markdown hr{height:1.5px;border:none;background:var(--accent-color)}.gdoc-markdown ul,.gdoc-markdown ol{padding-left:2rem}.gdoc-markdown dl dt{font-weight:bolder;margin-top:1rem}.gdoc-markdown dl dd{margin-left:2rem}.gdoc-markdown code{padding:.25rem .5rem}.gdoc-markdown pre,.gdoc-markdown code{background-color:var(--code-background);border-radius:.15rem;color:var(--code-font-color);font-size:.875rem;line-height:1rem}.gdoc-markdown pre code{display:block;padding:1rem;width:100%}.gdoc-markdown mark{background-color:var(--mark-color)}.gdoc-markdown__align--left{text-align:left}.gdoc-markdown__align--left h1,.gdoc-markdown__align--left h2,.gdoc-markdown__align--left h3,.gdoc-markdown__align--left h4,.gdoc-markdown__align--left h5,.gdoc-markdown__align--left h6{justify-content:flex-start}.gdoc-markdown__align--center{text-align:center}.gdoc-markdown__align--center h1,.gdoc-markdown__align--center h2,.gdoc-markdown__align--center h3,.gdoc-markdown__align--center h4,.gdoc-markdown__align--center h5,.gdoc-markdown__align--center h6{justify-content:center}.gdoc-markdown__align--right{text-align:right}.gdoc-markdown__align--right h1,.gdoc-markdown__align--right h2,.gdoc-markdown__align--right h3,.gdoc-markdown__align--right h4,.gdoc-markdown__align--right h5,.gdoc-markdown__align--right h6{justify-content:flex-end}.admonitionblock{margin:1rem 0;padding:0;border-left:3px solid var(--accent-color);border-radius:.15rem}.admonitionblock.info{border-left-color:#0091ea;background-color:#f3f9fd;color:#343a40}.admonitionblock.note{border-left-color:#0091ea;background-color:#f3f9fd;color:#343a40}.admonitionblock.ok{border-left-color:#00c853;background-color:#f2fdf6;color:#343a40}.admonitionblock.tip{border-left-color:#00c853;background-color:#f2fdf6;color:#343a40}.admonitionblock.important{border-left-color:#ffab00;background-color:#fdfaf4;color:#343a40}.admonitionblock.caution{border-left-color:#7300d3;background-color:#f8f2fd;color:#343a40}.admonitionblock.danger{border-left-color:#d50000;background-color:#fdf2f2;color:#343a40}.admonitionblock.warning{border-left-color:#d50000;background-color:#fdf2f2;color:#343a40}.admonitionblock table{margin:0 !important;padding:0 !important}.admonitionblock table tr{border:0 !important}.admonitionblock table td{display:block;padding:.25rem 1rem !important}.admonitionblock table td:first-child{background-color:rgba(134,142,150,.05);font-weight:bold}.admonitionblock table td:first-child.icon .title{display:flex;align-items:center}.admonitionblock table td:first-child.icon i.fa::after{content:attr(title);font-style:normal;padding-left:1.5rem}.admonitionblock table td:first-child.icon i.fa{color:#000;background-size:auto 90%;background-repeat:no-repeat;filter:invert(30%);margin-left:-5px}.admonitionblock table td:first-child.icon i.fa.icon-info{background-image:url(img/geekdoc-stack.svg#gdoc_info_outline)}.admonitionblock table td:first-child.icon i.fa.icon-note{background-image:url(img/geekdoc-stack.svg#gdoc_info_outline)}.admonitionblock table td:first-child.icon i.fa.icon-ok{background-image:url(img/geekdoc-stack.svg#gdoc_check_circle_outline)}.admonitionblock table td:first-child.icon i.fa.icon-tip{background-image:url(img/geekdoc-stack.svg#gdoc_check_circle_outline)}.admonitionblock table td:first-child.icon i.fa.icon-important{background-image:url(img/geekdoc-stack.svg#gdoc_error_outline)}.admonitionblock table td:first-child.icon i.fa.icon-caution{background-image:url(img/geekdoc-stack.svg#gdoc_dangerous)}.admonitionblock table td:first-child.icon i.fa.icon-danger{background-image:url(img/geekdoc-stack.svg#gdoc_fire)}.admonitionblock table td:first-child.icon i.fa.icon-warning{background-image:url(img/geekdoc-stack.svg#gdoc_fire)}.gdoc-expand{margin:1rem 0;border:1px solid var(--accent-color);border-radius:.15rem;overflow:hidden}.gdoc-expand__head{background:var(--accent-color-lite);padding:.5rem 1rem;cursor:pointer}.gdoc-expand__content{display:none;padding:0 1rem}.gdoc-expand__control:checked+.gdoc-expand__content{display:block}.gdoc-expand .gdoc-page__anchor{display:none}.gdoc-tabs{margin:1rem 0;border:1px solid var(--accent-color);border-radius:.15rem;overflow:hidden;display:flex;flex-wrap:wrap}.gdoc-tabs__label{display:inline-block;padding:.5rem 1rem;border-bottom:1px rgba(0,0,0,0);cursor:pointer}.gdoc-tabs__content{order:999;width:100%;border-top:1px solid var(--accent-color-lite);padding:0 1rem;display:none}.gdoc-tabs__control:checked+.gdoc-tabs__label{border-bottom:1.5px solid var(--link-color)}.gdoc-tabs__control:checked+.gdoc-tabs__label+.gdoc-tabs__content{display:block}.gdoc-tabs .gdoc-page__anchor{display:none}.gdoc-columns{margin:1rem 0}.gdoc-columns--regular>:first-child{flex:1}.gdoc-columns--small>:first-child{flex:.35;min-width:7rem}.gdoc-columns--large>:first-child{flex:1.65;min-width:33rem}.gdoc-columns__content{flex:1 1;min-width:13.2rem;padding:0}.gdoc-columns .gdoc-post__anchor{display:none}.gdoc-button{margin:1rem 0;display:inline-block;background:var(--accent-color-lite);border:1px solid var(--accent-color);border-radius:.15rem;cursor:pointer}.gdoc-button__link{display:inline-block;color:inherit !important;text-decoration:none !important}.gdoc-button:hover{background:var(--button-background);border-color:var(--button-border-color);color:#f8f9fa}.gdoc-button--regular{font-size:16px}.gdoc-button--regular .gdoc-button__link{padding:.25rem .5rem}.gdoc-button--large{font-size:1.25rem}.gdoc-button--large .gdoc-button__link{padding:.5rem 1rem}.gdoc-hint.info{border-left-color:#0091ea;background-color:#f3f9fd;color:#343a40;padding:0}.gdoc-hint.note{border-left-color:#0091ea;background-color:#f3f9fd;color:#343a40;padding:0}.gdoc-hint.ok{border-left-color:#00c853;background-color:#f2fdf6;color:#343a40;padding:0}.gdoc-hint.tip{border-left-color:#00c853;background-color:#f2fdf6;color:#343a40;padding:0}.gdoc-hint.important{border-left-color:#ffab00;background-color:#fdfaf4;color:#343a40;padding:0}.gdoc-hint.caution{border-left-color:#7300d3;background-color:#f8f2fd;color:#343a40;padding:0}.gdoc-hint.danger{border-left-color:#d50000;background-color:#fdf2f2;color:#343a40;padding:0}.gdoc-hint.warning{border-left-color:#d50000;background-color:#fdf2f2;color:#343a40;padding:0}.gdoc-hint__title{padding:.25rem 1rem;background-color:rgba(134,142,150,.05);font-weight:bold;color:rgba(52,58,64,.85)}.gdoc-hint__title i.fa::after{content:attr(title);font-style:normal;padding-left:1.5rem}.gdoc-hint__title i.fa{color:#000;background-size:auto 90%;background-repeat:no-repeat;filter:invert(30%);margin-left:-5px}.gdoc-hint__title i.fa.info{background-image:url(img/geekdoc-stack.svg#gdoc_info_outline)}.gdoc-hint__title i.fa.note{background-image:url(img/geekdoc-stack.svg#gdoc_info_outline)}.gdoc-hint__title i.fa.ok{background-image:url(img/geekdoc-stack.svg#gdoc_check_circle_outline)}.gdoc-hint__title i.fa.tip{background-image:url(img/geekdoc-stack.svg#gdoc_check_circle_outline)}.gdoc-hint__title i.fa.important{background-image:url(img/geekdoc-stack.svg#gdoc_error_outline)}.gdoc-hint__title i.fa.caution{background-image:url(img/geekdoc-stack.svg#gdoc_dangerous)}.gdoc-hint__title i.fa.danger{background-image:url(img/geekdoc-stack.svg#gdoc_fire)}.gdoc-hint__title i.fa.warning{background-image:url(img/geekdoc-stack.svg#gdoc_fire)}.gdoc-hint__title .gdoc-icon{width:1.5rem;height:1.5rem;margin-left:-5px}.gdoc-hint__text{padding:.25rem 1rem}.gdoc-hint .gdoc-page__anchor{display:none}.gdoc-mermaid{font-family:"Liberation Sans",sans-serif}.gdoc-mermaid>svg{height:100%;padding:.5rem}.gdoc-props__title,.gdoc-props__default{padding:0;margin:0;font-family:"Liberation Mono",monospace}.gdoc-props__meta{gap:.5em;line-height:normal;margin-bottom:.25rem}.gdoc-props__meta:hover .gdoc-page__anchor svg.gdoc-icon{color:var(--control-icons)}.gdoc-props__tag.info{border-color:#e8f4fb;background-color:#f3f9fd}.gdoc-props__tag.note{border-color:#e8f4fb;background-color:#f3f9fd}.gdoc-props__tag.ok{border-color:#e5faee;background-color:#f2fdf6}.gdoc-props__tag.tip{border-color:#e5faee;background-color:#f2fdf6}.gdoc-props__tag.important{border-color:#fbf5e9;background-color:#fdfaf4}.gdoc-props__tag.caution{border-color:#f1e6fb;background-color:#f8f2fd}.gdoc-props__tag.danger{border-color:#fbe6e6;background-color:#fdf2f2}.gdoc-props__tag.warning{border-color:#fbe6e6;background-color:#fdf2f2}.gdoc-props__tag{font-size:.875rem;font-weight:normal;background-color:#f8f9fa;border:1px solid #e9ecef;border-radius:.15rem;padding:.125rem .25rem;color:#343a40}.gdoc-props__default{font-size:.875rem}.gdoc-progress{margin-bottom:1rem}.gdoc-progress__label{padding:.25rem 0}.gdoc-progress__label--name{font-weight:bold}.gdoc-progress__wrap{background-color:var(--accent-color-lite);border-radius:1em;box-shadow:inset 0 0 0 1px var(--accent-color)}.gdoc-progress__bar{height:1em;border-radius:1em;background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.125) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.125) 50%, rgba(255, 255, 255, 0.125) 75%, transparent 75%, transparent);background-size:2.5em 2.5em;background-color:#205375 !important} \ No newline at end of file diff --git a/docs/themes/hugo-geekdoc/static/mobile-79ddc617.min.css b/docs/themes/hugo-geekdoc/static/mobile-79ddc617.min.css new file mode 100644 index 000000000..abf3504d9 --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/mobile-79ddc617.min.css @@ -0,0 +1 @@ +@media screen and (max-width: 41rem){.gdoc-nav{margin-left:-18rem;font-size:16px}.gdoc-nav__control{display:inline-block}.gdoc-header svg.gdoc-icon{width:1.5rem;height:1.5rem}.gdoc-brand{font-size:1.5rem;line-height:1.5rem}.gdoc-brand__img{display:none}.gdoc-menu-header__items{display:none}.gdoc-menu-header__control,.gdoc-menu-header__home{display:flex}.gdoc-error{padding:6rem 1rem}.gdoc-error svg.gdoc-icon{width:6rem;height:6rem}.gdoc-error__message{padding-left:2rem}.gdoc-error__line{padding:.25rem 0}.gdoc-error__title{font-size:2rem}.gdoc-page__header .breadcrumb,.hidden-mobile{display:none}.flex-mobile-column{flex-direction:column}.flex-mobile-column.gdoc-columns{margin:2rem 0}.flex-mobile-column .gdoc-columns__content{min-width:auto;margin:0}#menu-control:checked~main .gdoc-nav nav,#menu-control:checked~main .gdoc-page{transform:translateX(18rem)}#menu-control:checked~main .gdoc-page{opacity:.25}#menu-control:checked~.gdoc-header .gdoc-nav__control svg.gdoc-icon.gdoc_menu{display:none}#menu-control:checked~.gdoc-header .gdoc-nav__control svg.gdoc-icon.gdoc_arrow_back{display:inline-block}#menu-header-control:checked~.gdoc-header .gdoc-brand{display:none}#menu-header-control:checked~.gdoc-header .gdoc-menu-header__items{display:flex}#menu-header-control:checked~.gdoc-header .gdoc-menu-header__control svg.gdoc-icon.gdoc_keyboard_arrow_left{display:none}} \ No newline at end of file diff --git a/docs/themes/hugo-geekdoc/static/print-735ccc12.min.css b/docs/themes/hugo-geekdoc/static/print-735ccc12.min.css new file mode 100644 index 000000000..01994899b --- /dev/null +++ b/docs/themes/hugo-geekdoc/static/print-735ccc12.min.css @@ -0,0 +1 @@ +@media print{.gdoc-nav,.gdoc-footer .container span:not(:first-child),.gdoc-paging,.editpage{display:none}.gdoc-footer{border-top:1px solid #dee2e6}.gdoc-markdown pre{white-space:pre-wrap;overflow-wrap:break-word}.chroma code{border:1px solid #dee2e6;padding:.5rem !important;font-weight:normal !important}.gdoc-markdown code{font-weight:bold}a,a:visited{color:inherit !important;text-decoration:none !important}.gdoc-toc{flex:none}.gdoc-toc nav{position:relative;width:auto}.wrapper{display:block}.wrapper main{display:block}} \ No newline at end of file diff --git a/docs/themes/hugo-geekdoc/theme.toml b/docs/themes/hugo-geekdoc/theme.toml new file mode 100644 index 000000000..90b7cf59b --- /dev/null +++ b/docs/themes/hugo-geekdoc/theme.toml @@ -0,0 +1,12 @@ +name = "Geekdoc" +license = "MIT" +licenselink = "https://github.com/thegeeklab/hugo-geekdoc/blob/main/LICENSE" +description = "Hugo theme made for documentation" +homepage = "https://geekdocs.de/" +demosite = "https://geekdocs.de/" +tags = ["docs", "documentation", "responsive", "simple"] +min_version = "0.112.0" + +[author] + name = "Robert Kaussow" + homepage = "https://thegeeklab.de/" diff --git a/examples/example-exemplars-tail-sampling/README.md b/examples/example-exemplars-tail-sampling/README.md new file mode 100644 index 000000000..f12c43c95 --- /dev/null +++ b/examples/example-exemplars-tail-sampling/README.md @@ -0,0 +1,178 @@ +# Exemplars with OpenTelemetry's Tail Sampling + +## Background: What are Exemplars? + +Each Prometheus time series may contain Exemplars. Exemplars are additional metadata attached to a +Prometheus time +series. +Exemplars are often used to reference trace IDs when distributed tracing is used. +The following shows an example of a histogram in OpenMetrics text format where each non-empty bucket +has an Exemplar: + + + +```text +# TYPE request_duration_seconds histogram +# UNIT request_duration_seconds seconds +# HELP request_duration_seconds request duration in seconds +request_duration_seconds_bucket{http_status="200",le="0.005"} 0 +request_duration_seconds_bucket{http_status="200",le="0.01"} 5 # {span_id="826c6f49a0d6c931",trace_id="d2cf83f9f1fd22f793855edc4ae53320"} 0.007341934 1689971637.765 +request_duration_seconds_bucket{http_status="200",le="0.025"} 64 # {span_id="9ae17d91c9822c88",trace_id="320e53f894781db26fa0eb5fb0640426"} 0.014081662 1689971677.851 +request_duration_seconds_bucket{http_status="200",le="0.05"} 281 # {span_id="32c9706b1f798fce",trace_id="636a2bb9fe4aabea0f412b8cd6da2290"} 0.047227664 1689971700.484 +request_duration_seconds_bucket{http_status="200",le="0.1"} 1203 # {span_id="04902c82f56fb441",trace_id="c5cf7c1a4805e4b7a991c4e99fb38f87"} 0.094949368 1689971706.913 +request_duration_seconds_bucket{http_status="200",le="0.25"} 6338 # {span_id="81ffa3cbe3c8bf7e",trace_id="106a0d13ca1578a4c3ae4ec987b7f8f7"} 0.226545183 1689971700.004 +request_duration_seconds_bucket{http_status="200",le="0.5"} 10969 # {span_id="b7ac3d0a2b9570c3",trace_id="79b641c3d96bdba5554395e1521ffb13"} 0.439355954 1689971700.997 +request_duration_seconds_bucket{http_status="200",le="1.0"} 11180 # {span_id="b0cb8480a8b5c1ac",trace_id="4c57125265c4a7caa83c4d354f94bd40"} 0.625977473 1689971700.263 +request_duration_seconds_bucket{http_status="200",le="2.5"} 11209 # {span_id="4bce9aa28f1f8a65",trace_id="7fa30e3153f5129694bd58a23bcc96a8"} 1.529906213 1689971659.228 +request_duration_seconds_bucket{http_status="200",le="5.0"} 11236 # {span_id="e629a7d546da77e1",trace_id="20a43851621f908eab359217df2b5eed"} 2.936415405 1689971661.293 +request_duration_seconds_bucket{http_status="200",le="10.0"} 11243 # {span_id="024e3119605ab66e",trace_id="84721fdc42ef4d55e8416d3191b4d19e"} 5.163273443 1689971663.080 +request_duration_seconds_bucket{http_status="200",le="+Inf"} 11243 +request_duration_seconds_count{http_status="200"} 11243 +request_duration_seconds_sum{http_status="200"} 2843.3178731140015 +``` + + + +In Grafana Exemplars can be visualized as little green dots. The following shows an example of the +95th [quantile](https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_quantile) +for the histogram above. + +![Screenshot of a Latency Graph with Exemplars](https://github.com/prometheus/client_java/assets/330535/68aada3d-f55b-4a7b-90be-222481f0ec79) + +If you move the mouse over an Exemplar, an overlay pops up with a link to a tracing tool +like [Tempo](https://github.com/grafana/tempo). + +## Automatic Exemplar Generation + +The Prometheus Java client library automatically detects OpenTelemetry tracing. The library +automatically produces +Exemplars with OpenTelemetry trace IDs if applicable. + +## Sampling + +Distributed tracing produces a lot of data, and it is quite common to apply a sampling strategy to +reduce the number of +traces. + +There are two ways how to do this: + +1. _Head-based sampling_ is performed by the tracing library in the application itself. +2. _Tail-based sampling_ is performed by an external infrastructure component like + the [OpenTelemetry collector](https://opentelemetry.io/docs/collector/). + +When generating Exemplars, the Prometheus Java client library must make sure that the Exemplar +points to a trace that is +actually sampled. Otherwise, Exemplar's trace ID will not be available in the monitoring backend, +i.e. the Exemplar will link to a non-existing trace ID. + +With _head-based sampling_ this works out-of-the-box: The Prometheus client library calls +OpenTelemetry's +`Span.current().getSpanContext().isSampled()` function and selects Exemplars only if the current +Span is sampled. + +With _tail-based sampling_ there is a trick: The Prometheus client library adds an attribute +`exemplar="true"` to each +Span that is used as an Exemplar. The remainder of this readme shows how you can configure the +`tail_sampling` processor +of the OpenTelemetry collector to sample Spans marked with `exemplar="true"`. + +## Build the Example + +The example is built as part of the `client_java` parent project with + +```shell +./mvnw package +``` + +This should generate two Java services +`.../example-greeting-service/target/example-greeting-service.jar` and +`.../example-hello-world-app/target/example-hello-world-app.jar`. + +## Run the Example + +The `docker-compose` file will run the example with the following containers: + +- `hello-world-app`: Java service described above, with the OpenTelemetry Java instrumentation agent + attached for + distributed tracing. +- `greeting-service`: Java service described above, with the OpenTelemetry Java instrumentation + agent attached for + distributed tracing. +- `collector`: OpenTelemetry collector for receiving the distributed traces, performing _tail + sampling_, and forwarding + them to `tempo`. +- `prometheus`: Prometheus server scraping metrics from `hello-world-app`, `greeting-service`, and + `tempo`. +- `tempo`: Trace database. +- `grafana`: Has `prometheus` and `tempo` configured as data sources, and is configured with an + example dashboard with + Exemplars enabled. +- `k6`: The [k6](https://k6.io/) load test tool for generating 50 requests / second on the Java + services. + +With the Java services described above available in the `target/` directories, you can run the +example with: + +```shell +cd example-exemplars-tail-sampling +docker-compose up +``` + +Grafana will run on [http://localhost:3000](ttp://localhost:3000). The default user is _admin_ with +password _admin_. + +## Example Dashboard + +The example dashboard shows 50 requests / second for the Java services: + +![Screenshot showing the request rate on the Java services](https://github.com/prometheus/client_java/assets/330535/9f8dc92e-c9aa-40b6-8fda-a0f7e98560ba) + +The Tempo metrics show that only ~5 traces / second are received: + +![Screenshot showing the number of traces per second received by Tempo](https://github.com/prometheus/client_java/assets/330535/5e439ac5-3c5c-4d40-a4cd-6737c2c82dfd) + +The reason is that the OpenTelemetry collector is configured to sample only 10% of the traces. Yet, +all Exemplars in the +latency graph point to traces that actually made it to Tempo. + +## OpenTelemetry Collector Config + +The OpenTelemetry collector is configured to keep all Spans with the attribute `exemplar="true"`. +Probabilistic sampling +applies only to the remainder of the Spans. + +```yaml +processors: + batch: + tail_sampling: + expected_new_traces_per_sec: 10 + policies: + [ + { + name: keep-exemplars, + type: string_attribute, + string_attribute: { key: "exemplar", values: ["true"] }, + }, + { name: keep-10-percent, type: probabilistic, probabilistic: { sampling_percentage: 10 } }, + ] +``` + +The Prometheus Java client library automatically sets the `exemplar="true"` attribute for each Span +that is used as an +Exemplar. + +The Exemplar sampler of the Prometheus Java client library is rate-limited, the +`DEFAULT_MIN_RETENTION_PERIOD_SECONDS` +is 7s. +So only one Span per 7 seconds per time series will be marked with `exemplar="true"`. + +## Conclusion + +The Prometheus Java client library automatically generates Exemplars if OpenTelemetry tracing is +detected. +In order to make that work with _tail-based sampling_, the Prometheus Java client library adds an +attribute +`exemplar="true"` to each Span that's used as an Exemplar. +The `tail_sampling` processor in the OpenTelemetry collector can be configured to always sample +Spans marked as +`exemplar="true"`. diff --git a/examples/example-exemplars-tail-sampling/config/grafana-dashboards.yaml b/examples/example-exemplars-tail-sampling/config/grafana-dashboards.yaml new file mode 100644 index 000000000..e70097c52 --- /dev/null +++ b/examples/example-exemplars-tail-sampling/config/grafana-dashboards.yaml @@ -0,0 +1,8 @@ +apiVersion: 1 + +providers: + - name: "Example Dashboard" + type: file + options: + path: /etc/grafana/example-dashboard.json + foldersFromFilesStructure: false diff --git a/examples/example-exemplars-tail-sampling/config/grafana-datasources.yaml b/examples/example-exemplars-tail-sampling/config/grafana-datasources.yaml new file mode 100644 index 000000000..595a46559 --- /dev/null +++ b/examples/example-exemplars-tail-sampling/config/grafana-datasources.yaml @@ -0,0 +1,22 @@ +--- +apiVersion: 1 + +datasources: + - name: Prometheus + type: prometheus + uid: prometheus + url: http://localhost:9090 + + - name: Tempo + type: tempo + uid: tempo + url: http://localhost:3200 + + - name: Prometheus + type: prometheus + uid: prometheus + url: http://localhost:9090 + jsonData: + exemplarTraceIdDestinations: + - name: trace_id + datasourceUid: tempo diff --git a/examples/example-exemplars-tail-sampling/config/grafana-example-dashboard.json b/examples/example-exemplars-tail-sampling/config/grafana-example-dashboard.json new file mode 100644 index 000000000..5b39b6cc6 --- /dev/null +++ b/examples/example-exemplars-tail-sampling/config/grafana-example-dashboard.json @@ -0,0 +1,356 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 13, + "w": 18, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "histogram_quantile(0.95, rate(request_duration_seconds{job=\"$instance\"}[5m]))", + "instant": false, + "range": true, + "refId": "A" + } + ], + "title": "Request Duration 95th Percentile", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 18, + "x": 0, + "y": 13 + }, + "id": 1, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "exemplar": false, + "expr": "histogram_count(rate(request_duration_seconds{job=\"$instance\"}[5m]))", + "instant": true, + "key": "key1", + "range": true, + "refId": "A" + } + ], + "title": "Request Rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 18, + "x": 0, + "y": 24 + }, + "id": 3, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "rate(tempo_ingester_traces_created_total[5m])", + "instant": true, + "key": "key2", + "range": true, + "refId": "A" + } + ], + "title": "Traces Ingested in Tempo", + "type": "timeseries" + } + ], + "refresh": "", + "schemaVersion": 38, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": true, + "text": "greeting-service", + "value": "greeting-service" + }, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "definition": "label_values(job)", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "instance", + "options": [], + "query": { + "query": "label_values(job)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "/[^tempo]/", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Example Dashboard", + "uid": "e11cc371-fef5-4783-b5a5-fe0302f00740", + "version": 1, + "weekStart": "" +} diff --git a/examples/example-exemplars-tail-sampling/config/k6-script.js b/examples/example-exemplars-tail-sampling/config/k6-script.js new file mode 100644 index 000000000..c0338f982 --- /dev/null +++ b/examples/example-exemplars-tail-sampling/config/k6-script.js @@ -0,0 +1,18 @@ +import http from "k6/http"; + +export const options = { + scenarios: { + constant_request_rate: { + executor: "constant-arrival-rate", + rate: 50, + timeUnit: "1s", + duration: "2h", + preAllocatedVUs: 10, + maxVUs: 100, + }, + }, +}; + +export default function () { + http.get("http://localhost:8080"); +} diff --git a/examples/example-exemplars-tail-sampling/config/otelcol-config.yaml b/examples/example-exemplars-tail-sampling/config/otelcol-config.yaml new file mode 100644 index 000000000..c829434bc --- /dev/null +++ b/examples/example-exemplars-tail-sampling/config/otelcol-config.yaml @@ -0,0 +1,30 @@ +receivers: + otlp: + protocols: + grpc: + http: + +processors: + batch: + tail_sampling: + expected_new_traces_per_sec: 10 + policies: + [ + { + name: keep-exemplars, + type: string_attribute, + string_attribute: { key: "exemplar", values: ["true"] }, + }, + { name: keep-10-percent, type: probabilistic, probabilistic: { sampling_percentage: 10 } }, + ] + +exporters: + otlphttp: + endpoint: http://localhost:4418 + +service: + pipelines: + traces: + receivers: [otlp] + processors: [tail_sampling, batch] + exporters: [otlphttp] diff --git a/examples/example-exemplars-tail-sampling/config/prometheus.yaml b/examples/example-exemplars-tail-sampling/config/prometheus.yaml new file mode 100644 index 000000000..037c515f8 --- /dev/null +++ b/examples/example-exemplars-tail-sampling/config/prometheus.yaml @@ -0,0 +1,13 @@ +global: + scrape_interval: 5s + +scrape_configs: + - job_name: "tempo" + static_configs: + - targets: ["localhost:3200"] + - job_name: "hello-world-app" + static_configs: + - targets: ["localhost:8080"] + - job_name: "greeting-service" + static_configs: + - targets: ["localhost:8081"] diff --git a/examples/example-exemplars-tail-sampling/config/tempo-config.yaml b/examples/example-exemplars-tail-sampling/config/tempo-config.yaml new file mode 100644 index 000000000..12eed44cf --- /dev/null +++ b/examples/example-exemplars-tail-sampling/config/tempo-config.yaml @@ -0,0 +1,20 @@ +server: + http_listen_port: 3200 + grpc_listen_port: 9096 + +distributor: + receivers: + otlp: + protocols: + grpc: + endpoint: "localhost:4417" + http: + endpoint: "localhost:4418" + +storage: + trace: + backend: local + wal: + path: /tmp/tempo/wal + local: + path: /tmp/tempo/blocks diff --git a/examples/example-exemplars-tail-sampling/docker-compose.yaml b/examples/example-exemplars-tail-sampling/docker-compose.yaml new file mode 100644 index 000000000..6b3f50b32 --- /dev/null +++ b/examples/example-exemplars-tail-sampling/docker-compose.yaml @@ -0,0 +1,77 @@ +version: "3" +services: + hello-world-app: + image: opentelemetry-java-agent + build: + context: . + dockerfile_inline: | + FROM openjdk:11-jre + WORKDIR / + RUN curl -sOL https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.30.0/opentelemetry-javaagent.jar + network_mode: host + volumes: + - ./example-hello-world-app/target/example-hello-world-app.jar:/example-hello-world-app.jar + environment: + - OTEL_TRACES_EXPORTER=otlp + - OTEL_METRICS_EXPORTER=none + - OTEL_LOGS_EXPORTER=none + command: + - java + - -javaagent:/opentelemetry-javaagent.jar + - -jar + - /example-hello-world-app.jar + greeting-service: + # The opentelemetry-java-agent image is coming from the hello-world-up service above. + image: opentelemetry-java-agent + network_mode: host + volumes: + - ./example-greeting-service/target/example-greeting-service.jar:/example-greeting-service.jar + environment: + - OTEL_TRACES_EXPORTER=otlp + - OTEL_METRICS_EXPORTER=none + - OTEL_LOGS_EXPORTER=none + command: + - java + - -javaagent:/opentelemetry-javaagent.jar + - -jar + - /example-greeting-service.jar + collector: + image: otel/opentelemetry-collector-contrib:0.143.1@sha256:f051aff195ad50ed5ad9d95bcdd51d7258200c937def3797cf830366ed62e034 + network_mode: host + volumes: + - ./config/otelcol-config.yaml:/config.yaml + command: + - --config=file:/config.yaml + prometheus: + image: prom/prometheus:v3.9.1@sha256:1f0f50f06acaceb0f5670d2c8a658a599affe7b0d8e78b898c1035653849a702 + network_mode: host + volumes: + - ./config/prometheus.yaml:/prometheus.yaml + command: + - --enable-feature=exemplar-storage + - --enable-feature=native-histograms + - --config.file=/prometheus.yaml + tempo: + image: grafana/tempo:2.9.0@sha256:65a5789759435f1ef696f1953258b9bbdb18eb571d5ce711ff812d2e128288a4 + network_mode: host + volumes: + - ./config/tempo-config.yaml:/config.yaml + command: + - --config.file=/config.yaml + grafana: + image: grafana/grafana:12.3.1@sha256:2175aaa91c96733d86d31cf270d5310b278654b03f5718c59de12a865380a31f + network_mode: host + ports: + - "3000:3000" + volumes: + - ./config/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/grafana-datasources.yaml + - ./config/grafana-dashboards.yaml:/etc/grafana/provisioning/dashboards/grafana-dashboards.yaml + - ./config/grafana-example-dashboard.json:/etc/grafana/example-dashboard.json + k6: + image: grafana/k6@sha256:a7c79af2b374c9a3afa8b0fae9ec2899277d066612029b7b0fcd2fcb724ba86f + network_mode: host + volumes: + - ./config/k6-script.js:/k6-script.js + command: + - run + - /k6-script.js diff --git a/examples/example-exemplars-tail-sampling/example-greeting-service/pom.xml b/examples/example-exemplars-tail-sampling/example-greeting-service/pom.xml new file mode 100644 index 000000000..ca96b3723 --- /dev/null +++ b/examples/example-exemplars-tail-sampling/example-greeting-service/pom.xml @@ -0,0 +1,73 @@ + + + 4.0.0 + + + io.prometheus + example-exemplars-tail-sampling + 1.5.0-SNAPSHOT + + + example-greeting-service + + Example - OpenTelemetry Exemplars - Greeting Service + + Part of a distributed "Hello, World" REST service to show Exemplars with OpenTelemetry's distributed + tracing + + + + 25 + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + io.prometheus + prometheus-metrics-instrumentation-jvm + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-servlet-jakarta + ${project.version} + + + org.apache.tomcat.embed + tomcat-embed-core + 11.0.15 + + + + + ${project.artifactId} + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + io.prometheus.metrics.examples.otel.exemplars.greeting.Main + + + + + + + + + diff --git a/examples/example-exemplars-tail-sampling/example-greeting-service/src/main/java/io/prometheus/metrics/examples/otel/exemplars/greeting/GreetingServlet.java b/examples/example-exemplars-tail-sampling/example-greeting-service/src/main/java/io/prometheus/metrics/examples/otel/exemplars/greeting/GreetingServlet.java new file mode 100644 index 000000000..8b80268df --- /dev/null +++ b/examples/example-exemplars-tail-sampling/example-greeting-service/src/main/java/io/prometheus/metrics/examples/otel/exemplars/greeting/GreetingServlet.java @@ -0,0 +1,47 @@ +package io.prometheus.metrics.examples.otel.exemplars.greeting; + +import static io.prometheus.metrics.model.snapshots.Unit.nanosToSeconds; + +import io.prometheus.metrics.core.metrics.Histogram; +import io.prometheus.metrics.model.snapshots.Unit; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Random; + +/** Hello World REST servlet, with an example counter and an example histogram. */ +public class GreetingServlet extends HttpServlet { + + private static final long serialVersionUID = 0L; + + private final Random random = new Random(0); + + private final Histogram histogram; + + public GreetingServlet() { + histogram = + Histogram.builder() + .name("request_duration_seconds") + .help("request duration in seconds") + .unit(Unit.SECONDS) + .labelNames("http_status") + .register(); + histogram.initLabelValues("200"); + } + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { + long start = System.nanoTime(); + try { + Thread.sleep((long) Math.abs((random.nextGaussian() + 1.0) * 100.0)); + resp.setStatus(200); + resp.setContentType("text/plain"); + resp.getWriter().println("Hello, World!"); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } finally { + histogram.labelValues("200").observe(nanosToSeconds(System.nanoTime() - start)); + } + } +} diff --git a/examples/example-exemplars-tail-sampling/example-greeting-service/src/main/java/io/prometheus/metrics/examples/otel/exemplars/greeting/Main.java b/examples/example-exemplars-tail-sampling/example-greeting-service/src/main/java/io/prometheus/metrics/examples/otel/exemplars/greeting/Main.java new file mode 100644 index 000000000..99ba1084c --- /dev/null +++ b/examples/example-exemplars-tail-sampling/example-greeting-service/src/main/java/io/prometheus/metrics/examples/otel/exemplars/greeting/Main.java @@ -0,0 +1,32 @@ +package io.prometheus.metrics.examples.otel.exemplars.greeting; + +import io.prometheus.metrics.exporter.servlet.jakarta.PrometheusMetricsServlet; +import io.prometheus.metrics.instrumentation.jvm.JvmMetrics; +import java.io.File; +import org.apache.catalina.Context; +import org.apache.catalina.LifecycleException; +import org.apache.catalina.startup.Tomcat; + +/** Simple example using embedded Tomcat and the {@link PrometheusMetricsServlet}. */ +public class Main { + + public static void main(String[] args) throws LifecycleException { + + JvmMetrics.builder().register(); + + Tomcat tomcat = new Tomcat(); + tomcat.setPort(8081); + + Context ctx = tomcat.addContext("", new File(".").getAbsolutePath()); + + Tomcat.addServlet(ctx, "hello", new GreetingServlet()); + ctx.addServletMappingDecoded("/*", "hello"); + + Tomcat.addServlet(ctx, "metrics", new PrometheusMetricsServlet()); + ctx.addServletMappingDecoded("/metrics", "metrics"); + + tomcat.getConnector(); + tomcat.start(); + tomcat.getServer().await(); + } +} diff --git a/examples/example-exemplars-tail-sampling/example-greeting-service/version-rules.xml b/examples/example-exemplars-tail-sampling/example-greeting-service/version-rules.xml new file mode 100644 index 000000000..154e67489 --- /dev/null +++ b/examples/example-exemplars-tail-sampling/example-greeting-service/version-rules.xml @@ -0,0 +1,12 @@ + + + + + + .*-M[0-9]+ + + + + diff --git a/examples/example-exemplars-tail-sampling/example-hello-world-app/pom.xml b/examples/example-exemplars-tail-sampling/example-hello-world-app/pom.xml new file mode 100644 index 000000000..f3664d80b --- /dev/null +++ b/examples/example-exemplars-tail-sampling/example-hello-world-app/pom.xml @@ -0,0 +1,73 @@ + + + 4.0.0 + + + io.prometheus + example-exemplars-tail-sampling + 1.5.0-SNAPSHOT + + + example-hello-world-app + + Example - OpenTelemetry Exemplars - Hello World App + + Part of a distributed "Hello, World" REST service to show Exemplars with OpenTelemetry's distributed + tracing + + + + 25 + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + io.prometheus + prometheus-metrics-instrumentation-jvm + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-servlet-jakarta + ${project.version} + + + org.apache.tomcat.embed + tomcat-embed-core + 11.0.15 + + + + + ${project.artifactId} + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + io.prometheus.metrics.examples.otel.exemplars.app.Main + + + + + + + + + diff --git a/examples/example-exemplars-tail-sampling/example-hello-world-app/src/main/java/io/prometheus/metrics/examples/otel/exemplars/app/HelloWorldServlet.java b/examples/example-exemplars-tail-sampling/example-hello-world-app/src/main/java/io/prometheus/metrics/examples/otel/exemplars/app/HelloWorldServlet.java new file mode 100644 index 000000000..b770c29fb --- /dev/null +++ b/examples/example-exemplars-tail-sampling/example-hello-world-app/src/main/java/io/prometheus/metrics/examples/otel/exemplars/app/HelloWorldServlet.java @@ -0,0 +1,64 @@ +package io.prometheus.metrics.examples.otel.exemplars.app; + +import static io.prometheus.metrics.model.snapshots.Unit.nanosToSeconds; +import static java.net.http.HttpResponse.BodyHandlers.ofString; + +import io.prometheus.metrics.core.metrics.Histogram; +import io.prometheus.metrics.model.snapshots.Unit; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Random; + +/** Hello World REST servlet, with an example counter and an example histogram. */ +public class HelloWorldServlet extends HttpServlet { + + private static final long serialVersionUID = 0L; + + private final Random random = new Random(0); + + private final Histogram histogram; + + public HelloWorldServlet() { + histogram = + Histogram.builder() + .name("request_duration_seconds") + .help("request duration in seconds") + .unit(Unit.SECONDS) + .labelNames("http_status") + .register(); + histogram.initLabelValues("200"); + } + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException { + long start = System.nanoTime(); + try { + Thread.sleep((long) Math.abs((random.nextGaussian() + 1.0) * 100.0)); + String greeting = executeGreetingServiceRequest(); + resp.setStatus(200); + resp.setContentType("text/plain"); + resp.getWriter().print(greeting); + } catch (Exception e) { + throw new ServletException(e); + } finally { + histogram.labelValues("200").observe(nanosToSeconds(System.nanoTime() - start)); + } + } + + private String executeGreetingServiceRequest() + throws URISyntaxException, IOException, InterruptedException { + HttpRequest request = + HttpRequest.newBuilder().GET().uri(new URI("http://localhost:8081/")).build(); + HttpClient httpClient = HttpClient.newHttpClient(); + HttpResponse response = httpClient.send(request, ofString()); + return response.body(); + } +} diff --git a/examples/example-exemplars-tail-sampling/example-hello-world-app/src/main/java/io/prometheus/metrics/examples/otel/exemplars/app/Main.java b/examples/example-exemplars-tail-sampling/example-hello-world-app/src/main/java/io/prometheus/metrics/examples/otel/exemplars/app/Main.java new file mode 100644 index 000000000..25ea8a1c6 --- /dev/null +++ b/examples/example-exemplars-tail-sampling/example-hello-world-app/src/main/java/io/prometheus/metrics/examples/otel/exemplars/app/Main.java @@ -0,0 +1,32 @@ +package io.prometheus.metrics.examples.otel.exemplars.app; + +import io.prometheus.metrics.exporter.servlet.jakarta.PrometheusMetricsServlet; +import io.prometheus.metrics.instrumentation.jvm.JvmMetrics; +import java.io.File; +import org.apache.catalina.Context; +import org.apache.catalina.LifecycleException; +import org.apache.catalina.startup.Tomcat; + +/** Simple example using embedded Tomcat and the {@link PrometheusMetricsServlet}. */ +public class Main { + + public static void main(String[] args) throws LifecycleException { + + JvmMetrics.builder().register(); + + Tomcat tomcat = new Tomcat(); + tomcat.setPort(8080); + + Context ctx = tomcat.addContext("", new File(".").getAbsolutePath()); + + Tomcat.addServlet(ctx, "hello", new HelloWorldServlet()); + ctx.addServletMappingDecoded("/*", "hello"); + + Tomcat.addServlet(ctx, "metrics", new PrometheusMetricsServlet()); + ctx.addServletMappingDecoded("/metrics", "metrics"); + + tomcat.getConnector(); + tomcat.start(); + tomcat.getServer().await(); + } +} diff --git a/examples/example-exemplars-tail-sampling/example-hello-world-app/version-rules.xml b/examples/example-exemplars-tail-sampling/example-hello-world-app/version-rules.xml new file mode 100644 index 000000000..154e67489 --- /dev/null +++ b/examples/example-exemplars-tail-sampling/example-hello-world-app/version-rules.xml @@ -0,0 +1,12 @@ + + + + + + .*-M[0-9]+ + + + + diff --git a/examples/example-exemplars-tail-sampling/pom.xml b/examples/example-exemplars-tail-sampling/pom.xml new file mode 100644 index 000000000..8a739e939 --- /dev/null +++ b/examples/example-exemplars-tail-sampling/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + + + io.prometheus + examples + 1.5.0-SNAPSHOT + + + example-exemplars-tail-sampling + pom + + Example - Exemplars with OpenTelemetry's Tail Sampling + + Example project showing Examplars with OpenTelemetry's Tail Sampling. + + + + 11 + + + + example-greeting-service + example-hello-world-app + + diff --git a/examples/example-exporter-httpserver/README.md b/examples/example-exporter-httpserver/README.md new file mode 100644 index 000000000..341f8e2c3 --- /dev/null +++ b/examples/example-exporter-httpserver/README.md @@ -0,0 +1,38 @@ +# Built-in HTTPServer for Exposing Metrics + +## Build + +This example is built as part of the `client_java` project. + +```shell +./mvnw package +``` + +## Run + +The build creates a JAR file with the example application in +`./examples/example-exporter-httpserver/target/`. + +```shell +java -jar ./examples/example-exporter-httpserver/target/example-exporter-httpserver.jar +``` + +## Manually testing the Metrics Endpoint + +Accessing [http://localhost:9400/metrics](http://localhost:9400/metrics) with a Web browser should +yield an example of a counter metric. + +```text +# HELP uptime_seconds_total total number of seconds since this application was started +# TYPE uptime_seconds_total counter +uptime_seconds_total 301.0 +``` + +The exporter supports a `debug` URL parameter to quickly view other formats in your Web browser: + +- [http://localhost:9400/metrics?debug=text](http://localhost:9400/metrics?debug=text): Prometheus + text format, same as without the `debug` option. +- [http://localhost:9400/metrics?debug=openmetrics](http://localhost:9400/metrics?debug=openmetrics): + OpenMetrics text format. +- [http://localhost:9400/metrics?debug=prometheus-protobuf](http://localhost:9400/metrics?debug=prometheus-protobuf): + Text representation of the Prometheus protobuf format. diff --git a/examples/example-exporter-httpserver/pom.xml b/examples/example-exporter-httpserver/pom.xml new file mode 100644 index 000000000..f9ee206f0 --- /dev/null +++ b/examples/example-exporter-httpserver/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + + io.prometheus + examples + 1.5.0-SNAPSHOT + + + example-exporter-httpserver + + Example - HTTPServer Exporter + + Prometheus Metrics Example using the HTTPServer for exposing the metrics endpoint + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + io.prometheus + prometheus-metrics-instrumentation-jvm + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-httpserver + ${project.version} + + + + + ${project.artifactId} + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + io.prometheus.metrics.examples.httpserver.Main + + + + + + + + + diff --git a/examples/example-exporter-httpserver/src/main/java/io/prometheus/metrics/examples/httpserver/Main.java b/examples/example-exporter-httpserver/src/main/java/io/prometheus/metrics/examples/httpserver/Main.java new file mode 100644 index 000000000..3b0976778 --- /dev/null +++ b/examples/example-exporter-httpserver/src/main/java/io/prometheus/metrics/examples/httpserver/Main.java @@ -0,0 +1,39 @@ +package io.prometheus.metrics.examples.httpserver; + +import io.prometheus.metrics.core.metrics.Counter; +import io.prometheus.metrics.exporter.httpserver.HTTPServer; +import io.prometheus.metrics.instrumentation.jvm.JvmMetrics; +import io.prometheus.metrics.model.snapshots.Unit; +import java.io.IOException; + +/** Simple example of an application exposing metrics via Prometheus' built-in HTTPServer. */ +public class Main { + + public static void main(String[] args) throws IOException, InterruptedException { + + JvmMetrics.builder().register(); + + // Note: uptime_seconds_total is not a great example: + // The built-in JvmMetrics have an out-of-the-box metric named process_start_time_seconds + // with the start timestamp in seconds, so if you want to know the uptime you can simply + // run the Prometheus query + // time() - process_start_time_seconds + // rather than creating a custom uptime metric. + Counter counter = + Counter.builder() + .name("uptime_seconds_total") + .help("total number of seconds since this application was started") + .unit(Unit.SECONDS) + .register(); + + HTTPServer server = HTTPServer.builder().port(9400).buildAndStart(); + + System.out.println( + "HTTPServer listening on port http://localhost:" + server.getPort() + "/metrics"); + + while (true) { + Thread.sleep(1000); + counter.inc(); + } + } +} diff --git a/examples/example-exporter-multi-target/README.md b/examples/example-exporter-multi-target/README.md new file mode 100644 index 000000000..7b20217ac --- /dev/null +++ b/examples/example-exporter-multi-target/README.md @@ -0,0 +1,41 @@ +# Multi-Target pattern example + +## Build + +This example is built as part of the `client_java` project. + +```shell +./mvnw package +``` + +## Run + +The build creates a JAR file with the example application in +`./examples/example-exporter-multi-target/target/`. + +```shell +java -jar ./examples/example-exporter-multi-target/target/example-exporter-multi-target.jar +``` + +## Manually testing the Metrics Endpoint + +Accessing [http://localhost:9400/metrics](http://localhost:9400/metrics) with a Web browser should +yield an example of a +counter metric. + +```text +# HELP uptime_seconds_total total number of seconds since this application was started +# TYPE uptime_seconds_total counter +uptime_seconds_total 301.0 +``` + +The exporter supports a `debug` URL parameter to quickly view other formats in your Web browser: + +- [http://localhost:9400/metrics?debug=text](http://localhost:9400/metrics?debug=text): Prometheus + text format, same as + without the `debug` option. +- [http://localhost:9400/metrics?debug=openmetrics](http://localhost:9400/metrics?debug=openmetrics): + OpenMetrics text + format. +- [http://localhost:9400/metrics?debug=prometheus-protobuf](http://localhost:9400/metrics?debug=prometheus-protobuf): + Text representation of the Prometheus protobuf format. diff --git a/examples/example-exporter-multi-target/pom.xml b/examples/example-exporter-multi-target/pom.xml new file mode 100644 index 000000000..ac13ff2a1 --- /dev/null +++ b/examples/example-exporter-multi-target/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + + io.prometheus + examples + 1.5.0-SNAPSHOT + + + example-exporter-multi-target + + Example - HTTPServer Exporter Multi Target + + Prometheus Metrics Example for multi-target pattern implementation + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + io.prometheus + prometheus-metrics-instrumentation-jvm + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-httpserver + ${project.version} + + + + + ${project.artifactId} + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + io.prometheus.metrics.examples.multitarget.Main + + + + + + + + + diff --git a/examples/example-exporter-multi-target/src/main/java/io/prometheus/metrics/examples/multitarget/Main.java b/examples/example-exporter-multi-target/src/main/java/io/prometheus/metrics/examples/multitarget/Main.java new file mode 100644 index 000000000..0fac9a0d3 --- /dev/null +++ b/examples/example-exporter-multi-target/src/main/java/io/prometheus/metrics/examples/multitarget/Main.java @@ -0,0 +1,19 @@ +package io.prometheus.metrics.examples.multitarget; + +import io.prometheus.metrics.exporter.httpserver.HTTPServer; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import java.io.IOException; + +/** Simple example of an application exposing metrics via Prometheus' built-in HTTPServer. */ +public class Main { + + public static void main(String[] args) throws IOException, InterruptedException { + + SampleMultiCollector xmc = new SampleMultiCollector(); + PrometheusRegistry.defaultRegistry.register(xmc); + HTTPServer server = HTTPServer.builder().port(9401).buildAndStart(); + + System.out.println( + "HTTPServer listening on port http://localhost:" + server.getPort() + "/metrics"); + } +} diff --git a/examples/example-exporter-multi-target/src/main/java/io/prometheus/metrics/examples/multitarget/SampleMultiCollector.java b/examples/example-exporter-multi-target/src/main/java/io/prometheus/metrics/examples/multitarget/SampleMultiCollector.java new file mode 100644 index 000000000..207c024a5 --- /dev/null +++ b/examples/example-exporter-multi-target/src/main/java/io/prometheus/metrics/examples/multitarget/SampleMultiCollector.java @@ -0,0 +1,87 @@ +package io.prometheus.metrics.examples.multitarget; + +import io.prometheus.metrics.model.registry.MultiCollector; +import io.prometheus.metrics.model.registry.PrometheusScrapeRequest; +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import io.prometheus.metrics.model.snapshots.PrometheusNaming; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +public class SampleMultiCollector implements MultiCollector { + + public SampleMultiCollector() { + super(); + } + + @Override + public MetricSnapshots collect() { + return new MetricSnapshots(); + } + + @Override + public MetricSnapshots collect(PrometheusScrapeRequest scrapeRequest) { + return collectMetricSnapshots(scrapeRequest); + } + + protected MetricSnapshots collectMetricSnapshots(PrometheusScrapeRequest scrapeRequest) { + + GaugeSnapshot.Builder gaugeBuilder = GaugeSnapshot.builder(); + gaugeBuilder.name("x_load").help("process load"); + + CounterSnapshot.Builder counterBuilder = CounterSnapshot.builder(); + counterBuilder.name(PrometheusNaming.sanitizeMetricName("x_calls_total")).help("invocations"); + + String[] targetNames = scrapeRequest.getParameterValues("target"); + String targetName; + String[] procs = scrapeRequest.getParameterValues("proc"); + if (targetNames == null || targetNames.length == 0) { + targetName = "defaultTarget"; + procs = null; // ignore procs param + } else { + targetName = targetNames[0]; + } + CounterSnapshot.CounterDataPointSnapshot.Builder counterDataPointBuilder = + CounterSnapshot.CounterDataPointSnapshot.builder(); + io.prometheus.metrics.model.snapshots.GaugeSnapshot.GaugeDataPointSnapshot.Builder + gaugeDataPointBuilder = GaugeSnapshot.GaugeDataPointSnapshot.builder(); + Labels lbls = Labels.of("target", targetName); + + if (procs == null || procs.length == 0) { + counterDataPointBuilder.labels(lbls.merge(Labels.of("proc", "defaultProc"))); + gaugeDataPointBuilder.labels(lbls.merge(Labels.of("proc", "defaultProc"))); + counterDataPointBuilder.value(70); + gaugeDataPointBuilder.value(Math.random()); + + counterBuilder.dataPoint(counterDataPointBuilder.build()); + gaugeBuilder.dataPoint(gaugeDataPointBuilder.build()); + + } else { + for (int i = 0; i < procs.length; i++) { + counterDataPointBuilder.labels(lbls.merge(Labels.of("proc", procs[i]))); + gaugeDataPointBuilder.labels(lbls.merge(Labels.of("proc", procs[i]))); + counterDataPointBuilder.value(Math.random()); + gaugeDataPointBuilder.value(Math.random()); + + counterBuilder.dataPoint(counterDataPointBuilder.build()); + gaugeBuilder.dataPoint(gaugeDataPointBuilder.build()); + } + } + Collection snaps = new ArrayList<>(); + snaps.add(counterBuilder.build()); + snaps.add(gaugeBuilder.build()); + return new MetricSnapshots(snaps); + } + + @Override + public List getPrometheusNames() { + List names = new ArrayList(); + names.add("x_calls_total"); + names.add("x_load"); + return names; + } +} diff --git a/examples/example-exporter-opentelemetry/README.md b/examples/example-exporter-opentelemetry/README.md new file mode 100644 index 000000000..03dc39e45 --- /dev/null +++ b/examples/example-exporter-opentelemetry/README.md @@ -0,0 +1,33 @@ +# OpenTelemetry Exporter Example + +## Build + +This example is built as part of the `client_java` project. + +```shell +./mvnw package +``` + +## Run + +Assuming `./examples/example-exporter-opentelemetry/target/example-exporter-opentelemetry.jar` is +present, run the demo with: + +```bash +cd ./examples/example-exporter-opentelemetry/ +docker-compose up +``` + +This will set up the following scenario: + + + +```mermaid +flowchart LR + A[example app] -->|OTLP|B[OpenTelemetry collector] -->|Prometheus remote write|C[Prometheus server] +``` + + + +The OpenTelemetry collector is configured to log incoming metrics to the console. +The Prometheus server is running on [http://localhost:9090](http://localhost:9090). diff --git a/examples/example-exporter-opentelemetry/config/otelcol-config.yaml b/examples/example-exporter-opentelemetry/config/otelcol-config.yaml new file mode 100644 index 000000000..923840e0c --- /dev/null +++ b/examples/example-exporter-opentelemetry/config/otelcol-config.yaml @@ -0,0 +1,21 @@ +receivers: + otlp: + protocols: + grpc: + http: + +processors: + batch: + +exporters: + prometheusremotewrite: + endpoint: http://localhost:9090/api/v1/write + logging: + verbosity: detailed + +service: + pipelines: + metrics: + receivers: [otlp] + processors: [batch] + exporters: [logging, prometheusremotewrite] diff --git a/examples/example-exporter-opentelemetry/config/prometheus.yaml b/examples/example-exporter-opentelemetry/config/prometheus.yaml new file mode 100644 index 000000000..18369e9ca --- /dev/null +++ b/examples/example-exporter-opentelemetry/config/prometheus.yaml @@ -0,0 +1 @@ +# empty, because this Prometheus instance receives all metrics via remote write. diff --git a/examples/example-exporter-opentelemetry/docker-compose.yaml b/examples/example-exporter-opentelemetry/docker-compose.yaml new file mode 100644 index 000000000..9d9b8fda9 --- /dev/null +++ b/examples/example-exporter-opentelemetry/docker-compose.yaml @@ -0,0 +1,31 @@ +version: "3" +services: + prometheus-opentelemetry-example-app: + image: openjdk:11.0.16-jre@sha256:356949c3125c4fa8104745e7ea92bd995da4567634e6599b470d2f972d13e0e2 + network_mode: host + ports: + - "5005:5005" + volumes: + - ./target/example-exporter-opentelemetry.jar:/example-exporter-opentelemetry.jar + command: + - java + - -jar + #- -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005 + - /example-exporter-opentelemetry.jar + collector: + image: otel/opentelemetry-collector-contrib:0.143.1@sha256:f051aff195ad50ed5ad9d95bcdd51d7258200c937def3797cf830366ed62e034 + network_mode: host + volumes: + - ./config/otelcol-config.yaml:/config.yaml + command: + - --config=file:/config.yaml + prometheus: + image: prom/prometheus:v3.9.1@sha256:1f0f50f06acaceb0f5670d2c8a658a599affe7b0d8e78b898c1035653849a702 + network_mode: host + volumes: + - ./config/prometheus.yaml:/prometheus.yaml + command: + - --enable-feature=exemplar-storage + - --enable-feature=native-histograms + - --web.enable-remote-write-receiver + - --config.file=/prometheus.yaml diff --git a/examples/example-exporter-opentelemetry/oats-tests/agent/Dockerfile b/examples/example-exporter-opentelemetry/oats-tests/agent/Dockerfile new file mode 100644 index 000000000..ee5340755 --- /dev/null +++ b/examples/example-exporter-opentelemetry/oats-tests/agent/Dockerfile @@ -0,0 +1,9 @@ +FROM eclipse-temurin:25.0.1_8-jre@sha256:96bccca442e8842a7366df338f5960e3342862ea6b8d42b97009a3dfd8602547 + +COPY target/example-exporter-opentelemetry.jar ./app.jar +# check that the resource attributes from the agent are used, epsecially the service.instance.id should be the same +ADD --chmod=644 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v2.21.0/opentelemetry-javaagent.jar /usr/src/app/opentelemetry-javaagent.jar +ENV JAVA_TOOL_OPTIONS=-javaagent:/usr/src/app/opentelemetry-javaagent.jar + +#ENTRYPOINT [ "java", "-Dotel.javaagent.debug=true","-jar", "./app.jar" ] # for debugging +ENTRYPOINT [ "java", "-jar", "./app.jar" ] diff --git a/examples/example-exporter-opentelemetry/oats-tests/agent/docker-compose.yml b/examples/example-exporter-opentelemetry/oats-tests/agent/docker-compose.yml new file mode 100644 index 000000000..2b820bdea --- /dev/null +++ b/examples/example-exporter-opentelemetry/oats-tests/agent/docker-compose.yml @@ -0,0 +1,13 @@ +# OATS is an acceptance testing framework for OpenTelemetry - https://github.com/grafana/oats/tree/main/yaml +version: "3.4" + +services: + java: + build: + context: ../.. + dockerfile: oats-tests/agent/Dockerfile + environment: + OTEL_SERVICE_NAME: "rolldice" + OTEL_EXPORTER_OTLP_ENDPOINT: http://lgtm:4317 + OTEL_EXPORTER_OTLP_PROTOCOL: grpc + OTEL_METRIC_EXPORT_INTERVAL: "5000" # so we don't have to wait 60s for metrics diff --git a/examples/example-exporter-opentelemetry/oats-tests/agent/example_target_info.json b/examples/example-exporter-opentelemetry/oats-tests/agent/example_target_info.json new file mode 100644 index 000000000..57fa87af1 --- /dev/null +++ b/examples/example-exporter-opentelemetry/oats-tests/agent/example_target_info.json @@ -0,0 +1,73 @@ +{ + "status": "success", + "data": { + "resultType": "vector", + "result": [ + { + "metric": { + "__name__": "target_info", + "container_id": "0282187277c5f259f3405455bd5094a936642415a02bd8dbbdb41a73987d8db7", + "host_arch": "amd64", + "host_name": "0282187277c5", + "instance": "6b3318d9-2b87-498b-a1a3-bbfaecc96374", + "job": "rolldice", + "os_description": "Linux 6.8.0-57-generic", + "os_type": "linux", + "process_command_args": "[\"/opt/java/openjdk/bin/java\",\"-jar\",\"./app.jar\"]", + "process_executable_path": "/opt/java/openjdk/bin/java", + "process_pid": "1", + "process_runtime_description": "Eclipse Adoptium OpenJDK 64-Bit Server VM 21.0.6+7-LTS", + "process_runtime_name": "OpenJDK Runtime Environment", + "process_runtime_version": "21.0.6+7-LTS", + "service_instance_id": "6b3318d9-2b87-498b-a1a3-bbfaecc96374", + "service_name": "rolldice", + "telemetry_distro_name": "opentelemetry-java-instrumentation", + "telemetry_distro_version": "2.8.0", + "telemetry_sdk_language": "java", + "telemetry_sdk_name": "opentelemetry", + "telemetry_sdk_version": "1.42.1" + }, + "value": [1743776399.291, "1"] + }, + { + "metric": { + "__name__": "target_info", + "http_scheme": "http", + "instance": "e6ff9e41-acdb-4c47-88b5-8112c831f5b5", + "job": "otelcol-contrib", + "net_host_port": "8888", + "server_port": "8888", + "service_instance_id": "e6ff9e41-acdb-4c47-88b5-8112c831f5b5", + "service_name": "otelcol-contrib", + "service_version": "0.122.1", + "url_scheme": "http" + }, + "value": [1743776399.291, "1"] + }, + { + "metric": { + "__name__": "target_info", + "container_id": "0282187277c5f259f3405455bd5094a936642415a02bd8dbbdb41a73987d8db7", + "host_arch": "amd64", + "host_name": "0282187277c5", + "instance": "6b3318d9-2b87-498b-a1a3-bbfaecc96374", + "job": "rolldice", + "os_description": "Linux 6.8.0-57-generic", + "os_type": "linux", + "process_command_line": "/opt/java/openjdk/bin/java -javaagent:/usr/src/app/opentelemetry-javaagent.jar -jar ./app.jar", + "process_executable_path": "/opt/java/openjdk/bin/java", + "process_pid": "1", + "process_runtime_description": "Eclipse Adoptium OpenJDK 64-Bit Server VM 21.0.6+7-LTS", + "process_runtime_name": "OpenJDK Runtime Environment", + "process_runtime_version": "21.0.6+7-LTS", + "service_instance_id": "6b3318d9-2b87-498b-a1a3-bbfaecc96374", + "service_name": "rolldice", + "telemetry_sdk_language": "java", + "telemetry_sdk_name": "opentelemetry", + "telemetry_sdk_version": "1.48.0" + }, + "value": [1743776399.291, "1"] + } + ] + } +} diff --git a/examples/example-exporter-opentelemetry/oats-tests/agent/oats.yaml b/examples/example-exporter-opentelemetry/oats-tests/agent/oats.yaml new file mode 100644 index 000000000..899d1cd5d --- /dev/null +++ b/examples/example-exporter-opentelemetry/oats-tests/agent/oats.yaml @@ -0,0 +1,12 @@ +# OATS is an acceptance testing framework for OpenTelemetry - +# https://github.com/grafana/oats/tree/main/yaml +oats-schema-version: 2 +docker-compose: + files: + - ./docker-compose.yml +expected: + custom-checks: + - script: ./service_instance_id_check.py + metrics: + - promql: "uptime_seconds_total{}" + value: ">= 0" diff --git a/examples/example-exporter-opentelemetry/oats-tests/agent/service_instance_id_check.py b/examples/example-exporter-opentelemetry/oats-tests/agent/service_instance_id_check.py new file mode 100755 index 000000000..6bb8291f7 --- /dev/null +++ b/examples/example-exporter-opentelemetry/oats-tests/agent/service_instance_id_check.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 +""" +Check if the service instance id is present in the exported data. +Returns 0 if the service instance id is present in the exported data. +""" +import json +import urllib.parse +from urllib.request import urlopen + + +def get_json(url): + with urlopen(url) as response: + return json.loads(response.read().decode("utf-8")) + + +def main(): + # Query Prometheus for target_info + res = get_json("http://localhost:9090/api/v1/query?query=target_info") + + # Uncomment for local debugging + # with open('example_target_info.json') as f: + # res = json.load(f) + + instance_ids = { + r["metric"]["instance"] + for r in res["data"]["result"] + if r["metric"].get("service_name") != "otelcol-contrib" + } + instance_ids = list(instance_ids) + + print(f"Instance ids found:{instance_ids}") + if len(instance_ids) > 1: + print("More than one instance id found") + print(res) + + # Both the agent and the exporter should report the same instance id + assert len(instance_ids) == 1, "Expected exactly one instance id" + + query = f'target_info{{instance="{instance_ids[0]}"}}' + encoded_query = urllib.parse.quote_plus(query) + res = get_json(f"http://localhost:9090/api/v1/query?query={encoded_query}") + + infos = res["data"]["result"] + print(infos) + + # They should not have the same target info (e.g. only the agent has telemetry_distro_name) + assert len(infos) == 2, "Expected two target info results" + + +if __name__ == "__main__": + main() diff --git a/examples/example-exporter-opentelemetry/oats-tests/http/Dockerfile b/examples/example-exporter-opentelemetry/oats-tests/http/Dockerfile new file mode 100644 index 000000000..5e8ea0db7 --- /dev/null +++ b/examples/example-exporter-opentelemetry/oats-tests/http/Dockerfile @@ -0,0 +1,5 @@ +FROM eclipse-temurin:25.0.1_8-jre@sha256:96bccca442e8842a7366df338f5960e3342862ea6b8d42b97009a3dfd8602547 + +COPY target/example-exporter-opentelemetry.jar ./app.jar + +ENTRYPOINT [ "java", "-jar", "./app.jar" ] diff --git a/examples/example-exporter-opentelemetry/oats-tests/http/docker-compose.yml b/examples/example-exporter-opentelemetry/oats-tests/http/docker-compose.yml new file mode 100644 index 000000000..889278010 --- /dev/null +++ b/examples/example-exporter-opentelemetry/oats-tests/http/docker-compose.yml @@ -0,0 +1,13 @@ +# OATS is an acceptance testing framework for OpenTelemetry - https://github.com/grafana/oats/tree/main/yaml +version: "3.4" + +services: + java: + build: + context: ../.. + dockerfile: oats-tests/http/Dockerfile + environment: + OTEL_SERVICE_NAME: "rolldice" + OTEL_EXPORTER_OTLP_ENDPOINT: http://lgtm:4318 + OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf + OTEL_METRIC_EXPORT_INTERVAL: "5000" # so we don't have to wait 60s for metrics diff --git a/examples/example-exporter-opentelemetry/oats-tests/http/oats.yaml b/examples/example-exporter-opentelemetry/oats-tests/http/oats.yaml new file mode 100644 index 000000000..dbcfcf84f --- /dev/null +++ b/examples/example-exporter-opentelemetry/oats-tests/http/oats.yaml @@ -0,0 +1,10 @@ +# OATS is an acceptance testing framework for OpenTelemetry - +# https://github.com/grafana/oats/tree/main/yaml +oats-schema-version: 2 +docker-compose: + files: + - ./docker-compose.yml +expected: + metrics: + - promql: "uptime_seconds_total{}" + value: ">= 0" diff --git a/examples/example-exporter-opentelemetry/pom.xml b/examples/example-exporter-opentelemetry/pom.xml new file mode 100644 index 000000000..8e8fa6891 --- /dev/null +++ b/examples/example-exporter-opentelemetry/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + + io.prometheus + examples + 1.5.0-SNAPSHOT + + + example-exporter-opentelemetry + + Example - OpenTelemetry Metrics Exporter + + Example of exposing metrics in OpenTelemetry format and pushing them to an OpenTelemetry collector + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + io.prometheus + prometheus-metrics-instrumentation-jvm + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-opentelemetry + ${project.version} + + + + + ${project.artifactId} + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + io.prometheus.metrics.examples.opentelemetry.Main + + + + + + + + + diff --git a/examples/example-exporter-opentelemetry/src/main/java/io/prometheus/metrics/examples/opentelemetry/Main.java b/examples/example-exporter-opentelemetry/src/main/java/io/prometheus/metrics/examples/opentelemetry/Main.java new file mode 100644 index 000000000..b1aa440b1 --- /dev/null +++ b/examples/example-exporter-opentelemetry/src/main/java/io/prometheus/metrics/examples/opentelemetry/Main.java @@ -0,0 +1,42 @@ +package io.prometheus.metrics.examples.opentelemetry; + +import io.prometheus.metrics.core.metrics.Counter; +import io.prometheus.metrics.exporter.opentelemetry.OpenTelemetryExporter; +import io.prometheus.metrics.instrumentation.jvm.JvmMetrics; +import io.prometheus.metrics.model.snapshots.Unit; + +/** Simple example of an application exposing metrics pushing metrics via OTLP. */ +public class Main { + + public static void main(String[] args) throws Exception { + System.out.println("Starting example application"); + + // Note: Some JVM metrics are also defined as OpenTelemetry's semantic conventions. + // We have plans to implement a configuration option for JvmMetrics to use OpenTelemetry + // naming conventions rather than the Prometheus names. + JvmMetrics.builder().register(); + + // Note: uptime_seconds_total is not a great example: + // The built-in JvmMetrics have an out-of-the-box metric named process_start_time_seconds + // with the start timestamp in seconds, so if you want to know the uptime you can simply + // run the Prometheus query + // time() - process_start_time_seconds + // rather than creating a custom uptime metric. + Counter counter = + Counter.builder() + .name("uptime_seconds_total") + .help("total number of seconds since this application was started") + .unit(Unit.SECONDS) + .register(); + + OpenTelemetryExporter.builder() + .intervalSeconds(5) // ridiculously short interval for demo purposes + .buildAndStart(); + + while (true) { + Thread.sleep(1000); + System.out.println("Incrementing counter"); + counter.inc(); + } + } +} diff --git a/examples/example-exporter-opentelemetry/src/main/java/io/prometheus/metrics/examples/opentelemetry/ManualCompleteMetricsTest.java b/examples/example-exporter-opentelemetry/src/main/java/io/prometheus/metrics/examples/opentelemetry/ManualCompleteMetricsTest.java new file mode 100644 index 000000000..b2aa8950f --- /dev/null +++ b/examples/example-exporter-opentelemetry/src/main/java/io/prometheus/metrics/examples/opentelemetry/ManualCompleteMetricsTest.java @@ -0,0 +1,147 @@ +package io.prometheus.metrics.examples.opentelemetry; + +/* +import io.prometheus.metrics.core.metrics.Counter; +import io.prometheus.metrics.core.metrics.Gauge; +import io.prometheus.metrics.core.metrics.Histogram; +import io.prometheus.metrics.core.metrics.Info; +import io.prometheus.metrics.core.metrics.StateSet; +import io.prometheus.metrics.core.metrics.Summary; +import io.prometheus.metrics.exporter.httpserver.HTTPServer; +import io.prometheus.metrics.exporter.opentelemetry.OpenTelemetryExporter; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.Unit; +import io.prometheus.metrics.model.snapshots.UnknownSnapshot; + +import java.util.Random; +*/ + +class ManualCompleteMetricsTest { + + // This contains a complete set of all metric types, and target_info and otel_scope_info. + // I used this to expose in Prometheus format and OTLP format at the same time and compare the + // results. + // I'm keeping this as a backup for now, but this should be converted to an integration test. + // + // To run it, add prometheus-metrics-exporter-httpserver as a dependency and configure Prometheus + // to scrape from port 9400 in addition to receiving metrics via remote write. + + /* + public static void main(String[] args) throws Exception { + + Counter counter = Counter.newBuilder() + .withName("uptime_seconds_total") + .withHelp("total number of seconds since this application was started") + .withUnit(Unit.SECONDS) + .register(); + + Gauge gauge = Gauge.newBuilder() + .withName("temperature_celsius") + .withHelp("temperature in celsius") + .withUnit(Unit.CELSIUS) + .withLabelNames("location") + .register(); + + gauge.labelValues("inside").set(23.4); + gauge.labelValues("outside").set(9.3); + + // By default, the histogram will be exported as an exponential histogram in OpenTelemetry. + Histogram histogram = Histogram.newBuilder() + .withName("request_latency_seconds") + .withHelp("Request duration in seconds") + .withUnit(Unit.SECONDS) + .withLabelNames("http_status") + .register(); + + Random random = new Random(0); + for (int i = 0; i < 1000; i++) { + histogram.labelValues("200").observe(random.nextGaussian()); + } + + // Explicitly use a classic-only histogram to have an example of a classic + // histogram in OpenTelemetry + Histogram classicHistogram = Histogram.newBuilder() + .withName("request_size_bytes") + .withHelp("Request size in Bytes") + .withUnit(Unit.BYTES) + .withLabelNames("path") + .classicOnly() + .withClassicBuckets(128, 256, 512, 1024, 2048) + .register(); + + for (int i = 0; i < 15; i++) { + classicHistogram.labelValues("200").observe(random.nextInt(3000)); + } + + Summary summary = Summary.newBuilder() + .withName("response_latency_seconds") + .withHelp("Response latency seconds") + .withUnit(Unit.BYTES) + .withQuantile(0.95) + .withQuantile(0.99) + .register(); + + for (int i = 0; i < 1000; i++) { + summary.observe(random.nextGaussian()); + } + + Info targetInfo = Info.newBuilder() + .withName("target_info") + .withHelp("OTel resource") + .withLabelNames("service.version") + .register(); + targetInfo.setLabelValues("1.0.0"); + + Info scopeInfo = Info.newBuilder() + .withName("otel_scope_info") + .withLabelNames("otel.scope.name", "otel.scope.version", "library_mascot") + .register(); + + scopeInfo.setLabelValues("my.instrumentation.lib", "100.3", "bear"); + + Info info = Info.newBuilder() + .withName("java_runtime_info") + .withHelp("Java runtime info") + .withLabelNames("version", "vendor", "runtime") + .register(); + + String version = System.getProperty("java.runtime.version", "unknown"); + String vendor = System.getProperty("java.vm.vendor", "unknown"); + String runtime = System.getProperty("java.runtime.name", "unknown"); + + info.setLabelValues(version, vendor, runtime); + + StateSet stateSet = StateSet.newBuilder() + .withName("feature_flags") + .withLabelNames("env") + .withStates("feature1", "feature2") + .register(); + + stateSet.labelValues("dev").setFalse("feature1"); + stateSet.labelValues("dev").setTrue("feature2"); + + PrometheusRegistry.defaultRegistry.register(() -> UnknownSnapshot.newBuilder() + .withName("my_unknown_metric") + .addDataPoint(UnknownSnapshot.UnknownDataPointSnapshot.newBuilder() + .withLabels(Labels.of("a", "1", "b", "2")) + .withValue(3.0) + .build()) + .build()); + + HTTPServer server = HTTPServer.newBuilder() + .withPort(9400) + .buildAndStart(); + System.out.println("HTTPServer listening on port http://localhost:" + server.getPort() + "/metrics"); + + OpenTelemetryExporter.newBuilder() + .withIntervalSeconds(5) + .buildAndStart(); + + while (true) { + Thread.sleep(1000); + counter.inc(); + } + } + */ +} diff --git a/examples/example-exporter-servlet-tomcat/README.md b/examples/example-exporter-servlet-tomcat/README.md new file mode 100644 index 000000000..05ac894e3 --- /dev/null +++ b/examples/example-exporter-servlet-tomcat/README.md @@ -0,0 +1,97 @@ +# Tomcat Servlet Example + +## Build + +This example is built as part of the `client_java` project. + +```shell +./mvnw package +``` + +## Run + +The build creates a JAR file with the example application in +`./examples/example-exporter-servlet-tomcat/target/`. + +```shell +java -jar ./examples/example-exporter-servlet-tomcat/target/example-exporter-servlet-tomcat.jar +``` + +Accessing [http://localhost:8080/](http://localhost:8080/) with a Web browser should yield +`Hello, World!`. + +## Manually testing the Metrics Endpoint + +Metrics are available on [http://localhost:8080/metrics](http://localhost:8080/metrics). The default +Prometheus text +format looks like this: + +```text +# HELP request_duration_seconds request duration in seconds +# TYPE request_duration_seconds histogram +request_duration_seconds_bucket{http_status="200",le="0.005"} 0 +request_duration_seconds_bucket{http_status="200",le="0.01"} 1 +request_duration_seconds_bucket{http_status="200",le="0.025"} 1 +request_duration_seconds_bucket{http_status="200",le="0.05"} 2 +request_duration_seconds_bucket{http_status="200",le="0.1"} 5 +request_duration_seconds_bucket{http_status="200",le="0.25"} 11 +request_duration_seconds_bucket{http_status="200",le="0.5"} 12 +request_duration_seconds_bucket{http_status="200",le="1.0"} 12 +request_duration_seconds_bucket{http_status="200",le="2.5"} 12 +request_duration_seconds_bucket{http_status="200",le="5.0"} 12 +request_duration_seconds_bucket{http_status="200",le="10.0"} 12 +request_duration_seconds_bucket{http_status="200",le="+Inf"} 12 +request_duration_seconds_count{http_status="200"} 12 +request_duration_seconds_sum{http_status="200"} 1.513772412 +# HELP requests_total total number of requests +# TYPE requests_total counter +requests_total{http_status="200"} 12.0 +``` + +The exporter servlet supports a `debug` URL parameter to quickly view other formats in your Web +browser: + +- [http://localhost:8080/metrics?debug=text](http://localhost:8080/metrics?debug=text): Prometheus + text format, same as + without the `debug` option. +- [http://localhost:8080/metrics?debug=openmetrics](http://localhost:8080/metrics?debug=openmetrics): + OpenMetrics text + format. +- [http://localhost:8080/metrics?debug=prometheus-protobuf](http://localhost:8080/metrics?debug=prometheus-protobuf): + Text representation of the Prometheus protobuf format. + +## Testing with the Prometheus Server + +1. Download the latest Prometheus server release + from [https://github.com/prometheus/prometheus/releases](https://github.com/prometheus/prometheus/releases). +2. Extract the archive +3. Edit `prometheus.yml` and append the following snippet at the end: + ```yaml + job_name: "tomcat-servlet-example" + static_configs: + - targets: ["localhost:8080"] + ``` +4. Run with native histograms and examplars enabled: + ```shell + ./prometheus --enable-feature=native-histograms --enable-feature=exemplar-storage + ``` + +Verify that the `tomcat-servlet-example` target is up +on [http://localhost:9090/targets](http://localhost:9090/targets). + +Prometheus is now scraping metrics in Protobuf format. If you type the name +`request_duration_seconds` you will see a +non-human-readable representation of the histogram including the native buckets: + +![Screenshot showing a Prometheus Native Histogram in Text Format](https://github.com/prometheus/client_java/assets/330535/863efe0b-a9eb-40ae-a078-72497abc6f04) + +Note: You have to run at least one GET request on the Hello World +endpoint [http://localhost:8080](http://localhost:8080) before you see the metric. + +Use the `histogram_quantile()` function to calculate quantiles from the native histogram: + +```text +histogram_quantile(0.95, rate(request_duration_seconds[10m])) +``` + +![Screenshot showing the 95th Percentile Calculated from a Prometheus Native Histogram](https://github.com/prometheus/client_java/assets/330535/889fb769-9445-4f6f-8540-2b1ddffca55e) diff --git a/examples/example-exporter-servlet-tomcat/pom.xml b/examples/example-exporter-servlet-tomcat/pom.xml new file mode 100644 index 000000000..b5f0d1e60 --- /dev/null +++ b/examples/example-exporter-servlet-tomcat/pom.xml @@ -0,0 +1,71 @@ + + + 4.0.0 + + + io.prometheus + examples + 1.5.0-SNAPSHOT + + + example-exporter-servlet-tomcat + + Example - Servlet Exporter with Tomcat + + Prometheus Metrics Example using Embedded Tomcat and the Exporter Servlet + + + + 25 + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + io.prometheus + prometheus-metrics-instrumentation-jvm + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-servlet-jakarta + ${project.version} + + + org.apache.tomcat.embed + tomcat-embed-core + 11.0.15 + + + + + ${project.artifactId} + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + io.prometheus.metrics.examples.tomcat_servlet.Main + + + + + + + + + diff --git a/examples/example-exporter-servlet-tomcat/src/main/java/io/prometheus/metrics/examples/tomcat_servlet/HelloWorldServlet.java b/examples/example-exporter-servlet-tomcat/src/main/java/io/prometheus/metrics/examples/tomcat_servlet/HelloWorldServlet.java new file mode 100644 index 000000000..309cc5ba4 --- /dev/null +++ b/examples/example-exporter-servlet-tomcat/src/main/java/io/prometheus/metrics/examples/tomcat_servlet/HelloWorldServlet.java @@ -0,0 +1,58 @@ +package io.prometheus.metrics.examples.tomcat_servlet; + +import static io.prometheus.metrics.model.snapshots.Unit.nanosToSeconds; + +import io.prometheus.metrics.core.metrics.Counter; +import io.prometheus.metrics.core.metrics.Histogram; +import io.prometheus.metrics.model.snapshots.Unit; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Random; + +/** Hello World REST servlet, with an example counter and an example histogram. */ +public class HelloWorldServlet extends HttpServlet { + + private static final long serialVersionUID = 0L; + + private final Random random = new Random(0); + + // Note: The requests_total counter is not a great example, because the + // request_duration_seconds histogram below also has a count with the number of requests. + private final Counter counter = + Counter.builder() + .name("requests_total") + .help("total number of requests") + .labelNames("http_status") + .register(); + + private final Histogram histogram = + Histogram.builder() + .name("request_duration_seconds") + .help("request duration in seconds") + .unit(Unit.SECONDS) + .labelNames("http_status") + .register(); + + public HelloWorldServlet() { + counter.initLabelValues("200"); + histogram.initLabelValues("200"); + } + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { + long start = System.nanoTime(); + try { + Thread.sleep((long) Math.abs((random.nextGaussian() + 1.0) * 100.0)); + resp.setStatus(200); + resp.setContentType("text/plain"); + resp.getWriter().println("Hello, World!"); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } finally { + counter.labelValues("200").inc(); + histogram.labelValues("200").observe(nanosToSeconds(System.nanoTime() - start)); + } + } +} diff --git a/examples/example-exporter-servlet-tomcat/src/main/java/io/prometheus/metrics/examples/tomcat_servlet/Main.java b/examples/example-exporter-servlet-tomcat/src/main/java/io/prometheus/metrics/examples/tomcat_servlet/Main.java new file mode 100644 index 000000000..81bc2ac19 --- /dev/null +++ b/examples/example-exporter-servlet-tomcat/src/main/java/io/prometheus/metrics/examples/tomcat_servlet/Main.java @@ -0,0 +1,36 @@ +package io.prometheus.metrics.examples.tomcat_servlet; + +import io.prometheus.metrics.exporter.servlet.jakarta.PrometheusMetricsServlet; +import io.prometheus.metrics.instrumentation.jvm.JvmMetrics; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import org.apache.catalina.Context; +import org.apache.catalina.LifecycleException; +import org.apache.catalina.startup.Tomcat; + +/** Simple example using embedded Tomcat and the {@link PrometheusMetricsServlet}. */ +public class Main { + + public static void main(String[] args) throws LifecycleException, IOException { + + JvmMetrics.builder().register(); + + Tomcat tomcat = new Tomcat(); + Path tmpDir = Files.createTempDirectory("prometheus-tomcat-servlet-example-"); + tomcat.setBaseDir(tmpDir.toFile().getAbsolutePath()); + + Context ctx = tomcat.addContext("", new File(".").getAbsolutePath()); + + Tomcat.addServlet(ctx, "hello", new HelloWorldServlet()); + ctx.addServletMappingDecoded("/*", "hello"); + + Tomcat.addServlet(ctx, "metrics", new PrometheusMetricsServlet()); + ctx.addServletMappingDecoded("/metrics", "metrics"); + + tomcat.getConnector(); + tomcat.start(); + tomcat.getServer().await(); + } +} diff --git a/examples/example-exporter-servlet-tomcat/version-rules.xml b/examples/example-exporter-servlet-tomcat/version-rules.xml new file mode 100644 index 000000000..154e67489 --- /dev/null +++ b/examples/example-exporter-servlet-tomcat/version-rules.xml @@ -0,0 +1,12 @@ + + + + + + .*-M[0-9]+ + + + + diff --git a/examples/example-native-histogram/README.md b/examples/example-native-histogram/README.md new file mode 100644 index 000000000..0550a4f94 --- /dev/null +++ b/examples/example-native-histogram/README.md @@ -0,0 +1,32 @@ +# Native Histogram End-to-End Example + +## Build + +This example is built as part of the `client_java` project. + +```shell +./mvnw package +``` + +This should create the file +`./examples/example-native-histogram/target/example-native-histogram.jar`. + +## Run + +With `./examples/example-native-histogram/target/example-native-histogram.jar` present, simply run: + +```shell +cd ./examples/example-native-histogram/ +docker-compose up +``` + +This will run the following Docker containers: + +- [http://localhost:9400/metrics](http://localhost:9400/metrics) example application +- [http://localhost:9090](http://localhost:9090) Prometheus server +- [http://localhost:3000](http://localhost:3000) Grafana (user _admin_, password _admin_) + +You might need to replace `localhost` with `host.docker.internal` on macOS or Windows. + +The Grafana server is preconfigured with two dashboards, one based on the classic histogram and the +other one based on the native histogram. diff --git a/examples/example-native-histogram/docker-compose.yaml b/examples/example-native-histogram/docker-compose.yaml new file mode 100644 index 000000000..e99fafeef --- /dev/null +++ b/examples/example-native-histogram/docker-compose.yaml @@ -0,0 +1,27 @@ +version: "3" +services: + example-application: + image: eclipse-temurin:25.0.1_8-jre@sha256:96bccca442e8842a7366df338f5960e3342862ea6b8d42b97009a3dfd8602547 + network_mode: host + volumes: + - ./target/example-native-histogram.jar:/example-native-histogram.jar + command: + - /opt/java/openjdk/bin/java + - -jar + - /example-native-histogram.jar + prometheus: + image: prom/prometheus:v3.9.1@sha256:1f0f50f06acaceb0f5670d2c8a658a599affe7b0d8e78b898c1035653849a702 + network_mode: host + volumes: + - ./docker-compose/prometheus.yml:/prometheus.yml + command: + - --enable-feature=native-histograms + - --config.file=/prometheus.yml + grafana: + image: grafana/grafana:12.3.1@sha256:2175aaa91c96733d86d31cf270d5310b278654b03f5718c59de12a865380a31f + network_mode: host + volumes: + - ./docker-compose/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/grafana-datasources.yaml + - ./docker-compose/grafana-dashboards.yaml:/etc/grafana/provisioning/dashboards/grafana-dashboards.yaml + - ./docker-compose/grafana-dashboard-classic-histogram.json:/etc/grafana/grafana-dashboard-classic-histogram.json + - ./docker-compose/grafana-dashboard-native-histogram.json:/etc/grafana/grafana-dashboard-native-histogram.json diff --git a/examples/example-native-histogram/docker-compose/grafana-dashboard-classic-histogram.json b/examples/example-native-histogram/docker-compose/grafana-dashboard-classic-histogram.json new file mode 100644 index 000000000..1935e4836 --- /dev/null +++ b/examples/example-native-histogram/docker-compose/grafana-dashboard-classic-histogram.json @@ -0,0 +1,570 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "request rate, error rate, duration", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "description": "", + "gridPos": { + "h": 2, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 6, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "# Classic Histogram", + "mode": "markdown" + }, + "pluginVersion": "10.0.0", + "type": "text" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 2 + }, + "id": 1, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "sum(rate(request_latency_seconds_count{job=\"$job\", instance=\"$instance\"}[5m]))", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Request Rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 10 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "sum(rate(request_latency_seconds_count{job=\"$job\", instance=\"$instance\", status=~\"5..\"}[5m])) / sum(rate(request_latency_seconds_count{job=\"$job\", instance=\"$instance\"}[5m]))\n\n", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Error Rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 18 + }, + "id": 3, + "options": { + "displayMode": "gradient", + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false + }, + "showUnfilled": true, + "valueMode": "color" + }, + "pluginVersion": "10.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum by (le) (rate(request_latency_seconds_bucket{job=\"$job\", instance=\"$instance\"}[5m]))", + "format": "heatmap", + "instant": false, + "legendFormat": "{{le}}", + "range": true, + "refId": "A" + } + ], + "title": "Duration histogram (s)", + "type": "bargauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 26 + }, + "id": 5, + "options": { + "calculate": false, + "cellGap": 1, + "color": { + "exponent": 0.5, + "fill": "dark-orange", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "Oranges", + "steps": 64 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": true + }, + "rowsFrame": { + "layout": "auto" + }, + "tooltip": { + "show": true, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "reverse": false, + "unit": "s" + } + }, + "pluginVersion": "10.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum by (le) (rate(request_latency_seconds_bucket{job=\"$job\", instance=\"$instance\"}[5m]))", + "format": "heatmap", + "instant": false, + "range": true, + "refId": "A" + } + ], + "title": "Duration Heatmap", + "type": "heatmap" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 34 + }, + "id": 4, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.5.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "histogram_quantile(0.95, sum by (le) (rate(request_latency_seconds_bucket{job=\"$job\", instance=\"$instance\"}[5m])))", + "format": "time_series", + "instant": false, + "legendFormat": "95th", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "histogram_quantile(0.5, sum by (le) (rate(request_latency_seconds_bucket{job=\"$job\", instance=\"$instance\"}[5m])))", + "hide": false, + "legendFormat": "50th", + "range": true, + "refId": "B" + } + ], + "title": "Duration percentiles", + "type": "timeseries" + } + ], + "refresh": "", + "schemaVersion": 38, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": true, + "text": "greeting-service-out-of-the-box-classic-histogram", + "value": "greeting-service-out-of-the-box-classic-histogram" + }, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "definition": "label_values(job)", + "hide": 0, + "includeAll": false, + "label": "", + "multi": false, + "name": "job", + "options": [], + "query": { + "query": "label_values(job)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "2aa84f09-7278-4972-9dc4-5248bcab0306", + "value": "2aa84f09-7278-4972-9dc4-5248bcab0306" + }, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "definition": "label_values({job=\"$job\"},instance)", + "hide": 0, + "includeAll": false, + "label": "instance", + "multi": false, + "name": "instance", + "options": [], + "query": { + "query": "label_values({job=\"$job\"},instance)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Classic Histogram", + "uid": "f543a537-cb96-470d-a349-660ad1513136", + "version": 1, + "weekStart": "" +} diff --git a/examples/example-native-histogram/docker-compose/grafana-dashboard-native-histogram.json b/examples/example-native-histogram/docker-compose/grafana-dashboard-native-histogram.json new file mode 100644 index 000000000..edee69044 --- /dev/null +++ b/examples/example-native-histogram/docker-compose/grafana-dashboard-native-histogram.json @@ -0,0 +1,500 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "request rate, error rate, duration", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "description": "", + "gridPos": { + "h": 2, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 6, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "# Native Histogram", + "mode": "markdown" + }, + "pluginVersion": "10.0.0", + "type": "text" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 2 + }, + "id": 1, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "histogram_count(sum(rate(request_latency_seconds{job=\"$job\", instance=\"$instance\"}[5m])))", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Request Rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 10 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "histogram_count(sum(rate(request_latency_seconds{job=\"$job\", instance=\"$instance\", status=~\"5..\"}[5m]))) / histogram_count(sum(rate(request_latency_seconds{job=\"$job\", instance=\"$instance\"}[5m])))", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Error Rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 18 + }, + "id": 7, + "options": { + "calculate": false, + "cellGap": 1, + "color": { + "exponent": 0.5, + "fill": "dark-orange", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "Oranges", + "steps": 64 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": true + }, + "rowsFrame": { + "layout": "auto" + }, + "tooltip": { + "show": true, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "reverse": false, + "unit": "s" + } + }, + "pluginVersion": "10.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "sum(rate(request_latency_seconds{job=\"$job\", instance=\"$instance\"}[5m]))", + "instant": false, + "range": true, + "refId": "A" + } + ], + "title": "Duration Heatmap", + "type": "heatmap" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 26 + }, + "id": 4, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.5.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "histogram_quantile(0.95, sum(rate(request_latency_seconds{job=\"$job\", instance=\"$instance\"}[5m])))", + "format": "time_series", + "instant": false, + "legendFormat": "95th", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "exemplar": false, + "expr": "histogram_quantile(0.5, sum(rate(request_latency_seconds{job=\"$job\", instance=\"$instance\"}[5m])))", + "hide": false, + "legendFormat": "50th", + "range": true, + "refId": "B" + } + ], + "title": "Duration percentiles", + "type": "timeseries" + } + ], + "refresh": "", + "schemaVersion": 38, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": true, + "text": "greeting-service-out-of-the-box-exponential-histogram", + "value": "greeting-service-out-of-the-box-exponential-histogram" + }, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "definition": "label_values(job)", + "hide": 0, + "includeAll": false, + "label": "", + "multi": false, + "name": "job", + "options": [], + "query": { + "query": "label_values(job)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "f63e7d5e-ee7c-43ea-9576-753bcd833e9b", + "value": "f63e7d5e-ee7c-43ea-9576-753bcd833e9b" + }, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "definition": "label_values({job=\"$job\"},instance)", + "hide": 0, + "includeAll": false, + "label": "instance", + "multi": false, + "name": "instance", + "options": [], + "query": { + "query": "label_values({job=\"$job\"},instance)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Native Histogram", + "uid": "b5b5f4ce-beab-497a-a425-df71508abe0d", + "version": 1, + "weekStart": "" +} diff --git a/examples/example-native-histogram/docker-compose/grafana-dashboards.yaml b/examples/example-native-histogram/docker-compose/grafana-dashboards.yaml new file mode 100644 index 000000000..7478d4c9e --- /dev/null +++ b/examples/example-native-histogram/docker-compose/grafana-dashboards.yaml @@ -0,0 +1,13 @@ +apiVersion: 1 + +providers: + - name: "Classic Histogram Example" + type: file + options: + path: /etc/grafana/grafana-dashboard-classic-histogram.json + foldersFromFilesStructure: false + - name: "Native Histogram Example" + type: file + options: + path: /etc/grafana/grafana-dashboard-native-histogram.json + foldersFromFilesStructure: false diff --git a/examples/example-native-histogram/docker-compose/grafana-datasources.yaml b/examples/example-native-histogram/docker-compose/grafana-datasources.yaml new file mode 100644 index 000000000..d442d28d2 --- /dev/null +++ b/examples/example-native-histogram/docker-compose/grafana-datasources.yaml @@ -0,0 +1,7 @@ +apiVersion: 1 + +datasources: + - name: Prometheus + type: prometheus + uid: prometheus + url: http://localhost:9090 diff --git a/examples/example-native-histogram/docker-compose/prometheus.yml b/examples/example-native-histogram/docker-compose/prometheus.yml new file mode 100644 index 000000000..36fb85e7d --- /dev/null +++ b/examples/example-native-histogram/docker-compose/prometheus.yml @@ -0,0 +1,10 @@ +--- +global: + scrape_interval: 5s # very short interval for demo purposes + +scrape_configs: + - job_name: "demo" + # this will make Prometheus scrape both, the native and the classic histogram. + scrape_classic_histograms: true + static_configs: + - targets: ["localhost:9400"] diff --git a/examples/example-native-histogram/pom.xml b/examples/example-native-histogram/pom.xml new file mode 100644 index 000000000..5324ffb91 --- /dev/null +++ b/examples/example-native-histogram/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + + io.prometheus + examples + 1.5.0-SNAPSHOT + + + example-native-histogram + + Example - Native Histogram + + End-to-End example of a Native histogram: Java app -> Prometheus -> Grafana + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + io.prometheus + prometheus-metrics-instrumentation-jvm + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-httpserver + ${project.version} + + + + + ${project.artifactId} + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + io.prometheus.metrics.examples.nativehistogram.Main + + + + + + + + + diff --git a/examples/example-native-histogram/src/main/java/io/prometheus/metrics/examples/nativehistogram/Main.java b/examples/example-native-histogram/src/main/java/io/prometheus/metrics/examples/nativehistogram/Main.java new file mode 100644 index 000000000..b23fd054d --- /dev/null +++ b/examples/example-native-histogram/src/main/java/io/prometheus/metrics/examples/nativehistogram/Main.java @@ -0,0 +1,38 @@ +package io.prometheus.metrics.examples.nativehistogram; + +import io.prometheus.metrics.core.metrics.Histogram; +import io.prometheus.metrics.exporter.httpserver.HTTPServer; +import io.prometheus.metrics.instrumentation.jvm.JvmMetrics; +import io.prometheus.metrics.model.snapshots.Unit; +import java.io.IOException; +import java.util.Random; + +public class Main { + + public static void main(String[] args) throws IOException, InterruptedException { + + JvmMetrics.builder().register(); + + Histogram histogram = + Histogram.builder() + .name("request_latency_seconds") + .help("request latency in seconds") + .unit(Unit.SECONDS) + .labelNames("path", "status") + .register(); + + HTTPServer server = HTTPServer.builder().port(9400).buildAndStart(); + + System.out.println( + "HTTPServer listening on port http://localhost:" + server.getPort() + "/metrics"); + + Random random = new Random(0); + + while (true) { + double duration = Math.abs(random.nextGaussian() / 10.0 + 0.2); + String status = random.nextInt(100) < 20 ? "500" : "200"; + histogram.labelValues("/", status).observe(duration); + Thread.sleep(1000); + } + } +} diff --git a/examples/example-prometheus-properties/README.md b/examples/example-prometheus-properties/README.md new file mode 100644 index 000000000..2a4e61e80 --- /dev/null +++ b/examples/example-prometheus-properties/README.md @@ -0,0 +1,30 @@ +# prometheus.properties Example + +## Build + +This example is built as part of the `client_java` project. + +```shell +./mvnw package +``` + +This should create the file +`./examples/example-prometheus-properties/target/example-prometheus-properties.jar`. + +## Run + +```shell +java -jar ./examples/example-prometheus-properties/target/example-prometheus-properties.jar +``` + +View the metrics +on [http://localhost:9401/metrics?name[]=request_duration_seconds&name[]=request_size_bytes](http://localhost:9401/metrics?name[]=request_duration_seconds&name[]=request_size_bytes). + +The example has a `prometheus.properties` file in the classpath with a few examples of how to change +settings at runtime. + +There are multiple alternative ways to specify the location of the `prometheus.properties` file: + +- Put it in the classpath, like in this example. +- Set the environment variable `PROMETHEUS_CONFIG` to the file location. +- Set the `prometheus.config` System property to the file location. diff --git a/examples/example-prometheus-properties/pom.xml b/examples/example-prometheus-properties/pom.xml new file mode 100644 index 000000000..b02b8fa03 --- /dev/null +++ b/examples/example-prometheus-properties/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + + io.prometheus + examples + 1.5.0-SNAPSHOT + + + example-prometheus-properties + + Example - prometheus.properties + + Example of runtime configuration with prometheus.properties + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + io.prometheus + prometheus-metrics-instrumentation-jvm + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-httpserver + ${project.version} + + + + + ${project.artifactId} + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + io.prometheus.metrics.examples.prometheus_properties.Main + + + + + + + + + diff --git a/examples/example-prometheus-properties/src/main/java/io/prometheus/metrics/examples/prometheus_properties/Main.java b/examples/example-prometheus-properties/src/main/java/io/prometheus/metrics/examples/prometheus_properties/Main.java new file mode 100644 index 000000000..e1f5954bc --- /dev/null +++ b/examples/example-prometheus-properties/src/main/java/io/prometheus/metrics/examples/prometheus_properties/Main.java @@ -0,0 +1,45 @@ +package io.prometheus.metrics.examples.prometheus_properties; + +import io.prometheus.metrics.core.metrics.Histogram; +import io.prometheus.metrics.exporter.httpserver.HTTPServer; +import io.prometheus.metrics.instrumentation.jvm.JvmMetrics; +import io.prometheus.metrics.model.snapshots.Unit; +import java.io.IOException; +import java.util.Random; + +public class Main { + + public static void main(String[] args) throws IOException, InterruptedException { + + JvmMetrics.builder().register(); + + Histogram requestDuration = + Histogram.builder() + .name("request_duration_seconds") + .help("request duration in seconds") + .unit(Unit.SECONDS) + .register(); + + Histogram requestSize = + Histogram.builder() + .name("request_size_bytes") + .help("request size in bytes") + .unit(Unit.BYTES) + .register(); + + HTTPServer server = HTTPServer.builder().port(9400).buildAndStart(); + + System.out.println( + "HTTPServer listening on port http://localhost:" + server.getPort() + "/metrics"); + + Random random = new Random(0); + + while (true) { + double duration = Math.abs(random.nextGaussian() / 10.0 + 0.2); + double size = random.nextInt(1000) + 256; + requestDuration.observe(duration); + requestSize.observe(size); + Thread.sleep(1000); + } + } +} diff --git a/examples/example-prometheus-properties/src/main/resources/prometheus.properties b/examples/example-prometheus-properties/src/main/resources/prometheus.properties new file mode 100644 index 000000000..a786fd370 --- /dev/null +++ b/examples/example-prometheus-properties/src/main/resources/prometheus.properties @@ -0,0 +1,8 @@ +io.prometheus.exporter.httpServer.port = 9401 +io.prometheus.exporter.includeCreatedTimestamps = true + +# Set a new default for all histograms +io.prometheus.metrics.histogramClassicUpperBounds = .2, .4, .8, .1 + +# Override the default for one specific histogram +io.prometheus.metrics.request_size_bytes.histogramClassicUpperBounds = 256, 512, 768, 1024 diff --git a/examples/example-simpleclient-bridge/README.md b/examples/example-simpleclient-bridge/README.md new file mode 100644 index 000000000..9abce3bfa --- /dev/null +++ b/examples/example-simpleclient-bridge/README.md @@ -0,0 +1,29 @@ +# Built-in HTTPServer for Exposing Metrics + +## Build + +This example is built as part of the `client_java` project. + +```shell +./mvnw package +``` + +## Run + +The build creates a JAR file with the example application in +`./examples/example-simpleclient-bridge/target/`. + +```shell +java -jar ./examples/example-simpleclient-bridge/target/example-simpleclient-bridge.jar +``` + +This should expose a metrics endpoint +on [http://localhost:9400/metrics](http://localhost:9400/metrics). +The `events_total` counter should be exposed.with a Web browser should yield an example of a counter +metric. + +```text +# HELP events_total total number of events +# TYPE events_total counter +events_total 1.0 +``` diff --git a/examples/example-simpleclient-bridge/pom.xml b/examples/example-simpleclient-bridge/pom.xml new file mode 100644 index 000000000..f6d2c4207 --- /dev/null +++ b/examples/example-simpleclient-bridge/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + + io.prometheus + examples + 1.5.0-SNAPSHOT + + + example-simpleclient-bridge + + Example - Simpleclient Bridge + + Prometheus Metrics Example of the Simpleclient Backwards Compatibility module + + + + + io.prometheus + simpleclient + 0.16.0 + + + io.prometheus + prometheus-metrics-simpleclient-bridge + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-httpserver + ${project.version} + + + + + ${project.artifactId} + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + io.prometheus.metrics.examples.simpleclient.Main + + + + + + + + + diff --git a/examples/example-simpleclient-bridge/src/main/java/io/prometheus/metrics/examples/simpleclient/Main.java b/examples/example-simpleclient-bridge/src/main/java/io/prometheus/metrics/examples/simpleclient/Main.java new file mode 100644 index 000000000..dd9dbcdcb --- /dev/null +++ b/examples/example-simpleclient-bridge/src/main/java/io/prometheus/metrics/examples/simpleclient/Main.java @@ -0,0 +1,36 @@ +package io.prometheus.metrics.examples.simpleclient; + +import io.prometheus.client.Counter; +import io.prometheus.metrics.exporter.httpserver.HTTPServer; +import io.prometheus.metrics.simpleclient.bridge.SimpleclientCollector; +import java.io.IOException; + +/** Simple example of the simpleclient backwards compatibility module. */ +public class Main { + + public static void main(String[] args) throws IOException, InterruptedException { + + // The following call will register all metrics from the old CollectorRegistry.defaultRegistry + // with the new PrometheusRegistry.defaultRegistry. + + SimpleclientCollector.builder().register(); + + // Register a counter with the old CollectorRegistry. + // It doesn't matter whether the counter is registered before or after bridging with + // PrometheusRegistry. + + Counter simpleclientCounter = + Counter.build().name("events_total").help("total number of events").register(); + + simpleclientCounter.inc(); + + // Expose metrics from the new PrometheusRegistry. This should contain the events_total metric. + + HTTPServer server = HTTPServer.builder().port(9400).buildAndStart(); + + System.out.println( + "HTTPServer listening on port http://localhost:" + server.getPort() + "/metrics"); + + Thread.currentThread().join(); + } +} diff --git a/examples/example-simpleclient-bridge/version-rules.xml b/examples/example-simpleclient-bridge/version-rules.xml new file mode 100644 index 000000000..388ad5670 --- /dev/null +++ b/examples/example-simpleclient-bridge/version-rules.xml @@ -0,0 +1,12 @@ + + + + + + .*(alpha|beta)-[0-9] + + + + diff --git a/examples/pom.xml b/examples/pom.xml new file mode 100644 index 000000000..f88b313a2 --- /dev/null +++ b/examples/pom.xml @@ -0,0 +1,35 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + examples + pom + + Examples + + Example projects for the Prometheus Metrics Library. + + + + true + + + + example-exemplars-tail-sampling + example-exporter-servlet-tomcat + example-exporter-httpserver + example-exporter-multi-target + example-exporter-opentelemetry + example-simpleclient-bridge + example-native-histogram + example-prometheus-properties + + + diff --git a/integration-tests/it-common/pom.xml b/integration-tests/it-common/pom.xml new file mode 100644 index 000000000..2faac1769 --- /dev/null +++ b/integration-tests/it-common/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + + + io.prometheus + integration-tests + 1.5.0-SNAPSHOT + + + it-common + + Integration Tests - Common Utilities + + Common utilities for integration tests + + + + + io.prometheus + prometheus-metrics-exposition-formats + ${project.version} + + + + + + + src/test/resources + true + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + + + + diff --git a/integration-tests/it-common/src/test/java/io/prometheus/client/it/common/ExporterTest.java b/integration-tests/it-common/src/test/java/io/prometheus/client/it/common/ExporterTest.java new file mode 100644 index 000000000..605e760f4 --- /dev/null +++ b/integration-tests/it-common/src/test/java/io/prometheus/client/it/common/ExporterTest.java @@ -0,0 +1,158 @@ +package io.prometheus.client.it.common; + +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; + +import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.zip.GZIPInputStream; +import org.apache.commons.io.IOUtils; +import org.junit.jupiter.api.AfterEach; +import org.testcontainers.containers.BindMode; +import org.testcontainers.containers.GenericContainer; + +public abstract class ExporterTest { + private final GenericContainer sampleAppContainer; + private final Volume sampleAppVolume; + protected final String sampleApp; + + public ExporterTest(String sampleApp) throws IOException, URISyntaxException { + this.sampleApp = sampleApp; + this.sampleAppVolume = + Volume.create("it-exporter") + .copy("../../it-" + sampleApp + "/target/" + sampleApp + ".jar"); + this.sampleAppContainer = + new GenericContainer<>("eclipse-temurin:25") + .withFileSystemBind(sampleAppVolume.getHostPath(), "/app", BindMode.READ_ONLY) + .withWorkingDirectory("/app") + .withLogConsumer(LogConsumer.withPrefix(sampleApp)) + .withExposedPorts(9400); + } + + // @BeforeEach? + protected void start() { + start("success"); + } + + protected void start(String outcome) { + sampleAppContainer + .withCommand("java", "-jar", "/app/" + sampleApp + ".jar", "9400", outcome) + .start(); + } + + @AfterEach + public void tearDown() throws IOException { + sampleAppContainer.stop(); + sampleAppVolume.remove(); + } + + public static void assertContentType(String expected, String actual) { + if (!expected.replace(" ", "").equals(actual)) { + assertThat(actual).isEqualTo(expected); + } + } + + protected Response scrape(String method, String queryString, String... requestHeaders) + throws IOException { + return scrape( + method, + URI.create( + "http://localhost:" + + sampleAppContainer.getMappedPort(9400) + + "/metrics?" + + queryString), + requestHeaders); + } + + public static Response scrape(String method, URI uri, String... requestHeaders) + throws IOException { + long timeoutMillis = TimeUnit.SECONDS.toMillis(5); + HttpURLConnection con = (HttpURLConnection) uri.toURL().openConnection(); + con.setRequestMethod(method); + for (int i = 0; i < requestHeaders.length; i += 2) { + con.setRequestProperty(requestHeaders[i], requestHeaders[i + 1]); + } + long start = System.currentTimeMillis(); + Exception exception = null; + while (System.currentTimeMillis() - start < timeoutMillis) { + try { + if (con.getResponseCode() == 200) { + return new Response( + con.getResponseCode(), + con.getHeaderFields(), + IOUtils.toByteArray(con.getInputStream())); + } else { + return new Response( + con.getResponseCode(), + con.getHeaderFields(), + IOUtils.toByteArray(con.getErrorStream())); + } + } catch (Exception e) { + exception = e; + try { + Thread.sleep(100); + } catch (InterruptedException ignored) { + // ignore + } + } + } + if (exception != null) { + exception.printStackTrace(); + } + fail("timeout while getting metrics from " + uri); + return null; // will not happen + } + + public static class Response { + public final int status; + private final Map headers; + public final byte[] body; + + private Response(int status, Map> headers, byte[] body) { + this.status = status; + this.headers = new HashMap<>(headers.size()); + this.body = body; + for (Map.Entry> entry : headers.entrySet()) { + if (entry.getKey() + != null) { // HttpUrlConnection uses pseudo key "null" for the status line + this.headers.put(entry.getKey().toLowerCase(Locale.ROOT), entry.getValue().get(0)); + } + } + } + + public String getHeader(String name) { + // HTTP headers are case-insensitive + return headers.get(name.toLowerCase(Locale.ROOT)); + } + + public String stringBody() { + return new String(body, UTF_8); + } + + public String gzipBody() throws IOException { + return new String( + IOUtils.toByteArray(new GZIPInputStream(new ByteArrayInputStream(body))), UTF_8); + } + + public List protoBody() throws IOException { + List metrics = new ArrayList<>(); + InputStream in = new ByteArrayInputStream(body); + while (in.available() > 0) { + metrics.add(Metrics.MetricFamily.parseDelimitedFrom(in)); + } + return metrics; + } + } +} diff --git a/integration-tests/it-common/src/test/java/io/prometheus/client/it/common/LogConsumer.java b/integration-tests/it-common/src/test/java/io/prometheus/client/it/common/LogConsumer.java new file mode 100644 index 000000000..a57c5a7f3 --- /dev/null +++ b/integration-tests/it-common/src/test/java/io/prometheus/client/it/common/LogConsumer.java @@ -0,0 +1,28 @@ +package io.prometheus.client.it.common; + +import java.util.function.Consumer; +import org.testcontainers.containers.output.OutputFrame; + +/** Print Docker logs from TestContainers to stdout or stderr. */ +public class LogConsumer implements Consumer { + + private final String prefix; + + private LogConsumer(String prefix) { + this.prefix = prefix; + } + + public static LogConsumer withPrefix(String prefix) { + return new LogConsumer(prefix); + } + + @Override + public void accept(OutputFrame outputFrame) { + switch (outputFrame.getType()) { + case STDOUT -> System.out.print(prefix + " - " + outputFrame.getUtf8String()); + case END -> System.out.println(prefix + " - END"); + default -> // STDERR or unexpected + System.err.print(prefix + " - " + outputFrame.getUtf8String()); + } + } +} diff --git a/integration-tests/it-common/src/test/java/io/prometheus/client/it/common/Volume.java b/integration-tests/it-common/src/test/java/io/prometheus/client/it/common/Volume.java new file mode 100644 index 000000000..af5b0918e --- /dev/null +++ b/integration-tests/it-common/src/test/java/io/prometheus/client/it/common/Volume.java @@ -0,0 +1,105 @@ +package io.prometheus.client.it.common; + +import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; + +import java.io.File; +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.file.*; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.function.Predicate; + +/** Temporary directory in ./target/ to be mounted as a volume in Docker containers. */ +public class Volume { + + private final Path tmpDir; // will be created in the ./target/ directory + + private Volume(Path tmpDir) { + this.tmpDir = tmpDir; + } + + public static Volume create(String prefix) throws IOException, URISyntaxException { + Path targetDir = Paths.get(Volume.class.getResource("/").toURI()).getParent(); + assertThat(targetDir.getFileName().toString()) + .as("failed to locate target/ directory") + .isEqualTo("target"); + return new Volume(Files.createTempDirectory(targetDir, prefix + "-")); + } + + /** + * Copy a file or directory to this volume. + * + * @param src is relative to {@code ./target/} + */ + public Volume copy(String src) throws IOException { + Path srcPath = tmpDir.getParent().resolve(src); + if (Files.isRegularFile(srcPath)) { + Files.copy(srcPath, tmpDir.resolve(srcPath.getFileName()), REPLACE_EXISTING); + } else if (Files.isDirectory(srcPath)) { + Path dest = tmpDir.resolve(srcPath.getFileName()); + Files.createDirectories(dest); + Files.walkFileTree( + srcPath, + new SimpleFileVisitor() { + + // create parent directories + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) + throws IOException { + Files.createDirectories(dest.resolve(srcPath.relativize(dir))); + return FileVisitResult.CONTINUE; + } + + // copy file + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) + throws IOException { + Files.copy(file, dest.resolve(srcPath.relativize(file)), REPLACE_EXISTING); + return FileVisitResult.CONTINUE; + } + }); + } else { + fail(src + ": No such file or directory"); + } + return this; + } + + /** Remove files in tmpDir if they match the predicate. */ + public void rm(Predicate predicate) throws IOException { + Files.walkFileTree( + tmpDir, + new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) + throws IOException { + if (predicate.test(file)) { + Files.delete(file); + } + return FileVisitResult.CONTINUE; + } + }); + } + + public String getHostPath() { + return tmpDir.toString(); + } + + /** Recursively remove tmpDir and its contents. */ + public void remove() throws IOException { + if (!deleteRecursively(tmpDir.toFile())) { + throw new IOException(tmpDir + ": Failed to remove temporary test directory."); + } + } + + private boolean deleteRecursively(File file) { + File[] allContents = file.listFiles(); + if (allContents != null) { + for (File child : allContents) { + deleteRecursively(child); + } + } + return file.delete(); + } +} diff --git a/integration-tests/it-common/src/test/resources/project_version.properties b/integration-tests/it-common/src/test/resources/project_version.properties new file mode 100644 index 000000000..3c459b19d --- /dev/null +++ b/integration-tests/it-common/src/test/resources/project_version.properties @@ -0,0 +1,3 @@ +# ${project.version} will be replaced by Maven at built time +# when this file is copied to the target/ directory. +project.version=${project.version} diff --git a/integration-tests/it-common/version-rules.xml b/integration-tests/it-common/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/integration-tests/it-common/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/integration-tests/it-exporter/it-exporter-httpserver-sample/pom.xml b/integration-tests/it-exporter/it-exporter-httpserver-sample/pom.xml new file mode 100644 index 000000000..f52c8434e --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-httpserver-sample/pom.xml @@ -0,0 +1,57 @@ + + + 4.0.0 + + + io.prometheus + it-exporter + 1.5.0-SNAPSHOT + + + it-exporter-httpserver-sample + + Integration Tests - HTTPServer Exporter Sample + + HTTPServer Sample for the Exporter Integration Test + + + + + io.prometheus + prometheus-metrics-exporter-httpserver + ${project.version} + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + + + exporter-httpserver-sample + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + io.prometheus.metrics.it.exporter.httpserver.HTTPServerSample + + + + + + + + + diff --git a/integration-tests/it-exporter/it-exporter-httpserver-sample/src/main/java/io/prometheus/metrics/it/exporter/httpserver/HTTPServerSample.java b/integration-tests/it-exporter/it-exporter-httpserver-sample/src/main/java/io/prometheus/metrics/it/exporter/httpserver/HTTPServerSample.java new file mode 100644 index 000000000..8490cd64e --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-httpserver-sample/src/main/java/io/prometheus/metrics/it/exporter/httpserver/HTTPServerSample.java @@ -0,0 +1,95 @@ +package io.prometheus.metrics.it.exporter.httpserver; + +import io.prometheus.metrics.core.metrics.Counter; +import io.prometheus.metrics.core.metrics.Gauge; +import io.prometheus.metrics.core.metrics.Info; +import io.prometheus.metrics.exporter.httpserver.HTTPServer; +import io.prometheus.metrics.model.registry.Collector; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Unit; +import java.io.IOException; + +public class HTTPServerSample { + + enum Mode { + success, + error + } + + public static void main(String[] args) throws IOException, InterruptedException { + + if (args.length != 2) { + System.err.println("Usage: java -jar exporter-httpserver-sample.jar "); + System.err.println("Where mode is \"success\" or \"error\"."); + System.exit(1); + } + + int port = parsePortOrExit(args[0]); + Mode mode = parseModeOrExit(args[1]); + run(mode, port); + } + + private static void run(Mode mode, int port) throws IOException, InterruptedException { + Counter counter = + Counter.builder() + .name("uptime_seconds_total") + .help("total number of seconds since this application was started") + .unit(Unit.SECONDS) + .register(); + counter.inc(17); + + Info info = + Info.builder() + .name("integration_test_info") + .help("Info metric on this integration test") + .labelNames("test_name") + .register(); + info.addLabelValues("exporter-httpserver-sample"); + + Gauge gauge = + Gauge.builder() + .name("temperature_celsius") + .help("Temperature in Celsius") + .unit(Unit.CELSIUS) + .labelNames("location") + .register(); + gauge.labelValues("inside").set(23.0); + gauge.labelValues("outside").set(27.0); + + if (mode == Mode.error) { + Collector failingCollector = + () -> { + throw new RuntimeException("Simulating an error."); + }; + + PrometheusRegistry.defaultRegistry.register(failingCollector); + } + + HTTPServer server = HTTPServer.builder().port(port).buildAndStart(); + + System.out.println( + "HTTPServer listening on port http://localhost:" + server.getPort() + "/metrics"); + Thread.currentThread().join(); // wait forever + } + + private static int parsePortOrExit(String port) { + try { + return Integer.parseInt(port); + } catch (NumberFormatException e) { + System.err.println("\"" + port + "\": Invalid port number."); + System.exit(1); + } + return 0; // this won't happen + } + + private static Mode parseModeOrExit(String mode) { + try { + return Mode.valueOf(mode); + } catch (IllegalArgumentException e) { + System.err.println( + "\"" + mode + "\": Invalid mode. Legal values are \"success\" and \"error\"."); + System.exit(1); + } + return null; // this won't happen + } +} diff --git a/integration-tests/it-exporter/it-exporter-httpserver-sample/version-rules.xml b/integration-tests/it-exporter/it-exporter-httpserver-sample/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-httpserver-sample/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/integration-tests/it-exporter/it-exporter-no-protobuf/pom.xml b/integration-tests/it-exporter/it-exporter-no-protobuf/pom.xml new file mode 100644 index 000000000..f75c398a5 --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-no-protobuf/pom.xml @@ -0,0 +1,69 @@ + + + 4.0.0 + + + io.prometheus + it-exporter + 1.5.0-SNAPSHOT + + + it-exporter-no-protobuf + + Integration Tests - HTTPServer Exporter Sample - no protobuf + + HTTPServer Sample for the Exporter Integration Test without protobuf + + + + + io.prometheus + prometheus-metrics-exporter-httpserver + ${project.version} + + + io.prometheus + prometheus-metrics-exposition-formats + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + io.prometheus + prometheus-metrics-exposition-formats + + + + + + + exporter-no-protobuf + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + io.prometheus.metrics.it.exporter.httpserver.HTTPServerSample + + + + + + + + + diff --git a/integration-tests/it-exporter/it-exporter-no-protobuf/src/main/java/io/prometheus/metrics/it/exporter/httpserver/HTTPServerSample.java b/integration-tests/it-exporter/it-exporter-no-protobuf/src/main/java/io/prometheus/metrics/it/exporter/httpserver/HTTPServerSample.java new file mode 100644 index 000000000..dba07e51f --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-no-protobuf/src/main/java/io/prometheus/metrics/it/exporter/httpserver/HTTPServerSample.java @@ -0,0 +1,96 @@ +package io.prometheus.metrics.it.exporter.httpserver; + +import io.prometheus.metrics.core.metrics.Counter; +import io.prometheus.metrics.core.metrics.Gauge; +import io.prometheus.metrics.core.metrics.Info; +import io.prometheus.metrics.exporter.httpserver.HTTPServer; +import io.prometheus.metrics.model.registry.Collector; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Unit; +import java.io.IOException; + +public class HTTPServerSample { + + enum Mode { + success, + error + } + + public static void main(String[] args) throws IOException, InterruptedException { + + if (args.length != 2) { + System.err.println("Usage: java -jar exporter-httpserver-sample.jar "); + System.err.println("Where mode is \"success\" or \"error\"."); + System.exit(1); + } + + int port = parsePortOrExit(args[0]); + Mode mode = parseModeOrExit(args[1]); + + run(mode, port); + } + + private static void run(Mode mode, int port) throws IOException, InterruptedException { + Counter counter = + Counter.builder() + .name("uptime_seconds_total") + .help("total number of seconds since this application was started") + .unit(Unit.SECONDS) + .register(); + counter.inc(17); + + Info info = + Info.builder() + .name("integration_test_info") + .help("Info metric on this integration test") + .labelNames("test_name") + .register(); + info.addLabelValues("exporter-httpserver-sample"); + + Gauge gauge = + Gauge.builder() + .name("temperature_celsius") + .help("Temperature in Celsius") + .unit(Unit.CELSIUS) + .labelNames("location") + .register(); + gauge.labelValues("inside").set(23.0); + gauge.labelValues("outside").set(27.0); + + if (mode == Mode.error) { + Collector failingCollector = + () -> { + throw new RuntimeException("Simulating an error."); + }; + + PrometheusRegistry.defaultRegistry.register(failingCollector); + } + + HTTPServer server = HTTPServer.builder().port(port).buildAndStart(); + + System.out.println( + "HTTPServer listening on port http://localhost:" + server.getPort() + "/metrics"); + Thread.currentThread().join(); // wait forever + } + + private static int parsePortOrExit(String port) { + try { + return Integer.parseInt(port); + } catch (NumberFormatException e) { + System.err.println("\"" + port + "\": Invalid port number."); + System.exit(1); + } + return 0; // this won't happen + } + + private static Mode parseModeOrExit(String mode) { + try { + return Mode.valueOf(mode); + } catch (IllegalArgumentException e) { + System.err.println( + "\"" + mode + "\": Invalid mode. Legal values are \"success\" and \"error\"."); + System.exit(1); + } + return null; // this won't happen + } +} diff --git a/integration-tests/it-exporter/it-exporter-servlet-jetty-sample/pom.xml b/integration-tests/it-exporter/it-exporter-servlet-jetty-sample/pom.xml new file mode 100644 index 000000000..4d679b572 --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-servlet-jetty-sample/pom.xml @@ -0,0 +1,72 @@ + + + 4.0.0 + + + io.prometheus + it-exporter + 1.5.0-SNAPSHOT + + + it-exporter-servlet-jetty-sample + + Integration Tests - Exporter Servlet with Jetty Sample + + Jetty Sample for the Exporter Integration Test + + + 12.1.5 + 25 + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-servlet-jakarta + ${project.version} + + + org.eclipse.jetty + jetty-server + ${jetty-server.version} + + + org.eclipse.jetty.ee10 + jetty-ee10-servlet + ${jetty-server.version} + + + + + exporter-servlet-jetty-sample + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + io.prometheus.metrics.it.exporter.servlet.jetty.ExporterServletJettySample + + + + + + + + + + diff --git a/integration-tests/it-exporter/it-exporter-servlet-jetty-sample/src/main/java/io/prometheus/metrics/it/exporter/servlet/jetty/ExporterServletJettySample.java b/integration-tests/it-exporter/it-exporter-servlet-jetty-sample/src/main/java/io/prometheus/metrics/it/exporter/servlet/jetty/ExporterServletJettySample.java new file mode 100644 index 000000000..c694eda02 --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-servlet-jetty-sample/src/main/java/io/prometheus/metrics/it/exporter/servlet/jetty/ExporterServletJettySample.java @@ -0,0 +1,109 @@ +package io.prometheus.metrics.it.exporter.servlet.jetty; + +import io.prometheus.metrics.core.metrics.Counter; +import io.prometheus.metrics.core.metrics.Gauge; +import io.prometheus.metrics.core.metrics.Info; +import io.prometheus.metrics.exporter.servlet.jakarta.PrometheusMetricsServlet; +import io.prometheus.metrics.model.registry.Collector; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Unit; +import org.eclipse.jetty.ee10.servlet.ServletContextHandler; +import org.eclipse.jetty.server.Connector; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.server.ServerConnector; + +/** Sample application using the {@link PrometheusMetricsServlet} in Jetty. */ +public class ExporterServletJettySample { + enum Mode { + success, + error + } + + public static void main(String[] args) throws Exception { + + if (args.length != 2) { + System.err.println("Usage: java -jar exporter-servlet-jetty-sample.jar "); + System.err.println("Where mode is \"success\" or \"error\"."); + System.exit(1); + } + + int port = parsePortOrExit(args[0]); + Mode mode = parseModeOrExit(args[1]); + run(mode, port); + } + + private static void run(Mode mode, int port) throws Exception { + Counter counter = + Counter.builder() + .name("uptime_seconds_total") + .help("total number of seconds since this application was started") + .unit(Unit.SECONDS) + .register(); + counter.inc(17); + + Info info = + Info.builder() + .name("integration_test_info") + .help("Info metric on this integration test") + .labelNames("test_name") + .register(); + info.addLabelValues("exporter-servlet-jetty-sample"); + + Gauge gauge = + Gauge.builder() + .name("temperature_celsius") + .help("Temperature in Celsius") + .unit(Unit.CELSIUS) + .labelNames("location") + .register(); + gauge.labelValues("inside").set(23.0); + gauge.labelValues("outside").set(27.0); + + if (mode == Mode.error) { + Collector failingCollector = + () -> { + throw new RuntimeException("Simulating an error."); + }; + + PrometheusRegistry.defaultRegistry.register(failingCollector); + } + + Server server = new Server(); + + // set port + ServerConnector connector = new ServerConnector(server); + connector.setPort(port); + server.setConnectors(new Connector[] {connector}); + + // register servlet + ServletContextHandler servletHandler = new ServletContextHandler("/"); + servletHandler.addServlet(PrometheusMetricsServlet.class, "/metrics"); + server.setHandler(servletHandler); + + System.out.println("Running on http://localhost:" + port + "/metrics"); + + // run + server.start(); + } + + private static int parsePortOrExit(String port) { + try { + return Integer.parseInt(port); + } catch (NumberFormatException e) { + System.err.println("\"" + port + "\": Invalid port number."); + System.exit(1); + } + return 0; // this won't happen + } + + private static Mode parseModeOrExit(String mode) { + try { + return Mode.valueOf(mode); + } catch (IllegalArgumentException e) { + System.err.println( + "\"" + mode + "\": Invalid mode. Legal values are \"success\" and \"error\"."); + System.exit(1); + } + return null; // this won't happen + } +} diff --git a/integration-tests/it-exporter/it-exporter-servlet-jetty-sample/version-rules.xml b/integration-tests/it-exporter/it-exporter-servlet-jetty-sample/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-servlet-jetty-sample/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/integration-tests/it-exporter/it-exporter-servlet-tomcat-sample/pom.xml b/integration-tests/it-exporter/it-exporter-servlet-tomcat-sample/pom.xml new file mode 100644 index 000000000..2d5c34202 --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-servlet-tomcat-sample/pom.xml @@ -0,0 +1,67 @@ + + + 4.0.0 + + + io.prometheus + it-exporter + 1.5.0-SNAPSHOT + + + it-exporter-servlet-tomcat-sample + + Integration Tests - Exporter Servlet with Tomcat Sample + + Tomcat Sample for the Exporter Integration Test + + + + 25 + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-servlet-jakarta + ${project.version} + + + org.apache.tomcat.embed + tomcat-embed-core + 11.0.15 + + + + + exporter-servlet-tomcat-sample + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + io.prometheus.metrics.it.exporter.servlet.tomcat.ExporterServletTomcatSample + + + + + + + + + + diff --git a/integration-tests/it-exporter/it-exporter-servlet-tomcat-sample/src/main/java/io/prometheus/metrics/it/exporter/servlet/tomcat/ExporterServletTomcatSample.java b/integration-tests/it-exporter/it-exporter-servlet-tomcat-sample/src/main/java/io/prometheus/metrics/it/exporter/servlet/tomcat/ExporterServletTomcatSample.java new file mode 100644 index 000000000..fa470b306 --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-servlet-tomcat-sample/src/main/java/io/prometheus/metrics/it/exporter/servlet/tomcat/ExporterServletTomcatSample.java @@ -0,0 +1,108 @@ +package io.prometheus.metrics.it.exporter.servlet.tomcat; + +import io.prometheus.metrics.core.metrics.Counter; +import io.prometheus.metrics.core.metrics.Gauge; +import io.prometheus.metrics.core.metrics.Info; +import io.prometheus.metrics.exporter.servlet.jakarta.PrometheusMetricsServlet; +import io.prometheus.metrics.model.registry.Collector; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Unit; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import org.apache.catalina.Context; +import org.apache.catalina.LifecycleException; +import org.apache.catalina.startup.Tomcat; + +/** Sample application using the {@link PrometheusMetricsServlet} in Tomcat. */ +public class ExporterServletTomcatSample { + enum Mode { + success, + error + } + + public static void main(String[] args) throws LifecycleException, IOException { + + if (args.length != 2) { + System.err.println("Usage: java -jar exporter-servlet-tomcat-sample.jar "); + System.err.println("Where mode is \"success\" or \"error\"."); + System.exit(1); + } + + int port = parsePortOrExit(args[0]); + Mode mode = parseModeOrExit(args[1]); + run(mode, port); + } + + private static void run(Mode mode, int port) throws IOException, LifecycleException { + Counter counter = + Counter.builder() + .name("uptime_seconds_total") + .help("total number of seconds since this application was started") + .unit(Unit.SECONDS) + .register(); + counter.inc(17); + + Info info = + Info.builder() + .name("integration_test_info") + .help("Info metric on this integration test") + .labelNames("test_name") + .register(); + info.addLabelValues("exporter-servlet-tomcat-sample"); + + Gauge gauge = + Gauge.builder() + .name("temperature_celsius") + .help("Temperature in Celsius") + .unit(Unit.CELSIUS) + .labelNames("location") + .register(); + gauge.labelValues("inside").set(23.0); + gauge.labelValues("outside").set(27.0); + + if (mode == Mode.error) { + Collector failingCollector = + () -> { + throw new RuntimeException("Simulating an error."); + }; + + PrometheusRegistry.defaultRegistry.register(failingCollector); + } + + Tomcat tomcat = new Tomcat(); + tomcat.setPort(port); + + Path tmpDir = Files.createTempDirectory("exporter-servlet-tomcat-sample-"); + tomcat.setBaseDir(tmpDir.toFile().getAbsolutePath()); + Context ctx = tomcat.addContext("", new File(".").getAbsolutePath()); + Tomcat.addServlet(ctx, "metrics", new PrometheusMetricsServlet()); + ctx.addServletMappingDecoded("/metrics", "metrics"); + + tomcat.getConnector(); + tomcat.start(); + tomcat.getServer().await(); + } + + private static int parsePortOrExit(String port) { + try { + return Integer.parseInt(port); + } catch (NumberFormatException e) { + System.err.println("\"" + port + "\": Invalid port number."); + System.exit(1); + } + return 0; // this won't happen + } + + private static Mode parseModeOrExit(String mode) { + try { + return Mode.valueOf(mode); + } catch (IllegalArgumentException e) { + System.err.println( + "\"" + mode + "\": Invalid mode. Legal values are \"success\" and \"error\"."); + System.exit(1); + } + return null; // this won't happen + } +} diff --git a/integration-tests/it-exporter/it-exporter-servlet-tomcat-sample/version-rules.xml b/integration-tests/it-exporter/it-exporter-servlet-tomcat-sample/version-rules.xml new file mode 100644 index 000000000..154e67489 --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-servlet-tomcat-sample/version-rules.xml @@ -0,0 +1,12 @@ + + + + + + .*-M[0-9]+ + + + + diff --git a/integration-tests/it-exporter/it-exporter-test/pom.xml b/integration-tests/it-exporter/it-exporter-test/pom.xml new file mode 100644 index 000000000..1929a9c6d --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-test/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + + + io.prometheus + it-exporter + 1.5.0-SNAPSHOT + + + it-exporter-test + + Integration Tests - Exporter Test Implementations + + Integration Tests for Exporters + + + + + io.prometheus + it-common + test-jar + ${project.version} + test + + + diff --git a/integration-tests/it-exporter/it-exporter-test/src/test/java/io/prometheus/metrics/it/exporter/test/ExporterIT.java b/integration-tests/it-exporter/it-exporter-test/src/test/java/io/prometheus/metrics/it/exporter/test/ExporterIT.java new file mode 100644 index 000000000..cf876b3fd --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-test/src/test/java/io/prometheus/metrics/it/exporter/test/ExporterIT.java @@ -0,0 +1,287 @@ +package io.prometheus.metrics.it.exporter.test; + +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.common.io.Resources; +import io.prometheus.client.it.common.ExporterTest; +import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URLEncoder; +import java.util.List; +import java.util.regex.Pattern; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; + +abstract class ExporterIT extends ExporterTest { + + public ExporterIT(String sampleApp) throws IOException, URISyntaxException { + super(sampleApp); + } + + @Test + public void testOpenMetricsTextFormat() throws IOException { + start(); + Response response = + scrape("GET", "", "Accept", "application/openmetrics-text; version=1.0.0; charset=utf-8"); + assertThat(response.status).isEqualTo(200); + assertContentType( + "application/openmetrics-text; version=1.0.0; charset=utf-8", + response.getHeader("Content-Type")); + assertThat(response.getHeader("Content-Encoding")).isNull(); + assertThat(response.getHeader("Transfer-Encoding")).isNull(); + assertThat(response.getHeader("Content-Length")) + .isEqualTo(Integer.toString(response.body.length)); + assertThat(response.stringBody()) + .contains("integration_test_info{test_name=\"" + sampleApp + "\"} 1") + .contains("temperature_celsius{location=\"inside\"} 23.0") + .contains("temperature_celsius{location=\"outside\"} 27.0") + .contains("uptime_seconds_total 17.0") + // OpenMetrics text format has a UNIT. + .contains("# UNIT uptime_seconds seconds"); + } + + @Test + public void testPrometheusTextFormat() throws IOException { + start(); + Response response = scrape("GET", ""); + assertThat(response.status).isEqualTo(200); + assertContentType( + "text/plain; version=0.0.4; charset=utf-8", response.getHeader("Content-Type")); + assertThat(response.getHeader("Content-Encoding")).isNull(); + assertThat(response.getHeader("Transfer-Encoding")).isNull(); + assertThat(response.getHeader("Content-Length")) + .isEqualTo(Integer.toString(response.body.length)); + assertThat(response.stringBody()) + .contains("integration_test_info{test_name=\"" + sampleApp + "\"} 1") + .contains("temperature_celsius{location=\"inside\"} 23.0") + .contains("temperature_celsius{location=\"outside\"} 27.0") + .contains("uptime_seconds_total 17.0") + // Prometheus text format does not have a UNIT. + .doesNotContain("# UNIT uptime_seconds seconds"); + } + + @Test + public void testPrometheusProtobufFormat() throws IOException { + start(); + Response response = + scrape( + "GET", + "", + "Accept", + "application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily;" + + " encoding=delimited"); + assertThat(response.status).isEqualTo(200); + assertContentType( + "application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily;" + + " encoding=delimited", + response.getHeader("Content-Type")); + assertThat(response.getHeader("Content-Encoding")).isNull(); + assertThat(response.getHeader("Transfer-Encoding")).isNull(); + assertThat(response.getHeader("Content-Length")) + .isEqualTo(Integer.toString(response.body.length)); + List metrics = response.protoBody(); + assertThat(metrics).hasSize(3); + // metrics are sorted by name + assertThat(metrics.get(0).getName()).isEqualTo("integration_test_info"); + assertThat(metrics.get(1).getName()).isEqualTo("temperature_celsius"); + assertThat(metrics.get(2).getName()).isEqualTo("uptime_seconds_total"); + } + + @ParameterizedTest + @CsvSource({ + "openmetrics, debug-openmetrics.txt", + "text, debug-text.txt", + "prometheus-protobuf, debug-protobuf.txt", + }) + public void testPrometheusProtobufDebugFormat(String format, String expected) throws IOException { + start(); + Response response = scrape("GET", "debug=" + format); + assertThat(response.status).isEqualTo(200); + assertContentType( + "text/plain;charset=utf-8", response.getHeader("Content-Type").replace(" ", "")); + + String actualResponse = response.stringBody().trim(); + String expectedResponse = + Resources.toString(Resources.getResource(expected), UTF_8) + .trim() + .replace("", sampleApp); + + if ("prometheus-protobuf".equals(format)) { + assertThat(actualResponse) + .matches( + Pattern.quote(expectedResponse) + .replace("", "\\E\\d+\\Q") + .replace("", "\\E\\d+\\Q")); + } else { + assertThat(actualResponse).isEqualTo(expectedResponse); + } + } + + @Test + public void testCompression() throws IOException { + start(); + Response response = + scrape( + "GET", + "", + "Accept", + "application/openmetrics-text; version=1.0.0; charset=utf-8", + "Accept-Encoding", + "gzip"); + assertThat(response.status).isEqualTo(200); + assertThat(response.getHeader("Content-Encoding")).isEqualTo("gzip"); + if (response.getHeader("Content-Length") != null) { + // The servlet container might set a content length as the body is very small. + assertThat(response.getHeader("Content-Length")) + .isEqualTo(Integer.toString(response.body.length)); + assertThat(response.getHeader("Transfer-Encoding")).isNull(); + } else { + // If no content length is set, transfer-encoding chunked must be used. + assertThat(response.getHeader("Transfer-Encoding")).isEqualTo("chunked"); + } + assertContentType( + "application/openmetrics-text; version=1.0.0; charset=utf-8", + response.getHeader("Content-Type")); + assertThat(response.gzipBody()).contains("uptime_seconds_total 17.0"); + } + + @Test + public void testErrorHandling() throws IOException { + start("error"); + Response response = scrape("GET", ""); + assertThat(response.status).isEqualTo(500); + assertThat(response.stringBody()).contains("Simulating an error."); + } + + @Test + public void testHeadRequest() throws IOException { + start(); + Response fullResponse = scrape("GET", ""); + int size = fullResponse.body.length; + assertThat(size).isGreaterThan(0); + Response headResponse = scrape("HEAD", ""); + assertThat(headResponse.status).isEqualTo(200); + assertThat(headResponse.getHeader("Content-Length")).isEqualTo(Integer.toString(size)); + assertThat(headResponse.body).isEmpty(); + } + + @Test + public void testDebug() throws IOException { + start(); + Response response = scrape("GET", "debug=openmetrics"); + assertThat(response.status).isEqualTo(200); + assertContentType("text/plain; charset=utf-8", response.getHeader("Content-Type")); + assertThat(response.stringBody()) + .contains("uptime_seconds_total 17.0") + .contains("# UNIT uptime_seconds seconds"); + } + + @Test + public void testNameFilter() throws IOException { + start(); + Response response = + scrape( + "GET", + nameParam("integration_test_info") + "&" + nameParam("uptime_seconds_total"), + "Accept", + "application/openmetrics-text; version=1.0.0; charset=utf-8"); + assertThat(response.status).isEqualTo(200); + assertContentType( + "application/openmetrics-text; version=1.0.0; charset=utf-8", + response.getHeader("Content-Type")); + assertThat(response.stringBody()) + .contains("integration_test_info{test_name=\"" + sampleApp + "\"} 1") + .contains("uptime_seconds_total 17.0") + .doesNotContain("temperature_celsius"); + } + + @Test + public void testEmptyResponseOpenMetrics() throws IOException { + start(); + Response response = + scrape( + "GET", + nameParam("none_existing"), + "Accept", + "application/openmetrics-text; version=1.0.0; charset=utf-8"); + assertThat(response.status).isEqualTo(200); + assertContentType( + "application/openmetrics-text; version=1.0.0; charset=utf-8", + response.getHeader("Content-Type")); + assertThat(response.getHeader("Content-Length")) + .isEqualTo(Integer.toString(response.body.length)); + assertThat(response.stringBody()).isEqualTo("# EOF\n"); + } + + @Test + public void testEmptyResponseText() throws IOException { + start(); + Response response = scrape("GET", nameParam("none_existing")); + assertThat(response.status).isEqualTo(200); + assertContentType( + "text/plain; version=0.0.4; charset=utf-8", response.getHeader("Content-Type")); + if (response.getHeader("Content-Length") + != null) { // HTTPServer does not send a zero content length, which is ok + assertThat(response.getHeader("Content-Length")).isEqualTo("0"); + } + assertThat(response.body).isEmpty(); + } + + @Test + public void testEmptyResponseProtobuf() throws IOException { + start(); + Response response = + scrape( + "GET", + nameParam("none_existing"), + "Accept", + "application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily;" + + " encoding=delimited"); + assertThat(response.status).isEqualTo(200); + assertContentType( + "application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily;" + + " encoding=delimited", + response.getHeader("Content-Type")); + assertThat(response.body).isEmpty(); + } + + @Test + public void testEmptyResponseGzipOpenMetrics() throws IOException { + start(); + Response response = + scrape( + "GET", + nameParam("none_existing"), + "Accept", + "application/openmetrics-text; version=1.0.0; charset=utf-8", + "Accept-Encoding", + "gzip"); + assertThat(response.status).isEqualTo(200); + assertThat(response.getHeader("Content-Encoding")).isEqualTo("gzip"); + assertThat(response.gzipBody()).isEqualTo("# EOF\n"); + } + + @Test + public void testEmptyResponseGzipText() throws IOException { + start(); + Response response = scrape("GET", nameParam("none_existing"), "Accept-Encoding", "gzip"); + assertThat(response.status).isEqualTo(200); + assertThat(response.getHeader("Content-Encoding")).isEqualTo("gzip"); + assertThat(response.gzipBody()).isEmpty(); + } + + private String nameParam(String name) { + return URLEncoder.encode("name[]", UTF_8) + "=" + URLEncoder.encode(name, UTF_8); + } + + @Test + public void testDebugUnknown() throws IOException { + start(); + Response response = scrape("GET", "debug=unknown"); + assertThat(response.status).isEqualTo(500); + assertContentType("text/plain; charset=utf-8", response.getHeader("Content-Type")); + } +} diff --git a/integration-tests/it-exporter/it-exporter-test/src/test/java/io/prometheus/metrics/it/exporter/test/HttpServerIT.java b/integration-tests/it-exporter/it-exporter-test/src/test/java/io/prometheus/metrics/it/exporter/test/HttpServerIT.java new file mode 100644 index 000000000..4c7e61472 --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-test/src/test/java/io/prometheus/metrics/it/exporter/test/HttpServerIT.java @@ -0,0 +1,10 @@ +package io.prometheus.metrics.it.exporter.test; + +import java.io.IOException; +import java.net.URISyntaxException; + +class HttpServerIT extends ExporterIT { + public HttpServerIT() throws IOException, URISyntaxException { + super("exporter-httpserver-sample"); + } +} diff --git a/integration-tests/it-exporter/it-exporter-test/src/test/java/io/prometheus/metrics/it/exporter/test/JettyIT.java b/integration-tests/it-exporter/it-exporter-test/src/test/java/io/prometheus/metrics/it/exporter/test/JettyIT.java new file mode 100644 index 000000000..a3d3e7da6 --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-test/src/test/java/io/prometheus/metrics/it/exporter/test/JettyIT.java @@ -0,0 +1,10 @@ +package io.prometheus.metrics.it.exporter.test; + +import java.io.IOException; +import java.net.URISyntaxException; + +class JettyIT extends ExporterIT { + public JettyIT() throws IOException, URISyntaxException { + super("exporter-servlet-jetty-sample"); + } +} diff --git a/integration-tests/it-exporter/it-exporter-test/src/test/java/io/prometheus/metrics/it/exporter/test/TomcatIT.java b/integration-tests/it-exporter/it-exporter-test/src/test/java/io/prometheus/metrics/it/exporter/test/TomcatIT.java new file mode 100644 index 000000000..ea5e6b69d --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-test/src/test/java/io/prometheus/metrics/it/exporter/test/TomcatIT.java @@ -0,0 +1,10 @@ +package io.prometheus.metrics.it.exporter.test; + +import java.io.IOException; +import java.net.URISyntaxException; + +class TomcatIT extends ExporterIT { + public TomcatIT() throws IOException, URISyntaxException { + super("exporter-servlet-tomcat-sample"); + } +} diff --git a/integration-tests/it-exporter/it-exporter-test/src/test/resources/debug-openmetrics.txt b/integration-tests/it-exporter/it-exporter-test/src/test/resources/debug-openmetrics.txt new file mode 100644 index 000000000..667cfc87c --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-test/src/test/resources/debug-openmetrics.txt @@ -0,0 +1,13 @@ +# TYPE integration_test info +# HELP integration_test Info metric on this integration test +integration_test_info{test_name=""} 1 +# TYPE temperature_celsius gauge +# UNIT temperature_celsius celsius +# HELP temperature_celsius Temperature in Celsius +temperature_celsius{location="inside"} 23.0 +temperature_celsius{location="outside"} 27.0 +# TYPE uptime_seconds counter +# UNIT uptime_seconds seconds +# HELP uptime_seconds total number of seconds since this application was started +uptime_seconds_total 17.0 +# EOF diff --git a/integration-tests/it-exporter/it-exporter-test/src/test/resources/debug-protobuf.txt b/integration-tests/it-exporter/it-exporter-test/src/test/resources/debug-protobuf.txt new file mode 100644 index 000000000..06f19b85c --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-test/src/test/resources/debug-protobuf.txt @@ -0,0 +1,46 @@ +name: "integration_test_info" +help: "Info metric on this integration test" +type: GAUGE +metric { + label { + name: "test_name" + value: "" + } + gauge { + value: 1.0 + } +} +name: "temperature_celsius" +help: "Temperature in Celsius" +type: GAUGE +metric { + label { + name: "location" + value: "inside" + } + gauge { + value: 23.0 + } +} +metric { + label { + name: "location" + value: "outside" + } + gauge { + value: 27.0 + } +} +name: "uptime_seconds_total" +help: "total number of seconds since this application was started" +type: COUNTER +metric { + counter { + value: 17.0 + created_timestamp { + seconds: + nanos: + } + } +} + diff --git a/integration-tests/it-exporter/it-exporter-test/src/test/resources/debug-text.txt b/integration-tests/it-exporter/it-exporter-test/src/test/resources/debug-text.txt new file mode 100644 index 000000000..b57df80d9 --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-test/src/test/resources/debug-text.txt @@ -0,0 +1,10 @@ +# HELP integration_test_info Info metric on this integration test +# TYPE integration_test_info gauge +integration_test_info{test_name=""} 1 +# HELP temperature_celsius Temperature in Celsius +# TYPE temperature_celsius gauge +temperature_celsius{location="inside"} 23.0 +temperature_celsius{location="outside"} 27.0 +# HELP uptime_seconds_total total number of seconds since this application was started +# TYPE uptime_seconds_total counter +uptime_seconds_total 17.0 diff --git a/integration-tests/it-exporter/it-exporter-test/version-rules.xml b/integration-tests/it-exporter/it-exporter-test/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/integration-tests/it-exporter/it-exporter-test/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/integration-tests/it-exporter/it-no-protobuf-test/pom.xml b/integration-tests/it-exporter/it-no-protobuf-test/pom.xml new file mode 100644 index 000000000..6321799db --- /dev/null +++ b/integration-tests/it-exporter/it-no-protobuf-test/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + + + io.prometheus + it-exporter + 1.5.0-SNAPSHOT + + + it-no-protobuf-test + + Integration Test - No Protobuf + + Integration tests without protobuf + + + + + io.prometheus + it-common + test-jar + ${project.version} + test + + + diff --git a/integration-tests/it-exporter/it-no-protobuf-test/src/test/java/io/prometheus/metrics/it/noprotobuf/NoProtobufIT.java b/integration-tests/it-exporter/it-no-protobuf-test/src/test/java/io/prometheus/metrics/it/noprotobuf/NoProtobufIT.java new file mode 100644 index 000000000..cd534dcb9 --- /dev/null +++ b/integration-tests/it-exporter/it-no-protobuf-test/src/test/java/io/prometheus/metrics/it/noprotobuf/NoProtobufIT.java @@ -0,0 +1,23 @@ +package io.prometheus.metrics.it.noprotobuf; + +import static org.assertj.core.api.Assertions.assertThat; + +import io.prometheus.client.it.common.ExporterTest; +import java.io.IOException; +import java.net.URISyntaxException; +import org.junit.jupiter.api.Test; + +class NoProtobufIT extends ExporterTest { + + public NoProtobufIT() throws IOException, URISyntaxException { + super("exporter-no-protobuf"); + } + + @Test + public void testPrometheusProtobufDebugFormat() throws IOException { + start(); + assertThat(scrape("GET", "debug=text").status).isEqualTo(200); + // protobuf is not supported + assertThat(scrape("GET", "debug=prometheus-protobuf").status).isEqualTo(500); + } +} diff --git a/integration-tests/it-exporter/pom.xml b/integration-tests/it-exporter/pom.xml new file mode 100644 index 000000000..a442b9086 --- /dev/null +++ b/integration-tests/it-exporter/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + + + io.prometheus + integration-tests + 1.5.0-SNAPSHOT + + + it-exporter + pom + + Integration Tests - Exporter + + Integration tests for the Exporter modules + + + + it-exporter-servlet-tomcat-sample + it-exporter-servlet-jetty-sample + it-exporter-httpserver-sample + it-exporter-no-protobuf + it-exporter-test + it-no-protobuf-test + + diff --git a/integration-tests/it-exporter/version-rules.xml b/integration-tests/it-exporter/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/integration-tests/it-exporter/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/integration-tests/it-pushgateway/pom.xml b/integration-tests/it-pushgateway/pom.xml new file mode 100644 index 000000000..cf3e68169 --- /dev/null +++ b/integration-tests/it-pushgateway/pom.xml @@ -0,0 +1,81 @@ + + + 4.0.0 + + + io.prometheus + integration-tests + 1.5.0-SNAPSHOT + + + it-pushgateway + + Integration Test - Pushgateway + + Integration tests for the Pushgateway Exporter + + + + true + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-pushgateway + ${project.version} + + + + io.prometheus + it-common + test-jar + ${project.version} + test + + + com.squareup.okhttp + okhttp + 2.7.5 + test + + + com.jayway.jsonpath + json-path + 2.10.0 + test + + + + + pushgateway-test-app + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + io.prometheus.metrics.it.pushgateway.PushGatewayTestApp + + + + + + + + + diff --git a/integration-tests/it-pushgateway/src/main/java/io/prometheus/metrics/it/pushgateway/PushGatewayTestApp.java b/integration-tests/it-pushgateway/src/main/java/io/prometheus/metrics/it/pushgateway/PushGatewayTestApp.java new file mode 100644 index 000000000..5c8605617 --- /dev/null +++ b/integration-tests/it-pushgateway/src/main/java/io/prometheus/metrics/it/pushgateway/PushGatewayTestApp.java @@ -0,0 +1,127 @@ +package io.prometheus.metrics.it.pushgateway; + +import static io.prometheus.metrics.exporter.pushgateway.Scheme.HTTPS; + +import io.prometheus.metrics.core.metrics.Gauge; +import io.prometheus.metrics.core.metrics.Histogram; +import io.prometheus.metrics.exporter.pushgateway.Format; +import io.prometheus.metrics.exporter.pushgateway.HttpConnectionFactory; +import io.prometheus.metrics.exporter.pushgateway.PushGateway; +import io.prometheus.metrics.model.snapshots.Unit; +import java.io.IOException; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.X509Certificate; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; + +/** Example application using the {@link PushGateway}. */ +class PushGatewayTestApp { + + public static void main(String[] args) throws IOException { + if (args.length != 1) { + System.err.println("Usage: java -jar pushgateway-test-app.jar "); + System.exit(-1); + } + switch (args[0]) { + case "simple": + runSimpleTest(); + break; + case "textFormat": + runTextFormatTest(); + break; + case "basicauth": + runBasicAuthTest(); + break; + case "ssl": + runSslTest(); + break; + default: + System.err.println(args[0] + ": Not implemented."); + System.exit(-1); + } + } + + private static void runSimpleTest() throws IOException { + makeMetrics(); + PushGateway pg = PushGateway.builder().build(); + System.out.println("Pushing metrics..."); + pg.push(); + System.out.println("Push successful."); + } + + private static void runTextFormatTest() throws IOException { + makeMetrics(); + PushGateway pg = PushGateway.builder().format(Format.PROMETHEUS_TEXT).build(); + System.out.println("Pushing metrics..."); + pg.push(); + System.out.println("Push successful."); + } + + private static void runBasicAuthTest() throws IOException { + makeMetrics(); + PushGateway pg = PushGateway.builder().basicAuth("my_user", "secret_password").build(); + System.out.println("Pushing metrics..."); + pg.push(); + System.out.println("Push successful."); + } + + private static void runSslTest() throws IOException { + makeMetrics(); + PushGateway pg = + PushGateway.builder().scheme(HTTPS).connectionFactory(insecureConnectionFactory).build(); + System.out.println("Pushing metrics..."); + pg.push(); + System.out.println("Push successful."); + } + + static TrustManager insecureTrustManager = + new X509TrustManager() { + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return null; + } + + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType) {} + + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType) {} + }; + + static HttpConnectionFactory insecureConnectionFactory = + url -> { + try { + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(null, new TrustManager[] {insecureTrustManager}, null); + SSLContext.setDefault(sslContext); + + HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); + connection.setHostnameVerifier((hostname, session) -> true); + return connection; + } catch (NoSuchAlgorithmException | KeyManagementException e) { + throw new RuntimeException(e); + } + }; + + private static void makeMetrics() { + Histogram sizes = + Histogram.builder() + .name("file_sizes_bytes") + .classicUpperBounds(256, 512, 1024, 2048) + .unit(Unit.BYTES) + .register(); + sizes.observe(513); + sizes.observe(814); + sizes.observe(1553); + Gauge duration = + Gauge.builder() + .name("my_batch_job_duration_seconds") + .help("Duration of my batch job in seconds.") + .unit(Unit.SECONDS) + .register(); + duration.set(0.5); + } +} diff --git a/integration-tests/it-pushgateway/src/test/java/io/prometheus/metrics/it/pushgateway/PushGatewayIT.java b/integration-tests/it-pushgateway/src/test/java/io/prometheus/metrics/it/pushgateway/PushGatewayIT.java new file mode 100644 index 000000000..29a8fad72 --- /dev/null +++ b/integration-tests/it-pushgateway/src/test/java/io/prometheus/metrics/it/pushgateway/PushGatewayIT.java @@ -0,0 +1,268 @@ +package io.prometheus.metrics.it.pushgateway; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; + +import com.jayway.jsonpath.Criteria; +import com.jayway.jsonpath.Filter; +import com.jayway.jsonpath.JsonPath; +import com.squareup.okhttp.*; +import io.prometheus.client.it.common.LogConsumer; +import io.prometheus.client.it.common.Volume; +import java.io.IOException; +import java.net.URISyntaxException; +import java.util.concurrent.TimeUnit; +import net.minidev.json.JSONArray; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.testcontainers.containers.BindMode; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.Network; +import org.testcontainers.containers.wait.strategy.Wait; +import org.testcontainers.utility.MountableFile; + +public class PushGatewayIT { + + private GenericContainer sampleAppContainer; + private GenericContainer pushGatewayContainer; + private GenericContainer prometheusContainer; + private Volume sampleAppVolume; + + @BeforeEach + public void setUp() throws IOException, URISyntaxException { + Network network = Network.newNetwork(); + sampleAppVolume = Volume.create("it-pushgateway").copy("pushgateway-test-app.jar"); + pushGatewayContainer = + new GenericContainer<>("prom/pushgateway:v1.8.0") + .withExposedPorts(9091) + .withNetwork(network) + .withNetworkAliases("pushgateway") + .withLogConsumer(LogConsumer.withPrefix("pushgateway")) + .waitingFor(Wait.forListeningPort()); + sampleAppContainer = + new GenericContainer<>("eclipse-temurin:25") + .withFileSystemBind(sampleAppVolume.getHostPath(), "/app", BindMode.READ_ONLY) + .withNetwork(network) + .withWorkingDirectory("/app") + .dependsOn(pushGatewayContainer) + .withLogConsumer(LogConsumer.withPrefix("test-app")); + prometheusContainer = + new GenericContainer<>("prom/prometheus:v2.51.2") + .withNetwork(network) + .dependsOn(pushGatewayContainer) + .withExposedPorts(9090) + .withLogConsumer(LogConsumer.withPrefix("prometheus")); + } + + @AfterEach + public void tearDown() throws IOException { + prometheusContainer.stop(); + pushGatewayContainer.stop(); + sampleAppContainer.stop(); + sampleAppVolume.remove(); + } + + final OkHttpClient client = new OkHttpClient(); + + @Test + public void testSimple() throws IOException, InterruptedException { + pushGatewayContainer.start(); + sampleAppContainer + .withCommand( + "java", + "-Dio.prometheus.exporter.pushgateway.address=pushgateway:9091", + "-jar", + "/app/pushgateway-test-app.jar", + "simple") + .start(); + prometheusContainer + .withCopyFileToContainer( + MountableFile.forClasspathResource("/prometheus.yaml"), + "/etc/prometheus/prometheus.yml") + .start(); + awaitTermination(sampleAppContainer, 10, TimeUnit.SECONDS); + assertMetrics(); + } + + @Test + public void testTextFormat() throws IOException, InterruptedException { + pushGatewayContainer.start(); + sampleAppContainer + .withCommand( + "java", + "-Dio.prometheus.exporter.pushgateway.address=pushgateway:9091", + "-jar", + "/app/pushgateway-test-app.jar", + "textFormat") + .start(); + prometheusContainer + .withCopyFileToContainer( + MountableFile.forClasspathResource("/prometheus.yaml"), + "/etc/prometheus/prometheus.yml") + .start(); + awaitTermination(sampleAppContainer, 10, TimeUnit.SECONDS); + assertMetrics(); + } + + @Test + public void testBasicAuth() throws IOException, InterruptedException { + pushGatewayContainer + .withCopyFileToContainer( + MountableFile.forClasspathResource("/pushgateway-basicauth.yaml"), + "/pushgateway/pushgateway-basicauth.yaml") + .withCommand("--web.config.file", "pushgateway-basicauth.yaml") + .start(); + sampleAppContainer + .withCommand( + "java", + "-Dio.prometheus.exporter.pushgateway.address=pushgateway:9091", + "-jar", + "/app/pushgateway-test-app.jar", + "basicauth") + .start(); + prometheusContainer + .withCopyFileToContainer( + MountableFile.forClasspathResource("/prometheus-basicauth.yaml"), + "/etc/prometheus/prometheus.yml") + .start(); + awaitTermination(sampleAppContainer, 10, TimeUnit.SECONDS); + assertMetrics(); + } + + @Test + public void testSsl() throws InterruptedException, IOException { + pushGatewayContainer + .withCopyFileToContainer( + MountableFile.forClasspathResource("/pushgateway-ssl.yaml"), + "/pushgateway/pushgateway-ssl.yaml") + .withCommand("--web.config.file", "pushgateway-ssl.yaml") + .start(); + sampleAppContainer + .withCommand( + "java", + "-Dio.prometheus.exporter.pushgateway.address=pushgateway:9091", + "-jar", + "/app/pushgateway-test-app.jar", + "ssl") + .start(); + prometheusContainer + .withCopyFileToContainer( + MountableFile.forClasspathResource("/prometheus-ssl.yaml"), + "/etc/prometheus/prometheus.yml") + .start(); + awaitTermination(sampleAppContainer, 10, TimeUnit.SECONDS); + assertMetrics(); + } + + @Test + public void testProtobuf() throws IOException, InterruptedException { + pushGatewayContainer.start(); + sampleAppContainer + .withCommand( + "java", + "-Dio.prometheus.exporter.pushgateway.address=pushgateway:9091", + "-jar", + "/app/pushgateway-test-app.jar", + "simple") + .start(); + prometheusContainer + .withCommand( + "--enable-feature=native-histograms", "--config.file", "/etc/prometheus/prometheus.yml") + .withCopyFileToContainer( + MountableFile.forClasspathResource("/prometheus.yaml"), + "/etc/prometheus/prometheus.yml") + .start(); + awaitTermination(sampleAppContainer, 10, TimeUnit.SECONDS); + assertNativeHistogram(); + } + + private void assertMetrics() throws IOException, InterruptedException { + double value = getValue("my_batch_job_duration_seconds", "job", "pushgateway-test-app"); + assertThat(value).isEqualTo(0.5); + value = getValue("file_sizes_bytes_bucket", "job", "pushgateway-test-app", "le", "512"); + assertThat(value).isEqualTo(0.0); + value = getValue("file_sizes_bytes_bucket", "job", "pushgateway-test-app", "le", "1024"); + assertThat(value).isEqualTo(2.0); + value = getValue("file_sizes_bytes_bucket", "job", "pushgateway-test-app", "le", "+Inf"); + assertThat(value).isEqualTo(3.0); + } + + private double getValue(String name, String... labels) throws IOException, InterruptedException { + String scrapeResponseJson = scrape(name); + Criteria criteria = Criteria.where("metric.__name__").eq(name); + for (int i = 0; i < labels.length; i += 2) { + criteria = criteria.and("metric." + labels[i]).eq(labels[i + 1]); + } + JSONArray result = + JsonPath.parse(scrapeResponseJson) + .read("$.data.result" + Filter.filter(criteria) + ".value[1]"); + assertThat(result.size()).isOne(); + return Double.parseDouble(result.get(0).toString()); + } + + private void assertNativeHistogram() throws IOException, InterruptedException { + double count = getNativeHistogramCount("file_sizes_bytes", "pushgateway-test-app"); + assertThat(count).isEqualTo(3); + } + + private double getNativeHistogramCount(String name, String job) + throws IOException, InterruptedException { + String scrapeResponseJson = scrape("histogram_count(" + name + ")"); + Criteria criteria = Criteria.where("metric.job").eq(job); + JSONArray result = + JsonPath.parse(scrapeResponseJson) + .read("$.data.result" + Filter.filter(criteria) + ".value[1]"); + return Double.parseDouble(result.get(0).toString()); + } + + private String scrape(String query) throws IOException, InterruptedException { + System.out.println( + "Querying http://" + + prometheusContainer.getHost() + + ":" + + prometheusContainer.getMappedPort(9090)); + HttpUrl baseUrl = + HttpUrl.parse( + "http://" + + prometheusContainer.getHost() + + ":" + + prometheusContainer.getMappedPort(9090) + + "/api/v1/query"); + HttpUrl url = baseUrl.newBuilder().addQueryParameter("query", query).build(); + long timeRemaining = TimeUnit.SECONDS.toMillis(15); + while (timeRemaining > 0) { + Request request = new Request.Builder().url(url).build(); + Call call = client.newCall(request); + Response response = call.execute(); + String body = response.body().string(); + if (!body.contains("\"result\":[]")) { + // Result when data is not available yet: + // {"status":"success","data":{"resultType":"vector","result":[]}} + return body; + } + Thread.sleep(250); + timeRemaining -= 250; + } + fail("timeout while scraping " + url); + return null; + } + + private void awaitTermination(GenericContainer container, long timeout, TimeUnit unit) + throws InterruptedException { + long waitTimeMillis = 0; + while (container.isRunning()) { + if (waitTimeMillis > unit.toMillis(timeout)) { + fail( + container.getContainerName() + + " did not terminate after " + + timeout + + " " + + unit + + "."); + } + Thread.sleep(20); + waitTimeMillis += 20; + } + } +} diff --git a/integration-tests/it-pushgateway/src/test/resources/prometheus-basicauth.yaml b/integration-tests/it-pushgateway/src/test/resources/prometheus-basicauth.yaml new file mode 100644 index 000000000..fde102fe0 --- /dev/null +++ b/integration-tests/it-pushgateway/src/test/resources/prometheus-basicauth.yaml @@ -0,0 +1,11 @@ +global: + scrape_interval: 5s + +scrape_configs: + - job_name: "push" + honor_labels: true + static_configs: + - targets: ["pushgateway:9091"] + basic_auth: + username: "my_user" + password: "secret_password" diff --git a/integration-tests/it-pushgateway/src/test/resources/prometheus-ssl.yaml b/integration-tests/it-pushgateway/src/test/resources/prometheus-ssl.yaml new file mode 100644 index 000000000..bf6cab863 --- /dev/null +++ b/integration-tests/it-pushgateway/src/test/resources/prometheus-ssl.yaml @@ -0,0 +1,11 @@ +global: + scrape_interval: 5s + +scrape_configs: + - job_name: "push" + honor_labels: true + scheme: https + static_configs: + - targets: ["pushgateway:9091"] + tls_config: + insecure_skip_verify: true diff --git a/integration-tests/it-pushgateway/src/test/resources/prometheus.yaml b/integration-tests/it-pushgateway/src/test/resources/prometheus.yaml new file mode 100644 index 000000000..55bb777cb --- /dev/null +++ b/integration-tests/it-pushgateway/src/test/resources/prometheus.yaml @@ -0,0 +1,8 @@ +global: + scrape_interval: 5s + +scrape_configs: + - job_name: "push" + honor_labels: true + static_configs: + - targets: ["pushgateway:9091"] diff --git a/integration-tests/it-pushgateway/src/test/resources/pushgateway-basicauth.yaml b/integration-tests/it-pushgateway/src/test/resources/pushgateway-basicauth.yaml new file mode 100644 index 000000000..26bbb11ce --- /dev/null +++ b/integration-tests/it-pushgateway/src/test/resources/pushgateway-basicauth.yaml @@ -0,0 +1,7 @@ +--- +basic_auth_users: + # Note: The bcrypt hash of the password was generated + # with the following command line: + # python -c 'import bcrypt; print(bcrypt.hashpw(b"secret_password", + # bcrypt.gensalt(rounds=10)).decode("ascii"))' + my_user: $2b$10$kmIxr/4wpcORDXnKLvTMC.WPGqT8nqjBm8AI3MqGkzcSrWJioTfUG diff --git a/integration-tests/it-pushgateway/src/test/resources/pushgateway-ssl.yaml b/integration-tests/it-pushgateway/src/test/resources/pushgateway-ssl.yaml new file mode 100644 index 000000000..b3ed0fd70 --- /dev/null +++ b/integration-tests/it-pushgateway/src/test/resources/pushgateway-ssl.yaml @@ -0,0 +1,87 @@ +tls_server_config: + # cert and key have been generated with the following command: + # openssl req -x509 -newkey rsa:4096 -keyout key.pem -out + # cert.pem -sha256 -days 36500 -nodes -subj "/CN=localhost" + cert: | + -----BEGIN CERTIFICATE----- + MIIFCzCCAvOgAwIBAgIUPwSov6+heI4uY6+fvB1N+1EN3FwwDQYJKoZIhvcNAQEL + BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MCAXDTI0MDUxMDE0MzY1NloYDzIxMjQw + NDE2MTQzNjU2WjAUMRIwEAYDVQQDDAlsb2NhbGhvc3QwggIiMA0GCSqGSIb3DQEB + AQUAA4ICDwAwggIKAoICAQCnrySCLrYo5ad6w2/Tp/toGKnN4YW9C74eqmlqntht + VbGNkBha4FpEuuadjB64bH3dTSwXWg3ZMxUnjZplRCdosM7+beApzh8ZR+/Ju/qk + CPEw4N1J+NVZKzE7brt9rLKT+Cttjf4K8luUWnlVdOIl2UjqejCougV29TerctlD + svx7jUAoyauPhxbVC8Fmww8rCEox3xbv0MEe2bsc0hQP2opTRfXHwRKBq0hmA9x4 + 1FEqSl7gzQwbg7hHH/AfgxXSsQqRazIDzZEhDNePF0O9PYALrTJxonBrQ4uGBwJE + NQmlyIDnmynYmp5dOuXY8nspansOq7pQkubsg0qYiQ9VwLLZ/ApmFnvcY2uqSpta + TwqLalDYbUMqK61DtG6kHx3rHTokuLRFiXAqP++QdUkajqKtoH7quvKBAfzgrtHj + WJhNkDbaGaYlpyIlekyrxFdp25T06BEHzpFjylRGhuAaz2tbo1n7ynQ6KusdHEAf + l51JXQSS6yU/1Wy0yXo5yuKOykj0ey15s0AoH5yMHhEhAUVG0SKxtcWnnzAFcA9k + DYagco+IjQ+wRuX4jdM5S/l2Kmu8tvW0O7olNyxdWh2gzH/gLmt8ZthNEyTmb4mM + 7kPNYjjcwrbs+oNc/Qfwk66+pn+vwYmRuZJolTZvGAhp9Es3OC19suDEgwz2bLYI + 4wIDAQABo1MwUTAdBgNVHQ4EFgQUMx8SJAoEhboJXjRR4iz+/I2tUhkwHwYDVR0j + BBgwFoAUMx8SJAoEhboJXjRR4iz+/I2tUhkwDwYDVR0TAQH/BAUwAwEB/zANBgkq + hkiG9w0BAQsFAAOCAgEASkE0xnofeUBGTZQK4BdRbqYgSaL9XSKi0UBH7Jw7a+nr + vdNu1VqOYRuSjI1FH2aYFKIaKEOipd8Z/nb1LjYArCerC51Mf/pl1mEDiUVyxECL + 8F/IRj4xWwglbMMHpZw9wGYKAyG/QIpU/skbKEptAfUNb25kAVqhjuQ2vBb8w1kz + GdLf9pGXRCUefYtJIhgLVMDLhR7XVI8tsL2KfBE9fAMeSO/YAr1sa1wVKdqsmxQD + StQoecib3IhspO8QbRSJ10pb6p0sffTyU3jxDonv6b+E1jAslS0FQOxCUHnjwqG/ + TuwW1MPxl4QeOpX00cI9ReZd2qla6+aaxZDccbpDmHtJJ3nKoFVwknUYEqTu+B7y + qZF2iyBtIaPJmdouMISMvlEsFdR4vkcD+2eCWMLlZDkOfDifIF1ny+ni8xU7UELa + XoDOKdIey7A/ddKi86mUdvjp5DRD85ghpSByn20UTdSmvbjHqpdlTPuFSyvix9nk + 3KGJxS7Ra0hqOdGE8JHTmIXAFIjkOEEliNnmGRfd2l6EmDBEXufymlVgvz/DHlgF + krIsjl2SB9AUJckwmj17LdYN6pq9cUdaq7+7SIr12XCxPXyomIBSjlNyPCCy7u5L + nxDNTKImHmmupjoLCJ8MKpZ4fuva+kI372R47l2zMkwBWiEwn95C6+JB2kaFEiQ= + -----END CERTIFICATE----- + key: | + -----BEGIN PRIVATE KEY----- + MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQCnrySCLrYo5ad6 + w2/Tp/toGKnN4YW9C74eqmlqnthtVbGNkBha4FpEuuadjB64bH3dTSwXWg3ZMxUn + jZplRCdosM7+beApzh8ZR+/Ju/qkCPEw4N1J+NVZKzE7brt9rLKT+Cttjf4K8luU + WnlVdOIl2UjqejCougV29TerctlDsvx7jUAoyauPhxbVC8Fmww8rCEox3xbv0MEe + 2bsc0hQP2opTRfXHwRKBq0hmA9x41FEqSl7gzQwbg7hHH/AfgxXSsQqRazIDzZEh + DNePF0O9PYALrTJxonBrQ4uGBwJENQmlyIDnmynYmp5dOuXY8nspansOq7pQkubs + g0qYiQ9VwLLZ/ApmFnvcY2uqSptaTwqLalDYbUMqK61DtG6kHx3rHTokuLRFiXAq + P++QdUkajqKtoH7quvKBAfzgrtHjWJhNkDbaGaYlpyIlekyrxFdp25T06BEHzpFj + ylRGhuAaz2tbo1n7ynQ6KusdHEAfl51JXQSS6yU/1Wy0yXo5yuKOykj0ey15s0Ao + H5yMHhEhAUVG0SKxtcWnnzAFcA9kDYagco+IjQ+wRuX4jdM5S/l2Kmu8tvW0O7ol + NyxdWh2gzH/gLmt8ZthNEyTmb4mM7kPNYjjcwrbs+oNc/Qfwk66+pn+vwYmRuZJo + lTZvGAhp9Es3OC19suDEgwz2bLYI4wIDAQABAoICADi6JJSx7sgZITaDxWIKMx/9 + L/zJbbANt+yx4+XBBSC/28gzVjnwKjmULQ5hZ8cmVNI4GFFyErtG78IownG9w8NE + BVLHow0hgR3RW0qZAGrb55SMjfBHcQ2wcgBULrOOZ/9s9mwinC3h3Z9rmB6T4ynA + v00rtyhtfgnHXWTv/pZLh+TYXTsvNo3gupWqW2xDUu9Q56DFgwHwUlT4fbd7TnQq + j58qTMKeC3+4jU6NwdlSon63GC/ezljEj+Pn5xkSBKD5acTWSd5FffJ7YLU0vqLX + mmjY1/bfaD6xZBMcbeTbOH9QPGOd92Mis66AjV9+cLILJsRIzkgR2nNq2yKNQ5VG + rtpV7Vf9Mw3eI9+VKa2vjfdLlQUK9sSoBDOyyoDBYrWj9uL4E118wDTVeq6Sgk1T + Wxit6EDsyirNeax3VLj25KAiO0LWAp5kqvDLljMNgOkgKNAxSX5eM18ibKGWv2an + VTQ0TeurHEQidUo6SJA3XJJ0yeFgAN4hHSJB/OGkeCCyjAq4aieCMh7ziuXGJ48h + /g9hC9LcfIm8nOwPt/hrMVj4bpgIYGLlaNjLWvMoCoT/TwUdigqUSA4iYbR0bbVr + /So7tv5RH1QxRRWLvF1Y6bE87LzHjd4TpuZdE2Nh/Q8tBRuda0WBZucF/7fRo1Sv + +WPopY/3eXLhsrEmWsZxAoIBAQDsLxrag0KsOxyYB9J1z4fRrgpts8Af56ThxFOj + /X1fdW2lkblCeZZO2B1LS9vEoMmp1M9culX1uj82ST8VZNlrIaCwa5YzofbpyF6X + U2yVG+g8BxOREaMN0+V1hzrvI+lFFqx8Tl+3ex+pKYANOv+i4LfN5D+y5imlLzaT + M9l3gqMXZk0ZrejZBKJa9sWm949WmDDyXaKj6qC9XXLLXKbdRE9tAkPf5CMe3aLm + 2pbt1+nvLXgsAnsz2dt65uZEXnlubdFJr3KGK5+5BzaV0W6+8J+LSfyqUxz+AcWZ + +zrwRKzQ3VWx/3fuc+lkdQUJyXDz40Mk5Y2wqA9X8g5qfOcJAoIBAQC1wMI6XkyG + ufQHdV/B8ALVKnN1mG82t35rxCdNpfWSqsyTuLxkem1F9ZgzK4Q6CmIgEW1TxbP9 + 74eTdtPTuP0vP9cRMomRUREblCmsYZv5/c42DbJ7hfBPDiSJHB3JKpMT4yPfEuhN + 9DR3gnITV0L9QqxO9TVH2sqO7lM77l9LQpQt3xJARMKCqtGTWGLdEG6skUnXHKz3 + VBFFt1x4hT5noLVLh4M/df1A1nB2DRm5pEcyOaH1wSTMIGnCvUNgrq2xVoP3TIJs + RvWak9h2RO2MHPFf13Nhai3L7gxsdodpswH650Qmk4YO6og7iwUxHXL3B4GCZnK6 + PDDOzm9Ptp+LAoIBAQDiZHS1KETsmuzZvgW67+cc0lsktLxg2MZvsqUJ+J4ItqMX + pguS8MFnajkKR/itDgLATEFIfUSQeqrE+okBlN3jlyRUd4xOid4IUgx5uXnHpCyD + /bR/xgwp4Qd+FNYlDKM5mnZT4TxWwCqlGCaqh/cqxYTqUvPMJFue/xatG3JE4HA8 + qc8V4mHkRFDsKMdlOL+pHdEtQRv5S5owajbzQCiiyCvqLdWp8yDHIWRZLQanjeOr + ZEZgyTAXj6iWsmXe+0Ai3hlTLF32xjIgRg3Ipiwl0rjb51vOWETeJgyngO4KCYot + 2zudl2f6phj+Nj1SGEmxPhLKd0/OGgo7Hsc6w+chAoIBAHhdwcN58+A9ghj2aIY9 + dwLI7FHys6Re/QBNlWHdCLcrGfSyoUFBuuBb94HbzePKQJXQNMEH612+peDJDxvm + JPaHptyixWxRba0AAGFC+1Mh/NDbXVpkp3MTgKq0zh0Nbv36rSTslqAZnC2RXA7m + +VxULVzVE4YUpZTmzISiJsXmv89pLeMWJmL20XhtTnvsh/8M8QPe38WkDRRIjJrc + Uym5ypbMleUPNLsdyLjFkEXbP7NJa7MfSElPJftr8BU1WZ5aF2dNagpfLARE6VPZ + 7h+eg1PfkW/wK4gkjGHAVYlwnV0Wj5GknWF/fN1CAhw2zo4+kExVoKEpf4FWQW1f + GmUCggEBAKcJPOSdg26e0fBtTJ3CUXYwCyTDmvxVg5z9JCEuyziPoj5QqH0tmce3 + SWH/4bHOSWwnv1y3KwlAqGCzpa2VVvnXsfSn3dPcuQmrkXTtYv+zztMbXAMOyJxp + 4KEWow7AU2hKg9TrPXW6Sn3/0au3ejP5QBZBwp+1hbDqUawtSKTPmPIZkBsaGy8W + 6m1T5E5KtsNueMK97pH80jKc73zQtx6DjkhEnHRwMc/2EdGf/CB5k+BQ4TeXSUej + 2JftHmpMPwFWdtpTJ2jOqBNFps+ULuaX+4H6Bb7vOUKkAn3zhJfh4wFpvYVtnXE+ + v8yTmHG7BmzLiznu3uPyiEfAPQ3KQ9E= + -----END PRIVATE KEY----- diff --git a/integration-tests/it-pushgateway/version-rules.xml b/integration-tests/it-pushgateway/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/integration-tests/it-pushgateway/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/integration-tests/it-spring-boot-smoke-test/pom.xml b/integration-tests/it-spring-boot-smoke-test/pom.xml new file mode 100644 index 000000000..35663055f --- /dev/null +++ b/integration-tests/it-spring-boot-smoke-test/pom.xml @@ -0,0 +1,183 @@ + + + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 4.0.1 + + + + io.prometheus + it-spring-boot-smoke-test + 1.5.0-SNAPSHOT + + Integration Test - Spring Smoke Tests + + Spring Smoke Tests + + + 25 + 6.0.2 + + + + + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + + + io.prometheus + prometheus-metrics-bom + ${project.version} + pom + import + + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-actuator + + + io.micrometer + micrometer-registry-prometheus + runtime + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.platform + junit-platform-launcher + test + + + io.prometheus + it-common + test-jar + ${project.version} + test + + + + + + + org.graalvm.buildtools + native-maven-plugin + + + + + --initialize-at-build-time=org.junit.jupiter.api.DisplayNameGenerator$IndicativeSentences + + + --initialize-at-build-time=org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor$ClassInfo + + + --initialize-at-build-time=org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor$LifecycleMethods + + + --initialize-at-build-time=org.junit.jupiter.engine.descriptor.ClassTemplateInvocationTestDescriptor + + + --initialize-at-build-time=org.junit.jupiter.engine.descriptor.ClassTemplateTestDescriptor + + + --initialize-at-build-time=org.junit.jupiter.engine.descriptor.DynamicDescendantFilter$Mode + + + --initialize-at-build-time=org.junit.jupiter.engine.descriptor.ExclusiveResourceCollector$1 + + + --initialize-at-build-time=org.junit.jupiter.engine.descriptor.MethodBasedTestDescriptor$MethodInfo + + + --initialize-at-build-time=org.junit.jupiter.engine.discovery.ClassSelectorResolver$DummyClassTemplateInvocationContext + + + --initialize-at-build-time=org.junit.platform.engine.support.store.NamespacedHierarchicalStore$EvaluatedValue + + --initialize-at-build-time=org.junit.platform.launcher.core.DiscoveryIssueNotifier + + + --initialize-at-build-time=org.junit.platform.launcher.core.HierarchicalOutputDirectoryProvider + + + --initialize-at-build-time=org.junit.platform.launcher.core.LauncherDiscoveryResult$EngineResultInfo + + + --initialize-at-build-time=org.junit.platform.suite.engine.SuiteTestDescriptor$LifecycleMethods + + + --initialize-at-build-time=org.junit.platform.commons.logging.LoggerFactory$DelegatingLogger + + + --initialize-at-build-time=org.junit.jupiter.engine.execution.ConditionEvaluator + + + --initialize-at-build-time=org.junit.jupiter.engine.execution.InterceptingExecutableInvoker + + + --initialize-at-build-time=org.junit.jupiter.api.extension.ConditionEvaluationResult + + + --initialize-at-build-time=org.junit.jupiter.engine.execution.InvocationInterceptorChain + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + com.diffplug.spotless + spotless-maven-plugin + 3.1.0 + + + + + + + + verify + + check + + + + + + + + diff --git a/integration-tests/it-spring-boot-smoke-test/src/main/java/io/prometheus/metrics/it/springboot/Application.java b/integration-tests/it-spring-boot-smoke-test/src/main/java/io/prometheus/metrics/it/springboot/Application.java new file mode 100644 index 000000000..955ea4033 --- /dev/null +++ b/integration-tests/it-spring-boot-smoke-test/src/main/java/io/prometheus/metrics/it/springboot/Application.java @@ -0,0 +1,12 @@ +package io.prometheus.metrics.it.springboot; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } +} diff --git a/integration-tests/it-spring-boot-smoke-test/src/main/resources/application.yaml b/integration-tests/it-spring-boot-smoke-test/src/main/resources/application.yaml new file mode 100644 index 000000000..7ea719a7a --- /dev/null +++ b/integration-tests/it-spring-boot-smoke-test/src/main/resources/application.yaml @@ -0,0 +1,5 @@ +management: + endpoints: + web: + exposure: + include: "*" diff --git a/integration-tests/it-spring-boot-smoke-test/src/test/java/io/prometheus/metrics/it/springboot/ApplicationTest.java b/integration-tests/it-spring-boot-smoke-test/src/test/java/io/prometheus/metrics/it/springboot/ApplicationTest.java new file mode 100644 index 000000000..94617dc25 --- /dev/null +++ b/integration-tests/it-spring-boot-smoke-test/src/test/java/io/prometheus/metrics/it/springboot/ApplicationTest.java @@ -0,0 +1,34 @@ +package io.prometheus.metrics.it.springboot; + +import static org.assertj.core.api.Assertions.assertThat; + +import io.prometheus.client.it.common.ExporterTest; +import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics; +import java.io.IOException; +import java.net.URI; +import java.util.List; +import java.util.Optional; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) +class ApplicationTest { + @Test + public void testPrometheusProtobufFormat() throws IOException { + ExporterTest.Response response = + ExporterTest.scrape( + "GET", + URI.create("http://localhost:8080/actuator/prometheus"), + "Accept", + "application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily;" + + " encoding=delimited"); + assertThat(response.status).isEqualTo(200); + + List metrics = response.protoBody(); + Optional metric = + metrics.stream() + .filter(m -> m.getName().equals("application_started_time_seconds")) + .findFirst(); + assertThat(metric).isPresent(); + } +} diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml new file mode 100644 index 000000000..b932c5799 --- /dev/null +++ b/integration-tests/pom.xml @@ -0,0 +1,69 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + integration-tests + pom + + Integration Tests + + Integration tests for the Exporter modules + + + + true + + + + it-common + it-exporter + it-pushgateway + it-spring-boot-smoke-test + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + integration-test + integration-test + + integration-test + verify + + + + + + + + + + commons-io + commons-io + 2.21.0 + + + org.testcontainers + junit-jupiter + 1.21.4 + test + + + org.hamcrest + hamcrest-core + + + + + diff --git a/integration-tests/version-rules.xml b/integration-tests/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/integration-tests/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/lychee.toml b/lychee.toml new file mode 100644 index 000000000..d67acf825 --- /dev/null +++ b/lychee.toml @@ -0,0 +1,15 @@ +max_retries = 6 +exclude_loopback = true +cache = true + +base_url = "https://prometheus.github.io" +exclude_path = ["docs/themes"] +exclude = [ + '^https://github\.com/prometheus/client_java/settings', + '#', + 'CONTRIBUTING.md', + 'LICENSE', + 'MAINTAINERS.md' +] + + diff --git a/mise.toml b/mise.toml new file mode 100644 index 000000000..56d2680f5 --- /dev/null +++ b/mise.toml @@ -0,0 +1,85 @@ +[tools] +"go:github.com/gohugoio/hugo" = "v0.154.5" +"go:github.com/grafana/oats" = "0.6.0" +java = "temurin-25.0.1+8.0.LTS" +lychee = "0.22.0" +protoc = "33.4" + +[tasks.ci] +description = "CI Build" +run = "./mvnw clean install" +env.REQUIRE_PROTO_UP_TO_DATE = "true" +env.PROTO_GENERATION = "true" + +[tasks.format] +description = "format source code" +run = "./mvnw spotless:apply" + +[tasks.clean] +description = "clean all modules" +run = "./mvnw clean" + +[tasks.compile] +description = "bare compile, ignoring formatting and linters" +run = "./mvnw install -DskipTests -Dspotless.check.skip=true -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn" + +[tasks.generate] +description = "bare compile, ignoring formatting and linters" +run = [ + "mise use --pin protoc@latest", + "./mvnw clean install -DskipTests -Dspotless.check.skip=true -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn" +] +env.PROTO_GENERATION = "true" + +[tasks.test] +description = "run unit tests, ignoring formatting and linters" +run = "./mvnw test -Dspotless.check.skip=true -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn" + +[tasks.test-all] +description = "run all tests" +run = "./mvnw verify" + +[tasks.build] +description = "build all modules without tests" +run = "./mvnw install -DskipTests -Dcoverage.skip=true" + +[tasks."lint:links"] +description = "Lint markdown links" +run = "lychee --include-fragments ." + +[tasks."lint:rest"] +description = "All lints not covered by super linter" +depends = ["lint:links", "lint:bom"] + +[tasks."lint:all"] +description = "All lints" +depends = ["lint:rest", "lint:super-linter"] + +[tasks.acceptance-test] +description = "Run OATs acceptance tests" +depends = "build" +run = "oats -timeout 5m examples/" + +[tasks.javadoc] +description = "Generate Javadoc" +run = [ + "./mvnw -B clean compile javadoc:javadoc javadoc:aggregate -P 'javadoc,!default'", + "rm -rf ./docs/static/api", + "mv ./target/reports/apidocs ./docs/static/api && echo && echo 'ls ./docs/static/api' && ls ./docs/static/api" +] + +[tasks.gh-pages-dev] +description = "Build GitHub pages for dev" +run = "hugo server -D" +dir = "docs" + +[tasks.build-gh-pages] +description = "Build GitHub pages" +depends = ["javadoc", "set-release-version-github-pages"] +# For maximum backward compatibility with Hugo modules +env = { HUGO_ENVIRONMENT = "production", HUGO_ENV = "production" } +dir = "docs" +run = [ + "hugo --gc --minify --baseURL ${BASE_URL}/", + "echo 'ls ./public/api' && ls ./public/api" +] diff --git a/mvnw b/mvnw index 6ecc150ae..bd8896bf2 100755 --- a/mvnw +++ b/mvnw @@ -19,218 +19,277 @@ # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- -# Maven2 Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir +# Apache Maven Wrapper startup batch script, version 3.3.4 # # Optional ENV vars # ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# JAVA_HOME - location of a JDK home dir, required when download maven via java source +# MVNW_REPOURL - repo url base for downloading maven distribution +# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output # ---------------------------------------------------------------------------- -if [ -z "$MAVEN_SKIP_RC" ] ; then +set -euf +[ "${MVNW_VERBOSE-}" != debug ] || set -x - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi +# OS specific support. +native_path() { printf %s\\n "$1"; } +case "$(uname)" in +CYGWIN* | MINGW*) + [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" + native_path() { cygpath --path --windows "$1"; } + ;; +esac + +# set JAVACMD and JAVACCMD +set_java_home() { + # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched + if [ -n "${JAVA_HOME-}" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACCMD="$JAVA_HOME/jre/sh/javac" + else + JAVACMD="$JAVA_HOME/bin/java" + JAVACCMD="$JAVA_HOME/bin/javac" - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" + if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then + echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 + echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 + return 1 + fi + fi + else + JAVACMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v java + )" || : + JAVACCMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v javac + )" || : + + if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then + echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 + return 1 + fi fi +} -fi +# hash string like Java String::hashCode +hash_string() { + str="${1:-}" h=0 + while [ -n "$str" ]; do + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) + str="${str#?}" + done + printf %x\\n $h +} -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # - # Look for the Apple JDKs first to preserve the existing behaviour, and then look - # for the new JDKs provided by Oracle. - # - if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK ] ; then - # - # Apple JDKs - # - export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home - fi - - if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Java/JavaVirtualMachines/CurrentJDK ] ; then - # - # Apple JDKs - # - export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home - fi - - if [ -z "$JAVA_HOME" ] && [ -L "/Library/Java/JavaVirtualMachines/CurrentJDK" ] ; then - # - # Oracle JDKs - # - export JAVA_HOME=/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home - fi - - if [ -z "$JAVA_HOME" ] && [ -x "/usr/libexec/java_home" ]; then - # - # Apple JDKs - # - export JAVA_HOME=`/usr/libexec/java_home` - fi - ;; -esac +verbose() { :; } +[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi +die() { + printf %s\\n "$1" >&2 + exit 1 +} -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" +trim() { + # MWRAPPER-139: + # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. + # Needed for removing poorly interpreted newline sequences when running in more + # exotic environments such as mingw bash on Windows. + printf "%s" "${1}" | tr -d '[:space:]' +} - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done +scriptDir="$(dirname "$0")" +scriptName="$(basename "$0")" - saveddir=`pwd` +# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties +while IFS="=" read -r key value; do + case "${key-}" in + distributionUrl) distributionUrl=$(trim "${value-}") ;; + distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; + esac +done <"$scriptDir/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" - M2_HOME=`dirname "$PRG"`/.. +case "${distributionUrl##*/}" in +maven-mvnd-*bin.*) + MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ + case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in + *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; + :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; + :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; + :Linux*x86_64*) distributionPlatform=linux-amd64 ;; + *) + echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 + distributionPlatform=linux-amd64 + ;; + esac + distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" + ;; +maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; +*) MVN_CMD="mvn${scriptName#mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; +esac - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" +distributionUrlName="${distributionUrl##*/}" +distributionUrlNameMain="${distributionUrlName%.*}" +distributionUrlNameMain="${distributionUrlNameMain%-bin}" +MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" +MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" - cd "$saveddir" - # echo Using m2 at $M2_HOME +exec_maven() { + unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : + exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" +} + +if [ -d "$MAVEN_HOME" ]; then + verbose "found existing MAVEN_HOME at $MAVEN_HOME" + exec_maven "$@" fi -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +case "${distributionUrl-}" in +*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; +*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; +esac + +# prepare tmp dir +if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then + clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } + trap clean HUP INT TERM EXIT +else + die "cannot create temp dir" fi -# For Migwn, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" - # TODO classpath? +mkdir -p -- "${MAVEN_HOME%/*}" + +# Download and Install Apache Maven +verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +verbose "Downloading from: $distributionUrl" +verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +# select .zip or .tar.gz +if ! command -v unzip >/dev/null; then + distributionUrl="${distributionUrl%.zip}.tar.gz" + distributionUrlName="${distributionUrl##*/}" fi -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi +# verbose opt +__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' +[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v + +# normalize http auth +case "${MVNW_PASSWORD:+has-password}" in +'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; +has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; +esac + +if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then + verbose "Found wget ... using wget" + wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" +elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then + verbose "Found curl ... using curl" + curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" +elif set_java_home; then + verbose "Falling back to use Java to download" + javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" + targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" + cat >"$javaSource" <<-END + public class Downloader extends java.net.Authenticator + { + protected java.net.PasswordAuthentication getPasswordAuthentication() + { + return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); + } + public static void main( String[] args ) throws Exception + { + setDefault( new Downloader() ); + java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); + } + } + END + # For Cygwin/MinGW, switch paths to Windows format before running javac and java + verbose " - Compiling Downloader.java ..." + "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" + verbose " - Running Downloader.java ..." + "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" fi -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" +# If specified, validate the SHA-256 sum of the Maven distribution zip file +if [ -n "${distributionSha256Sum-}" ]; then + distributionSha256Result=false + if [ "$MVN_CMD" = mvnd.sh ]; then + echo "Checksum validation is not supported for maven-mvnd." >&2 + echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + elif command -v sha256sum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c - >/dev/null 2>&1; then + distributionSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then + distributionSha256Result=true fi else - JAVACMD="`which java`" + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $distributionSha256Result = false ]; then + echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 + echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 + exit 1 fi fi -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 +# unzip and move +if command -v unzip >/dev/null; then + unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" +else + tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" fi -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." +# Find the actual extracted directory name (handles snapshots where filename != directory name) +actualDistributionDir="" + +# First try the expected directory name (for regular distributions) +if [ -d "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" ]; then + if [ -f "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/bin/$MVN_CMD" ]; then + actualDistributionDir="$distributionUrlNameMain" + fi fi -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - local basedir=$(pwd) - local wdir=$(pwd) - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break +# If not found, search for any directory with the Maven executable (for snapshots) +if [ -z "$actualDistributionDir" ]; then + # enable globbing to iterate over items + set +f + for dir in "$TMP_DOWNLOAD_DIR"/*; do + if [ -d "$dir" ]; then + if [ -f "$dir/bin/$MVN_CMD" ]; then + actualDistributionDir="$(basename "$dir")" + break + fi fi - wdir=$(cd "$wdir/.."; pwd) done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)} -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` + set -f fi -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" -export MAVEN_CMD_LINE_ARGS +if [ -z "$actualDistributionDir" ]; then + verbose "Contents of $TMP_DOWNLOAD_DIR:" + verbose "$(ls -la "$TMP_DOWNLOAD_DIR")" + die "Could not find Maven distribution directory in extracted archive" +fi -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain +verbose "Found extracted Maven distribution directory: $actualDistributionDir" +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$actualDistributionDir/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$actualDistributionDir" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" -# avoid using MAVEN_CMD_LINE_ARGS below since that would loose parameter escaping in $@ -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" +clean || : +exec_maven "$@" diff --git a/mvnw.cmd b/mvnw.cmd index 8e2b7459f..5761d9489 100644 --- a/mvnw.cmd +++ b/mvnw.cmd @@ -1,3 +1,4 @@ +<# : batch portion @REM ---------------------------------------------------------------------------- @REM Licensed to the Apache Software Foundation (ASF) under one @REM or more contributor license agreements. See the NOTICE file @@ -18,129 +19,171 @@ @REM ---------------------------------------------------------------------------- @REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir +@REM Apache Maven Wrapper startup batch script, version 3.3.4 @REM @REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM MVNW_REPOURL - repo url base for downloading maven distribution +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output @REM ---------------------------------------------------------------------------- -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -set MAVEN_CMD_LINE_ARGS=%MAVEN_CONFIG% %* - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" - -set WRAPPER_JAR=""%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -# avoid using MAVEN_CMD_LINE_ARGS below since that would loose parameter escaping in %* -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% +@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) +@SET __MVNW_CMD__= +@SET __MVNW_ERROR__= +@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% +@SET PSModulePath= +@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( + IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) +) +@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% +@SET __MVNW_PSMODULEP_SAVE= +@SET __MVNW_ARG0_NAME__= +@SET MVNW_USERNAME= +@SET MVNW_PASSWORD= +@IF NOT "%__MVNW_CMD__%"=="" ("%__MVNW_CMD__%" %*) +@echo Cannot start maven from wrapper >&2 && exit /b 1 +@GOTO :EOF +: end batch / begin powershell #> + +$ErrorActionPreference = "Stop" +if ($env:MVNW_VERBOSE -eq "true") { + $VerbosePreference = "Continue" +} + +# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties +$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl +if (!$distributionUrl) { + Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" +} + +switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { + "maven-mvnd-*" { + $USE_MVND = $true + $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" + $MVN_CMD = "mvnd.cmd" + break + } + default { + $USE_MVND = $false + $MVN_CMD = $script -replace '^mvnw','mvn' + break + } +} + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +if ($env:MVNW_REPOURL) { + $MVNW_REPO_PATTERN = if ($USE_MVND -eq $False) { "/org/apache/maven/" } else { "/maven/mvnd/" } + $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace "^.*$MVNW_REPO_PATTERN",'')" +} +$distributionUrlName = $distributionUrl -replace '^.*/','' +$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' + +$MAVEN_M2_PATH = "$HOME/.m2" +if ($env:MAVEN_USER_HOME) { + $MAVEN_M2_PATH = "$env:MAVEN_USER_HOME" +} + +if (-not (Test-Path -Path $MAVEN_M2_PATH)) { + New-Item -Path $MAVEN_M2_PATH -ItemType Directory | Out-Null +} + +$MAVEN_WRAPPER_DISTS = $null +if ((Get-Item $MAVEN_M2_PATH).Target[0] -eq $null) { + $MAVEN_WRAPPER_DISTS = "$MAVEN_M2_PATH/wrapper/dists" +} else { + $MAVEN_WRAPPER_DISTS = (Get-Item $MAVEN_M2_PATH).Target[0] + "/wrapper/dists" +} + +$MAVEN_HOME_PARENT = "$MAVEN_WRAPPER_DISTS/$distributionUrlNameMain" +$MAVEN_HOME_NAME = ([System.Security.Cryptography.SHA256]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' +$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" + +if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { + Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" + Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" + exit $? +} + +if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { + Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" +} + +# prepare tmp dir +$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile +$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" +$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null +trap { + if ($TMP_DOWNLOAD_DIR.Exists) { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } + } +} + +New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null + +# Download and Install Apache Maven +Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +Write-Verbose "Downloading from: $distributionUrl" +Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +$webclient = New-Object System.Net.WebClient +if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { + $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) +} +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum +if ($distributionSha256Sum) { + if ($USE_MVND) { + Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." + } + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash + if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { + Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." + } +} + +# unzip and move +Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null + +# Find the actual extracted directory name (handles snapshots where filename != directory name) +$actualDistributionDir = "" + +# First try the expected directory name (for regular distributions) +$expectedPath = Join-Path "$TMP_DOWNLOAD_DIR" "$distributionUrlNameMain" +$expectedMvnPath = Join-Path "$expectedPath" "bin/$MVN_CMD" +if ((Test-Path -Path $expectedPath -PathType Container) -and (Test-Path -Path $expectedMvnPath -PathType Leaf)) { + $actualDistributionDir = $distributionUrlNameMain +} + +# If not found, search for any directory with the Maven executable (for snapshots) +if (!$actualDistributionDir) { + Get-ChildItem -Path "$TMP_DOWNLOAD_DIR" -Directory | ForEach-Object { + $testPath = Join-Path $_.FullName "bin/$MVN_CMD" + if (Test-Path -Path $testPath -PathType Leaf) { + $actualDistributionDir = $_.Name + } + } +} + +if (!$actualDistributionDir) { + Write-Error "Could not find Maven distribution directory in extracted archive" +} + +Write-Verbose "Found extracted Maven distribution directory: $actualDistributionDir" +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$actualDistributionDir" -NewName $MAVEN_HOME_NAME | Out-Null +try { + Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null +} catch { + if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { + Write-Error "fail to move MAVEN_HOME" + } +} finally { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } +} + +Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" diff --git a/pom.xml b/pom.xml index 29822221b..5a64862cf 100644 --- a/pom.xml +++ b/pom.xml @@ -1,192 +1,471 @@ - - pom - 4.0.0 + + pom + 4.0.0 + io.prometheus - parent - 0.6.1-SNAPSHOT + client_java_parent + 1.5.0-SNAPSHOT + prometheus-metrics-parent/pom.xml + - - org.sonatype.oss - oss-parent - 7 - + 1.5.0-SNAPSHOT + client_java - Prometheus Java Suite - http://github.com/prometheus/client_java - - The Prometheus Java Suite: Client Metrics, Exposition, and Examples - + Prometheus Metrics Library + + The Prometheus Java Metrics Library + - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - + + UTF-8 + --module-name-need-to-be-overridden-- + 4.33.4 + 33.5.0-jre + 6.0.2 + 2.16.0-alpha + 8 + 0.70 + false + false + false + false + -Werror + - - scm:git:git@github.com:prometheus/client_java.git - scm:git:git@github.com:prometheus/client_java.git - git@github.com:prometheus/client_java.git - HEAD - + + prometheus-metrics-parent + prometheus-metrics-bom + prometheus-metrics-core + prometheus-metrics-config + prometheus-metrics-model + prometheus-metrics-tracer + prometheus-metrics-exposition-formats + prometheus-metrics-exposition-formats-shaded + prometheus-metrics-exposition-textformats + prometheus-metrics-exporter-common + prometheus-metrics-exporter-servlet-jakarta + prometheus-metrics-exporter-servlet-javax + prometheus-metrics-exporter-httpserver + prometheus-metrics-exporter-opentelemetry + prometheus-metrics-exporter-opentelemetry-shaded + prometheus-metrics-exporter-opentelemetry-otel-agent-resources + prometheus-metrics-exporter-pushgateway + prometheus-metrics-instrumentation-caffeine + prometheus-metrics-instrumentation-jvm + prometheus-metrics-instrumentation-dropwizard5 + prometheus-metrics-instrumentation-dropwizard + prometheus-metrics-instrumentation-guava + prometheus-metrics-simpleclient-bridge + - - - mtp - Matt T. Proud - matt.proud@gmail.com - - + + + com.google.code.findbugs + jsr305 + 3.0.2 + provided + + - - simpleclient - simpleclient_common - simpleclient_caffeine - simpleclient_dropwizard - simpleclient_graphite_bridge - simpleclient_hibernate - simpleclient_guava - simpleclient_hotspot - simpleclient_httpserver - simpleclient_log4j - simpleclient_log4j2 - simpleclient_logback - simpleclient_pushgateway - simpleclient_servlet - simpleclient_spring_web - simpleclient_spring_boot - simpleclient_jetty - simpleclient_jetty_jdk8 - simpleclient_vertx - benchmark - + + + + + + + maven-install-plugin + 3.1.4 + + + maven-resources-plugin + 3.4.0 + + + maven-compiler-plugin + 3.14.1 + + + maven-surefire-plugin + 3.5.4 + + + maven-jar-plugin + 3.5.0 + + + maven-deploy-plugin + 3.1.4 + + + maven-clean-plugin + 3.5.0 + + + maven-site-plugin + 3.21.0 + + + + maven-shade-plugin + 3.6.1 + + + maven-failsafe-plugin + 3.5.4 + + + maven-dependency-plugin + 3.9.0 + + + maven-javadoc-plugin + 3.12.0 + + + maven-enforcer-plugin + 3.6.2 + + + org.codehaus.mojo + build-helper-maven-plugin + 3.6.1 + + + org.codehaus.mojo + exec-maven-plugin + 3.6.3 + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.6.0 + + true + google_checks.xml + checkstyle.xml + warning + true + ${checkstyle.skip} + checkstyle-suppressions.xml + **/generated/**,**/jmh_generated/* + + + + + check + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.14 + + ${coverage.skip} + + **/generated/** + **/*BlockingRejectedExecutionHandler* + + + + + + prepare-agent + + + + report + test + + report + + + + check + + check + + + + + CLASS + + + LINE + COVEREDRATIO + ${jacoco.line-coverage} + + + + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + + + enforce-plugin-versions + + enforce + + + + + + org.springframework.boot:spring-boot-maven-plugin + + + + + + + + + org.apache.felix + maven-bundle-plugin + 6.0.0 + true + + + ${automatic.module.name} + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + maven-compiler-plugin + + ${java.version} + ${java.version} + ${java.version} + 25 + 25 + 25 + true + + -Xlint:all,-serial,-processing,-options + ${warnings} + --should-stop=ifError=FLOW + -XDcompilePolicy=simple + + -Xplugin:ErrorProne + -Xep:AlmostJavadoc:OFF + -Xep:MissingSummary:OFF + -Xep:LongDoubleConversion:OFF + -Xep:StringSplitter:OFF + -XepExcludedPaths:(.*/generated/.*|.*/src/test/java/.*|.*/examples/.*|.*/integration-tests/.*) + -XepOpt:NullAway:AnnotatedPackages=io.prometheus.metrics + + + + + com.google.errorprone + error_prone_core + 2.46.0 + + + com.uber.nullaway + nullaway + 0.12.15 + + + + + + + org.codehaus.mojo + versions-maven-plugin + 2.20.1 + + file://${project.basedir}/version-rules.xml + + + + - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - + + + + + maven-project-info-reports-plugin + 3.9.0 + + + maven-javadoc-plugin + + + aggregate + false + + aggregate + + + + default + + javadoc + + + + + + - + + + default + + true + + + examples + benchmarks + integration-tests + + + + + org.junit + junit-bom + ${junit-jupiter.version} + pom + import + + + io.opentelemetry.instrumentation + opentelemetry-instrumentation-bom-alpha + ${otel.instrumentation.version} + pom + import + + + io.opentelemetry + opentelemetry-proto + 1.7.1-alpha + test + + + + + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + org.junit.jupiter + junit-jupiter-params + ${junit-jupiter.version} + test + + + org.mockito + mockito-core + 5.21.0 + test + + + org.assertj + assertj-core + 3.27.6 + test + + + com.google.guava + guava + ${guava.version} + test + + + org.slf4j + slf4j-simple + 2.0.17 + test + + + org.junit-pioneer + junit-pioneer + 2.3.0 + test + + + org.awaitility + awaitility + 4.3.0 + test + + + org.wiremock + wiremock + 3.13.2 + test + + + org.hamcrest + hamcrest-core + + + + + + + javadoc + - - maven-release-plugin - org.apache.maven.plugins - 2.5 - - true - false - release - deploy - - - - maven-deploy-plugin - org.apache.maven.plugins - 2.7 - - - org.apache.felix - maven-bundle-plugin - 2.4.0 - true - - - org.apache.maven.plugins - maven-surefire-plugin - 2.15 - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8 - - UTF-8 - UTF-8 - true - - - - generate-javadoc-site-report - site - - javadoc - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - 1.6 - 1.6 - - + + maven-javadoc-plugin + + UTF-8 + UTF-8 + true + all + public + io.prometheus.metrics.expositionformats.generated.* + + 8 + + - - - - - release - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.9.1 - - - attach-javadocs - - jar - - - - - - - - + + + + release + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + + + diff --git a/prometheus-metrics-bom/pom.xml b/prometheus-metrics-bom/pom.xml new file mode 100644 index 000000000..a13398228 --- /dev/null +++ b/prometheus-metrics-bom/pom.xml @@ -0,0 +1,154 @@ + + + 4.0.0 + + + io.prometheus + client_java_parent + 1.5.0-SNAPSHOT + ../prometheus-metrics-parent/pom.xml + + + prometheus-metrics-bom + pom + + Prometheus Metrics BOM + + Bill of Materials for the Prometheus Metrics library + + + + true + + + + + + io.prometheus + prometheus-metrics-config + ${project.version} + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-common + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-httpserver + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-opentelemetry + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-opentelemetry-no-otel + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-opentelemetry-otel-agent-resources + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-pushgateway + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-servlet-jakarta + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-servlet-javax + ${project.version} + + + io.prometheus + prometheus-metrics-exposition-formats-no-protobuf + ${project.version} + + + io.prometheus + prometheus-metrics-exposition-formats + ${project.version} + + + io.prometheus + prometheus-metrics-exposition-textformats + ${project.version} + + + io.prometheus + prometheus-metrics-instrumentation-dropwizard + ${project.version} + + + io.prometheus + prometheus-metrics-instrumentation-dropwizard5 + ${project.version} + + + io.prometheus + prometheus-metrics-instrumentation-caffeine + ${project.version} + + + io.prometheus + prometheus-metrics-instrumentation-guava + ${project.version} + + + io.prometheus + prometheus-metrics-instrumentation-jvm + ${project.version} + + + io.prometheus + prometheus-metrics-model + ${project.version} + + + io.prometheus + prometheus-metrics-simpleclient-bridge + ${project.version} + + + io.prometheus + prometheus-metrics-tracer + ${project.version} + + + io.prometheus + prometheus-metrics-tracer-common + ${project.version} + + + io.prometheus + prometheus-metrics-tracer-initializer + ${project.version} + + + io.prometheus + prometheus-metrics-tracer-otel + ${project.version} + + + io.prometheus + prometheus-metrics-tracer-otel-agent + ${project.version} + + + + diff --git a/prometheus-metrics-bom/version-rules.xml b/prometheus-metrics-bom/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-bom/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-config/pom.xml b/prometheus-metrics-config/pom.xml new file mode 100644 index 000000000..a07c83f0b --- /dev/null +++ b/prometheus-metrics-config/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-config + bundle + + Prometheus Metrics Config + + Configuration for Prometheus metrics and exposition formats. + + + + io.prometheus.metrics.config + + + diff --git a/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/EscapingScheme.java b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/EscapingScheme.java new file mode 100644 index 000000000..1cd037bf3 --- /dev/null +++ b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/EscapingScheme.java @@ -0,0 +1,85 @@ +package io.prometheus.metrics.config; + +import javax.annotation.Nullable; + +public enum EscapingScheme { + /** NO_ESCAPING indicates that a name will not be escaped. */ + ALLOW_UTF8("allow-utf-8"), + + /** UNDERSCORE_ESCAPING replaces all legacy-invalid characters with underscores. */ + UNDERSCORE_ESCAPING("underscores"), + + /** + * DOTS_ESCAPING is similar to UNDERSCORE_ESCAPING, except that dots are converted to `_dot_` and + * pre-existing underscores are converted to `__`. + */ + DOTS_ESCAPING("dots"), + + /** + * VALUE_ENCODING_ESCAPING prepends the name with `U__` and replaces all invalid characters with + * the Unicode value, surrounded by underscores. Single underscores are replaced with double + * underscores. + */ + VALUE_ENCODING_ESCAPING("values"); + + private static final String ESCAPING_KEY = "escaping"; + + /** Default escaping scheme for names when not specified. */ + public static final EscapingScheme DEFAULT = UNDERSCORE_ESCAPING; + + public final String getValue() { + return value; + } + + private final String value; + + EscapingScheme(String value) { + this.value = value; + } + + /** + * fromAcceptHeader returns an EscapingScheme depending on the Accept header. Iff the header + * contains an escaping=allow-utf-8 term, it will select NO_ESCAPING. If a valid "escaping" term + * exists, that will be used. Otherwise, the global default will be returned. + */ + public static EscapingScheme fromAcceptHeader(@Nullable String acceptHeader) { + if (acceptHeader != null) { + for (String p : acceptHeader.split(";")) { + String[] toks = p.split("="); + if (toks.length != 2) { + continue; + } + String key = toks[0].trim(); + String value = toks[1].trim(); + if (key.equals(ESCAPING_KEY)) { + try { + return EscapingScheme.forString(value); + } catch (IllegalArgumentException e) { + // If the escaping parameter is unknown, ignore it. + return DEFAULT; + } + } + } + } + return DEFAULT; + } + + static EscapingScheme forString(String value) { + switch (value) { + case "allow-utf-8": + return ALLOW_UTF8; + case "underscores": + return UNDERSCORE_ESCAPING; + case "dots": + return DOTS_ESCAPING; + case "values": + return VALUE_ENCODING_ESCAPING; + default: + throw new IllegalArgumentException("Unknown escaping scheme: " + value); + } + } + + public String toHeaderFormat() { + return "; " + ESCAPING_KEY + "=" + value; + } +} diff --git a/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExemplarsProperties.java b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExemplarsProperties.java new file mode 100644 index 000000000..20933bfdc --- /dev/null +++ b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExemplarsProperties.java @@ -0,0 +1,141 @@ +package io.prometheus.metrics.config; + +import java.util.Map; +import javax.annotation.Nullable; + +/** Properties starting with io.prometheus.exemplars */ +public class ExemplarsProperties { + + private static final String PREFIX = "io.prometheus.exemplars"; + private static final String MIN_RETENTION_PERIOD_SECONDS = "minRetentionPeriodSeconds"; + private static final String MAX_RETENTION_PERIOD_SECONDS = "maxRetentionPeriodSeconds"; + private static final String SAMPLE_INTERVAL_MILLISECONDS = "sampleIntervalMilliseconds"; + + @Nullable private final Integer minRetentionPeriodSeconds; + @Nullable private final Integer maxRetentionPeriodSeconds; + @Nullable private final Integer sampleIntervalMilliseconds; + + private ExemplarsProperties( + @Nullable Integer minRetentionPeriodSeconds, + @Nullable Integer maxRetentionPeriodSeconds, + @Nullable Integer sampleIntervalMilliseconds) { + this.minRetentionPeriodSeconds = minRetentionPeriodSeconds; + this.maxRetentionPeriodSeconds = maxRetentionPeriodSeconds; + this.sampleIntervalMilliseconds = sampleIntervalMilliseconds; + } + + /** + * Minimum time how long Exemplars are kept before they may be replaced by new Exemplars. + * + *

    Default see {@code ExemplarSamplerConfig.DEFAULT_MIN_RETENTION_PERIOD_SECONDS} + */ + @Nullable + public Integer getMinRetentionPeriodSeconds() { + return minRetentionPeriodSeconds; + } + + /** + * Maximum time how long Exemplars are kept before they are evicted. + * + *

    Default see {@code ExemplarSamplerConfig.DEFAULT_MAX_RETENTION_PERIOD_SECONDS} + */ + @Nullable + public Integer getMaxRetentionPeriodSeconds() { + return maxRetentionPeriodSeconds; + } + + /** + * Time between attempts to sample new Exemplars. This is a performance improvement for + * high-frequency applications, because with the sample interval we make sure that the exemplar + * sampler is not called for every single request. + * + *

    Default see {@code ExemplarSamplerConfig.DEFAULT_SAMPLE_INTERVAL_MILLISECONDS} + */ + @Nullable + public Integer getSampleIntervalMilliseconds() { + return sampleIntervalMilliseconds; + } + + /** + * Note that this will remove entries from {@code properties}. This is because we want to know if + * there are unused properties remaining after all properties have been loaded. + */ + static ExemplarsProperties load(Map properties) + throws PrometheusPropertiesException { + Integer minRetentionPeriodSeconds = + Util.loadInteger(PREFIX + "." + MIN_RETENTION_PERIOD_SECONDS, properties); + Integer maxRetentionPeriodSeconds = + Util.loadInteger(PREFIX + "." + MAX_RETENTION_PERIOD_SECONDS, properties); + Integer sampleIntervalMilliseconds = + Util.loadInteger(PREFIX + "." + SAMPLE_INTERVAL_MILLISECONDS, properties); + + Util.assertValue( + minRetentionPeriodSeconds, + t -> t > 0, + "Expecting value > 0.", + PREFIX, + MIN_RETENTION_PERIOD_SECONDS); + Util.assertValue( + maxRetentionPeriodSeconds, + t -> t > 0, + "Expecting value > 0.", + PREFIX, + MAX_RETENTION_PERIOD_SECONDS); + Util.assertValue( + sampleIntervalMilliseconds, + t -> t > 0, + "Expecting value > 0.", + PREFIX, + SAMPLE_INTERVAL_MILLISECONDS); + + if (minRetentionPeriodSeconds != null && maxRetentionPeriodSeconds != null) { + if (minRetentionPeriodSeconds > maxRetentionPeriodSeconds) { + throw new PrometheusPropertiesException( + PREFIX + + "." + + MIN_RETENTION_PERIOD_SECONDS + + " must not be greater than " + + PREFIX + + "." + + MAX_RETENTION_PERIOD_SECONDS + + "."); + } + } + + return new ExemplarsProperties( + minRetentionPeriodSeconds, maxRetentionPeriodSeconds, sampleIntervalMilliseconds); + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + @Nullable private Integer minRetentionPeriodSeconds; + @Nullable private Integer maxRetentionPeriodSeconds; + @Nullable private Integer sampleIntervalMilliseconds; + + private Builder() {} + + public Builder minRetentionPeriodSeconds(int minRetentionPeriodSeconds) { + this.minRetentionPeriodSeconds = minRetentionPeriodSeconds; + return this; + } + + public Builder maxRetentionPeriodSeconds(int maxRetentionPeriodSeconds) { + this.maxRetentionPeriodSeconds = maxRetentionPeriodSeconds; + return this; + } + + public Builder sampleIntervalMilliseconds(int sampleIntervalMilliseconds) { + this.sampleIntervalMilliseconds = sampleIntervalMilliseconds; + return this; + } + + public ExemplarsProperties build() { + return new ExemplarsProperties( + minRetentionPeriodSeconds, maxRetentionPeriodSeconds, sampleIntervalMilliseconds); + } + } +} diff --git a/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExporterFilterProperties.java b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExporterFilterProperties.java new file mode 100644 index 000000000..7f3b46842 --- /dev/null +++ b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExporterFilterProperties.java @@ -0,0 +1,123 @@ +package io.prometheus.metrics.config; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import javax.annotation.Nullable; + +/** Properties starting with io.prometheus.exporter.filter */ +public class ExporterFilterProperties { + + public static final String METRIC_NAME_MUST_BE_EQUAL_TO = "metricNameMustBeEqualTo"; + public static final String METRIC_NAME_MUST_NOT_BE_EQUAL_TO = "metricNameMustNotBeEqualTo"; + public static final String METRIC_NAME_MUST_START_WITH = "metricNameMustStartWith"; + public static final String METRIC_NAME_MUST_NOT_START_WITH = "metricNameMustNotStartWith"; + private static final String PREFIX = "io.prometheus.exporter.filter"; + + @Nullable private final List allowedNames; + @Nullable private final List excludedNames; + @Nullable private final List allowedPrefixes; + @Nullable private final List excludedPrefixes; + + private ExporterFilterProperties( + @Nullable List allowedNames, + @Nullable List excludedNames, + @Nullable List allowedPrefixes, + @Nullable List excludedPrefixes) { + this.allowedNames = + allowedNames == null ? null : Collections.unmodifiableList(new ArrayList<>(allowedNames)); + this.excludedNames = + excludedNames == null ? null : Collections.unmodifiableList(new ArrayList<>(excludedNames)); + this.allowedPrefixes = + allowedPrefixes == null + ? null + : Collections.unmodifiableList(new ArrayList<>(allowedPrefixes)); + this.excludedPrefixes = + excludedPrefixes == null + ? null + : Collections.unmodifiableList(new ArrayList<>(excludedPrefixes)); + } + + @Nullable + public List getAllowedMetricNames() { + return allowedNames; + } + + @Nullable + public List getExcludedMetricNames() { + return excludedNames; + } + + @Nullable + public List getAllowedMetricNamePrefixes() { + return allowedPrefixes; + } + + @Nullable + public List getExcludedMetricNamePrefixes() { + return excludedPrefixes; + } + + /** + * Note that this will remove entries from {@code properties}. This is because we want to know if + * there are unused properties remaining after all properties have been loaded. + */ + static ExporterFilterProperties load(Map properties) + throws PrometheusPropertiesException { + List allowedNames = + Util.loadStringList(PREFIX + "." + METRIC_NAME_MUST_BE_EQUAL_TO, properties); + List excludedNames = + Util.loadStringList(PREFIX + "." + METRIC_NAME_MUST_NOT_BE_EQUAL_TO, properties); + List allowedPrefixes = + Util.loadStringList(PREFIX + "." + METRIC_NAME_MUST_START_WITH, properties); + List excludedPrefixes = + Util.loadStringList(PREFIX + "." + METRIC_NAME_MUST_NOT_START_WITH, properties); + return new ExporterFilterProperties( + allowedNames, excludedNames, allowedPrefixes, excludedPrefixes); + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + @Nullable private List allowedNames; + @Nullable private List excludedNames; + @Nullable private List allowedPrefixes; + @Nullable private List excludedPrefixes; + + private Builder() {} + + /** Only allowed metric names will be exposed. */ + public Builder allowedNames(String... allowedNames) { + this.allowedNames = Arrays.asList(allowedNames); + return this; + } + + /** Excluded metric names will not be exposed. */ + public Builder excludedNames(String... excludedNames) { + this.excludedNames = Arrays.asList(excludedNames); + return this; + } + + /** Only metrics with a name starting with an allowed prefix will be exposed. */ + public Builder allowedPrefixes(String... allowedPrefixes) { + this.allowedPrefixes = Arrays.asList(allowedPrefixes); + return this; + } + + /** Metrics with a name starting with an excluded prefix will not be exposed. */ + public Builder excludedPrefixes(String... excludedPrefixes) { + this.excludedPrefixes = Arrays.asList(excludedPrefixes); + return this; + } + + public ExporterFilterProperties build() { + return new ExporterFilterProperties( + allowedNames, excludedNames, allowedPrefixes, excludedPrefixes); + } + } +} diff --git a/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExporterHttpServerProperties.java b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExporterHttpServerProperties.java new file mode 100644 index 000000000..01849f55a --- /dev/null +++ b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExporterHttpServerProperties.java @@ -0,0 +1,70 @@ +package io.prometheus.metrics.config; + +import java.util.Map; +import javax.annotation.Nullable; + +/** Properties starting with io.prometheus.exporter.httpServer */ +public class ExporterHttpServerProperties { + + private static final String PORT = "port"; + private static final String PREFER_UNCOMPRESSED_RESPONSE = "preferUncompressedResponse"; + private static final String PREFIX = "io.prometheus.exporter.httpServer"; + @Nullable private final Integer port; + private final boolean preferUncompressedResponse; + + private ExporterHttpServerProperties(@Nullable Integer port, boolean preferUncompressedResponse) { + this.port = port; + this.preferUncompressedResponse = preferUncompressedResponse; + } + + @Nullable + public Integer getPort() { + return port; + } + + public boolean isPreferUncompressedResponse() { + return preferUncompressedResponse; + } + + /** + * Note that this will remove entries from {@code properties}. This is because we want to know if + * there are unused properties remaining after all properties have been loaded. + */ + static ExporterHttpServerProperties load(Map properties) + throws PrometheusPropertiesException { + Integer port = Util.loadInteger(PREFIX + "." + PORT, properties); + Util.assertValue(port, t -> t > 0, "Expecting value > 0.", PREFIX, PORT); + + Boolean preferUncompressedResponse = + Util.loadBoolean(PREFIX + "." + PREFER_UNCOMPRESSED_RESPONSE, properties); + + return new ExporterHttpServerProperties( + port, preferUncompressedResponse != null && preferUncompressedResponse); + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + @Nullable private Integer port; + private boolean preferUncompressedResponse = false; + + private Builder() {} + + public Builder port(int port) { + this.port = port; + return this; + } + + public Builder preferUncompressedResponse(boolean preferUncompressedResponse) { + this.preferUncompressedResponse = preferUncompressedResponse; + return this; + } + + public ExporterHttpServerProperties build() { + return new ExporterHttpServerProperties(port, preferUncompressedResponse); + } + } +} diff --git a/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExporterOpenTelemetryProperties.java b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExporterOpenTelemetryProperties.java new file mode 100644 index 000000000..be09b5a63 --- /dev/null +++ b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExporterOpenTelemetryProperties.java @@ -0,0 +1,231 @@ +package io.prometheus.metrics.config; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Nullable; + +// TODO: JavaDoc is currently only in OpenTelemetryExporter.Builder. Look there for reference. +public class ExporterOpenTelemetryProperties { + + // See + // https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md + private static final String PROTOCOL = "protocol"; // otel.exporter.otlp.protocol + private static final String ENDPOINT = "endpoint"; // otel.exporter.otlp.endpoint + private static final String HEADERS = "headers"; // otel.exporter.otlp.headers + private static final String INTERVAL_SECONDS = "intervalSeconds"; // otel.metric.export.interval + private static final String TIMEOUT_SECONDS = "timeoutSeconds"; // otel.exporter.otlp.timeout + private static final String SERVICE_NAME = "serviceName"; // otel.service.name + private static final String SERVICE_NAMESPACE = "serviceNamespace"; + private static final String SERVICE_INSTANCE_ID = "serviceInstanceId"; + private static final String SERVICE_VERSION = "serviceVersion"; + private static final String RESOURCE_ATTRIBUTES = + "resourceAttributes"; // otel.resource.attributes + private static final String PREFIX = "io.prometheus.exporter.opentelemetry"; + + @Nullable private final String endpoint; + @Nullable private final String protocol; + private final Map headers; + @Nullable private final String interval; + @Nullable private final String timeout; + @Nullable private final String serviceName; + @Nullable private final String serviceNamespace; + @Nullable private final String serviceInstanceId; + @Nullable private final String serviceVersion; + private final Map resourceAttributes; + + private ExporterOpenTelemetryProperties( + @Nullable String protocol, + @Nullable String endpoint, + Map headers, + @Nullable String interval, + @Nullable String timeout, + @Nullable String serviceName, + @Nullable String serviceNamespace, + @Nullable String serviceInstanceId, + @Nullable String serviceVersion, + Map resourceAttributes) { + this.protocol = protocol; + this.endpoint = endpoint; + this.headers = headers; + this.interval = interval; + this.timeout = timeout; + this.serviceName = serviceName; + this.serviceNamespace = serviceNamespace; + this.serviceInstanceId = serviceInstanceId; + this.serviceVersion = serviceVersion; + this.resourceAttributes = resourceAttributes; + } + + @Nullable + public String getProtocol() { + return protocol; + } + + @Nullable + public String getEndpoint() { + return endpoint; + } + + public Map getHeaders() { + return headers; + } + + @Nullable + public String getInterval() { + return interval; + } + + @Nullable + public String getTimeout() { + return timeout; + } + + @Nullable + public String getServiceName() { + return serviceName; + } + + @Nullable + public String getServiceNamespace() { + return serviceNamespace; + } + + @Nullable + public String getServiceInstanceId() { + return serviceInstanceId; + } + + @Nullable + public String getServiceVersion() { + return serviceVersion; + } + + public Map getResourceAttributes() { + return resourceAttributes; + } + + /** + * Note that this will remove entries from {@code properties}. This is because we want to know if + * there are unused properties remaining after all properties have been loaded. + */ + static ExporterOpenTelemetryProperties load(Map properties) + throws PrometheusPropertiesException { + String protocol = Util.loadString(PREFIX + "." + PROTOCOL, properties); + String endpoint = Util.loadString(PREFIX + "." + ENDPOINT, properties); + Map headers = Util.loadMap(PREFIX + "." + HEADERS, properties); + String interval = Util.loadStringAddSuffix(PREFIX + "." + INTERVAL_SECONDS, properties, "s"); + String timeout = Util.loadStringAddSuffix(PREFIX + "." + TIMEOUT_SECONDS, properties, "s"); + String serviceName = Util.loadString(PREFIX + "." + SERVICE_NAME, properties); + String serviceNamespace = Util.loadString(PREFIX + "." + SERVICE_NAMESPACE, properties); + String serviceInstanceId = Util.loadString(PREFIX + "." + SERVICE_INSTANCE_ID, properties); + String serviceVersion = Util.loadString(PREFIX + "." + SERVICE_VERSION, properties); + Map resourceAttributes = + Util.loadMap(PREFIX + "." + RESOURCE_ATTRIBUTES, properties); + return new ExporterOpenTelemetryProperties( + protocol, + endpoint, + headers, + interval, + timeout, + serviceName, + serviceNamespace, + serviceInstanceId, + serviceVersion, + resourceAttributes); + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + @Nullable private String protocol; + @Nullable private String endpoint; + private final Map headers = new HashMap<>(); + @Nullable private String interval; + @Nullable private String timeout; + @Nullable private String serviceName; + @Nullable private String serviceNamespace; + @Nullable private String serviceInstanceId; + @Nullable private String serviceVersion; + private final Map resourceAttributes = new HashMap<>(); + + private Builder() {} + + public Builder protocol(String protocol) { + if (!protocol.equals("grpc") && !protocol.equals("http/protobuf")) { + throw new IllegalArgumentException( + protocol + ": Unsupported protocol. Expecting grpc or http/protobuf"); + } + this.protocol = protocol; + return this; + } + + public Builder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** Add a request header. Call multiple times to add multiple headers. */ + public Builder header(String name, String value) { + this.headers.put(name, value); + return this; + } + + public Builder intervalSeconds(int intervalSeconds) { + if (intervalSeconds <= 0) { + throw new IllegalArgumentException(intervalSeconds + ": Expecting intervalSeconds > 0"); + } + this.interval = intervalSeconds + "s"; + return this; + } + + public Builder timeoutSeconds(int timeoutSeconds) { + if (timeoutSeconds <= 0) { + throw new IllegalArgumentException(timeoutSeconds + ": Expecting timeoutSeconds > 0"); + } + this.timeout = timeoutSeconds + "s"; + return this; + } + + public Builder serviceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + public Builder serviceNamespace(String serviceNamespace) { + this.serviceNamespace = serviceNamespace; + return this; + } + + public Builder serviceInstanceId(String serviceInstanceId) { + this.serviceInstanceId = serviceInstanceId; + return this; + } + + public Builder serviceVersion(String serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + public Builder resourceAttribute(String name, String value) { + this.resourceAttributes.put(name, value); + return this; + } + + public ExporterOpenTelemetryProperties build() { + return new ExporterOpenTelemetryProperties( + protocol, + endpoint, + headers, + interval, + timeout, + serviceName, + serviceNamespace, + serviceInstanceId, + serviceVersion, + resourceAttributes); + } + } +} diff --git a/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExporterProperties.java b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExporterProperties.java new file mode 100644 index 000000000..6b081816d --- /dev/null +++ b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExporterProperties.java @@ -0,0 +1,97 @@ +package io.prometheus.metrics.config; + +import java.util.Map; +import javax.annotation.Nullable; + +/** Properties starting with io.prometheus.exporter */ +public class ExporterProperties { + + private static final String INCLUDE_CREATED_TIMESTAMPS = "includeCreatedTimestamps"; + // milliseconds is the default - we only provide a boolean flag to avoid a breaking change + private static final String PROMETHEUS_TIMESTAMPS_IN_MS = "prometheusTimestampsInMs"; + private static final String EXEMPLARS_ON_ALL_METRIC_TYPES = "exemplarsOnAllMetricTypes"; + private static final String PREFIX = "io.prometheus.exporter"; + + @Nullable private final Boolean includeCreatedTimestamps; + @Nullable private final Boolean prometheusTimestampsInMs; + @Nullable private final Boolean exemplarsOnAllMetricTypes; + + private ExporterProperties( + @Nullable Boolean includeCreatedTimestamps, + @Nullable Boolean prometheusTimestampsInMs, + @Nullable Boolean exemplarsOnAllMetricTypes) { + this.includeCreatedTimestamps = includeCreatedTimestamps; + this.prometheusTimestampsInMs = prometheusTimestampsInMs; + this.exemplarsOnAllMetricTypes = exemplarsOnAllMetricTypes; + } + + /** Include the {@code _created} timestamps in text format? Default is {@code false}. */ + public boolean getIncludeCreatedTimestamps() { + return includeCreatedTimestamps != null && includeCreatedTimestamps; + } + + /** Use milliseconds for timestamps in prometheus text format? Default is {@code false}. */ + public boolean getPrometheusTimestampsInMs() { + return prometheusTimestampsInMs != null && prometheusTimestampsInMs; + } + + /** + * Allow Exemplars on all metric types in OpenMetrics format? Default is {@code false}, which + * means Exemplars will only be added for Counters and Histogram buckets. + */ + public boolean getExemplarsOnAllMetricTypes() { + return exemplarsOnAllMetricTypes != null && exemplarsOnAllMetricTypes; + } + + /** + * Note that this will remove entries from {@code properties}. This is because we want to know if + * there are unused properties remaining after all properties have been loaded. + */ + static ExporterProperties load(Map properties) + throws PrometheusPropertiesException { + Boolean includeCreatedTimestamps = + Util.loadBoolean(PREFIX + "." + INCLUDE_CREATED_TIMESTAMPS, properties); + Boolean timestampsInMs = + Util.loadBoolean(PREFIX + "." + PROMETHEUS_TIMESTAMPS_IN_MS, properties); + Boolean exemplarsOnAllMetricTypes = + Util.loadBoolean(PREFIX + "." + EXEMPLARS_ON_ALL_METRIC_TYPES, properties); + return new ExporterProperties( + includeCreatedTimestamps, timestampsInMs, exemplarsOnAllMetricTypes); + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + @Nullable private Boolean includeCreatedTimestamps; + @Nullable private Boolean exemplarsOnAllMetricTypes; + boolean prometheusTimestampsInMs; + + private Builder() {} + + /** See {@link #getIncludeCreatedTimestamps()} */ + public Builder includeCreatedTimestamps(boolean includeCreatedTimestamps) { + this.includeCreatedTimestamps = includeCreatedTimestamps; + return this; + } + + /** See {@link #getExemplarsOnAllMetricTypes()}. */ + public Builder exemplarsOnAllMetricTypes(boolean exemplarsOnAllMetricTypes) { + this.exemplarsOnAllMetricTypes = exemplarsOnAllMetricTypes; + return this; + } + + /** See {@link #getPrometheusTimestampsInMs()}. */ + public Builder prometheusTimestampsInMs(boolean prometheusTimestampsInMs) { + this.prometheusTimestampsInMs = prometheusTimestampsInMs; + return this; + } + + public ExporterProperties build() { + return new ExporterProperties( + includeCreatedTimestamps, prometheusTimestampsInMs, exemplarsOnAllMetricTypes); + } + } +} diff --git a/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExporterPushgatewayProperties.java b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExporterPushgatewayProperties.java new file mode 100644 index 000000000..bd53f8b76 --- /dev/null +++ b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/ExporterPushgatewayProperties.java @@ -0,0 +1,177 @@ +package io.prometheus.metrics.config; + +import java.time.Duration; +import java.util.Map; +import javax.annotation.Nullable; + +public class ExporterPushgatewayProperties { + + private static final String ADDRESS = "address"; + private static final String JOB = "job"; + private static final String SCHEME = "scheme"; + private static final String ESCAPING_SCHEME = "escapingScheme"; + private static final String READ_TIMEOUT = "readTimeoutSeconds"; + private static final String CONNECT_TIMEOUT = "connectTimeoutSeconds"; + private static final String PREFIX = "io.prometheus.exporter.pushgateway"; + @Nullable private final String scheme; + @Nullable private final String address; + @Nullable private final String job; + @Nullable private final EscapingScheme escapingScheme; + @Nullable private final Duration connectTimeout; + @Nullable private final Duration readTimeout; + + private ExporterPushgatewayProperties( + @Nullable String address, + @Nullable String job, + @Nullable String scheme, + @Nullable EscapingScheme escapingScheme, + @Nullable Duration connectTimeout, + @Nullable Duration readTimeout) { + this.address = address; + this.job = job; + this.scheme = scheme; + this.escapingScheme = escapingScheme; + this.connectTimeout = connectTimeout; + this.readTimeout = readTimeout; + } + + /** Address of the Pushgateway in the form {@code host:port}. Default is {@code localhost:9091} */ + @Nullable + public String getAddress() { + return address; + } + + /** + * {@code job} label for metrics being pushed. Default is the name of the JAR file that is + * running. + */ + @Nullable + public String getJob() { + return job; + } + + /** + * Scheme to be used when pushing metrics to the pushgateway. Must be "http" or "https". Default + * is "http". + */ + @Nullable + public String getScheme() { + return scheme; + } + + /** Escaping scheme to be used when pushing metric data to the pushgateway. */ + @Nullable + public EscapingScheme getEscapingScheme() { + return escapingScheme; + } + + /** Connection timeout for connections to the Pushgateway. */ + @Nullable + public Duration getConnectTimeout() { + return connectTimeout; + } + + /** Read timeout for connections to the Pushgateway. */ + @Nullable + public Duration getReadTimeout() { + return readTimeout; + } + + /** + * Note that this will remove entries from {@code properties}. This is because we want to know if + * there are unused properties remaining after all properties have been loaded. + */ + static ExporterPushgatewayProperties load(Map properties) + throws PrometheusPropertiesException { + String address = Util.loadString(PREFIX + "." + ADDRESS, properties); + String job = Util.loadString(PREFIX + "." + JOB, properties); + String scheme = Util.loadString(PREFIX + "." + SCHEME, properties); + String escapingScheme = Util.loadString(PREFIX + "." + ESCAPING_SCHEME, properties); + Duration connectTimeout = Util.loadOptionalDuration(PREFIX + "." + CONNECT_TIMEOUT, properties); + Duration readTimeout = Util.loadOptionalDuration(PREFIX + "." + READ_TIMEOUT, properties); + + if (scheme != null) { + if (!scheme.equals("http") && !scheme.equals("https")) { + throw new PrometheusPropertiesException( + String.format( + "%s.%s: Illegal value. Expecting 'http' or 'https'. Found: %s", + PREFIX, SCHEME, scheme)); + } + } + + return new ExporterPushgatewayProperties( + address, job, scheme, parseEscapingScheme(escapingScheme), connectTimeout, readTimeout); + } + + private static @Nullable EscapingScheme parseEscapingScheme(@Nullable String scheme) { + if (scheme == null) { + return null; + } + switch (scheme) { + case "allow-utf-8": + return EscapingScheme.ALLOW_UTF8; + case "values": + return EscapingScheme.VALUE_ENCODING_ESCAPING; + case "underscores": + return EscapingScheme.UNDERSCORE_ESCAPING; + case "dots": + return EscapingScheme.DOTS_ESCAPING; + default: + throw new PrometheusPropertiesException( + String.format( + "%s.%s: Illegal value. Expecting 'allow-utf-8', 'values', 'underscores', " + + "or 'dots'. Found: %s", + PREFIX, ESCAPING_SCHEME, scheme)); + } + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + @Nullable private String address; + @Nullable private String job; + @Nullable private String scheme; + @Nullable private EscapingScheme escapingScheme; + @Nullable private Duration connectTimeout; + @Nullable private Duration readTimeout; + + private Builder() {} + + public Builder address(String address) { + this.address = address; + return this; + } + + public Builder job(String job) { + this.job = job; + return this; + } + + public Builder scheme(String scheme) { + this.scheme = scheme; + return this; + } + + public Builder escapingScheme(EscapingScheme escapingScheme) { + this.escapingScheme = escapingScheme; + return this; + } + + public Builder connectTimeout(Duration connectTimeout) { + this.connectTimeout = connectTimeout; + return this; + } + + public Builder readTimeout(Duration readTimeout) { + this.readTimeout = readTimeout; + return this; + } + + public ExporterPushgatewayProperties build() { + return new ExporterPushgatewayProperties( + address, job, scheme, escapingScheme, connectTimeout, readTimeout); + } + } +} diff --git a/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/MetricsProperties.java b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/MetricsProperties.java new file mode 100644 index 000000000..6c8942713 --- /dev/null +++ b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/MetricsProperties.java @@ -0,0 +1,480 @@ +package io.prometheus.metrics.config; + +import static java.util.Collections.unmodifiableList; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import javax.annotation.Nullable; + +/** Properties starting with io.prometheus.metrics */ +public class MetricsProperties { + + private static final String EXEMPLARS_ENABLED = "exemplarsEnabled"; + private static final String HISTOGRAM_NATIVE_ONLY = "histogramNativeOnly"; + private static final String HISTOGRAM_CLASSIC_ONLY = "histogramClassicOnly"; + private static final String HISTOGRAM_CLASSIC_UPPER_BOUNDS = "histogramClassicUpperBounds"; + private static final String HISTOGRAM_NATIVE_INITIAL_SCHEMA = "histogramNativeInitialSchema"; + private static final String HISTOGRAM_NATIVE_MIN_ZERO_THRESHOLD = + "histogramNativeMinZeroThreshold"; + private static final String HISTOGRAM_NATIVE_MAX_ZERO_THRESHOLD = + "histogramNativeMaxZeroThreshold"; + private static final String HISTOGRAM_NATIVE_MAX_NUMBER_OF_BUCKETS = + "histogramNativeMaxNumberOfBuckets"; // 0 means unlimited number of buckets + private static final String HISTOGRAM_NATIVE_RESET_DURATION_SECONDS = + "histogramNativeResetDurationSeconds"; // 0 means no reset + private static final String SUMMARY_QUANTILES = "summaryQuantiles"; + private static final String SUMMARY_QUANTILE_ERRORS = "summaryQuantileErrors"; + private static final String SUMMARY_MAX_AGE_SECONDS = "summaryMaxAgeSeconds"; + private static final String SUMMARY_NUMBER_OF_AGE_BUCKETS = "summaryNumberOfAgeBuckets"; + + @Nullable private final Boolean exemplarsEnabled; + @Nullable private final Boolean histogramNativeOnly; + @Nullable private final Boolean histogramClassicOnly; + @Nullable private final List histogramClassicUpperBounds; + @Nullable private final Integer histogramNativeInitialSchema; + @Nullable private final Double histogramNativeMinZeroThreshold; + @Nullable private final Double histogramNativeMaxZeroThreshold; + @Nullable private final Integer histogramNativeMaxNumberOfBuckets; + @Nullable private final Long histogramNativeResetDurationSeconds; + @Nullable private final List summaryQuantiles; + @Nullable private final List summaryQuantileErrors; + @Nullable private final Long summaryMaxAgeSeconds; + @Nullable private final Integer summaryNumberOfAgeBuckets; + + public MetricsProperties( + @Nullable Boolean exemplarsEnabled, + @Nullable Boolean histogramNativeOnly, + @Nullable Boolean histogramClassicOnly, + @Nullable List histogramClassicUpperBounds, + @Nullable Integer histogramNativeInitialSchema, + @Nullable Double histogramNativeMinZeroThreshold, + @Nullable Double histogramNativeMaxZeroThreshold, + @Nullable Integer histogramNativeMaxNumberOfBuckets, + @Nullable Long histogramNativeResetDurationSeconds, + @Nullable List summaryQuantiles, + @Nullable List summaryQuantileErrors, + @Nullable Long summaryMaxAgeSeconds, + @Nullable Integer summaryNumberOfAgeBuckets) { + this( + exemplarsEnabled, + histogramNativeOnly, + histogramClassicOnly, + histogramClassicUpperBounds, + histogramNativeInitialSchema, + histogramNativeMinZeroThreshold, + histogramNativeMaxZeroThreshold, + histogramNativeMaxNumberOfBuckets, + histogramNativeResetDurationSeconds, + summaryQuantiles, + summaryQuantileErrors, + summaryMaxAgeSeconds, + summaryNumberOfAgeBuckets, + ""); + } + + private MetricsProperties( + @Nullable Boolean exemplarsEnabled, + @Nullable Boolean histogramNativeOnly, + @Nullable Boolean histogramClassicOnly, + @Nullable List histogramClassicUpperBounds, + @Nullable Integer histogramNativeInitialSchema, + @Nullable Double histogramNativeMinZeroThreshold, + @Nullable Double histogramNativeMaxZeroThreshold, + @Nullable Integer histogramNativeMaxNumberOfBuckets, + @Nullable Long histogramNativeResetDurationSeconds, + @Nullable List summaryQuantiles, + @Nullable List summaryQuantileErrors, + @Nullable Long summaryMaxAgeSeconds, + @Nullable Integer summaryNumberOfAgeBuckets, + String configPropertyPrefix) { + this.exemplarsEnabled = exemplarsEnabled; + this.histogramNativeOnly = isHistogramNativeOnly(histogramClassicOnly, histogramNativeOnly); + this.histogramClassicOnly = isHistogramClassicOnly(histogramClassicOnly, histogramNativeOnly); + this.histogramClassicUpperBounds = + histogramClassicUpperBounds == null + ? null + : unmodifiableList(new ArrayList<>(histogramClassicUpperBounds)); + this.histogramNativeInitialSchema = histogramNativeInitialSchema; + this.histogramNativeMinZeroThreshold = histogramNativeMinZeroThreshold; + this.histogramNativeMaxZeroThreshold = histogramNativeMaxZeroThreshold; + this.histogramNativeMaxNumberOfBuckets = histogramNativeMaxNumberOfBuckets; + this.histogramNativeResetDurationSeconds = histogramNativeResetDurationSeconds; + this.summaryQuantiles = + summaryQuantiles == null ? null : unmodifiableList(new ArrayList<>(summaryQuantiles)); + this.summaryQuantileErrors = + summaryQuantileErrors == null + ? null + : unmodifiableList(new ArrayList<>(summaryQuantileErrors)); + this.summaryMaxAgeSeconds = summaryMaxAgeSeconds; + this.summaryNumberOfAgeBuckets = summaryNumberOfAgeBuckets; + validate(configPropertyPrefix); + } + + @Nullable + private Boolean isHistogramClassicOnly( + @Nullable Boolean histogramClassicOnly, @Nullable Boolean histogramNativeOnly) { + if (histogramClassicOnly != null) { + return histogramClassicOnly; + } + if (histogramNativeOnly != null) { + return !histogramNativeOnly; + } + return null; + } + + @Nullable + private Boolean isHistogramNativeOnly( + @Nullable Boolean histogramClassicOnly, @Nullable Boolean histogramNativeOnly) { + if (histogramNativeOnly != null) { + return histogramNativeOnly; + } + if (histogramClassicOnly != null) { + return !histogramClassicOnly; + } + return null; + } + + private void validate(String prefix) throws PrometheusPropertiesException { + Util.assertValue( + histogramNativeInitialSchema, + s -> s >= -4 && s <= 8, + "Expecting number between -4 and +8.", + prefix, + HISTOGRAM_NATIVE_INITIAL_SCHEMA); + Util.assertValue( + histogramNativeMinZeroThreshold, + t -> t >= 0, + "Expecting value >= 0.", + prefix, + HISTOGRAM_NATIVE_MIN_ZERO_THRESHOLD); + Util.assertValue( + histogramNativeMaxZeroThreshold, + t -> t >= 0, + "Expecting value >= 0.", + prefix, + HISTOGRAM_NATIVE_MAX_ZERO_THRESHOLD); + Util.assertValue( + histogramNativeMaxNumberOfBuckets, + n -> n >= 0, + "Expecting value >= 0.", + prefix, + HISTOGRAM_NATIVE_MAX_NUMBER_OF_BUCKETS); + Util.assertValue( + histogramNativeResetDurationSeconds, + t -> t >= 0, + "Expecting value >= 0.", + prefix, + HISTOGRAM_NATIVE_RESET_DURATION_SECONDS); + Util.assertValue( + summaryMaxAgeSeconds, t -> t > 0, "Expecting value > 0.", prefix, SUMMARY_MAX_AGE_SECONDS); + Util.assertValue( + summaryNumberOfAgeBuckets, + t -> t > 0, + "Expecting value > 0.", + prefix, + SUMMARY_NUMBER_OF_AGE_BUCKETS); + + if (Boolean.TRUE.equals(histogramNativeOnly) && Boolean.TRUE.equals(histogramClassicOnly)) { + throw new PrometheusPropertiesException( + prefix + + "." + + HISTOGRAM_NATIVE_ONLY + + " and " + + prefix + + "." + + HISTOGRAM_CLASSIC_ONLY + + " cannot both be true"); + } + + if (histogramNativeMinZeroThreshold != null && histogramNativeMaxZeroThreshold != null) { + if (histogramNativeMinZeroThreshold > histogramNativeMaxZeroThreshold) { + throw new PrometheusPropertiesException( + prefix + + "." + + HISTOGRAM_NATIVE_MIN_ZERO_THRESHOLD + + " cannot be greater than " + + prefix + + "." + + HISTOGRAM_NATIVE_MAX_ZERO_THRESHOLD); + } + } + + if (summaryQuantiles != null) { + for (double quantile : summaryQuantiles) { + if (quantile < 0 || quantile > 1) { + throw new PrometheusPropertiesException( + prefix + + "." + + SUMMARY_QUANTILES + + ": Expecting 0.0 <= quantile <= 1.0. Found: " + + quantile); + } + } + } + + if (summaryQuantileErrors != null) { + if (summaryQuantiles == null) { + throw new PrometheusPropertiesException( + prefix + + "." + + SUMMARY_QUANTILE_ERRORS + + ": Can't configure " + + SUMMARY_QUANTILE_ERRORS + + " without configuring " + + SUMMARY_QUANTILES); + } + if (summaryQuantileErrors.size() != summaryQuantiles.size()) { + throw new PrometheusPropertiesException( + prefix + + "." + + SUMMARY_QUANTILE_ERRORS + + ": must have the same length as " + + SUMMARY_QUANTILES); + } + for (double error : summaryQuantileErrors) { + if (error < 0 || error > 1) { + throw new PrometheusPropertiesException( + prefix + "." + SUMMARY_QUANTILE_ERRORS + ": Expecting 0.0 <= error <= 1.0"); + } + } + } + } + + /** + * This is the only configuration property that can be applied to all metric types. You can use it + * to turn Exemplar support off. Default is {@code true}. + */ + @Nullable + public Boolean getExemplarsEnabled() { + return exemplarsEnabled; + } + + /** See {@code Histogram.Builder.nativeOnly()} */ + @Nullable + public Boolean getHistogramNativeOnly() { + return histogramNativeOnly; + } + + /** See {@code Histogram.Builder.classicOnly()} */ + @Nullable + public Boolean getHistogramClassicOnly() { + return histogramClassicOnly; + } + + /** See {@code Histogram.Builder.classicUpperBounds()} */ + @Nullable + public List getHistogramClassicUpperBounds() { + return histogramClassicUpperBounds; + } + + /** See {@code Histogram.Builder.nativeInitialSchema()} */ + @Nullable + public Integer getHistogramNativeInitialSchema() { + return histogramNativeInitialSchema; + } + + /** See {@code Histogram.Builder.nativeMinZeroThreshold()} */ + @Nullable + public Double getHistogramNativeMinZeroThreshold() { + return histogramNativeMinZeroThreshold; + } + + /** See {@code Histogram.Builder.nativeMaxZeroThreshold()} */ + @Nullable + public Double getHistogramNativeMaxZeroThreshold() { + return histogramNativeMaxZeroThreshold; + } + + /** See {@code Histogram.Builder.nativeMaxNumberOfBuckets()} */ + @Nullable + public Integer getHistogramNativeMaxNumberOfBuckets() { + return histogramNativeMaxNumberOfBuckets; + } + + /** See {@code Histogram.Builder.nativeResetDuration()} */ + @Nullable + public Long getHistogramNativeResetDurationSeconds() { + return histogramNativeResetDurationSeconds; + } + + /** See {@code Summary.Builder.quantile()} */ + @Nullable + public List getSummaryQuantiles() { + return summaryQuantiles; + } + + /** + * See {@code Summary.Builder.quantile()} + * + *

    Returns {@code null} only if {@link #getSummaryQuantiles()} is also {@code null}. Returns an + * empty list if {@link #getSummaryQuantiles()} are specified without specifying errors. If the + * list is not empty, it has the same size as {@link #getSummaryQuantiles()}. + */ + @Nullable + public List getSummaryQuantileErrors() { + if (summaryQuantiles != null) { + if (summaryQuantileErrors == null) { + return Collections.emptyList(); + } + } + return summaryQuantileErrors; + } + + /** See {@code Summary.Builder.maxAgeSeconds()} */ + @Nullable + public Long getSummaryMaxAgeSeconds() { + return summaryMaxAgeSeconds; + } + + /** See {@code Summary.Builder.numberOfAgeBuckets()} */ + @Nullable + public Integer getSummaryNumberOfAgeBuckets() { + return summaryNumberOfAgeBuckets; + } + + /** + * Note that this will remove entries from {@code properties}. This is because we want to know if + * there are unused properties remaining after all properties have been loaded. + */ + static MetricsProperties load(String prefix, Map properties) + throws PrometheusPropertiesException { + return new MetricsProperties( + Util.loadBoolean(prefix + "." + EXEMPLARS_ENABLED, properties), + Util.loadBoolean(prefix + "." + HISTOGRAM_NATIVE_ONLY, properties), + Util.loadBoolean(prefix + "." + HISTOGRAM_CLASSIC_ONLY, properties), + Util.loadDoubleList(prefix + "." + HISTOGRAM_CLASSIC_UPPER_BOUNDS, properties), + Util.loadInteger(prefix + "." + HISTOGRAM_NATIVE_INITIAL_SCHEMA, properties), + Util.loadDouble(prefix + "." + HISTOGRAM_NATIVE_MIN_ZERO_THRESHOLD, properties), + Util.loadDouble(prefix + "." + HISTOGRAM_NATIVE_MAX_ZERO_THRESHOLD, properties), + Util.loadInteger(prefix + "." + HISTOGRAM_NATIVE_MAX_NUMBER_OF_BUCKETS, properties), + Util.loadLong(prefix + "." + HISTOGRAM_NATIVE_RESET_DURATION_SECONDS, properties), + Util.loadDoubleList(prefix + "." + SUMMARY_QUANTILES, properties), + Util.loadDoubleList(prefix + "." + SUMMARY_QUANTILE_ERRORS, properties), + Util.loadLong(prefix + "." + SUMMARY_MAX_AGE_SECONDS, properties), + Util.loadInteger(prefix + "." + SUMMARY_NUMBER_OF_AGE_BUCKETS, properties), + prefix); + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + @Nullable private Boolean exemplarsEnabled; + @Nullable private Boolean histogramNativeOnly; + @Nullable private Boolean histogramClassicOnly; + @Nullable private List histogramClassicUpperBounds; + @Nullable private Integer histogramNativeInitialSchema; + @Nullable private Double histogramNativeMinZeroThreshold; + @Nullable private Double histogramNativeMaxZeroThreshold; + @Nullable private Integer histogramNativeMaxNumberOfBuckets; + @Nullable private Long histogramNativeResetDurationSeconds; + @Nullable private List summaryQuantiles; + @Nullable private List summaryQuantileErrors; + @Nullable private Long summaryMaxAgeSeconds; + @Nullable private Integer summaryNumberOfAgeBuckets; + + private Builder() {} + + public MetricsProperties build() { + return new MetricsProperties( + exemplarsEnabled, + histogramNativeOnly, + histogramClassicOnly, + histogramClassicUpperBounds, + histogramNativeInitialSchema, + histogramNativeMinZeroThreshold, + histogramNativeMaxZeroThreshold, + histogramNativeMaxNumberOfBuckets, + histogramNativeResetDurationSeconds, + summaryQuantiles, + summaryQuantileErrors, + summaryMaxAgeSeconds, + summaryNumberOfAgeBuckets); + } + + /** See {@link MetricsProperties#getExemplarsEnabled()} */ + public Builder exemplarsEnabled(@Nullable Boolean exemplarsEnabled) { + this.exemplarsEnabled = exemplarsEnabled; + return this; + } + + /** See {@link MetricsProperties#getHistogramNativeOnly()} */ + public Builder histogramNativeOnly(@Nullable Boolean histogramNativeOnly) { + this.histogramNativeOnly = histogramNativeOnly; + return this; + } + + /** See {@link MetricsProperties#getHistogramClassicOnly()} */ + public Builder histogramClassicOnly(@Nullable Boolean histogramClassicOnly) { + this.histogramClassicOnly = histogramClassicOnly; + return this; + } + + /** See {@link MetricsProperties#getHistogramClassicUpperBounds()} */ + public Builder histogramClassicUpperBounds(double... histogramClassicUpperBounds) { + this.histogramClassicUpperBounds = Util.toList(histogramClassicUpperBounds); + return this; + } + + /** See {@link MetricsProperties#getHistogramNativeInitialSchema()} */ + public Builder histogramNativeInitialSchema(@Nullable Integer histogramNativeInitialSchema) { + this.histogramNativeInitialSchema = histogramNativeInitialSchema; + return this; + } + + /** See {@link MetricsProperties#getHistogramNativeMinZeroThreshold()} */ + public Builder histogramNativeMinZeroThreshold( + @Nullable Double histogramNativeMinZeroThreshold) { + this.histogramNativeMinZeroThreshold = histogramNativeMinZeroThreshold; + return this; + } + + /** See {@link MetricsProperties#getHistogramNativeMaxZeroThreshold()} */ + public Builder histogramNativeMaxZeroThreshold( + @Nullable Double histogramNativeMaxZeroThreshold) { + this.histogramNativeMaxZeroThreshold = histogramNativeMaxZeroThreshold; + return this; + } + + /** See {@link MetricsProperties#getHistogramNativeMaxNumberOfBuckets()} */ + public Builder histogramNativeMaxNumberOfBuckets( + @Nullable Integer histogramNativeMaxNumberOfBuckets) { + this.histogramNativeMaxNumberOfBuckets = histogramNativeMaxNumberOfBuckets; + return this; + } + + /** See {@link MetricsProperties#getHistogramNativeResetDurationSeconds()} */ + public Builder histogramNativeResetDurationSeconds( + @Nullable Long histogramNativeResetDurationSeconds) { + this.histogramNativeResetDurationSeconds = histogramNativeResetDurationSeconds; + return this; + } + + /** See {@link MetricsProperties#getSummaryQuantiles()} */ + public Builder summaryQuantiles(double... summaryQuantiles) { + this.summaryQuantiles = Util.toList(summaryQuantiles); + return this; + } + + /** See {@link MetricsProperties#getSummaryQuantileErrors()} */ + public Builder summaryQuantileErrors(double... summaryQuantileErrors) { + this.summaryQuantileErrors = Util.toList(summaryQuantileErrors); + return this; + } + + /** See {@link MetricsProperties#getSummaryMaxAgeSeconds()} */ + public Builder summaryMaxAgeSeconds(@Nullable Long summaryMaxAgeSeconds) { + this.summaryMaxAgeSeconds = summaryMaxAgeSeconds; + return this; + } + + /** See {@link MetricsProperties#getSummaryNumberOfAgeBuckets()} */ + public Builder summaryNumberOfAgeBuckets(@Nullable Integer summaryNumberOfAgeBuckets) { + this.summaryNumberOfAgeBuckets = summaryNumberOfAgeBuckets; + return this; + } + } +} diff --git a/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/PrometheusProperties.java b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/PrometheusProperties.java new file mode 100644 index 000000000..ab78b48e3 --- /dev/null +++ b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/PrometheusProperties.java @@ -0,0 +1,181 @@ +package io.prometheus.metrics.config; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Nullable; + +/** + * The Prometheus Java client library can be configured at runtime (e.g. using a properties file). + * + *

    This class represents the runtime configuration. + */ +public class PrometheusProperties { + + private static final PrometheusProperties instance = PrometheusPropertiesLoader.load(); + + private final MetricsProperties defaultMetricsProperties; + private final Map metricProperties = new HashMap<>(); + private final ExemplarsProperties exemplarProperties; + private final ExporterProperties exporterProperties; + private final ExporterFilterProperties exporterFilterProperties; + private final ExporterHttpServerProperties exporterHttpServerProperties; + private final ExporterOpenTelemetryProperties exporterOpenTelemetryProperties; + private final ExporterPushgatewayProperties exporterPushgatewayProperties; + + /** + * Get the properties instance. When called for the first time, {@code get()} loads the properties + * from the following locations: + * + *

      + *
    • {@code prometheus.properties} file found in the classpath. + *
    • Properties file specified in the {@code PROMETHEUS_CONFIG} environment variable or the + * {@code prometheus.config} system property. + *
    • Individual properties from system properties. + *
    + */ + public static PrometheusProperties get() throws PrometheusPropertiesException { + return instance; + } + + public static Builder builder() { + return new Builder(); + } + + public PrometheusProperties( + MetricsProperties defaultMetricsProperties, + Map metricProperties, + ExemplarsProperties exemplarProperties, + ExporterProperties exporterProperties, + ExporterFilterProperties exporterFilterProperties, + ExporterHttpServerProperties httpServerConfig, + ExporterPushgatewayProperties pushgatewayProperties, + ExporterOpenTelemetryProperties otelConfig) { + this.defaultMetricsProperties = defaultMetricsProperties; + this.metricProperties.putAll(metricProperties); + this.exemplarProperties = exemplarProperties; + this.exporterProperties = exporterProperties; + this.exporterFilterProperties = exporterFilterProperties; + this.exporterHttpServerProperties = httpServerConfig; + this.exporterPushgatewayProperties = pushgatewayProperties; + this.exporterOpenTelemetryProperties = otelConfig; + } + + /** + * The default metric properties apply for metrics where {@link #getMetricProperties(String)} is + * {@code null}. + */ + public MetricsProperties getDefaultMetricProperties() { + return defaultMetricsProperties; + } + + /** + * Properties specific for one metric. Should be merged with {@link + * #getDefaultMetricProperties()}. May return {@code null} if no metric-specific properties are + * configured for a metric name. + */ + @Nullable + public MetricsProperties getMetricProperties(String metricName) { + return metricProperties.get(metricName.replace(".", "_")); + } + + public ExemplarsProperties getExemplarProperties() { + return exemplarProperties; + } + + public ExporterProperties getExporterProperties() { + return exporterProperties; + } + + public ExporterFilterProperties getExporterFilterProperties() { + return exporterFilterProperties; + } + + public ExporterHttpServerProperties getExporterHttpServerProperties() { + return exporterHttpServerProperties; + } + + public ExporterPushgatewayProperties getExporterPushgatewayProperties() { + return exporterPushgatewayProperties; + } + + public ExporterOpenTelemetryProperties getExporterOpenTelemetryProperties() { + return exporterOpenTelemetryProperties; + } + + public static class Builder { + private MetricsProperties defaultMetricsProperties = MetricsProperties.builder().build(); + private Map metricProperties = new HashMap<>(); + private ExemplarsProperties exemplarProperties = ExemplarsProperties.builder().build(); + private ExporterProperties exporterProperties = ExporterProperties.builder().build(); + private ExporterFilterProperties exporterFilterProperties = + ExporterFilterProperties.builder().build(); + private ExporterHttpServerProperties exporterHttpServerProperties = + ExporterHttpServerProperties.builder().build(); + private ExporterPushgatewayProperties pushgatewayProperties = + ExporterPushgatewayProperties.builder().build(); + private ExporterOpenTelemetryProperties otelConfig = + ExporterOpenTelemetryProperties.builder().build(); + + private Builder() {} + + public Builder defaultMetricsProperties(MetricsProperties defaultMetricsProperties) { + this.defaultMetricsProperties = defaultMetricsProperties; + return this; + } + + public Builder metricProperties(Map metricProperties) { + this.metricProperties = metricProperties; + return this; + } + + /** Convenience for adding a single named MetricsProperties */ + public Builder putMetricProperty(String name, MetricsProperties props) { + this.metricProperties.put(name, props); + return this; + } + + public Builder exemplarProperties(ExemplarsProperties exemplarProperties) { + this.exemplarProperties = exemplarProperties; + return this; + } + + public Builder exporterProperties(ExporterProperties exporterProperties) { + this.exporterProperties = exporterProperties; + return this; + } + + public Builder exporterFilterProperties(ExporterFilterProperties exporterFilterProperties) { + this.exporterFilterProperties = exporterFilterProperties; + return this; + } + + public Builder exporterHttpServerProperties( + ExporterHttpServerProperties exporterHttpServerProperties) { + this.exporterHttpServerProperties = exporterHttpServerProperties; + return this; + } + + public Builder pushgatewayProperties(ExporterPushgatewayProperties pushgatewayProperties) { + this.pushgatewayProperties = pushgatewayProperties; + return this; + } + + public Builder exporterOpenTelemetryProperties( + ExporterOpenTelemetryProperties exporterOpenTelemetryProperties) { + this.otelConfig = exporterOpenTelemetryProperties; + return this; + } + + public PrometheusProperties build() { + return new PrometheusProperties( + defaultMetricsProperties, + metricProperties, + exemplarProperties, + exporterProperties, + exporterFilterProperties, + exporterHttpServerProperties, + pushgatewayProperties, + otelConfig); + } + } +} diff --git a/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/PrometheusPropertiesException.java b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/PrometheusPropertiesException.java new file mode 100644 index 000000000..bdb024514 --- /dev/null +++ b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/PrometheusPropertiesException.java @@ -0,0 +1,14 @@ +package io.prometheus.metrics.config; + +public class PrometheusPropertiesException extends RuntimeException { + + private static final long serialVersionUID = 0L; + + public PrometheusPropertiesException(String msg) { + super(msg); + } + + public PrometheusPropertiesException(String msg, Exception cause) { + super(msg, cause); + } +} diff --git a/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/PrometheusPropertiesLoader.java b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/PrometheusPropertiesLoader.java new file mode 100644 index 000000000..a847a8dba --- /dev/null +++ b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/PrometheusPropertiesLoader.java @@ -0,0 +1,138 @@ +package io.prometheus.metrics.config; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * The Properties Loader is early stages. + * + *

    It would be great to implement a subset of Spring + * Boot's Externalized Configuration, like support for YAML, Properties, and env vars, or + * support for Spring's naming conventions for properties. + */ +public class PrometheusPropertiesLoader { + + /** See {@link PrometheusProperties#get()}. */ + public static PrometheusProperties load() throws PrometheusPropertiesException { + return load(new Properties()); + } + + public static PrometheusProperties load(Map externalProperties) + throws PrometheusPropertiesException { + Map properties = loadProperties(externalProperties); + Map metricsConfigs = loadMetricsConfigs(properties); + MetricsProperties defaultMetricsProperties = + MetricsProperties.load("io.prometheus.metrics", properties); + ExemplarsProperties exemplarConfig = ExemplarsProperties.load(properties); + ExporterProperties exporterProperties = ExporterProperties.load(properties); + ExporterFilterProperties exporterFilterProperties = ExporterFilterProperties.load(properties); + ExporterHttpServerProperties exporterHttpServerProperties = + ExporterHttpServerProperties.load(properties); + ExporterPushgatewayProperties exporterPushgatewayProperties = + ExporterPushgatewayProperties.load(properties); + ExporterOpenTelemetryProperties exporterOpenTelemetryProperties = + ExporterOpenTelemetryProperties.load(properties); + validateAllPropertiesProcessed(properties); + return new PrometheusProperties( + defaultMetricsProperties, + metricsConfigs, + exemplarConfig, + exporterProperties, + exporterFilterProperties, + exporterHttpServerProperties, + exporterPushgatewayProperties, + exporterOpenTelemetryProperties); + } + + // This will remove entries from properties when they are processed. + private static Map loadMetricsConfigs(Map properties) { + Map result = new HashMap<>(); + // Note that the metric name in the properties file must be as exposed in the Prometheus + // exposition formats, + // i.e. all dots replaced with underscores. + Pattern pattern = Pattern.compile("io\\.prometheus\\.metrics\\.([^.]+)\\."); + // Create a copy of the keySet() for iterating. We cannot iterate directly over keySet() + // because entries are removed when MetricsConfig.load(...) is called. + Set propertyNames = new HashSet<>(); + for (Object key : properties.keySet()) { + propertyNames.add(key.toString()); + } + for (String propertyName : propertyNames) { + Matcher matcher = pattern.matcher(propertyName); + if (matcher.find()) { + String metricName = matcher.group(1).replace(".", "_"); + if (!result.containsKey(metricName)) { + result.put( + metricName, + MetricsProperties.load("io.prometheus.metrics." + metricName, properties)); + } + } + } + return result; + } + + // If there are properties left starting with io.prometheus it's likely a typo, + // because we didn't use that property. + // Throw a config error to let the user know that this property doesn't exist. + private static void validateAllPropertiesProcessed(Map properties) { + for (Object key : properties.keySet()) { + if (key.toString().startsWith("io.prometheus")) { + throw new PrometheusPropertiesException(key + ": Unknown property"); + } + } + } + + private static Map loadProperties(Map externalProperties) { + Map properties = new HashMap<>(); + properties.putAll(loadPropertiesFromClasspath()); + properties.putAll(loadPropertiesFromFile()); // overriding the entries from the classpath file + // overriding the entries from the properties file + // copy System properties to avoid ConcurrentModificationException + System.getProperties().stringPropertyNames().stream() + .filter(key -> key.startsWith("io.prometheus")) + .forEach(key -> properties.put(key, System.getProperty(key))); + properties.putAll(externalProperties); // overriding all the entries above + // TODO: Add environment variables like EXEMPLARS_ENABLED. + return properties; + } + + private static Properties loadPropertiesFromClasspath() { + Properties properties = new Properties(); + try (InputStream stream = + Thread.currentThread() + .getContextClassLoader() + .getResourceAsStream("prometheus.properties")) { + properties.load(stream); + } catch (Exception ignored) { + // No properties file found on the classpath. + } + return properties; + } + + private static Properties loadPropertiesFromFile() throws PrometheusPropertiesException { + Properties properties = new Properties(); + String path = System.getProperty("prometheus.config"); + if (System.getenv("PROMETHEUS_CONFIG") != null) { + path = System.getenv("PROMETHEUS_CONFIG"); + } + if (path != null) { + try (InputStream stream = Files.newInputStream(Paths.get(path))) { + properties.load(stream); + } catch (IOException e) { + throw new PrometheusPropertiesException( + "Failed to read Prometheus properties from " + path + ": " + e.getMessage(), e); + } + } + return properties; + } +} diff --git a/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/Util.java b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/Util.java new file mode 100644 index 000000000..04eb78a19 --- /dev/null +++ b/prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/Util.java @@ -0,0 +1,191 @@ +package io.prometheus.metrics.config; + +import java.time.Duration; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Predicate; +import javax.annotation.Nullable; + +class Util { + + @Nullable + static String getProperty(String name, Map properties) { + Object object = properties.remove(name); + if (object != null) { + return object.toString(); + } + return null; + } + + @Nullable + static Boolean loadBoolean(String name, Map properties) + throws PrometheusPropertiesException { + String property = getProperty(name, properties); + if (property != null) { + if (!"true".equalsIgnoreCase(property) && !"false".equalsIgnoreCase(property)) { + throw new PrometheusPropertiesException( + String.format("%s: Expecting 'true' or 'false'. Found: %s", name, property)); + } + return Boolean.parseBoolean(property); + } + return null; + } + + @Nullable + static List toList(@Nullable double... values) { + if (values == null) { + return null; + } + List result = new ArrayList<>(values.length); + for (double value : values) { + result.add(value); + } + return result; + } + + @Nullable + static String loadString(String name, Map properties) + throws PrometheusPropertiesException { + return getProperty(name, properties); + } + + @Nullable + static String loadStringAddSuffix(String name, Map properties, String suffix) { + Object object = properties.remove(name); + if (object != null) { + return object + suffix; + } + return null; + } + + @Nullable + static List loadStringList(String name, Map properties) + throws PrometheusPropertiesException { + String property = getProperty(name, properties); + if (property != null) { + return Arrays.asList(property.split("\\s*,\\s*")); + } + return null; + } + + @Nullable + static List loadDoubleList(String name, Map properties) + throws PrometheusPropertiesException { + String property = getProperty(name, properties); + if (property != null) { + String[] numbers = property.split("\\s*,\\s*"); + Double[] result = new Double[numbers.length]; + for (int i = 0; i < numbers.length; i++) { + try { + if ("+Inf".equals(numbers[i].trim())) { + result[i] = Double.POSITIVE_INFINITY; + } else { + result[i] = Double.parseDouble(numbers[i]); + } + } catch (NumberFormatException e) { + throw new PrometheusPropertiesException( + name + "=" + property + ": Expecting comma separated list of double values"); + } + } + return Arrays.asList(result); + } + return null; + } + + // Map is represented as "key1=value1,key2=value2" + static Map loadMap(String name, Map properties) + throws PrometheusPropertiesException { + Map result = new HashMap<>(); + String property = getProperty(name, properties); + if (property != null) { + String[] pairs = property.split(","); + for (String pair : pairs) { + if (pair.contains("=")) { + String[] keyValue = pair.split("=", 2); + if (keyValue.length == 2) { + String key = keyValue[0].trim(); + String value = keyValue[1].trim(); + if (!key.isEmpty() && !value.isEmpty()) { + result.putIfAbsent(key, value); + } + } + } + } + } + return result; + } + + @Nullable + static Integer loadInteger(String name, Map properties) + throws PrometheusPropertiesException { + String property = getProperty(name, properties); + if (property != null) { + try { + return Integer.parseInt(property); + } catch (NumberFormatException e) { + throw new PrometheusPropertiesException( + name + "=" + property + ": Expecting integer value"); + } + } + return null; + } + + @Nullable + static Double loadDouble(String name, Map properties) + throws PrometheusPropertiesException { + String property = getProperty(name, properties); + if (property != null) { + try { + return Double.parseDouble(property); + } catch (NumberFormatException e) { + throw new PrometheusPropertiesException(name + "=" + property + ": Expecting double value"); + } + } + return null; + } + + @Nullable + static Long loadLong(String name, Map properties) + throws PrometheusPropertiesException { + String property = getProperty(name, properties); + if (property != null) { + try { + return Long.parseLong(property); + } catch (NumberFormatException e) { + throw new PrometheusPropertiesException(name + "=" + property + ": Expecting long value"); + } + } + return null; + } + + @Nullable + static Duration loadOptionalDuration(String name, Map properties) + throws PrometheusPropertiesException { + + Long value = loadLong(name, properties); + + assertValue(value, t -> t >= 0, "Expecting value >= 0.", null, name); + + if (value == null || value == 0) { + return null; + } + return Duration.ofSeconds(value); + } + + static void assertValue( + @Nullable T number, + Predicate predicate, + String message, + @Nullable String prefix, + String name) + throws PrometheusPropertiesException { + if (number != null && !predicate.test(number)) { + String fullKey = prefix == null ? name : prefix + "." + name; + String fullMessage = String.format("%s: %s Found: %s", fullKey, message, number); + throw new PrometheusPropertiesException(fullMessage); + } + } +} diff --git a/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/EscapingSchemeTest.java b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/EscapingSchemeTest.java new file mode 100644 index 000000000..329644bf5 --- /dev/null +++ b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/EscapingSchemeTest.java @@ -0,0 +1,35 @@ +package io.prometheus.metrics.config; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatCode; + +import org.junit.jupiter.api.Test; + +class EscapingSchemeTest { + + @Test + void forString() { + assertThat(EscapingScheme.forString("allow-utf-8")).isEqualTo(EscapingScheme.ALLOW_UTF8); + assertThat(EscapingScheme.forString("underscores")) + .isEqualTo(EscapingScheme.UNDERSCORE_ESCAPING); + assertThat(EscapingScheme.forString("dots")).isEqualTo(EscapingScheme.DOTS_ESCAPING); + assertThat(EscapingScheme.forString("values")) + .isEqualTo(EscapingScheme.VALUE_ENCODING_ESCAPING); + assertThatCode(() -> EscapingScheme.forString("unknown")) + .isInstanceOf(IllegalArgumentException.class); + } + + @Test + void fromAcceptHeader() { + assertThat(EscapingScheme.fromAcceptHeader("application/json; escaping=allow-utf-8")) + .isEqualTo(EscapingScheme.ALLOW_UTF8); + assertThat(EscapingScheme.fromAcceptHeader("application/json; escaping=underscores")) + .isEqualTo(EscapingScheme.UNDERSCORE_ESCAPING); + assertThat(EscapingScheme.fromAcceptHeader("application/json; escaping=dots")) + .isEqualTo(EscapingScheme.DOTS_ESCAPING); + assertThat(EscapingScheme.fromAcceptHeader("application/json; escaping=values")) + .isEqualTo(EscapingScheme.VALUE_ENCODING_ESCAPING); + assertThat(EscapingScheme.fromAcceptHeader("application/json")) + .isEqualTo(EscapingScheme.DEFAULT); + } +} diff --git a/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExemplarsPropertiesTest.java b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExemplarsPropertiesTest.java new file mode 100644 index 000000000..53f7ae072 --- /dev/null +++ b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExemplarsPropertiesTest.java @@ -0,0 +1,56 @@ +package io.prometheus.metrics.config; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class ExemplarsPropertiesTest { + + @Test + void load() { + ExemplarsProperties properties = + load( + Map.of( + "io.prometheus.exemplars.minRetentionPeriodSeconds", "1", + "io.prometheus.exemplars.maxRetentionPeriodSeconds", "2", + "io.prometheus.exemplars.sampleIntervalMilliseconds", "3")); + assertThat(properties.getMinRetentionPeriodSeconds()).isOne(); + assertThat(properties.getMaxRetentionPeriodSeconds()).isEqualTo(2); + assertThat(properties.getSampleIntervalMilliseconds()).isEqualTo(3); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy(() -> load(Map.of("io.prometheus.exemplars.minRetentionPeriodSeconds", "-1"))) + .withMessage( + "io.prometheus.exemplars.minRetentionPeriodSeconds: Expecting value > 0. Found: -1"); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy(() -> load(Map.of("io.prometheus.exemplars.maxRetentionPeriodSeconds", "0"))) + .withMessage( + "io.prometheus.exemplars.maxRetentionPeriodSeconds: Expecting value > 0. Found: 0"); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy(() -> load(Map.of("io.prometheus.exemplars.sampleIntervalMilliseconds", "-1"))) + .withMessage( + "io.prometheus.exemplars.sampleIntervalMilliseconds: Expecting value > 0. Found: -1"); + } + + private static ExemplarsProperties load(Map map) { + return ExemplarsProperties.load(new HashMap<>(map)); + } + + @Test + void builder() { + ExemplarsProperties properties = + ExemplarsProperties.builder() + .minRetentionPeriodSeconds(1) + .maxRetentionPeriodSeconds(2) + .sampleIntervalMilliseconds(3) + .build(); + assertThat(properties.getMinRetentionPeriodSeconds()).isOne(); + assertThat(properties.getMaxRetentionPeriodSeconds()).isEqualTo(2); + assertThat(properties.getSampleIntervalMilliseconds()).isEqualTo(3); + } +} diff --git a/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExporterFilterPropertiesTest.java b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExporterFilterPropertiesTest.java new file mode 100644 index 000000000..0b30fbd43 --- /dev/null +++ b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExporterFilterPropertiesTest.java @@ -0,0 +1,44 @@ +package io.prometheus.metrics.config; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class ExporterFilterPropertiesTest { + + @Test + void load() { + ExporterFilterProperties properties = + load( + Map.of( + "io.prometheus.exporter.filter.metricNameMustBeEqualTo", "a,b,c", + "io.prometheus.exporter.filter.metricNameMustNotBeEqualTo", "d,e,f", + "io.prometheus.exporter.filter.metricNameMustStartWith", "g,h,i", + "io.prometheus.exporter.filter.metricNameMustNotStartWith", "j,k,l")); + assertThat(properties.getAllowedMetricNames()).containsExactly("a", "b", "c"); + assertThat(properties.getExcludedMetricNames()).containsExactly("d", "e", "f"); + assertThat(properties.getAllowedMetricNamePrefixes()).containsExactly("g", "h", "i"); + assertThat(properties.getExcludedMetricNamePrefixes()).containsExactly("j", "k", "l"); + } + + private static ExporterFilterProperties load(Map map) { + return ExporterFilterProperties.load(new HashMap<>(map)); + } + + @Test + void builder() { + ExporterFilterProperties properties = + ExporterFilterProperties.builder() + .allowedNames("a", "b", "c") + .excludedNames("d", "e", "f") + .allowedPrefixes("g", "h", "i") + .excludedPrefixes("j", "k", "l") + .build(); + assertThat(properties.getAllowedMetricNames()).containsExactly("a", "b", "c"); + assertThat(properties.getExcludedMetricNames()).containsExactly("d", "e", "f"); + assertThat(properties.getAllowedMetricNamePrefixes()).containsExactly("g", "h", "i"); + assertThat(properties.getExcludedMetricNamePrefixes()).containsExactly("j", "k", "l"); + } +} diff --git a/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExporterHttpServerPropertiesTest.java b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExporterHttpServerPropertiesTest.java new file mode 100644 index 000000000..ae83c305e --- /dev/null +++ b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExporterHttpServerPropertiesTest.java @@ -0,0 +1,39 @@ +package io.prometheus.metrics.config; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.assertj.core.api.SoftAssertions.assertSoftly; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class ExporterHttpServerPropertiesTest { + @Test + void load() { + ExporterHttpServerProperties properties = + load(Map.of("io.prometheus.exporter.httpServer.port", "1")); + assertThat(properties.getPort()).isOne(); + assertThat(properties.isPreferUncompressedResponse()).isFalse(); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy(() -> load(Map.of("io.prometheus.exporter.httpServer.port", "0"))) + .withMessage("io.prometheus.exporter.httpServer.port: Expecting value > 0. Found: 0"); + } + + @Test + void builder() { + ExporterHttpServerProperties properties = + ExporterHttpServerProperties.builder().port(1).build(); + + assertSoftly( + softly -> { + softly.assertThat(properties.getPort()).isOne(); + softly.assertThat(properties.isPreferUncompressedResponse()).isFalse(); + }); + } + + private static ExporterHttpServerProperties load(Map map) { + return ExporterHttpServerProperties.load(new HashMap<>(map)); + } +} diff --git a/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExporterOpenTelemetryPropertiesTest.java b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExporterOpenTelemetryPropertiesTest.java new file mode 100644 index 000000000..7ba275570 --- /dev/null +++ b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExporterOpenTelemetryPropertiesTest.java @@ -0,0 +1,69 @@ +package io.prometheus.metrics.config; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class ExporterOpenTelemetryPropertiesTest { + + @Test + void load() { + ExporterOpenTelemetryProperties properties = + load( + Map.of( + "io.prometheus.exporter.opentelemetry.protocol", "grpc", + "io.prometheus.exporter.opentelemetry.endpoint", "http://localhost:8080", + "io.prometheus.exporter.opentelemetry.headers", "key1=value1,key2=value2", + "io.prometheus.exporter.opentelemetry.intervalSeconds", "10", + "io.prometheus.exporter.opentelemetry.timeoutSeconds", "5", + "io.prometheus.exporter.opentelemetry.serviceName", "serviceName", + "io.prometheus.exporter.opentelemetry.serviceNamespace", "serviceNamespace", + "io.prometheus.exporter.opentelemetry.serviceInstanceId", "serviceInstanceId", + "io.prometheus.exporter.opentelemetry.serviceVersion", "serviceVersion", + "io.prometheus.exporter.opentelemetry.resourceAttributes", + "key1=value1,key2=value2")); + + assertValues(properties); + } + + private static void assertValues(ExporterOpenTelemetryProperties properties) { + assertThat(properties.getProtocol()).isEqualTo("grpc"); + assertThat(properties.getEndpoint()).isEqualTo("http://localhost:8080"); + assertThat(properties.getHeaders()) + .containsExactlyInAnyOrderEntriesOf(Map.of("key1", "value1", "key2", "value2")); + assertThat(properties.getInterval()).isEqualTo("10s"); + assertThat(properties.getTimeout()).isEqualTo("5s"); + assertThat(properties.getServiceName()).isEqualTo("serviceName"); + assertThat(properties.getServiceNamespace()).isEqualTo("serviceNamespace"); + assertThat(properties.getServiceInstanceId()).isEqualTo("serviceInstanceId"); + assertThat(properties.getServiceVersion()).isEqualTo("serviceVersion"); + assertThat(properties.getResourceAttributes()) + .containsExactlyInAnyOrderEntriesOf(Map.of("key1", "value1", "key2", "value2")); + } + + private static ExporterOpenTelemetryProperties load(Map map) { + return ExporterOpenTelemetryProperties.load(new HashMap<>(map)); + } + + @Test + void builder() { + ExporterOpenTelemetryProperties properties = + ExporterOpenTelemetryProperties.builder() + .protocol("grpc") + .endpoint("http://localhost:8080") + .header("key1", "value1") + .header("key2", "value2") + .intervalSeconds(10) + .timeoutSeconds(5) + .serviceName("serviceName") + .serviceNamespace("serviceNamespace") + .serviceInstanceId("serviceInstanceId") + .serviceVersion("serviceVersion") + .resourceAttribute("key1", "value1") + .resourceAttribute("key2", "value2") + .build(); + assertValues(properties); + } +} diff --git a/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExporterPropertiesTest.java b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExporterPropertiesTest.java new file mode 100644 index 000000000..dec9e03a5 --- /dev/null +++ b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExporterPropertiesTest.java @@ -0,0 +1,58 @@ +package io.prometheus.metrics.config; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class ExporterPropertiesTest { + + @Test + void load() { + ExporterProperties properties = + load( + new HashMap<>( + Map.of( + "io.prometheus.exporter.includeCreatedTimestamps", "true", + "io.prometheus.exporter.exemplarsOnAllMetricTypes", "true"))); + assertThat(properties.getIncludeCreatedTimestamps()).isTrue(); + assertThat(properties.getExemplarsOnAllMetricTypes()).isTrue(); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy( + () -> + load( + new HashMap<>( + Map.of("io.prometheus.exporter.includeCreatedTimestamps", "invalid")))) + .withMessage( + "io.prometheus.exporter.includeCreatedTimestamps: Expecting 'true' or 'false'. Found:" + + " invalid"); + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy( + () -> + load( + new HashMap<>( + Map.of("io.prometheus.exporter.exemplarsOnAllMetricTypes", "invalid")))) + .withMessage( + "io.prometheus.exporter.exemplarsOnAllMetricTypes: Expecting 'true' or 'false'. Found:" + + " invalid"); + } + + private static ExporterProperties load(Map map) { + return ExporterProperties.load(new HashMap<>(map)); + } + + @Test + void builder() { + ExporterProperties properties = + ExporterProperties.builder() + .includeCreatedTimestamps(true) + .exemplarsOnAllMetricTypes(true) + .prometheusTimestampsInMs(false) + .build(); + assertThat(properties.getIncludeCreatedTimestamps()).isTrue(); + assertThat(properties.getExemplarsOnAllMetricTypes()).isTrue(); + } +} diff --git a/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExporterPushgatewayPropertiesTest.java b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExporterPushgatewayPropertiesTest.java new file mode 100644 index 000000000..e1e06348a --- /dev/null +++ b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/ExporterPushgatewayPropertiesTest.java @@ -0,0 +1,56 @@ +package io.prometheus.metrics.config; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import java.time.Duration; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class ExporterPushgatewayPropertiesTest { + + @Test + void load() { + ExporterPushgatewayProperties properties = + load( + Map.of( + "io.prometheus.exporter.pushgateway.address", "http://localhost", + "io.prometheus.exporter.pushgateway.job", "job", + "io.prometheus.exporter.pushgateway.scheme", "http")); + + assertThat(properties.getAddress()).isEqualTo("http://localhost"); + assertThat(properties.getJob()).isEqualTo("job"); + assertThat(properties.getScheme()).isEqualTo("http"); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy(() -> load(Map.of("io.prometheus.exporter.pushgateway.scheme", "foo"))) + .withMessage( + "io.prometheus.exporter.pushgateway.scheme: Illegal value. Expecting 'http' or 'https'." + + " Found: foo"); + } + + private static ExporterPushgatewayProperties load(Map map) { + return ExporterPushgatewayProperties.load(new HashMap<>(map)); + } + + @Test + void builder() { + ExporterPushgatewayProperties properties = + ExporterPushgatewayProperties.builder() + .address("http://localhost") + .job("job") + .scheme("http") + .escapingScheme(EscapingScheme.DOTS_ESCAPING) + .connectTimeout(Duration.ofSeconds(1)) + .readTimeout(Duration.ofSeconds(2)) + .build(); + + assertThat(properties.getAddress()).isEqualTo("http://localhost"); + assertThat(properties.getJob()).isEqualTo("job"); + assertThat(properties.getScheme()).isEqualTo("http"); + assertThat(properties.getEscapingScheme()).isEqualTo(EscapingScheme.DOTS_ESCAPING); + assertThat(properties.getConnectTimeout()).isEqualTo(Duration.ofSeconds(1)); + assertThat(properties.getReadTimeout()).isEqualTo(Duration.ofSeconds(2)); + } +} diff --git a/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/MetricsPropertiesTest.java b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/MetricsPropertiesTest.java new file mode 100644 index 000000000..4f4c56755 --- /dev/null +++ b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/MetricsPropertiesTest.java @@ -0,0 +1,156 @@ +package io.prometheus.metrics.config; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import org.junit.jupiter.api.Test; + +class MetricsPropertiesTest { + @Test + void builder() { + assertThat(MetricsProperties.builder().exemplarsEnabled(true).build().getExemplarsEnabled()) + .isTrue(); + assertThat( + MetricsProperties.builder().histogramNativeOnly(true).build().getHistogramNativeOnly()) + .isTrue(); + assertThat( + MetricsProperties.builder() + .histogramClassicOnly(true) + .build() + .getHistogramClassicOnly()) + .isTrue(); + assertThat( + MetricsProperties.builder() + .histogramClassicUpperBounds(1.0, 2.0) + .build() + .getHistogramClassicUpperBounds()) + .containsExactly(1.0, 2.0); + + assertThat(MetricsProperties.builder().summaryQuantiles(0.1, 0.2).build().getSummaryQuantiles()) + .containsExactly(0.1, 0.2); + assertThat( + MetricsProperties.builder().summaryMaxAgeSeconds(1L).build().getSummaryMaxAgeSeconds()) + .isOne(); + assertThat( + MetricsProperties.builder() + .summaryQuantiles(0.2) + .summaryQuantileErrors(1.0) + .build() + .getSummaryQuantileErrors()) + .containsExactly(1.0); + assertThat( + MetricsProperties.builder() + .summaryNumberOfAgeBuckets(1) + .build() + .getSummaryNumberOfAgeBuckets()) + .isOne(); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy(() -> MetricsProperties.builder().summaryNumberOfAgeBuckets(0).build()) + .withMessage(".summaryNumberOfAgeBuckets: Expecting value > 0. Found: 0"); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy(() -> MetricsProperties.builder().summaryQuantiles(2L).build()) + .withMessage(".summaryQuantiles: Expecting 0.0 <= quantile <= 1.0. Found: 2.0"); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy(() -> MetricsProperties.builder().summaryQuantileErrors(0.9).build()) + .withMessage( + ".summaryQuantileErrors: Can't configure summaryQuantileErrors without configuring" + + " summaryQuantiles"); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy( + () -> + MetricsProperties.builder() + .summaryQuantiles(0.1) + .summaryQuantileErrors(0.1, 0.9) + .build()) + .withMessage(".summaryQuantileErrors: must have the same length as summaryQuantiles"); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy( + () -> + MetricsProperties.builder() + .summaryQuantiles(0.1) + .summaryQuantileErrors(-0.9) + .build()) + .withMessage(".summaryQuantileErrors: Expecting 0.0 <= error <= 1.0"); + } + + @Test + void nativeBuilder() { + assertThat( + MetricsProperties.builder() + .histogramNativeInitialSchema(1) + .build() + .getHistogramNativeInitialSchema()) + .isOne(); + assertThat( + MetricsProperties.builder() + .histogramNativeMinZeroThreshold(.1) + .build() + .getHistogramNativeMinZeroThreshold()) + .isEqualTo(.1); + assertThat( + MetricsProperties.builder() + .histogramNativeMaxZeroThreshold(.1) + .build() + .getHistogramNativeMaxZeroThreshold()) + .isEqualTo(.1); + assertThat( + MetricsProperties.builder() + .histogramNativeMaxNumberOfBuckets(1) + .build() + .getHistogramNativeMaxNumberOfBuckets()) + .isOne(); + assertThat( + MetricsProperties.builder() + .histogramNativeResetDurationSeconds(1L) + .build() + .getHistogramNativeResetDurationSeconds()) + .isOne(); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy(() -> MetricsProperties.builder().histogramNativeInitialSchema(10).build()) + .withMessage( + ".histogramNativeInitialSchema: Expecting number between -4 and +8. Found: 10"); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy(() -> MetricsProperties.builder().histogramNativeMinZeroThreshold(-1.0).build()) + .withMessage(".histogramNativeMinZeroThreshold: Expecting value >= 0. Found: -1.0"); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy(() -> MetricsProperties.builder().histogramNativeMaxZeroThreshold(-1.0).build()) + .withMessage(".histogramNativeMaxZeroThreshold: Expecting value >= 0. Found: -1.0"); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy(() -> MetricsProperties.builder().histogramNativeMaxNumberOfBuckets(-1).build()) + .withMessage(".histogramNativeMaxNumberOfBuckets: Expecting value >= 0. Found: -1"); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy( + () -> MetricsProperties.builder().histogramNativeResetDurationSeconds(-1L).build()) + .withMessage(".histogramNativeResetDurationSeconds: Expecting value >= 0. Found: -1"); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy( + () -> + MetricsProperties.builder() + .histogramNativeOnly(true) + .histogramClassicOnly(true) + .build()) + .withMessage(".histogramNativeOnly and .histogramClassicOnly cannot both be true"); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy( + () -> + MetricsProperties.builder() + .histogramNativeMinZeroThreshold(0.1) + .histogramNativeMaxZeroThreshold(0.01) + .build()) + .withMessage( + ".histogramNativeMinZeroThreshold cannot be greater than" + + " .histogramNativeMaxZeroThreshold"); + } +} diff --git a/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/PrometheusPropertiesLoaderTest.java b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/PrometheusPropertiesLoaderTest.java new file mode 100644 index 000000000..cf4933acf --- /dev/null +++ b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/PrometheusPropertiesLoaderTest.java @@ -0,0 +1,60 @@ +package io.prometheus.metrics.config; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import java.util.Properties; +import org.junit.jupiter.api.Test; +import org.junitpioneer.jupiter.SetSystemProperty; + +/** Tests for {@link PrometheusPropertiesLoader}. */ +class PrometheusPropertiesLoaderTest { + + @Test + public void propertiesShouldBeLoadedFromPropertiesFile() { + PrometheusProperties prometheusProperties = PrometheusPropertiesLoader.load(); + assertThat(prometheusProperties.getDefaultMetricProperties().getHistogramClassicUpperBounds()) + .hasSize(11); + assertThat( + prometheusProperties + .getMetricProperties("http_duration_seconds") + .getHistogramClassicUpperBounds()) + .hasSize(4); + assertThat(prometheusProperties.getExporterProperties().getExemplarsOnAllMetricTypes()) + .isTrue(); + } + + @Test + @SetSystemProperty(key = "prometheus.config", value = "nonexistent.properties") + void cantLoadPropertiesFile() { + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy( + () -> { + PrometheusPropertiesLoader.load(new Properties()); + }) + .withMessage( + "Failed to read Prometheus properties from nonexistent.properties:" + + " nonexistent.properties"); + } + + @Test + public void externalPropertiesShouldOverridePropertiesFile() { + Properties properties = new Properties(); + properties.setProperty("io.prometheus.metrics.histogramClassicUpperBounds", ".005, .01"); + properties.setProperty( + "io.prometheus.metrics.http_duration_seconds.histogramClassicUpperBounds", + ".005, .01, .015"); + properties.setProperty("io.prometheus.exporter.exemplarsOnAllMetricTypes", "false"); + + PrometheusProperties prometheusProperties = PrometheusPropertiesLoader.load(properties); + assertThat(prometheusProperties.getDefaultMetricProperties().getHistogramClassicUpperBounds()) + .hasSize(2); + assertThat( + prometheusProperties + .getMetricProperties("http_duration_seconds") + .getHistogramClassicUpperBounds()) + .hasSize(3); + assertThat(prometheusProperties.getExporterProperties().getExemplarsOnAllMetricTypes()) + .isFalse(); + } +} diff --git a/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/PrometheusPropertiesTest.java b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/PrometheusPropertiesTest.java new file mode 100644 index 000000000..d0205b28e --- /dev/null +++ b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/PrometheusPropertiesTest.java @@ -0,0 +1,70 @@ +package io.prometheus.metrics.config; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Collections; +import java.util.HashMap; +import java.util.Properties; +import org.junit.jupiter.api.Test; + +class PrometheusPropertiesTest { + + @Test + public void testPrometheusConfig() { + PrometheusProperties result = PrometheusProperties.get(); + assertThat(result.getDefaultMetricProperties().getHistogramClassicUpperBounds()).hasSize(11); + assertThat(result.getMetricProperties("http_duration_seconds").getHistogramClassicUpperBounds()) + .hasSize(4); + } + + @Test + public void testEmptyUpperBounds() throws IOException { + Properties properties = new Properties(); + try (InputStream stream = + Thread.currentThread() + .getContextClassLoader() + .getResourceAsStream("emptyUpperBounds.properties")) { + properties.load(stream); + } + assertThat(properties).hasSize(1); + MetricsProperties.load("io.prometheus.metrics", properties); + assertThat(properties).isEmpty(); + } + + @Test + public void testBuilder() { + PrometheusProperties defaults = PrometheusPropertiesLoader.load(new HashMap<>()); + PrometheusProperties.Builder builder = PrometheusProperties.builder(); + builder.defaultMetricsProperties(defaults.getDefaultMetricProperties()); + builder.metricProperties( + Collections.singletonMap( + "http_duration_seconds", + MetricsProperties.builder().histogramClassicUpperBounds(0.1, 0.2, 0.5, 1.0).build())); + builder.exemplarProperties(defaults.getExemplarProperties()); + builder.defaultMetricsProperties(defaults.getDefaultMetricProperties()); + builder.exporterFilterProperties(defaults.getExporterFilterProperties()); + builder.exporterHttpServerProperties(defaults.getExporterHttpServerProperties()); + builder.exporterOpenTelemetryProperties(defaults.getExporterOpenTelemetryProperties()); + builder.pushgatewayProperties(defaults.getExporterPushgatewayProperties()); + builder.exporterProperties(defaults.getExporterProperties()); + PrometheusProperties result = builder.build(); + assertThat(result.getDefaultMetricProperties()).isSameAs(defaults.getDefaultMetricProperties()); + assertThat(result.getExemplarProperties()).isSameAs(defaults.getExemplarProperties()); + assertThat(result.getExporterFilterProperties()) + .isSameAs(defaults.getExporterFilterProperties()); + assertThat(result.getExporterHttpServerProperties()) + .isSameAs(defaults.getExporterHttpServerProperties()); + assertThat(result.getExporterOpenTelemetryProperties()) + .isSameAs(defaults.getExporterOpenTelemetryProperties()); + assertThat(result.getExporterPushgatewayProperties()) + .isSameAs(defaults.getExporterPushgatewayProperties()); + assertThat(result.getMetricProperties("http_duration_seconds")) + .usingRecursiveComparison() + .isEqualTo( + MetricsProperties.builder().histogramClassicUpperBounds(0.1, 0.2, 0.5, 1.0).build()); + assertThat(result.getMetricProperties("unknown_metric")).isNull(); + assertThat(result.getExporterProperties()).isSameAs(defaults.getExporterProperties()); + } +} diff --git a/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/UtilTest.java b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/UtilTest.java new file mode 100644 index 000000000..23ffbd33b --- /dev/null +++ b/prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/UtilTest.java @@ -0,0 +1,50 @@ +package io.prometheus.metrics.config; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import java.time.Duration; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class UtilTest { + @Test + void loadOptionalDuration_positive() { + Map properties = new HashMap<>(Map.of("foo", "5")); + + assertThat(Util.loadOptionalDuration("foo", properties)).isEqualTo(Duration.ofSeconds(5)); + } + + @Test + void loadOptionalDuration_zero() { + Map properties = new HashMap<>(Map.of("foo", "0")); + + assertThat(Util.loadOptionalDuration("foo", properties)).isNull(); + } + + @Test + void loadOptionalDuration_missing() { + Map properties = new HashMap<>(); + + assertThat(Util.loadOptionalDuration("foo", properties)).isNull(); + } + + @Test + void loadOptionalDuration_negative_throws() { + Map properties = new HashMap<>(Map.of("foo", "-1")); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy(() -> Util.loadOptionalDuration("foo", properties)) + .withMessage("foo: Expecting value >= 0. Found: -1"); + } + + @Test + void loadOptionalDuration_invalidNumber_throws() { + Map properties = new HashMap<>(Map.of("foo", "abc")); + + assertThatExceptionOfType(PrometheusPropertiesException.class) + .isThrownBy(() -> Util.loadOptionalDuration("foo", properties)) + .withMessage("foo=abc: Expecting long value"); + } +} diff --git a/prometheus-metrics-config/src/test/resources/emptyUpperBounds.properties b/prometheus-metrics-config/src/test/resources/emptyUpperBounds.properties new file mode 100644 index 000000000..c019761ca --- /dev/null +++ b/prometheus-metrics-config/src/test/resources/emptyUpperBounds.properties @@ -0,0 +1 @@ +io.prometheus.metrics.histogramClassicUpperBounds =, diff --git a/prometheus-metrics-config/src/test/resources/prometheus.properties b/prometheus-metrics-config/src/test/resources/prometheus.properties new file mode 100644 index 000000000..13a5d9e39 --- /dev/null +++ b/prometheus-metrics-config/src/test/resources/prometheus.properties @@ -0,0 +1,26 @@ +io.prometheus.metrics.histogramClassicUpperBounds = .005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10 +io.prometheus.metrics.http_duration_seconds.histogramClassicUpperBounds = .005, .01, .015, .02 +io.prometheus.metrics.summaryQuantiles = 0.5, 0.95, 0.99 +io.prometheus.metrics.summaryQuantileErrors = 0.01, 0.01, 0.001 + +io.prometheus.metrics.exemplarsEnabled = true +io.prometheus.metrics.http_duration_seconds.exemplarsEnabled = true + +io.prometheus.exporter.includeCreatedTimestamps = false +io.prometheus.exporter.exemplarsOnAllMetricTypes = true +io.prometheus.exporter.filter.metricNameMustBeEqualTo = a, b, c + + +io.prometheus.exemplars.minRetentionPeriodSeconds = 30 +io.prometheus.exemplars.maxRetentionPeriodSeconds = 30 +io.prometheus.exemplars.sampleIntervalMilliseconds = 30 + +io.prometheus.exporter.httpServer.port = 9000 + +io.prometheus.exporter.opentelemetry.endpoint=http://localhost:4318 +io.prometheus.exporter.opentelemetry.intervalSeconds=30 +io.prometheus.exporter.opentelemetry.serviceName=hello-world-app +io.prometheus.exporter.opentelemetry.serviceNamespace=prod +io.prometheus.exporter.opentelemetry.serviceInstanceId=localhost:8081 + +# io.prometheus.metrics.unusedLabelsRetentionTimeSeconds = 0 diff --git a/prometheus-metrics-config/version-rules.xml b/prometheus-metrics-config/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-config/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-core/pom.xml b/prometheus-metrics-core/pom.xml new file mode 100644 index 000000000..3a61050de --- /dev/null +++ b/prometheus-metrics-core/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-core + bundle + + Prometheus Metrics Core + + Core Prometheus metric types + + + + io.prometheus.metrics.core + + + + + io.prometheus + prometheus-metrics-model + ${project.version} + + + io.prometheus + prometheus-metrics-config + ${project.version} + + + io.prometheus + prometheus-metrics-tracer-initializer + ${project.version} + + + + + io.prometheus + prometheus-metrics-exposition-formats + ${project.version} + test + + + org.apache.commons + commons-math3 + 3.6.1 + test + + + diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/CounterDataPoint.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/CounterDataPoint.java new file mode 100644 index 000000000..7055d7565 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/CounterDataPoint.java @@ -0,0 +1,102 @@ +package io.prometheus.metrics.core.datapoints; + +import io.prometheus.metrics.model.snapshots.Labels; + +/** + * Represents a single counter data point, i.e. a single line for a counter metric in Prometheus + * text format. + * + *

    Example usage: + * + *

    {@code
    + * Counter counter = Counter.builder()
    + *     .name("tasks_total")
    + *     .labelNames("status")
    + *     .register();
    + * CounterDataPoint newTasks = counter.labelValues("new");
    + * CounterDataPoint pendingTasks = counter.labelValues("pending");
    + * CounterDataPoint completedTasks = counter.labelValues("completed");
    + * }
    + * + *

    Using {@code DataPoint} directly improves performance. If you increment a counter like this: + * + *

    {@code
    + * counter.labelValues("pending").inc();
    + * }
    + * + * the label value {@code "pending"} needs to be looked up every single time. Using the {@code + * CounterDataPoint} like this: + * + *
    {@code
    + * CounterDataPoint pendingTasks = counter.labelValues("pending");
    + * pendingTasks.inc();
    + * }
    + * + * allows you to look up the label value only once, and then use the {@code CounterDataPoint} + * directly. This is a worthwhile performance improvement when instrumenting a performance-critical + * code path. + * + *

    If you have a counter without labels like this: + * + *

    {@code
    + * Counter counterWithoutLabels = Counter.builder()
    + *     .name("events_total")
    + *     .register();
    + * }
    + * + * You can use it as a {@code CounterDataPoint} directly. So the following: + * + *
    {@code
    + * CounterDataPoint counterData = counterWithoutLabels.labelValues(); // empty label values
    + * }
    + * + * is equivalent to + * + *
    {@code
    + * CounterDataPoint counterData = counterWithoutLabels;
    + * }
    + */ +public interface CounterDataPoint extends DataPoint { + + /** Add one. */ + default void inc() { + inc(1L); + } + + /** + * Add {@code amount}. Throws an {@link IllegalArgumentException} if {@code amount} is negative. + */ + default void inc(long amount) { + inc((double) amount); + } + + /** + * Add {@code amount}. Throws an {@link IllegalArgumentException} if {@code amount} is negative. + */ + void inc(double amount); + + /** Add one, and create a custom exemplar with the given labels. */ + default void incWithExemplar(Labels labels) { + incWithExemplar(1.0, labels); + } + + /** + * Add {@code amount}, and create a custom exemplar with the given labels. Throws an {@link + * IllegalArgumentException} if {@code amount} is negative. + */ + default void incWithExemplar(long amount, Labels labels) { + inc((double) amount); + } + + /** + * Add {@code amount}, and create a custom exemplar with the given labels. Throws an {@link + * IllegalArgumentException} if {@code amount} is negative. + */ + void incWithExemplar(double amount, Labels labels); + + /** Get the current value. */ + double get(); + + /** Get the current value as a {@code long}. Decimal places will be discarded. */ + long getLongValue(); +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/DataPoint.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/DataPoint.java new file mode 100644 index 000000000..5b6017ddf --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/DataPoint.java @@ -0,0 +1,3 @@ +package io.prometheus.metrics.core.datapoints; + +public interface DataPoint {} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/DistributionDataPoint.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/DistributionDataPoint.java new file mode 100644 index 000000000..0f2a072de --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/DistributionDataPoint.java @@ -0,0 +1,38 @@ +package io.prometheus.metrics.core.datapoints; + +import io.prometheus.metrics.model.snapshots.Labels; + +/** + * Represents a single data point of a histogram or a summary metric. + * + *

    Single data point means identified label values like {@code {method="GET", path="/", + * status_code="200"}}, ignoring the {@code "le"} label for histograms or the {@code "quantile"} + * label for summaries. + * + *

    This interface is named DistributionDataPoint because both histograms and summaries are + * used to observe distributions, like latency distributions or distributions of request sizes. + * Therefore DistributionDataPoint is a good name for a common interface implemented by + * histogram data points and summary data points. + * + *

    See JavaDoc of {@link CounterDataPoint} on how using data points directly can improve + * performance. + */ +public interface DistributionDataPoint extends DataPoint, TimerApi { + + /** Get the count of observations. */ + long getCount(); + + /** Get the sum of all observed values. */ + double getSum(); + + /** Observe {@code value}. */ + void observe(double value); + + /** Observe {@code value}, and create a custom exemplar with the given labels. */ + void observeWithExemplar(double value, Labels labels); + + @Override + default Timer startTimer() { + return new Timer(this::observe); + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/GaugeDataPoint.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/GaugeDataPoint.java new file mode 100644 index 000000000..eec0304c7 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/GaugeDataPoint.java @@ -0,0 +1,63 @@ +package io.prometheus.metrics.core.datapoints; + +import io.prometheus.metrics.model.snapshots.Labels; + +/** + * Represents a single gauge data point, i.e. a single line for a gauge metric in Prometheus text + * format. + * + *

    See JavaDoc of {@link CounterDataPoint} on how using data points directly can improve + * performance. + */ +public interface GaugeDataPoint extends DataPoint, TimerApi { + + /** Add one. */ + default void inc() { + inc(1.0); + } + + /** Add {@code amount}. */ + void inc(double amount); + + /** Add one, and create a custom exemplar with the given labels. */ + default void incWithExemplar(Labels labels) { + incWithExemplar(1.0, labels); + } + + /** Add {@code amount}, and create a custom exemplar with the given labels. */ + void incWithExemplar(double amount, Labels labels); + + /** Subtract one. */ + default void dec() { + inc(-1.0); + } + + /** Subtract {@code amount}. */ + default void dec(double amount) { + inc(-amount); + } + + /** Subtract one, and create a custom exemplar with the given labels. */ + default void decWithExemplar(Labels labels) { + incWithExemplar(-1.0, labels); + } + + /** Subtract {@code amount}, and create a custom exemplar with the given labels. */ + default void decWithExemplar(double amount, Labels labels) { + incWithExemplar(-amount, labels); + } + + /** Set the gauge to {@code value}. */ + void set(double value); + + /** Get the current value. */ + double get(); + + /** Set the gauge to {@code value}, and create a custom exemplar with the given labels. */ + void setWithExemplar(double value, Labels labels); + + @Override + default Timer startTimer() { + return new Timer(this::set); + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/StateSetDataPoint.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/StateSetDataPoint.java new file mode 100644 index 000000000..bf13b5214 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/StateSetDataPoint.java @@ -0,0 +1,38 @@ +package io.prometheus.metrics.core.datapoints; + +/** + * Represents a single StateSet data point. + * + *

    See JavaDoc of {@link CounterDataPoint} on how using data points directly can improve + * performance. + */ +public interface StateSetDataPoint extends DataPoint { + + /** + * {@code state} must be one of the states from when the {@code StateSet} was created with {@link + * io.prometheus.metrics.core.metrics.StateSet.Builder#states(String...)}. + */ + void setTrue(String state); + + /** + * {@code state} must be one of the states from when the {@code StateSet} was created with {@link + * io.prometheus.metrics.core.metrics.StateSet.Builder#states(Class)}. + */ + default void setTrue(Enum state) { + setTrue(state.toString()); + } + + /** + * {@code state} must be one of the states from when the {@code StateSet} was created with {@link + * io.prometheus.metrics.core.metrics.StateSet.Builder#states(String...)}. + */ + void setFalse(String state); + + /** + * {@code state} must be one of the states from when the {@code StateSet} was created with {@link + * io.prometheus.metrics.core.metrics.StateSet.Builder#states(Class)}. + */ + default void setFalse(Enum state) { + setFalse(state.toString()); + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/Timer.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/Timer.java new file mode 100644 index 000000000..d860bfa08 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/Timer.java @@ -0,0 +1,37 @@ +package io.prometheus.metrics.core.datapoints; + +import io.prometheus.metrics.model.snapshots.Unit; +import java.io.Closeable; +import java.util.function.DoubleConsumer; + +/** Helper class for observing durations. */ +public class Timer implements Closeable { + + private final DoubleConsumer observeFunction; + private final long startTimeNanos = System.nanoTime(); + + /** + * Constructor is package private. Use the {@link TimerApi} provided by the implementation of the + * {@link DataPoint}. + */ + Timer(DoubleConsumer observeFunction) { + this.observeFunction = observeFunction; + } + + /** + * Records the observed duration in seconds since this {@code Timer} instance was created. + * + * @return the observed duration in seconds. + */ + public double observeDuration() { + double elapsed = Unit.nanosToSeconds(System.nanoTime() - startTimeNanos); + observeFunction.accept(elapsed); + return elapsed; + } + + /** Same as {@link #observeDuration()}. */ + @Override + public void close() { + observeDuration(); + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/TimerApi.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/TimerApi.java new file mode 100644 index 000000000..8267f7f78 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/datapoints/TimerApi.java @@ -0,0 +1,82 @@ +package io.prometheus.metrics.core.datapoints; + +import java.util.concurrent.Callable; +import java.util.function.Supplier; + +/** + * Convenience API for timing durations. + * + *

    Durations are recorded in seconds. The Prometheus instrumentation guidelines say: "Metrics + * must use base units (e.g. seconds, bytes) and leave converting them to something more readable to + * graphing tools". + */ +public interface TimerApi { + + /** + * Start a {@code Timer}. Example: + * + *

    {@code
    +   * Histogram histogram = Histogram.builder()
    +   *         .name("http_request_duration_seconds")
    +   *         .help("HTTP request service time in seconds")
    +   *         .unit(SECONDS)
    +   *         .labelNames("method", "path")
    +   *         .register();
    +   *
    +   * try (Timer timer = histogram.labelValues("GET", "/").startTimer()) {
    +   *     // duration of this code block will be observed.
    +   * }
    +   * }
    + * + * Durations are recorded in seconds. The Prometheus instrumentation guidelines say: "Metrics + * must use base units (e.g. seconds, bytes) and leave converting them to something more readable + * to graphing tools". + */ + Timer startTimer(); + + /** + * Observe the duration of the {@code func} call. Example: + * + *
    {@code
    +   * Histogram histogram = Histogram.builder()
    +   *         .name("request_duration_seconds")
    +   *         .help("HTTP request service time in seconds")
    +   *         .unit(SECONDS)
    +   *         .labelNames("method", "path")
    +   *         .register();
    +   *
    +   * histogram2.labelValues("GET", "/").time(() -> {
    +   *     // duration of this code block will be observed.
    +   * });
    +   * }
    + * + *

    Durations are recorded in seconds. The Prometheus instrumentation guidelines say: "Metrics + * must use base units (e.g. seconds, bytes) and leave converting them to something more readable + * to graphing tools". + */ + @SuppressWarnings("try") + default void time(Runnable func) { + try (Timer ignored = startTimer()) { + func.run(); + } + } + + /** Like {@link #time(Runnable)}, but returns the return value of {@code func}. */ + @SuppressWarnings("try") + default T time(Supplier func) { + try (Timer ignored = startTimer()) { + return func.get(); + } + } + + /** Like {@link #time(Supplier)}, but {@code func} may throw a checked {@code Exception}. */ + @SuppressWarnings("try") + default T timeChecked(Callable func) throws Exception { + try (Timer ignored = startTimer()) { + return func.call(); + } + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/exemplars/ExemplarSampler.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/exemplars/ExemplarSampler.java new file mode 100644 index 000000000..1219b2a09 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/exemplars/ExemplarSampler.java @@ -0,0 +1,367 @@ +package io.prometheus.metrics.core.exemplars; + +import static java.util.Objects.requireNonNull; + +import io.prometheus.metrics.core.util.Scheduler; +import io.prometheus.metrics.model.snapshots.Exemplar; +import io.prometheus.metrics.model.snapshots.Exemplars; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.tracer.common.SpanContext; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.LongSupplier; +import javax.annotation.Nullable; + +/** + * The ExemplarSampler selects Spans as exemplars. + * + *

    There are two types of Exemplars: Regular exemplars are sampled implicitly if a supported + * tracing library is detected. Custom exemplars are provided explicitly in code, for example if a + * developer wants to make sure an Exemplar is created for a specific code path. + * + *

    Spans will be marked as being an Exemplar by calling {@link + * SpanContext#markCurrentSpanAsExemplar()}. The tracer implementation should set a Span attribute + * to mark the current Span as an Exemplar. This attribute can be used by a trace sampling algorithm + * to make sure traces with Exemplars are sampled. + * + *

    The ExemplarSample is rate-limited, so only a small fraction of Spans will be marked as + * Exemplars in an application with a large number of requests. + * + *

    See {@link ExemplarSamplerConfig} for configuration options. + */ +public class ExemplarSampler { + + private final ExemplarSamplerConfig config; + private final Exemplar[] exemplars; + private final Exemplar[] + customExemplars; // Separate from exemplars, because we don't want custom exemplars + // to be overwritten by automatic exemplar sampling. exemplars.length == customExemplars.length + private final AtomicBoolean acceptingNewExemplars = new AtomicBoolean(true); + private final AtomicBoolean acceptingNewCustomExemplars = new AtomicBoolean(true); + + @Nullable + private final SpanContext + spanContext; // may be null, in that case SpanContextSupplier.getSpanContext() is used. + + public ExemplarSampler(ExemplarSamplerConfig config) { + this(config, null); + } + + /** + * Constructor with an additional {code spanContext} argument. This is useful for testing, but may + * also be useful in some production scenarios. If {@code spanContext != null} that spanContext is + * used and {@link io.prometheus.metrics.tracer.initializer.SpanContextSupplier + * SpanContextSupplier} is not used. If {@code spanContext == null} {@link + * io.prometheus.metrics.tracer.initializer.SpanContextSupplier#getSpanContext() + * SpanContextSupplier.getSpanContext()} is called to find a span context. + */ + public ExemplarSampler(ExemplarSamplerConfig config, @Nullable SpanContext spanContext) { + this.config = config; + this.exemplars = new Exemplar[config.getNumberOfExemplars()]; + this.customExemplars = new Exemplar[exemplars.length]; + this.spanContext = spanContext; + } + + public Exemplars collect() { + // this may run in parallel with observe() + long now = System.currentTimeMillis(); + List result = new ArrayList<>(exemplars.length); + for (int i = 0; i < customExemplars.length; i++) { + Exemplar exemplar = customExemplars[i]; + if (exemplar != null) { + if (now - exemplar.getTimestampMillis() > config.getMaxRetentionPeriodMillis()) { + customExemplars[i] = null; + } else { + result.add(exemplar); + } + } + } + for (int i = 0; i < exemplars.length && result.size() < exemplars.length; i++) { + Exemplar exemplar = exemplars[i]; + if (exemplar != null) { + if (now - exemplar.getTimestampMillis() > config.getMaxRetentionPeriodMillis()) { + exemplars[i] = null; + } else { + result.add(exemplar); + } + } + } + return Exemplars.of(result); + } + + public void reset() { + for (int i = 0; i < exemplars.length; i++) { + exemplars[i] = null; + customExemplars[i] = null; + } + } + + public void observe(double value) { + if (!acceptingNewExemplars.get()) { + return; // This is the hot path in a high-throughput application and should be as efficient as + // possible. + } + rateLimitedObserve(acceptingNewExemplars, value, () -> doObserve(value)); + } + + public void observeWithExemplar(double value, Labels labels) { + if (!acceptingNewCustomExemplars.get()) { + return; // This is the hot path in a high-throughput application and should be as efficient as + // possible. + } + rateLimitedObserve( + acceptingNewCustomExemplars, value, () -> doObserveWithExemplar(value, labels)); + } + + private long doObserve(double value) { + if (exemplars.length == 1) { + return doObserveSingleExemplar(value); + } else { + double[] classicUpperBounds = config.getHistogramClassicUpperBounds(); + if (classicUpperBounds != null) { + return doObserveWithUpperBounds(value, classicUpperBounds); + } else { + return doObserveWithoutUpperBounds(value); + } + } + } + + private long doObserveSingleExemplar(double value) { + long now = System.currentTimeMillis(); + Exemplar current = exemplars[0]; + if (current == null + || now - current.getTimestampMillis() > config.getMinRetentionPeriodMillis()) { + return updateExemplar(0, value, now); + } + return 0; + } + + private long doObserveSingleExemplar(double amount, Labels labels) { + long now = System.currentTimeMillis(); + Exemplar current = customExemplars[0]; + if (current == null + || now - current.getTimestampMillis() > config.getMinRetentionPeriodMillis()) { + return updateCustomExemplar(0, amount, labels, now); + } + return 0; + } + + private long doObserveWithUpperBounds(double value, double[] classicUpperBounds) { + long now = System.currentTimeMillis(); + for (int i = 0; i < classicUpperBounds.length; i++) { + if (value <= classicUpperBounds[i]) { + Exemplar previous = exemplars[i]; + if (previous == null + || now - previous.getTimestampMillis() > config.getMinRetentionPeriodMillis()) { + return updateExemplar(i, value, now); + } else { + return 0; + } + } + } + return 0; // will never happen, as upperBounds contains +Inf + } + + private long doObserveWithoutUpperBounds(double value) { + final long now = System.currentTimeMillis(); + Exemplar smallest = null; + int smallestIndex = -1; + Exemplar largest = null; + int largestIndex = -1; + int nullIndex = -1; + for (int i = exemplars.length - 1; i >= 0; i--) { + Exemplar exemplar = exemplars[i]; + if (exemplar == null) { + nullIndex = i; + } else if (now - exemplar.getTimestampMillis() > config.getMaxRetentionPeriodMillis()) { + exemplars[i] = null; + nullIndex = i; + } else { + if (smallest == null || exemplar.getValue() < smallest.getValue()) { + smallest = exemplar; + smallestIndex = i; + } + if (largest == null || exemplar.getValue() > largest.getValue()) { + largest = exemplar; + largestIndex = i; + } + } + } + if (nullIndex >= 0) { + return updateExemplar(nullIndex, value, now); + } + if (now - requireNonNull(smallest).getTimestampMillis() > config.getMinRetentionPeriodMillis() + && value < smallest.getValue()) { + return updateExemplar(smallestIndex, value, now); + } + if (now - requireNonNull(largest).getTimestampMillis() > config.getMinRetentionPeriodMillis() + && value > largest.getValue()) { + return updateExemplar(largestIndex, value, now); + } + long oldestTimestamp = 0; + int oldestIndex = -1; + for (int i = 0; i < exemplars.length; i++) { + Exemplar exemplar = exemplars[i]; + if (exemplar != null && exemplar != smallest && exemplar != largest) { + if (oldestTimestamp == 0 || exemplar.getTimestampMillis() < oldestTimestamp) { + oldestTimestamp = exemplar.getTimestampMillis(); + oldestIndex = i; + } + } + } + if (oldestIndex != -1 && now - oldestTimestamp > config.getMinRetentionPeriodMillis()) { + return updateExemplar(oldestIndex, value, now); + } + return 0; + } + + // Returns the timestamp of the newly added Exemplar (which is System.currentTimeMillis()) + // or 0 if no Exemplar was added. + private long doObserveWithExemplar(double amount, Labels labels) { + if (customExemplars.length == 1) { + return doObserveSingleExemplar(amount, labels); + } else { + double[] classicUpperBounds = config.getHistogramClassicUpperBounds(); + if (classicUpperBounds != null) { + return doObserveWithExemplarWithUpperBounds(amount, labels, classicUpperBounds); + } else { + return doObserveWithExemplarWithoutUpperBounds(amount, labels); + } + } + } + + private long doObserveWithExemplarWithUpperBounds( + double value, Labels labels, double[] classicUpperBounds) { + long now = System.currentTimeMillis(); + for (int i = 0; i < classicUpperBounds.length; i++) { + if (value <= classicUpperBounds[i]) { + Exemplar previous = customExemplars[i]; + if (previous == null + || now - previous.getTimestampMillis() > config.getMinRetentionPeriodMillis()) { + return updateCustomExemplar(i, value, labels, now); + } else { + return 0; + } + } + } + return 0; // will never happen, as upperBounds contains +Inf + } + + private long doObserveWithExemplarWithoutUpperBounds(double amount, Labels labels) { + final long now = System.currentTimeMillis(); + int nullPos = -1; + int oldestPos = -1; + Exemplar oldest = null; + for (int i = customExemplars.length - 1; i >= 0; i--) { + Exemplar exemplar = customExemplars[i]; + if (exemplar == null) { + nullPos = i; + } else if (now - exemplar.getTimestampMillis() > config.getMaxRetentionPeriodMillis()) { + customExemplars[i] = null; + nullPos = i; + } else { + if (oldest == null || exemplar.getTimestampMillis() < oldest.getTimestampMillis()) { + oldest = exemplar; + oldestPos = i; + } + } + } + if (nullPos != -1) { + return updateCustomExemplar(nullPos, amount, labels, now); + } else if (now - requireNonNull(oldest).getTimestampMillis() + > config.getMinRetentionPeriodMillis()) { + return updateCustomExemplar(oldestPos, amount, labels, now); + } else { + return 0; + } + } + + /** + * Observing requires a system call to {@link System#currentTimeMillis()}, and it requires + * iterating over the existing exemplars to check if one of the existing exemplars can be + * replaced. + * + *

    To avoid performance issues, we rate limit observing exemplars to {@link + * ExemplarSamplerConfig#getSampleIntervalMillis()} milliseconds. + */ + @SuppressWarnings("FutureReturnValueIgnored") + private void rateLimitedObserve(AtomicBoolean accepting, double value, LongSupplier observeFunc) { + if (Double.isNaN(value)) { + return; + } + if (!accepting.compareAndSet(true, false)) { + return; + } + // observeFunc returns the current timestamp or 0 if no Exemplar was added. + long now = observeFunc.getAsLong(); + long sleepTime = + now == 0 ? config.getSampleIntervalMillis() : durationUntilNextExemplarExpires(now); + Scheduler.schedule( + () -> accepting.compareAndSet(false, true), sleepTime, TimeUnit.MILLISECONDS); + } + + private long durationUntilNextExemplarExpires(long now) { + long oldestTimestamp = now; + for (Exemplar exemplar : exemplars) { + if (exemplar == null) { + return config.getSampleIntervalMillis(); + } else if (exemplar.getTimestampMillis() < oldestTimestamp) { + oldestTimestamp = exemplar.getTimestampMillis(); + } + } + long oldestAge = now - oldestTimestamp; + if (oldestAge < config.getMinRetentionPeriodMillis()) { + return config.getMinRetentionPeriodMillis() - oldestAge; + } + return config.getSampleIntervalMillis(); + } + + private long updateCustomExemplar(int index, double value, Labels labels, long now) { + if (!labels.contains(Exemplar.TRACE_ID) && !labels.contains(Exemplar.SPAN_ID)) { + labels = labels.merge(doSampleExemplar()); + } + customExemplars[index] = + Exemplar.builder().value(value).labels(labels).timestampMillis(now).build(); + return now; + } + + private long updateExemplar(int index, double value, long now) { + Labels traceLabels = doSampleExemplar(); + if (!traceLabels.isEmpty()) { + exemplars[index] = + Exemplar.builder().value(value).labels(traceLabels).timestampMillis(now).build(); + return now; + } else { + return 0; + } + } + + private Labels doSampleExemplar() { + // Using the qualified name so that Micrometer can exclude the dependency on + // prometheus-metrics-tracer-initializer + // as they provide their own implementation of SpanContextSupplier. + // If we had an import statement for SpanContextSupplier the dependency would be needed in any + // case. + SpanContext spanContext = + this.spanContext != null + ? this.spanContext + : io.prometheus.metrics.tracer.initializer.SpanContextSupplier.getSpanContext(); + try { + if (spanContext != null) { + if (spanContext.isCurrentSpanSampled()) { + String spanId = spanContext.getCurrentSpanId(); + String traceId = spanContext.getCurrentTraceId(); + if (spanId != null && traceId != null) { + spanContext.markCurrentSpanAsExemplar(); + return Labels.of(Exemplar.TRACE_ID, traceId, Exemplar.SPAN_ID, spanId); + } + } + } + } catch (NoClassDefFoundError ignored) { + // ignore + } + return Labels.EMPTY; + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/exemplars/ExemplarSamplerConfig.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/exemplars/ExemplarSamplerConfig.java new file mode 100644 index 000000000..5bf642e7e --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/exemplars/ExemplarSamplerConfig.java @@ -0,0 +1,149 @@ +package io.prometheus.metrics.core.exemplars; + +import io.prometheus.metrics.config.ExemplarsProperties; +import io.prometheus.metrics.config.PrometheusProperties; +import java.util.concurrent.TimeUnit; +import javax.annotation.Nullable; + +public class ExemplarSamplerConfig { + + /** See {@link ExemplarsProperties#getMinRetentionPeriodSeconds()} */ + public static final int DEFAULT_MIN_RETENTION_PERIOD_SECONDS = 7; + + /** See {@link ExemplarsProperties#getMaxRetentionPeriodSeconds()} */ + public static final int DEFAULT_MAX_RETENTION_PERIOD_SECONDS = 70; + + /** See {@link ExemplarsProperties#getSampleIntervalMilliseconds()} */ + private static final int DEFAULT_SAMPLE_INTERVAL_MILLISECONDS = 90; + + private final long minRetentionPeriodMillis; + private final long maxRetentionPeriodMillis; + private final long sampleIntervalMillis; + + @Nullable + private final double[] histogramClassicUpperBounds; // null unless it's a classic histogram + + // if histogramClassicUpperBounds != null, + // then numberOfExemplars == histogramClassicUpperBounds.length + private final int numberOfExemplars; + + /** + * Constructor for all metric types except classic histograms. + * + * @param properties See {@link PrometheusProperties#getExemplarProperties()}. + * @param numberOfExemplars Counters have 1 Exemplar, native histograms and summaries have 4 + * Exemplars by default. For classic histogram use {@link + * #ExemplarSamplerConfig(ExemplarsProperties, double[])}. + */ + public ExemplarSamplerConfig(ExemplarsProperties properties, int numberOfExemplars) { + this(properties, numberOfExemplars, null); + } + + /** + * Constructor for classic histogram metrics. + * + * @param properties See {@link PrometheusProperties#getExemplarProperties()}. + * @param histogramClassicUpperBounds the ExemplarSampler will provide one Exemplar per histogram + * bucket. Must be sorted, and must include the +Inf bucket. + */ + public ExemplarSamplerConfig( + ExemplarsProperties properties, double[] histogramClassicUpperBounds) { + this(properties, histogramClassicUpperBounds.length, histogramClassicUpperBounds); + } + + private ExemplarSamplerConfig( + ExemplarsProperties properties, + int numberOfExemplars, + @Nullable double[] histogramClassicUpperBounds) { + this( + TimeUnit.SECONDS.toMillis( + getOrDefault( + properties.getMinRetentionPeriodSeconds(), DEFAULT_MIN_RETENTION_PERIOD_SECONDS)), + TimeUnit.SECONDS.toMillis( + getOrDefault( + properties.getMaxRetentionPeriodSeconds(), DEFAULT_MAX_RETENTION_PERIOD_SECONDS)), + getOrDefault( + properties.getSampleIntervalMilliseconds(), DEFAULT_SAMPLE_INTERVAL_MILLISECONDS), + numberOfExemplars, + histogramClassicUpperBounds); + } + + ExemplarSamplerConfig( + long minRetentionPeriodMillis, + long maxRetentionPeriodMillis, + long sampleIntervalMillis, + int numberOfExemplars, + @Nullable double[] histogramClassicUpperBounds) { + this.minRetentionPeriodMillis = minRetentionPeriodMillis; + this.maxRetentionPeriodMillis = maxRetentionPeriodMillis; + this.sampleIntervalMillis = sampleIntervalMillis; + this.numberOfExemplars = numberOfExemplars; + this.histogramClassicUpperBounds = histogramClassicUpperBounds; + validate(); + } + + private void validate() { + if (minRetentionPeriodMillis <= 0) { + throw new IllegalArgumentException( + minRetentionPeriodMillis + ": minRetentionPeriod must be > 0."); + } + if (maxRetentionPeriodMillis <= 0) { + throw new IllegalArgumentException( + maxRetentionPeriodMillis + ": maxRetentionPeriod must be > 0."); + } + if (histogramClassicUpperBounds != null) { + if (histogramClassicUpperBounds.length == 0 + || histogramClassicUpperBounds[histogramClassicUpperBounds.length - 1] + != Double.POSITIVE_INFINITY) { + throw new IllegalArgumentException( + "histogramClassicUpperBounds must contain the +Inf bucket."); + } + if (histogramClassicUpperBounds.length != numberOfExemplars) { + throw new IllegalArgumentException( + "histogramClassicUpperBounds.length must be equal to numberOfExemplars."); + } + double bound = histogramClassicUpperBounds[0]; + for (int i = 1; i < histogramClassicUpperBounds.length; i++) { + if (bound >= histogramClassicUpperBounds[i]) { + throw new IllegalArgumentException( + "histogramClassicUpperBounds must be sorted and must not contain duplicates."); + } + } + } + if (numberOfExemplars <= 0) { + throw new IllegalArgumentException(numberOfExemplars + ": numberOfExemplars must be > 0."); + } + } + + private static T getOrDefault(@Nullable T result, T defaultValue) { + return result != null ? result : defaultValue; + } + + @Nullable + public double[] getHistogramClassicUpperBounds() { + return histogramClassicUpperBounds; + } + + /** See {@link ExemplarsProperties#getMinRetentionPeriodSeconds()} */ + public long getMinRetentionPeriodMillis() { + return minRetentionPeriodMillis; + } + + /** See {@link ExemplarsProperties#getMaxRetentionPeriodSeconds()} */ + public long getMaxRetentionPeriodMillis() { + return maxRetentionPeriodMillis; + } + + /** See {@link ExemplarsProperties#getSampleIntervalMilliseconds()} */ + public long getSampleIntervalMillis() { + return sampleIntervalMillis; + } + + /** + * Defaults: Counters have one Exemplar, native histograms and summaries have 4 Exemplars, classic + * histograms have one Exemplar per bucket. + */ + public int getNumberOfExemplars() { + return numberOfExemplars; + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Buffer.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Buffer.java new file mode 100644 index 000000000..d4ff33a37 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Buffer.java @@ -0,0 +1,118 @@ +package io.prometheus.metrics.core.metrics; + +import io.prometheus.metrics.model.snapshots.DataPointSnapshot; +import java.util.Arrays; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.ReentrantLock; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Supplier; + +/** + * Metrics support concurrent write and scrape operations. + * + *

    This is implemented by switching to a Buffer when the scrape starts, and applying the values + * from the buffer after the scrape ends. + */ +class Buffer { + + private static final long bufferActiveBit = 1L << 63; + private final AtomicLong observationCount = new AtomicLong(0); + private double[] observationBuffer = new double[0]; + private int bufferPos = 0; + private boolean reset = false; + + ReentrantLock appendLock = new ReentrantLock(); + ReentrantLock runLock = new ReentrantLock(); + Condition bufferFilled = appendLock.newCondition(); + + boolean append(double value) { + long count = observationCount.incrementAndGet(); + if ((count & bufferActiveBit) == 0) { + return false; // sign bit not set -> buffer not active. + } else { + doAppend(value); + return true; + } + } + + private void doAppend(double amount) { + appendLock.lock(); + try { + if (bufferPos >= observationBuffer.length) { + observationBuffer = Arrays.copyOf(observationBuffer, observationBuffer.length + 128); + } + observationBuffer[bufferPos] = amount; + bufferPos++; + + bufferFilled.signalAll(); + } finally { + appendLock.unlock(); + } + } + + /** Must be called by the runnable in the run() method. */ + void reset() { + reset = true; + } + + @SuppressWarnings("ThreadPriorityCheck") + T run( + Function complete, + Supplier createResult, + Consumer observeFunction) { + double[] buffer; + int bufferSize; + T result; + + runLock.lock(); + try { + // Signal that the buffer is active. + Long expectedCount = observationCount.getAndAdd(bufferActiveBit); + + while (!complete.apply(expectedCount)) { + // Wait until all in-flight threads have added their observations to the histogram / + // summary. + // we can't use a condition here, because the other thread doesn't have a lock as it's on + // the fast path. + Thread.yield(); + } + result = createResult.get(); + + // Signal that the buffer is inactive. + int expectedBufferSize; + if (reset) { + expectedBufferSize = + (int) ((observationCount.getAndSet(0) & ~bufferActiveBit) - expectedCount); + reset = false; + } else { + expectedBufferSize = (int) (observationCount.addAndGet(bufferActiveBit) - expectedCount); + } + + appendLock.lock(); + try { + while (bufferPos < expectedBufferSize) { + // Wait until all in-flight threads have added their observations to the buffer. + bufferFilled.await(); + } + } finally { + appendLock.unlock(); + } + + buffer = observationBuffer; + bufferSize = bufferPos; + observationBuffer = new double[0]; + bufferPos = 0; + } catch (InterruptedException e) { + throw new RuntimeException(e); + } finally { + runLock.unlock(); + } + + for (int i = 0; i < bufferSize; i++) { + observeFunction.accept(buffer[i]); + } + return result; + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/CKMSQuantiles.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/CKMSQuantiles.java new file mode 100644 index 000000000..74ce18e72 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/CKMSQuantiles.java @@ -0,0 +1,279 @@ +package io.prometheus.metrics.core.metrics; + +// The original implementation was copied from +// https://raw.githubusercontent.com/Netflix/ocelli/master/ocelli-core/src/main/java/netflix/ocelli/stats/CKMSQuantiles.java +// Revision d0357b8bf5c17a173ce94d6b26823775b3f999f6 from Jan 21, 2015. +// However, it has been heavily refactored in the meantime. + +/* +Copyright 2012 Andrew Wang (andrew@umbrant.com) + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import java.util.Arrays; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.ListIterator; + +// CHECKSTYLE:OFF: checkstyle + +/** + * Algorithm solving the "Targeted Quantile Problem" as described in "Effective Computation of + * Biased Quantiles over Data Streams" by Cormode, Korn, Muthukrishnan, and Srivastava. + */ +final class CKMSQuantiles { + + final Quantile[] quantiles; + + /** Total number of observations (not including those that are still in the buffer). */ + int n = 0; + + /** List of sampled observations, ordered by Sample.value. */ + @SuppressWarnings("JdkObsolete") + final LinkedList samples = new LinkedList<>(); + + /** + * Compress is called every compressInterval inserts. Note that the buffer is flushed whenever + * get() is called, so we cannot just wait until the buffer is full before we call compress. + */ + private final int compressInterval = 128; + + private int insertsSinceLastCompress = 0; + + /** + * Note that the buffer size could as well be less than the compressInterval. However, the buffer + * size should not be greater than the compressInterval, because the compressInterval is not + * respected in flush(), so if you want to compress more often than calling flush() that won't + * work. + */ + private final double[] buffer = new double[compressInterval]; + + private int bufferPos = 0; + + public CKMSQuantiles(Quantile... quantiles) { + if (quantiles.length == 0) { + throw new IllegalArgumentException("quantiles cannot be empty"); + } + this.quantiles = quantiles; + } + + /** Add an observed value */ + public void insert(double value) { + buffer[bufferPos++] = value; + + if (bufferPos == buffer.length) { + flush(); + } + + if (++insertsSinceLastCompress == compressInterval) { + compress(); + insertsSinceLastCompress = 0; + } + } + + private void flush() { + Arrays.sort(buffer, 0, bufferPos); + insertBatch(buffer, bufferPos); + bufferPos = 0; + } + + /** Inserts the elements from index 0 to index toIndex from the sortedBuffer. */ + void insertBatch(double[] sortedBuffer, int toIndex) { + if (toIndex == 0) { + return; + } + ListIterator iterator = samples.listIterator(); + int i = 0; // position in buffer + int r = 0; // sum of g's left of the current sample + while (iterator.hasNext() && i < toIndex) { + Sample item = iterator.next(); + while (i < toIndex) { + if (sortedBuffer[i] > item.value) { + break; + } + insertBefore(iterator, sortedBuffer[i], r); + r++; // new item with g=1 was inserted before, so increment r + i++; + n++; + } + r += item.g; + } + while (i < toIndex) { + samples.add(new Sample(sortedBuffer[i], 0)); + i++; + n++; + } + } + + private void insertBefore(ListIterator iterator, double value, int r) { + if (!iterator.hasPrevious()) { + samples.addFirst(new Sample(value, 0)); + } else { + iterator.previous(); + iterator.add(new Sample(value, f(r) - 1)); + iterator.next(); + } + } + + /** Get the estimated value at the specified quantile. */ + public double get(double q) { + flush(); + + if (samples.isEmpty()) { + return Double.NaN; + } + + if (q == 0.0) { + return samples.getFirst().value; + } + + if (q == 1.0) { + return samples.getLast().value; + } + + int r = 0; // sum of g's left of the current sample + int desiredRank = (int) Math.ceil(q * n); + int upperBound = desiredRank + f(desiredRank) / 2; + + ListIterator iterator = samples.listIterator(); + while (iterator.hasNext()) { + Sample sample = iterator.next(); + if (r + sample.g + sample.delta > upperBound) { + iterator.previous(); // roll back the item.next() above + if (iterator.hasPrevious()) { + Sample result = iterator.previous(); + return result.value; + } else { + return sample.value; + } + } + r += sample.g; + } + return samples.getLast().value; + } + + /** Error function, as in definition 5 of the paper. */ + int f(int r) { + int minResult = Integer.MAX_VALUE; + for (Quantile q : quantiles) { + if (q.quantile == 0 || q.quantile == 1) { + continue; + } + int result; + // We had a numerical error here with the following example: + // quantile = 0.95, epsilon = 0.01, (n-r) = 30. + // The expected result of (2*0.01*30)/(1-0.95) is 12. The actual result is 11.99999999999999. + // To avoid running into these types of error we add 0.00000000001 before rounding down. + if (r >= q.quantile * n) { + result = (int) (q.v * r + 0.00000000001); + } else { + result = (int) (q.u * (n - r) + 0.00000000001); + } + if (result < minResult) { + minResult = result; + } + } + return Math.max(minResult, 1); + } + + /** Merge pairs of consecutive samples if this doesn't violate the error function. */ + void compress() { + if (samples.size() < 3) { + return; + } + Iterator descendingIterator = samples.descendingIterator(); + int r = n; // n is equal to the sum of the g's of all samples + + Sample right; + Sample left = descendingIterator.next(); + r -= left.g; + + while (descendingIterator.hasNext()) { + right = left; + left = descendingIterator.next(); + r = r - left.g; + if (left == samples.getFirst()) { + // The min sample must never be merged. + break; + } + if (left.g + right.g + right.delta < f(r)) { + right.g += left.g; + descendingIterator.remove(); + left = right; + } + } + } + + static class Sample { + + /** Observed value. */ + final double value; + + /** + * Difference between the lowest possible rank of this sample and its predecessor. This always + * starts with 1, but will be updated when compress() merges Samples. + */ + int g = 1; + + /** + * Difference between the greatest possible rank of this sample and the lowest possible rank of + * this sample. + */ + final int delta; + + Sample(double value, int delta) { + this.value = value; + this.delta = delta; + } + + @Override + public String toString() { + return String.format("Sample{val=%.3f, g=%d, delta=%d}", value, g, delta); + } + } + + static class Quantile { + + /** Quantile. Must be between 0 and 1. */ + final double quantile; + + /** Allowed error. Must be between 0 and 1. */ + final double epsilon; + + /** Helper used in the error function f(), see definition 5 in the paper. */ + final double u; + + /** Helper used in the error function f(), see definition 5 in the paper. */ + final double v; + + Quantile(double quantile, double epsilon) { + if (quantile < 0.0 || quantile > 1.0) + throw new IllegalArgumentException("Quantile must be between 0 and 1"); + if (epsilon < 0.0 || epsilon > 1.0) + throw new IllegalArgumentException("Epsilon must be between 0 and 1"); + + this.quantile = quantile; + this.epsilon = epsilon; + u = 2.0 * epsilon / (1.0 - quantile); // if quantile == 1 this will be Double.NaN + v = 2.0 * epsilon / quantile; // if quantile == 0 this will be Double.NaN + } + + @Override + public String toString() { + return String.format("Quantile{q=%.3f, epsilon=%.3f}", quantile, epsilon); + } + } +} + +// CHECKSTYLE:ON: checkstyle diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/CallbackMetric.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/CallbackMetric.java new file mode 100644 index 000000000..2afaffae7 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/CallbackMetric.java @@ -0,0 +1,54 @@ +package io.prometheus.metrics.core.metrics; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.model.snapshots.Labels; +import java.util.List; + +/** + * There are two kinds of metrics: {@code StatefulMetric} and {@code CallbackMetric}. + * + *

    See JavaDoc on {@link StatefulMetric} for more info. + */ +abstract class CallbackMetric extends MetricWithFixedMetadata { + + protected CallbackMetric(Builder builder) { + super(builder); + } + + protected Labels makeLabels(String... labelValues) { + if (labelNames.length == 0) { + if (labelValues != null && labelValues.length > 0) { + throw new IllegalArgumentException( + "Cannot pass label values to a " + + this.getClass().getSimpleName() + + " that was created without label names."); + } + return constLabels; + } else { + if (labelValues == null) { + throw new IllegalArgumentException( + this.getClass().getSimpleName() + + " was created with label names, " + + "but the callback was called without label values."); + } + if (labelValues.length != labelNames.length) { + throw new IllegalArgumentException( + this.getClass().getSimpleName() + + " was created with " + + labelNames.length + + " label names, but the callback was called with " + + labelValues.length + + " label values."); + } + return constLabels.merge(Labels.of(labelNames, labelValues)); + } + } + + abstract static class Builder, M extends CallbackMetric> + extends MetricWithFixedMetadata.Builder { + + protected Builder(List illegalLabelNames, PrometheusProperties properties) { + super(illegalLabelNames, properties); + } + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Counter.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Counter.java new file mode 100644 index 000000000..a2bac20d2 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Counter.java @@ -0,0 +1,251 @@ +package io.prometheus.metrics.core.metrics; + +import io.prometheus.metrics.config.MetricsProperties; +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.datapoints.CounterDataPoint; +import io.prometheus.metrics.core.exemplars.ExemplarSampler; +import io.prometheus.metrics.core.exemplars.ExemplarSamplerConfig; +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import io.prometheus.metrics.model.snapshots.Exemplar; +import io.prometheus.metrics.model.snapshots.Labels; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.atomic.DoubleAdder; +import java.util.concurrent.atomic.LongAdder; +import javax.annotation.Nullable; + +/** + * Counter metric. + * + *

    Example usage: + * + *

    {@code
    + * Counter requestCount = Counter.builder()
    + *     .name("requests_total")
    + *     .help("Total number of requests")
    + *     .labelNames("path", "status")
    + *     .register();
    + * requestCount.labelValues("/hello-world", "200").inc();
    + * requestCount.labelValues("/hello-world", "500").inc();
    + * }
    + */ +public class Counter extends StatefulMetric + implements CounterDataPoint { + + @Nullable private final ExemplarSamplerConfig exemplarSamplerConfig; + + private Counter(Builder builder, PrometheusProperties prometheusProperties) { + super(builder); + MetricsProperties[] properties = getMetricProperties(builder, prometheusProperties); + boolean exemplarsEnabled = + getConfigProperty(properties, MetricsProperties::getExemplarsEnabled); + if (exemplarsEnabled) { + exemplarSamplerConfig = + new ExemplarSamplerConfig(prometheusProperties.getExemplarProperties(), 1); + } else { + exemplarSamplerConfig = null; + } + } + + @Override + public void inc(long amount) { + getNoLabels().inc(amount); + } + + @Override + public void inc(double amount) { + getNoLabels().inc(amount); + } + + @Override + public void incWithExemplar(long amount, Labels labels) { + getNoLabels().incWithExemplar(amount, labels); + } + + @Override + public void incWithExemplar(double amount, Labels labels) { + getNoLabels().incWithExemplar(amount, labels); + } + + @Override + public double get() { + return getNoLabels().get(); + } + + @Override + public long getLongValue() { + return getNoLabels().getLongValue(); + } + + @Override + public CounterSnapshot collect() { + return (CounterSnapshot) super.collect(); + } + + @Override + protected CounterSnapshot collect(List labels, List metricData) { + List data = new ArrayList<>(labels.size()); + for (int i = 0; i < labels.size(); i++) { + data.add(metricData.get(i).collect(labels.get(i))); + } + return new CounterSnapshot(getMetadata(), data); + } + + @Override + protected DataPoint newDataPoint() { + if (exemplarSamplerConfig != null) { + return new DataPoint(new ExemplarSampler(exemplarSamplerConfig)); + } else { + return new DataPoint(null); + } + } + + static String stripTotalSuffix(String name) { + if (name != null && (name.endsWith("_total") || name.endsWith(".total"))) { + name = name.substring(0, name.length() - 6); + } + return name; + } + + static class DataPoint implements CounterDataPoint { + + private final DoubleAdder doubleValue = new DoubleAdder(); + // LongAdder is 20% faster than DoubleAdder. So let's use the LongAdder for long observations, + // and DoubleAdder for double observations. If the user doesn't observe any double at all, + // we will be using the LongAdder and get the best performance. + private final LongAdder longValue = new LongAdder(); + private final long createdTimeMillis = System.currentTimeMillis(); + + @Nullable + private final ExemplarSampler exemplarSampler; // null if exemplarSamplerConfig is null + + private DataPoint(@Nullable ExemplarSampler exemplarSampler) { + this.exemplarSampler = exemplarSampler; + } + + @Override + public double get() { + return longValue.sum() + doubleValue.sum(); + } + + @Override + public long getLongValue() { + return longValue.sum() + (long) doubleValue.sum(); + } + + @Override + public void inc(long amount) { + validateAndAdd(amount); + if (exemplarSampler != null) { + exemplarSampler.observe((double) amount); + } + } + + @Override + public void inc(double amount) { + validateAndAdd(amount); + if (exemplarSampler != null) { + exemplarSampler.observe(amount); + } + } + + @Override + public void incWithExemplar(long amount, Labels labels) { + validateAndAdd(amount); + if (exemplarSampler != null) { + exemplarSampler.observeWithExemplar((double) amount, labels); + } + } + + @Override + public void incWithExemplar(double amount, Labels labels) { + validateAndAdd(amount); + if (exemplarSampler != null) { + exemplarSampler.observeWithExemplar(amount, labels); + } + } + + private void validateAndAdd(long amount) { + if (amount < 0) { + throw new IllegalArgumentException( + "Negative increment " + amount + " is illegal for Counter metrics."); + } + longValue.add(amount); + } + + private void validateAndAdd(double amount) { + if (amount < 0) { + throw new IllegalArgumentException( + "Negative increment " + amount + " is illegal for Counter metrics."); + } + doubleValue.add(amount); + } + + private CounterSnapshot.CounterDataPointSnapshot collect(Labels labels) { + // Read the exemplar first. Otherwise, there is a race condition where you might + // see an Exemplar for a value that's not counted yet. + // If there are multiple Exemplars (by default it's just one), use the newest. + Exemplar latestExemplar = null; + if (exemplarSampler != null) { + for (Exemplar exemplar : exemplarSampler.collect()) { + if (latestExemplar == null + || exemplar.getTimestampMillis() > latestExemplar.getTimestampMillis()) { + latestExemplar = exemplar; + } + } + } + return new CounterSnapshot.CounterDataPointSnapshot( + get(), labels, latestExemplar, createdTimeMillis); + } + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder extends StatefulMetric.Builder { + + private Builder(PrometheusProperties properties) { + super(Collections.emptyList(), properties); + } + + /** + * The {@code _total} suffix will automatically be appended if it's missing. + * + *
    {@code
    +     * Counter c1 = Counter.builder()
    +     *     .name("events_total")
    +     *     .build();
    +     * Counter c2 = Counter.builder()
    +     *     .name("events")
    +     *     .build();
    +     * }
    + * + * In the example above both {@code c1} and {@code c2} would be named {@code "events_total"} in + * Prometheus. + * + *

    Throws an {@link IllegalArgumentException} if {@link + * io.prometheus.metrics.model.snapshots.PrometheusNaming#isValidMetricName(String) + * MetricMetadata.isValidMetricName(name)} is {@code false}. + */ + @Override + public Builder name(String name) { + return super.name(stripTotalSuffix(name)); + } + + @Override + public Counter build() { + return new Counter(this, properties); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/CounterWithCallback.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/CounterWithCallback.java new file mode 100644 index 000000000..044644ec5 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/CounterWithCallback.java @@ -0,0 +1,109 @@ +package io.prometheus.metrics.core.metrics; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.function.Consumer; +import javax.annotation.Nullable; + +/** + * Example: + * + *

    {@code
    + * ClassLoadingMXBean classLoadingMXBean = ManagementFactory.getClassLoadingMXBean();
    + *
    + * CounterWithCallback.builder()
    + *         .name("classes_loaded_total")
    + *         .help("The total number of classes since the JVM has started execution")
    + *         .callback(callback -> callback.call(classLoadingMXBean.getLoadedClassCount()))
    + *         .register();
    + * }
    + */ +public class CounterWithCallback extends CallbackMetric { + + @FunctionalInterface + public interface Callback { + void call(double value, String... labelValues); + } + + private final Consumer callback; + + private CounterWithCallback(Builder builder) { + super(builder); + if (builder.callback == null) { + throw new IllegalArgumentException("callback cannot be null"); + } + this.callback = builder.callback; + } + + @Override + public CounterSnapshot collect() { + List dataPoints = new ArrayList<>(); + callback.accept( + (value, labelValues) -> { + dataPoints.add( + new CounterSnapshot.CounterDataPointSnapshot( + value, makeLabels(labelValues), null, 0L)); + }); + return new CounterSnapshot(getMetadata(), dataPoints); + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties properties) { + return new Builder(properties); + } + + public static class Builder + extends CallbackMetric.Builder { + + @Nullable private Consumer callback; + + public Builder callback(Consumer callback) { + this.callback = callback; + return self(); + } + + private Builder(PrometheusProperties properties) { + super(Collections.emptyList(), properties); + } + + /** + * The {@code _total} suffix will automatically be appended if it's missing. + * + *
    {@code
    +     * CounterWithCallback c1 = CounterWithCallback.builder()
    +     *     .name("events_total")
    +     *     .build();
    +     * CounterWithCallback c2 = CounterWithCallback.builder()
    +     *     .name("events")
    +     *     .build();
    +     * }
    + * + * In the example above both {@code c1} and {@code c2} would be named {@code "events_total"} in + * Prometheus. + * + *

    Throws an {@link IllegalArgumentException} if {@link + * io.prometheus.metrics.model.snapshots.PrometheusNaming#isValidMetricName(String) + * MetricMetadata.isValidMetricName(name)} is {@code false}. + */ + @Override + public Builder name(String name) { + return super.name(Counter.stripTotalSuffix(name)); + } + + @Override + public CounterWithCallback build() { + return new CounterWithCallback(this); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Gauge.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Gauge.java new file mode 100644 index 000000000..5850a1cfe --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Gauge.java @@ -0,0 +1,197 @@ +package io.prometheus.metrics.core.metrics; + +import io.prometheus.metrics.config.MetricsProperties; +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.datapoints.GaugeDataPoint; +import io.prometheus.metrics.core.exemplars.ExemplarSampler; +import io.prometheus.metrics.core.exemplars.ExemplarSamplerConfig; +import io.prometheus.metrics.model.snapshots.Exemplar; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import io.prometheus.metrics.model.snapshots.Labels; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.atomic.AtomicLong; +import javax.annotation.Nullable; + +/** + * Gauge metric. + * + *

    Example usage: + * + *

    {@code
    + * Gauge currentActiveUsers = Gauge.builder()
    + *     .name("current_active_users")
    + *     .help("Number of users that are currently active")
    + *     .labelNames("region")
    + *     .register();
    + *
    + * public void login(String region) {
    + *     currentActiveUsers.labelValues(region).inc();
    + *     // perform login
    + * }
    + *
    + * public void logout(String region) {
    + *     currentActiveUsers.labelValues(region).dec();
    + *     // perform logout
    + * }
    + * }
    + */ +public class Gauge extends StatefulMetric + implements GaugeDataPoint { + + @Nullable private final ExemplarSamplerConfig exemplarSamplerConfig; + + private Gauge(Builder builder, PrometheusProperties prometheusProperties) { + super(builder); + MetricsProperties[] properties = getMetricProperties(builder, prometheusProperties); + boolean exemplarsEnabled = + getConfigProperty(properties, MetricsProperties::getExemplarsEnabled); + if (exemplarsEnabled) { + exemplarSamplerConfig = + new ExemplarSamplerConfig(prometheusProperties.getExemplarProperties(), 1); + } else { + exemplarSamplerConfig = null; + } + } + + @Override + public void inc(double amount) { + getNoLabels().inc(amount); + } + + @Override + public double get() { + return getNoLabels().get(); + } + + @Override + public void incWithExemplar(double amount, Labels labels) { + getNoLabels().incWithExemplar(amount, labels); + } + + @Override + public void set(double value) { + getNoLabels().set(value); + } + + @Override + public void setWithExemplar(double value, Labels labels) { + getNoLabels().setWithExemplar(value, labels); + } + + @Override + public GaugeSnapshot collect() { + return (GaugeSnapshot) super.collect(); + } + + @Override + protected GaugeSnapshot collect(List labels, List metricData) { + List dataPointSnapshots = new ArrayList<>(labels.size()); + for (int i = 0; i < labels.size(); i++) { + dataPointSnapshots.add(metricData.get(i).collect(labels.get(i))); + } + return new GaugeSnapshot(getMetadata(), dataPointSnapshots); + } + + @Override + protected DataPoint newDataPoint() { + if (exemplarSamplerConfig != null) { + return new DataPoint(new ExemplarSampler(exemplarSamplerConfig)); + } else { + return new DataPoint(null); + } + } + + static class DataPoint implements GaugeDataPoint { + + @Nullable + private final ExemplarSampler exemplarSampler; // null if exemplarSamplerConfig is null + + private DataPoint(@Nullable ExemplarSampler exemplarSampler) { + this.exemplarSampler = exemplarSampler; + } + + private final AtomicLong value = new AtomicLong(Double.doubleToRawLongBits(0)); + + @Override + public void inc(double amount) { + long next = + value.updateAndGet(l -> Double.doubleToRawLongBits(Double.longBitsToDouble(l) + amount)); + if (exemplarSampler != null) { + exemplarSampler.observe(Double.longBitsToDouble(next)); + } + } + + @Override + public void incWithExemplar(double amount, Labels labels) { + long next = + value.updateAndGet(l -> Double.doubleToRawLongBits(Double.longBitsToDouble(l) + amount)); + if (exemplarSampler != null) { + exemplarSampler.observeWithExemplar(Double.longBitsToDouble(next), labels); + } + } + + @Override + public void set(double value) { + this.value.set(Double.doubleToRawLongBits(value)); + if (exemplarSampler != null) { + exemplarSampler.observe(value); + } + } + + @Override + public double get() { + return Double.longBitsToDouble(value.get()); + } + + @Override + public void setWithExemplar(double value, Labels labels) { + this.value.set(Double.doubleToRawLongBits(value)); + if (exemplarSampler != null) { + exemplarSampler.observeWithExemplar(value, labels); + } + } + + private GaugeSnapshot.GaugeDataPointSnapshot collect(Labels labels) { + // Read the exemplar first. Otherwise, there is a race condition where you might + // see an Exemplar for a value that's not represented in getValue() yet. + // If there are multiple Exemplars (by default it's just one), use the oldest + // so that we don't violate min age. + Exemplar oldest = null; + if (exemplarSampler != null) { + for (Exemplar exemplar : exemplarSampler.collect()) { + if (oldest == null || exemplar.getTimestampMillis() < oldest.getTimestampMillis()) { + oldest = exemplar; + } + } + } + return new GaugeSnapshot.GaugeDataPointSnapshot(get(), labels, oldest); + } + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder extends StatefulMetric.Builder { + + private Builder(PrometheusProperties config) { + super(Collections.emptyList(), config); + } + + @Override + public Gauge build() { + return new Gauge(this, properties); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/GaugeWithCallback.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/GaugeWithCallback.java new file mode 100644 index 000000000..82f26afe1 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/GaugeWithCallback.java @@ -0,0 +1,89 @@ +package io.prometheus.metrics.core.metrics; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.function.Consumer; +import javax.annotation.Nullable; + +/** + * Example: + * + *
    {@code
    + * MemoryMXBean memoryBean = ManagementFactory.getMemoryMXBean();
    + *
    + * GaugeWithCallback.builder()
    + *     .name("jvm_memory_bytes_used")
    + *     .help("Used bytes of a given JVM memory area.")
    + *     .unit(Unit.BYTES)
    + *     .labelNames("area")
    + *     .callback(callback -> {
    + *         callback.call(memoryBean.getHeapMemoryUsage().getUsed(), "heap");
    + *         callback.call(memoryBean.getNonHeapMemoryUsage().getUsed(), "nonheap");
    + *     })
    + *     .register();
    + * }
    + */ +public class GaugeWithCallback extends CallbackMetric { + + @FunctionalInterface + public interface Callback { + void call(double value, String... labelValues); + } + + private final Consumer callback; + + private GaugeWithCallback(Builder builder) { + super(builder); + if (builder.callback == null) { + throw new IllegalArgumentException("callback cannot be null"); + } + this.callback = builder.callback; + } + + @Override + public GaugeSnapshot collect() { + List dataPoints = new ArrayList<>(); + callback.accept( + (value, labelValues) -> { + dataPoints.add( + new GaugeSnapshot.GaugeDataPointSnapshot(value, makeLabels(labelValues), null, 0L)); + }); + return new GaugeSnapshot(getMetadata(), dataPoints); + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties properties) { + return new Builder(properties); + } + + public static class Builder + extends CallbackMetric.Builder { + + @Nullable private Consumer callback; + + public Builder callback(Consumer callback) { + this.callback = callback; + return self(); + } + + private Builder(PrometheusProperties properties) { + super(Collections.emptyList(), properties); + } + + @Override + public GaugeWithCallback build() { + return new GaugeWithCallback(this); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Histogram.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Histogram.java new file mode 100644 index 000000000..85f6225d3 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Histogram.java @@ -0,0 +1,978 @@ +package io.prometheus.metrics.core.metrics; + +import io.prometheus.metrics.config.ExemplarsProperties; +import io.prometheus.metrics.config.MetricsProperties; +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.datapoints.DistributionDataPoint; +import io.prometheus.metrics.core.exemplars.ExemplarSampler; +import io.prometheus.metrics.core.exemplars.ExemplarSamplerConfig; +import io.prometheus.metrics.core.util.Scheduler; +import io.prometheus.metrics.model.snapshots.ClassicHistogramBuckets; +import io.prometheus.metrics.model.snapshots.Exemplars; +import io.prometheus.metrics.model.snapshots.HistogramSnapshot; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.NativeHistogramBuckets; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.SortedSet; +import java.util.TreeSet; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.DoubleAdder; +import java.util.concurrent.atomic.LongAdder; +import javax.annotation.Nullable; + +/** + * Histogram metric. Example usage: + * + *
    {@code
    + * Histogram histogram = Histogram.builder()
    + *         .name("http_request_duration_seconds")
    + *         .help("HTTP request service time in seconds")
    + *         .unit(SECONDS)
    + *         .labelNames("method", "path", "status_code")
    + *         .register();
    + *
    + * long start = System.nanoTime();
    + * // do something
    + * histogram.labelValues("GET", "/", "200").observe(Unit.nanosToSeconds(System.nanoTime() - start));
    + * }
    + * + * Prometheus supports two internal representations of histograms: + * + *
      + *
    1. Classic Histograms have a fixed number of buckets with fixed bucket boundaries. + *
    2. Native Histograms have an infinite number of buckets with a dynamic resolution. + * Prometheus native histograms are the same as OpenTelemetry's exponential histograms. + *
    + * + * By default, a histogram maintains both representations, i.e. the example above will maintain a + * classic histogram representation with Prometheus' default bucket boundaries as well as native + * histogram representation. Which representation is used depends on the exposition format, i.e. + * which content type the Prometheus server accepts when scraping. Exposition format "Text" exposes + * the classic histogram, exposition format "Protobuf" exposes both representations. This is great + * for migrating from classic histograms to native histograms. + * + *

    If you want the classic representation only, use {@link Histogram.Builder#classicOnly}. If you + * want the native representation only, use {@link Histogram.Builder#nativeOnly}. + */ +public class Histogram extends StatefulMetric + implements DistributionDataPoint { + + // nativeSchema == CLASSIC_HISTOGRAM indicates that this is a classic histogram only. + private static final int CLASSIC_HISTOGRAM = Integer.MIN_VALUE; + + // NATIVE_BOUNDS is used to look up the native bucket index depending on the current schema. + private static final double[][] NATIVE_BOUNDS; + + @Nullable private final ExemplarSamplerConfig exemplarSamplerConfig; + + // Upper bounds for the classic histogram buckets. Contains at least +Inf. + // An empty array indicates that this is a native histogram only. + private final double[] classicUpperBounds; + + // The schema defines the resolution of the native histogram. + // Schema is Prometheus terminology, in OpenTelemetry it's named "scale". + // The formula for the bucket boundaries at position "index" is: + // + // base := base = (2^(2^-scale)) + // lowerBound := base^(index-1) + // upperBound := base^(index) + // + // Note that this is off-by-one compared to OpenTelemetry. + // + // Example: With schema 0 the bucket boundaries are ... 1/16, 1/8, 1/4, 1/2, 1, 2, 4, 8, 16, ... + // Each increment in schema doubles the number of buckets. + // + // The initialNativeSchema is the schema we start with. The histogram will automatically scale + // down + // if the number of native histogram buckets exceeds nativeMaxBuckets. + private final int nativeInitialSchema; // integer in [-4, 8] + + // Native histogram buckets get smaller and smaller the closer they get to zero. + // To avoid wasting a lot of buckets for observations fluctuating around zero, we consider all + // values in [-zeroThreshold, +zeroThreshold] to be equal to zero. + // + // The zeroThreshold is initialized with minZeroThreshold, and will grow up to maxZeroThreshold if + // the number of native histogram buckets exceeds nativeMaxBuckets. + private final double nativeMinZeroThreshold; + private final double nativeMaxZeroThreshold; + + // When the number of native histogram buckets becomes larger than nativeMaxBuckets, + // an attempt is made to reduce the number of buckets: + // (1) Reset if the last reset is longer than the reset duration ago + // (2) Increase the zero bucket width if it's smaller than nativeMaxZeroThreshold + // (3) Decrease the nativeSchema, i.e. merge pairs of neighboring buckets into one + private final int nativeMaxBuckets; + + // If the number of native histogram buckets exceeds nativeMaxBuckets, + // the histogram may reset (all values set to zero) after nativeResetDurationSeconds is expired. + private final long nativeResetDurationSeconds; // 0 indicates no reset + + private Histogram(Histogram.Builder builder, PrometheusProperties prometheusProperties) { + super(builder); + MetricsProperties[] properties = getMetricProperties(builder, prometheusProperties); + nativeInitialSchema = + getConfigProperty( + properties, + props -> { + if (Boolean.TRUE.equals(props.getHistogramClassicOnly())) { + return CLASSIC_HISTOGRAM; + } else { + return props.getHistogramNativeInitialSchema(); + } + }); + classicUpperBounds = + getConfigProperty( + properties, + props -> { + if (Boolean.TRUE.equals(props.getHistogramNativeOnly())) { + return new double[] {}; + } else if (props.getHistogramClassicUpperBounds() != null) { + SortedSet upperBounds = + new TreeSet<>(props.getHistogramClassicUpperBounds()); + upperBounds.add(Double.POSITIVE_INFINITY); + double[] result = new double[upperBounds.size()]; + int i = 0; + for (double upperBound : upperBounds) { + result[i++] = upperBound; + } + return result; + } else { + return null; + } + }); + double max = + getConfigProperty(properties, MetricsProperties::getHistogramNativeMaxZeroThreshold); + double min = + getConfigProperty(properties, MetricsProperties::getHistogramNativeMinZeroThreshold); + nativeMaxZeroThreshold = + max == Builder.DEFAULT_NATIVE_MAX_ZERO_THRESHOLD && min > max ? min : max; + nativeMinZeroThreshold = Math.min(min, nativeMaxZeroThreshold); + nativeMaxBuckets = + getConfigProperty(properties, MetricsProperties::getHistogramNativeMaxNumberOfBuckets); + nativeResetDurationSeconds = + getConfigProperty(properties, MetricsProperties::getHistogramNativeResetDurationSeconds); + boolean exemplarsEnabled = + getConfigProperty(properties, MetricsProperties::getExemplarsEnabled); + ExemplarsProperties exemplarsProperties = prometheusProperties.getExemplarProperties(); + if (exemplarsEnabled) { + exemplarSamplerConfig = + classicUpperBounds.length == 0 + ? new ExemplarSamplerConfig(exemplarsProperties, 4) + : new ExemplarSamplerConfig(exemplarsProperties, classicUpperBounds); + } else { + exemplarSamplerConfig = null; + } + } + + @Override + public double getSum() { + return getNoLabels().getSum(); + } + + @Override + public long getCount() { + return getNoLabels().getCount(); + } + + @Override + public void observe(double amount) { + getNoLabels().observe(amount); + } + + @Override + public void observeWithExemplar(double amount, Labels labels) { + getNoLabels().observeWithExemplar(amount, labels); + } + + public class DataPoint implements DistributionDataPoint { + private final LongAdder[] classicBuckets; + private final ConcurrentHashMap nativeBucketsForPositiveValues = + new ConcurrentHashMap<>(); + private final ConcurrentHashMap nativeBucketsForNegativeValues = + new ConcurrentHashMap<>(); + private final LongAdder nativeZeroCount = new LongAdder(); + private final LongAdder count = new LongAdder(); + private final DoubleAdder sum = new DoubleAdder(); + private volatile int nativeSchema = + nativeInitialSchema; // integer in [-4, 8] or CLASSIC_HISTOGRAM + private volatile double nativeZeroThreshold = Histogram.this.nativeMinZeroThreshold; + private volatile long createdTimeMillis = System.currentTimeMillis(); + private final Buffer buffer = new Buffer(); + private volatile boolean resetDurationExpired = false; + @Nullable private final ExemplarSampler exemplarSampler; + + private DataPoint() { + if (exemplarSamplerConfig != null) { + exemplarSampler = new ExemplarSampler(exemplarSamplerConfig); + } else { + exemplarSampler = null; + } + classicBuckets = new LongAdder[classicUpperBounds.length]; + for (int i = 0; i < classicUpperBounds.length; i++) { + classicBuckets[i] = new LongAdder(); + } + maybeScheduleNextReset(); + } + + @Override + public double getSum() { + return sum.sum(); + } + + @Override + public long getCount() { + return count.sum(); + } + + @Override + public void observe(double value) { + if (Double.isNaN(value)) { + // See https://github.com/prometheus/client_golang/issues/1275 on ignoring NaN observations. + return; + } + if (!buffer.append(value)) { + doObserve(value, false); + } + if (exemplarSampler != null) { + exemplarSampler.observe(value); + } + } + + @Override + public void observeWithExemplar(double value, Labels labels) { + if (Double.isNaN(value)) { + // See https://github.com/prometheus/client_golang/issues/1275 on ignoring NaN observations. + return; + } + if (!buffer.append(value)) { + doObserve(value, false); + } + if (exemplarSampler != null) { + exemplarSampler.observeWithExemplar(value, labels); + } + } + + private void doObserve(double value, boolean fromBuffer) { + // classicUpperBounds is an empty array if this is a native histogram only. + for (int i = 0; i < classicUpperBounds.length; ++i) { + // The last bucket is +Inf, so we always increment. + if (value <= classicUpperBounds[i]) { + classicBuckets[i].add(1); + break; + } + } + boolean nativeBucketCreated = false; + if (Histogram.this.nativeInitialSchema != CLASSIC_HISTOGRAM) { + if (value > nativeZeroThreshold) { + nativeBucketCreated = addToNativeBucket(value, nativeBucketsForPositiveValues); + } else if (value < -nativeZeroThreshold) { + nativeBucketCreated = addToNativeBucket(-value, nativeBucketsForNegativeValues); + } else { + nativeZeroCount.add(1); + } + } + sum.add(value); + count + .increment(); // must be the last step, because count is used to signal that the operation + // is complete. + if (!fromBuffer) { + // maybeResetOrScaleDown will switch to the buffer, + // which won't work if we are currently still processing observations from the buffer. + // The reason is that before switching to the buffer we wait for all pending observations to + // be counted. + // If we do this while still applying observations from the buffer, the pending observations + // from + // the buffer will never be counted, and the buffer.run() method will wait forever. + maybeResetOrScaleDown(value, nativeBucketCreated); + } + } + + private HistogramSnapshot.HistogramDataPointSnapshot collect(Labels labels) { + Exemplars exemplars = exemplarSampler != null ? exemplarSampler.collect() : Exemplars.EMPTY; + return buffer.run( + expectedCount -> count.sum() == expectedCount, + () -> { + if (classicUpperBounds.length == 0) { + // native only + return new HistogramSnapshot.HistogramDataPointSnapshot( + nativeSchema, + nativeZeroCount.sum(), + nativeZeroThreshold, + toBucketList(nativeBucketsForPositiveValues), + toBucketList(nativeBucketsForNegativeValues), + sum.sum(), + labels, + exemplars, + createdTimeMillis); + } else if (Histogram.this.nativeInitialSchema == CLASSIC_HISTOGRAM) { + // classic only + return new HistogramSnapshot.HistogramDataPointSnapshot( + ClassicHistogramBuckets.of(classicUpperBounds, classicBuckets), + sum.sum(), + labels, + exemplars, + createdTimeMillis); + } else { + // hybrid: classic and native + return new HistogramSnapshot.HistogramDataPointSnapshot( + ClassicHistogramBuckets.of(classicUpperBounds, classicBuckets), + nativeSchema, + nativeZeroCount.sum(), + nativeZeroThreshold, + toBucketList(nativeBucketsForPositiveValues), + toBucketList(nativeBucketsForNegativeValues), + sum.sum(), + labels, + exemplars, + createdTimeMillis); + } + }, + v -> doObserve(v, true)); + } + + private boolean addToNativeBucket(double value, ConcurrentHashMap buckets) { + boolean newBucketCreated = false; + int bucketIndex; + if (Double.isInfinite(value)) { + bucketIndex = findBucketIndex(Double.MAX_VALUE) + 1; + } else { + bucketIndex = findBucketIndex(value); + } + LongAdder bucketCount = buckets.get(bucketIndex); + if (bucketCount == null) { + LongAdder newBucketCount = new LongAdder(); + LongAdder existingBucketCount = buckets.putIfAbsent(bucketIndex, newBucketCount); + if (existingBucketCount == null) { + newBucketCreated = true; + bucketCount = newBucketCount; + } else { + bucketCount = existingBucketCount; + } + } + bucketCount.increment(); + return newBucketCreated; + } + + private int findBucketIndex(double value) { + // Preconditions: + // Double.isNan(value) is false; + // Double.isInfinite(value) is false; + // value > 0 + // --- + // The following is a naive implementation of C's frexp() function. + // Performance can be improved by using the internal Bit representation of floating point + // numbers. + // More info on the Bit representation of floating point numbers: + // https://stackoverflow.com/questions/8341395/what-is-a-subnormal-floating-point-number + // Result: value == frac * 2^exp where frac in [0.5, 1). + double frac = value; + int exp = 0; + while (frac < 0.5) { + frac *= 2.0; + exp--; + } + while (frac >= 1.0) { + frac /= 2.0; + exp++; + } + // end of frexp() + + if (nativeSchema >= 1) { + return findIndex(NATIVE_BOUNDS[nativeSchema - 1], frac) + + (exp - 1) * NATIVE_BOUNDS[nativeSchema - 1].length; + } else { + int bucketIndex = exp; + if (frac == 0.5) { + bucketIndex--; + } + int offset = (1 << -nativeSchema) - 1; + bucketIndex = (bucketIndex + offset) >> -nativeSchema; + return bucketIndex; + } + } + + private int findIndex(double[] bounds, double frac) { + // The following is the equivalent of golang's sort.SearchFloat64s(bounds, frac) + // See https://pkg.go.dev/sort#SearchFloat64s + int first = 0; + int last = bounds.length - 1; + while (first <= last) { + int mid = (first + last) / 2; + if (bounds[mid] == frac) { + return mid; + } else if (bounds[mid] < frac) { + first = mid + 1; + } else { + last = mid - 1; + } + } + return last + 1; + } + + /** + * Makes sure that the number of native buckets does not exceed nativeMaxBuckets. + * + *

      + *
    • If the histogram has already been scaled down (nativeSchema < initialSchema) reset + * after resetIntervalExpired to get back to the original schema. + *
    • If a new bucket was created and we now exceed nativeMaxBuckets run maybeScaleDown() to + * scale down + *
    + */ + private void maybeResetOrScaleDown(double value, boolean nativeBucketCreated) { + AtomicBoolean wasReset = new AtomicBoolean(false); + if (resetDurationExpired && nativeSchema < nativeInitialSchema) { + // If nativeSchema < initialNativeSchema the histogram has been scaled down. + // So if resetDurationExpired we will reset it to restore the original native schema. + buffer.run( + expectedCount -> count.sum() == expectedCount, + () -> { + if (maybeReset()) { + wasReset.set(true); + } + return null; + }, + v -> doObserve(v, true)); + } else if (nativeBucketCreated) { + // If a new bucket was created we need to check if nativeMaxBuckets is exceeded + // and scale down if so. + maybeScaleDown(wasReset); + } + if (wasReset.get()) { + // We just discarded the newly observed value. Observe it again. + if (!buffer.append(value)) { + doObserve(value, true); + } + } + } + + private void maybeScaleDown(AtomicBoolean wasReset) { + if (nativeMaxBuckets == 0 || nativeSchema == -4) { + return; + } + int numberOfBuckets = + nativeBucketsForPositiveValues.size() + nativeBucketsForNegativeValues.size(); + if (numberOfBuckets <= nativeMaxBuckets) { + return; + } + buffer.run( + expectedCount -> count.sum() == expectedCount, + () -> { + // Now we are in the synchronized block while new observations go into the buffer. + // Check again if we need to limit the bucket size, because another thread might + // have limited it in the meantime. + int numBuckets = + nativeBucketsForPositiveValues.size() + nativeBucketsForNegativeValues.size(); + if (numBuckets <= nativeMaxBuckets || nativeSchema == -4) { + return null; + } + if (maybeReset()) { + wasReset.set(true); + return null; + } + if (maybeWidenZeroBucket()) { + return null; + } + doubleBucketWidth(); + return null; + }, + v -> doObserve(v, true)); + } + + // maybeReset is called in the synchronized block while new observations go into the buffer. + private boolean maybeReset() { + if (!resetDurationExpired) { + return false; + } + resetDurationExpired = false; + buffer.reset(); + nativeBucketsForPositiveValues.clear(); + nativeBucketsForNegativeValues.clear(); + nativeZeroCount.reset(); + count.reset(); + sum.reset(); + for (LongAdder classicBucket : classicBuckets) { + classicBucket.reset(); + } + nativeZeroThreshold = nativeMinZeroThreshold; + nativeSchema = Histogram.this.nativeInitialSchema; + createdTimeMillis = System.currentTimeMillis(); + if (exemplarSampler != null) { + exemplarSampler.reset(); + } + maybeScheduleNextReset(); + return true; + } + + // maybeWidenZeroBucket is called in the synchronized block while new observations go into the + // buffer. + private boolean maybeWidenZeroBucket() { + if (nativeZeroThreshold >= nativeMaxZeroThreshold) { + return false; + } + int smallestIndex = findSmallestIndex(nativeBucketsForPositiveValues); + int smallestNegativeIndex = findSmallestIndex(nativeBucketsForNegativeValues); + if (smallestNegativeIndex < smallestIndex) { + smallestIndex = smallestNegativeIndex; + } + if (smallestIndex == Integer.MAX_VALUE) { + return false; + } + double newZeroThreshold = nativeBucketIndexToUpperBound(nativeSchema, smallestIndex); + if (newZeroThreshold > nativeMaxZeroThreshold) { + return false; + } + mergeWithZeroBucket(smallestIndex, nativeBucketsForPositiveValues); + mergeWithZeroBucket(smallestIndex, nativeBucketsForNegativeValues); + nativeZeroThreshold = newZeroThreshold; + return true; + } + + private void mergeWithZeroBucket(int index, Map buckets) { + LongAdder count = buckets.remove(index); + if (count != null) { + nativeZeroCount.add(count.sum()); + } + } + + private double nativeBucketIndexToUpperBound(int schema, int index) { + double result = calcUpperBound(schema, index); + if (Double.isInfinite(result)) { + // The last bucket boundary should always be MAX_VALUE, so that the +Inf bucket counts only + // actual +Inf observations. + // However, MAX_VALUE is not a natural bucket boundary, so we introduce MAX_VALUE + // as an artificial boundary before +Inf. + double previousBucketBoundary = calcUpperBound(schema, index - 1); + if (Double.isFinite(previousBucketBoundary) && previousBucketBoundary < Double.MAX_VALUE) { + return Double.MAX_VALUE; + } + } + return result; + } + + private double calcUpperBound(int schema, int index) { + // The actual formula is: + // --- + // base := 2^(2^-schema); + // upperBound := base^index; + // --- + // The following implementation reduces the numerical error for index > 0. + // It's not very efficient. We should refactor and use an algorithm as in client_golang's + // getLe() + double factor = 1.0; + while (index > 0) { + if (index % 2 == 0) { + index /= 2; + schema -= 1; + } else { + index -= 1; + factor *= Math.pow(2, Math.pow(2, -schema)); + } + } + return factor * Math.pow(2, index * Math.pow(2, -schema)); + } + + private int findSmallestIndex(Map nativeBuckets) { + int result = Integer.MAX_VALUE; + for (int key : nativeBuckets.keySet()) { + if (key < result) { + result = key; + } + } + return result; + } + + // doubleBucketWidth is called in the synchronized block while new observations go into the + // buffer. + @SuppressWarnings("NonAtomicVolatileUpdate") + private void doubleBucketWidth() { + doubleBucketWidth(nativeBucketsForPositiveValues); + doubleBucketWidth(nativeBucketsForNegativeValues); + nativeSchema--; + } + + private void doubleBucketWidth(Map buckets) { + int[] keys = new int[buckets.size()]; + long[] values = new long[keys.length]; + int i = 0; + for (Map.Entry entry : buckets.entrySet()) { + keys[i] = entry.getKey(); + values[i] = entry.getValue().sum(); + i++; + } + buckets.clear(); + for (i = 0; i < keys.length; i++) { + int index = (keys[i] + 1) / 2; + LongAdder count = buckets.computeIfAbsent(index, k -> new LongAdder()); + count.add(values[i]); + } + } + + private NativeHistogramBuckets toBucketList(ConcurrentHashMap map) { + int[] bucketIndexes = new int[map.size()]; + long[] counts = new long[map.size()]; + int i = 0; + for (Map.Entry entry : map.entrySet()) { + bucketIndexes[i] = entry.getKey(); + counts[i] = entry.getValue().sum(); + i++; + } + return NativeHistogramBuckets.of(bucketIndexes, counts); + } + + @SuppressWarnings("FutureReturnValueIgnored") + private void maybeScheduleNextReset() { + if (nativeResetDurationSeconds > 0) { + Scheduler.schedule( + () -> resetDurationExpired = true, nativeResetDurationSeconds, TimeUnit.SECONDS); + } + } + } + + @Override + public HistogramSnapshot collect() { + return (HistogramSnapshot) super.collect(); + } + + @Override + protected HistogramSnapshot collect(List labels, List metricData) { + List data = new ArrayList<>(labels.size()); + for (int i = 0; i < labels.size(); i++) { + data.add(metricData.get(i).collect(labels.get(i))); + } + return new HistogramSnapshot(getMetadata(), data); + } + + @Override + protected DataPoint newDataPoint() { + return new DataPoint(); + } + + static { + // See bounds in client_golang's histogram implementation. + NATIVE_BOUNDS = new double[8][]; + for (int schema = 1; schema <= 8; schema++) { + NATIVE_BOUNDS[schema - 1] = new double[1 << schema]; + NATIVE_BOUNDS[schema - 1][0] = 0.5; + // https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/metrics/v1/metrics.proto#L501 + double base = Math.pow(2, Math.pow(2, -schema)); + for (int i = 1; i < NATIVE_BOUNDS[schema - 1].length; i++) { + if (i % 2 == 0 && schema > 1) { + // Use previously calculated value for increased precision, see comment in client_golang's + // implementation. + NATIVE_BOUNDS[schema - 1][i] = NATIVE_BOUNDS[schema - 2][i / 2]; + } else { + NATIVE_BOUNDS[schema - 1][i] = NATIVE_BOUNDS[schema - 1][i - 1] * base; + } + } + } + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder extends StatefulMetric.Builder { + + @SuppressWarnings("MutablePublicArray") + public static final double[] DEFAULT_CLASSIC_UPPER_BOUNDS = + new double[] {.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10}; + + private static final double DEFAULT_NATIVE_MIN_ZERO_THRESHOLD = Math.pow(2.0, -128); + private static final double DEFAULT_NATIVE_MAX_ZERO_THRESHOLD = Math.pow(2.0, -128); + private static final int DEFAULT_NATIVE_INITIAL_SCHEMA = 5; + private static final int DEFAULT_NATIVE_MAX_NUMBER_OF_BUCKETS = 160; + private static final long DEFAULT_NATIVE_RESET_DURATION_SECONDS = 0; // 0 means no reset + + @Nullable private Boolean nativeOnly; + @Nullable private Boolean classicOnly; + @Nullable private double[] classicUpperBounds; + @Nullable private Integer nativeInitialSchema; + @Nullable private Double nativeMaxZeroThreshold; + @Nullable private Double nativeMinZeroThreshold; + @Nullable private Integer nativeMaxNumberOfBuckets; + @Nullable private Long nativeResetDurationSeconds; + + @Override + public Histogram build() { + return new Histogram(this, properties); + } + + @Override + protected MetricsProperties toProperties() { + MetricsProperties.Builder builder = MetricsProperties.builder(); + if (classicUpperBounds != null) { + builder.histogramClassicUpperBounds(classicUpperBounds); + } + return builder + .exemplarsEnabled(exemplarsEnabled) + .histogramNativeOnly(nativeOnly) + .histogramClassicOnly(classicOnly) + .histogramNativeInitialSchema(nativeInitialSchema) + .histogramNativeMinZeroThreshold(nativeMinZeroThreshold) + .histogramNativeMaxZeroThreshold(nativeMaxZeroThreshold) + .histogramNativeMaxNumberOfBuckets(nativeMaxNumberOfBuckets) + .histogramNativeResetDurationSeconds(nativeResetDurationSeconds) + .build(); + } + + /** Default properties for histogram metrics. */ + @Override + public MetricsProperties getDefaultProperties() { + return MetricsProperties.builder() + .exemplarsEnabled(true) + .histogramNativeOnly(false) + .histogramClassicOnly(false) + .histogramClassicUpperBounds(DEFAULT_CLASSIC_UPPER_BOUNDS) + .histogramNativeInitialSchema(DEFAULT_NATIVE_INITIAL_SCHEMA) + .histogramNativeMinZeroThreshold(DEFAULT_NATIVE_MIN_ZERO_THRESHOLD) + .histogramNativeMaxZeroThreshold(DEFAULT_NATIVE_MAX_ZERO_THRESHOLD) + .histogramNativeMaxNumberOfBuckets(DEFAULT_NATIVE_MAX_NUMBER_OF_BUCKETS) + .histogramNativeResetDurationSeconds(DEFAULT_NATIVE_RESET_DURATION_SECONDS) + .build(); + } + + private Builder(PrometheusProperties config) { + super(Collections.singletonList("le"), config); + } + + /** + * Use the native histogram representation only, i.e. don't maintain classic histogram buckets. + * See {@link Histogram} for more info. + */ + public Builder nativeOnly() { + if (Boolean.TRUE.equals(classicOnly)) { + throw new IllegalArgumentException("Cannot call nativeOnly() after calling classicOnly()."); + } + nativeOnly = true; + return this; + } + + /** + * Use the classic histogram representation only, i.e. don't maintain native histogram buckets. + * See {@link Histogram} for more info. + */ + public Builder classicOnly() { + if (Boolean.TRUE.equals(nativeOnly)) { + throw new IllegalArgumentException("Cannot call classicOnly() after calling nativeOnly()."); + } + classicOnly = true; + return this; + } + + /** + * Set the upper bounds for the classic histogram buckets. Default is {@link + * Builder#DEFAULT_CLASSIC_UPPER_BOUNDS}. If the +Inf bucket is missing it will be added. If + * upperBounds contains duplicates the duplicates will be removed. + */ + public Builder classicUpperBounds(double... upperBounds) { + this.classicUpperBounds = upperBounds; + for (double bound : upperBounds) { + if (Double.isNaN(bound)) { + throw new IllegalArgumentException("Cannot use NaN as upper bound for a histogram"); + } + } + return this; + } + + /** + * Create classic histogram buckets with linear bucket boundaries. + * + *

    Example: {@code classicLinearUpperBounds(1.0, 0.5, 10)} creates bucket boundaries {@code + * [[1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5]}. + * + * @param start is the first bucket boundary + * @param width is the width of each bucket + * @param count is the total number of buckets, including start + */ + public Builder classicLinearUpperBounds(double start, double width, int count) { + this.classicUpperBounds = new double[count]; + // Use BigDecimal to avoid weird bucket boundaries like 0.7000000000000001. + BigDecimal s = new BigDecimal(Double.toString(start)); + BigDecimal w = new BigDecimal(Double.toString(width)); + for (int i = 0; i < count; i++) { + classicUpperBounds[i] = s.add(w.multiply(new BigDecimal(i))).doubleValue(); + } + return this; + } + + /** + * Create classic histogram buckets with exponential boundaries. + * + *

    Example: {@code classicExponentialUpperBounds(1.0, 2.0, 10)} creates bucket boundaries + * {@code [1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 256.0, 512.0]} + * + * @param start is the first bucket boundary + * @param factor growth factor + * @param count total number of buckets, including start + */ + public Builder classicExponentialUpperBounds(double start, double factor, int count) { + classicUpperBounds = new double[count]; + for (int i = 0; i < count; i++) { + classicUpperBounds[i] = start * Math.pow(factor, i); + } + return this; + } + + /** + * The schema is a number in [-4, 8] defining the resolution of the native histogram. Default is + * {@link Builder#DEFAULT_NATIVE_INITIAL_SCHEMA}. + * + *

    The higher the schema, the finer the resolution. Schema is Prometheus terminology. In + * OpenTelemetry it's called "scale". + * + *

    Note that the schema for a histogram may be automatically decreased at runtime if the + * number of native histogram buckets exceeds {@link #nativeMaxNumberOfBuckets(int)}. + * + *

    The following table shows: + * + *

      + *
    • factor: The growth factor for bucket boundaries, i.e. next bucket boundary = growth + * factor * previous bucket boundary. + *
    • max quantile error: The maximum error for quantiles calculated using the Prometheus + * histogram_quantile() function, relative to the observed value, assuming harmonic mean. + *
    + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    max quantile errors for different growth factors
    schemafactormax quantile error
    -465.53699%
    -325699%
    -21688%
    -1460%
    0233%
    11.4142...17%
    21.1892...9%
    31.1090...4%
    41.0442...2%
    51.0218...1%
    61.0108...0.5%
    71.0054...0.3%
    81.0027...0.1%
    + */ + public Builder nativeInitialSchema(int nativeSchema) { + if (nativeSchema < -4 || nativeSchema > 8) { + throw new IllegalArgumentException( + "Unsupported native histogram schema " + + nativeSchema + + ": expecting -4 <= schema <= 8."); + } + this.nativeInitialSchema = nativeSchema; + return this; + } + + /** + * Native histogram buckets get smaller and smaller the closer they get to zero. To avoid + * wasting a lot of buckets for observations fluctuating around zero, we consider all values in + * [-zeroThreshold, +zeroThreshold] to be equal to zero. + * + *

    The zeroThreshold is initialized with minZeroThreshold, and will grow up to + * maxZeroThreshold if the number of native histogram buckets exceeds nativeMaxBuckets. + * + *

    Default is {@link Builder#DEFAULT_NATIVE_MAX_NUMBER_OF_BUCKETS}. + */ + public Builder nativeMaxZeroThreshold(double nativeMaxZeroThreshold) { + if (nativeMaxZeroThreshold < 0) { + throw new IllegalArgumentException( + "Illegal native max zero threshold " + nativeMaxZeroThreshold + ": must be >= 0"); + } + this.nativeMaxZeroThreshold = nativeMaxZeroThreshold; + return this; + } + + /** + * Native histogram buckets get smaller and smaller the closer they get to zero. To avoid + * wasting a lot of buckets for observations fluctuating around zero, we consider all values in + * [-zeroThreshold, +zeroThreshold] to be equal to zero. + * + *

    The zeroThreshold is initialized with minZeroThreshold, and will grow up to + * maxZeroThreshold if the number of native histogram buckets exceeds nativeMaxBuckets. + * + *

    Default is {@link Builder#DEFAULT_NATIVE_MIN_ZERO_THRESHOLD}. + */ + public Builder nativeMinZeroThreshold(double nativeMinZeroThreshold) { + if (nativeMinZeroThreshold < 0) { + throw new IllegalArgumentException( + "Illegal native min zero threshold " + nativeMinZeroThreshold + ": must be >= 0"); + } + this.nativeMinZeroThreshold = nativeMinZeroThreshold; + return this; + } + + /** + * Limit the number of native buckets. + * + *

    If the number of native buckets exceeds the maximum, the {@link #nativeInitialSchema(int)} + * is decreased, i.e. the resolution of the histogram is decreased to reduce the number of + * buckets. + * + *

    Default is {@link Builder#DEFAULT_NATIVE_MAX_NUMBER_OF_BUCKETS}. + */ + public Builder nativeMaxNumberOfBuckets(int nativeMaxBuckets) { + this.nativeMaxNumberOfBuckets = nativeMaxBuckets; + return this; + } + + /** + * If the histogram needed to be scaled down because {@link #nativeMaxNumberOfBuckets(int)} was + * exceeded, reset the histogram after a certain time interval to go back to the original {@link + * #nativeInitialSchema(int)}. + * + *

    Reset means all values are set to zero. A good value might be 24h or 7d. + * + *

    Default is no reset. + */ + public Builder nativeResetDuration(long duration, TimeUnit unit) { + // TODO: reset interval isn't tested yet + if (duration <= 0) { + throw new IllegalArgumentException(duration + ": value > 0 expected"); + } + nativeResetDurationSeconds = unit.toSeconds(duration); + return this; + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Info.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Info.java new file mode 100644 index 000000000..d7aa6be70 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Info.java @@ -0,0 +1,172 @@ +package io.prometheus.metrics.core.metrics; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.model.snapshots.InfoSnapshot; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.Unit; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Set; +import java.util.concurrent.CopyOnWriteArraySet; +import javax.annotation.Nullable; + +/** + * Info metric. Example: + * + *

    {@code
    + * Info info = Info.builder()
    + *         .name("java_runtime_info")
    + *         .help("Java runtime info")
    + *         .labelNames("env", "version", "vendor", "runtime")
    + *         .register();
    + *
    + * String version = System.getProperty("java.runtime.version", "unknown");
    + * String vendor = System.getProperty("java.vm.vendor", "unknown");
    + * String runtime = System.getProperty("java.runtime.name", "unknown");
    + *
    + * info.addLabelValues("prod", version, vendor, runtime);
    + * info.addLabelValues("dev", version, vendor, runtime);
    + * }
    + */ +public class Info extends MetricWithFixedMetadata { + + private final Set labels = new CopyOnWriteArraySet<>(); + + private Info(Builder builder) { + super(builder); + } + + /** + * Set the info label values. This will replace any previous values, i.e. the info metric will + * only have one data point after calling setLabelValues(). This is good for a metric like {@code + * target_info} where you want only one single data point. + */ + public void setLabelValues(String... labelValues) { + if (labelValues.length != labelNames.length) { + throw new IllegalArgumentException( + getClass().getSimpleName() + + " " + + getMetadata().getName() + + " was created with " + + labelNames.length + + " label names, but you called setLabelValues() with " + + labelValues.length + + " label values."); + } + Labels newLabels = Labels.of(labelNames, labelValues); + labels.add(newLabels); + labels.retainAll(Collections.singletonList(newLabels)); + } + + /** Create an info data point with the given label values. */ + public void addLabelValues(String... labelValues) { + if (labelValues.length != labelNames.length) { + throw new IllegalArgumentException( + getClass().getSimpleName() + + " " + + getMetadata().getName() + + " was created with " + + labelNames.length + + " label names, but you called addLabelValues() with " + + labelValues.length + + " label values."); + } + labels.add(Labels.of(labelNames, labelValues)); + } + + /** Remove the data point with the specified label values. */ + public void remove(String... labelValues) { + if (labelValues.length != labelNames.length) { + throw new IllegalArgumentException( + getClass().getSimpleName() + + " " + + getMetadata().getName() + + " was created with " + + labelNames.length + + " label names, but you called remove() with " + + labelValues.length + + " label values."); + } + Labels toBeRemoved = Labels.of(labelNames, labelValues); + labels.remove(toBeRemoved); + } + + @Override + public InfoSnapshot collect() { + List data = new ArrayList<>(labels.size()); + if (labelNames.length == 0) { + data.add(new InfoSnapshot.InfoDataPointSnapshot(constLabels)); + } else { + for (Labels label : labels) { + data.add(new InfoSnapshot.InfoDataPointSnapshot(label.merge(constLabels))); + } + } + return new InfoSnapshot(getMetadata(), data); + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder extends MetricWithFixedMetadata.Builder { + + private Builder(PrometheusProperties config) { + super(Collections.emptyList(), config); + } + + /** + * The {@code _info} suffix will automatically be appended if it's missing. + * + *
    {@code
    +     * Info info1 = Info.builder()
    +     *     .name("runtime_info")
    +     *     .build();
    +     * Info info2 = Info.builder()
    +     *     .name("runtime")
    +     *     .build();
    +     * }
    + * + * In the example above both {@code info1} and {@code info2} will be named {@code + * "runtime_info"} in Prometheus. + * + *

    Throws an {@link IllegalArgumentException} if {@link + * io.prometheus.metrics.model.snapshots.PrometheusNaming#isValidMetricName(String) + * MetricMetadata.isValidMetricName(name)} is {@code false}. + */ + @Override + public Builder name(String name) { + return super.name(stripInfoSuffix(name)); + } + + /** Throws an {@link UnsupportedOperationException} because Info metrics cannot have a unit. */ + @Override + public Builder unit(@Nullable Unit unit) { + if (unit != null) { + throw new UnsupportedOperationException("Info metrics cannot have a unit."); + } + return this; + } + + private static String stripInfoSuffix(String name) { + if (name != null && (name.endsWith("_info") || name.endsWith(".info"))) { + name = name.substring(0, name.length() - 5); + } + return name; + } + + @Override + public Info build() { + return new Info(this); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Metric.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Metric.java new file mode 100644 index 000000000..d3c00eca0 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Metric.java @@ -0,0 +1,66 @@ +package io.prometheus.metrics.core.metrics; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.model.registry.Collector; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Label; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import java.util.ArrayList; +import java.util.List; + +/** Common base class for all metrics. */ +public abstract class Metric implements Collector { + + protected final Labels constLabels; + + protected Metric(Builder builder) { + this.constLabels = builder.constLabels; + } + + @Override + public abstract MetricSnapshot collect(); + + protected abstract static class Builder, M extends Metric> { + + protected final List illegalLabelNames; + protected final PrometheusProperties properties; + protected Labels constLabels = Labels.EMPTY; + + protected Builder(List illegalLabelNames, PrometheusProperties properties) { + this.illegalLabelNames = new ArrayList<>(illegalLabelNames); + this.properties = properties; + } + + // ConstLabels are only used rarely. In particular, do not use them to + // attach the same labels to all your metrics. Those use cases are + // better covered by target labels set by the scraping Prometheus + // server, or by one specific metric (e.g. a build_info or a + // machine_role metric). See also + // https://prometheus.io/docs/instrumenting/writing_exporters/#target-labels-not-static-scraped-labels + public B constLabels(Labels constLabels) { + for (Label label : constLabels) { // NPE if constLabels is null + if (illegalLabelNames.contains(label.getName())) { + throw new IllegalArgumentException( + label.getName() + ": illegal label name for this metric type"); + } + } + this.constLabels = constLabels; + return self(); + } + + public M register() { + return register(PrometheusRegistry.defaultRegistry); + } + + public M register(PrometheusRegistry registry) { + M metric = build(); + registry.register(metric); + return metric; + } + + public abstract M build(); + + protected abstract B self(); + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/MetricWithFixedMetadata.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/MetricWithFixedMetadata.java new file mode 100644 index 000000000..6f6afa482 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/MetricWithFixedMetadata.java @@ -0,0 +1,115 @@ +package io.prometheus.metrics.core.metrics; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.MetricMetadata; +import io.prometheus.metrics.model.snapshots.PrometheusNaming; +import io.prometheus.metrics.model.snapshots.Unit; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Nullable; + +/** + * Almost all metrics have fixed metadata, i.e. the metric name is known when the metric is created. + * + *

    An exception would be a metric that is a bridge to a 3rd party metric library, where the + * metric name has to be retrieved from the 3rd party metric library at scrape time. + */ +public abstract class MetricWithFixedMetadata extends Metric { + + private final MetricMetadata metadata; + protected final String[] labelNames; + + protected MetricWithFixedMetadata(Builder builder) { + super(builder); + this.metadata = + new MetricMetadata(makeName(builder.name, builder.unit), builder.help, builder.unit); + this.labelNames = Arrays.copyOf(builder.labelNames, builder.labelNames.length); + } + + protected MetricMetadata getMetadata() { + return metadata; + } + + private String makeName(@Nullable String name, @Nullable Unit unit) { + if (name == null) { + throw new IllegalArgumentException("Missing required field: name is null"); + } + if (unit != null) { + if (!name.endsWith("_" + unit) && !name.endsWith("." + unit)) { + name += "_" + unit; + } + } + return name; + } + + @Override + public String getPrometheusName() { + return metadata.getPrometheusName(); + } + + public abstract static class Builder, M extends MetricWithFixedMetadata> + extends Metric.Builder { + + @Nullable private String name; + @Nullable private Unit unit; + @Nullable private String help; + private String[] labelNames = new String[0]; + + protected Builder(List illegalLabelNames, PrometheusProperties properties) { + super(illegalLabelNames, properties); + } + + public B name(String name) { + String error = PrometheusNaming.validateMetricName(name); + if (error != null) { + throw new IllegalArgumentException("'" + name + "': Illegal metric name: " + error); + } + this.name = name; + return self(); + } + + public B unit(@Nullable Unit unit) { + this.unit = unit; + return self(); + } + + public B help(String help) { + this.help = help; + return self(); + } + + public B labelNames(String... labelNames) { + for (String labelName : labelNames) { + if (!PrometheusNaming.isValidLabelName(labelName)) { + throw new IllegalArgumentException(labelName + ": illegal label name"); + } + if (illegalLabelNames.contains(labelName)) { + throw new IllegalArgumentException( + labelName + ": illegal label name for this metric type"); + } + if (constLabels.contains(labelName)) { + throw new IllegalArgumentException(labelName + ": duplicate label name"); + } + } + this.labelNames = labelNames; + return self(); + } + + @Override + public B constLabels(Labels constLabels) { + for (String labelName : labelNames) { + if (constLabels.contains(labelName)) { // Labels.contains() treats dots like underscores + throw new IllegalArgumentException(labelName + ": duplicate label name"); + } + } + return super.constLabels(constLabels); + } + + @Override + public abstract M build(); + + @Override + protected abstract B self(); + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/SlidingWindow.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/SlidingWindow.java new file mode 100644 index 000000000..5360e3349 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/SlidingWindow.java @@ -0,0 +1,97 @@ +package io.prometheus.metrics.core.metrics; + +import java.lang.reflect.Array; +import java.util.concurrent.TimeUnit; +import java.util.function.LongSupplier; +import java.util.function.ObjDoubleConsumer; +import java.util.function.Supplier; + +/** + * Maintains a ring buffer of T to implement a sliding time window. + * + *

    This is used to maintain a sliding window of {@link CKMSQuantiles} for {@link Summary} + * metrics. + * + *

    It is implemented in a generic way so that 3rd party libraries can use it for implementing + * sliding windows. + * + *

    TODO: The current implementation is {@code synchronized}. There is likely room for + * optimization. + */ +public class SlidingWindow { + + private final Supplier constructor; + private final ObjDoubleConsumer observeFunction; + private final T[] ringBuffer; + private int currentBucket; + private long lastRotateTimestampMillis; + private final long durationBetweenRotatesMillis; + private final LongSupplier currentTimeMillis; + + /** + * Example: If the {@code maxAgeSeconds} is 60 and {@code ageBuckets} is 3, then 3 instances of + * {@code T} are maintained and the sliding window moves to the next instance of T every 20 + * seconds. + * + * @param clazz type of T + * @param constructor for creating a new instance of T as the old one gets evicted + * @param observeFunction for observing a value (e.g. calling {@code t.observe(value)} + * @param maxAgeSeconds after this amount of time an instance of T gets evicted. + * @param ageBuckets number of age buckets. + */ + public SlidingWindow( + Class clazz, + Supplier constructor, + ObjDoubleConsumer observeFunction, + long maxAgeSeconds, + int ageBuckets) { + this(clazz, constructor, observeFunction, maxAgeSeconds, ageBuckets, System::currentTimeMillis); + } + + // VisibleForTesting + @SuppressWarnings("unchecked") + SlidingWindow( + Class clazz, + Supplier constructor, + ObjDoubleConsumer observeFunction, + long maxAgeSeconds, + int ageBuckets, + LongSupplier currentTimeMillis) { + this.constructor = constructor; + this.observeFunction = observeFunction; + this.ringBuffer = (T[]) Array.newInstance(clazz, ageBuckets); + for (int i = 0; i < ringBuffer.length; i++) { + this.ringBuffer[i] = constructor.get(); + } + this.currentBucket = 0; + this.lastRotateTimestampMillis = currentTimeMillis.getAsLong(); + this.durationBetweenRotatesMillis = TimeUnit.SECONDS.toMillis(maxAgeSeconds) / ageBuckets; + this.currentTimeMillis = currentTimeMillis; + } + + /** Get the currently active instance of {@code T}. */ + public synchronized T current() { + return rotate(); + } + + /** Observe a value. */ + public synchronized void observe(double value) { + rotate(); + for (T t : ringBuffer) { + observeFunction.accept(t, value); + } + } + + private T rotate() { + long timeSinceLastRotateMillis = currentTimeMillis.getAsLong() - lastRotateTimestampMillis; + while (timeSinceLastRotateMillis > durationBetweenRotatesMillis) { + ringBuffer[currentBucket] = constructor.get(); + if (++currentBucket >= ringBuffer.length) { + currentBucket = 0; + } + timeSinceLastRotateMillis -= durationBetweenRotatesMillis; + lastRotateTimestampMillis += durationBetweenRotatesMillis; + } + return ringBuffer[currentBucket]; + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/StateSet.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/StateSet.java new file mode 100644 index 000000000..4dbaf8ad5 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/StateSet.java @@ -0,0 +1,173 @@ +package io.prometheus.metrics.core.metrics; + +import static io.prometheus.metrics.model.snapshots.PrometheusNaming.prometheusName; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.datapoints.StateSetDataPoint; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.StateSetSnapshot; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; +import javax.annotation.Nullable; + +/** + * StateSet metric. Example: + * + *

    {@code
    + * public enum Feature {
    + *
    + *     FEATURE_1("feature1"),
    + *     FEATURE_2("feature2");
    + *
    + *     private final String name;
    + *
    + *     Feature(String name) {
    + *         this.name = name;
    + *     }
    + *
    + *     // Override
    + *     public String toString() {
    + *         return name;
    + *     }
    + * }
    + *
    + * public static void main(String[] args) {
    + *
    + *     StateSet stateSet = StateSet.builder()
    + *             .name("feature_flags")
    + *             .help("Feature flags")
    + *             .labelNames("env")
    + *             .states(Feature.class)
    + *             .register();
    + *
    + *     stateSet.labelValues("dev").setFalse(FEATURE_1);
    + *     stateSet.labelValues("dev").setTrue(FEATURE_2);
    + * }
    + * }
    + * + * The example above shows how to use a StateSet with an enum. You don't have to use enum, you can + * use regular strings as well. + */ +public class StateSet extends StatefulMetric + implements StateSetDataPoint { + + private final String[] names; + + private StateSet(Builder builder, String[] names) { + super(builder); + this.names = names; + for (String name : names) { + if (this.getMetadata().getPrometheusName().equals(prometheusName(name))) { + throw new IllegalArgumentException( + "Label name " + + name + + " is illegal (can't use the metric name as label name in state set metrics)"); + } + } + } + + @Override + public StateSetSnapshot collect() { + return (StateSetSnapshot) super.collect(); + } + + @Override + protected StateSetSnapshot collect(List labels, List metricDataList) { + List data = new ArrayList<>(labels.size()); + for (int i = 0; i < labels.size(); i++) { + data.add( + new StateSetSnapshot.StateSetDataPointSnapshot( + names, metricDataList.get(i).values, labels.get(i))); + } + return new StateSetSnapshot(getMetadata(), data); + } + + @Override + public void setTrue(String state) { + getNoLabels().setTrue(state); + } + + @Override + public void setFalse(String state) { + getNoLabels().setFalse(state); + } + + @Override + protected DataPoint newDataPoint() { + return new DataPoint(); + } + + class DataPoint implements StateSetDataPoint { + + private final boolean[] values = new boolean[names.length]; + + private DataPoint() {} + + @Override + public void setTrue(String state) { + set(state, true); + } + + @Override + public void setFalse(String state) { + set(state, false); + } + + private void set(String name, boolean value) { + for (int i = 0; i < names.length; i++) { + if (names[i].equals(name)) { + values[i] = value; + return; + } + } + throw new IllegalArgumentException(name + ": unknown state"); + } + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder extends StatefulMetric.Builder { + + @Nullable private String[] names; + + private Builder(PrometheusProperties config) { + super(Collections.emptyList(), config); + } + + /** Declare the states that should be represented by this StateSet. */ + public Builder states(Class> enumClass) { + return states( + Stream.of(enumClass.getEnumConstants()).map(Enum::toString).toArray(String[]::new)); + } + + /** Declare the states that should be represented by this StateSet. */ + public Builder states(String... stateNames) { + if (stateNames.length == 0) { + throw new IllegalArgumentException("states cannot be empty"); + } + this.names = Stream.of(stateNames).distinct().sorted().toArray(String[]::new); + return this; + } + + @Override + public StateSet build() { + if (names == null) { + throw new IllegalStateException("State names are required when building a StateSet."); + } + return new StateSet(this, names); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/StatefulMetric.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/StatefulMetric.java new file mode 100644 index 000000000..386e92292 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/StatefulMetric.java @@ -0,0 +1,228 @@ +package io.prometheus.metrics.core.metrics; + +import io.prometheus.metrics.config.MetricsProperties; +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.datapoints.DataPoint; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; +import javax.annotation.Nullable; + +/** + * There are two kinds of metrics: + * + *
      + *
    • A {@code StatefulMetric} actively maintains its current values, e.g. a stateful counter + * actively stores its current count. + *
    • A {@code CallbackMetric} gets its values on demand when it is collected, e.g. a callback + * gauge representing the current heap size. + *
    + * + * The OpenTelemetry terminology for stateful is synchronous and the OpenTelemetry + * terminology for callback is asynchronous. We are using our own terminology here + * because in Java synchronous and asynchronous usually refers to multi-threading, but + * this has nothing to do with multi-threading. + */ +public abstract class StatefulMetric + extends MetricWithFixedMetadata { + + /** Map label values to data points. */ + private final ConcurrentHashMap, T> data = new ConcurrentHashMap<>(); + + /** Shortcut for data.get(Collections.emptyList()) */ + @Nullable private volatile T noLabels; + + protected StatefulMetric(Builder builder) { + super(builder); + } + + /** + * labels and metricData have the same size. labels.get(i) are the labels for metricData.get(i). + */ + protected abstract MetricSnapshot collect(List labels, List metricData); + + @Override + public MetricSnapshot collect() { + if (labelNames.length == 0 && data.isEmpty()) { + // This is a metric without labels that has not been used yet. Initialize the data on the fly. + labelValues(); + } + List labels = new ArrayList<>(data.size()); + List metricData = new ArrayList<>(data.size()); + for (Map.Entry, T> entry : data.entrySet()) { + String[] labelValues = entry.getKey().toArray(new String[labelNames.length]); + labels.add(constLabels.merge(labelNames, labelValues)); + metricData.add(entry.getValue()); + } + return collect(labels, metricData); + } + + /** + * Initialize label values. + * + *

    Example: Imagine you have a counter for payments as follows + * + *

    +   * payment_transactions_total{payment_type="credit card"} 7.0
    +   * payment_transactions_total{payment_type="paypal"} 3.0
    +   * 
    + * + * Now, the data points for the {@code payment_type} label values get initialized when they are + * first used, i.e. the first time you call + * + *
    {@code
    +   * counter.labelValues("paypal").inc();
    +   * }
    + * + * the data point with label {@code payment_type="paypal"} will go from non-existent to having + * value {@code 1.0}. + * + *

    In some cases this is confusing, and you want to have data points initialized on application + * start with an initial value of {@code 0.0}: + * + *

    +   * payment_transactions_total{payment_type="credit card"} 0.0
    +   * payment_transactions_total{payment_type="paypal"} 0.0
    +   * 
    + * + * {@code initLabelValues(...)} can be used to initialize label value, so that the data points + * show up in the exposition format with an initial value of zero. + */ + public void initLabelValues(String... labelValues) { + labelValues(labelValues); + } + + public D labelValues(String... labelValues) { + if (labelValues.length != labelNames.length) { + if (labelValues.length == 0) { + throw new IllegalArgumentException( + getClass().getSimpleName() + + " " + + getMetadata().getName() + + " was created with label names, so you must call labelValues(...)" + + " when using it."); + } else { + throw new IllegalArgumentException( + "Expected " + labelNames.length + " label values, but got " + labelValues.length + "."); + } + } + return data.computeIfAbsent( + Arrays.asList(labelValues), + l -> { + for (int i = 0; i < l.size(); i++) { + if (l.get(i) == null) { + throw new IllegalArgumentException( + "null label value for metric " + + getMetadata().getName() + + " and label " + + labelNames[i]); + } + } + return newDataPoint(); + }); + } + + /** + * Remove the data point with the given label values. See https://prometheus.io/docs/instrumenting/writing_clientlibs/#labels. + */ + public void remove(String... labelValues) { + data.remove(Arrays.asList(labelValues)); + } + + /** Remove the data points when the given function. */ + public void removeIf(Function, Boolean> f) { + data.entrySet().removeIf(entry -> f.apply(Collections.unmodifiableList(entry.getKey()))); + } + + /** Reset the metric (remove all data points). */ + public void clear() { + data.clear(); + noLabels = null; + } + + protected abstract T newDataPoint(); + + @SuppressWarnings("unchecked") + protected T getNoLabels() { + if (noLabels == null) { + // Note that this will throw an IllegalArgumentException if labelNames is not empty. + noLabels = (T) labelValues(); + } + return noLabels; + } + + /** + * Metric properties in effect by order of precedence with the highest precedence first. If a + * {@code MetricProperties} is configured for the metric name it has higher precedence than the + * builder configuration. A special case is the setting {@link Builder#withoutExemplars()} via the + * builder, which cannot be overridden by any configuration. + */ + protected MetricsProperties[] getMetricProperties( + Builder builder, PrometheusProperties prometheusProperties) { + List properties = new ArrayList<>(); + if (Objects.equals(builder.exemplarsEnabled, false)) { + properties.add(MetricsProperties.builder().exemplarsEnabled(false).build()); + } + String metricName = getMetadata().getName(); + if (prometheusProperties.getMetricProperties(metricName) != null) { + properties.add(prometheusProperties.getMetricProperties(metricName)); + } + properties.add(builder.toProperties()); + properties.add(prometheusProperties.getDefaultMetricProperties()); + properties.add(builder.getDefaultProperties()); // fallback + return properties.toArray(new MetricsProperties[0]); + } + + protected

    P getConfigProperty( + MetricsProperties[] properties, Function getter) { + P result; + for (MetricsProperties props : properties) { + result = getter.apply(props); + if (result != null) { + return result; + } + } + throw new IllegalStateException( + "Missing default config. This is a bug in the Prometheus metrics core library."); + } + + abstract static class Builder, M extends StatefulMetric> + extends MetricWithFixedMetadata.Builder { + + @Nullable protected Boolean exemplarsEnabled; + + protected Builder(List illegalLabelNames, PrometheusProperties config) { + super(illegalLabelNames, config); + } + + /** Allow Exemplars for this metric. */ + public B withExemplars() { + this.exemplarsEnabled = true; + return self(); + } + + /** Turn off Exemplars for this metric. */ + public B withoutExemplars() { + this.exemplarsEnabled = false; + return self(); + } + + /** Override if there are more properties than just exemplars enabled. */ + protected MetricsProperties toProperties() { + return MetricsProperties.builder().exemplarsEnabled(exemplarsEnabled).build(); + } + + /** Override if there are more properties than just exemplars enabled. */ + public MetricsProperties getDefaultProperties() { + return MetricsProperties.builder().exemplarsEnabled(true).build(); + } + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Summary.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Summary.java new file mode 100644 index 000000000..7d964dbb6 --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Summary.java @@ -0,0 +1,387 @@ +package io.prometheus.metrics.core.metrics; + +import static java.util.Objects.requireNonNull; + +import io.prometheus.metrics.config.MetricsProperties; +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.datapoints.DistributionDataPoint; +import io.prometheus.metrics.core.exemplars.ExemplarSampler; +import io.prometheus.metrics.core.exemplars.ExemplarSamplerConfig; +import io.prometheus.metrics.model.snapshots.Exemplars; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.Quantile; +import io.prometheus.metrics.model.snapshots.Quantiles; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.DoubleAdder; +import java.util.concurrent.atomic.LongAdder; +import javax.annotation.Nullable; + +/** + * Summary metric. Example: + * + *

    {@code
    + * Summary summary = Summary.builder()
    + *         .name("http_request_duration_seconds_hi")
    + *         .help("HTTP request service time in seconds")
    + *         .unit(SECONDS)
    + *         .labelNames("method", "path", "status_code")
    + *         .quantile(0.5, 0.01)
    + *         .quantile(0.95, 0.001)
    + *         .quantile(0.99, 0.001)
    + *         .register();
    + *
    + * long start = System.nanoTime();
    + * // process a request, duration will be observed
    + * summary.labelValues("GET", "/", "200").observe(Unit.nanosToSeconds(System.nanoTime() - start));
    + * }
    + * + * See {@link Summary.Builder} for configuration options. + */ +public class Summary extends StatefulMetric + implements DistributionDataPoint { + + private final List quantiles; // May be empty, but cannot be null. + + private final long maxAgeSeconds; + private final int ageBuckets; + @Nullable private final ExemplarSamplerConfig exemplarSamplerConfig; + + private Summary(Builder builder, PrometheusProperties prometheusProperties) { + super(builder); + MetricsProperties[] properties = getMetricProperties(builder, prometheusProperties); + quantiles = Collections.unmodifiableList(makeQuantiles(properties)); + maxAgeSeconds = getConfigProperty(properties, MetricsProperties::getSummaryMaxAgeSeconds); + ageBuckets = getConfigProperty(properties, MetricsProperties::getSummaryNumberOfAgeBuckets); + boolean exemplarsEnabled = + getConfigProperty(properties, MetricsProperties::getExemplarsEnabled); + if (exemplarsEnabled) { + exemplarSamplerConfig = + new ExemplarSamplerConfig(prometheusProperties.getExemplarProperties(), 4); + } else { + exemplarSamplerConfig = null; + } + } + + private List makeQuantiles(MetricsProperties[] properties) { + List result = new ArrayList<>(); + List quantiles = getConfigProperty(properties, MetricsProperties::getSummaryQuantiles); + List quantileErrors = + getConfigProperty(properties, MetricsProperties::getSummaryQuantileErrors); + if (quantiles != null) { + for (int i = 0; i < quantiles.size(); i++) { + if (quantileErrors.size() > 0) { + result.add(new CKMSQuantiles.Quantile(quantiles.get(i), quantileErrors.get(i))); + } else { + result.add( + new CKMSQuantiles.Quantile(quantiles.get(i), Builder.defaultError(quantiles.get(i)))); + } + } + } + return result; + } + + @Override + public double getSum() { + return getNoLabels().getSum(); + } + + @Override + public long getCount() { + return getNoLabels().getCount(); + } + + @Override + public void observe(double amount) { + getNoLabels().observe(amount); + } + + @Override + public void observeWithExemplar(double amount, Labels labels) { + getNoLabels().observeWithExemplar(amount, labels); + } + + @Override + public SummarySnapshot collect() { + return (SummarySnapshot) super.collect(); + } + + @Override + protected SummarySnapshot collect(List labels, List metricData) { + List data = new ArrayList<>(labels.size()); + for (int i = 0; i < labels.size(); i++) { + data.add(metricData.get(i).collect(labels.get(i))); + } + return new SummarySnapshot(getMetadata(), data); + } + + @Override + protected DataPoint newDataPoint() { + return new DataPoint(); + } + + public class DataPoint implements DistributionDataPoint { + + private final LongAdder count = new LongAdder(); + private final DoubleAdder sum = new DoubleAdder(); + @Nullable private final SlidingWindow quantileValues; + private final Buffer buffer = new Buffer(); + @Nullable private final ExemplarSampler exemplarSampler; + + private final long createdTimeMillis = System.currentTimeMillis(); + + private DataPoint() { + if (quantiles.isEmpty()) { + quantileValues = null; + } else { + CKMSQuantiles.Quantile[] quantilesArray = quantiles.toArray(new CKMSQuantiles.Quantile[0]); + quantileValues = + new SlidingWindow<>( + CKMSQuantiles.class, + () -> new CKMSQuantiles(quantilesArray), + CKMSQuantiles::insert, + maxAgeSeconds, + ageBuckets); + } + if (exemplarSamplerConfig != null) { + exemplarSampler = new ExemplarSampler(exemplarSamplerConfig); + } else { + exemplarSampler = null; + } + } + + @Override + public double getSum() { + return sum.sum(); + } + + @Override + public long getCount() { + return count.sum(); + } + + @Override + public void observe(double value) { + if (Double.isNaN(value)) { + return; + } + if (!buffer.append(value)) { + doObserve(value); + } + if (exemplarSampler != null) { + exemplarSampler.observe(value); + } + } + + @Override + public void observeWithExemplar(double value, Labels labels) { + if (Double.isNaN(value)) { + return; + } + if (!buffer.append(value)) { + doObserve(value); + } + if (exemplarSampler != null) { + exemplarSampler.observeWithExemplar(value, labels); + } + } + + private void doObserve(double amount) { + sum.add(amount); + if (quantileValues != null) { + quantileValues.observe(amount); + } + // count must be incremented last, because in collect() the count + // indicates the number of completed observations. + count.increment(); + } + + private SummarySnapshot.SummaryDataPointSnapshot collect(Labels labels) { + return buffer.run( + expectedCount -> count.sum() == expectedCount, + // TODO Exemplars (are hard-coded as empty in the line below) + () -> + new SummarySnapshot.SummaryDataPointSnapshot( + count.sum(), + sum.sum(), + makeQuantiles(), + labels, + Exemplars.EMPTY, + createdTimeMillis), + this::doObserve); + } + + private List getQuantiles() { + return quantiles; + } + + private Quantiles makeQuantiles() { + Quantile[] quantiles = new Quantile[getQuantiles().size()]; + for (int i = 0; i < getQuantiles().size(); i++) { + CKMSQuantiles.Quantile quantile = getQuantiles().get(i); + quantiles[i] = + new Quantile( + quantile.quantile, requireNonNull(quantileValues).current().get(quantile.quantile)); + } + return Quantiles.of(quantiles); + } + } + + public static Summary.Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Summary.Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder extends StatefulMetric.Builder { + + /** 5 minutes. See {@link #maxAgeSeconds(long)}. */ + public static final long DEFAULT_MAX_AGE_SECONDS = TimeUnit.MINUTES.toSeconds(5); + + /** 5. See {@link #numberOfAgeBuckets(int)} */ + public static final int DEFAULT_NUMBER_OF_AGE_BUCKETS = 5; + + private final List quantiles = new ArrayList<>(); + @Nullable private Long maxAgeSeconds; + @Nullable private Integer ageBuckets; + + private Builder(PrometheusProperties properties) { + super(Collections.singletonList("quantile"), properties); + } + + private static double defaultError(double quantile) { + if (quantile <= 0.01 || quantile >= 0.99) { + return 0.001; + } else if (quantile <= 0.02 || quantile >= 0.98) { + return 0.005; + } else { + return 0.01; + } + } + + /** + * Add a quantile. See {@link #quantile(double, double)}. + * + *

    Default errors are: + * + *

      + *
    • error = 0.001 if quantile <= 0.01 or quantile >= 0.99 + *
    • error = 0.005 if quantile <= 0.02 or quantile >= 0.98 + *
    • error = 0.01 else. + *
    + */ + public Builder quantile(double quantile) { + return quantile(quantile, defaultError(quantile)); + } + + /** + * Add a quantile. Call multiple times to add multiple quantiles. + * + *

    Example: The following will track the 0.95 quantile: + * + *

    {@code
    +     * .quantile(0.95, 0.001)
    +     * }
    + * + * The second argument is the acceptable error margin, i.e. with the code above the quantile + * will not be exactly the 0.95 quantile but something between 0.949 and 0.951. + * + *

    There are two special cases: + * + *

      + *
    • {@code .quantile(0.0, 0.0)} gives you the minimum observed value + *
    • {@code .quantile(1.0, 0.0)} gives you the maximum observed value + *
    + */ + public Builder quantile(double quantile, double error) { + if (quantile < 0.0 || quantile > 1.0) { + throw new IllegalArgumentException( + "Quantile " + quantile + " invalid: Expected number between 0.0 and 1.0."); + } + if (error < 0.0 || error > 1.0) { + throw new IllegalArgumentException( + "Error " + error + " invalid: Expected number between 0.0 and 1.0."); + } + quantiles.add(new CKMSQuantiles.Quantile(quantile, error)); + return this; + } + + /** + * The quantiles are relative to a moving time window. {@code maxAgeSeconds} is the size of that + * time window. Default is {@link #DEFAULT_MAX_AGE_SECONDS}. + */ + public Builder maxAgeSeconds(long maxAgeSeconds) { + if (maxAgeSeconds <= 0) { + throw new IllegalArgumentException("maxAgeSeconds cannot be " + maxAgeSeconds); + } + this.maxAgeSeconds = maxAgeSeconds; + return this; + } + + /** + * The quantiles are relative to a moving time window. The {@code numberOfAgeBuckets} defines + * how smoothly the time window moves forward. For example, if the time window is 5 minutes and + * has 5 age buckets, then it is moving forward every minute by one minute. Default is {@link + * #DEFAULT_NUMBER_OF_AGE_BUCKETS}. + */ + public Builder numberOfAgeBuckets(int ageBuckets) { + if (ageBuckets <= 0) { + throw new IllegalArgumentException("ageBuckets cannot be " + ageBuckets); + } + this.ageBuckets = ageBuckets; + return this; + } + + @Override + protected MetricsProperties toProperties() { + double[] quantiles = null; + double[] quantileErrors = null; + if (!this.quantiles.isEmpty()) { + quantiles = new double[this.quantiles.size()]; + quantileErrors = new double[this.quantiles.size()]; + for (int i = 0; i < this.quantiles.size(); i++) { + quantiles[i] = this.quantiles.get(i).quantile; + quantileErrors[i] = this.quantiles.get(i).epsilon; + } + } + MetricsProperties.Builder builder = MetricsProperties.builder(); + if (quantiles != null) { + builder.summaryQuantiles(quantiles); + } + if (quantileErrors != null) { + builder.summaryQuantileErrors(quantileErrors); + } + return builder + .exemplarsEnabled(exemplarsEnabled) + .summaryNumberOfAgeBuckets(ageBuckets) + .summaryMaxAgeSeconds(maxAgeSeconds) + .build(); + } + + /** Default properties for summary metrics. */ + @Override + public MetricsProperties getDefaultProperties() { + return MetricsProperties.builder() + .exemplarsEnabled(true) + .summaryQuantiles() + .summaryNumberOfAgeBuckets(DEFAULT_NUMBER_OF_AGE_BUCKETS) + .summaryMaxAgeSeconds(DEFAULT_MAX_AGE_SECONDS) + .build(); + } + + @Override + public Summary build() { + return new Summary(this, properties); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/SummaryWithCallback.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/SummaryWithCallback.java new file mode 100644 index 000000000..3c4a910ea --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/SummaryWithCallback.java @@ -0,0 +1,98 @@ +package io.prometheus.metrics.core.metrics; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.model.snapshots.Exemplars; +import io.prometheus.metrics.model.snapshots.Quantiles; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.function.Consumer; +import javax.annotation.Nullable; + +/** + * Example: + * + *
    {@code
    + * double MILLISECONDS_PER_SECOND = 1E3;
    + *
    + * SummaryWithCallback.builder()
    + *         .name("jvm_gc_collection_seconds")
    + *         .help("Time spent in a given JVM garbage collector in seconds.")
    + *         .unit(Unit.SECONDS)
    + *         .labelNames("gc")
    + *         .callback(callback -> {
    + *             for (GarbageCollectorMXBean gc : ManagementFactory.getGarbageCollectorMXBeans()) {
    + *                 callback.call(
    + *                         gc.getCollectionCount(),
    + *                         gc.getCollectionTime() / MILLISECONDS_PER_SECOND,
    + *                         Quantiles.EMPTY,
    + *                         gc.getName()
    + *                 );
    + *             }
    + *         })
    + *         .register();
    + * }
    + */ +public class SummaryWithCallback extends CallbackMetric { + + @FunctionalInterface + public interface Callback { + void call(long count, double sum, Quantiles quantiles, String... labelValues); + } + + private final Consumer callback; + + private SummaryWithCallback(Builder builder) { + super(builder); + if (builder.callback == null) { + throw new IllegalArgumentException("callback cannot be null"); + } + this.callback = builder.callback; + } + + @Override + public SummarySnapshot collect() { + List dataPoints = new ArrayList<>(); + callback.accept( + (count, sum, quantiles, labelValues) -> { + dataPoints.add( + new SummarySnapshot.SummaryDataPointSnapshot( + count, sum, quantiles, makeLabels(labelValues), Exemplars.EMPTY, 0L)); + }); + return new SummarySnapshot(getMetadata(), dataPoints); + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties properties) { + return new Builder(properties); + } + + public static class Builder + extends CallbackMetric.Builder { + + @Nullable private Consumer callback; + + public Builder callback(Consumer callback) { + this.callback = callback; + return self(); + } + + private Builder(PrometheusProperties properties) { + super(Collections.singletonList("quantile"), properties); + } + + @Override + public SummaryWithCallback build() { + return new SummaryWithCallback(this); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/util/Scheduler.java b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/util/Scheduler.java new file mode 100644 index 000000000..9dc6b79fe --- /dev/null +++ b/prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/util/Scheduler.java @@ -0,0 +1,45 @@ +package io.prometheus.metrics.core.util; + +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.TimeUnit; + +/** + * Used for scheduling maintenance tasks like purging outdated Exemplars or resetting native + * histograms. + */ +public class Scheduler { + + private static class DaemonThreadFactory implements ThreadFactory { + private static int threadNum; + + private static synchronized int nextThreadNum() { + return threadNum++; + } + + @Override + public Thread newThread(Runnable runnable) { + Thread thread = new Thread(runnable, "prometheus-metrics-scheduler-" + nextThreadNum()); + thread.setDaemon(true); + return thread; + } + } + + private static final ScheduledExecutorService executor = + Executors.newSingleThreadScheduledExecutor(new DaemonThreadFactory()); + + public static ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) { + return executor.schedule(command, delay, unit); + } + + /** For unit test. Wait until the executor Thread is running. */ + @SuppressWarnings("FutureReturnValueIgnored") + public static void awaitInitialization() throws InterruptedException { + CountDownLatch latch = new CountDownLatch(1); + Scheduler.schedule(latch::countDown, 0, TimeUnit.MILLISECONDS); + latch.await(); + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/datapoints/CounterDataPointTest.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/datapoints/CounterDataPointTest.java new file mode 100644 index 000000000..3e70ef199 --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/datapoints/CounterDataPointTest.java @@ -0,0 +1,39 @@ +package io.prometheus.metrics.core.datapoints; + +import static org.assertj.core.api.Assertions.assertThat; + +import io.prometheus.metrics.model.snapshots.Labels; +import org.junit.jupiter.api.Test; + +class CounterDataPointTest { + + private double value = 0; + + @Test + void inc() { + CounterDataPoint counterDataPoint = + new CounterDataPoint() { + @Override + public void inc(double value) { + CounterDataPointTest.this.value += value; + } + + @Override + public void incWithExemplar(double amount, Labels labels) {} + + @Override + public long getLongValue() { + return 0; + } + + @Override + public double get() { + return 0; + } + }; + counterDataPoint.inc(1); + assertThat(value).isOne(); + counterDataPoint.incWithExemplar(1, null); + assertThat(value).isEqualTo(2); + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/datapoints/TimerApiTest.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/datapoints/TimerApiTest.java new file mode 100644 index 000000000..b7c9ea836 --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/datapoints/TimerApiTest.java @@ -0,0 +1,32 @@ +package io.prometheus.metrics.core.datapoints; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.jupiter.api.Test; + +class TimerApiTest { + + private double time = 0; + + private io.prometheus.metrics.core.datapoints.Timer timer = + new io.prometheus.metrics.core.datapoints.Timer(t -> time = t) {}; + private TimerApi api = () -> timer; + + @Test + void runnable() { + api.time(() -> {}); + assertThat(time).isPositive(); + } + + @Test + void supplier() { + assertThat(api.time(() -> "foo")).isEqualTo("foo"); + assertThat(time).isPositive(); + } + + @Test + void callable() throws Exception { + assertThat(api.timeChecked(() -> "foo")).isEqualTo("foo"); + assertThat(time).isPositive(); + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/exemplars/ExemplarSamplerConfigTestUtil.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/exemplars/ExemplarSamplerConfigTestUtil.java new file mode 100644 index 000000000..e22e9d6c6 --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/exemplars/ExemplarSamplerConfigTestUtil.java @@ -0,0 +1,32 @@ +package io.prometheus.metrics.core.exemplars; + +import java.lang.reflect.Field; + +public class ExemplarSamplerConfigTestUtil { + + private static ExemplarSamplerConfig getConfig(Object metric, String fieldName) + throws NoSuchFieldException, IllegalAccessException { + Field configField = metric.getClass().getDeclaredField(fieldName); + configField.setAccessible(true); + return (ExemplarSamplerConfig) configField.get(metric); + } + + private static void setRetentionPeriod(ExemplarSamplerConfig config, String name, long value) + throws IllegalAccessException, NoSuchFieldException { + Field field = config.getClass().getDeclaredField(name); + field.setAccessible(true); + field.set(config, value); + } + + public static void setMinRetentionPeriodMillis(Object metric, long value) + throws NoSuchFieldException, IllegalAccessException { + ExemplarSamplerConfig config = getConfig(metric, "exemplarSamplerConfig"); + setRetentionPeriod(config, "minRetentionPeriodMillis", value); + } + + public static void setSampleIntervalMillis(Object metric, long value) + throws NoSuchFieldException, IllegalAccessException { + ExemplarSamplerConfig config = getConfig(metric, "exemplarSamplerConfig"); + setRetentionPeriod(config, "sampleIntervalMillis", value); + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/exemplars/ExemplarSamplerTest.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/exemplars/ExemplarSamplerTest.java new file mode 100644 index 000000000..059929c22 --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/exemplars/ExemplarSamplerTest.java @@ -0,0 +1,224 @@ +package io.prometheus.metrics.core.exemplars; + +import static org.assertj.core.api.Assertions.assertThat; + +import io.prometheus.metrics.core.util.Scheduler; +import io.prometheus.metrics.model.snapshots.Exemplar; +import io.prometheus.metrics.model.snapshots.Exemplars; +import io.prometheus.metrics.model.snapshots.Label; +import io.prometheus.metrics.tracer.initializer.SpanContextSupplier; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ExemplarSamplerTest { + + private final int tick = 10; // Time step in milliseconds. Make this larger if the test is flaky. + private final int sampleInterval = 10 * tick; // do not change this + private final int minAge = 50 * tick; // do not change this + private final int maxAge = 200 * tick; // do not change this + + private ExemplarSamplerConfig makeConfig(double... buckets) { + return new ExemplarSamplerConfig( + minAge, + maxAge, + sampleInterval, + buckets.length == 0 ? 4 : buckets.length, // number of exemplars + buckets.length == 0 ? null : buckets); + } + + private static class SpanContext implements io.prometheus.metrics.tracer.common.SpanContext { + + int callCount = 0; + boolean isSampled = true; + + @Override + public String getCurrentTraceId() { + return "" + callCount++; + } + + @Override + public String getCurrentSpanId() { + return "" + callCount; + } + + @Override + public boolean isCurrentSpanSampled() { + return isSampled; + } + + @Override + public void markCurrentSpanAsExemplar() {} + } + + @Test + public void testCustomExemplarsBuckets() throws Exception { + // TODO + } + + private io.prometheus.metrics.tracer.common.SpanContext origContext; + + @BeforeEach + public void setUp() { + origContext = SpanContextSupplier.getSpanContext(); + } + + @AfterEach + public void tearDown() { + SpanContextSupplier.setSpanContext(origContext); + } + + @Test + public void testIsSampled() throws Exception { + SpanContext context = new SpanContext(); + context.isSampled = false; + ExemplarSampler sampler = new ExemplarSampler(makeConfig(), context); + Thread.sleep(tick); // t = 1 tick + sampler.observe(0.3); // no sampled, because isSampled() returns false + assertExemplars(sampler); // empty + } + + @Test + public void testDefaultConfigHasFourExemplars() throws Exception { + ExemplarSampler sampler = new ExemplarSampler(makeConfig(), new SpanContext()); + Thread.sleep(tick); // t = 1 tick + sampler.observe(0.3); + Thread.sleep(sampleInterval + tick); // t = 12 tick + sampler.observe(0.8); + Thread.sleep(sampleInterval + tick); // t = 23 tick + sampler.observe(0.4); + Thread.sleep(sampleInterval + tick); // t = 34 tick + sampler.observe(0.6); + Thread.sleep(sampleInterval + tick); // t = 45 tick + sampler.observe(0.2); // not observed, we got 4 Exemplars already and non reached min age + assertExemplars(sampler, 0.3, 0.8, 0.4, 0.6); + print(sampler.collect()); + } + + @Test + public void testEmptyBuckets() throws Exception { + ExemplarSampler sampler = + new ExemplarSampler(makeConfig(Double.POSITIVE_INFINITY), new SpanContext()); + Thread.sleep(tick); // t = 1 tick + sampler.observe(0.8); // observed in the +Inf bucket + Thread.sleep(sampleInterval + tick); // t = 12 tick + sampler.observe(0.5); // not observed, because +Inf is the only bucket + assertExemplars(sampler, 0.8); + print(sampler.collect()); + } + + @Test + public void testDefaultExemplarsBuckets() throws Exception { + ExemplarSampler sampler = + new ExemplarSampler( + makeConfig(0.2, 0.4, 0.6, 0.8, 1.0, Double.POSITIVE_INFINITY), new SpanContext()); + Scheduler.awaitInitialization(); + Thread.sleep(tick); // t = 1 tick + sampler.observe(0.3); + sampler.observe(0.5); // not observed, previous observation is less than sample interval ms ago + assertExemplars(sampler, 0.3); + Thread.sleep(sampleInterval + tick); // t = 12 ticks + sampler.observe(0.5); // observed + assertExemplars(sampler, 0.3, 0.5); + Thread.sleep(sampleInterval + tick); // t = 23 ticks + sampler.observe(0.4); // not observed, because 0.3 hasn't reached min age yet + assertExemplars(sampler, 0.3, 0.5); + Thread.sleep(sampleInterval + tick); // t = 34 ticks + sampler.observe(1.1); // observed + assertExemplars(sampler, 0.3, 0.5, 1.1); + Thread.sleep(20 * tick); // t = 54 ticks + assertExemplars(sampler, 0.3, 0.5, 1.1); + sampler.observe(0.4); // observed + assertExemplars(sampler, 0.4, 0.5, 1.1); + Thread.sleep(159 * tick); // t = 213 ticks + assertExemplars(sampler, 0.4, 1.1); // 0.5 evicted because it has reached max age + print(sampler.collect()); + } + + @Test + public void testCustomExemplarsNoBuckets() throws Exception { + // TODO + } + + @Test + public void testDefaultExemplarsNoBuckets() throws Exception { + ExemplarSampler sampler = new ExemplarSampler(makeConfig(), new SpanContext()); + Scheduler.awaitInitialization(); + Thread.sleep(tick); // t = 1 tick + sampler.observe(1); // observed + assertExemplars(sampler, 1); + sampler.observe(2); // not observed, previous observation is less than sample interval ms ago + Thread.sleep(sampleInterval + tick); // t = 12 ticks + sampler.observe(3); // observed + assertExemplars(sampler, 1, 3); + Thread.sleep(2 * tick); // t = 14 ticks + sampler.observe(4); // not observed, previous observation is less than sample interval ms ago + Thread.sleep(sampleInterval + tick); // t = 25 ticks + sampler.observe(5); // observed + assertExemplars(sampler, 1, 3, 5); + Thread.sleep(sampleInterval + tick); // t = 36 ticks + sampler.observe(6); // observed + assertExemplars(sampler, 1, 3, 5, 6); + Thread.sleep(sampleInterval + tick); // t = 47 ticks + sampler.observe(7); // not observed, because no Exemplar has reached the minimum age yet + Thread.sleep(5 * tick); // t = 52 ticks + sampler.observe(2); // not observed. 1 is older than min age, but kept because it's the minimum + assertExemplars(sampler, 1, 3, 5, 6); + Thread.sleep(sampleInterval + tick); // t = 63 ticks + sampler.observe(2); // observed + assertExemplars(sampler, 1, 2, 5, 6); + Thread.sleep(27 * tick); // t = 90 ticks + sampler.observe(7); // observed, replaces 6 because 7 > 6 even though 5 is older + assertExemplars(sampler, 1, 2, 5, 7); + sampler.observe(8); // not observed, sample interval not done + assertExemplars(sampler, 1, 2, 5, 7); + Thread.sleep(sampleInterval + tick); // t = 101 ticks + sampler.observe(8); // observed + assertExemplars(sampler, 1, 2, 8, 7); + Thread.sleep(101 * tick); // t = 202 ticks + sampler.observe(5); // observed, replaces 1 because 1 reached the max age + assertExemplars(sampler, 5, 2, 8, 7); + print(sampler.collect()); + } + + private void assertExemplars(ExemplarSampler sampler, double... values) { + Exemplars exemplars = sampler.collect(); + assertThat(exemplars.size()).isEqualTo(values.length); + for (double value : values) { + boolean found = false; + for (Exemplar exemplar : exemplars) { + if (exemplar.getValue() == value) { + found = true; + break; + } + } + assertThat(found).as(value + " not found").isTrue(); + } + } + + private void print(Exemplars exemplars) { + System.out.print("["); + boolean farst = true; + for (Exemplar exemplar : exemplars) { + if (!farst) { + System.out.print(","); + } + farst = false; + System.out.print(exemplar.getValue() + "{"); + boolean first = true; + for (Label label : exemplar.getLabels()) { + if (!first) { + System.out.print(","); + } + System.out.print(label.getName() + "=" + label.getValue()); + first = false; + } + if (!first) { + System.out.print(","); + } + System.out.print("age=" + (System.currentTimeMillis() - exemplar.getTimestampMillis())); + System.out.print("}"); + } + System.out.println("]"); + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/exemplars/SpanContextSupplierTest.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/exemplars/SpanContextSupplierTest.java new file mode 100644 index 000000000..6c89b48a5 --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/exemplars/SpanContextSupplierTest.java @@ -0,0 +1,108 @@ +package io.prometheus.metrics.core.exemplars; + +import static io.prometheus.metrics.model.snapshots.Exemplar.TRACE_ID; +import static org.assertj.core.api.Assertions.assertThat; + +import io.prometheus.metrics.config.ExemplarsProperties; +import io.prometheus.metrics.model.snapshots.Exemplar; +import io.prometheus.metrics.model.snapshots.Exemplars; +import io.prometheus.metrics.tracer.common.SpanContext; +import io.prometheus.metrics.tracer.initializer.SpanContextSupplier; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class SpanContextSupplierTest { + + public SpanContext makeSpanContext(String traceId, String spanId) { + + return new SpanContext() { + @Override + public String getCurrentTraceId() { + return traceId; + } + + @Override + public String getCurrentSpanId() { + return spanId; + } + + @Override + public boolean isCurrentSpanSampled() { + return true; + } + + @Override + public void markCurrentSpanAsExemplar() {} + }; + } + + SpanContext spanContextA = makeSpanContext("A", "a"); + SpanContext spanContextB = makeSpanContext("B", "b"); + SpanContext origSpanContext; + + ExemplarSamplerConfig config = + new ExemplarSamplerConfig( + 10, // min retention period in milliseconds + 20, // max retention period in milliseconds + 5, // sample interval in milliseconds + 1, // number of exemplars + null // histogram upper bounds + ); + + @BeforeEach + public void setUp() { + origSpanContext = SpanContextSupplier.getSpanContext(); + } + + @AfterEach + public void tearDown() { + SpanContextSupplier.setSpanContext(origSpanContext); + } + + /** + * Test: When a {@link SpanContext} is provided as a constructor argument to the {@link + * ExemplarSampler}, then that {@link SpanContext} is used, not the one from the {@link + * SpanContextSupplier}. + */ + @Test + public void testConstructorInjection() { + ExemplarsProperties properties = ExemplarsProperties.builder().build(); + ExemplarSamplerConfig config = new ExemplarSamplerConfig(properties, 1); + ExemplarSampler exemplarSampler = new ExemplarSampler(config, spanContextA); + + SpanContextSupplier.setSpanContext(spanContextB); + exemplarSampler.observe(1.0); + Exemplars exemplars = exemplarSampler.collect(); + assertThat(exemplars.size()).isOne(); + Exemplar exemplar = exemplars.get(0); + assertThat(exemplar.getLabels().get(TRACE_ID)).isEqualTo("A"); + } + + /** + * When the global {@link SpanContext} is updated via {@link + * SpanContextSupplier#setSpanContext(SpanContext)}, the {@link ExemplarSampler} recognizes the + * update (unless a {@link ExemplarSampler} was provided as constructor argument to {@link + * ExemplarSampler}). + */ + @Test + public void testUpdateSpanContext() throws InterruptedException { + ExemplarSampler exemplarSampler = new ExemplarSampler(config); + + SpanContextSupplier.setSpanContext(spanContextB); + exemplarSampler.observe(1.0); + Exemplars exemplars = exemplarSampler.collect(); + assertThat(exemplars.size()).isOne(); + Exemplar exemplar = exemplars.get(0); + assertThat(exemplar.getLabels().get(TRACE_ID)).isEqualTo("B"); + + Thread.sleep(15); // more than the minimum retention period defined in config above. + + SpanContextSupplier.setSpanContext(spanContextA); + exemplarSampler.observe(1.0); + exemplars = exemplarSampler.collect(); + assertThat(exemplars.size()).isOne(); + exemplar = exemplars.get(0); + assertThat(exemplar.getLabels().get(TRACE_ID)).isEqualTo("A"); + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/CKMSQuantilesTest.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/CKMSQuantilesTest.java new file mode 100644 index 000000000..bd6b177a4 --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/CKMSQuantilesTest.java @@ -0,0 +1,378 @@ +package io.prometheus.metrics.core.metrics; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; +import static org.assertj.core.data.Offset.offset; + +import io.prometheus.metrics.core.metrics.CKMSQuantiles.Quantile; +import java.util.*; +import org.apache.commons.math3.distribution.NormalDistribution; +import org.apache.commons.math3.random.JDKRandomGenerator; +import org.apache.commons.math3.random.RandomGenerator; +import org.junit.jupiter.api.Test; + +class CKMSQuantilesTest { + + private final Quantile qMin = new Quantile(0.0, 0.00); + private final Quantile q50 = new Quantile(0.5, 0.01); + private final Quantile q95 = new Quantile(0.95, 0.005); + private final Quantile q99 = new Quantile(0.99, 0.001); + private final Quantile qMax = new Quantile(1.0, 0.00); + + @Test + public void testGetOnEmptyValues() { + CKMSQuantiles ckms = new CKMSQuantiles(q50, q95, q99); + assertThat(Double.isNaN(ckms.get(q95.quantile))).isTrue(); + } + + @Test + public void testGet() { + Random random = new Random(0); + CKMSQuantiles ckms = new CKMSQuantiles(q50, q95, q99); + List input = shuffledValues(100, random); + for (double value : input) { + ckms.insert(value); + } + validateResults(ckms); + } + + @Test + public void testBatchInsert() { + Random random = new Random(1); + testInsertBatch(1, 1, 100, random); + testInsertBatch(1, 10, 100, random); + testInsertBatch(2, 10, 100, random); + testInsertBatch( + 2, 110, 100, + random); // compress never called, because compress interval > number of inserts + testInsertBatch(3, 10, 100, random); + testInsertBatch(10, 10, 100, random); + testInsertBatch(128, 128, 1, random); + testInsertBatch(128, 128, 1000, random); + testInsertBatch(128, 128, 10 * 1000, random); + testInsertBatch(128, 128, 100 * 1000, random); + testInsertBatch(128, 128, 1000 * 1000, random); + } + + private void testInsertBatch( + int batchSize, int compressInterval, int totalNumber, Random random) { + System.out.println( + "testInsertBatch(batchSize=" + + batchSize + + ", compressInterval=" + + compressInterval + + ", totalNumber=" + + totalNumber + + ")"); + CKMSQuantiles ckms = new CKMSQuantiles(q50, q95); + int insertsSinceCompress = 0; + List input = shuffledValues(totalNumber, random); + for (int i = 0; i < input.size(); i += batchSize) { + double[] batch = new double[batchSize]; + int j; + for (j = 0; j < batchSize && i + j < input.size(); j++) { + batch[j] = input.get(i + j); + } + Arrays.sort(batch, 0, j); + ckms.insertBatch(batch, j); + validateSamples(ckms); // after each insert the samples should still be valid + insertsSinceCompress += j; + if (insertsSinceCompress >= compressInterval) { + ckms.compress(); + validateSamples(ckms); // after each compress the samples should still be valid + insertsSinceCompress = 0; + } + } + validateResults(ckms); + } + + @Test + public void testGetWithAMillionElements() { + Random random = new Random(2); + List input = shuffledValues(1000 * 1000, random); + CKMSQuantiles ckms = new CKMSQuantiles(q50, q95, q99); + for (double v : input) { + ckms.insert(v); + } + validateResults(ckms); + assertThat(ckms.samples).as("sample size should be way below 1_000_000").hasSizeLessThan(1000); + } + + @Test + public void testMin() { + Random random = new Random(3); + List input = shuffledValues(1000, random); + CKMSQuantiles ckms = new CKMSQuantiles(qMin); + for (double v : input) { + ckms.insert(v); + } + validateResults(ckms); + ckms.compress(); + assertThat(ckms.samples).hasSize(2); + } + + @Test + public void testMax() { + Random random = new Random(4); + List input = shuffledValues(1000, random); + CKMSQuantiles ckms = new CKMSQuantiles(qMax); + for (double v : input) { + ckms.insert(v); + } + validateResults(ckms); + ckms.compress(); + assertThat(ckms.samples).hasSize(2); + } + + @Test + public void testMinMax() { + Random random = new Random(5); + List input = shuffledValues(1000, random); + CKMSQuantiles ckms = new CKMSQuantiles(qMin, qMax); + for (double v : input) { + ckms.insert(v); + } + validateResults(ckms); + ckms.compress(); + assertThat(ckms.samples).hasSize(2); + } + + @Test + public void testMinAndOthers() { + Random random = new Random(6); + List input = shuffledValues(1000, random); + CKMSQuantiles ckms = new CKMSQuantiles(q95, qMin); + for (double v : input) { + ckms.insert(v); + } + validateResults(ckms); + assertThat(ckms.samples).hasSizeLessThan(200); // should be a lot less than input.size() + } + + @Test + public void testMaxAndOthers() { + Random random = new Random(7); + List input = shuffledValues(10000, random); + CKMSQuantiles ckms = new CKMSQuantiles(q50, q95, qMax); + for (double v : input) { + ckms.insert(v); + } + validateResults(ckms); + assertThat(ckms.samples).hasSizeLessThan(200); // should be a lot less than input.size() + } + + @Test + public void testMinMaxAndOthers() { + Random random = new Random(8); + List input = shuffledValues(10000, random); + CKMSQuantiles ckms = new CKMSQuantiles(qMin, q50, q95, q99, qMax); + for (double v : input) { + ckms.insert(v); + } + validateResults(ckms); + assertThat(ckms.samples).hasSizeLessThan(200); // should be a lot less than input.size() + } + + @Test + public void testExactQuantile() { + Random random = new Random(9); + List input = shuffledValues(10000, random); + CKMSQuantiles ckms = new CKMSQuantiles(new Quantile(0.95, 0)); + for (double v : input) { + ckms.insert(v); + } + validateResults(ckms); + // With epsilon == 0 we need to keep all inputs in samples. + assertThat(ckms.samples).hasSameSizeAs(input); + } + + @Test + public void testExactAndOthers() { + Random random = new Random(10); + List input = shuffledValues(10000, random); + CKMSQuantiles ckms = new CKMSQuantiles(q50, new Quantile(0.95, 0), q99); + for (double v : input) { + ckms.insert(v); + } + validateResults(ckms); + // With epsilon == 0 we need to keep all inputs in samples. + assertThat(ckms.samples).hasSameSizeAs(input); + } + + @Test + public void testExactAndMin() { + Random random = new Random(11); + List input = shuffledValues(10000, random); + CKMSQuantiles ckms = new CKMSQuantiles(qMin, q50, new Quantile(0.95, 0)); + for (double v : input) { + ckms.insert(v); + } + validateResults(ckms); + // With epsilon == 0 we need to keep all inputs in samples. + assertThat(ckms.samples).hasSameSizeAs(input); + } + + @Test + public void testMaxEpsilon() { + Random random = new Random(12); + List input = shuffledValues(10000, random); + // epsilon == 1 basically gives you random results, but it should still not throw an exception. + CKMSQuantiles ckms = new CKMSQuantiles(new Quantile(0.95, 1)); + for (double v : input) { + ckms.insert(v); + } + validateResults(ckms); + } + + @Test + public void testGetGaussian() { + RandomGenerator rand = new JDKRandomGenerator(); + rand.setSeed(0); + + double mean = 0.0; + double stddev = 1.0; + NormalDistribution normalDistribution = + new NormalDistribution( + rand, mean, stddev, NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY); + + List quantiles = new ArrayList<>(); + quantiles.add(new Quantile(0.10, 0.001)); + quantiles.add(new Quantile(0.50, 0.01)); + quantiles.add(new Quantile(0.90, 0.001)); + quantiles.add(new Quantile(0.95, 0.001)); + quantiles.add(new Quantile(0.99, 0.001)); + + CKMSQuantiles ckms = new CKMSQuantiles(quantiles.toArray(new Quantile[] {})); + + final int elemCount = 1000 * 1000; + double[] shuffle = normalDistribution.sample(elemCount); + + // insert a million samples + for (double v : shuffle) { + ckms.insert(v); + } + + // give the actual values for the quantiles we test + double p10 = normalDistribution.inverseCumulativeProbability(0.1); + double p90 = normalDistribution.inverseCumulativeProbability(0.9); + double p95 = normalDistribution.inverseCumulativeProbability(0.95); + double p99 = normalDistribution.inverseCumulativeProbability(0.99); + + // ε-approximate quantiles relaxes the requirement + // to finding an item with rank between (φ−ε)n and (φ+ε)n. + assertThat(ckms.get(0.1)) + .isCloseTo(p10, offset(errorBoundsNormalDistribution(0.1, 0.001, normalDistribution))); + assertThat(ckms.get(0.5)) + .isCloseTo(mean, offset(errorBoundsNormalDistribution(0.5, 0.01, normalDistribution))); + assertThat(ckms.get(0.9)) + .isCloseTo(p90, offset(errorBoundsNormalDistribution(0.9, 0.001, normalDistribution))); + assertThat(ckms.get(0.95)) + .isCloseTo(p95, offset(errorBoundsNormalDistribution(0.95, 0.001, normalDistribution))); + assertThat(ckms.get(0.99)) + .isCloseTo(p99, offset(errorBoundsNormalDistribution(0.99, 0.001, normalDistribution))); + + assertThat(ckms.samples).as("sample size should be below 1000").hasSizeLessThan(1000); + } + + double errorBoundsNormalDistribution(double p, double epsilon, NormalDistribution nd) { + // (φ+ε)n + double upperBound = nd.inverseCumulativeProbability(p + epsilon); + // (φ−ε)n + double lowerBound = nd.inverseCumulativeProbability(p - epsilon); + // subtract and divide by 2, assuming that the increase is linear in this small epsilon. + return Math.abs(upperBound - lowerBound) / 2; + } + + @Test + public void testIllegalArgumentException() { + try { + new Quantile(-1, 0); + } catch (IllegalArgumentException e) { + assertThat(e.getMessage()).isEqualTo("Quantile must be between 0 and 1"); + } catch (Exception e) { + fail("Wrong exception thrown" + e); + } + try { + new Quantile(0.95, 2); + } catch (IllegalArgumentException e) { + assertThat(e.getMessage()).isEqualTo("Epsilon must be between 0 and 1"); + } catch (Exception e) { + fail("Wrong exception thrown" + e); + } + } + + private List shuffledValues(int n, Random random) { + List result = new ArrayList<>(n); + for (int i = 0; i < n; i++) { + result.add(i + 1.0); + } + Collections.shuffle(result, random); + return result; + } + + /** The following invariant must be true for each sample: g + delta <= f(r) */ + private void validateSamples(CKMSQuantiles ckms) { + double prev = -1.0; + int r = 0; // sum of all g's left of the current sample + for (CKMSQuantiles.Sample sample : ckms.samples) { + String msg = + "invalid sample " + sample + ": count=" + ckms.n + " r=" + r + " f(r)=" + ckms.f(r); + assertThat(sample.g + sample.delta).as(msg).isLessThanOrEqualTo(ckms.f(r)); + assertThat(prev) + .as( + "Samples not ordered. Keep in mind that insertBatch() takes a sorted array as" + + " parameter.") + .isLessThanOrEqualTo(sample.value); + prev = sample.value; + r += sample.g; + } + assertThat(ckms.n) + .as("the sum of all g's must be the total number of observations") + .isEqualTo(r); + } + + /** + * The values that we insert in these tests are always the numbers from 1 to n, in random order. + * So we can trivially calculate the range of acceptable results for each quantile. We check if + * the value returned by get() is within the range of acceptable results. + */ + private void validateResults(CKMSQuantiles ckms) { + for (Quantile q : ckms.quantiles) { + double actual = ckms.get(q.quantile); + double lowerBound, upperBound; + if (q.quantile == 0) { + lowerBound = 1; + upperBound = 1; + } else if (q.quantile == 1) { + lowerBound = ckms.n; + upperBound = ckms.n; + } else { + lowerBound = Math.floor(ckms.n * (q.quantile - 2 * q.epsilon)); + upperBound = Math.ceil(ckms.n * (q.quantile + 2 * q.epsilon)); + } + boolean ok = actual >= lowerBound && actual <= upperBound; + if (!ok) { + for (CKMSQuantiles.Sample sample : ckms.samples) { + System.err.println(sample); + } + } + String errorMessage = + q + + ": " + + actual + + " not in [" + + lowerBound + + ", " + + upperBound + + "], n=" + + ckms.n + + ", " + + q.quantile + + "*" + + ckms.n + + "=" + + (q.quantile * ckms.n); + assertThat(ok).as(errorMessage).isTrue(); + } + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/CallbackMetricTest.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/CallbackMetricTest.java new file mode 100644 index 000000000..17fa641b0 --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/CallbackMetricTest.java @@ -0,0 +1,49 @@ +package io.prometheus.metrics.core.metrics; + +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import org.junit.jupiter.api.Test; + +class CallbackMetricTest { + + @Test + void makeLabels() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + CounterWithCallback.builder() + .name("c") + .callback(callback -> {}) + .labelNames("label1", "label2") + .build() + .makeLabels("foo")) + .withMessage( + "CounterWithCallback was created with 2 label names, but the callback was called with 1" + + " label values."); + + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + CounterWithCallback.builder() + .name("c") + .callback(callback -> {}) + .labelNames("label1", "label2") + .build() + .makeLabels((String[]) null)) + .withMessage( + "CounterWithCallback was created with label names, but the callback was called without" + + " label values."); + + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + CounterWithCallback.builder() + .name("c") + .callback(callback -> {}) + .build() + .makeLabels("foo")) + .withMessage( + "Cannot pass label values to a CounterWithCallback that was created without label" + + " names."); + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/CounterTest.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/CounterTest.java new file mode 100644 index 000000000..c39bf1ad6 --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/CounterTest.java @@ -0,0 +1,380 @@ +package io.prometheus.metrics.core.metrics; + +import static io.prometheus.metrics.core.metrics.TestUtil.assertExemplarEquals; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.assertj.core.data.Offset.offset; + +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.config.MetricsProperties; +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.exemplars.ExemplarSamplerConfigTestUtil; +import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics; +import io.prometheus.metrics.expositionformats.internal.PrometheusProtobufWriterImpl; +import io.prometheus.metrics.expositionformats.internal.ProtobufUtil; +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import io.prometheus.metrics.model.snapshots.Exemplar; +import io.prometheus.metrics.model.snapshots.Label; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.Unit; +import io.prometheus.metrics.tracer.common.SpanContext; +import io.prometheus.metrics.tracer.initializer.SpanContextSupplier; +import java.util.Arrays; +import java.util.Iterator; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +class CounterTest { + + private Counter noLabels; + private Counter labels; + private static final long exemplarSampleIntervalMillis = 10; + private static final long exemplarMinAgeMillis = 100; + private SpanContext origSpanContext; + + @BeforeEach + public void setUp() throws NoSuchFieldException, IllegalAccessException { + noLabels = Counter.builder().name("nolabels").build(); + labels = + Counter.builder().name("labels").help("help").unit(Unit.SECONDS).labelNames("l").build(); + origSpanContext = SpanContextSupplier.getSpanContext(); + ExemplarSamplerConfigTestUtil.setSampleIntervalMillis(noLabels, exemplarSampleIntervalMillis); + ExemplarSamplerConfigTestUtil.setMinRetentionPeriodMillis(noLabels, exemplarMinAgeMillis); + ExemplarSamplerConfigTestUtil.setSampleIntervalMillis(labels, exemplarSampleIntervalMillis); + ExemplarSamplerConfigTestUtil.setMinRetentionPeriodMillis(labels, exemplarMinAgeMillis); + } + + @AfterEach + public void tearDown() { + SpanContextSupplier.setSpanContext(origSpanContext); + } + + private CounterSnapshot.CounterDataPointSnapshot getData(Counter counter, String... labels) { + return counter.collect().getDataPoints().stream() + .filter(d -> d.getLabels().equals(Labels.of(labels))) + .findAny() + .orElseThrow( + () -> + new RuntimeException( + "counter with labels " + Arrays.toString(labels) + " not found")); + } + + private double getValue(Counter counter, String... labels) { + return getData(counter, labels).getValue(); + } + + private int getNumberOfLabels(Counter counter) { + return counter.collect().getDataPoints().size(); + } + + @Test + public void testIncrement() { + noLabels.inc(); + assertThat(getValue(noLabels)).isCloseTo(1.0, offset(.001)); + noLabels.inc(2); + assertThat(getValue(noLabels)).isCloseTo(3.0, offset(.001)); + noLabels.labelValues().inc(4); + assertThat(getValue(noLabels)).isCloseTo(7.0, offset(.001)); + noLabels.labelValues().inc(); + assertThat(getValue(noLabels)).isCloseTo(8.0, offset(.001)); + } + + @Test + public void testNegativeIncrementFails() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> noLabels.inc(-1)) + .withMessage("Negative increment -1 is illegal for Counter metrics."); + } + + @Test + public void testEmptyCountersHaveNoLabels() { + assertThat(getNumberOfLabels(noLabels)).isOne(); + assertThat(getNumberOfLabels(labels)).isZero(); + } + + @Test + public void testLabels() { + assertThat(getNumberOfLabels(labels)).isZero(); + labels.labelValues("a").inc(); + assertThat(getNumberOfLabels(labels)).isOne(); + assertThat(getValue(labels, "l", "a")).isCloseTo(1.0, offset(.001)); + labels.labelValues("b").inc(3); + assertThat(getNumberOfLabels(labels)).isEqualTo(2); + assertThat(getValue(labels, "l", "a")).isCloseTo(1.0, offset(.001)); + assertThat(getValue(labels, "l", "b")).isCloseTo(3.0, offset(.001)); + } + + @ParameterizedTest + @ValueSource( + strings = { + "my_counter_total", + "my_counter_seconds_total", + "my_counter", + "my_counter_seconds", + }) + public void testTotalStrippedFromName(String name) { + Counter counter = Counter.builder().name(name).unit(Unit.SECONDS).build(); + Metrics.MetricFamily protobufData = + new PrometheusProtobufWriterImpl().convert(counter.collect(), EscapingScheme.ALLOW_UTF8); + assertThat(ProtobufUtil.shortDebugString(protobufData)) + .matches( + "^name: \"my_counter_seconds_total\" type: COUNTER metric \\{ counter \\{ value: 0.0 created_timestamp \\{ seconds: \\d+ nanos: \\d+ } } }$"); + } + + @Test + public void testSnapshotComplete() { + long before = System.currentTimeMillis(); + Counter counter = + Counter.builder() + .name("test_seconds_total") + .unit(Unit.SECONDS) + .help("help message") + .constLabels(Labels.of("const1name", "const1value", "const2name", "const2value")) + .labelNames("path", "status") + .build(); + counter.labelValues("/", "200").inc(2); + counter.labelValues("/", "500").inc(); + CounterSnapshot snapshot = counter.collect(); + assertThat(snapshot.getMetadata().getName()).isEqualTo("test_seconds"); + assertThat(snapshot.getMetadata().getUnit()).hasToString("seconds"); + assertThat(snapshot.getMetadata().getHelp()).isEqualTo("help message"); + assertThat(snapshot.getDataPoints()).hasSize(2); + Iterator iter = snapshot.getDataPoints().iterator(); + // data is ordered by labels, so 200 comes before 500 + CounterSnapshot.CounterDataPointSnapshot data = iter.next(); + assertThat((Iterable) data.getLabels()) + .isEqualTo( + Labels.of( + "const1name", + "const1value", + "const2name", + "const2value", + "path", + "/", + "status", + "200")); + assertThat(data.getValue()).isCloseTo(2, offset(0.0001)); + assertThat(data.getCreatedTimestampMillis()) + .isGreaterThanOrEqualTo(before) + .isLessThanOrEqualTo(System.currentTimeMillis()); + // 500 + data = iter.next(); + assertThat((Iterable) data.getLabels()) + .isEqualTo( + Labels.of( + "const1name", + "const1value", + "const2name", + "const2value", + "path", + "/", + "status", + "500")); + assertThat(data.getValue()).isCloseTo(1, offset(0.0001)); + assertThat(data.getCreatedTimestampMillis()) + .isGreaterThanOrEqualTo(before) + .isLessThanOrEqualTo(System.currentTimeMillis()); + } + + @Test + public void testIncWithExemplar() throws Exception { + noLabels.incWithExemplar(Labels.of("key", "value")); + assertExemplar(noLabels, 1.0, "key", "value"); + + Thread.sleep(exemplarMinAgeMillis + 2 * exemplarSampleIntervalMillis); + + noLabels.incWithExemplar(Labels.EMPTY); + assertExemplar(noLabels, 1.0); + + Thread.sleep(exemplarMinAgeMillis + 2 * exemplarSampleIntervalMillis); + + noLabels.incWithExemplar(3, Labels.of("key1", "value1", "key2", "value2")); + assertExemplar(noLabels, 3, "key1", "value1", "key2", "value2"); + } + + private void assertExemplar(Counter counter, double value, String... labels) { + Exemplar exemplar = getData(counter).getExemplar(); + assertThat(exemplar.getValue()).isCloseTo(value, offset(0.0001)); + assertThat((Iterable) exemplar.getLabels()).isEqualTo(Labels.of(labels)); + } + + @Test + public void testExemplarSampler() throws Exception { + Exemplar exemplar1 = Exemplar.builder().value(2.0).traceId("abc").spanId("123").build(); + Exemplar exemplar2 = Exemplar.builder().value(1.0).traceId("def").spanId("456").build(); + Exemplar exemplar3 = Exemplar.builder().value(1.0).traceId("123").spanId("abc").build(); + Exemplar customExemplar = + Exemplar.builder() + .value(1.0) + .traceId("bab") + .spanId("cdc") + .labels(Labels.of("test", "test")) + .build(); + + SpanContext spanContext = + new SpanContext() { + private int callNumber = 0; + + @Override + public String getCurrentTraceId() { + return switch (callNumber) { + case 1 -> "abc"; + case 3 -> "def"; + case 4 -> "123"; + case 5 -> "bab"; + default -> throw new RuntimeException("unexpected call"); + }; + } + + @Override + public String getCurrentSpanId() { + return switch (callNumber) { + case 1 -> "123"; + case 3 -> "456"; + case 4 -> "abc"; + case 5 -> "cdc"; + default -> throw new RuntimeException("unexpected call"); + }; + } + + @Override + public boolean isCurrentSpanSampled() { + callNumber++; + return callNumber != 2; + } + + @Override + public void markCurrentSpanAsExemplar() {} + }; + Counter counter = Counter.builder().name("count_total").build(); + + SpanContextSupplier.setSpanContext(spanContext); + ExemplarSamplerConfigTestUtil.setMinRetentionPeriodMillis(counter, exemplarMinAgeMillis); + ExemplarSamplerConfigTestUtil.setSampleIntervalMillis(counter, exemplarSampleIntervalMillis); + + counter.inc(2.0); + assertExemplarEquals(exemplar1, getData(counter).getExemplar()); + + Thread.sleep(2 * exemplarSampleIntervalMillis); + + counter.inc( + 3.0); // min age not reached -> keep the previous exemplar, exemplar sampler not called + assertExemplarEquals(exemplar1, getData(counter).getExemplar()); + + Thread.sleep(exemplarMinAgeMillis + 2 * exemplarSampleIntervalMillis); + + counter.inc(2.0); // 2nd call: isSampled() returns false -> not sampled + assertExemplarEquals(exemplar1, getData(counter).getExemplar()); + + Thread.sleep(2 * exemplarSampleIntervalMillis); + + counter.inc(1.0); // sampled + assertExemplarEquals(exemplar2, getData(counter).getExemplar()); + + Thread.sleep(exemplarMinAgeMillis + 2 * exemplarSampleIntervalMillis); + + counter.inc(1.0); // sampled + assertExemplarEquals(exemplar3, getData(counter).getExemplar()); + + Thread.sleep(2 * exemplarSampleIntervalMillis); + + counter.incWithExemplar( + Labels.of( + "test", + "test")); // custom exemplar sampled even though the automatic exemplar hasn't reached + // min age yet + assertExemplarEquals(customExemplar, getData(counter).getExemplar()); + } + + @Test + void inc() { + Counter counter = Counter.builder().name("count_total").build(); + counter.inc(2.0); + + assertThat(getData(counter).getValue()).isCloseTo(2.0, offset(0.0001)); + assertThat(counter.get()).isEqualTo(2.0); + assertThat(counter.getLongValue()).isEqualTo(2L); + } + + @Test + void incWithExemplar() { + Counter counter = Counter.builder().name("count_total").build(); + counter.incWithExemplar(Labels.of("test", "test2")); + + assertExemplarEquals( + Exemplar.builder().value(1.0).labels(Labels.of("test", "test2")).build(), + getData(counter).getExemplar()); + } + + @Test + void incWithExemplar2() { + Counter counter = Counter.builder().name("count_total").build(); + counter.incWithExemplar(1.0, Labels.of("test", "test2")); + + assertExemplarEquals( + Exemplar.builder().value(1.0).labels(Labels.of("test", "test2")).build(), + getData(counter).getExemplar()); + } + + @Test + public void testExemplarSamplerDisabled() { + Counter counter = Counter.builder().name("count_total").withoutExemplars().build(); + counter.incWithExemplar(3.0, Labels.of("a", "b")); + assertThat(getData(counter).getExemplar()).isNull(); + counter.inc(2.0); + assertThat(getData(counter).getExemplar()).isNull(); + } + + @Test + public void testExemplarSamplerDisabled_enabledByDefault() { + PrometheusProperties properties = + PrometheusProperties.builder() + .defaultMetricsProperties(MetricsProperties.builder().exemplarsEnabled(true).build()) + .build(); + Counter counter = Counter.builder(properties).name("count_total").withoutExemplars().build(); + counter.incWithExemplar(3.0, Labels.of("a", "b")); + assertThat(getData(counter).getExemplar()).isNull(); + counter.inc(2.0); + assertThat(getData(counter).getExemplar()).isNull(); + } + + @Test + public void testExemplarSamplerDisabledInBuilder_enabledByPropertiesOnMetric() { + PrometheusProperties properties = + PrometheusProperties.builder() + .putMetricProperty("count", MetricsProperties.builder().exemplarsEnabled(true).build()) + .build(); + Counter counter = Counter.builder(properties).name("count_total").withoutExemplars().build(); + counter.incWithExemplar(3.0, Labels.of("a", "b")); + assertThat(getData(counter).getExemplar()).isNull(); + counter.inc(2.0); + assertThat(getData(counter).getExemplar()).isNull(); + } + + @Test + public void testConstLabelsFirst() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + Counter.builder() + .name("test_total") + .constLabels(Labels.of("const_a", "const_b")) + .labelNames("const.a") + .build()); + } + + @Test + public void testConstLabelsSecond() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + Counter.builder() + .name("test_total") + .labelNames("const.a") + .constLabels(Labels.of("const_a", "const_b")) + .build()); + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/CounterWithCallbackTest.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/CounterWithCallbackTest.java new file mode 100644 index 000000000..47c5f5c57 --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/CounterWithCallbackTest.java @@ -0,0 +1,46 @@ +package io.prometheus.metrics.core.metrics; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.assertj.core.data.Offset.offset; + +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Test; + +class CounterWithCallbackTest { + + @Test + public void testCounter() { + final AtomicInteger value = new AtomicInteger(1); + List labelValues = Arrays.asList("v1", "v2"); + CounterWithCallback counter = + CounterWithCallback.builder() + .name("counter") + .labelNames("l1", "l2") + .callback( + callback -> callback.call(value.doubleValue(), labelValues.toArray(new String[0]))) + .build(); + CounterSnapshot snapshot = counter.collect(); + + assertThat(snapshot.getDataPoints().size()).isOne(); + CounterSnapshot.CounterDataPointSnapshot datapoint = snapshot.getDataPoints().get(0); + assertThat(datapoint.getValue()).isCloseTo(value.doubleValue(), offset(0.1)); + assertThat(datapoint.getLabels().size()).isEqualTo(labelValues.size()); + + value.incrementAndGet(); + snapshot = counter.collect(); + assertThat(snapshot.getDataPoints().size()).isOne(); + datapoint = snapshot.getDataPoints().get(0); + assertThat(datapoint.getValue()).isCloseTo(value.doubleValue(), offset(0.1)); + } + + @Test + public void testCounterNoCallback() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> CounterWithCallback.builder().name("counter").labelNames("l1", "l2").build()); + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/GaugeTest.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/GaugeTest.java new file mode 100644 index 000000000..108fc05ce --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/GaugeTest.java @@ -0,0 +1,245 @@ +package io.prometheus.metrics.core.metrics; + +import static io.prometheus.metrics.core.metrics.TestUtil.assertExemplarEquals; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.data.Offset.offset; + +import io.prometheus.metrics.config.MetricsProperties; +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.datapoints.Timer; +import io.prometheus.metrics.core.exemplars.ExemplarSamplerConfigTestUtil; +import io.prometheus.metrics.model.snapshots.Exemplar; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.tracer.common.SpanContext; +import io.prometheus.metrics.tracer.initializer.SpanContextSupplier; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class GaugeTest { + + private static final long exemplarSampleIntervalMillis = 10; + private static final long exemplarMinAgeMillis = 100; + + private Gauge noLabels, labels; + + private SpanContext origSpanContext; + + @BeforeEach + public void setUp() { + noLabels = Gauge.builder().name("nolabels").build(); + labels = Gauge.builder().name("labels").labelNames("l").build(); + origSpanContext = SpanContextSupplier.getSpanContext(); + } + + @AfterEach + public void tearDown() { + SpanContextSupplier.setSpanContext(origSpanContext); + } + + private GaugeSnapshot.GaugeDataPointSnapshot getData(Gauge gauge, String... labels) { + return gauge.collect().getDataPoints().stream() + .filter(data -> data.getLabels().equals(Labels.of(labels))) + .findAny() + .orElseThrow(RuntimeException::new); + } + + private double getValue(Gauge gauge, String... labels) { + return getData(gauge, labels).getValue(); + } + + @Test + public void testIncrement() { + noLabels.inc(); + assertThat(getValue(noLabels)).isCloseTo(1.0, offset(.001)); + noLabels.inc(2); + assertThat(getValue(noLabels)).isCloseTo(3.0, offset(.001)); + noLabels.inc(4); + assertThat(getValue(noLabels)).isCloseTo(7.0, offset(.001)); + noLabels.inc(); + assertThat(getValue(noLabels)).isCloseTo(8.0, offset(.001)); + } + + @Test + public void testDecrement() { + noLabels.dec(); + assertThat(getValue(noLabels)).isCloseTo(-1.0, offset(.001)); + noLabels.dec(2); + assertThat(getValue(noLabels)).isCloseTo(-3.0, offset(.001)); + noLabels.dec(4); + assertThat(getValue(noLabels)).isCloseTo(-7.0, offset(.001)); + noLabels.dec(); + assertThat(getValue(noLabels)).isCloseTo(-8.0, offset(.001)); + } + + @Test + public void testSet() { + noLabels.set(42); + assertThat(getValue(noLabels)).isCloseTo(42, offset(.001)); + noLabels.set(7); + assertThat(getValue(noLabels)).isCloseTo(7.0, offset(.001)); + } + + @Test + @SuppressWarnings("try") + public void testTimer() throws InterruptedException { + try (Timer ignored = noLabels.startTimer()) { + Thread.sleep(12); + } + assertThat(getValue(noLabels)) + .isCloseTo(0.012, offset(0.005)); // 5ms delta should be enough so this isn't flaky + } + + @Test + public void noLabelsDefaultZeroValue() { + assertThat(getValue(noLabels)).isCloseTo(0.0, offset(.001)); + } + + @Test + public void testLabels() { + labels.labelValues("a").inc(); + labels.labelValues("b").inc(3); + assertThat(getValue(labels, "l", "a")).isCloseTo(1.0, offset(.001)); + assertThat(getValue(labels, "l", "b")).isCloseTo(3.0, offset(.001)); + } + + @Test + public void testExemplarSampler() throws Exception { + Exemplar exemplar1 = Exemplar.builder().value(2.0).traceId("abc").spanId("123").build(); + Exemplar exemplar2 = Exemplar.builder().value(6.5).traceId("def").spanId("456").build(); + Exemplar exemplar3 = Exemplar.builder().value(7.0).traceId("123").spanId("abc").build(); + Exemplar customExemplar = + Exemplar.builder() + .value(8.0) + .traceId("bab") + .spanId("cdc") + .labels(Labels.of("test", "test")) + .build(); + SpanContext spanContext = + new SpanContext() { + private int callNumber = 0; + + @Override + public String getCurrentTraceId() { + return switch (callNumber) { + case 1 -> "abc"; + case 3 -> "def"; + case 4 -> "123"; + case 5 -> "bab"; + default -> throw new RuntimeException("unexpected call"); + }; + } + + @Override + public String getCurrentSpanId() { + return switch (callNumber) { + case 1 -> "123"; + case 3 -> "456"; + case 4 -> "abc"; + case 5 -> "cdc"; + default -> throw new RuntimeException("unexpected call"); + }; + } + + @Override + public boolean isCurrentSpanSampled() { + callNumber++; + return callNumber != 2; + } + + @Override + public void markCurrentSpanAsExemplar() {} + }; + Gauge gauge = Gauge.builder().name("my_gauge").build(); + + ExemplarSamplerConfigTestUtil.setMinRetentionPeriodMillis(gauge, exemplarMinAgeMillis); + ExemplarSamplerConfigTestUtil.setSampleIntervalMillis(gauge, exemplarSampleIntervalMillis); + SpanContextSupplier.setSpanContext(spanContext); + + gauge.inc(2.0); + assertExemplarEquals(exemplar1, getData(gauge).getExemplar()); + + Thread.sleep(2 * exemplarSampleIntervalMillis); + + gauge.inc( + 3.0); // min age not reached -> keep the previous exemplar, exemplar sampler not called + assertExemplarEquals(exemplar1, getData(gauge).getExemplar()); + + Thread.sleep(exemplarMinAgeMillis + 2 * exemplarSampleIntervalMillis); + + gauge.inc(2.0); // 2nd call: isSampled() returns false -> not sampled + assertExemplarEquals(exemplar1, getData(gauge).getExemplar()); + + Thread.sleep(2 * exemplarSampleIntervalMillis); + + gauge.dec(0.5); // sampled + assertExemplarEquals(exemplar2, getData(gauge).getExemplar()); + + Thread.sleep(exemplarMinAgeMillis + 2 * exemplarSampleIntervalMillis); + + gauge.set(7.0); // sampled + assertExemplarEquals(exemplar3, getData(gauge).getExemplar()); + + Thread.sleep(2 * exemplarSampleIntervalMillis); + + gauge.incWithExemplar( + Labels.of( + "test", + "test")); // custom exemplar sampled even though the automatic exemplar hasn't reached + // min age yet + assertExemplarEquals(customExemplar, getData(gauge).getExemplar()); + } + + @Test + void incWithExemplar() { + Gauge gauge = Gauge.builder().name("count").build(); + gauge.incWithExemplar(1.0, Labels.of("test", "test2")); + + assertExemplarEquals( + Exemplar.builder().value(1.0).labels(Labels.of("test", "test2")).build(), + getData(gauge).getExemplar()); + } + + @Test + void dec() { + Gauge gauge = Gauge.builder().name("count").build(); + gauge.decWithExemplar(Labels.of("test", "test2")); + + assertExemplarEquals( + Exemplar.builder().value(-1.0).labels(Labels.of("test", "test2")).build(), + getData(gauge).getExemplar()); + } + + @Test + void decWithExemplar() { + Gauge gauge = Gauge.builder().name("count").build(); + gauge.decWithExemplar(1.0, Labels.of("test", "test2")); + + assertExemplarEquals( + Exemplar.builder().value(-1.0).labels(Labels.of("test", "test2")).build(), + getData(gauge).getExemplar()); + } + + @Test + public void testExemplarSamplerDisabled() { + Gauge gauge = Gauge.builder().name("test").withoutExemplars().build(); + gauge.setWithExemplar(3.0, Labels.of("a", "b")); + assertThat(getData(gauge).getExemplar()).isNull(); + gauge.inc(2.0); + assertThat(getData(gauge).getExemplar()).isNull(); + } + + @Test + public void testExemplarSamplerDisabledByBuilder_enabledByPropertiesOnMetric() { + PrometheusProperties properties = + PrometheusProperties.builder() + .putMetricProperty("test", MetricsProperties.builder().exemplarsEnabled(true).build()) + .build(); + Gauge gauge = Gauge.builder(properties).name("test").withoutExemplars().build(); + gauge.setWithExemplar(3.0, Labels.of("a", "b")); + assertThat(getData(gauge).getExemplar()).isNull(); + gauge.inc(2.0); + assertThat(getData(gauge).getExemplar()).isNull(); + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/GaugeWithCallbackTest.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/GaugeWithCallbackTest.java new file mode 100644 index 000000000..92a2d605e --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/GaugeWithCallbackTest.java @@ -0,0 +1,45 @@ +package io.prometheus.metrics.core.metrics; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.assertj.core.data.Offset.offset; + +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Test; + +class GaugeWithCallbackTest { + + @Test + public void testGauge() { + final AtomicInteger value = new AtomicInteger(1); + List labelValues = Arrays.asList("v1", "v2"); + GaugeWithCallback gauge = + GaugeWithCallback.builder() + .name("gauge") + .labelNames("l1", "l2") + .callback( + callback -> callback.call(value.doubleValue(), labelValues.toArray(new String[0]))) + .build(); + GaugeSnapshot snapshot = gauge.collect(); + + assertThat(snapshot.getDataPoints().size()).isOne(); + GaugeSnapshot.GaugeDataPointSnapshot datapoint = snapshot.getDataPoints().get(0); + assertThat(datapoint.getValue()).isCloseTo(value.doubleValue(), offset(0.1)); + assertThat(datapoint.getLabels().size()).isEqualTo(labelValues.size()); + + value.incrementAndGet(); + snapshot = gauge.collect(); + assertThat(snapshot.getDataPoints().size()).isOne(); + datapoint = snapshot.getDataPoints().get(0); + assertThat(datapoint.getValue()).isCloseTo(value.doubleValue(), offset(0.1)); + } + + @Test + public void testGaugeNoCallback() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> GaugeWithCallback.builder().name("gauge").labelNames("l1", "l2").build()); + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/HistogramTest.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/HistogramTest.java new file mode 100644 index 000000000..0a17dccd3 --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/HistogramTest.java @@ -0,0 +1,1539 @@ +package io.prometheus.metrics.core.metrics; + +import static io.prometheus.metrics.core.metrics.TestUtil.assertExemplarEquals; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.assertj.core.data.Offset.offset; + +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.config.MetricsProperties; +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.datapoints.DistributionDataPoint; +import io.prometheus.metrics.core.exemplars.ExemplarSamplerConfigTestUtil; +import io.prometheus.metrics.expositionformats.OpenMetricsTextFormatWriter; +import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics; +import io.prometheus.metrics.expositionformats.internal.PrometheusProtobufWriterImpl; +import io.prometheus.metrics.expositionformats.internal.ProtobufUtil; +import io.prometheus.metrics.model.snapshots.*; +import io.prometheus.metrics.tracer.common.SpanContext; +import io.prometheus.metrics.tracer.initializer.SpanContextSupplier; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Random; +import java.util.concurrent.CompletionService; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorCompletionService; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.stream.Collectors; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class HistogramTest { + + private static final double RESET_DURATION_REACHED = + -123.456; // just a random value indicating that we should simulate that the reset duration + // has been reached + + private SpanContext origSpanContext; + + @BeforeEach + public void setUp() { + origSpanContext = SpanContextSupplier.getSpanContext(); + } + + @AfterEach + public void tearDown() { + SpanContextSupplier.setSpanContext(origSpanContext); + } + + /** Mimic the tests in client_golang. */ + private static class GolangTestCase { + final String name; + final String expected; + final Histogram histogram; + final double[] observations; + + private GolangTestCase( + String name, String expected, Histogram histogram, double... observations) { + this.name = name; + this.expected = expected; + this.histogram = histogram; + this.observations = observations; + } + + private void run() throws NoSuchFieldException, IllegalAccessException { + System.out.println("Running " + name + "..."); + for (double observation : observations) { + if (observation == RESET_DURATION_REACHED) { + Field resetAllowed = Histogram.DataPoint.class.getDeclaredField("resetDurationExpired"); + resetAllowed.setAccessible(true); + resetAllowed.set(histogram.getNoLabels(), true); + } else { + histogram.observe(observation); + } + } + Metrics.MetricFamily protobufData = + new PrometheusProtobufWriterImpl() + .convert(histogram.collect(), EscapingScheme.ALLOW_UTF8); + String expectedWithMetadata = + "name: \"test\" type: HISTOGRAM metric { histogram { " + expected + " } }"; + assertThat(ProtobufUtil.shortDebugString(protobufData)) + .as("test \"" + name + "\" failed") + .isEqualTo(expectedWithMetadata); + } + } + + /** Test cases copied from histogram_test.go in client_golang. */ + @Test + public void testGolangTests() throws NoSuchFieldException, IllegalAccessException { + GolangTestCase[] testCases = + new GolangTestCase[] { + new GolangTestCase( + "'no sparse buckets' from client_golang", + "sample_count: 3 " + + "sample_sum: 6.0 " + + "bucket { cumulative_count: 0 upper_bound: 0.005 } " + + "bucket { cumulative_count: 0 upper_bound: 0.01 } " + + "bucket { cumulative_count: 0 upper_bound: 0.025 } " + + "bucket { cumulative_count: 0 upper_bound: 0.05 } " + + "bucket { cumulative_count: 0 upper_bound: 0.1 } " + + "bucket { cumulative_count: 0 upper_bound: 0.25 } " + + "bucket { cumulative_count: 0 upper_bound: 0.5 } " + + "bucket { cumulative_count: 1 upper_bound: 1.0 } " + + "bucket { cumulative_count: 2 upper_bound: 2.5 } " + + "bucket { cumulative_count: 3 upper_bound: 5.0 } " + + "bucket { cumulative_count: 3 upper_bound: 10.0 } " + + "bucket { cumulative_count: 3 upper_bound: Infinity }", + Histogram.builder().name("test").classicOnly().build(), + 1.0, + 2.0, + 3.0), + new GolangTestCase( + "'factor 1.1 results in schema 3' from client_golang", + "sample_count: 4 " + + "sample_sum: 6.0 " + + "schema: 3 " + + "zero_threshold: 0.0 " + + "zero_count: 1 " + + "positive_span { offset: 0 length: 1 } " + + "positive_span { offset: 7 length: 1 } " + + "positive_span { offset: 4 length: 1 } " + + "positive_delta: 1 " + + "positive_delta: 0 " + + "positive_delta: 0", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(3) + .nativeMaxZeroThreshold(0) + .build(), + 0.0, + 1.0, + 2.0, + 3.0), + new GolangTestCase( + "'factor 1.2 results in schema 2' from client_golang", + "sample_count: 6 " + + "sample_sum: 7.4 " + + "schema: 2 " + + "zero_threshold: 0.0 " + + "zero_count: 1 " + + "positive_span { offset: 0 length: 5 } " + + "positive_delta: 1 " + + "positive_delta: -1 " + + "positive_delta: 2 " + + "positive_delta: -2 " + + "positive_delta: 2", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(2) + .nativeMaxZeroThreshold(0) + .build(), + 0, + 1, + 1.2, + 1.4, + 1.8, + 2), + new GolangTestCase( + "'factor 4 results in schema -1' from client_golang", + "sample_count: 14 " + + "sample_sum: 63.2581251 " + + "schema: -1 " + + "zero_threshold: 0.0 " + + "zero_count: 0 " + + "positive_span { offset: -2 length: 6 } " + + "positive_delta: 2 " + + "positive_delta: 0 " + + "positive_delta: 0 " + + "positive_delta: 2 " + + "positive_delta: -1 " + + "positive_delta: -2", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(-1) + .nativeMaxZeroThreshold(0) + .build(), + 0.0156251, + 0.0625, // Bucket -2: (0.015625, 0.0625) + 0.1, + 0.25, // Bucket -1: (0.0625, 0.25] + 0.5, + 1, // Bucket 0: (0.25, 1] + 1.5, + 2, + 3, + 3.5, // Bucket 1: (1, 4] + 5, + 6, + 7, // Bucket 2: (4, 16] + 33.33 // Bucket 3: (16, 64] + ), + new GolangTestCase( + "'factor 17 results in schema -2' from client_golang", + "sample_count: 14 " + + "sample_sum: 63.2581251 " + + "schema: -2 " + + "zero_threshold: 0.0 " + + "zero_count: 0 " + + "positive_span { offset: -1 length: 4 } " + + "positive_delta: 2 " + + "positive_delta: 2 " + + "positive_delta: 3 " + + "positive_delta: -6", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(-2) + .nativeMaxZeroThreshold(0) + .build(), + 0.0156251, + 0.0625, // Bucket -1: (0.015625, 0.0625] + 0.1, + 0.25, + 0.5, + 1, // Bucket 0: (0.0625, 1] + 1.5, + 2, + 3, + 3.5, + 5, + 6, + 7, // Bucket 1: (1, 16] + 33.33 // Bucket 2: (16, 256] + ), + new GolangTestCase( + "'negative buckets' from client_golang", + "sample_count: 6 " + + "sample_sum: -7.4 " + + "schema: 2 " + + "zero_threshold: 0.0 " + + "zero_count: 1 " + + "negative_span { offset: 0 length: 5 } " + + "negative_delta: 1 " + + "negative_delta: -1 " + + "negative_delta: 2 " + + "negative_delta: -2 " + + "negative_delta: 2", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(2) + .nativeMaxZeroThreshold(0) + .build(), + 0, + -1, + -1.2, + -1.4, + -1.8, + -2), + new GolangTestCase( + "'negative and positive buckets' from client_golang", + "sample_count: 11 " + + "sample_sum: 0.0 " + + "schema: 2 " + + "zero_threshold: 0.0 " + + "zero_count: 1 " + + "negative_span { offset: 0 length: 5 } " + + "negative_delta: 1 " + + "negative_delta: -1 " + + "negative_delta: 2 " + + "negative_delta: -2 " + + "negative_delta: 2 " + + "positive_span { offset: 0 length: 5 } " + + "positive_delta: 1 " + + "positive_delta: -1 " + + "positive_delta: 2 " + + "positive_delta: -2 " + + "positive_delta: 2", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(2) + .nativeMaxZeroThreshold(0) + .build(), + 0, + -1, + -1.2, + -1.4, + -1.8, + -2, + 1, + 1.2, + 1.4, + 1.8, + 2), + new GolangTestCase( + "'wide zero bucket' from client_golang", + "sample_count: 11 " + + "sample_sum: 0.0 " + + "schema: 2 " + + "zero_threshold: 1.4 " + + "zero_count: 7 " + + "negative_span { offset: 4 length: 1 } " + + "negative_delta: 2 " + + "positive_span { offset: 4 length: 1 } " + + "positive_delta: 2", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(2) + .nativeMinZeroThreshold(1.4) + .build(), + 0, + -1, + -1.2, + -1.4, + -1.8, + -2, + 1, + 1.2, + 1.4, + 1.8, + 2), + /* + // See https://github.com/prometheus/client_golang/issues/1275 + new TestCase("'NaN observation' from client_golang", + "sample_count: 7 " + + "sample_sum: NaN " + + "schema: 2 " + + "zero_threshold: 0.0 " + + "zero_count: 1 " + + "positive_span { offset: 0 length: 5 } " + + "positive_delta: 1 " + + "positive_delta: -1 " + + "positive_delta: 2 " + + "positive_delta: -2 " + + "positive_delta: 2", + Histogram.builder() + .name("test") + .nativeHistogram() + .nativeSchema(2) + .nativeMaxZeroThreshold(0) + .build(), + 0, 1, 1.2, 1.4, 1.8, 2, Double.NaN + ), + */ + new GolangTestCase( + "'+Inf observation' from client_golang", + "sample_count: 7 " + + "sample_sum: Infinity " + + "schema: 2 " + + "zero_threshold: 0.0 " + + "zero_count: 1 " + + "positive_span { offset: 0 length: 5 } " + + "positive_span { offset: 4092 length: 1 } " + + "positive_delta: 1 " + + "positive_delta: -1 " + + "positive_delta: 2 " + + "positive_delta: -2 " + + "positive_delta: 2 " + + "positive_delta: -1", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(2) + .nativeMaxZeroThreshold(0) + .build(), + 0, + 1, + 1.2, + 1.4, + 1.8, + 2, + Double.POSITIVE_INFINITY), + new GolangTestCase( + "'-Inf observation' from client_golang", + "sample_count: 7 " + + "sample_sum: -Infinity " + + "schema: 2 " + + "zero_threshold: 0.0 " + + "zero_count: 1 " + + "negative_span { offset: 4097 length: 1 } " + + "negative_delta: 1 " + + "positive_span { offset: 0 length: 5 } " + + "positive_delta: 1 " + + "positive_delta: -1 " + + "positive_delta: 2 " + + "positive_delta: -2 " + + "positive_delta: 2", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(2) + .nativeMaxZeroThreshold(0) + .build(), + 0, + 1, + 1.2, + 1.4, + 1.8, + 2, + Double.NEGATIVE_INFINITY), + new GolangTestCase( + "'limited buckets but nothing triggered' from client_golang", + "sample_count: 6 " + + "sample_sum: 7.4 " + + "schema: 2 " + + "zero_threshold: 0.0 " + + "zero_count: 1 " + + "positive_span { offset: 0 length: 5 } " + + "positive_delta: 1 " + + "positive_delta: -1 " + + "positive_delta: 2 " + + "positive_delta: -2 " + + "positive_delta: 2", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(2) + .nativeMaxZeroThreshold(0) + .nativeMaxNumberOfBuckets(4) + .build(), + 0, + 1, + 1.2, + 1.4, + 1.8, + 2), + new GolangTestCase( + "'buckets limited by halving resolution' from client_golang", + "sample_count: 8 " + + "sample_sum: 11.5 " + + "schema: 1 " + + "zero_threshold: 0.0 " + + "zero_count: 1 " + + "positive_span { offset: 0 length: 5 } " + + "positive_delta: 1 " + + "positive_delta: 2 " + + "positive_delta: -1 " + + "positive_delta: -2 " + + "positive_delta: 1", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(2) + .nativeMaxZeroThreshold(0) + .nativeMaxNumberOfBuckets(4) + .build(), + 0, + 1, + 1.1, + 1.2, + 1.4, + 1.8, + 2, + 3), + new GolangTestCase( + "'buckets limited by widening the zero bucket' from client_golang", + "sample_count: 8 " + + "sample_sum: 11.5 " + + "schema: 2 " + + "zero_threshold: 1.0 " + + "zero_count: 2 " + + "positive_span { offset: 1 length: 7 } " + + "positive_delta: 1 " + + "positive_delta: 1 " + + "positive_delta: -2 " + + "positive_delta: 2 " + + "positive_delta: -2 " + + "positive_delta: 0 " + + "positive_delta: 1", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(2) + .nativeMaxZeroThreshold(1.2) + .nativeMaxNumberOfBuckets(4) + .build(), + 0, + 1, + 1.1, + 1.2, + 1.4, + 1.8, + 2, + 3), + new GolangTestCase( + "'buckets limited by widening the zero bucket twice' from client_golang", + "sample_count: 9 " + + "sample_sum: 15.5 " + + "schema: 2 " + + "zero_threshold: 1.189207115002721 " + + "zero_count: 3 " + + "positive_span { offset: 2 length: 7 } " + + "positive_delta: 2 " + + "positive_delta: -2 " + + "positive_delta: 2 " + + "positive_delta: -2 " + + "positive_delta: 0 " + + "positive_delta: 1 " + + "positive_delta: 0", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(2) + .nativeMaxZeroThreshold(1.2) + .nativeMaxNumberOfBuckets(4) + .build(), + 0, + 1, + 1.1, + 1.2, + 1.4, + 1.8, + 2, + 3, + 4), + new GolangTestCase( + "'buckets limited by reset' from client_golang", + "sample_count: 2 " + + "sample_sum: 7.0 " + + "schema: 2 " + + "zero_threshold: 0.0 " + + "zero_count: 0 " + + "positive_span { offset: 7 length: 2 } " + + "positive_delta: 1 " + + "positive_delta: 0", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(2) + .nativeMaxZeroThreshold(1.2) + .nativeMinZeroThreshold(0) + .nativeMaxNumberOfBuckets(4) + .build(), + 0, + 1, + 1.1, + 1.2, + 1.4, + 1.8, + 2, + RESET_DURATION_REACHED, + 3, + 4), + new GolangTestCase( + "'limited buckets but nothing triggered, negative observations' from client_golang", + "sample_count: 6 " + + "sample_sum: -7.4 " + + "schema: 2 " + + "zero_threshold: 0.0 " + + "zero_count: 1 " + + "negative_span { offset: 0 length: 5 } " + + "negative_delta: 1 " + + "negative_delta: -1 " + + "negative_delta: 2 " + + "negative_delta: -2 " + + "negative_delta: 2", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(2) + .nativeMaxZeroThreshold(0) + .nativeMaxNumberOfBuckets(4) + .build(), + 0, + -1, + -1.2, + -1.4, + -1.8, + -2), + new GolangTestCase( + "'buckets limited by halving resolution, negative observations' from client_golang", + "sample_count: 8 " + + "sample_sum: -11.5 " + + "schema: 1 " + + "zero_threshold: 0.0 " + + "zero_count: 1 " + + "negative_span { offset: 0 length: 5 } " + + "negative_delta: 1 " + + "negative_delta: 2 " + + "negative_delta: -1 " + + "negative_delta: -2 " + + "negative_delta: 1", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(2) + .nativeMaxZeroThreshold(0) + .nativeMaxNumberOfBuckets(4) + .build(), + 0, + -1, + -1.1, + -1.2, + -1.4, + -1.8, + -2, + -3), + new GolangTestCase( + "'buckets limited by widening the zero bucket, negative observations' from" + + " client_golang", + "sample_count: 8 " + + "sample_sum: -11.5 " + + "schema: 2 " + + "zero_threshold: 1.0 " + + "zero_count: 2 " + + "negative_span { offset: 1 length: 7 } " + + "negative_delta: 1 " + + "negative_delta: 1 " + + "negative_delta: -2 " + + "negative_delta: 2 " + + "negative_delta: -2 " + + "negative_delta: 0 " + + "negative_delta: 1", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(2) + .nativeMaxZeroThreshold(1.2) + .nativeMaxNumberOfBuckets(4) + .build(), + 0, + -1, + -1.1, + -1.2, + -1.4, + -1.8, + -2, + -3), + new GolangTestCase( + "'buckets limited by widening the zero bucket twice, negative observations' from" + + " client_golang", + "sample_count: 9 " + + "sample_sum: -15.5 " + + "schema: 2 " + + "zero_threshold: 1.189207115002721 " + + "zero_count: 3 " + + "negative_span { offset: 2 length: 7 } " + + "negative_delta: 2 " + + "negative_delta: -2 " + + "negative_delta: 2 " + + "negative_delta: -2 " + + "negative_delta: 0 " + + "negative_delta: 1 " + + "negative_delta: 0", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(2) + .nativeMaxZeroThreshold(1.2) + .nativeMaxNumberOfBuckets(4) + .build(), + 0, + -1, + -1.1, + -1.2, + -1.4, + -1.8, + -2, + -3, + -4), + new GolangTestCase( + "'buckets limited by reset, negative observations' from client_golang", + "sample_count: 2 " + + "sample_sum: -7.0 " + + "schema: 2 " + + "zero_threshold: " + + Math.pow(2.0, -128.0) + + " " + + "zero_count: 0 " + + "negative_span { offset: 7 length: 2 } " + + "negative_delta: 1 " + + "negative_delta: 0", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(2) + .nativeMaxZeroThreshold(1.2) + .nativeMaxNumberOfBuckets(4) + .build(), + 0, + -1, + -1.1, + -1.2, + -1.4, + -1.8, + -2, + RESET_DURATION_REACHED, + -3, + -4), + new GolangTestCase( + "'buckets limited by halving resolution, then reset' from client_golang", + "sample_count: 2 " + + "sample_sum: 7.0 " + + "schema: 2 " + + "zero_threshold: 0.0 " + + "zero_count: 0 " + + "positive_span { offset: 7 length: 2 } " + + "positive_delta: 1 " + + "positive_delta: 0", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(2) + .nativeMaxZeroThreshold(0) + .nativeMaxNumberOfBuckets(4) + .build(), + 0, + 1, + 1.1, + 1.2, + 1.4, + 1.8, + 2, + 5, + 5.1, + RESET_DURATION_REACHED, + 3, + 4), + new GolangTestCase( + "'buckets limited by widening the zero bucket, then reset' from client_golang", + "sample_count: 2 " + + "sample_sum: 7.0 " + + "schema: 2 " + + "zero_threshold: " + + Math.pow(2.0, -128.0) + + " " + + "zero_count: 0 " + + "positive_span { offset: 7 length: 2 } " + + "positive_delta: 1 " + + "positive_delta: 0", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(2) + .nativeMaxZeroThreshold(1.2) + .nativeMaxNumberOfBuckets(4) + .build(), + 0, + 1, + 1.1, + 1.2, + 1.4, + 1.8, + 2, + 5, + 5.1, + RESET_DURATION_REACHED, + 3, + 4) + }; + for (GolangTestCase testCase : testCases) { + testCase.run(); + } + } + + /** Additional tests that are not part of client_golang's test suite. */ + @Test + public void testAdditional() throws NoSuchFieldException, IllegalAccessException { + GolangTestCase[] testCases = + new GolangTestCase[] { + new GolangTestCase( + "observed values are exactly at bucket boundaries", + "sample_count: 3 " + + "sample_sum: 1.5 " + + "schema: 0 " + + "zero_threshold: 0.0 " + + "zero_count: 1 " + + "positive_span { offset: -1 length: 2 } " + + "positive_delta: 1 " + + "positive_delta: 0", + Histogram.builder() + .name("test") + .nativeOnly() + .nativeInitialSchema(0) + .nativeMaxZeroThreshold(0) + .build(), + 0.0, + 0.5, + 1.0) + }; + for (GolangTestCase testCase : testCases) { + testCase.run(); + } + } + + /** + * Tests HistogramData.nativeBucketIndexToUpperBound(int, int). + * + *

    This test is ported from client_golang's TestGetLe(). + */ + @Test + public void testNativeBucketIndexToUpperBound() + throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { + int[] indexes = new int[] {-1, 0, 1, 512, 513, -1, 0, 1, 1024, 1025, -1, 0, 1, 4096, 4097}; + int[] schemas = new int[] {-1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2}; + double[] expectedUpperBounds = + new double[] { + 0.25, + 1, + 4, + Double.MAX_VALUE, + Double.POSITIVE_INFINITY, + 0.5, + 1, + 2, + Double.MAX_VALUE, + Double.POSITIVE_INFINITY, + 0.8408964152537144, + 1, + 1.189207115002721, + Double.MAX_VALUE, + Double.POSITIVE_INFINITY + }; + Method method = + Histogram.DataPoint.class.getDeclaredMethod( + "nativeBucketIndexToUpperBound", int.class, int.class); + method.setAccessible(true); + for (int i = 0; i < indexes.length; i++) { + Histogram histogram = + Histogram.builder().name("test").nativeInitialSchema(schemas[i]).build(); + Histogram.DataPoint histogramData = histogram.newDataPoint(); + double result = (double) method.invoke(histogramData, schemas[i], indexes[i]); + assertThat(result) + .as("index=" + indexes[i] + ", schema=" + schemas[i]) + .isCloseTo(expectedUpperBounds[i], offset(0.0000000000001)); + } + } + + /** + * Test if lowerBound < value <= upperBound is true for the bucket index returned by + * findBucketIndex() + */ + @Test + public void testFindBucketIndex() + throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { + Random rand = new Random(); + Method findBucketIndex = + Histogram.DataPoint.class.getDeclaredMethod("findBucketIndex", double.class); + Method nativeBucketIndexToUpperBound = + Histogram.DataPoint.class.getDeclaredMethod( + "nativeBucketIndexToUpperBound", int.class, int.class); + findBucketIndex.setAccessible(true); + nativeBucketIndexToUpperBound.setAccessible(true); + for (int schema = -4; schema <= 8; schema++) { + Histogram histogram = + Histogram.builder().nativeOnly().name("test").nativeInitialSchema(schema).build(); + for (int i = 0; i < 10_000; i++) { + for (int zeros = -5; zeros <= 10; zeros++) { + double value = rand.nextDouble() * Math.pow(10, zeros); + int bucketIndex = (int) findBucketIndex.invoke(histogram.getNoLabels(), value); + double lowerBound = + (double) + nativeBucketIndexToUpperBound.invoke( + histogram.getNoLabels(), schema, bucketIndex - 1); + double upperBound = + (double) + nativeBucketIndexToUpperBound.invoke( + histogram.getNoLabels(), schema, bucketIndex); + assertThat(lowerBound < value && upperBound >= value) + .as( + "Bucket index " + + bucketIndex + + " with schema " + + schema + + " has range [" + + lowerBound + + ", " + + upperBound + + "]. Value " + + value + + " is outside of that range.") + .isTrue(); + } + } + } + } + + @Test + public void testDefaults() throws IOException { + Histogram histogram = Histogram.builder().name("test").build(); + histogram.observe(0.5); + HistogramSnapshot snapshot = histogram.collect(); + String expectedProtobuf = + "name: \"test\" " + + "type: HISTOGRAM " + + "metric { " + + "histogram { " + + "sample_count: 1 " + + "sample_sum: 0.5 " + + + // default has both, native and classic buckets + "bucket { cumulative_count: 0 upper_bound: 0.005 } " + + "bucket { cumulative_count: 0 upper_bound: 0.01 } " + + "bucket { cumulative_count: 0 upper_bound: 0.025 } " + + "bucket { cumulative_count: 0 upper_bound: 0.05 } " + + "bucket { cumulative_count: 0 upper_bound: 0.1 } " + + "bucket { cumulative_count: 0 upper_bound: 0.25 } " + + "bucket { cumulative_count: 1 upper_bound: 0.5 } " + + "bucket { cumulative_count: 1 upper_bound: 1.0 } " + + "bucket { cumulative_count: 1 upper_bound: 2.5 } " + + "bucket { cumulative_count: 1 upper_bound: 5.0 } " + + "bucket { cumulative_count: 1 upper_bound: 10.0 } " + + "bucket { cumulative_count: 1 upper_bound: Infinity } " + + + // default native schema is 5 + "schema: 5 " + + + // default zero threshold is 2^-128 + "zero_threshold: " + + Math.pow(2.0, -128.0) + + " " + + "zero_count: 0 " + + "positive_span { offset: -32 length: 1 } " + + "positive_delta: 1 " + + "} }"; + String expectedTextFormat = + // default classic buckets + """ + # TYPE test histogram + test_bucket{le="0.005"} 0 + test_bucket{le="0.01"} 0 + test_bucket{le="0.025"} 0 + test_bucket{le="0.05"} 0 + test_bucket{le="0.1"} 0 + test_bucket{le="0.25"} 0 + test_bucket{le="0.5"} 1 + test_bucket{le="1.0"} 1 + test_bucket{le="2.5"} 1 + test_bucket{le="5.0"} 1 + test_bucket{le="10.0"} 1 + test_bucket{le="+Inf"} 1 + test_count 1 + test_sum 0.5 + # EOF + """; + + // protobuf + Metrics.MetricFamily protobufData = + new PrometheusProtobufWriterImpl().convert(snapshot, EscapingScheme.ALLOW_UTF8); + assertThat(ProtobufUtil.shortDebugString(protobufData)).isEqualTo(expectedProtobuf); + + // text + ByteArrayOutputStream out = new ByteArrayOutputStream(); + OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter(false, true); + writer.write(out, MetricSnapshots.of(snapshot), EscapingScheme.ALLOW_UTF8); + assertThat(out).hasToString(expectedTextFormat); + } + + @Test + public void testExemplarsClassicHistogram() throws Exception { + SpanContext spanContext = + new SpanContext() { + int callCount = 0; + + @Override + public String getCurrentTraceId() { + return "traceId-" + callCount; + } + + @Override + public String getCurrentSpanId() { + return "spanId-" + callCount; + } + + @Override + public boolean isCurrentSpanSampled() { + callCount++; + return true; + } + + @Override + public void markCurrentSpanAsExemplar() {} + }; + Histogram histogram = + Histogram.builder() + .name("test") + // The default number of Exemplars is 4. + // Use 5 buckets to verify that the exemplar sample is configured with the buckets. + .classicUpperBounds(1.0, 2.0, 3.0, 4.0, Double.POSITIVE_INFINITY) + .labelNames("path") + .build(); + + long sampleIntervalMillis = 10; + ExemplarSamplerConfigTestUtil.setSampleIntervalMillis(histogram, sampleIntervalMillis); + SpanContextSupplier.setSpanContext(spanContext); + + Exemplar ex1a = Exemplar.builder().value(0.5).spanId("spanId-1").traceId("traceId-1").build(); + Exemplar ex1b = Exemplar.builder().value(0.5).spanId("spanId-2").traceId("traceId-2").build(); + Exemplar ex2a = Exemplar.builder().value(4.5).spanId("spanId-3").traceId("traceId-3").build(); + Exemplar ex2b = Exemplar.builder().value(4.5).spanId("spanId-4").traceId("traceId-4").build(); + Exemplar ex3a = Exemplar.builder().value(1.5).spanId("spanId-5").traceId("traceId-5").build(); + Exemplar ex3b = Exemplar.builder().value(1.5).spanId("spanId-6").traceId("traceId-6").build(); + Exemplar ex4a = Exemplar.builder().value(2.5).spanId("spanId-7").traceId("traceId-7").build(); + Exemplar ex4b = Exemplar.builder().value(2.5).spanId("spanId-8").traceId("traceId-8").build(); + Exemplar ex5a = Exemplar.builder().value(3.5).spanId("spanId-9").traceId("traceId-9").build(); + Exemplar ex5b = Exemplar.builder().value(3.5).spanId("spanId-10").traceId("traceId-10").build(); + histogram.labelValues("/hello").observe(0.5); + histogram + .labelValues("/world") + .observe(0.5); // different labels are tracked independently, i.e. we don't need to wait for + // sampleIntervalMillis + + HistogramSnapshot snapshot = histogram.collect(); + assertExemplarEquals(ex1a, getExemplar(snapshot, 1.0, "path", "/hello")); + assertExemplarEquals(ex1b, getExemplar(snapshot, 1.0, "path", "/world")); + assertThat(getExemplar(snapshot, 2.0, "path", "/hello")).isNull(); + assertThat(getExemplar(snapshot, 2.0, "path", "/world")).isNull(); + assertThat(getExemplar(snapshot, 3.0, "path", "/hello")).isNull(); + assertThat(getExemplar(snapshot, 3.0, "path", "/world")).isNull(); + assertThat(getExemplar(snapshot, 4.0, "path", "/hello")).isNull(); + assertThat(getExemplar(snapshot, 4.0, "path", "/world")).isNull(); + assertThat(getExemplar(snapshot, Double.POSITIVE_INFINITY, "path", "/hello")).isNull(); + assertThat(getExemplar(snapshot, Double.POSITIVE_INFINITY, "path", "/world")).isNull(); + + Thread.sleep(sampleIntervalMillis + 1); + histogram.labelValues("/hello").observe(4.5); + histogram.labelValues("/world").observe(4.5); + + snapshot = histogram.collect(); + assertExemplarEquals(ex1a, getExemplar(snapshot, 1.0, "path", "/hello")); + assertExemplarEquals(ex1b, getExemplar(snapshot, 1.0, "path", "/world")); + assertThat(getExemplar(snapshot, 2.0, "path", "/hello")).isNull(); + assertThat(getExemplar(snapshot, 2.0, "path", "/world")).isNull(); + assertThat(getExemplar(snapshot, 3.0, "path", "/hello")).isNull(); + assertThat(getExemplar(snapshot, 3.0, "path", "/world")).isNull(); + assertThat(getExemplar(snapshot, 4.0, "path", "/hello")).isNull(); + assertThat(getExemplar(snapshot, 4.0, "path", "/world")).isNull(); + assertExemplarEquals(ex2a, getExemplar(snapshot, Double.POSITIVE_INFINITY, "path", "/hello")); + assertExemplarEquals(ex2b, getExemplar(snapshot, Double.POSITIVE_INFINITY, "path", "/world")); + + Thread.sleep(sampleIntervalMillis + 1); + histogram.labelValues("/hello").observe(1.5); + histogram.labelValues("/world").observe(1.5); + Thread.sleep(sampleIntervalMillis + 1); + histogram.labelValues("/hello").observe(2.5); + histogram.labelValues("/world").observe(2.5); + Thread.sleep(sampleIntervalMillis + 1); + histogram.labelValues("/hello").observe(3.5); + histogram.labelValues("/world").observe(3.5); + + snapshot = histogram.collect(); + assertExemplarEquals(ex1a, getExemplar(snapshot, 1.0, "path", "/hello")); + assertExemplarEquals(ex1b, getExemplar(snapshot, 1.0, "path", "/world")); + assertExemplarEquals(ex3a, getExemplar(snapshot, 2.0, "path", "/hello")); + assertExemplarEquals(ex3b, getExemplar(snapshot, 2.0, "path", "/world")); + assertExemplarEquals(ex4a, getExemplar(snapshot, 3.0, "path", "/hello")); + assertExemplarEquals(ex4b, getExemplar(snapshot, 3.0, "path", "/world")); + assertExemplarEquals(ex5a, getExemplar(snapshot, 4.0, "path", "/hello")); + assertExemplarEquals(ex5b, getExemplar(snapshot, 4.0, "path", "/world")); + assertExemplarEquals(ex2a, getExemplar(snapshot, Double.POSITIVE_INFINITY, "path", "/hello")); + assertExemplarEquals(ex2b, getExemplar(snapshot, Double.POSITIVE_INFINITY, "path", "/world")); + + Exemplar custom = + Exemplar.builder() + .value(3.4) + .labels( + Labels.of( + "key2", + "value2", + "key1", + "value1", + "trace_id", + "traceId-11", + "span_id", + "spanId-11")) + .build(); + Thread.sleep(sampleIntervalMillis + 1); + histogram + .labelValues("/hello") + .observeWithExemplar(3.4, Labels.of("key1", "value1", "key2", "value2")); + snapshot = histogram.collect(); + // custom exemplars have preference, so the automatic exemplar is replaced + assertExemplarEquals(custom, getExemplar(snapshot, 4.0, "path", "/hello")); + } + + private Exemplar getExemplar(HistogramSnapshot snapshot, double le, String... labels) { + HistogramSnapshot.HistogramDataPointSnapshot data = + snapshot.getDataPoints().stream() + .filter(d -> d.getLabels().equals(Labels.of(labels))) + .findFirst() + .orElseThrow(() -> new RuntimeException("Labels not found")); + double lowerBound = Double.NEGATIVE_INFINITY; + for (ClassicHistogramBucket bucket : data.getClassicBuckets()) { + if (bucket.getUpperBound() == le) { + break; + } else { + lowerBound = bucket.getUpperBound(); + } + } + return data.getExemplars().get(lowerBound, le); + } + + @Test + public void testCustomExemplarsClassicHistogram() + throws InterruptedException, NoSuchFieldException, IllegalAccessException { + + // TODO: This was copied from the old simpleclient, can probably be refactored. + + Histogram histogram = Histogram.builder().name("test").withExemplars().build(); + + long sampleIntervalMillis = 10; + ExemplarSamplerConfigTestUtil.setSampleIntervalMillis(histogram, sampleIntervalMillis); + ExemplarSamplerConfigTestUtil.setMinRetentionPeriodMillis(histogram, 3 * sampleIntervalMillis); + + Labels labels = Labels.of("mapKey1", "mapValue1", "mapKey2", "mapValue2"); + + histogram.observeWithExemplar(0.5, Labels.of("key", "value")); + assertExemplar(histogram, 0.5, "key", "value"); + + Thread.sleep(sampleIntervalMillis * 3 + 1); + histogram.observeWithExemplar(0.5, Labels.EMPTY); + assertExemplar(histogram, 0.5); + + Thread.sleep(sampleIntervalMillis * 3 + 1); + histogram.observeWithExemplar(0.5, labels); + assertExemplar(histogram, 0.5, "mapKey1", "mapValue1", "mapKey2", "mapValue2"); + + // default buckets are {.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10} + Thread.sleep(sampleIntervalMillis * 3 + 1); + histogram.observeWithExemplar(2.0, Labels.of("key1", "value1", "key2", "value2")); + assertExemplar(histogram, 2.0, "key1", "value1", "key2", "value2"); + assertExemplar(histogram, 0.5, "mapKey1", "mapValue1", "mapKey2", "mapValue2"); + + Thread.sleep(sampleIntervalMillis * 3 + 1); + histogram.observeWithExemplar(0.4, Labels.EMPTY); // same bucket as 0.5 + assertExemplar(histogram, 0.4); + assertExemplar(histogram, 2.0, "key1", "value1", "key2", "value2"); + } + + private void assertExemplar(Histogram histogram, double value, String... labels) { + double lowerBound = Double.NEGATIVE_INFINITY; + double upperBound = Double.POSITIVE_INFINITY; + HistogramSnapshot snapshot = histogram.collect(); + HistogramSnapshot.HistogramDataPointSnapshot data = + snapshot.getDataPoints().stream() + .filter(d -> d.getLabels().isEmpty()) + .findFirst() + .orElseThrow(() -> new RuntimeException("No data without labels found")); + for (ClassicHistogramBucket bucket : data.getClassicBuckets()) { + if (bucket.getUpperBound() >= value) { + upperBound = bucket.getUpperBound(); + break; + } else { + lowerBound = bucket.getUpperBound(); + } + } + Exemplar exemplar = data.getExemplars().get(lowerBound, upperBound); + assertThat(exemplar) + .as("No exemplar found in bucket [" + lowerBound + ", " + upperBound + "]") + .isNotNull(); + assertThat(exemplar.getValue()).isEqualTo(value); + assertThat(exemplar.getLabels().size()) + .as("" + exemplar.getLabels()) + .isEqualTo(labels.length / 2); + for (int i = 0; i < labels.length; i += 2) { + assertThat(exemplar.getLabels().getName(i / 2)).isEqualTo(labels[i]); + assertThat(exemplar.getLabels().getValue(i / 2)).isEqualTo(labels[i + 1]); + } + } + + @Test + public void testExemplarsNativeHistogram() throws NoSuchFieldException, IllegalAccessException { + + SpanContext spanContext = + new SpanContext() { + int callCount = 0; + + @Override + public String getCurrentTraceId() { + return "traceId-" + callCount; + } + + @Override + public String getCurrentSpanId() { + return "spanId-" + callCount; + } + + @Override + public boolean isCurrentSpanSampled() { + callCount++; + return true; + } + + @Override + public void markCurrentSpanAsExemplar() {} + }; + Histogram histogram = Histogram.builder().name("test").nativeOnly().labelNames("path").build(); + + long sampleIntervalMillis = 10; + ExemplarSamplerConfigTestUtil.setSampleIntervalMillis(histogram, sampleIntervalMillis); + SpanContextSupplier.setSpanContext(spanContext); + + Exemplar ex1 = Exemplar.builder().value(3.11).spanId("spanId-1").traceId("traceId-1").build(); + Exemplar ex2 = Exemplar.builder().value(3.12).spanId("spanId-2").traceId("traceId-2").build(); + Exemplar ex3 = + Exemplar.builder() + .value(3.13) + .spanId("spanId-3") + .traceId("traceId-3") + .labels(Labels.of("key1", "value1", "key2", "value2")) + .build(); + + histogram.labelValues("/hello").observe(3.11); + histogram.labelValues("/world").observe(3.12); + assertThat(getData(histogram, "path", "/hello").getExemplars().size()).isOne(); + assertExemplarEquals( + ex1, getData(histogram, "path", "/hello").getExemplars().iterator().next()); + assertThat(getData(histogram, "path", "/world").getExemplars().size()).isOne(); + assertExemplarEquals( + ex2, getData(histogram, "path", "/world").getExemplars().iterator().next()); + + histogram + .labelValues("/world") + .observeWithExemplar(3.13, Labels.of("key1", "value1", "key2", "value2")); + assertThat(getData(histogram, "path", "/hello").getExemplars().size()).isOne(); + assertExemplarEquals( + ex1, getData(histogram, "path", "/hello").getExemplars().iterator().next()); + assertThat(getData(histogram, "path", "/world").getExemplars().size()).isEqualTo(2); + Exemplars exemplars = getData(histogram, "path", "/world").getExemplars(); + List exemplarList = new ArrayList<>(exemplars.size()); + for (Exemplar exemplar : exemplars) { + exemplarList.add(exemplar); + } + exemplarList.sort(Comparator.comparingDouble(Exemplar::getValue)); + assertThat(exemplars.size()).isEqualTo(2); + assertExemplarEquals(ex2, exemplarList.get(0)); + assertExemplarEquals(ex3, exemplarList.get(1)); + } + + @Test + public void testIllegalLabelName() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> Histogram.builder().name("test").labelNames("label", "le")); + } + + @Test + public void testIllegalLabelNameConstLabels() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + Histogram.builder() + .name("test") + .constLabels(Labels.of("label1", "value1", "le", "0.3"))); + } + + @Test + public void testIllegalLabelNamePrefix() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> Histogram.builder().name("test").labelNames("__hello")); + } + + @Test + public void testNoName() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> Histogram.builder().build()); + } + + @Test + public void testNullName() { + assertThatExceptionOfType(NullPointerException.class) + .isThrownBy(() -> Histogram.builder().name(null)); + } + + @Test + public void testDuplicateClassicBuckets() { + Histogram histogram = + Histogram.builder().name("test").classicUpperBounds(0, 3, 17, 3, 21).build(); + List upperBounds = + getData(histogram).getClassicBuckets().stream() + .map(ClassicHistogramBucket::getUpperBound) + .collect(Collectors.toList()); + assertThat(upperBounds) + .isEqualTo(Arrays.asList(0.0, 3.0, 17.0, 21.0, Double.POSITIVE_INFINITY)); + } + + @Test + public void testUnsortedBuckets() { + Histogram histogram = Histogram.builder().name("test").classicUpperBounds(0.2, 0.1).build(); + List upperBounds = + getData(histogram).getClassicBuckets().stream() + .map(ClassicHistogramBucket::getUpperBound) + .collect(Collectors.toList()); + assertThat(upperBounds).isEqualTo(Arrays.asList(0.1, 0.2, Double.POSITIVE_INFINITY)); + } + + @Test + public void testEmptyBuckets() { + Histogram histogram = Histogram.builder().name("test").classicUpperBounds().build(); + List upperBounds = + getData(histogram).getClassicBuckets().stream() + .map(ClassicHistogramBucket::getUpperBound) + .collect(Collectors.toList()); + assertThat(upperBounds).isEqualTo(Collections.singletonList(Double.POSITIVE_INFINITY)); + } + + @Test + public void testBucketsIncludePositiveInfinity() { + Histogram histogram = + Histogram.builder() + .name("test") + .classicUpperBounds(0.01, 0.1, 1.0, Double.POSITIVE_INFINITY) + .build(); + List upperBounds = + getData(histogram).getClassicBuckets().stream() + .map(ClassicHistogramBucket::getUpperBound) + .collect(Collectors.toList()); + assertThat(upperBounds).isEqualTo(Arrays.asList(0.01, 0.1, 1.0, Double.POSITIVE_INFINITY)); + } + + @Test + public void testLinearBuckets() { + Histogram histogram = + Histogram.builder().name("test").classicLinearUpperBounds(0.1, 0.1, 10).build(); + List upperBounds = + getData(histogram).getClassicBuckets().stream() + .map(ClassicHistogramBucket::getUpperBound) + .collect(Collectors.toList()); + assertThat(upperBounds) + .isEqualTo( + Arrays.asList( + 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, Double.POSITIVE_INFINITY)); + } + + @Test + public void testExponentialBuckets() { + Histogram histogram = + Histogram.builder().classicExponentialUpperBounds(2, 2.5, 3).name("test").build(); + List upperBounds = + getData(histogram).getClassicBuckets().stream() + .map(ClassicHistogramBucket::getUpperBound) + .collect(Collectors.toList()); + assertThat(upperBounds).isEqualTo(Arrays.asList(2.0, 5.0, 12.5, Double.POSITIVE_INFINITY)); + } + + @Test + public void testBucketsIncludeNaN() { + assertThatExceptionOfType(RuntimeException.class) + .isThrownBy( + () -> Histogram.builder().name("test").classicUpperBounds(0.01, 0.1, 1.0, Double.NaN)); + } + + @Test + public void testNoLabelsDefaultZeroValue() { + Histogram noLabels = Histogram.builder().name("test").build(); + assertThat(getBucket(noLabels, 0.005).getCount()).isZero(); + assertThat(getData(noLabels).getCount()).isZero(); + assertThat(getData(noLabels).getSum()).isEqualTo(0.0); + } + + private ClassicHistogramBucket getBucket(Histogram histogram, double le, String... labels) { + return getData(histogram, labels).getClassicBuckets().stream() + .filter(b -> b.getUpperBound() == le) + .findAny() + .orElseThrow(() -> new RuntimeException("bucket with le=" + le + " not found.")); + } + + @Test + public void testObserve() { + Histogram noLabels = Histogram.builder().name("test").build(); + noLabels.observe(2); + assertThat(noLabels.getCount()).isOne(); + assertThat(noLabels.getSum()).isCloseTo(2.0, offset(.0)); + assertThat(getData(noLabels).getCount()).isOne(); + assertThat(getData(noLabels).getSum()).isCloseTo(2.0, offset(.0)); + assertThat(getBucket(noLabels, 1).getCount()).isZero(); + assertThat(getBucket(noLabels, 2.5).getCount()).isOne(); + noLabels.observe(4); + assertThat(getData(noLabels).getCount()).isEqualTo(2); + assertThat(getData(noLabels).getSum()).isCloseTo(6.0, offset(.0)); + assertThat(getBucket(noLabels, 1).getCount()).isZero(); + assertThat(getBucket(noLabels, 2.5).getCount()).isOne(); + assertThat(getBucket(noLabels, 5).getCount()).isOne(); + assertThat(getBucket(noLabels, 10).getCount()).isZero(); + assertThat(getBucket(noLabels, Double.POSITIVE_INFINITY).getCount()).isZero(); + } + + @Test + // See https://github.com/prometheus/client_java/issues/646 + public void testNegativeAmount() { + Histogram histogram = + Histogram.builder() + .name("histogram") + .help("test histogram for negative values") + .classicUpperBounds(-10, -5, 0, 5, 10) + .build(); + double expectedCount = 0; + double expectedSum = 0; + for (int i = 10; i >= -11; i--) { + histogram.observe(i); + expectedCount++; + expectedSum += i; + assertThat(getData(histogram).getSum()).isCloseTo(expectedSum, offset(.001)); + assertThat(getData(histogram).getCount()).isEqualTo((long) expectedCount); + } + List expectedBucketCounts = + Arrays.asList(2L, 5L, 5L, 5L, 5L, 0L); // buckets -10, -5, 0, 5, 10, +Inf + List actualBucketCounts = + getData(histogram).getClassicBuckets().stream() + .map(ClassicHistogramBucket::getCount) + .collect(Collectors.toList()); + assertThat(actualBucketCounts).isEqualTo(expectedBucketCounts); + } + + @Test + public void testBoundaryConditions() { + Histogram histogram = Histogram.builder().name("test").build(); + histogram.observe(2.5); + assertThat(getBucket(histogram, 1).getCount()).isZero(); + assertThat(getBucket(histogram, 2.5).getCount()).isOne(); + + histogram.observe(Double.POSITIVE_INFINITY); + assertThat(getBucket(histogram, 1).getCount()).isZero(); + assertThat(getBucket(histogram, 2.5).getCount()).isOne(); + assertThat(getBucket(histogram, 5).getCount()).isZero(); + assertThat(getBucket(histogram, 10).getCount()).isZero(); + assertThat(getBucket(histogram, Double.POSITIVE_INFINITY).getCount()).isOne(); + } + + @Test + public void testExemplarsDisabledInBuilder() { + Histogram histogram = Histogram.builder().withoutExemplars().name("test").build(); + histogram.observeWithExemplar(2.5, Labels.EMPTY); + assertThat(getData(histogram).getExemplars().size()).isZero(); + } + + @Test + public void testExemplarsDisabledInBuilder_enabledByPropertiesOnMetric() { + PrometheusProperties properties = + PrometheusProperties.builder() + .putMetricProperty("test", MetricsProperties.builder().exemplarsEnabled(true).build()) + .defaultMetricsProperties(MetricsProperties.builder().build()) + .build(); + Histogram histogram = Histogram.builder(properties).withoutExemplars().name("test").build(); + histogram.observeWithExemplar(2.5, Labels.EMPTY); + assertThat(getData(histogram).getExemplars().size()).isZero(); + } + + @Test + public void testObserveWithLabels() { + Histogram histogram = + Histogram.builder() + .name("test") + .constLabels(Labels.of("env", "prod")) + .labelNames("path", "status") + .build(); + histogram.labelValues("/hello", "200").observe(0.11); + DistributionDataPoint distributionDataPoint = histogram.labelValues("/hello", "200"); + assertThat(distributionDataPoint.getCount()).isOne(); + assertThat(distributionDataPoint.getSum()).isCloseTo(0.11, offset(.0)); + histogram.labelValues("/hello", "200").observe(0.2); + histogram.labelValues("/hello", "500").observe(0.19); + HistogramSnapshot.HistogramDataPointSnapshot data200 = + getData(histogram, "env", "prod", "path", "/hello", "status", "200"); + HistogramSnapshot.HistogramDataPointSnapshot data500 = + getData(histogram, "env", "prod", "path", "/hello", "status", "500"); + assertThat(data200.getCount()).isEqualTo(2); + assertThat(data200.getSum()).isCloseTo(0.31, offset(0.0000001)); + assertThat(data500.getCount()).isOne(); + assertThat(data500.getSum()).isCloseTo(0.19, offset(0.0000001)); + histogram.labelValues("/hello", "200").observe(0.13); + data200 = getData(histogram, "env", "prod", "path", "/hello", "status", "200"); + data500 = getData(histogram, "env", "prod", "path", "/hello", "status", "500"); + assertThat(data200.getCount()).isEqualTo(3); + assertThat(data200.getSum()).isCloseTo(0.44, offset(0.0000001)); + assertThat(data500.getCount()).isOne(); + assertThat(data500.getSum()).isCloseTo(0.19, offset(0.0000001)); + } + + @Test + public void testObserveMultithreaded() + throws InterruptedException, ExecutionException, TimeoutException { + // Hard to test concurrency, but let's run a couple of observations in parallel and assert none + // gets lost. + Histogram histogram = Histogram.builder().name("test").labelNames("status").build(); + int nThreads = 8; + DistributionDataPoint obs = histogram.labelValues("200"); + ExecutorService executor = Executors.newFixedThreadPool(nThreads); + CompletionService> completionService = + new ExecutorCompletionService<>(executor); + CountDownLatch startSignal = new CountDownLatch(nThreads); + for (int t = 0; t < nThreads; t++) { + completionService.submit( + () -> { + List snapshots = new ArrayList<>(); + startSignal.countDown(); + startSignal.await(); + for (int i = 0; i < 10; i++) { + for (int j = 0; j < 1000; j++) { + obs.observe(1.1); + } + snapshots.add(histogram.collect()); + } + return snapshots; + }); + } + long maxCount = 0; + for (int i = 0; i < nThreads; i++) { + Future> future = completionService.take(); + List snapshots = future.get(5, TimeUnit.SECONDS); + long count = 0; + for (HistogramSnapshot snapshot : snapshots) { + assertThat(snapshot.getDataPoints().size()).isOne(); + HistogramSnapshot.HistogramDataPointSnapshot data = + snapshot.getDataPoints().stream().findFirst().orElseThrow(RuntimeException::new); + assertThat(data.getCount()) + .isGreaterThanOrEqualTo( + (count + 1000)); // 1000 own observations plus the ones from other threads + count = data.getCount(); + } + if (count > maxCount) { + maxCount = count; + } + } + assertThat(maxCount) + .isEqualTo(nThreads * 10_000L); // the last collect() has seen all observations + assertThat(nThreads * 10_000).isEqualTo(getBucket(histogram, 2.5, "status", "200").getCount()); + executor.shutdown(); + assertThat(executor.awaitTermination(5, TimeUnit.SECONDS)).isTrue(); + } + + private HistogramSnapshot.HistogramDataPointSnapshot getData( + Histogram histogram, String... labels) { + return histogram.collect().getDataPoints().stream() + .filter(d -> d.getLabels().equals(Labels.of(labels))) + .findAny() + .orElseThrow( + () -> + new RuntimeException( + "histogram with labels " + Arrays.toString(labels) + " not found")); + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/InfoTest.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/InfoTest.java new file mode 100644 index 000000000..e47bb7d6c --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/InfoTest.java @@ -0,0 +1,132 @@ +package io.prometheus.metrics.core.metrics; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.expositionformats.OpenMetricsTextFormatWriter; +import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics; +import io.prometheus.metrics.expositionformats.internal.PrometheusProtobufWriterImpl; +import io.prometheus.metrics.expositionformats.internal.ProtobufUtil; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import io.prometheus.metrics.model.snapshots.Unit; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +class InfoTest { + + @ParameterizedTest + @ValueSource(strings = {"jvm.runtime", "jvm.runtime.info"}) + public void testInfoStrippedFromName(String name) { + Info info = Info.builder().name(name).labelNames("my.key").build(); + info.addLabelValues("value"); + Metrics.MetricFamily protobufData = + new PrometheusProtobufWriterImpl().convert(info.collect(), EscapingScheme.ALLOW_UTF8); + assertThat(ProtobufUtil.shortDebugString(protobufData)) + .isEqualTo( + "name: \"jvm.runtime_info\" type: GAUGE metric { label { name: \"my.key\" value:" + + " \"value\" } gauge { value: 1.0 } }"); + } + + @Test + public void testAddAndRemove() { + Info info = Info.builder().name("test_info").labelNames("a", "b").build(); + assertThat(info.collect().getDataPoints()).isEmpty(); + info.addLabelValues("val1", "val2"); + assertThat(info.collect().getDataPoints()).hasSize(1); + info.addLabelValues("val1", "val2"); // already exist, so no change + assertThat(info.collect().getDataPoints()).hasSize(1); + info.addLabelValues("val2", "val2"); + assertThat(info.collect().getDataPoints()).hasSize(2); + info.remove("val1", "val3"); // does not exist, so no change + assertThat(info.collect().getDataPoints()).hasSize(2); + info.remove("val1", "val2"); + assertThat(info.collect().getDataPoints()).hasSize(1); + info.remove("val2", "val2"); + assertThat(info.collect().getDataPoints()).isEmpty(); + + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> info.addLabelValues("val1", "val2", "extra")) + .withMessage( + "Info test was created with 2 label names, but you called addLabelValues() with 3 label" + + " values."); + } + + @Test + public void testSet() throws IOException { + Info info = + Info.builder() + .name("target_info") + .constLabels(Labels.of("service.name", "test", "service.instance.id", "123")) + .labelNames("service.version") + .build(); + info.setLabelValues("1.0.0"); + assertThat(info.collect().getDataPoints()).hasSize(1); + info.setLabelValues("2.0.0"); + assertThat(info.collect().getDataPoints()).hasSize(1); + assertTextFormat( + "target_info{service_instance_id=\"123\",service_name=\"test\",service_version=\"2.0.0\"}" + + " 1\n", + info); + + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> info.setLabelValues("2.0.0", "extra")) + .withMessage( + "Info target was created with 1 label names, but you called setLabelValues() with 2" + + " label values."); + + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> info.remove("2.0.0", "extra")) + .withMessage( + "Info target was created with 1 label names, but you called remove() with 2 label" + + " values."); + } + + @Test + public void testConstLabelsOnly() throws IOException { + Info info = + Info.builder() + .name("target_info") + .constLabels(Labels.of("service.name", "test", "service.instance.id", "123")) + .build(); + assertThat(info.collect().getDataPoints()).hasSize(1); + assertTextFormat("target_info{service_instance_id=\"123\",service_name=\"test\"} 1\n", info); + } + + @Test + void unit() { + assertThatExceptionOfType(UnsupportedOperationException.class) + .isThrownBy(() -> Info.builder().unit(Unit.BYTES).build()) + .withMessage("Info metrics cannot have a unit."); + } + + @Test + public void testConstLabelsDuplicate1() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> Info.builder().constLabels(Labels.of("a_1", "val1")).labelNames("a.1").build()); + } + + @Test + public void testConstLabelsDuplicate2() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> Info.builder().labelNames("a_1").constLabels(Labels.of("a.1", "val1")).build()); + } + + private void assertTextFormat(String expected, Info info) throws IOException { + OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter(true, true); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + writer.write( + outputStream, MetricSnapshots.of(info.collect()), EscapingScheme.UNDERSCORE_ESCAPING); + String result = outputStream.toString(StandardCharsets.UTF_8.name()); + if (!result.contains(expected)) { + throw new AssertionError(expected + " is not contained in the following output:\n" + result); + } + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/SlidingWindowTest.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/SlidingWindowTest.java new file mode 100644 index 000000000..d85e5637c --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/SlidingWindowTest.java @@ -0,0 +1,94 @@ +package io.prometheus.metrics.core.metrics; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicLong; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class SlidingWindowTest { + + class Observer { + + final List values = new ArrayList<>(); + + public void observe(double value) { + values.add(value); + } + + void assertValues(double... expectedValues) { + ArrayList expectedList = new ArrayList<>(); + for (double expectedValue : expectedValues) { + expectedList.add(expectedValue); + } + assertThat(values) + .as( + "Start time: " + + startTime + + ", current time: " + + currentTimeMillis.get() + + ", elapsed time: " + + (currentTimeMillis.get() - startTime)) + .isEqualTo(expectedList); + } + } + + private long startTime; + private final AtomicLong currentTimeMillis = new AtomicLong(); + private SlidingWindow ringBuffer; + private final long maxAgeSeconds = 30; + private final int ageBuckets = 5; + private final long timeBetweenRotateMillis = maxAgeSeconds * 1000 / ageBuckets + 2; + + @BeforeEach + public void setUp() { + startTime = System.currentTimeMillis(); + currentTimeMillis.set(startTime); + ringBuffer = + new SlidingWindow<>( + Observer.class, + Observer::new, + Observer::observe, + maxAgeSeconds, + ageBuckets, + currentTimeMillis::get); + } + + @Test + public void testRotate() { + for (int i = 0; i < ageBuckets; i++) { + currentTimeMillis.addAndGet(timeBetweenRotateMillis); + ringBuffer.observe(1.0); + } + ringBuffer.current().assertValues(1.0, 1.0, 1.0, 1.0, 1.0); + currentTimeMillis.addAndGet(timeBetweenRotateMillis); + ringBuffer.current().assertValues(1.0, 1.0, 1.0, 1.0); + currentTimeMillis.addAndGet(timeBetweenRotateMillis); + ringBuffer.current().assertValues(1.0, 1.0, 1.0); + currentTimeMillis.addAndGet(timeBetweenRotateMillis); + ringBuffer.current().assertValues(1.0, 1.0); + currentTimeMillis.addAndGet(timeBetweenRotateMillis); + ringBuffer.current().assertValues(1.0); + currentTimeMillis.addAndGet(timeBetweenRotateMillis); + ringBuffer.current().assertValues(); + } + + @Test + public void testMultiRotate() { + ringBuffer.observe(1.0); + currentTimeMillis.addAndGet(2 * timeBetweenRotateMillis); // 2/5 of max aqe + ringBuffer.observe(2.0); + ringBuffer.current().assertValues(1.0, 2.0); + currentTimeMillis.addAndGet( + 3 * timeBetweenRotateMillis); // 5/5 of max age -> first observation evicted + ringBuffer.current().assertValues(2.0); + ringBuffer.observe(3.0); + ringBuffer.current().assertValues(2.0, 3.0); + currentTimeMillis.addAndGet(2 * timeBetweenRotateMillis); // 7/5 of max age + ringBuffer.current().assertValues(3.0); + currentTimeMillis.addAndGet(3 * timeBetweenRotateMillis); // 10/5 of max age + ringBuffer.current().assertValues(); // empty + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/StateSetTest.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/StateSetTest.java new file mode 100644 index 000000000..7d466335b --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/StateSetTest.java @@ -0,0 +1,90 @@ +package io.prometheus.metrics.core.metrics; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.StateSetSnapshot; +import java.util.Arrays; +import org.junit.jupiter.api.Test; + +class StateSetTest { + + enum MyFeatureFlag { + EXPERIMENTAL_FEATURE_1 { + @Override + public String toString() { + return "feature1"; + } + }, + + EXPERIMENTAL_FEATURE_2 { + @Override + public String toString() { + return "feature2"; + } + } + } + + @Test + public void testEnumStateSet() { + StateSet stateSet = + StateSet.builder() + .name("feature_flags") + .labelNames("environment") + .states(MyFeatureFlag.class) + .build(); + stateSet.labelValues("dev").setTrue(MyFeatureFlag.EXPERIMENTAL_FEATURE_2); + stateSet.labelValues("prod").setFalse(MyFeatureFlag.EXPERIMENTAL_FEATURE_2); + StateSetSnapshot snapshot = stateSet.collect(); + assertThat(snapshot.getDataPoints()).hasSize(2); + assertThat(getData(stateSet, "environment", "dev").size()).isEqualTo(2); + assertThat(getData(stateSet, "environment", "dev").getName(0)).isEqualTo("feature1"); + assertThat(getData(stateSet, "environment", "dev").isTrue(0)).isFalse(); + assertThat(getData(stateSet, "environment", "dev").getName(1)).isEqualTo("feature2"); + assertThat(getData(stateSet, "environment", "dev").isTrue(1)).isTrue(); + assertThat(getData(stateSet, "environment", "prod").size()).isEqualTo(2); + assertThat(getData(stateSet, "environment", "prod").getName(0)).isEqualTo("feature1"); + assertThat(getData(stateSet, "environment", "prod").isTrue(0)).isFalse(); + assertThat(getData(stateSet, "environment", "prod").getName(1)).isEqualTo("feature2"); + assertThat(getData(stateSet, "environment", "prod").isTrue(1)).isFalse(); + } + + @Test + public void testDefaultFalse() { + StateSet stateSet = + StateSet.builder().name("test").states("state1", "state2", "state3").build(); + assertThat(getData(stateSet).size()).isEqualTo(3); + assertThat(getData(stateSet).getName(0)).isEqualTo("state1"); + assertThat(getData(stateSet).isTrue(0)).isFalse(); + assertThat(getData(stateSet).getName(1)).isEqualTo("state2"); + assertThat(getData(stateSet).isTrue(1)).isFalse(); + assertThat(getData(stateSet).getName(2)).isEqualTo("state3"); + assertThat(getData(stateSet).isTrue(2)).isFalse(); + } + + @Test + void illegalName() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> StateSet.builder().name("state1").states("state1", "state2").build()) + .withMessage( + "Label name state1 is illegal (can't use the metric name as label name in state set" + + " metrics)"); + } + + private StateSetSnapshot.StateSetDataPointSnapshot getData(StateSet stateSet, String... labels) { + return stateSet.collect().getDataPoints().stream() + .filter(d -> d.getLabels().equals(Labels.of(labels))) + .findAny() + .orElseThrow( + () -> + new RuntimeException( + "stateset with labels " + Arrays.toString(labels) + " not found")); + } + + @Test + public void testStatesCannotBeEmpty() { + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy(() -> StateSet.builder().name("invalid").build()); + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/StatefulMetricTest.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/StatefulMetricTest.java new file mode 100644 index 000000000..00aa53bbd --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/StatefulMetricTest.java @@ -0,0 +1,104 @@ +package io.prometheus.metrics.core.metrics; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class StatefulMetricTest { + + @Test + public void testLabelRemoveWhileCollecting() throws Exception { + Counter counter = Counter.builder().name("test").labelNames("label1", "label2").build(); + Field data = counter.getClass().getSuperclass().getDeclaredField("data"); + data.setAccessible(true); + + counter.labelValues("a", "b").inc(1.0); + counter.labelValues("c", "d").inc(3.0); + counter.labelValues("e", "f").inc(7.0); + + // collect() iterates over data.entrySet(). + // remove() removes entries from data. + // Make sure iterating does not yield null while removing. + + int i = 0; + for (Map.Entry entry : ((Map) data.get(counter)).entrySet()) { + i++; + if (i == 2) { + counter.remove("c", "d"); + counter.remove("e", "f"); + } + assertThat(entry.getKey()).isNotNull(); + assertThat(entry.getValue()).isNotNull(); + } + } + + @Test + @SuppressWarnings("unchecked") + public void testLabelRemoveIf() throws Exception { + Counter counter = + Counter.builder().name("testLabelRemoveIf").labelNames("label1", "label2").build(); + Field data = counter.getClass().getSuperclass().getDeclaredField("data"); + data.setAccessible(true); + + counter.labelValues("a", "b").inc(1.0); + counter.labelValues("a", "c").inc(3.0); + counter.labelValues("a", "d").inc(7.0); + counter.labelValues("e", "f").inc(8.0); + + counter.removeIf(labels -> labels.size() == 2 && labels.get(0).equals("a")); + + Map, Counter.DataPoint> dataPoints = + (Map, Counter.DataPoint>) data.get(counter); + + assertThat(dataPoints).hasSize(1); + assertThat(dataPoints.get(Arrays.asList("e", "f"))).isNotNull(); + assertThat(dataPoints.get(Arrays.asList("e", "f")).get()).isEqualTo(8.0D); + } + + @Test + public void testClear() { + Counter counter = Counter.builder().name("test").labelNames("label1", "label2").build(); + counter.labelValues("a", "b").inc(3.0); + counter.labelValues("c", "d").inc(3.0); + counter.labelValues("a", "b").inc(); + assertThat(counter.collect().getDataPoints()).hasSize(2); + + counter.clear(); + assertThat(counter.collect().getDataPoints()).isEmpty(); + + counter.labelValues("a", "b").inc(); + assertThat(counter.collect().getDataPoints()).hasSize(1); + } + + @Test + public void testClearNoLabels() { + Counter counter = Counter.builder().name("test").build(); + counter.inc(); + assertThat(counter.collect().getDataPoints()).hasSize(1); + assertThat(counter.collect().getDataPoints().get(0).getValue()).isEqualTo(1.0); + + counter.clear(); + // No labels is always present, but as no value has been observed after clear() the value should + // be 0.0 + assertThat(counter.collect().getDataPoints()).hasSize(1); + assertThat(counter.collect().getDataPoints().get(0).getValue()).isEqualTo(0.0); + + // Making inc() works correctly after clear() + counter.inc(); + assertThat(counter.collect().getDataPoints()).hasSize(1); + assertThat(counter.collect().getDataPoints().get(0).getValue()).isEqualTo(1.0); + } + + @Test + public void testNullLabel() { + Counter counter = Counter.builder().name("test").labelNames("l1", "l2").build(); + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> counter.labelValues("l1", null)) + .withMessage("null label value for metric test and label l2"); + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/SummaryTest.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/SummaryTest.java new file mode 100644 index 000000000..cdfffe5f0 --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/SummaryTest.java @@ -0,0 +1,212 @@ +package io.prometheus.metrics.core.metrics; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.assertj.core.api.Assertions.fail; +import static org.assertj.core.data.Offset.offset; + +import io.prometheus.metrics.core.datapoints.DistributionDataPoint; +import io.prometheus.metrics.core.datapoints.Timer; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Label; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.Quantile; +import io.prometheus.metrics.model.snapshots.Quantiles; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import io.prometheus.metrics.model.snapshots.Unit; +import java.util.List; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class SummaryTest { + + private final Label label = new Label("name", "value"); + private final Labels labels = Labels.builder().label(label.getName(), label.getValue()).build(); + + private PrometheusRegistry registry; + private Summary noLabels; + private Summary withLabels; + private Summary withLabelsAndQuantiles; + private Summary noLabelsAndQuantiles; + + @BeforeEach + public void setUp() { + registry = new PrometheusRegistry(); + noLabels = + Summary.builder().name("nolabels").unit(Unit.SECONDS).help("help").register(registry); + withLabels = + Summary.builder() + .name("labels") + .unit(Unit.SECONDS) + .help("help") + .labelNames(label.getName()) + .register(registry); + noLabelsAndQuantiles = + Summary.builder() + .quantile(0.5, 0.05) + .quantile(0.9, 0.01) + .quantile(0.99, 0.001) + .name("no_labels_and_quantiles") + .unit(Unit.SECONDS) + .help("help") + .register(registry); + withLabelsAndQuantiles = + Summary.builder() + .quantile(0.5) + .quantile(0.9) + .quantile(0.99) + .name("labels_and_quantiles") + .unit(Unit.SECONDS) + .help("help") + .labelNames(label.getName()) + .register(registry); + } + + @Test + public void testObserve() { + noLabels.observe(2); + assertThat(noLabels.getCount()).isOne(); + assertThat(noLabels.getSum()).isCloseTo(2.0, offset(.0)); + assertThat(getCount(noLabels, Labels.EMPTY)).isOne(); + assertThat(getSum(noLabels, Labels.EMPTY)).isCloseTo(2.0, offset(.001)); + noLabels.observe(3); + assertThat(getCount(noLabels, Labels.EMPTY)).isEqualTo(2); + assertThat(getSum(noLabels, Labels.EMPTY)).isCloseTo(5.0, offset(.001)); + + withLabels.labelValues(label.getValue()).observe(4); + DistributionDataPoint distributionDataPoint = withLabels.labelValues(label.getValue()); + assertThat(distributionDataPoint.getCount()).isOne(); + assertThat(distributionDataPoint.getSum()).isCloseTo(4.0, offset(.0)); + assertThat(getCount(withLabels, labels)).isOne(); + assertThat(getSum(withLabels, labels)).isCloseTo(4.0, offset(.001)); + + withLabels.labelValues(label.getValue()).observeWithExemplar(6, labels); + assertThat(getCount(withLabels, labels)).isEqualTo(2); + assertThat(getSum(withLabels, labels)).isCloseTo(10.0, offset(.001)); + } + + @Test + public void testNegativeAmount() { + noLabels.observe(-1); + noLabels.observe(-3); + assertThat(getCount(noLabels, Labels.EMPTY)).isEqualTo(2); + assertThat(getSum(noLabels, Labels.EMPTY)).isCloseTo(-4.0, offset(.001)); + } + + @Test + public void testQuantiles() { + int nSamples = 1000000; // simulate one million samples + + for (int i = 1; i <= nSamples; i++) { + // In this test, we observe the numbers from 1 to nSamples, + // because that makes it easy to verify if the quantiles are correct. + withLabelsAndQuantiles.labelValues(label.getValue()).observe(i); + noLabelsAndQuantiles.observe(i); + } + assertThat(0.5 * nSamples) + .isCloseTo(getQuantile(noLabelsAndQuantiles, 0.5, Labels.EMPTY), offset(0.05 * nSamples)); + assertThat(0.9 * nSamples) + .isCloseTo(getQuantile(noLabelsAndQuantiles, 0.9, Labels.EMPTY), offset(0.01 * nSamples)); + assertThat(0.99 * nSamples) + .isCloseTo(getQuantile(noLabelsAndQuantiles, 0.99, Labels.EMPTY), offset(0.001 * nSamples)); + + assertThat(0.5 * nSamples) + .isCloseTo(getQuantile(withLabelsAndQuantiles, 0.5, labels), offset(0.05 * nSamples)); + assertThat(0.9 * nSamples) + .isCloseTo(getQuantile(withLabelsAndQuantiles, 0.9, labels), offset(0.01 * nSamples)); + assertThat(0.99 * nSamples) + .isCloseTo(getQuantile(withLabelsAndQuantiles, 0.99, labels), offset(0.001 * nSamples)); + } + + @Test + public void testMaxAge() throws InterruptedException { + Summary summary = + Summary.builder() + .quantile(0.99, 0.001) + .maxAgeSeconds(1) // After 1s, all observations will be discarded. + .numberOfAgeBuckets(2) // We got 2 buckets, so we discard one bucket every 500ms. + .name("short_attention_span") + .help("help") + .register(registry); + summary.observe(8.0); + assertThat(getQuantile(summary, 0.99, Labels.EMPTY)).isEqualTo(8.0); // From bucket 1. + Thread.sleep(600); + assertThat(getQuantile(summary, 0.99, Labels.EMPTY)).isEqualTo(8.0); // From bucket 2. + Thread.sleep(600); + assertThat(getQuantile(summary, 0.99, Labels.EMPTY)) + .isNaN(); // Bucket 1 again, now it is empty. + } + + @Test + public void testTimer() { + int result = noLabels.time(() -> 123); + assertThat(result).isEqualTo(123); + assertThat(getCount(noLabels, Labels.EMPTY)).isOne(); + + try (Timer timer = noLabels.startTimer()) { + timer.observeDuration(); + assertThat(getCount(noLabels, Labels.EMPTY)).isEqualTo(2); + } + } + + @Test + public void noLabelsDefaultZeroValue() { + assertThat(getCount(noLabels, Labels.EMPTY)).isZero(); + assertThat(getSum(noLabels, Labels.EMPTY)).isCloseTo(0.0, offset(.001)); + } + + @Test + public void testBuilderInvalidNumberOfAgeBuckets() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> Summary.builder().name("name").numberOfAgeBuckets(-1).build()); + } + + @Test + public void testBuilderInvalidMaxAge() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> Summary.builder().name("name").maxAgeSeconds(-1).build()); + } + + @Test + public void testBuilderInvalidQuantile() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> Summary.builder().name("name").quantile(42).build()); + } + + @Test + public void testBuilderInvalidQuantileError() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> Summary.builder().name("name").quantile(0.5, 20).build()); + } + + private double getQuantile(Summary summary, double quantile, Labels labels) { + SummarySnapshot.SummaryDataPointSnapshot datapoint = getDatapoint(summary, labels); + Quantiles quantiles = datapoint.getQuantiles(); + for (Quantile q : quantiles) { + if (q.getQuantile() == quantile) { + return q.getValue(); + } + } + fail("Unable to find quantile"); + return 0.0; + } + + private SummarySnapshot.SummaryDataPointSnapshot getDatapoint(Summary summary, Labels labels) { + SummarySnapshot snapshot = summary.collect(); + List datapoints = snapshot.getDataPoints(); + assertThat(datapoints.size()).isOne(); + SummarySnapshot.SummaryDataPointSnapshot datapoint = datapoints.get(0); + assertThat((Iterable) datapoint.getLabels()).isEqualTo(labels); + return datapoint; + } + + private long getCount(Summary summary, Labels labels) { + SummarySnapshot.SummaryDataPointSnapshot datapoint = getDatapoint(summary, labels); + return datapoint.getCount(); + } + + private double getSum(Summary summary, Labels labels) { + SummarySnapshot.SummaryDataPointSnapshot datapoint = getDatapoint(summary, labels); + return datapoint.getSum(); + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/SummaryWithCallbackTest.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/SummaryWithCallbackTest.java new file mode 100644 index 000000000..929efc597 --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/SummaryWithCallbackTest.java @@ -0,0 +1,57 @@ +package io.prometheus.metrics.core.metrics; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.assertj.core.data.Offset.offset; + +import io.prometheus.metrics.model.snapshots.Quantile; +import io.prometheus.metrics.model.snapshots.Quantiles; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Test; + +class SummaryWithCallbackTest { + + @Test + public void testGauge() { + final AtomicInteger count = new AtomicInteger(1); + final AtomicInteger sum = new AtomicInteger(1); + final Quantiles quantiles = Quantiles.of(new Quantile(0.5, 10)); + List labelValues = Arrays.asList("v1", "v2"); + SummaryWithCallback gauge = + SummaryWithCallback.builder() + .name("summary") + .labelNames("l1", "l2") + .callback( + callback -> { + callback.call( + count.get(), sum.get(), quantiles, labelValues.toArray(new String[0])); + }) + .build(); + SummarySnapshot snapshot = gauge.collect(); + + assertThat(snapshot.getDataPoints().size()).isOne(); + SummarySnapshot.SummaryDataPointSnapshot datapoint = snapshot.getDataPoints().get(0); + assertThat(datapoint.getCount()).isEqualTo(count.get()); + assertThat(datapoint.getSum()).isCloseTo(sum.doubleValue(), offset(0.1)); + assertThat(datapoint.getQuantiles()).isEqualTo(quantiles); + assertThat(datapoint.getLabels().size()).isEqualTo(labelValues.size()); + + count.incrementAndGet(); + sum.incrementAndGet(); + snapshot = gauge.collect(); + assertThat(snapshot.getDataPoints().size()).isOne(); + datapoint = snapshot.getDataPoints().get(0); + assertThat(datapoint.getCount()).isEqualTo(count.get()); + assertThat(datapoint.getSum()).isCloseTo(sum.doubleValue(), offset(0.1)); + } + + @Test + public void testSummaryNoCallback() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> SummaryWithCallback.builder().name("summary").labelNames("l1", "l2").build()); + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/TestUtil.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/TestUtil.java new file mode 100644 index 000000000..8d9a5bd0f --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/TestUtil.java @@ -0,0 +1,16 @@ +package io.prometheus.metrics.core.metrics; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.data.Offset.offset; + +import io.prometheus.metrics.model.snapshots.Exemplar; +import io.prometheus.metrics.model.snapshots.Label; + +class TestUtil { + + public static void assertExemplarEquals(Exemplar expected, Exemplar actual) { + // ignore timestamp + assertThat(actual.getValue()).isCloseTo(expected.getValue(), offset(0.00001)); + assertThat((Iterable) actual.getLabels()).isEqualTo(expected.getLabels()); + } +} diff --git a/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/TodoTest.java b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/TodoTest.java new file mode 100644 index 000000000..417226b94 --- /dev/null +++ b/prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/TodoTest.java @@ -0,0 +1,18 @@ +package io.prometheus.metrics.core.metrics; + +class TodoTest { + + // if a metric with labels is created but never used it has no data. + // The registry's collect() method should skip those metrics to avoid illegal protobuf or text + // format. + + // callback versions of metrics + + // build() called with name == null + + // call inc() without labels, but the metric was created with labels + + // call inc() with labels, but the metric was created without labels + + // for performance: Use return value of withLabels() directly +} diff --git a/prometheus-metrics-core/version-rules.xml b/prometheus-metrics-core/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-core/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-exporter-common/pom.xml b/prometheus-metrics-exporter-common/pom.xml new file mode 100644 index 000000000..73eed61cb --- /dev/null +++ b/prometheus-metrics-exporter-common/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-exporter-common + bundle + + Prometheus Metrics Exporter - Common + + Common functionality for implementing a Prometheus scrape endpoint. + + + + io.prometheus.metrics.exporter.common + + + + + io.prometheus + prometheus-metrics-model + ${project.version} + + + io.prometheus + prometheus-metrics-exposition-textformats + ${project.version} + + + io.prometheus + prometheus-metrics-exposition-formats + ${project.version} + runtime + + + + diff --git a/prometheus-metrics-exporter-common/src/main/java/io/prometheus/metrics/exporter/common/PrometheusHttpExchange.java b/prometheus-metrics-exporter-common/src/main/java/io/prometheus/metrics/exporter/common/PrometheusHttpExchange.java new file mode 100644 index 000000000..b7ac63b28 --- /dev/null +++ b/prometheus-metrics-exporter-common/src/main/java/io/prometheus/metrics/exporter/common/PrometheusHttpExchange.java @@ -0,0 +1,16 @@ +package io.prometheus.metrics.exporter.common; + +import java.io.IOException; + +public interface PrometheusHttpExchange extends AutoCloseable { + PrometheusHttpRequest getRequest(); + + PrometheusHttpResponse getResponse(); + + void handleException(IOException e) throws IOException; + + void handleException(RuntimeException e); + + @Override + void close(); +} diff --git a/prometheus-metrics-exporter-common/src/main/java/io/prometheus/metrics/exporter/common/PrometheusHttpRequest.java b/prometheus-metrics-exporter-common/src/main/java/io/prometheus/metrics/exporter/common/PrometheusHttpRequest.java new file mode 100644 index 000000000..3af9996e3 --- /dev/null +++ b/prometheus-metrics-exporter-common/src/main/java/io/prometheus/metrics/exporter/common/PrometheusHttpRequest.java @@ -0,0 +1,70 @@ +package io.prometheus.metrics.exporter.common; + +import io.prometheus.metrics.model.registry.PrometheusScrapeRequest; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.util.ArrayList; +import java.util.Enumeration; +import javax.annotation.Nullable; + +public interface PrometheusHttpRequest extends PrometheusScrapeRequest { + + /** See {@code jakarta.servlet.http.HttpServletRequest.getQueryString()} */ + String getQueryString(); + + /** See {@code jakarta.servlet.http.HttpServletRequest.getHeaders(String)} */ + Enumeration getHeaders(String name); + + /** See {@code jakarta.servlet.http.HttpServletRequest.getMethod()} */ + String getMethod(); + + /** See {@code jakarta.servlet.http.HttpServletRequest.getHeader(String)} */ + @Nullable + default String getHeader(String name) { + Enumeration headers = getHeaders(name); + if (headers == null || !headers.hasMoreElements()) { + return null; + } else { + return headers.nextElement(); + } + } + + /** See {@code jakarta.servlet.ServletRequest.getParameter(String)} */ + @Nullable + default String getParameter(String name) { + String[] values = getParameterValues(name); + if (values == null || values.length == 0) { + return null; + } else { + return values[0]; + } + } + + /** See {@code jakarta.servlet.ServletRequest.getParameterValues(String)} */ + @Override + @Nullable + default String[] getParameterValues(String name) { + try { + ArrayList result = new ArrayList<>(); + String queryString = getQueryString(); + if (queryString != null) { + String[] pairs = queryString.split("&"); + for (String pair : pairs) { + int idx = pair.indexOf("="); + if (idx != -1 && URLDecoder.decode(pair.substring(0, idx), "UTF-8").equals(name)) { + result.add(URLDecoder.decode(pair.substring(idx + 1), "UTF-8")); + } + } + } + if (result.isEmpty()) { + // Servlet API: getParameterValues() returns null if the parameter does not exist. + return null; + } else { + return result.toArray(new String[0]); + } + } catch (UnsupportedEncodingException e) { + // UTF-8 encoding not supported. + throw new RuntimeException(e); + } + } +} diff --git a/prometheus-metrics-exporter-common/src/main/java/io/prometheus/metrics/exporter/common/PrometheusHttpResponse.java b/prometheus-metrics-exporter-common/src/main/java/io/prometheus/metrics/exporter/common/PrometheusHttpResponse.java new file mode 100644 index 000000000..b3dd4e2fb --- /dev/null +++ b/prometheus-metrics-exporter-common/src/main/java/io/prometheus/metrics/exporter/common/PrometheusHttpResponse.java @@ -0,0 +1,17 @@ +package io.prometheus.metrics.exporter.common; + +import java.io.IOException; +import java.io.OutputStream; + +public interface PrometheusHttpResponse { + + /** See {@code jakarta.servlet.http.HttpServletResponse.setHeader(String, String)} */ + void setHeader(String name, String value); + + /** + * This is equivalent to calling {@link + * com.sun.net.httpserver.HttpExchange#sendResponseHeaders(int, long)} followed by {@link + * com.sun.net.httpserver.HttpExchange#getResponseBody()}. + */ + OutputStream sendHeadersAndGetBody(int statusCode, int contentLength) throws IOException; +} diff --git a/prometheus-metrics-exporter-common/src/main/java/io/prometheus/metrics/exporter/common/PrometheusScrapeHandler.java b/prometheus-metrics-exporter-common/src/main/java/io/prometheus/metrics/exporter/common/PrometheusScrapeHandler.java new file mode 100644 index 000000000..440110b33 --- /dev/null +++ b/prometheus-metrics-exporter-common/src/main/java/io/prometheus/metrics/exporter/common/PrometheusScrapeHandler.java @@ -0,0 +1,205 @@ +package io.prometheus.metrics.exporter.common; + +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.config.ExporterFilterProperties; +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.expositionformats.ExpositionFormatWriter; +import io.prometheus.metrics.expositionformats.ExpositionFormats; +import io.prometheus.metrics.model.registry.MetricNameFilter; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Enumeration; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Predicate; +import java.util.zip.GZIPOutputStream; +import javax.annotation.Nullable; + +/** Prometheus scrape endpoint. */ +public class PrometheusScrapeHandler { + + private final PrometheusRegistry registry; + private final ExpositionFormats expositionFormats; + @Nullable private final Predicate nameFilter; + private final AtomicInteger lastResponseSize = new AtomicInteger(2 << 9); // 0.5 MB + private final List supportedFormats; + private final boolean preferUncompressedResponse; + + public PrometheusScrapeHandler() { + this(PrometheusProperties.get(), PrometheusRegistry.defaultRegistry); + } + + public PrometheusScrapeHandler(PrometheusRegistry registry) { + this(PrometheusProperties.get(), registry); + } + + public PrometheusScrapeHandler(PrometheusProperties config) { + this(config, PrometheusRegistry.defaultRegistry); + } + + public PrometheusScrapeHandler(PrometheusProperties config, PrometheusRegistry registry) { + this.expositionFormats = ExpositionFormats.init(config.getExporterProperties()); + this.preferUncompressedResponse = + config.getExporterHttpServerProperties().isPreferUncompressedResponse(); + this.registry = registry; + this.nameFilter = makeNameFilter(config.getExporterFilterProperties()); + supportedFormats = new ArrayList<>(Arrays.asList("openmetrics", "text")); + if (expositionFormats.getPrometheusProtobufWriter().isAvailable()) { + supportedFormats.add("prometheus-protobuf"); + } + } + + public void handleRequest(PrometheusHttpExchange exchange) throws IOException { + try { + PrometheusHttpRequest request = exchange.getRequest(); + MetricSnapshots snapshots = scrape(request); + String acceptHeader = request.getHeader("Accept"); + EscapingScheme escapingScheme = EscapingScheme.fromAcceptHeader(acceptHeader); + if (writeDebugResponse(snapshots, escapingScheme, exchange)) { + return; + } + ExpositionFormatWriter writer = expositionFormats.findWriter(acceptHeader); + PrometheusHttpResponse response = exchange.getResponse(); + response.setHeader("Content-Type", writer.getContentType()); + + if (shouldUseCompression(request)) { + response.setHeader("Content-Encoding", "gzip"); + try (GZIPOutputStream gzipOutputStream = + new GZIPOutputStream(response.sendHeadersAndGetBody(200, 0))) { + writer.write(gzipOutputStream, snapshots, escapingScheme); + } + } else { + ByteArrayOutputStream responseBuffer = + new ByteArrayOutputStream(lastResponseSize.get() + 1024); + writer.write(responseBuffer, snapshots, escapingScheme); + lastResponseSize.set(responseBuffer.size()); + int contentLength = responseBuffer.size(); + if (contentLength > 0) { + response.setHeader("Content-Length", String.valueOf(contentLength)); + } + if (request.getMethod().equals("HEAD")) { + // The HTTPServer implementation will throw an Exception if we close the output stream + // without sending a response body, so let's not close the output stream in case of a HEAD + // response. + response.sendHeadersAndGetBody(200, -1); + } else { + try (OutputStream outputStream = response.sendHeadersAndGetBody(200, contentLength)) { + responseBuffer.writeTo(outputStream); + } + } + } + } catch (IOException e) { + exchange.handleException(e); + } catch (RuntimeException e) { + exchange.handleException(e); + } finally { + exchange.close(); + } + } + + @Nullable + private Predicate makeNameFilter(ExporterFilterProperties props) { + if (props.getAllowedMetricNames() == null + && props.getExcludedMetricNames() == null + && props.getAllowedMetricNamePrefixes() == null + && props.getExcludedMetricNamePrefixes() == null) { + return null; + } else { + return MetricNameFilter.builder() + .nameMustBeEqualTo(props.getAllowedMetricNames()) + .nameMustNotBeEqualTo(props.getExcludedMetricNames()) + .nameMustStartWith(props.getAllowedMetricNamePrefixes()) + .nameMustNotStartWith(props.getExcludedMetricNamePrefixes()) + .build(); + } + } + + @Nullable + private Predicate makeNameFilter(@Nullable String[] includedNames) { + Predicate result = null; + if (includedNames != null && includedNames.length > 0) { + result = MetricNameFilter.builder().nameMustBeEqualTo(includedNames).build(); + } + if (result != null && nameFilter != null) { + result = result.and(nameFilter); + } else if (nameFilter != null) { + result = nameFilter; + } + return result; + } + + private MetricSnapshots scrape(PrometheusHttpRequest request) { + + Predicate filter = makeNameFilter(request.getParameterValues("name[]")); + if (filter != null) { + return registry.scrape(filter, request); + } else { + return registry.scrape(request); + } + } + + private boolean writeDebugResponse( + MetricSnapshots snapshots, EscapingScheme escapingScheme, PrometheusHttpExchange exchange) + throws IOException { + String debugParam = exchange.getRequest().getParameter("debug"); + PrometheusHttpResponse response = exchange.getResponse(); + if (debugParam == null) { + return false; + } else { + response.setHeader("Content-Type", "text/plain; charset=utf-8"); + int responseStatus = supportedFormats.contains(debugParam) ? 200 : 500; + OutputStream body = response.sendHeadersAndGetBody(responseStatus, 0); + switch (debugParam) { + case "openmetrics": + expositionFormats.getOpenMetricsTextFormatWriter().write(body, snapshots, escapingScheme); + break; + case "text": + expositionFormats.getPrometheusTextFormatWriter().write(body, snapshots, escapingScheme); + break; + case "prometheus-protobuf": + String debugString = + expositionFormats + .getPrometheusProtobufWriter() + .toDebugString(snapshots, escapingScheme); + body.write(debugString.getBytes(StandardCharsets.UTF_8)); + break; + default: + body.write( + ("debug=" + + debugParam + + ": Unsupported query parameter. Valid values are 'openmetrics', " + + "'text', and 'prometheus-protobuf'.") + .getBytes(StandardCharsets.UTF_8)); + break; + } + return true; + } + } + + private boolean shouldUseCompression(PrometheusHttpRequest request) { + if (preferUncompressedResponse) { + return false; + } + + Enumeration encodingHeaders = request.getHeaders("Accept-Encoding"); + if (encodingHeaders == null) { + return false; + } + while (encodingHeaders.hasMoreElements()) { + String encodingHeader = encodingHeaders.nextElement(); + String[] encodings = encodingHeader.split(","); + for (String encoding : encodings) { + if (encoding.trim().equalsIgnoreCase("gzip")) { + return true; + } + } + } + return false; + } +} diff --git a/prometheus-metrics-exporter-common/version-rules.xml b/prometheus-metrics-exporter-common/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-exporter-common/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-exporter-httpserver/pom.xml b/prometheus-metrics-exporter-httpserver/pom.xml new file mode 100644 index 000000000..07c2abd71 --- /dev/null +++ b/prometheus-metrics-exporter-httpserver/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-exporter-httpserver + bundle + + Prometheus Metrics Exporter - HTTP Server + + HTTP Server providing a Prometheus scrape endpoint. + + + + io.prometheus.metrics.exporter.httpserver + 0.45 + + + + + io.prometheus + prometheus-metrics-exporter-common + ${project.version} + + + + diff --git a/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/BlockingRejectedExecutionHandler.java b/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/BlockingRejectedExecutionHandler.java new file mode 100644 index 000000000..023d3f2f0 --- /dev/null +++ b/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/BlockingRejectedExecutionHandler.java @@ -0,0 +1,18 @@ +package io.prometheus.metrics.exporter.httpserver; + +import java.util.concurrent.RejectedExecutionHandler; +import java.util.concurrent.ThreadPoolExecutor; + +class BlockingRejectedExecutionHandler implements RejectedExecutionHandler { + + @Override + public void rejectedExecution(Runnable runnable, ThreadPoolExecutor threadPoolExecutor) { + if (!threadPoolExecutor.isShutdown()) { + try { + threadPoolExecutor.getQueue().put(runnable); + } catch (InterruptedException ignored) { + // ignore + } + } + } +} diff --git a/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/DefaultHandler.java b/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/DefaultHandler.java new file mode 100644 index 000000000..a4a343d54 --- /dev/null +++ b/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/DefaultHandler.java @@ -0,0 +1,90 @@ +package io.prometheus.metrics.exporter.httpserver; + +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +/** Handler for the / endpoint */ +public class DefaultHandler implements HttpHandler { + + private final byte[] responseBytes; + private final String contentType; + + public DefaultHandler(String metricsPath) { + String metrics = metricsPath.startsWith("/") ? metricsPath.substring(1) : metricsPath; + String responseString = + "\n" + + "Prometheus Java Client\n" + + "\n" + + "

    Prometheus Java Client

    \n" + + "

    Metrics Path

    \n" + + String.format("The metrics path is %s.\n", metrics, metricsPath) + + "

    Name Filter

    \n" + + "If you want to scrape only specific metrics, " + + "use the name[] parameter like this:\n" + + "\n" + + "You can also use multiple name[] parameters to query multiple metrics:\n" + + "\n" + + "The name[] parameter can be used by the Prometheus server for scraping. " + + "Add the following snippet to your scrape job configuration in " + + "prometheus.yaml:\n" + + "
    \n"
    +            + "params:\n"
    +            + "    name[]:\n"
    +            + "        - my_metric_a\n"
    +            + "        - my_metric_b\n"
    +            + "
    \n" + + "

    Debug Parameter

    \n" + + "The Prometheus Java metrics library supports multiple exposition formats.\n" + + "The Prometheus server sends the Accept header " + + "to indicate which format it accepts.\n" + + "By default, the Prometheus server accepts OpenMetrics text format, " + + "unless the Prometheus server is started with feature flag " + + "--enable-feature=native-histograms,\n" + + "in which case the default is Prometheus protobuf.\n" + + "The Prometheus Java metrics library supports a debug query parameter " + + "for viewing the different formats in a Web browser:\n" + + "
      \n" + + String.format( + "
    • %s?debug=openmetrics: ", + metrics, metricsPath) + + "View OpenMetrics text format.
    • \n" + + String.format( + "
    • %s?debug=text: ", metrics, metricsPath) + + "View Prometheus text format (this is the default when accessing the " + + String.format( + "%s endpoint with a Web browser).
    • \n", metrics, metricsPath) + + String.format("
    • ", metrics) + + String.format("%s?debug=prometheus-protobuf: ", metricsPath) + + "View a text representation of the Prometheus protobuf format.
    • \n" + + "
    \n" + + "Note that the debug parameter is only for viewing different formats in a " + + "Web browser, it should not be used by the Prometheus server for scraping. " + + "The Prometheus server uses the Accept " + + "header for indicating which format it accepts.\n" + + "\n" + + "\n"; + this.responseBytes = responseString.getBytes(StandardCharsets.UTF_8); + this.contentType = "text/html; charset=utf-8"; + } + + @Override + public void handle(HttpExchange exchange) throws IOException { + try { + exchange.getResponseHeaders().set("Content-Type", contentType); + exchange.getResponseHeaders().set("Content-Length", Integer.toString(responseBytes.length)); + exchange.sendResponseHeaders(200, responseBytes.length); + exchange.getResponseBody().write(responseBytes); + } finally { + exchange.close(); + } + } +} diff --git a/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/HTTPServer.java b/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/HTTPServer.java new file mode 100644 index 000000000..41fdec76d --- /dev/null +++ b/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/HTTPServer.java @@ -0,0 +1,357 @@ +package io.prometheus.metrics.exporter.httpserver; + +import com.sun.net.httpserver.Authenticator; +import com.sun.net.httpserver.HttpContext; +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; +import com.sun.net.httpserver.HttpsConfigurator; +import com.sun.net.httpserver.HttpsServer; +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import java.io.Closeable; +import java.io.IOException; +import java.io.InputStream; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.SynchronousQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import javax.annotation.Nullable; +import javax.security.auth.Subject; + +/** + * Expose Prometheus metrics using a plain Java HttpServer. + * + *

    Example Usage: + * + *

    {@code
    + * HTTPServer server = HTTPServer.builder()
    + *     .port(9090)
    + *     .buildAndStart();
    + * }
    + */ +public class HTTPServer implements Closeable { + + static { + if (!System.getProperties().containsKey("sun.net.httpserver.maxReqTime")) { + System.setProperty("sun.net.httpserver.maxReqTime", "60"); + } + + if (!System.getProperties().containsKey("sun.net.httpserver.maxRspTime")) { + System.setProperty("sun.net.httpserver.maxRspTime", "600"); + } + } + + protected final HttpServer server; + protected final ExecutorService executorService; + + private HTTPServer( + PrometheusProperties config, + ExecutorService executorService, + HttpServer httpServer, + PrometheusRegistry registry, + @Nullable Authenticator authenticator, + @Nullable String authenticatedSubjectAttributeName, + @Nullable HttpHandler defaultHandler, + @Nullable String metricsHandlerPath, + @Nullable Boolean registerHealthHandler) { + if (httpServer.getAddress() == null) { + throw new IllegalArgumentException("HttpServer hasn't been bound to an address"); + } + this.server = httpServer; + this.executorService = executorService; + String metricsPath = getMetricsPath(metricsHandlerPath); + registerHandler( + "/", + defaultHandler == null ? new DefaultHandler(metricsPath) : defaultHandler, + authenticator, + authenticatedSubjectAttributeName); + registerHandler( + metricsPath, + new MetricsHandler(config, registry), + authenticator, + authenticatedSubjectAttributeName); + if (registerHealthHandler == null || registerHealthHandler) { + registerHandler( + "/-/healthy", new HealthyHandler(), authenticator, authenticatedSubjectAttributeName); + } + try { + // HttpServer.start() starts the HttpServer in a new background thread. + // If we call HttpServer.start() from a thread of the executorService, + // the background thread will inherit the "daemon" property, + // i.e. the server will run as a Daemon thread. + // See https://github.com/prometheus/client_java/pull/955 + this.executorService.submit(this.server::start).get(); + // calling .get() on the Future here to avoid silently discarding errors + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + } + + private String getMetricsPath(@Nullable String metricsHandlerPath) { + if (metricsHandlerPath == null) { + return "/metrics"; + } + if (!metricsHandlerPath.startsWith("/")) { + return "/" + metricsHandlerPath; + } + return metricsHandlerPath; + } + + private void registerHandler( + String path, + HttpHandler handler, + @Nullable Authenticator authenticator, + @Nullable String subjectAttributeName) { + HttpContext context = server.createContext(path, wrapWithDoAs(handler, subjectAttributeName)); + if (authenticator != null) { + context.setAuthenticator(authenticator); + } + } + + private HttpHandler wrapWithDoAs(HttpHandler handler, @Nullable String subjectAttributeName) { + if (subjectAttributeName == null) { + return handler; + } + + // invoke handler using the subject.doAs from the named attribute + return new HttpHandler() { + @Override + public void handle(HttpExchange exchange) throws IOException { + Object authSubject = exchange.getAttribute(subjectAttributeName); + if (authSubject instanceof Subject) { + try { + Subject.doAs( + (Subject) authSubject, + (PrivilegedExceptionAction) + () -> { + handler.handle(exchange); + return null; + }); + } catch (PrivilegedActionException e) { + if (e.getException() != null) { + throw new IOException(e.getException()); + } else { + throw new IOException(e); + } + } + } else { + drainInputAndClose(exchange); + exchange.sendResponseHeaders(403, -1); + } + } + }; + } + + private void drainInputAndClose(HttpExchange httpExchange) throws IOException { + InputStream inputStream = httpExchange.getRequestBody(); + byte[] b = new byte[4096]; + while (inputStream.read(b) != -1) { + // nop + } + inputStream.close(); + } + + /** Stop the HTTP server. Same as {@link #close()}. */ + public void stop() { + close(); + } + + /** Stop the HTTPServer. Same as {@link #stop()}. */ + @Override + public void close() { + server.stop(0); + executorService.shutdown(); // Free any (parked/idle) threads in pool + } + + /** + * Gets the port number. This is useful if you did not specify a port and the server picked a free + * port automatically. + */ + public int getPort() { + return server.getAddress().getPort(); + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder { + + private final PrometheusProperties config; + @Nullable private Integer port = null; + @Nullable private String hostname = null; + @Nullable private InetAddress inetAddress = null; + @Nullable private ExecutorService executorService = null; + @Nullable private PrometheusRegistry registry = null; + @Nullable private Authenticator authenticator = null; + @Nullable private String authenticatedSubjectAttributeName = null; + @Nullable private HttpsConfigurator httpsConfigurator = null; + @Nullable private HttpHandler defaultHandler = null; + @Nullable private String metricsHandlerPath = null; + @Nullable private Boolean registerHealthHandler = null; + + private Builder(PrometheusProperties config) { + this.config = config; + } + + /** + * Port to bind to. Default is 0, indicating that a random port will be selected. You can learn + * the randomly selected port by calling {@link HTTPServer#getPort()}. + */ + public Builder port(int port) { + this.port = port; + return this; + } + + /** + * Use this hostname to resolve the IP address to bind to. Must not be called together with + * {@link #inetAddress(InetAddress)}. Default is empty, indicating that the HTTPServer binds to + * the wildcard address. + */ + public Builder hostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Bind to this IP address. Must not be called together with {@link #hostname(String)}. Default + * is empty, indicating that the HTTPServer binds to the wildcard address. + */ + public Builder inetAddress(InetAddress address) { + this.inetAddress = address; + return this; + } + + /** Optional: ExecutorService used by the {@code httpServer}. */ + public Builder executorService(ExecutorService executorService) { + this.executorService = executorService; + return this; + } + + /** Optional: Default is {@link PrometheusRegistry#defaultRegistry}. */ + public Builder registry(PrometheusRegistry registry) { + this.registry = registry; + return this; + } + + /** Optional: {@link Authenticator} for authentication. */ + public Builder authenticator(Authenticator authenticator) { + this.authenticator = authenticator; + return this; + } + + /** Optional: the attribute name of a Subject from a custom authenticator. */ + public Builder authenticatedSubjectAttributeName(String authenticatedSubjectAttributeName) { + this.authenticatedSubjectAttributeName = authenticatedSubjectAttributeName; + return this; + } + + /** Optional: {@link HttpsConfigurator} for TLS/SSL */ + public Builder httpsConfigurator(HttpsConfigurator configurator) { + this.httpsConfigurator = configurator; + return this; + } + + /** + * Optional: Override default handler, i.e. the handler that will be registered for the / + * endpoint. + */ + public Builder defaultHandler(HttpHandler defaultHandler) { + this.defaultHandler = defaultHandler; + return this; + } + + /** Optional: Override default path for the metrics endpoint. Default is {@code /metrics}. */ + public Builder metricsHandlerPath(String metricsHandlerPath) { + this.metricsHandlerPath = metricsHandlerPath; + return this; + } + + /** Optional: Override if the health handler should be registered. Default is {@code true}. */ + public Builder registerHealthHandler(boolean registerHealthHandler) { + this.registerHealthHandler = registerHealthHandler; + return this; + } + + /** Build and start the HTTPServer. */ + public HTTPServer buildAndStart() throws IOException { + if (registry == null) { + registry = PrometheusRegistry.defaultRegistry; + } + HttpServer httpServer; + if (httpsConfigurator != null) { + httpServer = HttpsServer.create(makeInetSocketAddress(), 3); + ((HttpsServer) httpServer).setHttpsConfigurator(httpsConfigurator); + } else { + httpServer = HttpServer.create(makeInetSocketAddress(), 3); + } + ExecutorService executorService = makeExecutorService(); + httpServer.setExecutor(executorService); + return new HTTPServer( + config, + executorService, + httpServer, + registry, + authenticator, + authenticatedSubjectAttributeName, + defaultHandler, + metricsHandlerPath, + registerHealthHandler); + } + + private InetSocketAddress makeInetSocketAddress() { + if (inetAddress != null) { + assertNull(hostname, "cannot configure 'inetAddress' and 'hostname' at the same time"); + return new InetSocketAddress(inetAddress, findPort()); + } else if (hostname != null) { + return new InetSocketAddress(hostname, findPort()); + } else { + return new InetSocketAddress(findPort()); + } + } + + private ExecutorService makeExecutorService() { + if (executorService != null) { + return executorService; + } else { + return new ThreadPoolExecutor( + 1, + 10, + 120, + TimeUnit.SECONDS, + new SynchronousQueue<>(true), + NamedDaemonThreadFactory.defaultThreadFactory(true), + new BlockingRejectedExecutionHandler()); + } + } + + private int findPort() { + if (config != null && config.getExporterHttpServerProperties() != null) { + Integer port = config.getExporterHttpServerProperties().getPort(); + if (port != null) { + return port; + } + } + if (port != null) { + return port; + } + return 0; // random port will be selected + } + + private void assertNull(@Nullable Object o, String msg) { + if (o != null) { + throw new IllegalStateException(msg); + } + } + } +} diff --git a/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/HealthyHandler.java b/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/HealthyHandler.java new file mode 100644 index 000000000..806b47553 --- /dev/null +++ b/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/HealthyHandler.java @@ -0,0 +1,31 @@ +package io.prometheus.metrics.exporter.httpserver; + +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +/** Handler for the /-/healthy endpoint */ +public class HealthyHandler implements HttpHandler { + + private final byte[] responseBytes; + private final String contentType; + + public HealthyHandler() { + String responseString = "Exporter is healthy.\n"; + this.responseBytes = responseString.getBytes(StandardCharsets.UTF_8); + this.contentType = "text/plain; charset=utf-8"; + } + + @Override + public void handle(HttpExchange exchange) throws IOException { + try { + exchange.getResponseHeaders().set("Content-Type", contentType); + exchange.getResponseHeaders().set("Content-Length", Integer.toString(responseBytes.length)); + exchange.sendResponseHeaders(200, responseBytes.length); + exchange.getResponseBody().write(responseBytes); + } finally { + exchange.close(); + } + } +} diff --git a/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/HttpExchangeAdapter.java b/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/HttpExchangeAdapter.java new file mode 100644 index 000000000..3e0322309 --- /dev/null +++ b/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/HttpExchangeAdapter.java @@ -0,0 +1,148 @@ +package io.prometheus.metrics.exporter.httpserver; + +import com.sun.net.httpserver.HttpExchange; +import io.prometheus.metrics.exporter.common.PrometheusHttpExchange; +import io.prometheus.metrics.exporter.common.PrometheusHttpRequest; +import io.prometheus.metrics.exporter.common.PrometheusHttpResponse; +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.util.Collections; +import java.util.Enumeration; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class HttpExchangeAdapter implements PrometheusHttpExchange { + + private final HttpExchange httpExchange; + private final HttpRequest request = new HttpRequest(); + private final HttpResponse response = new HttpResponse(); + private volatile boolean responseSent = false; + + public HttpExchangeAdapter(HttpExchange httpExchange) { + this.httpExchange = httpExchange; + } + + public class HttpRequest implements PrometheusHttpRequest { + + @Override + public String getQueryString() { + return httpExchange.getRequestURI().getRawQuery(); + } + + @Override + public Enumeration getHeaders(String name) { + List headers = httpExchange.getRequestHeaders().get(name); + if (headers == null) { + return Collections.emptyEnumeration(); + } else { + return Collections.enumeration(headers); + } + } + + @Override + public String getMethod() { + return httpExchange.getRequestMethod(); + } + + @Override + public String getRequestPath() { + URI requestURI = httpExchange.getRequestURI(); + String uri = requestURI.toString(); + int qx = uri.indexOf('?'); + if (qx != -1) { + uri = uri.substring(0, qx); + } + return uri; + } + } + + public class HttpResponse implements PrometheusHttpResponse { + + @Override + public void setHeader(String name, String value) { + httpExchange.getResponseHeaders().set(name, value); + } + + @Override + public OutputStream sendHeadersAndGetBody(int statusCode, int contentLength) + throws IOException { + if (responseSent) { + throw new IOException("Cannot send multiple HTTP responses for a single HTTP exchange."); + } + responseSent = true; + httpExchange.sendResponseHeaders(statusCode, contentLength); + return httpExchange.getResponseBody(); + } + } + + @Override + public HttpRequest getRequest() { + return request; + } + + @Override + public HttpResponse getResponse() { + return response; + } + + @Override + public void handleException(IOException e) throws IOException { + sendErrorResponseWithStackTrace(e); + } + + @Override + public void handleException(RuntimeException e) { + sendErrorResponseWithStackTrace(e); + } + + private void sendErrorResponseWithStackTrace(Exception requestHandlerException) { + if (!responseSent) { + responseSent = true; + try { + StringWriter stringWriter = new StringWriter(); + PrintWriter printWriter = new PrintWriter(stringWriter); + printWriter.write("An Exception occurred while scraping metrics: "); + requestHandlerException.printStackTrace(new PrintWriter(printWriter)); + byte[] stackTrace = stringWriter.toString().getBytes(StandardCharsets.UTF_8); + httpExchange.getResponseHeaders().set("Content-Type", "text/plain; charset=utf-8"); + httpExchange.sendResponseHeaders(500, stackTrace.length); + httpExchange.getResponseBody().write(stackTrace); + } catch (Exception errorWriterException) { + // We want to avoid logging so that we don't mess with application logs when the HTTPServer + // is used in a Java agent. + // However, if we can't even send an error response to the client there's nothing we can do + // but logging a message. + Logger.getLogger(this.getClass().getName()) + .log( + Level.SEVERE, + "The Prometheus metrics HTTPServer caught an Exception during scrape and " + + "failed to send an error response to the client.", + errorWriterException); + Logger.getLogger(this.getClass().getName()) + .log( + Level.SEVERE, + "Original Exception that caused the Prometheus scrape error:", + requestHandlerException); + } + } else { + // If the exception occurs after response headers have been sent, it's too late to respond + // with HTTP 500. + Logger.getLogger(this.getClass().getName()) + .log( + Level.SEVERE, + "The Prometheus metrics HTTPServer caught an Exception while trying to send " + + "the metrics response.", + requestHandlerException); + } + } + + @Override + public void close() { + httpExchange.close(); + } +} diff --git a/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/MetricsHandler.java b/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/MetricsHandler.java new file mode 100644 index 000000000..4ac4b80d7 --- /dev/null +++ b/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/MetricsHandler.java @@ -0,0 +1,35 @@ +package io.prometheus.metrics.exporter.httpserver; + +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.exporter.common.PrometheusScrapeHandler; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import java.io.IOException; + +/** Handler for the /metrics endpoint */ +public class MetricsHandler implements HttpHandler { + + private final PrometheusScrapeHandler prometheusScrapeHandler; + + public MetricsHandler() { + prometheusScrapeHandler = new PrometheusScrapeHandler(); + } + + public MetricsHandler(PrometheusRegistry registry) { + prometheusScrapeHandler = new PrometheusScrapeHandler(registry); + } + + public MetricsHandler(PrometheusProperties config) { + prometheusScrapeHandler = new PrometheusScrapeHandler(config); + } + + public MetricsHandler(PrometheusProperties config, PrometheusRegistry registry) { + prometheusScrapeHandler = new PrometheusScrapeHandler(config, registry); + } + + @Override + public void handle(HttpExchange t) throws IOException { + prometheusScrapeHandler.handleRequest(new HttpExchangeAdapter(t)); + } +} diff --git a/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/NamedDaemonThreadFactory.java b/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/NamedDaemonThreadFactory.java new file mode 100644 index 000000000..b5d2415f7 --- /dev/null +++ b/prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/NamedDaemonThreadFactory.java @@ -0,0 +1,31 @@ +package io.prometheus.metrics.exporter.httpserver; + +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.atomic.AtomicInteger; + +class NamedDaemonThreadFactory implements ThreadFactory { + + private static final AtomicInteger POOL_NUMBER = new AtomicInteger(1); + private final int poolNumber = POOL_NUMBER.getAndIncrement(); + private final AtomicInteger threadNumber = new AtomicInteger(1); + private final ThreadFactory delegate; + private final boolean daemon; + + NamedDaemonThreadFactory(ThreadFactory delegate, boolean daemon) { + this.delegate = delegate; + this.daemon = daemon; + } + + @Override + public Thread newThread(Runnable r) { + Thread t = delegate.newThread(r); + t.setName(String.format("prometheus-http-%d-%d", poolNumber, threadNumber.getAndIncrement())); + t.setDaemon(daemon); + return t; + } + + static ThreadFactory defaultThreadFactory(boolean daemon) { + return new NamedDaemonThreadFactory(Executors.defaultThreadFactory(), daemon); + } +} diff --git a/prometheus-metrics-exporter-httpserver/src/test/java/io/prometheus/metrics/exporter/httpserver/HTTPServerTest.java b/prometheus-metrics-exporter-httpserver/src/test/java/io/prometheus/metrics/exporter/httpserver/HTTPServerTest.java new file mode 100644 index 000000000..9b7f658de --- /dev/null +++ b/prometheus-metrics-exporter-httpserver/src/test/java/io/prometheus/metrics/exporter/httpserver/HTTPServerTest.java @@ -0,0 +1,189 @@ +package io.prometheus.metrics.exporter.httpserver; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import com.sun.net.httpserver.Authenticator; +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpPrincipal; +import com.sun.net.httpserver.HttpsConfigurator; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.registry.PrometheusScrapeRequest; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.nio.charset.StandardCharsets; +import java.security.NoSuchAlgorithmException; +import java.security.Principal; +import java.util.concurrent.Executors; +import javax.net.ssl.SSLContext; +import javax.security.auth.Subject; +import org.junit.jupiter.api.Test; + +public class HTTPServerTest { + + @Test + @SuppressWarnings({"removal"}) + public void testSubjectDoAs() throws Exception { + + final String user = "joe"; + final Subject subject = new Subject(); + subject.getPrincipals().add(() -> user); + + Authenticator authenticator = + new Authenticator() { + @Override + public Result authenticate(HttpExchange exchange) { + exchange.setAttribute("aa", subject); + return new Success(new HttpPrincipal(user, "/")); + } + }; + + HttpHandler handler = + exchange -> { + boolean found = false; + Subject current = Subject.current(); + for (Principal p : current.getPrincipals()) { + if (user.equals(p.getName())) { + found = true; + break; + } + } + if (!found) { + throw new IOException("Expected validated user joe!"); + } + exchange.sendResponseHeaders(204, -1); + }; + HTTPServer server = + HTTPServer.builder() + .port(0) + .authenticator(authenticator) + .defaultHandler(handler) + .authenticatedSubjectAttributeName("aa") + .buildAndStart(); + + run(server, "204", "/"); + } + + private static void run(HTTPServer server, String expected, String path) throws IOException { + try (Socket socket = new Socket()) { + socket.connect(new InetSocketAddress("localhost", server.getPort())); + + socket + .getOutputStream() + .write(("GET " + path + " HTTP/1.1 \r\n").getBytes(StandardCharsets.UTF_8)); + socket.getOutputStream().write("HOST: localhost \r\n\r\n".getBytes(StandardCharsets.UTF_8)); + socket.getOutputStream().flush(); + + String actualResponse = ""; + byte[] resp = new byte[500]; + int read = socket.getInputStream().read(resp, 0, resp.length); + if (read > 0) { + actualResponse = new String(resp, 0, read, StandardCharsets.UTF_8); + } + assertThat(actualResponse).contains(expected); + } + } + + @Test + void defaultHandler() throws IOException { + run(HTTPServer.builder().port(0).buildAndStart(), "200", "/"); + } + + @Test + void metrics() throws IOException { + run( + HTTPServer.builder() + .port(0) + .registry(new PrometheusRegistry()) + .executorService(Executors.newFixedThreadPool(1)) + .buildAndStart(), + "200", + "/metrics"); + } + + @Test + void metricsCustomPath() throws IOException { + run( + HTTPServer.builder() + .port(0) + .registry(new PrometheusRegistry()) + .metricsHandlerPath("/my-metrics") + .executorService(Executors.newFixedThreadPool(1)) + .buildAndStart(), + "200", + "/my-metrics"); + } + + @Test + void registryThrows() throws IOException { + HTTPServer server = + HTTPServer.builder() + .port(0) + .registry( + new PrometheusRegistry() { + @Override + public MetricSnapshots scrape(PrometheusScrapeRequest scrapeRequest) { + throw new IllegalStateException("test"); + } + }) + .buildAndStart(); + run(server, "500", "/metrics"); + } + + @Test + void config() throws NoSuchAlgorithmException, IOException { + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy( + () -> + HTTPServer.builder() + .port(0) + .hostname("localhost") + .inetAddress(InetAddress.getByName("localhost")) + .buildAndStart()) + .withMessage("cannot configure 'inetAddress' and 'hostname' at the same time"); + + // ssl doesn't work without in tests + run( + HTTPServer.builder() + .port(0) + .httpsConfigurator(new HttpsConfigurator(SSLContext.getDefault())) + .buildAndStart(), + "", + "/"); + } + + @Test + void health() throws IOException { + run(HTTPServer.builder().port(0).buildAndStart(), "200", "/-/healthy"); + } + + @Test + void healthEnabled() throws IOException { + HttpHandler handler = exchange -> exchange.sendResponseHeaders(204, -1); + run( + HTTPServer.builder() + .port(0) + .defaultHandler(handler) + .registerHealthHandler(true) + .buildAndStart(), + "200", + "/-/healthy"); + } + + @Test + void healthDisabled() throws IOException { + HttpHandler handler = exchange -> exchange.sendResponseHeaders(204, -1); + run( + HTTPServer.builder() + .port(0) + .defaultHandler(handler) + .registerHealthHandler(false) + .buildAndStart(), + "204", + "/-/healthy"); + } +} diff --git a/prometheus-metrics-exporter-httpserver/src/test/java/io/prometheus/metrics/exporter/httpserver/MetricsHandlerTest.java b/prometheus-metrics-exporter-httpserver/src/test/java/io/prometheus/metrics/exporter/httpserver/MetricsHandlerTest.java new file mode 100644 index 000000000..703223861 --- /dev/null +++ b/prometheus-metrics-exporter-httpserver/src/test/java/io/prometheus/metrics/exporter/httpserver/MetricsHandlerTest.java @@ -0,0 +1,36 @@ +package io.prometheus.metrics.exporter.httpserver; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.RETURNS_MOCKS; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import org.junit.jupiter.api.Test; + +class MetricsHandlerTest { + + @Test + void ctor() { + assertThat(new MetricsHandler()) + .extracting("prometheusScrapeHandler") + .extracting("registry") + .isEqualTo(PrometheusRegistry.defaultRegistry); + + PrometheusRegistry registry = new PrometheusRegistry(); + assertThat(new MetricsHandler(registry)) + .extracting("prometheusScrapeHandler") + .extracting("registry") + .isEqualTo(registry); + + PrometheusProperties properties = mock(PrometheusProperties.class, RETURNS_MOCKS); + + assertThat(new MetricsHandler(properties)) + .extracting("prometheusScrapeHandler") + .extracting("registry") + .isEqualTo(PrometheusRegistry.defaultRegistry); + + verify(properties).getExporterProperties(); + } +} diff --git a/prometheus-metrics-exporter-httpserver/version-rules.xml b/prometheus-metrics-exporter-httpserver/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-exporter-httpserver/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-exporter-opentelemetry-otel-agent-resources/pom.xml b/prometheus-metrics-exporter-opentelemetry-otel-agent-resources/pom.xml new file mode 100644 index 000000000..b87712160 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry-otel-agent-resources/pom.xml @@ -0,0 +1,64 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-exporter-opentelemetry-otel-agent-resources + bundle + + OpenTelemetry Agent Resource Extractor + + Reads the OpenTelemetry Agent resources the GlobalOpenTelemetry instance + + + + io.prometheus.otel.resource.attributes + + 1.29.0 + + + + + + src/main/resources + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy + validate + + copy + + + + + + + io.opentelemetry + opentelemetry-api + ${otel-dynamic-load.version} + ${project.basedir}/src/main/resources/lib/ + + + io.opentelemetry + opentelemetry-context + ${otel-dynamic-load.version} + ${project.basedir}/src/main/resources/lib/ + + + + + + + diff --git a/prometheus-metrics-exporter-opentelemetry-otel-agent-resources/src/main/java/io/prometheus/otelagent/ResourceAttributesFromOtelAgent.java b/prometheus-metrics-exporter-opentelemetry-otel-agent-resources/src/main/java/io/prometheus/otelagent/ResourceAttributesFromOtelAgent.java new file mode 100644 index 000000000..5cf85d73d --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry-otel-agent-resources/src/main/java/io/prometheus/otelagent/ResourceAttributesFromOtelAgent.java @@ -0,0 +1,119 @@ +package io.prometheus.otelagent; + +import static java.nio.file.Files.createTempDirectory; + +import java.io.File; +import java.io.InputStream; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +public class ResourceAttributesFromOtelAgent { + + private static final String[] OTEL_JARS = + new String[] {"opentelemetry-api-1.29.0.jar", "opentelemetry-context-1.29.0.jar"}; + + /** + * This grabs resource attributes like {@code service.name} and {@code service.instance.id} from + * the OTel Java agent (if present) and adds them to {@code result}. + * + *

    The way this works is as follows: If the OTel Java agent is attached, it modifies the {@code + * GlobalOpenTelemetry.get()} method to return an agent-specific object. From that agent-specific + * object we can get the resource attributes via reflection. + * + *

    So we load the {@code GlobalOpenTelemetry} class (in a separate class loader from the JAR + * files that are bundled with this module), call {@code .get()}, and inspect the returned object. + * + *

    After that we discard the class loader so that all OTel specific classes are unloaded. No + * runtime dependency on any OTel version remains. + * + *

    The test for this class is in + * examples/example-exporter-opentelemetry/oats-tests/agent/service_instance_id_check.py + */ + public static Map getResourceAttributes(String instrumentationScopeName) { + try { + Path tmpDir = createTempDirectory(instrumentationScopeName + "-"); + try { + URL[] otelJars = copyOtelJarsToTempDir(tmpDir, instrumentationScopeName); + + try (URLClassLoader classLoader = new URLClassLoader(otelJars)) { + Class globalOpenTelemetryClass = + classLoader.loadClass("io.opentelemetry.api.GlobalOpenTelemetry"); + Object globalOpenTelemetry = globalOpenTelemetryClass.getMethod("get").invoke(null); + if (globalOpenTelemetry.getClass().getSimpleName().contains("ApplicationOpenTelemetry")) { + // GlobalOpenTelemetry is injected by the OTel Java agent + Object applicationMeterProvider = callMethod("getMeterProvider", globalOpenTelemetry); + Object agentMeterProvider = getField("agentMeterProvider", applicationMeterProvider); + Object sdkMeterProvider = getField("delegate", agentMeterProvider); + Object sharedState = getField("sharedState", sdkMeterProvider); + Object resource = callMethod("getResource", sharedState); + Object attributes = callMethod("getAttributes", resource); + Map attributeMap = (Map) callMethod("asMap", attributes); + + Map result = new HashMap<>(); + for (Map.Entry entry : attributeMap.entrySet()) { + if (entry.getKey() != null && entry.getValue() != null) { + result.put(entry.getKey().toString(), entry.getValue().toString()); + } + } + return Collections.unmodifiableMap(result); + } + } + } finally { + deleteTempDir(tmpDir.toFile()); + } + } catch (Exception ignored) { + // ignore + } + return Collections.emptyMap(); + } + + private static Object getField(String name, Object obj) throws Exception { + Field field = obj.getClass().getDeclaredField(name); + field.setAccessible(true); + return field.get(obj); + } + + private static Object callMethod(String name, Object obj) throws Exception { + Method method = obj.getClass().getMethod(name); + method.setAccessible(true); + return method.invoke(obj); + } + + private static URL[] copyOtelJarsToTempDir(Path tmpDir, String instrumentationScopeName) + throws Exception { + URL[] result = new URL[OTEL_JARS.length]; + for (int i = 0; i < OTEL_JARS.length; i++) { + InputStream inputStream = + Thread.currentThread().getContextClassLoader().getResourceAsStream("lib/" + OTEL_JARS[i]); + if (inputStream == null) { + throw new IllegalStateException( + "Error initializing " + + instrumentationScopeName + + ": lib/" + + OTEL_JARS[i] + + " not found in classpath."); + } + File outputFile = tmpDir.resolve(OTEL_JARS[i]).toFile(); + Files.copy(inputStream, outputFile.toPath(), StandardCopyOption.REPLACE_EXISTING); + inputStream.close(); + result[i] = outputFile.toURI().toURL(); + } + return result; + } + + private static void deleteTempDir(File tmpDir) { + // We don't have subdirectories, so this simple implementation should work. + for (File file : tmpDir.listFiles()) { + file.delete(); + } + tmpDir.delete(); + } +} diff --git a/prometheus-metrics-exporter-opentelemetry-otel-agent-resources/src/main/resources/lib/.gitignore b/prometheus-metrics-exporter-opentelemetry-otel-agent-resources/src/main/resources/lib/.gitignore new file mode 100644 index 000000000..d392f0e82 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry-otel-agent-resources/src/main/resources/lib/.gitignore @@ -0,0 +1 @@ +*.jar diff --git a/prometheus-metrics-exporter-opentelemetry-shaded/pom.xml b/prometheus-metrics-exporter-opentelemetry-shaded/pom.xml new file mode 100644 index 000000000..c08919d13 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry-shaded/pom.xml @@ -0,0 +1,287 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-exporter-opentelemetry + bundle + + Prometheus Metrics to OpenTelemetry Exporter + + Converts Prometheus metrics to OpenTelemetry format and pushes them to an OTLP endpoint + + + + io.prometheus.metrics.exporter.opentelemetry + + + + + + io.opentelemetry.instrumentation + opentelemetry-instrumentation-bom-alpha + ${otel.instrumentation.version} + pom + import + + + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-opentelemetry-otel-agent-resources + ${project.version} + + + io.opentelemetry + opentelemetry-api + + + io.opentelemetry + opentelemetry-sdk + + + io.opentelemetry + opentelemetry-exporter-otlp + + + io.opentelemetry + opentelemetry-sdk-extension-autoconfigure + + + io.opentelemetry + opentelemetry-sdk-extension-incubator + + + io.opentelemetry.instrumentation + opentelemetry-resources + + + + + + + javadoc + + + release + + + default + + true + + + + + io.opentelemetry + opentelemetry-proto + test + + + io.opentelemetry + opentelemetry-sdk-testing + test + + + + + + + + + target/metrics-exporter-opentelemetry/src/main/resources-filtered + true + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + copy-metrics-exporter-opentelemetry-main + validate + + copy-resources + + + target/metrics-exporter-opentelemetry/src/main + + + ../prometheus-metrics-exporter-opentelemetry/src/main + + + + + + + + copy-metrics-exporter-opentelemetry-test + validate + + copy-resources + + + target/metrics-exporter-opentelemetry/src/test + + + ../prometheus-metrics-exporter-opentelemetry/src/test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + regex-property + + regex-property + + + otel.instrumentation.string-version + ${otel.instrumentation.version} + [\.-] + _ + true + + + + metrics-exporter-opentelemetry-main + generate-sources + + add-source + + + + target/metrics-exporter-opentelemetry/src/main/java + + + + + add-metrics-exporter-opentelemetry-test + generate-sources + + add-test-source + + + + target/metrics-exporter-opentelemetry/src/test/java + + + + + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + io.opentelemetry:* + io.opentelemetry.semconv:* + io.opentelemetry.instrumentation:* + com.squareup.*:* + org.jetbrains:* + org.jetbrains.*:* + + + + + io.opentelemetry + + io.prometheus.metrics.shaded.io_opentelemetry_${otel.instrumentation.string-version} + + + + io.opentelemetry.instrumentation + + io.prometheus.metrics.shaded.io_opentelemetry_${otel.instrumentation.string-version}.instrumentation + + + + io.opentelemetry.semconv + + io.prometheus.metrics.shaded.io_opentelemetry_${otel.instrumentation.string-version}.semconv + + + + okhttp3 + + io.prometheus.metrics.shaded.io_opentelemetry_${otel.instrumentation.string-version}.okhttp3 + + + + kotlin + + io.prometheus.metrics.shaded.io_opentelemetry_${otel.instrumentation.string-version}.kotlin + + + + org.intellij + + io.prometheus.metrics.shaded.io_opentelemetry_${otel.instrumentation.string-version}.org.intellij + + + + org.jetbrains + + io.prometheus.metrics.shaded.io_opentelemetry_${otel.instrumentation.string-version}.org.jetbrains + + + + okio + + io.prometheus.metrics.shaded.io_opentelemetry_${otel.instrumentation.string-version}.okio + + + + + + + + + *:* + + lib/opentelemetry-* + META-INF/maven/org.jctools/** + META-INF/maven/org.jetbrains/** + META-INF/versions/** + META-INF/native-image/** + META-INF/proguard/** + META-INF/*.kotlin_module + META-INF/MANIFEST.MF + + + + + + + + + + diff --git a/prometheus-metrics-exporter-opentelemetry/pom.xml b/prometheus-metrics-exporter-opentelemetry/pom.xml new file mode 100644 index 000000000..acae00e0a --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/pom.xml @@ -0,0 +1,111 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-exporter-opentelemetry-no-otel + bundle + + Prometheus Metrics to OpenTelemetry Exporter without OTel shaded + + Converts Prometheus metrics to OpenTelemetry format and pushes them to an OTLP endpoint without shading + OpenTelemetry. + + + + io.prometheus.metrics.exporter.opentelemetry.nootel + + + + + + io.opentelemetry.instrumentation + opentelemetry-instrumentation-bom-alpha + ${otel.instrumentation.version} + pom + import + + + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + io.prometheus + prometheus-metrics-exporter-opentelemetry-otel-agent-resources + ${project.version} + + + io.opentelemetry + opentelemetry-api + + + io.opentelemetry + opentelemetry-sdk + + + io.opentelemetry + opentelemetry-exporter-otlp + + + io.opentelemetry + opentelemetry-sdk-extension-autoconfigure + + + io.opentelemetry + opentelemetry-sdk-extension-incubator + + + io.opentelemetry.instrumentation + opentelemetry-resources + + + + + + + javadoc + + + release + + + default + + true + + + + + io.opentelemetry + opentelemetry-proto + test + + + io.opentelemetry + opentelemetry-sdk-testing + test + + + + + + + + + src/main/resources-filtered + true + + + + diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/OpenTelemetryExporter.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/OpenTelemetryExporter.java new file mode 100644 index 000000000..8f122d3ee --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/OpenTelemetryExporter.java @@ -0,0 +1,204 @@ +package io.prometheus.metrics.exporter.opentelemetry; + +import io.opentelemetry.sdk.metrics.export.MetricReader; +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Nullable; + +public class OpenTelemetryExporter implements AutoCloseable { + private final MetricReader reader; + + public OpenTelemetryExporter(MetricReader reader) { + this.reader = reader; + } + + @Override + public void close() { + reader.shutdown(); + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder { + + private final PrometheusProperties config; + @Nullable private PrometheusRegistry registry = null; + @Nullable String protocol; + @Nullable String endpoint; + final Map headers = new HashMap<>(); + @Nullable String interval; + @Nullable String timeout; + @Nullable String serviceName; + @Nullable String serviceNamespace; + @Nullable String serviceInstanceId; + @Nullable String serviceVersion; + final Map resourceAttributes = new HashMap<>(); + + private Builder(PrometheusProperties config) { + this.config = config; + } + + public Builder registry(PrometheusRegistry registry) { + this.registry = registry; + return this; + } + + /** + * Specifies the OTLP transport protocol to be used when exporting metrics. + * + *

    Supported values are {@code "grpc"} and {@code "http/protobuf"}. Default is {@code + * "grpc"}. + * + *

    See OpenTelemetry's OTEL_EXPORTER_OTLP_PROTOCOL. + */ + public Builder protocol(String protocol) { + if (!protocol.equals("grpc") && !protocol.equals("http/protobuf")) { + throw new IllegalArgumentException( + protocol + ": Unsupported protocol. Expecting grpc or http/protobuf"); + } + this.protocol = protocol; + return this; + } + + /** + * The OTLP endpoint to send metric data to. + * + *

    The default depends on the protocol: + * + *

      + *
    • {@code "grpc"}: {@code "http://localhost:4317"} + *
    • {@code "http/protobuf"}: {@code "http://localhost:4318/v1/metrics"} + *
    + * + * If the protocol is {@code "http/protobuf"} and the endpoint does not have the {@code + * "/v1/metrics"} suffix, the {@code "/v1/metrics"} suffix will automatically be appended. + * + *

    See OpenTelemetry's OTEL_EXPORTER_OTLP_METRICS_ENDPOINT. + */ + public Builder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Add an HTTP header to be applied to outgoing requests. Call multiple times to add multiple + * headers. + * + *

    See OpenTelemetry's OTEL_EXPORTER_OTLP_HEADERS. + */ + public Builder header(String name, String value) { + this.headers.put(name, value); + return this; + } + + /** + * The interval between the start of two export attempts. Default is 60000. + * + *

    Like OpenTelemetry's OTEL_METRIC_EXPORT_INTERVAL, + * but in seconds rather than milliseconds. + */ + public Builder intervalSeconds(int intervalSeconds) { + if (intervalSeconds <= 0) { + throw new IllegalStateException(intervalSeconds + ": expecting a push interval > 0s"); + } + this.interval = intervalSeconds + "s"; + return this; + } + + /** + * The timeout for outgoing requests. Default is 10. + * + *

    Like OpenTelemetry's OTEL_EXPORTER_OTLP_METRICS_TIMEOUT, + * but in seconds rather than milliseconds. + */ + public Builder timeoutSeconds(int timeoutSeconds) { + if (timeoutSeconds <= 0) { + throw new IllegalStateException(timeoutSeconds + ": expecting a push interval > 0s"); + } + this.timeout = timeoutSeconds + "s"; + return this; + } + + /** + * The {@code service.name} resource attribute. + * + *

    If not explicitly specified, {@code client_java} will try to initialize it with a + * reasonable default, like the JAR file name. + * + *

    See {@code service.name} in OpenTelemetry's Resource + * Semantic Conventions. + */ + public Builder serviceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * The {@code service.namespace} resource attribute. + * + *

    See {@code service.namespace} in OpenTelemetry's Resource + * Semantic Conventions. + */ + public Builder serviceNamespace(String serviceNamespace) { + this.serviceNamespace = serviceNamespace; + return this; + } + + /** + * The {@code service.instance.id} resource attribute. + * + *

    See {@code service.instance.id} in OpenTelemetry's Resource + * Semantic Conventions. + */ + public Builder serviceInstanceId(String serviceInstanceId) { + this.serviceInstanceId = serviceInstanceId; + return this; + } + + /** + * The {@code service.version} resource attribute. + * + *

    See {@code service.version} in OpenTelemetry's Resource + * Semantic Conventions. + */ + public Builder serviceVersion(String serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /** + * Add a resource attribute. Call multiple times to add multiple resource attributes. + * + *

    See OpenTelemetry's OTEL_RESOURCE_ATTRIBUTES. + */ + public Builder resourceAttribute(String name, String value) { + this.resourceAttributes.put(name, value); + return this; + } + + public OpenTelemetryExporter buildAndStart() { + if (registry == null) { + registry = PrometheusRegistry.defaultRegistry; + } + return new OpenTelemetryExporter(OtelAutoConfig.createReader(this, config, registry)); + } + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/OtelAutoConfig.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/OtelAutoConfig.java new file mode 100644 index 000000000..4a16ee07e --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/OtelAutoConfig.java @@ -0,0 +1,119 @@ +package io.prometheus.metrics.exporter.opentelemetry; + +import static java.util.Objects.requireNonNull; + +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.common.AttributesBuilder; +import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk; +import io.opentelemetry.sdk.autoconfigure.ResourceConfiguration; +import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; +import io.opentelemetry.sdk.common.InstrumentationScopeInfo; +import io.opentelemetry.sdk.metrics.export.MetricReader; +import io.opentelemetry.sdk.resources.Resource; +import io.prometheus.metrics.config.ExporterOpenTelemetryProperties; +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.otelagent.ResourceAttributesFromOtelAgent; +import java.lang.reflect.Method; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; + +public class OtelAutoConfig { + + private static final String SERVICE_INSTANCE_ID = "service.instance.id"; + + static MetricReader createReader( + OpenTelemetryExporter.Builder builder, + PrometheusProperties config, + PrometheusRegistry registry) { + AtomicReference readerRef = new AtomicReference<>(); + InstrumentationScopeInfo instrumentationScopeInfo = + PrometheusInstrumentationScope.loadInstrumentationScopeInfo(); + + AutoConfiguredOpenTelemetrySdk sdk = + createAutoConfiguredOpenTelemetrySdk( + builder, + readerRef, + config.getExporterOpenTelemetryProperties(), + instrumentationScopeInfo); + + MetricReader reader = requireNonNull(readerRef.get()); + reader.register( + new PrometheusMetricProducer(registry, instrumentationScopeInfo, getResourceField(sdk))); + return reader; + } + + static AutoConfiguredOpenTelemetrySdk createAutoConfiguredOpenTelemetrySdk( + OpenTelemetryExporter.Builder builder, + AtomicReference readerRef, + ExporterOpenTelemetryProperties properties, + InstrumentationScopeInfo instrumentationScopeInfo) { + PropertyMapper propertyMapper = PropertyMapper.create(properties, builder); + + return AutoConfiguredOpenTelemetrySdk.builder() + .addPropertiesSupplier(() -> propertyMapper.configLowPriority) + .addPropertiesCustomizer( + c -> PropertyMapper.customizeProperties(propertyMapper.configHighPriority, c)) + .addMetricReaderCustomizer( + (reader, unused) -> { + readerRef.set(reader); + return reader; + }) + .addResourceCustomizer( + (resource, c) -> + getResource(builder, resource, instrumentationScopeInfo, c, properties)) + .build(); + } + + private static Resource getResource( + OpenTelemetryExporter.Builder builder, + Resource resource, + InstrumentationScopeInfo instrumentationScopeInfo, + ConfigProperties configProperties, + ExporterOpenTelemetryProperties properties) { + return resource + .merge( + PropertiesResourceProvider.mergeResource( + builder.resourceAttributes, + builder.serviceName, + builder.serviceNamespace, + builder.serviceInstanceId, + builder.serviceVersion)) + .merge(ResourceConfiguration.createEnvironmentResource(configProperties)) + .merge( + PropertiesResourceProvider.mergeResource( + properties.getResourceAttributes(), + properties.getServiceName(), + properties.getServiceNamespace(), + properties.getServiceInstanceId(), + properties.getServiceVersion())) + .merge(Resource.create(otelResourceAttributes(instrumentationScopeInfo))); + } + + /** + * Only copy the service instance id from the Otel agent resource attributes. + * + *

    All other attributes are calculated from the configuration using OTel SDK AutoConfig. + */ + private static Attributes otelResourceAttributes( + InstrumentationScopeInfo instrumentationScopeInfo) { + AttributesBuilder builder = Attributes.builder(); + Map attributes = + ResourceAttributesFromOtelAgent.getResourceAttributes(instrumentationScopeInfo.getName()); + String id = attributes.get(SERVICE_INSTANCE_ID); + if (id != null) { + builder.put(SERVICE_INSTANCE_ID, id); + } + return builder.build(); + } + + static Resource getResourceField(AutoConfiguredOpenTelemetrySdk sdk) { + try { + Method method = AutoConfiguredOpenTelemetrySdk.class.getDeclaredMethod("getResource"); + method.setAccessible(true); + return (Resource) method.invoke(sdk); + } catch (Exception e) { + throw new RuntimeException(e); + } + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/PrometheusInstrumentationScope.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/PrometheusInstrumentationScope.java new file mode 100644 index 000000000..5f02d38cc --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/PrometheusInstrumentationScope.java @@ -0,0 +1,55 @@ +package io.prometheus.metrics.exporter.opentelemetry; + +import io.opentelemetry.sdk.common.InstrumentationScopeInfo; +import java.util.Properties; + +class PrometheusInstrumentationScope { + + private static final String instrumentationScopePropertiesFile = + "instrumentationScope.properties"; + private static final String instrumentationScopeNameKey = "instrumentationScope.name"; + private static final String instrumentationScopeVersionKey = "instrumentationScope.version"; + + public static InstrumentationScopeInfo loadInstrumentationScopeInfo() { + return loadInstrumentationScopeInfo( + instrumentationScopePropertiesFile, + instrumentationScopeNameKey, + instrumentationScopeVersionKey); + } + + static InstrumentationScopeInfo loadInstrumentationScopeInfo( + String path, String nameKey, String versionKey) { + try { + Properties properties = new Properties(); + properties.load( + PrometheusInstrumentationScope.class.getClassLoader().getResourceAsStream(path)); + String instrumentationScopeName = properties.getProperty(nameKey); + if (instrumentationScopeName == null) { + throw new IllegalStateException( + "Prometheus metrics library initialization error: " + + nameKey + + " not found in " + + path + + " in classpath."); + } + String instrumentationScopeVersion = properties.getProperty(versionKey); + if (instrumentationScopeVersion == null) { + throw new IllegalStateException( + "Prometheus metrics library initialization error: " + + versionKey + + " not found in " + + path + + " in classpath."); + } + return InstrumentationScopeInfo.builder(instrumentationScopeName) + .setVersion(instrumentationScopeVersion) + .build(); + } catch (Exception e) { + throw new IllegalStateException( + "Prometheus metrics library initialization error: Failed to read " + + path + + " from classpath.", + e); + } + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/PrometheusMetricProducer.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/PrometheusMetricProducer.java new file mode 100644 index 000000000..54aa5135a --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/PrometheusMetricProducer.java @@ -0,0 +1,135 @@ +package io.prometheus.metrics.exporter.opentelemetry; + +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.common.AttributesBuilder; +import io.opentelemetry.sdk.common.InstrumentationScopeInfo; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.metrics.export.CollectionRegistration; +import io.opentelemetry.sdk.resources.Resource; +import io.opentelemetry.sdk.resources.ResourceBuilder; +import io.prometheus.metrics.exporter.opentelemetry.otelmodel.MetricDataFactory; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import io.prometheus.metrics.model.snapshots.HistogramSnapshot; +import io.prometheus.metrics.model.snapshots.InfoSnapshot; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import io.prometheus.metrics.model.snapshots.StateSetSnapshot; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import io.prometheus.metrics.model.snapshots.UnknownSnapshot; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import javax.annotation.Nullable; + +class PrometheusMetricProducer implements CollectionRegistration { + + private final PrometheusRegistry registry; + private final Resource resource; + private final InstrumentationScopeInfo instrumentationScopeInfo; + + public PrometheusMetricProducer( + PrometheusRegistry registry, + InstrumentationScopeInfo instrumentationScopeInfo, + Resource resource) { + this.registry = registry; + this.instrumentationScopeInfo = instrumentationScopeInfo; + this.resource = resource; + } + + @Override + public Collection collectAllMetrics() { + // TODO: We could add a filter configuration for the OpenTelemetry exporter and call + // registry.scrape(filter) if a filter is configured, like in the Servlet exporter. + MetricSnapshots snapshots = registry.scrape(); + Resource resourceWithTargetInfo = resource.merge(resourceFromTargetInfo(snapshots)); + InstrumentationScopeInfo scopeFromInfo = instrumentationScopeFromOtelScopeInfo(snapshots); + List result = new ArrayList<>(snapshots.size()); + MetricDataFactory factory = + new MetricDataFactory( + resourceWithTargetInfo, + scopeFromInfo != null ? scopeFromInfo : instrumentationScopeInfo, + System.currentTimeMillis()); + for (MetricSnapshot snapshot : snapshots) { + if (snapshot instanceof CounterSnapshot) { + addUnlessNull(result, factory.create((CounterSnapshot) snapshot)); + } else if (snapshot instanceof GaugeSnapshot) { + addUnlessNull(result, factory.create((GaugeSnapshot) snapshot)); + } else if (snapshot instanceof HistogramSnapshot) { + if (!((HistogramSnapshot) snapshot).isGaugeHistogram()) { + addUnlessNull(result, factory.create((HistogramSnapshot) snapshot)); + } + } else if (snapshot instanceof SummarySnapshot) { + addUnlessNull(result, factory.create((SummarySnapshot) snapshot)); + } else if (snapshot instanceof InfoSnapshot) { + String name = snapshot.getMetadata().getPrometheusName(); + if (!name.equals("target") && !name.equals("otel_scope")) { + addUnlessNull(result, factory.create((InfoSnapshot) snapshot)); + } + } else if (snapshot instanceof StateSetSnapshot) { + addUnlessNull(result, factory.create((StateSetSnapshot) snapshot)); + } else if (snapshot instanceof UnknownSnapshot) { + addUnlessNull(result, factory.create((UnknownSnapshot) snapshot)); + } + } + return result; + } + + private Resource resourceFromTargetInfo(MetricSnapshots snapshots) { + ResourceBuilder result = Resource.builder(); + for (MetricSnapshot snapshot : snapshots) { + if (snapshot.getMetadata().getName().equals("target") && snapshot instanceof InfoSnapshot) { + InfoSnapshot targetInfo = (InfoSnapshot) snapshot; + if (!targetInfo.getDataPoints().isEmpty()) { + InfoSnapshot.InfoDataPointSnapshot data = targetInfo.getDataPoints().get(0); + Labels labels = data.getLabels(); + for (int i = 0; i < labels.size(); i++) { + result.put(labels.getName(i), labels.getValue(i)); + } + } + } + } + return result.build(); + } + + @Nullable + private InstrumentationScopeInfo instrumentationScopeFromOtelScopeInfo( + MetricSnapshots snapshots) { + for (MetricSnapshot snapshot : snapshots) { + if (snapshot.getMetadata().getPrometheusName().equals("otel_scope") + && snapshot instanceof InfoSnapshot) { + InfoSnapshot scopeInfo = (InfoSnapshot) snapshot; + if (!scopeInfo.getDataPoints().isEmpty()) { + Labels labels = scopeInfo.getDataPoints().get(0).getLabels(); + String name = null; + String version = null; + AttributesBuilder attributesBuilder = Attributes.builder(); + for (int i = 0; i < labels.size(); i++) { + if (labels.getPrometheusName(i).equals("otel_scope_name")) { + name = labels.getValue(i); + } else if (labels.getPrometheusName(i).equals("otel_scope_version")) { + version = labels.getValue(i); + } else { + attributesBuilder.put(labels.getName(i), labels.getValue(i)); + } + } + if (name != null) { + return InstrumentationScopeInfo.builder(name) + .setVersion(version) + .setAttributes(attributesBuilder.build()) + .build(); + } + } + } + } + return null; + } + + private void addUnlessNull(List result, @Nullable MetricData data) { + if (data != null) { + result.add(data); + } + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/PropertiesResourceProvider.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/PropertiesResourceProvider.java new file mode 100644 index 000000000..cd906167c --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/PropertiesResourceProvider.java @@ -0,0 +1,36 @@ +package io.prometheus.metrics.exporter.opentelemetry; + +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.common.AttributesBuilder; +import io.opentelemetry.sdk.resources.Resource; +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Nullable; + +final class PropertiesResourceProvider { + + static Resource mergeResource( + Map resourceAttributes, + @Nullable String serviceName, + @Nullable String serviceNamespace, + @Nullable String serviceInstanceId, + @Nullable String serviceVersion) { + Map resource = new HashMap<>(resourceAttributes); + if (serviceName != null) { + resource.put("service.name", serviceName); + } + if (serviceNamespace != null) { + resource.put("service.namespace", serviceNamespace); + } + if (serviceInstanceId != null) { + resource.put("service.instance.id", serviceInstanceId); + } + if (serviceVersion != null) { + resource.put("service.version", serviceVersion); + } + + AttributesBuilder builder = Attributes.builder(); + resource.forEach(builder::put); + return Resource.create(builder.build()); + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/PropertyMapper.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/PropertyMapper.java new file mode 100644 index 000000000..2c00beb2f --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/PropertyMapper.java @@ -0,0 +1,115 @@ +package io.prometheus.metrics.exporter.opentelemetry; + +import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; +import io.prometheus.metrics.config.ExporterOpenTelemetryProperties; +import io.prometheus.metrics.config.PrometheusPropertiesException; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; +import javax.annotation.Nullable; + +class PropertyMapper { + + private static final String METRICS_ENDPOINT = "otel.exporter.otlp.metrics.endpoint"; + Map configLowPriority = new HashMap<>(); + Map configHighPriority = new HashMap<>(); + + static PropertyMapper create( + ExporterOpenTelemetryProperties properties, OpenTelemetryExporter.Builder builder) + throws PrometheusPropertiesException { + return new PropertyMapper() + .addString( + builder.protocol, properties.getProtocol(), "otel.exporter.otlp.metrics.protocol") + .addString(builder.endpoint, properties.getEndpoint(), METRICS_ENDPOINT) + .addString( + mapToOtelString(builder.headers), + mapToOtelString(properties.getHeaders()), + "otel.exporter.otlp.metrics.headers") + .addString(builder.interval, properties.getInterval(), "otel.metric.export.interval") + .addString(builder.timeout, properties.getTimeout(), "otel.exporter.otlp.metrics.timeout") + .addString(builder.serviceName, properties.getServiceName(), "otel.service.name"); + } + + PropertyMapper addString( + @Nullable String builderValue, @Nullable String propertyValue, String otelKey) { + if (builderValue != null) { + // the low priority config should not be used for the metrics settings, so that both general + // and metrics settings + // can be used to override the values + configLowPriority.put(otelKey.replace("otlp.metrics", "otlp"), builderValue); + } + if (propertyValue != null) { + configHighPriority.put(otelKey, propertyValue); + } + return this; + } + + @Nullable + private static String mapToOtelString(Map map) { + if (map.isEmpty()) { + return null; + } + StringBuilder sb = new StringBuilder(); + for (Map.Entry entry : map.entrySet()) { + sb.append(entry.getKey()).append("=").append(entry.getValue()).append(","); + } + return sb.substring(0, sb.length() - 1); + } + + static Map customizeProperties(Map result, ConfigProperties c) { + Map map = fixEndpointPaths(result, c); + map.put("otel.logs.exporter", "none"); + map.put("otel.traces.exporter", "none"); + return map; + } + + static Map fixEndpointPaths(Map result, ConfigProperties c) { + transformEndpointPath( + result, + c, + METRICS_ENDPOINT, + endpoint -> { + if (!endpoint.endsWith("v1/metrics")) { + if (!endpoint.endsWith("/")) { + return endpoint + "/v1/metrics"; + } else { + return endpoint + "v1/metrics"; + } + } + return endpoint; + }); + + transformEndpointPath( + result, + c, + "otel.exporter.otlp.endpoint", + endpoint -> { + if (endpoint.endsWith("v1/metrics")) { + return endpoint.substring(0, endpoint.length() - "v1/metrics".length()); + } + return endpoint; + }); + + return result; + } + + static void transformEndpointPath( + Map result, + ConfigProperties c, + String key, + Function valueMapper) { + String endpoint = c.getString(key); + if (endpoint == null) { + return; + } + String protocol = c.getString("otel.exporter.otlp.metrics.protocol"); + if (protocol == null) { + protocol = c.getString("otel.exporter.otlp.protocol"); + } + + if (!"grpc".equals(protocol)) { // http/protobuf + endpoint = valueMapper.apply(endpoint); + result.put(key, endpoint); + } + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/DoublePointDataImpl.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/DoublePointDataImpl.java new file mode 100644 index 000000000..043635977 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/DoublePointDataImpl.java @@ -0,0 +1,26 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.metrics.data.DoubleExemplarData; +import io.opentelemetry.sdk.metrics.data.DoublePointData; +import java.util.List; + +class DoublePointDataImpl extends PointDataImpl implements DoublePointData { + + private final double value; + + public DoublePointDataImpl( + double value, + long startEpochNanos, + long epochNanos, + Attributes attributes, + List exemplars) { + super(startEpochNanos, epochNanos, attributes, exemplars); + this.value = value; + } + + @Override + public double getValue() { + return value; + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/ExponentialHistogramBucketsImpl.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/ExponentialHistogramBucketsImpl.java new file mode 100644 index 000000000..3ec73c21d --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/ExponentialHistogramBucketsImpl.java @@ -0,0 +1,45 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import io.opentelemetry.sdk.metrics.data.ExponentialHistogramBuckets; +import java.util.ArrayList; +import java.util.List; + +class ExponentialHistogramBucketsImpl implements ExponentialHistogramBuckets { + + private final int scale; + private final int offset; + private final List bucketCounts = new ArrayList<>(); + + ExponentialHistogramBucketsImpl(int scale, int offset) { + this.scale = scale; + this.offset = offset; + } + + void addCount(long count) { + bucketCounts.add(count); + } + + @Override + public int getScale() { + return scale; + } + + @Override + public int getOffset() { + return offset; + } + + @Override + public List getBucketCounts() { + return bucketCounts; + } + + @Override + public long getTotalCount() { + long result = 0; + for (Long count : bucketCounts) { + result += count; + } + return result; + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/ExponentialHistogramPointDataImpl.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/ExponentialHistogramPointDataImpl.java new file mode 100644 index 000000000..70be47b82 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/ExponentialHistogramPointDataImpl.java @@ -0,0 +1,95 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.metrics.data.DoubleExemplarData; +import io.opentelemetry.sdk.metrics.data.ExponentialHistogramBuckets; +import io.opentelemetry.sdk.metrics.data.ExponentialHistogramPointData; +import java.util.List; + +public class ExponentialHistogramPointDataImpl extends PointDataImpl + implements ExponentialHistogramPointData { + + private final int scale; + private final double sum; + private final long count; + private final long zeroCount; + private final double min; + private final double max; + + private final ExponentialHistogramBuckets positiveBuckets; + private final ExponentialHistogramBuckets negativeBuckets; + + ExponentialHistogramPointDataImpl( + int scale, + double sum, + long count, + long zeroCount, + double min, + double max, + ExponentialHistogramBuckets positiveBuckets, + ExponentialHistogramBuckets negativeBuckets, + long startEpochNanos, + long epochNanos, + Attributes attributes, + List exemplars) { + super(startEpochNanos, epochNanos, attributes, exemplars); + this.scale = scale; + this.sum = sum; + this.count = count; + this.zeroCount = zeroCount; + this.min = min; + this.max = max; + this.positiveBuckets = positiveBuckets; + this.negativeBuckets = negativeBuckets; + } + + @Override + public int getScale() { + return scale; + } + + @Override + public double getSum() { + return sum; + } + + @Override + public long getCount() { + return count; + } + + @Override + public long getZeroCount() { + return zeroCount; + } + + @Override + public boolean hasMin() { + return !Double.isNaN(min); + } + + @Override + public double getMin() { + return min; + } + + @Override + public boolean hasMax() { + return !Double.isNaN(max); + } + + @Override + public double getMax() { + return max; + } + + @Override + public ExponentialHistogramBuckets getPositiveBuckets() { + return positiveBuckets; + } + + @Override + public ExponentialHistogramBuckets getNegativeBuckets() { + return negativeBuckets; + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/HistogramPointDataImpl.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/HistogramPointDataImpl.java new file mode 100644 index 000000000..22b98850b --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/HistogramPointDataImpl.java @@ -0,0 +1,76 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.metrics.data.DoubleExemplarData; +import io.opentelemetry.sdk.metrics.data.HistogramPointData; +import java.util.List; + +public class HistogramPointDataImpl extends PointDataImpl implements HistogramPointData { + + private final double sum; + private final long count; + private final double min; + private final double max; + private final List boundaries; + private final List counts; + + public HistogramPointDataImpl( + double sum, + long count, + double min, + double max, + List boundaries, + List counts, + long startEpochNanos, + long epochNanos, + Attributes attributes, + List exemplars) { + super(startEpochNanos, epochNanos, attributes, exemplars); + this.sum = sum; + this.count = count; + this.min = min; + this.max = max; + this.boundaries = boundaries; + this.counts = counts; + } + + @Override + public double getSum() { + return sum; + } + + @Override + public long getCount() { + return count; + } + + @Override + public boolean hasMin() { + return !Double.isNaN(min); + } + + @Override + public double getMin() { + return min; + } + + @Override + public boolean hasMax() { + return !Double.isNaN(max); + } + + @Override + public double getMax() { + return max; + } + + @Override + public List getBoundaries() { + return boundaries; + } + + @Override + public List getCounts() { + return counts; + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/MetricDataFactory.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/MetricDataFactory.java new file mode 100644 index 000000000..4c75d2622 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/MetricDataFactory.java @@ -0,0 +1,98 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import io.opentelemetry.sdk.common.InstrumentationScopeInfo; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.resources.Resource; +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import io.prometheus.metrics.model.snapshots.HistogramSnapshot; +import io.prometheus.metrics.model.snapshots.InfoSnapshot; +import io.prometheus.metrics.model.snapshots.StateSetSnapshot; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import io.prometheus.metrics.model.snapshots.UnknownSnapshot; +import javax.annotation.Nullable; + +public class MetricDataFactory { + + private final Resource resource; + private final InstrumentationScopeInfo instrumentationScopeInfo; + private final long currentTimeMillis; + + public MetricDataFactory( + Resource resource, + InstrumentationScopeInfo instrumentationScopeInfo, + long currentTimeMillis) { + this.resource = resource; + this.instrumentationScopeInfo = instrumentationScopeInfo; + this.currentTimeMillis = currentTimeMillis; + } + + public MetricData create(CounterSnapshot snapshot) { + return new PrometheusMetricData<>( + snapshot.getMetadata(), + new PrometheusCounter(snapshot, currentTimeMillis), + instrumentationScopeInfo, + resource); + } + + public MetricData create(GaugeSnapshot snapshot) { + return new PrometheusMetricData<>( + snapshot.getMetadata(), + new PrometheusGauge(snapshot, currentTimeMillis), + instrumentationScopeInfo, + resource); + } + + @Nullable + public MetricData create(HistogramSnapshot snapshot) { + if (!snapshot.getDataPoints().isEmpty()) { + HistogramSnapshot.HistogramDataPointSnapshot firstDataPoint = snapshot.getDataPoints().get(0); + if (firstDataPoint.hasNativeHistogramData()) { + return new PrometheusMetricData<>( + snapshot.getMetadata(), + new PrometheusNativeHistogram(snapshot, currentTimeMillis), + instrumentationScopeInfo, + resource); + } else if (firstDataPoint.hasClassicHistogramData()) { + return new PrometheusMetricData<>( + snapshot.getMetadata(), + new PrometheusClassicHistogram(snapshot, currentTimeMillis), + instrumentationScopeInfo, + resource); + } + } + return null; + } + + public MetricData create(SummarySnapshot snapshot) { + return new PrometheusMetricData<>( + snapshot.getMetadata(), + new PrometheusSummary(snapshot, currentTimeMillis), + instrumentationScopeInfo, + resource); + } + + public MetricData create(InfoSnapshot snapshot) { + return new PrometheusMetricData<>( + snapshot.getMetadata(), + new PrometheusInfo(snapshot, currentTimeMillis), + instrumentationScopeInfo, + resource); + } + + public MetricData create(StateSetSnapshot snapshot) { + return new PrometheusMetricData<>( + snapshot.getMetadata(), + new PrometheusStateSet(snapshot, currentTimeMillis), + instrumentationScopeInfo, + resource); + } + + public MetricData create(UnknownSnapshot snapshot) { + return new PrometheusMetricData<>( + snapshot.getMetadata(), + new PrometheusUnknown(snapshot, currentTimeMillis), + instrumentationScopeInfo, + resource); + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PointDataImpl.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PointDataImpl.java new file mode 100644 index 000000000..bf4b8e4d7 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PointDataImpl.java @@ -0,0 +1,45 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.metrics.data.DoubleExemplarData; +import io.opentelemetry.sdk.metrics.data.PointData; +import java.util.List; + +abstract class PointDataImpl implements PointData { + + private final long startEpochNanos; + private final long epochNanos; + private final Attributes attributes; + private final List exemplars; + + PointDataImpl( + long startEpochNanos, + long epochNanos, + Attributes attributes, + List exemplars) { + this.startEpochNanos = startEpochNanos; + this.epochNanos = epochNanos; + this.attributes = attributes; + this.exemplars = exemplars; + } + + @Override + public long getStartEpochNanos() { + return startEpochNanos; + } + + @Override + public long getEpochNanos() { + return epochNanos; + } + + @Override + public Attributes getAttributes() { + return attributes; + } + + @Override + public List getExemplars() { + return exemplars; + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusClassicHistogram.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusClassicHistogram.java new file mode 100644 index 000000000..1a2152fe0 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusClassicHistogram.java @@ -0,0 +1,85 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import io.opentelemetry.sdk.metrics.data.AggregationTemporality; +import io.opentelemetry.sdk.metrics.data.HistogramData; +import io.opentelemetry.sdk.metrics.data.HistogramPointData; +import io.opentelemetry.sdk.metrics.data.MetricDataType; +import io.prometheus.metrics.model.snapshots.ClassicHistogramBuckets; +import io.prometheus.metrics.model.snapshots.HistogramSnapshot; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import javax.annotation.Nullable; + +class PrometheusClassicHistogram extends PrometheusData + implements HistogramData { + + private final List points; + + PrometheusClassicHistogram(HistogramSnapshot snapshot, long currentTimeMillis) { + super(MetricDataType.HISTOGRAM); + this.points = + snapshot.getDataPoints().stream() + .map(dataPoint -> toOtelDataPoint(dataPoint, currentTimeMillis)) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + } + + @Override + public AggregationTemporality getAggregationTemporality() { + return AggregationTemporality.CUMULATIVE; + } + + @Override + public Collection getPoints() { + return points; + } + + @Nullable + private HistogramPointData toOtelDataPoint( + HistogramSnapshot.HistogramDataPointSnapshot dataPoint, long currentTimeMillis) { + if (!dataPoint.hasClassicHistogramData()) { + return null; + } else { + return new HistogramPointDataImpl( + dataPoint.hasSum() ? dataPoint.getSum() : Double.NaN, + dataPoint.hasCount() + ? dataPoint.getCount() + : calculateCount(dataPoint.getClassicBuckets()), + Double.NaN, + Double.NaN, + makeBoundaries(dataPoint.getClassicBuckets()), + makeCounts(dataPoint.getClassicBuckets()), + getStartEpochNanos(dataPoint), + getEpochNanos(dataPoint, currentTimeMillis), + labelsToAttributes(dataPoint.getLabels()), + convertExemplars(dataPoint.getExemplars())); + } + } + + private long calculateCount(ClassicHistogramBuckets buckets) { + long result = 0; + for (int i = 0; i < buckets.size(); i++) { + result += buckets.getCount(i); + } + return result; + } + + private List makeBoundaries(ClassicHistogramBuckets buckets) { + List result = new ArrayList<>(buckets.size()); + for (int i = 0; i < buckets.size(); i++) { + result.add(buckets.getUpperBound(i)); + } + return result; + } + + private List makeCounts(ClassicHistogramBuckets buckets) { + List result = new ArrayList<>(buckets.size()); + for (int i = 0; i < buckets.size(); i++) { + result.add(buckets.getCount(i)); + } + return result; + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusCounter.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusCounter.java new file mode 100644 index 000000000..e44ce901c --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusCounter.java @@ -0,0 +1,49 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import io.opentelemetry.sdk.metrics.data.AggregationTemporality; +import io.opentelemetry.sdk.metrics.data.DoublePointData; +import io.opentelemetry.sdk.metrics.data.MetricDataType; +import io.opentelemetry.sdk.metrics.data.SumData; +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +class PrometheusCounter extends PrometheusData + implements SumData { + + private final List points; + + public PrometheusCounter(CounterSnapshot snapshot, long currentTimeMillis) { + super(MetricDataType.DOUBLE_SUM); + this.points = + snapshot.getDataPoints().stream() + .map(dataPoint -> toOtelDataPoint(dataPoint, currentTimeMillis)) + .collect(Collectors.toList()); + } + + @Override + public boolean isMonotonic() { + return true; + } + + @Override + public AggregationTemporality getAggregationTemporality() { + return AggregationTemporality.CUMULATIVE; + } + + @Override + public Collection getPoints() { + return points; + } + + private DoublePointData toOtelDataPoint( + CounterSnapshot.CounterDataPointSnapshot dataPoint, long currentTimeMillis) { + return new DoublePointDataImpl( + dataPoint.getValue(), + getStartEpochNanos(dataPoint), + getEpochNanos(dataPoint, currentTimeMillis), + labelsToAttributes(dataPoint.getLabels()), + convertExemplar(dataPoint.getExemplar())); + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusData.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusData.java new file mode 100644 index 000000000..e13b4d121 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusData.java @@ -0,0 +1,105 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.common.AttributesBuilder; +import io.opentelemetry.api.trace.SpanContext; +import io.opentelemetry.api.trace.TraceFlags; +import io.opentelemetry.api.trace.TraceState; +import io.opentelemetry.sdk.metrics.data.Data; +import io.opentelemetry.sdk.metrics.data.DoubleExemplarData; +import io.opentelemetry.sdk.metrics.data.MetricDataType; +import io.opentelemetry.sdk.metrics.data.PointData; +import io.opentelemetry.sdk.metrics.internal.data.ImmutableDoubleExemplarData; +import io.prometheus.metrics.model.snapshots.DataPointSnapshot; +import io.prometheus.metrics.model.snapshots.Exemplar; +import io.prometheus.metrics.model.snapshots.Exemplars; +import io.prometheus.metrics.model.snapshots.Label; +import io.prometheus.metrics.model.snapshots.Labels; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; +import javax.annotation.Nullable; + +abstract class PrometheusData implements Data { + + private final MetricDataType type; + + public PrometheusData(MetricDataType type) { + this.type = type; + } + + public MetricDataType getType() { + return type; + } + + protected Attributes labelsToAttributes(Labels labels) { + if (labels.isEmpty()) { + return Attributes.empty(); + } else { + AttributesBuilder builder = Attributes.builder(); + for (int i = 0; i < labels.size(); i++) { + builder.put(labels.getName(i), labels.getValue(i)); + } + return builder.build(); + } + } + + protected List convertExemplar(@Nullable Exemplar exemplar) { + if (exemplar == null) { + return Collections.emptyList(); + } + return convertExemplars(Exemplars.of(exemplar)); + } + + protected List convertExemplars(Exemplars exemplars) { + return StreamSupport.stream(exemplars.spliterator(), false) + .map(this::toDoubleExemplarData) + .collect(Collectors.toList()); + } + + @Nullable + protected DoubleExemplarData toDoubleExemplarData(@Nullable Exemplar exemplar) { + if (exemplar == null) { + return null; + } + + AttributesBuilder filteredAttributesBuilder = Attributes.builder(); + String traceId = null; + String spanId = null; + for (Label label : exemplar.getLabels()) { + if (label.getName().equals(Exemplar.TRACE_ID)) { + traceId = label.getValue(); + } else if (label.getName().equals(Exemplar.SPAN_ID)) { + spanId = label.getValue(); + } else { + filteredAttributesBuilder.put(label.getName(), label.getValue()); + } + } + Attributes filteredAttributes = filteredAttributesBuilder.build(); + + SpanContext spanContext = + (traceId != null && spanId != null) + ? SpanContext.create(traceId, spanId, TraceFlags.getSampled(), TraceState.getDefault()) + : SpanContext.getInvalid(); + + return ImmutableDoubleExemplarData.create( + filteredAttributes, + TimeUnit.MILLISECONDS.toNanos(exemplar.getTimestampMillis()), + spanContext, + exemplar.getValue()); + } + + protected long getStartEpochNanos(DataPointSnapshot dataPoint) { + return dataPoint.hasCreatedTimestamp() + ? TimeUnit.MILLISECONDS.toNanos(dataPoint.getCreatedTimestampMillis()) + : 0L; + } + + protected long getEpochNanos(DataPointSnapshot dataPoint, long currentTimeMillis) { + return dataPoint.hasScrapeTimestamp() + ? TimeUnit.MILLISECONDS.toNanos(dataPoint.getScrapeTimestampMillis()) + : TimeUnit.MILLISECONDS.toNanos(currentTimeMillis); + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusGauge.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusGauge.java new file mode 100644 index 000000000..ecdc7ab75 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusGauge.java @@ -0,0 +1,38 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import io.opentelemetry.sdk.metrics.data.DoublePointData; +import io.opentelemetry.sdk.metrics.data.GaugeData; +import io.opentelemetry.sdk.metrics.data.MetricDataType; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +class PrometheusGauge extends PrometheusData + implements GaugeData { + + private final List points; + + public PrometheusGauge(GaugeSnapshot snapshot, long currentTimeMillis) { + super(MetricDataType.DOUBLE_GAUGE); + this.points = + snapshot.getDataPoints().stream() + .map(dataPoint -> toOtelDataPoint(dataPoint, currentTimeMillis)) + .collect(Collectors.toList()); + } + + @Override + public Collection getPoints() { + return points; + } + + private DoublePointData toOtelDataPoint( + GaugeSnapshot.GaugeDataPointSnapshot dataPoint, long currentTimeMillis) { + return new DoublePointDataImpl( + dataPoint.getValue(), + getStartEpochNanos(dataPoint), + getEpochNanos(dataPoint, currentTimeMillis), + labelsToAttributes(dataPoint.getLabels()), + convertExemplar(dataPoint.getExemplar())); + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusInfo.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusInfo.java new file mode 100644 index 000000000..2a7b8110f --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusInfo.java @@ -0,0 +1,51 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import io.opentelemetry.sdk.metrics.data.AggregationTemporality; +import io.opentelemetry.sdk.metrics.data.DoublePointData; +import io.opentelemetry.sdk.metrics.data.MetricDataType; +import io.opentelemetry.sdk.metrics.data.SumData; +import io.prometheus.metrics.model.snapshots.InfoSnapshot; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +@SuppressWarnings("this-escape") +public class PrometheusInfo extends PrometheusData + implements SumData { + + private final List points; + + public PrometheusInfo(InfoSnapshot snapshot, long currentTimeMillis) { + super(MetricDataType.DOUBLE_SUM); + this.points = + snapshot.getDataPoints().stream() + .map(dataPoint -> toOtelDataPoint(dataPoint, currentTimeMillis)) + .collect(Collectors.toList()); + } + + @Override + public boolean isMonotonic() { + return false; + } + + @Override + public AggregationTemporality getAggregationTemporality() { + return AggregationTemporality.CUMULATIVE; + } + + @Override + public Collection getPoints() { + return points; + } + + private DoublePointData toOtelDataPoint( + InfoSnapshot.InfoDataPointSnapshot dataPoint, long currentTimeMillis) { + return new DoublePointDataImpl( + 1.0, + getStartEpochNanos(dataPoint), + getEpochNanos(dataPoint, currentTimeMillis), + labelsToAttributes(dataPoint.getLabels()), + Collections.emptyList()); + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusMetricData.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusMetricData.java new file mode 100644 index 000000000..20603123c --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusMetricData.java @@ -0,0 +1,168 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import io.opentelemetry.sdk.common.InstrumentationScopeInfo; +import io.opentelemetry.sdk.metrics.data.DoublePointData; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.metrics.data.MetricDataType; +import io.opentelemetry.sdk.metrics.data.SumData; +import io.opentelemetry.sdk.resources.Resource; +import io.prometheus.metrics.model.snapshots.MetricMetadata; +import io.prometheus.metrics.model.snapshots.Unit; +import javax.annotation.Nullable; + +class PrometheusMetricData> implements MetricData { + + private final Resource resource; + private final InstrumentationScopeInfo instrumentationScopeInfo; + private final String name; + @Nullable private final String description; + @Nullable private final String unit; + T data; + + PrometheusMetricData( + MetricMetadata metricMetadata, + T data, + InstrumentationScopeInfo instrumentationScopeInfo, + Resource resource) { + this.instrumentationScopeInfo = instrumentationScopeInfo; + this.resource = resource; + this.name = getNameWithoutUnit(metricMetadata); + this.description = metricMetadata.getHelp(); + this.unit = convertUnit(metricMetadata.getUnit()); + this.data = data; + } + + // In OpenTelemetry the unit should not be part of the metric name. + private String getNameWithoutUnit(MetricMetadata metricMetadata) { + String name = metricMetadata.getName(); + if (metricMetadata.getUnit() != null) { + String unit = metricMetadata.getUnit().toString(); + if (name.endsWith(unit)) { + name = name.substring(0, name.length() - unit.length()); + } + while (name.endsWith("_")) { + name = name.substring(0, name.length() - 1); + } + } + return name; + } + + // See + // https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/6cf4dec6cb42d87d8840e9f67d4acf66d4eb8fda/pkg/translator/prometheus/normalize_name.go#L19 + @Nullable + static String convertUnit(@Nullable Unit unit) { + if (unit == null) { + return null; + } + switch (unit.toString()) { + // Time + case "days": + return "d"; + case "hours": + return "h"; + case "minutes": + return "min"; + case "seconds": + return "s"; + case "milliseconds": + return "ms"; + case "microseconds": + return "us"; + case "nanoseconds": + return "ns"; + // Bytes + case "bytes": + return "By"; + case "kibibytes": + return "KiBy"; + case "mebibytes": + return "MiBy"; + case "gibibytes": + return "GiBy"; + case "tibibytes": + return "TiBy"; + case "kilobytes": + return "KBy"; + case "megabytes": + return "MBy"; + case "gigabytes": + return "GBy"; + case "terabytes": + return "TBy"; + // SI + case "meters": + return "m"; + case "volts": + return "V"; + case "amperes": + return "A"; + case "joules": + return "J"; + case "watts": + return "W"; + case "grams": + return "g"; + // Misc + case "celsius": + return "Cel"; + case "hertz": + return "Hz"; + case "percent": + return "%"; + // default + default: + return unit.toString(); + } + } + + @Override + public Resource getResource() { + return resource; + } + + @Override + public InstrumentationScopeInfo getInstrumentationScopeInfo() { + return instrumentationScopeInfo; + } + + @Override + public String getName() { + return name; + } + + @Override + @Nullable + public String getDescription() { + return description; + } + + @Override + @Nullable + public String getUnit() { + return unit; + } + + @Override + public MetricDataType getType() { + return data.getType(); + } + + @Override + public T getData() { + return data; + } + + @Override + public SumData getDoubleSumData() { + if (data instanceof PrometheusCounter) { + return (PrometheusCounter) data; + } + if (data instanceof PrometheusStateSet) { + return (PrometheusStateSet) data; + } + if (data instanceof PrometheusInfo) { + return (PrometheusInfo) data; + } + return MetricData.super.getDoubleSumData(); + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusNativeHistogram.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusNativeHistogram.java new file mode 100644 index 000000000..61a4506e2 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusNativeHistogram.java @@ -0,0 +1,90 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import io.opentelemetry.sdk.metrics.data.AggregationTemporality; +import io.opentelemetry.sdk.metrics.data.ExponentialHistogramBuckets; +import io.opentelemetry.sdk.metrics.data.ExponentialHistogramData; +import io.opentelemetry.sdk.metrics.data.ExponentialHistogramPointData; +import io.opentelemetry.sdk.metrics.data.MetricDataType; +import io.prometheus.metrics.model.snapshots.HistogramSnapshot; +import io.prometheus.metrics.model.snapshots.NativeHistogramBuckets; +import java.util.Collection; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import javax.annotation.Nullable; + +class PrometheusNativeHistogram extends PrometheusData + implements ExponentialHistogramData { + + private final List points; + + PrometheusNativeHistogram(HistogramSnapshot snapshot, long currentTimeMillis) { + super(MetricDataType.EXPONENTIAL_HISTOGRAM); + this.points = + snapshot.getDataPoints().stream() + .map(dataPoint -> toOtelDataPoint(dataPoint, currentTimeMillis)) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + } + + @Override + public AggregationTemporality getAggregationTemporality() { + return AggregationTemporality.CUMULATIVE; + } + + @Override + public Collection getPoints() { + return points; + } + + @Nullable + private ExponentialHistogramPointData toOtelDataPoint( + HistogramSnapshot.HistogramDataPointSnapshot dataPoint, long currentTimeMillis) { + if (!dataPoint.hasNativeHistogramData()) { + return null; + } + return new ExponentialHistogramPointDataImpl( + dataPoint.getNativeSchema(), + dataPoint.hasSum() ? dataPoint.getSum() : Double.NaN, + dataPoint.hasCount() ? dataPoint.getCount() : calculateCount(dataPoint), + dataPoint.getNativeZeroCount(), + Double.NaN, + Double.NaN, + convertBuckets(dataPoint.getNativeSchema(), dataPoint.getNativeBucketsForPositiveValues()), + convertBuckets(dataPoint.getNativeSchema(), dataPoint.getNativeBucketsForNegativeValues()), + getStartEpochNanos(dataPoint), + getEpochNanos(dataPoint, currentTimeMillis), + labelsToAttributes(dataPoint.getLabels()), + convertExemplars(dataPoint.getExemplars())); + } + + private ExponentialHistogramBuckets convertBuckets(int scale, NativeHistogramBuckets buckets) { + if (buckets.size() == 0) { + return new ExponentialHistogramBucketsImpl(scale, 0); + } + int offset = buckets.getBucketIndex(0); + ExponentialHistogramBucketsImpl result = new ExponentialHistogramBucketsImpl(scale, offset - 1); + int currentBucket = 0; + for (int i = offset; i <= buckets.getBucketIndex(buckets.size() - 1); i++) { + if (buckets.getBucketIndex(currentBucket) == i) { + result.addCount(buckets.getCount(currentBucket)); + currentBucket++; + } else { + result.addCount(0); + } + } + return result; + } + + private long calculateCount(HistogramSnapshot.HistogramDataPointSnapshot dataPoint) { + long result = 0L; + for (int i = 0; i < dataPoint.getNativeBucketsForPositiveValues().size(); i++) { + result += dataPoint.getNativeBucketsForPositiveValues().getCount(i); + } + for (int i = 0; i < dataPoint.getNativeBucketsForNegativeValues().size(); i++) { + result += dataPoint.getNativeBucketsForNegativeValues().getCount(i); + } + result += dataPoint.getNativeZeroCount(); + return result; + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusStateSet.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusStateSet.java new file mode 100644 index 000000000..10417afc7 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusStateSet.java @@ -0,0 +1,60 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import io.opentelemetry.sdk.metrics.data.AggregationTemporality; +import io.opentelemetry.sdk.metrics.data.DoublePointData; +import io.opentelemetry.sdk.metrics.data.MetricDataType; +import io.opentelemetry.sdk.metrics.data.SumData; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.StateSetSnapshot; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +public class PrometheusStateSet extends PrometheusData + implements SumData { + + private final List points; + + @SuppressWarnings("this-escape") + public PrometheusStateSet(StateSetSnapshot snapshot, long currentTimeMillis) { + super(MetricDataType.DOUBLE_SUM); + this.points = new ArrayList<>(); + for (StateSetSnapshot.StateSetDataPointSnapshot dataPoint : snapshot.getDataPoints()) { + for (int i = 0; i < dataPoint.size(); i++) { + this.points.add(toOtelDataPoint(snapshot, dataPoint, i, currentTimeMillis)); + } + } + } + + @Override + public boolean isMonotonic() { + return false; + } + + @Override + public AggregationTemporality getAggregationTemporality() { + return AggregationTemporality.CUMULATIVE; + } + + @Override + public Collection getPoints() { + return points; + } + + private DoublePointData toOtelDataPoint( + StateSetSnapshot snapshot, + StateSetSnapshot.StateSetDataPointSnapshot dataPoint, + int i, + long currentTimeMillis) { + return new DoublePointDataImpl( + dataPoint.isTrue(i) ? 1.0 : 0.0, + getStartEpochNanos(dataPoint), + getEpochNanos(dataPoint, currentTimeMillis), + labelsToAttributes( + dataPoint + .getLabels() + .merge(Labels.of(snapshot.getMetadata().getName(), dataPoint.getName(i)))), + Collections.emptyList()); + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusSummary.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusSummary.java new file mode 100644 index 000000000..f1a81c83f --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusSummary.java @@ -0,0 +1,44 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import io.opentelemetry.sdk.metrics.data.MetricDataType; +import io.opentelemetry.sdk.metrics.data.SummaryData; +import io.opentelemetry.sdk.metrics.data.SummaryPointData; +import io.prometheus.metrics.model.snapshots.Quantile; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +class PrometheusSummary extends PrometheusData implements SummaryData { + + private final List points; + + PrometheusSummary(SummarySnapshot snapshot, long currentTimeMillis) { + super(MetricDataType.SUMMARY); + this.points = + snapshot.getDataPoints().stream() + .map(dataPoint -> toOtelDataPoint(dataPoint, currentTimeMillis)) + .collect(Collectors.toList()); + } + + @Override + public Collection getPoints() { + return points; + } + + private SummaryPointData toOtelDataPoint( + SummarySnapshot.SummaryDataPointSnapshot dataPoint, long currentTimeMillis) { + SummaryPointDataImpl result = + new SummaryPointDataImpl( + dataPoint.hasSum() ? dataPoint.getSum() : Double.NaN, + dataPoint.hasCount() ? dataPoint.getCount() : 0, + getStartEpochNanos(dataPoint), + getEpochNanos(dataPoint, currentTimeMillis), + labelsToAttributes(dataPoint.getLabels()), + convertExemplars(dataPoint.getExemplars())); + for (Quantile quantile : dataPoint.getQuantiles()) { + result.addValue(quantile.getQuantile(), quantile.getValue()); + } + return result; + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusUnknown.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusUnknown.java new file mode 100644 index 000000000..d52ea0942 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusUnknown.java @@ -0,0 +1,38 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import io.opentelemetry.sdk.metrics.data.DoublePointData; +import io.opentelemetry.sdk.metrics.data.GaugeData; +import io.opentelemetry.sdk.metrics.data.MetricDataType; +import io.prometheus.metrics.model.snapshots.UnknownSnapshot; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +class PrometheusUnknown extends PrometheusData + implements GaugeData { + + private final List points; + + public PrometheusUnknown(UnknownSnapshot snapshot, long currentTimeMillis) { + super(MetricDataType.DOUBLE_GAUGE); + this.points = + snapshot.getDataPoints().stream() + .map(dataPoint -> toOtelDataPoint(dataPoint, currentTimeMillis)) + .collect(Collectors.toList()); + } + + @Override + public Collection getPoints() { + return points; + } + + private DoublePointData toOtelDataPoint( + UnknownSnapshot.UnknownDataPointSnapshot dataPoint, long currentTimeMillis) { + return new DoublePointDataImpl( + dataPoint.getValue(), + getStartEpochNanos(dataPoint), + getEpochNanos(dataPoint, currentTimeMillis), + labelsToAttributes(dataPoint.getLabels()), + convertExemplar(dataPoint.getExemplar())); + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/SummaryPointDataImpl.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/SummaryPointDataImpl.java new file mode 100644 index 000000000..baa0ea782 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/SummaryPointDataImpl.java @@ -0,0 +1,46 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.metrics.data.DoubleExemplarData; +import io.opentelemetry.sdk.metrics.data.SummaryPointData; +import io.opentelemetry.sdk.metrics.data.ValueAtQuantile; +import java.util.ArrayList; +import java.util.List; + +public class SummaryPointDataImpl extends PointDataImpl implements SummaryPointData { + private final double sum; + private final long count; + private final List values; + + public SummaryPointDataImpl( + double sum, + long count, + long startEpochNanos, + long epochNanos, + Attributes attributes, + List exemplars) { + super(startEpochNanos, epochNanos, attributes, exemplars); + this.sum = sum; + this.count = count; + this.values = new ArrayList<>(); + } + + void addValue(double quantile, double value) { + values.add(new ValueAtQuantileImpl(quantile, value)); + } + + @Override + public long getCount() { + return count; + } + + @Override + public double getSum() { + return sum; + } + + @Override + public List getValues() { + return values; + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/ValueAtQuantileImpl.java b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/ValueAtQuantileImpl.java new file mode 100644 index 000000000..1b6363a05 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/ValueAtQuantileImpl.java @@ -0,0 +1,24 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import io.opentelemetry.sdk.metrics.data.ValueAtQuantile; + +public class ValueAtQuantileImpl implements ValueAtQuantile { + + private final double quantile; + private final double value; + + public ValueAtQuantileImpl(double quantile, double value) { + this.quantile = quantile; + this.value = value; + } + + @Override + public double getQuantile() { + return quantile; + } + + @Override + public double getValue() { + return value; + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/main/resources-filtered/instrumentationScope.properties b/prometheus-metrics-exporter-opentelemetry/src/main/resources-filtered/instrumentationScope.properties new file mode 100644 index 000000000..d1fa80d32 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/main/resources-filtered/instrumentationScope.properties @@ -0,0 +1,4 @@ +# Variables will be replaced by Maven at build time +# when this file is copied to the target/ directory. +instrumentationScope.name=${project.artifactId} +instrumentationScope.version=${project.version} diff --git a/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/ExemplarTest.java b/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/ExemplarTest.java new file mode 100644 index 000000000..48054b192 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/ExemplarTest.java @@ -0,0 +1,152 @@ +package io.prometheus.metrics.exporter.opentelemetry; + +import static com.github.tomakehurst.wiremock.client.WireMock.containing; +import static com.github.tomakehurst.wiremock.client.WireMock.equalTo; +import static com.github.tomakehurst.wiremock.client.WireMock.ok; +import static com.github.tomakehurst.wiremock.client.WireMock.post; +import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor; +import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; +import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; +import static com.github.tomakehurst.wiremock.client.WireMock.verify; +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.awaitility.Awaitility.await; + +import com.github.tomakehurst.wiremock.http.Request; +import com.github.tomakehurst.wiremock.junit5.WireMockTest; +import com.github.tomakehurst.wiremock.matching.MatchResult; +import com.github.tomakehurst.wiremock.matching.ValueMatcher; +import com.google.protobuf.InvalidProtocolBufferException; +import io.opentelemetry.api.trace.Span; +import io.opentelemetry.api.trace.Tracer; +import io.opentelemetry.context.Scope; +import io.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest; +import io.opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics; +import io.opentelemetry.proto.metrics.v1.Metric; +import io.opentelemetry.proto.metrics.v1.NumberDataPoint; +import io.opentelemetry.proto.metrics.v1.ResourceMetrics; +import io.opentelemetry.sdk.trace.SdkTracerProvider; +import io.opentelemetry.sdk.trace.samplers.Sampler; +import io.prometheus.metrics.core.metrics.Counter; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import org.awaitility.core.ConditionTimeoutException; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +@WireMockTest(httpPort = 4317) +class ExemplarTest { + private static final String ENDPOINT_PATH = "/v1/metrics"; + private static final int TIMEOUT = 3; + private static final String INSTRUMENTATION_SCOPE_NAME = "testInstrumentationScope"; + private static final String SPAN_NAME = "test-span"; + public static final String TEST_COUNTER_NAME = "test_counter"; + private Counter testCounter; + private OpenTelemetryExporter openTelemetryExporter; + + @BeforeEach + public void setUp() { + openTelemetryExporter = + OpenTelemetryExporter.builder() + .endpoint("http://localhost:4317") + .protocol("http/protobuf") + .intervalSeconds(1) + .buildAndStart(); + + testCounter = Counter.builder().name(TEST_COUNTER_NAME).withExemplars().register(); + + stubFor( + post(ENDPOINT_PATH) + .withHeader("Content-Type", containing("application/x-protobuf")) + .willReturn( + ok().withHeader("Content-Type", "application/json") + .withBody("{\"partialSuccess\":{}}"))); + } + + @AfterEach + public void tearDown() { + PrometheusRegistry.defaultRegistry.unregister(testCounter); + openTelemetryExporter.close(); + } + + @Test + @SuppressWarnings("try") + public void sampledExemplarIsForwarded() { + try (SdkTracerProvider sdkTracerProvider = + SdkTracerProvider.builder().setSampler(Sampler.alwaysOn()).build()) { + + Tracer test = sdkTracerProvider.get(INSTRUMENTATION_SCOPE_NAME); + Span span = test.spanBuilder(SPAN_NAME).startSpan(); + try (Scope ignored = span.makeCurrent()) { + testCounter.inc(2); + } + } + + await() + .atMost(TIMEOUT, SECONDS) + .ignoreException(com.github.tomakehurst.wiremock.client.VerificationException.class) + .until( + () -> { + verify( + postRequestedFor(urlEqualTo(ENDPOINT_PATH)) + .withHeader("Content-Type", equalTo("application/x-protobuf")) + .andMatching(getExemplarCountMatcher(1))); + return true; + }); + } + + @Test + @SuppressWarnings("try") + public void notSampledExemplarIsNotForwarded() { + try (SdkTracerProvider sdkTracerProvider = + SdkTracerProvider.builder().setSampler(Sampler.alwaysOff()).build()) { + + Tracer test = sdkTracerProvider.get(INSTRUMENTATION_SCOPE_NAME); + Span span = test.spanBuilder(SPAN_NAME).startSpan(); + try (Scope ignored = span.makeCurrent()) { + testCounter.inc(2); + } + } + + assertThatExceptionOfType(ConditionTimeoutException.class) + .isThrownBy( + () -> + await() + .atMost(TIMEOUT, SECONDS) + .ignoreException( + com.github.tomakehurst.wiremock.client.VerificationException.class) + .until( + () -> { + verify( + postRequestedFor(urlEqualTo(ENDPOINT_PATH)) + .withHeader("Content-Type", equalTo("application/x-protobuf")) + .andMatching(getExemplarCountMatcher(1))); + return true; + })); + } + + private static ValueMatcher getExemplarCountMatcher(int expectedCount) { + return request -> { + try { + ExportMetricsServiceRequest exportMetricsServiceRequest = + ExportMetricsServiceRequest.parseFrom(request.getBody()); + for (ResourceMetrics resourceMetrics : + exportMetricsServiceRequest.getResourceMetricsList()) { + for (InstrumentationLibraryMetrics instrumentationLibraryMetrics : + resourceMetrics.getInstrumentationLibraryMetricsList()) { + for (Metric metric : instrumentationLibraryMetrics.getMetricsList()) { + for (NumberDataPoint numberDataPoint : metric.getSum().getDataPointsList()) { + if (numberDataPoint.getExemplarsCount() == expectedCount) { + return MatchResult.exactMatch(); + } + } + } + } + } + } catch (InvalidProtocolBufferException e) { + throw new RuntimeException(e); + } + return MatchResult.noMatch(); + }; + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/ExportTest.java b/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/ExportTest.java new file mode 100644 index 000000000..55589ce84 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/ExportTest.java @@ -0,0 +1,312 @@ +package io.prometheus.metrics.exporter.opentelemetry; + +import static org.assertj.core.api.Assertions.assertThat; + +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.common.InstrumentationScopeInfo; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.metrics.export.MetricReader; +import io.opentelemetry.sdk.resources.Resource; +import io.opentelemetry.sdk.testing.assertj.MetricAssert; +import io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions; +import io.opentelemetry.sdk.testing.junit5.OpenTelemetryExtension; +import io.prometheus.metrics.core.metrics.Counter; +import io.prometheus.metrics.core.metrics.Gauge; +import io.prometheus.metrics.core.metrics.Histogram; +import io.prometheus.metrics.core.metrics.Info; +import io.prometheus.metrics.core.metrics.StateSet; +import io.prometheus.metrics.core.metrics.Summary; +import io.prometheus.metrics.model.registry.Collector; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.Unit; +import io.prometheus.metrics.model.snapshots.UnknownSnapshot; +import java.lang.reflect.Field; +import java.util.Collections; +import java.util.List; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +public class ExportTest { + + private static final Attributes ATTRIBUTES = + Attributes.of(AttributeKey.stringKey("label"), "val", AttributeKey.stringKey("key"), "value"); + @RegisterExtension OpenTelemetryExtension testing = OpenTelemetryExtension.create(); + + private final PrometheusRegistry registry = new PrometheusRegistry(); + + @BeforeEach + void setUp() throws IllegalAccessException, NoSuchFieldException { + Field field = testing.getClass().getDeclaredField("metricReader"); + field.setAccessible(true); + MetricReader reader = (MetricReader) field.get(testing); + + PrometheusMetricProducer prometheusMetricProducer = + new PrometheusMetricProducer( + registry, + InstrumentationScopeInfo.create("test"), + Resource.create(Attributes.builder().put("staticRes", "value").build())); + + reader.register(prometheusMetricProducer); + } + + @Test + void targetInfo() { + Info.builder().name("target").constLabels(Labels.of("res", "value")).register(registry); + Labels scope = Labels.of("otel_scope_name", "scope", "otel_scope_version", "1"); + Info.builder() + .name("otel_scope") + .constLabels(scope.add("scopeKey", "value")) + .register(registry); + Counter counter = Counter.builder().name("name").constLabels(scope).register(registry); + counter.inc(); + metricAssert() + .hasResource( + Resource.create( + Attributes.builder().put("res", "value").put("staticRes", "value").build())) + .hasInstrumentationScope( + InstrumentationScopeInfo.builder("scope") + .setAttributes(Attributes.of(AttributeKey.stringKey("scopeKey"), "value")) + .setVersion("1") + .build()); + } + + @Test + void counter() { + Counter counter = + Counter.builder() + .name("name") + .help("help") + .constLabels(Labels.of("key", "value")) + .labelNames("label") + .unit(Unit.BYTES) + .withExemplars() + .register(registry); + counter.labelValues("val").inc(); + metricAssert() + .hasName("name") + .hasDescription("help") + .hasUnit("By") + .hasDoubleSumSatisfying( + sum -> + sum.isMonotonic() + .isCumulative() + .hasPointsSatisfying(points -> points.hasValue(1.0).hasAttributes(ATTRIBUTES))); + } + + @Test + void histogram() { + Histogram histogram = + Histogram.builder() + .name("name") + .help("help") + .constLabels(Labels.of("key", "value")) + .labelNames("label") + .unit(Unit.BYTES) + .classicOnly() + .classicUpperBounds(1, 2, 3) + .register(registry); + histogram.labelValues("val").observe(1); + metricAssert() + .hasName("name") + .hasDescription("help") + .hasUnit("By") + .hasHistogramSatisfying( + hist -> + hist.hasPointsSatisfying( + points -> + points + .hasAttributes(ATTRIBUTES) + .hasCount(1) + .hasSum(1.0) + .satisfies( + p -> { + assertThat(p.getMin()).isNaN(); + assertThat(p.getMax()).isNaN(); + assertThat(p.getStartEpochNanos()).isPositive(); + assertThat(p.getEpochNanos()).isPositive(); + }) + .hasExemplars() + .hasBucketBoundaries(1, 2, 3, Double.POSITIVE_INFINITY) + .hasBucketCounts(1, 0, 0, 0))); + } + + @Test + void exponentialHistogram() { + Histogram histogram = + Histogram.builder() + .name("name") + .help("help") + .constLabels(Labels.of("key", "value")) + .labelNames("label") + .unit(Unit.BYTES) + .nativeOnly() + .register(registry); + histogram.labelValues("val").observe(1); + metricAssert() + .hasName("name") + .hasDescription("help") + .hasUnit("By") + .hasExponentialHistogramSatisfying( + hist -> + hist.isCumulative() + .hasPointsSatisfying( + points -> + points + .hasAttributes(ATTRIBUTES) + .hasCount(1) + .hasScale(5) + .hasZeroCount(0) + .hasSum(1.0) + .satisfies( + p -> { + assertThat(p.getMin()).isNaN(); + assertThat(p.getMax()).isNaN(); + assertThat(p.getStartEpochNanos()).isPositive(); + assertThat(p.getEpochNanos()).isPositive(); + }) + .hasExemplars() + .hasPositiveBucketsSatisfying( + buckets -> + buckets + .hasOffset(-1) + .hasTotalCount(1) + .hasCounts(Collections.singletonList(1L))))); + } + + @Test + void summary() { + Summary summary = + Summary.builder() + .name("name") + .help("help") + .constLabels(Labels.of("key", "value")) + .labelNames("label") + .unit(Unit.BYTES) + .quantile(0.5, 0.1) + .register(registry); + summary.labelValues("val").observe(1); + metricAssert() + .hasName("name") + .hasDescription("help") + .hasUnit("By") + .hasSummarySatisfying( + sum -> + sum.hasPointsSatisfying( + points -> + points + .hasAttributes(ATTRIBUTES) + .hasCount(1) + .hasSum(1.0) + .satisfies( + p -> { + assertThat(p.getStartEpochNanos()).isPositive(); + assertThat(p.getEpochNanos()).isPositive(); + }) + .hasValuesSatisfying(values -> values.hasQuantile(0.5).hasValue(1.0)))); + } + + @Test + void gauge() { + Gauge gauge = + Gauge.builder() + .name("name") + .help("help") + .constLabels(Labels.of("key", "value")) + .labelNames("label") + .unit(Unit.BYTES) + .register(registry); + gauge.labelValues("val").set(1); + metricAssert() + .hasName("name") + .hasDescription("help") + .hasUnit("By") + .hasDoubleGaugeSatisfying( + gaugeData -> + gaugeData.hasPointsSatisfying( + points -> points.hasValue(1.0).hasExemplars().hasAttributes(ATTRIBUTES))); + } + + @Test + void stateSet() { + StateSet stateSet = + StateSet.builder() + .name("name") + .help("help") + .constLabels(Labels.of("key", "value")) + .labelNames("label") + .states("state") + .register(registry); + stateSet.labelValues("val").setTrue("state"); + metricAssert() + .hasName("name") + .hasDescription("help") + .hasDoubleSumSatisfying( + sum -> + sum.isNotMonotonic() + .isCumulative() + .hasPointsSatisfying( + points -> + points + .hasValue(1.0) + .hasAttributes( + ATTRIBUTES.toBuilder().put("name", "state").build()))); + } + + @Test + void info() { + Info info = + Info.builder() + .name("name") + .help("help") + .constLabels(Labels.of("key", "value")) + .labelNames("label") + .register(registry); + info.addLabelValues("val"); + metricAssert() + .hasName("name") + .hasDescription("help") + .hasDoubleSumSatisfying( + sum -> + sum.isCumulative() + .isNotMonotonic() + .hasPointsSatisfying(points -> points.hasAttributes(ATTRIBUTES).hasValue(1.0))); + } + + @Test + void unknown() { + Collector collector = + () -> + UnknownSnapshot.builder() + .name("name_bytes") + .help("help") + .unit(Unit.BYTES) + .dataPoint( + UnknownSnapshot.UnknownDataPointSnapshot.builder() + .value(1.0) + .labels(Labels.of("label", "val")) + .build()) + .build(); + registry.register(collector); + metricAssert() + .hasName("name") + .hasDescription("help") + .hasUnit("By") + .hasDoubleGaugeSatisfying( + gaugeData -> + gaugeData.hasPointsSatisfying( + points -> + points + .hasValue(1.0) + .hasExemplars() + .hasAttributes(Attributes.of(AttributeKey.stringKey("label"), "val")))); + } + + private MetricAssert metricAssert() { + List metrics = testing.getMetrics(); + assertThat(metrics).hasSize(1); + return OpenTelemetryAssertions.assertThat(metrics.get(0)); + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/OtelAutoConfigTest.java b/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/OtelAutoConfigTest.java new file mode 100644 index 000000000..5a9103565 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/OtelAutoConfigTest.java @@ -0,0 +1,301 @@ +package io.prometheus.metrics.exporter.opentelemetry; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.common.collect.ImmutableMap; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk; +import io.opentelemetry.sdk.autoconfigure.internal.AutoConfigureUtil; +import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; +import io.prometheus.metrics.config.ExporterOpenTelemetryProperties; +import io.prometheus.metrics.config.PrometheusPropertiesLoader; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Consumer; +import java.util.stream.Stream; +import org.assertj.core.api.AbstractStringAssert; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class OtelAutoConfigTest { + + static class TestCase { + Map systemProperties = new HashMap<>(); + Map> expectedProperties = Collections.emptyMap(); + Map expectedResourceAttributes = Collections.emptyMap(); + Consumer exporterBuilder; + Consumer propertiesBuilder; + + public TestCase() {} + + public TestCase expectedProperties(Map> expectedProperties) { + this.expectedProperties = expectedProperties; + return this; + } + + public TestCase expectedResourceAttributes(Map expectedResourceAttributes) { + this.expectedResourceAttributes = expectedResourceAttributes; + return this; + } + + public TestCase systemProperties(Map systemProperties) { + this.systemProperties.putAll(systemProperties); + return this; + } + + public TestCase exporterBuilder(Consumer exporterBuilder) { + this.exporterBuilder = exporterBuilder; + return this; + } + + public TestCase propertiesBuilder( + Consumer propertiesBuilder) { + this.propertiesBuilder = propertiesBuilder; + return this; + } + } + + public static Stream testCases() { + return Stream.of( + Arguments.of( + "values from builder", + new TestCase() + .expectedProperties( + Map.of( + "otel.exporter.otlp.protocol", + Optional.of("http/protobuf"), + "otel.exporter.otlp.endpoint", + Optional.of("http://builder:4318"), + "otel.exporter.otlp.headers", + Optional.of("h=builder-v"), + "otel.metric.export.interval", + Optional.of("2s"), + "otel.exporter.otlp.timeout", + Optional.of("3s"), + "otel.service.name", + Optional.of("builder-service"))) + .expectedResourceAttributes( + Map.of( + "key", + "builder-value", + "service.name", + "builder-service", + "service.namespace", + "builder-namespace", + "service.instance.id", + "builder-instance", + "service.version", + "builder-version")) + .exporterBuilder(OtelAutoConfigTest::setBuilderValues)), + Arguments.of( + "builder endpoint with path", + new TestCase() + .expectedProperties( + ImmutableMap.of( + "otel.exporter.otlp.endpoint", Optional.of("http://builder:4318/"))) + .exporterBuilder(builder -> builder.endpoint("http://builder:4318/v1/metrics"))), + Arguments.of( + "values from otel have precedence over builder", + new TestCase() + .expectedProperties( + ImmutableMap.>builder() + .put("otel.exporter.otlp.protocol", Optional.of("grpc")) + .put("otel.exporter.otlp.metrics.protocol", Optional.empty()) + .put("otel.exporter.otlp.endpoint", Optional.of("http://otel:4317")) + .put("otel.exporter.otlp.metrics.endpoint", Optional.empty()) + .put("otel.exporter.otlp.headers", Optional.of("h=otel-v")) + .put("otel.exporter.otlp.metrics.headers", Optional.empty()) + .put("otel.metric.export.interval", Optional.of("12s")) + .put("otel.exporter.otlp.timeout", Optional.of("13s")) + .put("otel.exporter.otlp.metrics.timeout", Optional.empty()) + .put("otel.service.name", Optional.of("otel-service")) + .build()) + .expectedResourceAttributes( + ImmutableMap.of( + "key", + "otel-value", + "service.name", + "otel-service", + "service.namespace", + "otel-namespace", + "service.instance.id", + "otel-instance", + "service.version", + "otel-version")) + .exporterBuilder(OtelAutoConfigTest::setBuilderValues) + .systemProperties(otelOverrides())), + Arguments.of( + "values from prom properties have precedence over builder and otel", + new TestCase() + .expectedProperties( + ImmutableMap.>builder() + .put("otel.exporter.otlp.metrics.protocol", Optional.of("http/protobuf")) + .put("otel.exporter.otlp.protocol", Optional.of("grpc")) + .put("otel.exporter.otlp.metrics.endpoint", Optional.of("http://prom:4317")) + .put("otel.exporter.otlp.endpoint", Optional.of("http://otel:4317")) + .put("otel.exporter.otlp.metrics.headers", Optional.of("h=prom-v")) + .put("otel.exporter.otlp.headers", Optional.of("h=otel-v")) + .put("otel.metric.export.interval", Optional.of("22s")) + .put("otel.exporter.otlp.metrics.timeout", Optional.of("23s")) + .put("otel.exporter.otlp.timeout", Optional.of("13s")) + .put("otel.service.name", Optional.of("prom-service")) + .build()) + .expectedResourceAttributes( + ImmutableMap.of( + "key", + "prom-value", + "service.name", + "prom-service", + "service.namespace", + "prom-namespace", + "service.instance.id", + "prom-instance", + "service.version", + "prom-version")) + .exporterBuilder(OtelAutoConfigTest::setBuilderValues) + .systemProperties(otelOverrides()) + .systemProperties( + ImmutableMap.builder() + .put("io.prometheus.exporter.opentelemetry.protocol", "http/protobuf") + .put("io.prometheus.exporter.opentelemetry.endpoint", "http://prom:4317") + .put("io.prometheus.exporter.opentelemetry.headers", "h=prom-v") + .put("io.prometheus.exporter.opentelemetry.intervalSeconds", "22") + .put("io.prometheus.exporter.opentelemetry.timeoutSeconds", "23") + .put("io.prometheus.exporter.opentelemetry.serviceName", "prom-service") + .put( + "io.prometheus.exporter.opentelemetry.serviceNamespace", + "prom-namespace") + .put( + "io.prometheus.exporter.opentelemetry.serviceInstanceId", + "prom-instance") + .put("io.prometheus.exporter.opentelemetry.serviceVersion", "prom-version") + .put( + "io.prometheus.exporter.opentelemetry.resourceAttributes", + "key=prom-value") + .build())), + Arguments.of( + "values from prom properties builder have precedence over builder and otel", + new TestCase() + .expectedProperties( + ImmutableMap.>builder() + .put("otel.exporter.otlp.metrics.protocol", Optional.of("http/protobuf")) + .put("otel.exporter.otlp.protocol", Optional.of("grpc")) + .put("otel.exporter.otlp.metrics.endpoint", Optional.of("http://prom:4317")) + .put("otel.exporter.otlp.endpoint", Optional.of("http://otel:4317")) + .put("otel.exporter.otlp.metrics.headers", Optional.of("h=prom-v")) + .put("otel.exporter.otlp.headers", Optional.of("h=otel-v")) + .put("otel.metric.export.interval", Optional.of("22s")) + .put("otel.exporter.otlp.metrics.timeout", Optional.of("23s")) + .put("otel.exporter.otlp.timeout", Optional.of("13s")) + .put("otel.service.name", Optional.of("prom-service")) + .build()) + .expectedResourceAttributes( + ImmutableMap.of( + "key", + "prom-value", + "service.name", + "prom-service", + "service.namespace", + "prom-namespace", + "service.instance.id", + "prom-instance", + "service.version", + "prom-version")) + .exporterBuilder(OtelAutoConfigTest::setBuilderValues) + .systemProperties(otelOverrides()) + .propertiesBuilder( + builder -> + builder + .protocol("http/protobuf") + .endpoint("http://prom:4317") + .header("h", "prom-v") + .intervalSeconds(22) + .timeoutSeconds(23) + .serviceName("prom-service") + .serviceNamespace("prom-namespace") + .serviceInstanceId("prom-instance") + .serviceVersion("prom-version") + .resourceAttribute("key", "prom-value")))); + } + + private static ImmutableMap otelOverrides() { + return ImmutableMap.builder() + .put("otel.exporter.otlp.protocol", "grpc") + .put("otel.exporter.otlp.endpoint", "http://otel:4317") + .put("otel.exporter.otlp.headers", "h=otel-v") + .put("otel.metric.export.interval", "12s") + .put("otel.exporter.otlp.timeout", "13s") + .put("otel.service.name", "otel-service") + .put( + "otel.resource.attributes", + "key=otel-value,service.namespace=otel-namespace,service.instance.id=otel-instance,service.version=otel-version") + .build(); + } + + private static void setBuilderValues(OpenTelemetryExporter.Builder builder) { + builder + .protocol("http/protobuf") + .endpoint("http://builder:4318") + .header("h", "builder-v") + .intervalSeconds(2) + .timeoutSeconds(3) + .serviceName("builder-service") + .serviceNamespace("builder-namespace") + .serviceInstanceId("builder-instance") + .serviceVersion("builder-version") + .resourceAttribute("key", "builder-value"); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("testCases") + void properties(String name, TestCase testCase) { + testCase.systemProperties.forEach(System::setProperty); + + try { + OpenTelemetryExporter.Builder builder = OpenTelemetryExporter.builder(); + if (testCase.exporterBuilder != null) { + testCase.exporterBuilder.accept(builder); + } + AutoConfiguredOpenTelemetrySdk sdk = + OtelAutoConfig.createAutoConfiguredOpenTelemetrySdk( + builder, + new AtomicReference<>(), + getExporterOpenTelemetryProperties(testCase), + PrometheusInstrumentationScope.loadInstrumentationScopeInfo()); + + ConfigProperties config = AutoConfigureUtil.getConfig(sdk); + Map, Object> map = + OtelAutoConfig.getResourceField(sdk).getAttributes().asMap(); + testCase.expectedProperties.forEach( + (key, value) -> { + AbstractStringAssert o = assertThat(config.getString(key)).describedAs("key=" + key); + if (value.isPresent()) { + o.isEqualTo(value.get()); + } else { + o.isNull(); + } + }); + testCase.expectedResourceAttributes.forEach( + (key, value) -> + assertThat(map.get(AttributeKey.stringKey(key))) + .describedAs("key=" + key) + .hasToString(value)); + } finally { + testCase.systemProperties.keySet().forEach(System::clearProperty); + } + } + + private static ExporterOpenTelemetryProperties getExporterOpenTelemetryProperties( + TestCase testCase) { + if (testCase.propertiesBuilder == null) { + return PrometheusPropertiesLoader.load().getExporterOpenTelemetryProperties(); + } + ExporterOpenTelemetryProperties.Builder builder = ExporterOpenTelemetryProperties.builder(); + testCase.propertiesBuilder.accept(builder); + return builder.build(); + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/PrometheusInstrumentationScopeTest.java b/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/PrometheusInstrumentationScopeTest.java new file mode 100644 index 000000000..c50354b24 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/PrometheusInstrumentationScopeTest.java @@ -0,0 +1,40 @@ +package io.prometheus.metrics.exporter.opentelemetry; + +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Test; + +class PrometheusInstrumentationScopeTest { + + @Test + void loadInstrumentationScopeInfo() { + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy( + () -> + PrometheusInstrumentationScope.loadInstrumentationScopeInfo( + "path", "name", "version")) + .withMessage( + "Prometheus metrics library initialization error: Failed to read path from classpath."); + + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy( + () -> + PrometheusInstrumentationScope.loadInstrumentationScopeInfo( + "instrumentationScope.properties", "name", "version")) + .havingRootCause() + .withMessage( + "Prometheus metrics library initialization error: name not found in" + + " instrumentationScope.properties in classpath."); + + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy( + () -> + PrometheusInstrumentationScope.loadInstrumentationScopeInfo( + "instrumentationScope.properties", "instrumentationScope.name", "version")) + .havingRootCause() + .withMessage( + "Prometheus metrics library initialization error: version not found in" + + " instrumentationScope.properties in classpath."); + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusMetricDataTest.java b/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusMetricDataTest.java new file mode 100644 index 000000000..fb5542538 --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/otelmodel/PrometheusMetricDataTest.java @@ -0,0 +1,47 @@ +package io.prometheus.metrics.exporter.opentelemetry.otelmodel; + +import static java.util.Map.entry; +import static org.junit.jupiter.api.Assertions.*; + +import io.prometheus.metrics.model.snapshots.Unit; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class PrometheusMetricDataTest { + + Map translations = + Map.ofEntries( + entry("days", "d"), + entry("hours", "h"), + entry("minutes", "min"), + entry("seconds", "s"), + entry("milliseconds", "ms"), + entry("microseconds", "us"), + entry("nanoseconds", "ns"), + entry("bytes", "By"), + entry("kibibytes", "KiBy"), + entry("mebibytes", "MiBy"), + entry("gibibytes", "GiBy"), + entry("tibibytes", "TiBy"), + entry("kilobytes", "KBy"), + entry("megabytes", "MBy"), + entry("gigabytes", "GBy"), + entry("terabytes", "TBy"), + entry("meters", "m"), + entry("volts", "V"), + entry("amperes", "A"), + entry("joules", "J"), + entry("watts", "W"), + entry("grams", "g"), + entry("celsius", "Cel"), + entry("hertz", "Hz"), + entry("percent", "%")); + + @Test + void convertUnit() { + translations.forEach( + (unit, expected) -> { + assertEquals(expected, PrometheusMetricData.convertUnit(new Unit(unit.toString()))); + }); + } +} diff --git a/prometheus-metrics-exporter-opentelemetry/version-rules.xml b/prometheus-metrics-exporter-opentelemetry/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-exporter-opentelemetry/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-exporter-pushgateway/pom.xml b/prometheus-metrics-exporter-pushgateway/pom.xml new file mode 100644 index 000000000..6d59b2b4d --- /dev/null +++ b/prometheus-metrics-exporter-pushgateway/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-exporter-pushgateway + bundle + + Prometheus Metrics Exporter - Pushgateway + + Exporter for pushing metrics to a pushgateway. + + + + io.prometheus.metrics.exporter.pushgateway + + + + + io.prometheus + prometheus-metrics-exporter-common + ${project.version} + + + org.mock-server + mockserver-netty-no-dependencies + 5.15.0 + test + + + io.prometheus + prometheus-metrics-core + ${project.version} + test + + + diff --git a/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/DefaultHttpConnectionFactory.java b/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/DefaultHttpConnectionFactory.java new file mode 100644 index 000000000..60c110149 --- /dev/null +++ b/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/DefaultHttpConnectionFactory.java @@ -0,0 +1,20 @@ +package io.prometheus.metrics.exporter.pushgateway; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URL; + +/** + * This can be used for creating {@link Scheme#HTTP} and {@link Scheme#HTTPS} connections. + * + *

    However, if you want to use it with {@link Scheme#HTTPS} you must make sure that the keychain + * for verifying the server certificate is set up correctly. For an example of how to skip + * certificate verification see {@code PushGatewayTestApp} in {@code + * integration-tests/it-pushgateway/}. + */ +public class DefaultHttpConnectionFactory implements HttpConnectionFactory { + @Override + public HttpURLConnection create(URL url) throws IOException { + return (HttpURLConnection) url.openConnection(); + } +} diff --git a/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/DefaultJobLabelDetector.java b/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/DefaultJobLabelDetector.java new file mode 100644 index 000000000..6caa03492 --- /dev/null +++ b/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/DefaultJobLabelDetector.java @@ -0,0 +1,63 @@ +package io.prometheus.metrics.exporter.pushgateway; + +import java.nio.file.Files; +import java.nio.file.InvalidPathException; +import java.nio.file.Path; +import java.nio.file.Paths; +import javax.annotation.Nullable; + +/** + * The default {@code job} label is the name of the JAR file being executed. + * + *

    This is copy-and-paste from {@code ResourceAttributesFromJarFileName} in the {@code + * prometheus-metrics-exporter-opentelemetry} module. + */ +class DefaultJobLabelDetector { + + static String getDefaultJobLabel() { + Path jarPath = getJarPathFromSunCommandLine(); + if (jarPath == null) { + return "unknown_job"; + } + return getServiceName(jarPath); + } + + private static String getServiceName(Path jarPath) { + String jarName = jarPath.getFileName().toString(); + int dotIndex = jarName.lastIndexOf("."); + return dotIndex == -1 ? jarName : jarName.substring(0, dotIndex); + } + + @Nullable + private static Path getJarPathFromSunCommandLine() { + String programArguments = System.getProperty("sun.java.command"); + if (programArguments == null) { + return null; + } + // Take the path until the first space. If the path doesn't exist extend it up to the next + // space. Repeat until a path that exists is found or input runs out. + int next = 0; + while (true) { + int nextSpace = programArguments.indexOf(' ', next); + if (nextSpace == -1) { + return pathIfExists(programArguments); + } + Path path = pathIfExists(programArguments.substring(0, nextSpace)); + next = nextSpace + 1; + if (path != null) { + return path; + } + } + } + + @Nullable + private static Path pathIfExists(String programArguments) { + Path candidate; + try { + candidate = Paths.get(programArguments); + } catch (InvalidPathException e) { + return null; + } + return Files.isRegularFile(candidate) ? candidate : null; + } +} diff --git a/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/Format.java b/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/Format.java new file mode 100644 index 000000000..3d1b9d2e6 --- /dev/null +++ b/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/Format.java @@ -0,0 +1,6 @@ +package io.prometheus.metrics.exporter.pushgateway; + +public enum Format { + PROMETHEUS_PROTOBUF, + PROMETHEUS_TEXT +} diff --git a/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/HttpConnectionFactory.java b/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/HttpConnectionFactory.java new file mode 100644 index 000000000..f7a039af7 --- /dev/null +++ b/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/HttpConnectionFactory.java @@ -0,0 +1,11 @@ +package io.prometheus.metrics.exporter.pushgateway; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URL; + +/** See {@link DefaultHttpConnectionFactory}. */ +@FunctionalInterface +public interface HttpConnectionFactory { + HttpURLConnection create(URL url) throws IOException; +} diff --git a/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/PushGateway.java b/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/PushGateway.java new file mode 100644 index 000000000..72e0561c1 --- /dev/null +++ b/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/PushGateway.java @@ -0,0 +1,559 @@ +package io.prometheus.metrics.exporter.pushgateway; + +import static io.prometheus.metrics.exporter.pushgateway.Scheme.HTTP; +import static io.prometheus.metrics.model.snapshots.PrometheusNaming.escapeName; +import static java.util.Objects.requireNonNull; + +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.config.ExporterPushgatewayProperties; +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.config.PrometheusPropertiesException; +import io.prometheus.metrics.expositionformats.ExpositionFormatWriter; +import io.prometheus.metrics.expositionformats.PrometheusProtobufWriter; +import io.prometheus.metrics.expositionformats.PrometheusTextFormatWriter; +import io.prometheus.metrics.model.registry.Collector; +import io.prometheus.metrics.model.registry.MultiCollector; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.InetAddress; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URL; +import java.net.URLEncoder; +import java.net.UnknownHostException; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Base64; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.TreeMap; +import javax.annotation.Nullable; + +/** + * Export metrics via the Prometheus + * Pushgateway + * + *

    The Prometheus Pushgateway exists to allow ephemeral and batch jobs to expose their metrics to + * Prometheus. Since these kinds of jobs may not exist long enough to be scraped, they can instead + * push their metrics to a Pushgateway. This Java class allows pushing the contents of a {@link + * PrometheusRegistry} to a Pushgateway. + * + *

    Example usage: + * + *

    {@code
    + * void executeBatchJob() throws Exception {
    + *     PrometheusRegistry registry = new PrometheusRegistry();
    + *     Gauge duration = Gauge.builder()
    + *             .name("my_batch_job_duration_seconds")
    + *             .help("Duration of my batch job in seconds.")
    + *             .register(registry);
    + *     Timer durationTimer = duration.startTimer();
    + *     try {
    + *         // Your code here.
    + *
    + *         // This is only added to the registry after success,
    + *         // so that a previous success in the Pushgateway isn't overwritten on failure.
    + *         Gauge lastSuccess = Gauge.builder()
    + *                 .name("my_batch_job_last_success")
    + *                 .help("Last time my batch job succeeded, in unixtime.")
    + *                 .register(registry);
    + *         lastSuccess.set(System.currentTimeMillis());
    + *     } finally {
    + *         durationTimer.observeDuration();
    + *         PushGateway pg = PushGateway.builder()
    + *                 .address("127.0.0.1:9091")
    + *                 .job("my_batch_job")
    + *                 .registry(registry)
    + *                 .build();
    + *         pg.pushAdd();
    + *     }
    + * }
    + * }
    + * + *

    See https://github.com/prometheus/pushgateway. + */ +public class PushGateway { + private final URL url; + private final ExpositionFormatWriter writer; + private final boolean prometheusTimestampsInMs; + private final Map requestHeaders; + private final PrometheusRegistry registry; + private final HttpConnectionFactory connectionFactory; + private final EscapingScheme escapingScheme; + private final Duration connectionTimeout; + private final Duration readTimeout; + + private PushGateway( + PrometheusRegistry registry, + Format format, + URL url, + HttpConnectionFactory connectionFactory, + Map requestHeaders, + boolean prometheusTimestampsInMs, + EscapingScheme escapingScheme, + Duration connectionTimeout, + Duration readTimeout) { + this.registry = registry; + this.url = url; + this.requestHeaders = Collections.unmodifiableMap(new HashMap<>(requestHeaders)); + this.connectionFactory = connectionFactory; + this.prometheusTimestampsInMs = prometheusTimestampsInMs; + this.escapingScheme = escapingScheme; + this.connectionTimeout = connectionTimeout; + this.readTimeout = readTimeout; + writer = getWriter(format); + if (!writer.isAvailable()) { + throw new RuntimeException(writer.getClass() + " is not available"); + } + } + + @SuppressWarnings("deprecation") + private ExpositionFormatWriter getWriter(Format format) { + if (format == Format.PROMETHEUS_TEXT) { + return PrometheusTextFormatWriter.builder() + .setTimestampsInMs(this.prometheusTimestampsInMs) + .build(); + } else { + // use reflection to avoid a compile-time dependency on the expositionformats module + return new PrometheusProtobufWriter(); + } + } + + /** + * Push all metrics. All metrics with the same job and grouping key are replaced. + * + *

    This uses the PUT HTTP method. + */ + public void push() throws IOException { + doRequest(registry, "PUT"); + } + + /** + * Push a single metric. All metrics with the same job and grouping key are replaced. + * + *

    This is useful for pushing a single Gauge. + * + *

    This uses the PUT HTTP method. + */ + public void push(Collector collector) throws IOException { + PrometheusRegistry registry = new PrometheusRegistry(); + registry.register(collector); + doRequest(registry, "PUT"); + } + + /** + * Push a single collector. All metrics with the same job and grouping key are replaced. + * + *

    This uses the PUT HTTP method. + */ + public void push(MultiCollector collector) throws IOException { + PrometheusRegistry registry = new PrometheusRegistry(); + registry.register(collector); + doRequest(registry, "PUT"); + } + + /** + * Like {@link #push()}, but only metrics with the same name as the newly pushed metrics are + * replaced. + * + *

    This uses the POST HTTP method. + */ + public void pushAdd() throws IOException { + doRequest(registry, "POST"); + } + + /** + * Like {@link #push(Collector)}, but only the specified metric will be replaced. + * + *

    This uses the POST HTTP method. + */ + public void pushAdd(Collector collector) throws IOException { + PrometheusRegistry registry = new PrometheusRegistry(); + registry.register(collector); + doRequest(registry, "POST"); + } + + /** + * Like {@link #push(MultiCollector)}, but only the metrics from the collector will be replaced. + * + *

    This uses the POST HTTP method. + */ + public void pushAdd(MultiCollector collector) throws IOException { + PrometheusRegistry registry = new PrometheusRegistry(); + registry.register(collector); + doRequest(registry, "POST"); + } + + /** + * Deletes metrics from the Pushgateway. + * + *

    This uses the DELETE HTTP method. + */ + public void delete() throws IOException { + doRequest(null, "DELETE"); + } + + private void doRequest(@Nullable PrometheusRegistry registry, String method) throws IOException { + try { + HttpURLConnection connection = connectionFactory.create(url); + requestHeaders.forEach(connection::setRequestProperty); + connection.setRequestProperty("Content-Type", writer.getContentType()); + if (!method.equals("DELETE")) { + connection.setDoOutput(true); + } + connection.setRequestMethod(method); + + connection.setConnectTimeout((int) this.connectionTimeout.toMillis()); + connection.setReadTimeout((int) this.readTimeout.toMillis()); + connection.connect(); + + try { + if (!method.equals("DELETE")) { + OutputStream outputStream = connection.getOutputStream(); + writer.write(outputStream, requireNonNull(registry).scrape(), this.escapingScheme); + outputStream.flush(); + outputStream.close(); + } + + int response = connection.getResponseCode(); + if (response / 100 != 2) { + String errorMessage; + InputStream errorStream = connection.getErrorStream(); + if (errorStream != null) { + String errBody = readFromStream(errorStream); + errorMessage = + "Response code from " + url + " was " + response + ", response body: " + errBody; + } else { + errorMessage = "Response code from " + url + " was " + response; + } + throw new IOException(errorMessage); + } + + } finally { + connection.disconnect(); + } + } catch (IOException e) { + String baseUrl = url.getProtocol() + "://" + url.getHost(); + if (url.getPort() != -1) { + baseUrl += ":" + url.getPort(); + } + throw new IOException( + "Failed to push metrics to the Prometheus Pushgateway on " + + baseUrl + + ": " + + e.getMessage(), + e); + } + } + + private static String readFromStream(InputStream is) throws IOException { + ByteArrayOutputStream result = new ByteArrayOutputStream(); + byte[] buffer = new byte[1024]; + int length; + while ((length = is.read(buffer)) != -1) { + result.write(buffer, 0, length); + } + return result.toString("UTF-8"); + } + + public static Builder builder() { + return builder(PrometheusProperties.get()); + } + + /** + * The {@link PrometheusProperties} will be used to override what is set in the {@link Builder}. + */ + public static Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder { + + private final PrometheusProperties config; + @Nullable private Format format; + @Nullable private String address; + @Nullable private Scheme scheme; + @Nullable private String job; + @Nullable private Duration connectionTimeout; + @Nullable private Duration readTimeout; + private boolean prometheusTimestampsInMs; + private final Map requestHeaders = new HashMap<>(); + private PrometheusRegistry registry = PrometheusRegistry.defaultRegistry; + private HttpConnectionFactory connectionFactory = new DefaultHttpConnectionFactory(); + private final Map groupingKey = new TreeMap<>(); + @Nullable private EscapingScheme escapingScheme; + + private Builder(PrometheusProperties config) { + this.config = config; + } + + /** Default is {@link Format#PROMETHEUS_PROTOBUF}. */ + public Builder format(Format format) { + this.format = requireNonNull(format, "format must not be null"); + return this; + } + + /** + * Address of the Pushgateway in format {@code host:port}. Default is {@code localhost:9091}. + * Can be overwritten at runtime with the {@code io.prometheus.exporter.pushgateway.address} + * property. + */ + public Builder address(String address) { + this.address = requireNonNull(address, "address must not be null"); + return this; + } + + /** Username and password for HTTP basic auth when pushing to the Pushgateway. */ + public Builder basicAuth(String user, String password) { + byte[] credentialsBytes = + (requireNonNull(user, "user must not be null") + + ":" + + requireNonNull(password, "password must not be null")) + .getBytes(StandardCharsets.UTF_8); + String encoded = Base64.getEncoder().encodeToString(credentialsBytes); + requestHeaders.put("Authorization", String.format("Basic %s", encoded)); + return this; + } + + /** Bearer token authorization when pushing to the Pushgateway. */ + public Builder bearerToken(String token) { + requestHeaders.put( + "Authorization", + String.format("Bearer %s", requireNonNull(token, "token must not be null"))); + return this; + } + + /** + * Specify if metrics should be pushed using HTTP or HTTPS. Default is HTTP. Can be overwritten + * at runtime with the {@code io.prometheus.exporter.pushgateway.scheme} property. + */ + public Builder scheme(Scheme scheme) { + this.scheme = requireNonNull(scheme, "scheme must not be null"); + return this; + } + + /** + * Custom connection factory. Default is {@link DefaultHttpConnectionFactory}. + * + *

    The {@code PushGatewayTestApp} in {@code integration-tests/it-pushgateway/} has an example + * of a custom connection factory that skips SSL certificate validation for HTTPS connections. + */ + public Builder connectionFactory(HttpConnectionFactory connectionFactory) { + this.connectionFactory = + requireNonNull(connectionFactory, "connectionFactory must not be null"); + return this; + } + + /** + * The {@code job} label to be used when pushing metrics. If not provided, the name of the JAR + * file will be used by default. Can be overwritten at runtime with the {@code + * io.prometheus.exporter.pushgateway.job} property. + */ + public Builder job(String job) { + this.job = requireNonNull(job, "job must not be null"); + return this; + } + + /** + * Grouping keys to be used when pushing/deleting metrics. Call this method multiple times for + * adding multiple grouping keys. + */ + public Builder groupingKey(String name, String value) { + groupingKey.put( + requireNonNull(name, "name must not be null"), + requireNonNull(value, "value must not be null")); + return this; + } + + /** Convenience method for adding the current IP address as an "instance" label. */ + public Builder instanceIpGroupingKey() throws UnknownHostException { + return groupingKey("instance", InetAddress.getLocalHost().getHostAddress()); + } + + /** Push metrics from this registry instead of {@link PrometheusRegistry#defaultRegistry}. */ + public Builder registry(PrometheusRegistry registry) { + this.registry = requireNonNull(registry, "registry must not be null"); + return this; + } + + /** + * Specify the escaping scheme to be used when pushing metrics. Default is {@link + * EscapingScheme#UNDERSCORE_ESCAPING}. + */ + public Builder escapingScheme(EscapingScheme escapingScheme) { + this.escapingScheme = requireNonNull(escapingScheme, "escapingScheme must not be null"); + return this; + } + + /** + * Use milliseconds for timestamps in text format? Default is {@code false}. Can be overwritten + * at runtime with the {@code io.prometheus.exporter.timestampsInMs} property. + */ + public Builder prometheusTimestampsInMs(boolean prometheusTimestampsInMs) { + this.prometheusTimestampsInMs = prometheusTimestampsInMs; + return this; + } + + /** + * Specify the connection timeout for HTTP connections to the PushGateway. Default is 10 + * seconds. + * + * @param connectionTimeout timeout value + * @return this {@link Builder} instance + */ + public Builder connectionTimeout(Duration connectionTimeout) { + this.connectionTimeout = connectionTimeout; + return this; + } + + private Duration getConnectionTimeout(@Nullable ExporterPushgatewayProperties properties) { + if (properties != null && properties.getConnectTimeout() != null) { + return properties.getConnectTimeout(); + } else if (this.connectionTimeout != null) { + return this.connectionTimeout; + } else { + return Duration.ofSeconds(10); + } + } + + /** + * Specify the read timeout for HTTP connections to the PushGateway. Default is 10 seconds. + * + * @param readTimeout timeout value + * @return this {@link Builder} instance + */ + public Builder readTimeout(Duration readTimeout) { + this.readTimeout = readTimeout; + return this; + } + + private Duration getReadTimeout(@Nullable ExporterPushgatewayProperties properties) { + if (properties != null && properties.getReadTimeout() != null) { + return properties.getReadTimeout(); + } else if (this.readTimeout != null) { + return this.readTimeout; + } else { + return Duration.ofSeconds(10); + } + } + + private boolean getPrometheusTimestampsInMs() { + // accept either to opt in to timestamps in milliseconds + return config.getExporterProperties().getPrometheusTimestampsInMs() + || this.prometheusTimestampsInMs; + } + + private Scheme getScheme(@Nullable ExporterPushgatewayProperties properties) { + if (properties != null && properties.getScheme() != null) { + return Scheme.valueOf(properties.getScheme()); + } else if (this.scheme != null) { + return this.scheme; + } else { + return HTTP; + } + } + + private String getAddress(@Nullable ExporterPushgatewayProperties properties) { + if (properties != null && properties.getAddress() != null) { + return properties.getAddress(); + } else if (this.address != null) { + return this.address; + } else { + return "localhost:9091"; + } + } + + private String getJob(@Nullable ExporterPushgatewayProperties properties) { + if (properties != null && properties.getJob() != null) { + return properties.getJob(); + } else if (this.job != null) { + return this.job; + } else { + return DefaultJobLabelDetector.getDefaultJobLabel(); + } + } + + private EscapingScheme getEscapingScheme(@Nullable ExporterPushgatewayProperties properties) { + if (properties != null && properties.getEscapingScheme() != null) { + return properties.getEscapingScheme(); + } else if (this.escapingScheme != null) { + return this.escapingScheme; + } + return EscapingScheme.UNDERSCORE_ESCAPING; + } + + private Format getFormat() { + // currently not configurable via properties + if (this.format != null) { + return this.format; + } + return Format.PROMETHEUS_PROTOBUF; + } + + private URL makeUrl(@Nullable ExporterPushgatewayProperties properties) + throws UnsupportedEncodingException, MalformedURLException { + StringBuilder url = + new StringBuilder(getScheme(properties) + "://" + getAddress(properties) + "/metrics/"); + String job = getJob(properties); + if (job.contains("/")) { + url.append("job@base64/").append(base64url(job)); + } else { + url.append("job/").append(URLEncoder.encode(job, "UTF-8")); + } + for (Map.Entry entry : groupingKey.entrySet()) { + if (entry.getValue().isEmpty()) { + url.append("/") + .append(escapeName(entry.getKey(), EscapingScheme.VALUE_ENCODING_ESCAPING)) + .append("@base64/="); + } else if (entry.getValue().contains("/")) { + url.append("/") + .append(escapeName(entry.getKey(), EscapingScheme.VALUE_ENCODING_ESCAPING)) + .append("@base64/") + .append(base64url(entry.getValue())); + } else { + url.append("/") + .append(escapeName(entry.getKey(), EscapingScheme.VALUE_ENCODING_ESCAPING)) + .append("/") + .append(URLEncoder.encode(entry.getValue(), "UTF-8")); + } + } + return URI.create(url.toString()).normalize().toURL(); + } + + private String base64url(String v) { + return Base64.getEncoder() + .encodeToString(v.getBytes(StandardCharsets.UTF_8)) + .replace("+", "-") + .replace("/", "_"); + } + + public PushGateway build() { + ExporterPushgatewayProperties properties = + config == null ? null : config.getExporterPushgatewayProperties(); + try { + return new PushGateway( + registry, + getFormat(), + makeUrl(properties), + connectionFactory, + requestHeaders, + getPrometheusTimestampsInMs(), + getEscapingScheme(properties), + getConnectionTimeout(properties), + getReadTimeout(properties)); + } catch (MalformedURLException e) { + throw new PrometheusPropertiesException( + address + ": Invalid address. Expecting :"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); // cannot happen, UTF-8 is always supported + } + } + } +} diff --git a/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/Scheme.java b/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/Scheme.java new file mode 100644 index 000000000..51a2e32dd --- /dev/null +++ b/prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/Scheme.java @@ -0,0 +1,29 @@ +package io.prometheus.metrics.exporter.pushgateway; + +public enum Scheme { + HTTP("http"), + HTTPS("https"); + + private final String name; + + Scheme(String name) { + this.name = name; + } + + @Override + public String toString() { + return name; + } + + public static Scheme fromString(String name) { + switch (name) { + case "http": + return HTTP; + case "https": + return HTTPS; + default: + throw new IllegalArgumentException( + name + ": Unsupported scheme. Expecting 'http' or 'https'."); + } + } +} diff --git a/prometheus-metrics-exporter-pushgateway/src/test/java/io/prometheus/metrics/exporter/pushgateway/BasicAuthPushGatewayTest.java b/prometheus-metrics-exporter-pushgateway/src/test/java/io/prometheus/metrics/exporter/pushgateway/BasicAuthPushGatewayTest.java new file mode 100644 index 000000000..e2f052d6b --- /dev/null +++ b/prometheus-metrics-exporter-pushgateway/src/test/java/io/prometheus/metrics/exporter/pushgateway/BasicAuthPushGatewayTest.java @@ -0,0 +1,55 @@ +package io.prometheus.metrics.exporter.pushgateway; + +import static org.mockserver.model.HttpRequest.request; +import static org.mockserver.model.HttpResponse.response; + +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.core.metrics.Gauge; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import java.io.IOException; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockserver.client.MockServerClient; +import org.mockserver.integration.ClientAndServer; + +class BasicAuthPushGatewayTest { + private MockServerClient mockServerClient; + + PrometheusRegistry registry; + Gauge gauge; + PushGateway pushGateway; + + @BeforeEach + public void setUp() { + mockServerClient = ClientAndServer.startClientAndServer(0); + registry = new PrometheusRegistry(); + gauge = Gauge.builder().name("g").help("help").build(); + pushGateway = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .basicAuth("testUser", "testPwd") + .registry(registry) + .prometheusTimestampsInMs(true) + .escapingScheme(EscapingScheme.ALLOW_UTF8) + .job("j") + .build(); + } + + @AfterEach + void tearDown() { + mockServerClient.stop(); + } + + @Test + public void testAuthorizedPush() throws IOException { + mockServerClient + .when( + request() + .withMethod("PUT") + .withHeader("Authorization", "Basic dGVzdFVzZXI6dGVzdFB3ZA==") + .withPath("/metrics/job/j")) + .respond(response().withStatusCode(202)); + pushGateway.push(); + } +} diff --git a/prometheus-metrics-exporter-pushgateway/src/test/java/io/prometheus/metrics/exporter/pushgateway/BearerTokenPushGatewayTest.java b/prometheus-metrics-exporter-pushgateway/src/test/java/io/prometheus/metrics/exporter/pushgateway/BearerTokenPushGatewayTest.java new file mode 100644 index 000000000..09e6ff5e9 --- /dev/null +++ b/prometheus-metrics-exporter-pushgateway/src/test/java/io/prometheus/metrics/exporter/pushgateway/BearerTokenPushGatewayTest.java @@ -0,0 +1,53 @@ +package io.prometheus.metrics.exporter.pushgateway; + +import static org.mockserver.model.HttpRequest.request; +import static org.mockserver.model.HttpResponse.response; + +import io.prometheus.metrics.core.metrics.Gauge; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import java.io.IOException; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockserver.client.MockServerClient; +import org.mockserver.integration.ClientAndServer; + +class BearerTokenPushGatewayTest { + + private MockServerClient mockServerClient; + + PrometheusRegistry registry; + Gauge gauge; + PushGateway pushGateway; + + @BeforeEach + public void setUp() { + mockServerClient = ClientAndServer.startClientAndServer(0); + registry = new PrometheusRegistry(); + gauge = Gauge.builder().name("g").help("help").build(); + pushGateway = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .bearerToken("xxx") + .registry(registry) + .job("j") + .build(); + } + + @AfterEach + void tearDown() { + mockServerClient.stop(); + } + + @Test + public void testAuthorizedPush() throws IOException { + mockServerClient + .when( + request() + .withMethod("PUT") + .withHeader("Authorization", "Bearer xxx") + .withPath("/metrics/job/j")) + .respond(response().withStatusCode(202)); + pushGateway.push(); + } +} diff --git a/prometheus-metrics-exporter-pushgateway/src/test/java/io/prometheus/metrics/exporter/pushgateway/PushGatewayTest.java b/prometheus-metrics-exporter-pushgateway/src/test/java/io/prometheus/metrics/exporter/pushgateway/PushGatewayTest.java new file mode 100644 index 000000000..4eba4cb17 --- /dev/null +++ b/prometheus-metrics-exporter-pushgateway/src/test/java/io/prometheus/metrics/exporter/pushgateway/PushGatewayTest.java @@ -0,0 +1,432 @@ +package io.prometheus.metrics.exporter.pushgateway; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.mockserver.model.HttpRequest.request; +import static org.mockserver.model.HttpResponse.response; + +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.core.metrics.Gauge; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import java.io.IOException; +import java.lang.reflect.Field; +import java.net.InetAddress; +import java.net.URL; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockserver.client.MockServerClient; +import org.mockserver.integration.ClientAndServer; + +class PushGatewayTest { + + private MockServerClient mockServerClient; + + PrometheusRegistry registry; + Gauge gauge; + + @BeforeEach + public void setUp() { + mockServerClient = ClientAndServer.startClientAndServer(0); + registry = new PrometheusRegistry(); + gauge = Gauge.builder().name("g").help("help").build(); + } + + @AfterEach + void tearDown() { + mockServerClient.stop(); + } + + @Test + public void testInvalidURLThrowsRuntimeException() { + assertThatExceptionOfType(RuntimeException.class) + .isThrownBy( + () -> { + PushGateway.builder() + .address("::") + .build(); // ":" is interpreted as port number, so parsing fails + }); + } + + @Test + public void testMultipleSlashesAreStrippedFromURL() + throws NoSuchFieldException, IllegalAccessException { + final PushGateway pushGateway = + PushGateway.builder().address("example.com:1234/context///path//").job("test").build(); + assertThat(getUrl(pushGateway)) + .hasToString("http://example.com:1234/context/path/metrics/job/test"); + } + + private URL getUrl(PushGateway pushGateway) throws IllegalAccessException, NoSuchFieldException { + Field field = pushGateway.getClass().getDeclaredField("url"); + field.setAccessible(true); + return (URL) field.get(pushGateway); + } + + @Test + public void testPush() throws IOException { + mockServerClient + .when(request().withMethod("PUT").withPath("/metrics/job/j")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .registry(registry) + .job("j") + .build(); + pg.push(); + } + + @Test + public void testPush200Response() throws IOException { + mockServerClient + .when(request().withMethod("PUT").withPath("/metrics/job/j")) + .respond(response().withStatusCode(200)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .registry(registry) + .job("j") + .build(); + pg.push(); + } + + @Test + public void testNon202ResponseThrows() { + mockServerClient + .when(request().withMethod("PUT").withPath("/metrics/job/j")) + .respond(response().withStatusCode(500)); + assertThatExceptionOfType(IOException.class) + .isThrownBy( + () -> { + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .registry(registry) + .job("j") + .build(); + pg.push(); + }) + .withMessageContaining( + "Response code from http://localhost:" + + mockServerClient.getPort() + + "/metrics/job/j was 500"); + } + + @Test + public void testPushCollector() throws IOException { + mockServerClient + .when(request().withMethod("PUT").withPath("/metrics/job/j")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .registry(registry) + .job("j") + .build(); + pg.push(); + } + + @Test + public void testPushWithGroupingKey() throws IOException { + mockServerClient + .when(request().withMethod("PUT").withPath("/metrics/job/j/l/v")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .registry(registry) + .job("j") + .groupingKey("l", "v") + .build(); + pg.push(); + } + + @Test + public void testPushWithEscapedGroupingKey() throws IOException { + mockServerClient + .when(request().withMethod("PUT").withPath("/metrics/job/j/U__l_2e_1/v1")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .registry(registry) + .job("j") + .groupingKey("l.1", "v1") + .build(); + pg.push(); + } + + @Test + public void testPushWithMultiGroupingKey() throws IOException { + mockServerClient + .when(request().withMethod("PUT").withPath("/metrics/job/j/l/v/l2/v2")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .registry(registry) + .job("j") + .groupingKey("l", "v") + .groupingKey("l2", "v2") + .build(); + pg.push(); + } + + @Test + public void testPushWithMultiEscapedGroupingKey() throws IOException { + + mockServerClient + .when(request().withMethod("PUT").withPath("/metrics/job/j/U__l_2e_1/v1/U__l_2e_2/v2")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .registry(registry) + .job("j") + .groupingKey("l.1", "v1") + .groupingKey("l.2", "v2") + .build(); + pg.push(); + } + + @Test + public void testPushWithEmptyLabelGroupingKey() throws IOException { + mockServerClient + .when(request().withMethod("PUT").withPath("/metrics/job/j/l/v/l2@base64/=")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .registry(registry) + .job("j") + .groupingKey("l", "v") + .groupingKey("l2", "") + .build(); + pg.push(); + } + + @Test + public void testPushWithGroupingKeyWithSlashes() throws IOException { + mockServerClient + .when( + request().withMethod("PUT").withPath("/metrics/job@base64/YS9i/l/v/l2@base64/75-_Lw==")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .registry(registry) + .job("a/b") + .groupingKey("l", "v") + .groupingKey("l2", "\uF7FF/") + .build(); + pg.push(); + } + + @Test + public void testPushCollectorWithGroupingKey() throws IOException { + mockServerClient + .when(request().withMethod("PUT").withPath("/metrics/job/j/l/v")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .registry(registry) + .job("j") + .groupingKey("l", "v") + .build(); + pg.push(gauge); + } + + @Test + public void testPushCollectorWithEscapedGroupingKey() throws IOException { + mockServerClient + .when(request().withMethod("PUT").withPath("/metrics/job/j/U__l_2e_1/v1")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .registry(registry) + .job("j") + .groupingKey("l.1", "v1") + .build(); + pg.push(gauge); + } + + @Test + public void testPushAdd() throws IOException { + mockServerClient + .when(request().withMethod("POST").withPath("/metrics/job/j")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .registry(registry) + .job("j") + .build(); + pg.pushAdd(); + } + + @Test + public void testPushAddCollector() throws IOException { + mockServerClient + .when(request().withMethod("POST").withPath("/metrics/job/j")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder().address("localhost:" + mockServerClient.getPort()).job("j").build(); + pg.pushAdd(gauge); + } + + @Test + public void testPushAddWithGroupingKey() throws IOException { + mockServerClient + .when(request().withMethod("POST").withPath("/metrics/job/j/l/v")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .registry(registry) + .groupingKey("l", "v") + .job("j") + .build(); + pg.pushAdd(); + } + + @Test + public void testPushAddWithEscapedGroupingKey() throws IOException { + mockServerClient + .when(request().withMethod("POST").withPath("/metrics/job/j/U__l_2e_1/v1")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .registry(registry) + .groupingKey("l.1", "v1") + .job("j") + .build(); + pg.pushAdd(); + } + + @Test + public void testPushAddCollectorWithGroupingKey() throws IOException { + mockServerClient + .when(request().withMethod("POST").withPath("/metrics/job/j/l/v")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .registry(registry) + .groupingKey("l", "v") + .job("j") + .build(); + pg.pushAdd(gauge); + } + + @Test + public void testPushAddCollectorWithEscapedGroupingKey() throws IOException { + + mockServerClient + .when(request().withMethod("POST").withPath("/metrics/job/j/U__l_2e_1/v1")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .registry(registry) + .groupingKey("l.1", "v1") + .job("j") + .build(); + pg.pushAdd(gauge); + } + + @Test + public void testDelete() throws IOException { + mockServerClient + .when(request().withMethod("DELETE").withPath("/metrics/job/j")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder().address("localhost:" + mockServerClient.getPort()).job("j").build(); + pg.delete(); + } + + @Test + public void testDeleteWithGroupingKey() throws IOException { + mockServerClient + .when(request().withMethod("DELETE").withPath("/metrics/job/j/l/v")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .job("j") + .groupingKey("l", "v") + .build(); + pg.delete(); + } + + @Test + public void testDeleteWithEscapedGroupingKey() throws IOException { + + mockServerClient + .when(request().withMethod("DELETE").withPath("/metrics/job/j/U__l_2e_1/v1")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .job("j") + .groupingKey("l.1", "v1") + .build(); + pg.delete(); + } + + @Test + public void testInstanceIpGroupingKey() throws IOException { + String ip = InetAddress.getLocalHost().getHostAddress(); + assertThat(ip).isNotEmpty(); + mockServerClient + .when(request().withMethod("DELETE").withPath("/metrics/job/j/instance/" + ip + "/l/v")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .job("j") + .groupingKey("l", "v") + .instanceIpGroupingKey() + .build(); + pg.delete(); + } + + @Test + public void testInstanceIpEscapedGroupingKey() throws IOException { + + String ip = InetAddress.getLocalHost().getHostAddress(); + assertThat(ip).isNotEmpty(); + mockServerClient + .when( + request() + .withMethod("DELETE") + .withPath("/metrics/job/j/instance/" + ip + "/U__l_2e_1/v1")) + .respond(response().withStatusCode(202)); + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .job("j") + .groupingKey("l.1", "v1") + .instanceIpGroupingKey() + .build(); + pg.delete(); + } + + @Test + public void testEscapingSchemeDefaultValue() throws IllegalAccessException, NoSuchFieldException { + PushGateway pg = + PushGateway.builder() + .address("localhost:" + mockServerClient.getPort()) + .job("test") + .build(); + + Field escapingSchemeField = pg.getClass().getDeclaredField("escapingScheme"); + escapingSchemeField.setAccessible(true); + EscapingScheme scheme = (EscapingScheme) escapingSchemeField.get(pg); + + assertThat(scheme).isEqualTo(EscapingScheme.UNDERSCORE_ESCAPING); + } +} diff --git a/prometheus-metrics-exporter-pushgateway/src/test/java/io/prometheus/metrics/exporter/pushgateway/SchemeTest.java b/prometheus-metrics-exporter-pushgateway/src/test/java/io/prometheus/metrics/exporter/pushgateway/SchemeTest.java new file mode 100644 index 000000000..6695a2911 --- /dev/null +++ b/prometheus-metrics-exporter-pushgateway/src/test/java/io/prometheus/metrics/exporter/pushgateway/SchemeTest.java @@ -0,0 +1,18 @@ +package io.prometheus.metrics.exporter.pushgateway; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import org.junit.jupiter.api.Test; + +class SchemeTest { + + @Test + void fromString() { + assertThat(Scheme.HTTP).hasToString("http"); + assertThat(Scheme.HTTPS).hasToString("https"); + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> Scheme.fromString("ftp")) + .withMessage("ftp: Unsupported scheme. Expecting 'http' or 'https'."); + } +} diff --git a/prometheus-metrics-exporter-pushgateway/version-rules.xml b/prometheus-metrics-exporter-pushgateway/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-exporter-pushgateway/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-exporter-servlet-jakarta/pom.xml b/prometheus-metrics-exporter-servlet-jakarta/pom.xml new file mode 100644 index 000000000..263428a20 --- /dev/null +++ b/prometheus-metrics-exporter-servlet-jakarta/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-exporter-servlet-jakarta + bundle + + Prometheus Metrics Exporter - Servlet Jakarta + + Jakarta Servlet for exposing a Prometheus scrape endpoint. + + + + io.prometheus.metrics.exporter.servlet.jakarta + 17 + + + + + io.prometheus + prometheus-metrics-exporter-common + ${project.version} + + + jakarta.servlet + jakarta.servlet-api + 6.1.0 + provided + + + diff --git a/prometheus-metrics-exporter-servlet-jakarta/src/main/java/io/prometheus/metrics/exporter/servlet/jakarta/HttpExchangeAdapter.java b/prometheus-metrics-exporter-servlet-jakarta/src/main/java/io/prometheus/metrics/exporter/servlet/jakarta/HttpExchangeAdapter.java new file mode 100644 index 000000000..6953b1c6d --- /dev/null +++ b/prometheus-metrics-exporter-servlet-jakarta/src/main/java/io/prometheus/metrics/exporter/servlet/jakarta/HttpExchangeAdapter.java @@ -0,0 +1,112 @@ +package io.prometheus.metrics.exporter.servlet.jakarta; + +import io.prometheus.metrics.exporter.common.PrometheusHttpExchange; +import io.prometheus.metrics.exporter.common.PrometheusHttpRequest; +import io.prometheus.metrics.exporter.common.PrometheusHttpResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Enumeration; + +public class HttpExchangeAdapter implements PrometheusHttpExchange { + + private final Request request; + private final Response response; + + public HttpExchangeAdapter(HttpServletRequest request, HttpServletResponse response) { + this.request = new Request(request); + this.response = new Response(response); + } + + @Override + public PrometheusHttpRequest getRequest() { + return request; + } + + @Override + public PrometheusHttpResponse getResponse() { + return response; + } + + @Override + public void handleException(IOException e) throws IOException { + throw e; // leave exception handling to the servlet container + } + + @Override + public void handleException(RuntimeException e) { + throw e; // leave exception handling to the servlet container + } + + @Override + public void close() { + // nothing to do for Servlets. + } + + public static class Request implements PrometheusHttpRequest { + + private final HttpServletRequest request; + + public Request(HttpServletRequest request) { + this.request = request; + } + + @Override + public String getQueryString() { + return request.getQueryString(); + } + + @Override + public Enumeration getHeaders(String name) { + return request.getHeaders(name); + } + + @Override + public String getMethod() { + return request.getMethod(); + } + + @Override + public String getRequestPath() { + StringBuilder uri = new StringBuilder(); + String contextPath = request.getContextPath(); + if (contextPath.startsWith("/")) { + uri.append(contextPath); + } + String servletPath = request.getServletPath(); + if (servletPath.startsWith("/")) { + uri.append(servletPath); + } + String pathInfo = request.getPathInfo(); + if (pathInfo != null) { + uri.append(pathInfo); + } + return uri.toString(); + } + } + + public static class Response implements PrometheusHttpResponse { + + private final HttpServletResponse response; + + public Response(HttpServletResponse response) { + this.response = response; + } + + @Override + public void setHeader(String name, String value) { + response.setHeader(name, value); + } + + @Override + public OutputStream sendHeadersAndGetBody(int statusCode, int contentLength) + throws IOException { + if (response.getHeader("Content-Length") == null && contentLength > 0) { + response.setContentLength(contentLength); + } + response.setStatus(statusCode); + return response.getOutputStream(); + } + } +} diff --git a/prometheus-metrics-exporter-servlet-jakarta/src/main/java/io/prometheus/metrics/exporter/servlet/jakarta/PrometheusMetricsServlet.java b/prometheus-metrics-exporter-servlet-jakarta/src/main/java/io/prometheus/metrics/exporter/servlet/jakarta/PrometheusMetricsServlet.java new file mode 100644 index 000000000..5e22fc3fd --- /dev/null +++ b/prometheus-metrics-exporter-servlet-jakarta/src/main/java/io/prometheus/metrics/exporter/servlet/jakarta/PrometheusMetricsServlet.java @@ -0,0 +1,44 @@ +package io.prometheus.metrics.exporter.servlet.jakarta; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.exporter.common.PrometheusScrapeHandler; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * Initial example exporter so that we can try the new metrics library out. + * + *

    We'll add a Jakarta servlet, the built-in HTTPServer, etc. soon, and likely move common code + * into a common module. + */ +public class PrometheusMetricsServlet extends HttpServlet { + + private static final long serialVersionUID = 0L; + + private final PrometheusScrapeHandler handler; + + public PrometheusMetricsServlet() { + this(PrometheusProperties.get(), PrometheusRegistry.defaultRegistry); + } + + public PrometheusMetricsServlet(PrometheusRegistry registry) { + this(PrometheusProperties.get(), registry); + } + + public PrometheusMetricsServlet(PrometheusProperties config) { + this(config, PrometheusRegistry.defaultRegistry); + } + + public PrometheusMetricsServlet(PrometheusProperties config, PrometheusRegistry registry) { + this.handler = new PrometheusScrapeHandler(config, registry); + } + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws IOException { + handler.handleRequest(new HttpExchangeAdapter(request, response)); + } +} diff --git a/prometheus-metrics-exporter-servlet-jakarta/version-rules.xml b/prometheus-metrics-exporter-servlet-jakarta/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-exporter-servlet-jakarta/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-exporter-servlet-javax/pom.xml b/prometheus-metrics-exporter-servlet-javax/pom.xml new file mode 100644 index 000000000..30cd52539 --- /dev/null +++ b/prometheus-metrics-exporter-servlet-javax/pom.xml @@ -0,0 +1,46 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-exporter-servlet-javax + bundle + + Prometheus Metrics Exporter - Servlet JavaX + + JavaX Servlet for exposing a Prometheus scrape endpoint. + + + + io.prometheus.metrics.exporter.servlet.javax + + + + + kingster + Kinshuk Bairagi + hi@kinsh.uk + + + + + + io.prometheus + prometheus-metrics-exporter-common + ${project.version} + + + javax.servlet + javax.servlet-api + 4.0.1 + provided + + + + diff --git a/prometheus-metrics-exporter-servlet-javax/src/main/java/io/prometheus/metrics/exporter/servlet/javax/HttpExchangeAdapter.java b/prometheus-metrics-exporter-servlet-javax/src/main/java/io/prometheus/metrics/exporter/servlet/javax/HttpExchangeAdapter.java new file mode 100644 index 000000000..939b4d259 --- /dev/null +++ b/prometheus-metrics-exporter-servlet-javax/src/main/java/io/prometheus/metrics/exporter/servlet/javax/HttpExchangeAdapter.java @@ -0,0 +1,145 @@ +package io.prometheus.metrics.exporter.servlet.javax; + +import io.prometheus.metrics.exporter.common.PrometheusHttpExchange; +import io.prometheus.metrics.exporter.common.PrometheusHttpRequest; +import io.prometheus.metrics.exporter.common.PrometheusHttpResponse; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Enumeration; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * This class is an adapter for HTTP exchanges, implementing the PrometheusHttpExchange interface. + * It wraps HttpServletRequest and HttpServletResponse objects into Request and Response inner + * classes. + */ +public class HttpExchangeAdapter implements PrometheusHttpExchange { + + private final Request request; + private final Response response; + + /** + * Constructs a new HttpExchangeAdapter with the given HttpServletRequest and HttpServletResponse. + * + * @param request the HttpServletRequest to be adapted + * @param response the HttpServletResponse to be adapted + */ + public HttpExchangeAdapter(HttpServletRequest request, HttpServletResponse response) { + this.request = new Request(request); + this.response = new Response(response); + } + + /** + * Returns the adapted HttpServletRequest. + * + * @return the adapted HttpServletRequest + */ + @Override + public PrometheusHttpRequest getRequest() { + return request; + } + + /** + * Returns the adapted HttpServletResponse. + * + * @return the adapted HttpServletResponse + */ + @Override + public PrometheusHttpResponse getResponse() { + return response; + } + + @Override + public void handleException(IOException e) throws IOException { + throw e; // leave exception handling to the servlet container + } + + @Override + public void handleException(RuntimeException e) { + throw e; // leave exception handling to the servlet container + } + + @Override + public void close() { + // nothing to do for Servlets. + } + + /** This inner class adapts a HttpServletRequest to a PrometheusHttpRequest. */ + public static class Request implements PrometheusHttpRequest { + + private final HttpServletRequest request; + + /** + * Constructs a new Request with the given HttpServletRequest. + * + * @param request the HttpServletRequest to be adapted + */ + public Request(HttpServletRequest request) { + this.request = request; + } + + @Override + public String getQueryString() { + return request.getQueryString(); + } + + @Override + public Enumeration getHeaders(String name) { + return request.getHeaders(name); + } + + @Override + public String getMethod() { + return request.getMethod(); + } + + @Override + public String getRequestPath() { + StringBuilder uri = new StringBuilder(); + String contextPath = request.getContextPath(); + if (contextPath.startsWith("/")) { + uri.append(contextPath); + } + String servletPath = request.getServletPath(); + if (servletPath.startsWith("/")) { + uri.append(servletPath); + } + String pathInfo = request.getPathInfo(); + if (pathInfo != null) { + uri.append(pathInfo); + } + return uri.toString(); + } + } + + /** This inner class adapts a HttpServletResponse to a PrometheusHttpResponse. */ + public static class Response implements PrometheusHttpResponse { + + private final HttpServletResponse response; + + /** + * Constructs a new Response with the given HttpServletResponse. + * + * @param response the HttpServletResponse to be adapted + */ + public Response(HttpServletResponse response) { + this.response = response; + } + + @Override + public void setHeader(String name, String value) { + response.setHeader(name, value); + } + + @Override + public OutputStream sendHeadersAndGetBody(int statusCode, int contentLength) + throws IOException { + if (response.getHeader("Content-Length") == null && contentLength > 0) { + response.setContentLength(contentLength); + } + response.setStatus(statusCode); + return response.getOutputStream(); + } + } +} diff --git a/prometheus-metrics-exporter-servlet-javax/src/main/java/io/prometheus/metrics/exporter/servlet/javax/PrometheusMetricsServlet.java b/prometheus-metrics-exporter-servlet-javax/src/main/java/io/prometheus/metrics/exporter/servlet/javax/PrometheusMetricsServlet.java new file mode 100644 index 000000000..a486aec93 --- /dev/null +++ b/prometheus-metrics-exporter-servlet-javax/src/main/java/io/prometheus/metrics/exporter/servlet/javax/PrometheusMetricsServlet.java @@ -0,0 +1,68 @@ +package io.prometheus.metrics.exporter.servlet.javax; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.exporter.common.PrometheusScrapeHandler; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import java.io.IOException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * This class extends HttpServlet to create a servlet for exporting Prometheus metrics. It uses a + * PrometheusScrapeHandler to handle HTTP GET requests and export metrics. The servlet can be + * configured with custom PrometheusProperties and a PrometheusRegistry. + */ +public class PrometheusMetricsServlet extends HttpServlet { + + private static final long serialVersionUID = 0L; + + private final PrometheusScrapeHandler handler; + + /** Default constructor. Uses the default PrometheusProperties and PrometheusRegistry. */ + public PrometheusMetricsServlet() { + this(PrometheusProperties.get(), PrometheusRegistry.defaultRegistry); + } + + /** + * Constructor with a custom PrometheusRegistry. Uses the default PrometheusProperties. + * + * @param registry the PrometheusRegistry to use + */ + public PrometheusMetricsServlet(PrometheusRegistry registry) { + this(PrometheusProperties.get(), registry); + } + + /** + * Constructor with custom PrometheusProperties. Uses the default PrometheusRegistry. + * + * @param config the PrometheusProperties to use + */ + public PrometheusMetricsServlet(PrometheusProperties config) { + this(config, PrometheusRegistry.defaultRegistry); + } + + /** + * Constructor with custom PrometheusProperties and PrometheusRegistry. + * + * @param config the PrometheusProperties to use + * @param registry the PrometheusRegistry to use + */ + public PrometheusMetricsServlet(PrometheusProperties config, PrometheusRegistry registry) { + this.handler = new PrometheusScrapeHandler(config, registry); + } + + /** + * Handles HTTP GET requests. Exports Prometheus metrics by delegating to the + * PrometheusScrapeHandler. + * + * @param request the HttpServletRequest + * @param response the HttpServletResponse + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws IOException { + handler.handleRequest(new HttpExchangeAdapter(request, response)); + } +} diff --git a/prometheus-metrics-exporter-servlet-javax/version-rules.xml b/prometheus-metrics-exporter-servlet-javax/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-exporter-servlet-javax/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-exposition-formats-shaded/pom.xml b/prometheus-metrics-exposition-formats-shaded/pom.xml new file mode 100644 index 000000000..64e033366 --- /dev/null +++ b/prometheus-metrics-exposition-formats-shaded/pom.xml @@ -0,0 +1,187 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-exposition-formats + bundle + + Prometheus Metrics Exposition Formats + + Prometheus exposition formats. + + + + io.prometheus.metrics.expositionformats + + + + + io.prometheus + prometheus-metrics-exposition-textformats + ${project.version} + + + com.google.protobuf + protobuf-java + ${protobuf-java.version} + + + + + + + javadoc + + + release + + + default + + true + + + + + io.prometheus + prometheus-metrics-exposition-textformats + ${project.version} + test + test-jar + + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + copy-metrics-exposition-formats-main + validate + + copy-resources + + + target/metrics-exposition-formats/src/main + + + ../prometheus-metrics-exposition-formats/src/main + + + + + + copy-metrics-exposition-formats-test + validate + + copy-resources + + + target/metrics-exposition-formats/src/test + + + ../prometheus-metrics-exposition-formats/src/test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + regex-property + + regex-property + + + protobuf-java.string-version + ${protobuf-java.version} + \. + _ + true + + + + add-metrics-exposition-formats-main + generate-sources + + add-source + + + + target/metrics-exposition-formats/src/main/java + target/metrics-exposition-formats/src/main/generated + + + + + add-metrics-exposition-formats-test + generate-sources + + add-test-source + + + + target/metrics-exposition-formats/src/test/java + + + + + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + true + true + + + com.google.protobuf:protobuf-java + + + + + com.google.protobuf + + io.prometheus.metrics.shaded.com_google_protobuf_${protobuf-java.string-version} + + + + + + com.google.protobuf:protobuf-java + + META-INF/maven/com.google.protobuf/** + **/*.proto + META-INF/MANIFEST.MF + + + + + + + + + + diff --git a/prometheus-metrics-exposition-formats/generate-protobuf.sh b/prometheus-metrics-exposition-formats/generate-protobuf.sh new file mode 100755 index 000000000..9bd222241 --- /dev/null +++ b/prometheus-metrics-exposition-formats/generate-protobuf.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +set -euo pipefail + +# We use the shaded protobuf JAR from the protobuf-shaded module. +# I could not figure out how to use a protoc Maven plugin to use the shaded module, +# so I ran this command to generate the sources manually. + +TARGET_DIR=$1 +PROTO_DIR=src/main/protobuf +PROTOBUF_VERSION_STRING=$2 +PROTOBUF_VERSION="${PROTOBUF_VERSION_STRING//_/.}" + +echo "Generating protobuf sources for version $PROTOBUF_VERSION in $TARGET_DIR" + +rm -rf "$TARGET_DIR" +mkdir -p "$TARGET_DIR" +rm -rf $PROTO_DIR || true +mkdir -p $PROTO_DIR + +OLD_PACKAGE=$(sed -nE 's/import (io.prometheus.metrics.expositionformats.generated.*).Metrics;/\1/p' src/main/java/io/prometheus/metrics/expositionformats/internal/PrometheusProtobufWriterImpl.java) +PACKAGE="io.prometheus.metrics.expositionformats.generated.com_google_protobuf_${PROTOBUF_VERSION_STRING}" + +if [[ $OLD_PACKAGE != "$PACKAGE" ]]; then + echo "Replacing package $OLD_PACKAGE with $PACKAGE in all java files" + find .. -type f -name "*.java" -exec sed -i "s/$OLD_PACKAGE/$PACKAGE/g" {} + +fi + +curl -sL https://raw.githubusercontent.com/prometheus/client_model/master/io/prometheus/client/metrics.proto -o $PROTO_DIR/metrics.proto + +sed -i "s/java_package = \"io.prometheus.client\"/java_package = \"$PACKAGE\"/" $PROTO_DIR/metrics.proto +protoc --java_out "$TARGET_DIR" $PROTO_DIR/metrics.proto +sed -i '1 i\//CHECKSTYLE:OFF: checkstyle' "$(find src/main/generated/io -type f)" +sed -i -e $'$a\\\n//CHECKSTYLE:ON: checkstyle' "$(find src/main/generated/io -type f)" + +GENERATED_WITH=$(grep -oP '\/\/ Protobuf Java Version: \K.*' "$TARGET_DIR/${PACKAGE//\.//}"/Metrics.java) + +function help() { + echo "Please use https://mise.jdx.dev/ - this will use the version specified in mise.toml" + echo "Generated protobuf sources are not up-to-date. Please run 'mise run generate' and commit the changes." + echo "NOTE:" + echo "1. You should only run 'mise run generate' in a PR from renovate" + echo "2. The PR should update both '' in pom.xml and protoc in mise.toml" + echo " - but at least . If not, wait until renovate updates the PR." +} + +if [[ $GENERATED_WITH != "$PROTOBUF_VERSION" ]]; then + echo "Generated protobuf sources version $GENERATED_WITH does not match provided version $PROTOBUF_VERSION" + help + exit 1 +fi + +STATUS=$(git status --porcelain) +if [[ ${REQUIRE_PROTO_UP_TO_DATE:-false} == "true" && -n "$STATUS" ]]; then + help + echo "Local changes:" + echo "$STATUS" + exit 1 +fi diff --git a/prometheus-metrics-exposition-formats/pom.xml b/prometheus-metrics-exposition-formats/pom.xml new file mode 100644 index 000000000..bb780f0c2 --- /dev/null +++ b/prometheus-metrics-exposition-formats/pom.xml @@ -0,0 +1,141 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-exposition-formats-no-protobuf + bundle + + Prometheus Metrics Exposition Formats no protobuf + + Prometheus exposition formats without shaded Protobuf classes. + + + + io.prometheus.metrics.expositionformats.noprotobuf + + + + + io.prometheus + prometheus-metrics-exposition-textformats + ${project.version} + + + com.google.protobuf + protobuf-java + ${protobuf-java.version} + + + + + + + javadoc + + + release + + + default + + true + + + + + io.prometheus + prometheus-metrics-exposition-textformats + ${project.version} + test + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + regex-property + + regex-property + + + protobuf-java.string-version + ${protobuf-java.version} + \. + _ + true + + + + negate-prop + initialize + + bsh-property + + + skip.protobuf.generation = + !"true".equals(System.getenv("PROTO_GENERATION")); + + + skip.protobuf.generation + + + + + add-source + generate-sources + + add-source + + + + src/main/generated/ + + + + + + + exec-maven-plugin + org.codehaus.mojo + + + Generate Protobuf + generate-sources + + exec + + + ${skip.protobuf.generation} + ${project.basedir}/generate-protobuf.sh + + ${project.basedir}/src/main/generated + ${protobuf-java.string-version} + + + + + + + maven-javadoc-plugin + + src/main/java;src/main/generated + + + + + diff --git a/prometheus-metrics-exposition-formats/src/main/.gitignore b/prometheus-metrics-exposition-formats/src/main/.gitignore new file mode 100644 index 000000000..6de9f67ab --- /dev/null +++ b/prometheus-metrics-exposition-formats/src/main/.gitignore @@ -0,0 +1 @@ +protobuf/ diff --git a/prometheus-metrics-exposition-formats/src/main/generated/io/prometheus/metrics/expositionformats/generated/com_google_protobuf_4_33_4/Metrics.java b/prometheus-metrics-exposition-formats/src/main/generated/io/prometheus/metrics/expositionformats/generated/com_google_protobuf_4_33_4/Metrics.java new file mode 100644 index 000000000..fcbc1b8db --- /dev/null +++ b/prometheus-metrics-exposition-formats/src/main/generated/io/prometheus/metrics/expositionformats/generated/com_google_protobuf_4_33_4/Metrics.java @@ -0,0 +1,15117 @@ +//CHECKSTYLE:OFF: checkstyle +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: src/main/protobuf/metrics.proto +// Protobuf Java Version: 4.33.4 + +package io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4; + +@com.google.protobuf.Generated +public final class Metrics extends com.google.protobuf.GeneratedFile { + private Metrics() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 4, + /* suffix= */ "", + "Metrics"); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code io.prometheus.client.MetricType} + */ + public enum MetricType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *

    +     * COUNTER must use the Metric field "counter".
    +     * 
    + * + * COUNTER = 0; + */ + COUNTER(0), + /** + *
    +     * GAUGE must use the Metric field "gauge".
    +     * 
    + * + * GAUGE = 1; + */ + GAUGE(1), + /** + *
    +     * SUMMARY must use the Metric field "summary".
    +     * 
    + * + * SUMMARY = 2; + */ + SUMMARY(2), + /** + *
    +     * UNTYPED must use the Metric field "untyped".
    +     * 
    + * + * UNTYPED = 3; + */ + UNTYPED(3), + /** + *
    +     * HISTOGRAM must use the Metric field "histogram".
    +     * 
    + * + * HISTOGRAM = 4; + */ + HISTOGRAM(4), + /** + *
    +     * GAUGE_HISTOGRAM must use the Metric field "histogram".
    +     * 
    + * + * GAUGE_HISTOGRAM = 5; + */ + GAUGE_HISTOGRAM(5), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 4, + /* suffix= */ "", + "MetricType"); + } + /** + *
    +     * COUNTER must use the Metric field "counter".
    +     * 
    + * + * COUNTER = 0; + */ + public static final int COUNTER_VALUE = 0; + /** + *
    +     * GAUGE must use the Metric field "gauge".
    +     * 
    + * + * GAUGE = 1; + */ + public static final int GAUGE_VALUE = 1; + /** + *
    +     * SUMMARY must use the Metric field "summary".
    +     * 
    + * + * SUMMARY = 2; + */ + public static final int SUMMARY_VALUE = 2; + /** + *
    +     * UNTYPED must use the Metric field "untyped".
    +     * 
    + * + * UNTYPED = 3; + */ + public static final int UNTYPED_VALUE = 3; + /** + *
    +     * HISTOGRAM must use the Metric field "histogram".
    +     * 
    + * + * HISTOGRAM = 4; + */ + public static final int HISTOGRAM_VALUE = 4; + /** + *
    +     * GAUGE_HISTOGRAM must use the Metric field "histogram".
    +     * 
    + * + * GAUGE_HISTOGRAM = 5; + */ + public static final int GAUGE_HISTOGRAM_VALUE = 5; + + + public final int getNumber() { + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MetricType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static MetricType forNumber(int value) { + switch (value) { + case 0: return COUNTER; + case 1: return GAUGE; + case 2: return SUMMARY; + case 3: return UNTYPED; + case 4: return HISTOGRAM; + case 5: return GAUGE_HISTOGRAM; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + MetricType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public MetricType findValueByNumber(int number) { + return MetricType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.getDescriptor().getEnumTypes().get(0); + } + + private static final MetricType[] VALUES = values(); + + public static MetricType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private MetricType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:io.prometheus.client.MetricType) + } + + public interface LabelPairOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.prometheus.client.LabelPair) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string name = 1; + * @return Whether the name field is set. + */ + boolean hasName(); + /** + * optional string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * optional string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * optional string value = 2; + * @return Whether the value field is set. + */ + boolean hasValue(); + /** + * optional string value = 2; + * @return The value. + */ + java.lang.String getValue(); + /** + * optional string value = 2; + * @return The bytes for value. + */ + com.google.protobuf.ByteString + getValueBytes(); + } + /** + * Protobuf type {@code io.prometheus.client.LabelPair} + */ + public static final class LabelPair extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:io.prometheus.client.LabelPair) + LabelPairOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 4, + /* suffix= */ "", + "LabelPair"); + } + // Use LabelPair.newBuilder() to construct. + private LabelPair(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private LabelPair() { + name_ = ""; + value_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_LabelPair_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_LabelPair_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * optional string name = 1; + * @return Whether the name field is set. + */ + @java.lang.Override + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * optional string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object value_ = ""; + /** + * optional string value = 2; + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional string value = 2; + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + value_ = s; + } + return s; + } + } + /** + * optional string value = 2; + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair)) { + return super.equals(obj); + } + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair other = (io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair) obj; + + if (hasName() != other.hasName()) return false; + if (hasName()) { + if (!getName() + .equals(other.getName())) return false; + } + if (hasValue() != other.hasValue()) return false; + if (hasValue()) { + if (!getValue() + .equals(other.getValue())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (hasValue()) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code io.prometheus.client.LabelPair} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:io.prometheus.client.LabelPair) + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPairOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_LabelPair_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_LabelPair_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder.class); + } + + // Construct using io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + value_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_LabelPair_descriptor; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair getDefaultInstanceForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.getDefaultInstance(); + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair build() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair buildPartial() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair result = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair) { + return mergeFrom((io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair other) { + if (other == io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.getDefaultInstance()) return this; + if (other.hasName()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasValue()) { + value_ = other.value_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + value_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * optional string name = 1; + * @return Whether the name field is set. + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * optional string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + /** + * optional string value = 2; + * @return Whether the value field is set. + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional string value = 2; + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + value_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string value = 2; + * @return The bytes for value. + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string value = 2; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * optional string value = 2; + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * optional string value = 2; + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:io.prometheus.client.LabelPair) + } + + // @@protoc_insertion_point(class_scope:io.prometheus.client.LabelPair) + private static final io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair(); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LabelPair parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GaugeOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.prometheus.client.Gauge) + com.google.protobuf.MessageOrBuilder { + + /** + * optional double value = 1; + * @return Whether the value field is set. + */ + boolean hasValue(); + /** + * optional double value = 1; + * @return The value. + */ + double getValue(); + } + /** + * Protobuf type {@code io.prometheus.client.Gauge} + */ + public static final class Gauge extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:io.prometheus.client.Gauge) + GaugeOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 4, + /* suffix= */ "", + "Gauge"); + } + // Use Gauge.newBuilder() to construct. + private Gauge(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Gauge() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Gauge_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Gauge_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge.Builder.class); + } + + private int bitField0_; + public static final int VALUE_FIELD_NUMBER = 1; + private double value_ = 0D; + /** + * optional double value = 1; + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional double value = 1; + * @return The value. + */ + @java.lang.Override + public double getValue() { + return value_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeDouble(1, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(1, value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge)) { + return super.equals(obj); + } + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge other = (io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge) obj; + + if (hasValue() != other.hasValue()) return false; + if (hasValue()) { + if (java.lang.Double.doubleToLongBits(getValue()) + != java.lang.Double.doubleToLongBits( + other.getValue())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasValue()) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getValue())); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code io.prometheus.client.Gauge} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:io.prometheus.client.Gauge) + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.GaugeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Gauge_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Gauge_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge.Builder.class); + } + + // Construct using io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Gauge_descriptor; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge getDefaultInstanceForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge.getDefaultInstance(); + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge build() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge buildPartial() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge result = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.value_ = value_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge) { + return mergeFrom((io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge other) { + if (other == io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge.getDefaultInstance()) return this; + if (other.hasValue()) { + setValue(other.getValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + value_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private double value_ ; + /** + * optional double value = 1; + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional double value = 1; + * @return The value. + */ + @java.lang.Override + public double getValue() { + return value_; + } + /** + * optional double value = 1; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(double value) { + + value_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional double value = 1; + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000001); + value_ = 0D; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:io.prometheus.client.Gauge) + } + + // @@protoc_insertion_point(class_scope:io.prometheus.client.Gauge) + private static final io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge(); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Gauge parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CounterOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.prometheus.client.Counter) + com.google.protobuf.MessageOrBuilder { + + /** + * optional double value = 1; + * @return Whether the value field is set. + */ + boolean hasValue(); + /** + * optional double value = 1; + * @return The value. + */ + double getValue(); + + /** + * optional .io.prometheus.client.Exemplar exemplar = 2; + * @return Whether the exemplar field is set. + */ + boolean hasExemplar(); + /** + * optional .io.prometheus.client.Exemplar exemplar = 2; + * @return The exemplar. + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar getExemplar(); + /** + * optional .io.prometheus.client.Exemplar exemplar = 2; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder getExemplarOrBuilder(); + + /** + * optional .google.protobuf.Timestamp created_timestamp = 3; + * @return Whether the createdTimestamp field is set. + */ + boolean hasCreatedTimestamp(); + /** + * optional .google.protobuf.Timestamp created_timestamp = 3; + * @return The createdTimestamp. + */ + com.google.protobuf.Timestamp getCreatedTimestamp(); + /** + * optional .google.protobuf.Timestamp created_timestamp = 3; + */ + com.google.protobuf.TimestampOrBuilder getCreatedTimestampOrBuilder(); + } + /** + * Protobuf type {@code io.prometheus.client.Counter} + */ + public static final class Counter extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:io.prometheus.client.Counter) + CounterOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 4, + /* suffix= */ "", + "Counter"); + } + // Use Counter.newBuilder() to construct. + private Counter(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Counter() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Counter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Counter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter.Builder.class); + } + + private int bitField0_; + public static final int VALUE_FIELD_NUMBER = 1; + private double value_ = 0D; + /** + * optional double value = 1; + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional double value = 1; + * @return The value. + */ + @java.lang.Override + public double getValue() { + return value_; + } + + public static final int EXEMPLAR_FIELD_NUMBER = 2; + private io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar exemplar_; + /** + * optional .io.prometheus.client.Exemplar exemplar = 2; + * @return Whether the exemplar field is set. + */ + @java.lang.Override + public boolean hasExemplar() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 2; + * @return The exemplar. + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar getExemplar() { + return exemplar_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.getDefaultInstance() : exemplar_; + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 2; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder getExemplarOrBuilder() { + return exemplar_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.getDefaultInstance() : exemplar_; + } + + public static final int CREATED_TIMESTAMP_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createdTimestamp_; + /** + * optional .google.protobuf.Timestamp created_timestamp = 3; + * @return Whether the createdTimestamp field is set. + */ + @java.lang.Override + public boolean hasCreatedTimestamp() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 3; + * @return The createdTimestamp. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreatedTimestamp() { + return createdTimestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createdTimestamp_; + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreatedTimestampOrBuilder() { + return createdTimestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createdTimestamp_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeDouble(1, value_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getExemplar()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getCreatedTimestamp()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(1, value_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getExemplar()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getCreatedTimestamp()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter)) { + return super.equals(obj); + } + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter other = (io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter) obj; + + if (hasValue() != other.hasValue()) return false; + if (hasValue()) { + if (java.lang.Double.doubleToLongBits(getValue()) + != java.lang.Double.doubleToLongBits( + other.getValue())) return false; + } + if (hasExemplar() != other.hasExemplar()) return false; + if (hasExemplar()) { + if (!getExemplar() + .equals(other.getExemplar())) return false; + } + if (hasCreatedTimestamp() != other.hasCreatedTimestamp()) return false; + if (hasCreatedTimestamp()) { + if (!getCreatedTimestamp() + .equals(other.getCreatedTimestamp())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasValue()) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getValue())); + } + if (hasExemplar()) { + hash = (37 * hash) + EXEMPLAR_FIELD_NUMBER; + hash = (53 * hash) + getExemplar().hashCode(); + } + if (hasCreatedTimestamp()) { + hash = (37 * hash) + CREATED_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getCreatedTimestamp().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code io.prometheus.client.Counter} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:io.prometheus.client.Counter) + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.CounterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Counter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Counter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter.Builder.class); + } + + // Construct using io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetExemplarFieldBuilder(); + internalGetCreatedTimestampFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = 0D; + exemplar_ = null; + if (exemplarBuilder_ != null) { + exemplarBuilder_.dispose(); + exemplarBuilder_ = null; + } + createdTimestamp_ = null; + if (createdTimestampBuilder_ != null) { + createdTimestampBuilder_.dispose(); + createdTimestampBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Counter_descriptor; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter getDefaultInstanceForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter.getDefaultInstance(); + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter build() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter buildPartial() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter result = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.value_ = value_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.exemplar_ = exemplarBuilder_ == null + ? exemplar_ + : exemplarBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.createdTimestamp_ = createdTimestampBuilder_ == null + ? createdTimestamp_ + : createdTimestampBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter) { + return mergeFrom((io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter other) { + if (other == io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter.getDefaultInstance()) return this; + if (other.hasValue()) { + setValue(other.getValue()); + } + if (other.hasExemplar()) { + mergeExemplar(other.getExemplar()); + } + if (other.hasCreatedTimestamp()) { + mergeCreatedTimestamp(other.getCreatedTimestamp()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + value_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + case 18: { + input.readMessage( + internalGetExemplarFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + internalGetCreatedTimestampFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private double value_ ; + /** + * optional double value = 1; + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional double value = 1; + * @return The value. + */ + @java.lang.Override + public double getValue() { + return value_; + } + /** + * optional double value = 1; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(double value) { + + value_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional double value = 1; + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000001); + value_ = 0D; + onChanged(); + return this; + } + + private io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar exemplar_; + private com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder> exemplarBuilder_; + /** + * optional .io.prometheus.client.Exemplar exemplar = 2; + * @return Whether the exemplar field is set. + */ + public boolean hasExemplar() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 2; + * @return The exemplar. + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar getExemplar() { + if (exemplarBuilder_ == null) { + return exemplar_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.getDefaultInstance() : exemplar_; + } else { + return exemplarBuilder_.getMessage(); + } + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 2; + */ + public Builder setExemplar(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar value) { + if (exemplarBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + exemplar_ = value; + } else { + exemplarBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 2; + */ + public Builder setExemplar( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder builderForValue) { + if (exemplarBuilder_ == null) { + exemplar_ = builderForValue.build(); + } else { + exemplarBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 2; + */ + public Builder mergeExemplar(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar value) { + if (exemplarBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + exemplar_ != null && + exemplar_ != io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.getDefaultInstance()) { + getExemplarBuilder().mergeFrom(value); + } else { + exemplar_ = value; + } + } else { + exemplarBuilder_.mergeFrom(value); + } + if (exemplar_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 2; + */ + public Builder clearExemplar() { + bitField0_ = (bitField0_ & ~0x00000002); + exemplar_ = null; + if (exemplarBuilder_ != null) { + exemplarBuilder_.dispose(); + exemplarBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 2; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder getExemplarBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetExemplarFieldBuilder().getBuilder(); + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 2; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder getExemplarOrBuilder() { + if (exemplarBuilder_ != null) { + return exemplarBuilder_.getMessageOrBuilder(); + } else { + return exemplar_ == null ? + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.getDefaultInstance() : exemplar_; + } + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder> + internalGetExemplarFieldBuilder() { + if (exemplarBuilder_ == null) { + exemplarBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder>( + getExemplar(), + getParentForChildren(), + isClean()); + exemplar_ = null; + } + return exemplarBuilder_; + } + + private com.google.protobuf.Timestamp createdTimestamp_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createdTimestampBuilder_; + /** + * optional .google.protobuf.Timestamp created_timestamp = 3; + * @return Whether the createdTimestamp field is set. + */ + public boolean hasCreatedTimestamp() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 3; + * @return The createdTimestamp. + */ + public com.google.protobuf.Timestamp getCreatedTimestamp() { + if (createdTimestampBuilder_ == null) { + return createdTimestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createdTimestamp_; + } else { + return createdTimestampBuilder_.getMessage(); + } + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 3; + */ + public Builder setCreatedTimestamp(com.google.protobuf.Timestamp value) { + if (createdTimestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createdTimestamp_ = value; + } else { + createdTimestampBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 3; + */ + public Builder setCreatedTimestamp( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (createdTimestampBuilder_ == null) { + createdTimestamp_ = builderForValue.build(); + } else { + createdTimestampBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 3; + */ + public Builder mergeCreatedTimestamp(com.google.protobuf.Timestamp value) { + if (createdTimestampBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + createdTimestamp_ != null && + createdTimestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreatedTimestampBuilder().mergeFrom(value); + } else { + createdTimestamp_ = value; + } + } else { + createdTimestampBuilder_.mergeFrom(value); + } + if (createdTimestamp_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 3; + */ + public Builder clearCreatedTimestamp() { + bitField0_ = (bitField0_ & ~0x00000004); + createdTimestamp_ = null; + if (createdTimestampBuilder_ != null) { + createdTimestampBuilder_.dispose(); + createdTimestampBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 3; + */ + public com.google.protobuf.Timestamp.Builder getCreatedTimestampBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetCreatedTimestampFieldBuilder().getBuilder(); + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 3; + */ + public com.google.protobuf.TimestampOrBuilder getCreatedTimestampOrBuilder() { + if (createdTimestampBuilder_ != null) { + return createdTimestampBuilder_.getMessageOrBuilder(); + } else { + return createdTimestamp_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : createdTimestamp_; + } + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + internalGetCreatedTimestampFieldBuilder() { + if (createdTimestampBuilder_ == null) { + createdTimestampBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getCreatedTimestamp(), + getParentForChildren(), + isClean()); + createdTimestamp_ = null; + } + return createdTimestampBuilder_; + } + + // @@protoc_insertion_point(builder_scope:io.prometheus.client.Counter) + } + + // @@protoc_insertion_point(class_scope:io.prometheus.client.Counter) + private static final io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter(); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Counter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface QuantileOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.prometheus.client.Quantile) + com.google.protobuf.MessageOrBuilder { + + /** + * optional double quantile = 1; + * @return Whether the quantile field is set. + */ + boolean hasQuantile(); + /** + * optional double quantile = 1; + * @return The quantile. + */ + double getQuantile(); + + /** + * optional double value = 2; + * @return Whether the value field is set. + */ + boolean hasValue(); + /** + * optional double value = 2; + * @return The value. + */ + double getValue(); + } + /** + * Protobuf type {@code io.prometheus.client.Quantile} + */ + public static final class Quantile extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:io.prometheus.client.Quantile) + QuantileOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 4, + /* suffix= */ "", + "Quantile"); + } + // Use Quantile.newBuilder() to construct. + private Quantile(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Quantile() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Quantile_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Quantile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.Builder.class); + } + + private int bitField0_; + public static final int QUANTILE_FIELD_NUMBER = 1; + private double quantile_ = 0D; + /** + * optional double quantile = 1; + * @return Whether the quantile field is set. + */ + @java.lang.Override + public boolean hasQuantile() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional double quantile = 1; + * @return The quantile. + */ + @java.lang.Override + public double getQuantile() { + return quantile_; + } + + public static final int VALUE_FIELD_NUMBER = 2; + private double value_ = 0D; + /** + * optional double value = 2; + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional double value = 2; + * @return The value. + */ + @java.lang.Override + public double getValue() { + return value_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeDouble(1, quantile_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeDouble(2, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(1, quantile_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(2, value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile)) { + return super.equals(obj); + } + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile other = (io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile) obj; + + if (hasQuantile() != other.hasQuantile()) return false; + if (hasQuantile()) { + if (java.lang.Double.doubleToLongBits(getQuantile()) + != java.lang.Double.doubleToLongBits( + other.getQuantile())) return false; + } + if (hasValue() != other.hasValue()) return false; + if (hasValue()) { + if (java.lang.Double.doubleToLongBits(getValue()) + != java.lang.Double.doubleToLongBits( + other.getValue())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasQuantile()) { + hash = (37 * hash) + QUANTILE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getQuantile())); + } + if (hasValue()) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getValue())); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code io.prometheus.client.Quantile} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:io.prometheus.client.Quantile) + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.QuantileOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Quantile_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Quantile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.Builder.class); + } + + // Construct using io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + quantile_ = 0D; + value_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Quantile_descriptor; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile getDefaultInstanceForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.getDefaultInstance(); + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile build() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile buildPartial() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile result = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.quantile_ = quantile_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile) { + return mergeFrom((io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile other) { + if (other == io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.getDefaultInstance()) return this; + if (other.hasQuantile()) { + setQuantile(other.getQuantile()); + } + if (other.hasValue()) { + setValue(other.getValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + quantile_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + case 17: { + value_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private double quantile_ ; + /** + * optional double quantile = 1; + * @return Whether the quantile field is set. + */ + @java.lang.Override + public boolean hasQuantile() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional double quantile = 1; + * @return The quantile. + */ + @java.lang.Override + public double getQuantile() { + return quantile_; + } + /** + * optional double quantile = 1; + * @param value The quantile to set. + * @return This builder for chaining. + */ + public Builder setQuantile(double value) { + + quantile_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional double quantile = 1; + * @return This builder for chaining. + */ + public Builder clearQuantile() { + bitField0_ = (bitField0_ & ~0x00000001); + quantile_ = 0D; + onChanged(); + return this; + } + + private double value_ ; + /** + * optional double value = 2; + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional double value = 2; + * @return The value. + */ + @java.lang.Override + public double getValue() { + return value_; + } + /** + * optional double value = 2; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(double value) { + + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * optional double value = 2; + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000002); + value_ = 0D; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:io.prometheus.client.Quantile) + } + + // @@protoc_insertion_point(class_scope:io.prometheus.client.Quantile) + private static final io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile(); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Quantile parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SummaryOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.prometheus.client.Summary) + com.google.protobuf.MessageOrBuilder { + + /** + * optional uint64 sample_count = 1; + * @return Whether the sampleCount field is set. + */ + boolean hasSampleCount(); + /** + * optional uint64 sample_count = 1; + * @return The sampleCount. + */ + long getSampleCount(); + + /** + * optional double sample_sum = 2; + * @return Whether the sampleSum field is set. + */ + boolean hasSampleSum(); + /** + * optional double sample_sum = 2; + * @return The sampleSum. + */ + double getSampleSum(); + + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + java.util.List + getQuantileList(); + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile getQuantile(int index); + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + int getQuantileCount(); + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + java.util.List + getQuantileOrBuilderList(); + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.QuantileOrBuilder getQuantileOrBuilder( + int index); + + /** + * optional .google.protobuf.Timestamp created_timestamp = 4; + * @return Whether the createdTimestamp field is set. + */ + boolean hasCreatedTimestamp(); + /** + * optional .google.protobuf.Timestamp created_timestamp = 4; + * @return The createdTimestamp. + */ + com.google.protobuf.Timestamp getCreatedTimestamp(); + /** + * optional .google.protobuf.Timestamp created_timestamp = 4; + */ + com.google.protobuf.TimestampOrBuilder getCreatedTimestampOrBuilder(); + } + /** + * Protobuf type {@code io.prometheus.client.Summary} + */ + public static final class Summary extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:io.prometheus.client.Summary) + SummaryOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 4, + /* suffix= */ "", + "Summary"); + } + // Use Summary.newBuilder() to construct. + private Summary(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Summary() { + quantile_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Summary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Summary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary.Builder.class); + } + + private int bitField0_; + public static final int SAMPLE_COUNT_FIELD_NUMBER = 1; + private long sampleCount_ = 0L; + /** + * optional uint64 sample_count = 1; + * @return Whether the sampleCount field is set. + */ + @java.lang.Override + public boolean hasSampleCount() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional uint64 sample_count = 1; + * @return The sampleCount. + */ + @java.lang.Override + public long getSampleCount() { + return sampleCount_; + } + + public static final int SAMPLE_SUM_FIELD_NUMBER = 2; + private double sampleSum_ = 0D; + /** + * optional double sample_sum = 2; + * @return Whether the sampleSum field is set. + */ + @java.lang.Override + public boolean hasSampleSum() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional double sample_sum = 2; + * @return The sampleSum. + */ + @java.lang.Override + public double getSampleSum() { + return sampleSum_; + } + + public static final int QUANTILE_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List quantile_; + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + @java.lang.Override + public java.util.List getQuantileList() { + return quantile_; + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + @java.lang.Override + public java.util.List + getQuantileOrBuilderList() { + return quantile_; + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + @java.lang.Override + public int getQuantileCount() { + return quantile_.size(); + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile getQuantile(int index) { + return quantile_.get(index); + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.QuantileOrBuilder getQuantileOrBuilder( + int index) { + return quantile_.get(index); + } + + public static final int CREATED_TIMESTAMP_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createdTimestamp_; + /** + * optional .google.protobuf.Timestamp created_timestamp = 4; + * @return Whether the createdTimestamp field is set. + */ + @java.lang.Override + public boolean hasCreatedTimestamp() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 4; + * @return The createdTimestamp. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreatedTimestamp() { + return createdTimestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createdTimestamp_; + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreatedTimestampOrBuilder() { + return createdTimestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createdTimestamp_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeUInt64(1, sampleCount_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeDouble(2, sampleSum_); + } + for (int i = 0; i < quantile_.size(); i++) { + output.writeMessage(3, quantile_.get(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getCreatedTimestamp()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, sampleCount_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(2, sampleSum_); + } + for (int i = 0; i < quantile_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, quantile_.get(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getCreatedTimestamp()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary)) { + return super.equals(obj); + } + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary other = (io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary) obj; + + if (hasSampleCount() != other.hasSampleCount()) return false; + if (hasSampleCount()) { + if (getSampleCount() + != other.getSampleCount()) return false; + } + if (hasSampleSum() != other.hasSampleSum()) return false; + if (hasSampleSum()) { + if (java.lang.Double.doubleToLongBits(getSampleSum()) + != java.lang.Double.doubleToLongBits( + other.getSampleSum())) return false; + } + if (!getQuantileList() + .equals(other.getQuantileList())) return false; + if (hasCreatedTimestamp() != other.hasCreatedTimestamp()) return false; + if (hasCreatedTimestamp()) { + if (!getCreatedTimestamp() + .equals(other.getCreatedTimestamp())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSampleCount()) { + hash = (37 * hash) + SAMPLE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSampleCount()); + } + if (hasSampleSum()) { + hash = (37 * hash) + SAMPLE_SUM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getSampleSum())); + } + if (getQuantileCount() > 0) { + hash = (37 * hash) + QUANTILE_FIELD_NUMBER; + hash = (53 * hash) + getQuantileList().hashCode(); + } + if (hasCreatedTimestamp()) { + hash = (37 * hash) + CREATED_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getCreatedTimestamp().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code io.prometheus.client.Summary} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:io.prometheus.client.Summary) + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.SummaryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Summary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Summary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary.Builder.class); + } + + // Construct using io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetQuantileFieldBuilder(); + internalGetCreatedTimestampFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sampleCount_ = 0L; + sampleSum_ = 0D; + if (quantileBuilder_ == null) { + quantile_ = java.util.Collections.emptyList(); + } else { + quantile_ = null; + quantileBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + createdTimestamp_ = null; + if (createdTimestampBuilder_ != null) { + createdTimestampBuilder_.dispose(); + createdTimestampBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Summary_descriptor; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary getDefaultInstanceForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary.getDefaultInstance(); + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary build() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary buildPartial() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary result = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary result) { + if (quantileBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + quantile_ = java.util.Collections.unmodifiableList(quantile_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.quantile_ = quantile_; + } else { + result.quantile_ = quantileBuilder_.build(); + } + } + + private void buildPartial0(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sampleCount_ = sampleCount_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sampleSum_ = sampleSum_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createdTimestamp_ = createdTimestampBuilder_ == null + ? createdTimestamp_ + : createdTimestampBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary) { + return mergeFrom((io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary other) { + if (other == io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary.getDefaultInstance()) return this; + if (other.hasSampleCount()) { + setSampleCount(other.getSampleCount()); + } + if (other.hasSampleSum()) { + setSampleSum(other.getSampleSum()); + } + if (quantileBuilder_ == null) { + if (!other.quantile_.isEmpty()) { + if (quantile_.isEmpty()) { + quantile_ = other.quantile_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureQuantileIsMutable(); + quantile_.addAll(other.quantile_); + } + onChanged(); + } + } else { + if (!other.quantile_.isEmpty()) { + if (quantileBuilder_.isEmpty()) { + quantileBuilder_.dispose(); + quantileBuilder_ = null; + quantile_ = other.quantile_; + bitField0_ = (bitField0_ & ~0x00000004); + quantileBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + internalGetQuantileFieldBuilder() : null; + } else { + quantileBuilder_.addAllMessages(other.quantile_); + } + } + } + if (other.hasCreatedTimestamp()) { + mergeCreatedTimestamp(other.getCreatedTimestamp()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + sampleCount_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 17: { + sampleSum_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + case 26: { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile m = + input.readMessage( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.parser(), + extensionRegistry); + if (quantileBuilder_ == null) { + ensureQuantileIsMutable(); + quantile_.add(m); + } else { + quantileBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: { + input.readMessage( + internalGetCreatedTimestampFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long sampleCount_ ; + /** + * optional uint64 sample_count = 1; + * @return Whether the sampleCount field is set. + */ + @java.lang.Override + public boolean hasSampleCount() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional uint64 sample_count = 1; + * @return The sampleCount. + */ + @java.lang.Override + public long getSampleCount() { + return sampleCount_; + } + /** + * optional uint64 sample_count = 1; + * @param value The sampleCount to set. + * @return This builder for chaining. + */ + public Builder setSampleCount(long value) { + + sampleCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional uint64 sample_count = 1; + * @return This builder for chaining. + */ + public Builder clearSampleCount() { + bitField0_ = (bitField0_ & ~0x00000001); + sampleCount_ = 0L; + onChanged(); + return this; + } + + private double sampleSum_ ; + /** + * optional double sample_sum = 2; + * @return Whether the sampleSum field is set. + */ + @java.lang.Override + public boolean hasSampleSum() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional double sample_sum = 2; + * @return The sampleSum. + */ + @java.lang.Override + public double getSampleSum() { + return sampleSum_; + } + /** + * optional double sample_sum = 2; + * @param value The sampleSum to set. + * @return This builder for chaining. + */ + public Builder setSampleSum(double value) { + + sampleSum_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * optional double sample_sum = 2; + * @return This builder for chaining. + */ + public Builder clearSampleSum() { + bitField0_ = (bitField0_ & ~0x00000002); + sampleSum_ = 0D; + onChanged(); + return this; + } + + private java.util.List quantile_ = + java.util.Collections.emptyList(); + private void ensureQuantileIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + quantile_ = new java.util.ArrayList(quantile_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.QuantileOrBuilder> quantileBuilder_; + + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + public java.util.List getQuantileList() { + if (quantileBuilder_ == null) { + return java.util.Collections.unmodifiableList(quantile_); + } else { + return quantileBuilder_.getMessageList(); + } + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + public int getQuantileCount() { + if (quantileBuilder_ == null) { + return quantile_.size(); + } else { + return quantileBuilder_.getCount(); + } + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile getQuantile(int index) { + if (quantileBuilder_ == null) { + return quantile_.get(index); + } else { + return quantileBuilder_.getMessage(index); + } + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + public Builder setQuantile( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile value) { + if (quantileBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuantileIsMutable(); + quantile_.set(index, value); + onChanged(); + } else { + quantileBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + public Builder setQuantile( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.Builder builderForValue) { + if (quantileBuilder_ == null) { + ensureQuantileIsMutable(); + quantile_.set(index, builderForValue.build()); + onChanged(); + } else { + quantileBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + public Builder addQuantile(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile value) { + if (quantileBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuantileIsMutable(); + quantile_.add(value); + onChanged(); + } else { + quantileBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + public Builder addQuantile( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile value) { + if (quantileBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuantileIsMutable(); + quantile_.add(index, value); + onChanged(); + } else { + quantileBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + public Builder addQuantile( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.Builder builderForValue) { + if (quantileBuilder_ == null) { + ensureQuantileIsMutable(); + quantile_.add(builderForValue.build()); + onChanged(); + } else { + quantileBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + public Builder addQuantile( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.Builder builderForValue) { + if (quantileBuilder_ == null) { + ensureQuantileIsMutable(); + quantile_.add(index, builderForValue.build()); + onChanged(); + } else { + quantileBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + public Builder addAllQuantile( + java.lang.Iterable values) { + if (quantileBuilder_ == null) { + ensureQuantileIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, quantile_); + onChanged(); + } else { + quantileBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + public Builder clearQuantile() { + if (quantileBuilder_ == null) { + quantile_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + quantileBuilder_.clear(); + } + return this; + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + public Builder removeQuantile(int index) { + if (quantileBuilder_ == null) { + ensureQuantileIsMutable(); + quantile_.remove(index); + onChanged(); + } else { + quantileBuilder_.remove(index); + } + return this; + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.Builder getQuantileBuilder( + int index) { + return internalGetQuantileFieldBuilder().getBuilder(index); + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.QuantileOrBuilder getQuantileOrBuilder( + int index) { + if (quantileBuilder_ == null) { + return quantile_.get(index); } else { + return quantileBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + public java.util.List + getQuantileOrBuilderList() { + if (quantileBuilder_ != null) { + return quantileBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(quantile_); + } + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.Builder addQuantileBuilder() { + return internalGetQuantileFieldBuilder().addBuilder( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.getDefaultInstance()); + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.Builder addQuantileBuilder( + int index) { + return internalGetQuantileFieldBuilder().addBuilder( + index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.getDefaultInstance()); + } + /** + * repeated .io.prometheus.client.Quantile quantile = 3; + */ + public java.util.List + getQuantileBuilderList() { + return internalGetQuantileFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.QuantileOrBuilder> + internalGetQuantileFieldBuilder() { + if (quantileBuilder_ == null) { + quantileBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Quantile.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.QuantileOrBuilder>( + quantile_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + quantile_ = null; + } + return quantileBuilder_; + } + + private com.google.protobuf.Timestamp createdTimestamp_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createdTimestampBuilder_; + /** + * optional .google.protobuf.Timestamp created_timestamp = 4; + * @return Whether the createdTimestamp field is set. + */ + public boolean hasCreatedTimestamp() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 4; + * @return The createdTimestamp. + */ + public com.google.protobuf.Timestamp getCreatedTimestamp() { + if (createdTimestampBuilder_ == null) { + return createdTimestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createdTimestamp_; + } else { + return createdTimestampBuilder_.getMessage(); + } + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 4; + */ + public Builder setCreatedTimestamp(com.google.protobuf.Timestamp value) { + if (createdTimestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createdTimestamp_ = value; + } else { + createdTimestampBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 4; + */ + public Builder setCreatedTimestamp( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (createdTimestampBuilder_ == null) { + createdTimestamp_ = builderForValue.build(); + } else { + createdTimestampBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 4; + */ + public Builder mergeCreatedTimestamp(com.google.protobuf.Timestamp value) { + if (createdTimestampBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + createdTimestamp_ != null && + createdTimestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreatedTimestampBuilder().mergeFrom(value); + } else { + createdTimestamp_ = value; + } + } else { + createdTimestampBuilder_.mergeFrom(value); + } + if (createdTimestamp_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 4; + */ + public Builder clearCreatedTimestamp() { + bitField0_ = (bitField0_ & ~0x00000008); + createdTimestamp_ = null; + if (createdTimestampBuilder_ != null) { + createdTimestampBuilder_.dispose(); + createdTimestampBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 4; + */ + public com.google.protobuf.Timestamp.Builder getCreatedTimestampBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetCreatedTimestampFieldBuilder().getBuilder(); + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 4; + */ + public com.google.protobuf.TimestampOrBuilder getCreatedTimestampOrBuilder() { + if (createdTimestampBuilder_ != null) { + return createdTimestampBuilder_.getMessageOrBuilder(); + } else { + return createdTimestamp_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : createdTimestamp_; + } + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + internalGetCreatedTimestampFieldBuilder() { + if (createdTimestampBuilder_ == null) { + createdTimestampBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getCreatedTimestamp(), + getParentForChildren(), + isClean()); + createdTimestamp_ = null; + } + return createdTimestampBuilder_; + } + + // @@protoc_insertion_point(builder_scope:io.prometheus.client.Summary) + } + + // @@protoc_insertion_point(class_scope:io.prometheus.client.Summary) + private static final io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary(); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Summary parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface UntypedOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.prometheus.client.Untyped) + com.google.protobuf.MessageOrBuilder { + + /** + * optional double value = 1; + * @return Whether the value field is set. + */ + boolean hasValue(); + /** + * optional double value = 1; + * @return The value. + */ + double getValue(); + } + /** + * Protobuf type {@code io.prometheus.client.Untyped} + */ + public static final class Untyped extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:io.prometheus.client.Untyped) + UntypedOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 4, + /* suffix= */ "", + "Untyped"); + } + // Use Untyped.newBuilder() to construct. + private Untyped(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Untyped() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Untyped_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Untyped_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped.Builder.class); + } + + private int bitField0_; + public static final int VALUE_FIELD_NUMBER = 1; + private double value_ = 0D; + /** + * optional double value = 1; + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional double value = 1; + * @return The value. + */ + @java.lang.Override + public double getValue() { + return value_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeDouble(1, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(1, value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped)) { + return super.equals(obj); + } + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped other = (io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped) obj; + + if (hasValue() != other.hasValue()) return false; + if (hasValue()) { + if (java.lang.Double.doubleToLongBits(getValue()) + != java.lang.Double.doubleToLongBits( + other.getValue())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasValue()) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getValue())); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code io.prometheus.client.Untyped} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:io.prometheus.client.Untyped) + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.UntypedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Untyped_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Untyped_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped.Builder.class); + } + + // Construct using io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Untyped_descriptor; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped getDefaultInstanceForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped.getDefaultInstance(); + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped build() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped buildPartial() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped result = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.value_ = value_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped) { + return mergeFrom((io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped other) { + if (other == io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped.getDefaultInstance()) return this; + if (other.hasValue()) { + setValue(other.getValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + value_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private double value_ ; + /** + * optional double value = 1; + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional double value = 1; + * @return The value. + */ + @java.lang.Override + public double getValue() { + return value_; + } + /** + * optional double value = 1; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(double value) { + + value_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional double value = 1; + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000001); + value_ = 0D; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:io.prometheus.client.Untyped) + } + + // @@protoc_insertion_point(class_scope:io.prometheus.client.Untyped) + private static final io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped(); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Untyped parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface HistogramOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.prometheus.client.Histogram) + com.google.protobuf.MessageOrBuilder { + + /** + * optional uint64 sample_count = 1; + * @return Whether the sampleCount field is set. + */ + boolean hasSampleCount(); + /** + * optional uint64 sample_count = 1; + * @return The sampleCount. + */ + long getSampleCount(); + + /** + *
    +     * Overrides sample_count if > 0.
    +     * 
    + * + * optional double sample_count_float = 4; + * @return Whether the sampleCountFloat field is set. + */ + boolean hasSampleCountFloat(); + /** + *
    +     * Overrides sample_count if > 0.
    +     * 
    + * + * optional double sample_count_float = 4; + * @return The sampleCountFloat. + */ + double getSampleCountFloat(); + + /** + * optional double sample_sum = 2; + * @return Whether the sampleSum field is set. + */ + boolean hasSampleSum(); + /** + * optional double sample_sum = 2; + * @return The sampleSum. + */ + double getSampleSum(); + + /** + *
    +     * Buckets for the conventional histogram.
    +     * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + java.util.List + getBucketList(); + /** + *
    +     * Buckets for the conventional histogram.
    +     * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket getBucket(int index); + /** + *
    +     * Buckets for the conventional histogram.
    +     * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + int getBucketCount(); + /** + *
    +     * Buckets for the conventional histogram.
    +     * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + java.util.List + getBucketOrBuilderList(); + /** + *
    +     * Buckets for the conventional histogram.
    +     * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketOrBuilder getBucketOrBuilder( + int index); + + /** + * optional .google.protobuf.Timestamp created_timestamp = 15; + * @return Whether the createdTimestamp field is set. + */ + boolean hasCreatedTimestamp(); + /** + * optional .google.protobuf.Timestamp created_timestamp = 15; + * @return The createdTimestamp. + */ + com.google.protobuf.Timestamp getCreatedTimestamp(); + /** + * optional .google.protobuf.Timestamp created_timestamp = 15; + */ + com.google.protobuf.TimestampOrBuilder getCreatedTimestampOrBuilder(); + + /** + *
    +     * schema defines the bucket schema. Currently, valid numbers are -4 <= n <= 8.
    +     * They are all for base-2 bucket schemas, where 1 is a bucket boundary in each case, and
    +     * then each power of two is divided into 2^n logarithmic buckets.
    +     * Or in other words, each bucket boundary is the previous boundary times 2^(2^-n).
    +     * In the future, more bucket schemas may be added using numbers < -4 or > 8.
    +     * 
    + * + * optional sint32 schema = 5; + * @return Whether the schema field is set. + */ + boolean hasSchema(); + /** + *
    +     * schema defines the bucket schema. Currently, valid numbers are -4 <= n <= 8.
    +     * They are all for base-2 bucket schemas, where 1 is a bucket boundary in each case, and
    +     * then each power of two is divided into 2^n logarithmic buckets.
    +     * Or in other words, each bucket boundary is the previous boundary times 2^(2^-n).
    +     * In the future, more bucket schemas may be added using numbers < -4 or > 8.
    +     * 
    + * + * optional sint32 schema = 5; + * @return The schema. + */ + int getSchema(); + + /** + *
    +     * Breadth of the zero bucket.
    +     * 
    + * + * optional double zero_threshold = 6; + * @return Whether the zeroThreshold field is set. + */ + boolean hasZeroThreshold(); + /** + *
    +     * Breadth of the zero bucket.
    +     * 
    + * + * optional double zero_threshold = 6; + * @return The zeroThreshold. + */ + double getZeroThreshold(); + + /** + *
    +     * Count in zero bucket.
    +     * 
    + * + * optional uint64 zero_count = 7; + * @return Whether the zeroCount field is set. + */ + boolean hasZeroCount(); + /** + *
    +     * Count in zero bucket.
    +     * 
    + * + * optional uint64 zero_count = 7; + * @return The zeroCount. + */ + long getZeroCount(); + + /** + *
    +     * Overrides sb_zero_count if > 0.
    +     * 
    + * + * optional double zero_count_float = 8; + * @return Whether the zeroCountFloat field is set. + */ + boolean hasZeroCountFloat(); + /** + *
    +     * Overrides sb_zero_count if > 0.
    +     * 
    + * + * optional double zero_count_float = 8; + * @return The zeroCountFloat. + */ + double getZeroCountFloat(); + + /** + *
    +     * Negative buckets for the native histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + java.util.List + getNegativeSpanList(); + /** + *
    +     * Negative buckets for the native histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan getNegativeSpan(int index); + /** + *
    +     * Negative buckets for the native histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + int getNegativeSpanCount(); + /** + *
    +     * Negative buckets for the native histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + java.util.List + getNegativeSpanOrBuilderList(); + /** + *
    +     * Negative buckets for the native histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpanOrBuilder getNegativeSpanOrBuilder( + int index); + + /** + *
    +     * Use either "negative_delta" or "negative_count", the former for
    +     * regular histograms with integer counts, the latter for float
    +     * histograms.
    +     * 
    + * + * repeated sint64 negative_delta = 10; + * @return A list containing the negativeDelta. + */ + java.util.List getNegativeDeltaList(); + /** + *
    +     * Use either "negative_delta" or "negative_count", the former for
    +     * regular histograms with integer counts, the latter for float
    +     * histograms.
    +     * 
    + * + * repeated sint64 negative_delta = 10; + * @return The count of negativeDelta. + */ + int getNegativeDeltaCount(); + /** + *
    +     * Use either "negative_delta" or "negative_count", the former for
    +     * regular histograms with integer counts, the latter for float
    +     * histograms.
    +     * 
    + * + * repeated sint64 negative_delta = 10; + * @param index The index of the element to return. + * @return The negativeDelta at the given index. + */ + long getNegativeDelta(int index); + + /** + *
    +     * Absolute count of each bucket.
    +     * 
    + * + * repeated double negative_count = 11; + * @return A list containing the negativeCount. + */ + java.util.List getNegativeCountList(); + /** + *
    +     * Absolute count of each bucket.
    +     * 
    + * + * repeated double negative_count = 11; + * @return The count of negativeCount. + */ + int getNegativeCountCount(); + /** + *
    +     * Absolute count of each bucket.
    +     * 
    + * + * repeated double negative_count = 11; + * @param index The index of the element to return. + * @return The negativeCount at the given index. + */ + double getNegativeCount(int index); + + /** + *
    +     * Positive buckets for the native histogram.
    +     * Use a no-op span (offset 0, length 0) for a native histogram without any
    +     * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +     * indistinguishable from a classic histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + java.util.List + getPositiveSpanList(); + /** + *
    +     * Positive buckets for the native histogram.
    +     * Use a no-op span (offset 0, length 0) for a native histogram without any
    +     * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +     * indistinguishable from a classic histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan getPositiveSpan(int index); + /** + *
    +     * Positive buckets for the native histogram.
    +     * Use a no-op span (offset 0, length 0) for a native histogram without any
    +     * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +     * indistinguishable from a classic histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + int getPositiveSpanCount(); + /** + *
    +     * Positive buckets for the native histogram.
    +     * Use a no-op span (offset 0, length 0) for a native histogram without any
    +     * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +     * indistinguishable from a classic histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + java.util.List + getPositiveSpanOrBuilderList(); + /** + *
    +     * Positive buckets for the native histogram.
    +     * Use a no-op span (offset 0, length 0) for a native histogram without any
    +     * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +     * indistinguishable from a classic histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpanOrBuilder getPositiveSpanOrBuilder( + int index); + + /** + *
    +     * Use either "positive_delta" or "positive_count", the former for
    +     * regular histograms with integer counts, the latter for float
    +     * histograms.
    +     * 
    + * + * repeated sint64 positive_delta = 13; + * @return A list containing the positiveDelta. + */ + java.util.List getPositiveDeltaList(); + /** + *
    +     * Use either "positive_delta" or "positive_count", the former for
    +     * regular histograms with integer counts, the latter for float
    +     * histograms.
    +     * 
    + * + * repeated sint64 positive_delta = 13; + * @return The count of positiveDelta. + */ + int getPositiveDeltaCount(); + /** + *
    +     * Use either "positive_delta" or "positive_count", the former for
    +     * regular histograms with integer counts, the latter for float
    +     * histograms.
    +     * 
    + * + * repeated sint64 positive_delta = 13; + * @param index The index of the element to return. + * @return The positiveDelta at the given index. + */ + long getPositiveDelta(int index); + + /** + *
    +     * Absolute count of each bucket.
    +     * 
    + * + * repeated double positive_count = 14; + * @return A list containing the positiveCount. + */ + java.util.List getPositiveCountList(); + /** + *
    +     * Absolute count of each bucket.
    +     * 
    + * + * repeated double positive_count = 14; + * @return The count of positiveCount. + */ + int getPositiveCountCount(); + /** + *
    +     * Absolute count of each bucket.
    +     * 
    + * + * repeated double positive_count = 14; + * @param index The index of the element to return. + * @return The positiveCount at the given index. + */ + double getPositiveCount(int index); + + /** + *
    +     * Only used for native histograms. These exemplars MUST have a timestamp.
    +     * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + java.util.List + getExemplarsList(); + /** + *
    +     * Only used for native histograms. These exemplars MUST have a timestamp.
    +     * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar getExemplars(int index); + /** + *
    +     * Only used for native histograms. These exemplars MUST have a timestamp.
    +     * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + int getExemplarsCount(); + /** + *
    +     * Only used for native histograms. These exemplars MUST have a timestamp.
    +     * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + java.util.List + getExemplarsOrBuilderList(); + /** + *
    +     * Only used for native histograms. These exemplars MUST have a timestamp.
    +     * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder getExemplarsOrBuilder( + int index); + } + /** + * Protobuf type {@code io.prometheus.client.Histogram} + */ + public static final class Histogram extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:io.prometheus.client.Histogram) + HistogramOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 4, + /* suffix= */ "", + "Histogram"); + } + // Use Histogram.newBuilder() to construct. + private Histogram(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Histogram() { + bucket_ = java.util.Collections.emptyList(); + negativeSpan_ = java.util.Collections.emptyList(); + negativeDelta_ = emptyLongList(); + negativeCount_ = emptyDoubleList(); + positiveSpan_ = java.util.Collections.emptyList(); + positiveDelta_ = emptyLongList(); + positiveCount_ = emptyDoubleList(); + exemplars_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Histogram_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Histogram_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram.Builder.class); + } + + private int bitField0_; + public static final int SAMPLE_COUNT_FIELD_NUMBER = 1; + private long sampleCount_ = 0L; + /** + * optional uint64 sample_count = 1; + * @return Whether the sampleCount field is set. + */ + @java.lang.Override + public boolean hasSampleCount() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional uint64 sample_count = 1; + * @return The sampleCount. + */ + @java.lang.Override + public long getSampleCount() { + return sampleCount_; + } + + public static final int SAMPLE_COUNT_FLOAT_FIELD_NUMBER = 4; + private double sampleCountFloat_ = 0D; + /** + *
    +     * Overrides sample_count if > 0.
    +     * 
    + * + * optional double sample_count_float = 4; + * @return Whether the sampleCountFloat field is set. + */ + @java.lang.Override + public boolean hasSampleCountFloat() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * Overrides sample_count if > 0.
    +     * 
    + * + * optional double sample_count_float = 4; + * @return The sampleCountFloat. + */ + @java.lang.Override + public double getSampleCountFloat() { + return sampleCountFloat_; + } + + public static final int SAMPLE_SUM_FIELD_NUMBER = 2; + private double sampleSum_ = 0D; + /** + * optional double sample_sum = 2; + * @return Whether the sampleSum field is set. + */ + @java.lang.Override + public boolean hasSampleSum() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional double sample_sum = 2; + * @return The sampleSum. + */ + @java.lang.Override + public double getSampleSum() { + return sampleSum_; + } + + public static final int BUCKET_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List bucket_; + /** + *
    +     * Buckets for the conventional histogram.
    +     * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + @java.lang.Override + public java.util.List getBucketList() { + return bucket_; + } + /** + *
    +     * Buckets for the conventional histogram.
    +     * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + @java.lang.Override + public java.util.List + getBucketOrBuilderList() { + return bucket_; + } + /** + *
    +     * Buckets for the conventional histogram.
    +     * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + @java.lang.Override + public int getBucketCount() { + return bucket_.size(); + } + /** + *
    +     * Buckets for the conventional histogram.
    +     * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket getBucket(int index) { + return bucket_.get(index); + } + /** + *
    +     * Buckets for the conventional histogram.
    +     * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketOrBuilder getBucketOrBuilder( + int index) { + return bucket_.get(index); + } + + public static final int CREATED_TIMESTAMP_FIELD_NUMBER = 15; + private com.google.protobuf.Timestamp createdTimestamp_; + /** + * optional .google.protobuf.Timestamp created_timestamp = 15; + * @return Whether the createdTimestamp field is set. + */ + @java.lang.Override + public boolean hasCreatedTimestamp() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 15; + * @return The createdTimestamp. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreatedTimestamp() { + return createdTimestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createdTimestamp_; + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 15; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreatedTimestampOrBuilder() { + return createdTimestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createdTimestamp_; + } + + public static final int SCHEMA_FIELD_NUMBER = 5; + private int schema_ = 0; + /** + *
    +     * schema defines the bucket schema. Currently, valid numbers are -4 <= n <= 8.
    +     * They are all for base-2 bucket schemas, where 1 is a bucket boundary in each case, and
    +     * then each power of two is divided into 2^n logarithmic buckets.
    +     * Or in other words, each bucket boundary is the previous boundary times 2^(2^-n).
    +     * In the future, more bucket schemas may be added using numbers < -4 or > 8.
    +     * 
    + * + * optional sint32 schema = 5; + * @return Whether the schema field is set. + */ + @java.lang.Override + public boolean hasSchema() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
    +     * schema defines the bucket schema. Currently, valid numbers are -4 <= n <= 8.
    +     * They are all for base-2 bucket schemas, where 1 is a bucket boundary in each case, and
    +     * then each power of two is divided into 2^n logarithmic buckets.
    +     * Or in other words, each bucket boundary is the previous boundary times 2^(2^-n).
    +     * In the future, more bucket schemas may be added using numbers < -4 or > 8.
    +     * 
    + * + * optional sint32 schema = 5; + * @return The schema. + */ + @java.lang.Override + public int getSchema() { + return schema_; + } + + public static final int ZERO_THRESHOLD_FIELD_NUMBER = 6; + private double zeroThreshold_ = 0D; + /** + *
    +     * Breadth of the zero bucket.
    +     * 
    + * + * optional double zero_threshold = 6; + * @return Whether the zeroThreshold field is set. + */ + @java.lang.Override + public boolean hasZeroThreshold() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + *
    +     * Breadth of the zero bucket.
    +     * 
    + * + * optional double zero_threshold = 6; + * @return The zeroThreshold. + */ + @java.lang.Override + public double getZeroThreshold() { + return zeroThreshold_; + } + + public static final int ZERO_COUNT_FIELD_NUMBER = 7; + private long zeroCount_ = 0L; + /** + *
    +     * Count in zero bucket.
    +     * 
    + * + * optional uint64 zero_count = 7; + * @return Whether the zeroCount field is set. + */ + @java.lang.Override + public boolean hasZeroCount() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + *
    +     * Count in zero bucket.
    +     * 
    + * + * optional uint64 zero_count = 7; + * @return The zeroCount. + */ + @java.lang.Override + public long getZeroCount() { + return zeroCount_; + } + + public static final int ZERO_COUNT_FLOAT_FIELD_NUMBER = 8; + private double zeroCountFloat_ = 0D; + /** + *
    +     * Overrides sb_zero_count if > 0.
    +     * 
    + * + * optional double zero_count_float = 8; + * @return Whether the zeroCountFloat field is set. + */ + @java.lang.Override + public boolean hasZeroCountFloat() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + *
    +     * Overrides sb_zero_count if > 0.
    +     * 
    + * + * optional double zero_count_float = 8; + * @return The zeroCountFloat. + */ + @java.lang.Override + public double getZeroCountFloat() { + return zeroCountFloat_; + } + + public static final int NEGATIVE_SPAN_FIELD_NUMBER = 9; + @SuppressWarnings("serial") + private java.util.List negativeSpan_; + /** + *
    +     * Negative buckets for the native histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + @java.lang.Override + public java.util.List getNegativeSpanList() { + return negativeSpan_; + } + /** + *
    +     * Negative buckets for the native histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + @java.lang.Override + public java.util.List + getNegativeSpanOrBuilderList() { + return negativeSpan_; + } + /** + *
    +     * Negative buckets for the native histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + @java.lang.Override + public int getNegativeSpanCount() { + return negativeSpan_.size(); + } + /** + *
    +     * Negative buckets for the native histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan getNegativeSpan(int index) { + return negativeSpan_.get(index); + } + /** + *
    +     * Negative buckets for the native histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpanOrBuilder getNegativeSpanOrBuilder( + int index) { + return negativeSpan_.get(index); + } + + public static final int NEGATIVE_DELTA_FIELD_NUMBER = 10; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList negativeDelta_ = + emptyLongList(); + /** + *
    +     * Use either "negative_delta" or "negative_count", the former for
    +     * regular histograms with integer counts, the latter for float
    +     * histograms.
    +     * 
    + * + * repeated sint64 negative_delta = 10; + * @return A list containing the negativeDelta. + */ + @java.lang.Override + public java.util.List + getNegativeDeltaList() { + return negativeDelta_; + } + /** + *
    +     * Use either "negative_delta" or "negative_count", the former for
    +     * regular histograms with integer counts, the latter for float
    +     * histograms.
    +     * 
    + * + * repeated sint64 negative_delta = 10; + * @return The count of negativeDelta. + */ + public int getNegativeDeltaCount() { + return negativeDelta_.size(); + } + /** + *
    +     * Use either "negative_delta" or "negative_count", the former for
    +     * regular histograms with integer counts, the latter for float
    +     * histograms.
    +     * 
    + * + * repeated sint64 negative_delta = 10; + * @param index The index of the element to return. + * @return The negativeDelta at the given index. + */ + public long getNegativeDelta(int index) { + return negativeDelta_.getLong(index); + } + + public static final int NEGATIVE_COUNT_FIELD_NUMBER = 11; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.DoubleList negativeCount_ = + emptyDoubleList(); + /** + *
    +     * Absolute count of each bucket.
    +     * 
    + * + * repeated double negative_count = 11; + * @return A list containing the negativeCount. + */ + @java.lang.Override + public java.util.List + getNegativeCountList() { + return negativeCount_; + } + /** + *
    +     * Absolute count of each bucket.
    +     * 
    + * + * repeated double negative_count = 11; + * @return The count of negativeCount. + */ + public int getNegativeCountCount() { + return negativeCount_.size(); + } + /** + *
    +     * Absolute count of each bucket.
    +     * 
    + * + * repeated double negative_count = 11; + * @param index The index of the element to return. + * @return The negativeCount at the given index. + */ + public double getNegativeCount(int index) { + return negativeCount_.getDouble(index); + } + + public static final int POSITIVE_SPAN_FIELD_NUMBER = 12; + @SuppressWarnings("serial") + private java.util.List positiveSpan_; + /** + *
    +     * Positive buckets for the native histogram.
    +     * Use a no-op span (offset 0, length 0) for a native histogram without any
    +     * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +     * indistinguishable from a classic histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + @java.lang.Override + public java.util.List getPositiveSpanList() { + return positiveSpan_; + } + /** + *
    +     * Positive buckets for the native histogram.
    +     * Use a no-op span (offset 0, length 0) for a native histogram without any
    +     * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +     * indistinguishable from a classic histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + @java.lang.Override + public java.util.List + getPositiveSpanOrBuilderList() { + return positiveSpan_; + } + /** + *
    +     * Positive buckets for the native histogram.
    +     * Use a no-op span (offset 0, length 0) for a native histogram without any
    +     * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +     * indistinguishable from a classic histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + @java.lang.Override + public int getPositiveSpanCount() { + return positiveSpan_.size(); + } + /** + *
    +     * Positive buckets for the native histogram.
    +     * Use a no-op span (offset 0, length 0) for a native histogram without any
    +     * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +     * indistinguishable from a classic histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan getPositiveSpan(int index) { + return positiveSpan_.get(index); + } + /** + *
    +     * Positive buckets for the native histogram.
    +     * Use a no-op span (offset 0, length 0) for a native histogram without any
    +     * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +     * indistinguishable from a classic histogram.
    +     * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpanOrBuilder getPositiveSpanOrBuilder( + int index) { + return positiveSpan_.get(index); + } + + public static final int POSITIVE_DELTA_FIELD_NUMBER = 13; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList positiveDelta_ = + emptyLongList(); + /** + *
    +     * Use either "positive_delta" or "positive_count", the former for
    +     * regular histograms with integer counts, the latter for float
    +     * histograms.
    +     * 
    + * + * repeated sint64 positive_delta = 13; + * @return A list containing the positiveDelta. + */ + @java.lang.Override + public java.util.List + getPositiveDeltaList() { + return positiveDelta_; + } + /** + *
    +     * Use either "positive_delta" or "positive_count", the former for
    +     * regular histograms with integer counts, the latter for float
    +     * histograms.
    +     * 
    + * + * repeated sint64 positive_delta = 13; + * @return The count of positiveDelta. + */ + public int getPositiveDeltaCount() { + return positiveDelta_.size(); + } + /** + *
    +     * Use either "positive_delta" or "positive_count", the former for
    +     * regular histograms with integer counts, the latter for float
    +     * histograms.
    +     * 
    + * + * repeated sint64 positive_delta = 13; + * @param index The index of the element to return. + * @return The positiveDelta at the given index. + */ + public long getPositiveDelta(int index) { + return positiveDelta_.getLong(index); + } + + public static final int POSITIVE_COUNT_FIELD_NUMBER = 14; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.DoubleList positiveCount_ = + emptyDoubleList(); + /** + *
    +     * Absolute count of each bucket.
    +     * 
    + * + * repeated double positive_count = 14; + * @return A list containing the positiveCount. + */ + @java.lang.Override + public java.util.List + getPositiveCountList() { + return positiveCount_; + } + /** + *
    +     * Absolute count of each bucket.
    +     * 
    + * + * repeated double positive_count = 14; + * @return The count of positiveCount. + */ + public int getPositiveCountCount() { + return positiveCount_.size(); + } + /** + *
    +     * Absolute count of each bucket.
    +     * 
    + * + * repeated double positive_count = 14; + * @param index The index of the element to return. + * @return The positiveCount at the given index. + */ + public double getPositiveCount(int index) { + return positiveCount_.getDouble(index); + } + + public static final int EXEMPLARS_FIELD_NUMBER = 16; + @SuppressWarnings("serial") + private java.util.List exemplars_; + /** + *
    +     * Only used for native histograms. These exemplars MUST have a timestamp.
    +     * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + @java.lang.Override + public java.util.List getExemplarsList() { + return exemplars_; + } + /** + *
    +     * Only used for native histograms. These exemplars MUST have a timestamp.
    +     * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + @java.lang.Override + public java.util.List + getExemplarsOrBuilderList() { + return exemplars_; + } + /** + *
    +     * Only used for native histograms. These exemplars MUST have a timestamp.
    +     * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + @java.lang.Override + public int getExemplarsCount() { + return exemplars_.size(); + } + /** + *
    +     * Only used for native histograms. These exemplars MUST have a timestamp.
    +     * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar getExemplars(int index) { + return exemplars_.get(index); + } + /** + *
    +     * Only used for native histograms. These exemplars MUST have a timestamp.
    +     * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder getExemplarsOrBuilder( + int index) { + return exemplars_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeUInt64(1, sampleCount_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeDouble(2, sampleSum_); + } + for (int i = 0; i < bucket_.size(); i++) { + output.writeMessage(3, bucket_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeDouble(4, sampleCountFloat_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeSInt32(5, schema_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeDouble(6, zeroThreshold_); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeUInt64(7, zeroCount_); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeDouble(8, zeroCountFloat_); + } + for (int i = 0; i < negativeSpan_.size(); i++) { + output.writeMessage(9, negativeSpan_.get(i)); + } + for (int i = 0; i < negativeDelta_.size(); i++) { + output.writeSInt64(10, negativeDelta_.getLong(i)); + } + for (int i = 0; i < negativeCount_.size(); i++) { + output.writeDouble(11, negativeCount_.getDouble(i)); + } + for (int i = 0; i < positiveSpan_.size(); i++) { + output.writeMessage(12, positiveSpan_.get(i)); + } + for (int i = 0; i < positiveDelta_.size(); i++) { + output.writeSInt64(13, positiveDelta_.getLong(i)); + } + for (int i = 0; i < positiveCount_.size(); i++) { + output.writeDouble(14, positiveCount_.getDouble(i)); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(15, getCreatedTimestamp()); + } + for (int i = 0; i < exemplars_.size(); i++) { + output.writeMessage(16, exemplars_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, sampleCount_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(2, sampleSum_); + } + for (int i = 0; i < bucket_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, bucket_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(4, sampleCountFloat_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeSInt32Size(5, schema_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(6, zeroThreshold_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(7, zeroCount_); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(8, zeroCountFloat_); + } + for (int i = 0; i < negativeSpan_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, negativeSpan_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < negativeDelta_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeSInt64SizeNoTag(negativeDelta_.getLong(i)); + } + size += dataSize; + size += 1 * getNegativeDeltaList().size(); + } + { + int dataSize = 0; + dataSize = 8 * getNegativeCountList().size(); + size += dataSize; + size += 1 * getNegativeCountList().size(); + } + for (int i = 0; i < positiveSpan_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(12, positiveSpan_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < positiveDelta_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeSInt64SizeNoTag(positiveDelta_.getLong(i)); + } + size += dataSize; + size += 1 * getPositiveDeltaList().size(); + } + { + int dataSize = 0; + dataSize = 8 * getPositiveCountList().size(); + size += dataSize; + size += 1 * getPositiveCountList().size(); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(15, getCreatedTimestamp()); + } + for (int i = 0; i < exemplars_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(16, exemplars_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram)) { + return super.equals(obj); + } + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram other = (io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram) obj; + + if (hasSampleCount() != other.hasSampleCount()) return false; + if (hasSampleCount()) { + if (getSampleCount() + != other.getSampleCount()) return false; + } + if (hasSampleCountFloat() != other.hasSampleCountFloat()) return false; + if (hasSampleCountFloat()) { + if (java.lang.Double.doubleToLongBits(getSampleCountFloat()) + != java.lang.Double.doubleToLongBits( + other.getSampleCountFloat())) return false; + } + if (hasSampleSum() != other.hasSampleSum()) return false; + if (hasSampleSum()) { + if (java.lang.Double.doubleToLongBits(getSampleSum()) + != java.lang.Double.doubleToLongBits( + other.getSampleSum())) return false; + } + if (!getBucketList() + .equals(other.getBucketList())) return false; + if (hasCreatedTimestamp() != other.hasCreatedTimestamp()) return false; + if (hasCreatedTimestamp()) { + if (!getCreatedTimestamp() + .equals(other.getCreatedTimestamp())) return false; + } + if (hasSchema() != other.hasSchema()) return false; + if (hasSchema()) { + if (getSchema() + != other.getSchema()) return false; + } + if (hasZeroThreshold() != other.hasZeroThreshold()) return false; + if (hasZeroThreshold()) { + if (java.lang.Double.doubleToLongBits(getZeroThreshold()) + != java.lang.Double.doubleToLongBits( + other.getZeroThreshold())) return false; + } + if (hasZeroCount() != other.hasZeroCount()) return false; + if (hasZeroCount()) { + if (getZeroCount() + != other.getZeroCount()) return false; + } + if (hasZeroCountFloat() != other.hasZeroCountFloat()) return false; + if (hasZeroCountFloat()) { + if (java.lang.Double.doubleToLongBits(getZeroCountFloat()) + != java.lang.Double.doubleToLongBits( + other.getZeroCountFloat())) return false; + } + if (!getNegativeSpanList() + .equals(other.getNegativeSpanList())) return false; + if (!getNegativeDeltaList() + .equals(other.getNegativeDeltaList())) return false; + if (!getNegativeCountList() + .equals(other.getNegativeCountList())) return false; + if (!getPositiveSpanList() + .equals(other.getPositiveSpanList())) return false; + if (!getPositiveDeltaList() + .equals(other.getPositiveDeltaList())) return false; + if (!getPositiveCountList() + .equals(other.getPositiveCountList())) return false; + if (!getExemplarsList() + .equals(other.getExemplarsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSampleCount()) { + hash = (37 * hash) + SAMPLE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSampleCount()); + } + if (hasSampleCountFloat()) { + hash = (37 * hash) + SAMPLE_COUNT_FLOAT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getSampleCountFloat())); + } + if (hasSampleSum()) { + hash = (37 * hash) + SAMPLE_SUM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getSampleSum())); + } + if (getBucketCount() > 0) { + hash = (37 * hash) + BUCKET_FIELD_NUMBER; + hash = (53 * hash) + getBucketList().hashCode(); + } + if (hasCreatedTimestamp()) { + hash = (37 * hash) + CREATED_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getCreatedTimestamp().hashCode(); + } + if (hasSchema()) { + hash = (37 * hash) + SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getSchema(); + } + if (hasZeroThreshold()) { + hash = (37 * hash) + ZERO_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getZeroThreshold())); + } + if (hasZeroCount()) { + hash = (37 * hash) + ZERO_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getZeroCount()); + } + if (hasZeroCountFloat()) { + hash = (37 * hash) + ZERO_COUNT_FLOAT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getZeroCountFloat())); + } + if (getNegativeSpanCount() > 0) { + hash = (37 * hash) + NEGATIVE_SPAN_FIELD_NUMBER; + hash = (53 * hash) + getNegativeSpanList().hashCode(); + } + if (getNegativeDeltaCount() > 0) { + hash = (37 * hash) + NEGATIVE_DELTA_FIELD_NUMBER; + hash = (53 * hash) + getNegativeDeltaList().hashCode(); + } + if (getNegativeCountCount() > 0) { + hash = (37 * hash) + NEGATIVE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getNegativeCountList().hashCode(); + } + if (getPositiveSpanCount() > 0) { + hash = (37 * hash) + POSITIVE_SPAN_FIELD_NUMBER; + hash = (53 * hash) + getPositiveSpanList().hashCode(); + } + if (getPositiveDeltaCount() > 0) { + hash = (37 * hash) + POSITIVE_DELTA_FIELD_NUMBER; + hash = (53 * hash) + getPositiveDeltaList().hashCode(); + } + if (getPositiveCountCount() > 0) { + hash = (37 * hash) + POSITIVE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getPositiveCountList().hashCode(); + } + if (getExemplarsCount() > 0) { + hash = (37 * hash) + EXEMPLARS_FIELD_NUMBER; + hash = (53 * hash) + getExemplarsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code io.prometheus.client.Histogram} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:io.prometheus.client.Histogram) + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.HistogramOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Histogram_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Histogram_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram.Builder.class); + } + + // Construct using io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetBucketFieldBuilder(); + internalGetCreatedTimestampFieldBuilder(); + internalGetNegativeSpanFieldBuilder(); + internalGetPositiveSpanFieldBuilder(); + internalGetExemplarsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sampleCount_ = 0L; + sampleCountFloat_ = 0D; + sampleSum_ = 0D; + if (bucketBuilder_ == null) { + bucket_ = java.util.Collections.emptyList(); + } else { + bucket_ = null; + bucketBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + createdTimestamp_ = null; + if (createdTimestampBuilder_ != null) { + createdTimestampBuilder_.dispose(); + createdTimestampBuilder_ = null; + } + schema_ = 0; + zeroThreshold_ = 0D; + zeroCount_ = 0L; + zeroCountFloat_ = 0D; + if (negativeSpanBuilder_ == null) { + negativeSpan_ = java.util.Collections.emptyList(); + } else { + negativeSpan_ = null; + negativeSpanBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + negativeDelta_ = emptyLongList(); + negativeCount_ = emptyDoubleList(); + if (positiveSpanBuilder_ == null) { + positiveSpan_ = java.util.Collections.emptyList(); + } else { + positiveSpan_ = null; + positiveSpanBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00001000); + positiveDelta_ = emptyLongList(); + positiveCount_ = emptyDoubleList(); + if (exemplarsBuilder_ == null) { + exemplars_ = java.util.Collections.emptyList(); + } else { + exemplars_ = null; + exemplarsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00008000); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Histogram_descriptor; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram getDefaultInstanceForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram.getDefaultInstance(); + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram build() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram buildPartial() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram result = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram result) { + if (bucketBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + bucket_ = java.util.Collections.unmodifiableList(bucket_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.bucket_ = bucket_; + } else { + result.bucket_ = bucketBuilder_.build(); + } + if (negativeSpanBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0)) { + negativeSpan_ = java.util.Collections.unmodifiableList(negativeSpan_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.negativeSpan_ = negativeSpan_; + } else { + result.negativeSpan_ = negativeSpanBuilder_.build(); + } + if (positiveSpanBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0)) { + positiveSpan_ = java.util.Collections.unmodifiableList(positiveSpan_); + bitField0_ = (bitField0_ & ~0x00001000); + } + result.positiveSpan_ = positiveSpan_; + } else { + result.positiveSpan_ = positiveSpanBuilder_.build(); + } + if (exemplarsBuilder_ == null) { + if (((bitField0_ & 0x00008000) != 0)) { + exemplars_ = java.util.Collections.unmodifiableList(exemplars_); + bitField0_ = (bitField0_ & ~0x00008000); + } + result.exemplars_ = exemplars_; + } else { + result.exemplars_ = exemplarsBuilder_.build(); + } + } + + private void buildPartial0(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sampleCount_ = sampleCount_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sampleCountFloat_ = sampleCountFloat_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sampleSum_ = sampleSum_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.createdTimestamp_ = createdTimestampBuilder_ == null + ? createdTimestamp_ + : createdTimestampBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.schema_ = schema_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.zeroThreshold_ = zeroThreshold_; + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.zeroCount_ = zeroCount_; + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.zeroCountFloat_ = zeroCountFloat_; + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + negativeDelta_.makeImmutable(); + result.negativeDelta_ = negativeDelta_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + negativeCount_.makeImmutable(); + result.negativeCount_ = negativeCount_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + positiveDelta_.makeImmutable(); + result.positiveDelta_ = positiveDelta_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + positiveCount_.makeImmutable(); + result.positiveCount_ = positiveCount_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram) { + return mergeFrom((io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram other) { + if (other == io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram.getDefaultInstance()) return this; + if (other.hasSampleCount()) { + setSampleCount(other.getSampleCount()); + } + if (other.hasSampleCountFloat()) { + setSampleCountFloat(other.getSampleCountFloat()); + } + if (other.hasSampleSum()) { + setSampleSum(other.getSampleSum()); + } + if (bucketBuilder_ == null) { + if (!other.bucket_.isEmpty()) { + if (bucket_.isEmpty()) { + bucket_ = other.bucket_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureBucketIsMutable(); + bucket_.addAll(other.bucket_); + } + onChanged(); + } + } else { + if (!other.bucket_.isEmpty()) { + if (bucketBuilder_.isEmpty()) { + bucketBuilder_.dispose(); + bucketBuilder_ = null; + bucket_ = other.bucket_; + bitField0_ = (bitField0_ & ~0x00000008); + bucketBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + internalGetBucketFieldBuilder() : null; + } else { + bucketBuilder_.addAllMessages(other.bucket_); + } + } + } + if (other.hasCreatedTimestamp()) { + mergeCreatedTimestamp(other.getCreatedTimestamp()); + } + if (other.hasSchema()) { + setSchema(other.getSchema()); + } + if (other.hasZeroThreshold()) { + setZeroThreshold(other.getZeroThreshold()); + } + if (other.hasZeroCount()) { + setZeroCount(other.getZeroCount()); + } + if (other.hasZeroCountFloat()) { + setZeroCountFloat(other.getZeroCountFloat()); + } + if (negativeSpanBuilder_ == null) { + if (!other.negativeSpan_.isEmpty()) { + if (negativeSpan_.isEmpty()) { + negativeSpan_ = other.negativeSpan_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensureNegativeSpanIsMutable(); + negativeSpan_.addAll(other.negativeSpan_); + } + onChanged(); + } + } else { + if (!other.negativeSpan_.isEmpty()) { + if (negativeSpanBuilder_.isEmpty()) { + negativeSpanBuilder_.dispose(); + negativeSpanBuilder_ = null; + negativeSpan_ = other.negativeSpan_; + bitField0_ = (bitField0_ & ~0x00000200); + negativeSpanBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + internalGetNegativeSpanFieldBuilder() : null; + } else { + negativeSpanBuilder_.addAllMessages(other.negativeSpan_); + } + } + } + if (!other.negativeDelta_.isEmpty()) { + if (negativeDelta_.isEmpty()) { + negativeDelta_ = other.negativeDelta_; + negativeDelta_.makeImmutable(); + bitField0_ |= 0x00000400; + } else { + ensureNegativeDeltaIsMutable(); + negativeDelta_.addAll(other.negativeDelta_); + } + onChanged(); + } + if (!other.negativeCount_.isEmpty()) { + if (negativeCount_.isEmpty()) { + negativeCount_ = other.negativeCount_; + negativeCount_.makeImmutable(); + bitField0_ |= 0x00000800; + } else { + ensureNegativeCountIsMutable(); + negativeCount_.addAll(other.negativeCount_); + } + onChanged(); + } + if (positiveSpanBuilder_ == null) { + if (!other.positiveSpan_.isEmpty()) { + if (positiveSpan_.isEmpty()) { + positiveSpan_ = other.positiveSpan_; + bitField0_ = (bitField0_ & ~0x00001000); + } else { + ensurePositiveSpanIsMutable(); + positiveSpan_.addAll(other.positiveSpan_); + } + onChanged(); + } + } else { + if (!other.positiveSpan_.isEmpty()) { + if (positiveSpanBuilder_.isEmpty()) { + positiveSpanBuilder_.dispose(); + positiveSpanBuilder_ = null; + positiveSpan_ = other.positiveSpan_; + bitField0_ = (bitField0_ & ~0x00001000); + positiveSpanBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + internalGetPositiveSpanFieldBuilder() : null; + } else { + positiveSpanBuilder_.addAllMessages(other.positiveSpan_); + } + } + } + if (!other.positiveDelta_.isEmpty()) { + if (positiveDelta_.isEmpty()) { + positiveDelta_ = other.positiveDelta_; + positiveDelta_.makeImmutable(); + bitField0_ |= 0x00002000; + } else { + ensurePositiveDeltaIsMutable(); + positiveDelta_.addAll(other.positiveDelta_); + } + onChanged(); + } + if (!other.positiveCount_.isEmpty()) { + if (positiveCount_.isEmpty()) { + positiveCount_ = other.positiveCount_; + positiveCount_.makeImmutable(); + bitField0_ |= 0x00004000; + } else { + ensurePositiveCountIsMutable(); + positiveCount_.addAll(other.positiveCount_); + } + onChanged(); + } + if (exemplarsBuilder_ == null) { + if (!other.exemplars_.isEmpty()) { + if (exemplars_.isEmpty()) { + exemplars_ = other.exemplars_; + bitField0_ = (bitField0_ & ~0x00008000); + } else { + ensureExemplarsIsMutable(); + exemplars_.addAll(other.exemplars_); + } + onChanged(); + } + } else { + if (!other.exemplars_.isEmpty()) { + if (exemplarsBuilder_.isEmpty()) { + exemplarsBuilder_.dispose(); + exemplarsBuilder_ = null; + exemplars_ = other.exemplars_; + bitField0_ = (bitField0_ & ~0x00008000); + exemplarsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + internalGetExemplarsFieldBuilder() : null; + } else { + exemplarsBuilder_.addAllMessages(other.exemplars_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + sampleCount_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 17: { + sampleSum_ = input.readDouble(); + bitField0_ |= 0x00000004; + break; + } // case 17 + case 26: { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket m = + input.readMessage( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.parser(), + extensionRegistry); + if (bucketBuilder_ == null) { + ensureBucketIsMutable(); + bucket_.add(m); + } else { + bucketBuilder_.addMessage(m); + } + break; + } // case 26 + case 33: { + sampleCountFloat_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 33 + case 40: { + schema_ = input.readSInt32(); + bitField0_ |= 0x00000020; + break; + } // case 40 + case 49: { + zeroThreshold_ = input.readDouble(); + bitField0_ |= 0x00000040; + break; + } // case 49 + case 56: { + zeroCount_ = input.readUInt64(); + bitField0_ |= 0x00000080; + break; + } // case 56 + case 65: { + zeroCountFloat_ = input.readDouble(); + bitField0_ |= 0x00000100; + break; + } // case 65 + case 74: { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan m = + input.readMessage( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.parser(), + extensionRegistry); + if (negativeSpanBuilder_ == null) { + ensureNegativeSpanIsMutable(); + negativeSpan_.add(m); + } else { + negativeSpanBuilder_.addMessage(m); + } + break; + } // case 74 + case 80: { + long v = input.readSInt64(); + ensureNegativeDeltaIsMutable(); + negativeDelta_.addLong(v); + break; + } // case 80 + case 82: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureNegativeDeltaIsMutable(); + while (input.getBytesUntilLimit() > 0) { + negativeDelta_.addLong(input.readSInt64()); + } + input.popLimit(limit); + break; + } // case 82 + case 89: { + double v = input.readDouble(); + ensureNegativeCountIsMutable(); + negativeCount_.addDouble(v); + break; + } // case 89 + case 90: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureNegativeCountIsMutable(alloc / 8); + while (input.getBytesUntilLimit() > 0) { + negativeCount_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } // case 90 + case 98: { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan m = + input.readMessage( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.parser(), + extensionRegistry); + if (positiveSpanBuilder_ == null) { + ensurePositiveSpanIsMutable(); + positiveSpan_.add(m); + } else { + positiveSpanBuilder_.addMessage(m); + } + break; + } // case 98 + case 104: { + long v = input.readSInt64(); + ensurePositiveDeltaIsMutable(); + positiveDelta_.addLong(v); + break; + } // case 104 + case 106: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensurePositiveDeltaIsMutable(); + while (input.getBytesUntilLimit() > 0) { + positiveDelta_.addLong(input.readSInt64()); + } + input.popLimit(limit); + break; + } // case 106 + case 113: { + double v = input.readDouble(); + ensurePositiveCountIsMutable(); + positiveCount_.addDouble(v); + break; + } // case 113 + case 114: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensurePositiveCountIsMutable(alloc / 8); + while (input.getBytesUntilLimit() > 0) { + positiveCount_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } // case 114 + case 122: { + input.readMessage( + internalGetCreatedTimestampFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 122 + case 130: { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar m = + input.readMessage( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.parser(), + extensionRegistry); + if (exemplarsBuilder_ == null) { + ensureExemplarsIsMutable(); + exemplars_.add(m); + } else { + exemplarsBuilder_.addMessage(m); + } + break; + } // case 130 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long sampleCount_ ; + /** + * optional uint64 sample_count = 1; + * @return Whether the sampleCount field is set. + */ + @java.lang.Override + public boolean hasSampleCount() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional uint64 sample_count = 1; + * @return The sampleCount. + */ + @java.lang.Override + public long getSampleCount() { + return sampleCount_; + } + /** + * optional uint64 sample_count = 1; + * @param value The sampleCount to set. + * @return This builder for chaining. + */ + public Builder setSampleCount(long value) { + + sampleCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional uint64 sample_count = 1; + * @return This builder for chaining. + */ + public Builder clearSampleCount() { + bitField0_ = (bitField0_ & ~0x00000001); + sampleCount_ = 0L; + onChanged(); + return this; + } + + private double sampleCountFloat_ ; + /** + *
    +       * Overrides sample_count if > 0.
    +       * 
    + * + * optional double sample_count_float = 4; + * @return Whether the sampleCountFloat field is set. + */ + @java.lang.Override + public boolean hasSampleCountFloat() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +       * Overrides sample_count if > 0.
    +       * 
    + * + * optional double sample_count_float = 4; + * @return The sampleCountFloat. + */ + @java.lang.Override + public double getSampleCountFloat() { + return sampleCountFloat_; + } + /** + *
    +       * Overrides sample_count if > 0.
    +       * 
    + * + * optional double sample_count_float = 4; + * @param value The sampleCountFloat to set. + * @return This builder for chaining. + */ + public Builder setSampleCountFloat(double value) { + + sampleCountFloat_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Overrides sample_count if > 0.
    +       * 
    + * + * optional double sample_count_float = 4; + * @return This builder for chaining. + */ + public Builder clearSampleCountFloat() { + bitField0_ = (bitField0_ & ~0x00000002); + sampleCountFloat_ = 0D; + onChanged(); + return this; + } + + private double sampleSum_ ; + /** + * optional double sample_sum = 2; + * @return Whether the sampleSum field is set. + */ + @java.lang.Override + public boolean hasSampleSum() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional double sample_sum = 2; + * @return The sampleSum. + */ + @java.lang.Override + public double getSampleSum() { + return sampleSum_; + } + /** + * optional double sample_sum = 2; + * @param value The sampleSum to set. + * @return This builder for chaining. + */ + public Builder setSampleSum(double value) { + + sampleSum_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * optional double sample_sum = 2; + * @return This builder for chaining. + */ + public Builder clearSampleSum() { + bitField0_ = (bitField0_ & ~0x00000004); + sampleSum_ = 0D; + onChanged(); + return this; + } + + private java.util.List bucket_ = + java.util.Collections.emptyList(); + private void ensureBucketIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + bucket_ = new java.util.ArrayList(bucket_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketOrBuilder> bucketBuilder_; + + /** + *
    +       * Buckets for the conventional histogram.
    +       * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + public java.util.List getBucketList() { + if (bucketBuilder_ == null) { + return java.util.Collections.unmodifiableList(bucket_); + } else { + return bucketBuilder_.getMessageList(); + } + } + /** + *
    +       * Buckets for the conventional histogram.
    +       * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + public int getBucketCount() { + if (bucketBuilder_ == null) { + return bucket_.size(); + } else { + return bucketBuilder_.getCount(); + } + } + /** + *
    +       * Buckets for the conventional histogram.
    +       * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket getBucket(int index) { + if (bucketBuilder_ == null) { + return bucket_.get(index); + } else { + return bucketBuilder_.getMessage(index); + } + } + /** + *
    +       * Buckets for the conventional histogram.
    +       * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + public Builder setBucket( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket value) { + if (bucketBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBucketIsMutable(); + bucket_.set(index, value); + onChanged(); + } else { + bucketBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * Buckets for the conventional histogram.
    +       * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + public Builder setBucket( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.Builder builderForValue) { + if (bucketBuilder_ == null) { + ensureBucketIsMutable(); + bucket_.set(index, builderForValue.build()); + onChanged(); + } else { + bucketBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Buckets for the conventional histogram.
    +       * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + public Builder addBucket(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket value) { + if (bucketBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBucketIsMutable(); + bucket_.add(value); + onChanged(); + } else { + bucketBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * Buckets for the conventional histogram.
    +       * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + public Builder addBucket( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket value) { + if (bucketBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBucketIsMutable(); + bucket_.add(index, value); + onChanged(); + } else { + bucketBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * Buckets for the conventional histogram.
    +       * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + public Builder addBucket( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.Builder builderForValue) { + if (bucketBuilder_ == null) { + ensureBucketIsMutable(); + bucket_.add(builderForValue.build()); + onChanged(); + } else { + bucketBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * Buckets for the conventional histogram.
    +       * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + public Builder addBucket( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.Builder builderForValue) { + if (bucketBuilder_ == null) { + ensureBucketIsMutable(); + bucket_.add(index, builderForValue.build()); + onChanged(); + } else { + bucketBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Buckets for the conventional histogram.
    +       * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + public Builder addAllBucket( + java.lang.Iterable values) { + if (bucketBuilder_ == null) { + ensureBucketIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, bucket_); + onChanged(); + } else { + bucketBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * Buckets for the conventional histogram.
    +       * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + public Builder clearBucket() { + if (bucketBuilder_ == null) { + bucket_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + bucketBuilder_.clear(); + } + return this; + } + /** + *
    +       * Buckets for the conventional histogram.
    +       * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + public Builder removeBucket(int index) { + if (bucketBuilder_ == null) { + ensureBucketIsMutable(); + bucket_.remove(index); + onChanged(); + } else { + bucketBuilder_.remove(index); + } + return this; + } + /** + *
    +       * Buckets for the conventional histogram.
    +       * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.Builder getBucketBuilder( + int index) { + return internalGetBucketFieldBuilder().getBuilder(index); + } + /** + *
    +       * Buckets for the conventional histogram.
    +       * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketOrBuilder getBucketOrBuilder( + int index) { + if (bucketBuilder_ == null) { + return bucket_.get(index); } else { + return bucketBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * Buckets for the conventional histogram.
    +       * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + public java.util.List + getBucketOrBuilderList() { + if (bucketBuilder_ != null) { + return bucketBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(bucket_); + } + } + /** + *
    +       * Buckets for the conventional histogram.
    +       * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.Builder addBucketBuilder() { + return internalGetBucketFieldBuilder().addBuilder( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.getDefaultInstance()); + } + /** + *
    +       * Buckets for the conventional histogram.
    +       * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.Builder addBucketBuilder( + int index) { + return internalGetBucketFieldBuilder().addBuilder( + index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.getDefaultInstance()); + } + /** + *
    +       * Buckets for the conventional histogram.
    +       * 
    + * + * repeated .io.prometheus.client.Bucket bucket = 3; + */ + public java.util.List + getBucketBuilderList() { + return internalGetBucketFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketOrBuilder> + internalGetBucketFieldBuilder() { + if (bucketBuilder_ == null) { + bucketBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketOrBuilder>( + bucket_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + bucket_ = null; + } + return bucketBuilder_; + } + + private com.google.protobuf.Timestamp createdTimestamp_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createdTimestampBuilder_; + /** + * optional .google.protobuf.Timestamp created_timestamp = 15; + * @return Whether the createdTimestamp field is set. + */ + public boolean hasCreatedTimestamp() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 15; + * @return The createdTimestamp. + */ + public com.google.protobuf.Timestamp getCreatedTimestamp() { + if (createdTimestampBuilder_ == null) { + return createdTimestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createdTimestamp_; + } else { + return createdTimestampBuilder_.getMessage(); + } + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 15; + */ + public Builder setCreatedTimestamp(com.google.protobuf.Timestamp value) { + if (createdTimestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createdTimestamp_ = value; + } else { + createdTimestampBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 15; + */ + public Builder setCreatedTimestamp( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (createdTimestampBuilder_ == null) { + createdTimestamp_ = builderForValue.build(); + } else { + createdTimestampBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 15; + */ + public Builder mergeCreatedTimestamp(com.google.protobuf.Timestamp value) { + if (createdTimestampBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + createdTimestamp_ != null && + createdTimestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreatedTimestampBuilder().mergeFrom(value); + } else { + createdTimestamp_ = value; + } + } else { + createdTimestampBuilder_.mergeFrom(value); + } + if (createdTimestamp_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 15; + */ + public Builder clearCreatedTimestamp() { + bitField0_ = (bitField0_ & ~0x00000010); + createdTimestamp_ = null; + if (createdTimestampBuilder_ != null) { + createdTimestampBuilder_.dispose(); + createdTimestampBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 15; + */ + public com.google.protobuf.Timestamp.Builder getCreatedTimestampBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetCreatedTimestampFieldBuilder().getBuilder(); + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 15; + */ + public com.google.protobuf.TimestampOrBuilder getCreatedTimestampOrBuilder() { + if (createdTimestampBuilder_ != null) { + return createdTimestampBuilder_.getMessageOrBuilder(); + } else { + return createdTimestamp_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : createdTimestamp_; + } + } + /** + * optional .google.protobuf.Timestamp created_timestamp = 15; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + internalGetCreatedTimestampFieldBuilder() { + if (createdTimestampBuilder_ == null) { + createdTimestampBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getCreatedTimestamp(), + getParentForChildren(), + isClean()); + createdTimestamp_ = null; + } + return createdTimestampBuilder_; + } + + private int schema_ ; + /** + *
    +       * schema defines the bucket schema. Currently, valid numbers are -4 <= n <= 8.
    +       * They are all for base-2 bucket schemas, where 1 is a bucket boundary in each case, and
    +       * then each power of two is divided into 2^n logarithmic buckets.
    +       * Or in other words, each bucket boundary is the previous boundary times 2^(2^-n).
    +       * In the future, more bucket schemas may be added using numbers < -4 or > 8.
    +       * 
    + * + * optional sint32 schema = 5; + * @return Whether the schema field is set. + */ + @java.lang.Override + public boolean hasSchema() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + *
    +       * schema defines the bucket schema. Currently, valid numbers are -4 <= n <= 8.
    +       * They are all for base-2 bucket schemas, where 1 is a bucket boundary in each case, and
    +       * then each power of two is divided into 2^n logarithmic buckets.
    +       * Or in other words, each bucket boundary is the previous boundary times 2^(2^-n).
    +       * In the future, more bucket schemas may be added using numbers < -4 or > 8.
    +       * 
    + * + * optional sint32 schema = 5; + * @return The schema. + */ + @java.lang.Override + public int getSchema() { + return schema_; + } + /** + *
    +       * schema defines the bucket schema. Currently, valid numbers are -4 <= n <= 8.
    +       * They are all for base-2 bucket schemas, where 1 is a bucket boundary in each case, and
    +       * then each power of two is divided into 2^n logarithmic buckets.
    +       * Or in other words, each bucket boundary is the previous boundary times 2^(2^-n).
    +       * In the future, more bucket schemas may be added using numbers < -4 or > 8.
    +       * 
    + * + * optional sint32 schema = 5; + * @param value The schema to set. + * @return This builder for chaining. + */ + public Builder setSchema(int value) { + + schema_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * schema defines the bucket schema. Currently, valid numbers are -4 <= n <= 8.
    +       * They are all for base-2 bucket schemas, where 1 is a bucket boundary in each case, and
    +       * then each power of two is divided into 2^n logarithmic buckets.
    +       * Or in other words, each bucket boundary is the previous boundary times 2^(2^-n).
    +       * In the future, more bucket schemas may be added using numbers < -4 or > 8.
    +       * 
    + * + * optional sint32 schema = 5; + * @return This builder for chaining. + */ + public Builder clearSchema() { + bitField0_ = (bitField0_ & ~0x00000020); + schema_ = 0; + onChanged(); + return this; + } + + private double zeroThreshold_ ; + /** + *
    +       * Breadth of the zero bucket.
    +       * 
    + * + * optional double zero_threshold = 6; + * @return Whether the zeroThreshold field is set. + */ + @java.lang.Override + public boolean hasZeroThreshold() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + *
    +       * Breadth of the zero bucket.
    +       * 
    + * + * optional double zero_threshold = 6; + * @return The zeroThreshold. + */ + @java.lang.Override + public double getZeroThreshold() { + return zeroThreshold_; + } + /** + *
    +       * Breadth of the zero bucket.
    +       * 
    + * + * optional double zero_threshold = 6; + * @param value The zeroThreshold to set. + * @return This builder for chaining. + */ + public Builder setZeroThreshold(double value) { + + zeroThreshold_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +       * Breadth of the zero bucket.
    +       * 
    + * + * optional double zero_threshold = 6; + * @return This builder for chaining. + */ + public Builder clearZeroThreshold() { + bitField0_ = (bitField0_ & ~0x00000040); + zeroThreshold_ = 0D; + onChanged(); + return this; + } + + private long zeroCount_ ; + /** + *
    +       * Count in zero bucket.
    +       * 
    + * + * optional uint64 zero_count = 7; + * @return Whether the zeroCount field is set. + */ + @java.lang.Override + public boolean hasZeroCount() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + *
    +       * Count in zero bucket.
    +       * 
    + * + * optional uint64 zero_count = 7; + * @return The zeroCount. + */ + @java.lang.Override + public long getZeroCount() { + return zeroCount_; + } + /** + *
    +       * Count in zero bucket.
    +       * 
    + * + * optional uint64 zero_count = 7; + * @param value The zeroCount to set. + * @return This builder for chaining. + */ + public Builder setZeroCount(long value) { + + zeroCount_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +       * Count in zero bucket.
    +       * 
    + * + * optional uint64 zero_count = 7; + * @return This builder for chaining. + */ + public Builder clearZeroCount() { + bitField0_ = (bitField0_ & ~0x00000080); + zeroCount_ = 0L; + onChanged(); + return this; + } + + private double zeroCountFloat_ ; + /** + *
    +       * Overrides sb_zero_count if > 0.
    +       * 
    + * + * optional double zero_count_float = 8; + * @return Whether the zeroCountFloat field is set. + */ + @java.lang.Override + public boolean hasZeroCountFloat() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + *
    +       * Overrides sb_zero_count if > 0.
    +       * 
    + * + * optional double zero_count_float = 8; + * @return The zeroCountFloat. + */ + @java.lang.Override + public double getZeroCountFloat() { + return zeroCountFloat_; + } + /** + *
    +       * Overrides sb_zero_count if > 0.
    +       * 
    + * + * optional double zero_count_float = 8; + * @param value The zeroCountFloat to set. + * @return This builder for chaining. + */ + public Builder setZeroCountFloat(double value) { + + zeroCountFloat_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +       * Overrides sb_zero_count if > 0.
    +       * 
    + * + * optional double zero_count_float = 8; + * @return This builder for chaining. + */ + public Builder clearZeroCountFloat() { + bitField0_ = (bitField0_ & ~0x00000100); + zeroCountFloat_ = 0D; + onChanged(); + return this; + } + + private java.util.List negativeSpan_ = + java.util.Collections.emptyList(); + private void ensureNegativeSpanIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + negativeSpan_ = new java.util.ArrayList(negativeSpan_); + bitField0_ |= 0x00000200; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpanOrBuilder> negativeSpanBuilder_; + + /** + *
    +       * Negative buckets for the native histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + public java.util.List getNegativeSpanList() { + if (negativeSpanBuilder_ == null) { + return java.util.Collections.unmodifiableList(negativeSpan_); + } else { + return negativeSpanBuilder_.getMessageList(); + } + } + /** + *
    +       * Negative buckets for the native histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + public int getNegativeSpanCount() { + if (negativeSpanBuilder_ == null) { + return negativeSpan_.size(); + } else { + return negativeSpanBuilder_.getCount(); + } + } + /** + *
    +       * Negative buckets for the native histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan getNegativeSpan(int index) { + if (negativeSpanBuilder_ == null) { + return negativeSpan_.get(index); + } else { + return negativeSpanBuilder_.getMessage(index); + } + } + /** + *
    +       * Negative buckets for the native histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + public Builder setNegativeSpan( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan value) { + if (negativeSpanBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNegativeSpanIsMutable(); + negativeSpan_.set(index, value); + onChanged(); + } else { + negativeSpanBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * Negative buckets for the native histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + public Builder setNegativeSpan( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder builderForValue) { + if (negativeSpanBuilder_ == null) { + ensureNegativeSpanIsMutable(); + negativeSpan_.set(index, builderForValue.build()); + onChanged(); + } else { + negativeSpanBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Negative buckets for the native histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + public Builder addNegativeSpan(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan value) { + if (negativeSpanBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNegativeSpanIsMutable(); + negativeSpan_.add(value); + onChanged(); + } else { + negativeSpanBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * Negative buckets for the native histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + public Builder addNegativeSpan( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan value) { + if (negativeSpanBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNegativeSpanIsMutable(); + negativeSpan_.add(index, value); + onChanged(); + } else { + negativeSpanBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * Negative buckets for the native histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + public Builder addNegativeSpan( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder builderForValue) { + if (negativeSpanBuilder_ == null) { + ensureNegativeSpanIsMutable(); + negativeSpan_.add(builderForValue.build()); + onChanged(); + } else { + negativeSpanBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * Negative buckets for the native histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + public Builder addNegativeSpan( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder builderForValue) { + if (negativeSpanBuilder_ == null) { + ensureNegativeSpanIsMutable(); + negativeSpan_.add(index, builderForValue.build()); + onChanged(); + } else { + negativeSpanBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Negative buckets for the native histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + public Builder addAllNegativeSpan( + java.lang.Iterable values) { + if (negativeSpanBuilder_ == null) { + ensureNegativeSpanIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, negativeSpan_); + onChanged(); + } else { + negativeSpanBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * Negative buckets for the native histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + public Builder clearNegativeSpan() { + if (negativeSpanBuilder_ == null) { + negativeSpan_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + } else { + negativeSpanBuilder_.clear(); + } + return this; + } + /** + *
    +       * Negative buckets for the native histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + public Builder removeNegativeSpan(int index) { + if (negativeSpanBuilder_ == null) { + ensureNegativeSpanIsMutable(); + negativeSpan_.remove(index); + onChanged(); + } else { + negativeSpanBuilder_.remove(index); + } + return this; + } + /** + *
    +       * Negative buckets for the native histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder getNegativeSpanBuilder( + int index) { + return internalGetNegativeSpanFieldBuilder().getBuilder(index); + } + /** + *
    +       * Negative buckets for the native histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpanOrBuilder getNegativeSpanOrBuilder( + int index) { + if (negativeSpanBuilder_ == null) { + return negativeSpan_.get(index); } else { + return negativeSpanBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * Negative buckets for the native histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + public java.util.List + getNegativeSpanOrBuilderList() { + if (negativeSpanBuilder_ != null) { + return negativeSpanBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(negativeSpan_); + } + } + /** + *
    +       * Negative buckets for the native histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder addNegativeSpanBuilder() { + return internalGetNegativeSpanFieldBuilder().addBuilder( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.getDefaultInstance()); + } + /** + *
    +       * Negative buckets for the native histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder addNegativeSpanBuilder( + int index) { + return internalGetNegativeSpanFieldBuilder().addBuilder( + index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.getDefaultInstance()); + } + /** + *
    +       * Negative buckets for the native histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan negative_span = 9; + */ + public java.util.List + getNegativeSpanBuilderList() { + return internalGetNegativeSpanFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpanOrBuilder> + internalGetNegativeSpanFieldBuilder() { + if (negativeSpanBuilder_ == null) { + negativeSpanBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpanOrBuilder>( + negativeSpan_, + ((bitField0_ & 0x00000200) != 0), + getParentForChildren(), + isClean()); + negativeSpan_ = null; + } + return negativeSpanBuilder_; + } + + private com.google.protobuf.Internal.LongList negativeDelta_ = emptyLongList(); + private void ensureNegativeDeltaIsMutable() { + if (!negativeDelta_.isModifiable()) { + negativeDelta_ = makeMutableCopy(negativeDelta_); + } + bitField0_ |= 0x00000400; + } + /** + *
    +       * Use either "negative_delta" or "negative_count", the former for
    +       * regular histograms with integer counts, the latter for float
    +       * histograms.
    +       * 
    + * + * repeated sint64 negative_delta = 10; + * @return A list containing the negativeDelta. + */ + public java.util.List + getNegativeDeltaList() { + negativeDelta_.makeImmutable(); + return negativeDelta_; + } + /** + *
    +       * Use either "negative_delta" or "negative_count", the former for
    +       * regular histograms with integer counts, the latter for float
    +       * histograms.
    +       * 
    + * + * repeated sint64 negative_delta = 10; + * @return The count of negativeDelta. + */ + public int getNegativeDeltaCount() { + return negativeDelta_.size(); + } + /** + *
    +       * Use either "negative_delta" or "negative_count", the former for
    +       * regular histograms with integer counts, the latter for float
    +       * histograms.
    +       * 
    + * + * repeated sint64 negative_delta = 10; + * @param index The index of the element to return. + * @return The negativeDelta at the given index. + */ + public long getNegativeDelta(int index) { + return negativeDelta_.getLong(index); + } + /** + *
    +       * Use either "negative_delta" or "negative_count", the former for
    +       * regular histograms with integer counts, the latter for float
    +       * histograms.
    +       * 
    + * + * repeated sint64 negative_delta = 10; + * @param index The index to set the value at. + * @param value The negativeDelta to set. + * @return This builder for chaining. + */ + public Builder setNegativeDelta( + int index, long value) { + + ensureNegativeDeltaIsMutable(); + negativeDelta_.setLong(index, value); + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +       * Use either "negative_delta" or "negative_count", the former for
    +       * regular histograms with integer counts, the latter for float
    +       * histograms.
    +       * 
    + * + * repeated sint64 negative_delta = 10; + * @param value The negativeDelta to add. + * @return This builder for chaining. + */ + public Builder addNegativeDelta(long value) { + + ensureNegativeDeltaIsMutable(); + negativeDelta_.addLong(value); + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +       * Use either "negative_delta" or "negative_count", the former for
    +       * regular histograms with integer counts, the latter for float
    +       * histograms.
    +       * 
    + * + * repeated sint64 negative_delta = 10; + * @param values The negativeDelta to add. + * @return This builder for chaining. + */ + public Builder addAllNegativeDelta( + java.lang.Iterable values) { + ensureNegativeDeltaIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, negativeDelta_); + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +       * Use either "negative_delta" or "negative_count", the former for
    +       * regular histograms with integer counts, the latter for float
    +       * histograms.
    +       * 
    + * + * repeated sint64 negative_delta = 10; + * @return This builder for chaining. + */ + public Builder clearNegativeDelta() { + negativeDelta_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.DoubleList negativeCount_ = emptyDoubleList(); + private void ensureNegativeCountIsMutable() { + if (!negativeCount_.isModifiable()) { + negativeCount_ = makeMutableCopy(negativeCount_); + } + bitField0_ |= 0x00000800; + } + private void ensureNegativeCountIsMutable(int capacity) { + if (!negativeCount_.isModifiable()) { + negativeCount_ = makeMutableCopy(negativeCount_, capacity); + } + bitField0_ |= 0x00000800; + } + /** + *
    +       * Absolute count of each bucket.
    +       * 
    + * + * repeated double negative_count = 11; + * @return A list containing the negativeCount. + */ + public java.util.List + getNegativeCountList() { + negativeCount_.makeImmutable(); + return negativeCount_; + } + /** + *
    +       * Absolute count of each bucket.
    +       * 
    + * + * repeated double negative_count = 11; + * @return The count of negativeCount. + */ + public int getNegativeCountCount() { + return negativeCount_.size(); + } + /** + *
    +       * Absolute count of each bucket.
    +       * 
    + * + * repeated double negative_count = 11; + * @param index The index of the element to return. + * @return The negativeCount at the given index. + */ + public double getNegativeCount(int index) { + return negativeCount_.getDouble(index); + } + /** + *
    +       * Absolute count of each bucket.
    +       * 
    + * + * repeated double negative_count = 11; + * @param index The index to set the value at. + * @param value The negativeCount to set. + * @return This builder for chaining. + */ + public Builder setNegativeCount( + int index, double value) { + + ensureNegativeCountIsMutable(); + negativeCount_.setDouble(index, value); + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +       * Absolute count of each bucket.
    +       * 
    + * + * repeated double negative_count = 11; + * @param value The negativeCount to add. + * @return This builder for chaining. + */ + public Builder addNegativeCount(double value) { + + ensureNegativeCountIsMutable(); + negativeCount_.addDouble(value); + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +       * Absolute count of each bucket.
    +       * 
    + * + * repeated double negative_count = 11; + * @param values The negativeCount to add. + * @return This builder for chaining. + */ + public Builder addAllNegativeCount( + java.lang.Iterable values) { + ensureNegativeCountIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, negativeCount_); + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +       * Absolute count of each bucket.
    +       * 
    + * + * repeated double negative_count = 11; + * @return This builder for chaining. + */ + public Builder clearNegativeCount() { + negativeCount_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + + private java.util.List positiveSpan_ = + java.util.Collections.emptyList(); + private void ensurePositiveSpanIsMutable() { + if (!((bitField0_ & 0x00001000) != 0)) { + positiveSpan_ = new java.util.ArrayList(positiveSpan_); + bitField0_ |= 0x00001000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpanOrBuilder> positiveSpanBuilder_; + + /** + *
    +       * Positive buckets for the native histogram.
    +       * Use a no-op span (offset 0, length 0) for a native histogram without any
    +       * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +       * indistinguishable from a classic histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + public java.util.List getPositiveSpanList() { + if (positiveSpanBuilder_ == null) { + return java.util.Collections.unmodifiableList(positiveSpan_); + } else { + return positiveSpanBuilder_.getMessageList(); + } + } + /** + *
    +       * Positive buckets for the native histogram.
    +       * Use a no-op span (offset 0, length 0) for a native histogram without any
    +       * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +       * indistinguishable from a classic histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + public int getPositiveSpanCount() { + if (positiveSpanBuilder_ == null) { + return positiveSpan_.size(); + } else { + return positiveSpanBuilder_.getCount(); + } + } + /** + *
    +       * Positive buckets for the native histogram.
    +       * Use a no-op span (offset 0, length 0) for a native histogram without any
    +       * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +       * indistinguishable from a classic histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan getPositiveSpan(int index) { + if (positiveSpanBuilder_ == null) { + return positiveSpan_.get(index); + } else { + return positiveSpanBuilder_.getMessage(index); + } + } + /** + *
    +       * Positive buckets for the native histogram.
    +       * Use a no-op span (offset 0, length 0) for a native histogram without any
    +       * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +       * indistinguishable from a classic histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + public Builder setPositiveSpan( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan value) { + if (positiveSpanBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePositiveSpanIsMutable(); + positiveSpan_.set(index, value); + onChanged(); + } else { + positiveSpanBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * Positive buckets for the native histogram.
    +       * Use a no-op span (offset 0, length 0) for a native histogram without any
    +       * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +       * indistinguishable from a classic histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + public Builder setPositiveSpan( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder builderForValue) { + if (positiveSpanBuilder_ == null) { + ensurePositiveSpanIsMutable(); + positiveSpan_.set(index, builderForValue.build()); + onChanged(); + } else { + positiveSpanBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Positive buckets for the native histogram.
    +       * Use a no-op span (offset 0, length 0) for a native histogram without any
    +       * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +       * indistinguishable from a classic histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + public Builder addPositiveSpan(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan value) { + if (positiveSpanBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePositiveSpanIsMutable(); + positiveSpan_.add(value); + onChanged(); + } else { + positiveSpanBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * Positive buckets for the native histogram.
    +       * Use a no-op span (offset 0, length 0) for a native histogram without any
    +       * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +       * indistinguishable from a classic histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + public Builder addPositiveSpan( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan value) { + if (positiveSpanBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePositiveSpanIsMutable(); + positiveSpan_.add(index, value); + onChanged(); + } else { + positiveSpanBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * Positive buckets for the native histogram.
    +       * Use a no-op span (offset 0, length 0) for a native histogram without any
    +       * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +       * indistinguishable from a classic histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + public Builder addPositiveSpan( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder builderForValue) { + if (positiveSpanBuilder_ == null) { + ensurePositiveSpanIsMutable(); + positiveSpan_.add(builderForValue.build()); + onChanged(); + } else { + positiveSpanBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * Positive buckets for the native histogram.
    +       * Use a no-op span (offset 0, length 0) for a native histogram without any
    +       * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +       * indistinguishable from a classic histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + public Builder addPositiveSpan( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder builderForValue) { + if (positiveSpanBuilder_ == null) { + ensurePositiveSpanIsMutable(); + positiveSpan_.add(index, builderForValue.build()); + onChanged(); + } else { + positiveSpanBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Positive buckets for the native histogram.
    +       * Use a no-op span (offset 0, length 0) for a native histogram without any
    +       * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +       * indistinguishable from a classic histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + public Builder addAllPositiveSpan( + java.lang.Iterable values) { + if (positiveSpanBuilder_ == null) { + ensurePositiveSpanIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, positiveSpan_); + onChanged(); + } else { + positiveSpanBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * Positive buckets for the native histogram.
    +       * Use a no-op span (offset 0, length 0) for a native histogram without any
    +       * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +       * indistinguishable from a classic histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + public Builder clearPositiveSpan() { + if (positiveSpanBuilder_ == null) { + positiveSpan_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + } else { + positiveSpanBuilder_.clear(); + } + return this; + } + /** + *
    +       * Positive buckets for the native histogram.
    +       * Use a no-op span (offset 0, length 0) for a native histogram without any
    +       * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +       * indistinguishable from a classic histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + public Builder removePositiveSpan(int index) { + if (positiveSpanBuilder_ == null) { + ensurePositiveSpanIsMutable(); + positiveSpan_.remove(index); + onChanged(); + } else { + positiveSpanBuilder_.remove(index); + } + return this; + } + /** + *
    +       * Positive buckets for the native histogram.
    +       * Use a no-op span (offset 0, length 0) for a native histogram without any
    +       * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +       * indistinguishable from a classic histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder getPositiveSpanBuilder( + int index) { + return internalGetPositiveSpanFieldBuilder().getBuilder(index); + } + /** + *
    +       * Positive buckets for the native histogram.
    +       * Use a no-op span (offset 0, length 0) for a native histogram without any
    +       * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +       * indistinguishable from a classic histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpanOrBuilder getPositiveSpanOrBuilder( + int index) { + if (positiveSpanBuilder_ == null) { + return positiveSpan_.get(index); } else { + return positiveSpanBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * Positive buckets for the native histogram.
    +       * Use a no-op span (offset 0, length 0) for a native histogram without any
    +       * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +       * indistinguishable from a classic histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + public java.util.List + getPositiveSpanOrBuilderList() { + if (positiveSpanBuilder_ != null) { + return positiveSpanBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(positiveSpan_); + } + } + /** + *
    +       * Positive buckets for the native histogram.
    +       * Use a no-op span (offset 0, length 0) for a native histogram without any
    +       * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +       * indistinguishable from a classic histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder addPositiveSpanBuilder() { + return internalGetPositiveSpanFieldBuilder().addBuilder( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.getDefaultInstance()); + } + /** + *
    +       * Positive buckets for the native histogram.
    +       * Use a no-op span (offset 0, length 0) for a native histogram without any
    +       * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +       * indistinguishable from a classic histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder addPositiveSpanBuilder( + int index) { + return internalGetPositiveSpanFieldBuilder().addBuilder( + index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.getDefaultInstance()); + } + /** + *
    +       * Positive buckets for the native histogram.
    +       * Use a no-op span (offset 0, length 0) for a native histogram without any
    +       * observations yet and with a zero_threshold of 0. Otherwise, it would be
    +       * indistinguishable from a classic histogram.
    +       * 
    + * + * repeated .io.prometheus.client.BucketSpan positive_span = 12; + */ + public java.util.List + getPositiveSpanBuilderList() { + return internalGetPositiveSpanFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpanOrBuilder> + internalGetPositiveSpanFieldBuilder() { + if (positiveSpanBuilder_ == null) { + positiveSpanBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpanOrBuilder>( + positiveSpan_, + ((bitField0_ & 0x00001000) != 0), + getParentForChildren(), + isClean()); + positiveSpan_ = null; + } + return positiveSpanBuilder_; + } + + private com.google.protobuf.Internal.LongList positiveDelta_ = emptyLongList(); + private void ensurePositiveDeltaIsMutable() { + if (!positiveDelta_.isModifiable()) { + positiveDelta_ = makeMutableCopy(positiveDelta_); + } + bitField0_ |= 0x00002000; + } + /** + *
    +       * Use either "positive_delta" or "positive_count", the former for
    +       * regular histograms with integer counts, the latter for float
    +       * histograms.
    +       * 
    + * + * repeated sint64 positive_delta = 13; + * @return A list containing the positiveDelta. + */ + public java.util.List + getPositiveDeltaList() { + positiveDelta_.makeImmutable(); + return positiveDelta_; + } + /** + *
    +       * Use either "positive_delta" or "positive_count", the former for
    +       * regular histograms with integer counts, the latter for float
    +       * histograms.
    +       * 
    + * + * repeated sint64 positive_delta = 13; + * @return The count of positiveDelta. + */ + public int getPositiveDeltaCount() { + return positiveDelta_.size(); + } + /** + *
    +       * Use either "positive_delta" or "positive_count", the former for
    +       * regular histograms with integer counts, the latter for float
    +       * histograms.
    +       * 
    + * + * repeated sint64 positive_delta = 13; + * @param index The index of the element to return. + * @return The positiveDelta at the given index. + */ + public long getPositiveDelta(int index) { + return positiveDelta_.getLong(index); + } + /** + *
    +       * Use either "positive_delta" or "positive_count", the former for
    +       * regular histograms with integer counts, the latter for float
    +       * histograms.
    +       * 
    + * + * repeated sint64 positive_delta = 13; + * @param index The index to set the value at. + * @param value The positiveDelta to set. + * @return This builder for chaining. + */ + public Builder setPositiveDelta( + int index, long value) { + + ensurePositiveDeltaIsMutable(); + positiveDelta_.setLong(index, value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
    +       * Use either "positive_delta" or "positive_count", the former for
    +       * regular histograms with integer counts, the latter for float
    +       * histograms.
    +       * 
    + * + * repeated sint64 positive_delta = 13; + * @param value The positiveDelta to add. + * @return This builder for chaining. + */ + public Builder addPositiveDelta(long value) { + + ensurePositiveDeltaIsMutable(); + positiveDelta_.addLong(value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
    +       * Use either "positive_delta" or "positive_count", the former for
    +       * regular histograms with integer counts, the latter for float
    +       * histograms.
    +       * 
    + * + * repeated sint64 positive_delta = 13; + * @param values The positiveDelta to add. + * @return This builder for chaining. + */ + public Builder addAllPositiveDelta( + java.lang.Iterable values) { + ensurePositiveDeltaIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, positiveDelta_); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
    +       * Use either "positive_delta" or "positive_count", the former for
    +       * regular histograms with integer counts, the latter for float
    +       * histograms.
    +       * 
    + * + * repeated sint64 positive_delta = 13; + * @return This builder for chaining. + */ + public Builder clearPositiveDelta() { + positiveDelta_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.DoubleList positiveCount_ = emptyDoubleList(); + private void ensurePositiveCountIsMutable() { + if (!positiveCount_.isModifiable()) { + positiveCount_ = makeMutableCopy(positiveCount_); + } + bitField0_ |= 0x00004000; + } + private void ensurePositiveCountIsMutable(int capacity) { + if (!positiveCount_.isModifiable()) { + positiveCount_ = makeMutableCopy(positiveCount_, capacity); + } + bitField0_ |= 0x00004000; + } + /** + *
    +       * Absolute count of each bucket.
    +       * 
    + * + * repeated double positive_count = 14; + * @return A list containing the positiveCount. + */ + public java.util.List + getPositiveCountList() { + positiveCount_.makeImmutable(); + return positiveCount_; + } + /** + *
    +       * Absolute count of each bucket.
    +       * 
    + * + * repeated double positive_count = 14; + * @return The count of positiveCount. + */ + public int getPositiveCountCount() { + return positiveCount_.size(); + } + /** + *
    +       * Absolute count of each bucket.
    +       * 
    + * + * repeated double positive_count = 14; + * @param index The index of the element to return. + * @return The positiveCount at the given index. + */ + public double getPositiveCount(int index) { + return positiveCount_.getDouble(index); + } + /** + *
    +       * Absolute count of each bucket.
    +       * 
    + * + * repeated double positive_count = 14; + * @param index The index to set the value at. + * @param value The positiveCount to set. + * @return This builder for chaining. + */ + public Builder setPositiveCount( + int index, double value) { + + ensurePositiveCountIsMutable(); + positiveCount_.setDouble(index, value); + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + *
    +       * Absolute count of each bucket.
    +       * 
    + * + * repeated double positive_count = 14; + * @param value The positiveCount to add. + * @return This builder for chaining. + */ + public Builder addPositiveCount(double value) { + + ensurePositiveCountIsMutable(); + positiveCount_.addDouble(value); + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + *
    +       * Absolute count of each bucket.
    +       * 
    + * + * repeated double positive_count = 14; + * @param values The positiveCount to add. + * @return This builder for chaining. + */ + public Builder addAllPositiveCount( + java.lang.Iterable values) { + ensurePositiveCountIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, positiveCount_); + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + *
    +       * Absolute count of each bucket.
    +       * 
    + * + * repeated double positive_count = 14; + * @return This builder for chaining. + */ + public Builder clearPositiveCount() { + positiveCount_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + + private java.util.List exemplars_ = + java.util.Collections.emptyList(); + private void ensureExemplarsIsMutable() { + if (!((bitField0_ & 0x00008000) != 0)) { + exemplars_ = new java.util.ArrayList(exemplars_); + bitField0_ |= 0x00008000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder> exemplarsBuilder_; + + /** + *
    +       * Only used for native histograms. These exemplars MUST have a timestamp.
    +       * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + public java.util.List getExemplarsList() { + if (exemplarsBuilder_ == null) { + return java.util.Collections.unmodifiableList(exemplars_); + } else { + return exemplarsBuilder_.getMessageList(); + } + } + /** + *
    +       * Only used for native histograms. These exemplars MUST have a timestamp.
    +       * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + public int getExemplarsCount() { + if (exemplarsBuilder_ == null) { + return exemplars_.size(); + } else { + return exemplarsBuilder_.getCount(); + } + } + /** + *
    +       * Only used for native histograms. These exemplars MUST have a timestamp.
    +       * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar getExemplars(int index) { + if (exemplarsBuilder_ == null) { + return exemplars_.get(index); + } else { + return exemplarsBuilder_.getMessage(index); + } + } + /** + *
    +       * Only used for native histograms. These exemplars MUST have a timestamp.
    +       * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + public Builder setExemplars( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar value) { + if (exemplarsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExemplarsIsMutable(); + exemplars_.set(index, value); + onChanged(); + } else { + exemplarsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * Only used for native histograms. These exemplars MUST have a timestamp.
    +       * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + public Builder setExemplars( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder builderForValue) { + if (exemplarsBuilder_ == null) { + ensureExemplarsIsMutable(); + exemplars_.set(index, builderForValue.build()); + onChanged(); + } else { + exemplarsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Only used for native histograms. These exemplars MUST have a timestamp.
    +       * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + public Builder addExemplars(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar value) { + if (exemplarsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExemplarsIsMutable(); + exemplars_.add(value); + onChanged(); + } else { + exemplarsBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * Only used for native histograms. These exemplars MUST have a timestamp.
    +       * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + public Builder addExemplars( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar value) { + if (exemplarsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExemplarsIsMutable(); + exemplars_.add(index, value); + onChanged(); + } else { + exemplarsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * Only used for native histograms. These exemplars MUST have a timestamp.
    +       * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + public Builder addExemplars( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder builderForValue) { + if (exemplarsBuilder_ == null) { + ensureExemplarsIsMutable(); + exemplars_.add(builderForValue.build()); + onChanged(); + } else { + exemplarsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * Only used for native histograms. These exemplars MUST have a timestamp.
    +       * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + public Builder addExemplars( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder builderForValue) { + if (exemplarsBuilder_ == null) { + ensureExemplarsIsMutable(); + exemplars_.add(index, builderForValue.build()); + onChanged(); + } else { + exemplarsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Only used for native histograms. These exemplars MUST have a timestamp.
    +       * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + public Builder addAllExemplars( + java.lang.Iterable values) { + if (exemplarsBuilder_ == null) { + ensureExemplarsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, exemplars_); + onChanged(); + } else { + exemplarsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * Only used for native histograms. These exemplars MUST have a timestamp.
    +       * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + public Builder clearExemplars() { + if (exemplarsBuilder_ == null) { + exemplars_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00008000); + onChanged(); + } else { + exemplarsBuilder_.clear(); + } + return this; + } + /** + *
    +       * Only used for native histograms. These exemplars MUST have a timestamp.
    +       * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + public Builder removeExemplars(int index) { + if (exemplarsBuilder_ == null) { + ensureExemplarsIsMutable(); + exemplars_.remove(index); + onChanged(); + } else { + exemplarsBuilder_.remove(index); + } + return this; + } + /** + *
    +       * Only used for native histograms. These exemplars MUST have a timestamp.
    +       * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder getExemplarsBuilder( + int index) { + return internalGetExemplarsFieldBuilder().getBuilder(index); + } + /** + *
    +       * Only used for native histograms. These exemplars MUST have a timestamp.
    +       * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder getExemplarsOrBuilder( + int index) { + if (exemplarsBuilder_ == null) { + return exemplars_.get(index); } else { + return exemplarsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * Only used for native histograms. These exemplars MUST have a timestamp.
    +       * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + public java.util.List + getExemplarsOrBuilderList() { + if (exemplarsBuilder_ != null) { + return exemplarsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(exemplars_); + } + } + /** + *
    +       * Only used for native histograms. These exemplars MUST have a timestamp.
    +       * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder addExemplarsBuilder() { + return internalGetExemplarsFieldBuilder().addBuilder( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.getDefaultInstance()); + } + /** + *
    +       * Only used for native histograms. These exemplars MUST have a timestamp.
    +       * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder addExemplarsBuilder( + int index) { + return internalGetExemplarsFieldBuilder().addBuilder( + index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.getDefaultInstance()); + } + /** + *
    +       * Only used for native histograms. These exemplars MUST have a timestamp.
    +       * 
    + * + * repeated .io.prometheus.client.Exemplar exemplars = 16; + */ + public java.util.List + getExemplarsBuilderList() { + return internalGetExemplarsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder> + internalGetExemplarsFieldBuilder() { + if (exemplarsBuilder_ == null) { + exemplarsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder>( + exemplars_, + ((bitField0_ & 0x00008000) != 0), + getParentForChildren(), + isClean()); + exemplars_ = null; + } + return exemplarsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:io.prometheus.client.Histogram) + } + + // @@protoc_insertion_point(class_scope:io.prometheus.client.Histogram) + private static final io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram(); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Histogram parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface BucketOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.prometheus.client.Bucket) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Cumulative in increasing order.
    +     * 
    + * + * optional uint64 cumulative_count = 1; + * @return Whether the cumulativeCount field is set. + */ + boolean hasCumulativeCount(); + /** + *
    +     * Cumulative in increasing order.
    +     * 
    + * + * optional uint64 cumulative_count = 1; + * @return The cumulativeCount. + */ + long getCumulativeCount(); + + /** + *
    +     * Overrides cumulative_count if > 0.
    +     * 
    + * + * optional double cumulative_count_float = 4; + * @return Whether the cumulativeCountFloat field is set. + */ + boolean hasCumulativeCountFloat(); + /** + *
    +     * Overrides cumulative_count if > 0.
    +     * 
    + * + * optional double cumulative_count_float = 4; + * @return The cumulativeCountFloat. + */ + double getCumulativeCountFloat(); + + /** + *
    +     * Inclusive.
    +     * 
    + * + * optional double upper_bound = 2; + * @return Whether the upperBound field is set. + */ + boolean hasUpperBound(); + /** + *
    +     * Inclusive.
    +     * 
    + * + * optional double upper_bound = 2; + * @return The upperBound. + */ + double getUpperBound(); + + /** + * optional .io.prometheus.client.Exemplar exemplar = 3; + * @return Whether the exemplar field is set. + */ + boolean hasExemplar(); + /** + * optional .io.prometheus.client.Exemplar exemplar = 3; + * @return The exemplar. + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar getExemplar(); + /** + * optional .io.prometheus.client.Exemplar exemplar = 3; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder getExemplarOrBuilder(); + } + /** + *
    +   * A Bucket of a conventional histogram, each of which is treated as
    +   * an individual counter-like time series by Prometheus.
    +   * 
    + * + * Protobuf type {@code io.prometheus.client.Bucket} + */ + public static final class Bucket extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:io.prometheus.client.Bucket) + BucketOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 4, + /* suffix= */ "", + "Bucket"); + } + // Use Bucket.newBuilder() to construct. + private Bucket(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Bucket() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Bucket_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Bucket_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.Builder.class); + } + + private int bitField0_; + public static final int CUMULATIVE_COUNT_FIELD_NUMBER = 1; + private long cumulativeCount_ = 0L; + /** + *
    +     * Cumulative in increasing order.
    +     * 
    + * + * optional uint64 cumulative_count = 1; + * @return Whether the cumulativeCount field is set. + */ + @java.lang.Override + public boolean hasCumulativeCount() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * Cumulative in increasing order.
    +     * 
    + * + * optional uint64 cumulative_count = 1; + * @return The cumulativeCount. + */ + @java.lang.Override + public long getCumulativeCount() { + return cumulativeCount_; + } + + public static final int CUMULATIVE_COUNT_FLOAT_FIELD_NUMBER = 4; + private double cumulativeCountFloat_ = 0D; + /** + *
    +     * Overrides cumulative_count if > 0.
    +     * 
    + * + * optional double cumulative_count_float = 4; + * @return Whether the cumulativeCountFloat field is set. + */ + @java.lang.Override + public boolean hasCumulativeCountFloat() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * Overrides cumulative_count if > 0.
    +     * 
    + * + * optional double cumulative_count_float = 4; + * @return The cumulativeCountFloat. + */ + @java.lang.Override + public double getCumulativeCountFloat() { + return cumulativeCountFloat_; + } + + public static final int UPPER_BOUND_FIELD_NUMBER = 2; + private double upperBound_ = 0D; + /** + *
    +     * Inclusive.
    +     * 
    + * + * optional double upper_bound = 2; + * @return Whether the upperBound field is set. + */ + @java.lang.Override + public boolean hasUpperBound() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +     * Inclusive.
    +     * 
    + * + * optional double upper_bound = 2; + * @return The upperBound. + */ + @java.lang.Override + public double getUpperBound() { + return upperBound_; + } + + public static final int EXEMPLAR_FIELD_NUMBER = 3; + private io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar exemplar_; + /** + * optional .io.prometheus.client.Exemplar exemplar = 3; + * @return Whether the exemplar field is set. + */ + @java.lang.Override + public boolean hasExemplar() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 3; + * @return The exemplar. + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar getExemplar() { + return exemplar_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.getDefaultInstance() : exemplar_; + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 3; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder getExemplarOrBuilder() { + return exemplar_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.getDefaultInstance() : exemplar_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeUInt64(1, cumulativeCount_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeDouble(2, upperBound_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(3, getExemplar()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeDouble(4, cumulativeCountFloat_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, cumulativeCount_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(2, upperBound_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getExemplar()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(4, cumulativeCountFloat_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket)) { + return super.equals(obj); + } + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket other = (io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket) obj; + + if (hasCumulativeCount() != other.hasCumulativeCount()) return false; + if (hasCumulativeCount()) { + if (getCumulativeCount() + != other.getCumulativeCount()) return false; + } + if (hasCumulativeCountFloat() != other.hasCumulativeCountFloat()) return false; + if (hasCumulativeCountFloat()) { + if (java.lang.Double.doubleToLongBits(getCumulativeCountFloat()) + != java.lang.Double.doubleToLongBits( + other.getCumulativeCountFloat())) return false; + } + if (hasUpperBound() != other.hasUpperBound()) return false; + if (hasUpperBound()) { + if (java.lang.Double.doubleToLongBits(getUpperBound()) + != java.lang.Double.doubleToLongBits( + other.getUpperBound())) return false; + } + if (hasExemplar() != other.hasExemplar()) return false; + if (hasExemplar()) { + if (!getExemplar() + .equals(other.getExemplar())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCumulativeCount()) { + hash = (37 * hash) + CUMULATIVE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getCumulativeCount()); + } + if (hasCumulativeCountFloat()) { + hash = (37 * hash) + CUMULATIVE_COUNT_FLOAT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getCumulativeCountFloat())); + } + if (hasUpperBound()) { + hash = (37 * hash) + UPPER_BOUND_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getUpperBound())); + } + if (hasExemplar()) { + hash = (37 * hash) + EXEMPLAR_FIELD_NUMBER; + hash = (53 * hash) + getExemplar().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * A Bucket of a conventional histogram, each of which is treated as
    +     * an individual counter-like time series by Prometheus.
    +     * 
    + * + * Protobuf type {@code io.prometheus.client.Bucket} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:io.prometheus.client.Bucket) + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Bucket_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Bucket_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.Builder.class); + } + + // Construct using io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetExemplarFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + cumulativeCount_ = 0L; + cumulativeCountFloat_ = 0D; + upperBound_ = 0D; + exemplar_ = null; + if (exemplarBuilder_ != null) { + exemplarBuilder_.dispose(); + exemplarBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Bucket_descriptor; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket getDefaultInstanceForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.getDefaultInstance(); + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket build() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket buildPartial() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket result = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cumulativeCount_ = cumulativeCount_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.cumulativeCountFloat_ = cumulativeCountFloat_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.upperBound_ = upperBound_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.exemplar_ = exemplarBuilder_ == null + ? exemplar_ + : exemplarBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket) { + return mergeFrom((io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket other) { + if (other == io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket.getDefaultInstance()) return this; + if (other.hasCumulativeCount()) { + setCumulativeCount(other.getCumulativeCount()); + } + if (other.hasCumulativeCountFloat()) { + setCumulativeCountFloat(other.getCumulativeCountFloat()); + } + if (other.hasUpperBound()) { + setUpperBound(other.getUpperBound()); + } + if (other.hasExemplar()) { + mergeExemplar(other.getExemplar()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + cumulativeCount_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 17: { + upperBound_ = input.readDouble(); + bitField0_ |= 0x00000004; + break; + } // case 17 + case 26: { + input.readMessage( + internalGetExemplarFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 33: { + cumulativeCountFloat_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 33 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long cumulativeCount_ ; + /** + *
    +       * Cumulative in increasing order.
    +       * 
    + * + * optional uint64 cumulative_count = 1; + * @return Whether the cumulativeCount field is set. + */ + @java.lang.Override + public boolean hasCumulativeCount() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +       * Cumulative in increasing order.
    +       * 
    + * + * optional uint64 cumulative_count = 1; + * @return The cumulativeCount. + */ + @java.lang.Override + public long getCumulativeCount() { + return cumulativeCount_; + } + /** + *
    +       * Cumulative in increasing order.
    +       * 
    + * + * optional uint64 cumulative_count = 1; + * @param value The cumulativeCount to set. + * @return This builder for chaining. + */ + public Builder setCumulativeCount(long value) { + + cumulativeCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Cumulative in increasing order.
    +       * 
    + * + * optional uint64 cumulative_count = 1; + * @return This builder for chaining. + */ + public Builder clearCumulativeCount() { + bitField0_ = (bitField0_ & ~0x00000001); + cumulativeCount_ = 0L; + onChanged(); + return this; + } + + private double cumulativeCountFloat_ ; + /** + *
    +       * Overrides cumulative_count if > 0.
    +       * 
    + * + * optional double cumulative_count_float = 4; + * @return Whether the cumulativeCountFloat field is set. + */ + @java.lang.Override + public boolean hasCumulativeCountFloat() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +       * Overrides cumulative_count if > 0.
    +       * 
    + * + * optional double cumulative_count_float = 4; + * @return The cumulativeCountFloat. + */ + @java.lang.Override + public double getCumulativeCountFloat() { + return cumulativeCountFloat_; + } + /** + *
    +       * Overrides cumulative_count if > 0.
    +       * 
    + * + * optional double cumulative_count_float = 4; + * @param value The cumulativeCountFloat to set. + * @return This builder for chaining. + */ + public Builder setCumulativeCountFloat(double value) { + + cumulativeCountFloat_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Overrides cumulative_count if > 0.
    +       * 
    + * + * optional double cumulative_count_float = 4; + * @return This builder for chaining. + */ + public Builder clearCumulativeCountFloat() { + bitField0_ = (bitField0_ & ~0x00000002); + cumulativeCountFloat_ = 0D; + onChanged(); + return this; + } + + private double upperBound_ ; + /** + *
    +       * Inclusive.
    +       * 
    + * + * optional double upper_bound = 2; + * @return Whether the upperBound field is set. + */ + @java.lang.Override + public boolean hasUpperBound() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +       * Inclusive.
    +       * 
    + * + * optional double upper_bound = 2; + * @return The upperBound. + */ + @java.lang.Override + public double getUpperBound() { + return upperBound_; + } + /** + *
    +       * Inclusive.
    +       * 
    + * + * optional double upper_bound = 2; + * @param value The upperBound to set. + * @return This builder for chaining. + */ + public Builder setUpperBound(double value) { + + upperBound_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Inclusive.
    +       * 
    + * + * optional double upper_bound = 2; + * @return This builder for chaining. + */ + public Builder clearUpperBound() { + bitField0_ = (bitField0_ & ~0x00000004); + upperBound_ = 0D; + onChanged(); + return this; + } + + private io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar exemplar_; + private com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder> exemplarBuilder_; + /** + * optional .io.prometheus.client.Exemplar exemplar = 3; + * @return Whether the exemplar field is set. + */ + public boolean hasExemplar() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 3; + * @return The exemplar. + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar getExemplar() { + if (exemplarBuilder_ == null) { + return exemplar_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.getDefaultInstance() : exemplar_; + } else { + return exemplarBuilder_.getMessage(); + } + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 3; + */ + public Builder setExemplar(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar value) { + if (exemplarBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + exemplar_ = value; + } else { + exemplarBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 3; + */ + public Builder setExemplar( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder builderForValue) { + if (exemplarBuilder_ == null) { + exemplar_ = builderForValue.build(); + } else { + exemplarBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 3; + */ + public Builder mergeExemplar(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar value) { + if (exemplarBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + exemplar_ != null && + exemplar_ != io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.getDefaultInstance()) { + getExemplarBuilder().mergeFrom(value); + } else { + exemplar_ = value; + } + } else { + exemplarBuilder_.mergeFrom(value); + } + if (exemplar_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 3; + */ + public Builder clearExemplar() { + bitField0_ = (bitField0_ & ~0x00000008); + exemplar_ = null; + if (exemplarBuilder_ != null) { + exemplarBuilder_.dispose(); + exemplarBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 3; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder getExemplarBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetExemplarFieldBuilder().getBuilder(); + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 3; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder getExemplarOrBuilder() { + if (exemplarBuilder_ != null) { + return exemplarBuilder_.getMessageOrBuilder(); + } else { + return exemplar_ == null ? + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.getDefaultInstance() : exemplar_; + } + } + /** + * optional .io.prometheus.client.Exemplar exemplar = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder> + internalGetExemplarFieldBuilder() { + if (exemplarBuilder_ == null) { + exemplarBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder>( + getExemplar(), + getParentForChildren(), + isClean()); + exemplar_ = null; + } + return exemplarBuilder_; + } + + // @@protoc_insertion_point(builder_scope:io.prometheus.client.Bucket) + } + + // @@protoc_insertion_point(class_scope:io.prometheus.client.Bucket) + private static final io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket(); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Bucket parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Bucket getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface BucketSpanOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.prometheus.client.BucketSpan) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Gap to previous span, or starting point for 1st span (which can be negative).
    +     * 
    + * + * optional sint32 offset = 1; + * @return Whether the offset field is set. + */ + boolean hasOffset(); + /** + *
    +     * Gap to previous span, or starting point for 1st span (which can be negative).
    +     * 
    + * + * optional sint32 offset = 1; + * @return The offset. + */ + int getOffset(); + + /** + *
    +     * Length of consecutive buckets.
    +     * 
    + * + * optional uint32 length = 2; + * @return Whether the length field is set. + */ + boolean hasLength(); + /** + *
    +     * Length of consecutive buckets.
    +     * 
    + * + * optional uint32 length = 2; + * @return The length. + */ + int getLength(); + } + /** + *
    +   * A BucketSpan defines a number of consecutive buckets in a native
    +   * histogram with their offset. Logically, it would be more
    +   * straightforward to include the bucket counts in the Span. However,
    +   * the protobuf representation is more compact in the way the data is
    +   * structured here (with all the buckets in a single array separate
    +   * from the Spans).
    +   * 
    + * + * Protobuf type {@code io.prometheus.client.BucketSpan} + */ + public static final class BucketSpan extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:io.prometheus.client.BucketSpan) + BucketSpanOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 4, + /* suffix= */ "", + "BucketSpan"); + } + // Use BucketSpan.newBuilder() to construct. + private BucketSpan(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BucketSpan() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_BucketSpan_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_BucketSpan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder.class); + } + + private int bitField0_; + public static final int OFFSET_FIELD_NUMBER = 1; + private int offset_ = 0; + /** + *
    +     * Gap to previous span, or starting point for 1st span (which can be negative).
    +     * 
    + * + * optional sint32 offset = 1; + * @return Whether the offset field is set. + */ + @java.lang.Override + public boolean hasOffset() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * Gap to previous span, or starting point for 1st span (which can be negative).
    +     * 
    + * + * optional sint32 offset = 1; + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + + public static final int LENGTH_FIELD_NUMBER = 2; + private int length_ = 0; + /** + *
    +     * Length of consecutive buckets.
    +     * 
    + * + * optional uint32 length = 2; + * @return Whether the length field is set. + */ + @java.lang.Override + public boolean hasLength() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * Length of consecutive buckets.
    +     * 
    + * + * optional uint32 length = 2; + * @return The length. + */ + @java.lang.Override + public int getLength() { + return length_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeSInt32(1, offset_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeUInt32(2, length_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeSInt32Size(1, offset_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, length_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan)) { + return super.equals(obj); + } + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan other = (io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan) obj; + + if (hasOffset() != other.hasOffset()) return false; + if (hasOffset()) { + if (getOffset() + != other.getOffset()) return false; + } + if (hasLength() != other.hasLength()) return false; + if (hasLength()) { + if (getLength() + != other.getLength()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOffset()) { + hash = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getOffset(); + } + if (hasLength()) { + hash = (37 * hash) + LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getLength(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * A BucketSpan defines a number of consecutive buckets in a native
    +     * histogram with their offset. Logically, it would be more
    +     * straightforward to include the bucket counts in the Span. However,
    +     * the protobuf representation is more compact in the way the data is
    +     * structured here (with all the buckets in a single array separate
    +     * from the Spans).
    +     * 
    + * + * Protobuf type {@code io.prometheus.client.BucketSpan} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:io.prometheus.client.BucketSpan) + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpanOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_BucketSpan_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_BucketSpan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.Builder.class); + } + + // Construct using io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + offset_ = 0; + length_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_BucketSpan_descriptor; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan getDefaultInstanceForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.getDefaultInstance(); + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan build() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan buildPartial() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan result = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.offset_ = offset_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.length_ = length_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan) { + return mergeFrom((io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan other) { + if (other == io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan.getDefaultInstance()) return this; + if (other.hasOffset()) { + setOffset(other.getOffset()); + } + if (other.hasLength()) { + setLength(other.getLength()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + offset_ = input.readSInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + length_ = input.readUInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int offset_ ; + /** + *
    +       * Gap to previous span, or starting point for 1st span (which can be negative).
    +       * 
    + * + * optional sint32 offset = 1; + * @return Whether the offset field is set. + */ + @java.lang.Override + public boolean hasOffset() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +       * Gap to previous span, or starting point for 1st span (which can be negative).
    +       * 
    + * + * optional sint32 offset = 1; + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + /** + *
    +       * Gap to previous span, or starting point for 1st span (which can be negative).
    +       * 
    + * + * optional sint32 offset = 1; + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(int value) { + + offset_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Gap to previous span, or starting point for 1st span (which can be negative).
    +       * 
    + * + * optional sint32 offset = 1; + * @return This builder for chaining. + */ + public Builder clearOffset() { + bitField0_ = (bitField0_ & ~0x00000001); + offset_ = 0; + onChanged(); + return this; + } + + private int length_ ; + /** + *
    +       * Length of consecutive buckets.
    +       * 
    + * + * optional uint32 length = 2; + * @return Whether the length field is set. + */ + @java.lang.Override + public boolean hasLength() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +       * Length of consecutive buckets.
    +       * 
    + * + * optional uint32 length = 2; + * @return The length. + */ + @java.lang.Override + public int getLength() { + return length_; + } + /** + *
    +       * Length of consecutive buckets.
    +       * 
    + * + * optional uint32 length = 2; + * @param value The length to set. + * @return This builder for chaining. + */ + public Builder setLength(int value) { + + length_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Length of consecutive buckets.
    +       * 
    + * + * optional uint32 length = 2; + * @return This builder for chaining. + */ + public Builder clearLength() { + bitField0_ = (bitField0_ & ~0x00000002); + length_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:io.prometheus.client.BucketSpan) + } + + // @@protoc_insertion_point(class_scope:io.prometheus.client.BucketSpan) + private static final io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan(); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BucketSpan parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.BucketSpan getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ExemplarOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.prometheus.client.Exemplar) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + java.util.List + getLabelList(); + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair getLabel(int index); + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + int getLabelCount(); + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + java.util.List + getLabelOrBuilderList(); + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPairOrBuilder getLabelOrBuilder( + int index); + + /** + * optional double value = 2; + * @return Whether the value field is set. + */ + boolean hasValue(); + /** + * optional double value = 2; + * @return The value. + */ + double getValue(); + + /** + *
    +     * OpenMetrics-style.
    +     * 
    + * + * optional .google.protobuf.Timestamp timestamp = 3; + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + /** + *
    +     * OpenMetrics-style.
    +     * 
    + * + * optional .google.protobuf.Timestamp timestamp = 3; + * @return The timestamp. + */ + com.google.protobuf.Timestamp getTimestamp(); + /** + *
    +     * OpenMetrics-style.
    +     * 
    + * + * optional .google.protobuf.Timestamp timestamp = 3; + */ + com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder(); + } + /** + * Protobuf type {@code io.prometheus.client.Exemplar} + */ + public static final class Exemplar extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:io.prometheus.client.Exemplar) + ExemplarOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 4, + /* suffix= */ "", + "Exemplar"); + } + // Use Exemplar.newBuilder() to construct. + private Exemplar(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Exemplar() { + label_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Exemplar_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Exemplar_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder.class); + } + + private int bitField0_; + public static final int LABEL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List label_; + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + @java.lang.Override + public java.util.List getLabelList() { + return label_; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + @java.lang.Override + public java.util.List + getLabelOrBuilderList() { + return label_; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + @java.lang.Override + public int getLabelCount() { + return label_.size(); + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair getLabel(int index) { + return label_.get(index); + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPairOrBuilder getLabelOrBuilder( + int index) { + return label_.get(index); + } + + public static final int VALUE_FIELD_NUMBER = 2; + private double value_ = 0D; + /** + * optional double value = 2; + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional double value = 2; + * @return The value. + */ + @java.lang.Override + public double getValue() { + return value_; + } + + public static final int TIMESTAMP_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp timestamp_; + /** + *
    +     * OpenMetrics-style.
    +     * 
    + * + * optional .google.protobuf.Timestamp timestamp = 3; + * @return Whether the timestamp field is set. + */ + @java.lang.Override + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * OpenMetrics-style.
    +     * 
    + * + * optional .google.protobuf.Timestamp timestamp = 3; + * @return The timestamp. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestamp() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + /** + *
    +     * OpenMetrics-style.
    +     * 
    + * + * optional .google.protobuf.Timestamp timestamp = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < label_.size(); i++) { + output.writeMessage(1, label_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeDouble(2, value_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getTimestamp()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < label_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, label_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(2, value_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getTimestamp()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar)) { + return super.equals(obj); + } + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar other = (io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar) obj; + + if (!getLabelList() + .equals(other.getLabelList())) return false; + if (hasValue() != other.hasValue()) return false; + if (hasValue()) { + if (java.lang.Double.doubleToLongBits(getValue()) + != java.lang.Double.doubleToLongBits( + other.getValue())) return false; + } + if (hasTimestamp() != other.hasTimestamp()) return false; + if (hasTimestamp()) { + if (!getTimestamp() + .equals(other.getTimestamp())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getLabelCount() > 0) { + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + getLabelList().hashCode(); + } + if (hasValue()) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getValue())); + } + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code io.prometheus.client.Exemplar} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:io.prometheus.client.Exemplar) + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.ExemplarOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Exemplar_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Exemplar_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.Builder.class); + } + + // Construct using io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetLabelFieldBuilder(); + internalGetTimestampFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (labelBuilder_ == null) { + label_ = java.util.Collections.emptyList(); + } else { + label_ = null; + labelBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + value_ = 0D; + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Exemplar_descriptor; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar getDefaultInstanceForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.getDefaultInstance(); + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar build() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar buildPartial() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar result = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar result) { + if (labelBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + label_ = java.util.Collections.unmodifiableList(label_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.label_ = label_; + } else { + result.label_ = labelBuilder_.build(); + } + } + + private void buildPartial0(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.timestamp_ = timestampBuilder_ == null + ? timestamp_ + : timestampBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar) { + return mergeFrom((io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar other) { + if (other == io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar.getDefaultInstance()) return this; + if (labelBuilder_ == null) { + if (!other.label_.isEmpty()) { + if (label_.isEmpty()) { + label_ = other.label_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLabelIsMutable(); + label_.addAll(other.label_); + } + onChanged(); + } + } else { + if (!other.label_.isEmpty()) { + if (labelBuilder_.isEmpty()) { + labelBuilder_.dispose(); + labelBuilder_ = null; + label_ = other.label_; + bitField0_ = (bitField0_ & ~0x00000001); + labelBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + internalGetLabelFieldBuilder() : null; + } else { + labelBuilder_.addAllMessages(other.label_); + } + } + } + if (other.hasValue()) { + setValue(other.getValue()); + } + if (other.hasTimestamp()) { + mergeTimestamp(other.getTimestamp()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair m = + input.readMessage( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.parser(), + extensionRegistry); + if (labelBuilder_ == null) { + ensureLabelIsMutable(); + label_.add(m); + } else { + labelBuilder_.addMessage(m); + } + break; + } // case 10 + case 17: { + value_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + case 26: { + input.readMessage( + internalGetTimestampFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List label_ = + java.util.Collections.emptyList(); + private void ensureLabelIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + label_ = new java.util.ArrayList(label_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPairOrBuilder> labelBuilder_; + + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public java.util.List getLabelList() { + if (labelBuilder_ == null) { + return java.util.Collections.unmodifiableList(label_); + } else { + return labelBuilder_.getMessageList(); + } + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public int getLabelCount() { + if (labelBuilder_ == null) { + return label_.size(); + } else { + return labelBuilder_.getCount(); + } + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair getLabel(int index) { + if (labelBuilder_ == null) { + return label_.get(index); + } else { + return labelBuilder_.getMessage(index); + } + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public Builder setLabel( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair value) { + if (labelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelIsMutable(); + label_.set(index, value); + onChanged(); + } else { + labelBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public Builder setLabel( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder builderForValue) { + if (labelBuilder_ == null) { + ensureLabelIsMutable(); + label_.set(index, builderForValue.build()); + onChanged(); + } else { + labelBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public Builder addLabel(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair value) { + if (labelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelIsMutable(); + label_.add(value); + onChanged(); + } else { + labelBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public Builder addLabel( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair value) { + if (labelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelIsMutable(); + label_.add(index, value); + onChanged(); + } else { + labelBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public Builder addLabel( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder builderForValue) { + if (labelBuilder_ == null) { + ensureLabelIsMutable(); + label_.add(builderForValue.build()); + onChanged(); + } else { + labelBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public Builder addLabel( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder builderForValue) { + if (labelBuilder_ == null) { + ensureLabelIsMutable(); + label_.add(index, builderForValue.build()); + onChanged(); + } else { + labelBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public Builder addAllLabel( + java.lang.Iterable values) { + if (labelBuilder_ == null) { + ensureLabelIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, label_); + onChanged(); + } else { + labelBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public Builder clearLabel() { + if (labelBuilder_ == null) { + label_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + labelBuilder_.clear(); + } + return this; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public Builder removeLabel(int index) { + if (labelBuilder_ == null) { + ensureLabelIsMutable(); + label_.remove(index); + onChanged(); + } else { + labelBuilder_.remove(index); + } + return this; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder getLabelBuilder( + int index) { + return internalGetLabelFieldBuilder().getBuilder(index); + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPairOrBuilder getLabelOrBuilder( + int index) { + if (labelBuilder_ == null) { + return label_.get(index); } else { + return labelBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public java.util.List + getLabelOrBuilderList() { + if (labelBuilder_ != null) { + return labelBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(label_); + } + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder addLabelBuilder() { + return internalGetLabelFieldBuilder().addBuilder( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.getDefaultInstance()); + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder addLabelBuilder( + int index) { + return internalGetLabelFieldBuilder().addBuilder( + index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.getDefaultInstance()); + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public java.util.List + getLabelBuilderList() { + return internalGetLabelFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPairOrBuilder> + internalGetLabelFieldBuilder() { + if (labelBuilder_ == null) { + labelBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPairOrBuilder>( + label_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + label_ = null; + } + return labelBuilder_; + } + + private double value_ ; + /** + * optional double value = 2; + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional double value = 2; + * @return The value. + */ + @java.lang.Override + public double getValue() { + return value_; + } + /** + * optional double value = 2; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(double value) { + + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * optional double value = 2; + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000002); + value_ = 0D; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp timestamp_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> timestampBuilder_; + /** + *
    +       * OpenMetrics-style.
    +       * 
    + * + * optional .google.protobuf.Timestamp timestamp = 3; + * @return Whether the timestamp field is set. + */ + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +       * OpenMetrics-style.
    +       * 
    + * + * optional .google.protobuf.Timestamp timestamp = 3; + * @return The timestamp. + */ + public com.google.protobuf.Timestamp getTimestamp() { + if (timestampBuilder_ == null) { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } else { + return timestampBuilder_.getMessage(); + } + } + /** + *
    +       * OpenMetrics-style.
    +       * 
    + * + * optional .google.protobuf.Timestamp timestamp = 3; + */ + public Builder setTimestamp(com.google.protobuf.Timestamp value) { + if (timestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timestamp_ = value; + } else { + timestampBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * OpenMetrics-style.
    +       * 
    + * + * optional .google.protobuf.Timestamp timestamp = 3; + */ + public Builder setTimestamp( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (timestampBuilder_ == null) { + timestamp_ = builderForValue.build(); + } else { + timestampBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * OpenMetrics-style.
    +       * 
    + * + * optional .google.protobuf.Timestamp timestamp = 3; + */ + public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { + if (timestampBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + timestamp_ != null && + timestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getTimestampBuilder().mergeFrom(value); + } else { + timestamp_ = value; + } + } else { + timestampBuilder_.mergeFrom(value); + } + if (timestamp_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
    +       * OpenMetrics-style.
    +       * 
    + * + * optional .google.protobuf.Timestamp timestamp = 3; + */ + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00000004); + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * OpenMetrics-style.
    +       * 
    + * + * optional .google.protobuf.Timestamp timestamp = 3; + */ + public com.google.protobuf.Timestamp.Builder getTimestampBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetTimestampFieldBuilder().getBuilder(); + } + /** + *
    +       * OpenMetrics-style.
    +       * 
    + * + * optional .google.protobuf.Timestamp timestamp = 3; + */ + public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { + if (timestampBuilder_ != null) { + return timestampBuilder_.getMessageOrBuilder(); + } else { + return timestamp_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + } + /** + *
    +       * OpenMetrics-style.
    +       * 
    + * + * optional .google.protobuf.Timestamp timestamp = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + internalGetTimestampFieldBuilder() { + if (timestampBuilder_ == null) { + timestampBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getTimestamp(), + getParentForChildren(), + isClean()); + timestamp_ = null; + } + return timestampBuilder_; + } + + // @@protoc_insertion_point(builder_scope:io.prometheus.client.Exemplar) + } + + // @@protoc_insertion_point(class_scope:io.prometheus.client.Exemplar) + private static final io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar(); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Exemplar parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Exemplar getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface MetricOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.prometheus.client.Metric) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + java.util.List + getLabelList(); + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair getLabel(int index); + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + int getLabelCount(); + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + java.util.List + getLabelOrBuilderList(); + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPairOrBuilder getLabelOrBuilder( + int index); + + /** + * optional .io.prometheus.client.Gauge gauge = 2; + * @return Whether the gauge field is set. + */ + boolean hasGauge(); + /** + * optional .io.prometheus.client.Gauge gauge = 2; + * @return The gauge. + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge getGauge(); + /** + * optional .io.prometheus.client.Gauge gauge = 2; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.GaugeOrBuilder getGaugeOrBuilder(); + + /** + * optional .io.prometheus.client.Counter counter = 3; + * @return Whether the counter field is set. + */ + boolean hasCounter(); + /** + * optional .io.prometheus.client.Counter counter = 3; + * @return The counter. + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter getCounter(); + /** + * optional .io.prometheus.client.Counter counter = 3; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.CounterOrBuilder getCounterOrBuilder(); + + /** + * optional .io.prometheus.client.Summary summary = 4; + * @return Whether the summary field is set. + */ + boolean hasSummary(); + /** + * optional .io.prometheus.client.Summary summary = 4; + * @return The summary. + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary getSummary(); + /** + * optional .io.prometheus.client.Summary summary = 4; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.SummaryOrBuilder getSummaryOrBuilder(); + + /** + * optional .io.prometheus.client.Untyped untyped = 5; + * @return Whether the untyped field is set. + */ + boolean hasUntyped(); + /** + * optional .io.prometheus.client.Untyped untyped = 5; + * @return The untyped. + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped getUntyped(); + /** + * optional .io.prometheus.client.Untyped untyped = 5; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.UntypedOrBuilder getUntypedOrBuilder(); + + /** + * optional .io.prometheus.client.Histogram histogram = 7; + * @return Whether the histogram field is set. + */ + boolean hasHistogram(); + /** + * optional .io.prometheus.client.Histogram histogram = 7; + * @return The histogram. + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram getHistogram(); + /** + * optional .io.prometheus.client.Histogram histogram = 7; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.HistogramOrBuilder getHistogramOrBuilder(); + + /** + * optional int64 timestamp_ms = 6; + * @return Whether the timestampMs field is set. + */ + boolean hasTimestampMs(); + /** + * optional int64 timestamp_ms = 6; + * @return The timestampMs. + */ + long getTimestampMs(); + } + /** + * Protobuf type {@code io.prometheus.client.Metric} + */ + public static final class Metric extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:io.prometheus.client.Metric) + MetricOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 4, + /* suffix= */ "", + "Metric"); + } + // Use Metric.newBuilder() to construct. + private Metric(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Metric() { + label_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Metric_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Metric_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.Builder.class); + } + + private int bitField0_; + public static final int LABEL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List label_; + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + @java.lang.Override + public java.util.List getLabelList() { + return label_; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + @java.lang.Override + public java.util.List + getLabelOrBuilderList() { + return label_; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + @java.lang.Override + public int getLabelCount() { + return label_.size(); + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair getLabel(int index) { + return label_.get(index); + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPairOrBuilder getLabelOrBuilder( + int index) { + return label_.get(index); + } + + public static final int GAUGE_FIELD_NUMBER = 2; + private io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge gauge_; + /** + * optional .io.prometheus.client.Gauge gauge = 2; + * @return Whether the gauge field is set. + */ + @java.lang.Override + public boolean hasGauge() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .io.prometheus.client.Gauge gauge = 2; + * @return The gauge. + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge getGauge() { + return gauge_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge.getDefaultInstance() : gauge_; + } + /** + * optional .io.prometheus.client.Gauge gauge = 2; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.GaugeOrBuilder getGaugeOrBuilder() { + return gauge_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge.getDefaultInstance() : gauge_; + } + + public static final int COUNTER_FIELD_NUMBER = 3; + private io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter counter_; + /** + * optional .io.prometheus.client.Counter counter = 3; + * @return Whether the counter field is set. + */ + @java.lang.Override + public boolean hasCounter() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional .io.prometheus.client.Counter counter = 3; + * @return The counter. + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter getCounter() { + return counter_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter.getDefaultInstance() : counter_; + } + /** + * optional .io.prometheus.client.Counter counter = 3; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.CounterOrBuilder getCounterOrBuilder() { + return counter_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter.getDefaultInstance() : counter_; + } + + public static final int SUMMARY_FIELD_NUMBER = 4; + private io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary summary_; + /** + * optional .io.prometheus.client.Summary summary = 4; + * @return Whether the summary field is set. + */ + @java.lang.Override + public boolean hasSummary() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional .io.prometheus.client.Summary summary = 4; + * @return The summary. + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary getSummary() { + return summary_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary.getDefaultInstance() : summary_; + } + /** + * optional .io.prometheus.client.Summary summary = 4; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.SummaryOrBuilder getSummaryOrBuilder() { + return summary_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary.getDefaultInstance() : summary_; + } + + public static final int UNTYPED_FIELD_NUMBER = 5; + private io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped untyped_; + /** + * optional .io.prometheus.client.Untyped untyped = 5; + * @return Whether the untyped field is set. + */ + @java.lang.Override + public boolean hasUntyped() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional .io.prometheus.client.Untyped untyped = 5; + * @return The untyped. + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped getUntyped() { + return untyped_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped.getDefaultInstance() : untyped_; + } + /** + * optional .io.prometheus.client.Untyped untyped = 5; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.UntypedOrBuilder getUntypedOrBuilder() { + return untyped_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped.getDefaultInstance() : untyped_; + } + + public static final int HISTOGRAM_FIELD_NUMBER = 7; + private io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram histogram_; + /** + * optional .io.prometheus.client.Histogram histogram = 7; + * @return Whether the histogram field is set. + */ + @java.lang.Override + public boolean hasHistogram() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional .io.prometheus.client.Histogram histogram = 7; + * @return The histogram. + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram getHistogram() { + return histogram_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram.getDefaultInstance() : histogram_; + } + /** + * optional .io.prometheus.client.Histogram histogram = 7; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.HistogramOrBuilder getHistogramOrBuilder() { + return histogram_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram.getDefaultInstance() : histogram_; + } + + public static final int TIMESTAMP_MS_FIELD_NUMBER = 6; + private long timestampMs_ = 0L; + /** + * optional int64 timestamp_ms = 6; + * @return Whether the timestampMs field is set. + */ + @java.lang.Override + public boolean hasTimestampMs() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional int64 timestamp_ms = 6; + * @return The timestampMs. + */ + @java.lang.Override + public long getTimestampMs() { + return timestampMs_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < label_.size(); i++) { + output.writeMessage(1, label_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getGauge()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getCounter()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getSummary()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(5, getUntyped()); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeInt64(6, timestampMs_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(7, getHistogram()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < label_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, label_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getGauge()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getCounter()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getSummary()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getUntyped()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(6, timestampMs_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getHistogram()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric)) { + return super.equals(obj); + } + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric other = (io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric) obj; + + if (!getLabelList() + .equals(other.getLabelList())) return false; + if (hasGauge() != other.hasGauge()) return false; + if (hasGauge()) { + if (!getGauge() + .equals(other.getGauge())) return false; + } + if (hasCounter() != other.hasCounter()) return false; + if (hasCounter()) { + if (!getCounter() + .equals(other.getCounter())) return false; + } + if (hasSummary() != other.hasSummary()) return false; + if (hasSummary()) { + if (!getSummary() + .equals(other.getSummary())) return false; + } + if (hasUntyped() != other.hasUntyped()) return false; + if (hasUntyped()) { + if (!getUntyped() + .equals(other.getUntyped())) return false; + } + if (hasHistogram() != other.hasHistogram()) return false; + if (hasHistogram()) { + if (!getHistogram() + .equals(other.getHistogram())) return false; + } + if (hasTimestampMs() != other.hasTimestampMs()) return false; + if (hasTimestampMs()) { + if (getTimestampMs() + != other.getTimestampMs()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getLabelCount() > 0) { + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + getLabelList().hashCode(); + } + if (hasGauge()) { + hash = (37 * hash) + GAUGE_FIELD_NUMBER; + hash = (53 * hash) + getGauge().hashCode(); + } + if (hasCounter()) { + hash = (37 * hash) + COUNTER_FIELD_NUMBER; + hash = (53 * hash) + getCounter().hashCode(); + } + if (hasSummary()) { + hash = (37 * hash) + SUMMARY_FIELD_NUMBER; + hash = (53 * hash) + getSummary().hashCode(); + } + if (hasUntyped()) { + hash = (37 * hash) + UNTYPED_FIELD_NUMBER; + hash = (53 * hash) + getUntyped().hashCode(); + } + if (hasHistogram()) { + hash = (37 * hash) + HISTOGRAM_FIELD_NUMBER; + hash = (53 * hash) + getHistogram().hashCode(); + } + if (hasTimestampMs()) { + hash = (37 * hash) + TIMESTAMP_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestampMs()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code io.prometheus.client.Metric} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:io.prometheus.client.Metric) + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Metric_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Metric_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.Builder.class); + } + + // Construct using io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetLabelFieldBuilder(); + internalGetGaugeFieldBuilder(); + internalGetCounterFieldBuilder(); + internalGetSummaryFieldBuilder(); + internalGetUntypedFieldBuilder(); + internalGetHistogramFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (labelBuilder_ == null) { + label_ = java.util.Collections.emptyList(); + } else { + label_ = null; + labelBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + gauge_ = null; + if (gaugeBuilder_ != null) { + gaugeBuilder_.dispose(); + gaugeBuilder_ = null; + } + counter_ = null; + if (counterBuilder_ != null) { + counterBuilder_.dispose(); + counterBuilder_ = null; + } + summary_ = null; + if (summaryBuilder_ != null) { + summaryBuilder_.dispose(); + summaryBuilder_ = null; + } + untyped_ = null; + if (untypedBuilder_ != null) { + untypedBuilder_.dispose(); + untypedBuilder_ = null; + } + histogram_ = null; + if (histogramBuilder_ != null) { + histogramBuilder_.dispose(); + histogramBuilder_ = null; + } + timestampMs_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_Metric_descriptor; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric getDefaultInstanceForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.getDefaultInstance(); + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric build() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric buildPartial() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric result = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric result) { + if (labelBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + label_ = java.util.Collections.unmodifiableList(label_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.label_ = label_; + } else { + result.label_ = labelBuilder_.build(); + } + } + + private void buildPartial0(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.gauge_ = gaugeBuilder_ == null + ? gauge_ + : gaugeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.counter_ = counterBuilder_ == null + ? counter_ + : counterBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.summary_ = summaryBuilder_ == null + ? summary_ + : summaryBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.untyped_ = untypedBuilder_ == null + ? untyped_ + : untypedBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.histogram_ = histogramBuilder_ == null + ? histogram_ + : histogramBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.timestampMs_ = timestampMs_; + to_bitField0_ |= 0x00000020; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric) { + return mergeFrom((io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric other) { + if (other == io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.getDefaultInstance()) return this; + if (labelBuilder_ == null) { + if (!other.label_.isEmpty()) { + if (label_.isEmpty()) { + label_ = other.label_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLabelIsMutable(); + label_.addAll(other.label_); + } + onChanged(); + } + } else { + if (!other.label_.isEmpty()) { + if (labelBuilder_.isEmpty()) { + labelBuilder_.dispose(); + labelBuilder_ = null; + label_ = other.label_; + bitField0_ = (bitField0_ & ~0x00000001); + labelBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + internalGetLabelFieldBuilder() : null; + } else { + labelBuilder_.addAllMessages(other.label_); + } + } + } + if (other.hasGauge()) { + mergeGauge(other.getGauge()); + } + if (other.hasCounter()) { + mergeCounter(other.getCounter()); + } + if (other.hasSummary()) { + mergeSummary(other.getSummary()); + } + if (other.hasUntyped()) { + mergeUntyped(other.getUntyped()); + } + if (other.hasHistogram()) { + mergeHistogram(other.getHistogram()); + } + if (other.hasTimestampMs()) { + setTimestampMs(other.getTimestampMs()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair m = + input.readMessage( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.parser(), + extensionRegistry); + if (labelBuilder_ == null) { + ensureLabelIsMutable(); + label_.add(m); + } else { + labelBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: { + input.readMessage( + internalGetGaugeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + internalGetCounterFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + input.readMessage( + internalGetSummaryFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: { + input.readMessage( + internalGetUntypedFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: { + timestampMs_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 48 + case 58: { + input.readMessage( + internalGetHistogramFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 58 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List label_ = + java.util.Collections.emptyList(); + private void ensureLabelIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + label_ = new java.util.ArrayList(label_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPairOrBuilder> labelBuilder_; + + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public java.util.List getLabelList() { + if (labelBuilder_ == null) { + return java.util.Collections.unmodifiableList(label_); + } else { + return labelBuilder_.getMessageList(); + } + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public int getLabelCount() { + if (labelBuilder_ == null) { + return label_.size(); + } else { + return labelBuilder_.getCount(); + } + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair getLabel(int index) { + if (labelBuilder_ == null) { + return label_.get(index); + } else { + return labelBuilder_.getMessage(index); + } + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public Builder setLabel( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair value) { + if (labelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelIsMutable(); + label_.set(index, value); + onChanged(); + } else { + labelBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public Builder setLabel( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder builderForValue) { + if (labelBuilder_ == null) { + ensureLabelIsMutable(); + label_.set(index, builderForValue.build()); + onChanged(); + } else { + labelBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public Builder addLabel(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair value) { + if (labelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelIsMutable(); + label_.add(value); + onChanged(); + } else { + labelBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public Builder addLabel( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair value) { + if (labelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelIsMutable(); + label_.add(index, value); + onChanged(); + } else { + labelBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public Builder addLabel( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder builderForValue) { + if (labelBuilder_ == null) { + ensureLabelIsMutable(); + label_.add(builderForValue.build()); + onChanged(); + } else { + labelBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public Builder addLabel( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder builderForValue) { + if (labelBuilder_ == null) { + ensureLabelIsMutable(); + label_.add(index, builderForValue.build()); + onChanged(); + } else { + labelBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public Builder addAllLabel( + java.lang.Iterable values) { + if (labelBuilder_ == null) { + ensureLabelIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, label_); + onChanged(); + } else { + labelBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public Builder clearLabel() { + if (labelBuilder_ == null) { + label_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + labelBuilder_.clear(); + } + return this; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public Builder removeLabel(int index) { + if (labelBuilder_ == null) { + ensureLabelIsMutable(); + label_.remove(index); + onChanged(); + } else { + labelBuilder_.remove(index); + } + return this; + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder getLabelBuilder( + int index) { + return internalGetLabelFieldBuilder().getBuilder(index); + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPairOrBuilder getLabelOrBuilder( + int index) { + if (labelBuilder_ == null) { + return label_.get(index); } else { + return labelBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public java.util.List + getLabelOrBuilderList() { + if (labelBuilder_ != null) { + return labelBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(label_); + } + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder addLabelBuilder() { + return internalGetLabelFieldBuilder().addBuilder( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.getDefaultInstance()); + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder addLabelBuilder( + int index) { + return internalGetLabelFieldBuilder().addBuilder( + index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.getDefaultInstance()); + } + /** + * repeated .io.prometheus.client.LabelPair label = 1; + */ + public java.util.List + getLabelBuilderList() { + return internalGetLabelFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPairOrBuilder> + internalGetLabelFieldBuilder() { + if (labelBuilder_ == null) { + labelBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPair.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.LabelPairOrBuilder>( + label_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + label_ = null; + } + return labelBuilder_; + } + + private io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge gauge_; + private com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.GaugeOrBuilder> gaugeBuilder_; + /** + * optional .io.prometheus.client.Gauge gauge = 2; + * @return Whether the gauge field is set. + */ + public boolean hasGauge() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional .io.prometheus.client.Gauge gauge = 2; + * @return The gauge. + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge getGauge() { + if (gaugeBuilder_ == null) { + return gauge_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge.getDefaultInstance() : gauge_; + } else { + return gaugeBuilder_.getMessage(); + } + } + /** + * optional .io.prometheus.client.Gauge gauge = 2; + */ + public Builder setGauge(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge value) { + if (gaugeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gauge_ = value; + } else { + gaugeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Gauge gauge = 2; + */ + public Builder setGauge( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge.Builder builderForValue) { + if (gaugeBuilder_ == null) { + gauge_ = builderForValue.build(); + } else { + gaugeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Gauge gauge = 2; + */ + public Builder mergeGauge(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge value) { + if (gaugeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + gauge_ != null && + gauge_ != io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge.getDefaultInstance()) { + getGaugeBuilder().mergeFrom(value); + } else { + gauge_ = value; + } + } else { + gaugeBuilder_.mergeFrom(value); + } + if (gauge_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * optional .io.prometheus.client.Gauge gauge = 2; + */ + public Builder clearGauge() { + bitField0_ = (bitField0_ & ~0x00000002); + gauge_ = null; + if (gaugeBuilder_ != null) { + gaugeBuilder_.dispose(); + gaugeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Gauge gauge = 2; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge.Builder getGaugeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetGaugeFieldBuilder().getBuilder(); + } + /** + * optional .io.prometheus.client.Gauge gauge = 2; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.GaugeOrBuilder getGaugeOrBuilder() { + if (gaugeBuilder_ != null) { + return gaugeBuilder_.getMessageOrBuilder(); + } else { + return gauge_ == null ? + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge.getDefaultInstance() : gauge_; + } + } + /** + * optional .io.prometheus.client.Gauge gauge = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.GaugeOrBuilder> + internalGetGaugeFieldBuilder() { + if (gaugeBuilder_ == null) { + gaugeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Gauge.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.GaugeOrBuilder>( + getGauge(), + getParentForChildren(), + isClean()); + gauge_ = null; + } + return gaugeBuilder_; + } + + private io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter counter_; + private com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.CounterOrBuilder> counterBuilder_; + /** + * optional .io.prometheus.client.Counter counter = 3; + * @return Whether the counter field is set. + */ + public boolean hasCounter() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional .io.prometheus.client.Counter counter = 3; + * @return The counter. + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter getCounter() { + if (counterBuilder_ == null) { + return counter_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter.getDefaultInstance() : counter_; + } else { + return counterBuilder_.getMessage(); + } + } + /** + * optional .io.prometheus.client.Counter counter = 3; + */ + public Builder setCounter(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter value) { + if (counterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + counter_ = value; + } else { + counterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Counter counter = 3; + */ + public Builder setCounter( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter.Builder builderForValue) { + if (counterBuilder_ == null) { + counter_ = builderForValue.build(); + } else { + counterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Counter counter = 3; + */ + public Builder mergeCounter(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter value) { + if (counterBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + counter_ != null && + counter_ != io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter.getDefaultInstance()) { + getCounterBuilder().mergeFrom(value); + } else { + counter_ = value; + } + } else { + counterBuilder_.mergeFrom(value); + } + if (counter_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * optional .io.prometheus.client.Counter counter = 3; + */ + public Builder clearCounter() { + bitField0_ = (bitField0_ & ~0x00000004); + counter_ = null; + if (counterBuilder_ != null) { + counterBuilder_.dispose(); + counterBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Counter counter = 3; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter.Builder getCounterBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetCounterFieldBuilder().getBuilder(); + } + /** + * optional .io.prometheus.client.Counter counter = 3; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.CounterOrBuilder getCounterOrBuilder() { + if (counterBuilder_ != null) { + return counterBuilder_.getMessageOrBuilder(); + } else { + return counter_ == null ? + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter.getDefaultInstance() : counter_; + } + } + /** + * optional .io.prometheus.client.Counter counter = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.CounterOrBuilder> + internalGetCounterFieldBuilder() { + if (counterBuilder_ == null) { + counterBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Counter.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.CounterOrBuilder>( + getCounter(), + getParentForChildren(), + isClean()); + counter_ = null; + } + return counterBuilder_; + } + + private io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary summary_; + private com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.SummaryOrBuilder> summaryBuilder_; + /** + * optional .io.prometheus.client.Summary summary = 4; + * @return Whether the summary field is set. + */ + public boolean hasSummary() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional .io.prometheus.client.Summary summary = 4; + * @return The summary. + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary getSummary() { + if (summaryBuilder_ == null) { + return summary_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary.getDefaultInstance() : summary_; + } else { + return summaryBuilder_.getMessage(); + } + } + /** + * optional .io.prometheus.client.Summary summary = 4; + */ + public Builder setSummary(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary value) { + if (summaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + summary_ = value; + } else { + summaryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Summary summary = 4; + */ + public Builder setSummary( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary.Builder builderForValue) { + if (summaryBuilder_ == null) { + summary_ = builderForValue.build(); + } else { + summaryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Summary summary = 4; + */ + public Builder mergeSummary(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary value) { + if (summaryBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + summary_ != null && + summary_ != io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary.getDefaultInstance()) { + getSummaryBuilder().mergeFrom(value); + } else { + summary_ = value; + } + } else { + summaryBuilder_.mergeFrom(value); + } + if (summary_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * optional .io.prometheus.client.Summary summary = 4; + */ + public Builder clearSummary() { + bitField0_ = (bitField0_ & ~0x00000008); + summary_ = null; + if (summaryBuilder_ != null) { + summaryBuilder_.dispose(); + summaryBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Summary summary = 4; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary.Builder getSummaryBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetSummaryFieldBuilder().getBuilder(); + } + /** + * optional .io.prometheus.client.Summary summary = 4; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.SummaryOrBuilder getSummaryOrBuilder() { + if (summaryBuilder_ != null) { + return summaryBuilder_.getMessageOrBuilder(); + } else { + return summary_ == null ? + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary.getDefaultInstance() : summary_; + } + } + /** + * optional .io.prometheus.client.Summary summary = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.SummaryOrBuilder> + internalGetSummaryFieldBuilder() { + if (summaryBuilder_ == null) { + summaryBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Summary.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.SummaryOrBuilder>( + getSummary(), + getParentForChildren(), + isClean()); + summary_ = null; + } + return summaryBuilder_; + } + + private io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped untyped_; + private com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.UntypedOrBuilder> untypedBuilder_; + /** + * optional .io.prometheus.client.Untyped untyped = 5; + * @return Whether the untyped field is set. + */ + public boolean hasUntyped() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional .io.prometheus.client.Untyped untyped = 5; + * @return The untyped. + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped getUntyped() { + if (untypedBuilder_ == null) { + return untyped_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped.getDefaultInstance() : untyped_; + } else { + return untypedBuilder_.getMessage(); + } + } + /** + * optional .io.prometheus.client.Untyped untyped = 5; + */ + public Builder setUntyped(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped value) { + if (untypedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + untyped_ = value; + } else { + untypedBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Untyped untyped = 5; + */ + public Builder setUntyped( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped.Builder builderForValue) { + if (untypedBuilder_ == null) { + untyped_ = builderForValue.build(); + } else { + untypedBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Untyped untyped = 5; + */ + public Builder mergeUntyped(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped value) { + if (untypedBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + untyped_ != null && + untyped_ != io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped.getDefaultInstance()) { + getUntypedBuilder().mergeFrom(value); + } else { + untyped_ = value; + } + } else { + untypedBuilder_.mergeFrom(value); + } + if (untyped_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * optional .io.prometheus.client.Untyped untyped = 5; + */ + public Builder clearUntyped() { + bitField0_ = (bitField0_ & ~0x00000010); + untyped_ = null; + if (untypedBuilder_ != null) { + untypedBuilder_.dispose(); + untypedBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Untyped untyped = 5; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped.Builder getUntypedBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetUntypedFieldBuilder().getBuilder(); + } + /** + * optional .io.prometheus.client.Untyped untyped = 5; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.UntypedOrBuilder getUntypedOrBuilder() { + if (untypedBuilder_ != null) { + return untypedBuilder_.getMessageOrBuilder(); + } else { + return untyped_ == null ? + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped.getDefaultInstance() : untyped_; + } + } + /** + * optional .io.prometheus.client.Untyped untyped = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.UntypedOrBuilder> + internalGetUntypedFieldBuilder() { + if (untypedBuilder_ == null) { + untypedBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Untyped.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.UntypedOrBuilder>( + getUntyped(), + getParentForChildren(), + isClean()); + untyped_ = null; + } + return untypedBuilder_; + } + + private io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram histogram_; + private com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.HistogramOrBuilder> histogramBuilder_; + /** + * optional .io.prometheus.client.Histogram histogram = 7; + * @return Whether the histogram field is set. + */ + public boolean hasHistogram() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .io.prometheus.client.Histogram histogram = 7; + * @return The histogram. + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram getHistogram() { + if (histogramBuilder_ == null) { + return histogram_ == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram.getDefaultInstance() : histogram_; + } else { + return histogramBuilder_.getMessage(); + } + } + /** + * optional .io.prometheus.client.Histogram histogram = 7; + */ + public Builder setHistogram(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram value) { + if (histogramBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + histogram_ = value; + } else { + histogramBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Histogram histogram = 7; + */ + public Builder setHistogram( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram.Builder builderForValue) { + if (histogramBuilder_ == null) { + histogram_ = builderForValue.build(); + } else { + histogramBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Histogram histogram = 7; + */ + public Builder mergeHistogram(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram value) { + if (histogramBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + histogram_ != null && + histogram_ != io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram.getDefaultInstance()) { + getHistogramBuilder().mergeFrom(value); + } else { + histogram_ = value; + } + } else { + histogramBuilder_.mergeFrom(value); + } + if (histogram_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * optional .io.prometheus.client.Histogram histogram = 7; + */ + public Builder clearHistogram() { + bitField0_ = (bitField0_ & ~0x00000020); + histogram_ = null; + if (histogramBuilder_ != null) { + histogramBuilder_.dispose(); + histogramBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.Histogram histogram = 7; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram.Builder getHistogramBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetHistogramFieldBuilder().getBuilder(); + } + /** + * optional .io.prometheus.client.Histogram histogram = 7; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.HistogramOrBuilder getHistogramOrBuilder() { + if (histogramBuilder_ != null) { + return histogramBuilder_.getMessageOrBuilder(); + } else { + return histogram_ == null ? + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram.getDefaultInstance() : histogram_; + } + } + /** + * optional .io.prometheus.client.Histogram histogram = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.HistogramOrBuilder> + internalGetHistogramFieldBuilder() { + if (histogramBuilder_ == null) { + histogramBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Histogram.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.HistogramOrBuilder>( + getHistogram(), + getParentForChildren(), + isClean()); + histogram_ = null; + } + return histogramBuilder_; + } + + private long timestampMs_ ; + /** + * optional int64 timestamp_ms = 6; + * @return Whether the timestampMs field is set. + */ + @java.lang.Override + public boolean hasTimestampMs() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * optional int64 timestamp_ms = 6; + * @return The timestampMs. + */ + @java.lang.Override + public long getTimestampMs() { + return timestampMs_; + } + /** + * optional int64 timestamp_ms = 6; + * @param value The timestampMs to set. + * @return This builder for chaining. + */ + public Builder setTimestampMs(long value) { + + timestampMs_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * optional int64 timestamp_ms = 6; + * @return This builder for chaining. + */ + public Builder clearTimestampMs() { + bitField0_ = (bitField0_ & ~0x00000040); + timestampMs_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:io.prometheus.client.Metric) + } + + // @@protoc_insertion_point(class_scope:io.prometheus.client.Metric) + private static final io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric(); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Metric parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface MetricFamilyOrBuilder extends + // @@protoc_insertion_point(interface_extends:io.prometheus.client.MetricFamily) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string name = 1; + * @return Whether the name field is set. + */ + boolean hasName(); + /** + * optional string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * optional string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * optional string help = 2; + * @return Whether the help field is set. + */ + boolean hasHelp(); + /** + * optional string help = 2; + * @return The help. + */ + java.lang.String getHelp(); + /** + * optional string help = 2; + * @return The bytes for help. + */ + com.google.protobuf.ByteString + getHelpBytes(); + + /** + * optional .io.prometheus.client.MetricType type = 3; + * @return Whether the type field is set. + */ + boolean hasType(); + /** + * optional .io.prometheus.client.MetricType type = 3; + * @return The type. + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricType getType(); + + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + java.util.List + getMetricList(); + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric getMetric(int index); + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + int getMetricCount(); + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + java.util.List + getMetricOrBuilderList(); + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricOrBuilder getMetricOrBuilder( + int index); + + /** + * optional string unit = 5; + * @return Whether the unit field is set. + */ + boolean hasUnit(); + /** + * optional string unit = 5; + * @return The unit. + */ + java.lang.String getUnit(); + /** + * optional string unit = 5; + * @return The bytes for unit. + */ + com.google.protobuf.ByteString + getUnitBytes(); + } + /** + * Protobuf type {@code io.prometheus.client.MetricFamily} + */ + public static final class MetricFamily extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:io.prometheus.client.MetricFamily) + MetricFamilyOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 4, + /* suffix= */ "", + "MetricFamily"); + } + // Use MetricFamily.newBuilder() to construct. + private MetricFamily(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MetricFamily() { + name_ = ""; + help_ = ""; + type_ = 0; + metric_ = java.util.Collections.emptyList(); + unit_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_MetricFamily_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_MetricFamily_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * optional string name = 1; + * @return Whether the name field is set. + */ + @java.lang.Override + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * optional string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HELP_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object help_ = ""; + /** + * optional string help = 2; + * @return Whether the help field is set. + */ + @java.lang.Override + public boolean hasHelp() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional string help = 2; + * @return The help. + */ + @java.lang.Override + public java.lang.String getHelp() { + java.lang.Object ref = help_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + help_ = s; + } + return s; + } + } + /** + * optional string help = 2; + * @return The bytes for help. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getHelpBytes() { + java.lang.Object ref = help_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + help_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 3; + private int type_ = 0; + /** + * optional .io.prometheus.client.MetricType type = 3; + * @return Whether the type field is set. + */ + @java.lang.Override public boolean hasType() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional .io.prometheus.client.MetricType type = 3; + * @return The type. + */ + @java.lang.Override public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricType getType() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricType result = io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricType.forNumber(type_); + return result == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricType.COUNTER : result; + } + + public static final int METRIC_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private java.util.List metric_; + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + @java.lang.Override + public java.util.List getMetricList() { + return metric_; + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + @java.lang.Override + public java.util.List + getMetricOrBuilderList() { + return metric_; + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + @java.lang.Override + public int getMetricCount() { + return metric_.size(); + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric getMetric(int index) { + return metric_.get(index); + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricOrBuilder getMetricOrBuilder( + int index) { + return metric_.get(index); + } + + public static final int UNIT_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object unit_ = ""; + /** + * optional string unit = 5; + * @return Whether the unit field is set. + */ + @java.lang.Override + public boolean hasUnit() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional string unit = 5; + * @return The unit. + */ + @java.lang.Override + public java.lang.String getUnit() { + java.lang.Object ref = unit_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + unit_ = s; + } + return s; + } + } + /** + * optional string unit = 5; + * @return The bytes for unit. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUnitBytes() { + java.lang.Object ref = unit_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + unit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, help_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeEnum(3, type_); + } + for (int i = 0; i < metric_.size(); i++) { + output.writeMessage(4, metric_.get(i)); + } + if (((bitField0_ & 0x00000008) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, unit_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, help_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, type_); + } + for (int i = 0; i < metric_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, metric_.get(i)); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, unit_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily)) { + return super.equals(obj); + } + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily other = (io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily) obj; + + if (hasName() != other.hasName()) return false; + if (hasName()) { + if (!getName() + .equals(other.getName())) return false; + } + if (hasHelp() != other.hasHelp()) return false; + if (hasHelp()) { + if (!getHelp() + .equals(other.getHelp())) return false; + } + if (hasType() != other.hasType()) return false; + if (hasType()) { + if (type_ != other.type_) return false; + } + if (!getMetricList() + .equals(other.getMetricList())) return false; + if (hasUnit() != other.hasUnit()) return false; + if (hasUnit()) { + if (!getUnit() + .equals(other.getUnit())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (hasHelp()) { + hash = (37 * hash) + HELP_FIELD_NUMBER; + hash = (53 * hash) + getHelp().hashCode(); + } + if (hasType()) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + } + if (getMetricCount() > 0) { + hash = (37 * hash) + METRIC_FIELD_NUMBER; + hash = (53 * hash) + getMetricList().hashCode(); + } + if (hasUnit()) { + hash = (37 * hash) + UNIT_FIELD_NUMBER; + hash = (53 * hash) + getUnit().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code io.prometheus.client.MetricFamily} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:io.prometheus.client.MetricFamily) + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamilyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_MetricFamily_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_MetricFamily_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily.class, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily.Builder.class); + } + + // Construct using io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + help_ = ""; + type_ = 0; + if (metricBuilder_ == null) { + metric_ = java.util.Collections.emptyList(); + } else { + metric_ = null; + metricBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + unit_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.internal_static_io_prometheus_client_MetricFamily_descriptor; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily getDefaultInstanceForType() { + return io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily.getDefaultInstance(); + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily build() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily buildPartial() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily result = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily result) { + if (metricBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + metric_ = java.util.Collections.unmodifiableList(metric_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.metric_ = metric_; + } else { + result.metric_ = metricBuilder_.build(); + } + } + + private void buildPartial0(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.help_ = help_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.type_ = type_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.unit_ = unit_; + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily) { + return mergeFrom((io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily other) { + if (other == io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily.getDefaultInstance()) return this; + if (other.hasName()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasHelp()) { + help_ = other.help_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasType()) { + setType(other.getType()); + } + if (metricBuilder_ == null) { + if (!other.metric_.isEmpty()) { + if (metric_.isEmpty()) { + metric_ = other.metric_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureMetricIsMutable(); + metric_.addAll(other.metric_); + } + onChanged(); + } + } else { + if (!other.metric_.isEmpty()) { + if (metricBuilder_.isEmpty()) { + metricBuilder_.dispose(); + metricBuilder_ = null; + metric_ = other.metric_; + bitField0_ = (bitField0_ & ~0x00000008); + metricBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + internalGetMetricFieldBuilder() : null; + } else { + metricBuilder_.addAllMessages(other.metric_); + } + } + } + if (other.hasUnit()) { + unit_ = other.unit_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + help_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + int tmpRaw = input.readEnum(); + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricType tmpValue = + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricType.forNumber(tmpRaw); + if (tmpValue == null) { + mergeUnknownVarintField(3, tmpRaw); + } else { + type_ = tmpRaw; + bitField0_ |= 0x00000004; + } + break; + } // case 24 + case 34: { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric m = + input.readMessage( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.parser(), + extensionRegistry); + if (metricBuilder_ == null) { + ensureMetricIsMutable(); + metric_.add(m); + } else { + metricBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: { + unit_ = input.readBytes(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * optional string name = 1; + * @return Whether the name field is set. + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * optional string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object help_ = ""; + /** + * optional string help = 2; + * @return Whether the help field is set. + */ + public boolean hasHelp() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional string help = 2; + * @return The help. + */ + public java.lang.String getHelp() { + java.lang.Object ref = help_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + help_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string help = 2; + * @return The bytes for help. + */ + public com.google.protobuf.ByteString + getHelpBytes() { + java.lang.Object ref = help_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + help_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string help = 2; + * @param value The help to set. + * @return This builder for chaining. + */ + public Builder setHelp( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + help_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * optional string help = 2; + * @return This builder for chaining. + */ + public Builder clearHelp() { + help_ = getDefaultInstance().getHelp(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * optional string help = 2; + * @param value The bytes for help to set. + * @return This builder for chaining. + */ + public Builder setHelpBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + help_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * optional .io.prometheus.client.MetricType type = 3; + * @return Whether the type field is set. + */ + @java.lang.Override public boolean hasType() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional .io.prometheus.client.MetricType type = 3; + * @return The type. + */ + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricType getType() { + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricType result = io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricType.forNumber(type_); + return result == null ? io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricType.COUNTER : result; + } + /** + * optional .io.prometheus.client.MetricType type = 3; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricType value) { + if (value == null) { throw new NullPointerException(); } + bitField0_ |= 0x00000004; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * optional .io.prometheus.client.MetricType type = 3; + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000004); + type_ = 0; + onChanged(); + return this; + } + + private java.util.List metric_ = + java.util.Collections.emptyList(); + private void ensureMetricIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + metric_ = new java.util.ArrayList(metric_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricOrBuilder> metricBuilder_; + + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + public java.util.List getMetricList() { + if (metricBuilder_ == null) { + return java.util.Collections.unmodifiableList(metric_); + } else { + return metricBuilder_.getMessageList(); + } + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + public int getMetricCount() { + if (metricBuilder_ == null) { + return metric_.size(); + } else { + return metricBuilder_.getCount(); + } + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric getMetric(int index) { + if (metricBuilder_ == null) { + return metric_.get(index); + } else { + return metricBuilder_.getMessage(index); + } + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + public Builder setMetric( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric value) { + if (metricBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricIsMutable(); + metric_.set(index, value); + onChanged(); + } else { + metricBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + public Builder setMetric( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.Builder builderForValue) { + if (metricBuilder_ == null) { + ensureMetricIsMutable(); + metric_.set(index, builderForValue.build()); + onChanged(); + } else { + metricBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + public Builder addMetric(io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric value) { + if (metricBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricIsMutable(); + metric_.add(value); + onChanged(); + } else { + metricBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + public Builder addMetric( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric value) { + if (metricBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricIsMutable(); + metric_.add(index, value); + onChanged(); + } else { + metricBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + public Builder addMetric( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.Builder builderForValue) { + if (metricBuilder_ == null) { + ensureMetricIsMutable(); + metric_.add(builderForValue.build()); + onChanged(); + } else { + metricBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + public Builder addMetric( + int index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.Builder builderForValue) { + if (metricBuilder_ == null) { + ensureMetricIsMutable(); + metric_.add(index, builderForValue.build()); + onChanged(); + } else { + metricBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + public Builder addAllMetric( + java.lang.Iterable values) { + if (metricBuilder_ == null) { + ensureMetricIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, metric_); + onChanged(); + } else { + metricBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + public Builder clearMetric() { + if (metricBuilder_ == null) { + metric_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + metricBuilder_.clear(); + } + return this; + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + public Builder removeMetric(int index) { + if (metricBuilder_ == null) { + ensureMetricIsMutable(); + metric_.remove(index); + onChanged(); + } else { + metricBuilder_.remove(index); + } + return this; + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.Builder getMetricBuilder( + int index) { + return internalGetMetricFieldBuilder().getBuilder(index); + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricOrBuilder getMetricOrBuilder( + int index) { + if (metricBuilder_ == null) { + return metric_.get(index); } else { + return metricBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + public java.util.List + getMetricOrBuilderList() { + if (metricBuilder_ != null) { + return metricBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(metric_); + } + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.Builder addMetricBuilder() { + return internalGetMetricFieldBuilder().addBuilder( + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.getDefaultInstance()); + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.Builder addMetricBuilder( + int index) { + return internalGetMetricFieldBuilder().addBuilder( + index, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.getDefaultInstance()); + } + /** + * repeated .io.prometheus.client.Metric metric = 4; + */ + public java.util.List + getMetricBuilderList() { + return internalGetMetricFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricOrBuilder> + internalGetMetricFieldBuilder() { + if (metricBuilder_ == null) { + metricBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.Metric.Builder, io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricOrBuilder>( + metric_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + metric_ = null; + } + return metricBuilder_; + } + + private java.lang.Object unit_ = ""; + /** + * optional string unit = 5; + * @return Whether the unit field is set. + */ + public boolean hasUnit() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional string unit = 5; + * @return The unit. + */ + public java.lang.String getUnit() { + java.lang.Object ref = unit_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + unit_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string unit = 5; + * @return The bytes for unit. + */ + public com.google.protobuf.ByteString + getUnitBytes() { + java.lang.Object ref = unit_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + unit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string unit = 5; + * @param value The unit to set. + * @return This builder for chaining. + */ + public Builder setUnit( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + unit_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * optional string unit = 5; + * @return This builder for chaining. + */ + public Builder clearUnit() { + unit_ = getDefaultInstance().getUnit(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * optional string unit = 5; + * @param value The bytes for unit to set. + * @return This builder for chaining. + */ + public Builder setUnitBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + unit_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:io.prometheus.client.MetricFamily) + } + + // @@protoc_insertion_point(class_scope:io.prometheus.client.MetricFamily) + private static final io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily(); + } + + public static io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MetricFamily parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics.MetricFamily getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_io_prometheus_client_LabelPair_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_io_prometheus_client_LabelPair_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_io_prometheus_client_Gauge_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_io_prometheus_client_Gauge_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_io_prometheus_client_Counter_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_io_prometheus_client_Counter_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_io_prometheus_client_Quantile_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_io_prometheus_client_Quantile_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_io_prometheus_client_Summary_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_io_prometheus_client_Summary_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_io_prometheus_client_Untyped_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_io_prometheus_client_Untyped_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_io_prometheus_client_Histogram_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_io_prometheus_client_Histogram_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_io_prometheus_client_Bucket_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_io_prometheus_client_Bucket_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_io_prometheus_client_BucketSpan_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_io_prometheus_client_BucketSpan_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_io_prometheus_client_Exemplar_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_io_prometheus_client_Exemplar_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_io_prometheus_client_Metric_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_io_prometheus_client_Metric_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_io_prometheus_client_MetricFamily_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_io_prometheus_client_MetricFamily_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\037src/main/protobuf/metrics.proto\022\024io.pr" + + "ometheus.client\032\037google/protobuf/timesta" + + "mp.proto\"(\n\tLabelPair\022\014\n\004name\030\001 \001(\t\022\r\n\005v" + + "alue\030\002 \001(\t\"\026\n\005Gauge\022\r\n\005value\030\001 \001(\001\"\201\001\n\007C" + + "ounter\022\r\n\005value\030\001 \001(\001\0220\n\010exemplar\030\002 \001(\0132" + + "\036.io.prometheus.client.Exemplar\0225\n\021creat" + + "ed_timestamp\030\003 \001(\0132\032.google.protobuf.Tim" + + "estamp\"+\n\010Quantile\022\020\n\010quantile\030\001 \001(\001\022\r\n\005" + + "value\030\002 \001(\001\"\234\001\n\007Summary\022\024\n\014sample_count\030" + + "\001 \001(\004\022\022\n\nsample_sum\030\002 \001(\001\0220\n\010quantile\030\003 " + + "\003(\0132\036.io.prometheus.client.Quantile\0225\n\021c" + + "reated_timestamp\030\004 \001(\0132\032.google.protobuf" + + ".Timestamp\"\030\n\007Untyped\022\r\n\005value\030\001 \001(\001\"\221\004\n" + + "\tHistogram\022\024\n\014sample_count\030\001 \001(\004\022\032\n\022samp" + + "le_count_float\030\004 \001(\001\022\022\n\nsample_sum\030\002 \001(\001" + + "\022,\n\006bucket\030\003 \003(\0132\034.io.prometheus.client." + + "Bucket\0225\n\021created_timestamp\030\017 \001(\0132\032.goog" + + "le.protobuf.Timestamp\022\016\n\006schema\030\005 \001(\021\022\026\n" + + "\016zero_threshold\030\006 \001(\001\022\022\n\nzero_count\030\007 \001(" + + "\004\022\030\n\020zero_count_float\030\010 \001(\001\0227\n\rnegative_" + + "span\030\t \003(\0132 .io.prometheus.client.Bucket" + + "Span\022\026\n\016negative_delta\030\n \003(\022\022\026\n\016negative" + + "_count\030\013 \003(\001\0227\n\rpositive_span\030\014 \003(\0132 .io" + + ".prometheus.client.BucketSpan\022\026\n\016positiv" + + "e_delta\030\r \003(\022\022\026\n\016positive_count\030\016 \003(\001\0221\n" + + "\texemplars\030\020 \003(\0132\036.io.prometheus.client." + + "Exemplar\"\211\001\n\006Bucket\022\030\n\020cumulative_count\030" + + "\001 \001(\004\022\036\n\026cumulative_count_float\030\004 \001(\001\022\023\n" + + "\013upper_bound\030\002 \001(\001\0220\n\010exemplar\030\003 \001(\0132\036.i" + + "o.prometheus.client.Exemplar\",\n\nBucketSp" + + "an\022\016\n\006offset\030\001 \001(\021\022\016\n\006length\030\002 \001(\r\"x\n\010Ex" + + "emplar\022.\n\005label\030\001 \003(\0132\037.io.prometheus.cl" + + "ient.LabelPair\022\r\n\005value\030\002 \001(\001\022-\n\ttimesta" + + "mp\030\003 \001(\0132\032.google.protobuf.Timestamp\"\276\002\n" + + "\006Metric\022.\n\005label\030\001 \003(\0132\037.io.prometheus.c" + + "lient.LabelPair\022*\n\005gauge\030\002 \001(\0132\033.io.prom" + + "etheus.client.Gauge\022.\n\007counter\030\003 \001(\0132\035.i" + + "o.prometheus.client.Counter\022.\n\007summary\030\004" + + " \001(\0132\035.io.prometheus.client.Summary\022.\n\007u" + + "ntyped\030\005 \001(\0132\035.io.prometheus.client.Unty" + + "ped\0222\n\thistogram\030\007 \001(\0132\037.io.prometheus.c" + + "lient.Histogram\022\024\n\014timestamp_ms\030\006 \001(\003\"\226\001" + + "\n\014MetricFamily\022\014\n\004name\030\001 \001(\t\022\014\n\004help\030\002 \001" + + "(\t\022.\n\004type\030\003 \001(\0162 .io.prometheus.client." + + "MetricType\022,\n\006metric\030\004 \003(\0132\034.io.promethe" + + "us.client.Metric\022\014\n\004unit\030\005 \001(\t*b\n\nMetric" + + "Type\022\013\n\007COUNTER\020\000\022\t\n\005GAUGE\020\001\022\013\n\007SUMMARY\020" + + "\002\022\013\n\007UNTYPED\020\003\022\r\n\tHISTOGRAM\020\004\022\023\n\017GAUGE_H" + + "ISTOGRAM\020\005B\212\001\nLio.prometheus.metrics.exp" + + "ositionformats.generated.com_google_prot" + + "obuf_4_33_4Z:github.com/prometheus/clien" + + "t_model/go;io_prometheus_client" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_io_prometheus_client_LabelPair_descriptor = + getDescriptor().getMessageType(0); + internal_static_io_prometheus_client_LabelPair_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_io_prometheus_client_LabelPair_descriptor, + new java.lang.String[] { "Name", "Value", }); + internal_static_io_prometheus_client_Gauge_descriptor = + getDescriptor().getMessageType(1); + internal_static_io_prometheus_client_Gauge_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_io_prometheus_client_Gauge_descriptor, + new java.lang.String[] { "Value", }); + internal_static_io_prometheus_client_Counter_descriptor = + getDescriptor().getMessageType(2); + internal_static_io_prometheus_client_Counter_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_io_prometheus_client_Counter_descriptor, + new java.lang.String[] { "Value", "Exemplar", "CreatedTimestamp", }); + internal_static_io_prometheus_client_Quantile_descriptor = + getDescriptor().getMessageType(3); + internal_static_io_prometheus_client_Quantile_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_io_prometheus_client_Quantile_descriptor, + new java.lang.String[] { "Quantile", "Value", }); + internal_static_io_prometheus_client_Summary_descriptor = + getDescriptor().getMessageType(4); + internal_static_io_prometheus_client_Summary_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_io_prometheus_client_Summary_descriptor, + new java.lang.String[] { "SampleCount", "SampleSum", "Quantile", "CreatedTimestamp", }); + internal_static_io_prometheus_client_Untyped_descriptor = + getDescriptor().getMessageType(5); + internal_static_io_prometheus_client_Untyped_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_io_prometheus_client_Untyped_descriptor, + new java.lang.String[] { "Value", }); + internal_static_io_prometheus_client_Histogram_descriptor = + getDescriptor().getMessageType(6); + internal_static_io_prometheus_client_Histogram_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_io_prometheus_client_Histogram_descriptor, + new java.lang.String[] { "SampleCount", "SampleCountFloat", "SampleSum", "Bucket", "CreatedTimestamp", "Schema", "ZeroThreshold", "ZeroCount", "ZeroCountFloat", "NegativeSpan", "NegativeDelta", "NegativeCount", "PositiveSpan", "PositiveDelta", "PositiveCount", "Exemplars", }); + internal_static_io_prometheus_client_Bucket_descriptor = + getDescriptor().getMessageType(7); + internal_static_io_prometheus_client_Bucket_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_io_prometheus_client_Bucket_descriptor, + new java.lang.String[] { "CumulativeCount", "CumulativeCountFloat", "UpperBound", "Exemplar", }); + internal_static_io_prometheus_client_BucketSpan_descriptor = + getDescriptor().getMessageType(8); + internal_static_io_prometheus_client_BucketSpan_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_io_prometheus_client_BucketSpan_descriptor, + new java.lang.String[] { "Offset", "Length", }); + internal_static_io_prometheus_client_Exemplar_descriptor = + getDescriptor().getMessageType(9); + internal_static_io_prometheus_client_Exemplar_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_io_prometheus_client_Exemplar_descriptor, + new java.lang.String[] { "Label", "Value", "Timestamp", }); + internal_static_io_prometheus_client_Metric_descriptor = + getDescriptor().getMessageType(10); + internal_static_io_prometheus_client_Metric_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_io_prometheus_client_Metric_descriptor, + new java.lang.String[] { "Label", "Gauge", "Counter", "Summary", "Untyped", "Histogram", "TimestampMs", }); + internal_static_io_prometheus_client_MetricFamily_descriptor = + getDescriptor().getMessageType(11); + internal_static_io_prometheus_client_MetricFamily_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_io_prometheus_client_MetricFamily_descriptor, + new java.lang.String[] { "Name", "Help", "Type", "Metric", "Unit", }); + descriptor.resolveAllFeaturesImmutable(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} +//CHECKSTYLE:ON: checkstyle diff --git a/prometheus-metrics-exposition-formats/src/main/java/io/prometheus/metrics/expositionformats/internal/PrometheusProtobufWriterImpl.java b/prometheus-metrics-exposition-formats/src/main/java/io/prometheus/metrics/expositionformats/internal/PrometheusProtobufWriterImpl.java new file mode 100644 index 000000000..feaf15b22 --- /dev/null +++ b/prometheus-metrics-exposition-formats/src/main/java/io/prometheus/metrics/expositionformats/internal/PrometheusProtobufWriterImpl.java @@ -0,0 +1,395 @@ +package io.prometheus.metrics.expositionformats.internal; + +import static io.prometheus.metrics.expositionformats.internal.ProtobufUtil.timestampFromMillis; +import static io.prometheus.metrics.model.snapshots.SnapshotEscaper.getSnapshotLabelName; + +import com.google.protobuf.TextFormat; +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.expositionformats.ExpositionFormatWriter; +import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics; +import io.prometheus.metrics.model.snapshots.ClassicHistogramBuckets; +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import io.prometheus.metrics.model.snapshots.CounterSnapshot.CounterDataPointSnapshot; +import io.prometheus.metrics.model.snapshots.DataPointSnapshot; +import io.prometheus.metrics.model.snapshots.Exemplar; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import io.prometheus.metrics.model.snapshots.HistogramSnapshot; +import io.prometheus.metrics.model.snapshots.InfoSnapshot; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.MetricMetadata; +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import io.prometheus.metrics.model.snapshots.NativeHistogramBuckets; +import io.prometheus.metrics.model.snapshots.Quantiles; +import io.prometheus.metrics.model.snapshots.SnapshotEscaper; +import io.prometheus.metrics.model.snapshots.StateSetSnapshot; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import io.prometheus.metrics.model.snapshots.UnknownSnapshot; +import java.io.IOException; +import java.io.OutputStream; +import javax.annotation.Nullable; + +public class PrometheusProtobufWriterImpl implements ExpositionFormatWriter { + + @Override + public boolean accepts(@Nullable String acceptHeader) { + throw new IllegalStateException("use PrometheusProtobufWriter instead"); + } + + @Override + public String getContentType() { + throw new IllegalStateException("use PrometheusProtobufWriter instead"); + } + + @Override + public String toDebugString(MetricSnapshots metricSnapshots, EscapingScheme escapingScheme) { + StringBuilder stringBuilder = new StringBuilder(); + for (MetricSnapshot s : metricSnapshots) { + MetricSnapshot snapshot = SnapshotEscaper.escapeMetricSnapshot(s, escapingScheme); + if (!snapshot.getDataPoints().isEmpty()) { + stringBuilder.append(TextFormat.printer().printToString(convert(snapshot, escapingScheme))); + } + } + return stringBuilder.toString(); + } + + @Override + public void write( + OutputStream out, MetricSnapshots metricSnapshots, EscapingScheme escapingScheme) + throws IOException { + for (MetricSnapshot s : metricSnapshots) { + MetricSnapshot snapshot = SnapshotEscaper.escapeMetricSnapshot(s, escapingScheme); + if (!snapshot.getDataPoints().isEmpty()) { + convert(snapshot, escapingScheme).writeDelimitedTo(out); + } + } + } + + public Metrics.MetricFamily convert(MetricSnapshot snapshot, EscapingScheme scheme) { + Metrics.MetricFamily.Builder builder = Metrics.MetricFamily.newBuilder(); + if (snapshot instanceof CounterSnapshot) { + for (CounterDataPointSnapshot data : ((CounterSnapshot) snapshot).getDataPoints()) { + builder.addMetric(convert(data, scheme)); + } + setMetadataUnlessEmpty( + builder, snapshot.getMetadata(), "_total", Metrics.MetricType.COUNTER, scheme); + } else if (snapshot instanceof GaugeSnapshot) { + for (GaugeSnapshot.GaugeDataPointSnapshot data : ((GaugeSnapshot) snapshot).getDataPoints()) { + builder.addMetric(convert(data, scheme)); + } + setMetadataUnlessEmpty( + builder, snapshot.getMetadata(), null, Metrics.MetricType.GAUGE, scheme); + } else if (snapshot instanceof HistogramSnapshot) { + HistogramSnapshot histogram = (HistogramSnapshot) snapshot; + for (HistogramSnapshot.HistogramDataPointSnapshot data : histogram.getDataPoints()) { + builder.addMetric(convert(data, scheme)); + } + Metrics.MetricType type = + histogram.isGaugeHistogram() + ? Metrics.MetricType.GAUGE_HISTOGRAM + : Metrics.MetricType.HISTOGRAM; + setMetadataUnlessEmpty(builder, snapshot.getMetadata(), null, type, scheme); + } else if (snapshot instanceof SummarySnapshot) { + for (SummarySnapshot.SummaryDataPointSnapshot data : + ((SummarySnapshot) snapshot).getDataPoints()) { + if (data.hasCount() || data.hasSum() || data.getQuantiles().size() > 0) { + builder.addMetric(convert(data, scheme)); + } + } + setMetadataUnlessEmpty( + builder, snapshot.getMetadata(), null, Metrics.MetricType.SUMMARY, scheme); + } else if (snapshot instanceof InfoSnapshot) { + for (InfoSnapshot.InfoDataPointSnapshot data : ((InfoSnapshot) snapshot).getDataPoints()) { + builder.addMetric(convert(data, scheme)); + } + setMetadataUnlessEmpty( + builder, snapshot.getMetadata(), "_info", Metrics.MetricType.GAUGE, scheme); + } else if (snapshot instanceof StateSetSnapshot) { + for (StateSetSnapshot.StateSetDataPointSnapshot data : + ((StateSetSnapshot) snapshot).getDataPoints()) { + for (int i = 0; i < data.size(); i++) { + builder.addMetric(convert(data, snapshot.getMetadata().getPrometheusName(), i, scheme)); + } + } + setMetadataUnlessEmpty( + builder, snapshot.getMetadata(), null, Metrics.MetricType.GAUGE, scheme); + } else if (snapshot instanceof UnknownSnapshot) { + for (UnknownSnapshot.UnknownDataPointSnapshot data : + ((UnknownSnapshot) snapshot).getDataPoints()) { + builder.addMetric(convert(data, scheme)); + } + setMetadataUnlessEmpty( + builder, snapshot.getMetadata(), null, Metrics.MetricType.UNTYPED, scheme); + } + return builder.build(); + } + + private Metrics.Metric.Builder convert(CounterDataPointSnapshot data, EscapingScheme scheme) { + Metrics.Counter.Builder counterBuilder = Metrics.Counter.newBuilder(); + counterBuilder.setValue(data.getValue()); + if (data.getExemplar() != null) { + counterBuilder.setExemplar(convert(data.getExemplar(), scheme)); + } + if (data.hasCreatedTimestamp()) { + counterBuilder.setCreatedTimestamp( + ProtobufUtil.timestampFromMillis(data.getCreatedTimestampMillis())); + } + Metrics.Metric.Builder metricBuilder = Metrics.Metric.newBuilder(); + addLabels(metricBuilder, data.getLabels(), scheme); + metricBuilder.setCounter(counterBuilder.build()); + setScrapeTimestamp(metricBuilder, data); + return metricBuilder; + } + + private Metrics.Metric.Builder convert( + GaugeSnapshot.GaugeDataPointSnapshot data, EscapingScheme scheme) { + Metrics.Gauge.Builder gaugeBuilder = Metrics.Gauge.newBuilder(); + gaugeBuilder.setValue(data.getValue()); + Metrics.Metric.Builder metricBuilder = Metrics.Metric.newBuilder(); + addLabels(metricBuilder, data.getLabels(), scheme); + metricBuilder.setGauge(gaugeBuilder); + setScrapeTimestamp(metricBuilder, data); + return metricBuilder; + } + + private Metrics.Metric.Builder convert( + HistogramSnapshot.HistogramDataPointSnapshot data, EscapingScheme scheme) { + Metrics.Metric.Builder metricBuilder = Metrics.Metric.newBuilder(); + Metrics.Histogram.Builder histogramBuilder = Metrics.Histogram.newBuilder(); + if (data.hasNativeHistogramData()) { + histogramBuilder.setSchema(data.getNativeSchema()); + histogramBuilder.setZeroCount(data.getNativeZeroCount()); + histogramBuilder.setZeroThreshold(data.getNativeZeroThreshold()); + addBuckets(histogramBuilder, data.getNativeBucketsForPositiveValues(), +1); + addBuckets(histogramBuilder, data.getNativeBucketsForNegativeValues(), -1); + + if (!data.hasClassicHistogramData()) { // native only + // Add a single +Inf bucket for the exemplar. + Exemplar exemplar = data.getExemplars().getLatest(); + if (exemplar != null) { + Metrics.Bucket.Builder bucketBuilder = + Metrics.Bucket.newBuilder() + .setCumulativeCount(getNativeCount(data)) + .setUpperBound(Double.POSITIVE_INFINITY); + bucketBuilder.setExemplar(convert(exemplar, scheme)); + histogramBuilder.addBucket(bucketBuilder); + } + } + } + if (data.hasClassicHistogramData()) { + + ClassicHistogramBuckets buckets = data.getClassicBuckets(); + double lowerBound = Double.NEGATIVE_INFINITY; + long cumulativeCount = 0; + for (int i = 0; i < buckets.size(); i++) { + cumulativeCount += buckets.getCount(i); + double upperBound = buckets.getUpperBound(i); + Metrics.Bucket.Builder bucketBuilder = + Metrics.Bucket.newBuilder() + .setCumulativeCount(cumulativeCount) + .setUpperBound(upperBound); + Exemplar exemplar = data.getExemplars().get(lowerBound, upperBound); + if (exemplar != null) { + bucketBuilder.setExemplar(convert(exemplar, scheme)); + } + histogramBuilder.addBucket(bucketBuilder); + lowerBound = upperBound; + } + } + addLabels(metricBuilder, data.getLabels(), scheme); + setScrapeTimestamp(metricBuilder, data); + if (data.hasCount()) { + histogramBuilder.setSampleCount(data.getCount()); + } + if (data.hasSum()) { + histogramBuilder.setSampleSum(data.getSum()); + } + metricBuilder.setHistogram(histogramBuilder.build()); + return metricBuilder; + } + + private Metrics.Metric.Builder convert( + SummarySnapshot.SummaryDataPointSnapshot data, EscapingScheme scheme) { + Metrics.Summary.Builder summaryBuilder = Metrics.Summary.newBuilder(); + if (data.hasCount()) { + summaryBuilder.setSampleCount(data.getCount()); + } + if (data.hasSum()) { + summaryBuilder.setSampleSum(data.getSum()); + } + Quantiles quantiles = data.getQuantiles(); + for (int i = 0; i < quantiles.size(); i++) { + summaryBuilder.addQuantile( + Metrics.Quantile.newBuilder() + .setQuantile(quantiles.get(i).getQuantile()) + .setValue(quantiles.get(i).getValue()) + .build()); + } + Metrics.Metric.Builder metricBuilder = Metrics.Metric.newBuilder(); + addLabels(metricBuilder, data.getLabels(), scheme); + metricBuilder.setSummary(summaryBuilder.build()); + setScrapeTimestamp(metricBuilder, data); + return metricBuilder; + } + + private Metrics.Metric.Builder convert( + InfoSnapshot.InfoDataPointSnapshot data, EscapingScheme scheme) { + Metrics.Metric.Builder metricBuilder = Metrics.Metric.newBuilder(); + Metrics.Gauge.Builder gaugeBuilder = Metrics.Gauge.newBuilder(); + gaugeBuilder.setValue(1); + addLabels(metricBuilder, data.getLabels(), scheme); + metricBuilder.setGauge(gaugeBuilder); + setScrapeTimestamp(metricBuilder, data); + return metricBuilder; + } + + private Metrics.Metric.Builder convert( + StateSetSnapshot.StateSetDataPointSnapshot data, String name, int i, EscapingScheme scheme) { + Metrics.Metric.Builder metricBuilder = Metrics.Metric.newBuilder(); + Metrics.Gauge.Builder gaugeBuilder = Metrics.Gauge.newBuilder(); + addLabels(metricBuilder, data.getLabels(), scheme); + metricBuilder.addLabel( + Metrics.LabelPair.newBuilder().setName(name).setValue(data.getName(i)).build()); + if (data.isTrue(i)) { + gaugeBuilder.setValue(1); + } else { + gaugeBuilder.setValue(0); + } + metricBuilder.setGauge(gaugeBuilder); + setScrapeTimestamp(metricBuilder, data); + return metricBuilder; + } + + private Metrics.Metric.Builder convert( + UnknownSnapshot.UnknownDataPointSnapshot data, EscapingScheme scheme) { + Metrics.Metric.Builder metricBuilder = Metrics.Metric.newBuilder(); + Metrics.Untyped.Builder untypedBuilder = Metrics.Untyped.newBuilder(); + untypedBuilder.setValue(data.getValue()); + addLabels(metricBuilder, data.getLabels(), scheme); + metricBuilder.setUntyped(untypedBuilder); + return metricBuilder; + } + + private Metrics.Exemplar.Builder convert(Exemplar exemplar, EscapingScheme scheme) { + Metrics.Exemplar.Builder builder = Metrics.Exemplar.newBuilder(); + builder.setValue(exemplar.getValue()); + addLabels(builder, exemplar.getLabels(), scheme); + if (exemplar.hasTimestamp()) { + builder.setTimestamp(timestampFromMillis(exemplar.getTimestampMillis())); + } + return builder; + } + + private void setMetadataUnlessEmpty( + Metrics.MetricFamily.Builder builder, + MetricMetadata metadata, + @Nullable String nameSuffix, + Metrics.MetricType type, + EscapingScheme scheme) { + if (builder.getMetricCount() == 0) { + return; + } + if (nameSuffix == null) { + builder.setName(SnapshotEscaper.getMetadataName(metadata, scheme)); + } else { + builder.setName(SnapshotEscaper.getMetadataName(metadata, scheme) + nameSuffix); + } + if (metadata.getHelp() != null) { + builder.setHelp(metadata.getHelp()); + } + builder.setType(type); + } + + private long getNativeCount(HistogramSnapshot.HistogramDataPointSnapshot data) { + if (data.hasCount()) { + return data.getCount(); + } else { + long count = data.getNativeZeroCount(); + for (int i = 0; i < data.getNativeBucketsForPositiveValues().size(); i++) { + count += data.getNativeBucketsForPositiveValues().getCount(i); + } + for (int i = 0; i < data.getNativeBucketsForNegativeValues().size(); i++) { + count += data.getNativeBucketsForNegativeValues().getCount(i); + } + return count; + } + } + + private void addBuckets( + Metrics.Histogram.Builder histogramBuilder, NativeHistogramBuckets buckets, int sgn) { + if (buckets.size() > 0) { + Metrics.BucketSpan.Builder currentSpan = Metrics.BucketSpan.newBuilder(); + currentSpan.setOffset(buckets.getBucketIndex(0)); + currentSpan.setLength(0); + int previousIndex = currentSpan.getOffset(); + long previousCount = 0; + for (int i = 0; i < buckets.size(); i++) { + if (buckets.getBucketIndex(i) > previousIndex + 1) { + // If the gap between bucketIndex and previousIndex is just 1 or 2, + // we don't start a new span but continue the existing span and add 1 or 2 empty buckets. + if (buckets.getBucketIndex(i) <= previousIndex + 3) { + while (buckets.getBucketIndex(i) > previousIndex + 1) { + currentSpan.setLength(currentSpan.getLength() + 1); + previousIndex++; + if (sgn > 0) { + histogramBuilder.addPositiveDelta(-previousCount); + } else { + histogramBuilder.addNegativeDelta(-previousCount); + } + previousCount = 0; + } + } else { + if (sgn > 0) { + histogramBuilder.addPositiveSpan(currentSpan.build()); + } else { + histogramBuilder.addNegativeSpan(currentSpan.build()); + } + currentSpan = Metrics.BucketSpan.newBuilder(); + currentSpan.setOffset(buckets.getBucketIndex(i) - (previousIndex + 1)); + } + } + currentSpan.setLength(currentSpan.getLength() + 1); + previousIndex = buckets.getBucketIndex(i); + if (sgn > 0) { + histogramBuilder.addPositiveDelta(buckets.getCount(i) - previousCount); + } else { + histogramBuilder.addNegativeDelta(buckets.getCount(i) - previousCount); + } + previousCount = buckets.getCount(i); + } + if (sgn > 0) { + histogramBuilder.addPositiveSpan(currentSpan.build()); + } else { + histogramBuilder.addNegativeSpan(currentSpan.build()); + } + } + } + + private void addLabels( + Metrics.Metric.Builder metricBuilder, Labels labels, EscapingScheme scheme) { + for (int i = 0; i < labels.size(); i++) { + metricBuilder.addLabel( + Metrics.LabelPair.newBuilder() + .setName(getSnapshotLabelName(labels, i, scheme)) + .setValue(labels.getValue(i)) + .build()); + } + } + + private void addLabels( + Metrics.Exemplar.Builder metricBuilder, Labels labels, EscapingScheme scheme) { + for (int i = 0; i < labels.size(); i++) { + metricBuilder.addLabel( + Metrics.LabelPair.newBuilder() + .setName(getSnapshotLabelName(labels, i, scheme)) + .setValue(labels.getValue(i)) + .build()); + } + } + + private void setScrapeTimestamp(Metrics.Metric.Builder metricBuilder, DataPointSnapshot data) { + if (data.hasScrapeTimestamp()) { + metricBuilder.setTimestampMs(data.getScrapeTimestampMillis()); + } + } +} diff --git a/prometheus-metrics-exposition-formats/src/main/java/io/prometheus/metrics/expositionformats/internal/ProtobufUtil.java b/prometheus-metrics-exposition-formats/src/main/java/io/prometheus/metrics/expositionformats/internal/ProtobufUtil.java new file mode 100644 index 000000000..75e3d0ef2 --- /dev/null +++ b/prometheus-metrics-exposition-formats/src/main/java/io/prometheus/metrics/expositionformats/internal/ProtobufUtil.java @@ -0,0 +1,19 @@ +package io.prometheus.metrics.expositionformats.internal; + +import com.google.protobuf.MessageOrBuilder; +import com.google.protobuf.TextFormat; +import com.google.protobuf.Timestamp; + +public class ProtobufUtil { + + static Timestamp timestampFromMillis(long timestampMillis) { + return Timestamp.newBuilder() + .setSeconds(timestampMillis / 1000L) + .setNanos((int) (timestampMillis % 1000L * 1000000L)) + .build(); + } + + public static String shortDebugString(MessageOrBuilder protobufData) { + return TextFormat.printer().emittingSingleLine(true).printToString(protobufData); + } +} diff --git a/prometheus-metrics-exposition-formats/src/test/java/io/prometheus/metrics/expositionformats/ProtobufExpositionFormatsTest.java b/prometheus-metrics-exposition-formats/src/test/java/io/prometheus/metrics/expositionformats/ProtobufExpositionFormatsTest.java new file mode 100644 index 000000000..e2e669c8c --- /dev/null +++ b/prometheus-metrics-exposition-formats/src/test/java/io/prometheus/metrics/expositionformats/ProtobufExpositionFormatsTest.java @@ -0,0 +1,21 @@ +package io.prometheus.metrics.expositionformats; + +import static org.assertj.core.api.Assertions.assertThat; + +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_33_4.Metrics; +import io.prometheus.metrics.expositionformats.internal.PrometheusProtobufWriterImpl; +import io.prometheus.metrics.expositionformats.internal.ProtobufUtil; +import io.prometheus.metrics.model.snapshots.MetricSnapshot; + +class ProtobufExpositionFormatsTest extends ExpositionFormatsTest { + + @Override + protected void assertPrometheusProtobuf(String expected, MetricSnapshot snapshot) { + PrometheusProtobufWriterImpl writer = new PrometheusProtobufWriterImpl(); + Metrics.MetricFamily protobufData = + writer.convert(snapshot, EscapingScheme.UNDERSCORE_ESCAPING); + String actual = ProtobufUtil.shortDebugString(protobufData); + assertThat(actual).isEqualTo(expected); + } +} diff --git a/prometheus-metrics-exposition-formats/version-rules.xml b/prometheus-metrics-exposition-formats/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-exposition-formats/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-exposition-textformats/pom.xml b/prometheus-metrics-exposition-textformats/pom.xml new file mode 100644 index 000000000..1aeba0707 --- /dev/null +++ b/prometheus-metrics-exposition-textformats/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-exposition-textformats + bundle + + Prometheus Metrics Exposition Text Formats + + Prometheus exposition text formats. + + + + io.prometheus.writer.text + 0.50 + + + + + io.prometheus + prometheus-metrics-model + ${project.version} + + + io.prometheus + prometheus-metrics-config + ${project.version} + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + + + + diff --git a/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/ExpositionFormatWriter.java b/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/ExpositionFormatWriter.java new file mode 100644 index 000000000..67f1ee41e --- /dev/null +++ b/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/ExpositionFormatWriter.java @@ -0,0 +1,46 @@ +package io.prometheus.metrics.expositionformats; + +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import javax.annotation.Nullable; + +public interface ExpositionFormatWriter { + boolean accepts(@Nullable String acceptHeader); + + /** Writes the given metric snapshots to the output stream using the specified escaping scheme. */ + void write(OutputStream out, MetricSnapshots metricSnapshots, EscapingScheme escapingScheme) + throws IOException; + + /** Writes the given metric snapshots to the output stream using the default escaping scheme. */ + default void write(OutputStream out, MetricSnapshots metricSnapshots) throws IOException { + write(out, metricSnapshots, EscapingScheme.DEFAULT); + } + + /** Converts the metric snapshots to a debug string using the specified escaping scheme. */ + default String toDebugString(MetricSnapshots metricSnapshots, EscapingScheme escapingScheme) { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + try { + write(out, metricSnapshots, escapingScheme); + return out.toString("UTF-8"); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + /** Converts the metric snapshots to a debug string using the default escaping scheme. */ + default String toDebugString(MetricSnapshots metricSnapshots) { + return toDebugString(metricSnapshots, EscapingScheme.DEFAULT); + } + + String getContentType(); + + /** + * Returns true if the writer is available. If false, the writer will throw an exception if used. + */ + default boolean isAvailable() { + return true; + } +} diff --git a/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/ExpositionFormats.java b/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/ExpositionFormats.java new file mode 100644 index 000000000..0ffa23a58 --- /dev/null +++ b/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/ExpositionFormats.java @@ -0,0 +1,61 @@ +package io.prometheus.metrics.expositionformats; + +import io.prometheus.metrics.config.ExporterProperties; +import io.prometheus.metrics.config.PrometheusProperties; +import javax.annotation.Nullable; + +public class ExpositionFormats { + + private final PrometheusProtobufWriter prometheusProtobufWriter; + private final PrometheusTextFormatWriter prometheusTextFormatWriter; + private final OpenMetricsTextFormatWriter openMetricsTextFormatWriter; + + private ExpositionFormats( + PrometheusProtobufWriter prometheusProtobufWriter, + PrometheusTextFormatWriter prometheusTextFormatWriter, + OpenMetricsTextFormatWriter openMetricsTextFormatWriter) { + this.prometheusProtobufWriter = prometheusProtobufWriter; + this.prometheusTextFormatWriter = prometheusTextFormatWriter; + this.openMetricsTextFormatWriter = openMetricsTextFormatWriter; + } + + public static ExpositionFormats init() { + return init(PrometheusProperties.get().getExporterProperties()); + } + + @SuppressWarnings("deprecation") + public static ExpositionFormats init(ExporterProperties properties) { + return new ExpositionFormats( + new PrometheusProtobufWriter(), + PrometheusTextFormatWriter.builder() + .setIncludeCreatedTimestamps(properties.getIncludeCreatedTimestamps()) + .setTimestampsInMs(properties.getPrometheusTimestampsInMs()) + .build(), + OpenMetricsTextFormatWriter.builder() + .setCreatedTimestampsEnabled(properties.getIncludeCreatedTimestamps()) + .setExemplarsOnAllMetricTypesEnabled(properties.getExemplarsOnAllMetricTypes()) + .build()); + } + + public ExpositionFormatWriter findWriter(@Nullable String acceptHeader) { + if (prometheusProtobufWriter.accepts(acceptHeader)) { + return prometheusProtobufWriter; + } + if (openMetricsTextFormatWriter.accepts(acceptHeader)) { + return openMetricsTextFormatWriter; + } + return prometheusTextFormatWriter; + } + + public PrometheusProtobufWriter getPrometheusProtobufWriter() { + return prometheusProtobufWriter; + } + + public PrometheusTextFormatWriter getPrometheusTextFormatWriter() { + return prometheusTextFormatWriter; + } + + public OpenMetricsTextFormatWriter getOpenMetricsTextFormatWriter() { + return openMetricsTextFormatWriter; + } +} diff --git a/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/NameType.java b/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/NameType.java new file mode 100644 index 000000000..1a9a813aa --- /dev/null +++ b/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/NameType.java @@ -0,0 +1,6 @@ +package io.prometheus.metrics.expositionformats; + +enum NameType { + Metric, + Label +} diff --git a/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/OpenMetricsTextFormatWriter.java b/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/OpenMetricsTextFormatWriter.java new file mode 100644 index 000000000..1ba1c627d --- /dev/null +++ b/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/OpenMetricsTextFormatWriter.java @@ -0,0 +1,461 @@ +package io.prometheus.metrics.expositionformats; + +import static io.prometheus.metrics.expositionformats.TextFormatUtil.writeDouble; +import static io.prometheus.metrics.expositionformats.TextFormatUtil.writeEscapedString; +import static io.prometheus.metrics.expositionformats.TextFormatUtil.writeLabels; +import static io.prometheus.metrics.expositionformats.TextFormatUtil.writeLong; +import static io.prometheus.metrics.expositionformats.TextFormatUtil.writeName; +import static io.prometheus.metrics.expositionformats.TextFormatUtil.writeOpenMetricsTimestamp; +import static io.prometheus.metrics.model.snapshots.SnapshotEscaper.getMetadataName; +import static io.prometheus.metrics.model.snapshots.SnapshotEscaper.getSnapshotLabelName; + +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.model.snapshots.ClassicHistogramBuckets; +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import io.prometheus.metrics.model.snapshots.DataPointSnapshot; +import io.prometheus.metrics.model.snapshots.DistributionDataPointSnapshot; +import io.prometheus.metrics.model.snapshots.Exemplar; +import io.prometheus.metrics.model.snapshots.Exemplars; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import io.prometheus.metrics.model.snapshots.HistogramSnapshot; +import io.prometheus.metrics.model.snapshots.InfoSnapshot; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.MetricMetadata; +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import io.prometheus.metrics.model.snapshots.PrometheusNaming; +import io.prometheus.metrics.model.snapshots.Quantile; +import io.prometheus.metrics.model.snapshots.SnapshotEscaper; +import io.prometheus.metrics.model.snapshots.StateSetSnapshot; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import io.prometheus.metrics.model.snapshots.UnknownSnapshot; +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.nio.charset.StandardCharsets; +import java.util.List; +import javax.annotation.Nullable; + +/** + * Write the OpenMetrics text format as defined on https://openmetrics.io. + */ +public class OpenMetricsTextFormatWriter implements ExpositionFormatWriter { + + public static class Builder { + boolean createdTimestampsEnabled; + boolean exemplarsOnAllMetricTypesEnabled; + + private Builder() {} + + /** + * @param createdTimestampsEnabled whether to include the _created timestamp in the output + */ + public Builder setCreatedTimestampsEnabled(boolean createdTimestampsEnabled) { + this.createdTimestampsEnabled = createdTimestampsEnabled; + return this; + } + + /** + * @param exemplarsOnAllMetricTypesEnabled whether to include exemplars in the output for all + * metric types + */ + public Builder setExemplarsOnAllMetricTypesEnabled(boolean exemplarsOnAllMetricTypesEnabled) { + this.exemplarsOnAllMetricTypesEnabled = exemplarsOnAllMetricTypesEnabled; + return this; + } + + public OpenMetricsTextFormatWriter build() { + return new OpenMetricsTextFormatWriter( + createdTimestampsEnabled, exemplarsOnAllMetricTypesEnabled); + } + } + + public static final String CONTENT_TYPE = + "application/openmetrics-text; version=1.0.0; charset=utf-8"; + private final boolean createdTimestampsEnabled; + private final boolean exemplarsOnAllMetricTypesEnabled; + + /** + * @param createdTimestampsEnabled whether to include the _created timestamp in the output - This + * will produce an invalid OpenMetrics output, but is kept for backwards compatibility. + */ + public OpenMetricsTextFormatWriter( + boolean createdTimestampsEnabled, boolean exemplarsOnAllMetricTypesEnabled) { + this.createdTimestampsEnabled = createdTimestampsEnabled; + this.exemplarsOnAllMetricTypesEnabled = exemplarsOnAllMetricTypesEnabled; + } + + public static Builder builder() { + return new Builder(); + } + + public static OpenMetricsTextFormatWriter create() { + return builder().build(); + } + + @Override + public boolean accepts(@Nullable String acceptHeader) { + if (acceptHeader == null) { + return false; + } + return acceptHeader.contains("application/openmetrics-text"); + } + + @Override + public String getContentType() { + return CONTENT_TYPE; + } + + @Override + public void write(OutputStream out, MetricSnapshots metricSnapshots, EscapingScheme scheme) + throws IOException { + Writer writer = new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8)); + for (MetricSnapshot s : metricSnapshots) { + MetricSnapshot snapshot = SnapshotEscaper.escapeMetricSnapshot(s, scheme); + if (!snapshot.getDataPoints().isEmpty()) { + if (snapshot instanceof CounterSnapshot) { + writeCounter(writer, (CounterSnapshot) snapshot, scheme); + } else if (snapshot instanceof GaugeSnapshot) { + writeGauge(writer, (GaugeSnapshot) snapshot, scheme); + } else if (snapshot instanceof HistogramSnapshot) { + writeHistogram(writer, (HistogramSnapshot) snapshot, scheme); + } else if (snapshot instanceof SummarySnapshot) { + writeSummary(writer, (SummarySnapshot) snapshot, scheme); + } else if (snapshot instanceof InfoSnapshot) { + writeInfo(writer, (InfoSnapshot) snapshot, scheme); + } else if (snapshot instanceof StateSetSnapshot) { + writeStateSet(writer, (StateSetSnapshot) snapshot, scheme); + } else if (snapshot instanceof UnknownSnapshot) { + writeUnknown(writer, (UnknownSnapshot) snapshot, scheme); + } + } + } + writer.write("# EOF\n"); + writer.flush(); + } + + private void writeCounter(Writer writer, CounterSnapshot snapshot, EscapingScheme scheme) + throws IOException { + MetricMetadata metadata = snapshot.getMetadata(); + writeMetadata(writer, "counter", metadata, scheme); + for (CounterSnapshot.CounterDataPointSnapshot data : snapshot.getDataPoints()) { + writeNameAndLabels( + writer, getMetadataName(metadata, scheme), "_total", data.getLabels(), scheme); + writeDouble(writer, data.getValue()); + writeScrapeTimestampAndExemplar(writer, data, data.getExemplar(), scheme); + writeCreated(writer, metadata, data, scheme); + } + } + + private void writeGauge(Writer writer, GaugeSnapshot snapshot, EscapingScheme scheme) + throws IOException { + MetricMetadata metadata = snapshot.getMetadata(); + writeMetadata(writer, "gauge", metadata, scheme); + for (GaugeSnapshot.GaugeDataPointSnapshot data : snapshot.getDataPoints()) { + writeNameAndLabels(writer, getMetadataName(metadata, scheme), null, data.getLabels(), scheme); + writeDouble(writer, data.getValue()); + if (exemplarsOnAllMetricTypesEnabled) { + writeScrapeTimestampAndExemplar(writer, data, data.getExemplar(), scheme); + } else { + writeScrapeTimestampAndExemplar(writer, data, null, scheme); + } + } + } + + private void writeHistogram(Writer writer, HistogramSnapshot snapshot, EscapingScheme scheme) + throws IOException { + MetricMetadata metadata = snapshot.getMetadata(); + if (snapshot.isGaugeHistogram()) { + writeMetadata(writer, "gaugehistogram", metadata, scheme); + writeClassicHistogramBuckets( + writer, metadata, "_gcount", "_gsum", snapshot.getDataPoints(), scheme); + } else { + writeMetadata(writer, "histogram", metadata, scheme); + writeClassicHistogramBuckets( + writer, metadata, "_count", "_sum", snapshot.getDataPoints(), scheme); + } + } + + private void writeClassicHistogramBuckets( + Writer writer, + MetricMetadata metadata, + String countSuffix, + String sumSuffix, + List dataList, + EscapingScheme scheme) + throws IOException { + for (HistogramSnapshot.HistogramDataPointSnapshot data : dataList) { + ClassicHistogramBuckets buckets = getClassicBuckets(data); + Exemplars exemplars = data.getExemplars(); + long cumulativeCount = 0; + for (int i = 0; i < buckets.size(); i++) { + cumulativeCount += buckets.getCount(i); + writeNameAndLabels( + writer, + getMetadataName(metadata, scheme), + "_bucket", + data.getLabels(), + scheme, + "le", + buckets.getUpperBound(i)); + writeLong(writer, cumulativeCount); + Exemplar exemplar; + if (i == 0) { + exemplar = exemplars.get(Double.NEGATIVE_INFINITY, buckets.getUpperBound(i)); + } else { + exemplar = exemplars.get(buckets.getUpperBound(i - 1), buckets.getUpperBound(i)); + } + writeScrapeTimestampAndExemplar(writer, data, exemplar, scheme); + } + // In OpenMetrics format, histogram _count and _sum are either both present or both absent. + if (data.hasCount() && data.hasSum()) { + writeCountAndSum(writer, metadata, data, countSuffix, sumSuffix, exemplars, scheme); + } + writeCreated(writer, metadata, data, scheme); + } + } + + private ClassicHistogramBuckets getClassicBuckets( + HistogramSnapshot.HistogramDataPointSnapshot data) { + if (data.getClassicBuckets().isEmpty()) { + return ClassicHistogramBuckets.of( + new double[] {Double.POSITIVE_INFINITY}, new long[] {data.getCount()}); + } else { + return data.getClassicBuckets(); + } + } + + private void writeSummary(Writer writer, SummarySnapshot snapshot, EscapingScheme scheme) + throws IOException { + boolean metadataWritten = false; + MetricMetadata metadata = snapshot.getMetadata(); + for (SummarySnapshot.SummaryDataPointSnapshot data : snapshot.getDataPoints()) { + if (data.getQuantiles().size() == 0 && !data.hasCount() && !data.hasSum()) { + continue; + } + if (!metadataWritten) { + writeMetadata(writer, "summary", metadata, scheme); + metadataWritten = true; + } + Exemplars exemplars = data.getExemplars(); + // Exemplars for summaries are new, and there's no best practice yet which Exemplars to choose + // for which + // time series. We select exemplars[0] for _count, exemplars[1] for _sum, and exemplars[2...] + // for the + // quantiles, all indexes modulo exemplars.length. + int exemplarIndex = 1; + for (Quantile quantile : data.getQuantiles()) { + writeNameAndLabels( + writer, + getMetadataName(metadata, scheme), + null, + data.getLabels(), + scheme, + "quantile", + quantile.getQuantile()); + writeDouble(writer, quantile.getValue()); + if (exemplars.size() > 0 && exemplarsOnAllMetricTypesEnabled) { + exemplarIndex = (exemplarIndex + 1) % exemplars.size(); + writeScrapeTimestampAndExemplar(writer, data, exemplars.get(exemplarIndex), scheme); + } else { + writeScrapeTimestampAndExemplar(writer, data, null, scheme); + } + } + // Unlike histograms, summaries can have only a count or only a sum according to OpenMetrics. + writeCountAndSum(writer, metadata, data, "_count", "_sum", exemplars, scheme); + writeCreated(writer, metadata, data, scheme); + } + } + + private void writeInfo(Writer writer, InfoSnapshot snapshot, EscapingScheme scheme) + throws IOException { + MetricMetadata metadata = snapshot.getMetadata(); + writeMetadata(writer, "info", metadata, scheme); + for (InfoSnapshot.InfoDataPointSnapshot data : snapshot.getDataPoints()) { + writeNameAndLabels( + writer, getMetadataName(metadata, scheme), "_info", data.getLabels(), scheme); + writer.write("1"); + writeScrapeTimestampAndExemplar(writer, data, null, scheme); + } + } + + private void writeStateSet(Writer writer, StateSetSnapshot snapshot, EscapingScheme scheme) + throws IOException { + MetricMetadata metadata = snapshot.getMetadata(); + writeMetadata(writer, "stateset", metadata, scheme); + for (StateSetSnapshot.StateSetDataPointSnapshot data : snapshot.getDataPoints()) { + for (int i = 0; i < data.size(); i++) { + writer.write(getMetadataName(metadata, scheme)); + writer.write('{'); + Labels labels = data.getLabels(); + for (int j = 0; j < labels.size(); j++) { + if (j > 0) { + writer.write(","); + } + writer.write(getSnapshotLabelName(labels, j, scheme)); + writer.write("=\""); + writeEscapedString(writer, labels.getValue(j)); + writer.write("\""); + } + if (!labels.isEmpty()) { + writer.write(","); + } + writer.write(getMetadataName(metadata, scheme)); + writer.write("=\""); + writeEscapedString(writer, data.getName(i)); + writer.write("\"} "); + if (data.isTrue(i)) { + writer.write("1"); + } else { + writer.write("0"); + } + writeScrapeTimestampAndExemplar(writer, data, null, scheme); + } + } + } + + private void writeUnknown(Writer writer, UnknownSnapshot snapshot, EscapingScheme scheme) + throws IOException { + MetricMetadata metadata = snapshot.getMetadata(); + writeMetadata(writer, "unknown", metadata, scheme); + for (UnknownSnapshot.UnknownDataPointSnapshot data : snapshot.getDataPoints()) { + writeNameAndLabels(writer, getMetadataName(metadata, scheme), null, data.getLabels(), scheme); + writeDouble(writer, data.getValue()); + if (exemplarsOnAllMetricTypesEnabled) { + writeScrapeTimestampAndExemplar(writer, data, data.getExemplar(), scheme); + } else { + writeScrapeTimestampAndExemplar(writer, data, null, scheme); + } + } + } + + private void writeCountAndSum( + Writer writer, + MetricMetadata metadata, + DistributionDataPointSnapshot data, + String countSuffix, + String sumSuffix, + Exemplars exemplars, + EscapingScheme scheme) + throws IOException { + if (data.hasCount()) { + writeNameAndLabels( + writer, getMetadataName(metadata, scheme), countSuffix, data.getLabels(), scheme); + writeLong(writer, data.getCount()); + if (exemplarsOnAllMetricTypesEnabled) { + writeScrapeTimestampAndExemplar(writer, data, exemplars.getLatest(), scheme); + } else { + writeScrapeTimestampAndExemplar(writer, data, null, scheme); + } + } + if (data.hasSum()) { + writeNameAndLabels( + writer, getMetadataName(metadata, scheme), sumSuffix, data.getLabels(), scheme); + writeDouble(writer, data.getSum()); + writeScrapeTimestampAndExemplar(writer, data, null, scheme); + } + } + + private void writeCreated( + Writer writer, MetricMetadata metadata, DataPointSnapshot data, EscapingScheme scheme) + throws IOException { + if (createdTimestampsEnabled && data.hasCreatedTimestamp()) { + writeNameAndLabels( + writer, getMetadataName(metadata, scheme), "_created", data.getLabels(), scheme); + writeOpenMetricsTimestamp(writer, data.getCreatedTimestampMillis()); + if (data.hasScrapeTimestamp()) { + writer.write(' '); + writeOpenMetricsTimestamp(writer, data.getScrapeTimestampMillis()); + } + writer.write('\n'); + } + } + + private void writeNameAndLabels( + Writer writer, + String name, + @Nullable String suffix, + Labels labels, + EscapingScheme escapingScheme) + throws IOException { + writeNameAndLabels(writer, name, suffix, labels, escapingScheme, null, 0.0); + } + + private void writeNameAndLabels( + Writer writer, + String name, + @Nullable String suffix, + Labels labels, + EscapingScheme escapingScheme, + @Nullable String additionalLabelName, + double additionalLabelValue) + throws IOException { + boolean metricInsideBraces = false; + // If the name does not pass the legacy validity check, we must put the + // metric name inside the braces. + if (!PrometheusNaming.isValidLegacyMetricName(name)) { + metricInsideBraces = true; + writer.write('{'); + } + writeName(writer, name + (suffix != null ? suffix : ""), NameType.Metric); + if (!labels.isEmpty() || additionalLabelName != null) { + writeLabels( + writer, + labels, + additionalLabelName, + additionalLabelValue, + metricInsideBraces, + escapingScheme); + } else if (metricInsideBraces) { + writer.write('}'); + } + writer.write(' '); + } + + private void writeScrapeTimestampAndExemplar( + Writer writer, DataPointSnapshot data, @Nullable Exemplar exemplar, EscapingScheme scheme) + throws IOException { + if (data.hasScrapeTimestamp()) { + writer.write(' '); + writeOpenMetricsTimestamp(writer, data.getScrapeTimestampMillis()); + } + if (exemplar != null) { + writer.write(" # "); + writeLabels(writer, exemplar.getLabels(), null, 0, false, scheme); + writer.write(' '); + writeDouble(writer, exemplar.getValue()); + if (exemplar.hasTimestamp()) { + writer.write(' '); + writeOpenMetricsTimestamp(writer, exemplar.getTimestampMillis()); + } + } + writer.write('\n'); + } + + private void writeMetadata( + Writer writer, String typeName, MetricMetadata metadata, EscapingScheme scheme) + throws IOException { + writer.write("# TYPE "); + writeName(writer, getMetadataName(metadata, scheme), NameType.Metric); + writer.write(' '); + writer.write(typeName); + writer.write('\n'); + if (metadata.getUnit() != null) { + writer.write("# UNIT "); + writeName(writer, getMetadataName(metadata, scheme), NameType.Metric); + writer.write(' '); + writeEscapedString(writer, metadata.getUnit().toString()); + writer.write('\n'); + } + if (metadata.getHelp() != null && !metadata.getHelp().isEmpty()) { + writer.write("# HELP "); + writeName(writer, getMetadataName(metadata, scheme), NameType.Metric); + writer.write(' '); + writeEscapedString(writer, metadata.getHelp()); + writer.write('\n'); + } + } +} diff --git a/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/PrometheusProtobufWriter.java b/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/PrometheusProtobufWriter.java new file mode 100644 index 000000000..342beb255 --- /dev/null +++ b/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/PrometheusProtobufWriter.java @@ -0,0 +1,75 @@ +package io.prometheus.metrics.expositionformats; + +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.io.IOException; +import java.io.OutputStream; +import javax.annotation.Nullable; + +/** + * Write the Prometheus protobuf format as defined in github.com/prometheus/client_model. + * + *

    As of today, this is the only exposition format that supports native histograms. + */ +public class PrometheusProtobufWriter implements ExpositionFormatWriter { + + @Nullable private static final ExpositionFormatWriter DELEGATE = createProtobufWriter(); + + public static final String CONTENT_TYPE = + "application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; " + + "encoding=delimited"; + + @Nullable + private static ExpositionFormatWriter createProtobufWriter() { + try { + return Class.forName( + "io.prometheus.metrics.expositionformats.internal.PrometheusProtobufWriterImpl") + .asSubclass(ExpositionFormatWriter.class) + .getDeclaredConstructor() + .newInstance(); + } catch (Exception e) { + // not in classpath + return null; + } + } + + @Override + public boolean accepts(@Nullable String acceptHeader) { + if (acceptHeader == null) { + return false; + } else { + return acceptHeader.contains("application/vnd.google.protobuf") + && acceptHeader.contains("proto=io.prometheus.client.MetricFamily"); + } + } + + @Override + public String getContentType() { + return CONTENT_TYPE; + } + + @Override + public boolean isAvailable() { + return DELEGATE != null; + } + + @Override + public String toDebugString(MetricSnapshots metricSnapshots, EscapingScheme escapingScheme) { + return getDelegate().toDebugString(metricSnapshots, escapingScheme); + } + + @Override + public void write( + OutputStream out, MetricSnapshots metricSnapshots, EscapingScheme escapingScheme) + throws IOException { + getDelegate().write(out, metricSnapshots, escapingScheme); + } + + private ExpositionFormatWriter getDelegate() { + if (DELEGATE == null) { + throw new UnsupportedOperationException("Prometheus protobuf writer not available"); + } + return DELEGATE; + } +} diff --git a/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/PrometheusTextFormatWriter.java b/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/PrometheusTextFormatWriter.java new file mode 100644 index 000000000..73d33504e --- /dev/null +++ b/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/PrometheusTextFormatWriter.java @@ -0,0 +1,459 @@ +package io.prometheus.metrics.expositionformats; + +import static io.prometheus.metrics.expositionformats.TextFormatUtil.writeDouble; +import static io.prometheus.metrics.expositionformats.TextFormatUtil.writeEscapedString; +import static io.prometheus.metrics.expositionformats.TextFormatUtil.writeLabels; +import static io.prometheus.metrics.expositionformats.TextFormatUtil.writeLong; +import static io.prometheus.metrics.expositionformats.TextFormatUtil.writeName; +import static io.prometheus.metrics.expositionformats.TextFormatUtil.writePrometheusTimestamp; +import static io.prometheus.metrics.model.snapshots.SnapshotEscaper.escapeMetricSnapshot; +import static io.prometheus.metrics.model.snapshots.SnapshotEscaper.getMetadataName; +import static io.prometheus.metrics.model.snapshots.SnapshotEscaper.getSnapshotLabelName; + +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.model.snapshots.ClassicHistogramBuckets; +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import io.prometheus.metrics.model.snapshots.DataPointSnapshot; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import io.prometheus.metrics.model.snapshots.HistogramSnapshot; +import io.prometheus.metrics.model.snapshots.InfoSnapshot; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.MetricMetadata; +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import io.prometheus.metrics.model.snapshots.PrometheusNaming; +import io.prometheus.metrics.model.snapshots.Quantile; +import io.prometheus.metrics.model.snapshots.StateSetSnapshot; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import io.prometheus.metrics.model.snapshots.UnknownSnapshot; +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.nio.charset.StandardCharsets; +import javax.annotation.Nullable; + +/** + * Write the Prometheus text format. This is the default if you view a Prometheus endpoint with your + * Web browser. + */ +public class PrometheusTextFormatWriter implements ExpositionFormatWriter { + + public static final String CONTENT_TYPE = "text/plain; version=0.0.4; charset=utf-8"; + + private final boolean writeCreatedTimestamps; + private final boolean timestampsInMs; + + public static class Builder { + boolean includeCreatedTimestamps; + boolean timestampsInMs = true; + + private Builder() {} + + /** + * @param includeCreatedTimestamps whether to include the _created timestamp in the output + */ + public Builder setIncludeCreatedTimestamps(boolean includeCreatedTimestamps) { + this.includeCreatedTimestamps = includeCreatedTimestamps; + return this; + } + + @Deprecated + public Builder setTimestampsInMs(boolean timestampsInMs) { + this.timestampsInMs = timestampsInMs; + return this; + } + + public PrometheusTextFormatWriter build() { + return new PrometheusTextFormatWriter(includeCreatedTimestamps, timestampsInMs); + } + } + + /** + * @param writeCreatedTimestamps whether to include the _created timestamp in the output - This + * will produce an invalid OpenMetrics output, but is kept for backwards compatibility. + * @deprecated this constructor is deprecated and will be removed in the next major version - + * {@link #builder()} or {@link #create()} instead + */ + @Deprecated + public PrometheusTextFormatWriter(boolean writeCreatedTimestamps) { + this(writeCreatedTimestamps, false); + } + + private PrometheusTextFormatWriter(boolean writeCreatedTimestamps, boolean timestampsInMs) { + this.writeCreatedTimestamps = writeCreatedTimestamps; + this.timestampsInMs = timestampsInMs; + } + + public static PrometheusTextFormatWriter.Builder builder() { + return new Builder(); + } + + public static PrometheusTextFormatWriter create() { + return builder().build(); + } + + @Override + public boolean accepts(@Nullable String acceptHeader) { + if (acceptHeader == null) { + return false; + } else { + return acceptHeader.contains("text/plain"); + } + } + + @Override + public String getContentType() { + return CONTENT_TYPE; + } + + @Override + public void write(OutputStream out, MetricSnapshots metricSnapshots, EscapingScheme scheme) + throws IOException { + // See https://prometheus.io/docs/instrumenting/exposition_formats/ + // "unknown", "gauge", "counter", "stateset", "info", "histogram", "gaugehistogram", and + // "summary". + Writer writer = new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8)); + for (MetricSnapshot s : metricSnapshots) { + MetricSnapshot snapshot = escapeMetricSnapshot(s, scheme); + if (!snapshot.getDataPoints().isEmpty()) { + if (snapshot instanceof CounterSnapshot) { + writeCounter(writer, (CounterSnapshot) snapshot, scheme); + } else if (snapshot instanceof GaugeSnapshot) { + writeGauge(writer, (GaugeSnapshot) snapshot, scheme); + } else if (snapshot instanceof HistogramSnapshot) { + writeHistogram(writer, (HistogramSnapshot) snapshot, scheme); + } else if (snapshot instanceof SummarySnapshot) { + writeSummary(writer, (SummarySnapshot) snapshot, scheme); + } else if (snapshot instanceof InfoSnapshot) { + writeInfo(writer, (InfoSnapshot) snapshot, scheme); + } else if (snapshot instanceof StateSetSnapshot) { + writeStateSet(writer, (StateSetSnapshot) snapshot, scheme); + } else if (snapshot instanceof UnknownSnapshot) { + writeUnknown(writer, (UnknownSnapshot) snapshot, scheme); + } + } + } + if (writeCreatedTimestamps) { + for (MetricSnapshot s : metricSnapshots) { + MetricSnapshot snapshot = escapeMetricSnapshot(s, scheme); + if (!snapshot.getDataPoints().isEmpty()) { + if (snapshot instanceof CounterSnapshot) { + writeCreated(writer, snapshot, scheme); + } else if (snapshot instanceof HistogramSnapshot) { + writeCreated(writer, snapshot, scheme); + } else if (snapshot instanceof SummarySnapshot) { + writeCreated(writer, snapshot, scheme); + } + } + } + } + writer.flush(); + } + + public void writeCreated(Writer writer, MetricSnapshot snapshot, EscapingScheme scheme) + throws IOException { + boolean metadataWritten = false; + MetricMetadata metadata = snapshot.getMetadata(); + for (DataPointSnapshot data : snapshot.getDataPoints()) { + if (data.hasCreatedTimestamp()) { + if (!metadataWritten) { + writeMetadata(writer, "_created", "gauge", metadata, scheme); + metadataWritten = true; + } + writeNameAndLabels( + writer, getMetadataName(metadata, scheme), "_created", data.getLabels(), scheme); + writePrometheusTimestamp(writer, data.getCreatedTimestampMillis(), timestampsInMs); + writeScrapeTimestampAndNewline(writer, data); + } + } + } + + private void writeCounter(Writer writer, CounterSnapshot snapshot, EscapingScheme scheme) + throws IOException { + if (!snapshot.getDataPoints().isEmpty()) { + MetricMetadata metadata = snapshot.getMetadata(); + writeMetadata(writer, "_total", "counter", metadata, scheme); + for (CounterSnapshot.CounterDataPointSnapshot data : snapshot.getDataPoints()) { + writeNameAndLabels( + writer, getMetadataName(metadata, scheme), "_total", data.getLabels(), scheme); + writeDouble(writer, data.getValue()); + writeScrapeTimestampAndNewline(writer, data); + } + } + } + + private void writeGauge(Writer writer, GaugeSnapshot snapshot, EscapingScheme scheme) + throws IOException { + MetricMetadata metadata = snapshot.getMetadata(); + writeMetadata(writer, "", "gauge", metadata, scheme); + for (GaugeSnapshot.GaugeDataPointSnapshot data : snapshot.getDataPoints()) { + writeNameAndLabels(writer, getMetadataName(metadata, scheme), null, data.getLabels(), scheme); + writeDouble(writer, data.getValue()); + writeScrapeTimestampAndNewline(writer, data); + } + } + + private void writeHistogram(Writer writer, HistogramSnapshot snapshot, EscapingScheme scheme) + throws IOException { + MetricMetadata metadata = snapshot.getMetadata(); + writeMetadata(writer, "", "histogram", metadata, scheme); + for (HistogramSnapshot.HistogramDataPointSnapshot data : snapshot.getDataPoints()) { + ClassicHistogramBuckets buckets = getClassicBuckets(data); + long cumulativeCount = 0; + for (int i = 0; i < buckets.size(); i++) { + cumulativeCount += buckets.getCount(i); + writeNameAndLabels( + writer, + getMetadataName(metadata, scheme), + "_bucket", + data.getLabels(), + scheme, + "le", + buckets.getUpperBound(i)); + writeLong(writer, cumulativeCount); + writeScrapeTimestampAndNewline(writer, data); + } + if (!snapshot.isGaugeHistogram()) { + if (data.hasCount()) { + writeNameAndLabels( + writer, getMetadataName(metadata, scheme), "_count", data.getLabels(), scheme); + writeLong(writer, data.getCount()); + writeScrapeTimestampAndNewline(writer, data); + } + if (data.hasSum()) { + writeNameAndLabels( + writer, getMetadataName(metadata, scheme), "_sum", data.getLabels(), scheme); + writeDouble(writer, data.getSum()); + writeScrapeTimestampAndNewline(writer, data); + } + } + } + if (snapshot.isGaugeHistogram()) { + writeGaugeCountSum(writer, snapshot, metadata, scheme); + } + } + + private ClassicHistogramBuckets getClassicBuckets( + HistogramSnapshot.HistogramDataPointSnapshot data) { + if (data.getClassicBuckets().isEmpty()) { + return ClassicHistogramBuckets.of( + new double[] {Double.POSITIVE_INFINITY}, new long[] {data.getCount()}); + } else { + return data.getClassicBuckets(); + } + } + + private void writeGaugeCountSum( + Writer writer, HistogramSnapshot snapshot, MetricMetadata metadata, EscapingScheme scheme) + throws IOException { + // Prometheus text format does not support gaugehistogram's _gcount and _gsum. + // So we append _gcount and _gsum as gauge metrics. + boolean metadataWritten = false; + for (HistogramSnapshot.HistogramDataPointSnapshot data : snapshot.getDataPoints()) { + if (data.hasCount()) { + if (!metadataWritten) { + writeMetadata(writer, "_gcount", "gauge", metadata, scheme); + metadataWritten = true; + } + writeNameAndLabels( + writer, getMetadataName(metadata, scheme), "_gcount", data.getLabels(), scheme); + writeLong(writer, data.getCount()); + writeScrapeTimestampAndNewline(writer, data); + } + } + metadataWritten = false; + for (HistogramSnapshot.HistogramDataPointSnapshot data : snapshot.getDataPoints()) { + if (data.hasSum()) { + if (!metadataWritten) { + writeMetadata(writer, "_gsum", "gauge", metadata, scheme); + metadataWritten = true; + } + writeNameAndLabels( + writer, getMetadataName(metadata, scheme), "_gsum", data.getLabels(), scheme); + writeDouble(writer, data.getSum()); + writeScrapeTimestampAndNewline(writer, data); + } + } + } + + private void writeSummary(Writer writer, SummarySnapshot snapshot, EscapingScheme scheme) + throws IOException { + boolean metadataWritten = false; + MetricMetadata metadata = snapshot.getMetadata(); + for (SummarySnapshot.SummaryDataPointSnapshot data : snapshot.getDataPoints()) { + if (data.getQuantiles().size() == 0 && !data.hasCount() && !data.hasSum()) { + continue; + } + if (!metadataWritten) { + writeMetadata(writer, "", "summary", metadata, scheme); + metadataWritten = true; + } + for (Quantile quantile : data.getQuantiles()) { + writeNameAndLabels( + writer, + getMetadataName(metadata, scheme), + null, + data.getLabels(), + scheme, + "quantile", + quantile.getQuantile()); + writeDouble(writer, quantile.getValue()); + writeScrapeTimestampAndNewline(writer, data); + } + if (data.hasCount()) { + writeNameAndLabels( + writer, getMetadataName(metadata, scheme), "_count", data.getLabels(), scheme); + writeLong(writer, data.getCount()); + writeScrapeTimestampAndNewline(writer, data); + } + if (data.hasSum()) { + writeNameAndLabels( + writer, getMetadataName(metadata, scheme), "_sum", data.getLabels(), scheme); + writeDouble(writer, data.getSum()); + writeScrapeTimestampAndNewline(writer, data); + } + } + } + + private void writeInfo(Writer writer, InfoSnapshot snapshot, EscapingScheme scheme) + throws IOException { + MetricMetadata metadata = snapshot.getMetadata(); + writeMetadata(writer, "_info", "gauge", metadata, scheme); + for (InfoSnapshot.InfoDataPointSnapshot data : snapshot.getDataPoints()) { + writeNameAndLabels( + writer, getMetadataName(metadata, scheme), "_info", data.getLabels(), scheme); + writer.write("1"); + writeScrapeTimestampAndNewline(writer, data); + } + } + + private void writeStateSet(Writer writer, StateSetSnapshot snapshot, EscapingScheme scheme) + throws IOException { + MetricMetadata metadata = snapshot.getMetadata(); + writeMetadata(writer, "", "gauge", metadata, scheme); + for (StateSetSnapshot.StateSetDataPointSnapshot data : snapshot.getDataPoints()) { + for (int i = 0; i < data.size(); i++) { + writer.write(getMetadataName(metadata, scheme)); + writer.write('{'); + for (int j = 0; j < data.getLabels().size(); j++) { + if (j > 0) { + writer.write(","); + } + writer.write(getSnapshotLabelName(data.getLabels(), j, scheme)); + writer.write("=\""); + writeEscapedString(writer, data.getLabels().getValue(j)); + writer.write("\""); + } + if (!data.getLabels().isEmpty()) { + writer.write(","); + } + writer.write(getMetadataName(metadata, scheme)); + writer.write("=\""); + writeEscapedString(writer, data.getName(i)); + writer.write("\"} "); + if (data.isTrue(i)) { + writer.write("1"); + } else { + writer.write("0"); + } + writeScrapeTimestampAndNewline(writer, data); + } + } + } + + private void writeUnknown(Writer writer, UnknownSnapshot snapshot, EscapingScheme scheme) + throws IOException { + MetricMetadata metadata = snapshot.getMetadata(); + writeMetadata(writer, "", "untyped", metadata, scheme); + for (UnknownSnapshot.UnknownDataPointSnapshot data : snapshot.getDataPoints()) { + writeNameAndLabels(writer, getMetadataName(metadata, scheme), null, data.getLabels(), scheme); + writeDouble(writer, data.getValue()); + writeScrapeTimestampAndNewline(writer, data); + } + } + + private void writeNameAndLabels( + Writer writer, + String name, + @Nullable String suffix, + Labels labels, + EscapingScheme escapingScheme) + throws IOException { + writeNameAndLabels(writer, name, suffix, labels, escapingScheme, null, 0.0); + } + + private void writeNameAndLabels( + Writer writer, + String name, + @Nullable String suffix, + Labels labels, + EscapingScheme scheme, + @Nullable String additionalLabelName, + double additionalLabelValue) + throws IOException { + boolean metricInsideBraces = false; + // If the name does not pass the legacy validity check, we must put the + // metric name inside the braces. + if (!PrometheusNaming.isValidLegacyMetricName(name)) { + metricInsideBraces = true; + writer.write('{'); + } + writeName(writer, name + (suffix != null ? suffix : ""), NameType.Metric); + if (!labels.isEmpty() || additionalLabelName != null) { + writeLabels( + writer, labels, additionalLabelName, additionalLabelValue, metricInsideBraces, scheme); + } else if (metricInsideBraces) { + writer.write('}'); + } + writer.write(' '); + } + + private void writeMetadata( + Writer writer, + @Nullable String suffix, + String typeString, + MetricMetadata metadata, + EscapingScheme scheme) + throws IOException { + String name = getMetadataName(metadata, scheme) + (suffix != null ? suffix : ""); + if (metadata.getHelp() != null && !metadata.getHelp().isEmpty()) { + writer.write("# HELP "); + writeName(writer, name, NameType.Metric); + writer.write(' '); + writeEscapedHelp(writer, metadata.getHelp()); + writer.write('\n'); + } + writer.write("# TYPE "); + writeName(writer, name, NameType.Metric); + writer.write(' '); + writer.write(typeString); + writer.write('\n'); + } + + private void writeEscapedHelp(Writer writer, String s) throws IOException { + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + switch (c) { + case '\\': + writer.append("\\\\"); + break; + case '\n': + writer.append("\\n"); + break; + default: + writer.append(c); + } + } + } + + private void writeScrapeTimestampAndNewline(Writer writer, DataPointSnapshot data) + throws IOException { + if (data.hasScrapeTimestamp()) { + writer.write(' '); + writePrometheusTimestamp(writer, data.getScrapeTimestampMillis(), timestampsInMs); + } + writer.write('\n'); + } +} diff --git a/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/TextFormatUtil.java b/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/TextFormatUtil.java new file mode 100644 index 000000000..fb9d3f313 --- /dev/null +++ b/prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/TextFormatUtil.java @@ -0,0 +1,158 @@ +package io.prometheus.metrics.expositionformats; + +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.PrometheusNaming; +import io.prometheus.metrics.model.snapshots.SnapshotEscaper; +import java.io.IOException; +import java.io.Writer; +import javax.annotation.Nullable; + +public class TextFormatUtil { + + static void writeLong(Writer writer, long value) throws IOException { + writer.append(Long.toString(value)); + } + + static void writeDouble(Writer writer, double d) throws IOException { + if (d == Double.POSITIVE_INFINITY) { + writer.write("+Inf"); + } else if (d == Double.NEGATIVE_INFINITY) { + writer.write("-Inf"); + } else { + writer.write(Double.toString(d)); + // FloatingDecimal.getBinaryToASCIIConverter(d).appendTo(writer); + } + } + + static void writePrometheusTimestamp(Writer writer, long timestampMs, boolean timestampsInMs) + throws IOException { + if (timestampsInMs) { + // correct for prometheus exposition format + // https://prometheus.io/docs/instrumenting/exposition_formats/#text-format-details + writer.write(Long.toString(timestampMs)); + } else { + // incorrect for prometheus exposition format - + // but we need to support it for backwards compatibility + writeOpenMetricsTimestamp(writer, timestampMs); + } + } + + static void writeOpenMetricsTimestamp(Writer writer, long timestampMs) throws IOException { + writer.write(Long.toString(timestampMs / 1000L)); + writer.write("."); + long ms = timestampMs % 1000; + if (ms < 100) { + writer.write("0"); + } + if (ms < 10) { + writer.write("0"); + } + writer.write(Long.toString(ms)); + } + + static void writeEscapedString(Writer writer, String s) throws IOException { + // optimize for the common case where no escaping is needed + int start = 0; + // #indexOf is a vectorized intrinsic + int backslashIndex = s.indexOf('\\', start); + int quoteIndex = s.indexOf('\"', start); + int newlineIndex = s.indexOf('\n', start); + + int allEscapesIndex = backslashIndex & quoteIndex & newlineIndex; + while (allEscapesIndex != -1) { + int escapeStart = Integer.MAX_VALUE; + if (backslashIndex != -1) { + escapeStart = backslashIndex; + } + if (quoteIndex != -1) { + escapeStart = Math.min(escapeStart, quoteIndex); + } + if (newlineIndex != -1) { + escapeStart = Math.min(escapeStart, newlineIndex); + } + + // bulk write up to the first character that needs to be escaped + if (escapeStart > start) { + writer.write(s, start, escapeStart - start); + } + char c = s.charAt(escapeStart); + start = escapeStart + 1; + switch (c) { + case '\\': + writer.write("\\\\"); + backslashIndex = s.indexOf('\\', start); + break; + case '\"': + writer.write("\\\""); + quoteIndex = s.indexOf('\"', start); + break; + case '\n': + writer.write("\\n"); + newlineIndex = s.indexOf('\n', start); + break; + } + + allEscapesIndex = backslashIndex & quoteIndex & newlineIndex; + } + // up until the end nothing needs to be escaped anymore + int remaining = s.length() - start; + if (remaining > 0) { + writer.write(s, start, remaining); + } + } + + static void writeLabels( + Writer writer, + Labels labels, + @Nullable String additionalLabelName, + double additionalLabelValue, + boolean metricInsideBraces, + EscapingScheme scheme) + throws IOException { + if (!metricInsideBraces) { + writer.write('{'); + } + for (int i = 0; i < labels.size(); i++) { + if (i > 0 || metricInsideBraces) { + writer.write(","); + } + writeName(writer, SnapshotEscaper.getSnapshotLabelName(labels, i, scheme), NameType.Label); + writer.write("=\""); + writeEscapedString(writer, labels.getValue(i)); + writer.write("\""); + } + if (additionalLabelName != null) { + if (!labels.isEmpty() || metricInsideBraces) { + writer.write(","); + } + writer.write(additionalLabelName); + writer.write("=\""); + writeDouble(writer, additionalLabelValue); + writer.write("\""); + } + writer.write('}'); + } + + static void writeName(Writer writer, String name, NameType nameType) throws IOException { + switch (nameType) { + case Metric: + if (PrometheusNaming.isValidLegacyMetricName(name)) { + writer.write(name); + return; + } + break; + case Label: + if (PrometheusNaming.isValidLegacyLabelName(name)) { + writer.write(name); + return; + } + break; + default: + throw new RuntimeException("Invalid name type requested: " + nameType); + } + writer.write('"'); + writeEscapedString(writer, name); + writer.write('"'); + } +} diff --git a/prometheus-metrics-exposition-textformats/src/test/java/io/prometheus/metrics/expositionformats/ExpositionFormatWriterTest.java b/prometheus-metrics-exposition-textformats/src/test/java/io/prometheus/metrics/expositionformats/ExpositionFormatWriterTest.java new file mode 100644 index 000000000..51b4de8bb --- /dev/null +++ b/prometheus-metrics-exposition-textformats/src/test/java/io/prometheus/metrics/expositionformats/ExpositionFormatWriterTest.java @@ -0,0 +1,38 @@ +package io.prometheus.metrics.expositionformats; + +import static org.assertj.core.api.Assertions.assertThat; + +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import org.junit.jupiter.api.Test; + +class ExpositionFormatWriterTest { + + private final ExpositionFormatWriter writer = OpenMetricsTextFormatWriter.create(); + + @Test + void write() throws IOException { + MetricSnapshots snapshots = new MetricSnapshots(); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + writer.write(out, snapshots, EscapingScheme.ALLOW_UTF8); + assertThat(out).hasToString("# EOF\n"); + + out.reset(); + writer.write(out, snapshots); + assertThat(out).hasToString("# EOF\n"); + } + + @Test + void toDebugString() { + assertThat(writer.toDebugString(new MetricSnapshots(), EscapingScheme.ALLOW_UTF8)) + .isEqualTo("# EOF\n"); + assertThat(writer.toDebugString(new MetricSnapshots())).isEqualTo("# EOF\n"); + } + + @Test + void isAvailable() { + assertThat(writer.isAvailable()).isTrue(); + } +} diff --git a/prometheus-metrics-exposition-textformats/src/test/java/io/prometheus/metrics/expositionformats/ExpositionFormatsTest.java b/prometheus-metrics-exposition-textformats/src/test/java/io/prometheus/metrics/expositionformats/ExpositionFormatsTest.java new file mode 100644 index 000000000..8a31e41b1 --- /dev/null +++ b/prometheus-metrics-exposition-textformats/src/test/java/io/prometheus/metrics/expositionformats/ExpositionFormatsTest.java @@ -0,0 +1,2910 @@ +package io.prometheus.metrics.expositionformats; + +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.assertj.core.api.Assertions.assertThat; + +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.model.snapshots.ClassicHistogramBuckets; +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import io.prometheus.metrics.model.snapshots.CounterSnapshot.CounterDataPointSnapshot; +import io.prometheus.metrics.model.snapshots.Exemplar; +import io.prometheus.metrics.model.snapshots.Exemplars; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot.GaugeDataPointSnapshot; +import io.prometheus.metrics.model.snapshots.HistogramSnapshot; +import io.prometheus.metrics.model.snapshots.InfoSnapshot; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import io.prometheus.metrics.model.snapshots.NativeHistogramBuckets; +import io.prometheus.metrics.model.snapshots.PrometheusNaming; +import io.prometheus.metrics.model.snapshots.Quantiles; +import io.prometheus.metrics.model.snapshots.StateSetSnapshot; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import io.prometheus.metrics.model.snapshots.SummarySnapshot.SummaryDataPointSnapshot; +import io.prometheus.metrics.model.snapshots.Unit; +import io.prometheus.metrics.model.snapshots.UnknownSnapshot; +import io.prometheus.metrics.model.snapshots.UnknownSnapshot.UnknownDataPointSnapshot; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; + +class ExpositionFormatsTest { + + private final String exemplar1String = + "{env=\"prod\",span_id=\"12345\",trace_id=\"abcde\"} 1.7 1672850685.829"; + private final String exemplar2String = + "{env=\"dev\",span_id=\"23456\",trace_id=\"bcdef\"} 2.4 1672850685.830"; + private final String exemplarWithDotsString = + "{some_exemplar_key=\"some value\"} 3.0 1690298864.383"; + + private final String exemplar1protoString = + "exemplar { " + + "label { name: \"env\" value: \"prod\" } " + + "label { name: \"span_id\" value: \"12345\" } " + + "label { name: \"trace_id\" value: \"abcde\" } " + + "value: 1.7 " + + "timestamp { seconds: 1672850685 nanos: 829000000 } }"; + + private final String exemplar2protoString = + "exemplar { " + + "label { name: \"env\" value: \"dev\" } " + + "label { name: \"span_id\" value: \"23456\" } " + + "label { name: \"trace_id\" value: \"bcdef\" } " + + "value: 2.4 " + + "timestamp { seconds: 1672850685 nanos: 830000000 } }"; + + private final String exemplarWithDotsProtoString = + "exemplar { " + + "label { name: \"some_exemplar_key\" value: \"some value\" } " + + "value: 3.0 " + + "timestamp { seconds: 1690298864 nanos: 383000000 } }"; + + private final String createdTimestamp1s = "1672850385.800"; + private final long createdTimestamp1 = (long) (1000 * Double.parseDouble(createdTimestamp1s)); + private final String createdTimestamp2s = "1672850285.000"; + private final long createdTimestamp2 = (long) (1000 * Double.parseDouble(createdTimestamp2s)); + private final String scrapeTimestamp1s = "1672850685.829"; + private final long scrapeTimestamp1 = (long) (1000 * Double.parseDouble(scrapeTimestamp1s)); + private final String scrapeTimestamp2s = "1672850585.820"; + private final long scrapeTimestamp2 = (long) (1000 * Double.parseDouble(scrapeTimestamp2s)); + + private final Exemplar exemplar1 = + Exemplar.builder() + .spanId("12345") + .traceId("abcde") + .labels(Labels.of("env", "prod")) + .value(1.7) + .timestampMillis(1672850685829L) + .build(); + + private final Exemplar exemplar2 = + Exemplar.builder() + .spanId("23456") + .traceId("bcdef") + .labels(Labels.of("env", "dev")) + .value(2.4) + .timestampMillis(1672850685830L) + .build(); + + private final Exemplar exemplarWithDots = + Exemplar.builder() + .labels(Labels.of("some.exemplar.key", "some value")) + .value(3.0) + .timestampMillis(1690298864383L) + .build(); + + @Test + void init() { + ExpositionFormats formats = ExpositionFormats.init(); + assertThat(formats.findWriter("application/openmetrics-text")).isNotNull(); + assertThat(formats.findWriter("application/vnd.google.protobuf")).isNotNull(); + assertThat(formats.findWriter("text/plain")).isNotNull(); + assertThat(formats.getOpenMetricsTextFormatWriter()).isNotNull(); + assertThat(formats.getPrometheusProtobufWriter()).isNotNull(); + assertThat(formats.getPrometheusTextFormatWriter()).isNotNull(); + } + + @Test + public void testCounterComplete() throws IOException { + String openMetricsText = + "# TYPE service:time_seconds counter\n" + + "# UNIT service:time_seconds seconds\n" + + "# HELP service:time_seconds total time spent serving\n" + + "service:time_seconds_total{path=\"/hello\",status=\"200\"} 0.8 " + + scrapeTimestamp1s + + " # " + + exemplar1String + + "\n" + + "service:time_seconds_created{path=\"/hello\",status=\"200\"} " + + createdTimestamp1s + + " " + + scrapeTimestamp1s + + "\n" + + "service:time_seconds_total{path=\"/hello\",status=\"500\"} 0.9 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "service:time_seconds_created{path=\"/hello\",status=\"500\"} " + + createdTimestamp2s + + " " + + scrapeTimestamp2s + + "\n" + + "# EOF\n"; + String prometheusText = + "# HELP service:time_seconds_total total time spent serving\n" + + "# TYPE service:time_seconds_total counter\n" + + "service:time_seconds_total{path=\"/hello\",status=\"200\"} 0.8 " + + scrapeTimestamp1s + + "\n" + + "service:time_seconds_total{path=\"/hello\",status=\"500\"} 0.9 " + + scrapeTimestamp2s + + "\n" + + "# HELP service:time_seconds_created total time spent serving\n" + + "# TYPE service:time_seconds_created gauge\n" + + "service:time_seconds_created{path=\"/hello\",status=\"200\"} " + + createdTimestamp1s + + " " + + scrapeTimestamp1s + + "\n" + + "service:time_seconds_created{path=\"/hello\",status=\"500\"} " + + createdTimestamp2s + + " " + + scrapeTimestamp2s + + "\n"; + String openMetricsTextWithoutCreated = + "# TYPE service:time_seconds counter\n" + + "# UNIT service:time_seconds seconds\n" + + "# HELP service:time_seconds total time spent serving\n" + + "service:time_seconds_total{path=\"/hello\",status=\"200\"} 0.8 " + + scrapeTimestamp1s + + " # " + + exemplar1String + + "\n" + + "service:time_seconds_total{path=\"/hello\",status=\"500\"} 0.9 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "# EOF\n"; + String prometheusTextWithoutCreated = + "# HELP service:time_seconds_total total time spent serving\n" + + "# TYPE service:time_seconds_total counter\n" + + "service:time_seconds_total{path=\"/hello\",status=\"200\"} 0.8 " + + scrapeTimestamp1s + + "\n" + + "service:time_seconds_total{path=\"/hello\",status=\"500\"} 0.9 " + + scrapeTimestamp2s + + "\n"; + String prometheusProtobuf = + // @formatter:off + "name: \"service:time_seconds_total\" " + + "help: \"total time spent serving\" " + + "type: COUNTER " + + "metric { " + + "label { name: \"path\" value: \"/hello\" } " + + "label { name: \"status\" value: \"200\" } " + + "counter { " + + "value: 0.8 " + + exemplar1protoString + + " " + + "created_timestamp { seconds: 1672850385 nanos: 800000000 } " + + "} " + + "timestamp_ms: 1672850685829 " + + "} " + + "metric { " + + "label { name: \"path\" value: \"/hello\" } " + + "label { name: \"status\" value: \"500\" } " + + "counter { " + + "value: 0.9 " + + exemplar2protoString + + " " + + "created_timestamp { seconds: 1672850285 } " + + "} " + + "timestamp_ms: 1672850585820 " + + "}"; + // @formatter:on + + CounterSnapshot counter = + CounterSnapshot.builder() + .name("service:time_seconds") + .help("total time spent serving") + .unit(Unit.SECONDS) + .dataPoint( + CounterDataPointSnapshot.builder() + .value(0.8) + .labels(Labels.builder().label("path", "/hello").label("status", "200").build()) + .exemplar(exemplar1) + .createdTimestampMillis(createdTimestamp1) + .scrapeTimestampMillis(scrapeTimestamp1) + .build()) + .dataPoint( + CounterDataPointSnapshot.builder() + .value(0.9) + .labels(Labels.builder().label("path", "/hello").label("status", "500").build()) + .exemplar(exemplar2) + .createdTimestampMillis(createdTimestamp2) + .scrapeTimestampMillis(scrapeTimestamp2) + .build()) + .build(); + assertOpenMetricsText(openMetricsText, counter); + assertPrometheusText(prometheusText, counter); + assertOpenMetricsTextWithoutCreated(openMetricsTextWithoutCreated, counter); + assertPrometheusTextWithoutCreated(prometheusTextWithoutCreated, counter); + assertPrometheusProtobuf(prometheusProtobuf, counter); + } + + @Test + public void testCounterMinimal() throws IOException { + String openMetricsText = + """ + # TYPE my_counter counter + my_counter_total 1.1 + # EOF + """; + String prometheusText = + """ + # TYPE my_counter_total counter + my_counter_total 1.1 + """; + String prometheusProtobuf = + "name: \"my_counter_total\" type: COUNTER metric { counter { value: 1.1 } }"; + CounterSnapshot counter = + CounterSnapshot.builder() + .name("my_counter") + .dataPoint(CounterDataPointSnapshot.builder().value(1.1).build()) + .build(); + assertOpenMetricsText(openMetricsText, counter); + assertPrometheusText(prometheusText, counter); + assertOpenMetricsTextWithoutCreated(openMetricsText, counter); + assertPrometheusTextWithoutCreated(prometheusText, counter); + assertPrometheusProtobuf(prometheusProtobuf, counter); + } + + @Test + public void testCounterWithDots() throws IOException { + String openMetricsText = + """ + # TYPE U__my_2e_request_2e_count counter + U__my_2e_request_2e_count_total{U__http_2e_path="/hello"} 3.0 # {U__some_2e_exemplar_2e_key="some value"} 3.0 1690298864.383 + # EOF + """; + String prometheusText = + """ + # TYPE my_request_count_total counter + my_request_count_total{http_path="/hello"} 3.0 + """; + String prometheusProtobuf = + // @formatter:off + "name: \"my_request_count_total\" " + + "type: COUNTER " + + "metric { " + + "label { name: \"http_path\" value: \"/hello\" } " + + "counter { " + + "value: 3.0 " + + exemplarWithDotsProtoString + + " " + + "} " + + "}"; + // @formatter:on + + CounterSnapshot counter = + CounterSnapshot.builder() + .name("my.request.count") + .dataPoint( + CounterDataPointSnapshot.builder() + .value(3.0) + .labels(Labels.builder().label("http.path", "/hello").build()) + .exemplar(exemplarWithDots) + .build()) + .build(); + assertOpenMetricsText(openMetricsText, counter); + assertPrometheusText(prometheusText, counter); + assertPrometheusProtobuf(prometheusProtobuf, counter); + } + + @Test + public void testGaugeComplete() throws IOException { + String openMetricsText = + "# TYPE disk_usage_ratio gauge\n" + + "# UNIT disk_usage_ratio ratio\n" + + "# HELP disk_usage_ratio percentage used\n" + + "disk_usage_ratio{device=\"/dev/sda1\"} 0.2 " + + scrapeTimestamp1s + + "\n" + + "disk_usage_ratio{device=\"/dev/sda2\"} 0.7 " + + scrapeTimestamp2s + + "\n" + + "# EOF\n"; + String openMetricsTextWithExemplarsOnAllTimeSeries = + "# TYPE disk_usage_ratio gauge\n" + + "# UNIT disk_usage_ratio ratio\n" + + "# HELP disk_usage_ratio percentage used\n" + + "disk_usage_ratio{device=\"/dev/sda1\"} 0.2 " + + scrapeTimestamp1s + + " # " + + exemplar1String + + "\n" + + "disk_usage_ratio{device=\"/dev/sda2\"} 0.7 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "# EOF\n"; + String prometheusText = + "# HELP disk_usage_ratio percentage used\n" + + "# TYPE disk_usage_ratio gauge\n" + + "disk_usage_ratio{device=\"/dev/sda1\"} 0.2 " + + scrapeTimestamp1s + + "\n" + + "disk_usage_ratio{device=\"/dev/sda2\"} 0.7 " + + scrapeTimestamp2s + + "\n"; + String prometheusProtobuf = + // @formatter:off + "name: \"disk_usage_ratio\" " + + "help: \"percentage used\" " + + "type: GAUGE " + + "metric { " + + "label { name: \"device\" value: \"/dev/sda1\" } " + + "gauge { value: 0.2 } " + + "timestamp_ms: 1672850685829 " + + "} metric { " + + "label { name: \"device\" value: \"/dev/sda2\" } " + + "gauge { value: 0.7 } " + + "timestamp_ms: 1672850585820 " + + "}"; + // @formatter:on + GaugeSnapshot gauge = + GaugeSnapshot.builder() + .name("disk_usage_ratio") + .help("percentage used") + .unit(new Unit("ratio")) + .dataPoint( + GaugeDataPointSnapshot.builder() + .value(0.7) + .labels(Labels.builder().label("device", "/dev/sda2").build()) + .exemplar(exemplar2) + .scrapeTimestampMillis(scrapeTimestamp2) + .build()) + .dataPoint( + GaugeDataPointSnapshot.builder() + .value(0.2) + .labels(Labels.builder().label("device", "/dev/sda1").build()) + .exemplar(exemplar1) + .scrapeTimestampMillis(scrapeTimestamp1) + .build()) + .build(); + assertOpenMetricsText(openMetricsText, gauge); + assertOpenMetricsTextWithExemplarsOnAllTimeSeries( + openMetricsTextWithExemplarsOnAllTimeSeries, gauge); + assertPrometheusText(prometheusText, gauge); + assertOpenMetricsTextWithoutCreated(openMetricsText, gauge); + assertPrometheusTextWithoutCreated(prometheusText, gauge); + assertPrometheusProtobuf(prometheusProtobuf, gauge); + } + + @Test + public void testGaugeMinimal() throws IOException { + String openMetricsText = + """ + # TYPE temperature_centigrade gauge + temperature_centigrade 22.3 + # EOF + """; + String prometheusText = + """ + # TYPE temperature_centigrade gauge + temperature_centigrade 22.3 + """; + String prometheusProtobuf = + "name: \"temperature_centigrade\" type: GAUGE metric { gauge { value: 22.3 } }"; + GaugeSnapshot gauge = + GaugeSnapshot.builder() + .name("temperature_centigrade") + .dataPoint(GaugeDataPointSnapshot.builder().value(22.3).build()) + .build(); + assertOpenMetricsText(openMetricsText, gauge); + assertPrometheusText(prometheusText, gauge); + assertOpenMetricsTextWithoutCreated(openMetricsText, gauge); + assertPrometheusTextWithoutCreated(prometheusText, gauge); + assertPrometheusProtobuf(prometheusProtobuf, gauge); + } + + @Test + public void testGaugeWithDots() throws IOException { + String openMetricsText = + """ + # TYPE U__my_2e_temperature_2e_celsius gauge + # UNIT U__my_2e_temperature_2e_celsius celsius + # HELP U__my_2e_temperature_2e_celsius Temperature + U__my_2e_temperature_2e_celsius{U__location_2e_id="data-center-1"} 23.0 + # EOF + """; + String openMetricsTextWithExemplarsOnAllTimeSeries = + "# TYPE my_temperature_celsius gauge\n" + + "# UNIT my_temperature_celsius celsius\n" + + "# HELP my_temperature_celsius Temperature\n" + + "my_temperature_celsius{location_id=\"data-center-1\"} 23.0 # " + + exemplarWithDotsString + + "\n" + + "# EOF\n"; + String prometheusText = + """ + # HELP my_temperature_celsius Temperature + # TYPE my_temperature_celsius gauge + my_temperature_celsius{location_id="data-center-1"} 23.0 + """; + String prometheusProtobuf = + // @formatter:off + "name: \"my_temperature_celsius\" " + + "help: \"Temperature\" " + + "type: GAUGE " + + "metric { " + + "label { name: \"location_id\" value: \"data-center-1\" } " + + "gauge { " + + "value: 23.0 " + + "} " + + "}"; + // @formatter:on + + GaugeSnapshot gauge = + GaugeSnapshot.builder() + .name("my.temperature.celsius") + .help("Temperature") + .unit(Unit.CELSIUS) + .dataPoint( + GaugeDataPointSnapshot.builder() + .value(23.0) + .labels(Labels.builder().label("location.id", "data-center-1").build()) + .exemplar(exemplarWithDots) + .build()) + .build(); + assertOpenMetricsText(openMetricsText, gauge); + assertOpenMetricsTextWithExemplarsOnAllTimeSeries( + openMetricsTextWithExemplarsOnAllTimeSeries, gauge); + assertPrometheusText(prometheusText, gauge); + assertPrometheusProtobuf(prometheusProtobuf, gauge); + } + + @Test + public void testGaugeUTF8() throws IOException { + String prometheusText = + """ + # HELP "gauge.name" gauge\\ndoc\\nstr"ing + # TYPE "gauge.name" gauge + {"gauge.name","name.1"="Björn","name*2"="佖佥"} 3.14E42 + {"gauge.name","name.1"="val with\\nnew line","name*2"="val with \\\\backslash and \\"quotes\\""} +Inf + """; + GaugeSnapshot gauge = + GaugeSnapshot.builder() + .name("gauge.name") + .help("gauge\ndoc\nstr\"ing") + .dataPoint( + GaugeDataPointSnapshot.builder() + .value(Double.POSITIVE_INFINITY) + .labels( + Labels.builder() + .label("name.1", "val with\nnew line") + .label("name*2", "val with \\backslash and \"quotes\"") + .build()) + .build()) + .dataPoint( + GaugeDataPointSnapshot.builder() + .value(3.14e42) + .labels(Labels.builder().label("name.1", "Björn").label("name*2", "佖佥").build()) + .build()) + .build(); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + getPrometheusWriter(PrometheusTextFormatWriter.builder().setIncludeCreatedTimestamps(true)) + .write(out, MetricSnapshots.of((MetricSnapshot) gauge), EscapingScheme.ALLOW_UTF8); + assertThat(out).hasToString(prometheusText); + } + + @Test + public void testSummaryComplete() throws IOException { + String openMetricsText = + "# TYPE http_request_duration_seconds summary\n" + + "# UNIT http_request_duration_seconds seconds\n" + + "# HELP http_request_duration_seconds request duration\n" + + "http_request_duration_seconds{status=\"200\",quantile=\"0.5\"} 225.3 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds{status=\"200\",quantile=\"0.9\"} 240.7 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds{status=\"200\",quantile=\"0.95\"} 245.1 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds_count{status=\"200\"} 3 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds_sum{status=\"200\"} 1.2 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds_created{status=\"200\"} " + + createdTimestamp1s + + " " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds{status=\"500\",quantile=\"0.5\"} 225.3 " + + scrapeTimestamp2s + + "\n" + + "http_request_duration_seconds{status=\"500\",quantile=\"0.9\"} 240.7 " + + scrapeTimestamp2s + + "\n" + + "http_request_duration_seconds{status=\"500\",quantile=\"0.95\"} 245.1 " + + scrapeTimestamp2s + + "\n" + + "http_request_duration_seconds_count{status=\"500\"} 7 " + + scrapeTimestamp2s + + "\n" + + "http_request_duration_seconds_sum{status=\"500\"} 2.2 " + + scrapeTimestamp2s + + "\n" + + "http_request_duration_seconds_created{status=\"500\"} " + + createdTimestamp2s + + " " + + scrapeTimestamp2s + + "\n" + + "# EOF\n"; + String openMetricsTextWithExemplarsOnAllTimeSeries = + "# TYPE http_request_duration_seconds summary\n" + + "# UNIT http_request_duration_seconds seconds\n" + + "# HELP http_request_duration_seconds request duration\n" + + "http_request_duration_seconds{status=\"200\",quantile=\"0.5\"} 225.3 " + + scrapeTimestamp1s + + " # " + + exemplar1String + + "\n" + + "http_request_duration_seconds{status=\"200\",quantile=\"0.9\"} 240.7 " + + scrapeTimestamp1s + + " # " + + exemplar1String + + "\n" + + "http_request_duration_seconds{status=\"200\",quantile=\"0.95\"} 245.1 " + + scrapeTimestamp1s + + " # " + + exemplar1String + + "\n" + + "http_request_duration_seconds_count{status=\"200\"} 3 " + + scrapeTimestamp1s + + " # " + + exemplar1String + + "\n" + + "http_request_duration_seconds_sum{status=\"200\"} 1.2 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds_created{status=\"200\"} " + + createdTimestamp1s + + " " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds{status=\"500\",quantile=\"0.5\"} 225.3 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "http_request_duration_seconds{status=\"500\",quantile=\"0.9\"} 240.7 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "http_request_duration_seconds{status=\"500\",quantile=\"0.95\"} 245.1 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "http_request_duration_seconds_count{status=\"500\"} 7 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "http_request_duration_seconds_sum{status=\"500\"} 2.2 " + + scrapeTimestamp2s + + "\n" + + "http_request_duration_seconds_created{status=\"500\"} " + + createdTimestamp2s + + " " + + scrapeTimestamp2s + + "\n" + + "# EOF\n"; + String prometheusText = + "# HELP http_request_duration_seconds request duration\n" + + "# TYPE http_request_duration_seconds summary\n" + + "http_request_duration_seconds{status=\"200\",quantile=\"0.5\"} 225.3 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds{status=\"200\",quantile=\"0.9\"} 240.7 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds{status=\"200\",quantile=\"0.95\"} 245.1 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds_count{status=\"200\"} 3 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds_sum{status=\"200\"} 1.2 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds{status=\"500\",quantile=\"0.5\"} 225.3 " + + scrapeTimestamp2s + + "\n" + + "http_request_duration_seconds{status=\"500\",quantile=\"0.9\"} 240.7 " + + scrapeTimestamp2s + + "\n" + + "http_request_duration_seconds{status=\"500\",quantile=\"0.95\"} 245.1 " + + scrapeTimestamp2s + + "\n" + + "http_request_duration_seconds_count{status=\"500\"} 7 " + + scrapeTimestamp2s + + "\n" + + "http_request_duration_seconds_sum{status=\"500\"} 2.2 " + + scrapeTimestamp2s + + "\n" + + "# HELP http_request_duration_seconds_created request duration\n" + + "# TYPE http_request_duration_seconds_created gauge\n" + + "http_request_duration_seconds_created{status=\"200\"} " + + createdTimestamp1s + + " " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds_created{status=\"500\"} " + + createdTimestamp2s + + " " + + scrapeTimestamp2s + + "\n"; + String openMetricsTextWithoutCreated = + "# TYPE http_request_duration_seconds summary\n" + + "# UNIT http_request_duration_seconds seconds\n" + + "# HELP http_request_duration_seconds request duration\n" + + "http_request_duration_seconds{status=\"200\",quantile=\"0.5\"} 225.3 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds{status=\"200\",quantile=\"0.9\"} 240.7 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds{status=\"200\",quantile=\"0.95\"} 245.1 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds_count{status=\"200\"} 3 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds_sum{status=\"200\"} 1.2 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds{status=\"500\",quantile=\"0.5\"} 225.3 " + + scrapeTimestamp2s + + "\n" + + "http_request_duration_seconds{status=\"500\",quantile=\"0.9\"} 240.7 " + + scrapeTimestamp2s + + "\n" + + "http_request_duration_seconds{status=\"500\",quantile=\"0.95\"} 245.1 " + + scrapeTimestamp2s + + "\n" + + "http_request_duration_seconds_count{status=\"500\"} 7 " + + scrapeTimestamp2s + + "\n" + + "http_request_duration_seconds_sum{status=\"500\"} 2.2 " + + scrapeTimestamp2s + + "\n" + + "# EOF\n"; + String prometheusTextWithoutCreated = + "# HELP http_request_duration_seconds request duration\n" + + "# TYPE http_request_duration_seconds summary\n" + + "http_request_duration_seconds{status=\"200\",quantile=\"0.5\"} 225.3 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds{status=\"200\",quantile=\"0.9\"} 240.7 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds{status=\"200\",quantile=\"0.95\"} 245.1 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds_count{status=\"200\"} 3 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds_sum{status=\"200\"} 1.2 " + + scrapeTimestamp1s + + "\n" + + "http_request_duration_seconds{status=\"500\",quantile=\"0.5\"} 225.3 " + + scrapeTimestamp2s + + "\n" + + "http_request_duration_seconds{status=\"500\",quantile=\"0.9\"} 240.7 " + + scrapeTimestamp2s + + "\n" + + "http_request_duration_seconds{status=\"500\",quantile=\"0.95\"} 245.1 " + + scrapeTimestamp2s + + "\n" + + "http_request_duration_seconds_count{status=\"500\"} 7 " + + scrapeTimestamp2s + + "\n" + + "http_request_duration_seconds_sum{status=\"500\"} 2.2 " + + scrapeTimestamp2s + + "\n"; + String prometheusProtobuf = + // @formatter:off + "name: \"http_request_duration_seconds\" " + + "help: \"request duration\" " + + "type: SUMMARY " + + "metric { " + + "label { name: \"status\" value: \"200\" } " + + "summary { " + + "sample_count: 3 " + + "sample_sum: 1.2 " + + "quantile { quantile: 0.5 value: 225.3 } " + + "quantile { quantile: 0.9 value: 240.7 } " + + "quantile { quantile: 0.95 value: 245.1 } " + + "} " + + "timestamp_ms: 1672850685829 " + + "} metric { " + + "label { name: \"status\" value: \"500\" } " + + "summary { " + + "sample_count: 7 " + + "sample_sum: 2.2 " + + "quantile { quantile: 0.5 value: 225.3 } " + + "quantile { quantile: 0.9 value: 240.7 } " + + "quantile { quantile: 0.95 value: 245.1 } " + + "} " + + "timestamp_ms: 1672850585820 " + + "}"; + // @formatter:on + SummarySnapshot summary = + SummarySnapshot.builder() + .name("http_request_duration_seconds") + .help("request duration") + .unit(Unit.SECONDS) + .dataPoint( + SummaryDataPointSnapshot.builder() + .count(7) + .sum(2.2) + .quantiles( + Quantiles.builder() + .quantile(0.5, 225.3) + .quantile(0.9, 240.7) + .quantile(0.95, 245.1) + .build()) + .labels(Labels.builder().label("status", "500").build()) + .exemplars(Exemplars.of(exemplar2)) + .createdTimestampMillis(createdTimestamp2) + .scrapeTimestampMillis(scrapeTimestamp2) + .build()) + .dataPoint( + SummaryDataPointSnapshot.builder() + .count(3) + .sum(1.2) + .quantiles( + Quantiles.builder() + .quantile(0.5, 225.3) + .quantile(0.9, 240.7) + .quantile(0.95, 245.1) + .build()) + .labels(Labels.builder().label("status", "200").build()) + .exemplars(Exemplars.of(exemplar1)) + .createdTimestampMillis(createdTimestamp1) + .scrapeTimestampMillis(scrapeTimestamp1) + .build()) + .build(); + assertOpenMetricsText(openMetricsText, summary); + assertOpenMetricsTextWithExemplarsOnAllTimeSeries( + openMetricsTextWithExemplarsOnAllTimeSeries, summary); + assertPrometheusText(prometheusText, summary); + assertOpenMetricsTextWithoutCreated(openMetricsTextWithoutCreated, summary); + assertPrometheusTextWithoutCreated(prometheusTextWithoutCreated, summary); + assertPrometheusProtobuf(prometheusProtobuf, summary); + } + + @Test + public void testSummaryWithoutQuantiles() throws IOException { + String openMetricsText = + """ + # TYPE latency_seconds summary + # UNIT latency_seconds seconds + # HELP latency_seconds latency + latency_seconds_count 3 + latency_seconds_sum 1.2 + # EOF + """; + String prometheusText = + """ + # HELP latency_seconds latency + # TYPE latency_seconds summary + latency_seconds_count 3 + latency_seconds_sum 1.2 + """; + String prometheusProtobuf = + // @formatter:off + "name: \"latency_seconds\" " + + "help: \"latency\" " + + "type: SUMMARY " + + "metric { " + + "summary { " + + "sample_count: 3 " + + "sample_sum: 1.2 " + + "} " + + "}"; + // @formatter:on + SummarySnapshot summary = + SummarySnapshot.builder() + .name("latency_seconds") + .help("latency") + .unit(Unit.SECONDS) + .dataPoint(SummaryDataPointSnapshot.builder().count(3).sum(1.2).build()) + .build(); + assertOpenMetricsText(openMetricsText, summary); + assertPrometheusText(prometheusText, summary); + assertOpenMetricsTextWithoutCreated(openMetricsText, summary); + assertPrometheusTextWithoutCreated(prometheusText, summary); + assertPrometheusProtobuf(prometheusProtobuf, summary); + } + + @Test + public void testSummaryNoCountAndSum() throws IOException { + String openMetricsText = + """ + # TYPE latency_seconds summary + latency_seconds{quantile="0.95"} 200.0 + # EOF + """; + String prometheusText = + """ + # TYPE latency_seconds summary + latency_seconds{quantile="0.95"} 200.0 + """; + String prometheusProtobuf = + // @formatter:off + "name: \"latency_seconds\" " + + "type: SUMMARY " + + "metric { " + + "summary { " + + "quantile { quantile: 0.95 value: 200.0 } " + + "} " + + "}"; + // @formatter:on + SummarySnapshot summary = + SummarySnapshot.builder() + .name("latency_seconds") + .dataPoint( + SummaryDataPointSnapshot.builder() + .quantiles(Quantiles.builder().quantile(0.95, 200.0).build()) + .build()) + .build(); + assertOpenMetricsText(openMetricsText, summary); + assertPrometheusText(prometheusText, summary); + assertOpenMetricsTextWithoutCreated(openMetricsText, summary); + assertPrometheusTextWithoutCreated(prometheusText, summary); + assertPrometheusProtobuf(prometheusProtobuf, summary); + } + + @Test + public void testSummaryJustCount() throws IOException { + String openMetricsText = + """ + # TYPE latency_seconds summary + latency_seconds_count 1 + # EOF + """; + String prometheusText = + """ + # TYPE latency_seconds summary + latency_seconds_count 1 + """; + String prometheusProtobuf = + // @formatter:off + "name: \"latency_seconds\" " + + "type: SUMMARY " + + "metric { " + + "summary { " + + "sample_count: 1 " + + "} " + + "}"; + // @formatter:on + SummarySnapshot summary = + SummarySnapshot.builder() + .name("latency_seconds") + .dataPoint(SummaryDataPointSnapshot.builder().count(1).build()) + .build(); + assertOpenMetricsText(openMetricsText, summary); + assertPrometheusText(prometheusText, summary); + assertOpenMetricsTextWithoutCreated(openMetricsText, summary); + assertPrometheusTextWithoutCreated(prometheusText, summary); + assertPrometheusProtobuf(prometheusProtobuf, summary); + } + + @Test + public void testSummaryJustSum() throws IOException { + String openMetricsText = + """ + # TYPE latency_seconds summary + latency_seconds_sum 12.3 + # EOF + """; + String prometheusText = + """ + # TYPE latency_seconds summary + latency_seconds_sum 12.3 + """; + String prometheusProtobuf = + // @formatter:off + "name: \"latency_seconds\" " + + "type: SUMMARY " + + "metric { " + + "summary { " + + "sample_sum: 12.3 " + + "} " + + "}"; + // @formatter:on + SummarySnapshot summary = + SummarySnapshot.builder() + .name("latency_seconds") + .dataPoint(SummaryDataPointSnapshot.builder().sum(12.3).build()) + .build(); + assertOpenMetricsText(openMetricsText, summary); + assertPrometheusText(prometheusText, summary); + assertOpenMetricsTextWithoutCreated(openMetricsText, summary); + assertPrometheusTextWithoutCreated(prometheusText, summary); + assertPrometheusProtobuf(prometheusProtobuf, summary); + } + + @Test + public void testSummaryEmptyData() throws IOException { + // SummaryData can be present but empty (no count, no sum, no quantiles). + // This should be treated like no data is present. + SummarySnapshot summary = + SummarySnapshot.builder() + .name("latency_seconds") + .help("latency") + .unit(Unit.SECONDS) + .dataPoint(SummaryDataPointSnapshot.builder().build()) + .build(); + assertOpenMetricsText("# EOF\n", summary); + assertPrometheusText("", summary); + assertOpenMetricsTextWithoutCreated("# EOF\n", summary); + assertPrometheusTextWithoutCreated("", summary); + assertPrometheusProtobuf("", summary); + } + + @Test + public void testSummaryEmptyAndNonEmpty() throws IOException { + String openMetricsText = + """ + # TYPE latency_seconds summary + latency_seconds_count{path="/v2"} 2 + latency_seconds_sum{path="/v2"} 10.7 + # EOF + """; + String prometheusText = + """ + # TYPE latency_seconds summary + latency_seconds_count{path="/v2"} 2 + latency_seconds_sum{path="/v2"} 10.7 + """; + String prometheusProtobuf = + // @formatter:off + "name: \"latency_seconds\" " + + "type: SUMMARY " + + "metric { " + + "label { name: \"path\" value: \"/v2\" } " + + "summary { " + + "sample_count: 2 " + + "sample_sum: 10.7 " + + "} " + + "}"; + // @formatter:on + SummarySnapshot summary = + SummarySnapshot.builder() + .name("latency_seconds") + .dataPoint(SummaryDataPointSnapshot.builder().labels(Labels.of("path", "/v1")).build()) + .dataPoint( + SummaryDataPointSnapshot.builder() + .labels(Labels.of("path", "/v2")) + .count(2) + .sum(10.7) + .build()) + .dataPoint(SummaryDataPointSnapshot.builder().labels(Labels.of("path", "/v3")).build()) + .build(); + assertOpenMetricsText(openMetricsText, summary); + assertPrometheusText(prometheusText, summary); + assertOpenMetricsTextWithoutCreated(openMetricsText, summary); + assertPrometheusTextWithoutCreated(prometheusText, summary); + assertPrometheusProtobuf(prometheusProtobuf, summary); + } + + @Test + public void testSummaryWithDots() throws IOException { + String openMetricsText = + """ + # TYPE U__my_2e_request_2e_duration_2e_seconds summary + # UNIT U__my_2e_request_2e_duration_2e_seconds seconds + # HELP U__my_2e_request_2e_duration_2e_seconds Request duration in seconds + U__my_2e_request_2e_duration_2e_seconds_count{U__http_2e_path="/hello"} 1 + U__my_2e_request_2e_duration_2e_seconds_sum{U__http_2e_path="/hello"} 0.03 + # EOF + """; + String openMetricsTextWithExemplarsOnAllTimeSeries = + "# TYPE my_request_duration_seconds summary\n" + + "# UNIT my_request_duration_seconds seconds\n" + + "# HELP my_request_duration_seconds Request duration in seconds\n" + + "my_request_duration_seconds_count{http_path=\"/hello\"} 1 # " + + exemplarWithDotsString + + "\n" + + "my_request_duration_seconds_sum{http_path=\"/hello\"} 0.03\n" + + "# EOF\n"; + String prometheusText = + """ + # HELP my_request_duration_seconds Request duration in seconds + # TYPE my_request_duration_seconds summary + my_request_duration_seconds_count{http_path="/hello"} 1 + my_request_duration_seconds_sum{http_path="/hello"} 0.03 + """; + String prometheusProtobuf = + // @formatter:off + "name: \"my_request_duration_seconds\" " + + "help: \"Request duration in seconds\" " + + "type: SUMMARY " + + "metric { " + + "label { name: \"http_path\" value: \"/hello\" } " + + "summary { sample_count: 1 sample_sum: 0.03 } " + + "}"; + // @formatter:on + + SummarySnapshot summary = + SummarySnapshot.builder() + .name("my.request.duration.seconds") + .help("Request duration in seconds") + .unit(Unit.SECONDS) + .dataPoint( + SummaryDataPointSnapshot.builder() + .count(1) + .sum(0.03) + .labels(Labels.builder().label("http.path", "/hello").build()) + .exemplars(Exemplars.of(exemplarWithDots)) + .build()) + .build(); + assertOpenMetricsText(openMetricsText, summary); + assertOpenMetricsTextWithExemplarsOnAllTimeSeries( + openMetricsTextWithExemplarsOnAllTimeSeries, summary); + assertPrometheusText(prometheusText, summary); + assertPrometheusProtobuf(prometheusProtobuf, summary); + } + + @Test + public void testClassicHistogramComplete() throws Exception { + String openMetricsText = + "# TYPE response_size_bytes histogram\n" + + "# UNIT response_size_bytes bytes\n" + + "# HELP response_size_bytes help\n" + + "response_size_bytes_bucket{status=\"200\",le=\"2.2\"} 2 " + + scrapeTimestamp1s + + " # " + + exemplar1String + + "\n" + + "response_size_bytes_bucket{status=\"200\",le=\"+Inf\"} 3 " + + scrapeTimestamp1s + + " # " + + exemplar2String + + "\n" + + "response_size_bytes_count{status=\"200\"} 3 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_sum{status=\"200\"} 4.1 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_created{status=\"200\"} " + + createdTimestamp1s + + " " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"1.0\"} 3 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"2.2\"} 5 " + + scrapeTimestamp2s + + " # " + + exemplar1String + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"+Inf\"} 5 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "response_size_bytes_count{status=\"500\"} 5 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_sum{status=\"500\"} 3.2 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_created{status=\"500\"} " + + createdTimestamp2s + + " " + + scrapeTimestamp2s + + "\n" + + "# EOF\n"; + String openMetricsTextWithExemplarsOnAllTimeSeries = + "# TYPE response_size_bytes histogram\n" + + "# UNIT response_size_bytes bytes\n" + + "# HELP response_size_bytes help\n" + + "response_size_bytes_bucket{status=\"200\",le=\"2.2\"} 2 " + + scrapeTimestamp1s + + " # " + + exemplar1String + + "\n" + + "response_size_bytes_bucket{status=\"200\",le=\"+Inf\"} 3 " + + scrapeTimestamp1s + + " # " + + exemplar2String + + "\n" + + "response_size_bytes_count{status=\"200\"} 3 " + + scrapeTimestamp1s + + " # " + + exemplar2String + + "\n" + + "response_size_bytes_sum{status=\"200\"} 4.1 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_created{status=\"200\"} " + + createdTimestamp1s + + " " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"1.0\"} 3 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"2.2\"} 5 " + + scrapeTimestamp2s + + " # " + + exemplar1String + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"+Inf\"} 5 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "response_size_bytes_count{status=\"500\"} 5 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "response_size_bytes_sum{status=\"500\"} 3.2 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_created{status=\"500\"} " + + createdTimestamp2s + + " " + + scrapeTimestamp2s + + "\n" + + "# EOF\n"; + String prometheusText = + "# HELP response_size_bytes help\n" + + "# TYPE response_size_bytes histogram\n" + + "response_size_bytes_bucket{status=\"200\",le=\"2.2\"} 2 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_bucket{status=\"200\",le=\"+Inf\"} 3 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_count{status=\"200\"} 3 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_sum{status=\"200\"} 4.1 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"1.0\"} 3 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"2.2\"} 5 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"+Inf\"} 5 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_count{status=\"500\"} 5 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_sum{status=\"500\"} 3.2 " + + scrapeTimestamp2s + + "\n" + + "# HELP response_size_bytes_created help\n" + + "# TYPE response_size_bytes_created gauge\n" + + "response_size_bytes_created{status=\"200\"} " + + createdTimestamp1s + + " " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_created{status=\"500\"} " + + createdTimestamp2s + + " " + + scrapeTimestamp2s + + "\n"; + String openMetricsTextWithoutCreated = + "# TYPE response_size_bytes histogram\n" + + "# UNIT response_size_bytes bytes\n" + + "# HELP response_size_bytes help\n" + + "response_size_bytes_bucket{status=\"200\",le=\"2.2\"} 2 " + + scrapeTimestamp1s + + " # " + + exemplar1String + + "\n" + + "response_size_bytes_bucket{status=\"200\",le=\"+Inf\"} 3 " + + scrapeTimestamp1s + + " # " + + exemplar2String + + "\n" + + "response_size_bytes_count{status=\"200\"} 3 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_sum{status=\"200\"} 4.1 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"1.0\"} 3 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"2.2\"} 5 " + + scrapeTimestamp2s + + " # " + + exemplar1String + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"+Inf\"} 5 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "response_size_bytes_count{status=\"500\"} 5 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_sum{status=\"500\"} 3.2 " + + scrapeTimestamp2s + + "\n" + + "# EOF\n"; + String prometheusTextWithoutCreated = + "# HELP response_size_bytes help\n" + + "# TYPE response_size_bytes histogram\n" + + "response_size_bytes_bucket{status=\"200\",le=\"2.2\"} 2 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_bucket{status=\"200\",le=\"+Inf\"} 3 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_count{status=\"200\"} 3 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_sum{status=\"200\"} 4.1 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"1.0\"} 3 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"2.2\"} 5 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"+Inf\"} 5 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_count{status=\"500\"} 5 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_sum{status=\"500\"} 3.2 " + + scrapeTimestamp2s + + "\n"; + String prometheusProtobuf = + // @formatter:off + "name: \"response_size_bytes\" " + + "help: \"help\" " + + "type: HISTOGRAM " + + "metric { " + + "label { name: \"status\" value: \"200\" } " + + "timestamp_ms: 1672850685829 " + + "histogram { " + + "sample_count: 3 " + + "sample_sum: 4.1 " + + "bucket { " + + "cumulative_count: 2 " + + "upper_bound: 2.2 " + + exemplar1protoString + + " " + + "} bucket { " + + "cumulative_count: 3 " + + "upper_bound: Infinity " + + exemplar2protoString + + " " + + "} " + + "} " + + "} metric { " + + "label { name: \"status\" value: \"500\" } " + + "timestamp_ms: 1672850585820 " + + "histogram { " + + "sample_count: 5 " + + "sample_sum: 3.2 " + + "bucket { " + + "cumulative_count: 3 " + + "upper_bound: 1.0 " + + "} bucket { " + + "cumulative_count: 5 " + + "upper_bound: 2.2 " + + exemplar1protoString + + " " + + "} bucket { " + + "cumulative_count: 5 " + + "upper_bound: Infinity " + + exemplar2protoString + + " " + + "} " + + "} " + + "}"; + // @formatter:on + HistogramSnapshot histogram = + HistogramSnapshot.builder() + .name("response_size_bytes") + .help("help") + .unit(Unit.BYTES) + .dataPoint( + HistogramSnapshot.HistogramDataPointSnapshot.builder() + .sum(3.2) + .classicHistogramBuckets( + ClassicHistogramBuckets.builder() + .bucket(1.0, 3) + .bucket(2.2, 2) + .bucket(Double.POSITIVE_INFINITY, 0) + .build()) + .labels(Labels.of("status", "500")) + .exemplars(Exemplars.of(exemplar1, exemplar2)) + .createdTimestampMillis(createdTimestamp2) + .scrapeTimestampMillis(scrapeTimestamp2) + .build()) + .dataPoint( + HistogramSnapshot.HistogramDataPointSnapshot.builder() + .sum(4.1) + .classicHistogramBuckets( + ClassicHistogramBuckets.builder() + .bucket(2.2, 2) + .bucket(Double.POSITIVE_INFINITY, 1) + .build()) + .labels(Labels.of("status", "200")) + .exemplars(Exemplars.of(exemplar1, exemplar2)) + .createdTimestampMillis(createdTimestamp1) + .scrapeTimestampMillis(scrapeTimestamp1) + .build()) + .build(); + assertOpenMetricsText(openMetricsText, histogram); + assertOpenMetricsTextWithExemplarsOnAllTimeSeries( + openMetricsTextWithExemplarsOnAllTimeSeries, histogram); + assertPrometheusText(prometheusText, histogram); + assertOpenMetricsTextWithoutCreated(openMetricsTextWithoutCreated, histogram); + assertPrometheusTextWithoutCreated(prometheusTextWithoutCreated, histogram); + assertPrometheusProtobuf(prometheusProtobuf, histogram); + } + + @Test + public void testClassicHistogramMinimal() throws Exception { + // In OpenMetrics a histogram can have a _count if and only if it has a _sum. + // In Prometheus format, a histogram can have a _count without a _sum. + String openMetricsText = + """ + # TYPE request_latency_seconds histogram + request_latency_seconds_bucket{le="+Inf"} 2 + # EOF + """; + String prometheusText = + """ + # TYPE request_latency_seconds histogram + request_latency_seconds_bucket{le="+Inf"} 2 + request_latency_seconds_count 2 + """; + String prometheusProtobuf = + // @formatter:off + "name: \"request_latency_seconds\" " + + "type: HISTOGRAM " + + "metric { " + + "histogram { " + + "sample_count: 2 " + + "bucket { " + + "cumulative_count: 2 " + + "upper_bound: Infinity " + + "} " + + "} " + + "}"; + // @formatter:on + HistogramSnapshot histogram = + HistogramSnapshot.builder() + .name("request_latency_seconds") + .dataPoint( + HistogramSnapshot.HistogramDataPointSnapshot.builder() + .classicHistogramBuckets( + ClassicHistogramBuckets.builder() + .bucket(Double.POSITIVE_INFINITY, 2) + .build()) + .build()) + .build(); + assertOpenMetricsText(openMetricsText, histogram); + assertPrometheusText(prometheusText, histogram); + assertOpenMetricsTextWithoutCreated(openMetricsText, histogram); + assertPrometheusTextWithoutCreated(prometheusText, histogram); + assertPrometheusProtobuf(prometheusProtobuf, histogram); + } + + @Test + public void testClassicHistogramMinimalWithDots() throws Exception { + String openMetricsText = + """ + # TYPE "request.latency_seconds" histogram + {"request.latency_seconds_bucket",le="+Inf"} 2 + # EOF + """; + String prometheusText = + """ + # TYPE request_latency_seconds histogram + request_latency_seconds_bucket{le="+Inf"} 2 + request_latency_seconds_count 2 + """; + HistogramSnapshot histogram = + HistogramSnapshot.builder() + .name("request.latency_seconds") + .dataPoint( + HistogramSnapshot.HistogramDataPointSnapshot.builder() + .classicHistogramBuckets( + ClassicHistogramBuckets.builder() + .bucket(Double.POSITIVE_INFINITY, 2) + .build()) + .build()) + .build(); + // test that the name and label are separated with commas + assertOpenMetricsText(openMetricsText, histogram, EscapingScheme.ALLOW_UTF8); + assertPrometheusText(prometheusText, histogram); + assertPrometheusTextWithoutCreated(prometheusText, histogram); + } + + @Test + public void testClassicHistogramCountAndSum() throws Exception { + String openMetricsText = + """ + # TYPE request_latency_seconds histogram + request_latency_seconds_bucket{le="+Inf"} 2 + request_latency_seconds_count 2 + request_latency_seconds_sum 3.2 + # EOF + """; + String prometheusText = + """ + # TYPE request_latency_seconds histogram + request_latency_seconds_bucket{le="+Inf"} 2 + request_latency_seconds_count 2 + request_latency_seconds_sum 3.2 + """; + String prometheusProtobuf = + // @formatter:off + "name: \"request_latency_seconds\" " + + "type: HISTOGRAM " + + "metric { " + + "histogram { " + + "sample_count: 2 " + + "sample_sum: 3.2 " + + "bucket { " + + "cumulative_count: 2 " + + "upper_bound: Infinity " + + "} " + + "} " + + "}"; + // @formatter:on + HistogramSnapshot histogram = + HistogramSnapshot.builder() + .name("request_latency_seconds") + .dataPoint( + HistogramSnapshot.HistogramDataPointSnapshot.builder() + .sum(3.2) + .classicHistogramBuckets( + ClassicHistogramBuckets.builder() + .bucket(Double.POSITIVE_INFINITY, 2) + .build()) + .build()) + .build(); + assertOpenMetricsText(openMetricsText, histogram); + assertPrometheusText(prometheusText, histogram); + assertOpenMetricsTextWithoutCreated(openMetricsText, histogram); + assertPrometheusTextWithoutCreated(prometheusText, histogram); + assertPrometheusProtobuf(prometheusProtobuf, histogram); + } + + @Test + public void testClassicGaugeHistogramComplete() throws IOException { + String openMetricsText = + "# TYPE cache_size_bytes gaugehistogram\n" + + "# UNIT cache_size_bytes bytes\n" + + "# HELP cache_size_bytes number of bytes in the cache\n" + + "cache_size_bytes_bucket{db=\"items\",le=\"2.0\"} 3 " + + scrapeTimestamp1s + + " # " + + exemplar1String + + "\n" + + "cache_size_bytes_bucket{db=\"items\",le=\"+Inf\"} 4 " + + scrapeTimestamp1s + + " # " + + exemplar2String + + "\n" + + "cache_size_bytes_gcount{db=\"items\"} 4 " + + scrapeTimestamp1s + + "\n" + + "cache_size_bytes_gsum{db=\"items\"} 17.0 " + + scrapeTimestamp1s + + "\n" + + "cache_size_bytes_created{db=\"items\"} " + + createdTimestamp1s + + " " + + scrapeTimestamp1s + + "\n" + + "cache_size_bytes_bucket{db=\"options\",le=\"2.0\"} 4 " + + scrapeTimestamp2s + + " # " + + exemplar1String + + "\n" + + "cache_size_bytes_bucket{db=\"options\",le=\"+Inf\"} 4 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "cache_size_bytes_gcount{db=\"options\"} 4 " + + scrapeTimestamp2s + + "\n" + + "cache_size_bytes_gsum{db=\"options\"} 18.0 " + + scrapeTimestamp2s + + "\n" + + "cache_size_bytes_created{db=\"options\"} " + + createdTimestamp2s + + " " + + scrapeTimestamp2s + + "\n" + + "# EOF\n"; + String openMetricsTextWithExemplarsOnAllTimeSeries = + "# TYPE cache_size_bytes gaugehistogram\n" + + "# UNIT cache_size_bytes bytes\n" + + "# HELP cache_size_bytes number of bytes in the cache\n" + + "cache_size_bytes_bucket{db=\"items\",le=\"2.0\"} 3 " + + scrapeTimestamp1s + + " # " + + exemplar1String + + "\n" + + "cache_size_bytes_bucket{db=\"items\",le=\"+Inf\"} 4 " + + scrapeTimestamp1s + + " # " + + exemplar2String + + "\n" + + "cache_size_bytes_gcount{db=\"items\"} 4 " + + scrapeTimestamp1s + + " # " + + exemplar2String + + "\n" + + "cache_size_bytes_gsum{db=\"items\"} 17.0 " + + scrapeTimestamp1s + + "\n" + + "cache_size_bytes_created{db=\"items\"} " + + createdTimestamp1s + + " " + + scrapeTimestamp1s + + "\n" + + "cache_size_bytes_bucket{db=\"options\",le=\"2.0\"} 4 " + + scrapeTimestamp2s + + " # " + + exemplar1String + + "\n" + + "cache_size_bytes_bucket{db=\"options\",le=\"+Inf\"} 4 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "cache_size_bytes_gcount{db=\"options\"} 4 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "cache_size_bytes_gsum{db=\"options\"} 18.0 " + + scrapeTimestamp2s + + "\n" + + "cache_size_bytes_created{db=\"options\"} " + + createdTimestamp2s + + " " + + scrapeTimestamp2s + + "\n" + + "# EOF\n"; + String prometheusText = + "# HELP cache_size_bytes number of bytes in the cache\n" + + "# TYPE cache_size_bytes histogram\n" + + "cache_size_bytes_bucket{db=\"items\",le=\"2.0\"} 3 " + + scrapeTimestamp1s + + "\n" + + "cache_size_bytes_bucket{db=\"items\",le=\"+Inf\"} 4 " + + scrapeTimestamp1s + + "\n" + + "cache_size_bytes_bucket{db=\"options\",le=\"2.0\"} 4 " + + scrapeTimestamp2s + + "\n" + + "cache_size_bytes_bucket{db=\"options\",le=\"+Inf\"} 4 " + + scrapeTimestamp2s + + "\n" + + "# HELP cache_size_bytes_gcount number of bytes in the cache\n" + + "# TYPE cache_size_bytes_gcount gauge\n" + + "cache_size_bytes_gcount{db=\"items\"} 4 " + + scrapeTimestamp1s + + "\n" + + "cache_size_bytes_gcount{db=\"options\"} 4 " + + scrapeTimestamp2s + + "\n" + + "# HELP cache_size_bytes_gsum number of bytes in the cache\n" + + "# TYPE cache_size_bytes_gsum gauge\n" + + "cache_size_bytes_gsum{db=\"items\"} 17.0 " + + scrapeTimestamp1s + + "\n" + + "cache_size_bytes_gsum{db=\"options\"} 18.0 " + + scrapeTimestamp2s + + "\n" + + "# HELP cache_size_bytes_created number of bytes in the cache\n" + + "# TYPE cache_size_bytes_created gauge\n" + + "cache_size_bytes_created{db=\"items\"} " + + createdTimestamp1s + + " " + + scrapeTimestamp1s + + "\n" + + "cache_size_bytes_created{db=\"options\"} " + + createdTimestamp2s + + " " + + scrapeTimestamp2s + + "\n"; + String openMetricsTextWithoutCreated = + "# TYPE cache_size_bytes gaugehistogram\n" + + "# UNIT cache_size_bytes bytes\n" + + "# HELP cache_size_bytes number of bytes in the cache\n" + + "cache_size_bytes_bucket{db=\"items\",le=\"2.0\"} 3 " + + scrapeTimestamp1s + + " # " + + exemplar1String + + "\n" + + "cache_size_bytes_bucket{db=\"items\",le=\"+Inf\"} 4 " + + scrapeTimestamp1s + + " # " + + exemplar2String + + "\n" + + "cache_size_bytes_gcount{db=\"items\"} 4 " + + scrapeTimestamp1s + + "\n" + + "cache_size_bytes_gsum{db=\"items\"} 17.0 " + + scrapeTimestamp1s + + "\n" + + "cache_size_bytes_bucket{db=\"options\",le=\"2.0\"} 4 " + + scrapeTimestamp2s + + " # " + + exemplar1String + + "\n" + + "cache_size_bytes_bucket{db=\"options\",le=\"+Inf\"} 4 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "cache_size_bytes_gcount{db=\"options\"} 4 " + + scrapeTimestamp2s + + "\n" + + "cache_size_bytes_gsum{db=\"options\"} 18.0 " + + scrapeTimestamp2s + + "\n" + + "# EOF\n"; + String prometheusTextWithoutCreated = + "# HELP cache_size_bytes number of bytes in the cache\n" + + "# TYPE cache_size_bytes histogram\n" + + "cache_size_bytes_bucket{db=\"items\",le=\"2.0\"} 3 " + + scrapeTimestamp1s + + "\n" + + "cache_size_bytes_bucket{db=\"items\",le=\"+Inf\"} 4 " + + scrapeTimestamp1s + + "\n" + + "cache_size_bytes_bucket{db=\"options\",le=\"2.0\"} 4 " + + scrapeTimestamp2s + + "\n" + + "cache_size_bytes_bucket{db=\"options\",le=\"+Inf\"} 4 " + + scrapeTimestamp2s + + "\n" + + "# HELP cache_size_bytes_gcount number of bytes in the cache\n" + + "# TYPE cache_size_bytes_gcount gauge\n" + + "cache_size_bytes_gcount{db=\"items\"} 4 " + + scrapeTimestamp1s + + "\n" + + "cache_size_bytes_gcount{db=\"options\"} 4 " + + scrapeTimestamp2s + + "\n" + + "# HELP cache_size_bytes_gsum number of bytes in the cache\n" + + "# TYPE cache_size_bytes_gsum gauge\n" + + "cache_size_bytes_gsum{db=\"items\"} 17.0 " + + scrapeTimestamp1s + + "\n" + + "cache_size_bytes_gsum{db=\"options\"} 18.0 " + + scrapeTimestamp2s + + "\n"; + String prometheusProtobuf = + // @formatter:off + "name: \"cache_size_bytes\" " + + "help: \"number of bytes in the cache\" " + + "type: GAUGE_HISTOGRAM " + + "metric { " + + "label { name: \"db\" value: \"items\" } " + + "timestamp_ms: 1672850685829 " + + "histogram { " + + "sample_count: 4 " + + "sample_sum: 17.0 " + + "bucket { " + + "cumulative_count: 3 " + + "upper_bound: 2.0 " + + exemplar1protoString + + " " + + "} bucket { " + + "cumulative_count: 4 " + + "upper_bound: Infinity " + + exemplar2protoString + + " " + + "} " + + "} " + + "} metric { " + + "label { name: \"db\" value: \"options\" } " + + "timestamp_ms: 1672850585820 " + + "histogram { " + + "sample_count: 4 " + + "sample_sum: 18.0 " + + "bucket { " + + "cumulative_count: 4 " + + "upper_bound: 2.0 " + + exemplar1protoString + + " " + + "} bucket { " + + "cumulative_count: 4 " + + "upper_bound: Infinity " + + exemplar2protoString + + " " + + "} " + + "} " + + "}"; + // @formatter:on + HistogramSnapshot gaugeHistogram = + HistogramSnapshot.builder() + .gaugeHistogram(true) + .name("cache_size_bytes") + .help("number of bytes in the cache") + .unit(Unit.BYTES) + .dataPoint( + HistogramSnapshot.HistogramDataPointSnapshot.builder() + .sum(17) + .classicHistogramBuckets( + ClassicHistogramBuckets.builder() + .bucket(2.0, 3) + .bucket(Double.POSITIVE_INFINITY, 1) + .build()) + .labels(Labels.of("db", "items")) + .exemplars(Exemplars.of(exemplar1, exemplar2)) + .createdTimestampMillis(createdTimestamp1) + .scrapeTimestampMillis(scrapeTimestamp1) + .build()) + .dataPoint( + HistogramSnapshot.HistogramDataPointSnapshot.builder() + .sum(18) + .classicHistogramBuckets( + ClassicHistogramBuckets.builder() + .bucket(2.0, 4) + .bucket(Double.POSITIVE_INFINITY, 0) + .build()) + .labels(Labels.of("db", "options")) + .exemplars(Exemplars.of(exemplar1, exemplar2)) + .createdTimestampMillis(createdTimestamp2) + .scrapeTimestampMillis(scrapeTimestamp2) + .build()) + .build(); + assertOpenMetricsText(openMetricsText, gaugeHistogram); + assertOpenMetricsTextWithExemplarsOnAllTimeSeries( + openMetricsTextWithExemplarsOnAllTimeSeries, gaugeHistogram); + assertPrometheusText(prometheusText, gaugeHistogram); + assertOpenMetricsTextWithoutCreated(openMetricsTextWithoutCreated, gaugeHistogram); + assertPrometheusTextWithoutCreated(prometheusTextWithoutCreated, gaugeHistogram); + assertPrometheusProtobuf(prometheusProtobuf, gaugeHistogram); + } + + @Test + public void testClassicGaugeHistogramMinimal() throws IOException { + // In OpenMetrics a histogram can have a _count if and only if it has a _sum. + // In Prometheus format, a histogram can have a _count without a _sum. + String openMetricsText = + """ + # TYPE queue_size_bytes gaugehistogram + queue_size_bytes_bucket{le="+Inf"} 130 + # EOF + """; + String prometheusText = + """ + # TYPE queue_size_bytes histogram + queue_size_bytes_bucket{le="+Inf"} 130 + # TYPE queue_size_bytes_gcount gauge + queue_size_bytes_gcount 130 + """; + String prometheusProtobuf = + // @formatter:off + "name: \"queue_size_bytes\" " + + "type: GAUGE_HISTOGRAM " + + "metric { " + + "histogram { " + + "sample_count: 130 " + + "bucket { " + + "cumulative_count: 130 " + + "upper_bound: Infinity " + + "} " + + "} " + + "}"; + // @formatter:on + HistogramSnapshot gaugeHistogram = + HistogramSnapshot.builder() + .gaugeHistogram(true) + .name("queue_size_bytes") + .dataPoint( + HistogramSnapshot.HistogramDataPointSnapshot.builder() + .classicHistogramBuckets( + ClassicHistogramBuckets.builder() + .bucket(Double.POSITIVE_INFINITY, 130) + .build()) + .build()) + .build(); + assertOpenMetricsText(openMetricsText, gaugeHistogram); + assertPrometheusText(prometheusText, gaugeHistogram); + assertOpenMetricsTextWithoutCreated(openMetricsText, gaugeHistogram); + assertPrometheusTextWithoutCreated(prometheusText, gaugeHistogram); + assertPrometheusProtobuf(prometheusProtobuf, gaugeHistogram); + } + + @Test + public void testClassicGaugeHistogramCountAndSum() throws IOException { + String openMetricsText = + """ + # TYPE queue_size_bytes gaugehistogram + queue_size_bytes_bucket{le="+Inf"} 130 + queue_size_bytes_gcount 130 + queue_size_bytes_gsum 27000.0 + # EOF + """; + String prometheusText = + """ + # TYPE queue_size_bytes histogram + queue_size_bytes_bucket{le="+Inf"} 130 + # TYPE queue_size_bytes_gcount gauge + queue_size_bytes_gcount 130 + # TYPE queue_size_bytes_gsum gauge + queue_size_bytes_gsum 27000.0 + """; + String prometheusProtobuf = + // @formatter:off + "name: \"queue_size_bytes\" " + + "type: GAUGE_HISTOGRAM " + + "metric { " + + "histogram { " + + "sample_count: 130 " + + "sample_sum: 27000.0 " + + "bucket { " + + "cumulative_count: 130 " + + "upper_bound: Infinity " + + "} " + + "} " + + "}"; + // @formatter:on + HistogramSnapshot gaugeHistogram = + HistogramSnapshot.builder() + .gaugeHistogram(true) + .name("queue_size_bytes") + .dataPoint( + HistogramSnapshot.HistogramDataPointSnapshot.builder() + .sum(27000) + .classicHistogramBuckets( + ClassicHistogramBuckets.builder() + .bucket(Double.POSITIVE_INFINITY, 130) + .build()) + .build()) + .build(); + assertOpenMetricsText(openMetricsText, gaugeHistogram); + assertPrometheusText(prometheusText, gaugeHistogram); + assertOpenMetricsTextWithoutCreated(openMetricsText, gaugeHistogram); + assertPrometheusTextWithoutCreated(prometheusText, gaugeHistogram); + assertPrometheusProtobuf(prometheusProtobuf, gaugeHistogram); + } + + @Test + public void testClassicHistogramWithDots() throws IOException { + String openMetricsText = + """ + # TYPE U__my_2e_request_2e_duration_2e_seconds histogram + # UNIT U__my_2e_request_2e_duration_2e_seconds seconds + # HELP U__my_2e_request_2e_duration_2e_seconds Request duration in seconds + U__my_2e_request_2e_duration_2e_seconds_bucket{U__http_2e_path="/hello",le="+Inf"} 130 # {U__some_2e_exemplar_2e_key="some value"} 3.0 1690298864.383 + U__my_2e_request_2e_duration_2e_seconds_count{U__http_2e_path="/hello"} 130 + U__my_2e_request_2e_duration_2e_seconds_sum{U__http_2e_path="/hello"} 0.01 + # EOF + """; + String openMetricsTextWithExemplarsOnAllTimeSeries = + "# TYPE my_request_duration_seconds histogram\n" + + "# UNIT my_request_duration_seconds seconds\n" + + "# HELP my_request_duration_seconds Request duration in seconds\n" + + "my_request_duration_seconds_bucket{http_path=\"/hello\",le=\"+Inf\"} 130 # " + + exemplarWithDotsString + + "\n" + + "my_request_duration_seconds_count{http_path=\"/hello\"} 130 # " + + exemplarWithDotsString + + "\n" + + "my_request_duration_seconds_sum{http_path=\"/hello\"} 0.01\n" + + "# EOF\n"; + String prometheusText = + """ + # HELP my_request_duration_seconds Request duration in seconds + # TYPE my_request_duration_seconds histogram + my_request_duration_seconds_bucket{http_path="/hello",le="+Inf"} 130 + my_request_duration_seconds_count{http_path="/hello"} 130 + my_request_duration_seconds_sum{http_path="/hello"} 0.01 + """; + String prometheusProtobuf = + // @formatter:off + "name: \"my_request_duration_seconds\" " + + "help: \"Request duration in seconds\" " + + "type: HISTOGRAM " + + "metric { " + + "label { name: \"http_path\" value: \"/hello\" } " + + "histogram { " + + "sample_count: 130 " + + "sample_sum: 0.01 " + + "bucket { cumulative_count: 130 upper_bound: Infinity " + + exemplarWithDotsProtoString + + " } " + + "} " + + "}"; + // @formatter:on + + HistogramSnapshot histogram = + HistogramSnapshot.builder() + .name("my.request.duration.seconds") + .help("Request duration in seconds") + .unit(Unit.SECONDS) + .dataPoint( + HistogramSnapshot.HistogramDataPointSnapshot.builder() + .sum(0.01) + .labels(Labels.builder().label("http.path", "/hello").build()) + .classicHistogramBuckets( + ClassicHistogramBuckets.builder() + .bucket(Double.POSITIVE_INFINITY, 130) + .build()) + .exemplars(Exemplars.of(exemplarWithDots)) + .build()) + .build(); + assertOpenMetricsText(openMetricsText, histogram); + assertOpenMetricsTextWithExemplarsOnAllTimeSeries( + openMetricsTextWithExemplarsOnAllTimeSeries, histogram); + assertPrometheusText(prometheusText, histogram); + assertPrometheusProtobuf(prometheusProtobuf, histogram); + } + + @Test + public void testNativeHistogramComplete() throws IOException { + String openMetricsText = + "# TYPE response_size_bytes histogram\n" + + "# UNIT response_size_bytes bytes\n" + + "# HELP response_size_bytes help\n" + + "response_size_bytes_bucket{status=\"200\",le=\"+Inf\"} 2 " + + scrapeTimestamp1s + + " # " + + exemplar2String + + "\n" + + "response_size_bytes_count{status=\"200\"} 2 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_sum{status=\"200\"} 4.2 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_created{status=\"200\"} " + + createdTimestamp1s + + " " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"+Inf\"} 55 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "response_size_bytes_count{status=\"500\"} 55 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_sum{status=\"500\"} 3.2 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_created{status=\"500\"} " + + createdTimestamp2s + + " " + + scrapeTimestamp2s + + "\n" + + "# EOF\n"; + String openMetricsTextWithExemplarsOnAllTimeSeries = + "# TYPE response_size_bytes histogram\n" + + "# UNIT response_size_bytes bytes\n" + + "# HELP response_size_bytes help\n" + + "response_size_bytes_bucket{status=\"200\",le=\"+Inf\"} 2 " + + scrapeTimestamp1s + + " # " + + exemplar2String + + "\n" + + "response_size_bytes_count{status=\"200\"} 2 " + + scrapeTimestamp1s + + " # " + + exemplar2String + + "\n" + + "response_size_bytes_sum{status=\"200\"} 4.2 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_created{status=\"200\"} " + + createdTimestamp1s + + " " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"+Inf\"} 55 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "response_size_bytes_count{status=\"500\"} 55 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "response_size_bytes_sum{status=\"500\"} 3.2 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_created{status=\"500\"} " + + createdTimestamp2s + + " " + + scrapeTimestamp2s + + "\n" + + "# EOF\n"; + String prometheusText = + "# HELP response_size_bytes help\n" + + "# TYPE response_size_bytes histogram\n" + + "response_size_bytes_bucket{status=\"200\",le=\"+Inf\"} 2 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_count{status=\"200\"} 2 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_sum{status=\"200\"} 4.2 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"+Inf\"} 55 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_count{status=\"500\"} 55 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_sum{status=\"500\"} 3.2 " + + scrapeTimestamp2s + + "\n" + + "# HELP response_size_bytes_created help\n" + + "# TYPE response_size_bytes_created gauge\n" + + "response_size_bytes_created{status=\"200\"} " + + createdTimestamp1s + + " " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_created{status=\"500\"} " + + createdTimestamp2s + + " " + + scrapeTimestamp2s + + "\n"; + String openMetricsTextWithoutCreated = + "# TYPE response_size_bytes histogram\n" + + "# UNIT response_size_bytes bytes\n" + + "# HELP response_size_bytes help\n" + + "response_size_bytes_bucket{status=\"200\",le=\"+Inf\"} 2 " + + scrapeTimestamp1s + + " # " + + exemplar2String + + "\n" + + "response_size_bytes_count{status=\"200\"} 2 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_sum{status=\"200\"} 4.2 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"+Inf\"} 55 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "response_size_bytes_count{status=\"500\"} 55 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_sum{status=\"500\"} 3.2 " + + scrapeTimestamp2s + + "\n" + + "# EOF\n"; + String prometheusTextWithoutCreated = + "# HELP response_size_bytes help\n" + + "# TYPE response_size_bytes histogram\n" + + "response_size_bytes_bucket{status=\"200\",le=\"+Inf\"} 2 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_count{status=\"200\"} 2 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_sum{status=\"200\"} 4.2 " + + scrapeTimestamp1s + + "\n" + + "response_size_bytes_bucket{status=\"500\",le=\"+Inf\"} 55 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_count{status=\"500\"} 55 " + + scrapeTimestamp2s + + "\n" + + "response_size_bytes_sum{status=\"500\"} 3.2 " + + scrapeTimestamp2s + + "\n"; + String prometheusProtobuf = + // @formatter:off + "name: \"response_size_bytes\" " + + "help: \"help\" " + + "type: HISTOGRAM " + + "metric { " + + "label { name: \"status\" value: \"200\" } " + + "timestamp_ms: 1672850685829 " + + "histogram { " + + "sample_count: 2 " + + "sample_sum: 4.2 " + + "bucket { cumulative_count: 2 upper_bound: Infinity " + + exemplar2protoString + + " } " + + "schema: 5 " + + "zero_threshold: 0.0 " + + "zero_count: 0 " + + "positive_span { offset: 0 length: 1 } " + + "positive_delta: 2 " + + "} " + + "} metric { " + + "label { name: \"status\" value: \"500\" } " + + "timestamp_ms: 1672850585820 " + + "histogram { " + + "sample_count: 55 " + + // bucket counts + zero count + "sample_sum: 3.2 " + + "bucket { cumulative_count: 55 upper_bound: Infinity " + + exemplar2protoString + + " } " + + "schema: 5 " + + "zero_threshold: 0.0 " + + "zero_count: 1 " + + "negative_span { offset: 0 length: 1 } " + + "negative_span { offset: 9 length: 1 } " + + "negative_delta: 1 " + + "negative_delta: -1 " + + // span with count 0 + "positive_span { offset: 2 length: 3 } " + + // span with 3 buckets (indexes 2-4) + "positive_span { offset: 7 length: 1 } " + + // span with 1 bucket (index 12) + "positive_span { offset: 9 length: 4 } " + + // span with gap of size 1 (indexes 22-25) + "positive_span { offset: 6 length: 5 } " + + // span with gap of size 2 (indexes 32-36) + "positive_span { offset: 4 length: 2 } " + + // span with gap of size 3 part 1 (indexes 41-42) + "positive_span { offset: 3 length: 2 } " + + // span with gap of size 3 part 2 (indexes 46-47) + "positive_delta: 3 " + + // index 2, count 3 + "positive_delta: 2 " + + // index 3, count 5 + "positive_delta: -1 " + + // index 4, count 4 + "positive_delta: 2 " + + // index 12, count 6 + "positive_delta: -4 " + + // index 22, count 2 + "positive_delta: -2 " + + // index 23, gap + "positive_delta: 1 " + + // index 24, count 1 + "positive_delta: 2 " + + // index 25, count 3 + "positive_delta: 1 " + + // index 32, count 4 + "positive_delta: -1 " + + // index 33, count 3 + "positive_delta: -3 " + + // index 34, gap + "positive_delta: 0 " + + // index 35, gap + "positive_delta: 7 " + + // index 36, count 7 + "positive_delta: -4 " + + // index 41, count 3 + "positive_delta: 6 " + + // index 42, count 9 + "positive_delta: -7 " + + // index 46, count 2 + "positive_delta: -1 " + + // index 47, count 1 + "} " + + "}"; + // @formatter:on + HistogramSnapshot nativeHistogram = + HistogramSnapshot.builder() + .name("response_size_bytes") + .help("help") + .unit(Unit.BYTES) + .dataPoint( + HistogramSnapshot.HistogramDataPointSnapshot.builder() + .sum(3.2) + .nativeSchema(5) + .nativeZeroCount(1) + .nativeBucketsForPositiveValues( + NativeHistogramBuckets.builder() + // span with 3 buckets + .bucket(2, 3) + .bucket(3, 5) + .bucket(4, 4) + // span with just 1 bucket + .bucket(12, 6) + // span with gap of size 1 + .bucket(22, 2) + .bucket(24, 1) + .bucket(25, 3) + // span with gap of size 2 + .bucket(32, 4) + .bucket(33, 3) + .bucket(36, 7) + // span with gap of size 3 + .bucket(41, 3) + .bucket(42, 9) + .bucket(46, 2) + .bucket(47, 1) + .build()) + .nativeBucketsForNegativeValues( + NativeHistogramBuckets.builder() + .bucket(0, 1) + .bucket(10, 0) // bucket with count 0 + .build()) + .labels(Labels.of("status", "500")) + .exemplars(Exemplars.of(exemplar1, exemplar2)) + .createdTimestampMillis(createdTimestamp2) + .scrapeTimestampMillis(scrapeTimestamp2) + .build()) + .dataPoint( + HistogramSnapshot.HistogramDataPointSnapshot.builder() + .sum(4.2) + .nativeSchema(5) + .nativeBucketsForPositiveValues( + NativeHistogramBuckets.builder().bucket(0, 2).build()) + .labels(Labels.of("status", "200")) + .exemplars(Exemplars.of(exemplar1, exemplar2)) + .createdTimestampMillis(createdTimestamp1) + .scrapeTimestampMillis(scrapeTimestamp1) + .build()) + .build(); + assertOpenMetricsText(openMetricsText, nativeHistogram); + assertOpenMetricsTextWithExemplarsOnAllTimeSeries( + openMetricsTextWithExemplarsOnAllTimeSeries, nativeHistogram); + assertPrometheusText(prometheusText, nativeHistogram); + assertOpenMetricsTextWithoutCreated(openMetricsTextWithoutCreated, nativeHistogram); + assertPrometheusTextWithoutCreated(prometheusTextWithoutCreated, nativeHistogram); + assertPrometheusProtobuf(prometheusProtobuf, nativeHistogram); + } + + @Test + public void testNativeHistogramMinimal() throws IOException { + String openMetricsText = + """ + # TYPE latency_seconds histogram + latency_seconds_bucket{le="+Inf"} 0 + # EOF + """; + String prometheusText = + """ + # TYPE latency_seconds histogram + latency_seconds_bucket{le="+Inf"} 0 + latency_seconds_count 0 + """; + String prometheusProtobuf = + // @formatter:off + "name: \"latency_seconds\" " + + "type: HISTOGRAM " + + "metric { " + + "histogram { " + + "sample_count: 0 " + + "schema: 5 " + + "zero_threshold: 0.0 " + + "zero_count: 0 " + + "} " + + "}"; + // @formatter:on + HistogramSnapshot nativeHistogram = + HistogramSnapshot.builder() + .name("latency_seconds") + .dataPoint( + HistogramSnapshot.HistogramDataPointSnapshot.builder().nativeSchema(5).build()) + .build(); + assertOpenMetricsText(openMetricsText, nativeHistogram); + assertPrometheusText(prometheusText, nativeHistogram); + assertPrometheusProtobuf(prometheusProtobuf, nativeHistogram); + } + + @Test + public void testNativeHistogramWithDots() throws IOException { + String openMetricsText = + """ + # TYPE U__my_2e_request_2e_duration_2e_seconds histogram + # UNIT U__my_2e_request_2e_duration_2e_seconds seconds + # HELP U__my_2e_request_2e_duration_2e_seconds Request duration in seconds + U__my_2e_request_2e_duration_2e_seconds_bucket{U__http_2e_path="/hello",le="+Inf"} 4 # {U__some_2e_exemplar_2e_key="some value"} 3.0 1690298864.383 + U__my_2e_request_2e_duration_2e_seconds_count{U__http_2e_path="/hello"} 4 + U__my_2e_request_2e_duration_2e_seconds_sum{U__http_2e_path="/hello"} 3.2 + # EOF + """; + String openMetricsTextWithExemplarsOnAllTimeSeries = + "# TYPE my_request_duration_seconds histogram\n" + + "# UNIT my_request_duration_seconds seconds\n" + + "# HELP my_request_duration_seconds Request duration in seconds\n" + + "my_request_duration_seconds_bucket{http_path=\"/hello\",le=\"+Inf\"} 4 # " + + exemplarWithDotsString + + "\n" + + "my_request_duration_seconds_count{http_path=\"/hello\"} 4 # " + + exemplarWithDotsString + + "\n" + + "my_request_duration_seconds_sum{http_path=\"/hello\"} 3.2\n" + + "# EOF\n"; + String prometheusText = + """ + # HELP my_request_duration_seconds Request duration in seconds + # TYPE my_request_duration_seconds histogram + my_request_duration_seconds_bucket{http_path="/hello",le="+Inf"} 4 + my_request_duration_seconds_count{http_path="/hello"} 4 + my_request_duration_seconds_sum{http_path="/hello"} 3.2 + """; + String prometheusProtobuf = + // @formatter:off + "name: \"my_request_duration_seconds\" " + + "help: \"Request duration in seconds\" " + + "type: HISTOGRAM " + + "metric { " + + "label { name: \"http_path\" value: \"/hello\" } " + + "histogram { " + + "sample_count: 4 " + + "sample_sum: 3.2 " + + "bucket { cumulative_count: 4 upper_bound: Infinity " + + exemplarWithDotsProtoString + + " } " + + "schema: 5 " + + "zero_threshold: 0.0 " + + "zero_count: 1 " + + "positive_span { offset: 2 length: 1 } " + + "positive_delta: 3 " + + "} " + + "}"; + // @formatter:on + + HistogramSnapshot histogram = + HistogramSnapshot.builder() + .name("my.request.duration.seconds") + .help("Request duration in seconds") + .unit(Unit.SECONDS) + .dataPoint( + HistogramSnapshot.HistogramDataPointSnapshot.builder() + .labels(Labels.builder().label("http.path", "/hello").build()) + .sum(3.2) + .nativeSchema(5) + .nativeZeroCount(1) + .nativeBucketsForPositiveValues( + NativeHistogramBuckets.builder().bucket(2, 3).build()) + .exemplars(Exemplars.of(exemplarWithDots)) + .build()) + .build(); + assertOpenMetricsText(openMetricsText, histogram); + assertOpenMetricsTextWithExemplarsOnAllTimeSeries( + openMetricsTextWithExemplarsOnAllTimeSeries, histogram); + assertPrometheusText(prometheusText, histogram); + assertPrometheusProtobuf(prometheusProtobuf, histogram); + } + + // TODO: Gauge Native Histogram + + @Test + public void testInfo() throws IOException { + String openMetrics = + """ + # TYPE version info + # HELP version version information + version_info{version="1.2.3"} 1 + # EOF + """; + String prometheus = + """ + # HELP version_info version information + # TYPE version_info gauge + version_info{version="1.2.3"} 1 + """; + InfoSnapshot info = + InfoSnapshot.builder() + .name("version") + .help("version information") + .dataPoint( + InfoSnapshot.InfoDataPointSnapshot.builder() + .labels(Labels.of("version", "1.2.3")) + .build()) + .build(); + assertOpenMetricsText(openMetrics, info); + assertPrometheusText(prometheus, info); + assertOpenMetricsTextWithoutCreated(openMetrics, info); + assertPrometheusTextWithoutCreated(prometheus, info); + } + + @Test + public void testInfoWithDots() throws IOException { + String openMetricsText = + """ + # TYPE U__jvm_2e_status info + # HELP U__jvm_2e_status JVM status info + U__jvm_2e_status_info{U__jvm_2e_version="1.2.3"} 1 + # EOF + """; + String prometheusText = + """ + # HELP jvm_status_info JVM status info + # TYPE jvm_status_info gauge + jvm_status_info{jvm_version="1.2.3"} 1 + """; + String prometheusProtobuf = + // @formatter:off + "name: \"jvm_status_info\" " + + "help: \"JVM status info\" " + + "type: GAUGE " + + "metric { " + + "label { name: \"jvm_version\" value: \"1.2.3\" } " + + "gauge { value: 1.0 } " + + "}"; + // @formatter:on + InfoSnapshot info = + InfoSnapshot.builder() + .name("jvm.status") + .help("JVM status info") + .dataPoint( + InfoSnapshot.InfoDataPointSnapshot.builder() + .labels(Labels.of("jvm.version", "1.2.3")) + .build()) + .build(); + assertOpenMetricsText(openMetricsText, info); + assertPrometheusText(prometheusText, info); + assertPrometheusProtobuf(prometheusProtobuf, info); + } + + @Test + public void testStateSetComplete() throws IOException { + String openMetrics = + "# TYPE state stateset\n" + + "# HELP state complete state set example\n" + + "state{env=\"dev\",state=\"state1\"} 1 " + + scrapeTimestamp1s + + "\n" + + "state{env=\"dev\",state=\"state2\"} 0 " + + scrapeTimestamp1s + + "\n" + + "state{env=\"prod\",state=\"state1\"} 0 " + + scrapeTimestamp2s + + "\n" + + "state{env=\"prod\",state=\"state2\"} 1 " + + scrapeTimestamp2s + + "\n" + + "# EOF\n"; + String prometheus = + "# HELP state complete state set example\n" + + "# TYPE state gauge\n" + + "state{env=\"dev\",state=\"state1\"} 1 " + + scrapeTimestamp1s + + "\n" + + "state{env=\"dev\",state=\"state2\"} 0 " + + scrapeTimestamp1s + + "\n" + + "state{env=\"prod\",state=\"state1\"} 0 " + + scrapeTimestamp2s + + "\n" + + "state{env=\"prod\",state=\"state2\"} 1 " + + scrapeTimestamp2s + + "\n"; + StateSetSnapshot stateSet = + StateSetSnapshot.builder() + .name("state") + .help("complete state set example") + .dataPoint( + StateSetSnapshot.StateSetDataPointSnapshot.builder() + .labels(Labels.of("env", "prod")) + .state("state1", false) + .state("state2", true) + .scrapeTimestampMillis(scrapeTimestamp2) + .build()) + .dataPoint( + StateSetSnapshot.StateSetDataPointSnapshot.builder() + .labels(Labels.of("env", "dev")) + .state("state2", false) + .state("state1", true) + .scrapeTimestampMillis(scrapeTimestamp1) + .build()) + .build(); + assertOpenMetricsText(openMetrics, stateSet); + assertPrometheusText(prometheus, stateSet); + assertOpenMetricsTextWithoutCreated(openMetrics, stateSet); + assertPrometheusTextWithoutCreated(prometheus, stateSet); + } + + @Test + public void testStateSetMinimal() throws IOException { + String openMetrics = + """ + # TYPE state stateset + state{state="a"} 1 + state{state="bb"} 0 + # EOF + """; + String prometheus = + """ + # TYPE state gauge + state{state="a"} 1 + state{state="bb"} 0 + """; + StateSetSnapshot stateSet = + StateSetSnapshot.builder() + .name("state") + .dataPoint( + StateSetSnapshot.StateSetDataPointSnapshot.builder() + .state("a", true) + .state("bb", false) + .build()) + .build(); + assertOpenMetricsText(openMetrics, stateSet); + assertPrometheusText(prometheus, stateSet); + assertOpenMetricsTextWithoutCreated(openMetrics, stateSet); + assertPrometheusTextWithoutCreated(prometheus, stateSet); + } + + @Test + public void testStateSetWithDots() throws IOException { + String openMetricsText = + """ + # TYPE U__my_2e_application_2e_state stateset + # HELP U__my_2e_application_2e_state My application state + U__my_2e_application_2e_state{U__data_2e_center="us east",U__my_2e_application_2e_state="feature.enabled"} 1 + U__my_2e_application_2e_state{U__data_2e_center="us east",U__my_2e_application_2e_state="is.alpha.version"} 0 + # EOF + """; + String prometheusText = + """ + # HELP my_application_state My application state + # TYPE my_application_state gauge + my_application_state{data_center="us east",my_application_state="feature.enabled"} 1 + my_application_state{data_center="us east",my_application_state="is.alpha.version"} 0 + """; + String prometheusProtobuf = + // @formatter:off + "name: \"my_application_state\" " + + "help: \"My application state\" " + + "type: GAUGE " + + "metric { " + + "label { name: \"data_center\" value: \"us east\" } " + + "label { name: \"my_application_state\" value: \"feature.enabled\" } " + + "gauge { value: 1.0 } " + + "} metric { " + + "label { name: \"data_center\" value: \"us east\" } " + + "label { name: \"my_application_state\" value: \"is.alpha.version\" } " + + "gauge { value: 0.0 } " + + "}"; + // @formatter:on + StateSetSnapshot stateSet = + StateSetSnapshot.builder() + .name("my.application.state") + .help("My application state") + .dataPoint( + StateSetSnapshot.StateSetDataPointSnapshot.builder() + .labels(Labels.of("data.center", "us east")) + .state("feature.enabled", true) + .state("is.alpha.version", false) + .build()) + .build(); + assertOpenMetricsText(openMetricsText, stateSet); + assertPrometheusText(prometheusText, stateSet); + assertPrometheusProtobuf(prometheusProtobuf, stateSet); + } + + @Test + public void testUnknownComplete() throws IOException { + String openMetrics = + "# TYPE my_special_thing_bytes unknown\n" + + "# UNIT my_special_thing_bytes bytes\n" + + "# HELP my_special_thing_bytes help message\n" + + "my_special_thing_bytes{env=\"dev\"} 0.2 " + + scrapeTimestamp1s + + "\n" + + "my_special_thing_bytes{env=\"prod\"} 0.7 " + + scrapeTimestamp2s + + "\n" + + "# EOF\n"; + String openMetricsWithExemplarsOnAllTimeSeries = + "# TYPE my_special_thing_bytes unknown\n" + + "# UNIT my_special_thing_bytes bytes\n" + + "# HELP my_special_thing_bytes help message\n" + + "my_special_thing_bytes{env=\"dev\"} 0.2 " + + scrapeTimestamp1s + + " # " + + exemplar1String + + "\n" + + "my_special_thing_bytes{env=\"prod\"} 0.7 " + + scrapeTimestamp2s + + " # " + + exemplar2String + + "\n" + + "# EOF\n"; + String prometheus = + "# HELP my_special_thing_bytes help message\n" + + "# TYPE my_special_thing_bytes untyped\n" + + "my_special_thing_bytes{env=\"dev\"} 0.2 " + + scrapeTimestamp1s + + "\n" + + "my_special_thing_bytes{env=\"prod\"} 0.7 " + + scrapeTimestamp2s + + "\n"; + UnknownSnapshot unknown = + UnknownSnapshot.builder() + .name("my_special_thing_bytes") + .help("help message") + .unit(Unit.BYTES) + .dataPoint( + UnknownDataPointSnapshot.builder() + .value(0.7) + .labels(Labels.of("env", "prod")) + .exemplar(exemplar2) + .scrapeTimestampMillis(scrapeTimestamp2) + .build()) + .dataPoint( + UnknownDataPointSnapshot.builder() + .value(0.2) + .labels(Labels.of("env", "dev")) + .exemplar(exemplar1) + .scrapeTimestampMillis(scrapeTimestamp1) + .build()) + .build(); + assertOpenMetricsText(openMetrics, unknown); + assertOpenMetricsTextWithExemplarsOnAllTimeSeries( + openMetricsWithExemplarsOnAllTimeSeries, unknown); + assertPrometheusText(prometheus, unknown); + assertOpenMetricsTextWithoutCreated(openMetrics, unknown); + assertPrometheusTextWithoutCreated(prometheus, unknown); + } + + @Test + public void testUnknownMinimal() throws IOException { + String openMetrics = + """ + # TYPE other unknown + other 22.3 + # EOF + """; + String prometheus = + """ + # TYPE other untyped + other 22.3 + """; + UnknownSnapshot unknown = + UnknownSnapshot.builder() + .name("other") + .dataPoint(UnknownDataPointSnapshot.builder().value(22.3).build()) + .build(); + assertOpenMetricsText(openMetrics, unknown); + assertPrometheusText(prometheus, unknown); + assertOpenMetricsTextWithoutCreated(openMetrics, unknown); + assertPrometheusTextWithoutCreated(prometheus, unknown); + } + + @Test + public void testUnknownWithDots() throws IOException { + String openMetrics = + """ + # TYPE U__some_2e_unknown_2e_metric__bytes unknown + # UNIT U__some_2e_unknown_2e_metric__bytes bytes + # HELP U__some_2e_unknown_2e_metric__bytes help message + U__some_2e_unknown_2e_metric__bytes{U__test_2e_env="7"} 0.7 + # EOF + """; + String openMetricsWithExemplarsOnAllTimeSeries = + "# TYPE some_unknown_metric_bytes unknown\n" + + "# UNIT some_unknown_metric_bytes bytes\n" + + "# HELP some_unknown_metric_bytes help message\n" + + "some_unknown_metric_bytes{test_env=\"7\"} 0.7 # " + + exemplarWithDotsString + + "\n" + + "# EOF\n"; + String prometheus = + """ + # HELP some_unknown_metric_bytes help message + # TYPE some_unknown_metric_bytes untyped + some_unknown_metric_bytes{test_env="7"} 0.7 + """; + String prometheusProtobuf = + // @formatter:off + "name: \"some_unknown_metric_bytes\" " + + "help: \"help message\" " + + "type: UNTYPED " + + "metric { " + + "label { name: \"test_env\" value: \"7\" } " + + "untyped { value: 0.7 } " + + "}"; + // @formatter:on + UnknownSnapshot unknown = + UnknownSnapshot.builder() + .name(PrometheusNaming.sanitizeMetricName("some.unknown.metric", Unit.BYTES)) + .help("help message") + .unit(Unit.BYTES) + .dataPoint( + UnknownDataPointSnapshot.builder() + .value(0.7) + .labels(Labels.of("test.env", "7")) + .exemplar(exemplarWithDots) + .build()) + .build(); + assertOpenMetricsText(openMetrics, unknown); + assertOpenMetricsTextWithExemplarsOnAllTimeSeries( + openMetricsWithExemplarsOnAllTimeSeries, unknown); + assertPrometheusText(prometheus, unknown); + assertPrometheusProtobuf(prometheusProtobuf, unknown); + } + + @Test + public void testHelpEscape() throws IOException { + String openMetrics = + """ + # TYPE test counter + # HELP test Some text and \\n some \\" escaping + test_total 1.0 + # EOF + """; + String prometheus = + """ + # HELP test_total Some text and \\n some " escaping + # TYPE test_total counter + test_total 1.0 + """; + CounterSnapshot counter = + CounterSnapshot.builder() + .name("test") + .help("Some text and \n some \" escaping") // example from https://openMetrics.io + .dataPoint(CounterDataPointSnapshot.builder().value(1.0).build()) + .build(); + assertOpenMetricsText(openMetrics, counter); + assertPrometheusText(prometheus, counter); + assertOpenMetricsTextWithoutCreated(openMetrics, counter); + assertPrometheusTextWithoutCreated(prometheus, counter); + } + + @Test + public void testLabelValueEscape() throws IOException { + String openMetrics = + """ + # TYPE test counter + test_total{a="x",b="escaping\\" example \\n "} 1.0 + # EOF + """; + String prometheus = + """ + # TYPE test_total counter + test_total{a="x",b="escaping\\" example \\n "} 1.0 + """; + CounterSnapshot counter = + CounterSnapshot.builder() + .name("test") + .dataPoint( + CounterDataPointSnapshot.builder() + // example from https://openMetrics.io + .labels(Labels.of("a", "x", "b", "escaping\" example \n ")) + .value(1.0) + .build()) + .build(); + assertOpenMetricsText(openMetrics, counter); + assertPrometheusText(prometheus, counter); + } + + @ParameterizedTest + @CsvSource({ + "'application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily;encoding=delimited', 'application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited; escaping=underscores'", + "'text/plain;version=0.0.4', 'text/plain; version=0.0.4; charset=utf-8; escaping=underscores'", + "'application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily;encoding=delimited; escaping=allow-utf-8', 'application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited; escaping=allow-utf-8'", + "'application/openmetrics-text', 'application/openmetrics-text; version=1.0.0; charset=utf-8; escaping=underscores'", + "'application/openmetrics-text;version=0.0.1; escaping=underscores', 'application/openmetrics-text; version=1.0.0; charset=utf-8; escaping=underscores'", + "'text/plain;version=0.0.4; escaping=allow-utf-8', 'text/plain; version=0.0.4; charset=utf-8; escaping=allow-utf-8'" + }) + public void testFindWriter(String acceptHeaderValue, String expectedFmt) { + ExpositionFormats expositionFormats = ExpositionFormats.init(); + EscapingScheme escapingScheme = EscapingScheme.fromAcceptHeader(acceptHeaderValue); + ExpositionFormatWriter writer = expositionFormats.findWriter(acceptHeaderValue); + assertThat(writer.getContentType() + escapingScheme.toHeaderFormat()).hasToString(expectedFmt); + } + + @Test + public void testWrite() throws IOException { + ByteArrayOutputStream buff = new ByteArrayOutputStream(new AtomicInteger(2 << 9).get() + 1024); + ExpositionFormats expositionFormats = ExpositionFormats.init(); + UnknownSnapshot unknown = + UnknownSnapshot.builder() + .name("foo_metric") + .dataPoint(UnknownDataPointSnapshot.builder().value(1.234).build()) + .build(); + + String acceptHeaderValue = "text/plain; version=0.0.4; charset=utf-8"; + EscapingScheme escapingScheme = EscapingScheme.fromAcceptHeader(acceptHeaderValue); + ExpositionFormatWriter textWriter = expositionFormats.findWriter(acceptHeaderValue); + + textWriter.write(buff, MetricSnapshots.of(unknown), escapingScheme); + byte[] out = buff.toByteArray(); + assertThat(out.length).isNotEqualTo(0); + + String expected = + """ + # TYPE foo_metric untyped + foo_metric 1.234 + """; + + assertThat(new String(out, UTF_8)).hasToString(expected); + } + + private void assertOpenMetricsText(String expected, MetricSnapshot snapshot) throws IOException { + assertOpenMetricsText(expected, snapshot, EscapingScheme.VALUE_ENCODING_ESCAPING); + } + + private void assertOpenMetricsText( + String expected, MetricSnapshot snapshot, EscapingScheme escapingScheme) throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + OpenMetricsTextFormatWriter writer = + OpenMetricsTextFormatWriter.builder().setCreatedTimestampsEnabled(true).build(); + writer.write(out, MetricSnapshots.of(snapshot), escapingScheme); + assertThat(out).hasToString(expected); + } + + private void assertOpenMetricsTextWithExemplarsOnAllTimeSeries( + String expected, MetricSnapshot snapshot) throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + OpenMetricsTextFormatWriter writer = + OpenMetricsTextFormatWriter.builder() + .setCreatedTimestampsEnabled(true) + .setExemplarsOnAllMetricTypesEnabled(true) + .build(); + writer.write(out, MetricSnapshots.of(snapshot), EscapingScheme.UNDERSCORE_ESCAPING); + assertThat(out).hasToString(expected); + } + + private void assertOpenMetricsTextWithoutCreated(String expected, MetricSnapshot snapshot) + throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + OpenMetricsTextFormatWriter writer = OpenMetricsTextFormatWriter.create(); + writer.write(out, MetricSnapshots.of(snapshot), EscapingScheme.UNDERSCORE_ESCAPING); + assertThat(out).hasToString(expected); + } + + private void assertPrometheusText(String expected, MetricSnapshot snapshot) throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + getPrometheusWriter(PrometheusTextFormatWriter.builder().setIncludeCreatedTimestamps(true)) + .write(out, MetricSnapshots.of(snapshot), EscapingScheme.UNDERSCORE_ESCAPING); + assertThat(out).hasToString(expected); + } + + @SuppressWarnings("deprecation") + private static PrometheusTextFormatWriter getPrometheusWriter( + PrometheusTextFormatWriter.Builder builder) { + return builder.setTimestampsInMs(false).build(); + } + + private void assertPrometheusTextWithoutCreated(String expected, MetricSnapshot snapshot) + throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + getPrometheusWriter(PrometheusTextFormatWriter.builder()) + .write(out, MetricSnapshots.of(snapshot), EscapingScheme.UNDERSCORE_ESCAPING); + assertThat(out).hasToString(expected); + } + + protected void assertPrometheusProtobuf(String expected, MetricSnapshot snapshot) {} +} diff --git a/prometheus-metrics-exposition-textformats/src/test/java/io/prometheus/metrics/expositionformats/PrometheusProtobufWriterTest.java b/prometheus-metrics-exposition-textformats/src/test/java/io/prometheus/metrics/expositionformats/PrometheusProtobufWriterTest.java new file mode 100644 index 000000000..26561bf46 --- /dev/null +++ b/prometheus-metrics-exposition-textformats/src/test/java/io/prometheus/metrics/expositionformats/PrometheusProtobufWriterTest.java @@ -0,0 +1,37 @@ +package io.prometheus.metrics.expositionformats; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatCode; + +import io.prometheus.metrics.config.EscapingScheme; +import org.junit.jupiter.api.Test; + +class PrometheusProtobufWriterTest { + + private final PrometheusProtobufWriter writer = new PrometheusProtobufWriter(); + + @Test + void accepts() { + assertThat(writer.accepts(null)).isFalse(); + } + + @Test + void getContentType() { + assertThat(writer.getContentType()) + .isEqualTo( + "application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; " + + "encoding=delimited"); + } + + @Test + void write() { + assertThatCode(() -> writer.write(null, null, EscapingScheme.ALLOW_UTF8)) + .isInstanceOf(UnsupportedOperationException.class); + } + + @Test + void toDebugString() { + assertThatCode(() -> writer.toDebugString(null, EscapingScheme.ALLOW_UTF8)) + .isInstanceOf(UnsupportedOperationException.class); + } +} diff --git a/prometheus-metrics-exposition-textformats/src/test/java/io/prometheus/metrics/expositionformats/TextFormatUtilTest.java b/prometheus-metrics-exposition-textformats/src/test/java/io/prometheus/metrics/expositionformats/TextFormatUtilTest.java new file mode 100644 index 000000000..dbb707f51 --- /dev/null +++ b/prometheus-metrics-exposition-textformats/src/test/java/io/prometheus/metrics/expositionformats/TextFormatUtilTest.java @@ -0,0 +1,37 @@ +package io.prometheus.metrics.expositionformats; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; +import java.io.StringWriter; +import org.junit.jupiter.api.Test; + +class TextFormatUtilTest { + + @Test + void writeEscapedLabelValue() throws IOException { + assertEquals("aa\\\\bb\\\"cc\\ndd\\nee\\\\ff\\\"gg", escape("aa\\bb\"cc\ndd\nee\\ff\"gg")); + assertEquals("\\\\", escape("\\")); + assertEquals("\\\\\\\\", escape("\\\\")); + assertEquals("text", escape("text")); + } + + private static String escape(String s) throws IOException { + StringWriter writer = new StringWriter(); + TextFormatUtil.writeEscapedString(writer, s); + return writer.toString(); + } + + @Test + void testWritePrometheusTimestamp() throws IOException { + assertThat(writePrometheusTimestamp(true)).isEqualTo("1000"); + assertThat(writePrometheusTimestamp(false)).isEqualTo("1.000"); + } + + private static String writePrometheusTimestamp(boolean timestampsInMs) throws IOException { + StringWriter writer = new StringWriter(); + TextFormatUtil.writePrometheusTimestamp(writer, 1000, timestampsInMs); + return writer.toString(); + } +} diff --git a/prometheus-metrics-instrumentation-caffeine/pom.xml b/prometheus-metrics-instrumentation-caffeine/pom.xml new file mode 100644 index 000000000..f1fb57c6c --- /dev/null +++ b/prometheus-metrics-instrumentation-caffeine/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-instrumentation-caffeine + bundle + + Prometheus Metrics Instrumentation - Caffeine + + Instrumentation library for caffeine based caches + + + + io.prometheus.metrics.instrumentation.caffeine + + + + + pheyken + Petar Heyken + mail@petar-heyken.de + + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + com.github.ben-manes.caffeine + caffeine + 3.2.3 + provided + + + + + io.prometheus + prometheus-metrics-exposition-textformats + ${project.version} + test + + + + diff --git a/prometheus-metrics-instrumentation-caffeine/src/main/java/io/prometheus/metrics/instrumentation/caffeine/CacheMetricsCollector.java b/prometheus-metrics-instrumentation-caffeine/src/main/java/io/prometheus/metrics/instrumentation/caffeine/CacheMetricsCollector.java new file mode 100644 index 000000000..a1b8782a3 --- /dev/null +++ b/prometheus-metrics-instrumentation-caffeine/src/main/java/io/prometheus/metrics/instrumentation/caffeine/CacheMetricsCollector.java @@ -0,0 +1,349 @@ +package io.prometheus.metrics.instrumentation.caffeine; + +import com.github.benmanes.caffeine.cache.AsyncCache; +import com.github.benmanes.caffeine.cache.Cache; +import com.github.benmanes.caffeine.cache.LoadingCache; +import com.github.benmanes.caffeine.cache.Policy; +import com.github.benmanes.caffeine.cache.stats.CacheStats; +import io.prometheus.metrics.model.registry.MultiCollector; +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.stream.Collectors; + +/** + * Collect metrics from Caffeine's com.github.benmanes.caffeine.cache.Cache. + * + *

    + * + *

    {@code
    + * // Note that `recordStats()` is required to gather non-zero statistics
    + * Cache cache = Caffeine.newBuilder().recordStats().build();
    + * CacheMetricsCollector cacheMetrics = CacheMetricsCollector.builder().build();
    + * PrometheusRegistry.defaultRegistry.register(cacheMetrics);
    + * cacheMetrics.addCache("mycache", cache);
    + *
    + * }
    + * + * Exposed metrics are labeled with the provided cache name. + * + *

    With the example above, sample metric names would be: + * + *

    + *     caffeine_cache_hit_total{cache="mycache"} 10.0
    + *     caffeine_cache_miss_total{cache="mycache"} 3.0
    + *     caffeine_cache_requests_total{cache="mycache"} 13.0
    + *     caffeine_cache_eviction_total{cache="mycache"} 1.0
    + *     caffeine_cache_estimated_size{cache="mycache"} 5.0
    + * 
    + * + * Additionally, if the cache includes a loader, the following metrics would be provided: + * + *
    + *     caffeine_cache_load_failure_total{cache="mycache"} 2.0
    + *     caffeine_cache_loads_total{cache="mycache"} 7.0
    + *     caffeine_cache_load_duration_seconds_count{cache="mycache"} 7.0
    + *     caffeine_cache_load_duration_seconds_sum{cache="mycache"} 0.0034
    + * 
    + */ +public class CacheMetricsCollector implements MultiCollector { + private static final double NANOSECONDS_PER_SECOND = 1_000_000_000.0; + + private static final String METRIC_NAME_CACHE_HIT = "caffeine_cache_hit"; + private static final String METRIC_NAME_CACHE_MISS = "caffeine_cache_miss"; + private static final String METRIC_NAME_CACHE_REQUESTS = "caffeine_cache_requests"; + private static final String METRIC_NAME_CACHE_EVICTION = "caffeine_cache_eviction"; + private static final String METRIC_NAME_CACHE_EVICTION_WEIGHT = "caffeine_cache_eviction_weight"; + private static final String METRIC_NAME_CACHE_LOAD_FAILURE = "caffeine_cache_load_failure"; + private static final String METRIC_NAME_CACHE_LOADS = "caffeine_cache_loads"; + private static final String METRIC_NAME_CACHE_ESTIMATED_SIZE = "caffeine_cache_estimated_size"; + private static final String METRIC_NAME_CACHE_WEIGHTED_SIZE = "caffeine_cache_weighted_size"; + private static final String METRIC_NAME_CACHE_LOAD_DURATION_SECONDS = + "caffeine_cache_load_duration_seconds"; + + private static final List ALL_METRIC_NAMES = + Collections.unmodifiableList( + Arrays.asList( + METRIC_NAME_CACHE_HIT, + METRIC_NAME_CACHE_MISS, + METRIC_NAME_CACHE_REQUESTS, + METRIC_NAME_CACHE_EVICTION, + METRIC_NAME_CACHE_EVICTION_WEIGHT, + METRIC_NAME_CACHE_LOAD_FAILURE, + METRIC_NAME_CACHE_LOADS, + METRIC_NAME_CACHE_ESTIMATED_SIZE, + METRIC_NAME_CACHE_WEIGHTED_SIZE, + METRIC_NAME_CACHE_LOAD_DURATION_SECONDS)); + + protected final ConcurrentMap> children = new ConcurrentHashMap<>(); + private final boolean collectEvictionWeightAsCounter; + private final boolean collectWeightedSize; + + /** + * Instantiates a {@link CacheMetricsCollector}, with the legacy parameters. + * + *

    The use of this constructor is discouraged, in favor of a Builder pattern {@link #builder()} + * + *

    Note that the {@link #builder()} API has different default values than this deprecated + * constructor. + */ + @Deprecated + public CacheMetricsCollector() { + this(false, false); + } + + /** + * Instantiate a {@link CacheMetricsCollector} + * + * @param collectEvictionWeightAsCounter If true, {@code caffeine_cache_eviction_weight} will be + * observed as an incrementing counter instead of a gauge. + * @param collectWeightedSize If true, {@code caffeine_cache_weighted_size} will be observed. + */ + protected CacheMetricsCollector( + boolean collectEvictionWeightAsCounter, boolean collectWeightedSize) { + this.collectEvictionWeightAsCounter = collectEvictionWeightAsCounter; + this.collectWeightedSize = collectWeightedSize; + } + + /** + * Add or replace the cache with the given name. + * + *

    Any references any previous cache with this name is invalidated. + * + * @param cacheName The name of the cache, will be the metrics label value + * @param cache The cache being monitored + */ + public void addCache(String cacheName, Cache cache) { + children.put(cacheName, cache); + } + + /** + * Add or replace the cache with the given name. + * + *

    Any references any previous cache with this name is invalidated. + * + * @param cacheName The name of the cache, will be the metrics label value + * @param cache The cache being monitored + */ + public void addCache(String cacheName, AsyncCache cache) { + children.put(cacheName, cache.synchronous()); + } + + /** + * Remove the cache with the given name. + * + *

    Any references to the cache are invalidated. + * + * @param cacheName cache to be removed + */ + public Cache removeCache(String cacheName) { + return children.remove(cacheName); + } + + /** + * Remove all caches. + * + *

    Any references to all caches are invalidated. + */ + public void clear() { + children.clear(); + } + + @Override + public MetricSnapshots collect() { + final MetricSnapshots.Builder metricSnapshotsBuilder = MetricSnapshots.builder(); + final List labelNames = Arrays.asList("cache"); + + final CounterSnapshot.Builder cacheHitTotal = + CounterSnapshot.builder().name(METRIC_NAME_CACHE_HIT).help("Cache hit totals"); + + final CounterSnapshot.Builder cacheMissTotal = + CounterSnapshot.builder().name(METRIC_NAME_CACHE_MISS).help("Cache miss totals"); + + final CounterSnapshot.Builder cacheRequestsTotal = + CounterSnapshot.builder() + .name(METRIC_NAME_CACHE_REQUESTS) + .help("Cache request totals, hits + misses"); + + final CounterSnapshot.Builder cacheEvictionTotal = + CounterSnapshot.builder() + .name(METRIC_NAME_CACHE_EVICTION) + .help("Cache eviction totals, doesn't include manually removed entries"); + + final CounterSnapshot.Builder cacheEvictionWeight = + CounterSnapshot.builder() + .name(METRIC_NAME_CACHE_EVICTION_WEIGHT) + .help("Weight of evicted cache entries, doesn't include manually removed entries"); + final GaugeSnapshot.Builder cacheEvictionWeightLegacyGauge = + GaugeSnapshot.builder() + .name(METRIC_NAME_CACHE_EVICTION_WEIGHT) + .help("Weight of evicted cache entries, doesn't include manually removed entries"); + + final CounterSnapshot.Builder cacheLoadFailure = + CounterSnapshot.builder().name(METRIC_NAME_CACHE_LOAD_FAILURE).help("Cache load failures"); + + final CounterSnapshot.Builder cacheLoadTotal = + CounterSnapshot.builder() + .name(METRIC_NAME_CACHE_LOADS) + .help("Cache loads: both success and failures"); + + final GaugeSnapshot.Builder cacheSize = + GaugeSnapshot.builder().name(METRIC_NAME_CACHE_ESTIMATED_SIZE).help("Estimated cache size"); + + final GaugeSnapshot.Builder cacheWeightedSize = + GaugeSnapshot.builder() + .name(METRIC_NAME_CACHE_WEIGHTED_SIZE) + .help("Approximate accumulated weight of cache entries"); + + final SummarySnapshot.Builder cacheLoadSummary = + SummarySnapshot.builder() + .name(METRIC_NAME_CACHE_LOAD_DURATION_SECONDS) + .help("Cache load duration: both success and failures"); + + for (final Map.Entry> c : children.entrySet()) { + final List cacheName = Collections.singletonList(c.getKey()); + final Labels labels = Labels.of(labelNames, cacheName); + + final CacheStats stats = c.getValue().stats(); + + try { + cacheEvictionWeight.dataPoint( + CounterSnapshot.CounterDataPointSnapshot.builder() + .labels(labels) + .value(stats.evictionWeight()) + .build()); + cacheEvictionWeightLegacyGauge.dataPoint( + GaugeSnapshot.GaugeDataPointSnapshot.builder() + .labels(labels) + .value(stats.evictionWeight()) + .build()); + } catch (Exception e) { + // EvictionWeight metric is unavailable, newer version of Caffeine is needed. + } + + if (collectWeightedSize) { + final Optional> eviction = c.getValue().policy().eviction(); + if (eviction.isPresent() && eviction.get().weightedSize().isPresent()) { + cacheWeightedSize.dataPoint( + GaugeSnapshot.GaugeDataPointSnapshot.builder() + .labels(labels) + .value(eviction.get().weightedSize().getAsLong()) + .build()); + } + } + + cacheHitTotal.dataPoint( + CounterSnapshot.CounterDataPointSnapshot.builder() + .labels(labels) + .value(stats.hitCount()) + .build()); + + cacheMissTotal.dataPoint( + CounterSnapshot.CounterDataPointSnapshot.builder() + .labels(labels) + .value(stats.missCount()) + .build()); + + cacheRequestsTotal.dataPoint( + CounterSnapshot.CounterDataPointSnapshot.builder() + .labels(labels) + .value(stats.requestCount()) + .build()); + + cacheEvictionTotal.dataPoint( + CounterSnapshot.CounterDataPointSnapshot.builder() + .labels(labels) + .value(stats.evictionCount()) + .build()); + + cacheSize.dataPoint( + GaugeSnapshot.GaugeDataPointSnapshot.builder() + .labels(labels) + .value(c.getValue().estimatedSize()) + .build()); + + if (c.getValue() instanceof LoadingCache) { + cacheLoadFailure.dataPoint( + CounterSnapshot.CounterDataPointSnapshot.builder() + .labels(labels) + .value(stats.loadFailureCount()) + .build()); + + cacheLoadTotal.dataPoint( + CounterSnapshot.CounterDataPointSnapshot.builder() + .labels(labels) + .value(stats.loadCount()) + .build()); + + cacheLoadSummary.dataPoint( + SummarySnapshot.SummaryDataPointSnapshot.builder() + .labels(labels) + .count(stats.loadCount()) + .sum(stats.totalLoadTime() / NANOSECONDS_PER_SECOND) + .build()); + } + } + + if (collectWeightedSize) { + metricSnapshotsBuilder.metricSnapshot(cacheWeightedSize.build()); + } + + return metricSnapshotsBuilder + .metricSnapshot(cacheHitTotal.build()) + .metricSnapshot(cacheMissTotal.build()) + .metricSnapshot(cacheRequestsTotal.build()) + .metricSnapshot(cacheEvictionTotal.build()) + .metricSnapshot( + collectEvictionWeightAsCounter + ? cacheEvictionWeight.build() + : cacheEvictionWeightLegacyGauge.build()) + .metricSnapshot(cacheLoadFailure.build()) + .metricSnapshot(cacheLoadTotal.build()) + .metricSnapshot(cacheSize.build()) + .metricSnapshot(cacheLoadSummary.build()) + .build(); + } + + @Override + public List getPrometheusNames() { + if (!collectWeightedSize) { + return ALL_METRIC_NAMES.stream() + .filter(s -> !METRIC_NAME_CACHE_WEIGHTED_SIZE.equals(s)) + .collect(Collectors.toList()); + } + return ALL_METRIC_NAMES; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + private boolean collectEvictionWeightAsCounter = true; + private boolean collectWeightedSize = true; + + public Builder collectEvictionWeightAsCounter(boolean collectEvictionWeightAsCounter) { + this.collectEvictionWeightAsCounter = collectEvictionWeightAsCounter; + return this; + } + + public Builder collectWeightedSize(boolean collectWeightedSize) { + this.collectWeightedSize = collectWeightedSize; + return this; + } + + public CacheMetricsCollector build() { + return new CacheMetricsCollector(collectEvictionWeightAsCounter, collectWeightedSize); + } + } +} diff --git a/prometheus-metrics-instrumentation-caffeine/src/test/java/io/prometheus/metrics/instrumentation/caffeine/CacheMetricsCollectorTest.java b/prometheus-metrics-instrumentation-caffeine/src/test/java/io/prometheus/metrics/instrumentation/caffeine/CacheMetricsCollectorTest.java new file mode 100644 index 000000000..3a7b634a7 --- /dev/null +++ b/prometheus-metrics-instrumentation-caffeine/src/test/java/io/prometheus/metrics/instrumentation/caffeine/CacheMetricsCollectorTest.java @@ -0,0 +1,321 @@ +package io.prometheus.metrics.instrumentation.caffeine; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import com.github.benmanes.caffeine.cache.Cache; +import com.github.benmanes.caffeine.cache.CacheLoader; +import com.github.benmanes.caffeine.cache.Caffeine; +import com.github.benmanes.caffeine.cache.LoadingCache; +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.expositionformats.OpenMetricsTextFormatWriter; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.*; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.util.List; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.EnumSource; + +@SuppressWarnings("CheckReturnValue") +class CacheMetricsCollectorTest { + // This enum was added to simplify test parametrization on argument options. + public enum Options { + LEGACY(false, false), + COLLECT_EVICTION_WEIGHT_AS_COUNTER(true, false), + COLLECT_WEIGHTED_SIZE(false, true), + BUILDER_DEFAULT(true, true); + + private final boolean collectEvictionWeightAsCounter; + private final boolean collectWeightedSize; + + Options(boolean collectEvictionWeightAsCounter, boolean collectWeightedSize) { + this.collectEvictionWeightAsCounter = collectEvictionWeightAsCounter; + this.collectWeightedSize = collectWeightedSize; + } + } + + @ParameterizedTest + @EnumSource + public void cacheExposesMetricsForHitMissAndEviction(Options options) { + // Run cleanup in same thread, to remove async behavior with evictions + final Cache cache = + Caffeine.newBuilder().maximumSize(2).recordStats().executor(Runnable::run).build(); + + final CacheMetricsCollector collector = + CacheMetricsCollector.builder() + .collectEvictionWeightAsCounter(options.collectEvictionWeightAsCounter) + .collectWeightedSize(options.collectWeightedSize) + .build(); + collector.addCache("users", cache); + + final PrometheusRegistry registry = new PrometheusRegistry(); + registry.register(collector); + + cache.getIfPresent("user1"); + cache.getIfPresent("user1"); + cache.put("user1", "First User"); + cache.getIfPresent("user1"); + + // Add to cache to trigger eviction. + cache.put("user2", "Second User"); + cache.put("user3", "Third User"); + cache.put("user4", "Fourth User"); + + assertCounterMetric(registry, "caffeine_cache_hit", "users", 1.0); + assertCounterMetric(registry, "caffeine_cache_miss", "users", 2.0); + assertCounterMetric(registry, "caffeine_cache_requests", "users", 3.0); + assertCounterMetric(registry, "caffeine_cache_eviction", "users", 2.0); + String openMetricEvictionWeightExpectedText; + if (options.collectEvictionWeightAsCounter) { + assertCounterMetric(registry, "caffeine_cache_eviction_weight", "users", 2.0); + openMetricEvictionWeightExpectedText = +""" +# TYPE caffeine_cache_eviction_weight counter +# HELP caffeine_cache_eviction_weight Weight of evicted cache entries, doesn't include manually removed entries +caffeine_cache_eviction_weight_total{cache="users"} 2.0 +"""; + } else { + assertGaugeMetric(registry, "caffeine_cache_eviction_weight", "users", 2.0); + openMetricEvictionWeightExpectedText = +""" +# TYPE caffeine_cache_eviction_weight gauge +# HELP caffeine_cache_eviction_weight Weight of evicted cache entries, doesn't include manually removed entries +caffeine_cache_eviction_weight{cache="users"} 2.0 +"""; + } + + final String expected = + "# TYPE caffeine_cache_estimated_size gauge\n" + + "# HELP caffeine_cache_estimated_size Estimated cache size\n" + + "caffeine_cache_estimated_size{cache=\"users\"} 2.0\n" + + "# TYPE caffeine_cache_eviction counter\n" + + "# HELP caffeine_cache_eviction Cache eviction totals, doesn't include manually" + + " removed entries\n" + + "caffeine_cache_eviction_total{cache=\"users\"} 2.0\n" + + openMetricEvictionWeightExpectedText + + "# TYPE caffeine_cache_hit counter\n" + + "# HELP caffeine_cache_hit Cache hit totals\n" + + "caffeine_cache_hit_total{cache=\"users\"} 1.0\n" + + "# TYPE caffeine_cache_miss counter\n" + + "# HELP caffeine_cache_miss Cache miss totals\n" + + "caffeine_cache_miss_total{cache=\"users\"} 2.0\n" + + "# TYPE caffeine_cache_requests counter\n" + + "# HELP caffeine_cache_requests Cache request totals, hits + misses\n" + + "caffeine_cache_requests_total{cache=\"users\"} 3.0\n" + + "# EOF\n"; + + assertThat(convertToOpenMetricsFormat(registry)).isEqualTo(expected); + } + + @ParameterizedTest + @EnumSource + public void weightedCacheExposesMetricsForHitMissAndEvictionWeightedSize(Options options) { + // Run cleanup in same thread, to remove async behavior with evictions + final Cache cache = + Caffeine.newBuilder() + .weigher((String k, String v) -> k.length() + v.length()) + .maximumWeight(35) + .recordStats() + .executor(Runnable::run) + .build(); + + final CacheMetricsCollector collector = + CacheMetricsCollector.builder() + .collectEvictionWeightAsCounter(options.collectEvictionWeightAsCounter) + .collectWeightedSize(options.collectWeightedSize) + .build(); + collector.addCache("users", cache); + + final PrometheusRegistry registry = new PrometheusRegistry(); + registry.register(collector); + + cache.getIfPresent("user1"); + cache.getIfPresent("user1"); + cache.put("user1", "First User"); + cache.getIfPresent("user1"); + + // Add to cache to trigger eviction. + cache.put("user2", "Second User"); + cache.put("user3", "Third User"); + cache.put("user4", "Fourth User"); + + assertCounterMetric(registry, "caffeine_cache_hit", "users", 1.0); + assertCounterMetric(registry, "caffeine_cache_miss", "users", 2.0); + assertCounterMetric(registry, "caffeine_cache_requests", "users", 3.0); + assertCounterMetric(registry, "caffeine_cache_eviction", "users", 2.0); + String openMetricEvictionWeightExpectedText; + if (options.collectEvictionWeightAsCounter) { + assertCounterMetric(registry, "caffeine_cache_eviction_weight", "users", 31.0); + openMetricEvictionWeightExpectedText = +""" +# TYPE caffeine_cache_eviction_weight counter +# HELP caffeine_cache_eviction_weight Weight of evicted cache entries, doesn't include manually removed entries +caffeine_cache_eviction_weight_total{cache="users"} 31.0 +"""; + } else { + assertGaugeMetric(registry, "caffeine_cache_eviction_weight", "users", 31.0); + openMetricEvictionWeightExpectedText = +""" +# TYPE caffeine_cache_eviction_weight gauge +# HELP caffeine_cache_eviction_weight Weight of evicted cache entries, doesn't include manually removed entries +caffeine_cache_eviction_weight{cache="users"} 31.0 +"""; + } + String openMetricWeightedSizeExpectedText; + if (options.collectWeightedSize) { + openMetricWeightedSizeExpectedText = + """ + # TYPE caffeine_cache_weighted_size gauge + # HELP caffeine_cache_weighted_size Approximate accumulated weight of cache entries + caffeine_cache_weighted_size{cache="users"} 31.0 + """; + } else { + openMetricWeightedSizeExpectedText = ""; + } + + final String expected = + "# TYPE caffeine_cache_estimated_size gauge\n" + + "# HELP caffeine_cache_estimated_size Estimated cache size\n" + + "caffeine_cache_estimated_size{cache=\"users\"} 2.0\n" + + "# TYPE caffeine_cache_eviction counter\n" + + "# HELP caffeine_cache_eviction Cache eviction totals, doesn't include manually" + + " removed entries\n" + + "caffeine_cache_eviction_total{cache=\"users\"} 2.0\n" + + openMetricEvictionWeightExpectedText + + "# TYPE caffeine_cache_hit counter\n" + + "# HELP caffeine_cache_hit Cache hit totals\n" + + "caffeine_cache_hit_total{cache=\"users\"} 1.0\n" + + "# TYPE caffeine_cache_miss counter\n" + + "# HELP caffeine_cache_miss Cache miss totals\n" + + "caffeine_cache_miss_total{cache=\"users\"} 2.0\n" + + "# TYPE caffeine_cache_requests counter\n" + + "# HELP caffeine_cache_requests Cache request totals, hits + misses\n" + + "caffeine_cache_requests_total{cache=\"users\"} 3.0\n" + + openMetricWeightedSizeExpectedText + + "# EOF\n"; + + assertThat(convertToOpenMetricsFormat(registry)).isEqualTo(expected); + } + + @SuppressWarnings("unchecked") + @Test + public void loadingCacheExposesMetricsForLoadsAndExceptions() throws Exception { + final CacheLoader loader = mock(CacheLoader.class); + when(loader.load(anyString())) + .thenReturn("First User") + .thenThrow(new RuntimeException("Seconds time fails")) + .thenReturn("Third User"); + + final LoadingCache cache = Caffeine.newBuilder().recordStats().build(loader); + final CacheMetricsCollector collector = CacheMetricsCollector.builder().build(); + + collector.addCache("loadingusers", cache); + + final PrometheusRegistry registry = new PrometheusRegistry(); + registry.register(collector); + + cache.get("user1"); + cache.get("user1"); + try { + cache.get("user2"); + } catch (Exception e) { + // ignoring. + } + cache.get("user3"); + + assertCounterMetric(registry, "caffeine_cache_hit", "loadingusers", 1.0); + assertCounterMetric(registry, "caffeine_cache_miss", "loadingusers", 3.0); + + assertCounterMetric(registry, "caffeine_cache_load_failure", "loadingusers", 1.0); + assertCounterMetric(registry, "caffeine_cache_loads", "loadingusers", 3.0); + + final SummarySnapshot.SummaryDataPointSnapshot loadDuration = + (SummarySnapshot.SummaryDataPointSnapshot) + getDataPointSnapshot(registry, "caffeine_cache_load_duration_seconds", "loadingusers"); + + assertThat(loadDuration.getCount()).isEqualTo(3); + assertThat(loadDuration.getSum()).isGreaterThan(0); + } + + @ParameterizedTest + @EnumSource + public void getPrometheusNamesHasSameSizeAsMetricSizeWhenScraping(Options options) { + final CacheMetricsCollector collector = + CacheMetricsCollector.builder() + .collectEvictionWeightAsCounter(options.collectEvictionWeightAsCounter) + .collectWeightedSize(options.collectWeightedSize) + .build(); + + final PrometheusRegistry registry = new PrometheusRegistry(); + registry.register(collector); + + final MetricSnapshots metricSnapshots = registry.scrape(); + final List prometheusNames = collector.getPrometheusNames(); + + assertThat(prometheusNames).hasSize(metricSnapshots.size()); + } + + @ParameterizedTest + @EnumSource + public void collectedMetricNamesAreKnownPrometheusNames(Options options) { + final CacheMetricsCollector collector = + CacheMetricsCollector.builder() + .collectEvictionWeightAsCounter(options.collectEvictionWeightAsCounter) + .collectWeightedSize(options.collectWeightedSize) + .build(); + + final PrometheusRegistry registry = new PrometheusRegistry(); + registry.register(collector); + + final MetricSnapshots metricSnapshots = registry.scrape(); + final List prometheusNames = collector.getPrometheusNames(); + + metricSnapshots.forEach( + metricSnapshot -> + assertThat(prometheusNames).contains(metricSnapshot.getMetadata().getPrometheusName())); + } + + private void assertCounterMetric( + PrometheusRegistry registry, String name, String cacheName, double value) { + final CounterSnapshot.CounterDataPointSnapshot dataPointSnapshot = + (CounterSnapshot.CounterDataPointSnapshot) getDataPointSnapshot(registry, name, cacheName); + + assertThat(dataPointSnapshot.getValue()).isEqualTo(value); + } + + private void assertGaugeMetric( + PrometheusRegistry registry, String name, String cacheName, double value) { + final GaugeSnapshot.GaugeDataPointSnapshot dataPointSnapshot = + (GaugeSnapshot.GaugeDataPointSnapshot) getDataPointSnapshot(registry, name, cacheName); + + assertThat(dataPointSnapshot.getValue()).isEqualTo(value); + } + + private DataPointSnapshot getDataPointSnapshot( + PrometheusRegistry registry, String name, String cacheName) { + final Labels labels = Labels.of(new String[] {"cache"}, new String[] {cacheName}); + + return registry.scrape(name::equals).stream() + .flatMap(metricSnapshot -> metricSnapshot.getDataPoints().stream()) + .filter(dataPoint -> dataPoint.getLabels().equals(labels)) + .findFirst() + .get(); + } + + private String convertToOpenMetricsFormat(PrometheusRegistry registry) { + final ByteArrayOutputStream out = new ByteArrayOutputStream(); + final OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter(true, true); + try { + writer.write(out, registry.scrape(), EscapingScheme.ALLOW_UTF8); + return out.toString(StandardCharsets.UTF_8.name()); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } +} diff --git a/prometheus-metrics-instrumentation-caffeine/version-rules.xml b/prometheus-metrics-instrumentation-caffeine/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-instrumentation-caffeine/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-instrumentation-dropwizard/pom.xml b/prometheus-metrics-instrumentation-dropwizard/pom.xml new file mode 100644 index 000000000..d98fdc6b7 --- /dev/null +++ b/prometheus-metrics-instrumentation-dropwizard/pom.xml @@ -0,0 +1,72 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-instrumentation-dropwizard + bundle + + Prometheus Metrics Instrumentation - Dropwizard 4.x + + Instrumentation library for Dropwizard metrics 4.x + + + + io.prometheus.metrics.instrumentation.dropwizard + + + + + kingster + Kinshuk Bairagi + hi@kinsh.uk + + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + io.dropwizard.metrics + metrics-core + 4.2.37 + provided + + + + io.prometheus + prometheus-metrics-exporter-httpserver + ${project.version} + test + + + io.prometheus + prometheus-metrics-exposition-textformats + ${project.version} + test + + + io.prometheus + prometheus-metrics-instrumentation-dropwizard5 + ${project.version} + compile + + + io.dropwizard.metrics5 + metrics-core + + + + + + + diff --git a/prometheus-metrics-instrumentation-dropwizard/src/main/java/io/prometheus/metrics/instrumentation/dropwizard/DropwizardExports.java b/prometheus-metrics-instrumentation-dropwizard/src/main/java/io/prometheus/metrics/instrumentation/dropwizard/DropwizardExports.java new file mode 100644 index 000000000..4ab03341e --- /dev/null +++ b/prometheus-metrics-instrumentation-dropwizard/src/main/java/io/prometheus/metrics/instrumentation/dropwizard/DropwizardExports.java @@ -0,0 +1,297 @@ +package io.prometheus.metrics.instrumentation.dropwizard; + +import com.codahale.metrics.Counter; +import com.codahale.metrics.Gauge; +import com.codahale.metrics.Histogram; +import com.codahale.metrics.Meter; +import com.codahale.metrics.Metric; +import com.codahale.metrics.MetricFilter; +import com.codahale.metrics.MetricRegistry; +import com.codahale.metrics.Snapshot; +import com.codahale.metrics.Timer; +import io.prometheus.metrics.instrumentation.dropwizard5.InvalidMetricHandler; +import io.prometheus.metrics.instrumentation.dropwizard5.labels.CustomLabelMapper; +import io.prometheus.metrics.model.registry.MultiCollector; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import io.prometheus.metrics.model.snapshots.MetricMetadata; +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import io.prometheus.metrics.model.snapshots.PrometheusNaming; +import io.prometheus.metrics.model.snapshots.Quantiles; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import java.util.Collections; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.function.BiFunction; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +/** Collect Dropwizard metrics from a MetricRegistry. */ +public class DropwizardExports implements MultiCollector { + private static final Logger logger = Logger.getLogger(DropwizardExports.class.getName()); + private final MetricRegistry registry; + private final MetricFilter metricFilter; + @Nullable private final CustomLabelMapper labelMapper; + private final InvalidMetricHandler invalidMetricHandler; + + /** + * Creates a new DropwizardExports and {@link MetricFilter#ALL}. + * + * @param registry a metric registry to export in prometheus. + */ + public DropwizardExports(MetricRegistry registry) { + super(); + this.registry = registry; + this.metricFilter = MetricFilter.ALL; + this.labelMapper = null; + this.invalidMetricHandler = InvalidMetricHandler.ALWAYS_THROW; + } + + /** + * Creates a new DropwizardExports with a custom {@link MetricFilter}. + * + * @param registry a metric registry to export in prometheus. + * @param metricFilter a custom metric filter. + */ + public DropwizardExports(MetricRegistry registry, MetricFilter metricFilter) { + this.registry = registry; + this.metricFilter = metricFilter; + this.labelMapper = null; + this.invalidMetricHandler = InvalidMetricHandler.ALWAYS_THROW; + } + + /** + * @param registry a metric registry to export in prometheus. + * @param metricFilter a custom metric filter. + * @param labelMapper a labelMapper to use to map labels. + */ + public DropwizardExports( + MetricRegistry registry, MetricFilter metricFilter, @Nullable CustomLabelMapper labelMapper) { + this.registry = registry; + this.metricFilter = metricFilter; + this.labelMapper = labelMapper; + this.invalidMetricHandler = InvalidMetricHandler.ALWAYS_THROW; + } + + /** + * @param registry a metric registry to export in prometheus. + * @param metricFilter a custom metric filter. + * @param labelMapper a labelMapper to use to map labels. + */ + private DropwizardExports( + MetricRegistry registry, + MetricFilter metricFilter, + @Nullable CustomLabelMapper labelMapper, + InvalidMetricHandler invalidMetricHandler) { + this.registry = registry; + this.metricFilter = metricFilter; + this.labelMapper = labelMapper; + this.invalidMetricHandler = invalidMetricHandler; + } + + private static String getHelpMessage(String metricName, Metric metric) { + return String.format( + "Generated from Dropwizard metric import (metric=%s, type=%s)", + metricName, metric.getClass().getName()); + } + + private MetricMetadata getMetricMetaData(String metricName, Metric metric) { + String name = labelMapper != null ? labelMapper.getName(metricName) : metricName; + return new MetricMetadata( + PrometheusNaming.sanitizeMetricName(name), getHelpMessage(metricName, metric)); + } + + /** + * Export counter as Prometheus Gauge. + */ + MetricSnapshot fromCounter(String dropwizardName, Counter counter) { + MetricMetadata metadata = getMetricMetaData(dropwizardName, counter); + CounterSnapshot.CounterDataPointSnapshot.Builder dataPointBuilder = + CounterSnapshot.CounterDataPointSnapshot.builder() + .value(Long.valueOf(counter.getCount()).doubleValue()); + if (labelMapper != null) { + dataPointBuilder.labels( + labelMapper.getLabels(dropwizardName, Collections.emptyList(), Collections.emptyList())); + } + return new CounterSnapshot(metadata, Collections.singletonList(dataPointBuilder.build())); + } + + /** Export gauge as a prometheus gauge. */ + @Nullable + MetricSnapshot fromGauge(String dropwizardName, Gauge gauge) { + Object obj = gauge.getValue(); + double value; + if (obj instanceof Number) { + value = ((Number) obj).doubleValue(); + } else if (obj instanceof Boolean) { + value = ((Boolean) obj) ? 1 : 0; + } else { + logger.log( + Level.FINE, + String.format( + "Invalid type for Gauge %s: %s", + PrometheusNaming.sanitizeMetricName(dropwizardName), + obj == null ? "null" : obj.getClass().getName())); + return null; + } + MetricMetadata metadata = getMetricMetaData(dropwizardName, gauge); + GaugeSnapshot.GaugeDataPointSnapshot.Builder dataPointBuilder = + GaugeSnapshot.GaugeDataPointSnapshot.builder().value(value); + if (labelMapper != null) { + dataPointBuilder.labels( + labelMapper.getLabels(dropwizardName, Collections.emptyList(), Collections.emptyList())); + } + return new GaugeSnapshot(metadata, Collections.singletonList(dataPointBuilder.build())); + } + + /** + * Export a histogram snapshot as a prometheus SUMMARY. + * + * @param dropwizardName metric name. + * @param snapshot the histogram snapshot. + * @param count the total sample count for this snapshot. + * @param factor a factor to apply to histogram values. + */ + MetricSnapshot fromSnapshotAndCount( + String dropwizardName, Snapshot snapshot, long count, double factor, String helpMessage) { + Quantiles quantiles = + Quantiles.builder() + .quantile(0.5, snapshot.getMedian() * factor) + .quantile(0.75, snapshot.get75thPercentile() * factor) + .quantile(0.95, snapshot.get95thPercentile() * factor) + .quantile(0.98, snapshot.get98thPercentile() * factor) + .quantile(0.99, snapshot.get99thPercentile() * factor) + .quantile(0.999, snapshot.get999thPercentile() * factor) + .build(); + + String name = labelMapper != null ? labelMapper.getName(dropwizardName) : dropwizardName; + MetricMetadata metadata = + new MetricMetadata(PrometheusNaming.sanitizeMetricName(name), helpMessage); + SummarySnapshot.SummaryDataPointSnapshot.Builder dataPointBuilder = + SummarySnapshot.SummaryDataPointSnapshot.builder().quantiles(quantiles).count(count); + if (labelMapper != null) { + dataPointBuilder.labels( + labelMapper.getLabels(dropwizardName, Collections.emptyList(), Collections.emptyList())); + } + return new SummarySnapshot(metadata, Collections.singletonList(dataPointBuilder.build())); + } + + /** Convert histogram snapshot. */ + MetricSnapshot fromHistogram(String dropwizardName, Histogram histogram) { + return fromSnapshotAndCount( + dropwizardName, + histogram.getSnapshot(), + histogram.getCount(), + 1.0, + getHelpMessage(dropwizardName, histogram)); + } + + /** Export Dropwizard Timer as a histogram. Use TIME_UNIT as time unit. */ + MetricSnapshot fromTimer(String dropwizardName, Timer timer) { + return fromSnapshotAndCount( + dropwizardName, + timer.getSnapshot(), + timer.getCount(), + 1.0D / TimeUnit.SECONDS.toNanos(1L), + getHelpMessage(dropwizardName, timer)); + } + + /** Export a Meter as a prometheus COUNTER. */ + MetricSnapshot fromMeter(String dropwizardName, Meter meter) { + MetricMetadata metadata = getMetricMetaData(dropwizardName + "_total", meter); + CounterSnapshot.CounterDataPointSnapshot.Builder dataPointBuilder = + CounterSnapshot.CounterDataPointSnapshot.builder().value(meter.getCount()); + if (labelMapper != null) { + dataPointBuilder.labels( + labelMapper.getLabels(dropwizardName, Collections.emptyList(), Collections.emptyList())); + } + return new CounterSnapshot(metadata, Collections.singletonList(dataPointBuilder.build())); + } + + @Override + public MetricSnapshots collect() { + MetricSnapshots.Builder metricSnapshots = MetricSnapshots.builder(); + collectMetricKind(metricSnapshots, registry.getGauges(metricFilter), this::fromGauge); + collectMetricKind(metricSnapshots, registry.getCounters(metricFilter), this::fromCounter); + collectMetricKind(metricSnapshots, registry.getHistograms(metricFilter), this::fromHistogram); + collectMetricKind(metricSnapshots, registry.getTimers(metricFilter), this::fromTimer); + collectMetricKind(metricSnapshots, registry.getMeters(metricFilter), this::fromMeter); + return metricSnapshots.build(); + } + + private void collectMetricKind( + MetricSnapshots.Builder builder, + Map metric, + BiFunction toSnapshot) { + for (Map.Entry entry : metric.entrySet()) { + String metricName = entry.getKey(); + try { + MetricSnapshot snapshot = toSnapshot.apply(metricName, entry.getValue()); + if (snapshot != null) { + builder.metricSnapshot(snapshot); + } + } catch (Exception e) { + if (!invalidMetricHandler.suppressException(metricName, e)) { + throw e; + } + } + } + } + + public static Builder builder() { + return new Builder(); + } + + // Builder class for DropwizardExports + public static class Builder { + @Nullable private MetricRegistry registry; + private MetricFilter metricFilter; + @Nullable private CustomLabelMapper labelMapper; + private InvalidMetricHandler invalidMetricHandler; + + private Builder() { + this.metricFilter = MetricFilter.ALL; + this.invalidMetricHandler = InvalidMetricHandler.ALWAYS_THROW; + } + + public Builder dropwizardRegistry(MetricRegistry registry) { + this.registry = registry; + return this; + } + + public Builder metricFilter(MetricFilter metricFilter) { + this.metricFilter = metricFilter; + return this; + } + + public Builder customLabelMapper(CustomLabelMapper labelMapper) { + this.labelMapper = labelMapper; + return this; + } + + public Builder invalidMetricHandler(InvalidMetricHandler invalidMetricHandler) { + this.invalidMetricHandler = invalidMetricHandler; + return this; + } + + DropwizardExports build() { + if (registry == null) { + throw new IllegalArgumentException("MetricRegistry must be set"); + } + return new DropwizardExports(registry, metricFilter, labelMapper, invalidMetricHandler); + } + + public void register() { + register(PrometheusRegistry.defaultRegistry); + } + + public void register(PrometheusRegistry registry) { + DropwizardExports dropwizardExports = build(); + registry.register(dropwizardExports); + } + } +} diff --git a/prometheus-metrics-instrumentation-dropwizard/src/test/java/io/prometheus/metrics/instrumentation/dropwizard/DropwizardExportsTest.java b/prometheus-metrics-instrumentation-dropwizard/src/test/java/io/prometheus/metrics/instrumentation/dropwizard/DropwizardExportsTest.java new file mode 100644 index 000000000..ba5407942 --- /dev/null +++ b/prometheus-metrics-instrumentation-dropwizard/src/test/java/io/prometheus/metrics/instrumentation/dropwizard/DropwizardExportsTest.java @@ -0,0 +1,354 @@ +package io.prometheus.metrics.instrumentation.dropwizard; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatCode; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +import com.codahale.metrics.*; +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.expositionformats.OpenMetricsTextFormatWriter; +import io.prometheus.metrics.instrumentation.dropwizard5.InvalidMetricHandler; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class DropwizardExportsTest { + + private final PrometheusRegistry registry = new PrometheusRegistry(); + private MetricRegistry metricRegistry; + + @BeforeEach + public void setUp() { + metricRegistry = new MetricRegistry(); + DropwizardExports.builder() + .dropwizardRegistry(metricRegistry) + .metricFilter(MetricFilter.ALL) + .register(registry); + } + + @Test + public void testBuilderThrowsErrorOnNullRegistry() { + assertThatThrownBy( + () -> DropwizardExports.builder().dropwizardRegistry(null).register(registry)) + .isInstanceOf(IllegalArgumentException.class); + } + + @Test + public void testBuilderCreatesOkay() { + assertThatCode( + () -> DropwizardExports.builder().dropwizardRegistry(metricRegistry).register(registry)) + .doesNotThrowAnyException(); + } + + @Test + public void testCounter() { + metricRegistry.counter("foo.bar").inc(1); + String expected = +""" +# TYPE foo_bar counter +# HELP foo_bar Generated from Dropwizard metric import (metric=foo.bar, type=com.codahale.metrics.Counter) +foo_bar_total 1.0 +# EOF +"""; + + assertThat(convertToOpenMetricsFormat()).isEqualTo(expected); + } + + @Test + public void testGauge() { + // don't convert to lambda, as we need to test the type + Gauge integerGauge = + new Gauge() { + @Override + public Integer getValue() { + return 1234; + } + }; + Gauge doubleGauge = + new Gauge() { + @Override + public Double getValue() { + return 1.234D; + } + }; + Gauge longGauge = + new Gauge() { + @Override + public Long getValue() { + return 1234L; + } + }; + Gauge floatGauge = + new Gauge() { + @Override + public Float getValue() { + return 0.1234F; + } + }; + Gauge booleanGauge = + new Gauge() { + @Override + public Boolean getValue() { + return true; + } + }; + + metricRegistry.register("double.gauge", doubleGauge); + metricRegistry.register("long.gauge", longGauge); + metricRegistry.register("integer.gauge", integerGauge); + metricRegistry.register("float.gauge", floatGauge); + metricRegistry.register("boolean.gauge", booleanGauge); + + String expected = +""" +# TYPE boolean_gauge gauge +# HELP boolean_gauge Generated from Dropwizard metric import (metric=boolean.gauge, type=io.prometheus.metrics.instrumentation.dropwizard.DropwizardExportsTest$5) +boolean_gauge 1.0 +# TYPE double_gauge gauge +# HELP double_gauge Generated from Dropwizard metric import (metric=double.gauge, type=io.prometheus.metrics.instrumentation.dropwizard.DropwizardExportsTest$2) +double_gauge 1.234 +# TYPE float_gauge gauge +# HELP float_gauge Generated from Dropwizard metric import (metric=float.gauge, type=io.prometheus.metrics.instrumentation.dropwizard.DropwizardExportsTest$4) +float_gauge 0.1234000027179718 +# TYPE integer_gauge gauge +# HELP integer_gauge Generated from Dropwizard metric import (metric=integer.gauge, type=io.prometheus.metrics.instrumentation.dropwizard.DropwizardExportsTest$1) +integer_gauge 1234.0 +# TYPE long_gauge gauge +# HELP long_gauge Generated from Dropwizard metric import (metric=long.gauge, type=io.prometheus.metrics.instrumentation.dropwizard.DropwizardExportsTest$3) +long_gauge 1234.0 +# EOF +"""; + + assertThat(convertToOpenMetricsFormat()).isEqualTo(expected); + } + + @Test + public void testInvalidGaugeType() { + Gauge invalidGauge = () -> "foobar"; + + metricRegistry.register("invalid_gauge", invalidGauge); + + String expected = "# EOF\n"; + assertThat(convertToOpenMetricsFormat()).isEqualTo(expected); + } + + @Test + public void testGaugeReturningNullValue() { + Gauge invalidGauge = () -> null; + metricRegistry.register("invalid_gauge", invalidGauge); + String expected = "# EOF\n"; + assertThat(convertToOpenMetricsFormat()).isEqualTo(expected); + } + + @Test + public void testHistogram() { + // just test the standard mapper + final MetricRegistry metricRegistry = new MetricRegistry(); + PrometheusRegistry pmRegistry = new PrometheusRegistry(); + DropwizardExports.builder().dropwizardRegistry(metricRegistry).register(pmRegistry); + + Histogram hist = metricRegistry.histogram("hist"); + int i = 0; + while (i < 100) { + hist.update(i); + i += 1; + } + + // The result should look like this + String expected1 = +""" +# TYPE hist summary +# HELP hist Generated from Dropwizard metric import (metric=hist, type=com.codahale.metrics.Histogram) +hist{quantile="0.5"} 49.0 +hist{quantile="0.75"} 74.0 +hist{quantile="0.95"} 94.0 +hist{quantile="0.98"} 97.0 +hist{quantile="0.99"} 98.0 +hist{quantile="0.999"} 99.0 +hist_count 100 +# EOF +"""; + + // However, Dropwizard uses a random reservoir sampling algorithm, so the values could as well + // be off-by-one + String expected2 = +""" +# TYPE hist summary +# HELP hist Generated from Dropwizard metric import (metric=hist, type=com.codahale.metrics.Histogram) +hist{quantile="0.5"} 50.0 +hist{quantile="0.75"} 75.0 +hist{quantile="0.95"} 95.0 +hist{quantile="0.98"} 98.0 +hist{quantile="0.99"} 99.0 +hist{quantile="0.999"} 99.0 +hist_count 100 +# EOF +"""; + + // The following asserts the values matches either of the expected value. + String textFormat = convertToOpenMetricsFormat(pmRegistry); + assertThat(textFormat) + .satisfiesAnyOf( + text -> assertThat(text).isEqualTo(expected1), + text -> assertThat(text).isEqualTo(expected2)); + } + + @Test + public void testMeter() { + Meter meter = metricRegistry.meter("meter"); + meter.mark(); + meter.mark(); + + String expected = +""" +# TYPE meter counter +# HELP meter Generated from Dropwizard metric import (metric=meter_total, type=com.codahale.metrics.Meter) +meter_total 2.0 +# EOF +"""; + assertThat(convertToOpenMetricsFormat()).isEqualTo(expected); + } + + @Test + public void testTimer() throws InterruptedException { + final MetricRegistry metricRegistry = new MetricRegistry(); + DropwizardExports exports = new DropwizardExports(metricRegistry); + Timer t = metricRegistry.timer("timer"); + Timer.Context time = t.time(); + Thread.sleep(100L); + long timeSpentNanos = time.stop(); + double timeSpentMillis = TimeUnit.NANOSECONDS.toMillis(timeSpentNanos); + + assertThat(exports.collect().stream().flatMap(i1 -> i1.getDataPoints().stream()).findFirst()) + .containsInstanceOf(SummarySnapshot.SummaryDataPointSnapshot.class) + .hasValueSatisfying( + snapshot -> { + var dataPointSnapshot = (SummarySnapshot.SummaryDataPointSnapshot) snapshot; + // We slept for 1Ms so we ensure that all timers are above 1ms: + assertThat(dataPointSnapshot.getQuantiles().size()).isGreaterThan(1); + dataPointSnapshot + .getQuantiles() + .forEach(i -> assertThat(i.getValue()).isGreaterThan(timeSpentMillis / 1000d)); + assertThat(dataPointSnapshot.getCount()).isOne(); + }); + } + + @Test + public void testThatMetricHelpUsesOriginalDropwizardName() { + metricRegistry.timer("my.application.namedTimer1"); + metricRegistry.counter("my.application.namedCounter1"); + metricRegistry.meter("my.application.namedMeter1"); + metricRegistry.histogram("my.application.namedHistogram1"); + metricRegistry.register("my.application.namedGauge1", new ExampleDoubleGauge()); + + String expected = +""" +# TYPE my_application_namedCounter1 counter +# HELP my_application_namedCounter1 Generated from Dropwizard metric import (metric=my.application.namedCounter1, type=com.codahale.metrics.Counter) +my_application_namedCounter1_total 0.0 +# TYPE my_application_namedGauge1 gauge +# HELP my_application_namedGauge1 Generated from Dropwizard metric import (metric=my.application.namedGauge1, type=io.prometheus.metrics.instrumentation.dropwizard.DropwizardExportsTest$ExampleDoubleGauge) +my_application_namedGauge1 0.0 +# TYPE my_application_namedHistogram1 summary +# HELP my_application_namedHistogram1 Generated from Dropwizard metric import (metric=my.application.namedHistogram1, type=com.codahale.metrics.Histogram) +my_application_namedHistogram1{quantile="0.5"} 0.0 +my_application_namedHistogram1{quantile="0.75"} 0.0 +my_application_namedHistogram1{quantile="0.95"} 0.0 +my_application_namedHistogram1{quantile="0.98"} 0.0 +my_application_namedHistogram1{quantile="0.99"} 0.0 +my_application_namedHistogram1{quantile="0.999"} 0.0 +my_application_namedHistogram1_count 0 +# TYPE my_application_namedMeter1 counter +# HELP my_application_namedMeter1 Generated from Dropwizard metric import (metric=my.application.namedMeter1_total, type=com.codahale.metrics.Meter) +my_application_namedMeter1_total 0.0 +# TYPE my_application_namedTimer1 summary +# HELP my_application_namedTimer1 Generated from Dropwizard metric import (metric=my.application.namedTimer1, type=com.codahale.metrics.Timer) +my_application_namedTimer1{quantile="0.5"} 0.0 +my_application_namedTimer1{quantile="0.75"} 0.0 +my_application_namedTimer1{quantile="0.95"} 0.0 +my_application_namedTimer1{quantile="0.98"} 0.0 +my_application_namedTimer1{quantile="0.99"} 0.0 +my_application_namedTimer1{quantile="0.999"} 0.0 +my_application_namedTimer1_count 0 +# EOF +"""; + assertThat(convertToOpenMetricsFormat()).isEqualTo(expected); + } + + @Test + void responseWhenRegistryIsEmpty() { + var registry = new PrometheusRegistry(); + registry.register(DropwizardExports.builder().dropwizardRegistry(metricRegistry).build()); + assertThat(convertToOpenMetricsFormat(registry)) + .isEqualTo( +""" +# EOF +"""); + } + + @Test + void collectInvalidMetricFails() { + metricRegistry.counter("my.application.namedCounter1").inc(-10); + metricRegistry.counter("my.application.namedCounter2").inc(10); + var registry = new PrometheusRegistry(); + DropwizardExports.builder().dropwizardRegistry(metricRegistry).register(registry); + assertThatThrownBy(() -> convertToOpenMetricsFormat(registry)) + .isInstanceOf(IllegalArgumentException.class); + } + + @Test + void collectInvalidMetricPassesWhenExceptionIsIgnored() { + metricRegistry.counter("my.application.namedCounter1").inc(-10); + metricRegistry.counter("my.application.namedCounter2").inc(10); + var registry = new PrometheusRegistry(); + + final StringBuilder buf = new StringBuilder(); + InvalidMetricHandler invalidMetricHandler = + (name, exc) -> { + buf.append("%s: %s%n".formatted(name, exc.getMessage())); + return true; + }; + + DropwizardExports.builder() + .dropwizardRegistry(metricRegistry) + .invalidMetricHandler(invalidMetricHandler) + .register(registry); + assertThat(convertToOpenMetricsFormat(registry)) + .isEqualTo( +""" +# TYPE my_application_namedCounter2 counter +# HELP my_application_namedCounter2 Generated from Dropwizard metric import (metric=my.application.namedCounter2, type=com.codahale.metrics.Counter) +my_application_namedCounter2_total 10.0 +# EOF +"""); + assertThat(buf.toString()) + .contains("my.application.namedCounter1: -10.0: counters cannot have a negative value"); + } + + private static class ExampleDoubleGauge implements Gauge { + @Override + public Double getValue() { + return 0.0; + } + } + + private String convertToOpenMetricsFormat(PrometheusRegistry _registry) { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter(true, true); + try { + writer.write(out, _registry.scrape(), EscapingScheme.UNDERSCORE_ESCAPING); + return out.toString(StandardCharsets.UTF_8); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private String convertToOpenMetricsFormat() { + return convertToOpenMetricsFormat(registry); + } +} diff --git a/prometheus-metrics-instrumentation-dropwizard/version-rules.xml b/prometheus-metrics-instrumentation-dropwizard/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-instrumentation-dropwizard/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-instrumentation-dropwizard5/pom.xml b/prometheus-metrics-instrumentation-dropwizard5/pom.xml new file mode 100644 index 000000000..692e321bd --- /dev/null +++ b/prometheus-metrics-instrumentation-dropwizard5/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-instrumentation-dropwizard5 + bundle + + Prometheus Metrics Instrumentation - Dropwizard 5.x + + Instrumentation library for Dropwizard metrics 5.x + + + + io.prometheus.metrics.instrumentation.dropwizard5 + 0.50 + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + io.dropwizard.metrics5 + metrics-core + 5.0.5 + provided + + + + io.prometheus + prometheus-metrics-exporter-httpserver + ${project.version} + test + + + io.prometheus + prometheus-metrics-exposition-textformats + ${project.version} + test + + + + + + kingster + Kinshuk Bairagi + hi@kinsh.uk + + + + + diff --git a/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/DropwizardExports.java b/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/DropwizardExports.java new file mode 100644 index 000000000..c68d26f49 --- /dev/null +++ b/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/DropwizardExports.java @@ -0,0 +1,297 @@ +package io.prometheus.metrics.instrumentation.dropwizard5; + +import io.dropwizard.metrics5.Counter; +import io.dropwizard.metrics5.Gauge; +import io.dropwizard.metrics5.Histogram; +import io.dropwizard.metrics5.Meter; +import io.dropwizard.metrics5.Metric; +import io.dropwizard.metrics5.MetricFilter; +import io.dropwizard.metrics5.MetricName; +import io.dropwizard.metrics5.MetricRegistry; +import io.dropwizard.metrics5.Snapshot; +import io.dropwizard.metrics5.Timer; +import io.prometheus.metrics.instrumentation.dropwizard5.labels.CustomLabelMapper; +import io.prometheus.metrics.model.registry.MultiCollector; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import io.prometheus.metrics.model.snapshots.MetricMetadata; +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import io.prometheus.metrics.model.snapshots.PrometheusNaming; +import io.prometheus.metrics.model.snapshots.Quantiles; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import java.util.Collections; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.function.BiFunction; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +/** Collect Dropwizard metrics from a MetricRegistry. */ +public class DropwizardExports implements MultiCollector { + private static final Logger logger = Logger.getLogger(DropwizardExports.class.getName()); + private final MetricRegistry registry; + private final MetricFilter metricFilter; + @Nullable private final CustomLabelMapper labelMapper; + private final InvalidMetricHandler invalidMetricHandler; + + /** + * Creates a new DropwizardExports and {@link MetricFilter#ALL}. + * + * @param registry a metric registry to export in prometheus. + */ + public DropwizardExports(MetricRegistry registry) { + super(); + this.registry = registry; + this.metricFilter = MetricFilter.ALL; + this.labelMapper = null; + this.invalidMetricHandler = InvalidMetricHandler.ALWAYS_THROW; + } + + /** + * Creates a new DropwizardExports with a custom {@link MetricFilter}. + * + * @param registry a metric registry to export in prometheus. + * @param metricFilter a custom metric filter. + */ + public DropwizardExports(MetricRegistry registry, MetricFilter metricFilter) { + this.registry = registry; + this.metricFilter = metricFilter; + this.labelMapper = null; + this.invalidMetricHandler = InvalidMetricHandler.ALWAYS_THROW; + } + + /** + * @param registry a metric registry to export in prometheus. + * @param metricFilter a custom metric filter. + * @param labelMapper a labelMapper to use to map labels. + */ + public DropwizardExports( + MetricRegistry registry, MetricFilter metricFilter, @Nullable CustomLabelMapper labelMapper) { + this.registry = registry; + this.metricFilter = metricFilter; + this.labelMapper = labelMapper; + this.invalidMetricHandler = InvalidMetricHandler.ALWAYS_THROW; + } + + /** + * @param registry a metric registry to export in prometheus. + * @param metricFilter a custom metric filter. + * @param labelMapper a labelMapper to use to map labels. + */ + private DropwizardExports( + MetricRegistry registry, + MetricFilter metricFilter, + @Nullable CustomLabelMapper labelMapper, + InvalidMetricHandler invalidMetricHandler) { + this.registry = registry; + this.metricFilter = metricFilter; + this.labelMapper = labelMapper; + this.invalidMetricHandler = invalidMetricHandler; + } + + private static String getHelpMessage(String metricName, Metric metric) { + return String.format( + "Generated from Dropwizard metric import (metric=%s, type=%s)", + metricName, metric.getClass().getName()); + } + + private MetricMetadata getMetricMetaData(String metricName, Metric metric) { + String name = labelMapper != null ? labelMapper.getName(metricName) : metricName; + return new MetricMetadata( + PrometheusNaming.sanitizeMetricName(name), getHelpMessage(metricName, metric)); + } + + /** + * Export counter as Prometheus Gauge. + */ + MetricSnapshot fromCounter(String dropwizardName, Counter counter) { + MetricMetadata metadata = getMetricMetaData(dropwizardName, counter); + CounterSnapshot.CounterDataPointSnapshot.Builder dataPointBuilder = + CounterSnapshot.CounterDataPointSnapshot.builder() + .value(Long.valueOf(counter.getCount()).doubleValue()); + if (labelMapper != null) { + dataPointBuilder.labels( + labelMapper.getLabels(dropwizardName, Collections.emptyList(), Collections.emptyList())); + } + return new CounterSnapshot(metadata, Collections.singletonList(dataPointBuilder.build())); + } + + /** Export gauge as a prometheus gauge. */ + @Nullable + MetricSnapshot fromGauge(String dropwizardName, Gauge gauge) { + Object obj = gauge.getValue(); + double value; + if (obj instanceof Number) { + value = ((Number) obj).doubleValue(); + } else if (obj instanceof Boolean) { + value = ((Boolean) obj) ? 1 : 0; + } else { + logger.log( + Level.FINE, + String.format( + "Invalid type for Gauge %s: %s", + PrometheusNaming.sanitizeMetricName(dropwizardName), + obj == null ? "null" : obj.getClass().getName())); + return null; + } + MetricMetadata metadata = getMetricMetaData(dropwizardName, gauge); + GaugeSnapshot.GaugeDataPointSnapshot.Builder dataPointBuilder = + GaugeSnapshot.GaugeDataPointSnapshot.builder().value(value); + if (labelMapper != null) { + dataPointBuilder.labels( + labelMapper.getLabels(dropwizardName, Collections.emptyList(), Collections.emptyList())); + } + return new GaugeSnapshot(metadata, Collections.singletonList(dataPointBuilder.build())); + } + + /** + * Export a histogram snapshot as a prometheus SUMMARY. + * + * @param dropwizardName metric name. + * @param snapshot the histogram snapshot. + * @param count the total sample count for this snapshot. + * @param factor a factor to apply to histogram values. + */ + MetricSnapshot fromSnapshotAndCount( + String dropwizardName, Snapshot snapshot, long count, double factor, String helpMessage) { + Quantiles quantiles = + Quantiles.builder() + .quantile(0.5, snapshot.getMedian() * factor) + .quantile(0.75, snapshot.get75thPercentile() * factor) + .quantile(0.95, snapshot.get95thPercentile() * factor) + .quantile(0.98, snapshot.get98thPercentile() * factor) + .quantile(0.99, snapshot.get99thPercentile() * factor) + .quantile(0.999, snapshot.get999thPercentile() * factor) + .build(); + + String name = labelMapper != null ? labelMapper.getName(dropwizardName) : dropwizardName; + MetricMetadata metadata = + new MetricMetadata(PrometheusNaming.sanitizeMetricName(name), helpMessage); + SummarySnapshot.SummaryDataPointSnapshot.Builder dataPointBuilder = + SummarySnapshot.SummaryDataPointSnapshot.builder().quantiles(quantiles).count(count); + if (labelMapper != null) { + dataPointBuilder.labels( + labelMapper.getLabels(dropwizardName, Collections.emptyList(), Collections.emptyList())); + } + return new SummarySnapshot(metadata, Collections.singletonList(dataPointBuilder.build())); + } + + /** Convert histogram snapshot. */ + MetricSnapshot fromHistogram(String dropwizardName, Histogram histogram) { + return fromSnapshotAndCount( + dropwizardName, + histogram.getSnapshot(), + histogram.getCount(), + 1.0, + getHelpMessage(dropwizardName, histogram)); + } + + /** Export Dropwizard Timer as a histogram. Use TIME_UNIT as time unit. */ + MetricSnapshot fromTimer(String dropwizardName, Timer timer) { + return fromSnapshotAndCount( + dropwizardName, + timer.getSnapshot(), + timer.getCount(), + 1.0D / TimeUnit.SECONDS.toNanos(1L), + getHelpMessage(dropwizardName, timer)); + } + + /** Export a Meter as a prometheus COUNTER. */ + MetricSnapshot fromMeter(String dropwizardName, Meter meter) { + MetricMetadata metadata = getMetricMetaData(dropwizardName + "_total", meter); + CounterSnapshot.CounterDataPointSnapshot.Builder dataPointBuilder = + CounterSnapshot.CounterDataPointSnapshot.builder().value(meter.getCount()); + if (labelMapper != null) { + dataPointBuilder.labels( + labelMapper.getLabels(dropwizardName, Collections.emptyList(), Collections.emptyList())); + } + return new CounterSnapshot(metadata, Collections.singletonList(dataPointBuilder.build())); + } + + @Override + public MetricSnapshots collect() { + MetricSnapshots.Builder metricSnapshots = MetricSnapshots.builder(); + collectMetricKind(metricSnapshots, registry.getGauges(metricFilter), this::fromGauge); + collectMetricKind(metricSnapshots, registry.getCounters(metricFilter), this::fromCounter); + collectMetricKind(metricSnapshots, registry.getHistograms(metricFilter), this::fromHistogram); + collectMetricKind(metricSnapshots, registry.getTimers(metricFilter), this::fromTimer); + collectMetricKind(metricSnapshots, registry.getMeters(metricFilter), this::fromMeter); + return metricSnapshots.build(); + } + + private void collectMetricKind( + MetricSnapshots.Builder builder, + Map metric, + BiFunction toSnapshot) { + for (Map.Entry entry : metric.entrySet()) { + String metricName = entry.getKey().getKey(); + try { + MetricSnapshot snapshot = toSnapshot.apply(metricName, entry.getValue()); + if (snapshot != null) { + builder.metricSnapshot(snapshot); + } + } catch (Exception e) { + if (!invalidMetricHandler.suppressException(metricName, e)) { + throw e; + } + } + } + } + + public static Builder builder() { + return new Builder(); + } + + // Builder class for DropwizardExports + public static class Builder { + @Nullable private MetricRegistry registry; + private MetricFilter metricFilter; + @Nullable private CustomLabelMapper labelMapper; + private InvalidMetricHandler invalidMetricHandler; + + private Builder() { + this.metricFilter = MetricFilter.ALL; + this.invalidMetricHandler = InvalidMetricHandler.ALWAYS_THROW; + } + + public Builder dropwizardRegistry(MetricRegistry registry) { + this.registry = registry; + return this; + } + + public Builder metricFilter(MetricFilter metricFilter) { + this.metricFilter = metricFilter; + return this; + } + + public Builder customLabelMapper(CustomLabelMapper labelMapper) { + this.labelMapper = labelMapper; + return this; + } + + public Builder invalidMetricHandler(InvalidMetricHandler invalidMetricHandler) { + this.invalidMetricHandler = invalidMetricHandler; + return this; + } + + DropwizardExports build() { + if (registry == null) { + throw new IllegalArgumentException("MetricRegistry must be set"); + } + return new DropwizardExports(registry, metricFilter, labelMapper, invalidMetricHandler); + } + + public void register() { + register(PrometheusRegistry.defaultRegistry); + } + + public void register(PrometheusRegistry registry) { + DropwizardExports dropwizardExports = build(); + registry.register(dropwizardExports); + } + } +} diff --git a/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/InvalidMetricHandler.java b/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/InvalidMetricHandler.java new file mode 100644 index 000000000..bac1aa0af --- /dev/null +++ b/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/InvalidMetricHandler.java @@ -0,0 +1,13 @@ +package io.prometheus.metrics.instrumentation.dropwizard5; + +@FunctionalInterface +public interface InvalidMetricHandler { + InvalidMetricHandler ALWAYS_THROW = (metricName, exc) -> false; + + /** + * @param metricName the name of the metric that was collected. + * @param exc The exception that was thrown when producing the metric snapshot. + * @return true if the exception should be suppressed. + */ + boolean suppressException(String metricName, Exception exc); +} diff --git a/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/CustomLabelMapper.java b/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/CustomLabelMapper.java new file mode 100644 index 000000000..f2174970c --- /dev/null +++ b/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/CustomLabelMapper.java @@ -0,0 +1,121 @@ +package io.prometheus.metrics.instrumentation.dropwizard5.labels; + +import io.prometheus.metrics.model.snapshots.Labels; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * A LabelMapper to allow Dropwizard metrics to be translated to Prometheus metrics including custom + * labels and names. Prometheus metric name and labels are extracted from the Dropwizard name based + * on the provided list of {@link MapperConfig}s. The FIRST matching config will be used. + */ +public class CustomLabelMapper { + private final List compiledMapperConfigs; + + public CustomLabelMapper(List mapperConfigs) { + if (mapperConfigs == null || mapperConfigs.isEmpty()) { + throw new IllegalArgumentException("CustomLabelMapper needs some mapper configs!"); + } + + this.compiledMapperConfigs = new ArrayList<>(mapperConfigs.size()); + for (MapperConfig config : mapperConfigs) { + this.compiledMapperConfigs.add(new CompiledMapperConfig(config)); + } + } + + public String getName(String dropwizardName) { + if (dropwizardName == null) { + throw new IllegalArgumentException("Dropwizard metric name cannot be null"); + } + + CompiledMapperConfig matchingConfig = null; + for (CompiledMapperConfig config : this.compiledMapperConfigs) { + if (config.pattern.matches(dropwizardName)) { + matchingConfig = config; + break; + } + } + + if (matchingConfig != null) { + final Map params = matchingConfig.pattern.extractParameters(dropwizardName); + final NameAndLabels nameAndLabels = getNameAndLabels(matchingConfig.mapperConfig, params); + return nameAndLabels.name; + } + + return dropwizardName; + } + + public Labels getLabels( + final String dropwizardName, + final List additionalLabelNames, + final List additionalLabelValues) { + if (dropwizardName == null) { + throw new IllegalArgumentException("Dropwizard metric name cannot be null"); + } + + CompiledMapperConfig matchingConfig = null; + for (CompiledMapperConfig config : this.compiledMapperConfigs) { + if (config.pattern.matches(dropwizardName)) { + matchingConfig = config; + break; + } + } + + if (matchingConfig != null) { + final Map params = matchingConfig.pattern.extractParameters(dropwizardName); + final NameAndLabels nameAndLabels = getNameAndLabels(matchingConfig.mapperConfig, params); + nameAndLabels.labelNames.addAll(additionalLabelNames); + nameAndLabels.labelValues.addAll(additionalLabelValues); + return Labels.of(nameAndLabels.labelNames, nameAndLabels.labelValues); + } + + return Labels.of(additionalLabelNames, additionalLabelValues); + } + + @SuppressWarnings("NullAway") // not sure if it can be null here + protected NameAndLabels getNameAndLabels(MapperConfig config, Map parameters) { + final String metricName = formatTemplate(config.getName(), parameters); + final List labels = new ArrayList(config.getLabels().size()); + final List labelValues = new ArrayList(config.getLabels().size()); + for (Map.Entry entry : config.getLabels().entrySet()) { + labels.add(entry.getKey()); + labelValues.add(formatTemplate(entry.getValue(), parameters)); + } + + return new NameAndLabels(metricName, labels, labelValues); + } + + private String formatTemplate(String template, Map params) { + String result = template; + for (Map.Entry entry : params.entrySet()) { + result = result.replace(entry.getKey(), entry.getValue()); + } + + return result; + } + + static class CompiledMapperConfig { + final MapperConfig mapperConfig; + final GraphiteNamePattern pattern; + + @SuppressWarnings("NullAway") // not sure if it can be null here + CompiledMapperConfig(MapperConfig mapperConfig) { + this.mapperConfig = mapperConfig; + this.pattern = new GraphiteNamePattern(mapperConfig.getMatch()); + } + } + + static class NameAndLabels { + final String name; + final List labelNames; + final List labelValues; + + NameAndLabels( + final String name, final List labelNames, final List labelValues) { + this.name = name; + this.labelNames = labelNames; + this.labelValues = labelValues; + } + } +} diff --git a/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/GraphiteNamePattern.java b/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/GraphiteNamePattern.java new file mode 100644 index 000000000..c13ffd91c --- /dev/null +++ b/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/GraphiteNamePattern.java @@ -0,0 +1,95 @@ +package io.prometheus.metrics.instrumentation.dropwizard5.labels; + +import static io.prometheus.metrics.instrumentation.dropwizard5.labels.MapperConfig.METRIC_GLOB_REGEX; + +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * GraphiteNamePattern is initialised with a simplified glob pattern that only allows '*' as special + * character. Examples of valid patterns: + * + *

      + *
    • org.test.controller.gather.status.400 + *
    • org.test.controller.gather.status.* + *
    • org.test.controller.*.status.* + *
    • *.test.controller.*.status.* + *
    + * + *

    It contains logic to match a metric name and to extract named parameters from it. + */ +class GraphiteNamePattern { + private static final Pattern VALIDATION_PATTERN = Pattern.compile(METRIC_GLOB_REGEX); + + private Pattern pattern; + private String patternStr; + + /** + * Creates a new GraphiteNamePattern from the given simplified glob pattern. + * + * @param pattern The glob style pattern to be used. + */ + GraphiteNamePattern(String pattern) throws IllegalArgumentException { + if (!VALIDATION_PATTERN.matcher(pattern).matches()) { + throw new IllegalArgumentException( + String.format("Provided pattern [%s] does not matches [%s]", pattern, METRIC_GLOB_REGEX)); + } + initializePattern(pattern); + } + + /** + * Matches the metric name against the pattern. + * + * @param metricName The metric name to be tested. + * @return {@code true} if the name is matched, {@code false} otherwise. + */ + boolean matches(final String metricName) { + return metricName != null && pattern.matcher(metricName).matches(); + } + + /** + * Extracts parameters from the given metric name based on the pattern. The resulting map has keys + * named as '${n}' where n is the 0 based position in the pattern. E.g.: pattern: + * org.test.controller.*.status.* extractParameters("org.test.controller.gather.status.400") -> + * {${0} -> "gather", ${1} -> "400"} + * + * @param metricName The metric name to extract parameters from. + * @return A parameter map where keys are named '${n}' where n is 0 based parameter position in + * the pattern. + */ + Map extractParameters(final String metricName) { + final Matcher matcher = this.pattern.matcher(metricName); + final Map params = new HashMap(); + if (matcher.find()) { + for (int i = 1; i <= matcher.groupCount(); i++) { + params.put(String.format("${%d}", i - 1), matcher.group(i)); + } + } + + return params; + } + + /** + * Turns the GLOB pattern into a REGEX. + * + * @param pattern The pattern to use + */ + private void initializePattern(final String pattern) { + final String[] split = pattern.split(Pattern.quote("*"), -1); + final StringBuilder escapedPattern = new StringBuilder(Pattern.quote(split[0])); + for (int i = 1; i < split.length; i++) { + String quoted = Pattern.quote(split[i]); + escapedPattern.append("([^.]*)").append(quoted); + } + + final String regex = "^" + escapedPattern.toString() + "$"; + this.patternStr = regex; + this.pattern = Pattern.compile(regex); + } + + String getPatternString() { + return this.patternStr; + } +} diff --git a/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/MapperConfig.java b/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/MapperConfig.java new file mode 100644 index 000000000..13d890861 --- /dev/null +++ b/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/MapperConfig.java @@ -0,0 +1,158 @@ +package io.prometheus.metrics.instrumentation.dropwizard5.labels; + +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Pattern; +import javax.annotation.Nullable; + +/** + * POJO containing info on how to map a graphite metric to a prometheus one. Example mapping in yaml + * format: + * + *

    match: test.dispatcher.*.*.* name: dispatcher_events_total labels: action: ${1} outcome: + * ${2}_out processor: ${0} status: ${1}_${2} + * + *

    Dropwizard metrics that match the "match" pattern will be further processed to have a new name + * and new labels based on this config. + */ +public final class MapperConfig { + // each part of the metric name between dots + private static final String METRIC_PART_REGEX = "[a-zA-Z_0-9](-?[a-zA-Z0-9_])+"; + // Simplified GLOB: we can have "*." at the beginning and "*" only at the end + static final String METRIC_GLOB_REGEX = + "^(\\*\\.|" + METRIC_PART_REGEX + "\\.)+(\\*|" + METRIC_PART_REGEX + ")$"; + // Labels validation. + private static final String LABEL_REGEX = "^[a-zA-Z_][a-zA-Z0-9_]+$"; + private static final Pattern MATCH_EXPRESSION_PATTERN = Pattern.compile(METRIC_GLOB_REGEX); + private static final Pattern LABEL_PATTERN = Pattern.compile(LABEL_REGEX); + + /** + * Regex used to match incoming metric name. Uses a simplified glob syntax where only '*' are + * allowed. E.g: org.company.controller.*.status.* Will be used to match + * org.company.controller.controller1.status.200 and org.company.controller.controller2.status.400 + */ + @Nullable private String match; + + /** + * New metric name. Can contain placeholders to be replaced with actual values from the incoming + * metric name. Placeholders are in the ${n} format where n is the zero based index of the group + * to extract from the original metric name. E.g.: match: test.dispatcher.*.*.* name: + * dispatcher_events_total_${1} + * + *

    A metric "test.dispatcher.old.test.yay" will be converted in a new metric with name + * "dispatcher_events_total_test" + */ + @Nullable private String name; + + /** + * Labels to be extracted from the metric name. They should contain placeholders to be replaced + * with actual values from the incoming metric name. Placeholders are in the ${n} format where n + * is the zero based index of the group to extract from the original metric name. E.g.: match: + * test.dispatcher.*.* name: dispatcher_events_total_${0} labels: label1: ${1}_t + * + *

    A metric "test.dispatcher.sp1.yay" will be converted in a new metric with name + * "dispatcher_events_total_sp1" with label {label1: yay_t} + * + *

    Label names have to match the regex ^[a-zA-Z_][a-zA-Z0-9_]+$ + */ + private Map labels = new HashMap<>(); + + public MapperConfig() { + // empty constructor + } + + // for tests + MapperConfig(String match) { + validateMatch(match); + this.match = match; + } + + public MapperConfig(String match, String name, Map labels) { + this.name = name; + validateMatch(match); + this.match = match; + validateLabels(labels); + this.labels = labels; + } + + @Override + public String toString() { + return String.format("MapperConfig{match=%s, name=%s, labels=%s}", match, name, labels); + } + + @Nullable + public String getMatch() { + return match; + } + + public void setMatch(String match) { + validateMatch(match); + this.match = match; + } + + @Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Map getLabels() { + return labels; + } + + public void setLabels(Map labels) { + validateLabels(labels); + this.labels = labels; + } + + private void validateMatch(String match) { + if (!MATCH_EXPRESSION_PATTERN.matcher(match).matches()) { + throw new IllegalArgumentException( + String.format( + "Match expression [%s] does not match required pattern %s", + match, MATCH_EXPRESSION_PATTERN)); + } + } + + private void validateLabels(Map labels) { + if (labels != null) { + for (String key : labels.keySet()) { + if (!LABEL_PATTERN.matcher(key).matches()) { + throw new IllegalArgumentException( + String.format("Label [%s] does not match required pattern %s", match, LABEL_PATTERN)); + } + } + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + final MapperConfig that = (MapperConfig) o; + + if (match != null ? !match.equals(that.match) : that.match != null) { + return false; + } + if (name != null ? !name.equals(that.name) : that.name != null) { + return false; + } + return labels != null ? labels.equals(that.labels) : that.labels == null; + } + + @Override + public int hashCode() { + int result = match != null ? match.hashCode() : 0; + result = 31 * result + (name != null ? name.hashCode() : 0); + result = 31 * result + (labels != null ? labels.hashCode() : 0); + return result; + } +} diff --git a/prometheus-metrics-instrumentation-dropwizard5/src/test/java/io/prometheus/metrics/instrumentation/dropwizard5/DropwizardExportsTest.java b/prometheus-metrics-instrumentation-dropwizard5/src/test/java/io/prometheus/metrics/instrumentation/dropwizard5/DropwizardExportsTest.java new file mode 100644 index 000000000..ff76438d1 --- /dev/null +++ b/prometheus-metrics-instrumentation-dropwizard5/src/test/java/io/prometheus/metrics/instrumentation/dropwizard5/DropwizardExportsTest.java @@ -0,0 +1,363 @@ +package io.prometheus.metrics.instrumentation.dropwizard5; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.data.Offset.offset; + +import io.dropwizard.metrics5.*; +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.expositionformats.OpenMetricsTextFormatWriter; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import io.prometheus.metrics.model.snapshots.Quantiles; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class DropwizardExportsTest { + + private PrometheusRegistry registry = new PrometheusRegistry(); + private MetricRegistry metricRegistry; + + @BeforeEach + public void setUp() { + metricRegistry = new MetricRegistry(); + DropwizardExports.builder().dropwizardRegistry(metricRegistry).register(registry); + } + + @Test + public void testCounter() { + metricRegistry.counter("foo.bar").inc(1); + String expected = +""" +# TYPE foo_bar counter +# HELP foo_bar Generated from Dropwizard metric import (metric=foo.bar, type=io.dropwizard.metrics5.Counter) +foo_bar_total 1.0 +# EOF +"""; + + assertThat(convertToOpenMetricsFormat()).isEqualTo(expected); + } + + @Test + public void testGauge() { + // don't convert to lambda, as we need to test the type + Gauge integerGauge = + new Gauge() { + @Override + public Integer getValue() { + return 1234; + } + }; + Gauge doubleGauge = + new Gauge() { + @Override + public Double getValue() { + return 1.234D; + } + }; + Gauge longGauge = + new Gauge() { + @Override + public Long getValue() { + return 1234L; + } + }; + Gauge floatGauge = + new Gauge() { + @Override + public Float getValue() { + return 0.1234F; + } + }; + Gauge booleanGauge = + new Gauge() { + @Override + public Boolean getValue() { + return true; + } + }; + + metricRegistry.register(MetricName.parse("double.gauge"), doubleGauge); + metricRegistry.register(MetricName.parse("long.gauge"), longGauge); + metricRegistry.register(MetricName.parse("integer.gauge"), integerGauge); + metricRegistry.register(MetricName.parse("float.gauge"), floatGauge); + metricRegistry.register(MetricName.parse("boolean.gauge"), booleanGauge); + + String expected = +""" +# TYPE boolean_gauge gauge +# HELP boolean_gauge Generated from Dropwizard metric import (metric=boolean.gauge, type=io.prometheus.metrics.instrumentation.dropwizard5.DropwizardExportsTest$5) +boolean_gauge 1.0 +# TYPE double_gauge gauge +# HELP double_gauge Generated from Dropwizard metric import (metric=double.gauge, type=io.prometheus.metrics.instrumentation.dropwizard5.DropwizardExportsTest$2) +double_gauge 1.234 +# TYPE float_gauge gauge +# HELP float_gauge Generated from Dropwizard metric import (metric=float.gauge, type=io.prometheus.metrics.instrumentation.dropwizard5.DropwizardExportsTest$4) +float_gauge 0.1234000027179718 +# TYPE integer_gauge gauge +# HELP integer_gauge Generated from Dropwizard metric import (metric=integer.gauge, type=io.prometheus.metrics.instrumentation.dropwizard5.DropwizardExportsTest$1) +integer_gauge 1234.0 +# TYPE long_gauge gauge +# HELP long_gauge Generated from Dropwizard metric import (metric=long.gauge, type=io.prometheus.metrics.instrumentation.dropwizard5.DropwizardExportsTest$3) +long_gauge 1234.0 +# EOF +"""; + + assertThat(convertToOpenMetricsFormat()).isEqualTo(expected); + } + + @Test + public void testInvalidGaugeType() { + Gauge invalidGauge = () -> "foobar"; + + metricRegistry.register(MetricName.parse("invalid_gauge"), invalidGauge); + + String expected = "# EOF\n"; + assertThat(convertToOpenMetricsFormat()).isEqualTo(expected); + } + + @Test + public void testGaugeReturningNullValue() { + Gauge invalidGauge = () -> null; + metricRegistry.register(MetricName.parse("invalid_gauge"), invalidGauge); + String expected = "# EOF\n"; + assertThat(convertToOpenMetricsFormat()).isEqualTo(expected); + } + + @Test + public void testHistogram() { + // just test the standard mapper + final MetricRegistry metricRegistry = new MetricRegistry(); + PrometheusRegistry pmRegistry = new PrometheusRegistry(); + DropwizardExports.builder().dropwizardRegistry(metricRegistry).register(pmRegistry); + + Histogram hist = metricRegistry.histogram("hist"); + int i = 0; + while (i < 100) { + hist.update(i); + i += 1; + } + + // The result should look like this + // + // # TYPE hist summary + // # HELP hist Generated from Dropwizard metric import (metric=hist, + // type=io.dropwizard.metrics5.Histogram) + // hist{quantile="0.5"} 49.0 + // hist{quantile="0.75"} 74.0 + // hist{quantile="0.95"} 94.0 + // hist{quantile="0.98"} 97.0 + // hist{quantile="0.99"} 98.0 + // hist{quantile="0.999"} 99.0 + // hist_count 100 + // # EOF + // + // However, Dropwizard uses a random reservoir sampling algorithm, so the values could as well + // be off-by-one + // + // # TYPE hist summary + // # HELP hist Generated from Dropwizard metric import (metric=hist, + // type=io.dropwizard.metrics5.Histogram) + // hist{quantile="0.5"} 50.0 + // hist{quantile="0.75"} 75.0 + // hist{quantile="0.95"} 95.0 + // hist{quantile="0.98"} 98.0 + // hist{quantile="0.99"} 99.0 + // hist{quantile="0.999"} 99.0 + // hist_count 100 + // # EOF + // + // The following asserts the values, but allows an error of 1.0 for quantile values. + + MetricSnapshots snapshots = pmRegistry.scrape(name -> name.equals("hist")); + assertThat(snapshots.size()).isOne(); + SummarySnapshot snapshot = (SummarySnapshot) snapshots.get(0); + assertThat(snapshot.getMetadata().getName()).isEqualTo("hist"); + assertThat(snapshot.getMetadata().getHelp()) + .isEqualTo( + "Generated from Dropwizard metric import (metric=hist," + + " type=io.dropwizard.metrics5.Histogram)"); + assertThat(snapshot.getDataPoints().size()).isOne(); + SummarySnapshot.SummaryDataPointSnapshot dataPoint = snapshot.getDataPoints().get(0); + assertThat(dataPoint.hasCount()).isTrue(); + assertThat(dataPoint.getCount()).isEqualTo(100); + assertThat(dataPoint.hasSum()).isFalse(); + Quantiles quantiles = dataPoint.getQuantiles(); + assertThat(quantiles.size()).isEqualTo(6); + assertThat(quantiles.get(0).getQuantile()).isEqualTo(0.5); + assertThat(quantiles.get(0).getValue()).isCloseTo(49.0, offset(1.0)); + assertThat(quantiles.get(1).getQuantile()).isEqualTo(0.75); + assertThat(quantiles.get(1).getValue()).isCloseTo(74.0, offset(1.0)); + assertThat(quantiles.get(2).getQuantile()).isEqualTo(0.95); + assertThat(quantiles.get(2).getValue()).isCloseTo(94.0, offset(1.0)); + assertThat(quantiles.get(3).getQuantile()).isEqualTo(0.98); + assertThat(quantiles.get(3).getValue()).isCloseTo(97.0, offset(1.0)); + assertThat(quantiles.get(4).getQuantile()).isEqualTo(0.99); + assertThat(quantiles.get(4).getValue()).isCloseTo(98.0, offset(1.0)); + assertThat(quantiles.get(5).getQuantile()).isEqualTo(0.999); + assertThat(quantiles.get(5).getValue()).isCloseTo(99.0, offset(1.0)); + } + + @Test + public void testMeter() { + Meter meter = metricRegistry.meter("meter"); + meter.mark(); + meter.mark(); + + String expected = +""" +# TYPE meter counter +# HELP meter Generated from Dropwizard metric import (metric=meter_total, type=io.dropwizard.metrics5.Meter) +meter_total 2.0 +# EOF +"""; + assertThat(convertToOpenMetricsFormat()).isEqualTo(expected); + } + + @Test + public void testTimer() throws InterruptedException { + final MetricRegistry metricRegistry = new MetricRegistry(); + DropwizardExports exports = new DropwizardExports(metricRegistry); + Timer t = metricRegistry.timer("timer"); + Timer.Context time = t.time(); + Thread.sleep(100L); + long timeSpentNanos = time.stop(); + double timeSpentMillis = TimeUnit.NANOSECONDS.toMillis(timeSpentNanos); + System.out.println(timeSpentMillis); + + SummarySnapshot.SummaryDataPointSnapshot dataPointSnapshot = + (SummarySnapshot.SummaryDataPointSnapshot) + exports.collect().stream().flatMap(i -> i.getDataPoints().stream()).findFirst().get(); + // We slept for 1Ms so we ensure that all timers are above 1ms: + assertThat(dataPointSnapshot.getQuantiles().size()).isGreaterThan(1); + dataPointSnapshot + .getQuantiles() + .forEach( + i -> { + System.out.println(i.getQuantile() + " : " + i.getValue()); + assertThat(i.getValue()).isGreaterThan(timeSpentMillis / 1000d); + }); + assertThat(dataPointSnapshot.getCount()).isOne(); + } + + @Test + public void testThatMetricHelpUsesOriginalDropwizardName() { + + metricRegistry.timer("my.application.namedTimer1"); + metricRegistry.counter("my.application.namedCounter1"); + metricRegistry.meter("my.application.namedMeter1"); + metricRegistry.histogram("my.application.namedHistogram1"); + metricRegistry.register( + MetricName.parse("my.application.namedGauge1"), new ExampleDoubleGauge()); + + String expected = +""" +# TYPE my_application_namedCounter1 counter +# HELP my_application_namedCounter1 Generated from Dropwizard metric import (metric=my.application.namedCounter1, type=io.dropwizard.metrics5.Counter) +my_application_namedCounter1_total 0.0 +# TYPE my_application_namedGauge1 gauge +# HELP my_application_namedGauge1 Generated from Dropwizard metric import (metric=my.application.namedGauge1, type=io.prometheus.metrics.instrumentation.dropwizard5.DropwizardExportsTest$ExampleDoubleGauge) +my_application_namedGauge1 0.0 +# TYPE my_application_namedHistogram1 summary +# HELP my_application_namedHistogram1 Generated from Dropwizard metric import (metric=my.application.namedHistogram1, type=io.dropwizard.metrics5.Histogram) +my_application_namedHistogram1{quantile="0.5"} 0.0 +my_application_namedHistogram1{quantile="0.75"} 0.0 +my_application_namedHistogram1{quantile="0.95"} 0.0 +my_application_namedHistogram1{quantile="0.98"} 0.0 +my_application_namedHistogram1{quantile="0.99"} 0.0 +my_application_namedHistogram1{quantile="0.999"} 0.0 +my_application_namedHistogram1_count 0 +# TYPE my_application_namedMeter1 counter +# HELP my_application_namedMeter1 Generated from Dropwizard metric import (metric=my.application.namedMeter1_total, type=io.dropwizard.metrics5.Meter) +my_application_namedMeter1_total 0.0 +# TYPE my_application_namedTimer1 summary +# HELP my_application_namedTimer1 Generated from Dropwizard metric import (metric=my.application.namedTimer1, type=io.dropwizard.metrics5.Timer) +my_application_namedTimer1{quantile="0.5"} 0.0 +my_application_namedTimer1{quantile="0.75"} 0.0 +my_application_namedTimer1{quantile="0.95"} 0.0 +my_application_namedTimer1{quantile="0.98"} 0.0 +my_application_namedTimer1{quantile="0.99"} 0.0 +my_application_namedTimer1{quantile="0.999"} 0.0 +my_application_namedTimer1_count 0 +# EOF +"""; + assertThat(convertToOpenMetricsFormat()).isEqualTo(expected); + } + + @Test + void responseWhenRegistryIsEmpty() { + var registry = new PrometheusRegistry(); + registry.register(DropwizardExports.builder().dropwizardRegistry(metricRegistry).build()); + assertThat(convertToOpenMetricsFormat(registry)) + .isEqualTo( +""" +# EOF +"""); + } + + @Test + void collectInvalidMetricFails() { + metricRegistry.counter("my.application.namedCounter1").inc(-10); + metricRegistry.counter("my.application.namedCounter2").inc(10); + var registry = new PrometheusRegistry(); + DropwizardExports.builder().dropwizardRegistry(metricRegistry).register(registry); + assertThatThrownBy(() -> convertToOpenMetricsFormat(registry)) + .isInstanceOf(IllegalArgumentException.class); + } + + @Test + void collectInvalidMetricPassesWhenExceptionIsIgnored() { + metricRegistry.counter("my.application.namedCounter1").inc(-10); + metricRegistry.counter("my.application.namedCounter2").inc(10); + var registry = new PrometheusRegistry(); + + final StringBuilder buf = new StringBuilder(); + InvalidMetricHandler invalidMetricHandler = + (name, exc) -> { + buf.append("%s: %s%n".formatted(name, exc.getMessage())); + return true; + }; + + DropwizardExports.builder() + .dropwizardRegistry(metricRegistry) + .invalidMetricHandler(invalidMetricHandler) + .register(registry); + assertThat(convertToOpenMetricsFormat(registry)) + .isEqualTo( +""" +# TYPE my_application_namedCounter2 counter +# HELP my_application_namedCounter2 Generated from Dropwizard metric import (metric=my.application.namedCounter2, type=io.dropwizard.metrics5.Counter) +my_application_namedCounter2_total 10.0 +# EOF +"""); + assertThat(buf.toString()) + .contains("my.application.namedCounter1: -10.0: counters cannot have a negative value"); + } + + private static class ExampleDoubleGauge implements Gauge { + @Override + public Double getValue() { + return 0.0; + } + } + + private String convertToOpenMetricsFormat(PrometheusRegistry _registry) { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter(true, true); + try { + writer.write(out, _registry.scrape(), EscapingScheme.UNDERSCORE_ESCAPING); + return out.toString(StandardCharsets.UTF_8); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private String convertToOpenMetricsFormat() { + return convertToOpenMetricsFormat(registry); + } +} diff --git a/prometheus-metrics-instrumentation-dropwizard5/src/test/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/CustomLabelMapperTest.java b/prometheus-metrics-instrumentation-dropwizard5/src/test/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/CustomLabelMapperTest.java new file mode 100644 index 000000000..44c365898 --- /dev/null +++ b/prometheus-metrics-instrumentation-dropwizard5/src/test/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/CustomLabelMapperTest.java @@ -0,0 +1,228 @@ +package io.prometheus.metrics.instrumentation.dropwizard5.labels; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import io.dropwizard.metrics5.MetricFilter; +import io.dropwizard.metrics5.MetricRegistry; +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.expositionformats.OpenMetricsTextFormatWriter; +import io.prometheus.metrics.instrumentation.dropwizard5.DropwizardExports; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class CustomLabelMapperTest { + private MetricRegistry metricRegistry; + + @BeforeEach + public void setUp() { + metricRegistry = new MetricRegistry(); + } + + @Test + public void test_WHEN_EmptyConfig_THEN_Fail() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> new CustomLabelMapper(Collections.emptyList())); + } + + @Test + public void test_WHEN_NoMatches_THEN_ShouldReturnDefaultSample() { + final List mapperConfigs = + Arrays.asList( + new MapperConfig("client-nope.*.*.*"), + new MapperConfig("*.client-nope.*.*.*"), + new MapperConfig("not.even.this.*.*.*")); + final CustomLabelMapper labelMapper = new CustomLabelMapper(mapperConfigs); + DropwizardExports dropwizardExports = + new DropwizardExports(metricRegistry, MetricFilter.ALL, labelMapper); + + metricRegistry.counter("app.okhttpclient.client.HttpClient.service.total").inc(1); + System.out.println(convertToOpenMetricsFormat(dropwizardExports.collect())); + + String expected = +""" +# TYPE app_okhttpclient_client_HttpClient_service counter +# HELP app_okhttpclient_client_HttpClient_service Generated from Dropwizard metric import (metric=app.okhttpclient.client.HttpClient.service.total, type=io.dropwizard.metrics5.Counter) +app_okhttpclient_client_HttpClient_service_total 1.0 +# EOF +"""; + + assertThat(convertToOpenMetricsFormat(dropwizardExports.collect())).isEqualTo(expected); + } + + @Test + public void test_WHEN_OneMatch_THEN_ShouldReturnConverted() { + final Map labels = new HashMap(); + labels.put("service", "${0}"); + final MapperConfig mapperConfig = + new MapperConfig( + "app.okhttpclient.client.HttpClient.*.total", + "app.okhttpclient.client.HttpClient.total", + labels); + final List mapperConfigs = + Arrays.asList( + new MapperConfig("client-nope.*.*.*"), + mapperConfig, + new MapperConfig("not.even.this.*.*.*")); + final CustomLabelMapper labelMapper = new CustomLabelMapper(mapperConfigs); + DropwizardExports dropwizardExports = + new DropwizardExports(metricRegistry, MetricFilter.ALL, labelMapper); + + metricRegistry.counter("app.okhttpclient.client.HttpClient.greatService.total").inc(1); + + String expected = +""" +# TYPE app_okhttpclient_client_HttpClient counter +# HELP app_okhttpclient_client_HttpClient Generated from Dropwizard metric import (metric=app.okhttpclient.client.HttpClient.greatService.total, type=io.dropwizard.metrics5.Counter) +app_okhttpclient_client_HttpClient_total{service="greatService"} 1.0 +# EOF +"""; + assertThat(convertToOpenMetricsFormat(dropwizardExports.collect())).isEqualTo(expected); + } + + @Test + public void test_WHEN_MoreMatches_THEN_ShouldReturnFirstOne() { + final Map labels = new HashMap<>(); + labels.put("service", "${0}"); + final MapperConfig mapperConfig = + new MapperConfig( + "app.okhttpclient.client.HttpClient.*.total", + "app.okhttpclient.client.HttpClient.total", + labels); + final List mapperConfigs = + Arrays.asList( + new MapperConfig("client-nope.*.*.*"), + mapperConfig, + new MapperConfig("app.okhttpclient.client.HttpClient.*.*") // this matches as well + ); + final CustomLabelMapper labelMapper = new CustomLabelMapper(mapperConfigs); + DropwizardExports dropwizardExports = + new DropwizardExports(metricRegistry, MetricFilter.ALL, labelMapper); + + metricRegistry.counter("app.okhttpclient.client.HttpClient.greatService.total").inc(1); + + String expected = +""" +# TYPE app_okhttpclient_client_HttpClient counter +# HELP app_okhttpclient_client_HttpClient Generated from Dropwizard metric import (metric=app.okhttpclient.client.HttpClient.greatService.total, type=io.dropwizard.metrics5.Counter) +app_okhttpclient_client_HttpClient_total{service="greatService"} 1.0 +# EOF +"""; + assertThat(convertToOpenMetricsFormat(dropwizardExports.collect())).isEqualTo(expected); + } + + @Test + public void test_WHEN_MoreMatchesReverseOrder_THEN_ShouldReturnFirstOne() { + final Map labels = new LinkedHashMap<>(); + labels.put("service", "${0}"); + labels.put("status", "${1}"); + final MapperConfig mapperConfig = + new MapperConfig( + "app.okhttpclient.client.HttpClient.*.*", "app.okhttpclient.client.HttpClient", labels); + + final MapperConfig mapperConfig2 = + new MapperConfig( + "app.okhttpclient.client.HttpClient.*.*", + "app.okhttpclient.client.HttpClient2", + labels); + + final List mapperConfigs = + Arrays.asList( + new MapperConfig("client-nope.*.*.*"), + mapperConfig, + mapperConfig2 // this matches as well + ); + + final CustomLabelMapper labelMapper = new CustomLabelMapper(mapperConfigs); + DropwizardExports dropwizardExports = + new DropwizardExports(metricRegistry, MetricFilter.ALL, labelMapper); + metricRegistry.counter("app.okhttpclient.client.HttpClient.greatService.400").inc(1); + + String expected = +""" +# TYPE app_okhttpclient_client_HttpClient counter +# HELP app_okhttpclient_client_HttpClient Generated from Dropwizard metric import (metric=app.okhttpclient.client.HttpClient.greatService.400, type=io.dropwizard.metrics5.Counter) +app_okhttpclient_client_HttpClient_total{service="greatService",status="400"} 1.0 +# EOF +"""; + assertThat(convertToOpenMetricsFormat(dropwizardExports.collect())).isEqualTo(expected); + } + + @Test + public void test_WHEN_MoreToFormatInLabelsAndName_THEN_ShouldReturnCorrectSample() { + final Map labels = new LinkedHashMap<>(); + labels.put("service", "${0}_${1}"); + labels.put("status", "s_${1}"); + final MapperConfig mapperConfig = + new MapperConfig( + "app.okhttpclient.client.HttpClient.*.*", + "app.okhttpclient.client.HttpClient.${0}", + labels); + final List mapperConfigs = + Arrays.asList( + new MapperConfig("client-nope.*.*.*"), + mapperConfig, + new MapperConfig("app.okhttpclient.client.HttpClient.*.*") // this matches as well + ); + + final CustomLabelMapper labelMapper = new CustomLabelMapper(mapperConfigs); + DropwizardExports dropwizardExports = + new DropwizardExports(metricRegistry, MetricFilter.ALL, labelMapper); + metricRegistry.counter("app.okhttpclient.client.HttpClient.greatService.400").inc(1); + System.out.println(convertToOpenMetricsFormat(dropwizardExports.collect())); + + String expected = +""" +# TYPE app_okhttpclient_client_HttpClient_greatService counter +# HELP app_okhttpclient_client_HttpClient_greatService Generated from Dropwizard metric import (metric=app.okhttpclient.client.HttpClient.greatService.400, type=io.dropwizard.metrics5.Counter) +app_okhttpclient_client_HttpClient_greatService_total{service="greatService_400",status="s_400"} 1.0 +# EOF +"""; + assertThat(convertToOpenMetricsFormat(dropwizardExports.collect())).isEqualTo(expected); + } + + @Test + public void test_WHEN_AdditionalLabels_THEN_ShouldReturnCorrectSample() { + final Map labels = new LinkedHashMap<>(); + labels.put("service", "${0}"); + labels.put("status", "s_${1}"); + labels.put("client", "sampleClient"); + final MapperConfig mapperConfig = + new MapperConfig( + "app.okhttpclient.client.HttpClient.*.*", + "app.okhttpclient.client.HttpClient.${0}", + labels); + final List mapperConfigs = + Arrays.asList(new MapperConfig("client-nope.*.*.*"), mapperConfig); + + final CustomLabelMapper labelMapper = new CustomLabelMapper(mapperConfigs); + DropwizardExports dropwizardExports = + new DropwizardExports(metricRegistry, MetricFilter.ALL, labelMapper); + metricRegistry.counter("app.okhttpclient.client.HttpClient.greatService.400").inc(1); + + String expected = +""" +# TYPE app_okhttpclient_client_HttpClient_greatService counter +# HELP app_okhttpclient_client_HttpClient_greatService Generated from Dropwizard metric import (metric=app.okhttpclient.client.HttpClient.greatService.400, type=io.dropwizard.metrics5.Counter) +app_okhttpclient_client_HttpClient_greatService_total{client="sampleClient",service="greatService",status="s_400"} 1.0 +# EOF +"""; + assertThat(convertToOpenMetricsFormat(dropwizardExports.collect())).isEqualTo(expected); + } + + private String convertToOpenMetricsFormat(MetricSnapshots snapshots) { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter(true, true); + try { + writer.write(out, snapshots, EscapingScheme.UNDERSCORE_ESCAPING); + return out.toString(StandardCharsets.UTF_8); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/prometheus-metrics-instrumentation-dropwizard5/src/test/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/GraphiteNamePatternTest.java b/prometheus-metrics-instrumentation-dropwizard5/src/test/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/GraphiteNamePatternTest.java new file mode 100644 index 000000000..ed27d7f22 --- /dev/null +++ b/prometheus-metrics-instrumentation-dropwizard5/src/test/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/GraphiteNamePatternTest.java @@ -0,0 +1,144 @@ +package io.prometheus.metrics.instrumentation.dropwizard5.labels; + +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; + +class GraphiteNamePatternTest { + + @Test + public void createNew_WHEN_InvalidPattern_THEN_ShouldThrowException() { + List invalidPatterns = + Arrays.asList( + "", + "a", + "1org", + "1org.", + "org.", + "org.**", + "org.**", + "org.company-", + "org.company-.", + "org.company-*", + "org.company.**", + "org.company.**-", + "org.com*pany.*", + "org.test.contr.oller.gather.status..400", + "org.test.controller.gather.status..400"); + for (String pattern : invalidPatterns) { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> new GraphiteNamePattern(pattern)) + .withMessageContaining(pattern); + } + } + + @Test + public void createNew_WHEN_ValidPattern_THEN_ShouldCreateThePatternSuccessfully() { + final List validPatterns = + Arrays.asList( + "org.test.controller.gather.status.400", + "org.test.controller.*.status.400", + "org.test.controller.*.status.*", + "*.test.controller.*.status.*", + "*.test.controller-1.*.status.*", + "*.amazing-test.controller-1.*.status.*"); + for (String pattern : validPatterns) { + new GraphiteNamePattern(pattern); + } + } + + @Test + public void createNew_WHEN_ValidPattern_THEN_ShouldInitInternalPatternSuccessfully() { + final Map validPatterns = new HashMap(); + validPatterns.put( + "org.test.controller.gather.status.400", "^\\Qorg.test.controller.gather.status.400\\E$"); + validPatterns.put( + "org.test.controller.*.status.400", "^\\Qorg.test.controller.\\E([^.]*)\\Q.status.400\\E$"); + validPatterns.put( + "org.test.controller.*.status.*", + "^\\Qorg.test.controller.\\E([^.]*)\\Q.status.\\E([^.]*)\\Q\\E$"); + validPatterns.put( + "*.test.controller.*.status.*", + "^\\Q\\E([^.]*)\\Q.test.controller.\\E([^.]*)\\Q.status.\\E([^.]*)\\Q\\E$"); + + for (Map.Entry expected : validPatterns.entrySet()) { + final GraphiteNamePattern pattern = new GraphiteNamePattern(expected.getKey()); + Assertions.assertThat(pattern.getPatternString()).isEqualTo(expected.getValue()); + } + } + + @Test + public void match_WHEN_NotMatchingMetricNameProvided_THEN_ShouldNotMatch() { + final GraphiteNamePattern pattern = new GraphiteNamePattern("org.test.controller.*.status.*"); + final List notMatchingMetricNamed = + Arrays.asList("org.test.controller.status.400", "", null); + + for (String metricName : notMatchingMetricNamed) { + Assertions.assertThat(pattern.matches(metricName)) + .as("Matching [%s] against [%s]", metricName, pattern.getPatternString()) + .isFalse(); + } + } + + @Test + public void match_WHEN_MatchingMetricNameProvided_THEN_ShouldMatch() { + final GraphiteNamePattern pattern = new GraphiteNamePattern("org.test.controller.*.status.*"); + final List matchingMetricNamed = + Arrays.asList( + "org.test.controller.gather.status.400", + "org.test.controller.gather2.status.500", + "org.test.controller.gather1.status.", + "org.test.controller.*.status.*", + "org.test.controller..status.*"); + + for (String metricName : matchingMetricNamed) { + Assertions.assertThat(pattern.matches(metricName)) + .as("Matching [%s] against [%s]", metricName, pattern.getPatternString()) + .isTrue(); + } + } + + @Test + public void extractParameters() { + GraphiteNamePattern pattern; + Map expected = new HashMap(); + expected.put("${0}", "gather"); + expected.put("${1}", "400"); + pattern = new GraphiteNamePattern("org.test.controller.*.status.*"); + Assertions.assertThat(pattern.extractParameters("org.test.controller.gather.status.400")) + .isEqualTo(expected); + + expected = new HashMap(); + expected.put("${0}", "org"); + expected.put("${1}", "gather"); + expected.put("${2}", "400"); + pattern = new GraphiteNamePattern("*.test.controller.*.status.*"); + Assertions.assertThat(pattern.extractParameters("org.test.controller.gather.status.400")) + .isEqualTo(expected); + } + + @Test + public void extractParameters_WHEN_emptyStringInDottedMetricsName_THEN_ShouldReturnEmptyString() { + GraphiteNamePattern pattern; + Map expected = new HashMap(); + expected.put("${0}", ""); + expected.put("${1}", "400"); + pattern = new GraphiteNamePattern("org.test.controller.*.status.*"); + Assertions.assertThat(pattern.extractParameters("org.test.controller..status.400")) + .isEqualTo(expected); + } + + @Test + public void extractParameters_WHEN_moreDots_THEN_ShouldReturnNoMatches() { + GraphiteNamePattern pattern; + pattern = new GraphiteNamePattern("org.test.controller.*.status.*"); + Assertions.assertThat(pattern.extractParameters("org.test.controller...status.400")) + .isEqualTo(Collections.emptyMap()); + } +} diff --git a/prometheus-metrics-instrumentation-dropwizard5/src/test/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/MapperConfigTest.java b/prometheus-metrics-instrumentation-dropwizard5/src/test/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/MapperConfigTest.java new file mode 100644 index 000000000..a17963e0d --- /dev/null +++ b/prometheus-metrics-instrumentation-dropwizard5/src/test/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/MapperConfigTest.java @@ -0,0 +1,59 @@ +package io.prometheus.metrics.instrumentation.dropwizard5.labels; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class MapperConfigTest { + @Test + public void setMatch_WHEN_ExpressionMatchesPattern_AllGood() { + final MapperConfig mapperConfig = new MapperConfig(); + mapperConfig.setMatch("com.company.meter.*"); + assertThat(mapperConfig.getMatch()).isEqualTo("com.company.meter.*"); + } + + @Test + public void setMatch_WHEN_ExpressionDoesnNotMatchPattern_ThrowException() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> new MapperConfig().setMatch("com.company.meter.**.yay")); + } + + @Test + public void setLabels_WHEN_ExpressionMatchesPattern_AllGood() { + final MapperConfig mapperConfig = new MapperConfig(); + final Map labels = new HashMap<>(); + labels.put("valid", "${0}"); + mapperConfig.setLabels(labels); + assertThat(mapperConfig.getLabels()).isEqualTo(labels); + } + + @Test + public void setLabels_WHEN_ExpressionDoesnNotMatchPattern_ThrowException() { + final MapperConfig mapperConfig = new MapperConfig(); + final Map labels = new HashMap<>(); + labels.put("valid", "${0}"); + labels.put("not valid", "${0}"); + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> mapperConfig.setLabels(labels)); + } + + @Test + public void toString_WHEN_EmptyConfig_AllGood() { + final MapperConfig mapperConfig = new MapperConfig(); + assertThat(mapperConfig).hasToString("MapperConfig{match=null, name=null, labels={}}"); + } + + @Test + public void toString_WHEN_FullyConfigured_AllGood() { + final MapperConfig mapperConfig = new MapperConfig(); + mapperConfig.setMatch("com.company.meter.*.foo"); + mapperConfig.setName("foo"); + mapperConfig.setLabels(Collections.singletonMap("type", "${0}")); + assertThat(mapperConfig) + .hasToString("MapperConfig{match=com.company.meter.*.foo, name=foo, labels={type=${0}}}"); + } +} diff --git a/prometheus-metrics-instrumentation-dropwizard5/version-rules.xml b/prometheus-metrics-instrumentation-dropwizard5/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-instrumentation-dropwizard5/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-instrumentation-guava/pom.xml b/prometheus-metrics-instrumentation-guava/pom.xml new file mode 100644 index 000000000..b086151b6 --- /dev/null +++ b/prometheus-metrics-instrumentation-guava/pom.xml @@ -0,0 +1,51 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-instrumentation-guava + bundle + + Prometheus Metrics Instrumentation - Guava + + Instrumentation library guava based caches + + + + io.prometheus.metrics.instrumentation.guava + + + + + pheyken + Petar Heyken + mail@petar-heyken.de + + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + com.google.guava + guava + ${guava.version} + provided + + + io.prometheus + prometheus-metrics-exposition-textformats + ${project.version} + test + + + diff --git a/prometheus-metrics-instrumentation-guava/src/main/java/io/prometheus/metrics/instrumentation/guava/CacheMetricsCollector.java b/prometheus-metrics-instrumentation-guava/src/main/java/io/prometheus/metrics/instrumentation/guava/CacheMetricsCollector.java new file mode 100644 index 000000000..42473c686 --- /dev/null +++ b/prometheus-metrics-instrumentation-guava/src/main/java/io/prometheus/metrics/instrumentation/guava/CacheMetricsCollector.java @@ -0,0 +1,223 @@ +package io.prometheus.metrics.instrumentation.guava; + +import com.google.common.cache.Cache; +import com.google.common.cache.CacheStats; +import com.google.common.cache.LoadingCache; +import io.prometheus.metrics.model.registry.MultiCollector; +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +/** + * Collect metrics from Guava's com.google.common.cache.Cache. + * + *

    + * + *

    {@code
    + * // Note that `recordStats()` is required to gather non-zero statistics
    + * Cache cache = CacheBuilder.newBuilder().recordStats().build();
    + * CacheMetricsCollector cacheMetrics = new CacheMetricsCollector();
    + * PrometheusRegistry.defaultRegistry.register(cacheMetrics);
    + * cacheMetrics.addCache("mycache", cache);
    + *
    + * }
    + * + * Exposed metrics are labeled with the provided cache name. + * + *

    With the example above, sample metric names would be: + * + *

    + *     guava_cache_hit_total{cache="mycache"} 10.0
    + *     guava_cache_miss_total{cache="mycache"} 3.0
    + *     guava_cache_requests_total{cache="mycache"} 13.0
    + *     guava_cache_eviction_total{cache="mycache"} 1.0
    + *     guava_cache_size{cache="mycache"} 5.0
    + * 
    + * + * Additionally, if the cache includes a loader, the following metrics would be provided: + * + *
    + *     guava_cache_load_failure_total{cache="mycache"} 2.0
    + *     guava_cache_loads_total{cache="mycache"} 7.0
    + *     guava_cache_load_duration_seconds_count{cache="mycache"} 7.0
    + *     guava_cache_load_duration_seconds_sum{cache="mycache"} 0.0034
    + * 
    + */ +public class CacheMetricsCollector implements MultiCollector { + + private static final double NANOSECONDS_PER_SECOND = 1_000_000_000.0; + + private static final String METRIC_NAME_CACHE_HIT = "guava_cache_hit"; + private static final String METRIC_NAME_CACHE_MISS = "guava_cache_miss"; + private static final String METRIC_NAME_CACHE_REQUESTS = "guava_cache_requests"; + private static final String METRIC_NAME_CACHE_EVICTION = "guava_cache_eviction"; + private static final String METRIC_NAME_CACHE_LOAD_FAILURE = "guava_cache_load_failure"; + private static final String METRIC_NAME_CACHE_LOADS = "guava_cache_loads"; + private static final String METRIC_NAME_CACHE_SIZE = "guava_cache_size"; + private static final String METRIC_NAME_CACHE_LOAD_DURATION_SECONDS = + "guava_cache_load_duration_seconds"; + + private static final List ALL_METRIC_NAMES = + Collections.unmodifiableList( + Arrays.asList( + METRIC_NAME_CACHE_HIT, + METRIC_NAME_CACHE_MISS, + METRIC_NAME_CACHE_REQUESTS, + METRIC_NAME_CACHE_EVICTION, + METRIC_NAME_CACHE_LOAD_FAILURE, + METRIC_NAME_CACHE_LOADS, + METRIC_NAME_CACHE_SIZE, + METRIC_NAME_CACHE_LOAD_DURATION_SECONDS)); + + protected final ConcurrentMap> children = new ConcurrentHashMap<>(); + + /** + * Add or replace the cache with the given name. + * + *

    Any references any previous cache with this name is invalidated. + * + * @param cacheName The name of the cache, will be the metrics label value + * @param cache The cache being monitored + */ + public void addCache(String cacheName, Cache cache) { + children.put(cacheName, cache); + } + + /** + * Remove the cache with the given name. + * + *

    Any references to the cache are invalidated. + * + * @param cacheName cache to be removed + */ + public Cache removeCache(String cacheName) { + return children.remove(cacheName); + } + + /** + * Remove all caches. + * + *

    Any references to all caches are invalidated. + */ + public void clear() { + children.clear(); + } + + @Override + public MetricSnapshots collect() { + final MetricSnapshots.Builder metricSnapshotsBuilder = MetricSnapshots.builder(); + final List labelNames = Collections.singletonList("cache"); + + final CounterSnapshot.Builder cacheHitTotal = + CounterSnapshot.builder().name(METRIC_NAME_CACHE_HIT).help("Cache hit totals"); + + final CounterSnapshot.Builder cacheMissTotal = + CounterSnapshot.builder().name(METRIC_NAME_CACHE_MISS).help("Cache miss totals"); + + final CounterSnapshot.Builder cacheRequestsTotal = + CounterSnapshot.builder().name(METRIC_NAME_CACHE_REQUESTS).help("Cache request totals"); + + final CounterSnapshot.Builder cacheEvictionTotal = + CounterSnapshot.builder() + .name(METRIC_NAME_CACHE_EVICTION) + .help("Cache eviction totals, doesn't include manually removed entries"); + + final CounterSnapshot.Builder cacheLoadFailure = + CounterSnapshot.builder().name(METRIC_NAME_CACHE_LOAD_FAILURE).help("Cache load failures"); + + final CounterSnapshot.Builder cacheLoadTotal = + CounterSnapshot.builder() + .name(METRIC_NAME_CACHE_LOADS) + .help("Cache loads: both success and failures"); + + final GaugeSnapshot.Builder cacheSize = + GaugeSnapshot.builder().name(METRIC_NAME_CACHE_SIZE).help("Cache size"); + + final SummarySnapshot.Builder cacheLoadSummary = + SummarySnapshot.builder() + .name(METRIC_NAME_CACHE_LOAD_DURATION_SECONDS) + .help("Cache load duration: both success and failures"); + + for (final Map.Entry> c : children.entrySet()) { + final List cacheName = Collections.singletonList(c.getKey()); + final Labels labels = Labels.of(labelNames, cacheName); + + final CacheStats stats = c.getValue().stats(); + + cacheHitTotal.dataPoint( + CounterSnapshot.CounterDataPointSnapshot.builder() + .labels(labels) + .value(stats.hitCount()) + .build()); + + cacheMissTotal.dataPoint( + CounterSnapshot.CounterDataPointSnapshot.builder() + .labels(labels) + .value(stats.missCount()) + .build()); + + cacheRequestsTotal.dataPoint( + CounterSnapshot.CounterDataPointSnapshot.builder() + .labels(labels) + .value(stats.requestCount()) + .build()); + + cacheEvictionTotal.dataPoint( + CounterSnapshot.CounterDataPointSnapshot.builder() + .labels(labels) + .value(stats.evictionCount()) + .build()); + + cacheSize.dataPoint( + GaugeSnapshot.GaugeDataPointSnapshot.builder() + .labels(labels) + .value(c.getValue().size()) + .build()); + + if (c.getValue() instanceof LoadingCache) { + cacheLoadFailure.dataPoint( + CounterSnapshot.CounterDataPointSnapshot.builder() + .labels(labels) + .value(stats.loadExceptionCount()) + .build()); + + cacheLoadTotal.dataPoint( + CounterSnapshot.CounterDataPointSnapshot.builder() + .labels(labels) + .value(stats.loadCount()) + .build()); + + cacheLoadSummary.dataPoint( + SummarySnapshot.SummaryDataPointSnapshot.builder() + .labels(labels) + .count(stats.loadCount()) + .sum(stats.totalLoadTime() / NANOSECONDS_PER_SECOND) + .build()); + } + } + + metricSnapshotsBuilder.metricSnapshot(cacheHitTotal.build()); + metricSnapshotsBuilder.metricSnapshot(cacheMissTotal.build()); + metricSnapshotsBuilder.metricSnapshot(cacheRequestsTotal.build()); + metricSnapshotsBuilder.metricSnapshot(cacheEvictionTotal.build()); + metricSnapshotsBuilder.metricSnapshot(cacheLoadFailure.build()); + metricSnapshotsBuilder.metricSnapshot(cacheLoadTotal.build()); + metricSnapshotsBuilder.metricSnapshot(cacheSize.build()); + metricSnapshotsBuilder.metricSnapshot(cacheLoadSummary.build()); + + return metricSnapshotsBuilder.build(); + } + + @Override + public List getPrometheusNames() { + return ALL_METRIC_NAMES; + } +} diff --git a/prometheus-metrics-instrumentation-guava/src/test/java/io/prometheus/metrics/instrumentation/guava/CacheMetricsCollectorTest.java b/prometheus-metrics-instrumentation-guava/src/test/java/io/prometheus/metrics/instrumentation/guava/CacheMetricsCollectorTest.java new file mode 100644 index 000000000..31da91f20 --- /dev/null +++ b/prometheus-metrics-instrumentation-guava/src/test/java/io/prometheus/metrics/instrumentation/guava/CacheMetricsCollectorTest.java @@ -0,0 +1,171 @@ +package io.prometheus.metrics.instrumentation.guava; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.expositionformats.OpenMetricsTextFormatWriter; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.*; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.util.List; +import org.junit.jupiter.api.Test; + +class CacheMetricsCollectorTest { + + @Test + public void cacheExposesMetricsForHitMissAndEviction() { + final Cache cache = + CacheBuilder.newBuilder().maximumSize(2).recordStats().build(); + + final CacheMetricsCollector collector = new CacheMetricsCollector(); + collector.addCache("users", cache); + + final PrometheusRegistry registry = new PrometheusRegistry(); + registry.register(collector); + + cache.getIfPresent("user1"); + cache.getIfPresent("user1"); + cache.put("user1", "First User"); + cache.getIfPresent("user1"); + + // Add to cache to trigger eviction. + cache.put("user2", "Second User"); + cache.put("user3", "Third User"); + cache.put("user4", "Fourth User"); + + assertCounterMetric(registry, "guava_cache_hit", "users", 1.0); + assertCounterMetric(registry, "guava_cache_miss", "users", 2.0); + assertCounterMetric(registry, "guava_cache_requests", "users", 3.0); + assertCounterMetric(registry, "guava_cache_eviction", "users", 2.0); + + final String expected = + """ + # TYPE guava_cache_eviction counter + # HELP guava_cache_eviction Cache eviction totals, doesn't include manually removed entries + guava_cache_eviction_total{cache="users"} 2.0 + # TYPE guava_cache_hit counter + # HELP guava_cache_hit Cache hit totals + guava_cache_hit_total{cache="users"} 1.0 + # TYPE guava_cache_miss counter + # HELP guava_cache_miss Cache miss totals + guava_cache_miss_total{cache="users"} 2.0 + # TYPE guava_cache_requests counter + # HELP guava_cache_requests Cache request totals + guava_cache_requests_total{cache="users"} 3.0 + # TYPE guava_cache_size gauge + # HELP guava_cache_size Cache size + guava_cache_size{cache="users"} 2.0 + # EOF + """; + + assertThat(convertToOpenMetricsFormat(registry)).isEqualTo(expected); + } + + @SuppressWarnings("unchecked") + @Test + public void loadingCacheExposesMetricsForLoadsAndExceptions() throws Exception { + final CacheLoader loader = mock(CacheLoader.class); + when(loader.load(anyString())) + .thenReturn("First User") + .thenThrow(new RuntimeException("Seconds time fails")) + .thenReturn("Third User"); + + final LoadingCache cache = + CacheBuilder.newBuilder().recordStats().build(loader); + final CacheMetricsCollector collector = new CacheMetricsCollector(); + collector.addCache("loadingusers", cache); + + final PrometheusRegistry registry = new PrometheusRegistry(); + registry.register(collector); + + cache.get("user1"); + cache.get("user1"); + try { + cache.get("user2"); + } catch (Exception e) { + // ignoring. + } + cache.get("user3"); + + assertCounterMetric(registry, "guava_cache_hit", "loadingusers", 1.0); + assertCounterMetric(registry, "guava_cache_miss", "loadingusers", 3.0); + + assertCounterMetric(registry, "guava_cache_load_failure", "loadingusers", 1.0); + assertCounterMetric(registry, "guava_cache_loads", "loadingusers", 3.0); + + final SummarySnapshot.SummaryDataPointSnapshot loadDuration = + (SummarySnapshot.SummaryDataPointSnapshot) + getDataPointSnapshot(registry, "guava_cache_load_duration_seconds", "loadingusers"); + + assertThat(loadDuration.getCount()).isEqualTo(3); + assertThat(loadDuration.getSum()).isGreaterThan(0); + } + + @Test + public void getPrometheusNamesHasSameSizeAsMetricSizeWhenScraping() { + final CacheMetricsCollector collector = new CacheMetricsCollector(); + + final PrometheusRegistry registry = new PrometheusRegistry(); + registry.register(collector); + + final MetricSnapshots metricSnapshots = registry.scrape(); + final List prometheusNames = collector.getPrometheusNames(); + + assertThat(prometheusNames).hasSize(metricSnapshots.size()); + } + + @Test + public void collectedMetricNamesAreKnownPrometheusNames() { + final CacheMetricsCollector collector = new CacheMetricsCollector(); + + final PrometheusRegistry registry = new PrometheusRegistry(); + registry.register(collector); + + final MetricSnapshots metricSnapshots = registry.scrape(); + final List prometheusNames = collector.getPrometheusNames(); + + metricSnapshots.forEach( + metricSnapshot -> + assertThat(prometheusNames).contains(metricSnapshot.getMetadata().getPrometheusName())); + } + + private void assertCounterMetric( + PrometheusRegistry registry, String name, String cacheName, double value) { + final CounterSnapshot.CounterDataPointSnapshot dataPointSnapshot = + (CounterSnapshot.CounterDataPointSnapshot) getDataPointSnapshot(registry, name, cacheName); + + assertThat(dataPointSnapshot.getValue()).isEqualTo(value); + } + + private DataPointSnapshot getDataPointSnapshot( + PrometheusRegistry registry, String name, String cacheName) { + final Labels labels = Labels.of(new String[] {"cache"}, new String[] {cacheName}); + + return registry.scrape(name::equals).stream() + .flatMap(metricSnapshot -> metricSnapshot.getDataPoints().stream()) + .filter(dataPoint -> dataPoint.getLabels().equals(labels)) + .findFirst() + .get(); + } + + private String convertToOpenMetricsFormat(PrometheusRegistry registry) { + final ByteArrayOutputStream out = new ByteArrayOutputStream(); + final OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter(true, true); + try { + writer.write(out, registry.scrape(), EscapingScheme.ALLOW_UTF8); + return out.toString(StandardCharsets.UTF_8); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } +} diff --git a/prometheus-metrics-instrumentation-guava/version-rules.xml b/prometheus-metrics-instrumentation-guava/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-instrumentation-guava/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-instrumentation-jvm/pom.xml b/prometheus-metrics-instrumentation-jvm/pom.xml new file mode 100644 index 000000000..e7b379207 --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/pom.xml @@ -0,0 +1,46 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-instrumentation-jvm + bundle + + Prometheus Metrics Instrumentation - JVM + + Instrumentation library for JVM metrics + + + + io.prometheus.metrics.instrumentation.jvm + 0.55 + + + + + io.prometheus + prometheus-metrics-core + ${project.version} + + + + + io.prometheus + prometheus-metrics-exporter-httpserver + ${project.version} + test + + + io.prometheus + prometheus-metrics-exposition-textformats + ${project.version} + test + + + diff --git a/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmBufferPoolMetrics.java b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmBufferPoolMetrics.java new file mode 100644 index 000000000..8fc4b87e9 --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmBufferPoolMetrics.java @@ -0,0 +1,146 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.metrics.GaugeWithCallback; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.Unit; +import java.lang.management.BufferPoolMXBean; +import java.lang.management.ManagementFactory; +import java.util.List; +import javax.annotation.Nullable; + +/** + * JVM Buffer Pool metrics. The {@link JvmBufferPoolMetrics} are registered as part of the {@link + * JvmMetrics} like this: + * + *

    {@code
    + * JvmMetrics.builder().register();
    + * }
    + * + * However, if you want only the {@link JvmBufferPoolMetrics} you can also register them directly: + * + *
    {@code
    + * JvmBufferPoolMetrics.builder().register();
    + * }
    + * + * Example metrics being exported: + * + *
    + * # HELP jvm_buffer_pool_capacity_bytes Bytes capacity of a given JVM buffer pool.
    + * # TYPE jvm_buffer_pool_capacity_bytes gauge
    + * jvm_buffer_pool_capacity_bytes{pool="direct"} 8192.0
    + * jvm_buffer_pool_capacity_bytes{pool="mapped"} 0.0
    + * # HELP jvm_buffer_pool_used_buffers Used buffers of a given JVM buffer pool.
    + * # TYPE jvm_buffer_pool_used_buffers gauge
    + * jvm_buffer_pool_used_buffers{pool="direct"} 1.0
    + * jvm_buffer_pool_used_buffers{pool="mapped"} 0.0
    + * # HELP jvm_buffer_pool_used_bytes Used bytes of a given JVM buffer pool.
    + * # TYPE jvm_buffer_pool_used_bytes gauge
    + * jvm_buffer_pool_used_bytes{pool="direct"} 8192.0
    + * jvm_buffer_pool_used_bytes{pool="mapped"} 0.0
    + * 
    + */ +public class JvmBufferPoolMetrics { + + private static final String JVM_BUFFER_POOL_USED_BYTES = "jvm_buffer_pool_used_bytes"; + private static final String JVM_BUFFER_POOL_CAPACITY_BYTES = "jvm_buffer_pool_capacity_bytes"; + private static final String JVM_BUFFER_POOL_USED_BUFFERS = "jvm_buffer_pool_used_buffers"; + + private final PrometheusProperties config; + private final List bufferPoolBeans; + private final Labels constLabels; + + private JvmBufferPoolMetrics( + List bufferPoolBeans, PrometheusProperties config, Labels constLabels) { + this.config = config; + this.bufferPoolBeans = bufferPoolBeans; + this.constLabels = constLabels; + } + + private void register(PrometheusRegistry registry) { + + GaugeWithCallback.builder(config) + .name(JVM_BUFFER_POOL_USED_BYTES) + .help("Used bytes of a given JVM buffer pool.") + .unit(Unit.BYTES) + .labelNames("pool") + .callback( + callback -> { + for (BufferPoolMXBean pool : bufferPoolBeans) { + callback.call(pool.getMemoryUsed(), pool.getName()); + } + }) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_BUFFER_POOL_CAPACITY_BYTES) + .help("Bytes capacity of a given JVM buffer pool.") + .unit(Unit.BYTES) + .labelNames("pool") + .callback( + callback -> { + for (BufferPoolMXBean pool : bufferPoolBeans) { + callback.call(pool.getTotalCapacity(), pool.getName()); + } + }) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_BUFFER_POOL_USED_BUFFERS) + .help("Used buffers of a given JVM buffer pool.") + .labelNames("pool") + .callback( + callback -> { + for (BufferPoolMXBean pool : bufferPoolBeans) { + callback.call(pool.getCount(), pool.getName()); + } + }) + .constLabels(constLabels) + .register(registry); + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder { + + private final PrometheusProperties config; + @Nullable private List bufferPoolBeans; + private Labels constLabels = Labels.EMPTY; + + private Builder(PrometheusProperties config) { + this.config = config; + } + + public Builder constLabels(Labels constLabels) { + this.constLabels = constLabels; + return this; + } + + /** Package private. For testing only. */ + Builder bufferPoolBeans(List bufferPoolBeans) { + this.bufferPoolBeans = bufferPoolBeans; + return this; + } + + public void register() { + register(PrometheusRegistry.defaultRegistry); + } + + public void register(PrometheusRegistry registry) { + List bufferPoolBeans = this.bufferPoolBeans; + if (bufferPoolBeans == null) { + bufferPoolBeans = ManagementFactory.getPlatformMXBeans(BufferPoolMXBean.class); + } + new JvmBufferPoolMetrics(bufferPoolBeans, config, constLabels).register(registry); + } + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmClassLoadingMetrics.java b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmClassLoadingMetrics.java new file mode 100644 index 000000000..34e9dcb8a --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmClassLoadingMetrics.java @@ -0,0 +1,125 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.metrics.CounterWithCallback; +import io.prometheus.metrics.core.metrics.GaugeWithCallback; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Labels; +import java.lang.management.ClassLoadingMXBean; +import java.lang.management.ManagementFactory; +import javax.annotation.Nullable; + +/** + * JVM Class Loading metrics. The {@link JvmClassLoadingMetrics} are registered as part of the + * {@link JvmMetrics} like this: + * + *
    {@code
    + * JvmMetrics.builder().register();
    + * }
    + * + * However, if you want only the {@link JvmClassLoadingMetrics} you can also register them directly: + * + *
    {@code
    + * JvmClassLoadingMetrics.builder().register();
    + * }
    + * + * Example metrics being exported: + * + *
    + * # HELP jvm_classes_currently_loaded The number of classes that are currently loaded in the JVM
    + * # TYPE jvm_classes_currently_loaded gauge
    + * jvm_classes_currently_loaded 1109.0
    + * # HELP jvm_classes_loaded_total The total number of classes that have been loaded since the JVM has started execution
    + * # TYPE jvm_classes_loaded_total counter
    + * jvm_classes_loaded_total 1109.0
    + * # HELP jvm_classes_unloaded_total The total number of classes that have been unloaded since the JVM has started execution
    + * # TYPE jvm_classes_unloaded_total counter
    + * jvm_classes_unloaded_total 0.0
    + * 
    + */ +public class JvmClassLoadingMetrics { + + private static final String JVM_CLASSES_CURRENTLY_LOADED = "jvm_classes_currently_loaded"; + private static final String JVM_CLASSES_LOADED_TOTAL = "jvm_classes_loaded_total"; + private static final String JVM_CLASSES_UNLOADED_TOTAL = "jvm_classes_unloaded_total"; + + private final PrometheusProperties config; + private final ClassLoadingMXBean classLoadingBean; + private final Labels constLabels; + + private JvmClassLoadingMetrics( + ClassLoadingMXBean classLoadingBean, PrometheusProperties config, Labels constLabels) { + this.classLoadingBean = classLoadingBean; + this.config = config; + this.constLabels = constLabels; + } + + private void register(PrometheusRegistry registry) { + + GaugeWithCallback.builder(config) + .name(JVM_CLASSES_CURRENTLY_LOADED) + .help("The number of classes that are currently loaded in the JVM") + .callback(callback -> callback.call(classLoadingBean.getLoadedClassCount())) + .constLabels(constLabels) + .register(registry); + + CounterWithCallback.builder(config) + .name(JVM_CLASSES_LOADED_TOTAL) + .help( + "The total number of classes that have been loaded since the JVM has started execution") + .callback(callback -> callback.call(classLoadingBean.getTotalLoadedClassCount())) + .constLabels(constLabels) + .register(registry); + + CounterWithCallback.builder(config) + .name(JVM_CLASSES_UNLOADED_TOTAL) + .help( + "The total number of classes that have been unloaded since the JVM has " + + "started execution") + .callback(callback -> callback.call(classLoadingBean.getUnloadedClassCount())) + .constLabels(constLabels) + .register(registry); + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder { + + private final PrometheusProperties config; + @Nullable private ClassLoadingMXBean classLoadingBean; + private Labels constLabels = Labels.EMPTY; + + private Builder(PrometheusProperties config) { + this.config = config; + } + + public Builder constLabels(Labels constLabels) { + this.constLabels = constLabels; + return this; + } + + /** Package private. For testing only. */ + Builder classLoadingBean(ClassLoadingMXBean classLoadingBean) { + this.classLoadingBean = classLoadingBean; + return this; + } + + public void register() { + register(PrometheusRegistry.defaultRegistry); + } + + public void register(PrometheusRegistry registry) { + ClassLoadingMXBean classLoadingBean = + this.classLoadingBean != null + ? this.classLoadingBean + : ManagementFactory.getClassLoadingMXBean(); + new JvmClassLoadingMetrics(classLoadingBean, config, constLabels).register(registry); + } + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmCompilationMetrics.java b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmCompilationMetrics.java new file mode 100644 index 000000000..975b6c6a3 --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmCompilationMetrics.java @@ -0,0 +1,109 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import static io.prometheus.metrics.model.snapshots.Unit.millisToSeconds; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.metrics.CounterWithCallback; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.Unit; +import java.lang.management.CompilationMXBean; +import java.lang.management.ManagementFactory; +import javax.annotation.Nullable; + +/** + * JVM Compilation metrics. The {@link JvmCompilationMetrics} are registered as part of the {@link + * JvmMetrics} like this: + * + *
    {@code
    + * JvmMetrics.builder().register();
    + * }
    + * + * However, if you want only the {@link JvmCompilationMetrics} you can also register them directly: + * + *
    {@code
    + * JvmCompilationMetrics.builder().register();
    + * }
    + * + * Example metrics being exported: + * + *
    + * # HELP jvm_compilation_time_seconds_total The total time in seconds taken for HotSpot class compilation
    + * # TYPE jvm_compilation_time_seconds_total counter
    + * jvm_compilation_time_seconds_total 0.152
    + * 
    + */ +public class JvmCompilationMetrics { + + private static final String JVM_COMPILATION_TIME_SECONDS_TOTAL = + "jvm_compilation_time_seconds_total"; + + private final PrometheusProperties config; + private final CompilationMXBean compilationBean; + private final Labels constLabels; + + private JvmCompilationMetrics( + CompilationMXBean compilationBean, PrometheusProperties config, Labels constLabels) { + this.compilationBean = compilationBean; + this.config = config; + this.constLabels = constLabels; + } + + private void register(PrometheusRegistry registry) { + + if (compilationBean == null || !compilationBean.isCompilationTimeMonitoringSupported()) { + return; + } + + CounterWithCallback.builder(config) + .name(JVM_COMPILATION_TIME_SECONDS_TOTAL) + .help("The total time in seconds taken for HotSpot class compilation") + .unit(Unit.SECONDS) + .callback( + callback -> callback.call(millisToSeconds(compilationBean.getTotalCompilationTime()))) + .constLabels(constLabels) + .register(registry); + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder { + + private final PrometheusProperties config; + @Nullable private CompilationMXBean compilationBean; + private Labels constLabels = Labels.EMPTY; + + private Builder(PrometheusProperties config) { + this.config = config; + } + + public Builder constLabels(Labels constLabels) { + this.constLabels = constLabels; + return this; + } + + /** Package private. For testing only. */ + Builder compilationBean(CompilationMXBean compilationBean) { + this.compilationBean = compilationBean; + return this; + } + + public void register() { + register(PrometheusRegistry.defaultRegistry); + } + + public void register(PrometheusRegistry registry) { + CompilationMXBean compilationBean = + this.compilationBean != null + ? this.compilationBean + : ManagementFactory.getCompilationMXBean(); + new JvmCompilationMetrics(compilationBean, config, constLabels).register(registry); + } + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmGarbageCollectorMetrics.java b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmGarbageCollectorMetrics.java new file mode 100644 index 000000000..a87b52a4f --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmGarbageCollectorMetrics.java @@ -0,0 +1,119 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.metrics.SummaryWithCallback; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.Quantiles; +import io.prometheus.metrics.model.snapshots.Unit; +import java.lang.management.GarbageCollectorMXBean; +import java.lang.management.ManagementFactory; +import java.util.List; +import javax.annotation.Nullable; + +/** + * JVM Garbage Collector metrics. The {@link JvmGarbageCollectorMetrics} are registered as part of + * the {@link JvmMetrics} like this: + * + *
    {@code
    + * JvmMetrics.builder().register();
    + * }
    + * + * However, if you want only the {@link JvmGarbageCollectorMetrics} you can also register them + * directly: + * + *
    {@code
    + * JvmGarbageCollectorMetrics.builder().register();
    + * }
    + * + * Example metrics being exported: + * + *
    + * # HELP jvm_gc_collection_seconds Time spent in a given JVM garbage collector in seconds.
    + * # TYPE jvm_gc_collection_seconds summary
    + * jvm_gc_collection_seconds_count{gc="PS MarkSweep"} 0
    + * jvm_gc_collection_seconds_sum{gc="PS MarkSweep"} 0.0
    + * jvm_gc_collection_seconds_count{gc="PS Scavenge"} 0
    + * jvm_gc_collection_seconds_sum{gc="PS Scavenge"} 0.0
    + * 
    + */ +public class JvmGarbageCollectorMetrics { + + private static final String JVM_GC_COLLECTION_SECONDS = "jvm_gc_collection_seconds"; + + private final PrometheusProperties config; + private final List garbageCollectorBeans; + private final Labels constLabels; + + private JvmGarbageCollectorMetrics( + List garbageCollectorBeans, + PrometheusProperties config, + Labels constLabels) { + this.config = config; + this.garbageCollectorBeans = garbageCollectorBeans; + this.constLabels = constLabels; + } + + private void register(PrometheusRegistry registry) { + + SummaryWithCallback.builder(config) + .name(JVM_GC_COLLECTION_SECONDS) + .help("Time spent in a given JVM garbage collector in seconds.") + .unit(Unit.SECONDS) + .labelNames("gc") + .callback( + callback -> { + for (GarbageCollectorMXBean gc : garbageCollectorBeans) { + callback.call( + gc.getCollectionCount(), + Unit.millisToSeconds(gc.getCollectionTime()), + Quantiles.EMPTY, + gc.getName()); + } + }) + .constLabels(constLabels) + .register(registry); + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder { + + private final PrometheusProperties config; + @Nullable private List garbageCollectorBeans; + private Labels constLabels = Labels.EMPTY; + + private Builder(PrometheusProperties config) { + this.config = config; + } + + public Builder constLabels(Labels constLabels) { + this.constLabels = constLabels; + return this; + } + + /** Package private. For testing only. */ + Builder garbageCollectorBeans(List garbageCollectorBeans) { + this.garbageCollectorBeans = garbageCollectorBeans; + return this; + } + + public void register() { + register(PrometheusRegistry.defaultRegistry); + } + + public void register(PrometheusRegistry registry) { + List garbageCollectorBeans = this.garbageCollectorBeans; + if (garbageCollectorBeans == null) { + garbageCollectorBeans = ManagementFactory.getGarbageCollectorMXBeans(); + } + new JvmGarbageCollectorMetrics(garbageCollectorBeans, config, constLabels).register(registry); + } + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmMemoryMetrics.java b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmMemoryMetrics.java new file mode 100644 index 000000000..1b34dba6c --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmMemoryMetrics.java @@ -0,0 +1,345 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.metrics.GaugeWithCallback; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.Unit; +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryMXBean; +import java.lang.management.MemoryPoolMXBean; +import java.lang.management.MemoryUsage; +import java.util.List; +import java.util.function.Consumer; +import java.util.function.Function; +import javax.annotation.Nullable; + +/** + * JVM memory metrics. The {@link JvmMemoryMetrics} are registered as part of the {@link JvmMetrics} + * like this: + * + *
    {@code
    + * JvmMetrics.builder().register();
    + * }
    + * + * However, if you want only the {@link JvmMemoryMetrics} you can also register them directly: + * + *
    {@code
    + * JvmMemoryMetrics.builder().register();
    + * }
    + * + * Example metrics being exported: + * + *
    + * # HELP jvm_memory_committed_bytes Committed (bytes) of a given JVM memory area.
    + * # TYPE jvm_memory_committed_bytes gauge
    + * jvm_memory_committed_bytes{area="heap"} 4.98597888E8
    + * jvm_memory_committed_bytes{area="nonheap"} 1.1993088E7
    + * # HELP jvm_memory_init_bytes Initial bytes of a given JVM memory area.
    + * # TYPE jvm_memory_init_bytes gauge
    + * jvm_memory_init_bytes{area="heap"} 5.20093696E8
    + * jvm_memory_init_bytes{area="nonheap"} 2555904.0
    + * # HELP jvm_memory_max_bytes Max (bytes) of a given JVM memory area.
    + * # TYPE jvm_memory_max_bytes gauge
    + * jvm_memory_max_bytes{area="heap"} 7.38983936E9
    + * jvm_memory_max_bytes{area="nonheap"} -1.0
    + * # HELP jvm_memory_objects_pending_finalization The number of objects waiting in the finalizer queue.
    + * # TYPE jvm_memory_objects_pending_finalization gauge
    + * jvm_memory_objects_pending_finalization 0.0
    + * # HELP jvm_memory_pool_collection_committed_bytes Committed after last collection bytes of a given JVM memory pool.
    + * # TYPE jvm_memory_pool_collection_committed_bytes gauge
    + * jvm_memory_pool_collection_committed_bytes{pool="PS Eden Space"} 1.30023424E8
    + * jvm_memory_pool_collection_committed_bytes{pool="PS Old Gen"} 3.47078656E8
    + * jvm_memory_pool_collection_committed_bytes{pool="PS Survivor Space"} 2.1495808E7
    + * # HELP jvm_memory_pool_collection_init_bytes Initial after last collection bytes of a given JVM memory pool.
    + * # TYPE jvm_memory_pool_collection_init_bytes gauge
    + * jvm_memory_pool_collection_init_bytes{pool="PS Eden Space"} 1.30023424E8
    + * jvm_memory_pool_collection_init_bytes{pool="PS Old Gen"} 3.47078656E8
    + * jvm_memory_pool_collection_init_bytes{pool="PS Survivor Space"} 2.1495808E7
    + * # HELP jvm_memory_pool_collection_max_bytes Max bytes after last collection of a given JVM memory pool.
    + * # TYPE jvm_memory_pool_collection_max_bytes gauge
    + * jvm_memory_pool_collection_max_bytes{pool="PS Eden Space"} 2.727870464E9
    + * jvm_memory_pool_collection_max_bytes{pool="PS Old Gen"} 5.542248448E9
    + * jvm_memory_pool_collection_max_bytes{pool="PS Survivor Space"} 2.1495808E7
    + * # HELP jvm_memory_pool_collection_used_bytes Used bytes after last collection of a given JVM memory pool.
    + * # TYPE jvm_memory_pool_collection_used_bytes gauge
    + * jvm_memory_pool_collection_used_bytes{pool="PS Eden Space"} 0.0
    + * jvm_memory_pool_collection_used_bytes{pool="PS Old Gen"} 1249696.0
    + * jvm_memory_pool_collection_used_bytes{pool="PS Survivor Space"} 0.0
    + * # HELP jvm_memory_pool_committed_bytes Committed bytes of a given JVM memory pool.
    + * # TYPE jvm_memory_pool_committed_bytes gauge
    + * jvm_memory_pool_committed_bytes{pool="Code Cache"} 4128768.0
    + * jvm_memory_pool_committed_bytes{pool="Compressed Class Space"} 917504.0
    + * jvm_memory_pool_committed_bytes{pool="Metaspace"} 6946816.0
    + * jvm_memory_pool_committed_bytes{pool="PS Eden Space"} 1.30023424E8
    + * jvm_memory_pool_committed_bytes{pool="PS Old Gen"} 3.47078656E8
    + * jvm_memory_pool_committed_bytes{pool="PS Survivor Space"} 2.1495808E7
    + * # HELP jvm_memory_pool_init_bytes Initial bytes of a given JVM memory pool.
    + * # TYPE jvm_memory_pool_init_bytes gauge
    + * jvm_memory_pool_init_bytes{pool="Code Cache"} 2555904.0
    + * jvm_memory_pool_init_bytes{pool="Compressed Class Space"} 0.0
    + * jvm_memory_pool_init_bytes{pool="Metaspace"} 0.0
    + * jvm_memory_pool_init_bytes{pool="PS Eden Space"} 1.30023424E8
    + * jvm_memory_pool_init_bytes{pool="PS Old Gen"} 3.47078656E8
    + * jvm_memory_pool_init_bytes{pool="PS Survivor Space"} 2.1495808E7
    + * # HELP jvm_memory_pool_max_bytes Max bytes of a given JVM memory pool.
    + * # TYPE jvm_memory_pool_max_bytes gauge
    + * jvm_memory_pool_max_bytes{pool="Code Cache"} 2.5165824E8
    + * jvm_memory_pool_max_bytes{pool="Compressed Class Space"} 1.073741824E9
    + * jvm_memory_pool_max_bytes{pool="Metaspace"} -1.0
    + * jvm_memory_pool_max_bytes{pool="PS Eden Space"} 2.727870464E9
    + * jvm_memory_pool_max_bytes{pool="PS Old Gen"} 5.542248448E9
    + * jvm_memory_pool_max_bytes{pool="PS Survivor Space"} 2.1495808E7
    + * # HELP jvm_memory_pool_used_bytes Used bytes of a given JVM memory pool.
    + * # TYPE jvm_memory_pool_used_bytes gauge
    + * jvm_memory_pool_used_bytes{pool="Code Cache"} 4065472.0
    + * jvm_memory_pool_used_bytes{pool="Compressed Class Space"} 766680.0
    + * jvm_memory_pool_used_bytes{pool="Metaspace"} 6659432.0
    + * jvm_memory_pool_used_bytes{pool="PS Eden Space"} 7801536.0
    + * jvm_memory_pool_used_bytes{pool="PS Old Gen"} 1249696.0
    + * jvm_memory_pool_used_bytes{pool="PS Survivor Space"} 0.0
    + * # HELP jvm_memory_used_bytes Used bytes of a given JVM memory area.
    + * # TYPE jvm_memory_used_bytes gauge
    + * jvm_memory_used_bytes{area="heap"} 9051232.0
    + * jvm_memory_used_bytes{area="nonheap"} 1.1490688E7
    + * 
    + */ +public class JvmMemoryMetrics { + + private static final String JVM_MEMORY_OBJECTS_PENDING_FINALIZATION = + "jvm_memory_objects_pending_finalization"; + private static final String JVM_MEMORY_USED_BYTES = "jvm_memory_used_bytes"; + private static final String JVM_MEMORY_COMMITTED_BYTES = "jvm_memory_committed_bytes"; + private static final String JVM_MEMORY_MAX_BYTES = "jvm_memory_max_bytes"; + private static final String JVM_MEMORY_INIT_BYTES = "jvm_memory_init_bytes"; + private static final String JVM_MEMORY_POOL_USED_BYTES = "jvm_memory_pool_used_bytes"; + private static final String JVM_MEMORY_POOL_COMMITTED_BYTES = "jvm_memory_pool_committed_bytes"; + private static final String JVM_MEMORY_POOL_MAX_BYTES = "jvm_memory_pool_max_bytes"; + private static final String JVM_MEMORY_POOL_INIT_BYTES = "jvm_memory_pool_init_bytes"; + private static final String JVM_MEMORY_POOL_COLLECTION_USED_BYTES = + "jvm_memory_pool_collection_used_bytes"; + private static final String JVM_MEMORY_POOL_COLLECTION_COMMITTED_BYTES = + "jvm_memory_pool_collection_committed_bytes"; + private static final String JVM_MEMORY_POOL_COLLECTION_MAX_BYTES = + "jvm_memory_pool_collection_max_bytes"; + private static final String JVM_MEMORY_POOL_COLLECTION_INIT_BYTES = + "jvm_memory_pool_collection_init_bytes"; + + private final PrometheusProperties config; + private final MemoryMXBean memoryBean; + private final List poolBeans; + private final Labels constLabels; + + private JvmMemoryMetrics( + List poolBeans, + MemoryMXBean memoryBean, + PrometheusProperties config, + Labels constLabels) { + this.config = config; + this.poolBeans = poolBeans; + this.memoryBean = memoryBean; + this.constLabels = constLabels; + } + + private void register(PrometheusRegistry registry) { + + GaugeWithCallback.builder(config) + .name(JVM_MEMORY_OBJECTS_PENDING_FINALIZATION) + .help("The number of objects waiting in the finalizer queue.") + .callback(callback -> callback.call(memoryBean.getObjectPendingFinalizationCount())) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_MEMORY_USED_BYTES) + .help("Used bytes of a given JVM memory area.") + .unit(Unit.BYTES) + .labelNames("area") + .callback( + callback -> { + callback.call(memoryBean.getHeapMemoryUsage().getUsed(), "heap"); + callback.call(memoryBean.getNonHeapMemoryUsage().getUsed(), "nonheap"); + }) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_MEMORY_COMMITTED_BYTES) + .help("Committed (bytes) of a given JVM memory area.") + .unit(Unit.BYTES) + .labelNames("area") + .callback( + callback -> { + callback.call(memoryBean.getHeapMemoryUsage().getCommitted(), "heap"); + callback.call(memoryBean.getNonHeapMemoryUsage().getCommitted(), "nonheap"); + }) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_MEMORY_MAX_BYTES) + .help("Max (bytes) of a given JVM memory area.") + .unit(Unit.BYTES) + .labelNames("area") + .callback( + callback -> { + callback.call(memoryBean.getHeapMemoryUsage().getMax(), "heap"); + callback.call(memoryBean.getNonHeapMemoryUsage().getMax(), "nonheap"); + }) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_MEMORY_INIT_BYTES) + .help("Initial bytes of a given JVM memory area.") + .unit(Unit.BYTES) + .labelNames("area") + .callback( + callback -> { + callback.call(memoryBean.getHeapMemoryUsage().getInit(), "heap"); + callback.call(memoryBean.getNonHeapMemoryUsage().getInit(), "nonheap"); + }) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_MEMORY_POOL_USED_BYTES) + .help("Used bytes of a given JVM memory pool.") + .unit(Unit.BYTES) + .labelNames("pool") + .callback(makeCallback(poolBeans, MemoryPoolMXBean::getUsage, MemoryUsage::getUsed)) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_MEMORY_POOL_COMMITTED_BYTES) + .help("Committed bytes of a given JVM memory pool.") + .unit(Unit.BYTES) + .labelNames("pool") + .callback(makeCallback(poolBeans, MemoryPoolMXBean::getUsage, MemoryUsage::getCommitted)) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_MEMORY_POOL_MAX_BYTES) + .help("Max bytes of a given JVM memory pool.") + .unit(Unit.BYTES) + .labelNames("pool") + .callback(makeCallback(poolBeans, MemoryPoolMXBean::getUsage, MemoryUsage::getMax)) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_MEMORY_POOL_INIT_BYTES) + .help("Initial bytes of a given JVM memory pool.") + .unit(Unit.BYTES) + .labelNames("pool") + .callback(makeCallback(poolBeans, MemoryPoolMXBean::getUsage, MemoryUsage::getInit)) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_MEMORY_POOL_COLLECTION_USED_BYTES) + .help("Used bytes after last collection of a given JVM memory pool.") + .unit(Unit.BYTES) + .labelNames("pool") + .callback( + makeCallback(poolBeans, MemoryPoolMXBean::getCollectionUsage, MemoryUsage::getUsed)) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_MEMORY_POOL_COLLECTION_COMMITTED_BYTES) + .help("Committed after last collection bytes of a given JVM memory pool.") + .unit(Unit.BYTES) + .labelNames("pool") + .callback( + makeCallback( + poolBeans, MemoryPoolMXBean::getCollectionUsage, MemoryUsage::getCommitted)) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_MEMORY_POOL_COLLECTION_MAX_BYTES) + .help("Max bytes after last collection of a given JVM memory pool.") + .unit(Unit.BYTES) + .labelNames("pool") + .callback( + makeCallback(poolBeans, MemoryPoolMXBean::getCollectionUsage, MemoryUsage::getMax)) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_MEMORY_POOL_COLLECTION_INIT_BYTES) + .help("Initial after last collection bytes of a given JVM memory pool.") + .unit(Unit.BYTES) + .labelNames("pool") + .callback( + makeCallback(poolBeans, MemoryPoolMXBean::getCollectionUsage, MemoryUsage::getInit)) + .constLabels(constLabels) + .register(registry); + } + + private Consumer makeCallback( + List poolBeans, + Function memoryUsageFunc, + Function valueFunc) { + return callback -> { + for (MemoryPoolMXBean pool : poolBeans) { + MemoryUsage poolUsage = memoryUsageFunc.apply(pool); + if (poolUsage != null) { + callback.call(valueFunc.apply(poolUsage), pool.getName()); + } + } + }; + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder { + + private final PrometheusProperties config; + @Nullable private MemoryMXBean memoryBean; + @Nullable private List poolBeans; + private Labels constLabels = Labels.EMPTY; + + private Builder(PrometheusProperties config) { + this.config = config; + } + + public Builder constLabels(Labels constLabels) { + this.constLabels = constLabels; + return this; + } + + /** Package private. For testing only. */ + Builder withMemoryBean(MemoryMXBean memoryBean) { + this.memoryBean = memoryBean; + return this; + } + + /** Package private. For testing only. */ + Builder withMemoryPoolBeans(List memoryPoolBeans) { + this.poolBeans = memoryPoolBeans; + return this; + } + + public void register() { + register(PrometheusRegistry.defaultRegistry); + } + + public void register(PrometheusRegistry registry) { + MemoryMXBean bean = + this.memoryBean != null ? this.memoryBean : ManagementFactory.getMemoryMXBean(); + List poolBeans = + this.poolBeans != null ? this.poolBeans : ManagementFactory.getMemoryPoolMXBeans(); + new JvmMemoryMetrics(poolBeans, bean, config, constLabels).register(registry); + } + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmMemoryPoolAllocationMetrics.java b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmMemoryPoolAllocationMetrics.java new file mode 100644 index 000000000..5dfb4199b --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmMemoryPoolAllocationMetrics.java @@ -0,0 +1,187 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import com.sun.management.GarbageCollectionNotificationInfo; +import com.sun.management.GcInfo; +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.metrics.Counter; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Labels; +import java.lang.management.GarbageCollectorMXBean; +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryUsage; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Nullable; +import javax.management.Notification; +import javax.management.NotificationEmitter; +import javax.management.NotificationListener; +import javax.management.openmbean.CompositeData; + +/** + * JVM memory allocation metrics. The {@link JvmMemoryPoolAllocationMetrics} are registered as part + * of the {@link JvmMetrics} like this: + * + *
    {@code
    + * JvmMetrics.builder().register();
    + * }
    + * + * However, if you want only the {@link JvmMemoryPoolAllocationMetrics} you can also register them + * directly: + * + *
    {@code
    + * JvmMemoryAllocationMetrics.builder().register();
    + * }
    + * + * Example metrics being exported: + * + *
    + * # HELP jvm_memory_pool_allocated_bytes_total Total bytes allocated in a given JVM memory pool. Only updated after GC, not continuously.
    + * # TYPE jvm_memory_pool_allocated_bytes_total counter
    + * jvm_memory_pool_allocated_bytes_total{pool="Code Cache"} 4336448.0
    + * jvm_memory_pool_allocated_bytes_total{pool="Compressed Class Space"} 875016.0
    + * jvm_memory_pool_allocated_bytes_total{pool="Metaspace"} 7480456.0
    + * jvm_memory_pool_allocated_bytes_total{pool="PS Eden Space"} 1.79232824E8
    + * jvm_memory_pool_allocated_bytes_total{pool="PS Old Gen"} 1428888.0
    + * jvm_memory_pool_allocated_bytes_total{pool="PS Survivor Space"} 4115280.0
    + * 
    + */ +public class JvmMemoryPoolAllocationMetrics { + + private static final String JVM_MEMORY_POOL_ALLOCATED_BYTES_TOTAL = + "jvm_memory_pool_allocated_bytes_total"; + + private final List garbageCollectorBeans; + private final Labels constLabels; + + private JvmMemoryPoolAllocationMetrics( + List garbageCollectorBeans, Labels constLabels) { + this.garbageCollectorBeans = garbageCollectorBeans; + this.constLabels = constLabels; + } + + private void register(PrometheusRegistry registry) { + Counter allocatedCounter = + Counter.builder() + .name(JVM_MEMORY_POOL_ALLOCATED_BYTES_TOTAL) + .help( + "Total bytes allocated in a given JVM memory pool. Only updated after GC, " + + "not continuously.") + .labelNames("pool") + .constLabels(constLabels) + .register(registry); + + AllocationCountingNotificationListener listener = + new AllocationCountingNotificationListener(allocatedCounter); + for (GarbageCollectorMXBean bean : garbageCollectorBeans) { + if (bean instanceof NotificationEmitter) { + ((NotificationEmitter) bean).addNotificationListener(listener, null, null); + } + } + } + + static class AllocationCountingNotificationListener implements NotificationListener { + + private final Map lastMemoryUsage = new HashMap<>(); + private final Counter counter; + + AllocationCountingNotificationListener(Counter counter) { + this.counter = counter; + } + + @Override + public synchronized void handleNotification(Notification notification, Object handback) { + GarbageCollectionNotificationInfo info = + GarbageCollectionNotificationInfo.from((CompositeData) notification.getUserData()); + GcInfo gcInfo = info.getGcInfo(); + Map memoryUsageBeforeGc = gcInfo.getMemoryUsageBeforeGc(); + Map memoryUsageAfterGc = gcInfo.getMemoryUsageAfterGc(); + for (Map.Entry entry : memoryUsageBeforeGc.entrySet()) { + String memoryPool = entry.getKey(); + long before = entry.getValue().getUsed(); + long after = Objects.requireNonNull(memoryUsageAfterGc.get(memoryPool)).getUsed(); + handleMemoryPool(memoryPool, before, after); + } + } + + // Visible for testing + void handleMemoryPool(String memoryPool, long before, long after) { + /* + * Calculate increase in the memory pool by comparing memory used + * after last GC, before this GC, and after this GC. + * See ascii illustration below. + * Make sure to count only increases and ignore decreases. + * (Typically a pool will only increase between GCs or during GCs, not both. + * E.g. eden pools between GCs. Survivor and old generation pools during GCs.) + * + * |<-- diff1 -->|<-- diff2 -->| + * Timeline: |-- last GC --| |---- GC -----| + * ___^__ ___^____ ___^___ + * Mem. usage vars: / last \ / before \ / after \ + */ + + // Get last memory usage after GC and remember memory used after for next time + long last = getAndSet(lastMemoryUsage, memoryPool, after); + // Difference since last GC + long diff1 = before - last; + // Difference during this GC + long diff2 = after - before; + // Make sure to only count increases + if (diff1 < 0) { + diff1 = 0; + } + if (diff2 < 0) { + diff2 = 0; + } + long increase = diff1 + diff2; + if (increase > 0) { + counter.labelValues(memoryPool).inc(increase); + } + } + + private static long getAndSet(Map map, String key, long value) { + Long last = map.put(key, value); + return last == null ? 0 : last; + } + } + + public static Builder builder() { + return new Builder(); + } + + @SuppressWarnings("unused") + public static Builder builder(PrometheusProperties config) { + return new Builder(); + } + + public static class Builder { + @Nullable private List garbageCollectorBeans; + private Labels constLabels = Labels.EMPTY; + + private Builder() {} + + public Builder constLabels(Labels constLabels) { + this.constLabels = constLabels; + return this; + } + + /** Package private. For testing only. */ + Builder withGarbageCollectorBeans(List garbageCollectorBeans) { + this.garbageCollectorBeans = garbageCollectorBeans; + return this; + } + + public void register() { + register(PrometheusRegistry.defaultRegistry); + } + + public void register(PrometheusRegistry registry) { + List garbageCollectorBeans = this.garbageCollectorBeans; + if (garbageCollectorBeans == null) { + garbageCollectorBeans = ManagementFactory.getGarbageCollectorMXBeans(); + } + new JvmMemoryPoolAllocationMetrics(garbageCollectorBeans, constLabels).register(registry); + } + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmMetrics.java b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmMetrics.java new file mode 100644 index 000000000..b0abd86b1 --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmMetrics.java @@ -0,0 +1,79 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Labels; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Registers all JVM metrics. Example usage: + * + *
    {@code
    + * JvmMetrics.builder().register();
    + * }
    + */ +public class JvmMetrics { + + private static final Set REGISTERED = ConcurrentHashMap.newKeySet(); + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + // Note: Currently there is no configuration for JVM metrics, so it doesn't matter whether you + // pass a config or not. + // However, we will add config options in the future, like whether you want to use Prometheus + // naming conventions + // or OpenTelemetry semantic conventions for JVM metrics. + public static Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder { + + private final PrometheusProperties config; + private Labels constLabels = Labels.EMPTY; + + private Builder(PrometheusProperties config) { + this.config = config; + } + + /** Set constant labels that will be applied to all JVM metrics registered by this builder. */ + public Builder constLabels(Labels constLabels) { + this.constLabels = constLabels; + return this; + } + + /** + * Register all JVM metrics with the default registry. + * + *

    It's safe to call this multiple times, only the first call will register the metrics, all + * subsequent calls will be ignored. + */ + public void register() { + register(PrometheusRegistry.defaultRegistry); + } + + /** + * Register all JVM metrics with the {@code registry}. + * + *

    It's safe to call this multiple times, only the first call will register the metrics, all + * subsequent calls will be ignored. + */ + public void register(PrometheusRegistry registry) { + if (REGISTERED.add(registry)) { + JvmThreadsMetrics.builder(config).constLabels(constLabels).register(registry); + JvmBufferPoolMetrics.builder(config).constLabels(constLabels).register(registry); + JvmClassLoadingMetrics.builder(config).constLabels(constLabels).register(registry); + JvmCompilationMetrics.builder(config).constLabels(constLabels).register(registry); + JvmGarbageCollectorMetrics.builder(config).constLabels(constLabels).register(registry); + JvmMemoryPoolAllocationMetrics.builder(config).constLabels(constLabels).register(registry); + JvmMemoryMetrics.builder(config).constLabels(constLabels).register(registry); + JvmNativeMemoryMetrics.builder(config).constLabels(constLabels).register(registry); + JvmRuntimeInfoMetric.builder(config).constLabels(constLabels).register(registry); + ProcessMetrics.builder(config).constLabels(constLabels).register(registry); + } + } + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmNativeMemoryMetrics.java b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmNativeMemoryMetrics.java new file mode 100644 index 000000000..f2ae98abf --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmNativeMemoryMetrics.java @@ -0,0 +1,234 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.metrics.GaugeWithCallback; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.Unit; +import java.lang.management.ManagementFactory; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.Consumer; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.management.InstanceNotFoundException; +import javax.management.MBeanException; +import javax.management.MalformedObjectNameException; +import javax.management.ObjectName; +import javax.management.ReflectionException; + +/** + * JVM native memory. JVM native memory tracking is disabled by default. You need to enable it by + * starting your JVM with this flag: + * + *

    -XX:NativeMemoryTracking=summary
    + * + *

    When native memory tracking is disabled the metrics are not registered either. + * + *

    + * + *

    The {@link JvmNativeMemoryMetrics} are registered as part of the {@link JvmMetrics} like this: + * + *

    {@code
    + * JvmMetrics.builder().register();
    + * }
    + * + * However, if you want only the {@link JvmNativeMemoryMetrics} you can also register them directly: + * + *
    {@code
    + * JvmNativeMemoryMetrics.builder().register();
    + * }
    + * + * Example metrics being exported: + * + *
    + * # HELP jvm_native_memory_committed_bytes Committed bytes of a given JVM. Committed memory represents the amount of memory the JVM is using right now.
    + * # TYPE jvm_native_memory_committed_bytes gauge
    + * jvm_native_memory_committed_bytes{pool="Arena Chunk"} 58480.0
    + * jvm_native_memory_committed_bytes{pool="Arguments"} 25119.0
    + * jvm_native_memory_committed_bytes{pool="Class"} 1.00609438E8
    + * jvm_native_memory_committed_bytes{pool="Code"} 2.7980888E7
    + * jvm_native_memory_committed_bytes{pool="Compiler"} 529922.0
    + * jvm_native_memory_committed_bytes{pool="GC"} 515466.0
    + * jvm_native_memory_committed_bytes{pool="Internal"} 673194.0
    + * jvm_native_memory_committed_bytes{pool="Java Heap"} 4.0923136E7
    + * jvm_native_memory_committed_bytes{pool="Logging"} 4596.0
    + * jvm_native_memory_committed_bytes{pool="Module"} 96408.0
    + * jvm_native_memory_committed_bytes{pool="Native Memory Tracking"} 3929432.0
    + * jvm_native_memory_committed_bytes{pool="Other"} 667656.0
    + * jvm_native_memory_committed_bytes{pool="Safepoint"} 8192.0
    + * jvm_native_memory_committed_bytes{pool="Symbol"} 2.4609808E7
    + * jvm_native_memory_committed_bytes{pool="Synchronizer"} 272520.0
    + * jvm_native_memory_committed_bytes{pool="Thread"} 3546896.0
    + * jvm_native_memory_committed_bytes{pool="Total"} 2.0448392E8
    + * jvm_native_memory_committed_bytes{pool="Tracing"} 1.0
    + * jvm_native_memory_committed_bytes{pool="Unknown"} 32768.0
    + * # HELP jvm_native_memory_reserved_bytes Reserved bytes of a given JVM. Reserved memory represents the total amount of memory the JVM can potentially use.
    + * # TYPE jvm_native_memory_reserved_bytes gauge
    + * jvm_native_memory_reserved_bytes{pool="Arena Chunk"} 25736.0
    + * jvm_native_memory_reserved_bytes{pool="Arguments"} 25119.0
    + * jvm_native_memory_reserved_bytes{pool="Class"} 1.162665374E9
    + * jvm_native_memory_reserved_bytes{pool="Code"} 2.55386712E8
    + * jvm_native_memory_reserved_bytes{pool="Compiler"} 529922.0
    + * jvm_native_memory_reserved_bytes{pool="GC"} 1695114.0
    + * jvm_native_memory_reserved_bytes{pool="Internal"} 673191.0
    + * jvm_native_memory_reserved_bytes{pool="Java Heap"} 4.02653184E8
    + * jvm_native_memory_reserved_bytes{pool="Logging"} 4596.0
    + * jvm_native_memory_reserved_bytes{pool="Module"} 96408.0
    + * jvm_native_memory_reserved_bytes{pool="Native Memory Tracking"} 3929400.0
    + * jvm_native_memory_reserved_bytes{pool="Other"} 667656.0
    + * jvm_native_memory_reserved_bytes{pool="Safepoint"} 8192.0
    + * jvm_native_memory_reserved_bytes{pool="Symbol"} 2.4609808E7
    + * jvm_native_memory_reserved_bytes{pool="Synchronizer"} 272520.0
    + * jvm_native_memory_reserved_bytes{pool="Thread"} 3.383272E7
    + * jvm_native_memory_reserved_bytes{pool="Total"} 1.887108421E9
    + * jvm_native_memory_reserved_bytes{pool="Tracing"} 1.0
    + * jvm_native_memory_reserved_bytes{pool="Unknown"} 32768.0
    + * 
    + */ +public class JvmNativeMemoryMetrics { + private static final String JVM_NATIVE_MEMORY_RESERVED_BYTES = "jvm_native_memory_reserved_bytes"; + private static final String JVM_NATIVE_MEMORY_COMMITTED_BYTES = + "jvm_native_memory_committed_bytes"; + + private static final Pattern pattern = + Pattern.compile("\\s*([A-Z][A-Za-z\\s]*[A-Za-z]+).*reserved=(\\d+), committed=(\\d+)"); + + /** Package private. For testing only. */ + static final AtomicBoolean isEnabled = new AtomicBoolean(true); + + private final PrometheusProperties config; + private final PlatformMBeanServerAdapter adapter; + private final Labels constLabels; + + private JvmNativeMemoryMetrics( + PrometheusProperties config, PlatformMBeanServerAdapter adapter, Labels constLabels) { + this.config = config; + this.adapter = adapter; + this.constLabels = constLabels; + } + + private void register(PrometheusRegistry registry) { + // first call will check if enabled and set the flag + vmNativeMemorySummaryInBytesOrEmpty(); + if (isEnabled.get()) { + GaugeWithCallback.builder(config) + .name(JVM_NATIVE_MEMORY_RESERVED_BYTES) + .help( + "Reserved bytes of a given JVM. Reserved memory represents the total amount of " + + "memory the JVM can potentially use.") + .unit(Unit.BYTES) + .labelNames("pool") + .callback(makeCallback(true)) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_NATIVE_MEMORY_COMMITTED_BYTES) + .help( + "Committed bytes of a given JVM. Committed memory represents the amount of " + + "memory the JVM is using right now.") + .unit(Unit.BYTES) + .labelNames("pool") + .callback(makeCallback(false)) + .constLabels(constLabels) + .register(registry); + } + } + + private Consumer makeCallback(Boolean reserved) { + return callback -> { + String summary = vmNativeMemorySummaryInBytesOrEmpty(); + if (!summary.isEmpty()) { + Matcher matcher = pattern.matcher(summary); + while (matcher.find()) { + String category = matcher.group(1); + long value = + reserved ? Long.parseLong(matcher.group(2)) : Long.parseLong(matcher.group(3)); + callback.call(value, category); + } + } + }; + } + + private String vmNativeMemorySummaryInBytesOrEmpty() { + if (!isEnabled.get()) { + return ""; + } + try { + // requires -XX:NativeMemoryTracking=summary + String summary = adapter.vmNativeMemorySummaryInBytes(); + if (summary.isEmpty() || summary.trim().contains("Native memory tracking is not enabled")) { + isEnabled.set(false); + return ""; + } else { + return summary; + } + } catch (Exception ex) { + // ignore errors + isEnabled.set(false); + return ""; + } + } + + interface PlatformMBeanServerAdapter { + String vmNativeMemorySummaryInBytes(); + } + + static class DefaultPlatformMBeanServerAdapter implements PlatformMBeanServerAdapter { + @Override + public String vmNativeMemorySummaryInBytes() { + try { + return (String) + ManagementFactory.getPlatformMBeanServer() + .invoke( + new ObjectName("com.sun.management:type=DiagnosticCommand"), + "vmNativeMemory", + new Object[] {new String[] {"summary", "scale=B"}}, + new String[] {"[Ljava.lang.String;"}); + } catch (ReflectionException + | MalformedObjectNameException + | InstanceNotFoundException + | MBeanException e) { + throw new IllegalStateException("Native memory tracking is not enabled", e); + } + } + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder { + + private final PrometheusProperties config; + private final PlatformMBeanServerAdapter adapter; + private Labels constLabels = Labels.EMPTY; + + private Builder(PrometheusProperties config) { + this(config, new DefaultPlatformMBeanServerAdapter()); + } + + /** Package private. For testing only. */ + Builder(PrometheusProperties config, PlatformMBeanServerAdapter adapter) { + this.config = config; + this.adapter = adapter; + } + + public Builder constLabels(Labels constLabels) { + this.constLabels = constLabels; + return this; + } + + public void register() { + register(PrometheusRegistry.defaultRegistry); + } + + public void register(PrometheusRegistry registry) { + new JvmNativeMemoryMetrics(config, adapter, constLabels).register(registry); + } + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmRuntimeInfoMetric.java b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmRuntimeInfoMetric.java new file mode 100644 index 000000000..58363780f --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmRuntimeInfoMetric.java @@ -0,0 +1,124 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.metrics.Info; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Labels; +import javax.annotation.Nullable; + +/** + * JVM Runtime Info metric. The {@link JvmRuntimeInfoMetric} is registered as part of the {@link + * JvmMetrics} like this: + * + *
    {@code
    + * JvmMetrics.builder().register();
    + * }
    + * + * However, if you want only the {@link JvmRuntimeInfoMetric} you can also register them directly: + * + *
    {@code
    + * JvmRuntimeInfoMetric.builder().register();
    + * }
    + * + *
    + * # TYPE jvm_runtime info
    + * # HELP jvm_runtime JVM runtime info
    + * jvm_runtime_info{runtime="OpenJDK Runtime Environment",vendor="Oracle Corporation",version="1.8.0_382-b05"} 1
    + * 
    + */ +public class JvmRuntimeInfoMetric { + + private static final String JVM_RUNTIME_INFO = "jvm_runtime_info"; + + private final PrometheusProperties config; + private final String version; + private final String vendor; + private final String runtime; + private final Labels constLabels; + + private JvmRuntimeInfoMetric( + String version, + String vendor, + String runtime, + PrometheusProperties config, + Labels constLabels) { + this.config = config; + this.version = version; + this.vendor = vendor; + this.runtime = runtime; + this.constLabels = constLabels; + } + + private void register(PrometheusRegistry registry) { + + Info jvmInfo = + Info.builder(config) + .name(JVM_RUNTIME_INFO) + .help("JVM runtime info") + .labelNames("version", "vendor", "runtime") + .constLabels(constLabels) + .register(registry); + + jvmInfo.setLabelValues(version, vendor, runtime); + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder { + + private final PrometheusProperties config; + @Nullable private String version; + @Nullable private String vendor; + @Nullable private String runtime; + private Labels constLabels = Labels.EMPTY; + + private Builder(PrometheusProperties config) { + this.config = config; + } + + public Builder constLabels(Labels constLabels) { + this.constLabels = constLabels; + return this; + } + + /** Package private. For testing only. */ + Builder version(String version) { + this.version = version; + return this; + } + + /** Package private. For testing only. */ + Builder vendor(String vendor) { + this.vendor = vendor; + return this; + } + + /** Package private. For testing only. */ + Builder runtime(String runtime) { + this.runtime = runtime; + return this; + } + + public void register() { + register(PrometheusRegistry.defaultRegistry); + } + + public void register(PrometheusRegistry registry) { + String version = + this.version != null + ? this.version + : System.getProperty("java.runtime.version", "unknown"); + String vendor = + this.vendor != null ? this.vendor : System.getProperty("java.vm.vendor", "unknown"); + String runtime = + this.runtime != null ? this.runtime : System.getProperty("java.runtime.name", "unknown"); + new JvmRuntimeInfoMetric(version, vendor, runtime, config, constLabels).register(registry); + } + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmThreadsMetrics.java b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmThreadsMetrics.java new file mode 100644 index 000000000..0e98e29d3 --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/JvmThreadsMetrics.java @@ -0,0 +1,247 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import static java.util.Objects.requireNonNull; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.metrics.CounterWithCallback; +import io.prometheus.metrics.core.metrics.GaugeWithCallback; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Labels; +import java.lang.management.ManagementFactory; +import java.lang.management.ThreadInfo; +import java.lang.management.ThreadMXBean; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Nullable; + +/** + * JVM Thread metrics. The {@link JvmThreadsMetrics} are registered as part of the {@link + * JvmMetrics} like this: + * + *
    {@code
    + * JvmMetrics.builder().register();
    + * }
    + * + * However, if you want only the {@link JvmThreadsMetrics} you can also register them directly: + * + *
    {@code
    + * JvmThreadMetrics.builder().register();
    + * }
    + * + * Example metrics being exported: + * + *
    + * # HELP jvm_threads_current Current thread count of a JVM
    + * # TYPE jvm_threads_current gauge
    + * jvm_threads_current 10.0
    + * # HELP jvm_threads_daemon Daemon thread count of a JVM
    + * # TYPE jvm_threads_daemon gauge
    + * jvm_threads_daemon 8.0
    + * # HELP jvm_threads_deadlocked Cycles of JVM-threads that are in deadlock waiting to acquire object monitors or ownable synchronizers
    + * # TYPE jvm_threads_deadlocked gauge
    + * jvm_threads_deadlocked 0.0
    + * # HELP jvm_threads_deadlocked_monitor Cycles of JVM-threads that are in deadlock waiting to acquire object monitors
    + * # TYPE jvm_threads_deadlocked_monitor gauge
    + * jvm_threads_deadlocked_monitor 0.0
    + * # HELP jvm_threads_peak Peak thread count of a JVM
    + * # TYPE jvm_threads_peak gauge
    + * jvm_threads_peak 10.0
    + * # HELP jvm_threads_started_total Started thread count of a JVM
    + * # TYPE jvm_threads_started_total counter
    + * jvm_threads_started_total 10.0
    + * # HELP jvm_threads_state Current count of threads by state
    + * # TYPE jvm_threads_state gauge
    + * jvm_threads_state{state="BLOCKED"} 0.0
    + * jvm_threads_state{state="NEW"} 0.0
    + * jvm_threads_state{state="RUNNABLE"} 5.0
    + * jvm_threads_state{state="TERMINATED"} 0.0
    + * jvm_threads_state{state="TIMED_WAITING"} 2.0
    + * jvm_threads_state{state="UNKNOWN"} 0.0
    + * jvm_threads_state{state="WAITING"} 3.0
    + * 
    + */ +public class JvmThreadsMetrics { + + private static final String UNKNOWN = "UNKNOWN"; + private static final String JVM_THREADS_STATE = "jvm_threads_state"; + private static final String JVM_THREADS_CURRENT = "jvm_threads_current"; + private static final String JVM_THREADS_DAEMON = "jvm_threads_daemon"; + private static final String JVM_THREADS_PEAK = "jvm_threads_peak"; + private static final String JVM_THREADS_STARTED_TOTAL = "jvm_threads_started_total"; + private static final String JVM_THREADS_DEADLOCKED = "jvm_threads_deadlocked"; + private static final String JVM_THREADS_DEADLOCKED_MONITOR = "jvm_threads_deadlocked_monitor"; + + private final PrometheusProperties config; + private final ThreadMXBean threadBean; + private final boolean isNativeImage; + private final Labels constLabels; + + private JvmThreadsMetrics( + boolean isNativeImage, + ThreadMXBean threadBean, + PrometheusProperties config, + Labels constLabels) { + this.config = config; + this.threadBean = threadBean; + this.isNativeImage = isNativeImage; + this.constLabels = constLabels; + } + + private void register(PrometheusRegistry registry) { + + GaugeWithCallback.builder(config) + .name(JVM_THREADS_CURRENT) + .help("Current thread count of a JVM") + .callback(callback -> callback.call(threadBean.getThreadCount())) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_THREADS_DAEMON) + .help("Daemon thread count of a JVM") + .callback(callback -> callback.call(threadBean.getDaemonThreadCount())) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_THREADS_PEAK) + .help("Peak thread count of a JVM") + .callback(callback -> callback.call(threadBean.getPeakThreadCount())) + .constLabels(constLabels) + .register(registry); + + CounterWithCallback.builder(config) + .name(JVM_THREADS_STARTED_TOTAL) + .help("Started thread count of a JVM") + .callback(callback -> callback.call(threadBean.getTotalStartedThreadCount())) + .constLabels(constLabels) + .register(registry); + + if (!isNativeImage) { + GaugeWithCallback.builder(config) + .name(JVM_THREADS_DEADLOCKED) + .help( + "Cycles of JVM-threads that are in deadlock waiting to acquire object monitors or " + + "ownable synchronizers") + .callback( + callback -> callback.call(nullSafeArrayLength(threadBean.findDeadlockedThreads()))) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_THREADS_DEADLOCKED_MONITOR) + .help("Cycles of JVM-threads that are in deadlock waiting to acquire object monitors") + .callback( + callback -> + callback.call(nullSafeArrayLength(threadBean.findMonitorDeadlockedThreads()))) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(JVM_THREADS_STATE) + .help("Current count of threads by state") + .labelNames("state") + .callback( + callback -> { + Map threadStateCounts = getThreadStateCountMap(threadBean); + for (Map.Entry entry : threadStateCounts.entrySet()) { + callback.call(entry.getValue(), entry.getKey()); + } + }) + .constLabels(constLabels) + .register(registry); + } + } + + private Map getThreadStateCountMap(ThreadMXBean threadBean) { + long[] threadIds = threadBean.getAllThreadIds(); + + // Code to remove any thread id values <= 0 + int writePos = 0; + for (int i = 0; i < threadIds.length; i++) { + if (threadIds[i] > 0) { + threadIds[writePos++] = threadIds[i]; + } + } + + final int numberOfInvalidThreadIds = threadIds.length - writePos; + threadIds = Arrays.copyOf(threadIds, writePos); + + // Get thread information without computing any stack traces + ThreadInfo[] allThreads = threadBean.getThreadInfo(threadIds, 0); + + // Initialize the map with all thread states + Map threadCounts = new HashMap<>(); + for (Thread.State state : Thread.State.values()) { + threadCounts.put(state.name(), 0); + } + + // Collect the actual thread counts + for (ThreadInfo curThread : allThreads) { + if (curThread != null) { + Thread.State threadState = curThread.getThreadState(); + threadCounts.put( + threadState.name(), requireNonNull(threadCounts.get(threadState.name())) + 1); + } + } + + // Add the thread count for invalid thread ids + threadCounts.put(UNKNOWN, numberOfInvalidThreadIds); + + return threadCounts; + } + + private double nullSafeArrayLength(long[] array) { + return null == array ? 0 : array.length; + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder { + + private final PrometheusProperties config; + @Nullable private Boolean isNativeImage; + @Nullable private ThreadMXBean threadBean; + private Labels constLabels = Labels.EMPTY; + + private Builder(PrometheusProperties config) { + this.config = config; + } + + public Builder constLabels(Labels constLabels) { + this.constLabels = constLabels; + return this; + } + + /** Package private. For testing only. */ + Builder threadBean(ThreadMXBean threadBean) { + this.threadBean = threadBean; + return this; + } + + /** Package private. For testing only. */ + Builder isNativeImage(boolean isNativeImage) { + this.isNativeImage = isNativeImage; + return this; + } + + public void register() { + register(PrometheusRegistry.defaultRegistry); + } + + public void register(PrometheusRegistry registry) { + ThreadMXBean threadBean = + this.threadBean != null ? this.threadBean : ManagementFactory.getThreadMXBean(); + boolean isNativeImage = + this.isNativeImage != null ? this.isNativeImage : NativeImageChecker.isGraalVmNativeImage; + new JvmThreadsMetrics(isNativeImage, threadBean, config, constLabels).register(registry); + } + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/NativeImageChecker.java b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/NativeImageChecker.java new file mode 100644 index 000000000..e75350bce --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/NativeImageChecker.java @@ -0,0 +1,15 @@ +package io.prometheus.metrics.instrumentation.jvm; + +/** + * Contains utilities to check if we are running inside or building for native image. Default + * behavior is to check if specific for graalvm runtime property is present. For additional + * optimizations it is possible to do add + * "--initialize-at-build-time=io.prometheus.client.hotspot.NativeImageChecker" to graalvm native + * image build command and the native image will be identified during build time. + */ +class NativeImageChecker { + static final boolean isGraalVmNativeImage = + System.getProperty("org.graalvm.nativeimage.imagecode") != null; + + private NativeImageChecker() {} +} diff --git a/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/ProcessMetrics.java b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/ProcessMetrics.java new file mode 100644 index 000000000..b341f848a --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/main/java/io/prometheus/metrics/instrumentation/jvm/ProcessMetrics.java @@ -0,0 +1,330 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.core.metrics.CounterWithCallback; +import io.prometheus.metrics.core.metrics.GaugeWithCallback; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.Unit; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.lang.management.ManagementFactory; +import java.lang.management.OperatingSystemMXBean; +import java.lang.management.RuntimeMXBean; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import javax.annotation.Nullable; + +/** + * Process metrics. + * + *

    These metrics are defined in the process + * metrics section of the Prometheus client library documentation, and they are implemented + * across client libraries in multiple programming languages. + * + *

    Technically, some of them are OS-level metrics and not JVM-level metrics. However, I'm still + * putting them in the {@code prometheus-metrics-instrumentation-jvm} module, because first it seems + * overkill to create a separate Maven module just for the {@link ProcessMetrics} class, and seconds + * some of these metrics are coming from the JVM via JMX anyway. + * + *

    The {@link ProcessMetrics} are registered as part of the {@link JvmMetrics} like this: + * + *

    {@code
    + * JvmMetrics.builder().register();
    + * }
    + * + * However, if you want only the {@link ProcessMetrics} you can also register them directly: + * + *
    {@code
    + * ProcessMetrics.builder().register();
    + * }
    + * + * Example metrics being exported: + * + *
    + * # HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
    + * # TYPE process_cpu_seconds_total counter
    + * process_cpu_seconds_total 1.63
    + * # HELP process_max_fds Maximum number of open file descriptors.
    + * # TYPE process_max_fds gauge
    + * process_max_fds 524288.0
    + * # HELP process_open_fds Number of open file descriptors.
    + * # TYPE process_open_fds gauge
    + * process_open_fds 28.0
    + * # HELP process_resident_memory_bytes Resident memory size in bytes.
    + * # TYPE process_resident_memory_bytes gauge
    + * process_resident_memory_bytes 7.8577664E7
    + * # HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
    + * # TYPE process_start_time_seconds gauge
    + * process_start_time_seconds 1.693829439767E9
    + * # HELP process_virtual_memory_bytes Virtual memory size in bytes.
    + * # TYPE process_virtual_memory_bytes gauge
    + * process_virtual_memory_bytes 1.2683624448E10
    + * 
    + */ +public class ProcessMetrics { + + private static final String PROCESS_CPU_SECONDS_TOTAL = "process_cpu_seconds_total"; + private static final String PROCESS_START_TIME_SECONDS = "process_start_time_seconds"; + private static final String PROCESS_OPEN_FDS = "process_open_fds"; + private static final String PROCESS_MAX_FDS = "process_max_fds"; + private static final String PROCESS_VIRTUAL_MEMORY_BYTES = "process_virtual_memory_bytes"; + private static final String PROCESS_RESIDENT_MEMORY_BYTES = "process_resident_memory_bytes"; + + static final File PROC_SELF_STATUS = new File("/proc/self/status"); + + private final PrometheusProperties config; + private final OperatingSystemMXBean osBean; + private final RuntimeMXBean runtimeBean; + private final Grepper grepper; + private final boolean linux; + private final Labels constLabels; + + private ProcessMetrics( + OperatingSystemMXBean osBean, + RuntimeMXBean runtimeBean, + Grepper grepper, + PrometheusProperties config, + Labels constLabels) { + this.osBean = osBean; + this.runtimeBean = runtimeBean; + this.grepper = grepper; + this.config = config; + this.linux = PROC_SELF_STATUS.canRead(); + this.constLabels = constLabels; + } + + private void register(PrometheusRegistry registry) { + + CounterWithCallback.builder(config) + .name(PROCESS_CPU_SECONDS_TOTAL) + .help("Total user and system CPU time spent in seconds.") + .unit(Unit.SECONDS) + .callback( + callback -> { + try { + // There exist at least 2 similar but unrelated UnixOperatingSystemMXBean + // interfaces, in + // com.sun.management and com.ibm.lang.management. Hence use reflection and + // recursively go + // through implemented interfaces until the method can be made accessible and + // invoked. + Long processCpuTime = callLongGetter("getProcessCpuTime", osBean); + if (processCpuTime != null) { + callback.call(Unit.nanosToSeconds(processCpuTime)); + } + } catch (Exception ignored) { + // Ignored + } + }) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(PROCESS_START_TIME_SECONDS) + .help("Start time of the process since unix epoch in seconds.") + .unit(Unit.SECONDS) + .callback(callback -> callback.call(Unit.millisToSeconds(runtimeBean.getStartTime()))) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(PROCESS_OPEN_FDS) + .help("Number of open file descriptors.") + .callback( + callback -> { + try { + Long openFds = callLongGetter("getOpenFileDescriptorCount", osBean); + if (openFds != null) { + callback.call(openFds); + } + } catch (Exception ignored) { + // Ignored + } + }) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(PROCESS_MAX_FDS) + .help("Maximum number of open file descriptors.") + .callback( + callback -> { + try { + Long maxFds = callLongGetter("getMaxFileDescriptorCount", osBean); + if (maxFds != null) { + callback.call(maxFds); + } + } catch (Exception ignored) { + // Ignored + } + }) + .constLabels(constLabels) + .register(registry); + + if (linux) { + + GaugeWithCallback.builder(config) + .name(PROCESS_VIRTUAL_MEMORY_BYTES) + .help("Virtual memory size in bytes.") + .unit(Unit.BYTES) + .callback( + callback -> { + try { + String line = grepper.lineStartingWith(PROC_SELF_STATUS, "VmSize:"); + callback.call(Unit.kiloBytesToBytes(Double.parseDouble(line.split("\\s+")[1]))); + } catch (Exception ignored) { + // Ignored + } + }) + .constLabels(constLabels) + .register(registry); + + GaugeWithCallback.builder(config) + .name(PROCESS_RESIDENT_MEMORY_BYTES) + .help("Resident memory size in bytes.") + .unit(Unit.BYTES) + .callback( + callback -> { + try { + String line = grepper.lineStartingWith(PROC_SELF_STATUS, "VmRSS:"); + callback.call(Unit.kiloBytesToBytes(Double.parseDouble(line.split("\\s+")[1]))); + } catch (Exception ignored) { + // Ignored + } + }) + .constLabels(constLabels) + .register(registry); + } + } + + @Nullable + private Long callLongGetter(String getterName, Object obj) + throws NoSuchMethodException, InvocationTargetException { + return callLongGetter(obj.getClass().getMethod(getterName), obj); + } + + /** + * Attempts to call a method either directly or via one of the implemented interfaces. + * + *

    A Method object refers to a specific method declared in a specific class. The first + * invocation might happen with method == SomeConcreteClass.publicLongGetter() and will fail if + * SomeConcreteClass is not public. We then recurse over all interfaces implemented by + * SomeConcreteClass (or extended by those interfaces and so on) until we eventually invoke + * callMethod() with method == SomePublicInterface.publicLongGetter(), which will then succeed. + * + *

    There is a built-in assumption that the method will never return null (or, equivalently, + * that it returns the primitive data type, i.e. {@code long} rather than {@code Long}). If this + * assumption doesn't hold, the method might be called repeatedly and the returned value will be + * the one produced by the last call. + */ + @Nullable + private Long callLongGetter(Method method, Object obj) throws InvocationTargetException { + try { + return (Long) method.invoke(obj); + } catch (IllegalAccessException e) { + // Expected, the declaring class or interface might not be public. + } + + // Iterate over all implemented/extended interfaces and attempt invoking the method with the + // same name and parameters on each. + for (Class clazz : method.getDeclaringClass().getInterfaces()) { + try { + Method interfaceMethod = clazz.getMethod(method.getName(), method.getParameterTypes()); + Long result = callLongGetter(interfaceMethod, obj); + if (result != null) { + return result; + } + } catch (NoSuchMethodException e) { + // Expected, class might implement multiple, unrelated interfaces. + } + } + return null; + } + + interface Grepper { + String lineStartingWith(File file, String prefix) throws IOException; + } + + private static class FileGrepper implements Grepper { + + @Override + public String lineStartingWith(File file, String prefix) throws IOException { + try (BufferedReader reader = + new BufferedReader( + new InputStreamReader(Files.newInputStream(file.toPath()), StandardCharsets.UTF_8))) { + String line = reader.readLine(); + while (line != null) { + if (line.startsWith(prefix)) { + return line; + } + line = reader.readLine(); + } + } + throw new IllegalStateException( + String.format("File %s does not contain a line starting with '%s'.", file, prefix)); + } + } + + public static Builder builder() { + return new Builder(PrometheusProperties.get()); + } + + public static Builder builder(PrometheusProperties config) { + return new Builder(config); + } + + public static class Builder { + + private final PrometheusProperties config; + @Nullable private OperatingSystemMXBean osBean; + @Nullable private RuntimeMXBean runtimeBean; + @Nullable private Grepper grepper; + private Labels constLabels = Labels.EMPTY; + + private Builder(PrometheusProperties config) { + this.config = config; + } + + /** Package private. For testing only. */ + Builder osBean(OperatingSystemMXBean osBean) { + this.osBean = osBean; + return this; + } + + /** Package private. For testing only. */ + Builder runtimeBean(RuntimeMXBean runtimeBean) { + this.runtimeBean = runtimeBean; + return this; + } + + /** Package private. For testing only. */ + Builder grepper(Grepper grepper) { + this.grepper = grepper; + return this; + } + + public Builder constLabels(Labels constLabels) { + this.constLabels = constLabels; + return this; + } + + public void register() { + register(PrometheusRegistry.defaultRegistry); + } + + public void register(PrometheusRegistry registry) { + OperatingSystemMXBean osBean = + this.osBean != null ? this.osBean : ManagementFactory.getOperatingSystemMXBean(); + RuntimeMXBean bean = + this.runtimeBean != null ? this.runtimeBean : ManagementFactory.getRuntimeMXBean(); + Grepper grepper = this.grepper != null ? this.grepper : new FileGrepper(); + new ProcessMetrics(osBean, bean, grepper, config, constLabels).register(registry); + } + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/ExampleExporterForManualTesting.java b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/ExampleExporterForManualTesting.java new file mode 100644 index 000000000..0bea87baf --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/ExampleExporterForManualTesting.java @@ -0,0 +1,22 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import io.prometheus.metrics.exporter.httpserver.HTTPServer; +import java.io.IOException; + +class ExampleExporterForManualTesting { + + public static void main(String[] args) throws IOException, InterruptedException { + + JvmMetrics.builder().register(); + + HTTPServer server = HTTPServer.builder().port(9400).buildAndStart(); + + System.out.println( + "HTTPServer listening on port http://localhost:" + server.getPort() + "/metrics"); + + while (true) { + Thread.sleep(100); + Runtime.getRuntime().gc(); // Memory allocation metrics only start after GC run. + } + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmBufferPoolMetricsTest.java b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmBufferPoolMetricsTest.java new file mode 100644 index 000000000..e3bf55fb4 --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmBufferPoolMetricsTest.java @@ -0,0 +1,82 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import static io.prometheus.metrics.instrumentation.jvm.TestUtil.convertToOpenMetricsFormat; +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import io.prometheus.metrics.model.registry.MetricNameFilter; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.io.IOException; +import java.lang.management.BufferPoolMXBean; +import java.util.Arrays; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class JvmBufferPoolMetricsTest { + + private final BufferPoolMXBean directBuffer = Mockito.mock(BufferPoolMXBean.class); + private final BufferPoolMXBean mappedBuffer = Mockito.mock(BufferPoolMXBean.class); + + @BeforeEach + public void setUp() { + when(directBuffer.getName()).thenReturn("direct"); + when(directBuffer.getCount()).thenReturn(2L); + when(directBuffer.getMemoryUsed()).thenReturn(1234L); + when(directBuffer.getTotalCapacity()).thenReturn(3456L); + when(mappedBuffer.getName()).thenReturn("mapped"); + when(mappedBuffer.getCount()).thenReturn(3L); + when(mappedBuffer.getMemoryUsed()).thenReturn(2345L); + when(mappedBuffer.getTotalCapacity()).thenReturn(4567L); + } + + @Test + public void testGoodCase() throws IOException { + PrometheusRegistry registry = new PrometheusRegistry(); + JvmBufferPoolMetrics.builder() + .bufferPoolBeans(Arrays.asList(mappedBuffer, directBuffer)) + .register(registry); + MetricSnapshots snapshots = registry.scrape(); + + String expected = + """ + # TYPE jvm_buffer_pool_capacity_bytes gauge + # UNIT jvm_buffer_pool_capacity_bytes bytes + # HELP jvm_buffer_pool_capacity_bytes Bytes capacity of a given JVM buffer pool. + jvm_buffer_pool_capacity_bytes{pool="direct"} 3456.0 + jvm_buffer_pool_capacity_bytes{pool="mapped"} 4567.0 + # TYPE jvm_buffer_pool_used_buffers gauge + # HELP jvm_buffer_pool_used_buffers Used buffers of a given JVM buffer pool. + jvm_buffer_pool_used_buffers{pool="direct"} 2.0 + jvm_buffer_pool_used_buffers{pool="mapped"} 3.0 + # TYPE jvm_buffer_pool_used_bytes gauge + # UNIT jvm_buffer_pool_used_bytes bytes + # HELP jvm_buffer_pool_used_bytes Used bytes of a given JVM buffer pool. + jvm_buffer_pool_used_bytes{pool="direct"} 1234.0 + jvm_buffer_pool_used_bytes{pool="mapped"} 2345.0 + # EOF + """; + + assertThat(convertToOpenMetricsFormat(snapshots)).isEqualTo(expected); + } + + @Test + public void testIgnoredMetricNotScraped() { + MetricNameFilter filter = + MetricNameFilter.builder().nameMustNotBeEqualTo("jvm_buffer_pool_used_bytes").build(); + + PrometheusRegistry registry = new PrometheusRegistry(); + JvmBufferPoolMetrics.builder() + .bufferPoolBeans(Arrays.asList(directBuffer, mappedBuffer)) + .register(registry); + registry.scrape(filter); + + verify(directBuffer, times(0)).getMemoryUsed(); + verify(mappedBuffer, times(0)).getMemoryUsed(); + verify(directBuffer, times(1)).getTotalCapacity(); + verify(mappedBuffer, times(1)).getTotalCapacity(); + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmClassLoadingMetricsTest.java b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmClassLoadingMetricsTest.java new file mode 100644 index 000000000..ac13ab382 --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmClassLoadingMetricsTest.java @@ -0,0 +1,64 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import static io.prometheus.metrics.instrumentation.jvm.TestUtil.convertToOpenMetricsFormat; +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import io.prometheus.metrics.model.registry.MetricNameFilter; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.io.IOException; +import java.lang.management.ClassLoadingMXBean; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class JvmClassLoadingMetricsTest { + + private final ClassLoadingMXBean mockClassLoadingBean = Mockito.mock(ClassLoadingMXBean.class); + + @BeforeEach + public void setUp() { + when(mockClassLoadingBean.getLoadedClassCount()).thenReturn(1000); + when(mockClassLoadingBean.getTotalLoadedClassCount()).thenReturn(2000L); + when(mockClassLoadingBean.getUnloadedClassCount()).thenReturn(500L); + } + + @Test + public void testGoodCase() throws IOException { + PrometheusRegistry registry = new PrometheusRegistry(); + JvmClassLoadingMetrics.builder().classLoadingBean(mockClassLoadingBean).register(registry); + MetricSnapshots snapshots = registry.scrape(); + + String expected = +""" +# TYPE jvm_classes_currently_loaded gauge +# HELP jvm_classes_currently_loaded The number of classes that are currently loaded in the JVM +jvm_classes_currently_loaded 1000.0 +# TYPE jvm_classes_loaded counter +# HELP jvm_classes_loaded The total number of classes that have been loaded since the JVM has started execution +jvm_classes_loaded_total 2000.0 +# TYPE jvm_classes_unloaded counter +# HELP jvm_classes_unloaded The total number of classes that have been unloaded since the JVM has started execution +jvm_classes_unloaded_total 500.0 +# EOF +"""; + + assertThat(convertToOpenMetricsFormat(snapshots)).isEqualTo(expected); + } + + @Test + public void testIgnoredMetricNotScraped() { + MetricNameFilter filter = + MetricNameFilter.builder().nameMustNotBeEqualTo("jvm_classes_currently_loaded").build(); + + PrometheusRegistry registry = new PrometheusRegistry(); + JvmClassLoadingMetrics.builder().classLoadingBean(mockClassLoadingBean).register(registry); + registry.scrape(filter); + + verify(mockClassLoadingBean, times(0)).getLoadedClassCount(); + verify(mockClassLoadingBean, times(1)).getTotalLoadedClassCount(); + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmCompilationMetricsTest.java b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmCompilationMetricsTest.java new file mode 100644 index 000000000..73d1a39df --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmCompilationMetricsTest.java @@ -0,0 +1,60 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import static io.prometheus.metrics.instrumentation.jvm.TestUtil.convertToOpenMetricsFormat; +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.mockito.internal.verification.VerificationModeFactory.times; + +import io.prometheus.metrics.model.registry.MetricNameFilter; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.io.IOException; +import java.lang.management.CompilationMXBean; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class JvmCompilationMetricsTest { + + private final CompilationMXBean mockCompilationBean = Mockito.mock(CompilationMXBean.class); + + @BeforeEach + public void setUp() { + when(mockCompilationBean.getTotalCompilationTime()).thenReturn(10000L); + when(mockCompilationBean.isCompilationTimeMonitoringSupported()).thenReturn(true); + } + + @Test + public void testGoodCase() throws IOException { + PrometheusRegistry registry = new PrometheusRegistry(); + JvmCompilationMetrics.builder().compilationBean(mockCompilationBean).register(registry); + MetricSnapshots snapshots = registry.scrape(); + + String expected = +""" +# TYPE jvm_compilation_time_seconds counter +# UNIT jvm_compilation_time_seconds seconds +# HELP jvm_compilation_time_seconds The total time in seconds taken for HotSpot class compilation +jvm_compilation_time_seconds_total 10.0 +# EOF +"""; + + assertThat(convertToOpenMetricsFormat(snapshots)).isEqualTo(expected); + } + + @Test + public void testIgnoredMetricNotScraped() { + MetricNameFilter filter = + MetricNameFilter.builder() + .nameMustNotBeEqualTo("jvm_compilation_time_seconds_total") + .build(); + + PrometheusRegistry registry = new PrometheusRegistry(); + JvmCompilationMetrics.builder().compilationBean(mockCompilationBean).register(registry); + MetricSnapshots snapshots = registry.scrape(filter); + + verify(mockCompilationBean, times(0)).getTotalCompilationTime(); + assertThat(snapshots.size()).isZero(); + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmGarbageCollectorMetricsTest.java b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmGarbageCollectorMetricsTest.java new file mode 100644 index 000000000..177f29d2e --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmGarbageCollectorMetricsTest.java @@ -0,0 +1,73 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import static io.prometheus.metrics.instrumentation.jvm.TestUtil.convertToOpenMetricsFormat; +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import io.prometheus.metrics.model.registry.MetricNameFilter; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.io.IOException; +import java.lang.management.GarbageCollectorMXBean; +import java.util.Arrays; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class JvmGarbageCollectorMetricsTest { + + private final GarbageCollectorMXBean mockGcBean1 = Mockito.mock(GarbageCollectorMXBean.class); + private final GarbageCollectorMXBean mockGcBean2 = Mockito.mock(GarbageCollectorMXBean.class); + + @BeforeEach + public void setUp() { + when(mockGcBean1.getName()).thenReturn("MyGC1"); + when(mockGcBean1.getCollectionCount()).thenReturn(100L); + when(mockGcBean1.getCollectionTime()).thenReturn(TimeUnit.SECONDS.toMillis(10)); + when(mockGcBean2.getName()).thenReturn("MyGC2"); + when(mockGcBean2.getCollectionCount()).thenReturn(200L); + when(mockGcBean2.getCollectionTime()).thenReturn(TimeUnit.SECONDS.toMillis(20)); + } + + @Test + public void testGoodCase() throws IOException { + PrometheusRegistry registry = new PrometheusRegistry(); + JvmGarbageCollectorMetrics.builder() + .garbageCollectorBeans(Arrays.asList(mockGcBean1, mockGcBean2)) + .register(registry); + MetricSnapshots snapshots = registry.scrape(); + + String expected = + """ + # TYPE jvm_gc_collection_seconds summary + # UNIT jvm_gc_collection_seconds seconds + # HELP jvm_gc_collection_seconds Time spent in a given JVM garbage collector in seconds. + jvm_gc_collection_seconds_count{gc="MyGC1"} 100 + jvm_gc_collection_seconds_sum{gc="MyGC1"} 10.0 + jvm_gc_collection_seconds_count{gc="MyGC2"} 200 + jvm_gc_collection_seconds_sum{gc="MyGC2"} 20.0 + # EOF + """; + + assertThat(convertToOpenMetricsFormat(snapshots)).isEqualTo(expected); + } + + @Test + public void testIgnoredMetricNotScraped() { + MetricNameFilter filter = + MetricNameFilter.builder().nameMustNotBeEqualTo("jvm_gc_collection_seconds").build(); + + PrometheusRegistry registry = new PrometheusRegistry(); + JvmGarbageCollectorMetrics.builder() + .garbageCollectorBeans(Arrays.asList(mockGcBean1, mockGcBean2)) + .register(registry); + MetricSnapshots snapshots = registry.scrape(filter); + + verify(mockGcBean1, times(0)).getCollectionTime(); + verify(mockGcBean1, times(0)).getCollectionCount(); + assertThat(snapshots.size()).isZero(); + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmMemoryMetricsTest.java b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmMemoryMetricsTest.java new file mode 100644 index 000000000..a79ec3b3b --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmMemoryMetricsTest.java @@ -0,0 +1,179 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import static io.prometheus.metrics.instrumentation.jvm.TestUtil.convertToOpenMetricsFormat; +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import io.prometheus.metrics.model.registry.MetricNameFilter; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.io.IOException; +import java.lang.management.MemoryMXBean; +import java.lang.management.MemoryPoolMXBean; +import java.lang.management.MemoryUsage; +import java.util.Arrays; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class JvmMemoryMetricsTest { + + private final MemoryMXBean mockMemoryBean = Mockito.mock(MemoryMXBean.class); + private final MemoryPoolMXBean mockPoolsBeanEdenSpace = Mockito.mock(MemoryPoolMXBean.class); + private final MemoryPoolMXBean mockPoolsBeanOldGen = Mockito.mock(MemoryPoolMXBean.class); + private final MemoryUsage memoryUsageHeap = Mockito.mock(MemoryUsage.class); + private final MemoryUsage memoryUsageNonHeap = Mockito.mock(MemoryUsage.class); + private final MemoryUsage memoryUsagePoolEdenSpace = Mockito.mock(MemoryUsage.class); + private final MemoryUsage memoryUsagePoolOldGen = Mockito.mock(MemoryUsage.class); + private final MemoryUsage memoryUsagePoolCollectionEdenSpace = Mockito.mock(MemoryUsage.class); + private final MemoryUsage memoryUsagePoolCollectionOldGen = Mockito.mock(MemoryUsage.class); + + @SuppressWarnings("deprecation") + @BeforeEach + public void setUp() { + when(mockMemoryBean.getHeapMemoryUsage()).thenReturn(memoryUsageHeap); + when(mockMemoryBean.getNonHeapMemoryUsage()).thenReturn(memoryUsageNonHeap); + + long val = 1L; + when(mockMemoryBean.getObjectPendingFinalizationCount()).thenReturn((int) val++); + + when(memoryUsageHeap.getUsed()).thenReturn(val++); + when(memoryUsageHeap.getMax()).thenReturn(val++); + when(memoryUsageHeap.getCommitted()).thenReturn(val++); + when(memoryUsageHeap.getInit()).thenReturn(val++); + + when(memoryUsageNonHeap.getUsed()).thenReturn(val++); + when(memoryUsageNonHeap.getMax()).thenReturn(val++); + when(memoryUsageNonHeap.getCommitted()).thenReturn(val++); + when(memoryUsageNonHeap.getInit()).thenReturn(val++); + + when(memoryUsagePoolEdenSpace.getUsed()).thenReturn(val++); + when(memoryUsagePoolEdenSpace.getMax()).thenReturn(val++); + when(memoryUsagePoolEdenSpace.getCommitted()).thenReturn(val++); + when(memoryUsagePoolEdenSpace.getInit()).thenReturn(val++); + + when(memoryUsagePoolOldGen.getUsed()).thenReturn(val++); + when(memoryUsagePoolOldGen.getMax()).thenReturn(val++); + when(memoryUsagePoolOldGen.getCommitted()).thenReturn(val++); + when(memoryUsagePoolOldGen.getInit()).thenReturn(val++); + + when(memoryUsagePoolCollectionEdenSpace.getUsed()).thenReturn(val++); + when(memoryUsagePoolCollectionEdenSpace.getMax()).thenReturn(val++); + when(memoryUsagePoolCollectionEdenSpace.getCommitted()).thenReturn(val++); + when(memoryUsagePoolCollectionEdenSpace.getInit()).thenReturn(val++); + + when(memoryUsagePoolCollectionOldGen.getUsed()).thenReturn(val++); + when(memoryUsagePoolCollectionOldGen.getMax()).thenReturn(val++); + when(memoryUsagePoolCollectionOldGen.getCommitted()).thenReturn(val++); + when(memoryUsagePoolCollectionOldGen.getInit()).thenReturn(val++); + + when(mockPoolsBeanEdenSpace.getName()).thenReturn("PS Eden Space"); + when(mockPoolsBeanEdenSpace.getUsage()).thenReturn(memoryUsagePoolEdenSpace); + when(mockPoolsBeanEdenSpace.getCollectionUsage()) + .thenReturn(memoryUsagePoolCollectionEdenSpace); + + when(mockPoolsBeanOldGen.getName()).thenReturn("PS Old Gen"); + when(mockPoolsBeanOldGen.getUsage()).thenReturn(memoryUsagePoolOldGen); + when(mockPoolsBeanOldGen.getCollectionUsage()).thenReturn(memoryUsagePoolCollectionOldGen); + } + + @Test + public void testGoodCase() throws IOException { + PrometheusRegistry registry = new PrometheusRegistry(); + JvmMemoryMetrics.builder() + .withMemoryBean(mockMemoryBean) + .withMemoryPoolBeans(Arrays.asList(mockPoolsBeanEdenSpace, mockPoolsBeanOldGen)) + .register(registry); + MetricSnapshots snapshots = registry.scrape(); + + String expected = +""" +# TYPE jvm_memory_committed_bytes gauge +# UNIT jvm_memory_committed_bytes bytes +# HELP jvm_memory_committed_bytes Committed (bytes) of a given JVM memory area. +jvm_memory_committed_bytes{area="heap"} 4.0 +jvm_memory_committed_bytes{area="nonheap"} 8.0 +# TYPE jvm_memory_init_bytes gauge +# UNIT jvm_memory_init_bytes bytes +# HELP jvm_memory_init_bytes Initial bytes of a given JVM memory area. +jvm_memory_init_bytes{area="heap"} 5.0 +jvm_memory_init_bytes{area="nonheap"} 9.0 +# TYPE jvm_memory_max_bytes gauge +# UNIT jvm_memory_max_bytes bytes +# HELP jvm_memory_max_bytes Max (bytes) of a given JVM memory area. +jvm_memory_max_bytes{area="heap"} 3.0 +jvm_memory_max_bytes{area="nonheap"} 7.0 +# TYPE jvm_memory_objects_pending_finalization gauge +# HELP jvm_memory_objects_pending_finalization The number of objects waiting in the finalizer queue. +jvm_memory_objects_pending_finalization 1.0 +# TYPE jvm_memory_pool_collection_committed_bytes gauge +# UNIT jvm_memory_pool_collection_committed_bytes bytes +# HELP jvm_memory_pool_collection_committed_bytes Committed after last collection bytes of a given JVM memory pool. +jvm_memory_pool_collection_committed_bytes{pool="PS Eden Space"} 20.0 +jvm_memory_pool_collection_committed_bytes{pool="PS Old Gen"} 24.0 +# TYPE jvm_memory_pool_collection_init_bytes gauge +# UNIT jvm_memory_pool_collection_init_bytes bytes +# HELP jvm_memory_pool_collection_init_bytes Initial after last collection bytes of a given JVM memory pool. +jvm_memory_pool_collection_init_bytes{pool="PS Eden Space"} 21.0 +jvm_memory_pool_collection_init_bytes{pool="PS Old Gen"} 25.0 +# TYPE jvm_memory_pool_collection_max_bytes gauge +# UNIT jvm_memory_pool_collection_max_bytes bytes +# HELP jvm_memory_pool_collection_max_bytes Max bytes after last collection of a given JVM memory pool. +jvm_memory_pool_collection_max_bytes{pool="PS Eden Space"} 19.0 +jvm_memory_pool_collection_max_bytes{pool="PS Old Gen"} 23.0 +# TYPE jvm_memory_pool_collection_used_bytes gauge +# UNIT jvm_memory_pool_collection_used_bytes bytes +# HELP jvm_memory_pool_collection_used_bytes Used bytes after last collection of a given JVM memory pool. +jvm_memory_pool_collection_used_bytes{pool="PS Eden Space"} 18.0 +jvm_memory_pool_collection_used_bytes{pool="PS Old Gen"} 22.0 +# TYPE jvm_memory_pool_committed_bytes gauge +# UNIT jvm_memory_pool_committed_bytes bytes +# HELP jvm_memory_pool_committed_bytes Committed bytes of a given JVM memory pool. +jvm_memory_pool_committed_bytes{pool="PS Eden Space"} 12.0 +jvm_memory_pool_committed_bytes{pool="PS Old Gen"} 16.0 +# TYPE jvm_memory_pool_init_bytes gauge +# UNIT jvm_memory_pool_init_bytes bytes +# HELP jvm_memory_pool_init_bytes Initial bytes of a given JVM memory pool. +jvm_memory_pool_init_bytes{pool="PS Eden Space"} 13.0 +jvm_memory_pool_init_bytes{pool="PS Old Gen"} 17.0 +# TYPE jvm_memory_pool_max_bytes gauge +# UNIT jvm_memory_pool_max_bytes bytes +# HELP jvm_memory_pool_max_bytes Max bytes of a given JVM memory pool. +jvm_memory_pool_max_bytes{pool="PS Eden Space"} 11.0 +jvm_memory_pool_max_bytes{pool="PS Old Gen"} 15.0 +# TYPE jvm_memory_pool_used_bytes gauge +# UNIT jvm_memory_pool_used_bytes bytes +# HELP jvm_memory_pool_used_bytes Used bytes of a given JVM memory pool. +jvm_memory_pool_used_bytes{pool="PS Eden Space"} 10.0 +jvm_memory_pool_used_bytes{pool="PS Old Gen"} 14.0 +# TYPE jvm_memory_used_bytes gauge +# UNIT jvm_memory_used_bytes bytes +# HELP jvm_memory_used_bytes Used bytes of a given JVM memory area. +jvm_memory_used_bytes{area="heap"} 2.0 +jvm_memory_used_bytes{area="nonheap"} 6.0 +# EOF +"""; + + assertThat(convertToOpenMetricsFormat(snapshots)).isEqualTo(expected); + } + + @Test + public void testIgnoredMetricNotScraped() { + MetricNameFilter filter = + MetricNameFilter.builder().nameMustNotBeEqualTo("jvm_memory_pool_used_bytes").build(); + + PrometheusRegistry registry = new PrometheusRegistry(); + JvmMemoryMetrics.builder() + .withMemoryBean(mockMemoryBean) + .withMemoryPoolBeans(Arrays.asList(mockPoolsBeanEdenSpace, mockPoolsBeanOldGen)) + .register(registry); + registry.scrape(filter); + + verify(memoryUsagePoolEdenSpace, times(0)).getUsed(); + verify(memoryUsagePoolOldGen, times(0)).getUsed(); + verify(memoryUsagePoolEdenSpace, times(1)).getMax(); + verify(memoryUsagePoolOldGen, times(1)).getMax(); + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmMemoryPoolAllocationMetricsTest.java b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmMemoryPoolAllocationMetricsTest.java new file mode 100644 index 000000000..67dd6f2e6 --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmMemoryPoolAllocationMetricsTest.java @@ -0,0 +1,66 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; + +import io.prometheus.metrics.core.metrics.Counter; +import io.prometheus.metrics.instrumentation.jvm.JvmMemoryPoolAllocationMetrics.AllocationCountingNotificationListener; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import org.junit.jupiter.api.Test; + +class JvmMemoryPoolAllocationMetricsTest { + + @Test + public void testListenerLogic() { + PrometheusRegistry registry = new PrometheusRegistry(); + Counter counter = Counter.builder().name("test").labelNames("pool").register(registry); + AllocationCountingNotificationListener listener = + new AllocationCountingNotificationListener(counter); + + // Increase by 123 + listener.handleMemoryPool("TestPool", 0, 123); + assertThat(getCountByPool("test", "TestPool", registry.scrape())).isEqualTo(123); + + // No increase + listener.handleMemoryPool("TestPool", 123, 123); + assertThat(getCountByPool("test", "TestPool", registry.scrape())).isEqualTo(123); + + // No increase, then decrease to 0 + listener.handleMemoryPool("TestPool", 123, 0); + assertThat(getCountByPool("test", "TestPool", registry.scrape())).isEqualTo(123); + + // No increase, then increase by 7 + listener.handleMemoryPool("TestPool", 0, 7); + assertThat(getCountByPool("test", "TestPool", registry.scrape())).isEqualTo(130); + + // Increase by 10, then decrease to 10 + listener.handleMemoryPool("TestPool", 17, 10); + assertThat(getCountByPool("test", "TestPool", registry.scrape())).isEqualTo(140); + + // Increase by 7, then increase by 3 + listener.handleMemoryPool("TestPool", 17, 20); + assertThat(getCountByPool("test", "TestPool", registry.scrape())).isEqualTo(150); + + // Decrease to 17, then increase by 3 + listener.handleMemoryPool("TestPool", 17, 20); + assertThat(getCountByPool("test", "TestPool", registry.scrape())).isEqualTo(153); + } + + private double getCountByPool(String metricName, String poolName, MetricSnapshots snapshots) { + for (MetricSnapshot snapshot : snapshots) { + if (snapshot.getMetadata().getPrometheusName().equals(metricName)) { + for (CounterSnapshot.CounterDataPointSnapshot data : + ((CounterSnapshot) snapshot).getDataPoints()) { + if (data.getLabels().get("pool").equals(poolName)) { + return data.getValue(); + } + } + } + } + fail("pool " + poolName + " not found."); + return 0.0; + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmMetricsTest.java b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmMetricsTest.java new file mode 100644 index 000000000..551ed35c7 --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmMetricsTest.java @@ -0,0 +1,63 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import static org.assertj.core.api.Assertions.assertThat; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.DataPointSnapshot; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.lang.management.ManagementFactory; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class JvmMetricsTest { + + @BeforeEach + void setUp() { + PrometheusRegistry.defaultRegistry.clear(); + } + + @Test + public void testRegisterIdempotent() { + PrometheusRegistry registry = new PrometheusRegistry(); + assertThat(registry.scrape().size()).isZero(); + JvmMetrics.builder().register(registry); + assertThat(registry.scrape().size()).isGreaterThan(0); + JvmMetrics.builder().register(registry); + } + + @Test + void pool() { + // for coverage + JvmMemoryPoolAllocationMetrics.builder(PrometheusProperties.get()) + .withGarbageCollectorBeans(ManagementFactory.getGarbageCollectorMXBeans()) + .register(); + } + + @Test + void testConstLabelsApplied() { + PrometheusRegistry registry = new PrometheusRegistry(); + Labels labels = Labels.of("env", "dev"); + JvmMetrics.builder().constLabels(labels).register(registry); + MetricSnapshots snapshots = registry.scrape(); + boolean found = false; + for (MetricSnapshot snapshot : snapshots) { + for (DataPointSnapshot dp : snapshot.getDataPoints()) { + if ("dev".equals(dp.getLabels().get("env"))) { + found = true; + break; + } + } + if (found) break; + } + assertThat(found).isTrue(); + } + + @Test + void testJvmMetrics() { + JvmMetrics.builder(PrometheusProperties.get()).register(); + JvmMetrics.builder().register(); + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmNativeMemoryMetricsTest.java b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmNativeMemoryMetricsTest.java new file mode 100644 index 000000000..bbf42ecc7 --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmNativeMemoryMetricsTest.java @@ -0,0 +1,241 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import static io.prometheus.metrics.instrumentation.jvm.TestUtil.convertToOpenMetricsFormat; +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.when; + +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.io.IOException; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class JvmNativeMemoryMetricsTest { + + @Test + public void testNativeMemoryTrackingFail() throws IOException { + JvmNativeMemoryMetrics.isEnabled.set(true); + + JvmNativeMemoryMetrics.PlatformMBeanServerAdapter adapter = + Mockito.mock(JvmNativeMemoryMetrics.PlatformMBeanServerAdapter.class); + when(adapter.vmNativeMemorySummaryInBytes()).thenThrow(new RuntimeException("mock")); + + PrometheusRegistry registry = new PrometheusRegistry(); + new JvmNativeMemoryMetrics.Builder(PrometheusProperties.get(), adapter).register(registry); + MetricSnapshots snapshots = registry.scrape(); + + String expected = "# EOF\n"; + + assertThat(convertToOpenMetricsFormat(snapshots)).isEqualTo(expected); + } + + @Test + void nativeMemoryTrackingNotEnabled() { + assertThat( + new JvmNativeMemoryMetrics.DefaultPlatformMBeanServerAdapter() + .vmNativeMemorySummaryInBytes()) + .isEqualTo("Native memory tracking is not enabled\n"); + } + + @Test + public void testNativeMemoryTrackingEmpty() throws IOException { + JvmNativeMemoryMetrics.isEnabled.set(true); + + JvmNativeMemoryMetrics.PlatformMBeanServerAdapter adapter = + Mockito.mock(JvmNativeMemoryMetrics.PlatformMBeanServerAdapter.class); + when(adapter.vmNativeMemorySummaryInBytes()).thenReturn(""); + + PrometheusRegistry registry = new PrometheusRegistry(); + new JvmNativeMemoryMetrics.Builder(PrometheusProperties.get(), adapter).register(registry); + MetricSnapshots snapshots = registry.scrape(); + + String expected = "# EOF\n"; + + assertThat(convertToOpenMetricsFormat(snapshots)).isEqualTo(expected); + } + + @Test + public void testNativeMemoryTrackingDisabled() throws IOException { + JvmNativeMemoryMetrics.isEnabled.set(true); + + JvmNativeMemoryMetrics.PlatformMBeanServerAdapter adapter = + Mockito.mock(JvmNativeMemoryMetrics.PlatformMBeanServerAdapter.class); + when(adapter.vmNativeMemorySummaryInBytes()) + .thenReturn("Native memory tracking is not enabled"); + + PrometheusRegistry registry = new PrometheusRegistry(); + new JvmNativeMemoryMetrics.Builder(PrometheusProperties.get(), adapter).register(registry); + MetricSnapshots snapshots = registry.scrape(); + + String expected = "# EOF\n"; + + assertThat(convertToOpenMetricsFormat(snapshots)).isEqualTo(expected); + } + + @Test + public void testNativeMemoryTrackingEnabled() throws IOException { + JvmNativeMemoryMetrics.isEnabled.set(true); + + JvmNativeMemoryMetrics.PlatformMBeanServerAdapter adapter = + Mockito.mock(JvmNativeMemoryMetrics.PlatformMBeanServerAdapter.class); + when(adapter.vmNativeMemorySummaryInBytes()) + .thenReturn( + """ + Native Memory Tracking: + + Total: reserved=10341970661, committed=642716389 + malloc: 27513573 #22947 + mmap: reserved=10314457088, committed=615202816 + + - Java Heap (reserved=8531214336, committed=536870912) + (mmap: reserved=8531214336, committed=536870912)\s + \s + - Class (reserved=1073899939, committed=616867) + (classes #1630) + ( instance classes #1462, array classes #168) + (malloc=158115 #2350)\s + (mmap: reserved=1073741824, committed=458752)\s + ( Metadata: ) + ( reserved=67108864, committed=2818048) + ( used=2748008) + ( waste=70040 =2.49%) + ( Class space:) + ( reserved=1073741824, committed=458752) + ( used=343568) + ( waste=115184 =25.11%) + \s + - Thread (reserved=21020080, committed=847280) + (thread #20) + (stack: reserved=20971520, committed=798720) + (malloc=27512 #125)\s + (arena=21048 #37) + \s + - Code (reserved=253796784, committed=7836080) + (malloc=105944 #1403)\s + (mmap: reserved=253689856, committed=7729152)\s + (arena=984 #1) + \s + - GC (reserved=373343252, committed=76530708) + (malloc=22463508 #720)\s + (mmap: reserved=350879744, committed=54067200)\s + \s + - Compiler (reserved=1926356, committed=1926356) + (malloc=20428 #73)\s + (arena=1905928 #20) + \s + - Internal (reserved=242257, committed=242257) + (malloc=176721 #1808)\s + (mmap: reserved=65536, committed=65536)\s + \s + - Other (reserved=4096, committed=4096) + (malloc=4096 #2)\s + \s + - Symbol (reserved=1505072, committed=1505072) + (malloc=1136432 #14482)\s + (arena=368640 #1) + \s + - Native Memory Tracking (reserved=373448, committed=373448) + (malloc=6280 #91)\s + (tracking overhead=367168) + \s + - Shared class space (reserved=16777216, committed=12386304) + (mmap: reserved=16777216, committed=12386304)\s + \s + - Arena Chunk (reserved=503216, committed=503216) + (malloc=503216)\s + \s + - Tracing (reserved=33097, committed=33097) + (malloc=369 #10)\s + (arena=32728 #1) + \s + - Arguments (reserved=160, committed=160) + (malloc=160 #5)\s + \s + - Module (reserved=169168, committed=169168) + (malloc=169168 #1266)\s + \s + - Safepoint (reserved=8192, committed=8192) + (mmap: reserved=8192, committed=8192)\s + \s + - Synchronization (reserved=31160, committed=31160) + (malloc=31160 #452)\s + \s + - Serviceability (reserved=600, committed=600) + (malloc=600 #6)\s + \s + - Metaspace (reserved=67120768, committed=2829952) + (malloc=11904 #12)\s + (mmap: reserved=67108864, committed=2818048)\s + \s + - String Deduplication (reserved=632, committed=632) + (malloc=632 #8)\s + \s + - Object Monitors (reserved=832, committed=832) + (malloc=832 #4)\s + \s + + """); + + PrometheusRegistry registry = new PrometheusRegistry(); + new JvmNativeMemoryMetrics.Builder(PrometheusProperties.get(), adapter).register(registry); + MetricSnapshots snapshots = registry.scrape(); + + String expected = +""" +# TYPE jvm_native_memory_committed_bytes gauge +# UNIT jvm_native_memory_committed_bytes bytes +# HELP jvm_native_memory_committed_bytes Committed bytes of a given JVM. Committed memory represents the amount of memory the JVM is using right now. +jvm_native_memory_committed_bytes{pool="Arena Chunk"} 503216.0 +jvm_native_memory_committed_bytes{pool="Arguments"} 160.0 +jvm_native_memory_committed_bytes{pool="Class"} 616867.0 +jvm_native_memory_committed_bytes{pool="Code"} 7836080.0 +jvm_native_memory_committed_bytes{pool="Compiler"} 1926356.0 +jvm_native_memory_committed_bytes{pool="GC"} 7.6530708E7 +jvm_native_memory_committed_bytes{pool="Internal"} 242257.0 +jvm_native_memory_committed_bytes{pool="Java Heap"} 5.36870912E8 +jvm_native_memory_committed_bytes{pool="Metaspace"} 2829952.0 +jvm_native_memory_committed_bytes{pool="Module"} 169168.0 +jvm_native_memory_committed_bytes{pool="Native Memory Tracking"} 373448.0 +jvm_native_memory_committed_bytes{pool="Object Monitors"} 832.0 +jvm_native_memory_committed_bytes{pool="Other"} 4096.0 +jvm_native_memory_committed_bytes{pool="Safepoint"} 8192.0 +jvm_native_memory_committed_bytes{pool="Serviceability"} 600.0 +jvm_native_memory_committed_bytes{pool="Shared class space"} 1.2386304E7 +jvm_native_memory_committed_bytes{pool="String Deduplication"} 632.0 +jvm_native_memory_committed_bytes{pool="Symbol"} 1505072.0 +jvm_native_memory_committed_bytes{pool="Synchronization"} 31160.0 +jvm_native_memory_committed_bytes{pool="Thread"} 847280.0 +jvm_native_memory_committed_bytes{pool="Total"} 6.42716389E8 +jvm_native_memory_committed_bytes{pool="Tracing"} 33097.0 +# TYPE jvm_native_memory_reserved_bytes gauge +# UNIT jvm_native_memory_reserved_bytes bytes +# HELP jvm_native_memory_reserved_bytes Reserved bytes of a given JVM. Reserved memory represents the total amount of memory the JVM can potentially use. +jvm_native_memory_reserved_bytes{pool="Arena Chunk"} 503216.0 +jvm_native_memory_reserved_bytes{pool="Arguments"} 160.0 +jvm_native_memory_reserved_bytes{pool="Class"} 1.073899939E9 +jvm_native_memory_reserved_bytes{pool="Code"} 2.53796784E8 +jvm_native_memory_reserved_bytes{pool="Compiler"} 1926356.0 +jvm_native_memory_reserved_bytes{pool="GC"} 3.73343252E8 +jvm_native_memory_reserved_bytes{pool="Internal"} 242257.0 +jvm_native_memory_reserved_bytes{pool="Java Heap"} 8.531214336E9 +jvm_native_memory_reserved_bytes{pool="Metaspace"} 6.7120768E7 +jvm_native_memory_reserved_bytes{pool="Module"} 169168.0 +jvm_native_memory_reserved_bytes{pool="Native Memory Tracking"} 373448.0 +jvm_native_memory_reserved_bytes{pool="Object Monitors"} 832.0 +jvm_native_memory_reserved_bytes{pool="Other"} 4096.0 +jvm_native_memory_reserved_bytes{pool="Safepoint"} 8192.0 +jvm_native_memory_reserved_bytes{pool="Serviceability"} 600.0 +jvm_native_memory_reserved_bytes{pool="Shared class space"} 1.6777216E7 +jvm_native_memory_reserved_bytes{pool="String Deduplication"} 632.0 +jvm_native_memory_reserved_bytes{pool="Symbol"} 1505072.0 +jvm_native_memory_reserved_bytes{pool="Synchronization"} 31160.0 +jvm_native_memory_reserved_bytes{pool="Thread"} 2.102008E7 +jvm_native_memory_reserved_bytes{pool="Total"} 1.0341970661E10 +jvm_native_memory_reserved_bytes{pool="Tracing"} 33097.0 +# EOF +"""; + + assertThat(convertToOpenMetricsFormat(snapshots)).isEqualTo(expected); + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmRuntimeInfoMetricTest.java b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmRuntimeInfoMetricTest.java new file mode 100644 index 000000000..a477065c9 --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmRuntimeInfoMetricTest.java @@ -0,0 +1,33 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import static io.prometheus.metrics.instrumentation.jvm.TestUtil.convertToOpenMetricsFormat; +import static org.assertj.core.api.Assertions.assertThat; + +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.io.IOException; +import org.junit.jupiter.api.Test; + +class JvmRuntimeInfoMetricTest { + + @Test + public void testGoodCase() throws IOException { + PrometheusRegistry registry = new PrometheusRegistry(); + JvmRuntimeInfoMetric.builder() + .version("1.8.0_382-b05") + .vendor("Oracle Corporation") + .runtime("OpenJDK Runtime Environment") + .register(registry); + MetricSnapshots snapshots = registry.scrape(); + + String expected = +""" +# TYPE jvm_runtime info +# HELP jvm_runtime JVM runtime info +jvm_runtime_info{runtime="OpenJDK Runtime Environment",vendor="Oracle Corporation",version="1.8.0_382-b05"} 1 +# EOF +"""; + + assertThat(convertToOpenMetricsFormat(snapshots)).isEqualTo(expected); + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmThreadsMetricsTest.java b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmThreadsMetricsTest.java new file mode 100644 index 000000000..cd651cc7f --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/JvmThreadsMetricsTest.java @@ -0,0 +1,194 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import static io.prometheus.metrics.instrumentation.jvm.TestUtil.convertToOpenMetricsFormat; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assumptions.assumeThat; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import io.prometheus.metrics.model.registry.MetricNameFilter; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.io.IOException; +import java.lang.management.ThreadInfo; +import java.lang.management.ThreadMXBean; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CountDownLatch; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class JvmThreadsMetricsTest { + + private final ThreadMXBean mockThreadsBean = Mockito.mock(ThreadMXBean.class); + private final ThreadInfo mockThreadInfoBlocked = Mockito.mock(ThreadInfo.class); + private final ThreadInfo mockThreadInfoRunnable1 = Mockito.mock(ThreadInfo.class); + private final ThreadInfo mockThreadInfoRunnable2 = Mockito.mock(ThreadInfo.class); + + @BeforeEach + public void setUp() { + when(mockThreadsBean.getThreadCount()).thenReturn(300); + when(mockThreadsBean.getDaemonThreadCount()).thenReturn(200); + when(mockThreadsBean.getPeakThreadCount()).thenReturn(301); + when(mockThreadsBean.getTotalStartedThreadCount()).thenReturn(503L); + when(mockThreadsBean.findDeadlockedThreads()).thenReturn(new long[] {1L, 2L, 3L}); + when(mockThreadsBean.findMonitorDeadlockedThreads()).thenReturn(new long[] {2L, 3L, 4L}); + when(mockThreadsBean.getAllThreadIds()).thenReturn(new long[] {3L, 4L, 5L}); + when(mockThreadInfoBlocked.getThreadState()).thenReturn(Thread.State.BLOCKED); + when(mockThreadInfoRunnable1.getThreadState()).thenReturn(Thread.State.RUNNABLE); + when(mockThreadInfoRunnable2.getThreadState()).thenReturn(Thread.State.RUNNABLE); + when(mockThreadsBean.getThreadInfo(new long[] {3L, 4L, 5L}, 0)) + .thenReturn( + new ThreadInfo[] { + mockThreadInfoBlocked, mockThreadInfoRunnable1, mockThreadInfoRunnable2 + }); + } + + @Test + public void testGoodCase() throws IOException { + PrometheusRegistry registry = new PrometheusRegistry(); + JvmThreadsMetrics.builder().threadBean(mockThreadsBean).isNativeImage(false).register(registry); + MetricSnapshots snapshots = registry.scrape(); + + String expected = +""" +# TYPE jvm_threads_current gauge +# HELP jvm_threads_current Current thread count of a JVM +jvm_threads_current 300.0 +# TYPE jvm_threads_daemon gauge +# HELP jvm_threads_daemon Daemon thread count of a JVM +jvm_threads_daemon 200.0 +# TYPE jvm_threads_deadlocked gauge +# HELP jvm_threads_deadlocked Cycles of JVM-threads that are in deadlock waiting to acquire object monitors or ownable synchronizers +jvm_threads_deadlocked 3.0 +# TYPE jvm_threads_deadlocked_monitor gauge +# HELP jvm_threads_deadlocked_monitor Cycles of JVM-threads that are in deadlock waiting to acquire object monitors +jvm_threads_deadlocked_monitor 3.0 +# TYPE jvm_threads_peak gauge +# HELP jvm_threads_peak Peak thread count of a JVM +jvm_threads_peak 301.0 +# TYPE jvm_threads_started counter +# HELP jvm_threads_started Started thread count of a JVM +jvm_threads_started_total 503.0 +# TYPE jvm_threads_state gauge +# HELP jvm_threads_state Current count of threads by state +jvm_threads_state{state="BLOCKED"} 1.0 +jvm_threads_state{state="NEW"} 0.0 +jvm_threads_state{state="RUNNABLE"} 2.0 +jvm_threads_state{state="TERMINATED"} 0.0 +jvm_threads_state{state="TIMED_WAITING"} 0.0 +jvm_threads_state{state="UNKNOWN"} 0.0 +jvm_threads_state{state="WAITING"} 0.0 +# EOF +"""; + + assertThat(convertToOpenMetricsFormat(snapshots)).isEqualTo(expected); + } + + @Test + public void testIgnoredMetricNotScraped() { + MetricNameFilter filter = + MetricNameFilter.builder().nameMustNotBeEqualTo("jvm_threads_deadlocked").build(); + + PrometheusRegistry registry = new PrometheusRegistry(); + JvmThreadsMetrics.builder().threadBean(mockThreadsBean).isNativeImage(false).register(registry); + registry.scrape(filter); + + verify(mockThreadsBean, times(0)).findDeadlockedThreads(); + verify(mockThreadsBean, times(1)).getThreadCount(); + } + + @Test + public void testInvalidThreadIds() { + try { + String javaVersion = System.getProperty("java.version"); // Example: "21.0.2" + String majorJavaVersion = javaVersion.replaceAll("\\..*", ""); // Example: "21" + // With Java 21 and newer you can no longer have invalid thread ids. + assumeThat(Integer.parseInt(majorJavaVersion)).isLessThan(21); + } catch (NumberFormatException ignored) { + // ignore + } + PrometheusRegistry registry = new PrometheusRegistry(); + JvmThreadsMetrics.builder().register(registry); + + // Number of threads to create with invalid thread ids + int numberOfInvalidThreadIds = 2; + + Map expected = getCountByState(registry.scrape()); + expected.compute( + "UNKNOWN", + (key, oldValue) -> + oldValue == null ? numberOfInvalidThreadIds : oldValue + numberOfInvalidThreadIds); + + final CountDownLatch countDownLatch = new CountDownLatch(numberOfInvalidThreadIds); + + try { + // Create and start threads with invalid thread ids (id=0, id=-1, etc.) + for (int i = 0; i < numberOfInvalidThreadIds; i++) { + new ThreadWithInvalidId(-i, new TestRunnable(countDownLatch)).start(); + } + + Map actual = getCountByState(registry.scrape()); + + assertThat(actual).hasSameSizeAs(expected); + for (String threadState : expected.keySet()) { + assertThat(actual.get(threadState)).isEqualTo(expected.get(threadState)); + } + } finally { + for (int i = 0; i < numberOfInvalidThreadIds; i++) { + countDownLatch.countDown(); + } + } + } + + private Map getCountByState(MetricSnapshots snapshots) { + Map result = new HashMap<>(); + for (MetricSnapshot snapshot : snapshots) { + if (snapshot.getMetadata().getName().equals("jvm_threads_state")) { + for (GaugeSnapshot.GaugeDataPointSnapshot data : + ((GaugeSnapshot) snapshot).getDataPoints()) { + String state = data.getLabels().get("state"); + assertThat(state).isNotNull(); + result.put(state, data.getValue()); + } + } + } + return result; + } + + private static class ThreadWithInvalidId extends Thread { + + private final long id; + + private ThreadWithInvalidId(long id, Runnable runnable) { + super(runnable); + setDaemon(true); + this.id = id; + } + + /** + * Note that only Java versions < 21 call this to get the thread id. With Java 21 and newer it's + * no longer possible to make an invalid thread id. + */ + @SuppressWarnings("deprecation") + @Override + public long getId() { + return this.id; + } + } + + private record TestRunnable(CountDownLatch countDownLatch) implements Runnable { + @Override + public void run() { + try { + countDownLatch.await(); + } catch (InterruptedException e) { + // DO NOTHING + } + } + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/ProcessMetricsTest.java b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/ProcessMetricsTest.java new file mode 100644 index 000000000..f5804ad7f --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/ProcessMetricsTest.java @@ -0,0 +1,137 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import static io.prometheus.metrics.instrumentation.jvm.TestUtil.convertToOpenMetricsFormat; +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import io.prometheus.metrics.model.registry.MetricNameFilter; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.io.File; +import java.io.IOException; +import java.lang.management.RuntimeMXBean; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class ProcessMetricsTest { + + private final com.sun.management.UnixOperatingSystemMXBean sunOsBean = + Mockito.mock(com.sun.management.UnixOperatingSystemMXBean.class); + private final java.lang.management.OperatingSystemMXBean javaOsBean = + Mockito.mock(java.lang.management.OperatingSystemMXBean.class); + private final ProcessMetrics.Grepper linuxGrepper = Mockito.mock(ProcessMetrics.Grepper.class); + private final ProcessMetrics.Grepper windowsGrepper = Mockito.mock(ProcessMetrics.Grepper.class); + private final RuntimeMXBean runtimeBean = Mockito.mock(RuntimeMXBean.class); + + @BeforeEach + public void setUp() throws IOException { + when(sunOsBean.getProcessCpuTime()).thenReturn(TimeUnit.MILLISECONDS.toNanos(72)); + when(sunOsBean.getOpenFileDescriptorCount()).thenReturn(127L); + when(sunOsBean.getMaxFileDescriptorCount()).thenReturn(244L); + when(runtimeBean.getStartTime()).thenReturn(37100L); + when(linuxGrepper.lineStartingWith(any(File.class), eq("VmSize:"))) + .thenReturn("VmSize: 6036 kB"); + when(linuxGrepper.lineStartingWith(any(File.class), eq("VmRSS:"))) + .thenReturn("VmRSS: 1012 kB"); + } + + @Test + public void testGoodCase() throws IOException { + PrometheusRegistry registry = new PrometheusRegistry(); + ProcessMetrics.builder() + .osBean(sunOsBean) + .runtimeBean(runtimeBean) + .grepper(linuxGrepper) + .register(registry); + MetricSnapshots snapshots = registry.scrape(); + + String expected = + """ + # TYPE process_cpu_seconds counter + # UNIT process_cpu_seconds seconds + # HELP process_cpu_seconds Total user and system CPU time spent in seconds. + process_cpu_seconds_total 0.072 + # TYPE process_max_fds gauge + # HELP process_max_fds Maximum number of open file descriptors. + process_max_fds 244.0 + # TYPE process_open_fds gauge + # HELP process_open_fds Number of open file descriptors. + process_open_fds 127.0 + """; + // To allow running this test in non-linux environments + if (ProcessMetrics.PROC_SELF_STATUS.canRead()) { + expected += + """ + # TYPE process_resident_memory_bytes gauge + # UNIT process_resident_memory_bytes bytes + # HELP process_resident_memory_bytes Resident memory size in bytes. + process_resident_memory_bytes 1036288.0 + """; + } + expected += + """ + # TYPE process_start_time_seconds gauge + # UNIT process_start_time_seconds seconds + # HELP process_start_time_seconds Start time of the process since unix epoch in seconds. + process_start_time_seconds 37.1 + """; + // To allow running this test in non-linux environments + if (ProcessMetrics.PROC_SELF_STATUS.canRead()) { + expected += + """ + # TYPE process_virtual_memory_bytes gauge + # UNIT process_virtual_memory_bytes bytes + # HELP process_virtual_memory_bytes Virtual memory size in bytes. + process_virtual_memory_bytes 6180864.0 + """; + } + expected += "# EOF\n"; + + assertThat(convertToOpenMetricsFormat(snapshots)).isEqualTo(expected); + } + + @Test + public void testMinimal() throws IOException { + PrometheusRegistry registry = new PrometheusRegistry(); + ProcessMetrics.builder() + .osBean(javaOsBean) + .runtimeBean(runtimeBean) + .grepper(windowsGrepper) + .register(registry); + MetricSnapshots snapshots = registry.scrape(); + + String expected = + """ + # TYPE process_start_time_seconds gauge + # UNIT process_start_time_seconds seconds + # HELP process_start_time_seconds Start time of the process since unix epoch in seconds. + process_start_time_seconds 37.1 + # EOF + """; + + assertThat(convertToOpenMetricsFormat(snapshots)).isEqualTo(expected); + } + + @Test + public void testIgnoredMetricNotScraped() { + MetricNameFilter filter = + MetricNameFilter.builder().nameMustNotBeEqualTo("process_max_fds").build(); + + PrometheusRegistry registry = new PrometheusRegistry(); + ProcessMetrics.builder() + .osBean(sunOsBean) + .runtimeBean(runtimeBean) + .grepper(linuxGrepper) + .register(registry); + registry.scrape(filter); + + verify(sunOsBean, times(0)).getMaxFileDescriptorCount(); + verify(sunOsBean, times(1)).getOpenFileDescriptorCount(); + } +} diff --git a/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/TestUtil.java b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/TestUtil.java new file mode 100644 index 000000000..64e15590c --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/TestUtil.java @@ -0,0 +1,18 @@ +package io.prometheus.metrics.instrumentation.jvm; + +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.expositionformats.OpenMetricsTextFormatWriter; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +class TestUtil { + + static String convertToOpenMetricsFormat(MetricSnapshots snapshots) throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter(true, true); + writer.write(out, snapshots, EscapingScheme.ALLOW_UTF8); + return out.toString(StandardCharsets.UTF_8); + } +} diff --git a/prometheus-metrics-instrumentation-jvm/version-rules.xml b/prometheus-metrics-instrumentation-jvm/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-instrumentation-jvm/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-model/pom.xml b/prometheus-metrics-model/pom.xml new file mode 100644 index 000000000..1919ee95c --- /dev/null +++ b/prometheus-metrics-model/pom.xml @@ -0,0 +1,32 @@ + + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-model + bundle + + Prometheus Metrics Model + + Data model for read-only immutable Prometheus metrics snapshots. + + + + io.prometheus.metrics.model + + + + + io.prometheus + prometheus-metrics-config + ${project.version} + + + diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/registry/Collector.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/registry/Collector.java new file mode 100644 index 000000000..b7154ae70 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/registry/Collector.java @@ -0,0 +1,81 @@ +package io.prometheus.metrics.model.registry; + +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import java.util.function.Predicate; +import javax.annotation.Nullable; + +/** + * To be registered with the Prometheus collector registry. See Overall Structure on https://prometheus.io/docs/instrumenting/writing_clientlibs/. + */ +@FunctionalInterface +public interface Collector { + + /** Called when the Prometheus server scrapes metrics. */ + MetricSnapshot collect(); + + /** + * Provides Collector with the details of the request issued by Prometheus to allow multi-target + * pattern implementation Override to implement request dependent logic to provide MetricSnapshot + */ + default MetricSnapshot collect(PrometheusScrapeRequest scrapeRequest) { + return collect(); + } + + /** + * Like {@link #collect()}, but returns {@code null} if {@code includedNames.test(name)} is {@code + * false}. + * + *

    Override this if there is a more efficient way than first collecting the snapshot and then + * discarding it. + */ + @Nullable + default MetricSnapshot collect(Predicate includedNames) { + MetricSnapshot result = collect(); + if (includedNames.test(result.getMetadata().getPrometheusName())) { + return result; + } else { + return null; + } + } + + /** + * Like {@link #collect(Predicate)}, but with support for multi-target pattern. + * + *

    Override this if there is a more efficient way than first collecting the snapshot and then + * discarding it. + */ + @Nullable + default MetricSnapshot collect( + Predicate includedNames, PrometheusScrapeRequest scrapeRequest) { + MetricSnapshot result = collect(scrapeRequest); + if (includedNames.test(result.getMetadata().getPrometheusName())) { + return result; + } else { + return null; + } + } + + /** + * This is called in two places: + * + *

      + *
    1. During registration to check if a metric with that name already exists. + *
    2. During scrape to check if this collector can be skipped because a name filter is present + * and the metric name is excluded. + *
    + * + * Returning {@code null} means checks are omitted (registration the metric always succeeds), and + * the collector is always scraped (the result is dropped after scraping if a name filter is + * present and the metric name is excluded). + * + *

    If your metric has a name that does not change at runtime it is a good idea to overwrite + * this and return the name. + * + *

    All metrics in {@code prometheus-metrics-core} override this. + */ + @Nullable + default String getPrometheusName() { + return null; + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/registry/MetricNameFilter.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/registry/MetricNameFilter.java new file mode 100644 index 000000000..609f7fd33 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/registry/MetricNameFilter.java @@ -0,0 +1,198 @@ +package io.prometheus.metrics.model.registry; + +import static java.util.Collections.unmodifiableCollection; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.function.Predicate; +import javax.annotation.Nullable; + +/** Filter samples (i.e. time series) by name. */ +public class MetricNameFilter implements Predicate { + + /** For convenience, a filter that allows all names. */ + public static final Predicate ALLOW_ALL = name -> true; + + private final Collection nameIsEqualTo; + private final Collection nameIsNotEqualTo; + private final Collection nameStartsWith; + private final Collection nameDoesNotStartWith; + + private MetricNameFilter( + Collection nameIsEqualTo, + Collection nameIsNotEqualTo, + Collection nameStartsWith, + Collection nameDoesNotStartWith) { + this.nameIsEqualTo = unmodifiableCollection(new ArrayList<>(nameIsEqualTo)); + this.nameIsNotEqualTo = unmodifiableCollection(new ArrayList<>(nameIsNotEqualTo)); + this.nameStartsWith = unmodifiableCollection(new ArrayList<>(nameStartsWith)); + this.nameDoesNotStartWith = unmodifiableCollection(new ArrayList<>(nameDoesNotStartWith)); + } + + @Override + public boolean test(String sampleName) { + return matchesNameEqualTo(sampleName) + && !matchesNameNotEqualTo(sampleName) + && matchesNameStartsWith(sampleName) + && !matchesNameDoesNotStartWith(sampleName); + } + + private boolean matchesNameEqualTo(String metricName) { + if (nameIsEqualTo.isEmpty()) { + return true; + } + for (String name : nameIsEqualTo) { + // The following ignores suffixes like _total. + // "request_count" and "request_count_total" both match a metric named "request_count". + if (name.startsWith(metricName)) { + return true; + } + } + return false; + } + + private boolean matchesNameNotEqualTo(String metricName) { + if (nameIsNotEqualTo.isEmpty()) { + return false; + } + for (String name : nameIsNotEqualTo) { + // The following ignores suffixes like _total. + // "request_count" and "request_count_total" both match a metric named "request_count". + if (name.startsWith(metricName)) { + return true; + } + } + return false; + } + + private boolean matchesNameStartsWith(String metricName) { + if (nameStartsWith.isEmpty()) { + return true; + } + for (String prefix : nameStartsWith) { + if (metricName.startsWith(prefix)) { + return true; + } + } + return false; + } + + private boolean matchesNameDoesNotStartWith(String metricName) { + if (nameDoesNotStartWith.isEmpty()) { + return false; + } + for (String prefix : nameDoesNotStartWith) { + if (metricName.startsWith(prefix)) { + return true; + } + } + return false; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + private final Collection nameEqualTo = new ArrayList<>(); + private final Collection nameNotEqualTo = new ArrayList<>(); + private final Collection nameStartsWith = new ArrayList<>(); + private final Collection nameDoesNotStartWith = new ArrayList<>(); + + private Builder() {} + + /** + * @see #nameMustBeEqualTo(Collection) + */ + public Builder nameMustBeEqualTo(String... names) { + return nameMustBeEqualTo(Arrays.asList(names)); + } + + /** + * Only samples with one of the {@code names} will be included. + * + *

    Note that the provided {@code names} will be matched against the sample name (i.e. the + * time series name) and not the metric name. For instance, to retrieve all samples from a + * histogram, you must include the '_count', '_sum' and '_bucket' names. + * + *

    This method should be used by HTTP exporters to implement the {@code ?name[]=} URL + * parameters. + * + * @param names empty means no restriction. + */ + public Builder nameMustBeEqualTo(@Nullable Collection names) { + if (names != null) { + nameEqualTo.addAll(names); + } + return this; + } + + /** + * @see #nameMustNotBeEqualTo(Collection) + */ + public Builder nameMustNotBeEqualTo(String... names) { + return nameMustNotBeEqualTo(Arrays.asList(names)); + } + + /** + * All samples that are not in {@code names} will be excluded. + * + *

    Note that the provided {@code names} will be matched against the sample name (i.e. the + * time series name) and not the metric name. For instance, to exclude all samples from a + * histogram, you must exclude the '_count', '_sum' and '_bucket' names. + * + * @param names empty means no name will be excluded. + */ + public Builder nameMustNotBeEqualTo(@Nullable Collection names) { + if (names != null) { + nameNotEqualTo.addAll(names); + } + return this; + } + + /** + * @see #nameMustStartWith(Collection) + */ + public Builder nameMustStartWith(String... prefixes) { + return nameMustStartWith(Arrays.asList(prefixes)); + } + + /** + * Only samples whose name starts with one of the {@code prefixes} will be included. + * + * @param prefixes empty means no restriction. + */ + public Builder nameMustStartWith(@Nullable Collection prefixes) { + if (prefixes != null) { + nameStartsWith.addAll(prefixes); + } + return this; + } + + /** + * @see #nameMustNotStartWith(Collection) + */ + public Builder nameMustNotStartWith(String... prefixes) { + return nameMustNotStartWith(Arrays.asList(prefixes)); + } + + /** + * Samples with names starting with one of the {@code prefixes} will be excluded. + * + * @param prefixes empty means no time series will be excluded. + */ + public Builder nameMustNotStartWith(@Nullable Collection prefixes) { + if (prefixes != null) { + nameDoesNotStartWith.addAll(prefixes); + } + return this; + } + + public MetricNameFilter build() { + return new MetricNameFilter( + nameEqualTo, nameNotEqualTo, nameStartsWith, nameDoesNotStartWith); + } + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/registry/MultiCollector.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/registry/MultiCollector.java new file mode 100644 index 000000000..d1051958d --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/registry/MultiCollector.java @@ -0,0 +1,73 @@ +package io.prometheus.metrics.model.registry; + +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.util.Collections; +import java.util.List; +import java.util.function.Predicate; +import javax.annotation.Nullable; + +/** Like {@link Collector}, but collecting multiple Snapshots at once. */ +@FunctionalInterface +public interface MultiCollector { + + /** Called when the Prometheus server scrapes metrics. */ + MetricSnapshots collect(); + + /** + * Provides Collector with the details of the request issued by Prometheus to allow multi-target + * pattern implementation Override to implement request dependent logic to provide MetricSnapshot + */ + default MetricSnapshots collect(PrometheusScrapeRequest scrapeRequest) { + return collect(); + } + + /** + * Like {@link #collect()}, but returns only the snapshots where {@code includedNames.test(name)} + * is {@code true}. + * + *

    Override this if there is a more efficient way than first collecting all snapshot and then + * discarding the excluded ones. + */ + default MetricSnapshots collect(Predicate includedNames) { + return collect(includedNames, null); + } + + /** + * Like {@link #collect(Predicate)}, but with support for multi-target pattern. + * + *

    Override this if there is a more efficient way than first collecting the snapshot and then + * discarding it. + */ + default MetricSnapshots collect( + Predicate includedNames, @Nullable PrometheusScrapeRequest scrapeRequest) { + MetricSnapshots allSnapshots = scrapeRequest == null ? collect() : collect(scrapeRequest); + MetricSnapshots.Builder result = MetricSnapshots.builder(); + for (MetricSnapshot snapshot : allSnapshots) { + if (includedNames.test(snapshot.getMetadata().getPrometheusName())) { + result.metricSnapshot(snapshot); + } + } + return result.build(); + } + + /** + * This is called in two places: + * + *

      + *
    1. During registration to check if a metric with that name already exists. + *
    2. During scrape to check if the collector can be skipped because a name filter is present + * and all names are excluded. + *
    + * + * Returning an empty list means checks are omitted (registration metric always succeeds), and the + * collector is always scraped (if a name filter is present and all names are excluded the result + * is dropped). + * + *

    If your collector returns a constant list of metrics that have names that do not change at + * runtime it is a good idea to overwrite this and return the names. + */ + default List getPrometheusNames() { + return Collections.emptyList(); + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/registry/PrometheusRegistry.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/registry/PrometheusRegistry.java new file mode 100644 index 000000000..7db568d95 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/registry/PrometheusRegistry.java @@ -0,0 +1,151 @@ +package io.prometheus.metrics.model.registry; + +import static io.prometheus.metrics.model.snapshots.PrometheusNaming.prometheusName; + +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.util.List; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.function.Predicate; +import javax.annotation.Nullable; + +public class PrometheusRegistry { + + public static final PrometheusRegistry defaultRegistry = new PrometheusRegistry(); + + private final Set prometheusNames = ConcurrentHashMap.newKeySet(); + private final List collectors = new CopyOnWriteArrayList<>(); + private final List multiCollectors = new CopyOnWriteArrayList<>(); + + public void register(Collector collector) { + String prometheusName = collector.getPrometheusName(); + if (prometheusName != null) { + if (!prometheusNames.add(prometheusName)) { + throw new IllegalStateException( + "Can't register " + + prometheusName + + " because a metric with that name is already registered."); + } + } + collectors.add(collector); + } + + public void register(MultiCollector collector) { + for (String prometheusName : collector.getPrometheusNames()) { + if (!prometheusNames.add(prometheusName)) { + throw new IllegalStateException( + "Can't register " + prometheusName + " because that name is already registered."); + } + } + multiCollectors.add(collector); + } + + public void unregister(Collector collector) { + collectors.remove(collector); + String prometheusName = collector.getPrometheusName(); + if (prometheusName != null) { + prometheusNames.remove(collector.getPrometheusName()); + } + } + + public void unregister(MultiCollector collector) { + multiCollectors.remove(collector); + for (String prometheusName : collector.getPrometheusNames()) { + prometheusNames.remove(prometheusName(prometheusName)); + } + } + + public void clear() { + collectors.clear(); + multiCollectors.clear(); + prometheusNames.clear(); + } + + public MetricSnapshots scrape() { + return scrape((PrometheusScrapeRequest) null); + } + + public MetricSnapshots scrape(@Nullable PrometheusScrapeRequest scrapeRequest) { + MetricSnapshots.Builder result = MetricSnapshots.builder(); + for (Collector collector : collectors) { + MetricSnapshot snapshot = + scrapeRequest == null ? collector.collect() : collector.collect(scrapeRequest); + if (snapshot != null) { + if (result.containsMetricName(snapshot.getMetadata().getName())) { + throw new IllegalStateException( + snapshot.getMetadata().getPrometheusName() + ": duplicate metric name."); + } + result.metricSnapshot(snapshot); + } + } + for (MultiCollector collector : multiCollectors) { + MetricSnapshots snapshots = + scrapeRequest == null ? collector.collect() : collector.collect(scrapeRequest); + for (MetricSnapshot snapshot : snapshots) { + if (result.containsMetricName(snapshot.getMetadata().getName())) { + throw new IllegalStateException( + snapshot.getMetadata().getPrometheusName() + ": duplicate metric name."); + } + result.metricSnapshot(snapshot); + } + } + return result.build(); + } + + public MetricSnapshots scrape(Predicate includedNames) { + if (includedNames == null) { + return scrape(); + } + return scrape(includedNames, null); + } + + public MetricSnapshots scrape( + Predicate includedNames, @Nullable PrometheusScrapeRequest scrapeRequest) { + if (includedNames == null) { + return scrape(scrapeRequest); + } + MetricSnapshots.Builder result = MetricSnapshots.builder(); + for (Collector collector : collectors) { + String prometheusName = collector.getPrometheusName(); + // prometheusName == null means the name is unknown, and we have to scrape to learn the name. + // prometheusName != null means we can skip the scrape if the name is excluded. + if (prometheusName == null || includedNames.test(prometheusName)) { + MetricSnapshot snapshot = + scrapeRequest == null + ? collector.collect(includedNames) + : collector.collect(includedNames, scrapeRequest); + if (snapshot != null) { + result.metricSnapshot(snapshot); + } + } + } + for (MultiCollector collector : multiCollectors) { + List prometheusNames = collector.getPrometheusNames(); + // empty prometheusNames means the names are unknown, and we have to scrape to learn the + // names. + // non-empty prometheusNames means we can exclude the collector if all names are excluded by + // the filter. + boolean excluded = !prometheusNames.isEmpty(); + for (String prometheusName : prometheusNames) { + if (includedNames.test(prometheusName)) { + excluded = false; + break; + } + } + if (!excluded) { + MetricSnapshots snapshots = + scrapeRequest == null + ? collector.collect(includedNames) + : collector.collect(includedNames, scrapeRequest); + for (MetricSnapshot snapshot : snapshots) { + if (snapshot != null) { + result.metricSnapshot(snapshot); + } + } + } + } + return result.build(); + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/registry/PrometheusScrapeRequest.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/registry/PrometheusScrapeRequest.java new file mode 100644 index 000000000..91a1313ab --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/registry/PrometheusScrapeRequest.java @@ -0,0 +1,14 @@ +package io.prometheus.metrics.model.registry; + +import javax.annotation.Nullable; + +/** Infos extracted from the request received by the endpoint */ +public interface PrometheusScrapeRequest { + + /** Absolute path of the HTTP request. */ + String getRequestPath(); + + /** See {@code jakarta.servlet.ServletRequest.getParameterValues(String name)} */ + @Nullable + String[] getParameterValues(String name); +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/ClassicHistogramBucket.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/ClassicHistogramBucket.java new file mode 100644 index 000000000..ebadd1f16 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/ClassicHistogramBucket.java @@ -0,0 +1,44 @@ +package io.prometheus.metrics.model.snapshots; + +/** + * Helper class for iterating over {@link ClassicHistogramBuckets}. Note that the {@code count} is + * not cumulative. + */ +public class ClassicHistogramBucket implements Comparable { + + private final long count; // not cumulative + private final double upperBound; + + public ClassicHistogramBucket(double upperBound, long count) { + this.count = count; + this.upperBound = upperBound; + if (Double.isNaN(upperBound)) { + throw new IllegalArgumentException("Cannot use NaN as an upper bound for a histogram bucket"); + } + if (count < 0) { + throw new IllegalArgumentException( + count + + ": " + + ClassicHistogramBuckets.class.getSimpleName() + + " cannot have a negative count"); + } + } + + public long getCount() { + return count; + } + + public double getUpperBound() { + return upperBound; + } + + /** For sorting a list of buckets by upper bound. */ + @Override + public int compareTo(ClassicHistogramBucket other) { + int result = Double.compare(upperBound, other.upperBound); + if (result != 0) { + return result; + } + return Long.compare(count, other.count); + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/ClassicHistogramBuckets.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/ClassicHistogramBuckets.java new file mode 100644 index 000000000..09e75181b --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/ClassicHistogramBuckets.java @@ -0,0 +1,227 @@ +package io.prometheus.metrics.model.snapshots; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.stream.Stream; + +/** + * Immutable container for histogram buckets with fixed bucket boundaries. Note that the counts are + * not cumulative. + */ +public class ClassicHistogramBuckets implements Iterable { + + /** Used in native histograms to indicate that no classic histogram buckets are present. */ + public static final ClassicHistogramBuckets EMPTY = + new ClassicHistogramBuckets(new double[] {}, new long[] {}); + + private final double[] upperBounds; + private final long[] counts; // not cumulative + + private ClassicHistogramBuckets(double[] upperBounds, long[] counts) { + this.upperBounds = upperBounds; + this.counts = counts; + } + + /** + * To create new {@link ClassicHistogramBuckets}, you can either use one of the static {@code + * of(...)} methods, or use {@link ClassicHistogramBuckets#builder()}. + * + *

    This method will create a copy of upperBounds and counts. + * + * @param upperBounds must have the same length as counts. Must not contain duplicates. Must + * contain at least {@link Double#POSITIVE_INFINITY} for the {@code +Inf} bucket. An upper + * bound must not be {@link Double#NaN}. The upperBounds array does not need to be sorted. + * @param counts must have the same length as {@code upperBounds}. The entry at index {@code i} is + * the count for the {@code upperBounds} at index {@code i}. For each count, {@link + * Number#longValue()} is called to get the value. Counts are not cumulative. Counts + * must not be negative. + */ + public static ClassicHistogramBuckets of( + List upperBounds, List counts) { + double[] upperBoundsCopy = new double[upperBounds.size()]; + for (int i = 0; i < upperBounds.size(); i++) { + upperBoundsCopy[i] = upperBounds.get(i); + } + long[] countsCopy = new long[counts.size()]; + for (int i = 0; i < counts.size(); i++) { + countsCopy[i] = counts.get(i).longValue(); + } + sortAndValidate(upperBoundsCopy, countsCopy); + return new ClassicHistogramBuckets(upperBoundsCopy, countsCopy); + } + + /** + * To create new {@link ClassicHistogramBuckets}, you can either use one of the static {@code + * of(...)} methods, or use {@link ClassicHistogramBuckets#builder()}. + * + *

    This method will create a copy of upperBounds and counts. + * + * @param upperBounds must have the same length as counts. Must not contain duplicates. Must + * contain at least {@link Double#POSITIVE_INFINITY} for the {@code +Inf} bucket. An upper + * bound must not be {@link Double#NaN}. The upperBounds array does not need to be sorted. + * @param counts must have the same length as {@code upperBounds}. The entry at index {@code i} is + * the count for the {@code upperBounds} at index {@code i}. For each count, {@link + * Number#longValue()} is called to get the value. Counts are not cumulative. Counts + * must not be negative. + */ + public static ClassicHistogramBuckets of(double[] upperBounds, Number[] counts) { + double[] upperBoundsCopy = Arrays.copyOf(upperBounds, upperBounds.length); + long[] countsCopy = new long[counts.length]; + for (int i = 0; i < counts.length; i++) { + countsCopy[i] = counts[i].longValue(); + } + sortAndValidate(upperBoundsCopy, countsCopy); + return new ClassicHistogramBuckets(upperBoundsCopy, countsCopy); + } + + /** + * To create new {@link ClassicHistogramBuckets}, you can either use one of the static {@code + * of(...)} methods, or use {@link ClassicHistogramBuckets#builder()}. + * + *

    This method will create a copy of upperBounds and counts. + * + * @param upperBounds must have the same length as counts. Must not contain duplicates. Must + * contain at least {@link Double#POSITIVE_INFINITY} for the {@code +Inf} bucket. An upper + * bound must not be {@link Double#NaN}. The upperBounds array does not need to be sorted. + * @param counts must have the same length as {@code upperBounds}. The entry at index {@code i} is + * the count for the {@code upperBounds} at index {@code i}. Counts are not cumulative. + * Counts must not be negative. + */ + public static ClassicHistogramBuckets of(double[] upperBounds, long[] counts) { + double[] upperBoundsCopy = Arrays.copyOf(upperBounds, upperBounds.length); + long[] countsCopy = Arrays.copyOf(counts, counts.length); + sortAndValidate(upperBoundsCopy, countsCopy); + return new ClassicHistogramBuckets(upperBoundsCopy, countsCopy); + } + + private static void sortAndValidate(double[] upperBounds, long[] counts) { + if (upperBounds.length != counts.length) { + throw new IllegalArgumentException( + "upperBounds.length == " + + upperBounds.length + + " but counts.length == " + + counts.length + + ". Expected the same length."); + } + sort(upperBounds, counts); + validate(upperBounds, counts); + } + + private static void sort(double[] upperBounds, long[] counts) { + // Bubblesort. Should be efficient here as in most cases upperBounds is already sorted. + int n = upperBounds.length; + for (int i = 0; i < n - 1; i++) { + for (int j = 0; j < n - i - 1; j++) { + if (upperBounds[j] > upperBounds[j + 1]) { + swap(j, j + 1, upperBounds, counts); + } + } + } + } + + private static void swap(int i, int j, double[] upperBounds, long[] counts) { + double tmpDouble = upperBounds[j]; + upperBounds[j] = upperBounds[i]; + upperBounds[i] = tmpDouble; + long tmpLong = counts[j]; + counts[j] = counts[i]; + counts[i] = tmpLong; + } + + private static void validate(double[] upperBounds, long[] counts) { + // Preconditions: + // * upperBounds sorted + // * upperBounds and counts have the same length + if (upperBounds.length == 0) { + throw new IllegalArgumentException( + ClassicHistogramBuckets.class.getSimpleName() + + " cannot be empty. They must contain at least the +Inf bucket."); + } + if (upperBounds[upperBounds.length - 1] != Double.POSITIVE_INFINITY) { + throw new IllegalArgumentException( + ClassicHistogramBuckets.class.getSimpleName() + " must contain the +Inf bucket."); + } + for (int i = 0; i < upperBounds.length; i++) { + if (Double.isNaN(upperBounds[i])) { + throw new IllegalArgumentException( + "Cannot use NaN as an upper bound in " + ClassicHistogramBuckets.class.getSimpleName()); + } + if (counts[i] < 0) { + throw new IllegalArgumentException( + "Counts in " + ClassicHistogramBuckets.class.getSimpleName() + " cannot be negative."); + } + if (i > 0) { + if (upperBounds[i - 1] == upperBounds[i]) { + throw new IllegalArgumentException("Duplicate upper bound " + upperBounds[i]); + } + } + } + } + + public int size() { + return upperBounds.length; + } + + public double getUpperBound(int i) { + return upperBounds[i]; + } + + /** The count is not cumulative. */ + public long getCount(int i) { + return counts[i]; + } + + public boolean isEmpty() { + return this.upperBounds.length == 0; + } + + private List asList() { + List result = new ArrayList<>(size()); + for (int i = 0; i < upperBounds.length; i++) { + result.add(new ClassicHistogramBucket(upperBounds[i], counts[i])); + } + return Collections.unmodifiableList(result); + } + + @Override + public Iterator iterator() { + return asList().iterator(); + } + + public Stream stream() { + return asList().stream(); + } + + /** + * To create new {@link ClassicHistogramBuckets}, you can either use one of the static {@code + * of(...)} methods, or use {@code builder()}. + */ + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private final List upperBounds = new ArrayList<>(); + private final List counts = new ArrayList<>(); + + private Builder() {} + + /** Must be called at least once for the {@link Double#POSITIVE_INFINITY} bucket. */ + public Builder bucket(double upperBound, long count) { + upperBounds.add(upperBound); + counts.add(count); + return this; + } + + /** + * Will throw an {@link IllegalArgumentException} if the {@link Double#POSITIVE_INFINITY} bucket + * is missing. + */ + public ClassicHistogramBuckets build() { + return ClassicHistogramBuckets.of(upperBounds, counts); + } + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/CounterSnapshot.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/CounterSnapshot.java new file mode 100644 index 000000000..72a83a879 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/CounterSnapshot.java @@ -0,0 +1,192 @@ +package io.prometheus.metrics.model.snapshots; + +import io.prometheus.metrics.config.EscapingScheme; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import javax.annotation.Nullable; + +/** Immutable snapshot of a Counter. */ +public class CounterSnapshot extends MetricSnapshot { + + /** + * To create a new {@link CounterSnapshot}, you can either call the constructor directly or use + * the builder with {@link CounterSnapshot#builder()}. + * + * @param metadata the metric name in metadata must not include the {@code _total} suffix. See + * {@link MetricMetadata} for more naming conventions. + * @param dataPoints the constructor will create a sorted copy of the collection. + */ + public CounterSnapshot(MetricMetadata metadata, Collection dataPoints) { + this(metadata, dataPoints, false); + } + + private CounterSnapshot( + MetricMetadata metadata, Collection dataPoints, boolean internal) { + super(metadata, dataPoints, internal); + } + + @SuppressWarnings("unchecked") + @Override + public List getDataPoints() { + return (List) dataPoints; + } + + @SuppressWarnings("unchecked") + @Override + MetricSnapshot escape( + EscapingScheme escapingScheme, List dataPointSnapshots) { + return new CounterSnapshot( + getMetadata().escape(escapingScheme), + (List) dataPointSnapshots, + true); + } + + public static class CounterDataPointSnapshot extends DataPointSnapshot { + + private final double value; + @Nullable private final Exemplar exemplar; + + /** + * To create a new {@link CounterDataPointSnapshot}, you can either call the constructor + * directly or use the Builder with {@link CounterDataPointSnapshot#builder()}. + * + * @param value the counter value. Must not be negative. + * @param labels must not be null. Use {@link Labels#EMPTY} if there are no labels. + * @param exemplar may be null. + * @param createdTimestampMillis timestamp (as in {@link System#currentTimeMillis()}) when the + * time series (this specific set of labels) was created (or reset to zero). It's optional. + * Use {@code 0L} if there is no created timestamp. + */ + public CounterDataPointSnapshot( + double value, Labels labels, @Nullable Exemplar exemplar, long createdTimestampMillis) { + this(value, labels, exemplar, createdTimestampMillis, 0); + } + + /** + * Constructor with an additional scrape timestamp. This is only useful in rare cases as the + * scrape timestamp is usually set by the Prometheus server during scraping. Exceptions include + * mirroring metrics with given timestamps from other metric sources. + */ + @SuppressWarnings("this-escape") + public CounterDataPointSnapshot( + double value, + Labels labels, + @Nullable Exemplar exemplar, + long createdTimestampMillis, + long scrapeTimestampMillis) { + this(value, labels, exemplar, createdTimestampMillis, scrapeTimestampMillis, false); + } + + @SuppressWarnings("this-escape") + public CounterDataPointSnapshot( + double value, + Labels labels, + @Nullable Exemplar exemplar, + long createdTimestampMillis, + long scrapeTimestampMillis, + boolean internal) { + super(labels, createdTimestampMillis, scrapeTimestampMillis, internal); + this.value = value; + this.exemplar = exemplar; + if (!internal) { + validate(); + } + } + + public double getValue() { + return value; + } + + @Nullable + public Exemplar getExemplar() { + return exemplar; + } + + protected void validate() { + if (value < 0.0) { + throw new IllegalArgumentException(value + ": counters cannot have a negative value"); + } + } + + @Override + DataPointSnapshot escape(EscapingScheme escapingScheme) { + return new CounterSnapshot.CounterDataPointSnapshot( + value, + SnapshotEscaper.escapeLabels(getLabels(), escapingScheme), + SnapshotEscaper.escapeExemplar(exemplar, escapingScheme), + getCreatedTimestampMillis(), + getScrapeTimestampMillis(), + true); + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder extends DataPointSnapshot.Builder { + + @Nullable private Exemplar exemplar = null; + @Nullable private Double value = null; + private long createdTimestampMillis = 0L; + + private Builder() {} + + /** Counter value. This is required. The value must not be negative. */ + public Builder value(double value) { + this.value = value; + return this; + } + + public Builder exemplar(@Nullable Exemplar exemplar) { + this.exemplar = exemplar; + return this; + } + + public Builder createdTimestampMillis(long createdTimestampMillis) { + this.createdTimestampMillis = createdTimestampMillis; + return this; + } + + public CounterDataPointSnapshot build() { + if (value == null) { + throw new IllegalArgumentException("Missing required field: value is null."); + } + return new CounterDataPointSnapshot( + value, labels, exemplar, createdTimestampMillis, scrapeTimestampMillis); + } + + @Override + protected Builder self() { + return this; + } + } + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder extends MetricSnapshot.Builder { + + private final List dataPoints = new ArrayList<>(); + + private Builder() {} + + /** Add a data point. Can be called multiple times to add multiple data points. */ + public Builder dataPoint(CounterDataPointSnapshot dataPoint) { + dataPoints.add(dataPoint); + return this; + } + + @Override + public CounterSnapshot build() { + return new CounterSnapshot(buildMetadata(), dataPoints); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/DataPointSnapshot.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/DataPointSnapshot.java new file mode 100644 index 000000000..d960912a0 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/DataPointSnapshot.java @@ -0,0 +1,94 @@ +package io.prometheus.metrics.model.snapshots; + +import io.prometheus.metrics.config.EscapingScheme; + +@SuppressWarnings("this-escape") +public abstract class DataPointSnapshot { + private final Labels labels; + private final long createdTimestampMillis; + private final long scrapeTimestampMillis; + + protected DataPointSnapshot( + Labels labels, long createdTimestampMillis, long scrapeTimestampMillis, boolean internal) { + this.labels = labels; + this.createdTimestampMillis = createdTimestampMillis; + this.scrapeTimestampMillis = scrapeTimestampMillis; + if (!internal) { + validate(); + } + } + + private void validate() { + if (labels == null) { + throw new IllegalArgumentException( + "Labels cannot be null. Use Labels.EMPTY if there are no labels."); + } + if (createdTimestampMillis < 0) { + throw new IllegalArgumentException( + "Created timestamp cannot be negative. " + + "Use 0 if the metric doesn't have a created timestamp."); + } + if (scrapeTimestampMillis < 0) { + throw new IllegalArgumentException( + "Scrape timestamp cannot be negative. " + + "Use 0 to indicate that the Prometheus server should set the scrape timestamp."); + } + if (hasCreatedTimestamp() && hasScrapeTimestamp()) { + if (scrapeTimestampMillis < createdTimestampMillis) { + throw new IllegalArgumentException( + "The scrape timestamp cannot be before the created timestamp"); + } + } + } + + public Labels getLabels() { + return labels; + } + + public boolean hasScrapeTimestamp() { + return scrapeTimestampMillis != 0L; + } + + /** This will only return a reasonable value if {@link #hasScrapeTimestamp()} is true. */ + public long getScrapeTimestampMillis() { + return scrapeTimestampMillis; + } + + public boolean hasCreatedTimestamp() { + return createdTimestampMillis != 0L; + } + + /** + * This will only return a reasonable value if {@link #hasCreatedTimestamp()} is true. Some + * metrics like Gauge don't have created timestamps. For these metrics {@link + * #hasCreatedTimestamp()} is always false. + */ + public long getCreatedTimestampMillis() { + return createdTimestampMillis; + } + + public abstract static class Builder> { + + protected Labels labels = Labels.EMPTY; + protected long scrapeTimestampMillis = 0L; + + public T labels(Labels labels) { + this.labels = labels; + return self(); + } + + /** + * In most cases you should not set a scrape timestamp, because the scrape timestamp is set by + * the Prometheus server during scraping. Exceptions include mirroring metrics with given + * timestamps from other metric sources. + */ + public T scrapeTimestampMillis(long scrapeTimestampMillis) { + this.scrapeTimestampMillis = scrapeTimestampMillis; + return self(); + } + + protected abstract T self(); + } + + abstract DataPointSnapshot escape(EscapingScheme escapingScheme); +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/DistributionDataPointSnapshot.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/DistributionDataPointSnapshot.java new file mode 100644 index 000000000..1ae0559e1 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/DistributionDataPointSnapshot.java @@ -0,0 +1,89 @@ +package io.prometheus.metrics.model.snapshots; + +/** + * Common base class for histogram and summary data. Histograms and Summaries represent + * distributions, like a latency distribution or a distribution of request sizes in Bytes. + */ +public abstract class DistributionDataPointSnapshot extends DataPointSnapshot { + private final long count; // optional, negative value means no count. + private final double sum; // optional, Double.NaN means no sum. + private final Exemplars exemplars; // optional, Exemplars.EMPTY means no Exemplars. + + /** See JavaDoc of the child classes. */ + protected DistributionDataPointSnapshot( + long count, + double sum, + Exemplars exemplars, + Labels labels, + long createdTimestampMillis, + long scrapeTimestampMillis, + boolean internal) { + super(labels, createdTimestampMillis, scrapeTimestampMillis, internal); + this.count = count; + this.sum = sum; + this.exemplars = exemplars == null ? Exemplars.EMPTY : exemplars; + if (!internal) { + validate(); + } + } + + private void validate() { + // If a histogram or summary observes negative values the sum could be negative. + // According to OpenMetrics sum should be omitted in that case, but we don't enforce this here. + } + + public boolean hasCount() { + return count >= 0; + } + + public boolean hasSum() { + return !Double.isNaN(sum); + } + + /** This will return garbage if {@link #hasCount()} is {@code false}. */ + public long getCount() { + return count; + } + + /** This will return garbage if {@link #hasSum()} is {@code false}. */ + public double getSum() { + return sum; + } + + /** May be {@link Exemplars#EMPTY}, but will never be {@code null}. */ + public Exemplars getExemplars() { + return exemplars; + } + + abstract static class Builder> extends DataPointSnapshot.Builder { + + protected long count = -1; + protected double sum = Double.NaN; + protected long createdTimestampMillis = 0L; + protected Exemplars exemplars = Exemplars.EMPTY; + + /** + * Count can be explicitly set on summaries (this is a public method for summary metrics), and + * it is set implicitly on histograms (derived from the bucket counts). + */ + protected T count(long count) { + this.count = count; + return self(); + } + + public T sum(double sum) { + this.sum = sum; + return self(); + } + + public T exemplars(Exemplars exemplars) { + this.exemplars = exemplars; + return self(); + } + + public T createdTimestampMillis(long createdTimestampMillis) { + this.createdTimestampMillis = createdTimestampMillis; + return self(); + } + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/DuplicateLabelsException.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/DuplicateLabelsException.java new file mode 100644 index 000000000..721655105 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/DuplicateLabelsException.java @@ -0,0 +1,27 @@ +package io.prometheus.metrics.model.snapshots; + +/** + * Thrown when a collector tries to create a {@link MetricSnapshot} where multiple data points have + * the same labels (same label names and label values). + */ +public class DuplicateLabelsException extends IllegalArgumentException { + + private static final long serialVersionUID = 0L; + + private final MetricMetadata metadata; + private final Labels labels; + + public DuplicateLabelsException(MetricMetadata metadata, Labels labels) { + super("Duplicate labels for metric \"" + metadata.getName() + "\": " + labels); + this.metadata = metadata; + this.labels = labels; + } + + public MetricMetadata getMetadata() { + return metadata; + } + + public Labels getLabels() { + return labels; + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Exemplar.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Exemplar.java new file mode 100644 index 000000000..418603580 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Exemplar.java @@ -0,0 +1,122 @@ +package io.prometheus.metrics.model.snapshots; + +import static java.util.Objects.requireNonNull; + +import javax.annotation.Nullable; + +/** Immutable representation of an Exemplar. */ +public class Exemplar { + + /** Label name for trace id. */ + public static final String TRACE_ID = "trace_id"; + + /** Label name for span id. */ + public static final String SPAN_ID = "span_id"; + + private final double value; + private final Labels labels; + private final long timestampMillis; + + /** + * To create a new {@link Exemplar}, you can either call the constructor directly or use the + * Builder with {@link Exemplar#builder()}. + * + * @param value the observed value. This is required. + * @param labels in most cases the labels will contain the {@link #TRACE_ID} and {@link #SPAN_ID}. + * Must not be {@code null}. Use {@link Labels#EMPTY} if no labels are present. + * @param timestampMillis timestamp when the value was observed. Optional. Use 0L if not + * available. + */ + public Exemplar(double value, Labels labels, long timestampMillis) { + if (labels == null) { + throw new NullPointerException("Labels cannot be null. Use Labels.EMPTY."); + } + this.value = value; + this.labels = labels; + this.timestampMillis = timestampMillis; + } + + public double getValue() { + return value; + } + + /** + * In most cases labels will contain {@link #TRACE_ID} and {@link #SPAN_ID}, but this is not + * required. May be {@link Labels#EMPTY}, but may not be {@code null}. + */ + public Labels getLabels() { + return labels; + } + + public boolean hasTimestamp() { + return timestampMillis != 0L; + } + + /** Will return garbage if {@link #hasTimestamp()} is {@code false}. */ + public long getTimestampMillis() { + return timestampMillis; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + @Nullable private Double value = null; + private Labels labels = Labels.EMPTY; + @Nullable private String traceId = null; + @Nullable private String spanId = null; + private long timestampMillis = 0L; + + private Builder() {} + + public Builder value(double value) { + this.value = value; + return this; + } + + public Builder traceId(String traceId) { + this.traceId = traceId; + return this; + } + + public Builder spanId(String spanId) { + this.spanId = spanId; + return this; + } + + public Builder labels(Labels labels) { + this.labels = requireNonNull(labels, "Labels must not be null."); + return this; + } + + public Builder timestampMillis(long timestampMillis) { + this.timestampMillis = timestampMillis; + return this; + } + + /** + * @throws IllegalStateException if {@link #value(double)} wasn't called. + */ + public Exemplar build() { + if (value == null) { + throw new IllegalStateException("cannot build an Exemplar without a value"); + } + Labels allLabels; + if (traceId != null && spanId != null) { + allLabels = Labels.of(TRACE_ID, traceId, SPAN_ID, spanId); + } else if (traceId != null) { + allLabels = Labels.of(TRACE_ID, traceId); + } else if (spanId != null) { + allLabels = Labels.of(SPAN_ID, spanId); + } else { + allLabels = Labels.EMPTY; + } + if (!labels.isEmpty()) { + allLabels = allLabels.merge(labels); + } + return new Exemplar(value, allLabels, timestampMillis); + } + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Exemplars.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Exemplars.java new file mode 100644 index 000000000..887a80fff --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Exemplars.java @@ -0,0 +1,143 @@ +package io.prometheus.metrics.model.snapshots; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import javax.annotation.Nullable; + +/** + * Immutable container for Exemplars. + * + *

    This is currently backed by a {@code List}. May be refactored later to use a more + * efficient data structure. + */ +public class Exemplars implements Iterable { + + /** EMPTY means no Exemplars. */ + public static final Exemplars EMPTY = new Exemplars(Collections.emptyList()); + + private final List exemplars; + + private Exemplars(Collection exemplars) { + List copy = new ArrayList<>(exemplars.size()); + for (Exemplar exemplar : exemplars) { + if (exemplar == null) { + throw new NullPointerException("Illegal null value in Exemplars"); + } + copy.add(exemplar); + } + this.exemplars = Collections.unmodifiableList(copy); + } + + /** + * Create a new Exemplars instance. You can either create Exemplars with one of the static {@code + * Exemplars.of(...)} methods, or you can use the {@link Exemplars#builder()}. + * + * @param exemplars a copy of the exemplars collection will be created. + */ + public static Exemplars of(Collection exemplars) { + return new Exemplars(exemplars); + } + + /** + * Create a new Exemplars instance. You can either create Exemplars with one of the static {@code + * Exemplars.of(...)} methods, or you can use the {@link Exemplars#builder()}. + * + * @param exemplars a copy of the exemplars array will be created. + */ + public static Exemplars of(Exemplar... exemplars) { + return new Exemplars(Arrays.asList(exemplars)); + } + + @Override + public Iterator iterator() { + return exemplars.iterator(); + } + + public int size() { + return exemplars.size(); + } + + @Nullable + public Exemplar get(int index) { + return exemplars.get(index); + } + + /** + * This is used by classic histograms to find an exemplar with a value between lowerBound and + * upperBound. If there is more than one exemplar within the bounds the one with the newest time + * stamp is returned. + */ + @Nullable + public Exemplar get(double lowerBound, double upperBound) { + Exemplar result = null; + for (Exemplar exemplar : exemplars) { + double value = exemplar.getValue(); + if (value > lowerBound && value <= upperBound) { + if (result == null) { + result = exemplar; + } else if (result.hasTimestamp() && exemplar.hasTimestamp()) { + if (exemplar.getTimestampMillis() > result.getTimestampMillis()) { + result = exemplar; + } + } + } + } + return result; + } + + /** Find the Exemplar with the newest timestamp. May return {@code null}. */ + @Nullable + public Exemplar getLatest() { + Exemplar latest = null; + for (Exemplar candidate : exemplars) { + if (candidate == null) { + continue; + } + if (latest == null) { + latest = candidate; + continue; + } + if (!latest.hasTimestamp()) { + latest = candidate; + continue; + } + if (candidate.hasTimestamp()) { + if (latest.getTimestampMillis() < candidate.getTimestampMillis()) { + latest = candidate; + } + } + } + return latest; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + private final ArrayList exemplars = new ArrayList<>(); + + private Builder() {} + + /** Add an exemplar. This can be called multiple times to add multiple exemplars. */ + public Builder exemplar(Exemplar exemplar) { + exemplars.add(exemplar); + return this; + } + + /** Add all exemplars form the collection. */ + public Builder exemplars(Collection exemplars) { + this.exemplars.addAll(exemplars); + return this; + } + + public Exemplars build() { + return Exemplars.of(exemplars); + } + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/GaugeSnapshot.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/GaugeSnapshot.java new file mode 100644 index 000000000..03474852f --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/GaugeSnapshot.java @@ -0,0 +1,164 @@ +package io.prometheus.metrics.model.snapshots; + +import io.prometheus.metrics.config.EscapingScheme; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import javax.annotation.Nullable; + +/** Immutable snapshot of a Gauge. */ +public final class GaugeSnapshot extends MetricSnapshot { + + /** + * To create a new {@link GaugeSnapshot}, you can either call the constructor directly or use the + * builder with {@link GaugeSnapshot#builder()}. + * + * @param metadata see {@link MetricMetadata} for naming conventions. + * @param data the constructor will create a sorted copy of the collection. + */ + public GaugeSnapshot(MetricMetadata metadata, Collection data) { + this(metadata, data, false); + } + + private GaugeSnapshot( + MetricMetadata metadata, Collection data, boolean internal) { + super(metadata, data, internal); + } + + @SuppressWarnings("unchecked") + @Override + public List getDataPoints() { + return (List) dataPoints; + } + + @SuppressWarnings("unchecked") + @Override + MetricSnapshot escape( + EscapingScheme escapingScheme, List dataPointSnapshots) { + return new GaugeSnapshot( + getMetadata().escape(escapingScheme), + (List) dataPointSnapshots, + true); + } + + public static final class GaugeDataPointSnapshot extends DataPointSnapshot { + + private final double value; + @Nullable private final Exemplar exemplar; + + /** + * To create a new {@link GaugeDataPointSnapshot}, you can either call the constructor directly + * or use the Builder with {@link GaugeDataPointSnapshot#builder()}. + * + * @param value the gauge value. + * @param labels must not be null. Use {@link Labels#EMPTY} if there are no labels. + * @param exemplar may be null. + */ + public GaugeDataPointSnapshot(double value, Labels labels, @Nullable Exemplar exemplar) { + this(value, labels, exemplar, 0); + } + + /** + * Constructor with an additional scrape timestamp. This is only useful in rare cases as the + * scrape timestamp is usually set by the Prometheus server during scraping. Exceptions include + * mirroring metrics with given timestamps from other metric sources. + */ + public GaugeDataPointSnapshot( + double value, Labels labels, @Nullable Exemplar exemplar, long scrapeTimestampMillis) { + this(value, labels, exemplar, scrapeTimestampMillis, false); + } + + private GaugeDataPointSnapshot( + double value, + Labels labels, + @Nullable Exemplar exemplar, + long scrapeTimestampMillis, + boolean internal) { + super(labels, 0L, scrapeTimestampMillis, internal); + this.value = value; + this.exemplar = exemplar; + } + + public double getValue() { + return value; + } + + @Nullable + public Exemplar getExemplar() { + return exemplar; + } + + public static Builder builder() { + return new Builder(); + } + + @Override + DataPointSnapshot escape(EscapingScheme escapingScheme) { + return new GaugeSnapshot.GaugeDataPointSnapshot( + value, + SnapshotEscaper.escapeLabels(getLabels(), escapingScheme), + SnapshotEscaper.escapeExemplar(exemplar, escapingScheme), + getCreatedTimestampMillis(), + true); + } + + public static class Builder extends DataPointSnapshot.Builder { + + @Nullable private Exemplar exemplar = null; + @Nullable private Double value = null; + + private Builder() {} + + /** Gauge value. This is required. */ + public Builder value(double value) { + this.value = value; + return this; + } + + /** Optional */ + public Builder exemplar(Exemplar exemplar) { + this.exemplar = exemplar; + return this; + } + + public GaugeDataPointSnapshot build() { + if (value == null) { + throw new IllegalArgumentException("Missing required field: value is null."); + } + return new GaugeDataPointSnapshot(value, labels, exemplar, scrapeTimestampMillis); + } + + @Override + protected Builder self() { + return this; + } + } + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder extends MetricSnapshot.Builder { + + private final List dataPoints = new ArrayList<>(); + + private Builder() {} + + /** Add a data point. This can be called multiple times to add multiple data points. */ + public Builder dataPoint(GaugeDataPointSnapshot dataPoint) { + dataPoints.add(dataPoint); + return this; + } + + @Override + public GaugeSnapshot build() { + return new GaugeSnapshot(buildMetadata(), dataPoints); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/HistogramSnapshot.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/HistogramSnapshot.java new file mode 100644 index 000000000..acc78d3d3 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/HistogramSnapshot.java @@ -0,0 +1,552 @@ +package io.prometheus.metrics.model.snapshots; + +import io.prometheus.metrics.config.EscapingScheme; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +/** Immutable snapshot of a Histogram. */ +public final class HistogramSnapshot extends MetricSnapshot { + + private final boolean gaugeHistogram; + public static final int CLASSIC_HISTOGRAM = Integer.MIN_VALUE; + + /** + * To create a new {@link HistogramSnapshot}, you can either call the constructor directly or use + * the builder with {@link HistogramSnapshot#builder()}. + * + * @param metadata see {@link MetricMetadata} for naming conventions. + * @param data the constructor will create a sorted copy of the collection. + */ + public HistogramSnapshot(MetricMetadata metadata, Collection data) { + this(false, metadata, data); + } + + /** + * Use this with the first parameter {@code true} to create a snapshot of a Gauge Histogram. The + * data model for Gauge Histograms is the same as for regular histograms, except that bucket + * values are semantically gauges and not counters. See openmetrics.io for more info on Gauge Histograms. + */ + public HistogramSnapshot( + boolean isGaugeHistogram, + MetricMetadata metadata, + Collection data) { + this(isGaugeHistogram, metadata, data, false); + } + + private HistogramSnapshot( + boolean isGaugeHistogram, + MetricMetadata metadata, + Collection data, + boolean internal) { + super(metadata, data, internal); + this.gaugeHistogram = isGaugeHistogram; + } + + public boolean isGaugeHistogram() { + return gaugeHistogram; + } + + @SuppressWarnings("unchecked") + @Override + public List getDataPoints() { + return (List) dataPoints; + } + + @SuppressWarnings("unchecked") + @Override + MetricSnapshot escape( + EscapingScheme escapingScheme, List dataPointSnapshots) { + return new HistogramSnapshot( + gaugeHistogram, + getMetadata().escape(escapingScheme), + (List) dataPointSnapshots, + true); + } + + public static final class HistogramDataPointSnapshot extends DistributionDataPointSnapshot { + + // There are two types of histograms: Classic histograms and native histograms. + // Classic histograms have a fixed set of buckets. + // Native histograms have "infinitely many" buckets with exponentially growing boundaries. + // The OpenTelemetry terminology for native histogram is "exponential histogram". + // --- + // A histogram can be a classic histogram (indicated by nativeSchema == CLASSIC_HISTOGRAM), + // or a native histogram (indicated by classicBuckets == ClassicHistogramBuckets.EMPTY), + // or both. + // --- + // A histogram that is both classic and native is great for migrating from classic histograms + // to native histograms: Old Prometheus servers can still scrape the classic histogram, while + // new Prometheus servers can scrape the native histogram. + + private final ClassicHistogramBuckets + classicBuckets; // May be ClassicHistogramBuckets.EMPTY for native histograms. + private final int + nativeSchema; // Number in [-4, 8]. May be CLASSIC_HISTOGRAM for classic histograms. + private final long nativeZeroCount; // only used if nativeSchema != CLASSIC_HISTOGRAM + private final double nativeZeroThreshold; // only used if nativeSchema != CLASSIC_HISTOGRAM + private final NativeHistogramBuckets + nativeBucketsForPositiveValues; // only used if nativeSchema != CLASSIC_HISTOGRAM + private final NativeHistogramBuckets + nativeBucketsForNegativeValues; // only used if nativeSchema != CLASSIC_HISTOGRAM + + /** + * Constructor for classic histograms (as opposed to native histograms). + * + *

    To create a new {@link HistogramDataPointSnapshot}, you can either call the constructor + * directly or use the Builder with {@link HistogramSnapshot#builder()}. + * + * @param classicBuckets required. Must not be empty. Must at least contain the +Inf bucket. + * @param sum sum of all observed values. Optional, pass {@link Double#NaN} if not available. + * @param labels must not be null. Use {@link Labels#EMPTY} if there are no labels. + * @param exemplars must not be null. Use {@link Exemplars#EMPTY} if there are no Exemplars. + * @param createdTimestampMillis timestamp (as in {@link System#currentTimeMillis()}) when the + * time series (this specific set of labels) was created (or reset to zero). It's optional. + * Use {@code 0L} if there is no created timestamp. + */ + public HistogramDataPointSnapshot( + ClassicHistogramBuckets classicBuckets, + double sum, + Labels labels, + Exemplars exemplars, + long createdTimestampMillis) { + this( + classicBuckets, + CLASSIC_HISTOGRAM, + 0, + 0, + NativeHistogramBuckets.EMPTY, + NativeHistogramBuckets.EMPTY, + sum, + labels, + exemplars, + createdTimestampMillis, + 0L); + } + + /** + * Constructor for native histograms (as opposed to classic histograms). + * + *

    To create a new {@link HistogramDataPointSnapshot}, you can either call the constructor + * directly or use the Builder with {@link HistogramSnapshot#builder()}. + * + * @param nativeSchema number in [-4, 8]. See Prometheus + * client_model metrics.proto. + * @param nativeZeroCount number of observed zero values (zero is special because there is no + * histogram bucket for zero values). + * @param nativeZeroThreshold observations in [-zeroThreshold, +zeroThreshold] are treated as + * zero. This is to avoid creating a large number of buckets if observations fluctuate + * around zero. + * @param nativeBucketsForPositiveValues must not be {@code null}. Use {@link + * NativeHistogramBuckets#EMPTY} if empty. + * @param nativeBucketsForNegativeValues must not be {@code null}. Use {@link + * NativeHistogramBuckets#EMPTY} if empty. + * @param sum sum of all observed values. Optional, use {@link Double#NaN} if not available. + * @param labels must not be null. Use {@link Labels#EMPTY} if there are no labels. + * @param exemplars must not be null. Use {@link Exemplars#EMPTY} if there are no Exemplars. + * @param createdTimestampMillis timestamp (as in {@link System#currentTimeMillis()}) when the + * time series (this specific set of labels) was created (or reset to zero). It's optional. + * Use {@code 0L} if there is no created timestamp. + */ + public HistogramDataPointSnapshot( + int nativeSchema, + long nativeZeroCount, + double nativeZeroThreshold, + NativeHistogramBuckets nativeBucketsForPositiveValues, + NativeHistogramBuckets nativeBucketsForNegativeValues, + double sum, + Labels labels, + Exemplars exemplars, + long createdTimestampMillis) { + this( + ClassicHistogramBuckets.EMPTY, + nativeSchema, + nativeZeroCount, + nativeZeroThreshold, + nativeBucketsForPositiveValues, + nativeBucketsForNegativeValues, + sum, + labels, + exemplars, + createdTimestampMillis, + 0L); + } + + /** + * Constructor for a histogram with both, classic and native data. + * + *

    To create a new {@link HistogramDataPointSnapshot}, you can either call the constructor + * directly or use the Builder with {@link HistogramSnapshot#builder()}. + * + * @param classicBuckets required. Must not be empty. Must at least contain the +Inf bucket. + * @param nativeSchema number in [-4, 8]. See Prometheus + * client_model metrics.proto. + * @param nativeZeroCount number of observed zero values (zero is special because there is no + * histogram bucket for zero values). + * @param nativeZeroThreshold observations in [-zeroThreshold, +zeroThreshold] are treated as + * zero. This is to avoid creating a large number of buckets if observations fluctuate + * around zero. + * @param nativeBucketsForPositiveValues must not be {@code null}. Use {@link + * NativeHistogramBuckets#EMPTY} if empty. + * @param nativeBucketsForNegativeValues must not be {@code null}. Use {@link + * NativeHistogramBuckets#EMPTY} if empty. + * @param sum sum of all observed values. Optional, use {@link Double#NaN} if not available. + * @param labels must not be null. Use {@link Labels#EMPTY} if there are no labels. + * @param exemplars must not be null. Use {@link Exemplars#EMPTY} if there are no Exemplars. + * @param createdTimestampMillis timestamp (as in {@link System#currentTimeMillis()}) when the + * time series (this specific set of labels) was created (or reset to zero). It's optional. + * Use {@code 0L} if there is no created timestamp. + */ + public HistogramDataPointSnapshot( + ClassicHistogramBuckets classicBuckets, + int nativeSchema, + long nativeZeroCount, + double nativeZeroThreshold, + NativeHistogramBuckets nativeBucketsForPositiveValues, + NativeHistogramBuckets nativeBucketsForNegativeValues, + double sum, + Labels labels, + Exemplars exemplars, + long createdTimestampMillis) { + this( + classicBuckets, + nativeSchema, + nativeZeroCount, + nativeZeroThreshold, + nativeBucketsForPositiveValues, + nativeBucketsForNegativeValues, + sum, + labels, + exemplars, + createdTimestampMillis, + 0L); + } + + /** + * Constructor with an additional scrape timestamp. This is only useful in rare cases as the + * scrape timestamp is usually set by the Prometheus server during scraping. Exceptions include + * mirroring metrics with given timestamps from other metric sources. + */ + public HistogramDataPointSnapshot( + ClassicHistogramBuckets classicBuckets, + int nativeSchema, + long nativeZeroCount, + double nativeZeroThreshold, + NativeHistogramBuckets nativeBucketsForPositiveValues, + NativeHistogramBuckets nativeBucketsForNegativeValues, + double sum, + Labels labels, + Exemplars exemplars, + long createdTimestampMillis, + long scrapeTimestampMillis) { + this( + classicBuckets, + nativeSchema, + sum, + labels, + exemplars, + createdTimestampMillis, + scrapeTimestampMillis, + calculateCount( + classicBuckets, + nativeSchema, + nativeZeroCount, + nativeBucketsForPositiveValues, + nativeBucketsForNegativeValues), + nativeSchema == CLASSIC_HISTOGRAM + ? NativeHistogramBuckets.EMPTY + : nativeBucketsForPositiveValues, + nativeSchema == CLASSIC_HISTOGRAM + ? NativeHistogramBuckets.EMPTY + : nativeBucketsForNegativeValues, + nativeSchema == CLASSIC_HISTOGRAM ? 0 : nativeZeroCount, + nativeSchema == CLASSIC_HISTOGRAM ? 0 : nativeZeroThreshold, + false); + validate(); + } + + private HistogramDataPointSnapshot( + ClassicHistogramBuckets classicBuckets, + int nativeSchema, + double sum, + Labels labels, + Exemplars exemplars, + long createdTimestampMillis, + long scrapeTimestampMillis, + long count, + NativeHistogramBuckets nativeBucketsForPositiveValues, + NativeHistogramBuckets nativeBucketsForNegativeValues, + long nativeZeroCount, + double nativeZeroThreshold, + boolean internal) { + super(count, sum, exemplars, labels, createdTimestampMillis, scrapeTimestampMillis, internal); + this.classicBuckets = classicBuckets; + this.nativeSchema = nativeSchema; + this.nativeZeroCount = nativeZeroCount; + this.nativeZeroThreshold = nativeZeroThreshold; + this.nativeBucketsForPositiveValues = nativeBucketsForPositiveValues; + this.nativeBucketsForNegativeValues = nativeBucketsForNegativeValues; + } + + private static long calculateCount( + ClassicHistogramBuckets classicBuckets, + int nativeSchema, + long nativeZeroCount, + NativeHistogramBuckets nativeBucketsForPositiveValues, + NativeHistogramBuckets nativeBucketsForNegativeValues) { + if (classicBuckets.isEmpty()) { + // This is a native histogram + return calculateNativeCount( + nativeZeroCount, nativeBucketsForPositiveValues, nativeBucketsForNegativeValues); + } else if (nativeSchema == CLASSIC_HISTOGRAM) { + // This is a classic histogram + return calculateClassicCount(classicBuckets); + } else { + // This is both, a native and a classic histogram. Count should be the same for both. + long classicCount = calculateClassicCount(classicBuckets); + long nativeCount = + calculateNativeCount( + nativeZeroCount, nativeBucketsForPositiveValues, nativeBucketsForNegativeValues); + if (classicCount != nativeCount) { + throw new IllegalArgumentException( + "Inconsistent observation count: If a histogram has both classic and native " + + "data the observation count must be the same. Classic count is " + + classicCount + + " but native count is " + + nativeCount + + "."); + } + return classicCount; + } + } + + private static long calculateClassicCount(ClassicHistogramBuckets classicBuckets) { + long count = 0; + for (int i = 0; i < classicBuckets.size(); i++) { + count += classicBuckets.getCount(i); + } + return count; + } + + private static long calculateNativeCount( + long nativeZeroCount, + NativeHistogramBuckets nativeBucketsForPositiveValues, + NativeHistogramBuckets nativeBucketsForNegativeValues) { + long count = nativeZeroCount; + for (int i = 0; i < nativeBucketsForNegativeValues.size(); i++) { + count += nativeBucketsForNegativeValues.getCount(i); + } + for (int i = 0; i < nativeBucketsForPositiveValues.size(); i++) { + count += nativeBucketsForPositiveValues.getCount(i); + } + return count; + } + + public boolean hasClassicHistogramData() { + return !classicBuckets.isEmpty(); + } + + public boolean hasNativeHistogramData() { + return nativeSchema != CLASSIC_HISTOGRAM; + } + + /** Will return garbage if {@link #hasClassicHistogramData()} is {@code false}. */ + public ClassicHistogramBuckets getClassicBuckets() { + return classicBuckets; + } + + /** + * The schema defines the scale of the native histogram, i.g. the granularity of the buckets. + * Current supported values are -4 <= schema <= 8. See {@link NativeHistogramBuckets} for + * more info. This will return garbage if {@link #hasNativeHistogramData()} is {@code false}. + */ + public int getNativeSchema() { + return nativeSchema; + } + + /** + * Number of observed zero values. Will return garbage if {@link #hasNativeHistogramData()} is + * {@code false}. + */ + public long getNativeZeroCount() { + return nativeZeroCount; + } + + /** + * All observations in [-nativeZeroThreshold; +nativeZeroThreshold] are treated as zero. This is + * useful to avoid creation of a large number of buckets if observations fluctuate around zero. + * Will return garbage if {@link #hasNativeHistogramData()} is {@code false}. + */ + public double getNativeZeroThreshold() { + return nativeZeroThreshold; + } + + /** Will return garbage if {@link #hasNativeHistogramData()} is {@code false}. */ + public NativeHistogramBuckets getNativeBucketsForPositiveValues() { + return nativeBucketsForPositiveValues; + } + + /** Will return garbage if {@link #hasNativeHistogramData()} is {@code false}. */ + public NativeHistogramBuckets getNativeBucketsForNegativeValues() { + return nativeBucketsForNegativeValues; + } + + private void validate() { + for (Label label : getLabels()) { + if (label.getName().equals("le")) { + throw new IllegalArgumentException("le is a reserved label name for histograms"); + } + } + if (nativeSchema == CLASSIC_HISTOGRAM && classicBuckets.isEmpty()) { + throw new IllegalArgumentException( + "Histogram buckets cannot be empty, must at least have the +Inf bucket."); + } + if (nativeSchema != CLASSIC_HISTOGRAM) { + if (nativeSchema < -4 || nativeSchema > 8) { + throw new IllegalArgumentException( + nativeSchema + ": illegal schema. Expecting number in [-4, 8]."); + } + if (nativeZeroCount < 0) { + throw new IllegalArgumentException( + nativeZeroCount + ": nativeZeroCount cannot be negative"); + } + if (Double.isNaN(nativeZeroThreshold) || nativeZeroThreshold < 0) { + throw new IllegalArgumentException( + nativeZeroThreshold + ": illegal nativeZeroThreshold. Must be >= 0."); + } + } + } + + @Override + DataPointSnapshot escape(EscapingScheme escapingScheme) { + return new HistogramSnapshot.HistogramDataPointSnapshot( + classicBuckets, + nativeSchema, + getSum(), + SnapshotEscaper.escapeLabels(getLabels(), escapingScheme), + SnapshotEscaper.escapeExemplars(getExemplars(), escapingScheme), + getCreatedTimestampMillis(), + getScrapeTimestampMillis(), + getCount(), + nativeBucketsForPositiveValues, + nativeBucketsForNegativeValues, + nativeZeroCount, + nativeZeroThreshold, + true); + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder extends DistributionDataPointSnapshot.Builder { + + private ClassicHistogramBuckets classicHistogramBuckets = ClassicHistogramBuckets.EMPTY; + private int nativeSchema = CLASSIC_HISTOGRAM; + private long nativeZeroCount = 0; + private double nativeZeroThreshold = 0; + private NativeHistogramBuckets nativeBucketsForPositiveValues = NativeHistogramBuckets.EMPTY; + private NativeHistogramBuckets nativeBucketsForNegativeValues = NativeHistogramBuckets.EMPTY; + + private Builder() {} + + @Override + protected Builder self() { + return this; + } + + public Builder classicHistogramBuckets(ClassicHistogramBuckets classicBuckets) { + this.classicHistogramBuckets = classicBuckets; + return this; + } + + public Builder nativeSchema(int nativeSchema) { + this.nativeSchema = nativeSchema; + return this; + } + + public Builder nativeZeroCount(long zeroCount) { + this.nativeZeroCount = zeroCount; + return this; + } + + public Builder nativeZeroThreshold(double zeroThreshold) { + this.nativeZeroThreshold = zeroThreshold; + return this; + } + + public Builder nativeBucketsForPositiveValues( + NativeHistogramBuckets bucketsForPositiveValues) { + this.nativeBucketsForPositiveValues = bucketsForPositiveValues; + return this; + } + + public Builder nativeBucketsForNegativeValues( + NativeHistogramBuckets bucketsForNegativeValues) { + this.nativeBucketsForNegativeValues = bucketsForNegativeValues; + return this; + } + + public HistogramDataPointSnapshot build() { + if (nativeSchema == CLASSIC_HISTOGRAM && classicHistogramBuckets.isEmpty()) { + throw new IllegalArgumentException( + "One of nativeSchema and classicHistogramBuckets is required."); + } + return new HistogramDataPointSnapshot( + classicHistogramBuckets, + nativeSchema, + nativeZeroCount, + nativeZeroThreshold, + nativeBucketsForPositiveValues, + nativeBucketsForNegativeValues, + sum, + labels, + exemplars, + createdTimestampMillis, + scrapeTimestampMillis); + } + } + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder extends MetricSnapshot.Builder { + + private final List dataPoints = new ArrayList<>(); + private boolean isGaugeHistogram = false; + + private Builder() {} + + /** Add a data point. Call multiple times to add multiple data points. */ + public Builder dataPoint(HistogramDataPointSnapshot dataPoint) { + dataPoints.add(dataPoint); + return this; + } + + /** + * {@code true} indicates that this histogram is a gauge histogram. The data model for gauge + * histograms is the same as for regular histograms, except that bucket values are semantically + * gauges and not counters. See openmetrics.io for more + * info on gauge histograms. + */ + public Builder gaugeHistogram(boolean isGaugeHistogram) { + this.isGaugeHistogram = isGaugeHistogram; + return this; + } + + @Override + public HistogramSnapshot build() { + return new HistogramSnapshot(isGaugeHistogram, buildMetadata(), dataPoints); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/InfoSnapshot.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/InfoSnapshot.java new file mode 100644 index 000000000..ca6cf70a0 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/InfoSnapshot.java @@ -0,0 +1,131 @@ +package io.prometheus.metrics.model.snapshots; + +import io.prometheus.metrics.config.EscapingScheme; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import javax.annotation.Nullable; + +/** Immutable snapshot of an Info metric. */ +public final class InfoSnapshot extends MetricSnapshot { + + /** + * To create a new {@link InfoSnapshot}, you can either call the constructor directly or use the + * builder with {@link InfoSnapshot#builder()}. + * + * @param metadata the metric name in metadata must not include the {@code _info} suffix. See + * {@link MetricMetadata} for more naming conventions. The metadata must not have a unit. + * @param data the constructor will create a sorted copy of the collection. + */ + public InfoSnapshot(MetricMetadata metadata, Collection data) { + this(metadata, data, false); + if (metadata.hasUnit()) { + throw new IllegalArgumentException("An Info metric cannot have a unit."); + } + } + + private InfoSnapshot( + MetricMetadata metadata, Collection data, boolean internal) { + super(metadata, data, internal); + } + + @SuppressWarnings("unchecked") + @Override + public List getDataPoints() { + return (List) dataPoints; + } + + @SuppressWarnings("unchecked") + @Override + MetricSnapshot escape( + EscapingScheme escapingScheme, List dataPointSnapshots) { + return new InfoSnapshot( + getMetadata().escape(escapingScheme), + (List) dataPointSnapshots, + true); + } + + public static class InfoDataPointSnapshot extends DataPointSnapshot { + + /** + * To create a new {@link InfoDataPointSnapshot}, you can either call the constructor directly + * or use the Builder with {@link InfoDataPointSnapshot#builder()}. + * + * @param labels must not be null. Use {@link Labels#EMPTY} if there are no labels. + */ + public InfoDataPointSnapshot(Labels labels) { + this(labels, 0L); + } + + /** + * Constructor with an additional scrape timestamp. This is only useful in rare cases as the + * scrape timestamp is usually set by the Prometheus server during scraping. Exceptions include + * mirroring metrics with given timestamps from other metric sources. + */ + public InfoDataPointSnapshot(Labels labels, long scrapeTimestampMillis) { + this(labels, scrapeTimestampMillis, false); + } + + private InfoDataPointSnapshot(Labels labels, long scrapeTimestampMillis, boolean internal) { + super(labels, 0L, scrapeTimestampMillis, internal); + } + + public static Builder builder() { + return new Builder(); + } + + @Override + DataPointSnapshot escape(EscapingScheme escapingScheme) { + return new InfoSnapshot.InfoDataPointSnapshot( + SnapshotEscaper.escapeLabels(getLabels(), escapingScheme), + getScrapeTimestampMillis(), + true); + } + + public static class Builder extends DataPointSnapshot.Builder { + + private Builder() {} + + public InfoDataPointSnapshot build() { + return new InfoDataPointSnapshot(labels, scrapeTimestampMillis, true); + } + + @Override + protected Builder self() { + return this; + } + } + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder extends MetricSnapshot.Builder { + + private final List dataPoints = new ArrayList<>(); + + private Builder() {} + + /** Add a data point. Call multiple times for adding multiple data points. */ + public Builder dataPoint(InfoDataPointSnapshot dataPoint) { + dataPoints.add(dataPoint); + return this; + } + + @Override + public Builder unit(@Nullable Unit unit) { + throw new IllegalArgumentException("Info metric cannot have a unit."); + } + + @Override + public InfoSnapshot build() { + return new InfoSnapshot(buildMetadata(), dataPoints); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Label.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Label.java new file mode 100644 index 000000000..45acd56ee --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Label.java @@ -0,0 +1,51 @@ +package io.prometheus.metrics.model.snapshots; + +import java.util.Objects; + +/** Utility for iterating over {@link Labels}. */ +public final class Label implements Comparable

    Dots are treated as underscores, so {@code contains("my.label")} and {@code + * contains("my_label")} are the same. + */ + public boolean contains(String labelName) { + return get(labelName) != null; + } + + /** + * Get the label value for a given label name. + * + *

    Returns {@code null} if the {@code labelName} is not found. + * + *

    Dots are treated as underscores, so {@code get("my.label")} and {@code get("my_label")} are + * the same. + */ + @Nullable + public String get(String labelName) { + labelName = prometheusName(labelName); + for (int i = 0; i < prometheusNames.length; i++) { + if (prometheusNames[i].equals(labelName)) { + return values[i]; + } + } + return null; + } + + private static void sortAndValidate(String[] names, String[] prometheusNames, String[] values) { + sort(names, prometheusNames, values); + validateNames(names, prometheusNames); + } + + private static void validateNames(String[] names, String[] prometheusNames) { + for (int i = 0; i < names.length; i++) { + if (!isValidLabelName(names[i])) { + throw new IllegalArgumentException("'" + names[i] + "' is an illegal label name"); + } + // The arrays are sorted, so duplicates are next to each other + if (i > 0 && prometheusNames[i - 1].equals(prometheusNames[i])) { + throw new IllegalArgumentException(names[i] + ": duplicate label name"); + } + } + } + + private static void sort(String[] names, String[] prometheusNames, String[] values) { + // bubblesort + int n = prometheusNames.length; + for (int i = 0; i < n - 1; i++) { + for (int j = 0; j < n - i - 1; j++) { + if (prometheusNames[j].compareTo(prometheusNames[j + 1]) > 0) { + swap(j, j + 1, names, prometheusNames, values); + } + } + } + } + + private static void swap( + int i, int j, String[] names, String[] prometheusNames, String[] values) { + String tmp = names[j]; + names[j] = names[i]; + names[i] = tmp; + tmp = values[j]; + values[j] = values[i]; + values[i] = tmp; + if (prometheusNames != names) { + tmp = prometheusNames[j]; + prometheusNames[j] = prometheusNames[i]; + prometheusNames[i] = tmp; + } + } + + @Override + public Iterator

    This is used by Prometheus exposition formats. + */ + public String getPrometheusName(int i) { + return prometheusNames[i]; + } + + public String getValue(int i) { + return values[i]; + } + + /** + * Create a new Labels instance containing the labels of this and the labels of other. This and + * other must not contain the same label name. + */ + public Labels merge(Labels other) { + if (this.isEmpty()) { + return other; + } + if (other.isEmpty()) { + return this; + } + String[] names = new String[this.names.length + other.names.length]; + String[] prometheusNames = names; + if (this.names != this.prometheusNames || other.names != other.prometheusNames) { + prometheusNames = new String[names.length]; + } + String[] values = new String[names.length]; + int thisPos = 0; + int otherPos = 0; + while (thisPos + otherPos < names.length) { + if (thisPos >= this.names.length) { + names[thisPos + otherPos] = other.names[otherPos]; + values[thisPos + otherPos] = other.values[otherPos]; + if (prometheusNames != names) { + prometheusNames[thisPos + otherPos] = other.prometheusNames[otherPos]; + } + otherPos++; + } else if (otherPos >= other.names.length) { + names[thisPos + otherPos] = this.names[thisPos]; + values[thisPos + otherPos] = this.values[thisPos]; + if (prometheusNames != names) { + prometheusNames[thisPos + otherPos] = this.prometheusNames[thisPos]; + } + thisPos++; + } else if (this.prometheusNames[thisPos].compareTo(other.prometheusNames[otherPos]) < 0) { + names[thisPos + otherPos] = this.names[thisPos]; + values[thisPos + otherPos] = this.values[thisPos]; + if (prometheusNames != names) { + prometheusNames[thisPos + otherPos] = this.prometheusNames[thisPos]; + } + thisPos++; + } else if (this.prometheusNames[thisPos].compareTo(other.prometheusNames[otherPos]) > 0) { + names[thisPos + otherPos] = other.names[otherPos]; + values[thisPos + otherPos] = other.values[otherPos]; + if (prometheusNames != names) { + prometheusNames[thisPos + otherPos] = other.prometheusNames[otherPos]; + } + otherPos++; + } else { + throw new IllegalArgumentException("Duplicate label name: '" + this.names[thisPos] + "'."); + } + } + return new Labels(names, prometheusNames, values); + } + + /** + * Create a new Labels instance containing the labels of this and the labels passed as names and + * values. The new label names must not already be contained in this Labels instance. + */ + public Labels merge(String[] names, String[] values) { + if (this.equals(EMPTY)) { + return Labels.of(names, values); + } + String[] mergedNames = new String[this.names.length + names.length]; + String[] mergedValues = new String[this.values.length + values.length]; + System.arraycopy(this.names, 0, mergedNames, 0, this.names.length); + System.arraycopy(this.values, 0, mergedValues, 0, this.values.length); + System.arraycopy(names, 0, mergedNames, this.names.length, names.length); + System.arraycopy(values, 0, mergedValues, this.values.length, values.length); + String[] prometheusNames = makePrometheusNames(mergedNames); + sortAndValidate(mergedNames, prometheusNames, mergedValues); + return new Labels(mergedNames, prometheusNames, mergedValues); + } + + /** + * Create a new Labels instance containing the labels of this and the label passed as name and + * value. The label name must not already be contained in this Labels instance. + */ + public Labels add(String name, String value) { + return merge(Labels.of(name, value)); + } + + public boolean hasSameNames(Labels other) { + return Arrays.equals(prometheusNames, other.prometheusNames); + } + + public boolean hasSameValues(Labels other) { + return Arrays.equals(values, other.values); + } + + @Override + public int compareTo(Labels other) { + int result = compare(prometheusNames, other.prometheusNames); + if (result != 0) { + return result; + } + return compare(values, other.values); + } + + // Looks like Java doesn't have a compareTo() method for arrays. + private int compare(String[] array1, String[] array2) { + int result; + for (int i = 0; i < array1.length; i++) { + if (array2.length <= i) { + return 1; + } + result = array1[i].compareTo(array2[i]); + if (result != 0) { + return result; + } + } + if (array2.length > array1.length) { + return -1; + } + return 0; + } + + private List

    However, for debugging it's better to show the original names rather than the Prometheus + * names. + */ + @Override + public String toString() { + StringBuilder b = new StringBuilder(); + b.append("{"); + for (int i = 0; i < names.length; i++) { + if (i > 0) { + b.append(","); + } + b.append(names[i]); + b.append("=\""); + appendEscapedLabelValue(b, values[i]); + b.append("\""); + } + b.append("}"); + return b.toString(); + } + + private void appendEscapedLabelValue(StringBuilder b, String value) { + for (int i = 0; i < value.length(); i++) { + char c = value.charAt(i); + switch (c) { + case '\\': + b.append("\\\\"); + break; + case '\"': + b.append("\\\""); + break; + case '\n': + b.append("\\n"); + break; + default: + b.append(c); + } + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Labels labels = (Labels) o; + return labels.hasSameNames(this) && labels.hasSameValues(this); + } + + @Override + public int hashCode() { + int result = Arrays.hashCode(prometheusNames); + result = 31 * result + Arrays.hashCode(values); + return result; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private final List names = new ArrayList<>(); + private final List values = new ArrayList<>(); + + private Builder() {} + + /** Add a label. Call multiple times to add multiple labels. */ + public Builder label(String name, String value) { + names.add(name); + values.add(value); + return this; + } + + public Labels build() { + return Labels.of(names, values); + } + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/MetricMetadata.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/MetricMetadata.java new file mode 100644 index 000000000..9c54f96d5 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/MetricMetadata.java @@ -0,0 +1,130 @@ +package io.prometheus.metrics.model.snapshots; + +import io.prometheus.metrics.config.EscapingScheme; +import javax.annotation.Nullable; + +/** Immutable container for metric metadata: name, help, unit. */ +public final class MetricMetadata { + + /** + * Name without suffix. + * + *

    For example, the name for a counter "http_requests_total" is "http_requests". The name of an + * info called "jvm_info" is "jvm". + * + *

    We allow dots in label names. Dots are automatically replaced with underscores in Prometheus + * exposition formats. However, if metrics from this library are exposed in OpenTelemetry format + * dots are retained. + * + *

    See {@link #MetricMetadata(String, String, Unit)} for more info on naming conventions. + */ + private final String name; + + /** + * Same as name that all invalid char (without Unicode support) are replaced by _ + * + *

    Multiple metrics with the same prometheusName are not allowed, because they would end up in + * the same time series in Prometheus if {@link EscapingScheme#UNDERSCORE_ESCAPING} or {@link + * EscapingScheme#DOTS_ESCAPING} is used. + */ + private final String prometheusName; + + @Nullable private final String help; + @Nullable private final Unit unit; + + /** See {@link #MetricMetadata(String, String, Unit)} */ + public MetricMetadata(String name) { + this(name, null, null); + } + + /** See {@link #MetricMetadata(String, String, Unit)} */ + public MetricMetadata(String name, String help) { + this(name, help, null); + } + + /** + * Constructor. + * + * @param name must not be {@code null}. {@link PrometheusNaming#isValidMetricName(String) + * isValidMetricName(name)} must be {@code true}. Use {@link + * PrometheusNaming#sanitizeMetricName(String)} to convert arbitrary strings into valid names. + * @param help optional. May be {@code null}. + * @param unit optional. May be {@code null}. + */ + public MetricMetadata(String name, @Nullable String help, @Nullable Unit unit) { + this.name = name; + this.help = help; + this.unit = unit; + validate(); + this.prometheusName = PrometheusNaming.prometheusName(name); + } + + /** + * The name does not include the {@code _total} suffix for counter metrics or the {@code _info} + * suffix for Info metrics. + * + *

    The name may contain any Unicode chars. Use {@link #getPrometheusName()} to get the name in + * legacy Prometheus format, i.e. with all dots and all invalid chars replaced by underscores. + */ + public String getName() { + return name; + } + + /** + * Same as {@link #getName()} but with all invalid characters and dots replaced by underscores. + * + *

    This is used by Prometheus exposition formats. + */ + public String getPrometheusName() { + return prometheusName; + } + + @Nullable + public String getHelp() { + return help; + } + + public boolean hasUnit() { + return unit != null; + } + + @Nullable + public Unit getUnit() { + return unit; + } + + private void validate() { + if (name == null) { + throw new IllegalArgumentException("Missing required field: name is null"); + } + String error = PrometheusNaming.validateMetricName(name); + if (error != null) { + throw new IllegalArgumentException( + "'" + + name + + "': Illegal metric name. " + + error + + " Call " + + PrometheusNaming.class.getSimpleName() + + ".sanitizeMetricName(name) to avoid this error."); + } + if (hasUnit()) { + if (!name.endsWith("_" + unit) && !name.endsWith("." + unit)) { + throw new IllegalArgumentException( + "'" + + name + + "': Illegal metric name. If the unit is non-null, " + + "the name must end with the unit: _" + + unit + + "." + + " Call " + + PrometheusNaming.class.getSimpleName() + + ".sanitizeMetricName(name, unit) to avoid this error."); + } + } + } + + MetricMetadata escape(EscapingScheme escapingScheme) { + return new MetricMetadata(PrometheusNaming.escapeName(name, escapingScheme), help, unit); + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/MetricSnapshot.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/MetricSnapshot.java new file mode 100644 index 000000000..4dac2e30e --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/MetricSnapshot.java @@ -0,0 +1,96 @@ +package io.prometheus.metrics.model.snapshots; + +import io.prometheus.metrics.config.EscapingScheme; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import javax.annotation.Nullable; + +/** Base class for metric snapshots. */ +public abstract class MetricSnapshot { + private final MetricMetadata metadata; + protected final List dataPoints; + + protected MetricSnapshot( + MetricMetadata metadata, + Collection dataPoints, + boolean internal) { + this.metadata = metadata; + if (internal) { + this.dataPoints = (List) dataPoints; + } else { + if (metadata == null) { + throw new NullPointerException("metadata"); + } + if (dataPoints == null) { + throw new NullPointerException("dataPoints"); + } + List dataCopy = new ArrayList<>(dataPoints); + dataCopy.sort(Comparator.comparing(DataPointSnapshot::getLabels)); + this.dataPoints = Collections.unmodifiableList(dataCopy); + validateLabels(this.dataPoints, metadata); + } + } + + public MetricMetadata getMetadata() { + return metadata; + } + + public abstract List getDataPoints(); + + private static void validateLabels( + List dataPoints, MetricMetadata metadata) { + // Verify that labels are unique (the same set of names/values must not be used multiple times + // for the same metric). + for (int i = 0; i < dataPoints.size() - 1; i++) { + if (dataPoints.get(i).getLabels().equals(dataPoints.get(i + 1).getLabels())) { + throw new DuplicateLabelsException(metadata, dataPoints.get(i).getLabels()); + } + } + // Should we verify that all entries in data have the same label names? + // No. They should have the same label names, but according to OpenMetrics this is not a MUST. + } + + public abstract static class Builder> { + + @Nullable private String name; + @Nullable private String help; + @Nullable private Unit unit; + + /** + * The name is required. If the name is missing or invalid, {@code build()} will throw an {@link + * IllegalArgumentException}. See {@link PrometheusNaming#isValidMetricName(String)} for info on + * valid metric names. + */ + public T name(String name) { + this.name = name; + return self(); + } + + public T help(@Nullable String help) { + this.help = help; + return self(); + } + + public T unit(@Nullable Unit unit) { + this.unit = unit; + return self(); + } + + public abstract MetricSnapshot build(); + + protected MetricMetadata buildMetadata() { + if (name == null) { + throw new IllegalArgumentException("Missing required field: name is null"); + } + return new MetricMetadata(name, help, unit); + } + + protected abstract T self(); + } + + abstract MetricSnapshot escape( + EscapingScheme escapingScheme, List dataPointSnapshots); +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/MetricSnapshots.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/MetricSnapshots.java new file mode 100644 index 000000000..ecee897e4 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/MetricSnapshots.java @@ -0,0 +1,102 @@ +package io.prometheus.metrics.model.snapshots; + +import static io.prometheus.metrics.model.snapshots.PrometheusNaming.prometheusName; +import static java.util.Collections.unmodifiableList; +import static java.util.Comparator.comparing; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.stream.Stream; + +/** Immutable list of metric snapshots. */ +public class MetricSnapshots implements Iterable { + + private final List snapshots; + + /** See {@link #MetricSnapshots(Collection)} */ + public MetricSnapshots(MetricSnapshot... snapshots) { + this(Arrays.asList(snapshots)); + } + + /** + * To create MetricSnapshots, you can either call the constructor directly or use {@link + * #builder()}. + * + * @param snapshots the constructor creates a sorted copy of snapshots. + * @throws IllegalArgumentException if snapshots contains duplicate metric names. To avoid + * duplicate metric names use {@link #builder()} and check {@link + * Builder#containsMetricName(String)} before calling {@link + * Builder#metricSnapshot(MetricSnapshot)}. + */ + public MetricSnapshots(Collection snapshots) { + List list = new ArrayList<>(snapshots); + list.sort(comparing(s -> s.getMetadata().getPrometheusName())); + for (int i = 0; i < snapshots.size() - 1; i++) { + if (list.get(i) + .getMetadata() + .getPrometheusName() + .equals(list.get(i + 1).getMetadata().getPrometheusName())) { + throw new IllegalArgumentException( + list.get(i).getMetadata().getPrometheusName() + ": duplicate metric name"); + } + } + this.snapshots = unmodifiableList(list); + } + + public static MetricSnapshots of(MetricSnapshot... snapshots) { + return new MetricSnapshots(snapshots); + } + + @Override + public Iterator iterator() { + return snapshots.iterator(); + } + + public int size() { + return snapshots.size(); + } + + public MetricSnapshot get(int i) { + return snapshots.get(i); + } + + public Stream stream() { + return snapshots.stream(); + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + private final List snapshots = new ArrayList<>(); + private final Set prometheusNames = new HashSet<>(); + + private Builder() {} + + public boolean containsMetricName(String name) { + if (name == null) { + return false; + } + String prometheusName = prometheusName(name); + return prometheusNames.contains(prometheusName); + } + + /** Add a metric snapshot. Call multiple times to add multiple metric snapshots. */ + public Builder metricSnapshot(MetricSnapshot snapshot) { + snapshots.add(snapshot); + prometheusNames.add(snapshot.getMetadata().getPrometheusName()); + return this; + } + + public MetricSnapshots build() { + return new MetricSnapshots(snapshots); + } + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/NativeHistogramBucket.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/NativeHistogramBucket.java new file mode 100644 index 000000000..9e58af18f --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/NativeHistogramBucket.java @@ -0,0 +1,22 @@ +package io.prometheus.metrics.model.snapshots; + +/** For iterating over {@link NativeHistogramBuckets}. */ +public class NativeHistogramBucket { + + private final int bucketIndex; + private final long count; + + public NativeHistogramBucket(int bucketIndex, long count) { + this.bucketIndex = bucketIndex; + this.count = count; + } + + /** See {@link NativeHistogramBuckets} for info on native bucket indexes. */ + public int getBucketIndex() { + return bucketIndex; + } + + public long getCount() { + return count; + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/NativeHistogramBuckets.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/NativeHistogramBuckets.java new file mode 100644 index 000000000..3b1214364 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/NativeHistogramBuckets.java @@ -0,0 +1,169 @@ +package io.prometheus.metrics.model.snapshots; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.stream.Stream; + +/** + * Immutable representation of native histogram buckets. + * + *

    The bucket index defines the boundaries of the bucket, depending on the histogram's {@link + * HistogramSnapshot.HistogramDataPointSnapshot#getNativeSchema() schema}. + * + *

    + *     base = 2^(2^-schema)
    + *     lower bound = base^(index - 1)
    + *     upper bound = base^index
    + * 
    + */ +public class NativeHistogramBuckets implements Iterable { + + public static final NativeHistogramBuckets EMPTY = + new NativeHistogramBuckets(new int[] {}, new long[] {}); + private final int[] bucketIndexes; // sorted + private final long[] counts; + + private NativeHistogramBuckets(int[] bucketIndexes, long[] counts) { + this.bucketIndexes = bucketIndexes; + this.counts = counts; + } + + /** + * To create a new {@link NativeHistogramBuckets} instance, you can either use one of the static + * {@code of(...)} methods, or use {@link NativeHistogramBuckets#builder()}. + * + * @param bucketIndexes see class javadoc of {@link NativeHistogramBuckets}. May be empty. + * @param counts must have the same length as bucketIndexes + */ + public static NativeHistogramBuckets of(int[] bucketIndexes, long[] counts) { + int[] bucketIndexesCopy = Arrays.copyOf(bucketIndexes, bucketIndexes.length); + long[] countsCopy = Arrays.copyOf(counts, counts.length); + sortAndValidate(bucketIndexesCopy, countsCopy); + return new NativeHistogramBuckets(bucketIndexesCopy, countsCopy); + } + + /** + * To create a new {@link NativeHistogramBuckets} instance, you can either use one of the static + * {@code of(...)} methods, or use {@link NativeHistogramBuckets#builder()}. + * + * @param bucketIndexes see class javadoc of {@link NativeHistogramBuckets}. May be empty. + * @param counts must have the same size as bucketIndexes + */ + public static NativeHistogramBuckets of(List bucketIndexes, List counts) { + int[] bucketIndexesCopy = new int[bucketIndexes.size()]; + for (int i = 0; i < bucketIndexes.size(); i++) { + bucketIndexesCopy[i] = bucketIndexes.get(i); + } + long[] countsCopy = new long[counts.size()]; + for (int i = 0; i < counts.size(); i++) { + countsCopy[i] = counts.get(i); + } + sortAndValidate(bucketIndexesCopy, countsCopy); + return new NativeHistogramBuckets(bucketIndexesCopy, countsCopy); + } + + public int size() { + return bucketIndexes.length; + } + + private List asList() { + List result = new ArrayList<>(size()); + for (int i = 0; i < bucketIndexes.length; i++) { + result.add(new NativeHistogramBucket(bucketIndexes[i], counts[i])); + } + return Collections.unmodifiableList(result); + } + + @Override + public Iterator iterator() { + return asList().iterator(); + } + + public Stream stream() { + return asList().stream(); + } + + public int getBucketIndex(int i) { + return bucketIndexes[i]; + } + + public long getCount(int i) { + return counts[i]; + } + + private static void sortAndValidate(int[] bucketIndexes, long[] counts) { + if (bucketIndexes.length != counts.length) { + throw new IllegalArgumentException( + "bucketIndexes.length == " + + bucketIndexes.length + + " but counts.length == " + + counts.length + + ". Expected the same length."); + } + sort(bucketIndexes, counts); + validate(bucketIndexes, counts); + } + + private static void sort(int[] bucketIndexes, long[] counts) { + // Bubblesort. Should be efficient here as in most cases bucketIndexes is already sorted. + int n = bucketIndexes.length; + for (int i = 0; i < n - 1; i++) { + for (int j = 0; j < n - i - 1; j++) { + if (bucketIndexes[j] > bucketIndexes[j + 1]) { + swap(j, j + 1, bucketIndexes, counts); + } + } + } + } + + private static void swap(int i, int j, int[] bucketIndexes, long[] counts) { + int tmpInt = bucketIndexes[j]; + bucketIndexes[j] = bucketIndexes[i]; + bucketIndexes[i] = tmpInt; + long tmpLong = counts[j]; + counts[j] = counts[i]; + counts[i] = tmpLong; + } + + private static void validate(int[] bucketIndexes, long[] counts) { + // Preconditions: + // * bucketIndexes sorted + // * bucketIndexes and counts have the same length + for (int i = 0; i < bucketIndexes.length; i++) { + if (counts[i] < 0) { + throw new IllegalArgumentException("Bucket counts cannot be negative."); + } + if (i > 0) { + if (bucketIndexes[i - 1] == bucketIndexes[i]) { + throw new IllegalArgumentException("Duplicate bucket index " + bucketIndexes[i]); + } + } + } + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + private final List bucketIndexes = new ArrayList<>(); + private final List counts = new ArrayList<>(); + + private Builder() {} + + /** Add a native histogram bucket. Call multiple times to add multiple buckets. */ + public Builder bucket(int bucketIndex, long count) { + bucketIndexes.add(bucketIndex); + counts.add(count); + return this; + } + + public NativeHistogramBuckets build() { + return NativeHistogramBuckets.of(bucketIndexes, counts); + } + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/PrometheusNaming.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/PrometheusNaming.java new file mode 100644 index 000000000..71de5d0b4 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/PrometheusNaming.java @@ -0,0 +1,389 @@ +package io.prometheus.metrics.model.snapshots; + +import static java.lang.Character.MAX_CODE_POINT; +import static java.lang.Character.MAX_LOW_SURROGATE; +import static java.lang.Character.MIN_HIGH_SURROGATE; + +import io.prometheus.metrics.config.EscapingScheme; +import java.nio.charset.StandardCharsets; +import javax.annotation.Nullable; + +/** + * Utility for Prometheus Metric and Label naming. + * + *

    Note that this library allows dots in metric and label names. Dots will automatically be + * replaced with underscores in Prometheus exposition formats. However, if metrics are exposed in + * OpenTelemetry format the dots are retained. + */ +public class PrometheusNaming { + + /** + * According to OpenMetrics {@code _count} and {@code _sum} (and {@code _gcount}, {@code _gsum}) + * should also be reserved metric name suffixes. However, popular instrumentation libraries have + * Gauges with names ending in {@code _count}. Examples: + * + *

      + *
    • Micrometer: {@code jvm_buffer_count} + *
    • OpenTelemetry: {@code process_runtime_jvm_buffer_count} + *
    + * + * We do not treat {@code _count} and {@code _sum} as reserved suffixes here for compatibility + * with these libraries. However, there is a risk of name conflict if someone creates a gauge + * named {@code my_data_count} and a histogram or summary named {@code my_data}, because the + * histogram or summary will implicitly have a sample named {@code my_data_count}. + */ + private static final String[] RESERVED_METRIC_NAME_SUFFIXES = { + "_total", "_created", "_bucket", "_info", + ".total", ".created", ".bucket", ".info" + }; + + /** + * Test if a metric name is valid. Rules: + * + *
      + *
    • The name must match Metric + * names. + *
    • The name MUST NOT end with one of the {@link #RESERVED_METRIC_NAME_SUFFIXES}. + *
    + * + * If a metric has a {@link Unit}, the metric name SHOULD end with the unit as a suffix. Note that + * OpenMetrics requires metric names to have their unit as + * suffix, and we implement this in {@code prometheus-metrics-core}. However, {@code + * prometheus-metrics-model} does not enforce Unit suffixes. + * + *

    Example: If you create a Counter for a processing time with Unit {@link Unit#SECONDS + * SECONDS}, the name should be {@code processing_time_seconds}. When exposed in OpenMetrics Text + * format, this will be represented as two values: {@code processing_time_seconds_total} for the + * counter value, and the optional {@code processing_time_seconds_created} timestamp. + * + *

    Use {@link #sanitizeMetricName(String)} to convert arbitrary Strings to valid metric names. + */ + public static boolean isValidMetricName(String name) { + return validateMetricName(name) == null; + } + + /** + * Same as {@link #isValidMetricName(String)}, but produces an error message. + * + *

    The name is valid if the error message is {@code null}. + */ + @Nullable + public static String validateMetricName(String name) { + for (String reservedSuffix : RESERVED_METRIC_NAME_SUFFIXES) { + if (name.endsWith(reservedSuffix)) { + return "The metric name must not include the '" + reservedSuffix + "' suffix."; + } + } + if (isValidUtf8(name)) { + return null; + } + return "The metric name contains unsupported characters"; + } + + public static boolean isValidLegacyMetricName(String name) { + if (name.isEmpty()) { + return false; + } + // First character must be [a-zA-Z_:] + char first = name.charAt(0); + if (!((first >= 'a' && first <= 'z') + || (first >= 'A' && first <= 'Z') + || first == '_' + || first == ':')) { + return false; + } + // Remaining characters must be [a-zA-Z0-9_:] + for (int i = 1; i < name.length(); i++) { + char c = name.charAt(i); + if (!((c >= 'a' && c <= 'z') + || (c >= 'A' && c <= 'Z') + || (c >= '0' && c <= '9') + || c == '_' + || c == ':')) { + return false; + } + } + return true; + } + + public static boolean isValidLabelName(String name) { + return isValidUtf8(name) + && !(name.startsWith("__") + || name.startsWith("._") + || name.startsWith("..") + || name.startsWith("_.")); + } + + private static boolean isValidUtf8(String name) { + return !name.isEmpty() && StandardCharsets.UTF_8.newEncoder().canEncode(name); + } + + public static boolean isValidLegacyLabelName(String name) { + if (name.isEmpty()) { + return false; + } + // First character must be [a-zA-Z_] + char first = name.charAt(0); + if (!((first >= 'a' && first <= 'z') || (first >= 'A' && first <= 'Z') || first == '_')) { + return false; + } + // Remaining characters must be [a-zA-Z0-9_] + for (int i = 1; i < name.length(); i++) { + char c = name.charAt(i); + if (!((c >= 'a' && c <= 'z') + || (c >= 'A' && c <= 'Z') + || (c >= '0' && c <= '9') + || c == '_')) { + return false; + } + } + return true; + } + + /** + * Units may not have illegal characters, and they may not end with a reserved suffix like + * 'total'. + */ + public static boolean isValidUnitName(String name) { + return validateUnitName(name) == null; + } + + /** Same as {@link #isValidUnitName(String)} but returns an error message. */ + @Nullable + public static String validateUnitName(String name) { + if (name.isEmpty()) { + return "The unit name must not be empty."; + } + for (String reservedSuffix : RESERVED_METRIC_NAME_SUFFIXES) { + String suffixName = reservedSuffix.substring(1); + if (name.endsWith(suffixName)) { + return suffixName + " is a reserved suffix in Prometheus"; + } + } + // Check if all characters are [a-zA-Z0-9_.:]+ + for (int i = 0; i < name.length(); i++) { + char c = name.charAt(i); + if (!((c >= 'a' && c <= 'z') + || (c >= 'A' && c <= 'Z') + || (c >= '0' && c <= '9') + || c == '_' + || c == '.' + || c == ':')) { + return "The unit name contains unsupported characters"; + } + } + return null; + } + + /** + * Get the metric or label name that is used in Prometheus exposition format. + * + * @param name must be a valid metric or label name, i.e. {@link #isValidMetricName(String) + * isValidMetricName(name)} or {@link #isValidLabelName(String) isValidLabelName(name)} must + * be true. + * @return the name with dots replaced by underscores. + */ + public static String prometheusName(String name) { + return escapeName(name, EscapingScheme.UNDERSCORE_ESCAPING); + } + + /** + * Convert an arbitrary string to a name where {@link #isValidMetricName(String) + * isValidMetricName(name)} is true. + */ + public static String sanitizeMetricName(String metricName) { + if (metricName.isEmpty()) { + throw new IllegalArgumentException("Cannot convert an empty string to a valid metric name."); + } + String sanitizedName = metricName; + boolean modified = true; + while (modified) { + modified = false; + for (String reservedSuffix : RESERVED_METRIC_NAME_SUFFIXES) { + if (sanitizedName.equals(reservedSuffix)) { + // This is for the corner case when you call sanitizeMetricName("_total"). + // In that case the result will be "total". + return reservedSuffix.substring(1); + } + if (sanitizedName.endsWith(reservedSuffix)) { + sanitizedName = + sanitizedName.substring(0, sanitizedName.length() - reservedSuffix.length()); + modified = true; + } + } + } + return sanitizedName; + } + + /** + * Like {@link #sanitizeMetricName(String)}, but also makes sure that the unit is appended as a + * suffix if the unit is not {@code null}. + */ + public static String sanitizeMetricName(String metricName, Unit unit) { + String result = sanitizeMetricName(metricName); + if (unit != null) { + if (!result.endsWith("_" + unit) && !result.endsWith("." + unit)) { + result += "_" + unit; + } + } + return result; + } + + /** + * Convert an arbitrary string to a name where {@link #isValidLabelName(String) + * isValidLabelName(name)} is true. + */ + public static String sanitizeLabelName(String labelName) { + if (labelName.isEmpty()) { + throw new IllegalArgumentException("Cannot convert an empty string to a valid label name."); + } + String sanitizedName = labelName; + while (sanitizedName.startsWith("__") + || sanitizedName.startsWith("_.") + || sanitizedName.startsWith("._") + || sanitizedName.startsWith("..")) { + sanitizedName = sanitizedName.substring(1); + } + return sanitizedName; + } + + /** + * Convert an arbitrary string to a name where {@link #validateUnitName(String)} is {@code null} + * (i.e. the name is valid). + * + * @throws IllegalArgumentException if the {@code unitName} cannot be converted, for example if + * you call {@code sanitizeUnitName("total")} or {@code sanitizeUnitName("")}. + * @throws NullPointerException if {@code unitName} is null. + */ + public static String sanitizeUnitName(String unitName) { + if (unitName.isEmpty()) { + throw new IllegalArgumentException("Cannot convert an empty string to a valid unit name."); + } + String sanitizedName = replaceIllegalCharsInUnitName(unitName); + boolean modified = true; + while (modified) { + modified = false; + while (sanitizedName.startsWith("_") || sanitizedName.startsWith(".")) { + sanitizedName = sanitizedName.substring(1); + modified = true; + } + while (sanitizedName.endsWith(".") || sanitizedName.endsWith("_")) { + sanitizedName = sanitizedName.substring(0, sanitizedName.length() - 1); + modified = true; + } + for (String reservedSuffix : RESERVED_METRIC_NAME_SUFFIXES) { + String suffixName = reservedSuffix.substring(1); + if (sanitizedName.endsWith(suffixName)) { + sanitizedName = sanitizedName.substring(0, sanitizedName.length() - suffixName.length()); + modified = true; + } + } + } + if (sanitizedName.isEmpty()) { + throw new IllegalArgumentException( + "Cannot convert '" + unitName + "' into a valid unit name."); + } + return sanitizedName; + } + + /** Returns a string with only valid unit name characters [a-zA-Z0-9_.:]. */ + private static String replaceIllegalCharsInUnitName(String name) { + int length = name.length(); + char[] sanitized = new char[length]; + for (int i = 0; i < length; i++) { + char ch = name.charAt(i); + if (ch == ':' + || ch == '.' + || (ch >= 'a' && ch <= 'z') + || (ch >= 'A' && ch <= 'Z') + || (ch >= '0' && ch <= '9')) { + sanitized[i] = ch; + } else { + sanitized[i] = '_'; + } + } + return new String(sanitized); + } + + /** + * Escapes the incoming name according to the provided escaping scheme. Depending on the rules of + * escaping, this may cause no change in the string that is returned (especially NO_ESCAPING, + * which by definition is a noop). This method does not do any validation of the name. + */ + public static String escapeName(String name, EscapingScheme scheme) { + if (name.isEmpty() || !needsEscaping(name, scheme)) { + return name; + } + + StringBuilder escaped = new StringBuilder(); + switch (scheme) { + case ALLOW_UTF8: + return name; + case UNDERSCORE_ESCAPING: + for (int i = 0; i < name.length(); ) { + int c = name.codePointAt(i); + if (isValidLegacyChar(c, i)) { + escaped.appendCodePoint(c); + } else { + escaped.append('_'); + } + i += Character.charCount(c); + } + return escaped.toString(); + case DOTS_ESCAPING: + // Do not early return for legacy valid names, we still escape underscores. + for (int i = 0; i < name.length(); ) { + int c = name.codePointAt(i); + if (c == '_') { + escaped.append("__"); + } else if (c == '.') { + escaped.append("_dot_"); + } else if (isValidLegacyChar(c, i)) { + escaped.appendCodePoint(c); + } else { + escaped.append("__"); + } + i += Character.charCount(c); + } + return escaped.toString(); + case VALUE_ENCODING_ESCAPING: + escaped.append("U__"); + for (int i = 0; i < name.length(); ) { + int c = name.codePointAt(i); + if (c == '_') { + escaped.append("__"); + } else if (isValidLegacyChar(c, i)) { + escaped.appendCodePoint(c); + } else if (!isValidUtf8Char(c)) { + escaped.append("_FFFD_"); + } else { + escaped.append('_'); + escaped.append(Integer.toHexString(c)); + escaped.append('_'); + } + i += Character.charCount(c); + } + return escaped.toString(); + default: + throw new IllegalArgumentException("Invalid escaping scheme " + scheme); + } + } + + public static boolean needsEscaping(String name, EscapingScheme scheme) { + return !isValidLegacyMetricName(name) + || (scheme == EscapingScheme.DOTS_ESCAPING && (name.contains(".") || name.contains("_"))); + } + + static boolean isValidLegacyChar(int c, int i) { + return (c >= 'a' && c <= 'z') + || (c >= 'A' && c <= 'Z') + || c == '_' + || c == ':' + || (c >= '0' && c <= '9' && i > 0); + } + + private static boolean isValidUtf8Char(int c) { + return (0 <= c && c < MIN_HIGH_SURROGATE) || (MAX_LOW_SURROGATE < c && c <= MAX_CODE_POINT); + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Quantile.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Quantile.java new file mode 100644 index 000000000..1601920f0 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Quantile.java @@ -0,0 +1,34 @@ +package io.prometheus.metrics.model.snapshots; + +/** Immutable representation of a Quantile. */ +public class Quantile { + + private final double quantile; + private final double value; + + /** + * @param quantile expecting 0.0 <= quantile <= 1.0, otherwise an {@link + * IllegalArgumentException} will be thrown. + * @param value the quantile value + */ + public Quantile(double quantile, double value) { + this.quantile = quantile; + this.value = value; + validate(); + } + + public double getQuantile() { + return quantile; + } + + public double getValue() { + return value; + } + + private void validate() { + if (quantile < 0.0 || quantile > 1.0) { + throw new IllegalArgumentException( + quantile + ": Illegal quantile. Expecting 0 <= quantile <= 1"); + } + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Quantiles.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Quantiles.java new file mode 100644 index 000000000..34a9bc048 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Quantiles.java @@ -0,0 +1,92 @@ +package io.prometheus.metrics.model.snapshots; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; + +/** Immutable list of quantiles. */ +public class Quantiles implements Iterable { + + private final List quantiles; + public static final Quantiles EMPTY = new Quantiles(Collections.emptyList()); + + private Quantiles(List quantiles) { + quantiles = new ArrayList<>(quantiles); + quantiles.sort(Comparator.comparing(Quantile::getQuantile)); + this.quantiles = Collections.unmodifiableList(quantiles); + validate(); + } + + private void validate() { + for (int i = 0; i < quantiles.size() - 1; i++) { + if (quantiles.get(i).getQuantile() == quantiles.get(i + 1).getQuantile()) { + throw new IllegalArgumentException( + "Duplicate " + quantiles.get(i).getQuantile() + " quantile."); + } + } + } + + /** + * Create a new Quantiles instance. You can either create Quantiles with one of the static {@code + * Quantiles.of(...)} methods, or you can use the {@link Quantiles#builder()}. + */ + public static Quantiles of(List quantiles) { + return new Quantiles(quantiles); + } + + /** + * Create a new Quantiles instance. You can either create Quantiles with one of the static {@code + * Quantiles.of(...)} methods, or you can use the {@link Quantiles#builder()}. + */ + public static Quantiles of(Quantile... quantiles) { + return of(Arrays.asList(quantiles)); + } + + public int size() { + return quantiles.size(); + } + + public Quantile get(int i) { + return quantiles.get(i); + } + + @Override + public Iterator iterator() { + return quantiles.iterator(); + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + + private final List quantiles = new ArrayList<>(); + + private Builder() {} + + /** Add a quantile. Call multiple times to add multiple quantiles. */ + public Builder quantile(Quantile quantile) { + quantiles.add(quantile); + return this; + } + + /** + * Add a quantile. Call multiple times to add multiple quantiles. + * + * @param quantile 0.0 <= quantile <= 1.0 + * @param value the quantile value + */ + public Builder quantile(double quantile, double value) { + quantiles.add(new Quantile(quantile, value)); + return this; + } + + public Quantiles build() { + return new Quantiles(quantiles); + } + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/SnapshotEscaper.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/SnapshotEscaper.java new file mode 100644 index 000000000..422b36ee0 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/SnapshotEscaper.java @@ -0,0 +1,128 @@ +package io.prometheus.metrics.model.snapshots; + +import io.prometheus.metrics.config.EscapingScheme; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Nullable; + +public class SnapshotEscaper { + + private SnapshotEscaper() {} + + /** Escapes the given metric names and labels with the given escaping scheme. */ + public static MetricSnapshot escapeMetricSnapshot(MetricSnapshot v, EscapingScheme scheme) { + if (scheme == EscapingScheme.ALLOW_UTF8 || scheme == EscapingScheme.UNDERSCORE_ESCAPING) { + // we re-use the prometheus name for underscore escaping as an optimization + return v; + } + + List outDataPoints = new ArrayList<>(); + + for (DataPointSnapshot d : v.getDataPoints()) { + if (snapshotNeedsEscaping(d, scheme)) { + outDataPoints.add(d.escape(scheme)); + } else { + outDataPoints.add(d); + } + } + + return v.escape(scheme, outDataPoints); + } + + static boolean snapshotNeedsEscaping(DataPointSnapshot d, EscapingScheme scheme) { + Labels labels = d.getLabels(); + if (labelsNeedsEscaping(labels, scheme)) { + return true; + } + if (d instanceof SummarySnapshot.SummaryDataPointSnapshot) { + return exemplarsNeedsEscaping( + ((SummarySnapshot.SummaryDataPointSnapshot) d).getExemplars(), scheme); + } + if (d instanceof HistogramSnapshot.HistogramDataPointSnapshot) { + return exemplarsNeedsEscaping( + ((HistogramSnapshot.HistogramDataPointSnapshot) d).getExemplars(), scheme); + } + if (d instanceof CounterSnapshot.CounterDataPointSnapshot) { + return exemplarNeedsEscaping( + ((CounterSnapshot.CounterDataPointSnapshot) d).getExemplar(), scheme); + } + if (d instanceof UnknownSnapshot.UnknownDataPointSnapshot) { + return exemplarNeedsEscaping( + ((UnknownSnapshot.UnknownDataPointSnapshot) d).getExemplar(), scheme); + } + if (d instanceof GaugeSnapshot.GaugeDataPointSnapshot) { + return exemplarNeedsEscaping( + ((GaugeSnapshot.GaugeDataPointSnapshot) d).getExemplar(), scheme); + } + + return false; + } + + private static boolean labelsNeedsEscaping(Labels labels, EscapingScheme scheme) { + for (Label l : labels) { + if (PrometheusNaming.needsEscaping(l.getName(), scheme)) { + return true; + } + } + return false; + } + + private static boolean exemplarNeedsEscaping(@Nullable Exemplar exemplar, EscapingScheme scheme) { + return exemplar != null && labelsNeedsEscaping(exemplar.getLabels(), scheme); + } + + private static boolean exemplarsNeedsEscaping(Exemplars exemplars, EscapingScheme scheme) { + for (Exemplar exemplar : exemplars) { + if (labelsNeedsEscaping(exemplar.getLabels(), scheme)) { + return true; + } + } + return false; + } + + public static String getSnapshotLabelName(Labels labels, int index, EscapingScheme scheme) { + if (scheme == EscapingScheme.UNDERSCORE_ESCAPING) { + return labels.getPrometheusName(index); + } else { + return labels.getName(index); + } + } + + public static String getMetadataName(MetricMetadata metadata, EscapingScheme scheme) { + if (scheme == EscapingScheme.UNDERSCORE_ESCAPING) { + return metadata.getPrometheusName(); + } else { + return metadata.getName(); + } + } + + public static Labels escapeLabels(Labels labels, EscapingScheme scheme) { + Labels.Builder outLabelsBuilder = Labels.builder(); + + for (Label l : labels) { + outLabelsBuilder.label(PrometheusNaming.escapeName(l.getName(), scheme), l.getValue()); + } + + return outLabelsBuilder.build(); + } + + public static Exemplars escapeExemplars(Exemplars exemplars, EscapingScheme scheme) { + List escapedExemplars = new ArrayList<>(exemplars.size()); + for (Exemplar exemplar : exemplars) { + escapedExemplars.add(escapeExemplar(exemplar, scheme)); + } + return Exemplars.of(escapedExemplars); + } + + @Nullable + public static Exemplar escapeExemplar(@Nullable Exemplar exemplar, EscapingScheme scheme) { + if (exemplar == null) { + return null; + } + return Exemplar.builder() + .labels(escapeLabels(exemplar.getLabels(), scheme)) + .timestampMillis(exemplar.getTimestampMillis()) + .value(exemplar.getValue()) + .build(); + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/StateSetSnapshot.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/StateSetSnapshot.java new file mode 100644 index 000000000..7ca7f36d1 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/StateSetSnapshot.java @@ -0,0 +1,271 @@ +package io.prometheus.metrics.model.snapshots; + +import io.prometheus.metrics.config.EscapingScheme; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.stream.Stream; +import javax.annotation.Nullable; + +/** Immutable snapshot of a StateSet metric. */ +public final class StateSetSnapshot extends MetricSnapshot { + + /** + * To create a new {@link StateSetSnapshot}, you can either call the constructor directly or use + * the builder with {@link StateSetSnapshot#builder()}. + * + * @param metadata See {@link MetricMetadata} for more naming conventions. + * @param data the constructor will create a sorted copy of the collection. + */ + public StateSetSnapshot(MetricMetadata metadata, Collection data) { + this(metadata, data, false); + validate(); + } + + private StateSetSnapshot( + MetricMetadata metadata, Collection data, boolean internal) { + super(metadata, data, internal); + } + + private void validate() { + if (getMetadata().hasUnit()) { + throw new IllegalArgumentException("An state set metric cannot have a unit."); + } + for (StateSetDataPointSnapshot entry : getDataPoints()) { + if (entry.getLabels().contains(getMetadata().getPrometheusName())) { + throw new IllegalArgumentException( + "Label name " + getMetadata().getPrometheusName() + " is reserved."); + } + } + } + + @SuppressWarnings("unchecked") + @Override + public List getDataPoints() { + return (List) dataPoints; + } + + @SuppressWarnings("unchecked") + @Override + MetricSnapshot escape( + EscapingScheme escapingScheme, List dataPointSnapshots) { + return new StateSetSnapshot( + getMetadata().escape(escapingScheme), + (List) dataPointSnapshots, + true); + } + + public static class StateSetDataPointSnapshot extends DataPointSnapshot + implements Iterable { + final String[] names; + final boolean[] values; + + /** + * To create a new {@link StateSetDataPointSnapshot}, you can either call the constructor + * directly or use the Builder with {@link StateSetDataPointSnapshot#builder()}. + * + * @param names state names. Must have at least 1 entry. The constructor will create a copy of + * the array. + * @param values state values. Must have the same length as {@code names}. The constructor will + * create a copy of the array. + * @param labels must not be null. Use {@link Labels#EMPTY} if there are no labels. + */ + public StateSetDataPointSnapshot(String[] names, boolean[] values, Labels labels) { + this(names, values, labels, 0L); + } + + /** + * Constructor with an additional scrape timestamp. This is only useful in rare cases as the + * scrape timestamp is usually set by the Prometheus server during scraping. Exceptions include + * mirroring metrics with given timestamps from other metric sources. + */ + public StateSetDataPointSnapshot( + String[] names, boolean[] values, Labels labels, long scrapeTimestampMillis) { + this(names, values, labels, scrapeTimestampMillis, false); + } + + private StateSetDataPointSnapshot( + String[] names, + boolean[] values, + Labels labels, + long scrapeTimestampMillis, + boolean internal) { + super(labels, 0L, scrapeTimestampMillis, false); + if (internal) { + this.names = names; + this.values = values; + } else { + if (names.length == 0) { + throw new IllegalArgumentException("StateSet must have at least one state."); + } + if (names.length != values.length) { + throw new IllegalArgumentException("names[] and values[] must have the same length"); + } + + String[] namesCopy = Arrays.copyOf(names, names.length); + boolean[] valuesCopy = Arrays.copyOf(values, names.length); + sort(namesCopy, valuesCopy); + this.names = namesCopy; + this.values = valuesCopy; + validate(); + } + } + + public int size() { + return names.length; + } + + public String getName(int i) { + return names[i]; + } + + public boolean isTrue(int i) { + return values[i]; + } + + private void validate() { + for (int i = 0; i < names.length; i++) { + if (names[i].isEmpty()) { + throw new IllegalArgumentException("Empty string as state name"); + } + if (i > 0 && names[i - 1].equals(names[i])) { + throw new IllegalArgumentException(names[i] + " duplicate state name"); + } + } + } + + @Override + DataPointSnapshot escape(EscapingScheme escapingScheme) { + return new StateSetSnapshot.StateSetDataPointSnapshot( + names, + values, + SnapshotEscaper.escapeLabels(getLabels(), escapingScheme), + getScrapeTimestampMillis(), + true); + } + + private List asList() { + List result = new ArrayList<>(size()); + for (int i = 0; i < names.length; i++) { + result.add(new State(names[i], values[i])); + } + return Collections.unmodifiableList(result); + } + + @Override + public Iterator iterator() { + return asList().iterator(); + } + + public Stream stream() { + return asList().stream(); + } + + private static void sort(String[] names, boolean[] values) { + // Bubblesort + int n = names.length; + for (int i = 0; i < n - 1; i++) { + for (int j = 0; j < n - i - 1; j++) { + if (names[j].compareTo(names[j + 1]) > 0) { + swap(j, j + 1, names, values); + } + } + } + } + + private static void swap(int i, int j, String[] names, boolean[] values) { + String tmpName = names[j]; + names[j] = names[i]; + names[i] = tmpName; + boolean tmpValue = values[j]; + values[j] = values[i]; + values[i] = tmpValue; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder extends DataPointSnapshot.Builder { + + private final List names = new ArrayList<>(); + private final List values = new ArrayList<>(); + + private Builder() {} + + /** Add a state. Call multiple times to add multiple states. */ + public Builder state(String name, boolean value) { + names.add(name); + values.add(value); + return this; + } + + @Override + protected Builder self() { + return this; + } + + public StateSetDataPointSnapshot build() { + boolean[] valuesArray = new boolean[values.size()]; + for (int i = 0; i < values.size(); i++) { + valuesArray[i] = values.get(i); + } + return new StateSetDataPointSnapshot( + names.toArray(new String[] {}), valuesArray, labels, scrapeTimestampMillis); + } + } + } + + public static class State { + private final String name; + private final boolean value; + + private State(String name, boolean value) { + this.name = name; + this.value = value; + } + + public String getName() { + return name; + } + + public boolean isTrue() { + return value; + } + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder extends MetricSnapshot.Builder { + + private final List dataPoints = new ArrayList<>(); + + private Builder() {} + + /** Add a data point. Call multiple times to add multiple data points. */ + public Builder dataPoint(StateSetDataPointSnapshot dataPoint) { + dataPoints.add(dataPoint); + return this; + } + + @Override + public Builder unit(@Nullable Unit unit) { + throw new IllegalArgumentException("StateSet metric cannot have a unit."); + } + + @Override + public StateSetSnapshot build() { + return new StateSetSnapshot(buildMetadata(), dataPoints); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/SummarySnapshot.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/SummarySnapshot.java new file mode 100644 index 000000000..1b8dbc2e9 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/SummarySnapshot.java @@ -0,0 +1,204 @@ +package io.prometheus.metrics.model.snapshots; + +import io.prometheus.metrics.config.EscapingScheme; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +/** Immutable snapshot of a Summary metric. */ +public final class SummarySnapshot extends MetricSnapshot { + + /** + * To create a new {@link SummarySnapshot}, you can either call the constructor directly or use + * the builder with {@link SummarySnapshot#builder()}. + * + * @param metadata See {@link MetricMetadata} for more naming conventions. + * @param data the constructor will create a sorted copy of the collection. + */ + public SummarySnapshot(MetricMetadata metadata, Collection data) { + this(metadata, data, false); + } + + private SummarySnapshot( + MetricMetadata metadata, Collection data, boolean internal) { + super(metadata, data, internal); + } + + @SuppressWarnings("unchecked") + @Override + public List getDataPoints() { + return (List) dataPoints; + } + + @SuppressWarnings("unchecked") + @Override + MetricSnapshot escape( + EscapingScheme escapingScheme, List dataPointSnapshots) { + return new SummarySnapshot( + getMetadata().escape(escapingScheme), + (List) dataPointSnapshots, + true); + } + + public static final class SummaryDataPointSnapshot extends DistributionDataPointSnapshot { + + private final Quantiles quantiles; + + /** + * To create a new {@link SummaryDataPointSnapshot}, you can either call the constructor + * directly or use the Builder with {@link SummaryDataPointSnapshot#builder()}. + * + * @param count total number of observations. Optional, pass -1 if not available. + * @param sum sum of all observed values. Optional, pass {@link Double#NaN} if not available. + * @param quantiles must not be {@code null}. Use {@link Quantiles#EMPTY} if there are no + * quantiles. + * @param labels must not be {@code null}. Use {@link Labels#EMPTY} if there are no labels. + * @param exemplars must not be {@code null}. Use {@link Exemplars#EMPTY} if there are no + * exemplars. + * @param createdTimestampMillis timestamp (as in {@link System#currentTimeMillis()}) when this + * summary data (this specific set of labels) was created. Note that this refers to the + * creation of the timeseries, not the creation of the snapshot. The created timestamp + * optional. Use {@code 0L} if there is no created timestamp. + */ + public SummaryDataPointSnapshot( + long count, + double sum, + Quantiles quantiles, + Labels labels, + Exemplars exemplars, + long createdTimestampMillis) { + this(count, sum, quantiles, labels, exemplars, createdTimestampMillis, 0); + } + + /** + * Constructor with an additional scrape timestamp. This is only useful in rare cases as the + * scrape timestamp is usually set by the Prometheus server during scraping. Exceptions include + * mirroring metrics with given timestamps from other metric sources. + */ + public SummaryDataPointSnapshot( + long count, + double sum, + Quantiles quantiles, + Labels labels, + Exemplars exemplars, + long createdTimestampMillis, + long scrapeTimestampMillis) { + this( + count, + sum, + quantiles, + labels, + exemplars, + createdTimestampMillis, + scrapeTimestampMillis, + false); + validate(); + } + + private SummaryDataPointSnapshot( + long count, + double sum, + Quantiles quantiles, + Labels labels, + Exemplars exemplars, + long createdTimestampMillis, + long scrapeTimestampMillis, + boolean internal) { + super(count, sum, exemplars, labels, createdTimestampMillis, scrapeTimestampMillis, internal); + this.quantiles = quantiles; + } + + public Quantiles getQuantiles() { + return quantiles; + } + + private void validate() { + for (Label label : getLabels()) { + if (label.getName().equals("quantile")) { + throw new IllegalArgumentException("quantile is a reserved label name for summaries"); + } + } + if (quantiles == null) { + throw new NullPointerException(); + } + } + + @Override + DataPointSnapshot escape(EscapingScheme escapingScheme) { + return new SummarySnapshot.SummaryDataPointSnapshot( + getCount(), + getSum(), + getQuantiles(), + SnapshotEscaper.escapeLabels(getLabels(), escapingScheme), + SnapshotEscaper.escapeExemplars(getExemplars(), escapingScheme), + getCreatedTimestampMillis(), + getScrapeTimestampMillis(), + true); + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder extends DistributionDataPointSnapshot.Builder { + + private Quantiles quantiles = Quantiles.EMPTY; + + private Builder() {} + + @Override + protected Builder self() { + return this; + } + + public Builder quantiles(Quantiles quantiles) { + this.quantiles = quantiles; + return this; + } + + @Override + public Builder count(long count) { + super.count(count); + return this; + } + + public SummaryDataPointSnapshot build() { + return new SummaryDataPointSnapshot( + count, + sum, + quantiles, + labels, + exemplars, + createdTimestampMillis, + scrapeTimestampMillis); + } + } + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder extends MetricSnapshot.Builder { + + private final List dataPoints = new ArrayList<>(); + + private Builder() {} + + /** Add a data point. Call multiple times to add multiple data points. */ + public Builder dataPoint(SummaryDataPointSnapshot data) { + dataPoints.add(data); + return this; + } + + @Override + public SummarySnapshot build() { + return new SummarySnapshot(buildMetadata(), dataPoints); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Unit.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Unit.java new file mode 100644 index 000000000..31a9524e7 --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/Unit.java @@ -0,0 +1,78 @@ +package io.prometheus.metrics.model.snapshots; + +import java.util.Objects; + +/** + * Some pre-defined units for convenience. You can create your own units with + * + *

    + *     new Unit("myUnit");
    + * 
    + * + * Note that in Prometheus, units are largely based on SI base units (seconds, bytes, joules, grams, + * meters, ratio, volts, amperes, and Celsius). + */ +public final class Unit { + + private final String name; + + public static final Unit RATIO = new Unit("ratio"); + public static final Unit SECONDS = new Unit("seconds"); + public static final Unit BYTES = new Unit("bytes"); + public static final Unit CELSIUS = new Unit("celsius"); + public static final Unit JOULES = new Unit("joules"); + public static final Unit GRAMS = new Unit("grams"); + public static final Unit METERS = new Unit("meters"); + public static final Unit VOLTS = new Unit("volts"); + public static final Unit AMPERES = new Unit("amperes"); + + public Unit(String name) { + if (name == null) { + throw new NullPointerException("Unit name cannot be null."); + } + name = name.trim(); + String error = PrometheusNaming.validateUnitName(name); + if (error != null) { + throw new IllegalArgumentException(name + ": Illegal unit name: " + error); + } + this.name = name; + } + + @Override + public String toString() { + return name; + } + + public static double nanosToSeconds(long nanos) { + return nanos / 1E9; + } + + public static double millisToSeconds(long millis) { + return millis / 1E3; + } + + public static double secondsToMillis(double seconds) { + return seconds * 1E3; + } + + public static double kiloBytesToBytes(double kilobytes) { + return kilobytes * 1024; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Unit unit = (Unit) o; + return Objects.equals(name, unit.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } +} diff --git a/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/UnknownSnapshot.java b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/UnknownSnapshot.java new file mode 100644 index 000000000..09574d6cd --- /dev/null +++ b/prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/UnknownSnapshot.java @@ -0,0 +1,165 @@ +package io.prometheus.metrics.model.snapshots; + +import io.prometheus.metrics.config.EscapingScheme; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import javax.annotation.Nullable; + +/** Immutable snapshot of an Unknown (Untyped) metric. */ +public final class UnknownSnapshot extends MetricSnapshot { + + /** + * To create a new {@link UnknownSnapshot}, you can either call the constructor directly or use + * the builder with {@link UnknownSnapshot#builder()}. + * + * @param metadata required name and optional help and unit. See {@link MetricMetadata} for naming + * conventions. + * @param data the constructor will create a sorted copy of the collection. + */ + public UnknownSnapshot(MetricMetadata metadata, Collection data) { + this(metadata, data, false); + } + + private UnknownSnapshot( + MetricMetadata metadata, Collection data, boolean internal) { + super(metadata, data, internal); + } + + @SuppressWarnings("unchecked") + @Override + public List getDataPoints() { + return (List) dataPoints; + } + + @SuppressWarnings("unchecked") + @Override + MetricSnapshot escape( + EscapingScheme escapingScheme, List dataPointSnapshots) { + return new UnknownSnapshot( + getMetadata().escape(escapingScheme), + (List) dataPointSnapshots, + true); + } + + public static final class UnknownDataPointSnapshot extends DataPointSnapshot { + + private final double value; + @Nullable private final Exemplar exemplar; + + /** + * To create a new {@link UnknownDataPointSnapshot}, you can either call the constructor + * directly or use the Builder with {@link UnknownDataPointSnapshot#builder()}. + * + * @param value the value. + * @param labels must not be null. Use {@link Labels#EMPTY} if there are no labels. + * @param exemplar may be null. + */ + public UnknownDataPointSnapshot(double value, Labels labels, @Nullable Exemplar exemplar) { + this(value, labels, exemplar, 0); + } + + /** + * Constructor with an additional scrape timestamp. This is only useful in rare cases as the + * scrape timestamp is usually set by the Prometheus server during scraping. Exceptions include + * mirroring metrics with given timestamps from other metric sources. + */ + public UnknownDataPointSnapshot( + double value, Labels labels, @Nullable Exemplar exemplar, long scrapeTimestampMillis) { + this(value, labels, exemplar, scrapeTimestampMillis, false); + } + + private UnknownDataPointSnapshot( + double value, + Labels labels, + @Nullable Exemplar exemplar, + long scrapeTimestampMillis, + boolean internal) { + super(labels, 0L, scrapeTimestampMillis, internal); + this.value = value; + this.exemplar = exemplar; + } + + public double getValue() { + return value; + } + + @Nullable + public Exemplar getExemplar() { + return exemplar; + } + + public static Builder builder() { + return new Builder(); + } + + @Override + DataPointSnapshot escape(EscapingScheme escapingScheme) { + return new UnknownDataPointSnapshot( + value, + SnapshotEscaper.escapeLabels(getLabels(), escapingScheme), + SnapshotEscaper.escapeExemplar(exemplar, escapingScheme), + getScrapeTimestampMillis(), + true); + } + + public static class Builder extends DataPointSnapshot.Builder { + + @Nullable private Exemplar exemplar = null; + @Nullable private Double value = null; + + private Builder() {} + + /** required. */ + public Builder value(double value) { + this.value = value; + return this; + } + + /** Optional */ + public Builder exemplar(@Nullable Exemplar exemplar) { + this.exemplar = exemplar; + return this; + } + + public UnknownDataPointSnapshot build() { + if (value == null) { + throw new IllegalArgumentException("Missing required field: value is null."); + } + return new UnknownDataPointSnapshot(value, labels, exemplar, scrapeTimestampMillis); + } + + @Override + protected Builder self() { + return this; + } + } + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder extends MetricSnapshot.Builder { + + private final List dataPoints = new ArrayList<>(); + + private Builder() {} + + /** Add a data point. Call multiple times to add multiple data points. */ + public Builder dataPoint(UnknownDataPointSnapshot data) { + dataPoints.add(data); + return this; + } + + @Override + public UnknownSnapshot build() { + return new UnknownSnapshot(buildMetadata(), dataPoints); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/registry/CollectorTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/registry/CollectorTest.java new file mode 100644 index 000000000..65102c17b --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/registry/CollectorTest.java @@ -0,0 +1,29 @@ +package io.prometheus.metrics.model.registry; + +import static org.assertj.core.api.Assertions.assertThat; + +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import org.junit.jupiter.api.Test; + +class CollectorTest { + + Collector collector = () -> CounterSnapshot.builder().name("counter_a").build(); + + @Test + void predicate() { + PrometheusScrapeRequest request = + new PrometheusScrapeRequest() { + @Override + public String getRequestPath() { + return "/metrics"; + } + + @Override + public String[] getParameterValues(String name) { + return new String[0]; + } + }; + assertThat(collector.collect(name -> false, request)).isNull(); + assertThat(collector.collect(name -> true, request)).isNotNull(); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/registry/MetricNameFilterTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/registry/MetricNameFilterTest.java new file mode 100644 index 000000000..0dc9cdee1 --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/registry/MetricNameFilterTest.java @@ -0,0 +1,66 @@ +package io.prometheus.metrics.model.registry; + +import static org.assertj.core.api.Assertions.assertThat; + +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import io.prometheus.metrics.model.snapshots.CounterSnapshot.CounterDataPointSnapshot; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import org.junit.jupiter.api.Test; + +class MetricNameFilterTest { + + private final PrometheusRegistry registry = new PrometheusRegistry(); + + @Test + public void testCounter() { + registry.register( + () -> + CounterSnapshot.builder() + .name("counter1") + .help("test counter 1") + .dataPoint( + CounterDataPointSnapshot.builder() + .labels(Labels.of("path", "/hello")) + .value(1.0) + .build()) + .dataPoint( + CounterDataPointSnapshot.builder() + .labels(Labels.of("path", "/goodbye")) + .value(2.0) + .build()) + .build()); + registry.register( + () -> + CounterSnapshot.builder() + .name("counter2") + .help("test counter 2") + .dataPoint(CounterDataPointSnapshot.builder().value(1.0).build()) + .build()); + + MetricNameFilter filter = MetricNameFilter.builder().build(); + assertThat(registry.scrape(filter).size()).isEqualTo(2); + + filter = MetricNameFilter.builder().nameMustStartWith("counter1").build(); + MetricSnapshots snapshots = registry.scrape(filter); + assertThat(snapshots.size()).isOne(); + assertThat(snapshots.get(0).getMetadata().getName()).isEqualTo("counter1"); + + filter = MetricNameFilter.builder().nameMustNotStartWith("counter1").build(); + snapshots = registry.scrape(filter); + assertThat(snapshots.size()).isOne(); + assertThat(snapshots.get(0).getMetadata().getName()).isEqualTo("counter2"); + + filter = + MetricNameFilter.builder().nameMustBeEqualTo("counter2_total", "counter1_total").build(); + snapshots = registry.scrape(filter); + assertThat(snapshots.size()).isEqualTo(2); + + filter = + MetricNameFilter.builder() + .nameMustBeEqualTo("counter1_total") + .nameMustNotBeEqualTo("counter1_total") + .build(); + assertThat(registry.scrape(filter).size()).isZero(); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/registry/MultiCollectorNameFilterTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/registry/MultiCollectorNameFilterTest.java new file mode 100644 index 000000000..d2a38c3cf --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/registry/MultiCollectorNameFilterTest.java @@ -0,0 +1,89 @@ +package io.prometheus.metrics.model.registry; + +import static org.assertj.core.api.Assertions.assertThat; + +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import io.prometheus.metrics.model.snapshots.CounterSnapshot.CounterDataPointSnapshot; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot.GaugeDataPointSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; +import org.junit.jupiter.api.Test; + +class MultiCollectorNameFilterTest { + + private static class Registry extends PrometheusRegistry { + private final AtomicBoolean collectCalled = new AtomicBoolean(); + + private Registry(List prometheusNames) { + register( + new MultiCollector() { + @Override + public MetricSnapshots collect() { + collectCalled.set(true); + return MetricSnapshots.builder() + .metricSnapshot( + CounterSnapshot.builder() + .name("counter_1") + .dataPoint(CounterDataPointSnapshot.builder().value(1.0).build()) + .build()) + .metricSnapshot( + GaugeSnapshot.builder() + .name("gauge_2") + .dataPoint(GaugeDataPointSnapshot.builder().value(1.0).build()) + .build()) + .build(); + } + + @Override + public List getPrometheusNames() { + return prometheusNames; + } + }); + } + + private boolean collectCalled() { + return collectCalled.get(); + } + } + + @Test + public void testPartialFilter() { + Registry registry = new Registry(Collections.emptyList()); + MetricSnapshots snapshots = registry.scrape(name -> name.equals("counter_1")); + assertThat(registry.collectCalled()).isTrue(); + assertThat(snapshots.size()).isOne(); + assertThat(snapshots.get(0).getMetadata().getName()).isEqualTo("counter_1"); + } + + @Test + public void testPartialFilterWithPrometheusNames() { + Registry registry = new Registry(Arrays.asList("counter_1", "gauge_2")); + + MetricSnapshots snapshots = registry.scrape(name -> name.equals("counter_1")); + assertThat(registry.collectCalled()).isTrue(); + assertThat(snapshots.size()).isOne(); + assertThat(snapshots.get(0).getMetadata().getName()).isEqualTo("counter_1"); + } + + @Test + public void testCompleteFilter_CollectCalled() { + Registry registry = new Registry(Collections.emptyList()); + MetricSnapshots snapshots = + registry.scrape(name -> !name.equals("counter_1") && !name.equals("gauge_2")); + assertThat(registry.collectCalled()).isTrue(); + assertThat(snapshots.size()).isZero(); + } + + @Test + public void testCompleteFilter_CollectNotCalled() { + Registry registry = new Registry(Arrays.asList("counter_1", "gauge_2")); + MetricSnapshots snapshots = + registry.scrape(name -> !name.equals("counter_1") && !name.equals("gauge_2")); + assertThat(registry.collectCalled()).isFalse(); + assertThat(snapshots.size()).isZero(); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/registry/PrometheusRegistryTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/registry/PrometheusRegistryTest.java new file mode 100644 index 000000000..9e87f1fc9 --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/registry/PrometheusRegistryTest.java @@ -0,0 +1,155 @@ +package io.prometheus.metrics.model.registry; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatCode; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Test; + +class PrometheusRegistryTest { + + Collector noName = () -> GaugeSnapshot.builder().name("no_name_gauge").build(); + + Collector counterA1 = + new Collector() { + @Override + public MetricSnapshot collect() { + return CounterSnapshot.builder().name("counter_a").build(); + } + + @Override + public String getPrometheusName() { + return "counter_a"; + } + }; + + Collector counterA2 = + new Collector() { + @Override + public MetricSnapshot collect() { + return CounterSnapshot.builder().name("counter.a").build(); + } + + @Override + public String getPrometheusName() { + return "counter_a"; + } + }; + + Collector counterB = + new Collector() { + @Override + public MetricSnapshot collect() { + return CounterSnapshot.builder().name("counter_b").build(); + } + + @Override + public String getPrometheusName() { + return "counter_b"; + } + }; + + Collector gaugeA = + new Collector() { + @Override + public MetricSnapshot collect() { + return GaugeSnapshot.builder().name("gauge_a").build(); + } + + @Override + public String getPrometheusName() { + return "gauge_a"; + } + }; + + MultiCollector multiCollector = + new MultiCollector() { + @Override + public MetricSnapshots collect() { + return new MetricSnapshots(gaugeA.collect(), counterB.collect()); + } + + @Override + public List getPrometheusNames() { + return Arrays.asList(gaugeA.getPrometheusName(), counterB.getPrometheusName()); + } + }; + + @Test + public void registerNoName() { + PrometheusRegistry registry = new PrometheusRegistry(); + // If the collector does not have a name at registration time, there is no conflict during + // registration. + registry.register(noName); + registry.register(noName); + // However, at scrape time the collector has to provide a metric name, and then we'll get a + // duplicate name error. + assertThatCode(registry::scrape) + .hasMessageContaining("duplicate") + .hasMessageContaining("no_name_gauge"); + } + + @Test + public void registerDuplicateName() { + PrometheusRegistry registry = new PrometheusRegistry(); + registry.register(counterA1); + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy(() -> registry.register(counterA2)); + } + + @Test + public void registerOk() { + PrometheusRegistry registry = new PrometheusRegistry(); + registry.register(counterA1); + registry.register(counterB); + registry.register(gaugeA); + MetricSnapshots snapshots = registry.scrape(); + assertThat(snapshots.size()).isEqualTo(3); + + registry.unregister(counterB); + snapshots = registry.scrape(); + assertThat(snapshots.size()).isEqualTo(2); + + registry.register(counterB); + snapshots = registry.scrape(); + assertThat(snapshots.size()).isEqualTo(3); + } + + @Test + public void registerDuplicateMultiCollector() { + PrometheusRegistry registry = new PrometheusRegistry(); + registry.register(multiCollector); + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy(() -> registry.register(multiCollector)); + } + + @Test + public void registerOkMultiCollector() { + PrometheusRegistry registry = new PrometheusRegistry(); + registry.register(multiCollector); + MetricSnapshots snapshots = registry.scrape(); + assertThat(snapshots.size()).isEqualTo(2); + + registry.unregister(multiCollector); + snapshots = registry.scrape(); + assertThat(snapshots.size()).isZero(); + } + + @Test + public void clearOk() { + PrometheusRegistry registry = new PrometheusRegistry(); + registry.register(counterA1); + registry.register(counterB); + registry.register(gaugeA); + assertThat(registry.scrape().size()).isEqualTo(3); + + registry.clear(); + assertThat(registry.scrape().size()).isZero(); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/ClassicHistogramBucketsTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/ClassicHistogramBucketsTest.java new file mode 100644 index 000000000..d39b32436 --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/ClassicHistogramBucketsTest.java @@ -0,0 +1,130 @@ +package io.prometheus.metrics.model.snapshots; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import java.util.Iterator; +import java.util.List; +import java.util.stream.Collectors; +import org.junit.jupiter.api.Test; + +class ClassicHistogramBucketsTest { + + @Test + public void testGoodCase() { + ClassicHistogramBuckets buckets = + ClassicHistogramBuckets.builder() + .bucket(Double.NEGATIVE_INFINITY, 0) + .bucket(-10.0, 7) + .bucket(1024, 3) + .bucket(Double.POSITIVE_INFINITY, 8) + .build(); + assertThat(buckets.size()).isEqualTo(4); + } + + @Test + public void testSort() { + ClassicHistogramBuckets buckets = + ClassicHistogramBuckets.builder() + .bucket(7, 2) + .bucket(2, 0) + .bucket(Double.POSITIVE_INFINITY, 3) + .build(); + assertThat(buckets.size()).isEqualTo(3); + assertThat(buckets.getUpperBound(0)).isEqualTo(2); + assertThat(buckets.getUpperBound(1)).isEqualTo(7); + assertThat(buckets.getUpperBound(2)).isEqualTo(Double.POSITIVE_INFINITY); + assertThat(buckets.getCount(0)).isZero(); + assertThat(buckets.getCount(1)).isEqualTo(2); + assertThat(buckets.getCount(2)).isEqualTo(3); + } + + @Test + public void testMinimalBuckets() { + ClassicHistogramBuckets buckets = + ClassicHistogramBuckets.builder().bucket(Double.POSITIVE_INFINITY, 0).build(); + assertThat(buckets.size()).isOne(); + } + + @Test + public void testInfBucketMissing() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> ClassicHistogramBuckets.builder().bucket(Double.NEGATIVE_INFINITY, 0).build()); + } + + @Test + public void testNegativeCount() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + ClassicHistogramBuckets.builder() + .bucket(0.0, 10) + .bucket(Double.POSITIVE_INFINITY, -1) + .build()); + } + + @Test + public void testNaNBoundary() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + ClassicHistogramBuckets.builder() + .bucket(0.0, 1) + .bucket(Double.NaN, 2) + .bucket(Double.POSITIVE_INFINITY, 0) + .build()); + } + + @Test + public void testDuplicateBoundary() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + ClassicHistogramBuckets.builder() + .bucket(1.0, 1) + .bucket(2.0, 2) + .bucket(1.0, 2) + .bucket(Double.POSITIVE_INFINITY, 0) + .build()); + } + + @Test + public void testEmptyBuckets() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> ClassicHistogramBuckets.builder().build()); + } + + @Test + public void testDifferentLength() { + double[] upperBounds = new double[] {0.7, 1.3, Double.POSITIVE_INFINITY}; + long[] counts = new long[] {13, 178, 1024, 3000}; + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> ClassicHistogramBuckets.of(upperBounds, counts)); + } + + @Test + public void testImmutable() { + ClassicHistogramBuckets buckets = + ClassicHistogramBuckets.builder() + .bucket(1.0, 7) + .bucket(2.0, 8) + .bucket(Double.POSITIVE_INFINITY, 0) + .build(); + Iterator iterator = buckets.iterator(); + iterator.next(); + assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(iterator::remove); + } + + @Test + public void compare() { + ClassicHistogramBuckets buckets = + ClassicHistogramBuckets.builder() + .bucket(1.0, 7) + .bucket(2.0, 8) + .bucket(Double.POSITIVE_INFINITY, 0) + .build(); + List list = buckets.stream().collect(Collectors.toList()); + assertThat(list.get(0)).isNotEqualByComparingTo(list.get(1)); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/CounterSnapshotTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/CounterSnapshotTest.java new file mode 100644 index 000000000..a69ccfbab --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/CounterSnapshotTest.java @@ -0,0 +1,119 @@ +package io.prometheus.metrics.model.snapshots; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import io.prometheus.metrics.model.snapshots.CounterSnapshot.CounterDataPointSnapshot; +import java.util.Iterator; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; + +class CounterSnapshotTest { + + @Test + public void testCompleteGoodCase() { + long createdTimestamp1 = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(1); + long createdTimestamp2 = System.currentTimeMillis() - TimeUnit.MINUTES.toMillis(2); + long exemplarTimestamp = System.currentTimeMillis(); + CounterSnapshot snapshot = + CounterSnapshot.builder() + .name("http_server_requests_seconds") + .help("total time spent serving requests") + .unit(Unit.SECONDS) + .dataPoint( + CounterDataPointSnapshot.builder() + .value(1.0) + .exemplar( + Exemplar.builder() + .value(3.0) + .traceId("abc123") + .spanId("123457") + .timestampMillis(exemplarTimestamp) + .build()) + .labels(Labels.builder().label("path", "/world").build()) + .createdTimestampMillis(createdTimestamp1) + .build()) + .dataPoint( + CounterDataPointSnapshot.builder() + .value(2.0) + .exemplar( + Exemplar.builder() + .value(4.0) + .traceId("def456") + .spanId("234567") + .timestampMillis(exemplarTimestamp) + .build()) + .labels(Labels.builder().label("path", "/hello").build()) + .createdTimestampMillis(createdTimestamp2) + .build()) + .build(); + SnapshotTestUtil.assertMetadata( + snapshot, "http_server_requests_seconds", "total time spent serving requests", "seconds"); + assertThat(snapshot.getDataPoints()).hasSize(2); + CounterDataPointSnapshot data = + snapshot + .getDataPoints() + .get(0); // data is sorted by labels, so the first one should be path="/hello" + assertThat((Iterable) data.getLabels()).isEqualTo(Labels.of("path", "/hello")); + assertThat(data.getValue()).isEqualTo(2.0); + assertThat(data.getExemplar().getValue()).isEqualTo(4.0); + assertThat(data.getCreatedTimestampMillis()).isEqualTo(createdTimestamp2); + assertThat(data.hasScrapeTimestamp()).isFalse(); + data = snapshot.getDataPoints().get(1); + assertThat((Iterable) data.getLabels()).isEqualTo(Labels.of("path", "/world")); + assertThat(data.getValue()).isEqualTo(1.0); + assertThat(data.getExemplar().getValue()).isEqualTo(3.0); + assertThat(data.getCreatedTimestampMillis()).isEqualTo(createdTimestamp1); + assertThat(data.hasScrapeTimestamp()).isFalse(); + } + + @Test + public void testMinimalGoodCase() { + CounterSnapshot snapshot = + CounterSnapshot.builder() + .name("events") + .dataPoint(CounterDataPointSnapshot.builder().value(1.0).build()) + .build(); + SnapshotTestUtil.assertMetadata(snapshot, "events", null, null); + assertThat(snapshot.getDataPoints()).hasSize(1); + CounterDataPointSnapshot data = snapshot.getDataPoints().get(0); + assertThat((Iterable) data.getLabels()).isEmpty(); + assertThat(data.getValue()).isEqualTo(1.0); + assertThat(data.getExemplar()).isNull(); + assertThat(data.hasCreatedTimestamp()).isFalse(); + assertThat(data.hasScrapeTimestamp()).isFalse(); + } + + @Test + public void testEmptyCounter() { + CounterSnapshot snapshot = CounterSnapshot.builder().name("events").build(); + assertThat(snapshot.getDataPoints()).isEmpty(); + } + + @Test + public void testTotalSuffixPresent() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> CounterSnapshot.builder().name("test_total").build()); + } + + @Test + public void testValueMissing() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> CounterDataPointSnapshot.builder().build()); + } + + @Test + public void testDataImmutable() { + CounterSnapshot snapshot = + CounterSnapshot.builder() + .name("events") + .dataPoint( + CounterDataPointSnapshot.builder().labels(Labels.of("a", "a")).value(1.0).build()) + .dataPoint( + CounterDataPointSnapshot.builder().labels(Labels.of("a", "b")).value(2.0).build()) + .build(); + Iterator iterator = snapshot.getDataPoints().iterator(); + iterator.next(); + assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(iterator::remove); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/ExemplarTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/ExemplarTest.java new file mode 100644 index 000000000..4a40b47ef --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/ExemplarTest.java @@ -0,0 +1,88 @@ +package io.prometheus.metrics.model.snapshots; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import org.assertj.core.api.IterableAssert; +import org.junit.jupiter.api.Test; + +class ExemplarTest { + + @Test + public void testGoodCaseComplete() { + long timestamp = System.currentTimeMillis(); + Exemplar exemplar = + Exemplar.builder() + .value(2.2) + .traceId("abc123abc123") + .spanId("def456def456") + .timestampMillis(timestamp) + .labels(Labels.of("path", "/", "error", "none")) + .build(); + assertThat(exemplar.getValue()).isEqualTo(2.2); + assertLabels(exemplar.getLabels()) + .isEqualTo( + Labels.of( + Exemplar.TRACE_ID, + "abc123abc123", + Exemplar.SPAN_ID, + "def456def456", + "path", + "/", + "error", + "none")); + assertThat(exemplar.hasTimestamp()).isTrue(); + assertThat(exemplar.getTimestampMillis()).isEqualTo(timestamp); + } + + @Test + public void testValueMissing() { + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy(() -> Exemplar.builder().build()); + } + + @Test + public void testMinimal() { + Exemplar exemplar = Exemplar.builder().value(0.0).build(); + assertThat(exemplar.getValue()).isEqualTo(0.0); + assertLabels(exemplar.getLabels()).isEqualTo(Labels.EMPTY); + assertThat(exemplar.hasTimestamp()).isFalse(); + } + + @Test + public void testLabelsMergeTraceId() { + Exemplar exemplar = + Exemplar.builder().value(0.0).labels(Labels.of("a", "b")).traceId("abc").build(); + assertLabels(exemplar.getLabels()).isEqualTo(Labels.of("a", "b", "trace_id", "abc")); + } + + private static IterableAssert assertLabels(Labels labels) { + return assertThat((Iterable) labels); + } + + @Test + public void testLabelsMergeSpanId() { + Exemplar exemplar = + Exemplar.builder().value(0.0).labels(Labels.of("a", "b")).spanId("abc").build(); + assertLabels(exemplar.getLabels()).isEqualTo(Labels.of("a", "b", "span_id", "abc")); + } + + @Test + public void testLabelsMergeTraceIdAndSpanId() { + Exemplar exemplar = + Exemplar.builder() + .value(0.0) + .labels(Labels.of("a", "b")) + .spanId("abc") + .traceId("def") + .build(); + assertLabels(exemplar.getLabels()) + .isEqualTo(Labels.of("span_id", "abc", "a", "b", "trace_id", "def")); + } + + @Test + public void testLabelsMergeNone() { + Exemplar exemplar = Exemplar.builder().value(0.0).labels(Labels.of("a", "b")).build(); + assertLabels(exemplar.getLabels()).isEqualTo(Labels.of("a", "b")); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/ExemplarsTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/ExemplarsTest.java new file mode 100644 index 000000000..cd38342cd --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/ExemplarsTest.java @@ -0,0 +1,56 @@ +package io.prometheus.metrics.model.snapshots; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import java.util.Iterator; +import org.junit.jupiter.api.Test; + +class ExemplarsTest { + + @Test + public void testUpperBound() { + Exemplars exemplars = + Exemplars.of( + Exemplar.builder().value(1.0).build(), + Exemplar.builder().value(3.0).build(), + Exemplar.builder().value(2.0).build()); + assertThat(exemplars.size()).isEqualTo(3); + assertThat(exemplars).extracting(Exemplar::getValue).containsExactly(1.0, 3.0, 2.0); + assertThat(exemplars.get(0.0, Double.POSITIVE_INFINITY).getValue()).isEqualTo(1.0); + assertThat(exemplars.get(0.0, 1.0).getValue()).isEqualTo(1.0); + assertThat(exemplars.get(1.0, 4.0).getValue()).isEqualTo(3.0); + assertThat(exemplars.get(2.0, 3.0).getValue()).isEqualTo(3.0); + assertThat(exemplars.get(1.0, 2.1).getValue()).isEqualTo(2.0); + assertThat(exemplars.get(2.0, 2.1)).isNull(); + } + + @Test + public void testImmutable() { + Exemplars exemplars = + Exemplars.of( + Exemplar.builder().value(1.0).build(), + Exemplar.builder().value(3.0).build(), + Exemplar.builder().value(2.0).build()); + Iterator iterator = exemplars.iterator(); + iterator.next(); + assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(iterator::remove); + } + + @Test + public void testGet() { + Exemplar oldest = + Exemplar.builder().timestampMillis(System.currentTimeMillis() - 100).value(1.8).build(); + Exemplar middle = + Exemplar.builder().timestampMillis(System.currentTimeMillis() - 50).value(1.2).build(); + Exemplar newest = + Exemplar.builder().timestampMillis(System.currentTimeMillis()).value(1.0).build(); + Exemplars exemplars = Exemplars.of(oldest, newest, middle); + Exemplar result = exemplars.get(1.1, 1.9); // newest is not within these bounds + assertThat(middle).isSameAs(result); + result = exemplars.get(0.9, Double.POSITIVE_INFINITY); + assertThat(newest).isSameAs(result); + + assertThat(exemplars.getLatest()).isSameAs(newest); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/GaugeSnapshotTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/GaugeSnapshotTest.java new file mode 100644 index 000000000..c469647e0 --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/GaugeSnapshotTest.java @@ -0,0 +1,120 @@ +package io.prometheus.metrics.model.snapshots; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import io.prometheus.metrics.model.snapshots.CounterSnapshot.CounterDataPointSnapshot; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot.GaugeDataPointSnapshot; +import java.util.Iterator; +import org.junit.jupiter.api.Test; + +class GaugeSnapshotTest { + + @Test + public void testCompleteGoodCase() { + long exemplarTimestamp = System.currentTimeMillis(); + GaugeSnapshot snapshot = + GaugeSnapshot.builder() + .name("cache_size_bytes") + .help("cache size in Bytes") + .unit(Unit.BYTES) + .dataPoint( + GaugeDataPointSnapshot.builder() + .value(1024.0) + .exemplar( + Exemplar.builder() + .value(1024.0) + .traceId("abc123") + .spanId("123457") + .timestampMillis(exemplarTimestamp) + .build()) + .labels(Labels.builder().label("env", "prod").build()) + .build()) + .dataPoint( + GaugeDataPointSnapshot.builder() + .value(128.0) + .exemplar( + Exemplar.builder() + .value(128.0) + .traceId("def456") + .spanId("234567") + .timestampMillis(exemplarTimestamp) + .build()) + .labels(Labels.builder().label("env", "dev").build()) + .build()) + .build(); + SnapshotTestUtil.assertMetadata(snapshot, "cache_size_bytes", "cache size in Bytes", "bytes"); + assertThat(snapshot.getDataPoints()).hasSize(2); + GaugeDataPointSnapshot data = + snapshot + .getDataPoints() + .get(0); // data is sorted by labels, so the first one should be path="/hello" + assertThat((Iterable) data.getLabels()).isEqualTo(Labels.of("env", "dev")); + assertThat(data.getValue()).isEqualTo(128.0); + assertThat(data.getExemplar().getValue()).isEqualTo(128.0); + assertThat(data.hasCreatedTimestamp()).isFalse(); + assertThat(data.hasScrapeTimestamp()).isFalse(); + data = snapshot.getDataPoints().get(1); + assertThat((Iterable) data.getLabels()).isEqualTo(Labels.of("env", "prod")); + assertThat(data.getValue()).isEqualTo(1024.0); + assertThat(data.getExemplar().getValue()).isEqualTo(1024.0); + assertThat(data.hasCreatedTimestamp()).isFalse(); + assertThat(data.hasScrapeTimestamp()).isFalse(); + } + + @Test + public void testMinimalGoodCase() { + GaugeSnapshot snapshot = + GaugeSnapshot.builder() + .name("temperature") + .dataPoint(GaugeDataPointSnapshot.builder().value(23.0).build()) + .build(); + SnapshotTestUtil.assertMetadata(snapshot, "temperature", null, null); + assertThat(snapshot.getDataPoints().size()).isOne(); + GaugeDataPointSnapshot data = snapshot.getDataPoints().get(0); + assertThat((Iterable) data.getLabels()).isEmpty(); + assertThat(data.getValue()).isEqualTo(23.0); + assertThat(data.getExemplar()).isNull(); + assertThat(data.hasCreatedTimestamp()).isFalse(); + assertThat(data.hasScrapeTimestamp()).isFalse(); + } + + @Test + public void testEmptyGauge() { + GaugeSnapshot snapshot = GaugeSnapshot.builder().name("temperature").build(); + assertThat(snapshot.getDataPoints().size()).isZero(); + } + + @Test + public void testTotalSuffixPresent() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> CounterSnapshot.builder().name("test_total").build()); + } + + @Test + public void testTotalSuffixPresentDot() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> CounterSnapshot.builder().name("test.total").build()); + } + + @Test + public void testValueMissing() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> CounterDataPointSnapshot.builder().build()); + } + + @Test + public void testDataImmutable() { + GaugeSnapshot snapshot = + GaugeSnapshot.builder() + .name("gauge") + .dataPoint( + GaugeDataPointSnapshot.builder().labels(Labels.of("a", "a")).value(23.0).build()) + .dataPoint( + GaugeDataPointSnapshot.builder().labels(Labels.of("a", "b")).value(23.0).build()) + .build(); + Iterator iterator = snapshot.getDataPoints().iterator(); + iterator.next(); + assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(iterator::remove); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/HistogramSnapshotTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/HistogramSnapshotTest.java new file mode 100644 index 000000000..54eefbe66 --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/HistogramSnapshotTest.java @@ -0,0 +1,320 @@ +package io.prometheus.metrics.model.snapshots; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.assertj.core.data.Offset.offset; + +import io.prometheus.metrics.model.snapshots.HistogramSnapshot.HistogramDataPointSnapshot; +import java.util.Collections; +import java.util.Iterator; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; + +class HistogramSnapshotTest { + + @Test + public void testGoodCaseComplete() { + long createdTimestamp = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(1); + long scrapeTimestamp = System.currentTimeMillis() - TimeUnit.MINUTES.toMillis(2); + long exemplarTimestamp = System.currentTimeMillis(); + Exemplar exemplar1 = + Exemplar.builder() + .value(129.0) + .traceId("abcabc") + .spanId("defdef") + .labels(Labels.of("status", "200")) + .timestampMillis(exemplarTimestamp) + .build(); + HistogramSnapshot snapshot = + HistogramSnapshot.builder() + .name("request_size_bytes") + .help("request sizes in bytes") + .unit(Unit.BYTES) + .dataPoint( + HistogramDataPointSnapshot.builder() + .sum(27000.0) + .nativeSchema(5) + .nativeZeroCount(2) + .nativeZeroThreshold(0.0000001) + .classicHistogramBuckets( + ClassicHistogramBuckets.builder() + .bucket(Double.POSITIVE_INFINITY, 0) + .bucket(128.0, 7) + .bucket(1024.0, 15) + .build()) + // The total number of observations in the native and classic histogram + // is consistent (22 observations), but the individual bucket counts don't fit. + // It doesn't matter for this test, but it would be good to use a more + // consistent + // example in the test. + .nativeBucketsForPositiveValues( + NativeHistogramBuckets.builder() + .bucket(1, 12) + .bucket(2, 3) + .bucket(4, 2) + .build()) + .nativeBucketsForNegativeValues( + NativeHistogramBuckets.builder().bucket(-1, 1).bucket(0, 2).build()) + .labels(Labels.of("path", "/")) + .exemplars(Exemplars.of(exemplar1)) + .createdTimestampMillis(createdTimestamp) + .scrapeTimestampMillis(scrapeTimestamp) + .build()) + .dataPoint( + HistogramDataPointSnapshot.builder() + .count(3) + .sum(400.2) + .nativeSchema(5) + .classicHistogramBuckets( + ClassicHistogramBuckets.builder() + .bucket(128.0, 0) + .bucket(1024.0, 4) + .bucket(Double.POSITIVE_INFINITY, 2) + .build()) + .nativeBucketsForPositiveValues( + NativeHistogramBuckets.builder() + .bucket(-1, 1) + .bucket(3, 3) + .bucket(4, 2) + .build()) + .labels(Labels.of("path", "/api/v1")) + .exemplars(Exemplars.of(exemplar1)) + .createdTimestampMillis(createdTimestamp) + .scrapeTimestampMillis(scrapeTimestamp) + .build()) + .build(); + SnapshotTestUtil.assertMetadata( + snapshot, "request_size_bytes", "request sizes in bytes", "bytes"); + + assertThat(snapshot.getDataPoints()).hasSize(2); + HistogramDataPointSnapshot data = + snapshot + .getDataPoints() + .get(0); // data is sorted by labels, so the first one should be path="/" + assertThat(data.hasSum()).isTrue(); + assertThat(data.hasCount()).isTrue(); + assertThat(data.hasCreatedTimestamp()).isTrue(); + assertThat(data.hasScrapeTimestamp()).isTrue(); + assertThat(data.getCount()).isEqualTo(22); + assertThat(data.getSum()).isEqualTo(27000.0); + assertThat((Iterable) data.getLabels()).isEqualTo(Labels.of("path", "/")); + assertThat(data.getExemplars().get(128.0, 1024.0).getValue()).isEqualTo(exemplar1.getValue()); + assertThat(data.getCreatedTimestampMillis()).isEqualTo(createdTimestamp); + assertThat(data.getScrapeTimestampMillis()).isEqualTo(scrapeTimestamp); + // classic histogram 1 + int i = 0; + for (ClassicHistogramBucket bucket : data.getClassicBuckets()) { + switch (i++) { + case 0 -> { + assertThat(bucket.getUpperBound()).isEqualTo(128.0); + assertThat(bucket.getCount()).isEqualTo(7); + } + case 1 -> { + assertThat(bucket.getUpperBound()).isEqualTo(1024.0); + assertThat(bucket.getCount()).isEqualTo(15); + } + case 2 -> { + assertThat(bucket.getUpperBound()).isEqualTo(Double.POSITIVE_INFINITY); + assertThat(bucket.getCount()).isZero(); + } + } + } + assertThat(i).as("expecting 3 classic histogram buckets").isEqualTo(3); + // native histogram 1 + assertThat(data.getNativeSchema()).isEqualTo(5); + assertThat(data.getNativeZeroCount()).isEqualTo(2); + assertThat(data.getNativeZeroThreshold()).isCloseTo(0.0000001, offset(0.0000001)); + assertThat(data.getNativeBucketsForPositiveValues().size()).isEqualTo(3); + i = 0; + for (NativeHistogramBucket bucket : data.getNativeBucketsForPositiveValues()) { + switch (i++) { + case 0 -> { + assertThat(bucket.getBucketIndex()).isOne(); + assertThat(bucket.getCount()).isEqualTo(12); + } + case 1 -> { + assertThat(bucket.getBucketIndex()).isEqualTo(2); + assertThat(bucket.getCount()).isEqualTo(3); + } + case 2 -> { + assertThat(bucket.getBucketIndex()).isEqualTo(4); + assertThat(bucket.getCount()).isEqualTo(2); + } + } + } + assertThat(i).as("expecting 3 native buckets for positive values").isEqualTo(3); + i = 0; + assertThat(data.getNativeBucketsForNegativeValues().size()).isEqualTo(2); + for (NativeHistogramBucket bucket : data.getNativeBucketsForNegativeValues()) { + switch (i++) { + case 0 -> { + assertThat(bucket.getBucketIndex()).isEqualTo(-1); + assertThat(bucket.getCount()).isOne(); + } + case 1 -> { + assertThat(bucket.getBucketIndex()).isZero(); + assertThat(bucket.getCount()).isEqualTo(2); + } + } + } + assertThat(i).as("expecting 2 native buckets for positive values").isEqualTo(2); + // classic histogram 2 (it's ok that this is incomplete, because we covered it with the other + // tests) + data = snapshot.getDataPoints().get(1); + assertThat(data.getCount()).isEqualTo(6); + // native histogram 2 (it's ok that this is incomplete, because we covered it with the other + // tests) + assertThat(data.getNativeSchema()).isEqualTo(5); + assertThat(data.getNativeZeroCount()).isZero(); + assertThat(data.getNativeZeroThreshold()).isZero(); + } + + @Test + public void testEmptyHistogram() { + assertThat(HistogramSnapshot.builder().name("empty_histogram").build().getDataPoints()) + .isEmpty(); + HistogramSnapshot snapshot = + new HistogramSnapshot( + new MetricMetadata("empty_bytes", "help", Unit.BYTES), Collections.emptyList()); + assertThat(snapshot.getDataPoints()).isEmpty(); + assertThat(snapshot.isGaugeHistogram()).isFalse(); + } + + @Test + public void testMinimalClassicHistogram() { + HistogramSnapshot snapshot = + HistogramSnapshot.builder() + .name("minimal_histogram") + .dataPoint( + HistogramDataPointSnapshot.builder() + .classicHistogramBuckets( + ClassicHistogramBuckets.of( + new double[] {Double.POSITIVE_INFINITY}, new long[] {0})) + .build()) + .build(); + HistogramDataPointSnapshot data = snapshot.getDataPoints().get(0); + assertThat(data.hasSum()).isFalse(); + assertThat(snapshot.getDataPoints().get(0).getClassicBuckets().size()).isOne(); + } + + @Test + public void testMinimalNativeHistogram() { + HistogramSnapshot snapshot = + HistogramSnapshot.builder() + .name("hist") + .dataPoint(HistogramDataPointSnapshot.builder().nativeSchema(5).build()) + .build(); + assertThat(snapshot.getMetadata().getName()).isEqualTo("hist"); + assertThat(snapshot.getMetadata().hasUnit()).isFalse(); + assertThat(snapshot.getDataPoints().size()).isOne(); + HistogramDataPointSnapshot data = snapshot.getDataPoints().get(0); + assertThat(data.hasCreatedTimestamp()).isFalse(); + assertThat(data.hasScrapeTimestamp()).isFalse(); + assertThat(data.hasCount()).isTrue(); + assertThat(data.getCount()).isZero(); + assertThat(data.hasSum()).isFalse(); + assertThat(data.getNativeBucketsForNegativeValues().size()).isZero(); + assertThat(data.getNativeBucketsForPositiveValues().size()).isZero(); + } + + @Test + public void testClassicCount() { + HistogramSnapshot snapshot = + HistogramSnapshot.builder() + .name("test_histogram") + .dataPoint( + HistogramDataPointSnapshot.builder() + .classicHistogramBuckets( + ClassicHistogramBuckets.builder() + .bucket(1.0, 3) + .bucket(2.0, 2) + .bucket(Double.POSITIVE_INFINITY, 0) + .build()) + .build()) + .build(); + HistogramDataPointSnapshot data = snapshot.getDataPoints().get(0); + assertThat(data.hasSum()).isFalse(); + assertThat(data.hasCount()).isTrue(); + assertThat(data.getCount()).isEqualTo(5); + } + + @Test + public void testEmptyData() { + // This will fail because one of nativeSchema and classicHistogramBuckets is required + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> HistogramDataPointSnapshot.builder().build()); + } + + @Test + public void testEmptyNativeData() { + HistogramDataPointSnapshot data = HistogramDataPointSnapshot.builder().nativeSchema(5).build(); + assertThat(data.getNativeBucketsForNegativeValues().size()).isZero(); + assertThat(data.getNativeBucketsForPositiveValues().size()).isZero(); + } + + @Test + public void testDataImmutable() { + HistogramSnapshot snapshot = + HistogramSnapshot.builder() + .name("test_histogram") + .dataPoint( + HistogramDataPointSnapshot.builder() + .labels(Labels.of("a", "a")) + .classicHistogramBuckets( + ClassicHistogramBuckets.of( + new double[] {Double.POSITIVE_INFINITY}, new long[] {0})) + .build()) + .dataPoint( + HistogramDataPointSnapshot.builder() + .labels(Labels.of("a", "b")) + .classicHistogramBuckets( + ClassicHistogramBuckets.of( + new double[] {Double.POSITIVE_INFINITY}, new long[] {2})) + .build()) + .build(); + Iterator iterator = snapshot.getDataPoints().iterator(); + iterator.next(); + assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(iterator::remove); + } + + @Test + public void testEmptyClassicBuckets() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + new HistogramDataPointSnapshot( + ClassicHistogramBuckets.EMPTY, Double.NaN, Labels.EMPTY, Exemplars.EMPTY, 0L)); + } + + @Test + public void testMinimalNativeData() { + new HistogramDataPointSnapshot( + ClassicHistogramBuckets.EMPTY, + 0, + 0, + 0.0, + NativeHistogramBuckets.EMPTY, + NativeHistogramBuckets.EMPTY, + Double.NaN, + Labels.EMPTY, + Exemplars.EMPTY, + 0L); + } + + @Test + public void testMinimalClassicData() { + ClassicHistogramBuckets buckets = + ClassicHistogramBuckets.builder().bucket(Double.POSITIVE_INFINITY, 0).build(); + new HistogramDataPointSnapshot( + buckets, + HistogramSnapshot.CLASSIC_HISTOGRAM, + 0, + 0.0, + NativeHistogramBuckets.EMPTY, + NativeHistogramBuckets.EMPTY, + Double.NaN, + Labels.EMPTY, + Exemplars.EMPTY, + 0L); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/InfoSnapshotTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/InfoSnapshotTest.java new file mode 100644 index 000000000..983450181 --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/InfoSnapshotTest.java @@ -0,0 +1,73 @@ +package io.prometheus.metrics.model.snapshots; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import java.util.Iterator; +import org.junit.jupiter.api.Test; + +class InfoSnapshotTest { + + @Test + public void testCompleteGoodCase() { + InfoSnapshot snapshot = + InfoSnapshot.builder() + .name("target") + .help("Target info") + .dataPoint( + InfoSnapshot.InfoDataPointSnapshot.builder() + .labels(Labels.of("instance_id", "127.0.0.1:9100", "service_name", "gateway")) + .build()) + .build(); + assertThat(snapshot.getMetadata().getName()).isEqualTo("target"); + assertThat(snapshot.getMetadata().getHelp()).isEqualTo("Target info"); + assertThat(snapshot.getMetadata().hasUnit()).isFalse(); + assertThat(snapshot.getDataPoints().size()).isOne(); + } + + @Test + void create() { + InfoSnapshot.InfoDataPointSnapshot snapshot = + new InfoSnapshot.InfoDataPointSnapshot(Labels.EMPTY); + assertThat(snapshot.getScrapeTimestampMillis()).isZero(); + } + + @Test + public void testEmptyInfo() { + InfoSnapshot snapshot = InfoSnapshot.builder().name("target").build(); + assertThat(snapshot.getDataPoints()).isEmpty(); + } + + @Test + public void testDataImmutable() { + InfoSnapshot snapshot = + InfoSnapshot.builder() + .name("target") + .dataPoint( + InfoSnapshot.InfoDataPointSnapshot.builder() + .labels( + Labels.of("instance_id", "127.0.0.1:9100", "service_name", "gateway.v1")) + .build()) + .dataPoint( + InfoSnapshot.InfoDataPointSnapshot.builder() + .labels( + Labels.of("instance_id", "127.0.0.1:9200", "service_name", "gateway.v2")) + .build()) + .build(); + Iterator iterator = snapshot.getDataPoints().iterator(); + iterator.next(); + assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(iterator::remove); + } + + @Test + public void testNameMustNotIncludeSuffix() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> InfoSnapshot.builder().name("jvm_info").build()); + } + + @Test + public void testNameMustNotIncludeSuffixDot() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> InfoSnapshot.builder().name("jvm.info").build()); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/LabelTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/LabelTest.java new file mode 100644 index 000000000..386f29f15 --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/LabelTest.java @@ -0,0 +1,32 @@ +package io.prometheus.metrics.model.snapshots; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.jupiter.api.Test; + +class LabelTest { + + private static final Label LABEL = new Label("name", "value"); + private static final Label SAME = new Label("name", "value"); + private static final Label LABEL2 = new Label("name", "value2"); + + @Test + void compareTo() { + assertThat(LABEL).isEqualByComparingTo(SAME).isLessThan(LABEL2); + } + + @Test + void testToString() { + assertThat(LABEL).hasToString("Label{name='name', value='value'}"); + } + + @Test + void testEquals() { + assertThat(LABEL).isEqualTo(SAME).isNotEqualTo(LABEL2); + } + + @Test + void testHashCode() { + assertThat(LABEL).hasSameHashCodeAs(SAME).doesNotHaveSameHashCodeAs(LABEL2); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/LabelsTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/LabelsTest.java new file mode 100644 index 000000000..5bdd285e3 --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/LabelsTest.java @@ -0,0 +1,132 @@ +package io.prometheus.metrics.model.snapshots; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import org.assertj.core.api.IterableAssert; +import org.junit.jupiter.api.Test; + +class LabelsTest { + + private > void assertLessThan(T a, T b) { + assertThat(a).isLessThan(b); + } + + private > void assertGreaterThan(T a, T b) { + assertThat(a).isGreaterThan(b); + } + + @Test + public void testCompareDifferentLabelNames() { + Labels labels1 = Labels.of("env", "prod", "status2", "200"); + Labels labels2 = Labels.of("env", "prod", "status1", "200"); + assertGreaterThan(labels1, labels2); + assertLessThan(labels2, labels1); + assertLabels(labels2).isNotEqualTo(labels1); + assertLabels(labels1).isNotEqualTo(labels2); + } + + private static IterableAssert assertLabels(Labels labels) { + return assertThat((Iterable) labels); + } + + @Test + public void testCompareSameLabelNames() { + // If all label names are the same, labels should be sorted by label value. + Labels labels1 = Labels.of("env", "prod", "status", "200"); + Labels labels2 = Labels.of("env", "prod", "status", "500"); + assertLessThan(labels1, labels2); + assertGreaterThan(labels2, labels1); + assertLabels(labels2).isNotEqualTo(labels1); + assertLabels(labels1).isNotEqualTo(labels2); + } + + @Test + public void testCompareDifferentNumberOfLabels() { + Labels labels1 = Labels.of("env", "prod", "status", "200"); + Labels labels2 = Labels.of("env", "prod", "status", "200", "x_code", "none"); + assertLessThan(labels1, labels2); + assertGreaterThan(labels2, labels1); + assertLabels(labels2).isNotEqualTo(labels1); + assertLabels(labels1).isNotEqualTo(labels2); + } + + @Test + public void testComparePrometheusNames() { + Labels labels1 = Labels.of("my_a", "val"); + Labels labels2 = Labels.of("my.b", "val"); + assertLessThan(labels1, labels2); // this is true because it compares "my_a" to "my_b". + } + + @Test + public void testEqualsHashcodeDots() { + Labels labels1 = Labels.of("my_a", "val"); + Labels labels2 = Labels.of("my.a", "val"); + assertLabels(labels2).isEqualTo(labels1).hasSameHashCodeAs(labels1); + } + + @SuppressWarnings({"unchecked", "rawtypes"}) + @Test + public void testCompareEquals() { + Labels labels1 = Labels.of("env", "prod", "status", "200"); + Labels labels2 = Labels.of("env", "prod", "status", "200"); + assertThat((Comparable) labels1).isEqualByComparingTo(labels2); + assertThat((Comparable) labels2).isEqualByComparingTo(labels1); + assertLabels(labels2).isEqualTo(labels1); + assertLabels(labels1).isEqualTo(labels2); + } + + @Test + public void testReservedLabelName() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> Labels.of("__name__", "requests_total")); + } + + @Test + public void testDuplicateLabelName() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> Labels.of("name1", "value1", "name2", "value2", "name1", "value3")); + } + + @Test + public void testMakePrometheusNames() { + String[] names = new String[] {}; + String[] prometheusNames = Labels.makePrometheusNames(names); + assertThat(prometheusNames).isSameAs(names); + + names = new String[] {"no_dots", "at_all"}; + prometheusNames = Labels.makePrometheusNames(names); + assertThat(prometheusNames).isSameAs(names); + + names = new String[] {"dots", "here.it.is"}; + prometheusNames = Labels.makePrometheusNames(names); + assertThat(prometheusNames).isNotSameAs(names); + assertThat(prometheusNames[0]).isSameAs(names[0]); + assertThat(names[1]).isEqualTo("here.it.is"); + assertThat(prometheusNames[1]).isEqualTo("here_it_is"); + } + + @Test + public void testMerge() { + Labels labels1 = Labels.of("key.1", "value 1", "key.3", "value 3"); + Labels labels2 = Labels.of("key_2", "value 2"); + Labels merged = labels2.merge(labels1); + assertThat(merged.getName(0)).isEqualTo("key.1"); + assertThat(merged.getName(1)).isEqualTo("key_2"); + assertThat(merged.getName(2)).isEqualTo("key.3"); + } + + @Test + public void testMergeDuplicateName() { + Labels labels1 = Labels.of("key_one", "v1"); + Labels labels2 = Labels.of("key.one", "v2"); + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> labels2.merge(labels1)); + } + + @Test + public void testDuplicateName() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> Labels.of("key_one", "v1", "key.one", "v2")); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/MetricMetadataTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/MetricMetadataTest.java new file mode 100644 index 000000000..f2d6a6ba4 --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/MetricMetadataTest.java @@ -0,0 +1,75 @@ +package io.prometheus.metrics.model.snapshots; + +import static io.prometheus.metrics.model.snapshots.PrometheusNaming.sanitizeMetricName; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import org.junit.jupiter.api.Test; + +class MetricMetadataTest { + + @Test + public void testEmptyName() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> new MetricMetadata("")); + } + + @Test + public void testNullName() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> new MetricMetadata(null)); + } + + @Test + public void testSanitizationIllegalCharacters() { + MetricMetadata metadata = + new MetricMetadata( + sanitizeMetricName("my_namespace/http.server.duration", Unit.SECONDS), + "help string", + Unit.SECONDS); + assertThat(metadata.getName()).isEqualTo("my_namespace/http.server.duration_seconds"); + assertThat(metadata.getPrometheusName()).isEqualTo("my_namespace_http_server_duration_seconds"); + assertThat(metadata.getHelp()).isEqualTo("help string"); + assertThat(metadata.getUnit()).hasToString("seconds"); + } + + @Test + public void testSanitizationCounter() { + MetricMetadata metadata = new MetricMetadata(sanitizeMetricName("my_events_total")); + assertThat(metadata.getName()).isEqualTo("my_events"); + } + + @Test + public void testSanitizationInfo() { + MetricMetadata metadata = new MetricMetadata(sanitizeMetricName("target_info")); + assertThat(metadata.getName()).isEqualTo("target"); + } + + @Test + public void testSanitizationWeirdCornerCase() { + MetricMetadata metadata = new MetricMetadata(sanitizeMetricName("_total_created")); + assertThat(metadata.getName()).isEqualTo("total"); + } + + @Test + public void testSanitizeEmptyString() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> sanitizeMetricName("")); + } + + @Test + public void testUnitSuffixRequired() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> new MetricMetadata("my_counter", "help", Unit.SECONDS)); + } + + @Test + public void testUnitSuffixAdded() { + new MetricMetadata(sanitizeMetricName("my_counter", Unit.SECONDS), "help", Unit.SECONDS); + } + + @Test + public void testUnitNotDuplicated() { + assertThat(sanitizeMetricName("my_counter_bytes", Unit.BYTES)).isEqualTo("my_counter_bytes"); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/MetricSnapshotTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/MetricSnapshotTest.java new file mode 100644 index 000000000..2c1c04bb6 --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/MetricSnapshotTest.java @@ -0,0 +1,52 @@ +package io.prometheus.metrics.model.snapshots; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import org.junit.jupiter.api.Test; + +class MetricSnapshotTest { + + @Test + public void testDuplicateLabels() { + assertThatExceptionOfType(DuplicateLabelsException.class) + .isThrownBy( + () -> + CounterSnapshot.builder() + .name("events") + .dataPoint( + CounterSnapshot.CounterDataPointSnapshot.builder() + .labels(Labels.of("path", "/hello", "status", "200")) + .value(1.0) + .build()) + .dataPoint( + CounterSnapshot.CounterDataPointSnapshot.builder() + .labels(Labels.of("path", "/world", "status", "200")) + .value(2.0) + .build()) + .dataPoint( + CounterSnapshot.CounterDataPointSnapshot.builder() + .labels(Labels.of("status", "200", "path", "/hello")) + .value(3.0) + .build()) + .build()) + .satisfies( + e -> { + assertThat(e.getMetadata().getName()).isEqualTo("events"); + assertThat((Iterable) e.getLabels()) + .isEqualTo(Labels.of("path", "/hello", "status", "200")); + }); + } + + @Test + public void testNoData() { + MetricSnapshot snapshot = CounterSnapshot.builder().name("test").build(); + assertThat(snapshot.getDataPoints().size()).isEqualTo(0); + } + + @Test + public void testNullData() { + assertThatExceptionOfType(NullPointerException.class) + .isThrownBy(() -> new CounterSnapshot(new MetricMetadata("test"), null)); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/MetricSnapshotsTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/MetricSnapshotsTest.java new file mode 100644 index 000000000..04a824f02 --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/MetricSnapshotsTest.java @@ -0,0 +1,99 @@ +package io.prometheus.metrics.model.snapshots; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import java.util.Iterator; +import org.junit.jupiter.api.Test; + +class MetricSnapshotsTest { + + @Test + public void testEmpty() { + MetricSnapshots snapshots = MetricSnapshots.builder().build(); + assertThat(snapshots.stream().findAny()).isNotPresent(); + } + + @Test + public void testSort() { + CounterSnapshot c1 = + CounterSnapshot.builder() + .name("counter1") + .dataPoint(CounterSnapshot.CounterDataPointSnapshot.builder().value(1.0).build()) + .build(); + CounterSnapshot c2 = + CounterSnapshot.builder() + .name("counter2") + .dataPoint(CounterSnapshot.CounterDataPointSnapshot.builder().value(1.0).build()) + .build(); + CounterSnapshot c3 = + CounterSnapshot.builder() + .name("counter3") + .dataPoint(CounterSnapshot.CounterDataPointSnapshot.builder().value(1.0).build()) + .build(); + MetricSnapshots snapshots = new MetricSnapshots(c2, c3, c1); + assertThat(snapshots.size()).isEqualTo(3); + assertThat(snapshots.get(0).getMetadata().getName()).isEqualTo("counter1"); + assertThat(snapshots.get(1).getMetadata().getName()).isEqualTo("counter2"); + assertThat(snapshots.get(2).getMetadata().getName()).isEqualTo("counter3"); + } + + @Test + public void testDuplicateName() { + // Q: What if you have a counter named "foo" and a gauge named "foo"? + // A: Great question. You might think this is a valid scenario, because the counter will produce + // the values "foo_total" and "foo_created" while the gauge will produce the value "foo". + // So from that perspective there is no conflict. However, the name for HELP, TYPE, UNIT is + // the same, + // and that is the conflict. Therefore, you cannot have a counter named "foo" and a gauge + // named "foo". + CounterSnapshot c = + CounterSnapshot.builder() + .name("my_metric") + .dataPoint(CounterSnapshot.CounterDataPointSnapshot.builder().value(1.0).build()) + .build(); + GaugeSnapshot g = + GaugeSnapshot.builder() + .name("my_metric") + .dataPoint(GaugeSnapshot.GaugeDataPointSnapshot.builder().value(1.0).build()) + .build(); + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> new MetricSnapshots(c, g)); + } + + @Test + public void testBuilder() { + CounterSnapshot counter = + CounterSnapshot.builder() + .name("my_metric") + .dataPoint(CounterSnapshot.CounterDataPointSnapshot.builder().value(1.0).build()) + .build(); + MetricSnapshots.Builder builder = MetricSnapshots.builder(); + assertThat(builder.containsMetricName("my_metric")).isFalse(); + builder.metricSnapshot(counter); + assertThat(builder.containsMetricName("my_metric")).isTrue(); + } + + @Test + public void testImmutable() { + CounterSnapshot c1 = + CounterSnapshot.builder() + .name("counter1") + .dataPoint(CounterSnapshot.CounterDataPointSnapshot.builder().value(1.0).build()) + .build(); + CounterSnapshot c2 = + CounterSnapshot.builder() + .name("counter2") + .dataPoint(CounterSnapshot.CounterDataPointSnapshot.builder().value(1.0).build()) + .build(); + CounterSnapshot c3 = + CounterSnapshot.builder() + .name("counter3") + .dataPoint(CounterSnapshot.CounterDataPointSnapshot.builder().value(1.0).build()) + .build(); + MetricSnapshots snapshots = new MetricSnapshots(c2, c3, c1); + Iterator iterator = snapshots.iterator(); + iterator.next(); + assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(iterator::remove); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/NativeHistogramBucketsTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/NativeHistogramBucketsTest.java new file mode 100644 index 000000000..32c7f3eb3 --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/NativeHistogramBucketsTest.java @@ -0,0 +1,57 @@ +package io.prometheus.metrics.model.snapshots; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import java.util.Iterator; +import org.junit.jupiter.api.Test; + +class NativeHistogramBucketsTest { + + @Test + public void testGoodCase() { + NativeHistogramBuckets buckets = + NativeHistogramBuckets.builder().bucket(-10, 12).bucket(120, 17).build(); + assertThat(buckets.size()).isEqualTo(2); + assertThat(buckets.getBucketIndex(0)).isEqualTo(-10); + assertThat(buckets.getCount(0)).isEqualTo(12); + assertThat(buckets.getBucketIndex(1)).isEqualTo(120); + assertThat(buckets.getCount(1)).isEqualTo(17); + } + + @Test + public void testEmpty() { + NativeHistogramBuckets buckets = NativeHistogramBuckets.builder().build(); + assertThat(buckets.size()).isZero(); + } + + @Test + public void testSort() { + NativeHistogramBuckets buckets = + NativeHistogramBuckets.builder().bucket(7, 4).bucket(2, 0).bucket(5, 3).build(); + assertThat(buckets.size()).isEqualTo(3); + assertThat(buckets.getBucketIndex(0)).isEqualTo(2); + assertThat(buckets.getBucketIndex(1)).isEqualTo(5); + assertThat(buckets.getBucketIndex(2)).isEqualTo(7); + assertThat(buckets.getCount(0)).isZero(); + assertThat(buckets.getCount(1)).isEqualTo(3); + assertThat(buckets.getCount(2)).isEqualTo(4); + } + + @Test + public void testDifferentLength() { + int[] bucketIndexes = new int[] {0, 1, 2}; + long[] cumulativeCounts = new long[] {13, 178, 1024, 3000}; + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> NativeHistogramBuckets.of(bucketIndexes, cumulativeCounts)); + } + + @Test + public void testImmutable() { + NativeHistogramBuckets buckets = + NativeHistogramBuckets.builder().bucket(1, 1).bucket(2, 1).build(); + Iterator iterator = buckets.iterator(); + iterator.next(); + assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(iterator::remove); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/PrometheusNamingTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/PrometheusNamingTest.java new file mode 100644 index 000000000..40c1f1bde --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/PrometheusNamingTest.java @@ -0,0 +1,200 @@ +package io.prometheus.metrics.model.snapshots; + +import static io.prometheus.metrics.model.snapshots.PrometheusNaming.escapeName; +import static io.prometheus.metrics.model.snapshots.PrometheusNaming.isValidLabelName; +import static io.prometheus.metrics.model.snapshots.PrometheusNaming.prometheusName; +import static io.prometheus.metrics.model.snapshots.PrometheusNaming.sanitizeLabelName; +import static io.prometheus.metrics.model.snapshots.PrometheusNaming.sanitizeMetricName; +import static io.prometheus.metrics.model.snapshots.PrometheusNaming.sanitizeUnitName; +import static io.prometheus.metrics.model.snapshots.PrometheusNaming.validateMetricName; +import static io.prometheus.metrics.model.snapshots.PrometheusNaming.validateUnitName; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import io.prometheus.metrics.config.EscapingScheme; +import java.util.stream.Stream; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class PrometheusNamingTest { + + @Test + public void testSanitizeMetricName() { + assertThat(sanitizeMetricName("my_counter_total")).isEqualTo("my_counter"); + assertThat(sanitizeMetricName("jvm.info")).isEqualTo("jvm"); + assertThat(sanitizeMetricName("jvm_info")).isEqualTo("jvm"); + assertThat(sanitizeMetricName("jvm.info")).isEqualTo("jvm"); + assertThat(sanitizeMetricName("a.b")).isEqualTo("a.b"); + assertThat(sanitizeMetricName("_total")).isEqualTo("total"); + assertThat(sanitizeMetricName("total")).isEqualTo("total"); + } + + @Test + public void testSanitizeMetricNameWithUnit() { + assertThat(prometheusName(sanitizeMetricName("def", Unit.RATIO))) + .isEqualTo("def_" + Unit.RATIO); + assertThat(prometheusName(sanitizeMetricName("my_counter_total", Unit.RATIO))) + .isEqualTo("my_counter_" + Unit.RATIO); + assertThat(sanitizeMetricName("jvm.info", Unit.RATIO)).isEqualTo("jvm_" + Unit.RATIO); + assertThat(sanitizeMetricName("_total", Unit.RATIO)).isEqualTo("total_" + Unit.RATIO); + assertThat(sanitizeMetricName("total", Unit.RATIO)).isEqualTo("total_" + Unit.RATIO); + } + + @Test + public void testSanitizeLabelName() { + assertThat(prometheusName(sanitizeLabelName("0abc.def"))).isEqualTo("_abc_def"); + assertThat(prometheusName(sanitizeLabelName("_abc"))).isEqualTo("_abc"); + assertThat(prometheusName(sanitizeLabelName("__abc"))).isEqualTo("_abc"); + assertThat(prometheusName(sanitizeLabelName("___abc"))).isEqualTo("_abc"); + assertThat(prometheusName(sanitizeLabelName("_.abc"))).isEqualTo("_abc"); + assertThat(sanitizeLabelName("abc.def")).isEqualTo("abc.def"); + assertThat(sanitizeLabelName("abc.def2")).isEqualTo("abc.def2"); + } + + @Test + public void testValidateUnitName() { + assertThat(validateUnitName("secondstotal")).isNotNull(); + assertThat(validateUnitName("total")).isNotNull(); + assertThat(validateUnitName("seconds_total")).isNotNull(); + assertThat(validateUnitName("_total")).isNotNull(); + assertThat(validateUnitName("")).isNotNull(); + + assertThat(validateUnitName("seconds")).isNull(); + assertThat(validateUnitName("2")).isNull(); + } + + @Test + public void testSanitizeUnitName() { + assertThat(sanitizeUnitName("seconds")).isEqualTo("seconds"); + assertThat(sanitizeUnitName("seconds_total")).isEqualTo("seconds"); + assertThat(sanitizeUnitName("seconds_total_total")).isEqualTo("seconds"); + assertThat(sanitizeUnitName("m/s")).isEqualTo("m_s"); + assertThat(sanitizeUnitName("secondstotal")).isEqualTo("seconds"); + assertThat(sanitizeUnitName("2")).isEqualTo("2"); + } + + @Test + public void testInvalidUnitName1() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> sanitizeUnitName("total")); + } + + @Test + public void testInvalidUnitName2() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> sanitizeUnitName("_total")); + } + + @Test + public void testInvalidUnitName3() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> sanitizeUnitName("%")); + } + + @Test + public void testEmptyUnitName() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> sanitizeUnitName("")); + } + + @ParameterizedTest + @MethodSource("nameIsValid") + public void testLabelNameIsValidUtf8(String labelName, boolean utf8Valid) { + assertMetricName(labelName, utf8Valid); + assertLabelName(labelName, utf8Valid); + } + + private static void assertLabelName(String labelName, boolean legacyValid) { + assertThat(isValidLabelName(labelName)) + .describedAs("isValidLabelName(%s)", labelName) + .isEqualTo(legacyValid); + } + + private static void assertMetricName(String labelName, boolean valid) { + assertThat(validateMetricName(labelName)) + .describedAs("validateMetricName(%s)", labelName) + .isEqualTo(valid ? null : "The metric name contains unsupported characters"); + } + + static Stream nameIsValid() { + return Stream.of( + Arguments.of("", false), + Arguments.of("Avalid_23name", true), + Arguments.of("_Avalid_23name", true), + Arguments.of("1valid_23name", true), + Arguments.of("avalid_23name", true), + Arguments.of("Ava:lid_23name", true), + Arguments.of("a lid_23name", true), + Arguments.of(":leading_colon", true), + Arguments.of("colon:in:the:middle", true), + Arguments.of("aΩz", true), + Arguments.of("a\ud800z", false)); + } + + @ParameterizedTest + @MethodSource("escapeNameLegacyTestCases") + public void testEscapeName(String input, EscapingScheme escapingScheme, String expected) { + assertThat(escapeName(input, escapingScheme)).isEqualTo(expected); + } + + static Stream escapeNameLegacyTestCases() { + return Stream.of( + Arguments.of("", EscapingScheme.UNDERSCORE_ESCAPING, ""), + Arguments.of("", EscapingScheme.DOTS_ESCAPING, ""), + Arguments.of("", EscapingScheme.VALUE_ENCODING_ESCAPING, ""), + Arguments.of( + "no:escaping_required", EscapingScheme.UNDERSCORE_ESCAPING, "no:escaping_required"), + // Dots escaping will escape underscores even though it's not strictly + // necessary for compatibility. + Arguments.of("no:escaping_required", EscapingScheme.DOTS_ESCAPING, "no:escaping__required"), + Arguments.of( + "no:escaping_required", EscapingScheme.VALUE_ENCODING_ESCAPING, "no:escaping_required"), + Arguments.of( + "no:escaping_required", EscapingScheme.UNDERSCORE_ESCAPING, "no:escaping_required"), + Arguments.of( + "mysystem.prod.west.cpu.load", + EscapingScheme.DOTS_ESCAPING, + "mysystem_dot_prod_dot_west_dot_cpu_dot_load"), + Arguments.of( + "mysystem.prod.west.cpu.load_total", + EscapingScheme.DOTS_ESCAPING, + "mysystem_dot_prod_dot_west_dot_cpu_dot_load__total"), + Arguments.of("http.status:sum", EscapingScheme.DOTS_ESCAPING, "http_dot_status:sum"), + Arguments.of("label with 😱", EscapingScheme.UNDERSCORE_ESCAPING, "label_with__"), + Arguments.of("label with 😱", EscapingScheme.DOTS_ESCAPING, "label__with____"), + Arguments.of( + "label with 😱", EscapingScheme.VALUE_ENCODING_ESCAPING, "U__label_20_with_20__1f631_"), + // name with unicode characters > 0x100 + Arguments.of("花火", EscapingScheme.UNDERSCORE_ESCAPING, "__"), + // Dots-replacement does not know the difference between two replaced + Arguments.of("花火", EscapingScheme.DOTS_ESCAPING, "____"), + Arguments.of("花火", EscapingScheme.VALUE_ENCODING_ESCAPING, "U___82b1__706b_"), + // name with spaces and edge-case value + Arguments.of("label with Ā", EscapingScheme.UNDERSCORE_ESCAPING, "label_with__"), + Arguments.of("label with Ā", EscapingScheme.DOTS_ESCAPING, "label__with____"), + Arguments.of( + "label with Ā", EscapingScheme.VALUE_ENCODING_ESCAPING, "U__label_20_with_20__100_"), + // name with dots - needs UTF-8 validation for escaping to occur + Arguments.of( + "mysystem.prod.west.cpu.load", + EscapingScheme.UNDERSCORE_ESCAPING, + "mysystem_prod_west_cpu_load"), + Arguments.of( + "mysystem.prod.west.cpu.load", + EscapingScheme.VALUE_ENCODING_ESCAPING, + "U__mysystem_2e_prod_2e_west_2e_cpu_2e_load"), + Arguments.of( + "mysystem.prod.west.cpu.load_total", + EscapingScheme.UNDERSCORE_ESCAPING, + "mysystem_prod_west_cpu_load_total"), + Arguments.of( + "mysystem.prod.west.cpu.load_total", + EscapingScheme.VALUE_ENCODING_ESCAPING, + "U__mysystem_2e_prod_2e_west_2e_cpu_2e_load__total"), + Arguments.of("http.status:sum", EscapingScheme.UNDERSCORE_ESCAPING, "http_status:sum"), + Arguments.of( + "http.status:sum", EscapingScheme.VALUE_ENCODING_ESCAPING, "U__http_2e_status:sum")); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/QuantilesTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/QuantilesTest.java new file mode 100644 index 000000000..8703657ca --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/QuantilesTest.java @@ -0,0 +1,49 @@ +package io.prometheus.metrics.model.snapshots; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import java.util.Iterator; +import org.junit.jupiter.api.Test; + +class QuantilesTest { + + @Test + public void testSort() { + Quantiles quantiles = + Quantiles.builder().quantile(0.99, 0.23).quantile(0.5, 0.2).quantile(0.95, 0.22).build(); + assertThat(quantiles.size()).isEqualTo(3); + assertThat(quantiles.get(0).getQuantile()).isEqualTo(0.5); + assertThat(quantiles.get(0).getValue()).isEqualTo(0.2); + assertThat(quantiles.get(1).getQuantile()).isEqualTo(0.95); + assertThat(quantiles.get(1).getValue()).isEqualTo(0.22); + assertThat(quantiles.get(2).getQuantile()).isEqualTo(0.99); + assertThat(quantiles.get(2).getValue()).isEqualTo(0.23); + } + + @Test + public void testImmutable() { + Quantiles quantiles = + Quantiles.builder().quantile(0.99, 0.23).quantile(0.5, 0.2).quantile(0.95, 0.22).build(); + Iterator iterator = quantiles.iterator(); + iterator.next(); + assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(iterator::remove); + } + + @Test + public void testEmpty() { + assertThat(Quantiles.EMPTY.size()).isZero(); + } + + @Test + public void testDuplicate() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + Quantiles.builder() + .quantile(0.95, 0.23) + .quantile(0.5, 0.2) + .quantile(0.95, 0.22) + .build()); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/SnapshotEscaperTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/SnapshotEscaperTest.java new file mode 100644 index 000000000..f84024e95 --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/SnapshotEscaperTest.java @@ -0,0 +1,220 @@ +package io.prometheus.metrics.model.snapshots; + +import static io.prometheus.metrics.model.snapshots.SnapshotEscaper.escapeMetricSnapshot; +import static io.prometheus.metrics.model.snapshots.SnapshotEscaper.getSnapshotLabelName; +import static org.assertj.core.api.Assertions.assertThat; + +import io.prometheus.metrics.config.EscapingScheme; +import java.util.Objects; +import java.util.stream.Stream; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class SnapshotEscaperTest { + + @Test + public void testEscapeMetricSnapshotEmpty() { + MetricSnapshot original = CounterSnapshot.builder().name("empty").build(); + MetricSnapshot got = escapeMetricSnapshot(original, EscapingScheme.VALUE_ENCODING_ESCAPING); + assertThat(Objects.requireNonNull(got).getMetadata().getName()).isEqualTo("empty"); + assertThat(original.getMetadata().getName()).isEqualTo("empty"); + } + + @Test + public void testEscapeMetricSnapshotSimpleNoEscapingNeeded() { + testEscapeMetricSnapshot( + "my_metric", + "some_label", + "labelvalue", + "my_metric", + "some_label", + "labelvalue", + EscapingScheme.VALUE_ENCODING_ESCAPING, + CounterSnapshot.class); + } + + @Test + public void testEscapeMetricSnapshotLabelNameEscapingNeeded() { + testEscapeMetricSnapshot( + "my_metric", + "some.label", + "labelvalue", + "my_metric", + "U__some_2e_label", + "labelvalue", + EscapingScheme.VALUE_ENCODING_ESCAPING, + CounterSnapshot.class); + } + + @Test + public void testEscapeMetricSnapshotCounterEscapingNeeded() { + testEscapeMetricSnapshot( + "my.metric", + "some?label", + "label??value", + "U__my_2e_metric", + "U__some_3f_label", + "label??value", + EscapingScheme.VALUE_ENCODING_ESCAPING, + CounterSnapshot.class); + } + + @Test + public void testEscapeMetricSnapshotGaugeEscapingNeeded() { + testEscapeMetricSnapshot( + "unicode.and.dots.花火", + "some_label", + "label??value", + "unicode_dot_and_dot_dots_dot_____", + "some__label", + "label??value", + EscapingScheme.DOTS_ESCAPING, + GaugeSnapshot.class); + } + + private void testEscapeMetricSnapshot( + String name, + String labelName, + String labelValue, + String expectedName, + String expectedLabelName, + String expectedLabelValue, + EscapingScheme escapingScheme, + Class snapshotType) { + + MetricSnapshot original = createTestSnapshot(name, labelName, labelValue, snapshotType); + MetricSnapshot got = escapeMetricSnapshot(original, escapingScheme); + + assertThat(got.getMetadata().getName()).isEqualTo(expectedName); + assertThat(got.getMetadata().getHelp()).isEqualTo("some help text"); + assertThat(got.getDataPoints()).hasSize(1); + + DataPointSnapshot escapedData = got.getDataPoints().get(0); + assertThat((Iterable) escapedData.getLabels()) + .isEqualTo(Labels.builder().label(expectedLabelName, expectedLabelValue).build()); + + assertThat(original.getMetadata().getName()).isEqualTo(name); + assertThat(original.getMetadata().getHelp()).isEqualTo("some help text"); + assertThat(original.getDataPoints()).hasSize(1); + + DataPointSnapshot originalData = original.getDataPoints().get(0); + assertThat((Iterable) originalData.getLabels()) + .isEqualTo(Labels.builder().label(labelName, labelValue).build()); + } + + private MetricSnapshot createTestSnapshot( + String name, + String labelName, + String labelValue, + Class snapshotType) { + Labels labels = Labels.builder().label(labelName, labelValue).build(); + + if (snapshotType.equals(CounterSnapshot.class)) { + return CounterSnapshot.builder() + .name(name) + .help("some help text") + .dataPoint( + CounterSnapshot.CounterDataPointSnapshot.builder().value(34.2).labels(labels).build()) + .build(); + } else if (snapshotType.equals(GaugeSnapshot.class)) { + return GaugeSnapshot.builder() + .name(name) + .help("some help text") + .dataPoint( + GaugeSnapshot.GaugeDataPointSnapshot.builder().value(34.2).labels(labels).build()) + .build(); + } + + throw new IllegalArgumentException("Unsupported snapshot type: " + snapshotType); + } + + @ParameterizedTest + @MethodSource("emptySnapshots") + void escape(MetricSnapshot original) { + assertThat(original) + .isSameAs(escapeMetricSnapshot(original, EscapingScheme.ALLOW_UTF8)) + .isSameAs(escapeMetricSnapshot(original, EscapingScheme.UNDERSCORE_ESCAPING)); + assertThat(escapeMetricSnapshot(original, EscapingScheme.VALUE_ENCODING_ESCAPING)) + .usingRecursiveComparison() + .isEqualTo(original); + } + + @Test + void escapeNull() { + assertThat(escapeMetricSnapshot(null, EscapingScheme.ALLOW_UTF8)).isNull(); + } + + public static Stream emptySnapshots() { + return Stream.of( + Arguments.of( + CounterSnapshot.builder() + .name("empty") + .dataPoint(CounterSnapshot.CounterDataPointSnapshot.builder().value(0).build()) + .build()), + Arguments.of( + GaugeSnapshot.builder() + .name("empty") + .dataPoint(GaugeSnapshot.GaugeDataPointSnapshot.builder().value(0).build()) + .build()), + Arguments.of( + SummarySnapshot.builder() + .name("empty") + .dataPoint( + SummarySnapshot.SummaryDataPointSnapshot.builder().count(0).sum(0.0).build()) + .build()), + Arguments.of( + HistogramSnapshot.builder() + .name("empty") + .dataPoint( + HistogramSnapshot.HistogramDataPointSnapshot.builder() + .count(0) + .sum(0.0) + .classicHistogramBuckets( + ClassicHistogramBuckets.builder() + .bucket(0.0, 0) + .bucket(1.0, 0) + .bucket(2.0, 0) + .bucket(Double.POSITIVE_INFINITY, 0) + .build()) + .exemplars( + Exemplars.builder() + .exemplar( + Exemplar.builder() + .labels(Labels.of("exemplar_label", "exemplar_value")) + .value(0.0) + .build()) + .build()) + .build()) + .build()), + Arguments.of( + StateSetSnapshot.builder() + .name("empty") + .dataPoint( + StateSetSnapshot.StateSetDataPointSnapshot.builder().state("foo", true).build()) + .build()), + Arguments.of( + UnknownSnapshot.builder() + .name("empty") + .dataPoint(UnknownSnapshot.UnknownDataPointSnapshot.builder().value(1.0).build()) + .build())); + } + + @Test + void metadataName() { + MetricMetadata metadata = new MetricMetadata("test."); + assertThat(SnapshotEscaper.getMetadataName(metadata, EscapingScheme.ALLOW_UTF8)) + .isEqualTo("test."); + assertThat(SnapshotEscaper.getMetadataName(metadata, EscapingScheme.UNDERSCORE_ESCAPING)) + .isEqualTo("test_"); + } + + @Test + void snapshotLabelName() { + Labels labels = Labels.builder().label("test.", "value").build(); + assertThat(getSnapshotLabelName(labels, 0, EscapingScheme.ALLOW_UTF8)).isEqualTo("test."); + assertThat(getSnapshotLabelName(labels, 0, EscapingScheme.UNDERSCORE_ESCAPING)) + .isEqualTo("test_"); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/SnapshotTestUtil.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/SnapshotTestUtil.java new file mode 100644 index 000000000..d8e8d33e4 --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/SnapshotTestUtil.java @@ -0,0 +1,17 @@ +package io.prometheus.metrics.model.snapshots; + +import static org.assertj.core.api.Assertions.assertThat; + +class SnapshotTestUtil { + + public static void assertMetadata( + MetricSnapshot snapshot, String name, String help, String unit) { + assertThat(snapshot.getMetadata().getName()).isEqualTo(name); + assertThat(snapshot.getMetadata().getHelp()).isEqualTo(help); + if (unit != null) { + assertThat(snapshot.getMetadata().getUnit()).hasToString(unit); + } else { + assertThat(snapshot.getMetadata().getUnit()).isNull(); + } + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/StateSetSnapshotTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/StateSetSnapshotTest.java new file mode 100644 index 000000000..05e102b9d --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/StateSetSnapshotTest.java @@ -0,0 +1,170 @@ +package io.prometheus.metrics.model.snapshots; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import java.util.Iterator; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; + +class StateSetSnapshotTest { + + @Test + public void testCompleteGoodCase() { + long scrapeTimestamp = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(1); + StateSetSnapshot snapshot = + StateSetSnapshot.builder() + .name("my_feature_flags") + .help("Feature Flags") + .dataPoint( + StateSetSnapshot.StateSetDataPointSnapshot.builder() + .labels(Labels.of("entity", "controller")) + .scrapeTimestampMillis(scrapeTimestamp) + .state("feature1", true) + .state("feature2", false) + .build()) + .dataPoint( + StateSetSnapshot.StateSetDataPointSnapshot.builder() + .labels(Labels.of("entity", "api")) + .state("feature1", false) + .state("feature2", false) + .build()) + .build(); + SnapshotTestUtil.assertMetadata(snapshot, "my_feature_flags", "Feature Flags", null); + assertThat(snapshot.getDataPoints()).hasSize(2); + StateSetSnapshot.StateSetDataPointSnapshot data = + snapshot + .getDataPoints() + .get(1); // data is sorted by labels, so the second one should be entity="controller" + assertThat((Iterable) data.getLabels()) + .isEqualTo(Labels.of("entity", "controller")); + assertThat(data.size()).isEqualTo(2); + assertThat(data.getName(0)).isEqualTo("feature1"); + assertThat(data.isTrue(0)).isTrue(); + assertThat(data.getName(1)).isEqualTo("feature2"); + assertThat(data.isTrue(1)).isFalse(); + assertThat(data.hasScrapeTimestamp()).isTrue(); + assertThat(data.getScrapeTimestampMillis()).isEqualTo(scrapeTimestamp); + assertThat(data.hasCreatedTimestamp()).isFalse(); + } + + @Test + public void testStateSetDataSorted() { + StateSetSnapshot.StateSetDataPointSnapshot data = + StateSetSnapshot.StateSetDataPointSnapshot.builder() + .state("b", true) + .state("d", false) + .state("c", true) + .state("a", false) + .build(); + assertThat(data.size()).isEqualTo(4); + assertThat(data.getName(0)).isEqualTo("a"); + assertThat(data.isTrue(0)).isFalse(); + assertThat(data.getName(1)).isEqualTo("b"); + assertThat(data.isTrue(1)).isTrue(); + assertThat(data.getName(2)).isEqualTo("c"); + assertThat(data.isTrue(2)).isTrue(); + assertThat(data.getName(3)).isEqualTo("d"); + assertThat(data.isTrue(3)).isFalse(); + } + + @Test + public void testMustHaveState() { + // Must have at least one state. + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> StateSetSnapshot.StateSetDataPointSnapshot.builder().build()); + } + + @Test + public void testMinimal() { + StateSetSnapshot snapshot = + StateSetSnapshot.builder() + .name("my_flag") + .dataPoint( + StateSetSnapshot.StateSetDataPointSnapshot.builder().state("flag", true).build()) + .build(); + assertThat(snapshot.dataPoints.size()).isOne(); + } + + @Test + public void testEmpty() { + StateSetSnapshot snapshot = StateSetSnapshot.builder().name("my_flag").build(); + assertThat(snapshot.dataPoints).isEmpty(); + } + + @Test + public void testDataImmutable() { + StateSetSnapshot.StateSetDataPointSnapshot data = + StateSetSnapshot.StateSetDataPointSnapshot.builder() + .state("a", true) + .state("b", true) + .state("c", true) + .build(); + assertThat(data.iterator().next()) + .usingRecursiveComparison() + .isEqualTo(data.stream().iterator().next()); + Iterator iterator = data.iterator(); + StateSetSnapshot.State state = iterator.next(); + assertThat(state.getName()).isEqualTo("a"); + assertThat(state.isTrue()).isTrue(); + assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(iterator::remove); + } + + @Test + public void testDuplicateState() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + StateSetSnapshot.StateSetDataPointSnapshot.builder() + .state("a", true) + .state("b", true) + .state("a", true) + .build()); + } + + @Test + public void noUnit() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> StateSetSnapshot.builder().name("flags").unit(Unit.BYTES).build()); + } + + @Test + public void testStateSetImmutable() { + StateSetSnapshot snapshot = + StateSetSnapshot.builder() + .name("flags") + .dataPoint( + StateSetSnapshot.StateSetDataPointSnapshot.builder() + .labels(Labels.of("entity", "controller")) + .state("feature", true) + .build()) + .dataPoint( + StateSetSnapshot.StateSetDataPointSnapshot.builder() + .labels(Labels.of("entity", "api")) + .state("feature", true) + .build()) + .build(); + Iterator iterator = + snapshot.getDataPoints().iterator(); + iterator.next(); + assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(iterator::remove); + } + + @Test + public void testLabelsUnique() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + StateSetSnapshot.builder() + .name("flags") + .dataPoint( + StateSetSnapshot.StateSetDataPointSnapshot.builder() + .state("feature", true) + .build()) + .dataPoint( + StateSetSnapshot.StateSetDataPointSnapshot.builder() + .state("feature", true) + .build()) + .build()); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/SummarySnapshotTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/SummarySnapshotTest.java new file mode 100644 index 000000000..df423ba97 --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/SummarySnapshotTest.java @@ -0,0 +1,123 @@ +package io.prometheus.metrics.model.snapshots; + +import static org.assertj.core.api.Assertions.assertThat; + +import io.prometheus.metrics.config.EscapingScheme; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; + +class SummarySnapshotTest { + + @Test + public void testCompleteGoodCase() { + long createdTimestamp = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(1); + long scrapeTimestamp = System.currentTimeMillis() - TimeUnit.MINUTES.toMillis(2); + long exemplarTimestamp = System.currentTimeMillis(); + SummarySnapshot snapshot = + SummarySnapshot.builder() + .name("latency_seconds") + .help("latency in seconds") + .unit(Unit.SECONDS) + .dataPoint( + SummarySnapshot.SummaryDataPointSnapshot.builder() + .createdTimestampMillis(createdTimestamp) + .scrapeTimestampMillis(scrapeTimestamp) + .labels(Labels.of("endpoint", "/")) + .quantiles( + Quantiles.builder() + .quantile(0.5, 0.2) + .quantile(0.95, 0.22) + .quantile(0.99, 0.23) + .build()) + .exemplars( + Exemplars.builder() + .exemplar( + Exemplar.builder() + .value(0.2) + .traceId("abc123") + .spanId("123457") + .timestampMillis(exemplarTimestamp) + .build()) + .exemplar( + Exemplar.builder() + .value(0.21) + .traceId("abc124") + .spanId("123458") + .timestampMillis(exemplarTimestamp) + .build()) + .build()) + .count(1093) + .sum(218.6) + .build()) + .dataPoint( + SummarySnapshot.SummaryDataPointSnapshot.builder() + .labels(Labels.of("endpoint", "/test")) + .count(1093) + .sum(218.6) + .build()) + .build(); + SnapshotTestUtil.assertMetadata(snapshot, "latency_seconds", "latency in seconds", "seconds"); + assertThat(snapshot.getDataPoints()).hasSize(2); + SummarySnapshot.SummaryDataPointSnapshot data = snapshot.getDataPoints().get(0); + assertThat((Iterable) data.getLabels()).isEqualTo(Labels.of("endpoint", "/")); + assertThat(data.hasCount()).isTrue(); + assertThat(data.getCount()).isEqualTo(1093); + assertThat(data.hasSum()).isTrue(); + assertThat(data.getSum()).isEqualTo(218.6); + assertThat(data.hasCreatedTimestamp()).isTrue(); + assertThat(data.getCreatedTimestampMillis()).isEqualTo(createdTimestamp); + assertThat(data.hasScrapeTimestamp()).isTrue(); + assertThat(data.getScrapeTimestampMillis()).isEqualTo(scrapeTimestamp); + Quantiles quantiles = data.getQuantiles(); + assertThat(quantiles.size()).isEqualTo(3); + // quantiles are tested in QuantilesTest already, skipping here. + assertThat(data.getExemplars().size()).isEqualTo(2); + // exemplars are tested in ExemplarsTest already, skipping here. + + data = snapshot.getDataPoints().get(1); + assertThat(data.hasCreatedTimestamp()).isFalse(); + assertThat(data.hasScrapeTimestamp()).isFalse(); + assertThat(data.hasCount()).isTrue(); + assertThat(data.hasSum()).isTrue(); + } + + @Test + public void testMinimal() { + SummarySnapshot snapshot = + SummarySnapshot.builder() + .name("size_bytes") + .dataPoint( + SummarySnapshot.SummaryDataPointSnapshot.builder().count(10).sum(12.0).build()) + .build(); + assertThat(snapshot.getDataPoints()).hasSize(1); + assertThat((Iterable) snapshot.getDataPoints().get(0).getLabels()) + .isEqualTo(Labels.EMPTY); + } + + @Test + public void testEmptySnapshot() { + SummarySnapshot snapshot = SummarySnapshot.builder().name("empty_summary").build(); + assertThat(snapshot.getDataPoints()).isEmpty(); + } + + @Test + public void testEmptyData() { + SummarySnapshot.SummaryDataPointSnapshot data = + SummarySnapshot.SummaryDataPointSnapshot.builder().build(); + assertThat(data.getQuantiles().size()).isZero(); + assertThat(data.hasCount()).isFalse(); + assertThat(data.hasSum()).isFalse(); + assertThat(data.hasCreatedTimestamp()).isFalse(); + assertThat(data.hasScrapeTimestamp()).isFalse(); + assertThat(data.getExemplars().size()).isZero(); + } + + @Test + void escape() { + SummarySnapshot.SummaryDataPointSnapshot data = + SummarySnapshot.SummaryDataPointSnapshot.builder().sum(12.0).build(); + assertThat(data.escape(EscapingScheme.UNDERSCORE_ESCAPING)) + .usingRecursiveComparison() + .isEqualTo(data); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/UnitTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/UnitTest.java new file mode 100644 index 000000000..4585e7281 --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/UnitTest.java @@ -0,0 +1,46 @@ +package io.prometheus.metrics.model.snapshots; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import org.junit.jupiter.api.Test; + +class UnitTest { + + @Test + public void testEmpty() { + assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> new Unit(" ")); + } + + @Test + public void testEquals1() { + Unit unit1 = Unit.BYTES; + Unit unit2 = new Unit("bytes"); + + assertThat(unit1).isEqualTo(unit2); + } + + @Test + public void testEquals2() { + Unit unit1 = new Unit("bytes "); + Unit unit2 = new Unit("bytes"); + + assertThat(unit1).isEqualTo(unit2); + } + + @Test + public void testEquals3() { + Unit unit1 = new Unit(" bytes"); + Unit unit2 = new Unit("bytes"); + + assertThat(unit1).isEqualTo(unit2); + } + + @Test + public void testEquals4() { + Unit unit1 = new Unit(" bytes "); + Unit unit2 = new Unit("bytes"); + + assertThat(unit1).isEqualTo(unit2); + } +} diff --git a/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/UnknownSnapshotTest.java b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/UnknownSnapshotTest.java new file mode 100644 index 000000000..53df0a95d --- /dev/null +++ b/prometheus-metrics-model/src/test/java/io/prometheus/metrics/model/snapshots/UnknownSnapshotTest.java @@ -0,0 +1,92 @@ +package io.prometheus.metrics.model.snapshots; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.assertj.core.data.Offset.offset; + +import org.junit.jupiter.api.Test; + +class UnknownSnapshotTest { + + @Test + public void testCompleteGoodCase() { + long exemplarTimestamp = System.currentTimeMillis(); + UnknownSnapshot snapshot = + UnknownSnapshot.builder() + .name("my_unknown_seconds") + .help("something in seconds") + .unit(Unit.SECONDS) + .dataPoint( + UnknownSnapshot.UnknownDataPointSnapshot.builder() + .value(0.3) + .exemplar( + Exemplar.builder() + .value(0.12) + .traceId("abc123") + .spanId("123457") + .timestampMillis(exemplarTimestamp) + .build()) + .labels(Labels.builder().label("env", "prod").build()) + .build()) + .dataPoint( + UnknownSnapshot.UnknownDataPointSnapshot.builder() + .value(0.29) + .labels(Labels.builder().label("env", "dev").build()) + .build()) + .build(); + SnapshotTestUtil.assertMetadata( + snapshot, "my_unknown_seconds", "something in seconds", "seconds"); + assertThat(snapshot.getDataPoints()).hasSize(2); + UnknownSnapshot.UnknownDataPointSnapshot data = snapshot.getDataPoints().get(1); // env="prod" + assertThat((Iterable) data.getLabels()).isEqualTo(Labels.of("env", "prod")); + assertThat(data.getValue()).isEqualTo(0.3); + assertThat(data.getExemplar().getValue()).isEqualTo(0.12); + assertThat(data.hasCreatedTimestamp()).isFalse(); + assertThat(data.hasScrapeTimestamp()).isFalse(); + } + + @Test + public void testMinimal() { + UnknownSnapshot snapshot = + UnknownSnapshot.builder() + .name("test") + .dataPoint(UnknownSnapshot.UnknownDataPointSnapshot.builder().value(1.0).build()) + .build(); + assertThat(snapshot.getDataPoints()).hasSize(1); + } + + @Test + public void testEmpty() { + UnknownSnapshot snapshot = UnknownSnapshot.builder().name("test").build(); + assertThat(snapshot.getDataPoints()).isEmpty(); + } + + @Test + public void testNameMissing() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> UnknownSnapshot.builder().build()); + } + + @Test + public void testValueMissing() { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> UnknownSnapshot.UnknownDataPointSnapshot.builder().build()); + } + + @Test + public void testUnknownDataPointSnapshot() { + Labels labels = Labels.of("k1", "v1"); + Exemplar exemplar = Exemplar.builder().value(2.0).build(); + + UnknownSnapshot.UnknownDataPointSnapshot data = + new UnknownSnapshot.UnknownDataPointSnapshot(1.0, labels, exemplar); + assertThat(data.getValue()).isCloseTo(1.0, offset(0.1)); + assertThat((Iterable) data.getLabels()).isEqualTo(labels); + assertThat(data.getExemplar()).isEqualTo(exemplar); + + data = new UnknownSnapshot.UnknownDataPointSnapshot(1.0, labels, exemplar, 0L); + assertThat(data.getValue()).isCloseTo(1.0, offset(0.1)); + assertThat((Iterable) data.getLabels()).isEqualTo(labels); + assertThat(data.getExemplar()).isEqualTo(exemplar); + } +} diff --git a/prometheus-metrics-model/version-rules.xml b/prometheus-metrics-model/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-model/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-parent/pom.xml b/prometheus-metrics-parent/pom.xml new file mode 100644 index 000000000..075eaf782 --- /dev/null +++ b/prometheus-metrics-parent/pom.xml @@ -0,0 +1,146 @@ + + + pom + 4.0.0 + + io.prometheus + client_java_parent + 1.5.0-SNAPSHOT + + Prometheus Metrics Library Parent + http://github.com/prometheus/client_java + + The Prometheus Java Metrics Library Parent + + + + true + true + true + true + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + scm:git:git@github.com:prometheus/client_java.git + scm:git:git@github.com:prometheus/client_java.git + git@github.com:prometheus/client_java.git + HEAD + + + + + fstab + Fabian Stäber + fabian@fstab.de + + + zeitlinger + Gregor Zeitlinger + gregor.zeitlinger@grafana.com + + + dhoard + Doug Hoard + doug.hoard@gmail.com + + + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + + com.diffplug.spotless + spotless-maven-plugin + 3.1.0 + + + + + ${spotless.skip} + + + + verify + + check + + + + + + + + + + release + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.2.8 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.4.0 + + + attach-sources + + jar-no-fork + + + + + + org.sonatype.central + central-publishing-maven-plugin + 0.10.0 + true + + ossrh + true + published + + + + + + + diff --git a/prometheus-metrics-simpleclient-bridge/pom.xml b/prometheus-metrics-simpleclient-bridge/pom.xml new file mode 100644 index 000000000..e15a5631c --- /dev/null +++ b/prometheus-metrics-simpleclient-bridge/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-simpleclient-bridge + bundle + + Prometheus Metrics - Simpleclient Bridge + + Bridge the old simpleclient CollectorRegistry to the new PrometheusRegistry + + + + io.prometheus.metrics.simpleclient.bridge + + + + + io.prometheus + prometheus-metrics-model + ${project.version} + + + io.prometheus + prometheus-metrics-config + ${project.version} + + + io.prometheus + simpleclient + 0.16.0 + provided + + + + + io.prometheus + prometheus-metrics-exposition-textformats + ${project.version} + test + + + io.prometheus + simpleclient_common + 0.16.0 + test + + + diff --git a/prometheus-metrics-simpleclient-bridge/src/main/java/io/prometheus/metrics/simpleclient/bridge/SimpleclientCollector.java b/prometheus-metrics-simpleclient-bridge/src/main/java/io/prometheus/metrics/simpleclient/bridge/SimpleclientCollector.java new file mode 100644 index 000000000..3a96453e7 --- /dev/null +++ b/prometheus-metrics-simpleclient-bridge/src/main/java/io/prometheus/metrics/simpleclient/bridge/SimpleclientCollector.java @@ -0,0 +1,421 @@ +package io.prometheus.metrics.simpleclient.bridge; + +import static io.prometheus.metrics.model.snapshots.PrometheusNaming.sanitizeMetricName; +import static java.util.Objects.requireNonNull; + +import io.prometheus.client.Collector; +import io.prometheus.client.CollectorRegistry; +import io.prometheus.metrics.config.PrometheusProperties; +import io.prometheus.metrics.model.registry.MultiCollector; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import io.prometheus.metrics.model.snapshots.ClassicHistogramBuckets; +import io.prometheus.metrics.model.snapshots.CounterSnapshot; +import io.prometheus.metrics.model.snapshots.Exemplar; +import io.prometheus.metrics.model.snapshots.Exemplars; +import io.prometheus.metrics.model.snapshots.GaugeSnapshot; +import io.prometheus.metrics.model.snapshots.HistogramSnapshot; +import io.prometheus.metrics.model.snapshots.InfoSnapshot; +import io.prometheus.metrics.model.snapshots.Labels; +import io.prometheus.metrics.model.snapshots.MetricSnapshot; +import io.prometheus.metrics.model.snapshots.MetricSnapshots; +import io.prometheus.metrics.model.snapshots.Quantile; +import io.prometheus.metrics.model.snapshots.Quantiles; +import io.prometheus.metrics.model.snapshots.StateSetSnapshot; +import io.prometheus.metrics.model.snapshots.SummarySnapshot; +import io.prometheus.metrics.model.snapshots.Unit; +import io.prometheus.metrics.model.snapshots.UnknownSnapshot; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Nullable; + +/** + * Bridge from {@code simpleclient} (version 0.16.0 and older) to the new {@code prometheus-metrics} + * (version 1.0.0 and newer). + * + *

    Usage: The following line will register all metrics from a {@code simpleclient} {@link + * CollectorRegistry#defaultRegistry} to a {@code prometheus-metrics} {@link + * PrometheusRegistry#defaultRegistry}: + * + *

    {@code
    + * SimpleclientCollector.builder().register();
    + * }
    + * + *

    If you have custom registries (not the default registries), use the following snippet: + * + *

    {@code
    + * CollectorRegistry simpleclientRegistry = ...;
    + * PrometheusRegistry prometheusRegistry = ...;
    + * SimpleclientCollector.builder()
    + *     .collectorRegistry(simpleclientRegistry)
    + *     .register(prometheusRegistry);
    + * }
    + */ +public class SimpleclientCollector implements MultiCollector { + + private final CollectorRegistry simpleclientRegistry; + + private SimpleclientCollector(CollectorRegistry simpleclientRegistry) { + this.simpleclientRegistry = simpleclientRegistry; + } + + @Override + public MetricSnapshots collect() { + return convert(simpleclientRegistry.metricFamilySamples()); + } + + private MetricSnapshots convert(Enumeration samples) { + MetricSnapshots.Builder result = MetricSnapshots.builder(); + while (samples.hasMoreElements()) { + Collector.MetricFamilySamples sample = samples.nextElement(); + switch (sample.type) { + case COUNTER: + result.metricSnapshot(convertCounter(sample)); + break; + case GAUGE: + result.metricSnapshot(convertGauge(sample)); + break; + case HISTOGRAM: + result.metricSnapshot(convertHistogram(sample, false)); + break; + case GAUGE_HISTOGRAM: + result.metricSnapshot(convertHistogram(sample, true)); + break; + case SUMMARY: + result.metricSnapshot(convertSummary(sample)); + break; + case INFO: + result.metricSnapshot(convertInfo(sample)); + break; + case STATE_SET: + result.metricSnapshot(convertStateSet(sample)); + break; + case UNKNOWN: + result.metricSnapshot(convertUnknown(sample)); + break; + default: + throw new IllegalStateException(sample.type + ": Unexpected metric type"); + } + } + return result.build(); + } + + private MetricSnapshot convertCounter(Collector.MetricFamilySamples samples) { + CounterSnapshot.Builder counter = + CounterSnapshot.builder() + .name(sanitizeMetricName(samples.name)) + .help(samples.help) + .unit(convertUnit(samples)); + Map dataPoints = new HashMap<>(); + for (Collector.MetricFamilySamples.Sample sample : samples.samples) { + Labels labels = Labels.of(sample.labelNames, sample.labelValues); + CounterSnapshot.CounterDataPointSnapshot.Builder dataPoint = + dataPoints.computeIfAbsent( + labels, l -> CounterSnapshot.CounterDataPointSnapshot.builder().labels(labels)); + if (sample.name.endsWith("_created")) { + dataPoint.createdTimestampMillis((long) Unit.secondsToMillis(sample.value)); + } else { + dataPoint.value(sample.value); + if (sample.exemplar != null) { + dataPoint.exemplar(convertExemplar(sample.exemplar)); + } + if (sample.timestampMs != null) { + dataPoint.scrapeTimestampMillis(sample.timestampMs); + } + } + } + for (CounterSnapshot.CounterDataPointSnapshot.Builder dataPoint : dataPoints.values()) { + counter.dataPoint(dataPoint.build()); + } + return counter.build(); + } + + private MetricSnapshot convertGauge(Collector.MetricFamilySamples samples) { + GaugeSnapshot.Builder gauge = + GaugeSnapshot.builder() + .name(sanitizeMetricName(samples.name)) + .help(samples.help) + .unit(convertUnit(samples)); + for (Collector.MetricFamilySamples.Sample sample : samples.samples) { + GaugeSnapshot.GaugeDataPointSnapshot.Builder dataPoint = + GaugeSnapshot.GaugeDataPointSnapshot.builder() + .value(sample.value) + .labels(Labels.of(sample.labelNames, sample.labelValues)); + if (sample.exemplar != null) { + dataPoint.exemplar(convertExemplar(sample.exemplar)); + } + if (sample.timestampMs != null) { + dataPoint.scrapeTimestampMillis(sample.timestampMs); + } + gauge.dataPoint(dataPoint.build()); + } + return gauge.build(); + } + + private MetricSnapshot convertHistogram( + Collector.MetricFamilySamples samples, boolean isGaugeHistogram) { + HistogramSnapshot.Builder histogram = + HistogramSnapshot.builder() + .name(sanitizeMetricName(samples.name)) + .help(samples.help) + .unit(convertUnit(samples)) + .gaugeHistogram(isGaugeHistogram); + Map dataPoints = new HashMap<>(); + Map> cumulativeBuckets = new HashMap<>(); + Map exemplars = new HashMap<>(); + for (Collector.MetricFamilySamples.Sample sample : samples.samples) { + Labels labels = labelsWithout(sample, "le"); + dataPoints.computeIfAbsent( + labels, l -> HistogramSnapshot.HistogramDataPointSnapshot.builder().labels(labels)); + cumulativeBuckets.computeIfAbsent(labels, l -> new HashMap<>()); + exemplars.computeIfAbsent(labels, l -> Exemplars.builder()); + if (sample.name.endsWith("_sum")) { + dataPoints.get(labels).sum(sample.value); + } + if (sample.name.endsWith("_bucket")) { + addBucket(cumulativeBuckets.get(labels), sample); + } + if (sample.name.endsWith("_created")) { + dataPoints.get(labels).createdTimestampMillis((long) Unit.secondsToMillis(sample.value)); + } + if (sample.exemplar != null) { + exemplars.get(labels).exemplar(convertExemplar(sample.exemplar)); + } + if (sample.timestampMs != null) { + dataPoints.get(labels).scrapeTimestampMillis(sample.timestampMs); + } + } + for (Labels labels : dataPoints.keySet()) { + histogram.dataPoint( + requireNonNull(dataPoints.get(labels)) + .classicHistogramBuckets(makeBuckets(requireNonNull(cumulativeBuckets.get(labels)))) + .exemplars(requireNonNull(exemplars.get(labels)).build()) + .build()); + } + return histogram.build(); + } + + private MetricSnapshot convertSummary(Collector.MetricFamilySamples samples) { + SummarySnapshot.Builder summary = + SummarySnapshot.builder() + .name(sanitizeMetricName(samples.name)) + .help(samples.help) + .unit(convertUnit(samples)); + Map dataPoints = new HashMap<>(); + Map quantiles = new HashMap<>(); + Map exemplars = new HashMap<>(); + for (Collector.MetricFamilySamples.Sample sample : samples.samples) { + Labels labels = labelsWithout(sample, "quantile"); + dataPoints.computeIfAbsent( + labels, l -> SummarySnapshot.SummaryDataPointSnapshot.builder().labels(labels)); + quantiles.computeIfAbsent(labels, l -> Quantiles.builder()); + exemplars.computeIfAbsent(labels, l -> Exemplars.builder()); + if (sample.name.endsWith("_sum")) { + dataPoints.get(labels).sum(sample.value); + } else if (sample.name.endsWith("_count")) { + dataPoints.get(labels).count((long) sample.value); + } else if (sample.name.endsWith("_created")) { + dataPoints.get(labels).createdTimestampMillis((long) Unit.secondsToMillis(sample.value)); + } else { + for (int i = 0; i < sample.labelNames.size(); i++) { + if (sample.labelNames.get(i).equals("quantile")) { + quantiles + .get(labels) + .quantile( + new Quantile(Double.parseDouble(sample.labelValues.get(i)), sample.value)); + break; + } + } + } + if (sample.exemplar != null) { + exemplars.get(labels).exemplar(convertExemplar(sample.exemplar)); + } + if (sample.timestampMs != null) { + dataPoints.get(labels).scrapeTimestampMillis(sample.timestampMs); + } + } + for (Labels labels : dataPoints.keySet()) { + summary.dataPoint( + requireNonNull(dataPoints.get(labels)) + .quantiles(requireNonNull(quantiles.get(labels)).build()) + .exemplars(requireNonNull(exemplars.get(labels)).build()) + .build()); + } + return summary.build(); + } + + private MetricSnapshot convertStateSet(Collector.MetricFamilySamples samples) { + StateSetSnapshot.Builder stateSet = + StateSetSnapshot.builder().name(sanitizeMetricName(samples.name)).help(samples.help); + Map dataPoints = new HashMap<>(); + for (Collector.MetricFamilySamples.Sample sample : samples.samples) { + Labels labels = labelsWithout(sample, sample.name); + dataPoints.computeIfAbsent( + labels, l -> StateSetSnapshot.StateSetDataPointSnapshot.builder().labels(labels)); + String stateName = null; + for (int i = 0; i < sample.labelNames.size(); i++) { + if (sample.labelNames.get(i).equals(sample.name)) { + stateName = sample.labelValues.get(i); + break; + } + } + if (stateName == null) { + throw new IllegalStateException("Invalid StateSet metric: No state name found."); + } + dataPoints.get(labels).state(stateName, sample.value == 1.0); + if (sample.timestampMs != null) { + dataPoints.get(labels).scrapeTimestampMillis(sample.timestampMs); + } + } + for (StateSetSnapshot.StateSetDataPointSnapshot.Builder dataPoint : dataPoints.values()) { + stateSet.dataPoint(dataPoint.build()); + } + return stateSet.build(); + } + + private MetricSnapshot convertUnknown(Collector.MetricFamilySamples samples) { + UnknownSnapshot.Builder unknown = + UnknownSnapshot.builder() + .name(sanitizeMetricName(samples.name)) + .help(samples.help) + .unit(convertUnit(samples)); + for (Collector.MetricFamilySamples.Sample sample : samples.samples) { + UnknownSnapshot.UnknownDataPointSnapshot.Builder dataPoint = + UnknownSnapshot.UnknownDataPointSnapshot.builder() + .value(sample.value) + .labels(Labels.of(sample.labelNames, sample.labelValues)); + if (sample.exemplar != null) { + dataPoint.exemplar(convertExemplar(sample.exemplar)); + } + if (sample.timestampMs != null) { + dataPoint.scrapeTimestampMillis(sample.timestampMs); + } + unknown.dataPoint(dataPoint.build()); + } + return unknown.build(); + } + + @Nullable + private Unit convertUnit(Collector.MetricFamilySamples samples) { + if (samples.unit != null && !samples.unit.isEmpty()) { + return new Unit(samples.unit); + } else { + return null; + } + } + + private ClassicHistogramBuckets makeBuckets(Map cumulativeBuckets) { + List upperBounds = new ArrayList<>(cumulativeBuckets.size()); + upperBounds.addAll(cumulativeBuckets.keySet()); + Collections.sort(upperBounds); + ClassicHistogramBuckets.Builder result = ClassicHistogramBuckets.builder(); + long previousCount = 0L; + for (Double upperBound : upperBounds) { + long cumulativeCount = requireNonNull(cumulativeBuckets.get(upperBound)); + result.bucket(upperBound, cumulativeCount - previousCount); + previousCount = cumulativeCount; + } + return result.build(); + } + + private void addBucket(Map buckets, Collector.MetricFamilySamples.Sample sample) { + for (int i = 0; i < sample.labelNames.size(); i++) { + if (sample.labelNames.get(i).equals("le")) { + double upperBound; + switch (sample.labelValues.get(i)) { + case "+Inf": + upperBound = Double.POSITIVE_INFINITY; + break; + case "-Inf": // Doesn't make sense as count would always be zero. Catch this anyway. + upperBound = Double.NEGATIVE_INFINITY; + break; + default: + upperBound = Double.parseDouble(sample.labelValues.get(i)); + } + buckets.put(upperBound, (long) sample.value); + return; + } + } + throw new IllegalStateException(sample.name + " does not have a le label."); + } + + private Labels labelsWithout( + Collector.MetricFamilySamples.Sample sample, String excludedLabelName) { + Labels.Builder labels = Labels.builder(); + for (int i = 0; i < sample.labelNames.size(); i++) { + if (!sample.labelNames.get(i).equals(excludedLabelName)) { + labels.label(sample.labelNames.get(i), sample.labelValues.get(i)); + } + } + return labels.build(); + } + + private MetricSnapshot convertInfo(Collector.MetricFamilySamples samples) { + InfoSnapshot.Builder info = + InfoSnapshot.builder().name(sanitizeMetricName(samples.name)).help(samples.help); + for (Collector.MetricFamilySamples.Sample sample : samples.samples) { + info.dataPoint( + InfoSnapshot.InfoDataPointSnapshot.builder() + .labels(Labels.of(sample.labelNames, sample.labelValues)) + .build()); + } + return info.build(); + } + + private Exemplar convertExemplar(io.prometheus.client.exemplars.Exemplar exemplar) { + Exemplar.Builder result = Exemplar.builder().value(exemplar.getValue()); + if (exemplar.getTimestampMs() != null) { + result.timestampMillis(exemplar.getTimestampMs()); + } + Labels.Builder labels = Labels.builder(); + for (int i = 0; i < exemplar.getNumberOfLabels(); i++) { + labels.label(exemplar.getLabelName(i), exemplar.getLabelValue(i)); + } + return result.labels(labels.build()).build(); + } + + /** + * Currently there are no configuration options for the SimpleclientCollector. However, we want to + * follow the pattern to pass the config everywhere so that we can introduce config options later + * without the need for API changes. + */ + @SuppressWarnings("unused") + public static Builder builder(PrometheusProperties config) { + return new Builder(); + } + + public static Builder builder() { + return builder(PrometheusProperties.get()); + } + + public static class Builder { + + @Nullable private CollectorRegistry collectorRegistry; + + private Builder() {} + + public Builder collectorRegistry(CollectorRegistry registry) { + this.collectorRegistry = registry; + return this; + } + + public SimpleclientCollector build() { + return collectorRegistry != null + ? new SimpleclientCollector(collectorRegistry) + : new SimpleclientCollector(CollectorRegistry.defaultRegistry); + } + + public SimpleclientCollector register() { + return register(PrometheusRegistry.defaultRegistry); + } + + public SimpleclientCollector register(PrometheusRegistry registry) { + SimpleclientCollector result = build(); + registry.register(result); + return result; + } + } +} diff --git a/prometheus-metrics-simpleclient-bridge/src/test/java/io/prometheus/metrics/simpleclient/bridge/SimpleclientCollectorTest.java b/prometheus-metrics-simpleclient-bridge/src/test/java/io/prometheus/metrics/simpleclient/bridge/SimpleclientCollectorTest.java new file mode 100644 index 000000000..a17ed8bc4 --- /dev/null +++ b/prometheus-metrics-simpleclient-bridge/src/test/java/io/prometheus/metrics/simpleclient/bridge/SimpleclientCollectorTest.java @@ -0,0 +1,273 @@ +package io.prometheus.metrics.simpleclient.bridge; + +import static org.assertj.core.api.Assertions.assertThat; + +import io.prometheus.client.Collector; +import io.prometheus.client.CollectorRegistry; +import io.prometheus.client.Counter; +import io.prometheus.client.Gauge; +import io.prometheus.client.Histogram; +import io.prometheus.client.Info; +import io.prometheus.client.Summary; +import io.prometheus.client.exporter.common.TextFormat; +import io.prometheus.metrics.config.EscapingScheme; +import io.prometheus.metrics.expositionformats.OpenMetricsTextFormatWriter; +import io.prometheus.metrics.model.registry.PrometheusRegistry; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.StringWriter; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class SimpleclientCollectorTest { + + private CollectorRegistry origRegistry; + private PrometheusRegistry newRegistry; + + @BeforeEach + public void setUp() { + origRegistry = new CollectorRegistry(); + newRegistry = new PrometheusRegistry(); + SimpleclientCollector.builder().collectorRegistry(origRegistry).register(newRegistry); + } + + @Test + public void testCounterComplete() throws IOException, InterruptedException { + Counter counter = + Counter.build() + .name("service_time_seconds_total") + .help("total time spent serving") + .labelNames("path", "status") + .register(origRegistry); + counter.labels("/hello", "200").incWithExemplar(0.8, "trace_id", "12345", "span_id", "abcde"); + Thread.sleep(3); // make timestamps a bit different + counter.labels("/hello", "500").incWithExemplar(2.4, "trace_id", "23446", "span_id", "bcdef"); + + assertThat(sort(newOpenMetrics())).isEqualTo(fixTimestamps(sort(origOpenMetrics()))); + } + + @Test + public void testCounterMinimal() throws IOException { + Counter.build().name("events").help("total number of events").register(origRegistry); + + assertThat(sort(newOpenMetrics())).isEqualTo(fixTimestamps(sort(origOpenMetrics()))); + } + + @Test + public void testGaugeComplete() throws IOException, InterruptedException { + Gauge gauge = + Gauge.build() + .name("disk_usage_ratio") + .help("percentage used") + .unit("ratio") + .labelNames("device") + .register(origRegistry); + gauge.labels("/dev/sda1").set(0.2); + Thread.sleep(3); + gauge.labels("/dev/sda2").set(0.7); + + assertThat(sort(newOpenMetrics())).isEqualTo(sort(origOpenMetrics())); + } + + @Test + public void testGaugeMinimal() throws IOException { + Gauge gauge = + Gauge.build() + .name("temperature_centigrade") + .help("temperature") + .unit("celsius") + .register(origRegistry); + gauge.set(22.3); + + assertThat(sort(newOpenMetrics())).isEqualTo(sort(origOpenMetrics())); + } + + @Test + public void testHistogramComplete() throws IOException, InterruptedException { + Histogram histogram = + Histogram.build() + .name("response_size_bytes") + .help("response size in Bytes") + .labelNames("status") + .buckets(64, 256, 512.1) + .register(origRegistry); + histogram.labels("200").observeWithExemplar(38, "trace_id", "1", "span_id", "2"); + histogram.labels("200").observeWithExemplar(127, "trace_id", "3", "span_id", "4"); + histogram.labels("200").observeWithExemplar(130, "trace_id", "5", "span_id", "6"); + histogram.labels("200").observeWithExemplar(40, "trace_id", "7", "span_id", "8"); + histogram.labels("200").observeWithExemplar(41, "trace_id", "9", "span_id", "10"); + Thread.sleep(3); // make timestamps a bit different + histogram.labels("500").observeWithExemplar(10000, "trace_id", "11", "span_id", "12"); + + assertThat(sort(newOpenMetrics())).isEqualTo(fixCounts(fixTimestamps(sort(origOpenMetrics())))); + } + + @Test + public void testHistogramMinimal() throws IOException { + Histogram.build().name("request_latency").help("request latency").register(origRegistry); + + assertThat(sort(newOpenMetrics())).isEqualTo(fixCounts(fixTimestamps(sort(origOpenMetrics())))); + } + + @Test + public void testSummaryComplete() throws IOException, InterruptedException { + Summary summary = + Summary.build() + .name("http_request_duration_seconds") + .help("request duration") + .labelNames("path", "status") + .quantile(0.5, 0.01) + .quantile(0.95, 0.01) + .quantile(0.99, 0.001) + .register(origRegistry); + summary.labels("/", "200").observe(0.2); + Thread.sleep(3); + summary.labels("/info", "200").observe(0.7); + summary.labels("/info", "200").observe(0.8); + summary.labels("/info", "200").observe(0.9); + Thread.sleep(3); + summary.labels("/", "500").observe(0.3); + summary.labels("/", "500").observe(0.31); + summary.labels("/", "500").observe(0.32); + + assertThat(sort(newOpenMetrics())).isEqualTo(fixCounts(fixTimestamps(sort(origOpenMetrics())))); + } + + @Test + public void testSummaryMinimal() throws IOException { + Summary.build().name("request_size").help("request size").register(origRegistry); + + assertThat(sort(newOpenMetrics())).isEqualTo(fixCounts(fixTimestamps(sort(origOpenMetrics())))); + } + + @Test + public void testInfoComplete() throws IOException, InterruptedException { + Info info = + Info.build() + .name("version") + .help("version information") + .labelNames("env") + .register(origRegistry); + info.labels("prod").info("major_version", "12", "minor_version", "3"); + Thread.sleep(3); + info.labels("dev").info("major_version", "13", "minor_version", "1"); + + assertThat(sort(newOpenMetrics())).isEqualTo(fixBoolean(sort(origOpenMetrics()))); + } + + @Test + public void testInfoMinimal() throws IOException { + Info info = Info.build().name("jvm").help("JVM info").register(origRegistry); + info.info("version", "17"); + + assertThat(sort(newOpenMetrics())).isEqualTo(fixBoolean(sort(origOpenMetrics()))); + } + + @Test + public void testStateSetComplete() throws IOException { + Collector stateSet = + new Collector() { + @Override + public List collect() { + List samples = new ArrayList<>(); + samples.add( + new Collector.MetricFamilySamples.Sample( + "state", Arrays.asList("env", "state"), Arrays.asList("dev", "state1"), 1.0)); + samples.add( + new Collector.MetricFamilySamples.Sample( + "state", Arrays.asList("env", "state"), Arrays.asList("dev", "state2"), 0.0)); + return Collections.singletonList( + new Collector.MetricFamilySamples( + "state", Collector.Type.STATE_SET, "my state", samples)); + } + }; + origRegistry.register(stateSet); + + assertThat(sort(newOpenMetrics())).isEqualTo(fixBoolean(sort(origOpenMetrics()))); + } + + @Test + public void testUnknownComplete() throws IOException { + Collector unknown = + new Collector() { + @Override + public List collect() { + List samples = new ArrayList<>(); + samples.add( + new Collector.MetricFamilySamples.Sample( + "my_unknown_metric_seconds", + Arrays.asList("env", "status"), + Arrays.asList("dev", "ok"), + 3.0)); + samples.add( + new Collector.MetricFamilySamples.Sample( + "my_unknown_metric_seconds", + Arrays.asList("env", "status"), + Arrays.asList("prod", "error"), + 0.0)); + return Collections.singletonList( + new Collector.MetricFamilySamples( + "my_unknown_metric_seconds", + "seconds", + Type.UNKNOWN, + "test metric of type unknown", + samples)); + } + }; + origRegistry.register(unknown); + + assertThat(sort(newOpenMetrics())).isEqualTo(sort(origOpenMetrics())); + } + + private String fixBoolean(String s) { + return s.replaceAll(" 1.0", " 1").replaceAll(" 0.0", " 0"); + } + + private String sort(String s) { + String[] lines = s.split("\n"); + Arrays.sort(lines); + return String.join("\n", lines); + } + + private String fixTimestamps(String s) { + // Example of a "_created" timestamp in orig format: 1.694464002939E9 + // Example of a "_created" timestamp in new format: 1694464002.939 + // The following regex translates the orig timestamp to the new timestamp + return s.replaceAll("1\\.([0-9]{9})([0-9]{3})E9", "1$1.$2") // Example: 1.694464002939E9 + .replaceAll("1\\.([0-9]{9})([0-9]{2})E9", "1$1.$20") // Example: 1.69460725747E9 + .replaceAll("1\\.([0-9]{9})([0-9])E9", "1$1.$200") // Example: 1.6946072574E9 + .replaceAll("1\\.([0-9]{9})E9", "1$1.000") // Example: 1.712332231E9 + .replaceAll("1\\.([0-9]{8})E9", "1$10.000") // Example: 1.71233242E9 + .replaceAll("1\\.([0-9]{7})E9", "1$100.000") // Example: 1.7123324E9 + .replaceAll("1\\.([0-9]{6})E9", "1$1000.000") + .replaceAll("1\\.([0-9]{5})E9", "1$10000.000") + .replaceAll("1\\.([0-9]{4})E9", "1$100000.000") + .replaceAll("1\\.([0-9]{3})E9", "1$1000000.000") + .replaceAll("1\\.([0-9]{2})E9", "1$10000000.000"); + } + + private String fixCounts(String s) { + // Example of a "_count" or "_bucket" in orig format: 3.0 + // Example of a "_count" or "_bucket" in new format: 3 + // The following regex translates the orig bucket counts to the new bucket counts + return s.replaceAll("((_count|_bucket)(\\{[^}]*})? [0-9])\\.0", "$1"); + } + + private String origOpenMetrics() throws IOException { + StringWriter out = new StringWriter(); + TextFormat.writeOpenMetrics100(out, origRegistry.metricFamilySamples()); + return out.toString(); + } + + private String newOpenMetrics() throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter(true, false); + writer.write(out, newRegistry.scrape(), EscapingScheme.ALLOW_UTF8); + return out.toString(StandardCharsets.UTF_8); + } +} diff --git a/prometheus-metrics-simpleclient-bridge/version-rules.xml b/prometheus-metrics-simpleclient-bridge/version-rules.xml new file mode 100644 index 000000000..6c0100118 --- /dev/null +++ b/prometheus-metrics-simpleclient-bridge/version-rules.xml @@ -0,0 +1,12 @@ + + + + + + .*(alpha|beta)-[0-9] + + + + diff --git a/prometheus-metrics-tracer/pom.xml b/prometheus-metrics-tracer/pom.xml new file mode 100644 index 000000000..15ea09307 --- /dev/null +++ b/prometheus-metrics-tracer/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.5.0-SNAPSHOT + + + prometheus-metrics-tracer + pom + + Prometheus Metrics Tracer + + Parent for Prometheus integrations with distributed tracing libraries. + + + + + + io.opentelemetry.instrumentation + opentelemetry-instrumentation-bom-alpha + ${otel.instrumentation.version} + pom + import + + + + + + prometheus-metrics-tracer-common + prometheus-metrics-tracer-initializer + prometheus-metrics-tracer-otel + prometheus-metrics-tracer-otel-agent + + + diff --git a/prometheus-metrics-tracer/prometheus-metrics-tracer-common/pom.xml b/prometheus-metrics-tracer/prometheus-metrics-tracer-common/pom.xml new file mode 100644 index 000000000..573e78801 --- /dev/null +++ b/prometheus-metrics-tracer/prometheus-metrics-tracer-common/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + + + io.prometheus + prometheus-metrics-tracer + 1.5.0-SNAPSHOT + + + prometheus-metrics-tracer-common + bundle + + Prometheus Metrics Tracer Common + + Common Module for Prometheus integrations with distributed tracing libraries. + + + + io.prometheus.metrics.tracer.common + + + diff --git a/prometheus-metrics-tracer/prometheus-metrics-tracer-common/src/main/java/io/prometheus/metrics/tracer/common/SpanContext.java b/prometheus-metrics-tracer/prometheus-metrics-tracer-common/src/main/java/io/prometheus/metrics/tracer/common/SpanContext.java new file mode 100644 index 000000000..7d087f8b5 --- /dev/null +++ b/prometheus-metrics-tracer/prometheus-metrics-tracer-common/src/main/java/io/prometheus/metrics/tracer/common/SpanContext.java @@ -0,0 +1,33 @@ +package io.prometheus.metrics.tracer.common; + +import javax.annotation.Nullable; + +public interface SpanContext { + + String EXEMPLAR_ATTRIBUTE_NAME = "exemplar"; + String EXEMPLAR_ATTRIBUTE_VALUE = "true"; + + /** + * @return the current trace id, or {@code null} if this call is not happening within a span + * context. + */ + @Nullable + String getCurrentTraceId(); + + /** + * @return the current span id, or {@code null} if this call is not happening within a span + * context. + */ + @Nullable + String getCurrentSpanId(); + + /** + * @return the state of the current Span. If this value is false a component before in the chain + * take the decision to not record it. Subsequent calling service have to respect this value + * in order not to have partial TraceID with only some Span in it. This value is important to + * be sure to choose a recorded Trace in Examplar sampling process + */ + boolean isCurrentSpanSampled(); + + void markCurrentSpanAsExemplar(); +} diff --git a/prometheus-metrics-tracer/prometheus-metrics-tracer-common/version-rules.xml b/prometheus-metrics-tracer/prometheus-metrics-tracer-common/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-tracer/prometheus-metrics-tracer-common/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-tracer/prometheus-metrics-tracer-initializer/pom.xml b/prometheus-metrics-tracer/prometheus-metrics-tracer-initializer/pom.xml new file mode 100644 index 000000000..2d15be029 --- /dev/null +++ b/prometheus-metrics-tracer/prometheus-metrics-tracer-initializer/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + + + io.prometheus + prometheus-metrics-tracer + 1.5.0-SNAPSHOT + + + prometheus-metrics-tracer-initializer + bundle + + Prometheus Metrics Tracer Initializer + + Initialize Prometheus integrations with distributed tracing libraries. + + + + io.prometheus.metrics.tracer.initializer + + + + + io.prometheus + prometheus-metrics-tracer-common + ${project.version} + + + io.prometheus + prometheus-metrics-tracer-otel + ${project.version} + + + io.prometheus + prometheus-metrics-tracer-otel-agent + ${project.version} + + + diff --git a/prometheus-metrics-tracer/prometheus-metrics-tracer-initializer/src/main/java/io/prometheus/metrics/tracer/initializer/SpanContextSupplier.java b/prometheus-metrics-tracer/prometheus-metrics-tracer-initializer/src/main/java/io/prometheus/metrics/tracer/initializer/SpanContextSupplier.java new file mode 100644 index 000000000..0e39e19ac --- /dev/null +++ b/prometheus-metrics-tracer/prometheus-metrics-tracer-initializer/src/main/java/io/prometheus/metrics/tracer/initializer/SpanContextSupplier.java @@ -0,0 +1,47 @@ +package io.prometheus.metrics.tracer.initializer; + +import io.prometheus.metrics.tracer.agent.OpenTelemetryAgentSpanContext; +import io.prometheus.metrics.tracer.common.SpanContext; +import io.prometheus.metrics.tracer.otel.OpenTelemetrySpanContext; +import java.util.concurrent.atomic.AtomicReference; +import javax.annotation.Nullable; + +public class SpanContextSupplier { + + private static final AtomicReference spanContextRef = + new AtomicReference(); + + public static void setSpanContext(SpanContext spanContext) { + spanContextRef.set(spanContext); + } + + public static boolean hasSpanContext() { + return getSpanContext() != null; + } + + @Nullable + public static SpanContext getSpanContext() { + return spanContextRef.get(); + } + + static { + try { + if (OpenTelemetrySpanContext.isAvailable()) { + spanContextRef.set(new OpenTelemetrySpanContext()); + } + } catch (NoClassDefFoundError ignored) { + // tracer_otel dependency not found + } catch (UnsupportedClassVersionError ignored) { + // OpenTelemetry requires Java 8, but client_java might run on Java 6. + } + try { + if (OpenTelemetryAgentSpanContext.isAvailable()) { + spanContextRef.set(new OpenTelemetryAgentSpanContext()); + } + } catch (NoClassDefFoundError ignored) { + // tracer_otel_agent dependency not found + } catch (UnsupportedClassVersionError ignored) { + // OpenTelemetry requires Java 8, but client_java might run on Java 6. + } + } +} diff --git a/prometheus-metrics-tracer/prometheus-metrics-tracer-initializer/version-rules.xml b/prometheus-metrics-tracer/prometheus-metrics-tracer-initializer/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-tracer/prometheus-metrics-tracer-initializer/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-tracer/prometheus-metrics-tracer-otel-agent/pom.xml b/prometheus-metrics-tracer/prometheus-metrics-tracer-otel-agent/pom.xml new file mode 100644 index 000000000..be140167d --- /dev/null +++ b/prometheus-metrics-tracer/prometheus-metrics-tracer-otel-agent/pom.xml @@ -0,0 +1,68 @@ + + + 4.0.0 + + + io.prometheus + prometheus-metrics-tracer + 1.5.0-SNAPSHOT + + + prometheus-metrics-tracer-otel-agent + bundle + + Prometheus Metrics Tracer OpenTelemetry Agent + + Prometheus integration with the OpenTelemetry Java agent for distributed tracing. + + + + io.prometheus.metrics.tracer.otel_agent + + + + + io.prometheus + prometheus-metrics-tracer-common + ${project.version} + + + io.opentelemetry + opentelemetry-api + provided + true + + + + + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + io.opentelemetry.api + io.opentelemetry.javaagent.shaded.io.opentelemetry.api + + + + + io.prometheus:prometheus-metrics-tracer-common + + + + + + + + + diff --git a/prometheus-metrics-tracer/prometheus-metrics-tracer-otel-agent/src/main/java/io/prometheus/metrics/tracer/agent/OpenTelemetryAgentSpanContext.java b/prometheus-metrics-tracer/prometheus-metrics-tracer-otel-agent/src/main/java/io/prometheus/metrics/tracer/agent/OpenTelemetryAgentSpanContext.java new file mode 100644 index 000000000..265995cb8 --- /dev/null +++ b/prometheus-metrics-tracer/prometheus-metrics-tracer-otel-agent/src/main/java/io/prometheus/metrics/tracer/agent/OpenTelemetryAgentSpanContext.java @@ -0,0 +1,57 @@ +package io.prometheus.metrics.tracer.agent; + +import io.opentelemetry.api.trace.Span; +import io.opentelemetry.api.trace.SpanId; +import io.opentelemetry.api.trace.TraceId; +import io.prometheus.metrics.tracer.common.SpanContext; +import javax.annotation.Nullable; + +/** + * This is exactly the same as the {@code OpenTelemetrySpanContextSupplier}. However, the {@code + * io.opentelemetry.api} package is relocated to {@code + * io.opentelemetry.javaagent.shaded.io.opentelemetry.api} in the OpenTelemetry agent. + */ +public class OpenTelemetryAgentSpanContext implements SpanContext { + + public static boolean isAvailable() { + try { + OpenTelemetryAgentSpanContext test = new OpenTelemetryAgentSpanContext(); + test.getCurrentSpanId(); + test.getCurrentTraceId(); + test.isCurrentSpanSampled(); + return true; + } catch (LinkageError ignored) { + // NoClassDefFoundError: + // Either OpenTelemetry is not present, or it is version 0.9.1 or older when + // io.opentelemetry.api.trace.Span did not exist. + // IncompatibleClassChangeError: + // The application uses an OpenTelemetry version between 0.10.0 and 0.15.0 when SpanContext + // was a class, and not an interface. + return false; + } + } + + @Override + @Nullable + public String getCurrentTraceId() { + String traceId = Span.current().getSpanContext().getTraceId(); + return TraceId.isValid(traceId) ? traceId : null; + } + + @Override + @Nullable + public String getCurrentSpanId() { + String spanId = Span.current().getSpanContext().getSpanId(); + return SpanId.isValid(spanId) ? spanId : null; + } + + @Override + public boolean isCurrentSpanSampled() { + return Span.current().getSpanContext().isSampled(); + } + + @Override + public void markCurrentSpanAsExemplar() { + Span.current().setAttribute(EXEMPLAR_ATTRIBUTE_NAME, EXEMPLAR_ATTRIBUTE_VALUE); + } +} diff --git a/prometheus-metrics-tracer/prometheus-metrics-tracer-otel-agent/version-rules.xml b/prometheus-metrics-tracer/prometheus-metrics-tracer-otel-agent/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-tracer/prometheus-metrics-tracer-otel-agent/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-tracer/prometheus-metrics-tracer-otel/pom.xml b/prometheus-metrics-tracer/prometheus-metrics-tracer-otel/pom.xml new file mode 100644 index 000000000..3dda51c6b --- /dev/null +++ b/prometheus-metrics-tracer/prometheus-metrics-tracer-otel/pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + + + io.prometheus + prometheus-metrics-tracer + 1.5.0-SNAPSHOT + + + prometheus-metrics-tracer-otel + bundle + + Prometheus Metrics Tracer OpenTelemetry + + Prometheus integration with the OpenTelemetry distributed tracing library. + + + + io.prometheus.metrics.tracer.otel + + + + + io.prometheus + prometheus-metrics-tracer-common + ${project.version} + + + io.opentelemetry + opentelemetry-api + provided + true + + + diff --git a/prometheus-metrics-tracer/prometheus-metrics-tracer-otel/src/main/java/io/prometheus/metrics/tracer/otel/OpenTelemetrySpanContext.java b/prometheus-metrics-tracer/prometheus-metrics-tracer-otel/src/main/java/io/prometheus/metrics/tracer/otel/OpenTelemetrySpanContext.java new file mode 100644 index 000000000..d760cdff2 --- /dev/null +++ b/prometheus-metrics-tracer/prometheus-metrics-tracer-otel/src/main/java/io/prometheus/metrics/tracer/otel/OpenTelemetrySpanContext.java @@ -0,0 +1,52 @@ +package io.prometheus.metrics.tracer.otel; + +import io.opentelemetry.api.trace.Span; +import io.opentelemetry.api.trace.SpanId; +import io.opentelemetry.api.trace.TraceId; +import io.prometheus.metrics.tracer.common.SpanContext; +import javax.annotation.Nullable; + +public class OpenTelemetrySpanContext implements SpanContext { + + public static boolean isAvailable() { + try { + OpenTelemetrySpanContext test = new OpenTelemetrySpanContext(); + test.getCurrentSpanId(); + test.getCurrentTraceId(); + test.isCurrentSpanSampled(); + return true; + } catch (LinkageError ignored) { + // NoClassDefFoundError: + // Either OpenTelemetry is not present, or it is version 0.9.1 or older when + // io.opentelemetry.api.trace.Span did not exist. + // IncompatibleClassChangeError: + // The application uses an OpenTelemetry version between 0.10.0 and 0.15.0 when SpanContext + // was a class, and not an interface. + return false; + } + } + + @Override + @Nullable + public String getCurrentTraceId() { + String traceId = Span.current().getSpanContext().getTraceId(); + return TraceId.isValid(traceId) ? traceId : null; + } + + @Override + @Nullable + public String getCurrentSpanId() { + String spanId = Span.current().getSpanContext().getSpanId(); + return SpanId.isValid(spanId) ? spanId : null; + } + + @Override + public boolean isCurrentSpanSampled() { + return Span.current().getSpanContext().isSampled(); + } + + @Override + public void markCurrentSpanAsExemplar() { + Span.current().setAttribute(EXEMPLAR_ATTRIBUTE_NAME, EXEMPLAR_ATTRIBUTE_VALUE); + } +} diff --git a/prometheus-metrics-tracer/prometheus-metrics-tracer-otel/version-rules.xml b/prometheus-metrics-tracer/prometheus-metrics-tracer-otel/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-tracer/prometheus-metrics-tracer-otel/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/prometheus-metrics-tracer/version-rules.xml b/prometheus-metrics-tracer/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/prometheus-metrics-tracer/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/simpleclient-archive/README.md b/simpleclient-archive/README.md new file mode 100644 index 000000000..c61f46758 --- /dev/null +++ b/simpleclient-archive/README.md @@ -0,0 +1,7 @@ +# Archived simpleclient modules + +This is not functional source code. We just keep these files around so we don't +lose the GitHub history once we copy them to the new 1.0.x modules. + +If you are looking for the source code for the latest 0.x.x release, see +the [simpleclient](https://github.com/prometheus/client_java/tree/simpleclient) branch. diff --git a/simpleclient-archive/integration_tests/it_common/pom.xml b/simpleclient-archive/integration_tests/it_common/pom.xml new file mode 100644 index 000000000..46ec6cead --- /dev/null +++ b/simpleclient-archive/integration_tests/it_common/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + + + io.prometheus + integration_tests + 1.0.0-beta-2-SNAPSHOT + + + it_common + Integration Tests - Common Utilities + + + + org.testcontainers + testcontainers + test + + + com.squareup.okhttp3 + okhttp + test + + + + + + + src/test/resources + true + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + + + + diff --git a/simpleclient-archive/integration_tests/it_common/src/test/java/io/prometheus/client/it/common/Downloader.java b/simpleclient-archive/integration_tests/it_common/src/test/java/io/prometheus/client/it/common/Downloader.java new file mode 100644 index 000000000..dfc5c96e7 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_common/src/test/java/io/prometheus/client/it/common/Downloader.java @@ -0,0 +1,36 @@ +package io.prometheus.client.it.common; + +import java.io.*; +import java.net.URISyntaxException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; + +public class Downloader { + + /** Download a file from an HTTP URL and store it in the target/ directory. */ + public static void downloadToTarget(String url, String fileName) + throws IOException, URISyntaxException { + Path destination = + Paths.get(Downloader.class.getResource("/").toURI()).getParent().resolve(fileName); + if (Files.exists(destination)) { + return; // only download once + } + System.out.println("Downloading " + url); + OkHttpClient client = new OkHttpClient(); + Request request = new Request.Builder().url(url).build(); + Response response = client.newCall(request).execute(); + InputStream responseBody = response.body().byteStream(); + OutputStream output = new FileOutputStream(destination.toFile()); + byte[] data = new byte[1024]; + int count; + while ((count = responseBody.read(data)) != -1) { + output.write(data, 0, count); + } + output.close(); + responseBody.close(); + } +} diff --git a/simpleclient-archive/integration_tests/it_common/src/test/java/io/prometheus/client/it/common/LogConsumer.java b/simpleclient-archive/integration_tests/it_common/src/test/java/io/prometheus/client/it/common/LogConsumer.java new file mode 100644 index 000000000..0e6cfbcc6 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_common/src/test/java/io/prometheus/client/it/common/LogConsumer.java @@ -0,0 +1,33 @@ +package io.prometheus.client.it.common; + +import java.util.function.Consumer; +import org.testcontainers.containers.output.OutputFrame; + +/** Print Docker logs from TestContainers to stdout or stderr. */ +public class LogConsumer implements Consumer { + + private final String prefix; + + private LogConsumer(String prefix) { + this.prefix = prefix; + } + + public static LogConsumer withPrefix(String prefix) { + return new LogConsumer(prefix); + } + + @Override + public void accept(OutputFrame outputFrame) { + switch (outputFrame.getType()) { + case STDOUT: + System.out.print(prefix + " - " + outputFrame.getUtf8String()); + break; + case END: + System.out.println(prefix + " - END"); + break; + default: // STDERR or unexpected + System.err.print(prefix + " - " + outputFrame.getUtf8String()); + break; + } + } +} diff --git a/simpleclient-archive/integration_tests/it_common/src/test/java/io/prometheus/client/it/common/Scraper.java b/simpleclient-archive/integration_tests/it_common/src/test/java/io/prometheus/client/it/common/Scraper.java new file mode 100644 index 000000000..31826aef3 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_common/src/test/java/io/prometheus/client/it/common/Scraper.java @@ -0,0 +1,56 @@ +package io.prometheus.client.it.common; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import okhttp3.Credentials; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import org.junit.Assert; + +/** Scrape metrics via HTTP */ +public class Scraper { + + /** Scrape metrics from url without authentication. */ + public static List scrape(String url, long timeoutMillis) { + return scrape(url, null, null, timeoutMillis); + } + + /** Scrape metrics from url with HTTP basic authentication. */ + public static List scrape(String url, String user, String password, long timeoutMillis) { + OkHttpClient client = new OkHttpClient(); + long start = System.currentTimeMillis(); + Exception exception = null; + while (System.currentTimeMillis() - start < timeoutMillis) { + try { + Request.Builder requestBuilder = + new Request.Builder() + .header("Accept", "application/openmetrics-text; version=1.0.0; charset=utf-8") + .url(url); + if (user != null && password != null) { + requestBuilder.header("Authorization", Credentials.basic(user, password)); + } + Request request = requestBuilder.build(); + try (Response response = client.newCall(request).execute()) { + if (response.code() != 200) { + throw new IOException( + "Received HTTP Status " + response.code() + ": " + response.body().string()); + } + return Arrays.asList(response.body().string().split("\\n")); + } + } catch (Exception e) { + exception = e; + try { + Thread.sleep(100); + } catch (InterruptedException ignored) { + } + } + } + if (exception != null) { + exception.printStackTrace(); + } + Assert.fail("timeout while getting metrics from " + url); + return null; // will not happen + } +} diff --git a/simpleclient-archive/integration_tests/it_common/src/test/java/io/prometheus/client/it/common/Version.java b/simpleclient-archive/integration_tests/it_common/src/test/java/io/prometheus/client/it/common/Version.java new file mode 100644 index 000000000..d96f58485 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_common/src/test/java/io/prometheus/client/it/common/Version.java @@ -0,0 +1,14 @@ +package io.prometheus.client.it.common; + +import java.io.IOException; +import java.util.Properties; + +/** Utility to get the project version, like 0.12.1-SNAPSHOT */ +public class Version { + + public static String loadProjectVersion() throws IOException { + Properties properties = new Properties(); + properties.load(Volume.class.getResourceAsStream("/project_version.properties")); + return properties.getProperty("project.version"); + } +} diff --git a/simpleclient-archive/integration_tests/it_common/src/test/java/io/prometheus/client/it/common/Volume.java b/simpleclient-archive/integration_tests/it_common/src/test/java/io/prometheus/client/it/common/Volume.java new file mode 100644 index 000000000..d168342cf --- /dev/null +++ b/simpleclient-archive/integration_tests/it_common/src/test/java/io/prometheus/client/it/common/Volume.java @@ -0,0 +1,99 @@ +package io.prometheus.client.it.common; + +import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; + +import java.io.File; +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.file.*; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.function.Predicate; +import org.junit.Assert; + +/** Temporary directory in ./target/ to be mounted as a volume in Docker containers. */ +public class Volume { + + private final Path tmpDir; // will be created in the ./target/ directory + + private Volume(Path tmpDir) { + this.tmpDir = tmpDir; + } + + public static Volume create(String prefix) throws IOException, URISyntaxException { + Path targetDir = Paths.get(Volume.class.getResource("/").toURI()).getParent(); + Assert.assertEquals( + "failed to locate target/ directory", "target", targetDir.getFileName().toString()); + return new Volume(Files.createTempDirectory(targetDir, prefix + "-")); + } + + /** Copy a file or directory from ./target/ into the tmpDir */ + public Volume copyFromTargetDirectory(String name) throws IOException { + Path src = tmpDir.getParent().resolve(name); + if (Files.isRegularFile(src)) { + Files.copy(src, tmpDir.resolve(src.getFileName()), REPLACE_EXISTING); + } else if (Files.isDirectory(src)) { + Path dest = tmpDir.resolve(src.getFileName()); + Files.createDirectories(dest); + Files.walkFileTree( + src, + new SimpleFileVisitor() { + + // create parent directories + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) + throws IOException { + Files.createDirectories(dest.resolve(src.relativize(dir))); + return FileVisitResult.CONTINUE; + } + + // copy file + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) + throws IOException { + Files.copy(file, dest.resolve(src.relativize(file)), REPLACE_EXISTING); + return FileVisitResult.CONTINUE; + } + }); + } else { + Assert.fail(name + ": No such file or directory"); + } + return this; + } + + /** Remove files in tmpDir if they match the predicate. */ + public void rm(Predicate predicate) throws IOException { + Files.walkFileTree( + tmpDir, + new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) + throws IOException { + if (predicate.test(file)) { + Files.delete(file); + } + return FileVisitResult.CONTINUE; + } + }); + } + + public String getHostPath() { + return tmpDir.toString(); + } + + /** Recursively remove tmpDir and its contents. */ + public void remove() throws IOException { + if (!deleteRecursively(tmpDir.toFile())) { + throw new IOException(tmpDir + ": Failed to remove temporary test directory."); + } + } + + private boolean deleteRecursively(File file) { + File[] allContents = file.listFiles(); + if (allContents != null) { + for (File child : allContents) { + deleteRecursively(child); + } + } + return file.delete(); + } +} diff --git a/simpleclient-archive/integration_tests/it_common/src/test/resources/project_version.properties b/simpleclient-archive/integration_tests/it_common/src/test/resources/project_version.properties new file mode 100644 index 000000000..3c459b19d --- /dev/null +++ b/simpleclient-archive/integration_tests/it_common/src/test/resources/project_version.properties @@ -0,0 +1,3 @@ +# ${project.version} will be replaced by Maven at built time +# when this file is copied to the target/ directory. +project.version=${project.version} diff --git a/simpleclient-archive/integration_tests/it_common/version-rules.xml b/simpleclient-archive/integration_tests/it_common/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/simpleclient-archive/integration_tests/it_common/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/simpleclient-archive/integration_tests/it_exemplars_otel_agent/pom.xml b/simpleclient-archive/integration_tests/it_exemplars_otel_agent/pom.xml new file mode 100644 index 000000000..4a70ea136 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_exemplars_otel_agent/pom.xml @@ -0,0 +1,95 @@ + + + 4.0.0 + + + io.prometheus + integration_tests + 1.0.0-beta-2-SNAPSHOT + + + it_exemplars_otel_agent + Integration Tests - Exemplars with the OpenTelemetry Agent + + + + + org.springframework.boot + spring-boot-dependencies + 2.6.3 + pom + import + + + io.prometheus + simpleclient_bom + ${project.version} + pom + import + + + + + + + org.springframework.boot + spring-boot-starter-web + + + com.squareup.okhttp3 + okhttp + compile + + + io.prometheus + simpleclient_hotspot + ${project.version} + + + io.prometheus + simpleclient_servlet + ${project.version} + + + org.testcontainers + testcontainers + test + + + ch.qos.logback + logback-classic + 1.2.13 + test + + + io.prometheus + it_common + test-jar + ${project.version} + test + + + + + example-spring-boot-app + + + org.springframework.boot + spring-boot-maven-plugin + 2.7.6 + + + + repackage + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + diff --git a/simpleclient-archive/integration_tests/it_exemplars_otel_agent/src/main/java/io/prometheus/client/it/exemplars_otel_agent/ExampleSpringBootApp.java b/simpleclient-archive/integration_tests/it_exemplars_otel_agent/src/main/java/io/prometheus/client/it/exemplars_otel_agent/ExampleSpringBootApp.java new file mode 100644 index 000000000..d07c4d443 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_exemplars_otel_agent/src/main/java/io/prometheus/client/it/exemplars_otel_agent/ExampleSpringBootApp.java @@ -0,0 +1,117 @@ +package io.prometheus.client.it.exemplars_otel_agent; + +import io.prometheus.client.Counter; +import io.prometheus.client.Gauge; +import io.prometheus.client.Histogram; +import io.prometheus.client.Summary; +import io.prometheus.client.exporter.MetricsServlet; +import io.prometheus.client.hotspot.DefaultExports; +import java.io.IOException; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * The OpenTelemetry agent supports Spring Boot out-of-the-box. We use this Spring Boot example to + * test whether OpenTelemetry Traces created by the OpenTelemetry agent will be picked up as + * Exemplars by the Prometheus client_java library. + */ +@SpringBootApplication +@RestController +public class ExampleSpringBootApp { + + private double durationOuterMs = 0.5; + private double durationInnerMs = 0.3; + + private final OkHttpClient client = new OkHttpClient(); + + // Counter should have Exemplars when the OpenTelemetry agent is attached. + private final Counter requestCounter = + Counter.build() + .name("requests_total") + .help("Total number of requests.") + .labelNames("path") + .register(); + + // Gauges don't have Exemplars. + private final Gauge lastRequestTimestamp = + Gauge.build() + .name("last_request_timestamp") + .help("unix time of the last request") + .labelNames("path") + .register(); + + // Histogram should have Exemplars when the OpenTelemetry agent is attached. + private final Histogram requestDurationHistogram = + Histogram.build() + .name("request_duration_histogram") + .help("Request duration in seconds") + .labelNames("path") + .buckets(0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009) + .register(); + + // Summaries don't have Exemplars + private final Summary requestDurationSummary = + Summary.build() + .name("request_duration_summary") + .help("Request duration in seconds") + .labelNames("path") + .quantile(0.75, 0.01) + .quantile(0.85, 0.01) + .register(); + + public static void main(String[] args) { + DefaultExports.initialize(); + SpringApplication.run(ExampleSpringBootApp.class, args); + } + + /** + * GET /hello will trigger a GET request to /god-of-fire. That way, we get a nice distributed + * trace for the OpenTelemetry agent. + */ + @GetMapping("/hello") + public String hello() throws IOException { + String path = "/hello"; + requestCounter.labels(path).inc(); + lastRequestTimestamp.labels(path).setToCurrentTime(); + requestDurationHistogram.labels(path).observe(durationOuterMs / 1000.0); + requestDurationSummary.labels(path).observe(durationOuterMs / 1000.0); + durationOuterMs += 1; + if (durationOuterMs > 10) { + durationOuterMs = 0.5; + } + Request request = new Request.Builder().url("http://localhost:8080/god-of-fire").build(); + try (Response response = client.newCall(request).execute()) { + return "Hello, " + response.body().string() + "!\n"; + } + } + + @GetMapping("/god-of-fire") + public String godOfFire() { + String path = "/god-of-fire"; + requestCounter.labels(path).inc(); + lastRequestTimestamp.labels(path).setToCurrentTime(); + requestDurationHistogram.labels(path).observe(durationInnerMs / 1000.0); + requestDurationSummary.labels(path).observe(durationInnerMs / 1000.0); + durationInnerMs += 1; + if (durationInnerMs > 10) { + durationInnerMs = 0.3; + } + return "Prometheus"; + } + + /** Expose Prometheus metrics. */ + @Bean + public ServletRegistrationBean metricsServlet() { + ServletRegistrationBean bean = + new ServletRegistrationBean<>(new MetricsServlet(), "/metrics"); + bean.setLoadOnStartup(1); + return bean; + } +} diff --git a/simpleclient-archive/integration_tests/it_exemplars_otel_agent/src/main/resources/application.properties b/simpleclient-archive/integration_tests/it_exemplars_otel_agent/src/main/resources/application.properties new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_exemplars_otel_agent/src/main/resources/application.properties @@ -0,0 +1 @@ + diff --git a/simpleclient-archive/integration_tests/it_exemplars_otel_agent/src/test/java/io/prometheus/client/it/exemplars_otel_agent/ExemplarsOpenTelemetryAgentIT.java b/simpleclient-archive/integration_tests/it_exemplars_otel_agent/src/test/java/io/prometheus/client/it/exemplars_otel_agent/ExemplarsOpenTelemetryAgentIT.java new file mode 100644 index 000000000..6ba3dca87 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_exemplars_otel_agent/src/test/java/io/prometheus/client/it/exemplars_otel_agent/ExemplarsOpenTelemetryAgentIT.java @@ -0,0 +1,290 @@ +package io.prometheus.client.it.exemplars_otel_agent; + +import io.prometheus.client.it.common.*; +import java.io.IOException; +import java.net.URISyntaxException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.testcontainers.containers.BindMode; +import org.testcontainers.containers.GenericContainer; + +/** Test if traces from the OpenTelemetry agent are picked up as Exemplars. */ +public class ExemplarsOpenTelemetryAgentIT { + + private final String image = "openjdk:11-jre"; + private final String otelAgentVersion = "1.10.1"; + private final Volume volume; + private final GenericContainer javaContainer; + + public ExemplarsOpenTelemetryAgentIT() throws IOException, URISyntaxException { + String appJar = "example-spring-boot-app.jar"; + String agentJar = "opentelemetry-javaagent.jar"; + String agentDownloadUrl = + "https://github.com/open-telemetry/opentelemetry-java-instrumentation/" + + "releases/download/v" + + otelAgentVersion + + "/" + + agentJar; + Downloader.downloadToTarget(agentDownloadUrl, agentJar); + this.volume = + Volume.create("exemplars-otel-agent-test") + .copyFromTargetDirectory(appJar) + .copyFromTargetDirectory(agentJar); + String[] cmd = + new String[] { + "java", + "-Dotel.traces.exporter=logging", + "-Dotel.metrics.exporter=none", + "-Dotel.traces.sampler=always_on", + "-javaagent:/app/" + agentJar, + "-jar", + "/app/" + appJar + }; + System.out.println("Volume directory: " + volume.getHostPath()); + System.out.println("Command: " + String.join(" ", cmd)); + System.out.println("Docker image: " + image); + javaContainer = + new GenericContainer<>(image) + .withFileSystemBind(volume.getHostPath(), "/app", BindMode.READ_ONLY) + .withWorkingDirectory("/app") + .withLogConsumer(LogConsumer.withPrefix(image)) + .withExposedPorts(8080) + .withCommand(cmd); + } + + @Before + public void setUp() { + javaContainer.start(); + } + + @After + public void tearDown() throws IOException { + javaContainer.stop(); + volume.remove(); + } + + @Test + public void testExemplars() throws IOException, URISyntaxException { + String metricsUrl = "http://localhost:" + javaContainer.getMappedPort(8080) + "/metrics"; + + // --------------------------------------------------- + // first request + // --------------------------------------------------- + + callHelloWorldEndpoint(); + List metrics = Scraper.scrape(metricsUrl, 10_000); + SpanContext outer = + getSpanContext( + metrics, "request_duration_histogram_bucket", "path", "/hello", "le", "0.001"); + SpanContext inner = + getSpanContext( + metrics, "request_duration_histogram_bucket", "path", "/god-of-fire", "le", "0.001"); + Assert.assertEquals(outer.traceId, inner.traceId); + Assert.assertNotEquals(outer.spanId, inner.spanId); + + // counter + assertExemplar(outer, metrics, "requests_total", "path", "/hello"); + assertNoExemplar(metrics, "requests_created", "path", "/hello"); + assertExemplar(inner, metrics, "requests_total", "path", "/god-of-fire"); + assertNoExemplar(metrics, "requests_created", "path", "/god-of-fire"); + + // gauge (Gauges don't have Exemplars according to the OpenMetrics Spec) + assertNoExemplar(metrics, "last_request_timestamp", "path", "/hello"); + assertNoExemplar(metrics, "last_request_timestamp", "path", "/god-of-fire"); + + // histogram: simulated duration is 0.5ms for the outer and 0.3ms for the inner request + assertExemplar( + outer, metrics, "request_duration_histogram_bucket", "path", "/hello", "le", "0.001"); + assertExemplar( + inner, metrics, "request_duration_histogram_bucket", "path", "/god-of-fire", "le", "0.001"); + for (int i = 2; i <= 9; i++) { + assertNoExemplar( + metrics, "request_duration_histogram_bucket", "path", "/hello", "le", "0.00" + i); + assertNoExemplar( + metrics, "request_duration_histogram_bucket", "path", "/god-of-fire", "le", "0.00" + i); + } + assertNoExemplar(metrics, "request_duration_histogram_bucket", "path", "/hello", "le", "+Inf"); + assertNoExemplar( + metrics, "request_duration_histogram_bucket", "path", "/god-of-fire", "le", "+Inf"); + + // summary: all values are identical because there is only one observation. Summaries don't have + // exempalrs + assertNoExemplar(metrics, "request_duration_summary", "path", "/hello", "quantile", "0.75"); + assertNoExemplar(metrics, "request_duration_summary", "path", "/hello", "quantile", "0.85"); + assertNoExemplar(metrics, "request_duration_summary_count", "path", "/hello"); + assertNoExemplar(metrics, "request_duration_summary_sum", "path", "/hello"); + assertNoExemplar( + metrics, "request_duration_summary", "path", "/god-of-fire", "quantile", "0.75"); + assertNoExemplar( + metrics, "request_duration_summary", "path", "/god-of-fire", "quantile", "0.85"); + assertNoExemplar(metrics, "request_duration_summary_count", "path", "/god-of-fire"); + assertNoExemplar(metrics, "request_duration_summary_sum", "path", "/god-of-fire"); + + // random unrelated metric + assertNoExemplar(metrics, "jvm_threads_current"); + + // --------------------------------------------------- + // 10 more requests + // --------------------------------------------------- + + for (int i = 0; i < 10; i++) { + callHelloWorldEndpoint(); + } + metrics = Scraper.scrape(metricsUrl, 10_000); + Map outers = new HashMap<>(); + Map inners = new HashMap<>(); + for (String bucket : + new String[] { + "0.001", "0.002", "0.003", "0.004", "0.005", "0.006", "0.007", "0.008", "0.009", "+Inf" + }) { + outers.put( + bucket, + getSpanContext( + metrics, "request_duration_histogram_bucket", "path", "/hello", "le", bucket)); + inners.put( + bucket, + getSpanContext( + metrics, "request_duration_histogram_bucket", "path", "/god-of-fire", "le", bucket)); + } + + // counter: not updated, because the minimum retention interval is not over yet + assertExemplar(outer, metrics, "requests_total", "path", "/hello"); + assertNoExemplar(metrics, "requests_created", "path", "/hello"); + assertExemplar(inner, metrics, "requests_total", "path", "/god-of-fire"); + assertNoExemplar(metrics, "requests_created", "path", "/god-of-fire"); + + // gauge (still no Exemplar) + assertNoExemplar(metrics, "last_request_timestamp", "path", "/hello"); + assertNoExemplar(metrics, "last_request_timestamp", "path", "/god-of-fire"); + + // histogram + assertHistogramAfterMoreThenTenCalls(outers, inners); + + // summary: each call is 1ms slower than the previous one, up to 10ms, then we start again. + assertNoExemplar(metrics, "request_duration_summary", "path", "/hello", "quantile", "0.75"); + assertNoExemplar(metrics, "request_duration_summary", "path", "/hello", "quantile", "0.85"); + assertNoExemplar(metrics, "request_duration_summary_count", "path", "/hello"); + assertNoExemplar(metrics, "request_duration_summary_sum", "path", "/hello"); + assertNoExemplar( + metrics, "request_duration_summary", "path", "/god-of-fire", "quantile", "0.75"); + assertNoExemplar( + metrics, "request_duration_summary", "path", "/god-of-fire", "quantile", "0.85"); + assertNoExemplar(metrics, "request_duration_summary_count", "path", "/god-of-fire"); + assertNoExemplar(metrics, "request_duration_summary_sum", "path", "/god-of-fire"); + + // random unrelated metric + assertNoExemplar(metrics, "jvm_threads_current"); + } + + private void assertHistogramAfterMoreThenTenCalls( + Map outers, Map inners) { + for (String outerKey : outers.keySet()) { + for (String innerKey : inners.keySet()) { + if (outerKey.equals(innerKey)) { + // same bucket == same trace, because the sample application simulates the same duration + // for both calls + Assert.assertEquals(outers.get(outerKey).traceId, inners.get(innerKey).traceId); + } else { + // different bucket -> different trace + Assert.assertNotEquals(outers.get(outerKey).traceId, inners.get(innerKey).traceId); + } + // span ids are unique + Assert.assertNotEquals(outers.get(outerKey).spanId, inners.get(innerKey).spanId); + } + } + } + + private void assertExemplar( + SpanContext spanContext, List responseBody, String metricName, String... labels) { + String prefix = makeFullMetricName(metricName, labels); + for (String line : responseBody) { + if (line.startsWith(prefix)) { + String exemplarLabels = + "# {span_id=\"" + spanContext.spanId + "\",trace_id=\"" + spanContext.traceId + "\"}"; + String message = + prefix + " did not have the expected exemplar labels " + exemplarLabels + ":\n" + line; + Assert.assertTrue(message, line.contains(exemplarLabels)); + return; + } + } + Assert.fail(prefix + " metric not found"); + } + + private void assertNoExemplar(List responseBody, String metricName, String... labels) { + String prefix = makeFullMetricName(metricName, labels); + for (String line : responseBody) { + if (line.startsWith(prefix)) { + if (line.contains("trace_id")) { + Assert.fail("unexpected exemplars in metric:\n" + line); + } else { + return; + } + } + } + Assert.fail(prefix + " metric not found"); + } + + private void callHelloWorldEndpoint() throws IOException { + String helloUrl = "http://localhost:" + javaContainer.getMappedPort(8080) + "/hello"; + OkHttpClient client = new OkHttpClient(); + Request request = new Request.Builder().url(helloUrl).build(); + try (Response response = client.newCall(request).execute()) { + Assert.assertEquals("Hello, Prometheus!\n", response.body().string()); + } + } + + private static class SpanContext { + final String spanId; + final String traceId; + + private SpanContext(String spanId, String traceId) { + this.spanId = spanId; + this.traceId = traceId; + } + } + + private SpanContext getSpanContext( + List responseBody, String metricName, String... labels) { + String prefix = makeFullMetricName(metricName, labels); + Pattern pattern = Pattern.compile(".*span_id=\"([0-9a-f]+)\",trace_id=\"([0-9a-f]+).*"); + for (String line : responseBody) { + if (line.startsWith(prefix)) { + Matcher matcher = pattern.matcher(line); + Assert.assertTrue(prefix + " should have an exemplar", matcher.matches()); + return new SpanContext(matcher.group(1), matcher.group(2)); + } + } + Assert.fail(prefix + " not found"); + return null; + } + + // does not need to be perfect, it's ok if this works for the examples used in this test + private String makeFullMetricName(String metricName, String... labels) { + if (labels.length % 2 != 0) { + throw new IllegalArgumentException("labels must be a list of key/value pairs"); + } + if (labels.length == 0) { + return metricName; + } else { + StringBuilder result = new StringBuilder().append(metricName).append("{"); + for (int i = 0; i < labels.length; i += 2) { + if (i > 0) { + result.append(","); + } + result.append(labels[i]).append("=\"").append(labels[i + 1]).append("\""); + } + result.append("}"); + return result.toString(); + } + } +} diff --git a/simpleclient-archive/integration_tests/it_exemplars_otel_agent/src/test/resources/logback-test.xml b/simpleclient-archive/integration_tests/it_exemplars_otel_agent/src/test/resources/logback-test.xml new file mode 100644 index 000000000..1b7a25aa0 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_exemplars_otel_agent/src/test/resources/logback-test.xml @@ -0,0 +1,14 @@ + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + + + + + + + \ No newline at end of file diff --git a/simpleclient-archive/integration_tests/it_exemplars_otel_agent/version-rules.xml b/simpleclient-archive/integration_tests/it_exemplars_otel_agent/version-rules.xml new file mode 100644 index 000000000..2cd86fb7b --- /dev/null +++ b/simpleclient-archive/integration_tests/it_exemplars_otel_agent/version-rules.xml @@ -0,0 +1,11 @@ + + + + + .*alpha.* + + + + diff --git a/simpleclient-archive/integration_tests/it_exemplars_otel_sdk/pom.xml b/simpleclient-archive/integration_tests/it_exemplars_otel_sdk/pom.xml new file mode 100644 index 000000000..213dd63f7 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_exemplars_otel_sdk/pom.xml @@ -0,0 +1,86 @@ + + + 4.0.0 + + + io.prometheus + integration_tests + 1.0.0-beta-2-SNAPSHOT + + + it_exemplars_otel_sdk + Integration Tests - Exemplars with OpenTelemetry + + + 1.10.1 + + + + + io.prometheus + simpleclient + ${project.version} + + + io.opentelemetry + opentelemetry-api + ${otel.version} + + + io.opentelemetry + opentelemetry-sdk + ${otel.version} + + + io.prometheus + simpleclient_httpserver + ${project.version} + + + io.prometheus + it_common + test-jar + ${project.version} + test + + + com.squareup.okhttp3 + okhttp + test + + + org.testcontainers + testcontainers + test + + + ch.qos.logback + logback-classic + test + + + + + example-open-telemetry-app + + + org.apache.maven.plugins + maven-failsafe-plugin + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + package + + copy-dependencies + + + + + + + diff --git a/simpleclient-archive/integration_tests/it_exemplars_otel_sdk/src/main/java/io/prometheus/client/it/exemplars_otel/ExampleApplication.java b/simpleclient-archive/integration_tests/it_exemplars_otel_sdk/src/main/java/io/prometheus/client/it/exemplars_otel/ExampleApplication.java new file mode 100644 index 000000000..0473a36cd --- /dev/null +++ b/simpleclient-archive/integration_tests/it_exemplars_otel_sdk/src/main/java/io/prometheus/client/it/exemplars_otel/ExampleApplication.java @@ -0,0 +1,68 @@ +package io.prometheus.client.it.exemplars_otel; + +import io.opentelemetry.api.trace.Span; +import io.opentelemetry.api.trace.Tracer; +import io.opentelemetry.sdk.trace.SdkTracerProvider; +import io.prometheus.client.Counter; +import io.prometheus.client.exporter.HTTPServer; +import java.io.IOException; + +/** Example application using the OpenTelemetry SDK. */ +public class ExampleApplication { + + public static void main(String[] args) throws IOException, InterruptedException { + Counter counter = Counter.build().name("test").help("help").register(); + + // The following code compiles with OpenTelemetry versions 0.13.0 and higher. + // Starting with 0.16.0 you will see exemplars. With 0.15.0 or lower the code will run but you + // won't see exemplars. + System.out.println(Tracer.class.getProtectionDomain().getCodeSource().getLocation()); + Tracer tracer = SdkTracerProvider.builder().build().get(null); + Span span = tracer.spanBuilder("my span").startSpan(); + span.makeCurrent(); + counter.inc(1); + span.end(); + + // Examples with older OpenTelemetry versions used for manual testing: + + /* + // OpenTelemetry versions 0.10.0 - 0.12.0 + System.out.println(Tracer.class.getProtectionDomain().getCodeSource().getLocation()); + Tracer tracer = OpenTelemetrySdk.get().getTracer("test"); + Span span = tracer.spanBuilder("my span").startSpan(); + span.makeCurrent(); + counter.inc(1); + span.end(); + */ + + /* + // OpenTelemetry versions 0.4.0 - 0.9.1 + System.out.println(TracerSdkProvider.class.getProtectionDomain().getCodeSource().getLocation()); + Tracer tracer = TracerSdkProvider.builder().build().get("test"); + Span span = tracer.spanBuilder("my span").startSpan(); + counter.inc(1); + span.end(); + */ + + /* + // OpenTelemetry version 0.3.0 + System.out.println(TracerSdkProvider.class.getProtectionDomain().getCodeSource().getLocation()); + TracerSdk tracer = TracerSdkProvider.builder().build().get("test"); + Span span = tracer.spanBuilder("my span").startSpan(); + counter.inc(1); + span.end(); + */ + + /* + // OpenTelemetry version 0.2.0 + System.out.println(TracerSdkFactory.class.getProtectionDomain().getCodeSource().getLocation()); + TracerSdk tracer = TracerSdkFactory.create().get("test"); + Span span = tracer.spanBuilder("my span").startSpan(); + counter.inc(1); + span.end(); + */ + + new HTTPServer(9000); + Thread.currentThread().join(); // sleep forever + } +} diff --git a/simpleclient-archive/integration_tests/it_exemplars_otel_sdk/src/test/java/io/prometheus/client/it/exemplars_otel/ExemplarsOpenTelemetrySdkIT.java b/simpleclient-archive/integration_tests/it_exemplars_otel_sdk/src/test/java/io/prometheus/client/it/exemplars_otel/ExemplarsOpenTelemetrySdkIT.java new file mode 100644 index 000000000..d7bbc842e --- /dev/null +++ b/simpleclient-archive/integration_tests/it_exemplars_otel_sdk/src/test/java/io/prometheus/client/it/exemplars_otel/ExemplarsOpenTelemetrySdkIT.java @@ -0,0 +1,149 @@ +package io.prometheus.client.it.exemplars_otel; + +import io.prometheus.client.it.common.LogConsumer; +import io.prometheus.client.it.common.Scraper; +import io.prometheus.client.it.common.Volume; +import java.io.IOException; +import java.net.URISyntaxException; +import java.util.List; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.testcontainers.containers.BindMode; +import org.testcontainers.containers.GenericContainer; + +/** + * Test if traces from the OpenTelemetry SDK are picked up as Exemplars. + * + *

    In addition, we make sure that missing OpenTelemetry dependencies do not cause client_java to + * crash the application. + */ +public class ExemplarsOpenTelemetrySdkIT { + + private Volume volume; + private GenericContainer javaContainer; + + private final String appJar = "example-open-telemetry-app.jar"; + private final String image = "openjdk:11-jre"; + private final String[] cmd = + new String[] {"java", "-cp", appJar + ":dependency/*", ExampleApplication.class.getName()}; + + @Before + public void setUp() throws IOException, URISyntaxException { + volume = + Volume.create("exemplars-otel-sdk-test") + .copyFromTargetDirectory(appJar) + .copyFromTargetDirectory("dependency"); + javaContainer = + new GenericContainer<>(image) + .withFileSystemBind(volume.getHostPath(), "/app", BindMode.READ_ONLY) + .withWorkingDirectory("/app") + .withLogConsumer(LogConsumer.withPrefix(image)) + .withExposedPorts(9000) + .withCommand(cmd); + System.out.println("Java image: " + image); + System.out.println("Temp dir: " + volume.getHostPath()); + System.out.println("cmd: " + String.join(" ", cmd)); + } + + @After + public void tearDown() throws IOException { + javaContainer.stop(); + volume.remove(); + } + + public void removeDependency(String prefix) throws IOException, URISyntaxException { + volume.rm(path -> path.getFileName().toString().startsWith(prefix)); + } + + /** All dependencies present -> Exemplars should be found. */ + @Test + public void testGoodCase() throws IOException { + startContainerAndValidateMetrics(true); + } + + /** + * The dependency simpleclient_tracer_otel_agent is for getting the trace context from the + * OpenTelemetry Java agent. As we are getting the trace context from the OpenTelemetry SDK and + * not from the agent, Exemplars should work. + * + *

    We test this because if a user excludes simpleclient_tracer_otel_agent from the transitive + * dependencies for some reason we don't want client_java to break. + */ + @Test + public void testOtelAgentMissing() throws IOException, URISyntaxException { + removeDependency("simpleclient_tracer_otel_agent-"); + startContainerAndValidateMetrics(true); + } + + /** + * The dependency simpleclient_tracer_otel is for getting the trace context from the OpenTelemetry + * SDK. If this dependency is missing, Exemplars will be missing, but metrics should still work. + * + *

    We test this because users may exclude simpleclient_tracer_otel as a way to disable + * OpenTelemetry Exemplars. + */ + @Test + public void testOtelSdkMissing() throws IOException, URISyntaxException { + removeDependency("simpleclient_tracer_otel-"); + startContainerAndValidateMetrics(false); + } + + /** + * This will remove both, simpleclient_tracer_otel_agent and simpleclient_tracer_otel. The + * expected result is that Exemplars are missing, but metrics still work. + */ + @Test + public void testOtelAllMissing() throws IOException, URISyntaxException { + removeDependency("simpleclient_tracer_otel"); + startContainerAndValidateMetrics(false); + } + + /** + * Without simpleclient_tracer_common, Exemplars will be missing but metrics should still work. + */ + @Test + public void testTracerCommonMissing() throws IOException, URISyntaxException { + removeDependency("simpleclient_tracer_common-"); + startContainerAndValidateMetrics(false); + } + + /** + * If a user excludes all simpleclient_tracer dependencies, Exemplars will be missing but metrics + * should still work. + */ + @Test + public void testAllMissing() throws IOException, URISyntaxException { + removeDependency("simpleclient_tracer"); + startContainerAndValidateMetrics(false); + } + + private void startContainerAndValidateMetrics(boolean exemplarsExpected) throws IOException { + javaContainer.start(); + List metrics = + Scraper.scrape( + "http://localhost:" + javaContainer.getMappedPort(9000) + "/metrics", 10_000); + boolean testTotalWithExemplarFound = false; + boolean testTotalWithoutExemplarFound = false; + for (String metric : metrics) { + System.out.println(metric); + if (metric.matches( + "^test_total 1\\.0 # \\{span_id=\"[0-9a-f]+\",trace_id=\"[0-9a-f]+\"} 1.0 [0-9.]+$")) { + testTotalWithExemplarFound = true; + } + if (metric.matches("^test_total 1\\.0$")) { + testTotalWithoutExemplarFound = true; + } + } + if (exemplarsExpected) { + Assert.assertTrue("test_total metric with exemplars expected", testTotalWithExemplarFound); + Assert.assertFalse( + "test_total without exemplar should not be there", testTotalWithoutExemplarFound); + } else { + Assert.assertFalse( + "test_total metric with exemplar should not be there", testTotalWithExemplarFound); + Assert.assertTrue("test_total without exemplar expected", testTotalWithoutExemplarFound); + } + } +} diff --git a/simpleclient-archive/integration_tests/it_exemplars_otel_sdk/src/test/resources/logback-test.xml b/simpleclient-archive/integration_tests/it_exemplars_otel_sdk/src/test/resources/logback-test.xml new file mode 100644 index 000000000..1b7a25aa0 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_exemplars_otel_sdk/src/test/resources/logback-test.xml @@ -0,0 +1,14 @@ + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + + + + + + + \ No newline at end of file diff --git a/simpleclient-archive/integration_tests/it_exemplars_otel_sdk/version-rules.xml b/simpleclient-archive/integration_tests/it_exemplars_otel_sdk/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/simpleclient-archive/integration_tests/it_exemplars_otel_sdk/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/simpleclient-archive/integration_tests/it_java_versions/pom.xml b/simpleclient-archive/integration_tests/it_java_versions/pom.xml new file mode 100644 index 000000000..19587bcc3 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_java_versions/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + + + io.prometheus + integration_tests + 1.0.0-beta-2-SNAPSHOT + + + it_java_versions + Integration Tests - Java Versions + + + + io.prometheus + simpleclient + ${project.version} + + + io.prometheus + simpleclient_hotspot + ${project.version} + + + io.prometheus + simpleclient_httpserver + ${project.version} + + + org.testcontainers + testcontainers + test + + + ch.qos.logback + logback-classic + test + + + io.prometheus + it_common + test-jar + ${project.version} + test + + + com.squareup.okhttp3 + okhttp + test + + + + + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + io.prometheus.client.it.java_versions.ExampleApplication + + + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + diff --git a/simpleclient-archive/integration_tests/it_java_versions/src/main/java/io/prometheus/client/it/java_versions/ExampleApplication.java b/simpleclient-archive/integration_tests/it_java_versions/src/main/java/io/prometheus/client/it/java_versions/ExampleApplication.java new file mode 100644 index 000000000..547eeb2da --- /dev/null +++ b/simpleclient-archive/integration_tests/it_java_versions/src/main/java/io/prometheus/client/it/java_versions/ExampleApplication.java @@ -0,0 +1,19 @@ +package io.prometheus.client.it.java_versions; + +import io.prometheus.client.Counter; +import io.prometheus.client.exporter.HTTPServer; +import io.prometheus.client.hotspot.DefaultExports; +import java.io.IOException; + +/** Simple example application that compiles with Java 6. */ +public class ExampleApplication { + + public static void main(String[] args) throws IOException, InterruptedException { + DefaultExports.initialize(); + Counter counter = + Counter.build().name("test").help("test counter").labelNames("path").register(); + counter.labels("/hello-world").inc(); + new HTTPServer(9000); + Thread.currentThread().join(); // sleep forever + } +} diff --git a/simpleclient-archive/integration_tests/it_java_versions/src/test/java/io/prometheus/client/it/java_versions/JavaVersionsIT.java b/simpleclient-archive/integration_tests/it_java_versions/src/test/java/io/prometheus/client/it/java_versions/JavaVersionsIT.java new file mode 100644 index 000000000..f039a8330 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_java_versions/src/test/java/io/prometheus/client/it/java_versions/JavaVersionsIT.java @@ -0,0 +1,90 @@ +package io.prometheus.client.it.java_versions; + +import com.github.dockerjava.api.model.Ulimit; +import io.prometheus.client.it.common.LogConsumer; +import io.prometheus.client.it.common.Scraper; +import io.prometheus.client.it.common.Version; +import io.prometheus.client.it.common.Volume; +import java.io.IOException; +import java.net.URISyntaxException; +import java.util.Arrays; +import java.util.List; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.testcontainers.containers.BindMode; +import org.testcontainers.containers.GenericContainer; + +/** Smoke test with different Java versions. */ +@RunWith(Parameterized.class) +public class JavaVersionsIT { + + private final Volume exampleApplicationDir; + private final GenericContainer javaContainer; + + @Parameterized.Parameters(name = "{0}") + public static String[] images() { + return new String[] { + + // HotSpot + "openjdk:8-jre", + "openjdk:11-jre", + "openjdk:17", + "adoptopenjdk/openjdk16:ubi-minimal-jre", + + // OpenJ9 + "ibmjava:8-jre", + "adoptopenjdk/openjdk11-openj9:alpine", + }; + } + + public JavaVersionsIT(String image) throws IOException, URISyntaxException { + String exampleApplicationJar = "it_java_versions-" + Version.loadProjectVersion() + ".jar"; + exampleApplicationDir = + Volume.create("it-java-versions").copyFromTargetDirectory(exampleApplicationJar); + javaContainer = + new GenericContainer<>(image) + .withCreateContainerCmdModifier( + c -> + c.getHostConfig() + .withUlimits(new Ulimit[] {new Ulimit("nofile", 65536L, 65536L)})) + .withFileSystemBind(exampleApplicationDir.getHostPath(), "/app", BindMode.READ_ONLY) + .withWorkingDirectory("/app") + .withLogConsumer(LogConsumer.withPrefix(image)) + .withExposedPorts(9000) + .withCommand("/bin/sh", "-c", "java -version && java -jar " + exampleApplicationJar); + } + + private final List exampleMetrics = + Arrays.asList("test_total{path=\"/hello-world\"}", "jvm_memory_bytes_used{area=\"heap\"}"); + + @Before + public void setUp() { + javaContainer.start(); + } + + @After + public void tearDown() throws IOException { + javaContainer.stop(); + exampleApplicationDir.remove(); + } + + @Test + public void testExampleMetrics() { + List metrics = + Scraper.scrape( + "http://localhost:" + javaContainer.getMappedPort(9000) + "/metrics", 10_000); + for (String metric : exampleMetrics) { + Assert.assertTrue( + metric + " not found", + metrics.stream() + .filter(m -> m.startsWith(metric + " ")) + .peek(System.out::println) + .findAny() + .isPresent()); + } + } +} diff --git a/simpleclient-archive/integration_tests/it_java_versions/src/test/resources/logback-test.xml b/simpleclient-archive/integration_tests/it_java_versions/src/test/resources/logback-test.xml new file mode 100644 index 000000000..1b7a25aa0 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_java_versions/src/test/resources/logback-test.xml @@ -0,0 +1,14 @@ + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + + + + + + + \ No newline at end of file diff --git a/simpleclient-archive/integration_tests/it_java_versions/version-rules.xml b/simpleclient-archive/integration_tests/it_java_versions/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/simpleclient-archive/integration_tests/it_java_versions/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/simpleclient-archive/integration_tests/it_log4j2/pom.xml b/simpleclient-archive/integration_tests/it_log4j2/pom.xml new file mode 100644 index 000000000..384e1de43 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_log4j2/pom.xml @@ -0,0 +1,99 @@ + + + 4.0.0 + + + io.prometheus + integration_tests + 1.0.0-beta-2-SNAPSHOT + + + it_log4j2 + Integration Tests - log4j2 + + + 2.17.2 + + + + + + + io.prometheus + simpleclient + ${project.version} + + + io.prometheus + simpleclient_log4j2 + ${project.version} + + + io.prometheus + simpleclient_httpserver + ${project.version} + + + org.apache.logging.log4j + log4j-api + ${log4j2.version} + + + org.apache.logging.log4j + log4j-core + ${log4j2.version} + + + org.testcontainers + testcontainers + test + + + ch.qos.logback + logback-classic + test + + + io.prometheus + it_common + test-jar + ${project.version} + test + + + com.squareup.okhttp3 + okhttp + test + + + + + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + io.prometheus.client.it.log4j2.ExampleApplication + + + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + diff --git a/simpleclient-archive/integration_tests/it_log4j2/src/main/java/io/prometheus/client/it/log4j2/ExampleApplication.java b/simpleclient-archive/integration_tests/it_log4j2/src/main/java/io/prometheus/client/it/log4j2/ExampleApplication.java new file mode 100644 index 000000000..8a97a5222 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_log4j2/src/main/java/io/prometheus/client/it/log4j2/ExampleApplication.java @@ -0,0 +1,22 @@ +package io.prometheus.client.it.log4j2; + +import io.prometheus.client.exporter.HTTPServer; +import java.io.IOException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** Simple example application using simpleclient_log4j2. */ +public class ExampleApplication { + + private static final Logger logger = LogManager.getLogger(ExampleApplication.class); + + public static void main(String[] args) throws IOException, InterruptedException { + + logger.debug("some debug message"); + logger.debug("another debug message"); + logger.warn("this is a warning"); + + new HTTPServer(9000); + Thread.currentThread().join(); // sleep forever + } +} diff --git a/simpleclient-archive/integration_tests/it_log4j2/src/main/resources/log4j2.xml b/simpleclient-archive/integration_tests/it_log4j2/src/main/resources/log4j2.xml new file mode 100644 index 000000000..b3dc3eb6c --- /dev/null +++ b/simpleclient-archive/integration_tests/it_log4j2/src/main/resources/log4j2.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/simpleclient-archive/integration_tests/it_log4j2/src/test/java/io/prometheus/client/it/log4j2/Log4j2IT.java b/simpleclient-archive/integration_tests/it_log4j2/src/test/java/io/prometheus/client/it/log4j2/Log4j2IT.java new file mode 100644 index 000000000..8a39b0247 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_log4j2/src/test/java/io/prometheus/client/it/log4j2/Log4j2IT.java @@ -0,0 +1,68 @@ +package io.prometheus.client.it.log4j2; + +import io.prometheus.client.it.common.LogConsumer; +import io.prometheus.client.it.common.Scraper; +import io.prometheus.client.it.common.Version; +import io.prometheus.client.it.common.Volume; +import java.io.IOException; +import java.net.URISyntaxException; +import java.util.List; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.testcontainers.containers.BindMode; +import org.testcontainers.containers.GenericContainer; + +/** Test simpleclient_log4j2. */ +public class Log4j2IT { + + private final String image = "openjdk:8-jre"; + private final Volume volume; + private final GenericContainer javaContainer; + + public Log4j2IT() throws IOException, URISyntaxException { + String exampleApplicationJar = "it_log4j2-" + Version.loadProjectVersion() + ".jar"; + volume = Volume.create("it-log4j2").copyFromTargetDirectory(exampleApplicationJar); + String[] cmd = new String[] {"java", "-jar", exampleApplicationJar}; + javaContainer = + new GenericContainer<>(image) + .withFileSystemBind(volume.getHostPath(), "/app", BindMode.READ_ONLY) + .withWorkingDirectory("/app") + .withLogConsumer(LogConsumer.withPrefix(image)) + .withExposedPorts(9000) + .withCommand(cmd); + System.out.println("Volume directory: " + volume.getHostPath()); + System.out.println("Command: " + String.join(" ", cmd)); + System.out.println("Docker image: " + image); + } + + @Before + public void setUp() { + javaContainer.start(); + } + + @After + public void tearDown() throws IOException { + javaContainer.stop(); + volume.remove(); + } + + @Test + public void testLog4j2Metrics() { + List metrics = + Scraper.scrape( + "http://localhost:" + javaContainer.getMappedPort(9000) + "/metrics", 10_000); + for (String expectedMetric : + new String[] { + "log4j2_appender_total{level=\"trace\"} 0.0", + "log4j2_appender_total{level=\"debug\"} 2.0", + "log4j2_appender_total{level=\"info\"} 0.0", + "log4j2_appender_total{level=\"warn\"} 1.0", + "log4j2_appender_total{level=\"error\"} 0.0", + "log4j2_appender_total{level=\"fatal\"} 0.0" + }) { + Assert.assertTrue(expectedMetric + " not found", metrics.contains(expectedMetric)); + } + } +} diff --git a/simpleclient-archive/integration_tests/it_log4j2/src/test/resources/logback-test.xml b/simpleclient-archive/integration_tests/it_log4j2/src/test/resources/logback-test.xml new file mode 100644 index 000000000..1b7a25aa0 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_log4j2/src/test/resources/logback-test.xml @@ -0,0 +1,14 @@ + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + + + + + + + \ No newline at end of file diff --git a/simpleclient-archive/integration_tests/it_log4j2/version-rules.xml b/simpleclient-archive/integration_tests/it_log4j2/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/simpleclient-archive/integration_tests/it_log4j2/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/simpleclient-archive/integration_tests/it_pushgateway/pom.xml b/simpleclient-archive/integration_tests/it_pushgateway/pom.xml new file mode 100644 index 000000000..4be9bb954 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_pushgateway/pom.xml @@ -0,0 +1,81 @@ + + + 4.0.0 + + + io.prometheus + integration_tests + 1.0.0-beta-2-SNAPSHOT + + + it_pushgateway + Integration Tests - Pushgateway + + + + io.prometheus + simpleclient + ${project.version} + + + io.prometheus + simpleclient_pushgateway + ${project.version} + + + org.testcontainers + testcontainers + test + + + com.squareup.okhttp3 + okhttp + 4.10.0 + test + + + ch.qos.logback + logback-classic + 1.2.11 + test + + + io.prometheus + it_common + test-jar + ${project.version} + test + + + + + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + simpleclient-archive/integration_tests/it_pushgateway/pom.xml + io.prometheus.client.it.pushgateway.ExampleBatchJob + + + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + diff --git a/simpleclient-archive/integration_tests/it_pushgateway/src/main/java/io/prometheus/client/it/pushgateway/ExampleBatchJob.java b/simpleclient-archive/integration_tests/it_pushgateway/src/main/java/io/prometheus/client/it/pushgateway/ExampleBatchJob.java new file mode 100644 index 000000000..757945219 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_pushgateway/src/main/java/io/prometheus/client/it/pushgateway/ExampleBatchJob.java @@ -0,0 +1,39 @@ +package io.prometheus.client.it.pushgateway; + +import io.prometheus.client.CollectorRegistry; +import io.prometheus.client.Gauge; +import io.prometheus.client.exporter.BasicAuthHttpConnectionFactory; +import io.prometheus.client.exporter.PushGateway; + +public class ExampleBatchJob { + + // The following is copy-and-paste from README.md + // except that we added basic authentication to test the BasicAuthHttpConnectionFactory with + // different Java versions. + public static void main(String[] args) throws Exception { + if (args.length != 3) { + System.err.println("Usage: batch-job.jar

    "); + System.exit(-1); + } + CollectorRegistry registry = new CollectorRegistry(); + Gauge duration = + Gauge.build() + .name("my_batch_job_duration_seconds") + .help("Duration of my batch job in seconds.") + .register(registry); + Gauge.Timer durationTimer = duration.startTimer(); + try { + Gauge lastSuccess = + Gauge.build() + .name("my_batch_job_last_success") + .help("Last time my batch job succeeded, in unixtime.") + .register(registry); + lastSuccess.setToCurrentTime(); + } finally { + durationTimer.setDuration(); + PushGateway pg = new PushGateway(args[0]); + pg.setConnectionFactory(new BasicAuthHttpConnectionFactory(args[1], args[2])); + pg.pushAdd(registry, "my_batch_job"); + } + } +} diff --git a/simpleclient-archive/integration_tests/it_pushgateway/src/test/java/io/prometheus/client/it/pushgateway/PushGatewayIT.java b/simpleclient-archive/integration_tests/it_pushgateway/src/test/java/io/prometheus/client/it/pushgateway/PushGatewayIT.java new file mode 100644 index 000000000..3611c2d78 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_pushgateway/src/test/java/io/prometheus/client/it/pushgateway/PushGatewayIT.java @@ -0,0 +1,106 @@ +package io.prometheus.client.it.pushgateway; + +import com.github.dockerjava.api.model.Ulimit; +import io.prometheus.client.it.common.LogConsumer; +import io.prometheus.client.it.common.Scraper; +import io.prometheus.client.it.common.Version; +import io.prometheus.client.it.common.Volume; +import java.io.IOException; +import java.net.URISyntaxException; +import java.util.List; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.testcontainers.containers.BindMode; +import org.testcontainers.containers.Container; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.Network; +import org.testcontainers.utility.MountableFile; + +@RunWith(Parameterized.class) +public class PushGatewayIT { + + private final String batchJobJar; + private final Volume batchJobDir; + private final GenericContainer javaContainer; + private final GenericContainer pushGatewayContainer; + + @Parameterized.Parameters(name = "{0}") + public static String[] images() { + return new String[] {"ibmjava:8-jre", "openjdk:11-slim", "openjdk:17"}; + } + + public PushGatewayIT(String image) throws IOException, URISyntaxException { + batchJobJar = "it_pushgateway-" + Version.loadProjectVersion() + ".jar"; + batchJobDir = Volume.create("it-pushgateway-batch-job").copyFromTargetDirectory(batchJobJar); + Network network = Network.newNetwork(); + pushGatewayContainer = + new GenericContainer<>("prom/pushgateway") + .withCreateContainerCmdModifier( + c -> + c.getHostConfig() + .withUlimits(new Ulimit[] {new Ulimit("nofile", 65536L, 65536L)})) + .withCopyFileToContainer( + MountableFile.forClasspathResource("web-config.yml", 0644), "/") + .withNetwork(network) + .withNetworkAliases("pushgateway") + .withLogConsumer(LogConsumer.withPrefix("prom/pushgateway")) + .withCommand("--web.config.file=/web-config.yml") + .withExposedPorts(9091); + javaContainer = + new GenericContainer<>(image) + .withCreateContainerCmdModifier( + c -> + c.getHostConfig() + .withUlimits(new Ulimit[] {new Ulimit("nofile", 65536L, 65536L)})) + .withFileSystemBind(batchJobDir.getHostPath(), "/app", BindMode.READ_ONLY) + .withNetwork(network) + .withWorkingDirectory("/app") + .withLogConsumer(LogConsumer.withPrefix(image)) + .withCommand("sleep", "30"); + } + + @Before + public void setUp() { + pushGatewayContainer.start(); + javaContainer.start(); + } + + @After + public void tearDown() throws IOException { + javaContainer.stop(); + pushGatewayContainer.stop(); + batchJobDir.remove(); + } + + @Test + public void testPushGateway() throws IOException, InterruptedException { + String user = "testUser"; + String password = "testPwd"; + Container.ExecResult r = + javaContainer.execInContainer( + "java", "-jar", batchJobJar, "pushgateway:9091", user, password); + System.err.println(r.getStderr()); + System.out.println(r.getStdout()); + List metrics = + Scraper.scrape( + "http://localhost:" + pushGatewayContainer.getMappedPort(9091) + "/metrics", + user, + password, + 10_000); + assertContains(metrics, "my_batch_job_duration_seconds"); + assertContains(metrics, "my_batch_job_last_success"); + } + + private void assertContains(List metrics, String metric) { + for (String line : metrics) { + if (line.startsWith(metric + " ") || line.startsWith(metric + "{")) { + return; + } + } + Assert.fail(metric + " not found"); + } +} diff --git a/simpleclient-archive/integration_tests/it_pushgateway/src/test/resources/logback-test.xml b/simpleclient-archive/integration_tests/it_pushgateway/src/test/resources/logback-test.xml new file mode 100644 index 000000000..1b7a25aa0 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_pushgateway/src/test/resources/logback-test.xml @@ -0,0 +1,14 @@ + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + + + + + + + \ No newline at end of file diff --git a/simpleclient-archive/integration_tests/it_pushgateway/src/test/resources/web-config.yml b/simpleclient-archive/integration_tests/it_pushgateway/src/test/resources/web-config.yml new file mode 100644 index 000000000..6dd05c39f --- /dev/null +++ b/simpleclient-archive/integration_tests/it_pushgateway/src/test/resources/web-config.yml @@ -0,0 +1,7 @@ +--- +# Usernames and passwords required to connect. +# Passwords are hashed with bcrypt: +# https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md#about-bcrypt. +basic_auth_users: + # testUser: testPwd + testUser: $2y$10$r/SV/hDe3E3ISKsrZIwVJe40vrCo5N8e22WbxDCThMIhaYdUgCBwe diff --git a/simpleclient-archive/integration_tests/it_pushgateway/version-rules.xml b/simpleclient-archive/integration_tests/it_pushgateway/version-rules.xml new file mode 100644 index 000000000..2cd86fb7b --- /dev/null +++ b/simpleclient-archive/integration_tests/it_pushgateway/version-rules.xml @@ -0,0 +1,11 @@ + + + + + .*alpha.* + + + + diff --git a/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/pom.xml b/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/pom.xml new file mode 100644 index 000000000..0213445b4 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/pom.xml @@ -0,0 +1,85 @@ + + + 4.0.0 + + + io.prometheus + integration_tests + 1.0.0-beta-2-SNAPSHOT + + + it_servlet_jakarta_exporter_webxml + Integration Tests - Servlet Jakarta Exporter web.xml + war + + + 1.2.0 + + + + + io.prometheus + simpleclient + ${project.version} + + + io.prometheus + simpleclient_servlet_jakarta + ${project.version} + + + io.prometheus + simpleclient_hotspot + ${project.version} + + + com.squareup.okhttp3 + okhttp + 4.10.0 + + + org.testcontainers + testcontainers + test + + + ch.qos.logback + logback-classic + 1.2.11 + + + jakarta.servlet + jakarta.servlet-api + 6.0.0 + provided + + + + + ${project.artifactId} + + + org.apache.maven.plugins + maven-failsafe-plugin + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + package + + copy-dependencies + + + + + + maven-war-plugin + 3.3.1 + + + + diff --git a/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/src/main/java/io/prometheus/client/it/servlet/jakarta/ExampleServlet.java b/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/src/main/java/io/prometheus/client/it/servlet/jakarta/ExampleServlet.java new file mode 100644 index 000000000..e4ed91637 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/src/main/java/io/prometheus/client/it/servlet/jakarta/ExampleServlet.java @@ -0,0 +1,27 @@ +package io.prometheus.client.it.servlet.jakarta; + +import io.prometheus.client.hotspot.DefaultExports; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.Writer; + +public class ExampleServlet extends HttpServlet { + + @Override + public void init() { + DefaultExports.initialize(); + } + + @Override + protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) + throws IOException { + resp.setStatus(200); + resp.setContentType("text/plain"); + Writer writer = new BufferedWriter(resp.getWriter()); + writer.write("Hello, world!\n"); + writer.close(); + } +} diff --git a/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/src/main/webapp/WEB-INF/web.xml b/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 000000000..2341199c0 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,44 @@ + + + + + example + io.prometheus.client.it.servlet.jakarta.ExampleServlet + + + + prometheus + io.prometheus.client.servlet.jakarta.filter.MetricsFilter + + metric-name + requests + + + + prometheus-exporter + io.prometheus.client.servlet.jakarta.exporter.MetricsServlet + + name-must-not-start-with + + jvm_threads_deadlocked + jvm_memory_pool + + + + + example + /* + + + prometheus-exporter + /metrics + + + prometheus + example + + diff --git a/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/src/test/java/io/prometheus/client/it/servlet/jakarta/ServletJakartaExporterWebXmlIT.java b/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/src/test/java/io/prometheus/client/it/servlet/jakarta/ServletJakartaExporterWebXmlIT.java new file mode 100644 index 000000000..37dfd9e3b --- /dev/null +++ b/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/src/test/java/io/prometheus/client/it/servlet/jakarta/ServletJakartaExporterWebXmlIT.java @@ -0,0 +1,121 @@ +package io.prometheus.client.it.servlet.jakarta; + +import java.io.IOException; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.List; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.wait.strategy.Wait; +import org.testcontainers.images.builder.ImageFromDockerfile; + +public class ServletJakartaExporterWebXmlIT { + + private final OkHttpClient client = new OkHttpClient(); + + private static class DockerContainer extends GenericContainer { + DockerContainer() { + super( + new ImageFromDockerfile("servlet-jakarta-exporter-webxml") + .withFileFromPath( + "servlet_jakarta_exporter_webxml.war", + Paths.get("target/it_servlet_jakarta_exporter_webxml.war")) + .withFileFromClasspath("Dockerfile", "Dockerfile")); + } + } + + @Rule + public DockerContainer dockerContainer = + new DockerContainer() + .withExposedPorts(8080) + .waitingFor(Wait.forLogMessage(".*oejs.Server:main: Started Server.*", 1)); + + @Test + public void testSampleNameFilter() throws IOException, InterruptedException { + callExampleServlet(); + List metrics = scrapeMetrics(); + assertContains(metrics, "requests_bucket"); + assertContains(metrics, "requests_count"); + assertContains(metrics, "requests_sum"); + assertContains(metrics, "requests_created"); + assertContains(metrics, "requests_status_total"); + assertContains(metrics, "requests_status_created"); + assertContains(metrics, "jvm_gc_collection_seconds_count"); + assertNotContains(metrics, "jvm_threads_deadlocked"); + assertNotContains(metrics, "jvm_memory_pool"); + + List filteredMetrics = scrapeMetricsWithNameFilter("requests_count", "requests_sum"); + assertNotContains(filteredMetrics, "requests_bucket"); + assertContains(filteredMetrics, "requests_count"); + assertContains(filteredMetrics, "requests_sum"); + assertNotContains(filteredMetrics, "requests_created"); + assertNotContains(filteredMetrics, "requests_status_total"); + assertNotContains(filteredMetrics, "requests_status_created"); + assertNotContains(filteredMetrics, "jvm_gc_collection_seconds_count"); + assertNotContains(filteredMetrics, "jvm_threads_deadlocked"); + assertNotContains(filteredMetrics, "jvm_memory_pool"); + } + + private void assertContains(List metrics, String prefix) { + for (String metric : metrics) { + if (metric.startsWith(prefix)) { + return; + } + } + Assert.fail("metric not found: " + prefix); + } + + private void assertNotContains(List metrics, String prefix) { + for (String metric : metrics) { + if (metric.startsWith(prefix)) { + Assert.fail("unexpected metric found: " + metric); + } + } + } + + private void callExampleServlet() throws IOException { + Request request = + new Request.Builder() + .url("http://localhost:" + dockerContainer.getMappedPort(8080) + "/hello") + .build(); + try (Response response = client.newCall(request).execute()) { + Assert.assertEquals("Hello, world!\n", response.body().string()); + } + } + + private List scrapeMetrics() throws IOException { + Request request = + new Request.Builder() + .url("http://localhost:" + dockerContainer.getMappedPort(8080) + "/metrics") + .header("Accept", "application/openmetrics-text; version=1.0.0; charset=utf-8") + .build(); + try (Response response = client.newCall(request).execute()) { + return Arrays.asList(response.body().string().split("\\n")); + } + } + + private List scrapeMetricsWithNameFilter(String... names) throws IOException { + StringBuilder param = new StringBuilder(); + boolean first = true; + for (String name : names) { + if (!first) { + param.append("&"); + } + param.append("name[]=").append(name); + first = false; + } + Request request = + new Request.Builder() + .url("http://localhost:" + dockerContainer.getMappedPort(8080) + "/metrics?" + param) + .header("Accept", "application/openmetrics-text; version=1.0.0; charset=utf-8") + .build(); + try (Response response = client.newCall(request).execute()) { + return Arrays.asList(response.body().string().split("\\n")); + } + } +} diff --git a/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/src/test/resources/Dockerfile b/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/src/test/resources/Dockerfile new file mode 100644 index 000000000..abd1416db --- /dev/null +++ b/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/src/test/resources/Dockerfile @@ -0,0 +1,2 @@ +FROM jetty:11.0.6 +COPY servlet_jakarta_exporter_webxml.war /var/lib/jetty/webapps/ROOT.war diff --git a/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/src/test/resources/logback-test.xml b/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/src/test/resources/logback-test.xml new file mode 100644 index 000000000..1b7a25aa0 --- /dev/null +++ b/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/src/test/resources/logback-test.xml @@ -0,0 +1,14 @@ + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + + + + + + + + + + \ No newline at end of file diff --git a/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/version-rules.xml b/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/version-rules.xml new file mode 100644 index 000000000..2cd86fb7b --- /dev/null +++ b/simpleclient-archive/integration_tests/it_servlet_jakarta_exporter_webxml/version-rules.xml @@ -0,0 +1,11 @@ + + + + + .*alpha.* + + + + diff --git a/simpleclient-archive/integration_tests/pom.xml b/simpleclient-archive/integration_tests/pom.xml new file mode 100644 index 000000000..ecaddd212 --- /dev/null +++ b/simpleclient-archive/integration_tests/pom.xml @@ -0,0 +1,69 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.0.0-beta-2-SNAPSHOT + + + integration_tests + pom + + Prometheus Java Suit - Integration Tests + + + it_exemplars_otel_sdk + it_exemplars_otel_agent + it_java_versions + it_servlet_jakarta_exporter_webxml + it_common + it_pushgateway + it_log4j2 + + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + integration-test + integration-test + + integration-test + verify + + + + + + + + + + + org.testcontainers + testcontainers + 1.17.2 + test + + + com.squareup.okhttp3 + okhttp + 4.10.0 + test + + + ch.qos.logback + logback-classic + 1.2.11 + test + + + + diff --git a/simpleclient-archive/integration_tests/version-rules.xml b/simpleclient-archive/integration_tests/version-rules.xml new file mode 100644 index 000000000..2cd86fb7b --- /dev/null +++ b/simpleclient-archive/integration_tests/version-rules.xml @@ -0,0 +1,11 @@ + + + + + .*alpha.* + + + + diff --git a/simpleclient-archive/simpleclient_graphite_bridge/pom.xml b/simpleclient-archive/simpleclient_graphite_bridge/pom.xml new file mode 100644 index 000000000..612097f25 --- /dev/null +++ b/simpleclient-archive/simpleclient_graphite_bridge/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.0.0-beta-2-SNAPSHOT + + + simpleclient_graphite_bridge + bundle + + Prometheus Java Simpleclient Graphite Bridge + + Graphite bridge for the simpleclient. + + + + + io.prometheus + simpleclient + ${project.version} + + + diff --git a/simpleclient_graphite_bridge/src/main/java/io/prometheus/client/bridge/Graphite.java b/simpleclient-archive/simpleclient_graphite_bridge/src/main/java/io/prometheus/client/bridge/Graphite.java similarity index 69% rename from simpleclient_graphite_bridge/src/main/java/io/prometheus/client/bridge/Graphite.java rename to simpleclient-archive/simpleclient_graphite_bridge/src/main/java/io/prometheus/client/bridge/Graphite.java index 708b025bd..691afe186 100644 --- a/simpleclient_graphite_bridge/src/main/java/io/prometheus/client/bridge/Graphite.java +++ b/simpleclient-archive/simpleclient_graphite_bridge/src/main/java/io/prometheus/client/bridge/Graphite.java @@ -2,33 +2,35 @@ import io.prometheus.client.Collector; import io.prometheus.client.CollectorRegistry; - import java.io.BufferedWriter; import java.io.IOException; +import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.net.Socket; +import java.nio.charset.Charset; import java.util.Collections; import java.util.logging.Level; import java.util.logging.Logger; -import java.util.regex.Pattern; import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * Export metrics in the Graphite plaintext format. + * *

    - *

    - * {@code
    - *  Graphite g = new Graphite("localhost", 2003);
    - *  // Push the default registry once.
    - *  g.push(CollectorRegistry.defaultRegistry);
      *
    - *  // Push the default registry every 60 seconds.
    - *  Thread thread = g.start(CollectorRegistry.defaultRegistry, 60);
    - *  // Stop pushing.
    - *  thread.interrupt();
    - *  thread.join();
    - * }
    - * 
    + *
    {@code
    + * Graphite g = new Graphite("localhost", 2003);
    + * // Push the default registry once.
    + * g.push(CollectorRegistry.defaultRegistry);
    + *
    + * // Push the default registry every 60 seconds.
    + * Thread thread = g.start(CollectorRegistry.defaultRegistry, 60);
    + * // Stop pushing.
    + * thread.interrupt();
    + * thread.join();
    + * }
    + * *

    */ public class Graphite { @@ -37,29 +39,29 @@ public class Graphite { private final String host; private final int port; private static final Pattern INVALID_GRAPHITE_CHARS = Pattern.compile("[^a-zA-Z0-9_-]"); - /** - * Construct a Graphite Bridge with the given host:port. - */ + + /** Construct a Graphite Bridge with the given host:port. */ public Graphite(String host, int port) { this.host = host; this.port = port; } - /** - * Push samples from the given registry to Graphite. - */ + /** Push samples from the given registry to Graphite. */ public void push(CollectorRegistry registry) throws IOException { Socket s = new Socket(host, port); - BufferedWriter writer = new BufferedWriter(new PrintWriter(s.getOutputStream())); + BufferedWriter writer = + new BufferedWriter( + new PrintWriter(new OutputStreamWriter(s.getOutputStream(), Charset.forName("UTF-8")))); Matcher m = INVALID_GRAPHITE_CHARS.matcher(""); long now = System.currentTimeMillis() / 1000; - for (Collector.MetricFamilySamples metricFamilySamples: Collections.list(registry.metricFamilySamples())) { - for (Collector.MetricFamilySamples.Sample sample: metricFamilySamples.samples) { + for (Collector.MetricFamilySamples metricFamilySamples : + Collections.list(registry.metricFamilySamples())) { + for (Collector.MetricFamilySamples.Sample sample : metricFamilySamples.samples) { m.reset(sample.name); writer.write(m.replaceAll("_")); for (int i = 0; i < sample.labelNames.size(); ++i) { m.reset(sample.labelValues.get(i)); - writer.write("." + sample.labelNames.get(i) + "." + m.replaceAll("_")); + writer.write(";" + sample.labelNames.get(i) + "=" + m.replaceAll("_")); } writer.write(" " + sample.value + " " + now + "\n"); } @@ -68,16 +70,12 @@ public void push(CollectorRegistry registry) throws IOException { s.close(); } - /** - * Push samples from the given registry to Graphite every minute. - */ + /** Push samples from the given registry to Graphite every minute. */ public Thread start(CollectorRegistry registry) { return start(registry, 60); } - /** - * Push samples from the given registry to Graphite at the given interval. - */ + /** Push samples from the given registry to Graphite at the given interval. */ public Thread start(CollectorRegistry registry, int intervalSeconds) { Thread thread = new PushThread(registry, intervalSeconds); thread.setDaemon(true); diff --git a/simpleclient_graphite_bridge/src/test/java/io/prometheus/client/bridge/GraphiteTest.java b/simpleclient-archive/simpleclient_graphite_bridge/src/test/java/io/prometheus/client/bridge/GraphiteTest.java similarity index 64% rename from simpleclient_graphite_bridge/src/test/java/io/prometheus/client/bridge/GraphiteTest.java rename to simpleclient-archive/simpleclient_graphite_bridge/src/test/java/io/prometheus/client/bridge/GraphiteTest.java index dbe6099ef..9b21eacab 100644 --- a/simpleclient_graphite_bridge/src/test/java/io/prometheus/client/bridge/GraphiteTest.java +++ b/simpleclient-archive/simpleclient_graphite_bridge/src/test/java/io/prometheus/client/bridge/GraphiteTest.java @@ -3,18 +3,15 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; -import org.junit.Test; - import io.prometheus.client.CollectorRegistry; import io.prometheus.client.Gauge; - import java.io.BufferedReader; -import java.io.IOException; import java.io.InputStreamReader; import java.net.ServerSocket; import java.net.Socket; +import org.junit.Test; -public class GraphiteTest { +class GraphiteTest { @Test public void testPush() throws Exception { // Create a metric. @@ -22,23 +19,23 @@ public void testPush() throws Exception { Gauge labels = Gauge.build().name("labels").help("help").labelNames("l").register(registry); labels.labels("fo*o").inc(); - // Server to accept push. final ServerSocket ss = new ServerSocket(0); final StringBuilder result = new StringBuilder(); - Thread t = new Thread() { - public void run() { - try { - Socket s = ss.accept(); - BufferedReader reader = new BufferedReader(new InputStreamReader(s.getInputStream())); - result.append(reader.readLine()); - s.close(); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - } - }; + Thread t = + new Thread() { + public void run() { + try { + Socket s = ss.accept(); + BufferedReader reader = new BufferedReader(new InputStreamReader(s.getInputStream())); + result.append(reader.readLine()); + s.close(); + } catch (Exception e) { + e.printStackTrace(); + fail(); + } + } + }; t.start(); // Push. @@ -50,8 +47,8 @@ public void run() { // Check result. String[] parts = result.toString().split(" "); assertEquals(3, parts.length); - assertEquals("labels.l.fo_o", parts[0]); + assertEquals("labels;l=fo_o", parts[0]); assertEquals("1.0", parts[1]); - Integer.parseInt(parts[2]); // This shouldn't throw an exception. + Integer.parseInt(parts[2]); // This shouldn't throw an exception. } } diff --git a/simpleclient-archive/simpleclient_graphite_bridge/version-rules.xml b/simpleclient-archive/simpleclient_graphite_bridge/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/simpleclient-archive/simpleclient_graphite_bridge/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/simpleclient-archive/simpleclient_hibernate/pom.xml b/simpleclient-archive/simpleclient_hibernate/pom.xml new file mode 100644 index 000000000..6c90ac93b --- /dev/null +++ b/simpleclient-archive/simpleclient_hibernate/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.0.0-beta-2-SNAPSHOT + + + simpleclient_hibernate + bundle + + Prometheus Java Simpleclient Hibernate + + Collectors of data from Hibernate. + + + + + + io.prometheus + simpleclient + ${project.version} + + + + + org.hibernate + hibernate-core + 6.1.0.Final + provided + + + diff --git a/simpleclient_hibernate/src/main/java/io/prometheus/client/hibernate/HibernateStatisticsCollector.java b/simpleclient-archive/simpleclient_hibernate/src/main/java/io/prometheus/client/hibernate/HibernateStatisticsCollector.java similarity index 72% rename from simpleclient_hibernate/src/main/java/io/prometheus/client/hibernate/HibernateStatisticsCollector.java rename to simpleclient-archive/simpleclient_hibernate/src/main/java/io/prometheus/client/hibernate/HibernateStatisticsCollector.java index 32f07f8f9..8c78ca1d3 100644 --- a/simpleclient_hibernate/src/main/java/io/prometheus/client/hibernate/HibernateStatisticsCollector.java +++ b/simpleclient-archive/simpleclient_hibernate/src/main/java/io/prometheus/client/hibernate/HibernateStatisticsCollector.java @@ -16,53 +16,57 @@ /** * Collect metrics from one or more Hibernate SessionFactory instances. - *

    - * Usage example for a single session factory: + * + *

    Usage example for a single session factory: + * *

      * new HibernateStatisticsCollector(sessionFactory, "myapp").register();
      * 
    + * * Usage example for multiple session factories: + * *
      * new HibernateStatisticsCollector()
      *     .add(sessionFactory1, "myapp1")
      *     .add(sessionFactory2, "myapp2")
      *     .register();
      * 
    + * * If you are in a JPA environment, you can obtain the SessionFactory like this: + * *
      * SessionFactory sessionFactory =
      *     entityManagerFactory.unwrap(SessionFactory.class);
      * 
    - *

    - * When {@code enablePerQueryMetrics()} has been called, certain metrics like execution - * time are collected per query. This may create a lot of monitoring data, so it should - * be used with caution. + * + *

    When {@code enablePerQueryMetrics()} has been called, certain metrics like execution time are + * collected per query. This may create a lot of monitoring data, so it should be used with caution. * * @author Christian Kaltepoth */ -public class HibernateStatisticsCollector extends Collector { +class HibernaTestatisticsCollector extends Collector { private static final List LABEL_NAMES = Collections.singletonList("unit"); private static final List LABEL_NAMES_PER_QUERY = Arrays.asList("unit", "query"); - private final Map sessionFactories = new ConcurrentHashMap(); + private final Map sessionFactories = + new ConcurrentHashMap(); private boolean perQueryMetricsEnabled; /** - * Creates an empty collector. If you use this constructor, you have to add one or more - * session factories to the collector by calling the {@link #add(SessionFactory, String)} - * method. + * Creates an empty collector. If you use this constructor, you have to add one or more session + * factories to the collector by calling the {@link #add(SessionFactory, String)} method. */ public HibernateStatisticsCollector() { // nothing } /** - * Creates a new collector for the given session factory. Calling this constructor - * has the same effect as creating an empty collector and adding the session factory - * using {@link #add(SessionFactory, String)}. + * Creates a new collector for the given session factory. Calling this constructor has the same + * effect as creating an empty collector and adding the session factory using {@link + * #add(SessionFactory, String)}. * * @param sessionFactory The Hibernate SessionFactory to collect metrics for * @param name A unique name for this SessionFactory @@ -84,10 +88,12 @@ public HibernateStatisticsCollector add(SessionFactory sessionFactory, String na } /** - * Enables collection of per-query metrics. Produces a lot of monitoring data, so use with caution. - *

    - * Per-query metrics have a label "query" with the actual HQL query as value. The query will contain - * placeholders ("?") instead of the real parameter values (example: {@code select u from User u where id=?}). + * Enables collection of per-query metrics. Produces a lot of monitoring data, so use with + * caution. + * + *

    Per-query metrics have a label "query" with the actual HQL query as value. The query will + * contain placeholders ("?") instead of the real parameter values (example: {@code select u from + * User u where id=?}). * * @return Returns the collector */ @@ -128,8 +134,7 @@ private List getSessionMetrics() { public double getValue(Statistics statistics) { return statistics.getSessionOpenCount(); } - } - ), + }), createCounter( "hibernate_session_closed_total", "Global number of sessions closed (getSessionCloseCount)", @@ -138,8 +143,7 @@ public double getValue(Statistics statistics) { public double getValue(Statistics statistics) { return statistics.getSessionCloseCount(); } - } - ), + }), createCounter( "hibernate_flushed_total", "The global number of flushes executed by sessions (getFlushCount)", @@ -148,8 +152,7 @@ public double getValue(Statistics statistics) { public double getValue(Statistics statistics) { return statistics.getFlushCount(); } - } - ), + }), createCounter( "hibernate_connect_total", "The global number of connections requested by the sessions (getConnectCount)", @@ -158,8 +161,7 @@ public double getValue(Statistics statistics) { public double getValue(Statistics statistics) { return statistics.getConnectCount(); } - } - ), + }), createCounter( "hibernate_optimistic_failure_total", "The number of StaleObjectStateExceptions that occurred (getOptimisticFailureCount)", @@ -168,9 +170,7 @@ public double getValue(Statistics statistics) { public double getValue(Statistics statistics) { return statistics.getOptimisticFailureCount(); } - } - ) - ); + })); } private List getConnectionMetrics() { @@ -183,8 +183,7 @@ private List getConnectionMetrics() { public double getValue(Statistics statistics) { return statistics.getPrepareStatementCount(); } - } - ), + }), createCounter( "hibernate_statement_closed_total", "The number of prepared statements that were released (getCloseStatementCount)", @@ -193,8 +192,7 @@ public double getValue(Statistics statistics) { public double getValue(Statistics statistics) { return statistics.getCloseStatementCount(); } - } - ), + }), createCounter( "hibernate_transaction_total", "The number of transactions we know to have completed (getTransactionCount)", @@ -203,63 +201,61 @@ public double getValue(Statistics statistics) { public double getValue(Statistics statistics) { return statistics.getTransactionCount(); } - } - ), + }), createCounter( "hibernate_transaction_success_total", - "The number of transactions we know to have been successful (getSuccessfulTransactionCount)", + "The number of transactions we know to have been successful" + + " (getSuccessfulTransactionCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getSuccessfulTransactionCount(); } - } - ) - ); + })); } private List getCacheMetrics() { return Arrays.asList( createCounter( "hibernate_second_level_cache_hit_total", - "Global number of cacheable entities/collections successfully retrieved from the cache (getSecondLevelCacheHitCount)", + "Global number of cacheable entities/collections successfully retrieved from the cache" + + " (getSecondLevelCacheHitCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getSecondLevelCacheHitCount(); } - } - ), + }), createCounter( "hibernate_second_level_cache_miss_total", - "Global number of cacheable entities/collections not found in the cache and loaded from the database (getSecondLevelCacheMissCount)", + "Global number of cacheable entities/collections not found in the cache and loaded from" + + " the database (getSecondLevelCacheMissCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getSecondLevelCacheMissCount(); } - } - ), + }), createCounter( "hibernate_second_level_cache_put_total", - "Global number of cacheable entities/collections put in the cache (getSecondLevelCachePutCount)", + "Global number of cacheable entities/collections put in the cache" + + " (getSecondLevelCachePutCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getSecondLevelCachePutCount(); } - } - ), + }), createCounter( "hibernate_query_cache_hit_total", - "The global number of cached queries successfully retrieved from cache (getQueryCacheHitCount)", + "The global number of cached queries successfully retrieved from cache" + + " (getQueryCacheHitCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getQueryCacheHitCount(); } - } - ), + }), createCounter( "hibernate_query_cache_miss_total", "The global number of cached queries not found in cache (getQueryCacheMissCount)", @@ -268,8 +264,7 @@ public double getValue(Statistics statistics) { public double getValue(Statistics statistics) { return statistics.getQueryCacheMissCount(); } - } - ), + }), createCounter( "hibernate_query_cache_put_total", "The global number of cacheable queries put in cache (getQueryCachePutCount)", @@ -278,58 +273,57 @@ public double getValue(Statistics statistics) { public double getValue(Statistics statistics) { return statistics.getQueryCachePutCount(); } - } - ), + }), createCounter( "hibernate_natural_id_cache_hit_total", - "The global number of cached naturalId lookups successfully retrieved from cache (getNaturalIdCacheHitCount)", + "The global number of cached naturalId lookups successfully retrieved from cache" + + " (getNaturalIdCacheHitCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getNaturalIdCacheHitCount(); } - } - ), + }), createCounter( "hibernate_natural_id_cache_miss_total", - "The global number of cached naturalId lookups not found in cache (getNaturalIdCacheMissCount)", + "The global number of cached naturalId lookups not found in cache" + + " (getNaturalIdCacheMissCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getNaturalIdCacheMissCount(); } - } - ), + }), createCounter( "hibernate_natural_id_cache_put_total", - "The global number of cacheable naturalId lookups put in cache (getNaturalIdCachePutCount)", + "The global number of cacheable naturalId lookups put in cache" + + " (getNaturalIdCachePutCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getNaturalIdCachePutCount(); } - } - ), + }), createCounter( "hibernate_update_timestamps_cache_hit_total", - "The global number of timestamps successfully retrieved from cache (getUpdateTimestampsCacheHitCount)", + "The global number of timestamps successfully retrieved from cache" + + " (getUpdateTimestampsCacheHitCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getUpdateTimestampsCacheHitCount(); } - } - ), + }), createCounter( "hibernate_update_timestamps_cache_miss_total", - "The global number of tables for which no update timestamps was not found in cache (getUpdateTimestampsCacheMissCount)", + "The global number of tables for which no update timestamps was not found in cache" + + " (getUpdateTimestampsCacheMissCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getUpdateTimestampsCacheMissCount(); } - } - ), + }), createCounter( "hibernate_update_timestamps_cache_put_total", "The global number of timestamps put in cache (getUpdateTimestampsCachePutCount)", @@ -338,9 +332,7 @@ public double getValue(Statistics statistics) { public double getValue(Statistics statistics) { return statistics.getUpdateTimestampsCachePutCount(); } - } - ) - ); + })); } private List getEntityMetrics() { @@ -353,8 +345,7 @@ private List getEntityMetrics() { public double getValue(Statistics statistics) { return statistics.getEntityDeleteCount(); } - } - ), + }), createCounter( "hibernate_entity_insert_total", "Global number of entity inserts (getEntityInsertCount)", @@ -363,8 +354,7 @@ public double getValue(Statistics statistics) { public double getValue(Statistics statistics) { return statistics.getEntityInsertCount(); } - } - ), + }), createCounter( "hibernate_entity_load_total", "Global number of entity loads (getEntityLoadCount)", @@ -373,8 +363,7 @@ public double getValue(Statistics statistics) { public double getValue(Statistics statistics) { return statistics.getEntityLoadCount(); } - } - ), + }), createCounter( "hibernate_entity_fetch_total", "Global number of entity fetches (getEntityFetchCount)", @@ -383,8 +372,7 @@ public double getValue(Statistics statistics) { public double getValue(Statistics statistics) { return statistics.getEntityFetchCount(); } - } - ), + }), createCounter( "hibernate_entity_update_total", "Global number of entity updates (getEntityUpdateCount)", @@ -393,8 +381,7 @@ public double getValue(Statistics statistics) { public double getValue(Statistics statistics) { return statistics.getEntityUpdateCount(); } - } - ), + }), createCounter( "hibernate_collection_load_total", "Global number of collections loaded (getCollectionLoadCount)", @@ -403,8 +390,7 @@ public double getValue(Statistics statistics) { public double getValue(Statistics statistics) { return statistics.getCollectionLoadCount(); } - } - ), + }), createCounter( "hibernate_collection_fetch_total", "Global number of collections fetched (getCollectionFetchCount)", @@ -413,8 +399,7 @@ public double getValue(Statistics statistics) { public double getValue(Statistics statistics) { return statistics.getCollectionFetchCount(); } - } - ), + }), createCounter( "hibernate_collection_update_total", "Global number of collections updated (getCollectionUpdateCount)", @@ -423,8 +408,7 @@ public double getValue(Statistics statistics) { public double getValue(Statistics statistics) { return statistics.getCollectionUpdateCount(); } - } - ), + }), createCounter( "hibernate_collection_remove_total", "Global number of collections removed (getCollectionRemoveCount)", @@ -433,8 +417,7 @@ public double getValue(Statistics statistics) { public double getValue(Statistics statistics) { return statistics.getCollectionRemoveCount(); } - } - ), + }), createCounter( "hibernate_collection_recreate_total", "Global number of collections recreated (getCollectionRecreateCount)", @@ -443,9 +426,7 @@ public double getValue(Statistics statistics) { public double getValue(Statistics statistics) { return statistics.getCollectionRecreateCount(); } - } - ) - ); + })); } private List getQueryExecutionMetrics() { @@ -458,107 +439,96 @@ private List getQueryExecutionMetrics() { public double getValue(Statistics statistics) { return statistics.getQueryExecutionCount(); } - } - ), + }), createCounter( "hibernate_natural_id_query_execution_total", - "The global number of naturalId queries executed against the database (getNaturalIdQueryExecutionCount)", + "The global number of naturalId queries executed against the database" + + " (getNaturalIdQueryExecutionCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getNaturalIdQueryExecutionCount(); } - } - ) - ); + })); } private List getPerQueryMetrics() { List metrics = new ArrayList(); - metrics.addAll(Arrays.asList( - - createCounterForQuery("hibernate_per_query_cache_hit_total", + metrics.addAll( + Arrays.asList( + createCounterForQuery( + "hibernate_per_query_cache_hit_total", "Global number of cache hits for query (getCacheHitCount)", - new ValueProviderPerQuery() { - @Override - public double getValue(Statistics statistics, String query) { - return statistics.getQueryStatistics(query) - .getCacheHitCount(); - } - } - ), - createCounterForQuery("hibernate_per_query_cache_miss_total", + new ValueProviderPerQuery() { + @Override + public double getValue(Statistics statistics, String query) { + return statistics.getQueryStatistics(query).getCacheHitCount(); + } + }), + createCounterForQuery( + "hibernate_per_query_cache_miss_total", "Global number of cache misses for query (getCacheMissCount)", - new ValueProviderPerQuery() { - @Override - public double getValue(Statistics statistics, String query) { - return statistics.getQueryStatistics(query) - .getCacheMissCount(); - } - } - ), - createCounterForQuery("hibernate_per_query_cache_put_total", + new ValueProviderPerQuery() { + @Override + public double getValue(Statistics statistics, String query) { + return statistics.getQueryStatistics(query).getCacheMissCount(); + } + }), + createCounterForQuery( + "hibernate_per_query_cache_put_total", "Global number of cache puts for query (getCachePutCount)", - new ValueProviderPerQuery() { - @Override - public double getValue(Statistics statistics, String query) { - return statistics.getQueryStatistics(query) - .getCachePutCount(); - } - } - ), - createCounterForQuery("hibernate_per_query_execution_total", + new ValueProviderPerQuery() { + @Override + public double getValue(Statistics statistics, String query) { + return statistics.getQueryStatistics(query).getCachePutCount(); + } + }), + createCounterForQuery( + "hibernate_per_query_execution_total", "Global number of executions for query (getExecutionCount)", - new ValueProviderPerQuery() { - @Override - public double getValue(Statistics statistics, String query) { - return statistics.getQueryStatistics(query) - .getExecutionCount(); - } - } - ), - createCounterForQuery("hibernate_per_query_execution_rows_total", + new ValueProviderPerQuery() { + @Override + public double getValue(Statistics statistics, String query) { + return statistics.getQueryStatistics(query).getExecutionCount(); + } + }), + createCounterForQuery( + "hibernate_per_query_execution_rows_total", "Global number of rows for all executions of query (getExecutionRowCount)", - new ValueProviderPerQuery() { - @Override - public double getValue(Statistics statistics, String query) { - return statistics.getQueryStatistics(query) - .getExecutionRowCount(); - } - } - ), - createGaugeForQuery("hibernate_per_query_execution_min_seconds", + new ValueProviderPerQuery() { + @Override + public double getValue(Statistics statistics, String query) { + return statistics.getQueryStatistics(query).getExecutionRowCount(); + } + }), + createGaugeForQuery( + "hibernate_per_query_execution_min_seconds", "Minimum execution time of query in seconds (based on getExecutionMinTime)", - new ValueProviderPerQuery() { - @Override - public double getValue(Statistics statistics, String query) { - return toSeconds(statistics.getQueryStatistics(query) - .getExecutionMinTime()); - } - } - ), - createGaugeForQuery("hibernate_per_query_execution_max_seconds", + new ValueProviderPerQuery() { + @Override + public double getValue(Statistics statistics, String query) { + return toSeconds(statistics.getQueryStatistics(query).getExecutionMinTime()); + } + }), + createGaugeForQuery( + "hibernate_per_query_execution_max_seconds", "Maximum execution time of query in seconds (based on getExecutionMaxTime)", - new ValueProviderPerQuery() { - @Override - public double getValue(Statistics statistics, String query) { - return toSeconds(statistics.getQueryStatistics(query) - .getExecutionMaxTime()); - } - } - ), - createCounterForQuery("hibernate_per_query_execution_seconds_total", - "Accumulated execution time of query in seconds (based on getExecutionTotalTime)", - new ValueProviderPerQuery() { - @Override - public double getValue(Statistics statistics, String query) { - return toSeconds(statistics.getQueryStatistics(query) - .getExecutionTotalTime()); - } - } - ) - )); + new ValueProviderPerQuery() { + @Override + public double getValue(Statistics statistics, String query) { + return toSeconds(statistics.getQueryStatistics(query).getExecutionMaxTime()); + } + }), + createCounterForQuery( + "hibernate_per_query_execution_seconds_total", + "Accumulated execution time of query in seconds (based on getExecutionTotalTime)", + new ValueProviderPerQuery() { + @Override + public double getValue(Statistics statistics, String query) { + return toSeconds(statistics.getQueryStatistics(query).getExecutionTotalTime()); + } + }))); return metrics; } @@ -569,43 +539,46 @@ private CounterMetricFamily createCounter(String metric, String help, ValueProvi for (Entry entry : sessionFactories.entrySet()) { metricFamily.addMetric( - Collections.singletonList(entry.getKey()), - provider.getValue(entry.getValue().getStatistics()) - ); + Collections.singletonList(entry.getKey()), + provider.getValue(entry.getValue().getStatistics())); } return metricFamily; - } - private CounterMetricFamily createCounterForQuery(String metric, String help, ValueProviderPerQuery provider) { + private CounterMetricFamily createCounterForQuery( + String metric, String help, ValueProviderPerQuery provider) { - final CounterMetricFamily counters = new CounterMetricFamily(metric, help, LABEL_NAMES_PER_QUERY); + final CounterMetricFamily counters = + new CounterMetricFamily(metric, help, LABEL_NAMES_PER_QUERY); - addMetricsForQuery(new PerQuerySamples() { - @Override - public void addMetric(List labelValues, double value) { - counters.addMetric(labelValues, value); - } - }, provider); + addMetricsForQuery( + new PerQuerySamples() { + @Override + public void addMetric(List labelValues, double value) { + counters.addMetric(labelValues, value); + } + }, + provider); return counters; - } - private GaugeMetricFamily createGaugeForQuery(String metric, String help, ValueProviderPerQuery provider) { + private GaugeMetricFamily createGaugeForQuery( + String metric, String help, ValueProviderPerQuery provider) { final GaugeMetricFamily gauges = new GaugeMetricFamily(metric, help, LABEL_NAMES_PER_QUERY); - addMetricsForQuery(new PerQuerySamples() { - @Override - public void addMetric(List labelValues, double value) { - gauges.addMetric(labelValues, value); - } - }, provider); + addMetricsForQuery( + new PerQuerySamples() { + @Override + public void addMetric(List labelValues, double value) { + gauges.addMetric(labelValues, value); + } + }, + provider); return gauges; - } private void addMetricsForQuery(PerQuerySamples samples, ValueProviderPerQuery provider) { @@ -621,28 +594,22 @@ private void addMetricsForQuery(PerQuerySamples samples, ValueProviderPerQuery p } } - private double toSeconds(long milliseconds){ + private double toSeconds(long milliseconds) { return milliseconds / 1000d; } private interface PerQuerySamples { void addMetric(List labelValues, double value); - } - private interface ValueProvider { double getValue(Statistics statistics); - } private interface ValueProviderPerQuery { double getValue(Statistics statistics, String query); - } - - } diff --git a/simpleclient_hibernate/src/test/java/io/prometheus/client/hibernate/HibernateStatisticsCollectorTest.java b/simpleclient-archive/simpleclient_hibernate/src/test/java/io/prometheus/client/hibernate/HibernateStatisticsCollectorTest.java similarity index 72% rename from simpleclient_hibernate/src/test/java/io/prometheus/client/hibernate/HibernateStatisticsCollectorTest.java rename to simpleclient-archive/simpleclient_hibernate/src/test/java/io/prometheus/client/hibernate/HibernateStatisticsCollectorTest.java index b148ee108..dadea581b 100644 --- a/simpleclient_hibernate/src/test/java/io/prometheus/client/hibernate/HibernateStatisticsCollectorTest.java +++ b/simpleclient-archive/simpleclient_hibernate/src/test/java/io/prometheus/client/hibernate/HibernateStatisticsCollectorTest.java @@ -16,10 +16,9 @@ import org.junit.Test; import org.junit.rules.ExpectedException; -public class HibernateStatisticsCollectorTest { +class HibernateStatisticsCollectorTest { - @Rule - public ExpectedException expectedException = ExpectedException.none(); + @Rule public ExpectedException expectedException = ExpectedException.none(); private SessionFactory sessionFactory; private Statistics statistics; @@ -44,16 +43,13 @@ public void shouldPublishSessionMetrics() { when(statistics.getConnectCount()).thenReturn(4L); when(statistics.getOptimisticFailureCount()).thenReturn(5L); - new HibernateStatisticsCollector() - .add(sessionFactory, "factory1") - .register(registry); + new HibernateStatisticsCollector().add(sessionFactory, "factory1").register(registry); assertThat(getSample("hibernate_session_opened_total", "factory1"), is(1.0)); assertThat(getSample("hibernate_session_closed_total", "factory1"), is(2.0)); assertThat(getSample("hibernate_flushed_total", "factory1"), is(3.0)); assertThat(getSample("hibernate_connect_total", "factory1"), is(4.0)); assertThat(getSample("hibernate_optimistic_failure_total", "factory1"), is(5.0)); - } @Test @@ -64,15 +60,12 @@ public void shouldPublishConnectionMetrics() { when(statistics.getTransactionCount()).thenReturn(3L); when(statistics.getSuccessfulTransactionCount()).thenReturn(4L); - new HibernateStatisticsCollector() - .add(sessionFactory, "factory2") - .register(registry); + new HibernateStatisticsCollector().add(sessionFactory, "factory2").register(registry); assertThat(getSample("hibernate_statement_prepared_total", "factory2"), is(1.0)); assertThat(getSample("hibernate_statement_closed_total", "factory2"), is(2.0)); assertThat(getSample("hibernate_transaction_total", "factory2"), is(3.0)); assertThat(getSample("hibernate_transaction_success_total", "factory2"), is(4.0)); - } @Test @@ -94,9 +87,7 @@ public void shouldPublishCacheMetrics() { when(statistics.getUpdateTimestampsCacheMissCount()).thenReturn(11L); when(statistics.getUpdateTimestampsCachePutCount()).thenReturn(12L); - new HibernateStatisticsCollector() - .add(sessionFactory, "factory3") - .register(registry); + new HibernateStatisticsCollector().add(sessionFactory, "factory3").register(registry); assertThat(getSample("hibernate_second_level_cache_hit_total", "factory3"), is(1.0)); assertThat(getSample("hibernate_second_level_cache_miss_total", "factory3"), is(2.0)); @@ -113,7 +104,6 @@ public void shouldPublishCacheMetrics() { assertThat(getSample("hibernate_update_timestamps_cache_hit_total", "factory3"), is(10.0)); assertThat(getSample("hibernate_update_timestamps_cache_miss_total", "factory3"), is(11.0)); assertThat(getSample("hibernate_update_timestamps_cache_put_total", "factory3"), is(12.0)); - } @Test @@ -131,9 +121,7 @@ public void shouldPublishEntityMetrics() { when(statistics.getCollectionRemoveCount()).thenReturn(9L); when(statistics.getCollectionRecreateCount()).thenReturn(10L); - new HibernateStatisticsCollector() - .add(sessionFactory, "factory4") - .register(registry); + new HibernateStatisticsCollector().add(sessionFactory, "factory4").register(registry); assertThat(getSample("hibernate_entity_delete_total", "factory4"), is(1.0)); assertThat(getSample("hibernate_entity_insert_total", "factory4"), is(2.0)); @@ -146,7 +134,6 @@ public void shouldPublishEntityMetrics() { assertThat(getSample("hibernate_collection_update_total", "factory4"), is(8.0)); assertThat(getSample("hibernate_collection_remove_total", "factory4"), is(9.0)); assertThat(getSample("hibernate_collection_recreate_total", "factory4"), is(10.0)); - } @Test @@ -155,13 +142,10 @@ public void shouldPublishQueryExecutionMetrics() { when(statistics.getQueryExecutionCount()).thenReturn(1L); when(statistics.getNaturalIdQueryExecutionCount()).thenReturn(3L); - new HibernateStatisticsCollector() - .add(sessionFactory, "factory5") - .register(registry); + new HibernateStatisticsCollector().add(sessionFactory, "factory5").register(registry); assertThat(getSample("hibernate_query_execution_total", "factory5"), is(1.0)); assertThat(getSample("hibernate_natural_id_query_execution_total", "factory5"), is(3.0)); - } @Test @@ -170,19 +154,29 @@ public void shouldPublishPerQueryMetricsWhenEnabled() { mockQueryStatistics(query); new HibernateStatisticsCollector() - .add(sessionFactory, "factory6") - .enablePerQueryMetrics() - .register(registry); - - assertThat(getSampleForQuery("hibernate_per_query_cache_hit_total", "factory6", query), is(1.0)); - assertThat(getSampleForQuery("hibernate_per_query_cache_miss_total", "factory6", query), is(2.0)); - assertThat(getSampleForQuery("hibernate_per_query_cache_put_total", "factory6", query), is(3.0)); - assertThat(getSampleForQuery("hibernate_per_query_execution_max_seconds", "factory6", query), is(0.555d)); - assertThat(getSampleForQuery("hibernate_per_query_execution_min_seconds", "factory6", query), is(0.123d)); - assertThat(getSampleForQuery("hibernate_per_query_execution_rows_total", "factory6", query), is(7.0)); - assertThat(getSampleForQuery("hibernate_per_query_execution_total", "factory6", query), is(8.0)); - assertThat(getSampleForQuery("hibernate_per_query_execution_seconds_total", "factory6", query), is(102.540d)); + .add(sessionFactory, "factory6") + .enablePerQueryMetrics() + .register(registry); + assertThat( + getSampleForQuery("hibernate_per_query_cache_hit_total", "factory6", query), is(1.0)); + assertThat( + getSampleForQuery("hibernate_per_query_cache_miss_total", "factory6", query), is(2.0)); + assertThat( + getSampleForQuery("hibernate_per_query_cache_put_total", "factory6", query), is(3.0)); + assertThat( + getSampleForQuery("hibernate_per_query_execution_max_seconds", "factory6", query), + is(0.555d)); + assertThat( + getSampleForQuery("hibernate_per_query_execution_min_seconds", "factory6", query), + is(0.123d)); + assertThat( + getSampleForQuery("hibernate_per_query_execution_rows_total", "factory6", query), is(7.0)); + assertThat( + getSampleForQuery("hibernate_per_query_execution_total", "factory6", query), is(8.0)); + assertThat( + getSampleForQuery("hibernate_per_query_execution_seconds_total", "factory6", query), + is(102.540d)); } @Test @@ -190,23 +184,31 @@ public void shouldNotPublishPerQueryMetricsByDefault() { String query = "query"; mockQueryStatistics(query); - new HibernateStatisticsCollector() - .add(sessionFactory, "factory7") - .register(registry); - - assertThat(getSampleForQuery("hibernate_per_query_cache_hit_total", "factory7", query), nullValue()); - assertThat(getSampleForQuery("hibernate_per_query_cache_miss_total", "factory7", query), nullValue()); - assertThat(getSampleForQuery("hibernate_per_query_cache_put_total", "factory7", query), nullValue()); - assertThat(getSampleForQuery("hibernate_per_query_execution_max_seconds", "factory7", query), nullValue()); - assertThat(getSampleForQuery("hibernate_per_query_execution_min_seconds", "factory7", query), nullValue()); - assertThat(getSampleForQuery("hibernate_per_query_execution_rows_total", "factory7", query), nullValue()); - assertThat(getSampleForQuery("hibernate_per_query_execution_total", "factory7", query), nullValue()); - assertThat(getSampleForQuery("hibernate_per_query_execution_seconds", "factory7", query), nullValue()); - + new HibernateStatisticsCollector().add(sessionFactory, "factory7").register(registry); + + assertThat( + getSampleForQuery("hibernate_per_query_cache_hit_total", "factory7", query), nullValue()); + assertThat( + getSampleForQuery("hibernate_per_query_cache_miss_total", "factory7", query), nullValue()); + assertThat( + getSampleForQuery("hibernate_per_query_cache_put_total", "factory7", query), nullValue()); + assertThat( + getSampleForQuery("hibernate_per_query_execution_max_seconds", "factory7", query), + nullValue()); + assertThat( + getSampleForQuery("hibernate_per_query_execution_min_seconds", "factory7", query), + nullValue()); + assertThat( + getSampleForQuery("hibernate_per_query_execution_rows_total", "factory7", query), + nullValue()); + assertThat( + getSampleForQuery("hibernate_per_query_execution_total", "factory7", query), nullValue()); + assertThat( + getSampleForQuery("hibernate_per_query_execution_seconds", "factory7", query), nullValue()); } private void mockQueryStatistics(String query) { - when(statistics.getQueries()).thenReturn(new String[]{query}); + when(statistics.getQueries()).thenReturn(new String[] {query}); when(statistics.getQueryStatistics(eq(query))).thenReturn(queryStatistics); when(queryStatistics.getCacheHitCount()).thenReturn(1L); when(queryStatistics.getCacheMissCount()).thenReturn(2L); @@ -225,19 +227,14 @@ public void shouldFailIfNoSessionFactoriesAreRegistered() { expectedException.expectMessage("SessionFactory"); new HibernateStatisticsCollector().register(registry); - } private Double getSample(String metric, String factory) { - return registry.getSampleValue( - metric, new String[]{"unit"}, new String[]{factory} - ); + return registry.getSampleValue(metric, new String[] {"unit"}, new String[] {factory}); } private Double getSampleForQuery(String metric, String factory, String query) { return registry.getSampleValue( - metric, new String[]{"unit", "query"}, new String[]{factory, query} - ); + metric, new String[] {"unit", "query"}, new String[] {factory, query}); } - -} \ No newline at end of file +} diff --git a/simpleclient-archive/simpleclient_hibernate/version-rules.xml b/simpleclient-archive/simpleclient_hibernate/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/simpleclient-archive/simpleclient_hibernate/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/simpleclient-archive/simpleclient_httpserver/pom.xml b/simpleclient-archive/simpleclient_httpserver/pom.xml new file mode 100644 index 000000000..efcc225eb --- /dev/null +++ b/simpleclient-archive/simpleclient_httpserver/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.0.0-beta-2-SNAPSHOT + + + simpleclient_httpserver + bundle + + Prometheus Java Simpleclient Httpserver + + Httpserver exposition for the simpleclient. + + + + + io.prometheus + simpleclient + ${project.version} + + + io.prometheus + simpleclient_common + ${project.version} + + + + javax.xml.bind + jaxb-api + 2.4.0-b180830.0359 + test + + + diff --git a/simpleclient-archive/simpleclient_httpserver/src/main/java/io/prometheus/client/exporter/HTTPServer.java b/simpleclient-archive/simpleclient_httpserver/src/main/java/io/prometheus/client/exporter/HTTPServer.java new file mode 100644 index 000000000..f0cec823b --- /dev/null +++ b/simpleclient-archive/simpleclient_httpserver/src/main/java/io/prometheus/client/exporter/HTTPServer.java @@ -0,0 +1,518 @@ +package io.prometheus.client.exporter; + +import com.sun.net.httpserver.Authenticator; +import com.sun.net.httpserver.HttpContext; +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; +import com.sun.net.httpserver.HttpsConfigurator; +import com.sun.net.httpserver.HttpsServer; +import io.prometheus.client.CollectorRegistry; +import io.prometheus.client.Predicate; +import io.prometheus.client.SampleNameFilter; +import io.prometheus.client.Supplier; +import io.prometheus.client.exporter.common.TextFormat; +import java.io.ByteArrayOutputStream; +import java.io.Closeable; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.net.HttpURLConnection; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.URLDecoder; +import java.nio.charset.Charset; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.FutureTask; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.zip.GZIPOutputStream; + +/** + * Expose Prometheus metrics using a plain Java HttpServer. + * + *

    Example Usage: + * + *

    {@code
    + * HTTPServer server = new HTTPServer(1234);
    + * }
    + */ +public class HTTPServer implements Closeable { + + static { + if (!System.getProperties().containsKey("sun.net.httpserver.maxReqTime")) { + System.setProperty("sun.net.httpserver.maxReqTime", "60"); + } + + if (!System.getProperties().containsKey("sun.net.httpserver.maxRspTime")) { + System.setProperty("sun.net.httpserver.maxRspTime", "600"); + } + } + + private static class LocalByteArray extends ThreadLocal { + @Override + protected ByteArrayOutputStream initialValue() { + return new ByteArrayOutputStream(1 << 20); + } + } + + /** Handles Metrics collections from the given registry. */ + public static class HTTPMetricHandler implements HttpHandler { + private final CollectorRegistry registry; + private final LocalByteArray response = new LocalByteArray(); + private final Supplier> sampleNameFilterSupplier; + private static final String HEALTHY_RESPONSE = "Exporter is Healthy."; + + public HTTPMetricHandler(CollectorRegistry registry) { + this(registry, null); + } + + public HTTPMetricHandler( + CollectorRegistry registry, Supplier> sampleNameFilterSupplier) { + this.registry = registry; + this.sampleNameFilterSupplier = sampleNameFilterSupplier; + } + + @Override + public void handle(HttpExchange t) throws IOException { + String query = t.getRequestURI().getRawQuery(); + String contextPath = t.getHttpContext().getPath(); + ByteArrayOutputStream response = this.response.get(); + response.reset(); + OutputStreamWriter osw = new OutputStreamWriter(response, Charset.forName("UTF-8")); + if ("/-/healthy".equals(contextPath)) { + osw.write(HEALTHY_RESPONSE); + } else { + String contentType = TextFormat.chooseContentType(t.getRequestHeaders().getFirst("Accept")); + t.getResponseHeaders().set("Content-Type", contentType); + Predicate filter = + sampleNameFilterSupplier == null ? null : sampleNameFilterSupplier.get(); + filter = SampleNameFilter.restrictToNamesEqualTo(filter, parseQuery(query)); + if (filter == null) { + TextFormat.writeFormat(contentType, osw, registry.metricFamilySamples()); + } else { + TextFormat.writeFormat(contentType, osw, registry.filteredMetricFamilySamples(filter)); + } + } + + osw.close(); + + if (shouldUseCompression(t)) { + t.getResponseHeaders().set("Content-Encoding", "gzip"); + t.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0); + final GZIPOutputStream os = new GZIPOutputStream(t.getResponseBody()); + try { + response.writeTo(os); + } finally { + os.close(); + } + } else { + long contentLength = response.size(); + if (contentLength > 0) { + t.getResponseHeaders().set("Content-Length", String.valueOf(contentLength)); + } + if (t.getRequestMethod().equals("HEAD")) { + contentLength = -1; + } + t.sendResponseHeaders(HttpURLConnection.HTTP_OK, contentLength); + response.writeTo(t.getResponseBody()); + } + t.close(); + } + } + + protected static boolean shouldUseCompression(HttpExchange exchange) { + List encodingHeaders = exchange.getRequestHeaders().get("Accept-Encoding"); + if (encodingHeaders == null) return false; + + for (String encodingHeader : encodingHeaders) { + String[] encodings = encodingHeader.split(","); + for (String encoding : encodings) { + if (encoding.trim().equalsIgnoreCase("gzip")) { + return true; + } + } + } + return false; + } + + protected static Set parseQuery(String query) throws IOException { + Set names = new HashSet(); + if (query != null) { + String[] pairs = query.split("&"); + for (String pair : pairs) { + int idx = pair.indexOf("="); + if (idx != -1 && URLDecoder.decode(pair.substring(0, idx), "UTF-8").equals("name[]")) { + names.add(URLDecoder.decode(pair.substring(idx + 1), "UTF-8")); + } + } + } + return names; + } + + static class NamedDaemonThreadFactory implements ThreadFactory { + private static final AtomicInteger POOL_NUMBER = new AtomicInteger(1); + + private final int poolNumber = POOL_NUMBER.getAndIncrement(); + private final AtomicInteger threadNumber = new AtomicInteger(1); + private final ThreadFactory delegate; + private final boolean daemon; + + NamedDaemonThreadFactory(ThreadFactory delegate, boolean daemon) { + this.delegate = delegate; + this.daemon = daemon; + } + + @Override + public Thread newThread(Runnable r) { + Thread t = delegate.newThread(r); + t.setName(String.format("prometheus-http-%d-%d", poolNumber, threadNumber.getAndIncrement())); + t.setDaemon(daemon); + return t; + } + + static ThreadFactory defaultThreadFactory(boolean daemon) { + return new NamedDaemonThreadFactory(Executors.defaultThreadFactory(), daemon); + } + } + + protected final HttpServer server; + protected final ExecutorService executorService; + + /** + * We keep the original constructors of {@link HTTPServer} for compatibility, but new + * configuration parameters like {@code sampleNameFilter} must be configured using the Builder. + */ + public static class Builder { + + private int port = 0; + private String hostname = null; + private InetAddress inetAddress = null; + private InetSocketAddress inetSocketAddress = null; + private HttpServer httpServer = null; + private ExecutorService executorService = null; + private CollectorRegistry registry = CollectorRegistry.defaultRegistry; + private boolean daemon = false; + private Predicate sampleNameFilter; + private Supplier> sampleNameFilterSupplier; + private Authenticator authenticator; + private HttpsConfigurator httpsConfigurator; + + /** + * Port to bind to. Must not be called together with {@link + * #withInetSocketAddress(InetSocketAddress)} or {@link #withHttpServer(HttpServer)}. Default is + * 0, indicating that a random port will be selected. + */ + public Builder withPort(int port) { + this.port = port; + return this; + } + + /** + * Use this hostname to resolve the IP address to bind to. Must not be called together with + * {@link #withInetAddress(InetAddress)} or {@link #withInetSocketAddress(InetSocketAddress)} or + * {@link #withHttpServer(HttpServer)}. Default is empty, indicating that the HTTPServer binds + * to the wildcard address. + */ + public Builder withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Bind to this IP address. Must not be called together with {@link #withHostname(String)} or + * {@link #withInetSocketAddress(InetSocketAddress)} or {@link #withHttpServer(HttpServer)}. + * Default is empty, indicating that the HTTPServer binds to the wildcard address. + */ + public Builder withInetAddress(InetAddress address) { + this.inetAddress = address; + return this; + } + + /** + * Listen on this address. Must not be called together with {@link #withPort(int)}, {@link + * #withHostname(String)}, {@link #withInetAddress(InetAddress)}, or {@link + * #withHttpServer(HttpServer)}. + */ + public Builder withInetSocketAddress(InetSocketAddress address) { + this.inetSocketAddress = address; + return this; + } + + /** + * Use this httpServer. The {@code httpServer} is expected to already be bound to an address. + * Must not be called together with {@link #withPort(int)}, or {@link #withHostname(String)}, or + * {@link #withInetAddress(InetAddress)}, or {@link #withInetSocketAddress(InetSocketAddress)}, + * or {@link #withExecutorService(ExecutorService)}. + */ + public Builder withHttpServer(HttpServer httpServer) { + this.httpServer = httpServer; + return this; + } + + /** + * Optional: ExecutorService used by the {@code httpServer}. Must not be called together with + * the {@link #withHttpServer(HttpServer)}. + * + * @param executorService + * @return + */ + public Builder withExecutorService(ExecutorService executorService) { + this.executorService = executorService; + return this; + } + + /** + * By default, the {@link HTTPServer} uses non-daemon threads. Set this to {@code true} to run + * the {@link HTTPServer} with daemon threads. + */ + public Builder withDaemonThreads(boolean daemon) { + this.daemon = daemon; + return this; + } + + /** + * Optional: Only export time series where {@code sampleNameFilter.test(name)} returns true. + * + *

    Use this if the sampleNameFilter remains the same throughout the lifetime of the + * HTTPServer. If the sampleNameFilter changes during runtime, use {@link + * #withSampleNameFilterSupplier(Supplier)}. + */ + public Builder withSampleNameFilter(Predicate sampleNameFilter) { + this.sampleNameFilter = sampleNameFilter; + return this; + } + + /** + * Optional: Only export time series where {@code sampleNameFilter.test(name)} returns true. + * + *

    Use this if the sampleNameFilter may change during runtime, like for example if you have a + * hot reload mechanism for your filter config. If the sampleNameFilter remains the same + * throughout the lifetime of the HTTPServer, use {@link #withSampleNameFilter(Predicate)} + * instead. + */ + public Builder withSampleNameFilterSupplier( + Supplier> sampleNameFilterSupplier) { + this.sampleNameFilterSupplier = sampleNameFilterSupplier; + return this; + } + + /** Optional: Default is {@link CollectorRegistry#defaultRegistry}. */ + public Builder withRegistry(CollectorRegistry registry) { + this.registry = registry; + return this; + } + + /** Optional: {@link Authenticator} to use to support authentication. */ + public Builder withAuthenticator(Authenticator authenticator) { + this.authenticator = authenticator; + return this; + } + + /** Optional: {@link HttpsConfigurator} to use to support TLS/SSL */ + public Builder withHttpsConfigurator(HttpsConfigurator configurator) { + this.httpsConfigurator = configurator; + return this; + } + + /** + * Build the HTTPServer + * + * @throws IOException + */ + public HTTPServer build() throws IOException { + if (sampleNameFilter != null) { + assertNull( + sampleNameFilterSupplier, + "cannot configure 'sampleNameFilter' and 'sampleNameFilterSupplier' at the same time"); + sampleNameFilterSupplier = SampleNameFilterSupplier.of(sampleNameFilter); + } + + if (httpServer != null) { + assertNull(executorService, "cannot configure 'httpServer' and `executorService'"); + assertZero(port, "cannot configure 'httpServer' and 'port' at the same time"); + assertNull(hostname, "cannot configure 'httpServer' and 'hostname' at the same time"); + assertNull(inetAddress, "cannot configure 'httpServer' and 'inetAddress' at the same time"); + assertNull( + inetSocketAddress, + "cannot configure 'httpServer' and 'inetSocketAddress' at the same time"); + assertNull( + httpsConfigurator, + "cannot configure 'httpServer' and 'httpsConfigurator' at the same time"); + return new HTTPServer( + executorService, httpServer, registry, daemon, sampleNameFilterSupplier, authenticator); + } else if (inetSocketAddress != null) { + assertZero(port, "cannot configure 'inetSocketAddress' and 'port' at the same time"); + assertNull( + hostname, "cannot configure 'inetSocketAddress' and 'hostname' at the same time"); + assertNull( + inetAddress, "cannot configure 'inetSocketAddress' and 'inetAddress' at the same time"); + } else if (inetAddress != null) { + assertNull(hostname, "cannot configure 'inetAddress' and 'hostname' at the same time"); + inetSocketAddress = new InetSocketAddress(inetAddress, port); + } else if (hostname != null) { + inetSocketAddress = new InetSocketAddress(hostname, port); + } else { + inetSocketAddress = new InetSocketAddress(port); + } + + HttpServer httpServer = null; + if (httpsConfigurator != null) { + httpServer = HttpsServer.create(inetSocketAddress, 3); + ((HttpsServer) httpServer).setHttpsConfigurator(httpsConfigurator); + } else { + httpServer = HttpServer.create(inetSocketAddress, 3); + } + + return new HTTPServer( + executorService, httpServer, registry, daemon, sampleNameFilterSupplier, authenticator); + } + + private void assertNull(Object o, String msg) { + if (o != null) { + throw new IllegalStateException(msg); + } + } + + private void assertZero(int i, String msg) { + if (i != 0) { + throw new IllegalStateException(msg); + } + } + } + + /** + * Start an HTTP server serving Prometheus metrics from the given registry using the given {@link + * HttpServer}. The {@code httpServer} is expected to already be bound to an address + */ + public HTTPServer(HttpServer httpServer, CollectorRegistry registry, boolean daemon) + throws IOException { + this(null, httpServer, registry, daemon, null, null); + } + + /** Start an HTTP server serving Prometheus metrics from the given registry. */ + public HTTPServer(InetSocketAddress addr, CollectorRegistry registry, boolean daemon) + throws IOException { + this(HttpServer.create(addr, 3), registry, daemon); + } + + /** + * Start an HTTP server serving Prometheus metrics from the given registry using non-daemon + * threads. + */ + public HTTPServer(InetSocketAddress addr, CollectorRegistry registry) throws IOException { + this(addr, registry, false); + } + + /** Start an HTTP server serving the default Prometheus registry. */ + public HTTPServer(int port, boolean daemon) throws IOException { + this(new InetSocketAddress(port), CollectorRegistry.defaultRegistry, daemon); + } + + /** Start an HTTP server serving the default Prometheus registry using non-daemon threads. */ + public HTTPServer(int port) throws IOException { + this(port, false); + } + + /** Start an HTTP server serving the default Prometheus registry. */ + public HTTPServer(String host, int port, boolean daemon) throws IOException { + this(new InetSocketAddress(host, port), CollectorRegistry.defaultRegistry, daemon); + } + + /** Start an HTTP server serving the default Prometheus registry using non-daemon threads. */ + public HTTPServer(String host, int port) throws IOException { + this(new InetSocketAddress(host, port), CollectorRegistry.defaultRegistry, false); + } + + private HTTPServer( + ExecutorService executorService, + HttpServer httpServer, + CollectorRegistry registry, + boolean daemon, + Supplier> sampleNameFilterSupplier, + Authenticator authenticator) { + if (httpServer.getAddress() == null) + throw new IllegalArgumentException("HttpServer hasn't been bound to an address"); + + server = httpServer; + HttpHandler mHandler = new HTTPMetricHandler(registry, sampleNameFilterSupplier); + HttpContext mContext = server.createContext("/", mHandler); + if (authenticator != null) { + mContext.setAuthenticator(authenticator); + } + mContext = server.createContext("/metrics", mHandler); + if (authenticator != null) { + mContext.setAuthenticator(authenticator); + } + mContext = server.createContext("/-/healthy", mHandler); + if (authenticator != null) { + mContext.setAuthenticator(authenticator); + } + if (executorService != null) { + this.executorService = executorService; + } else { + ThreadPoolExecutor executor = + (ThreadPoolExecutor) + Executors.newCachedThreadPool(NamedDaemonThreadFactory.defaultThreadFactory(daemon)); + executor.setKeepAliveTime(2, TimeUnit.MINUTES); + this.executorService = executor; + } + server.setExecutor(this.executorService); + start(daemon); + } + + /** Start an HTTP server by making sure that its background thread inherit proper daemon flag. */ + private void start(boolean daemon) { + if (daemon == Thread.currentThread().isDaemon()) { + server.start(); + } else { + FutureTask startTask = + new FutureTask( + new Runnable() { + @Override + public void run() { + server.start(); + } + }, + null); + NamedDaemonThreadFactory.defaultThreadFactory(daemon).newThread(startTask).start(); + try { + startTask.get(); + } catch (ExecutionException e) { + throw new RuntimeException("Unexpected exception on starting HTTPSever", e); + } catch (InterruptedException e) { + // This is possible only if the current tread has been interrupted, + // but in real use cases this should not happen. + // In any case, there is nothing to do, except to propagate interrupted flag. + Thread.currentThread().interrupt(); + } + } + } + + /** + * Stop the HTTP server. + * + * @deprecated renamed to close(), so that the HTTPServer can be used in try-with-resources. + */ + public void stop() { + close(); + } + + /** Stop the HTTPServer. */ + @Override + public void close() { + server.stop(0); + executorService.shutdown(); // Free any (parked/idle) threads in pool + } + + /** Gets the port number. */ + public int getPort() { + return server.getAddress().getPort(); + } +} diff --git a/simpleclient-archive/simpleclient_httpserver/src/main/java/io/prometheus/client/exporter/SampleNameFilterSupplier.java b/simpleclient-archive/simpleclient_httpserver/src/main/java/io/prometheus/client/exporter/SampleNameFilterSupplier.java new file mode 100644 index 000000000..d41dd5c75 --- /dev/null +++ b/simpleclient-archive/simpleclient_httpserver/src/main/java/io/prometheus/client/exporter/SampleNameFilterSupplier.java @@ -0,0 +1,26 @@ +package io.prometheus.client.exporter; + +import io.prometheus.client.Predicate; +import io.prometheus.client.Supplier; + +/** + * For convenience, an implementation of a {@code Supplier>} that always returns + * the same sampleNameFilter. + */ +public class SampleNameFilterSupplier implements Supplier> { + + private final Predicate sampleNameFilter; + + public static SampleNameFilterSupplier of(Predicate sampleNameFilter) { + return new SampleNameFilterSupplier(sampleNameFilter); + } + + private SampleNameFilterSupplier(Predicate sampleNameFilter) { + this.sampleNameFilter = sampleNameFilter; + } + + @Override + public Predicate get() { + return sampleNameFilter; + } +} diff --git a/simpleclient-archive/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/ExampleExporter.java b/simpleclient-archive/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/ExampleExporter.java new file mode 100644 index 000000000..9b8dd84ff --- /dev/null +++ b/simpleclient-archive/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/ExampleExporter.java @@ -0,0 +1,24 @@ +package io.prometheus.client.exporter; + +import io.prometheus.client.Counter; +import io.prometheus.client.Gauge; +import io.prometheus.client.Histogram; +import io.prometheus.client.Summary; + +public class ExampleExporter { + + static final Gauge g = Gauge.build().name("gauge").help("blah").register(); + static final Counter c = Counter.build().name("counter").help("meh").register(); + static final Summary s = Summary.build().name("summary").help("meh").register(); + static final Histogram h = Histogram.build().name("histogram").help("meh").register(); + static final Gauge l = Gauge.build().name("labels").help("blah").labelNames("l").register(); + + public static void main(String[] args) throws Exception { + new HTTPServer(1234); + g.set(1); + c.inc(2); + s.observe(3); + h.observe(4); + l.labels("foo").inc(5); + } +} diff --git a/simpleclient-archive/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/HttpRequest.java b/simpleclient-archive/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/HttpRequest.java new file mode 100644 index 000000000..75b731972 --- /dev/null +++ b/simpleclient-archive/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/HttpRequest.java @@ -0,0 +1,237 @@ +package io.prometheus.client.exporter; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLConnection; +import java.security.GeneralSecurityException; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Scanner; +import java.util.Set; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.xml.bind.DatatypeConverter; + +/** Class to perform HTTP testing */ +public class HttpRequest { + + enum METHOD { + GET, + HEAD + } + + private final Configuration configuration; + + /** + * Constructor + * + * @param configuration configuration + */ + private HttpRequest(Configuration configuration) { + this.configuration = configuration; + } + + /** + * Method to execute an HTTP request + * + * @return HttpResponse + * @throws IOException + */ + public HttpResponse execute() throws IOException { + if (configuration.url.toLowerCase().startsWith("https://") + && (configuration.trustManagers != null)) { + try { + SSLContext sslContext = SSLContext.getInstance("SSL"); + sslContext.init(null, configuration.trustManagers, new java.security.SecureRandom()); + HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory()); + } catch (GeneralSecurityException e) { + throw new IOException(e); + } + + if (configuration.hostnameVerifier != null) { + HttpsURLConnection.setDefaultHostnameVerifier(configuration.hostnameVerifier); + } + } + + URLConnection urlConnection = new URL(configuration.url).openConnection(); + ((HttpURLConnection) urlConnection).setRequestMethod(configuration.method.toString()); + + Set>> entries = configuration.headers.entrySet(); + for (Map.Entry> entry : entries) { + for (String value : entry.getValue()) { + urlConnection.addRequestProperty(entry.getKey(), value); + } + } + + urlConnection.setUseCaches(false); + urlConnection.setDoInput(true); + urlConnection.setDoOutput(true); + urlConnection.connect(); + + Scanner scanner = new Scanner(urlConnection.getInputStream(), "UTF-8").useDelimiter("\\A"); + + return new HttpResponse( + ((HttpURLConnection) urlConnection).getResponseCode(), + urlConnection.getHeaderFields(), + urlConnection.getContentLength(), + scanner.hasNext() ? scanner.next() : ""); + } + + /** Class to build an HttpRequest */ + static class Builder { + + private final Configuration configuration; + + /** Constructor */ + public Builder() { + configuration = new Configuration(); + } + + /** + * Method to set the HTTP request method + * + * @param method + * @return Builder + */ + public Builder withMethod(METHOD method) { + configuration.method = method; + return this; + } + + /** + * Method to set the HTTP request URL + * + * @param url + * @return Builder + */ + public Builder withURL(String url) { + configuration.url = url; + return this; + } + + /** + * Method to add an HTTP request header + * + * @param name + * @param value + * @return Builder + */ + public Builder withHeader(String name, String value) { + configuration.addHeader(name, value); + return this; + } + + /** + * Method to set the HTTP request "Authorization" header + * + * @param username + * @param password + * @return Builder + */ + public Builder withAuthorization(String username, String password) { + configuration.setHeader("Authorization", encodeCredentials(username, password)); + return this; + } + + /** + * Method to set the HTTP request trust managers when using an SSL URL + * + * @param trustManagers + * @return Builder + */ + public Builder withTrustManagers(TrustManager[] trustManagers) { + configuration.trustManagers = trustManagers; + return this; + } + + /** + * Method to set the HTTP request hostname verifier when using an SSL URL + * + * @param hostnameVerifier + * @return Builder + */ + public Builder withHostnameVerifier(HostnameVerifier hostnameVerifier) { + configuration.hostnameVerifier = hostnameVerifier; + return this; + } + + /** + * Method to build the HttpRequest + * + * @return HttpRequest + */ + public HttpRequest build() { + return new HttpRequest(configuration); + } + } + + /** Class used for Builder configuration */ + private static class Configuration { + + public METHOD method; + public String url; + public Map> headers; + public TrustManager[] trustManagers; + public HostnameVerifier hostnameVerifier; + + /** Constructor */ + Configuration() { + method = METHOD.GET; + headers = new HashMap>(); + } + + /** + * Method to add (append) an HTTP request header + * + * @param name + * @param value + * @return Configuration + */ + void addHeader(String name, String value) { + name = name.toLowerCase(); + List values = headers.get(name); + if (values == null) { + values = new LinkedList(); + headers.put(name, values); + } + + values.add(value); + } + + /** + * Method to set (overwrite) an HTTP request header, removing all previous header values + * + * @param name + * @param value + * @return Configuration + */ + void setHeader(String name, String value) { + List values = new LinkedList(); + values.add(value); + headers.put(name, values); + } + } + + /** + * Method to encode "Authorization" credentials + * + * @param username + * @param password + * @return String + */ + private static final String encodeCredentials(String username, String password) { + // Per RFC4648 table 2. We support Java 6, and java.util.Base64 was only added in Java 8, + try { + byte[] credentialsBytes = (username + ":" + password).getBytes("UTF-8"); + return "Basic " + DatatypeConverter.printBase64Binary(credentialsBytes); + } catch (UnsupportedEncodingException e) { + throw new IllegalArgumentException(e); + } + } +} diff --git a/simpleclient-archive/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/HttpResponse.java b/simpleclient-archive/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/HttpResponse.java new file mode 100644 index 000000000..af559a4f0 --- /dev/null +++ b/simpleclient-archive/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/HttpResponse.java @@ -0,0 +1,109 @@ +package io.prometheus.client.exporter; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** Class to perform HTTP testing */ +class HttpResponse { + + private int responseCode; + private Map> headers; + private long contentLength = -1; + private String body; + + /** + * Constructor + * + * @param responseCode + * @param headers + * @param contentLength + * @param body + */ + HttpResponse(int responseCode, Map> headers, long contentLength, String body) + throws IOException { + this.responseCode = responseCode; + this.body = body; + this.contentLength = contentLength; + this.headers = new HashMap>(); + + Set>> headerSet = headers.entrySet(); + for (String header : headers.keySet()) { + if (header != null) { + List values = headers.get(header); + this.headers.put(header.toLowerCase(), values); + } + } + + if (getHeader("content-length") != null && getHeader("transfer-encoding") != null) { + throw new IOException( + "Invalid HTTP response, should only contain Connect-Length or Transfer-Encoding"); + } + } + + /** + * Method to get the HTTP response code + * + * @return int + */ + public int getResponseCode() { + return this.responseCode; + } + + /** + * Method to get a list of HTTP response headers values + * + * @param name + * @return List + */ + public List getHeaderList(String name) { + return headers.get(name.toLowerCase()); + } + + /** + * Method to get the first HTTP response header value + * + * @param name + * @return String + */ + public String getHeader(String name) { + String value = null; + + List valueList = getHeaderList(name); + if (valueList != null && (valueList.size() >= 0)) { + value = valueList.get(0); + } + + return value; + } + + /** + * Method to get the first HTTP response header value as a Long. Returns null of the header + * doesn't exist + * + * @param name + * @return Long + */ + public Long getHeaderAsLong(String name) { + String value = getHeader(name); + if (value != null) { + try { + return Long.valueOf(value); + } catch (Exception e) { + } + } + + return null; + } + + /** + * Method to get the HTTP response body + * + * @return String + */ + public String getBody() { + return body; + } +} diff --git a/simpleclient-archive/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/TestDaemonFlags.java b/simpleclient-archive/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/TestDaemonFlags.java new file mode 100644 index 000000000..3252b8ac5 --- /dev/null +++ b/simpleclient-archive/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/TestDaemonFlags.java @@ -0,0 +1,46 @@ +package io.prometheus.client.exporter; + +import static org.assertj.core.api.Java6Assertions.assertThat; + +import java.io.IOException; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.FutureTask; +import org.junit.Test; + +class TestDaemonFlags { + + @Test + public void testDefaultIsNotDaemon() + throws IOException, ExecutionException, InterruptedException { + assertThat(usesDaemonExecutor(new HTTPServer(0))).isFalse(); + } + + @Test + public void testDaemon() throws IOException, ExecutionException, InterruptedException { + assertThat(usesDaemonExecutor(new HTTPServer(0, true))).isTrue(); + } + + @Test + public void testNonDaemon() throws IOException, ExecutionException, InterruptedException { + assertThat(usesDaemonExecutor(new HTTPServer(0, false))).isFalse(); + } + + private boolean usesDaemonExecutor(HTTPServer httpServer) + throws IOException, InterruptedException, ExecutionException { + try { + FutureTask task = + new FutureTask( + new Callable() { + @Override + public Boolean call() throws Exception { + return Thread.currentThread().isDaemon(); + } + }); + httpServer.server.getExecutor().execute(task); + return task.get(); + } finally { + httpServer.stop(); + } + } +} diff --git a/simpleclient-archive/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/TestHTTPServer.java b/simpleclient-archive/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/TestHTTPServer.java new file mode 100644 index 000000000..889575c23 --- /dev/null +++ b/simpleclient-archive/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/TestHTTPServer.java @@ -0,0 +1,658 @@ +package io.prometheus.client.exporter; + +import static org.assertj.core.api.Java6Assertions.assertThat; + +import com.sun.net.httpserver.Authenticator; +import com.sun.net.httpserver.BasicAuthenticator; +import com.sun.net.httpserver.HttpServer; +import com.sun.net.httpserver.HttpsConfigurator; +import com.sun.net.httpserver.HttpsParameters; +import io.prometheus.client.CollectorRegistry; +import io.prometheus.client.Gauge; +import io.prometheus.client.SampleNameFilter; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.InetSocketAddress; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.cert.X509Certificate; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLParameters; +import javax.net.ssl.SSLSession; +import javax.net.ssl.TrustManager; +import javax.net.ssl.TrustManagerFactory; +import javax.net.ssl.X509TrustManager; +import javax.xml.bind.DatatypeConverter; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +class TestHTTPServer { + + CollectorRegistry registry; + + private static final SSLContext SSL_CONTEXT; + + private static final HttpsConfigurator HTTPS_CONFIGURATOR; + + // Code put in a static block due to possible Exceptions + static { + try { + SSL_CONTEXT = + createSSLContext("SSL", "PKCS12", "./src/test/resources/keystore.pkcs12", "changeit"); + } catch (GeneralSecurityException e) { + throw new RuntimeException("Exception creating SSL_CONTEXT", e); + } catch (IOException e) { + throw new RuntimeException("Exception creating SSL_CONTEXT", e); + } + + HTTPS_CONFIGURATOR = createHttpsConfigurator(SSL_CONTEXT); + } + + /** TrustManager[] that trusts all certificates */ + private static final TrustManager[] TRUST_ALL_CERTS_TRUST_MANAGERS = + new TrustManager[] { + new X509TrustManager() { + public X509Certificate[] getAcceptedIssuers() { + return new X509Certificate[0]; + } + + public void checkClientTrusted(X509Certificate[] certs, String authType) {} + + public void checkServerTrusted(X509Certificate[] certs, String authType) {} + } + }; + + /** HostnameVerifier that accepts any hostname */ + private static final HostnameVerifier TRUST_ALL_HOSTS_HOSTNAME_VERIFIER = + new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + + HttpRequest.Builder createHttpRequestBuilder(HTTPServer httpServer, String urlPath) { + return new HttpRequest.Builder().withURL("http://localhost:" + httpServer.getPort() + urlPath); + } + + HttpRequest.Builder createHttpRequestBuilderWithSSL(HTTPServer httpServer, String urlPath) { + return new HttpRequest.Builder() + .withURL("https://localhost:" + httpServer.getPort() + urlPath) + .withTrustManagers(TRUST_ALL_CERTS_TRUST_MANAGERS) + .withHostnameVerifier(TRUST_ALL_HOSTS_HOSTNAME_VERIFIER); + } + + HttpRequest.Builder createHttpRequestBuilder(HttpServer httpServer, String urlPath) { + return new HttpRequest.Builder() + .withURL("http://localhost:" + httpServer.getAddress().getPort() + urlPath); + } + + @Before + public void init() throws IOException { + registry = new CollectorRegistry(); + Gauge.build("a", "a help").register(registry); + Gauge.build("b", "a help").register(registry); + Gauge.build("c", "a help").register(registry); + } + + @Test(expected = IllegalArgumentException.class) + public void testRefuseUsingUnbound() throws IOException { + CollectorRegistry registry = new CollectorRegistry(); + HTTPServer httpServer = new HTTPServer(HttpServer.create(), registry, true); + httpServer.close(); + } + + @Test + public void testSimpleRequest() throws IOException { + HTTPServer httpServer = new HTTPServer(new InetSocketAddress(0), registry); + + try { + String body = createHttpRequestBuilder(httpServer, "/metrics").build().execute().getBody(); + assertThat(body).contains("a 0.0"); + assertThat(body).contains("b 0.0"); + assertThat(body).contains("c 0.0"); + } finally { + httpServer.close(); + } + } + + @Test + public void testBadParams() throws IOException { + HTTPServer httpServer = new HTTPServer(new InetSocketAddress(0), registry); + + try { + String body = createHttpRequestBuilder(httpServer, "/metrics?x").build().execute().getBody(); + assertThat(body).contains("a 0.0"); + assertThat(body).contains("b 0.0"); + assertThat(body).contains("c 0.0"); + } finally { + httpServer.close(); + } + } + + @Test + public void testSingleName() throws IOException { + HTTPServer httpServer = new HTTPServer(new InetSocketAddress(0), registry); + + try { + String body = + createHttpRequestBuilder(httpServer, "/metrics?name[]=a").build().execute().getBody(); + assertThat(body).contains("a 0.0"); + assertThat(body).doesNotContain("b 0.0"); + assertThat(body).doesNotContain("c 0.0"); + } finally { + httpServer.close(); + } + } + + @Test + public void testMultiName() throws IOException { + HTTPServer httpServer = new HTTPServer(new InetSocketAddress(0), registry); + + try { + String body = + createHttpRequestBuilder(httpServer, "/metrics?name[]=a&name[]=b") + .build() + .execute() + .getBody(); + assertThat(body).contains("a 0.0"); + assertThat(body).contains("b 0.0"); + assertThat(body).doesNotContain("c 0.0"); + } finally { + httpServer.close(); + } + } + + @Test + public void testSampleNameFilter() throws IOException { + HTTPServer httpServer = + new HTTPServer.Builder() + .withRegistry(registry) + .withSampleNameFilter(new SampleNameFilter.Builder().nameMustNotStartWith("a").build()) + .build(); + + try { + String body = + createHttpRequestBuilder(httpServer, "/metrics?name[]=a&name[]=b") + .build() + .execute() + .getBody(); + assertThat(body).doesNotContain("a 0.0"); + assertThat(body).contains("b 0.0"); + assertThat(body).doesNotContain("c 0.0"); + } finally { + httpServer.close(); + } + } + + @Test + public void testSampleNameFilterEmptyBody() throws IOException { + HTTPServer httpServer = + new HTTPServer.Builder() + .withRegistry(registry) + .withSampleNameFilter( + new SampleNameFilter.Builder() + .nameMustNotStartWith("a") + .nameMustNotStartWith("b") + .build()) + .build(); + + try { + HttpResponse httpResponse = + createHttpRequestBuilder(httpServer, "/metrics?name[]=a&name[]=b").build().execute(); + assertThat(httpResponse.getBody()).isEmpty(); + } finally { + httpServer.close(); + } + } + + @Test + public void testDecoding() throws IOException { + HTTPServer httpServer = new HTTPServer(new InetSocketAddress(0), registry); + + try { + String body = + createHttpRequestBuilder(httpServer, "/metrics?n%61me[]=%61").build().execute().getBody(); + assertThat(body).contains("a 0.0"); + assertThat(body).doesNotContain("b 0.0"); + assertThat(body).doesNotContain("c 0.0"); + } finally { + httpServer.close(); + } + } + + @Test + public void testGzipCompression() throws IOException { + HTTPServer httpServer = new HTTPServer(new InetSocketAddress(0), registry); + + try { + String body = + createHttpRequestBuilder(httpServer, "/metrics") + .withHeader("Accept", "gzip") + .withHeader("Accept", "deflate") + .build() + .execute() + .getBody(); + assertThat(body).contains("a 0.0"); + assertThat(body).contains("b 0.0"); + assertThat(body).contains("c 0.0"); + } finally { + httpServer.close(); + } + } + + @Test + public void testOpenMetrics() throws IOException { + HTTPServer httpServer = new HTTPServer(new InetSocketAddress(0), registry); + + try { + String body = + createHttpRequestBuilder(httpServer, "/metrics") + .withHeader( + "Accept", + "application/openmetrics-text;" + + " version=0.0.1,text/plain;version=0.0.4;q=0.5,*/*;q=0.1") + .build() + .execute() + .getBody(); + assertThat(body).contains("# EOF"); + } finally { + httpServer.close(); + } + } + + @Test + public void testHealth() throws IOException { + HTTPServer httpServer = new HTTPServer(new InetSocketAddress(0), registry); + + try { + String body = createHttpRequestBuilder(httpServer, "/-/healthy").build().execute().getBody(); + assertThat(body).contains("Exporter is Healthy"); + } finally { + httpServer.close(); + } + } + + @Test + public void testHealthGzipCompression() throws IOException { + HTTPServer httpServer = new HTTPServer(new InetSocketAddress(0), registry); + + try { + String body = + createHttpRequestBuilder(httpServer, "/-/healthy") + .withHeader("Accept", "gzip") + .withHeader("Accept", "deflate") + .build() + .execute() + .getBody(); + assertThat(body).contains("Exporter is Healthy"); + } finally { + httpServer.close(); + } + } + + @Test + public void testBasicAuthSuccess() throws IOException { + HTTPServer httpServer = + new HTTPServer.Builder() + .withRegistry(registry) + .withAuthenticator(createAuthenticator("/", "user", "secret")) + .build(); + + try { + String body = + createHttpRequestBuilder(httpServer, "/metrics?name[]=a&name[]=b") + .withAuthorization("user", "secret") + .build() + .execute() + .getBody(); + assertThat(body).contains("a 0.0"); + } finally { + httpServer.close(); + } + } + + @Test + public void testBasicAuthCredentialsMissing() throws IOException { + HTTPServer httpServer = + new HTTPServer.Builder() + .withRegistry(registry) + .withAuthenticator(createAuthenticator("/", "user", "secret")) + .build(); + + try { + createHttpRequestBuilder(httpServer, "/metrics?name[]=a&name[]=b") + .build() + .execute() + .getBody(); + Assert.fail("expected IOException with HTTP 401"); + } catch (IOException e) { + Assert.assertTrue(e.getMessage().contains("401")); + } finally { + httpServer.close(); + } + } + + @Test + public void testBasicAuthWrongCredentials() throws IOException { + HTTPServer httpServer = + new HTTPServer.Builder() + .withRegistry(registry) + .withAuthenticator(createAuthenticator("/", "user", "secret")) + .build(); + + try { + createHttpRequestBuilder(httpServer, "/metrics?name[]=a&name[]=b") + .withAuthorization("user", "wrong") + .build() + .execute() + .getBody(); + Assert.fail("expected IOException with HTTP 401"); + } catch (IOException e) { + Assert.assertTrue(e.getMessage().contains("401")); + } finally { + httpServer.close(); + } + } + + @Test + public void testHEADRequest() throws IOException { + HTTPServer httpServer = new HTTPServer.Builder().withRegistry(registry).build(); + + try { + HttpResponse httpResponse = + createHttpRequestBuilder(httpServer, "/metrics?name[]=a&name[]=b") + .withMethod(HttpRequest.METHOD.HEAD) + .build() + .execute(); + Assert.assertNotNull(httpResponse); + Assert.assertNotNull(httpResponse.getHeaderAsLong("content-length")); + Assert.assertTrue(httpResponse.getHeaderAsLong("content-length") == 74); + assertThat(httpResponse.getBody()).isEmpty(); + } finally { + httpServer.close(); + } + } + + @Test + public void testHEADRequestWithSSL() throws GeneralSecurityException, IOException { + HTTPServer httpServer = + new HTTPServer.Builder() + .withRegistry(registry) + .withHttpsConfigurator(HTTPS_CONFIGURATOR) + .build(); + + try { + HttpResponse httpResponse = + createHttpRequestBuilderWithSSL(httpServer, "/metrics?name[]=a&name[]=b") + .withMethod(HttpRequest.METHOD.HEAD) + .build() + .execute(); + Assert.assertNotNull(httpResponse); + Assert.assertNotNull(httpResponse.getHeaderAsLong("content-length")); + Assert.assertTrue(httpResponse.getHeaderAsLong("content-length") == 74); + assertThat(httpResponse.getBody()).isEmpty(); + } finally { + httpServer.close(); + } + } + + @Test + public void testSimpleRequestHttpServerWithHTTPMetricHandler() throws IOException { + InetSocketAddress inetSocketAddress = new InetSocketAddress("localhost", 0); + HttpServer httpServer = HttpServer.create(inetSocketAddress, 0); + httpServer.createContext("/metrics", new HTTPServer.HTTPMetricHandler(registry)); + httpServer.start(); + + try { + String body = createHttpRequestBuilder(httpServer, "/metrics").build().execute().getBody(); + assertThat(body).contains("a 0.0"); + assertThat(body).contains("b 0.0"); + assertThat(body).contains("c 0.0"); + } finally { + httpServer.stop(0); + } + } + + @Test + public void testHEADRequestWithSSLAndBasicAuthSuccess() + throws GeneralSecurityException, IOException { + HTTPServer httpServer = + new HTTPServer.Builder() + .withRegistry(registry) + .withHttpsConfigurator(HTTPS_CONFIGURATOR) + .withAuthenticator(createAuthenticator("/", "user", "secret")) + .build(); + + try { + HttpResponse httpResponse = + createHttpRequestBuilderWithSSL(httpServer, "/metrics?name[]=a&name[]=b") + .withMethod(HttpRequest.METHOD.HEAD) + .withAuthorization("user", "secret") + .build() + .execute(); + Assert.assertNotNull(httpResponse); + Assert.assertNotNull(httpResponse.getHeaderAsLong("content-length")); + Assert.assertTrue(httpResponse.getHeaderAsLong("content-length") == 74); + assertThat(httpResponse.getBody()).isEmpty(); + } finally { + httpServer.close(); + } + } + + @Test + public void testHEADRequestWithSSLAndBasicAuthCredentialsMissing() + throws GeneralSecurityException, IOException { + HTTPServer httpServer = + new HTTPServer.Builder() + .withRegistry(registry) + .withHttpsConfigurator(HTTPS_CONFIGURATOR) + .withAuthenticator(createAuthenticator("/", "user", "secret")) + .build(); + + try { + createHttpRequestBuilderWithSSL(httpServer, "/metrics?name[]=a&name[]=b") + .withMethod(HttpRequest.METHOD.HEAD) + .build() + .execute(); + Assert.fail("expected IOException with HTTP 401"); + } catch (IOException e) { + Assert.assertTrue(e.getMessage().contains("401")); + } finally { + httpServer.close(); + } + } + + @Test + public void testHEADRequestWithSSLAndBasicAuthWrongCredentials() + throws GeneralSecurityException, IOException { + HTTPServer httpServer = + new HTTPServer.Builder() + .withRegistry(registry) + .withHttpsConfigurator(HTTPS_CONFIGURATOR) + .withAuthenticator(createAuthenticator("/", "user", "secret")) + .build(); + + try { + createHttpRequestBuilderWithSSL(httpServer, "/metrics?name[]=a&name[]=b") + .withMethod(HttpRequest.METHOD.HEAD) + .withAuthorization("user", "wrong") + .build() + .execute(); + Assert.fail("expected IOException with HTTP 401"); + } catch (IOException e) { + Assert.assertTrue(e.getMessage().contains("401")); + } finally { + httpServer.close(); + } + } + + @Test + public void testExecutorService() throws IOException { + ExecutorService executorService = Executors.newFixedThreadPool(20); + + HTTPServer httpServer = + new HTTPServer.Builder() + .withExecutorService(executorService) + .withRegistry(registry) + .build(); + + Assert.assertEquals(httpServer.executorService, executorService); + + try { + String body = createHttpRequestBuilder(httpServer, "/metrics").build().execute().getBody(); + assertThat(body).contains("a 0.0"); + assertThat(body).contains("b 0.0"); + assertThat(body).contains("c 0.0"); + } finally { + httpServer.close(); + } + } + + @Test(expected = IllegalStateException.class) + public void testExecutorServiceWithHttpServer() throws IOException { + InetSocketAddress inetSocketAddress = new InetSocketAddress("localhost", 0); + + HttpServer externalHttpServer = HttpServer.create(inetSocketAddress, 0); + externalHttpServer.createContext("/metrics", new HTTPServer.HTTPMetricHandler(registry)); + externalHttpServer.start(); + + ExecutorService executorService = Executors.newFixedThreadPool(20); + + HTTPServer httpServer = + new HTTPServer.Builder() + .withExecutorService(executorService) + .withHttpServer(externalHttpServer) + .withRegistry(registry) + .build(); + + try { + String body = createHttpRequestBuilder(httpServer, "/metrics").build().execute().getBody(); + assertThat(body).contains("a 0.0"); + assertThat(body).contains("b 0.0"); + assertThat(body).contains("c 0.0"); + } finally { + httpServer.close(); + } + } + + /** + * Encodes authorization credentials + * + * @param username + * @param password + * @return String + */ + private static final String encodeCredentials(String username, String password) { + // Per RFC4648 table 2. We support Java 6, and java.util.Base64 was only added in Java 8, + try { + byte[] credentialsBytes = (username + ":" + password).getBytes("UTF-8"); + return "Basic " + DatatypeConverter.printBase64Binary(credentialsBytes); + } catch (UnsupportedEncodingException e) { + throw new IllegalArgumentException(e); + } + } + + /** + * Create an SSLContext + * + * @param sslContextType + * @param keyStoreType + * @param keyStorePath + * @param keyStorePassword + * @return SSLContext + * @throws GeneralSecurityException + * @throws IOException + */ + private static final SSLContext createSSLContext( + String sslContextType, String keyStoreType, String keyStorePath, String keyStorePassword) + throws GeneralSecurityException, IOException { + SSLContext sslContext = null; + FileInputStream fileInputStream = null; + + try { + File file = new File(keyStorePath); + + if ((file.exists() == false) || (file.isFile() == false) || (file.canRead() == false)) { + throw new IllegalArgumentException( + "cannot read 'keyStorePath', path = [" + file.getAbsolutePath() + "]"); + } + + fileInputStream = new FileInputStream(keyStorePath); + + KeyStore keyStore = KeyStore.getInstance(keyStoreType); + keyStore.load(fileInputStream, keyStorePassword.toCharArray()); + + KeyManagerFactory keyManagerFactor = KeyManagerFactory.getInstance("SunX509"); + keyManagerFactor.init(keyStore, keyStorePassword.toCharArray()); + + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("SunX509"); + trustManagerFactory.init(keyStore); + + sslContext = SSLContext.getInstance(sslContextType); + sslContext.init( + keyManagerFactor.getKeyManagers(), trustManagerFactory.getTrustManagers(), null); + } finally { + if (fileInputStream != null) { + try { + fileInputStream.close(); + } catch (IOException e) { + // IGNORE + } + } + } + + return sslContext; + } + + /** + * Creates an Authenticator + * + * @param realm + * @param validUsername + * @param validPassword + * @return Authenticator + */ + private static final Authenticator createAuthenticator( + String realm, final String validUsername, final String validPassword) { + return new BasicAuthenticator(realm) { + @Override + public boolean checkCredentials(String username, String password) { + return validUsername.equals(username) && validPassword.equals(password); + } + }; + } + + /** + * Creates an HttpsConfiguration + * + * @param sslContext + * @return HttpsConfigurator + */ + private static HttpsConfigurator createHttpsConfigurator(SSLContext sslContext) { + return new HttpsConfigurator(sslContext) { + @Override + public void configure(HttpsParameters params) { + try { + SSLContext c = getSSLContext(); + SSLEngine engine = c.createSSLEngine(); + params.setNeedClientAuth(false); + params.setCipherSuites(engine.getEnabledCipherSuites()); + params.setProtocols(engine.getEnabledProtocols()); + SSLParameters sslParameters = c.getSupportedSSLParameters(); + params.setSSLParameters(sslParameters); + } catch (Exception e) { + throw new RuntimeException("Exception creating HttpsConfigurator", e); + } + } + }; + } +} diff --git a/simpleclient-archive/simpleclient_httpserver/src/test/resources/keystore.pkcs12 b/simpleclient-archive/simpleclient_httpserver/src/test/resources/keystore.pkcs12 new file mode 100644 index 000000000..4e635ac82 Binary files /dev/null and b/simpleclient-archive/simpleclient_httpserver/src/test/resources/keystore.pkcs12 differ diff --git a/simpleclient-archive/simpleclient_httpserver/version-rules.xml b/simpleclient-archive/simpleclient_httpserver/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/simpleclient-archive/simpleclient_httpserver/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/simpleclient-archive/simpleclient_jetty/pom.xml b/simpleclient-archive/simpleclient_jetty/pom.xml new file mode 100644 index 000000000..8cbc5a604 --- /dev/null +++ b/simpleclient-archive/simpleclient_jetty/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.0.0-beta-2-SNAPSHOT + + + simpleclient_jetty + bundle + + Prometheus Java Simpleclient Jetty + + Collector of data from Jetty StatisticsHandler. + + + + 10.0.24 + + + + + io.prometheus + simpleclient + ${project.version} + + + org.eclipse.jetty + jetty-server + ${jetty.version} + + + org.eclipse.jetty + jetty-servlet + ${jetty.version} + + + + org.hamcrest + hamcrest-all + 1.3 + test + + + diff --git a/simpleclient-archive/simpleclient_jetty/src/main/java/io/prometheus/client/jetty/JettyStatisticsCollector.java b/simpleclient-archive/simpleclient_jetty/src/main/java/io/prometheus/client/jetty/JettyStatisticsCollector.java new file mode 100644 index 000000000..127abed95 --- /dev/null +++ b/simpleclient-archive/simpleclient_jetty/src/main/java/io/prometheus/client/jetty/JettyStatisticsCollector.java @@ -0,0 +1,148 @@ +package io.prometheus.client.jetty; + +import io.prometheus.client.Collector; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.eclipse.jetty.server.handler.StatisticsHandler; + +/** + * Collect metrics from jetty's org.eclipse.jetty.server.handler.StatisticsHandler. + * + *

    + * Server server = new Server(8080);
    + *
    + * ServletContextHandler context = new ServletContextHandler();
    + * context.setContextPath("/");
    + * server.setHandler(context);
    + *
    + * HandlerCollection handlers = new HandlerCollection();
    + *
    + * StatisticsHandler statisticsHandler = new StatisticsHandler();
    + * statisticsHandler.setServer(server);
    + * handlers.addHandler(statisticsHandler);
    + *
    + * // Register collector.
    + * new JettyStatisticsCollector(statisticsHandler).register();
    + *
    + * server.setHandler(handlers);
    + *
    + * server.start();
    + * 
    + */ +public class JettyStatisticsCollector extends Collector { + private final StatisticsHandler statisticsHandler; + private static final List EMPTY_LIST = new ArrayList(); + + public JettyStatisticsCollector(StatisticsHandler statisticsHandler) { + this.statisticsHandler = statisticsHandler; + } + + @Override + public List collect() { + return Arrays.asList( + buildCounter("jetty_requests_total", "Number of requests", statisticsHandler.getRequests()), + buildGauge( + "jetty_requests_active", + "Number of requests currently active", + statisticsHandler.getRequestsActive()), + buildGauge( + "jetty_requests_active_max", + "Maximum number of requests that have been active at once", + statisticsHandler.getRequestsActiveMax()), + buildGauge( + "jetty_request_time_max_seconds", + "Maximum time spent handling requests", + statisticsHandler.getRequestTimeMax() / 1000.0), + buildCounter( + "jetty_request_time_seconds_total", + "Total time spent in all request handling", + statisticsHandler.getRequestTimeTotal() / 1000.0), + buildCounter( + "jetty_dispatched_total", "Number of dispatches", statisticsHandler.getDispatched()), + buildGauge( + "jetty_dispatched_active", + "Number of dispatches currently active", + statisticsHandler.getDispatchedActive()), + buildGauge( + "jetty_dispatched_active_max", + "Maximum number of active dispatches being handled", + statisticsHandler.getDispatchedActiveMax()), + buildGauge( + "jetty_dispatched_time_max", + "Maximum time spent in dispatch handling", + statisticsHandler.getDispatchedTimeMax()), + buildCounter( + "jetty_dispatched_time_seconds_total", + "Total time spent in dispatch handling", + statisticsHandler.getDispatchedTimeTotal() / 1000.0), + buildCounter( + "jetty_async_requests_total", + "Total number of async requests", + statisticsHandler.getAsyncRequests()), + buildGauge( + "jetty_async_requests_waiting", + "Currently waiting async requests", + statisticsHandler.getAsyncRequestsWaiting()), + buildGauge( + "jetty_async_requests_waiting_max", + "Maximum number of waiting async requests", + statisticsHandler.getAsyncRequestsWaitingMax()), + buildCounter( + "jetty_async_dispatches_total", + "Number of requested that have been asynchronously dispatched", + statisticsHandler.getAsyncDispatches()), + buildCounter( + "jetty_expires_total", + "Number of async requests requests that have expired", + statisticsHandler.getExpires()), + buildStatusCounter(), + buildGauge( + "jetty_stats_seconds", + "Time in seconds stats have been collected for", + statisticsHandler.getStatsOnMs() / 1000.0), + buildCounter( + "jetty_responses_bytes_total", + "Total number of bytes across all responses", + statisticsHandler.getResponsesBytesTotal())); + } + + private static MetricFamilySamples buildGauge(String name, String help, double value) { + return new MetricFamilySamples( + name, + Type.GAUGE, + help, + Collections.singletonList( + new MetricFamilySamples.Sample(name, EMPTY_LIST, EMPTY_LIST, value))); + } + + private static MetricFamilySamples buildCounter(String name, String help, double value) { + return new MetricFamilySamples( + name, + Type.COUNTER, + help, + Collections.singletonList( + new MetricFamilySamples.Sample(name, EMPTY_LIST, EMPTY_LIST, value))); + } + + private MetricFamilySamples buildStatusCounter() { + String name = "jetty_responses_total"; + return new MetricFamilySamples( + name, + Type.COUNTER, + "Number of requests with response status", + Arrays.asList( + buildStatusSample(name, "1xx", statisticsHandler.getResponses1xx()), + buildStatusSample(name, "2xx", statisticsHandler.getResponses2xx()), + buildStatusSample(name, "3xx", statisticsHandler.getResponses3xx()), + buildStatusSample(name, "4xx", statisticsHandler.getResponses4xx()), + buildStatusSample(name, "5xx", statisticsHandler.getResponses5xx()))); + } + + private static MetricFamilySamples.Sample buildStatusSample( + String name, String status, double value) { + return new MetricFamilySamples.Sample( + name, Collections.singletonList("code"), Collections.singletonList(status), value); + } +} diff --git a/simpleclient_jetty/src/test/java/io/prometheus/client/jetty/JettyStatisticsCollectorTest.java b/simpleclient-archive/simpleclient_jetty/src/test/java/io/prometheus/client/jetty/JettyStatisticsCollectorTest.java similarity index 50% rename from simpleclient_jetty/src/test/java/io/prometheus/client/jetty/JettyStatisticsCollectorTest.java rename to simpleclient-archive/simpleclient_jetty/src/test/java/io/prometheus/client/jetty/JettyStatisticsCollectorTest.java index 80969c2c8..325d1844a 100644 --- a/simpleclient_jetty/src/test/java/io/prometheus/client/jetty/JettyStatisticsCollectorTest.java +++ b/simpleclient-archive/simpleclient_jetty/src/test/java/io/prometheus/client/jetty/JettyStatisticsCollectorTest.java @@ -19,7 +19,7 @@ import org.junit.Before; import org.junit.Test; -public class JettyStatisticsCollectorTest { +class JettyStatisticsCollectorTest { private final Server server = new Server(); private final ServerConnector connector = new ServerConnector(server); @@ -31,7 +31,7 @@ public void setUp() throws Exception { ServletContextHandler context = new ServletContextHandler(); context.setContextPath("/"); - handlers.setHandlers(new Handler[]{context}); + handlers.setHandlers(new Handler[] {context}); StatisticsHandler stats = new StatisticsHandler(); stats.setHandler(handlers); @@ -61,47 +61,73 @@ public void collect() throws Exception { } assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_requests_total"), is(1.0)); - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_requests_active"), is(0.0)); - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_requests_active_max"), - is(1.0)); - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_request_time_max_seconds"), + Double jettyRequestsActive = null; + for (int i = 0; i < 10; i++) { + jettyRequestsActive = + CollectorRegistry.defaultRegistry.getSampleValue("jetty_requests_active"); + if (Double.valueOf(0.0).equals(jettyRequestsActive)) { + break; + } + Thread.sleep(50); + } + assertThat(jettyRequestsActive, is(0.0)); + assertThat( + CollectorRegistry.defaultRegistry.getSampleValue("jetty_requests_active_max"), is(1.0)); + assertThat( + CollectorRegistry.defaultRegistry.getSampleValue("jetty_request_time_max_seconds"), is(notNullValue())); - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_request_time_seconds_total"), + assertThat( + CollectorRegistry.defaultRegistry.getSampleValue("jetty_request_time_seconds_total"), is(notNullValue())); assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_dispatched_total"), is(1.0)); - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_dispatched_active"), - is(0.0)); - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_dispatched_active_max"), + assertThat( + CollectorRegistry.defaultRegistry.getSampleValue("jetty_dispatched_active"), is(0.0)); + assertThat( + CollectorRegistry.defaultRegistry.getSampleValue("jetty_dispatched_active_max"), is(greaterThan(0.0))); - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_dispatched_time_max"), + assertThat( + CollectorRegistry.defaultRegistry.getSampleValue("jetty_dispatched_time_max"), is(notNullValue())); assertThat( CollectorRegistry.defaultRegistry.getSampleValue("jetty_dispatched_time_seconds_total"), is(notNullValue())); - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_async_requests_total"), + assertThat( + CollectorRegistry.defaultRegistry.getSampleValue("jetty_async_requests_total"), is(0.0)); + assertThat( + CollectorRegistry.defaultRegistry.getSampleValue("jetty_async_requests_waiting"), is(0.0)); + assertThat( + CollectorRegistry.defaultRegistry.getSampleValue("jetty_async_requests_waiting_max"), + is(0.0)); + assertThat( + CollectorRegistry.defaultRegistry.getSampleValue("jetty_async_dispatches_total"), is(0.0)); + assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_expires_total"), is(0.0)); + + assertThat( + CollectorRegistry.defaultRegistry.getSampleValue( + "jetty_responses_total", new String[] {"code"}, new String[] {"1xx"}), is(0.0)); - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_async_requests_waiting"), + assertThat( + CollectorRegistry.defaultRegistry.getSampleValue( + "jetty_responses_total", new String[] {"code"}, new String[] {"2xx"}), is(0.0)); - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_async_requests_waiting_max"), + assertThat( + CollectorRegistry.defaultRegistry.getSampleValue( + "jetty_responses_total", new String[] {"code"}, new String[] {"3xx"}), is(0.0)); - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_async_dispatches_total"), + assertThat( + CollectorRegistry.defaultRegistry.getSampleValue( + "jetty_responses_total", new String[] {"code"}, new String[] {"4xx"}), + is(1.0)); + assertThat( + CollectorRegistry.defaultRegistry.getSampleValue( + "jetty_responses_total", new String[] {"code"}, new String[] {"5xx"}), is(0.0)); - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_expires_total"), is(0.0)); - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_responses_total", - new String[]{"code"}, new String[]{"1xx"}), is(0.0)); - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_responses_total", - new String[]{"code"}, new String[]{"2xx"}), is(0.0)); - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_responses_total", - new String[]{"code"}, new String[]{"3xx"}), is(0.0)); - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_responses_total", - new String[]{"code"}, new String[]{"4xx"}), is(1.0)); - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_responses_total", - new String[]{"code"}, new String[]{"5xx"}), is(0.0)); - - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_stats_seconds"), + assertThat( + CollectorRegistry.defaultRegistry.getSampleValue("jetty_stats_seconds"), is(notNullValue())); - assertThat(CollectorRegistry.defaultRegistry.getSampleValue("jetty_responses_bytes_total"), + assertThat( + CollectorRegistry.defaultRegistry.getSampleValue("jetty_responses_bytes_total"), is(notNullValue())); } } diff --git a/simpleclient-archive/simpleclient_jetty/version-rules.xml b/simpleclient-archive/simpleclient_jetty/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/simpleclient-archive/simpleclient_jetty/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/simpleclient-archive/simpleclient_jetty_jdk8/pom.xml b/simpleclient-archive/simpleclient_jetty_jdk8/pom.xml new file mode 100644 index 000000000..2cd3ce7ed --- /dev/null +++ b/simpleclient-archive/simpleclient_jetty_jdk8/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.0.0-beta-2-SNAPSHOT + + + simpleclient_jetty_jdk8 + bundle + + Prometheus Java Simpleclient Jetty JDK 8 + + Collector of data from Jetty Statistics for Jetty versions which require JDK 8. + + + + + io.prometheus + simpleclient + ${project.version} + + + org.eclipse.jetty + jetty-server + 11.0.24 + + + org.eclipse.jetty + jetty-servlet + 11.0.9 + + + + org.hamcrest + hamcrest-all + 1.3 + test + + + diff --git a/simpleclient_jetty_jdk8/src/main/java/io/prometheus/client/jetty/QueuedThreadPoolStatisticsCollector.java b/simpleclient-archive/simpleclient_jetty_jdk8/src/main/java/io/prometheus/client/jetty/QueuedThreadPoolStatisticsCollector.java similarity index 67% rename from simpleclient_jetty_jdk8/src/main/java/io/prometheus/client/jetty/QueuedThreadPoolStatisticsCollector.java rename to simpleclient-archive/simpleclient_jetty_jdk8/src/main/java/io/prometheus/client/jetty/QueuedThreadPoolStatisticsCollector.java index 7e12da3da..f514218b0 100644 --- a/simpleclient_jetty_jdk8/src/main/java/io/prometheus/client/jetty/QueuedThreadPoolStatisticsCollector.java +++ b/simpleclient-archive/simpleclient_jetty_jdk8/src/main/java/io/prometheus/client/jetty/QueuedThreadPoolStatisticsCollector.java @@ -17,8 +17,7 @@ public class QueuedThreadPoolStatisticsCollector extends Collector { private final Map queuedThreadPoolMap = new ConcurrentHashMap<>(); - public QueuedThreadPoolStatisticsCollector() { - } + public QueuedThreadPoolStatisticsCollector() {} public QueuedThreadPoolStatisticsCollector(QueuedThreadPool queuedThreadPool, String name) { add(queuedThreadPool, name); @@ -32,13 +31,21 @@ public QueuedThreadPoolStatisticsCollector add(QueuedThreadPool queuedThreadPool @Override public List collect() { return Arrays.asList( - buildGauge("jetty_queued_thread_pool_threads", "Number of total threads", + buildGauge( + "jetty_queued_thread_pool_threads", + "Number of total threads", QueuedThreadPool::getThreads), - buildGauge("jetty_queued_thread_pool_threads_idle", "Number of idle threads", + buildGauge( + "jetty_queued_thread_pool_threads_idle", + "Number of idle threads", QueuedThreadPool::getIdleThreads), - buildGauge("jetty_queued_thread_pool_threads_max", "Max size of thread pool", + buildGauge( + "jetty_queued_thread_pool_threads_max", + "Max size of thread pool", QueuedThreadPool::getMaxThreads), - buildGauge("jetty_queued_thread_pool_jobs", "Number of total jobs", + buildGauge( + "jetty_queued_thread_pool_jobs", + "Number of total jobs", QueuedThreadPool::getQueueSize)); } @@ -50,13 +57,13 @@ public T register(CollectorRegistry registry) { return super.register(registry); } - private GaugeMetricFamily buildGauge(String metric, String help, - Function metricValueProvider) { + private GaugeMetricFamily buildGauge( + String metric, String help, Function metricValueProvider) { final GaugeMetricFamily metricFamily = new GaugeMetricFamily(metric, help, LABEL_NAMES); - queuedThreadPoolMap.forEach((key, value) -> metricFamily.addMetric( - Collections.singletonList(key), - metricValueProvider.apply(value) - )); + queuedThreadPoolMap.forEach( + (key, value) -> + metricFamily.addMetric( + Collections.singletonList(key), metricValueProvider.apply(value))); return metricFamily; } } diff --git a/simpleclient_jetty_jdk8/src/test/java/io/prometheus/client/jetty/QueuedThreadPoolStatisticsCollectorTest.java b/simpleclient-archive/simpleclient_jetty_jdk8/src/test/java/io/prometheus/client/jetty/QueuedThreadPoolStatisticsCollectorTest.java similarity index 66% rename from simpleclient_jetty_jdk8/src/test/java/io/prometheus/client/jetty/QueuedThreadPoolStatisticsCollectorTest.java rename to simpleclient-archive/simpleclient_jetty_jdk8/src/test/java/io/prometheus/client/jetty/QueuedThreadPoolStatisticsCollectorTest.java index 326a1c45c..f0e4efc77 100644 --- a/simpleclient_jetty_jdk8/src/test/java/io/prometheus/client/jetty/QueuedThreadPoolStatisticsCollectorTest.java +++ b/simpleclient-archive/simpleclient_jetty_jdk8/src/test/java/io/prometheus/client/jetty/QueuedThreadPoolStatisticsCollectorTest.java @@ -14,12 +14,11 @@ import org.junit.Test; import org.junit.rules.ExpectedException; -public class QueuedThreadPoolStatisticsCollectorTest { +class QueuedThreadPoolStatisticsCollectorTest { private static final String[] LABEL_NAMES = {"unit"}; - @Rule - public ExpectedException expectedException = ExpectedException.none(); + @Rule public ExpectedException expectedException = ExpectedException.none(); private Server server; private QueuedThreadPool queuedThreadPool; @@ -45,16 +44,20 @@ public void metricsGathered() throws Exception { server.start(); assertTrue( - CollectorRegistry.defaultRegistry.getSampleValue("jetty_queued_thread_pool_threads", - LABEL_NAMES, labelValues) > 0); + CollectorRegistry.defaultRegistry.getSampleValue( + "jetty_queued_thread_pool_threads", LABEL_NAMES, labelValues) + > 0); assertTrue( - CollectorRegistry.defaultRegistry.getSampleValue("jetty_queued_thread_pool_threads_idle", - LABEL_NAMES, labelValues) > 0); + CollectorRegistry.defaultRegistry.getSampleValue( + "jetty_queued_thread_pool_threads_idle", LABEL_NAMES, labelValues) + > 0); assertTrue( - CollectorRegistry.defaultRegistry.getSampleValue("jetty_queued_thread_pool_threads_max", - LABEL_NAMES, labelValues) == 200); - assertNotNull(CollectorRegistry.defaultRegistry.getSampleValue("jetty_queued_thread_pool_jobs", - LABEL_NAMES, labelValues)); + CollectorRegistry.defaultRegistry.getSampleValue( + "jetty_queued_thread_pool_threads_max", LABEL_NAMES, labelValues) + == 200); + assertNotNull( + CollectorRegistry.defaultRegistry.getSampleValue( + "jetty_queued_thread_pool_jobs", LABEL_NAMES, labelValues)); } @Test diff --git a/simpleclient-archive/simpleclient_jetty_jdk8/version-rules.xml b/simpleclient-archive/simpleclient_jetty_jdk8/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/simpleclient-archive/simpleclient_jetty_jdk8/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/simpleclient-archive/simpleclient_log4j/pom.xml b/simpleclient-archive/simpleclient_log4j/pom.xml new file mode 100644 index 000000000..0942c1d9d --- /dev/null +++ b/simpleclient-archive/simpleclient_log4j/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.0.0-beta-2-SNAPSHOT + + + simpleclient_log4j + bundle + + Prometheus Java Simpleclient log4j + + Metrics collector for log4j appender logging + + + + + io.prometheus + simpleclient + ${project.version} + + + org.apache.logging.log4j + log4j-core + 2.17.2 + provided + + + org.apache.logging.log4j + log4j-1.2-api + 2.17.2 + provided + + + diff --git a/simpleclient_log4j/src/main/java/io/prometheus/client/log4j/InstrumentedAppender.java b/simpleclient-archive/simpleclient_log4j/src/main/java/io/prometheus/client/log4j/InstrumentedAppender.java similarity index 89% rename from simpleclient_log4j/src/main/java/io/prometheus/client/log4j/InstrumentedAppender.java rename to simpleclient-archive/simpleclient_log4j/src/main/java/io/prometheus/client/log4j/InstrumentedAppender.java index 52a19f67f..401b867c2 100644 --- a/simpleclient_log4j/src/main/java/io/prometheus/client/log4j/InstrumentedAppender.java +++ b/simpleclient-archive/simpleclient_log4j/src/main/java/io/prometheus/client/log4j/InstrumentedAppender.java @@ -16,9 +16,11 @@ public class InstrumentedAppender extends AppenderSkeleton { private static final Counter.Child WARN_LABEL; private static final Counter.Child ERROR_LABEL; private static final Counter.Child FATAL_LABEL; - + static { - COUNTER = Counter.build().name(COUNTER_NAME) + COUNTER = + Counter.build() + .name(COUNTER_NAME) .help("Log4j log statements at various log levels") .labelNames("level") .register(); @@ -31,16 +33,11 @@ public class InstrumentedAppender extends AppenderSkeleton { FATAL_LABEL = COUNTER.labels("fatal"); } - /** - * Create a new instrumented appender using the default registry. - */ - public InstrumentedAppender() { - } - + /** Create a new instrumented appender using the default registry. */ + public InstrumentedAppender() {} @Override - public void activateOptions() { - } + public void activateOptions() {} @Override protected void append(LoggingEvent event) { diff --git a/simpleclient_log4j/src/test/java/io/prometheus/client/log4j/InstrumentedAppenderTest.java b/simpleclient-archive/simpleclient_log4j/src/test/java/io/prometheus/client/log4j/InstrumentedAppenderTest.java similarity index 90% rename from simpleclient_log4j/src/test/java/io/prometheus/client/log4j/InstrumentedAppenderTest.java rename to simpleclient-archive/simpleclient_log4j/src/test/java/io/prometheus/client/log4j/InstrumentedAppenderTest.java index 39c50029c..7da8e5d71 100644 --- a/simpleclient_log4j/src/test/java/io/prometheus/client/log4j/InstrumentedAppenderTest.java +++ b/simpleclient-archive/simpleclient_log4j/src/test/java/io/prometheus/client/log4j/InstrumentedAppenderTest.java @@ -11,7 +11,7 @@ import org.junit.Before; import org.junit.Test; -public class InstrumentedAppenderTest { +class InstrumentedAppenderTest { private InstrumentedAppender appender; private LoggingEvent event; @@ -20,7 +20,7 @@ public class InstrumentedAppenderTest { public void setUp() throws Exception { appender = new InstrumentedAppender(); appender.activateOptions(); - + event = mock(LoggingEvent.class); } @@ -79,7 +79,8 @@ public void metersFatalEvents() throws Exception { } private int getLogLevelCount(String level) { - return CollectorRegistry.defaultRegistry.getSampleValue(COUNTER_NAME, - new String[]{"level"}, new String[]{level}).intValue(); + return CollectorRegistry.defaultRegistry + .getSampleValue(COUNTER_NAME, new String[] {"level"}, new String[] {level}) + .intValue(); } } diff --git a/simpleclient-archive/simpleclient_log4j/version-rules.xml b/simpleclient-archive/simpleclient_log4j/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/simpleclient-archive/simpleclient_log4j/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/simpleclient-archive/simpleclient_log4j2/pom.xml b/simpleclient-archive/simpleclient_log4j2/pom.xml new file mode 100644 index 000000000..5627f0660 --- /dev/null +++ b/simpleclient-archive/simpleclient_log4j2/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.0.0-beta-2-SNAPSHOT + + + simpleclient_log4j2 + bundle + + Prometheus Java Simpleclient log4j2 + + Metrics collector for log4j2 appender logging + + + + + io.prometheus + simpleclient + ${project.version} + + + org.apache.logging.log4j + log4j-core + 2.17.2 + provided + + + diff --git a/simpleclient-archive/simpleclient_log4j2/src/main/java/io/prometheus/client/log4j2/InstrumentedAppender.java b/simpleclient-archive/simpleclient_log4j2/src/main/java/io/prometheus/client/log4j2/InstrumentedAppender.java new file mode 100644 index 000000000..06c0c9777 --- /dev/null +++ b/simpleclient-archive/simpleclient_log4j2/src/main/java/io/prometheus/client/log4j2/InstrumentedAppender.java @@ -0,0 +1,96 @@ +package io.prometheus.client.log4j2; + +import static org.apache.logging.log4j.Level.*; + +import io.prometheus.client.Counter; +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.core.LogEvent; +import org.apache.logging.log4j.core.appender.AbstractAppender; +import org.apache.logging.log4j.core.config.plugins.Plugin; +import org.apache.logging.log4j.core.config.plugins.PluginAttribute; +import org.apache.logging.log4j.core.config.plugins.PluginFactory; + +/** + * Log4j2 log statements at various log levels + * + *

    Example log4j2 configuration: + * + *

    + *   <?xml version="1.0" encoding="UTF-8"?>
    + *   <Configuration packages="io.prometheus.client.log4j2">
    + *     <Appenders>
    + *       <Prometheus name="PROMETHEUS"/>
    + *     </Appenders>
    + *     <Loggers>
    + *       <Root level="trace">
    + *         <AppenderRef ref="PROMETHEUS"/>
    + *       </Root>
    + *     </Loggers>
    + *   </Configuration>
    + * 
    + * + * Example metrics being exported: + * + *
    + *   log4j_appender_total{level="trace",} 1.0
    + *   log4j_appender_total{level="debug",} 2.0
    + *   log4j_appender_total{level="info",} 3.0
    + *   log4j_appender_total{level="warn",} 4.0
    + *   log4j_appender_total{level="error",} 5.0
    + *   log4j_appender_total{level="fatal",} 6.0
    + * 
    + */ +@Plugin(name = "Prometheus", category = "Core", elementType = "appender") +public final class InstrumentedAppender extends AbstractAppender { + + public static final String COUNTER_NAME = "log4j2_appender_total"; + + private static final Counter COUNTER; + private static final Counter.Child TRACE_LABEL; + private static final Counter.Child DEBUG_LABEL; + private static final Counter.Child INFO_LABEL; + private static final Counter.Child WARN_LABEL; + private static final Counter.Child ERROR_LABEL; + private static final Counter.Child FATAL_LABEL; + + static { + COUNTER = + Counter.build() + .name(COUNTER_NAME) + .help("Log4j2 log statements at various log levels") + .labelNames("level") + .register(); + + TRACE_LABEL = COUNTER.labels("trace"); + DEBUG_LABEL = COUNTER.labels("debug"); + INFO_LABEL = COUNTER.labels("info"); + WARN_LABEL = COUNTER.labels("warn"); + ERROR_LABEL = COUNTER.labels("error"); + FATAL_LABEL = COUNTER.labels("fatal"); + } + + /** Create a new instrumented appender using the default registry. */ + protected InstrumentedAppender(String name) { + super(name, null, null); + } + + @Override + public void append(LogEvent event) { + Level level = event.getLevel(); + if (TRACE.equals(level)) TRACE_LABEL.inc(); + else if (DEBUG.equals(level)) DEBUG_LABEL.inc(); + else if (INFO.equals(level)) INFO_LABEL.inc(); + else if (WARN.equals(level)) WARN_LABEL.inc(); + else if (ERROR.equals(level)) ERROR_LABEL.inc(); + else if (FATAL.equals(level)) FATAL_LABEL.inc(); + } + + @PluginFactory + public static InstrumentedAppender createAppender(@PluginAttribute("name") String name) { + if (name == null) { + LOGGER.error("No name provided for InstrumentedAppender"); + return null; + } + return new InstrumentedAppender(name); + } +} diff --git a/simpleclient-archive/simpleclient_log4j2/src/test/java/io/prometheus/client/log4j2/InstrumentedAppenderTest.java b/simpleclient-archive/simpleclient_log4j2/src/test/java/io/prometheus/client/log4j2/InstrumentedAppenderTest.java new file mode 100644 index 000000000..187eeb5e8 --- /dev/null +++ b/simpleclient-archive/simpleclient_log4j2/src/test/java/io/prometheus/client/log4j2/InstrumentedAppenderTest.java @@ -0,0 +1,84 @@ +package io.prometheus.client.log4j2; + +import static io.prometheus.client.log4j2.InstrumentedAppender.COUNTER_NAME; +import static org.apache.logging.log4j.Level.*; +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import io.prometheus.client.CollectorRegistry; +import org.apache.logging.log4j.core.LogEvent; +import org.junit.Before; +import org.junit.Test; + +class InstrumentedAppenderTest { + + private InstrumentedAppender appender; + private LogEvent event; + + @Before + public void setUp() throws Exception { + appender = InstrumentedAppender.createAppender("Prometheus-Appender"); + event = mock(LogEvent.class); + } + + @Test + public void metersTraceEvents() throws Exception { + when(event.getLevel()).thenReturn(TRACE); + + appender.append(event); + + assertEquals(1, getLogLevelCount("trace")); + } + + @Test + public void metersDebugEvents() throws Exception { + when(event.getLevel()).thenReturn(DEBUG); + + appender.append(event); + + assertEquals(1, getLogLevelCount("debug")); + } + + @Test + public void metersInfoEvents() throws Exception { + when(event.getLevel()).thenReturn(INFO); + + appender.append(event); + + assertEquals(1, getLogLevelCount("trace")); + } + + @Test + public void metersWarnEvents() throws Exception { + when(event.getLevel()).thenReturn(WARN); + + appender.append(event); + + assertEquals(1, getLogLevelCount("warn")); + } + + @Test + public void metersErrorEvents() throws Exception { + when(event.getLevel()).thenReturn(ERROR); + + appender.append(event); + + assertEquals(1, getLogLevelCount("error")); + } + + @Test + public void metersFatalEvents() throws Exception { + when(event.getLevel()).thenReturn(FATAL); + + appender.append(event); + + assertEquals(1, getLogLevelCount("fatal")); + } + + private int getLogLevelCount(String level) { + return CollectorRegistry.defaultRegistry + .getSampleValue(COUNTER_NAME, new String[] {"level"}, new String[] {level}) + .intValue(); + } +} diff --git a/simpleclient-archive/simpleclient_log4j2/version-rules.xml b/simpleclient-archive/simpleclient_log4j2/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/simpleclient-archive/simpleclient_log4j2/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/simpleclient-archive/simpleclient_logback/pom.xml b/simpleclient-archive/simpleclient_logback/pom.xml new file mode 100644 index 000000000..415ea5e24 --- /dev/null +++ b/simpleclient-archive/simpleclient_logback/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.0.0-beta-2-SNAPSHOT + + + simpleclient_logback + bundle + + Prometheus Java Simpleclient logback + + Metrics collector for logback appender logging + + + + + io.prometheus + simpleclient + ${project.version} + + + ch.qos.logback + logback-classic + 1.2.11 + + + diff --git a/simpleclient-archive/simpleclient_logback/src/main/java/io/prometheus/client/logback/InstrumentedAppender.java b/simpleclient-archive/simpleclient_logback/src/main/java/io/prometheus/client/logback/InstrumentedAppender.java new file mode 100644 index 000000000..3dd20b1ed --- /dev/null +++ b/simpleclient-archive/simpleclient_logback/src/main/java/io/prometheus/client/logback/InstrumentedAppender.java @@ -0,0 +1,74 @@ +package io.prometheus.client.logback; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.UnsynchronizedAppenderBase; +import io.prometheus.client.CollectorRegistry; +import io.prometheus.client.Counter; + +public class InstrumentedAppender extends UnsynchronizedAppenderBase { + public static final String COUNTER_NAME = "logback_appender_total"; + + private static final Counter defaultCounter = + Counter.build() + .name(COUNTER_NAME) + .help("Logback log statements at various log levels") + .labelNames("level") + .register(); + private final Counter.Child traceCounter; + private final Counter.Child debugCounter; + private final Counter.Child infoCounter; + private final Counter.Child warnCounter; + private final Counter.Child errorCounter; + + /** Create a new instrumented appender using the default registry. */ + public InstrumentedAppender() { + this(defaultCounter); + } + + /** Create a new instrumented appender using the supplied registry. */ + public InstrumentedAppender(CollectorRegistry registry) { + this( + Counter.build() + .name(COUNTER_NAME) + .help("Logback log statements at various log levels") + .labelNames("level") + .register(registry)); + } + + private InstrumentedAppender(Counter counter) { + this.traceCounter = counter.labels("trace"); + this.debugCounter = counter.labels("debug"); + this.infoCounter = counter.labels("info"); + this.warnCounter = counter.labels("warn"); + this.errorCounter = counter.labels("error"); + } + + @Override + public void start() { + super.start(); + } + + @Override + protected void append(ILoggingEvent event) { + switch (event.getLevel().toInt()) { + case Level.TRACE_INT: + this.traceCounter.inc(); + break; + case Level.DEBUG_INT: + this.debugCounter.inc(); + break; + case Level.INFO_INT: + this.infoCounter.inc(); + break; + case Level.WARN_INT: + this.warnCounter.inc(); + break; + case Level.ERROR_INT: + this.errorCounter.inc(); + break; + default: + break; + } + } +} diff --git a/simpleclient_logback/src/test/java/io/prometheus/client/logback/InstrumentedAppenderTest.java b/simpleclient-archive/simpleclient_logback/src/test/java/io/prometheus/client/logback/InstrumentedAppenderTest.java similarity index 60% rename from simpleclient_logback/src/test/java/io/prometheus/client/logback/InstrumentedAppenderTest.java rename to simpleclient-archive/simpleclient_logback/src/test/java/io/prometheus/client/logback/InstrumentedAppenderTest.java index b9b853710..7849c636b 100644 --- a/simpleclient_logback/src/test/java/io/prometheus/client/logback/InstrumentedAppenderTest.java +++ b/simpleclient-archive/simpleclient_logback/src/test/java/io/prometheus/client/logback/InstrumentedAppenderTest.java @@ -11,16 +11,22 @@ import org.junit.Before; import org.junit.Test; -public class InstrumentedAppenderTest { - +class InstrumentedAppenderTest { + private CollectorRegistry registry; private InstrumentedAppender appender; + private InstrumentedAppender defaultAppender; private ILoggingEvent event; @Before public void setUp() throws Exception { - appender = new InstrumentedAppender(); + registry = new CollectorRegistry(); + + appender = new InstrumentedAppender(registry); appender.start(); - + + defaultAppender = new InstrumentedAppender(); + defaultAppender.start(); + event = mock(ILoggingEvent.class); } @@ -29,8 +35,10 @@ public void metersTraceEvents() throws Exception { when(event.getLevel()).thenReturn(Level.TRACE); appender.doAppend(event); - assertEquals(1, getLogLevelCount("trace")); + + defaultAppender.doAppend(event); + assertEquals(1, getDefaultLogLevelCount("trace")); } @Test @@ -38,8 +46,10 @@ public void metersDebugEvents() throws Exception { when(event.getLevel()).thenReturn(Level.DEBUG); appender.doAppend(event); - assertEquals(1, getLogLevelCount("debug")); + + defaultAppender.doAppend(event); + assertEquals(1, getDefaultLogLevelCount("debug")); } @Test @@ -47,8 +57,10 @@ public void metersInfoEvents() throws Exception { when(event.getLevel()).thenReturn(Level.INFO); appender.doAppend(event); - assertEquals(1, getLogLevelCount("info")); + + defaultAppender.doAppend(event); + assertEquals(1, getDefaultLogLevelCount("info")); } @Test @@ -56,8 +68,10 @@ public void metersWarnEvents() throws Exception { when(event.getLevel()).thenReturn(Level.WARN); appender.doAppend(event); - assertEquals(1, getLogLevelCount("warn")); + + defaultAppender.doAppend(event); + assertEquals(1, getDefaultLogLevelCount("warn")); } @Test @@ -65,12 +79,21 @@ public void metersErrorEvents() throws Exception { when(event.getLevel()).thenReturn(Level.ERROR); appender.doAppend(event); - assertEquals(1, getLogLevelCount("error")); + + defaultAppender.doAppend(event); + assertEquals(1, getDefaultLogLevelCount("error")); } private int getLogLevelCount(String level) { - return CollectorRegistry.defaultRegistry.getSampleValue(COUNTER_NAME, - new String[]{"level"}, new String[]{level}).intValue(); + return registry + .getSampleValue(COUNTER_NAME, new String[] {"level"}, new String[] {level}) + .intValue(); + } + + private int getDefaultLogLevelCount(String level) { + return CollectorRegistry.defaultRegistry + .getSampleValue(COUNTER_NAME, new String[] {"level"}, new String[] {level}) + .intValue(); } } diff --git a/simpleclient-archive/simpleclient_logback/version-rules.xml b/simpleclient-archive/simpleclient_logback/version-rules.xml new file mode 100644 index 000000000..2cd86fb7b --- /dev/null +++ b/simpleclient-archive/simpleclient_logback/version-rules.xml @@ -0,0 +1,11 @@ + + + + + .*alpha.* + + + + diff --git a/simpleclient-archive/simpleclient_servlet/pom.xml b/simpleclient-archive/simpleclient_servlet/pom.xml new file mode 100644 index 000000000..46c559b48 --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.0.0-beta-2-SNAPSHOT + + + simpleclient_servlet + bundle + + Prometheus Java Simpleclient Servlet - Javax + + HTTP servlet exporter for the simpleclient. + + + + UTF-8 + + + + + io.prometheus + simpleclient + ${project.version} + + + io.prometheus + simpleclient_common + ${project.version} + + + io.prometheus + simpleclient_servlet_common + ${project.version} + + + javax.servlet + javax.servlet-api + 4.0.1 + provided + + + + org.eclipse.jetty + jetty-servlet + 8.2.0.v20160908 + test + + + + diff --git a/simpleclient-archive/simpleclient_servlet/src/main/java/io/prometheus/client/exporter/MetricsServlet.java b/simpleclient-archive/simpleclient_servlet/src/main/java/io/prometheus/client/exporter/MetricsServlet.java new file mode 100644 index 000000000..44e624768 --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet/src/main/java/io/prometheus/client/exporter/MetricsServlet.java @@ -0,0 +1,59 @@ +package io.prometheus.client.exporter; + +import static io.prometheus.client.internal.Adapter.wrap; + +import io.prometheus.client.CollectorRegistry; +import io.prometheus.client.Predicate; +import io.prometheus.client.internal.Adapter; +import io.prometheus.client.servlet.common.exporter.Exporter; +import io.prometheus.client.servlet.common.exporter.ServletConfigurationException; +import java.io.IOException; +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** The MetricsServlet class provides a simple way of exposing the metrics values. */ +public class MetricsServlet extends HttpServlet { + + private final Exporter exporter; + + public MetricsServlet() { + this(CollectorRegistry.defaultRegistry, null); + } + + public MetricsServlet(Predicate sampleNameFilter) { + this(CollectorRegistry.defaultRegistry, sampleNameFilter); + } + + public MetricsServlet(CollectorRegistry registry) { + this(registry, null); + } + + public MetricsServlet(CollectorRegistry registry, Predicate sampleNameFilter) { + exporter = new Exporter(registry, sampleNameFilter); + } + + @Override + public void init(ServletConfig servletConfig) throws ServletException { + try { + super.init(servletConfig); + exporter.init(Adapter.wrap(servletConfig)); + } catch (ServletConfigurationException e) { + throw new ServletException(e); + } + } + + @Override + protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) + throws IOException { + exporter.doGet(wrap(req), wrap(resp)); + } + + @Override + protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) + throws IOException { + exporter.doPost(wrap(req), wrap(resp)); + } +} diff --git a/simpleclient-archive/simpleclient_servlet/src/main/java/io/prometheus/client/filter/MetricsFilter.java b/simpleclient-archive/simpleclient_servlet/src/main/java/io/prometheus/client/filter/MetricsFilter.java new file mode 100644 index 000000000..75832e326 --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet/src/main/java/io/prometheus/client/filter/MetricsFilter.java @@ -0,0 +1,131 @@ +package io.prometheus.client.filter; + +import io.prometheus.client.internal.Adapter; +import io.prometheus.client.servlet.common.filter.Filter; +import io.prometheus.client.servlet.common.filter.FilterConfigurationException; +import java.io.IOException; +import javax.servlet.*; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * The MetricsFilter class provides a high-level filter that enables tunable collection of metrics + * for Servlet performance. + * + *

    This is the Javax version of the MetricsFilter. If you are using Jakarta Servlet, there is a + * Jakarta version available in {@code simpleclient-servlet-jakarta}. + * + *

    The metric name itself is required, and configured with a {@code metric-name} init parameter. + * + *

    The help parameter, configured with the {@code help} init parameter, is not required but + * strongly recommended. + * + *

    The Histogram buckets can be configured with a {@code buckets} init parameter whose value is a + * comma-separated list * of valid {@code double} values. If omitted, the default buckets from + * {@link io.prometheus.client.Histogram} are used. + * + *

    By default, this filter will provide metrics that distinguish only 1 level deep for the + * request path (including servlet context path), but can be configured with the {@code + * path-components} init parameter. Any number provided that is less than 1 will provide the full + * path granularity (warning, this may affect performance). + * + *

    The {@code strip-context-path} init parameter can be used to avoid including the leading path + * components which are part of the context (i.e. the folder where the servlet is deployed) so that + * the same project deployed under different paths can produce the same metrics. + * + *

    HTTP statuses will be aggregated via Counter. The name for this counter will be derived from + * the {@code metric-name} init parameter. + * + *

    {@code
    + * 
    + *   prometheusFilter
    + *   
    + *   
    + *   io.prometheus.client.filter.MetricsFilter
    + *   
    + *     metric-name
    + *     webapp_metrics_filter
    + *   
    + *   
    + *   
    + *     help
    + *     This is the help for your metrics filter
    + *   
    + *   
    + *   
    + *     buckets
    + *     0.005,0.01,0.025,0.05,0.075,0.1,0.25,0.5,0.75,1,2.5,5,7.5,10
    + *   
    + *   
    + *   
    + *     path-components
    + *     1
    + *   
    + *   
    + *   
    + *     strip-context-path
    + *     false
    + *   
    + * 
    + *
    + * 
    + * 
    + *   prometheusFilter
    + *   /*
    + * 
    + * }
    + */ +public class MetricsFilter implements javax.servlet.Filter { + + private final Filter delegate; + + public MetricsFilter() { + this.delegate = new Filter(); + } + + // compatibility with 0.11.1 and older + public MetricsFilter(String metricName, String help, Integer pathComponents, double[] buckets) { + this(metricName, help, pathComponents, buckets, false); + } + + /** See {@link Filter#Filter(String, String, Integer, double[], boolean)}. */ + public MetricsFilter( + String metricName, + String help, + Integer pathComponents, + double[] buckets, + boolean stripContextPath) { + this.delegate = new Filter(metricName, help, pathComponents, buckets, stripContextPath); + } + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + try { + delegate.init(Adapter.wrap(filterConfig)); + } catch (FilterConfigurationException e) { + throw new ServletException(e); + } + } + + @Override + public void doFilter( + ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) + throws IOException, ServletException { + if (!(servletRequest instanceof HttpServletRequest) + || !(servletResponse instanceof HttpServletResponse)) { + filterChain.doFilter(servletRequest, servletResponse); + return; + } + Filter.MetricData data = delegate.startTimer(Adapter.wrap((HttpServletRequest) servletRequest)); + try { + filterChain.doFilter(servletRequest, servletResponse); + } finally { + delegate.observeDuration(data, Adapter.wrap((HttpServletResponse) servletResponse)); + } + } + + @Override + public void destroy() {} +} diff --git a/simpleclient-archive/simpleclient_servlet/src/main/java/io/prometheus/client/internal/Adapter.java b/simpleclient-archive/simpleclient_servlet/src/main/java/io/prometheus/client/internal/Adapter.java new file mode 100644 index 000000000..f4bc8b6cd --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet/src/main/java/io/prometheus/client/internal/Adapter.java @@ -0,0 +1,122 @@ +package io.prometheus.client.internal; + +import io.prometheus.client.servlet.common.adapter.FilterConfigAdapter; +import io.prometheus.client.servlet.common.adapter.HttpServletRequestAdapter; +import io.prometheus.client.servlet.common.adapter.HttpServletResponseAdapter; +import io.prometheus.client.servlet.common.adapter.ServletConfigAdapter; +import java.io.IOException; +import java.io.PrintWriter; +import javax.servlet.FilterConfig; +import javax.servlet.ServletConfig; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +public class Adapter { + + private static class HttpServletRequestAdapterImpl implements HttpServletRequestAdapter { + + private final HttpServletRequest delegate; + + HttpServletRequestAdapterImpl(HttpServletRequest delegate) { + this.delegate = delegate; + } + + @Override + public String getHeader(String name) { + return delegate.getHeader(name); + } + + @Override + public String getRequestURI() { + return delegate.getRequestURI(); + } + + @Override + public String getMethod() { + return delegate.getMethod(); + } + + @Override + public String[] getParameterValues(String name) { + return delegate.getParameterValues(name); + } + + @Override + public String getContextPath() { + return delegate.getContextPath(); + } + } + + private static class HttpServletResponseAdapterImpl implements HttpServletResponseAdapter { + + private final HttpServletResponse delegate; + + HttpServletResponseAdapterImpl(HttpServletResponse delegate) { + this.delegate = delegate; + } + + @Override + public void setStatus(int httpStatusCode) { + delegate.setStatus(httpStatusCode); + } + + @Override + public void setContentType(String contentType) { + delegate.setContentType(contentType); + } + + @Override + public PrintWriter getWriter() throws IOException { + return delegate.getWriter(); + } + + @Override + public int getStatus() { + return delegate.getStatus(); + } + } + + private static class FilterConfigAdapterImpl implements FilterConfigAdapter { + + private final FilterConfig delegate; + + private FilterConfigAdapterImpl(FilterConfig delegate) { + this.delegate = delegate; + } + + @Override + public String getInitParameter(String name) { + return delegate.getInitParameter(name); + } + } + + private static class ServletConfigAdapterImpl implements ServletConfigAdapter { + + final ServletConfig delegate; + + private ServletConfigAdapterImpl(ServletConfig delegate) { + this.delegate = delegate; + } + + @Override + public String getInitParameter(String name) { + return delegate.getInitParameter(name); + } + } + + public static HttpServletRequestAdapter wrap(HttpServletRequest req) { + return new HttpServletRequestAdapterImpl(req); + } + + public static HttpServletResponseAdapter wrap(HttpServletResponse resp) { + return new HttpServletResponseAdapterImpl(resp); + } + + public static FilterConfigAdapter wrap(FilterConfig filterConfig) { + return new FilterConfigAdapterImpl(filterConfig); + } + + public static ServletConfigAdapter wrap(ServletConfig servletConfig) { + return new ServletConfigAdapterImpl(servletConfig); + } +} diff --git a/simpleclient-archive/simpleclient_servlet/src/test/java/io/prometheus/client/exporter/ExampleBenchmark.java b/simpleclient-archive/simpleclient_servlet/src/test/java/io/prometheus/client/exporter/ExampleBenchmark.java new file mode 100644 index 000000000..a6c03962c --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet/src/test/java/io/prometheus/client/exporter/ExampleBenchmark.java @@ -0,0 +1,49 @@ +package io.prometheus.client.exporter; + +import io.prometheus.client.Gauge; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.UUID; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletContextHandler; +import org.eclipse.jetty.servlet.ServletHolder; + +public class ExampleBenchmark { + + public static void main(String[] args) throws Exception { + + Gauge gauge = Gauge.build().name("labels").help("foo").labelNames("bar").register(); + for (int i = 0; i < 10000; i++) { + gauge.labels(UUID.randomUUID().toString()).set(Math.random()); + } + + ServletContextHandler context = new ServletContextHandler(); + context.setContextPath("/"); + context.addServlet(new ServletHolder(new MetricsServlet()), "/metrics"); + + Server server = new Server(0); + server.setHandler(context); + server.start(); + Thread.sleep(1000); + + byte[] bytes = new byte[8192]; + URL url = new URL("http", "localhost", server.getConnectors()[0].getLocalPort(), "/metrics"); + + long start = System.nanoTime(); + for (int i = 0; i < 100; i++) { + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + InputStream in = connection.getInputStream(); + try { + while (in.read(bytes) != -1) in.available(); + } finally { + in.close(); + } + connection.disconnect(); + } + System.out.println(String.format("%,3d ns", System.nanoTime() - start)); + + server.stop(); + server.join(); + } +} diff --git a/simpleclient_servlet/src/test/java/io/prometheus/client/exporter/ExampleExporter.java b/simpleclient-archive/simpleclient_servlet/src/test/java/io/prometheus/client/exporter/ExampleExporter.java similarity index 99% rename from simpleclient_servlet/src/test/java/io/prometheus/client/exporter/ExampleExporter.java rename to simpleclient-archive/simpleclient_servlet/src/test/java/io/prometheus/client/exporter/ExampleExporter.java index 151d16252..5ecb769c3 100644 --- a/simpleclient_servlet/src/test/java/io/prometheus/client/exporter/ExampleExporter.java +++ b/simpleclient-archive/simpleclient_servlet/src/test/java/io/prometheus/client/exporter/ExampleExporter.java @@ -30,5 +30,4 @@ public static void main(String[] args) throws Exception { server.start(); server.join(); } - } diff --git a/simpleclient-archive/simpleclient_servlet/version-rules.xml b/simpleclient-archive/simpleclient_servlet/version-rules.xml new file mode 100644 index 000000000..850a3fccc --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet/version-rules.xml @@ -0,0 +1,12 @@ + + + + + + [^8].* + + + + diff --git a/simpleclient-archive/simpleclient_servlet_common/pom.xml b/simpleclient-archive/simpleclient_servlet_common/pom.xml new file mode 100644 index 000000000..f50d5a8a3 --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet_common/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.0.0-beta-2-SNAPSHOT + + + simpleclient_servlet_common + bundle + + Prometheus Java Simpleclient Servlet - Common + + HTTP servlet exporter for the simpleclient. + + + + UTF-8 + + + + + io.prometheus + simpleclient + ${project.version} + + + io.prometheus + simpleclient_common + ${project.version} + + + diff --git a/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/adapter/FilterConfigAdapter.java b/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/adapter/FilterConfigAdapter.java new file mode 100644 index 000000000..7912dfa91 --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/adapter/FilterConfigAdapter.java @@ -0,0 +1,5 @@ +package io.prometheus.client.servlet.common.adapter; + +public interface FilterConfigAdapter { + String getInitParameter(String name); +} diff --git a/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/adapter/HttpServletRequestAdapter.java b/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/adapter/HttpServletRequestAdapter.java new file mode 100644 index 000000000..b9079c30a --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/adapter/HttpServletRequestAdapter.java @@ -0,0 +1,13 @@ +package io.prometheus.client.servlet.common.adapter; + +public interface HttpServletRequestAdapter { + String getHeader(String name); + + String getRequestURI(); + + String getMethod(); + + String[] getParameterValues(String name); + + String getContextPath(); +} diff --git a/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/adapter/HttpServletResponseAdapter.java b/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/adapter/HttpServletResponseAdapter.java new file mode 100644 index 000000000..0838542ba --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/adapter/HttpServletResponseAdapter.java @@ -0,0 +1,14 @@ +package io.prometheus.client.servlet.common.adapter; + +import java.io.IOException; +import java.io.PrintWriter; + +public interface HttpServletResponseAdapter { + int getStatus(); + + void setStatus(int httpStatusCode); + + void setContentType(String contentType); + + PrintWriter getWriter() throws IOException; +} diff --git a/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/adapter/ServletConfigAdapter.java b/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/adapter/ServletConfigAdapter.java new file mode 100644 index 000000000..8136fe560 --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/adapter/ServletConfigAdapter.java @@ -0,0 +1,5 @@ +package io.prometheus.client.servlet.common.adapter; + +public interface ServletConfigAdapter { + String getInitParameter(String name); +} diff --git a/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/exporter/Exporter.java b/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/exporter/Exporter.java new file mode 100644 index 000000000..29c444f88 --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/exporter/Exporter.java @@ -0,0 +1,106 @@ +package io.prometheus.client.servlet.common.exporter; + +import io.prometheus.client.CollectorRegistry; +import io.prometheus.client.Predicate; +import io.prometheus.client.SampleNameFilter; +import io.prometheus.client.exporter.common.TextFormat; +import io.prometheus.client.servlet.common.adapter.HttpServletRequestAdapter; +import io.prometheus.client.servlet.common.adapter.HttpServletResponseAdapter; +import io.prometheus.client.servlet.common.adapter.ServletConfigAdapter; +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.Writer; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** The MetricsServlet class exists to provide a simple way of exposing the metrics values. */ +public class Exporter { + + public static final String NAME_MUST_BE_EQUAL_TO = "name-must-be-equal-to"; + public static final String NAME_MUST_NOT_BE_EQUAL_TO = "name-must-not-be-equal-to"; + public static final String NAME_MUST_START_WITH = "name-must-start-with"; + public static final String NAME_MUST_NOT_START_WITH = "name-must-not-start-with"; + + private CollectorRegistry registry; + private Predicate sampleNameFilter; + + /** + * Construct a MetricsServlet for the given registry. + * + * @param registry collector registry + * @param sampleNameFilter programmatically set a {@link SampleNameFilter}. If there are any + * filter options configured in {@code ServletConfig}, they will be merged so that samples + * need to pass both filters to be exported. sampleNameFilter may be {@code null} indicating + * that nothing should be filtered. + */ + public Exporter(CollectorRegistry registry, Predicate sampleNameFilter) { + this.registry = registry; + this.sampleNameFilter = sampleNameFilter; + } + + public void init(ServletConfigAdapter servletConfig) throws ServletConfigurationException { + List allowedNames = + SampleNameFilter.stringToList(servletConfig.getInitParameter(NAME_MUST_BE_EQUAL_TO)); + List excludedNames = + SampleNameFilter.stringToList(servletConfig.getInitParameter(NAME_MUST_NOT_BE_EQUAL_TO)); + List allowedPrefixes = + SampleNameFilter.stringToList(servletConfig.getInitParameter(NAME_MUST_START_WITH)); + List excludedPrefixes = + SampleNameFilter.stringToList(servletConfig.getInitParameter(NAME_MUST_NOT_START_WITH)); + if (!allowedPrefixes.isEmpty() + || !excludedPrefixes.isEmpty() + || !allowedNames.isEmpty() + || !excludedNames.isEmpty()) { + SampleNameFilter filter = + new SampleNameFilter.Builder() + .nameMustBeEqualTo(allowedNames) + .nameMustNotBeEqualTo(excludedNames) + .nameMustStartWith(allowedPrefixes) + .nameMustNotStartWith(excludedPrefixes) + .build(); + if (this.sampleNameFilter != null) { + this.sampleNameFilter = filter.and(this.sampleNameFilter); + } else { + this.sampleNameFilter = filter; + } + } + } + + public void doGet(final HttpServletRequestAdapter req, final HttpServletResponseAdapter resp) + throws IOException { + resp.setStatus(200); + String contentType = TextFormat.chooseContentType(req.getHeader("Accept")); + resp.setContentType(contentType); + + Writer writer = new BufferedWriter(resp.getWriter()); + try { + Predicate filter = + SampleNameFilter.restrictToNamesEqualTo(sampleNameFilter, parse(req)); + if (filter == null) { + TextFormat.writeFormat(contentType, writer, registry.metricFamilySamples()); + } else { + TextFormat.writeFormat(contentType, writer, registry.filteredMetricFamilySamples(filter)); + } + writer.flush(); + } finally { + writer.close(); + } + } + + private Set parse(HttpServletRequestAdapter req) { + String[] includedParam = req.getParameterValues("name[]"); + if (includedParam == null) { + return Collections.emptySet(); + } else { + return new HashSet(Arrays.asList(includedParam)); + } + } + + public void doPost(final HttpServletRequestAdapter req, final HttpServletResponseAdapter resp) + throws IOException { + doGet(req, resp); + } +} diff --git a/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/exporter/ServletConfigurationException.java b/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/exporter/ServletConfigurationException.java new file mode 100644 index 000000000..1dfc731b1 --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/exporter/ServletConfigurationException.java @@ -0,0 +1,3 @@ +package io.prometheus.client.servlet.common.exporter; + +public class ServletConfigurationException extends Exception {} diff --git a/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/filter/Filter.java b/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/filter/Filter.java new file mode 100644 index 000000000..1f814f53c --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/filter/Filter.java @@ -0,0 +1,175 @@ +package io.prometheus.client.servlet.common.filter; + +import io.prometheus.client.*; +import io.prometheus.client.servlet.common.adapter.*; + +/** + * Filter implements the common functionality provided by the two MetricsFilter implementations: + * + *
      + *
    • javax version: {@code io.prometheus.client.filter.MetricsFilter} provided by {@code + * simpleclient_servlet} + *
    • jakarta version: {@code io.prometheus.client.servlet.jakarta.filter.MetricsFilter} provided + * by {@code simpleclient_servlet_jakarta} + *
    + * + * @author Andrew Stuart <andrew.stuart2@gmail.com> + */ +public class Filter { + static final String PATH_COMPONENT_PARAM = "path-components"; + static final String HELP_PARAM = "help"; + static final String METRIC_NAME_PARAM = "metric-name"; + static final String BUCKET_CONFIG_PARAM = "buckets"; + static final String STRIP_CONTEXT_PATH_PARAM = "strip-context-path"; + + private Histogram histogram = null; + private Counter statusCounter = null; + + // Package-level for testing purposes. + int pathComponents = 1; + private String metricName = null; + boolean stripContextPath = false; + private String help = "The time taken fulfilling servlet requests"; + private double[] buckets = null; + + public Filter() {} + + /** + * If you want to configure the filter programmatically instead of via {@code web.xml}, you can + * pass all configuration parameters to this constructor. + */ + public Filter( + String metricName, + String help, + Integer pathComponents, + double[] buckets, + boolean stripContextPath) { + this.metricName = metricName; + this.buckets = buckets; + if (help != null) { + this.help = help; + } + if (pathComponents != null) { + this.pathComponents = pathComponents; + } + this.stripContextPath = stripContextPath; + } + + private boolean isEmpty(String s) { + return s == null || s.length() == 0; + } + + private String getComponents(String str) { + if (str == null || pathComponents < 1) { + return str; + } + int count = 0; + int i = -1; + do { + i = str.indexOf("/", i + 1); + if (i < 0) { + // Path is longer than specified pathComponents. + return str; + } + count++; + } while (count <= pathComponents); + + return str.substring(0, i); + } + + /** + * Common implementation of {@code javax.servlet.Filter.init()} and {@code + * jakarta.servlet.Filter.init()}. + */ + public void init(FilterConfigAdapter filterConfig) throws FilterConfigurationException { + Histogram.Builder builder = Histogram.build().labelNames("path", "method"); + + if (filterConfig == null && isEmpty(metricName)) { + throw new FilterConfigurationException( + "No configuration object provided, and no metricName passed via constructor"); + } + + if (filterConfig != null) { + if (isEmpty(metricName)) { + metricName = filterConfig.getInitParameter(METRIC_NAME_PARAM); + if (isEmpty(metricName)) { + throw new FilterConfigurationException( + "Init parameter \"" + METRIC_NAME_PARAM + "\" is required; please supply a value"); + } + } + + if (!isEmpty(filterConfig.getInitParameter(HELP_PARAM))) { + help = filterConfig.getInitParameter(HELP_PARAM); + } + + // Allow users to override the default bucket configuration + if (!isEmpty(filterConfig.getInitParameter(BUCKET_CONFIG_PARAM))) { + String[] bucketParams = filterConfig.getInitParameter(BUCKET_CONFIG_PARAM).split(","); + buckets = new double[bucketParams.length]; + + for (int i = 0; i < bucketParams.length; i++) { + buckets[i] = Double.parseDouble(bucketParams[i]); + } + } + + // Allow overriding of the path "depth" to track + if (!isEmpty(filterConfig.getInitParameter(PATH_COMPONENT_PARAM))) { + pathComponents = Integer.parseInt(filterConfig.getInitParameter(PATH_COMPONENT_PARAM)); + } + + if (!isEmpty(filterConfig.getInitParameter(STRIP_CONTEXT_PATH_PARAM))) { + stripContextPath = + Boolean.parseBoolean(filterConfig.getInitParameter(STRIP_CONTEXT_PATH_PARAM)); + } + } + + if (buckets != null) { + builder = builder.buckets(buckets); + } + + histogram = builder.help(help).name(metricName).register(); + + statusCounter = + Counter.build(metricName + "_status_total", "HTTP status codes of " + help) + .labelNames("path", "method", "status") + .register(); + } + + /** + * To be called at the beginning of {@code javax.servlet.Filter.doFilter()} or {@code + * jakarta.servlet.Filter.doFilter()}. + */ + public MetricData startTimer(HttpServletRequestAdapter request) { + String path = request.getRequestURI(); + if (stripContextPath) { + path = path.substring(request.getContextPath().length()); + } + String components = getComponents(path); + String method = request.getMethod(); + Histogram.Timer timer = histogram.labels(components, method).startTimer(); + return new MetricData(components, method, timer); + } + + /** + * To be called at the end of {@code javax.servlet.Filter.doFilter()} or {@code + * jakarta.servlet.Filter.doFilter()}. + */ + public void observeDuration(MetricData data, HttpServletResponseAdapter resp) { + String status = Integer.toString(resp.getStatus()); + data.timer.observeDuration(); + statusCounter.labels(data.components, data.method, status).inc(); + } + + public static class MetricData { + + final String components; + final String method; + final Histogram.Timer timer; + + private MetricData(String components, String method, Histogram.Timer timer) { + this.components = components; + this.method = method; + this.timer = timer; + } + } +} diff --git a/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/filter/FilterConfigurationException.java b/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/filter/FilterConfigurationException.java new file mode 100644 index 000000000..8173f45d8 --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet_common/src/main/java/io/prometheus/client/servlet/common/filter/FilterConfigurationException.java @@ -0,0 +1,8 @@ +package io.prometheus.client.servlet.common.filter; + +/** Thrown when there is a misconfiguration in {@code web.xml}. */ +public class FilterConfigurationException extends Exception { + public FilterConfigurationException(String msg) { + super(msg); + } +} diff --git a/simpleclient-archive/simpleclient_servlet_common/src/test/java/io/prometheus/client/servlet/common/exporter/ExporterTest.java b/simpleclient-archive/simpleclient_servlet_common/src/test/java/io/prometheus/client/servlet/common/exporter/ExporterTest.java new file mode 100644 index 000000000..f2903cbe1 --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet_common/src/test/java/io/prometheus/client/servlet/common/exporter/ExporterTest.java @@ -0,0 +1,161 @@ +package io.prometheus.client.servlet.common.exporter; + +import static org.assertj.core.api.Java6Assertions.assertThat; +import static org.assertj.core.api.Java6Assertions.fail; + +import io.prometheus.client.CollectorRegistry; +import io.prometheus.client.Gauge; +import io.prometheus.client.servlet.common.adapter.HttpServletRequestAdapter; +import io.prometheus.client.servlet.common.adapter.HttpServletResponseAdapter; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.concurrent.atomic.AtomicBoolean; +import org.junit.Assert; +import org.junit.Test; + +class ExporterTest { + + private HttpServletRequestAdapter mockHttpServletRequest() { + return mockHttpServletRequest(null, false); + } + + private HttpServletRequestAdapter mockHttpServletRequest( + final String[] nameParam, final boolean openMetrics) { + return new HttpServletRequestAdapter() { + @Override + public String getHeader(String name) { + if (openMetrics && "Accept".equals(name)) { + return "application/openmetrics-text;" + + " version=0.0.1,text/plain;version=0.0.4;q=0.5,*/*;q=0.1"; + } + return null; + } + + @Override + public String getMethod() { + return null; + } + + @Override + public String getRequestURI() { + return null; + } + + @Override + public String[] getParameterValues(String name) { + if ("name[]".equals(name)) { + return nameParam; + } + return null; + } + + @Override + public String getContextPath() { + return ""; + } + }; + } + + private HttpServletResponseAdapter mockHttpServletResponse(final PrintWriter writer) { + return new HttpServletResponseAdapter() { + @Override + public int getStatus() { + return 0; + } + + @Override + public void setStatus(int httpStatusCode) {} + + @Override + public void setContentType(String contentType) {} + + @Override + public PrintWriter getWriter() { + return writer; + } + }; + } + + @Test + public void testWriterFiltersBasedOnParameter() throws IOException { + CollectorRegistry registry = new CollectorRegistry(); + Gauge.build("a", "a help").register(registry); + Gauge.build("b", "a help").register(registry); + Gauge.build("c", "a help").register(registry); + + HttpServletRequestAdapter req = + mockHttpServletRequest(new String[] {"a", "b", "oneTheDoesntExist", ""}, false); + StringWriter responseBody = new StringWriter(); + HttpServletResponseAdapter resp = mockHttpServletResponse(new PrintWriter(responseBody)); + + new Exporter(registry, null).doGet(req, resp); + + assertThat(responseBody.toString()).contains("a 0.0"); + assertThat(responseBody.toString()).contains("b 0.0"); + assertThat(responseBody.toString()).doesNotContain("c 0.0"); + } + + @Test + public void testWriterIsClosedNormally() throws IOException { + final AtomicBoolean closed = new AtomicBoolean(false); + StringWriter responseBody = + new StringWriter() { + @Override + public void close() { + closed.set(true); + } + }; + HttpServletRequestAdapter req = mockHttpServletRequest(); + HttpServletResponseAdapter resp = mockHttpServletResponse(new PrintWriter(responseBody)); + CollectorRegistry registry = new CollectorRegistry(); + Gauge a = Gauge.build("a", "a help").register(registry); + + new Exporter(registry, null).doGet(req, resp); + Assert.assertTrue(closed.get()); + } + + @Test + public void testWriterIsClosedOnException() { + final AtomicBoolean closed = new AtomicBoolean(false); + StringWriter responseBody = + new StringWriter() { + @Override + public void write(char cbuf[], int off, int len) { + throw new RuntimeException(); + } + + @Override + public void close() { + closed.set(true); + } + }; + HttpServletRequestAdapter req = mockHttpServletRequest(); + HttpServletResponseAdapter resp = mockHttpServletResponse(new PrintWriter(responseBody)); + CollectorRegistry registry = new CollectorRegistry(); + Gauge a = Gauge.build("a", "a help").register(registry); + + try { + new Exporter(registry, null).doGet(req, resp); + fail("Exception expected"); + } catch (Exception e) { + } + + Assert.assertTrue(closed.get()); + } + + @Test + public void testOpenMetricsNegotiated() throws IOException { + CollectorRegistry registry = new CollectorRegistry(); + Gauge.build("a", "a help").register(registry); + + HttpServletRequestAdapter req = mockHttpServletRequest(null, true); + StringWriter responseBody = new StringWriter(); + HttpServletResponseAdapter resp = mockHttpServletResponse(new PrintWriter(responseBody)); + + new Exporter(registry, null).doGet(req, resp); + + assertThat(responseBody.toString()).contains("a 0.0"); + assertThat(responseBody.toString()).contains("# EOF"); + } +} diff --git a/simpleclient-archive/simpleclient_servlet_common/src/test/java/io/prometheus/client/servlet/common/filter/FilterTest.java b/simpleclient-archive/simpleclient_servlet_common/src/test/java/io/prometheus/client/servlet/common/filter/FilterTest.java new file mode 100644 index 000000000..cde839b6b --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet_common/src/test/java/io/prometheus/client/servlet/common/filter/FilterTest.java @@ -0,0 +1,248 @@ +package io.prometheus.client.servlet.common.filter; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import io.prometheus.client.Collector; +import io.prometheus.client.CollectorRegistry; +import io.prometheus.client.servlet.common.adapter.FilterConfigAdapter; +import io.prometheus.client.servlet.common.adapter.HttpServletRequestAdapter; +import io.prometheus.client.servlet.common.adapter.HttpServletResponseAdapter; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Enumeration; +import org.junit.After; +import org.junit.Test; + +class FilterTest { + + public static final String GET = "GET"; + public static final String POST = "POST"; + public static final String METRIC_NAME = "foo"; + + private FilterConfigAdapter mockFilterConfig() { + return mockFilterConfig(null, null); + } + + private FilterConfigAdapter mockFilterConfig( + final String metricName, final String pathComponents) { + return mockFilterConfig(metricName, pathComponents, null); + } + + private FilterConfigAdapter mockFilterConfig( + final String metricName, final String pathComponents, final String buckets) { + return new FilterConfigAdapter() { + @Override + public String getInitParameter(String name) { + if (Filter.METRIC_NAME_PARAM.equals(name)) { + return metricName; + } + if (Filter.PATH_COMPONENT_PARAM.equals(name)) { + return pathComponents; + } + if (Filter.BUCKET_CONFIG_PARAM.equals(name)) { + return buckets; + } + return null; + } + }; + } + + private HttpServletRequestAdapter mockHttpServletRequest(final String method, final String uri) { + return new HttpServletRequestAdapter() { + @Override + public String getHeader(String name) { + return null; + } + + @Override + public String getMethod() { + return method; + } + + @Override + public String getRequestURI() { + return uri; + } + + @Override + public String[] getParameterValues(String name) { + return null; + } + + @Override + public String getContextPath() { + return ""; + } + }; + } + + private HttpServletResponseAdapter mockHttpServletResponse() { + return mockHttpServletResponse(0); + } + + private HttpServletResponseAdapter mockHttpServletResponse(final int status) { + return new HttpServletResponseAdapter() { + @Override + public int getStatus() { + return status; + } + + @Override + public void setStatus(int httpStatusCode) {} + + @Override + public void setContentType(String contentType) {} + + @Override + public PrintWriter getWriter() throws IOException { + return null; + } + }; + } + + @After + public void clear() { + CollectorRegistry.defaultRegistry.clear(); + } + + @Test + public void testPathComponents4() throws Exception { + Filter filter = new Filter(); + String metricName = "foo"; + int pathComponents = 4; + filter.init(mockFilterConfig(metricName, Integer.toString(pathComponents))); + assertEquals(filter.pathComponents, 4); + Filter.MetricData data = + filter.startTimer(mockHttpServletRequest(GET, "/foo/bar/baz/bang/zilch/zip/nada")); + filter.observeDuration(data, mockHttpServletResponse()); + + final Double sampleValue = + CollectorRegistry.defaultRegistry.getSampleValue( + METRIC_NAME + "_count", + new String[] {"path", "method"}, + new String[] {"/foo/bar/baz/bang", GET}); + assertNotNull(sampleValue); + assertEquals(1, sampleValue, 0.0001); + } + + @Test + public void testPathComponents0() throws Exception { + Filter filter = new Filter(); + String metricName = "foo"; + int pathComponents = 0; + String path = "/foo/bar/baz/bang/zilch/zip/nada"; + filter.init(mockFilterConfig(metricName, Integer.toString(pathComponents))); + assertEquals(filter.pathComponents, 0); + Filter.MetricData data = filter.startTimer(mockHttpServletRequest(GET, path)); + filter.observeDuration(data, mockHttpServletResponse()); + + final Double sampleValue = + CollectorRegistry.defaultRegistry.getSampleValue( + metricName + "_count", new String[] {"path", "method"}, new String[] {path, GET}); + assertNotNull(sampleValue); + assertEquals(1, sampleValue, 0.0001); + } + + @Test + public void testConstructor() throws Exception { + final String path = "/foo/bar/baz/bang"; + HttpServletRequestAdapter req = mockHttpServletRequest(POST, path); + HttpServletResponseAdapter res = mockHttpServletResponse(); + + Filter constructed = + new Filter("foobar_baz_filter_duration_seconds", "Help for my filter", 0, null, false); + constructed.init(mockFilterConfig(null, null)); + + Filter.MetricData data = constructed.startTimer(req); + Thread.sleep(100); + constructed.observeDuration(data, res); + + final Double sum = + CollectorRegistry.defaultRegistry.getSampleValue( + "foobar_baz_filter_duration_seconds_sum", + new String[] {"path", "method"}, + new String[] {path, POST}); + assertNotNull(sum); + assertEquals(0.1, sum, 0.01); + } + + @Test + public void testBucketsAndName() throws Exception { + final String path = "/foo/bar/baz/bang"; + HttpServletRequestAdapter req = mockHttpServletRequest(POST, path); + + final String buckets = "0.01,0.05,0.1,0.15,0.25"; + FilterConfigAdapter cfg = mockFilterConfig("foo", null, buckets); + + HttpServletResponseAdapter res = mockHttpServletResponse(); + + Filter filter = new Filter(); + filter.init(cfg); + + Filter.MetricData data = filter.startTimer(req); + Thread.sleep(100); + filter.observeDuration(data, res); + + final Double sum = + CollectorRegistry.defaultRegistry.getSampleValue( + "foo_sum", new String[] {"path", "method"}, new String[] {"/foo", POST}); + assertEquals(0.1, sum, 0.01); + + final Double le05 = + CollectorRegistry.defaultRegistry.getSampleValue( + "foo_bucket", + new String[] {"path", "method", "le"}, + new String[] {"/foo", POST, "0.05"}); + assertNotNull(le05); + assertEquals(0, le05, 0.01); + final Double le15 = + CollectorRegistry.defaultRegistry.getSampleValue( + "foo_bucket", + new String[] {"path", "method", "le"}, + new String[] {"/foo", POST, "0.15"}); + assertNotNull(le15); + assertEquals(1, le15, 0.01); + + final Enumeration samples = + CollectorRegistry.defaultRegistry.metricFamilySamples(); + Collector.MetricFamilySamples sample = null; + while (samples.hasMoreElements()) { + sample = samples.nextElement(); + if (sample.name.equals("foo")) { + break; + } + } + + assertNotNull(sample); + + int count = 0; + for (Collector.MetricFamilySamples.Sample s : sample.samples) { + if (s.name.equals("foo_bucket")) { + count++; + } + } + // +1 because of the final le=+infinity bucket + assertEquals(buckets.split(",").length + 1, count); + } + + @Test + public void testStatusCode() throws Exception { + HttpServletRequestAdapter req = mockHttpServletRequest(GET, "/foo/bar/baz/bang"); + HttpServletResponseAdapter res = mockHttpServletResponse(200); + + Filter constructed = new Filter("foobar_filter", "Help for my filter", 2, null, false); + constructed.init(mockFilterConfig()); + + Filter.MetricData data = constructed.startTimer(req); + constructed.observeDuration(data, res); + + final Double sampleValue = + CollectorRegistry.defaultRegistry.getSampleValue( + "foobar_filter_status_total", + new String[] {"path", "method", "status"}, + new String[] {"/foo/bar", GET, "200"}); + assertNotNull(sampleValue); + assertEquals(1, sampleValue, 0.0001); + } +} diff --git a/simpleclient-archive/simpleclient_servlet_common/version-rules.xml b/simpleclient-archive/simpleclient_servlet_common/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet_common/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/simpleclient-archive/simpleclient_servlet_jakarta/pom.xml b/simpleclient-archive/simpleclient_servlet_jakarta/pom.xml new file mode 100644 index 000000000..e82941a38 --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet_jakarta/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.0.0-beta-2-SNAPSHOT + + + simpleclient_servlet_jakarta + bundle + + Prometheus Java Simpleclient Servlet - Jakarta + + HTTP jakarta servlet exporter for the simpleclient. + + + + UTF-8 + + + + + io.prometheus + simpleclient + ${project.version} + + + io.prometheus + simpleclient_common + ${project.version} + + + io.prometheus + simpleclient_servlet_common + ${project.version} + + + jakarta.servlet + jakarta.servlet-api + 6.0.0 + provided + + + + org.eclipse.jetty + jetty-servlet + 11.0.9 + test + + + diff --git a/simpleclient-archive/simpleclient_servlet_jakarta/src/main/java/io/prometheus/client/servlet/jakarta/Adapter.java b/simpleclient-archive/simpleclient_servlet_jakarta/src/main/java/io/prometheus/client/servlet/jakarta/Adapter.java new file mode 100644 index 000000000..0bee67007 --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet_jakarta/src/main/java/io/prometheus/client/servlet/jakarta/Adapter.java @@ -0,0 +1,122 @@ +package io.prometheus.client.servlet.jakarta; + +import io.prometheus.client.servlet.common.adapter.FilterConfigAdapter; +import io.prometheus.client.servlet.common.adapter.HttpServletRequestAdapter; +import io.prometheus.client.servlet.common.adapter.HttpServletResponseAdapter; +import io.prometheus.client.servlet.common.adapter.ServletConfigAdapter; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; + +public class Adapter { + + private static class HttpServletRequestAdapterImpl implements HttpServletRequestAdapter { + + private final HttpServletRequest delegate; + + HttpServletRequestAdapterImpl(HttpServletRequest delegate) { + this.delegate = delegate; + } + + @Override + public String getHeader(String name) { + return delegate.getHeader(name); + } + + @Override + public String getRequestURI() { + return delegate.getRequestURI(); + } + + @Override + public String getMethod() { + return delegate.getMethod(); + } + + @Override + public String[] getParameterValues(String name) { + return delegate.getParameterValues(name); + } + + @Override + public String getContextPath() { + return delegate.getContextPath(); + } + } + + private static class HttpServletResponseAdapterImpl implements HttpServletResponseAdapter { + + private final HttpServletResponse delegate; + + HttpServletResponseAdapterImpl(HttpServletResponse delegate) { + this.delegate = delegate; + } + + @Override + public void setStatus(int httpStatusCode) { + delegate.setStatus(httpStatusCode); + } + + @Override + public void setContentType(String contentType) { + delegate.setContentType(contentType); + } + + @Override + public PrintWriter getWriter() throws IOException { + return delegate.getWriter(); + } + + @Override + public int getStatus() { + return delegate.getStatus(); + } + } + + private static class FilterConfigAdapterImpl implements FilterConfigAdapter { + + private final FilterConfig delegate; + + private FilterConfigAdapterImpl(FilterConfig delegate) { + this.delegate = delegate; + } + + @Override + public String getInitParameter(String name) { + return delegate.getInitParameter(name); + } + } + + private static class ServletConfigAdapterImpl implements ServletConfigAdapter { + + final ServletConfig delegate; + + private ServletConfigAdapterImpl(ServletConfig delegate) { + this.delegate = delegate; + } + + @Override + public String getInitParameter(String name) { + return delegate.getInitParameter(name); + } + } + + public static HttpServletRequestAdapter wrap(HttpServletRequest req) { + return new HttpServletRequestAdapterImpl(req); + } + + public static HttpServletResponseAdapter wrap(HttpServletResponse resp) { + return new HttpServletResponseAdapterImpl(resp); + } + + public static FilterConfigAdapter wrap(FilterConfig filterConfig) { + return new FilterConfigAdapterImpl(filterConfig); + } + + public static ServletConfigAdapter wrap(ServletConfig servletConfig) { + return new ServletConfigAdapterImpl(servletConfig); + } +} diff --git a/simpleclient-archive/simpleclient_servlet_jakarta/src/main/java/io/prometheus/client/servlet/jakarta/filter/MetricsFilter.java b/simpleclient-archive/simpleclient_servlet_jakarta/src/main/java/io/prometheus/client/servlet/jakarta/filter/MetricsFilter.java new file mode 100644 index 000000000..c3dd403ef --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet_jakarta/src/main/java/io/prometheus/client/servlet/jakarta/filter/MetricsFilter.java @@ -0,0 +1,126 @@ +package io.prometheus.client.servlet.jakarta.filter; + +import io.prometheus.client.servlet.common.filter.Filter; +import io.prometheus.client.servlet.common.filter.FilterConfigurationException; +import io.prometheus.client.servlet.jakarta.Adapter; +import jakarta.servlet.*; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * The MetricsFilter class provides a high-level filter that enables tunable collection of metrics + * for Servlet performance. + * + *

    This is the Jakarta version of the MetricsFilter. If you are using Javax Servlet, there is a + * Javax version available in {@code simpleclient-servlet}. + * + *

    The metric name itself is required, and configured with a {@code metric-name} init parameter. + * + *

    The help parameter, configured with the {@code help} init parameter, is not required but + * strongly recommended. + * + *

    The Histogram buckets can be configured with a {@code buckets} init parameter whose value is a + * comma-separated list * of valid {@code double} values. If omitted, the default buckets from + * {@link io.prometheus.client.Histogram} are used. + * + *

    By default, this filter will provide metrics that distinguish only 1 level deep for the + * request path (including servlet context path), but can be configured with the {@code + * path-components} init parameter. Any number provided that is less than 1 will provide the full + * path granularity (warning, this may affect performance). + * + *

    The {@code strip-context-path} init parameter can be used to avoid including the leading path + * components which are part of the context (i.e. the folder where the servlet is deployed) so that + * the same project deployed under different paths can produce the same metrics. + * + *

    HTTP statuses will be aggregated via Counter. The name for this counter will be derived from + * the {@code metric-name} init parameter. + * + *

    {@code
    + * 
    + *   prometheusFilter
    + *   
    + *   
    + *   io.prometheus.client.filter.MetricsFilter
    + *   
    + *     metric-name
    + *     webapp_metrics_filter
    + *   
    + *   
    + *   
    + *     help
    + *     This is the help for your metrics filter
    + *   
    + *   
    + *   
    + *     buckets
    + *     0.005,0.01,0.025,0.05,0.075,0.1,0.25,0.5,0.75,1,2.5,5,7.5,10
    + *   
    + *   
    + *   
    + *     path-components
    + *     1
    + *   
    + *   
    + *   
    + *     strip-context-path
    + *     false
    + *   
    + * 
    + *
    + * 
    + * 
    + *   prometheusFilter
    + *   /*
    + * 
    + * }
    + */ +public class MetricsFilter implements jakarta.servlet.Filter { + + private final Filter delegate; + + public MetricsFilter() { + this.delegate = new Filter(); + } + + /** See {@link Filter#Filter(String, String, Integer, double[], boolean)}. */ + public MetricsFilter( + String metricName, + String help, + Integer pathComponents, + double[] buckets, + boolean stripContextPath) { + this.delegate = new Filter(metricName, help, pathComponents, buckets, stripContextPath); + } + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + try { + delegate.init(Adapter.wrap(filterConfig)); + } catch (FilterConfigurationException e) { + throw new ServletException(e); + } + } + + @Override + public void doFilter( + ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) + throws IOException, ServletException { + if (!(servletRequest instanceof HttpServletRequest) + || !(servletResponse instanceof HttpServletResponse)) { + filterChain.doFilter(servletRequest, servletResponse); + return; + } + Filter.MetricData data = delegate.startTimer(Adapter.wrap((HttpServletRequest) servletRequest)); + try { + filterChain.doFilter(servletRequest, servletResponse); + } finally { + delegate.observeDuration(data, Adapter.wrap((HttpServletResponse) servletResponse)); + } + } + + @Override + public void destroy() {} +} diff --git a/simpleclient-archive/simpleclient_servlet_jakarta/src/test/java/io/prometheus/client/exporter/ExampleBenchmark.java b/simpleclient-archive/simpleclient_servlet_jakarta/src/test/java/io/prometheus/client/exporter/ExampleBenchmark.java new file mode 100644 index 000000000..5c773124f --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet_jakarta/src/test/java/io/prometheus/client/exporter/ExampleBenchmark.java @@ -0,0 +1,52 @@ +package io.prometheus.client.exporter; + +import io.prometheus.client.Gauge; +import io.prometheus.client.servlet.jakarta.exporter.MetricsServlet; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.UUID; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.server.ServerConnector; +import org.eclipse.jetty.servlet.ServletContextHandler; +import org.eclipse.jetty.servlet.ServletHolder; + +public class ExampleBenchmark { + + public static void main(String[] args) throws Exception { + + Gauge gauge = Gauge.build().name("labels").help("foo").labelNames("bar").register(); + for (int i = 0; i < 10000; i++) { + gauge.labels(UUID.randomUUID().toString()).set(Math.random()); + } + + ServletContextHandler context = new ServletContextHandler(); + context.setContextPath("/"); + context.addServlet(new ServletHolder(new MetricsServlet()), "/metrics"); + + Server server = new Server(0); + server.setHandler(context); + server.start(); + Thread.sleep(1000); + + ServerConnector connector = (ServerConnector) server.getConnectors()[0]; + byte[] bytes = new byte[8192]; + URL url = new URL("http", "localhost", connector.getLocalPort(), "/metrics"); + + long start = System.nanoTime(); + for (int i = 0; i < 100; i++) { + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + InputStream in = connection.getInputStream(); + try { + while (in.read(bytes) != -1) in.available(); + } finally { + in.close(); + } + connection.disconnect(); + } + System.out.println(String.format("%,3d ns", System.nanoTime() - start)); + + server.stop(); + server.join(); + } +} diff --git a/simpleclient-archive/simpleclient_servlet_jakarta/src/test/java/io/prometheus/client/exporter/ExampleExporter.java b/simpleclient-archive/simpleclient_servlet_jakarta/src/test/java/io/prometheus/client/exporter/ExampleExporter.java new file mode 100644 index 000000000..217aff4c5 --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet_jakarta/src/test/java/io/prometheus/client/exporter/ExampleExporter.java @@ -0,0 +1,34 @@ +package io.prometheus.client.exporter; + +import io.prometheus.client.Counter; +import io.prometheus.client.Gauge; +import io.prometheus.client.Histogram; +import io.prometheus.client.Summary; +import io.prometheus.client.servlet.jakarta.exporter.MetricsServlet; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletContextHandler; +import org.eclipse.jetty.servlet.ServletHolder; + +public class ExampleExporter { + + static final Gauge g = Gauge.build().name("gauge").help("blah").register(); + static final Counter c = Counter.build().name("counter").help("meh").register(); + static final Summary s = Summary.build().name("summary").help("meh").register(); + static final Histogram h = Histogram.build().name("histogram").help("meh").register(); + static final Gauge l = Gauge.build().name("labels").help("blah").labelNames("l").register(); + + public static void main(String[] args) throws Exception { + Server server = new Server(1234); + ServletContextHandler context = new ServletContextHandler(); + context.setContextPath("/"); + server.setHandler(context); + context.addServlet(new ServletHolder(new MetricsServlet()), "/metrics"); + g.set(1); + c.inc(2); + s.observe(3); + h.observe(4); + l.labels("foo").inc(5); + server.start(); + server.join(); + } +} diff --git a/simpleclient-archive/simpleclient_servlet_jakarta/version-rules.xml b/simpleclient-archive/simpleclient_servlet_jakarta/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/simpleclient-archive/simpleclient_servlet_jakarta/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/simpleclient-archive/simpleclient_spring_web/pom.xml b/simpleclient-archive/simpleclient_spring_web/pom.xml new file mode 100644 index 000000000..3bfc03a11 --- /dev/null +++ b/simpleclient-archive/simpleclient_spring_web/pom.xml @@ -0,0 +1,69 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.0.0-beta-2-SNAPSHOT + + + simpleclient_spring_web + bundle + + Prometheus Java Simpleclient Spring Metrics + + Spring-specific metrics helpers + + + + UTF-8 + + + + + io.prometheus + simpleclient + ${project.version} + + + io.prometheus + simpleclient_common + ${project.version} + + + org.springframework + spring-web + 4.3.30.RELEASE + + + org.springframework + spring-aop + 4.3.30.RELEASE + + + org.springframework + spring-context + 4.3.30.RELEASE + + + org.aspectj + aspectjweaver + 1.9.9.1 + + + org.apache.commons + commons-lang3 + 3.12.0 + + + + + org.springframework + spring-test + 4.3.30.RELEASE + test + + + diff --git a/simpleclient_spring_web/src/main/java/io/prometheus/client/spring/web/EnablePrometheusTiming.java b/simpleclient-archive/simpleclient_spring_web/src/main/java/io/prometheus/client/spring/web/EnablePrometheusTiming.java similarity index 73% rename from simpleclient_spring_web/src/main/java/io/prometheus/client/spring/web/EnablePrometheusTiming.java rename to simpleclient-archive/simpleclient_spring_web/src/main/java/io/prometheus/client/spring/web/EnablePrometheusTiming.java index 2d9de3793..c4d5cf388 100644 --- a/simpleclient_spring_web/src/main/java/io/prometheus/client/spring/web/EnablePrometheusTiming.java +++ b/simpleclient-archive/simpleclient_spring_web/src/main/java/io/prometheus/client/spring/web/EnablePrometheusTiming.java @@ -1,20 +1,22 @@ package io.prometheus.client.spring.web; -import org.springframework.context.annotation.Import; - import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.springframework.context.annotation.Import; /** * Enable the use of {@link PrometheusTimeMethod} annotation on classes or methods. * - * Usage: Add this annotation to any Spring {@link org.springframework.context.annotation.Configuration} class to enable - * the use of the {@link PrometheusTimeMethod} annotation. + *

    Usage: Add this annotation to any Spring {@link + * org.springframework.context.annotation.Configuration} class to enable the use of the {@link + * PrometheusTimeMethod} annotation. + * + *

    * * - * *

    
    + * 
    
      * {@literal @}Configuration
      * {@literal @}EnablePrometheusEndpoint
      * {@literal @}EnablePrometheusTiming
    @@ -29,4 +31,4 @@
     @Target(ElementType.TYPE)
     @Import(MethodTimer.class)
     @Documented
    -public @interface EnablePrometheusTiming {}
    \ No newline at end of file
    +public @interface EnablePrometheusTiming {}
    diff --git a/simpleclient-archive/simpleclient_spring_web/src/main/java/io/prometheus/client/spring/web/MethodTimer.java b/simpleclient-archive/simpleclient_spring_web/src/main/java/io/prometheus/client/spring/web/MethodTimer.java
    new file mode 100644
    index 000000000..afab20b77
    --- /dev/null
    +++ b/simpleclient-archive/simpleclient_spring_web/src/main/java/io/prometheus/client/spring/web/MethodTimer.java
    @@ -0,0 +1,123 @@
    +package io.prometheus.client.spring.web;
    +
    +import io.prometheus.client.Summary;
    +import java.lang.reflect.Method;
    +import java.util.HashMap;
    +import java.util.concurrent.locks.Lock;
    +import java.util.concurrent.locks.ReadWriteLock;
    +import java.util.concurrent.locks.ReentrantReadWriteLock;
    +import org.aspectj.lang.ProceedingJoinPoint;
    +import org.aspectj.lang.annotation.Around;
    +import org.aspectj.lang.annotation.Aspect;
    +import org.aspectj.lang.annotation.Pointcut;
    +import org.aspectj.lang.reflect.MethodSignature;
    +import org.springframework.context.annotation.Scope;
    +import org.springframework.core.annotation.AnnotationUtils;
    +import org.springframework.util.ReflectionUtils;
    +import org.springframework.web.bind.annotation.ControllerAdvice;
    +
    +/**
    + * This class automatically times (via aspectj) the execution of annotated methods, if it's been
    + * enabled via {@link EnablePrometheusTiming}, for methods annotated with {@link
    + * PrometheusTimeMethod}
    + *
    + * @author Andrew Stuart
    + */
    +@Aspect("pertarget(io.prometheus.client.spring.web.MethodTimer.timeable())")
    +@Scope("prototype")
    +@ControllerAdvice
    +public class MethodTimer {
    +  private final ReadWriteLock summaryLock = new ReentrantReadWriteLock();
    +  private final HashMap summaries = new HashMap();
    +
    +  @Pointcut("@annotation(io.prometheus.client.spring.web.PrometheusTimeMethod)")
    +  public void annotatedMethod() {}
    +
    +  @Pointcut("annotatedMethod()")
    +  public void timeable() {}
    +
    +  private PrometheusTimeMethod getAnnotation(ProceedingJoinPoint pjp) throws NoSuchMethodException {
    +    assert (pjp.getSignature() instanceof MethodSignature);
    +    MethodSignature signature = (MethodSignature) pjp.getSignature();
    +
    +    PrometheusTimeMethod annot =
    +        AnnotationUtils.findAnnotation(pjp.getTarget().getClass(), PrometheusTimeMethod.class);
    +    if (annot != null) {
    +      return annot;
    +    }
    +
    +    // When target is an AOP interface proxy but annotation is on class method (rather than
    +    // Interface method).
    +    final String name = signature.getName();
    +    final Class[] parameterTypes = signature.getParameterTypes();
    +    Method method = ReflectionUtils.findMethod(pjp.getTarget().getClass(), name, parameterTypes);
    +    return AnnotationUtils.findAnnotation(method, PrometheusTimeMethod.class);
    +  }
    +
    +  private Summary ensureSummary(ProceedingJoinPoint pjp, String key) throws IllegalStateException {
    +    PrometheusTimeMethod annot;
    +    try {
    +      annot = getAnnotation(pjp);
    +    } catch (NoSuchMethodException e) {
    +      throw new IllegalStateException(
    +          "Annotation could not be found for pjp \"" + pjp.toShortString() + "\"", e);
    +    } catch (NullPointerException e) {
    +      throw new IllegalStateException(
    +          "Annotation could not be found for pjp \"" + pjp.toShortString() + "\"", e);
    +    }
    +
    +    assert (annot != null);
    +
    +    Summary summary;
    +
    +    // We use a writeLock here to guarantee no concurrent reads.
    +    final Lock writeLock = summaryLock.writeLock();
    +    writeLock.lock();
    +    try {
    +      // Check one last time with full mutual exclusion in case multiple readers got null before
    +      // creation.
    +      summary = summaries.get(key);
    +      if (summary != null) {
    +        return summary;
    +      }
    +
    +      // Now we know for sure that we have never before registered.
    +      summary = Summary.build().name(annot.name()).help(annot.help()).register();
    +
    +      // Even a rehash of the underlying table will not cause issues as we mutually exclude readers
    +      // while we
    +      // perform our updates.
    +      summaries.put(key, summary);
    +
    +      return summary;
    +    } finally {
    +      writeLock.unlock();
    +    }
    +  }
    +
    +  @Around("timeable()")
    +  public Object timeMethod(ProceedingJoinPoint pjp) throws Throwable {
    +    String key = pjp.getSignature().toLongString();
    +
    +    Summary summary;
    +    final Lock r = summaryLock.readLock();
    +    r.lock();
    +    try {
    +      summary = summaries.get(key);
    +    } finally {
    +      r.unlock();
    +    }
    +
    +    if (summary == null) {
    +      summary = ensureSummary(pjp, key);
    +    }
    +
    +    final Summary.Timer t = summary.startTimer();
    +
    +    try {
    +      return pjp.proceed();
    +    } finally {
    +      t.observeDuration();
    +    }
    +  }
    +}
    diff --git a/simpleclient_spring_web/src/main/java/io/prometheus/client/spring/web/PrometheusTimeMethod.java b/simpleclient-archive/simpleclient_spring_web/src/main/java/io/prometheus/client/spring/web/PrometheusTimeMethod.java
    similarity index 58%
    rename from simpleclient_spring_web/src/main/java/io/prometheus/client/spring/web/PrometheusTimeMethod.java
    rename to simpleclient-archive/simpleclient_spring_web/src/main/java/io/prometheus/client/spring/web/PrometheusTimeMethod.java
    index 990f69ed5..209c25718 100644
    --- a/simpleclient_spring_web/src/main/java/io/prometheus/client/spring/web/PrometheusTimeMethod.java
    +++ b/simpleclient-archive/simpleclient_spring_web/src/main/java/io/prometheus/client/spring/web/PrometheusTimeMethod.java
    @@ -6,13 +6,14 @@
     import java.lang.annotation.Target;
     
     /**
    - * Enable Spring-AOP-based automated method timing for the annotated method. The timings will be recorded in a
    - * {@link io.prometheus.client.Summary} with a name specified by the required {@code name} parameter, and help
    - * specified by the {@code help} parameter.
    + * Enable Spring-AOP-based automated method timing for the annotated method. The timings will be
    + * recorded in a {@link io.prometheus.client.Summary} with a name specified by the required {@code
    + * name} parameter, and help specified by the {@code help} parameter.
      *
    - * To properly work, {@link EnablePrometheusTiming} must be specified somewhere in your application configuration.
    + * 

    To properly work, {@link EnablePrometheusTiming} must be specified somewhere in your + * application configuration. * - *

    
    + * 
    
      * {@literal @}Controller
      *  public class MyController {
      *    {@literal @}RequestMapping("/")
    @@ -25,21 +26,22 @@
      *  }
      * 
    * - * * @author Andrew Stuart */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface PrometheusTimeMethod { - /** - * The metric name to use for recording latencies - * @return A metric name specific to your use case. - */ - String name(); + /** + * The metric name to use for recording latencies + * + * @return A metric name specific to your use case. + */ + String name(); - /** - * The help message to show in prometheus metrics - * @return A help string - */ - String help(); + /** + * The help message to show in prometheus metrics + * + * @return A help string + */ + String help(); } diff --git a/simpleclient-archive/simpleclient_spring_web/src/test/java/io/prometheus/client/spring/web/MethodTimerAppTest.java b/simpleclient-archive/simpleclient_spring_web/src/test/java/io/prometheus/client/spring/web/MethodTimerAppTest.java new file mode 100644 index 000000000..dd4538121 --- /dev/null +++ b/simpleclient-archive/simpleclient_spring_web/src/test/java/io/prometheus/client/spring/web/MethodTimerAppTest.java @@ -0,0 +1,23 @@ +package io.prometheus.client.spring.web; + +import static org.junit.Assert.*; + +import org.springframework.stereotype.Controller; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.web.bind.annotation.RequestMapping; + +@ContextConfiguration +@EnablePrometheusTiming +class MethodTimerAppTest { + + @Controller + public static class MyController { + @RequestMapping("/") + @PrometheusTimeMethod(name = "prom_time_seconds", help = "time") + public void waitJustAGoshDarnSecond() throws Exception { + Thread.sleep(1000); + } + } + + public static class MyConfig {} +} diff --git a/simpleclient-archive/simpleclient_spring_web/src/test/java/io/prometheus/client/spring/web/MethodTimerTest.java b/simpleclient-archive/simpleclient_spring_web/src/test/java/io/prometheus/client/spring/web/MethodTimerTest.java new file mode 100644 index 000000000..4130b2ff9 --- /dev/null +++ b/simpleclient-archive/simpleclient_spring_web/src/test/java/io/prometheus/client/spring/web/MethodTimerTest.java @@ -0,0 +1,247 @@ +package io.prometheus.client.spring.web; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import io.prometheus.client.Collector; +import io.prometheus.client.CollectorRegistry; +import java.util.Enumeration; +import org.junit.Assert; +import org.junit.Test; +import org.springframework.aop.aspectj.annotation.AspectJProxyFactory; + +class MethodTimerTest { + private interface Timeable { + void timeMe() throws Exception; + } + + private final class TestClass implements Timeable { + @PrometheusTimeMethod(name = "test_class", help = "help one") + public void timeMe() throws Exception { + Thread.sleep(20); + } + } + + private class TestCglibClassParent implements Timeable { + @PrometheusTimeMethod(name = "test_sub_class", help = "help one sub") + public void timeMe() throws Exception { + Thread.sleep(20); + } + } + + /** mock cglib proxy by subclass and in this class don't contain timMe() method */ + private final class MockCglibProxyTestClass extends TestCglibClassParent {} + + private interface Time2 { + void timeMe() throws Exception; + + void aSecondMethod() throws Exception; + } + + @Test + public void timeMethodInSubClassModel() throws Exception { + Timeable cprime = new MockCglibProxyTestClass(); + AspectJProxyFactory factory = new AspectJProxyFactory(cprime); + factory.addAspect(MethodTimer.class); + Timeable proxy = factory.getProxy(); + + proxy.timeMe(); + + final Double tot = CollectorRegistry.defaultRegistry.getSampleValue("test_sub_class_sum"); + Assert.assertNotNull(tot); + assertEquals(0.02, tot, 0.01); + } + + @Test + public void timeMethod() throws Exception { + Timeable cprime = new TestClass(); + AspectJProxyFactory factory = new AspectJProxyFactory(cprime); + factory.addAspect(MethodTimer.class); + Timeable proxy = factory.getProxy(); + + proxy.timeMe(); + + final Double tot = CollectorRegistry.defaultRegistry.getSampleValue("test_class_sum"); + Assert.assertNotNull(tot); + assertEquals(0.02, tot, 0.01); + } + + T getProxy(T source) { + AspectJProxyFactory factory = new AspectJProxyFactory(source); + factory.addAspect(MethodTimer.class); + return factory.getProxy(); + } + + @Test + public void testValueParam() throws Exception { + final String name = "foobar"; + Time2 a = + getProxy( + new Time2() { + @PrometheusTimeMethod(name = name, help = "help") + @Override + public void timeMe() throws Exception { + Thread.sleep(35); + } + + @Override + public void aSecondMethod() throws Exception {} + }); + + a.timeMe(); + + final Double tot = CollectorRegistry.defaultRegistry.getSampleValue(name + "_sum"); + assertEquals(0.035, tot, 0.01); + + a.timeMe(); + a.timeMe(); + a.timeMe(); + final Double tot2 = CollectorRegistry.defaultRegistry.getSampleValue(name + "_sum"); + assertEquals(0.035 * 4, tot2, 0.1); + } + + @Test + public void testHelpParam() throws Exception { + final String name = "foo"; + final String help = "help"; + + Time2 a = + getProxy( + new Time2() { + @Override + @PrometheusTimeMethod(name = name, help = help) + public void timeMe() throws Exception { + Thread.sleep(100); + } + + @Override + public void aSecondMethod() throws Exception {} + }); + + a.timeMe(); + + final Enumeration samples = + CollectorRegistry.defaultRegistry.metricFamilySamples(); + + Collector.MetricFamilySamples sample = null; + while (samples.hasMoreElements()) { + sample = samples.nextElement(); + if (name.equals(sample.name)) { + break; + } + } + Assert.assertNotNull(sample); + assertEquals(help, sample.help); + } + + private class MyException extends Exception { + public MyException(String msg) { + super(msg); + } + } + + @Test + public void testThrowWorks() { + Time2 p = + getProxy( + new Time2() { + @Override + @PrometheusTimeMethod(name = "fooasdf", help = "bar") + public void timeMe() throws Exception { + Thread.sleep(10); + throw new MyException("Yo this is an exception"); + } + + @Override + public void aSecondMethod() throws Exception {} + }); + + MyException e = null; + + try { + p.timeMe(); + } catch (Exception e1) { + e = (MyException) e1; + } + + final Double tot = CollectorRegistry.defaultRegistry.getSampleValue("fooasdf_sum"); + assertEquals(0.01, tot, 0.01); + assert (e != null); + } + + @Test + public void testSecondMethod() throws Exception { + final int sleepTime = 90, misnamedSleepTime = 10; + + Time2 p = + getProxy( + new Time2() { + @Override + @PrometheusTimeMethod(name = "fooasdf2", help = "bar") + public void timeMe() throws Exception { + Thread.sleep(misnamedSleepTime); + } + + @Override + @PrometheusTimeMethod(name = "second_method_name_seconds", help = "help two") + public void aSecondMethod() throws Exception { + Thread.sleep(sleepTime); + } + }); + + p.timeMe(); + + int count = 5; + for (int i = 0; i < count; i++) { + p.aSecondMethod(); + } + + final Double misnamedTotal = CollectorRegistry.defaultRegistry.getSampleValue("fooasdf2_sum"); + final Double total = + CollectorRegistry.defaultRegistry.getSampleValue("second_method_name_seconds_sum"); + + assertNotNull(total); + assertEquals(0.001 * count * sleepTime, total, 0.1); + + assertNotNull(misnamedTotal); + assertEquals(0.001 * misnamedSleepTime, misnamedTotal, 0.01); + } + + private interface SameMethodNameTest { + void doSomething() throws Exception; + + void doSomething(String s) throws Exception; + } + + @Test + public void testOverloadedMethodName() throws Exception { + final int sleep1 = 100, sleep2 = 200; + + SameMethodNameTest r = + getProxy( + new SameMethodNameTest() { + @Override + @PrometheusTimeMethod(name = "dosomething_one_test_seconds", help = "halp") + public void doSomething() throws Exception { + Thread.sleep(sleep1); + } + + @Override + @PrometheusTimeMethod(name = "dosomething_two_test_seconds", help = "also halp") + public void doSomething(String s) throws Exception { + Thread.sleep(sleep2); + } + }); + + r.doSomething(); + r.doSomething("foobar"); + + final Double tot1 = + CollectorRegistry.defaultRegistry.getSampleValue("dosomething_one_test_seconds_sum"); + final Double tot2 = + CollectorRegistry.defaultRegistry.getSampleValue("dosomething_two_test_seconds_sum"); + + assertEquals(.001 * sleep2, tot2, .01); + assertEquals(.001 * sleep1, tot1, .01); + } +} diff --git a/simpleclient-archive/simpleclient_spring_web/version-rules.xml b/simpleclient-archive/simpleclient_spring_web/version-rules.xml new file mode 100644 index 000000000..056c9c580 --- /dev/null +++ b/simpleclient-archive/simpleclient_spring_web/version-rules.xml @@ -0,0 +1,12 @@ + + + + + + [^4].* + + + + diff --git a/simpleclient-archive/simpleclient_vertx/pom.xml b/simpleclient-archive/simpleclient_vertx/pom.xml new file mode 100644 index 000000000..e8442d36a --- /dev/null +++ b/simpleclient-archive/simpleclient_vertx/pom.xml @@ -0,0 +1,42 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.0.0-beta-2-SNAPSHOT + + + simpleclient_vertx + bundle + + Prometheus Java Simpleclient Vert.x 3 + + Vert.x 3 Web Handler exporter for the simpleclient. + + + + UTF-8 + + + + + io.prometheus + simpleclient + ${project.version} + + + io.prometheus + simpleclient_common + ${project.version} + + + io.vertx + vertx-web + 3.9.13 + provided + + + diff --git a/simpleclient_vertx/src/main/java/io/prometheus/client/vertx/MetricsHandler.java b/simpleclient-archive/simpleclient_vertx/src/main/java/io/prometheus/client/vertx/MetricsHandler.java similarity index 65% rename from simpleclient_vertx/src/main/java/io/prometheus/client/vertx/MetricsHandler.java rename to simpleclient-archive/simpleclient_vertx/src/main/java/io/prometheus/client/vertx/MetricsHandler.java index 4f763a541..c32579ae4 100644 --- a/simpleclient_vertx/src/main/java/io/prometheus/client/vertx/MetricsHandler.java +++ b/simpleclient-archive/simpleclient_vertx/src/main/java/io/prometheus/client/vertx/MetricsHandler.java @@ -6,29 +6,24 @@ import io.vertx.core.buffer.Buffer; import io.vertx.core.http.HttpServerRequest; import io.vertx.ext.web.RoutingContext; - import java.io.IOException; import java.io.Writer; -import java.util.Arrays; import java.util.HashSet; import java.util.Set; /** * Metrics Handler for Vert.x Web. - *

    - * This handler will allow the usage of Prometheus Client Java API with - * Vert.x applications and expose a API compatible handler for the collector. - *

    - * Usage: - *

    - * router.route("/metrics").handler(new MetricsHandler()); + * + *

    This handler will allow the usage of Prometheus Client Java API with Vert.x applications and + * expose a API compatible handler for the collector. + * + *

    Usage: + * + *

    router.route("/metrics").handler(new MetricsHandler()); */ public class MetricsHandler implements Handler { - /** - * Wrap a Vert.x Buffer as a Writer so it can be used with - * TextFormat writer - */ + /** Wrap a Vert.x Buffer as a Writer so it can be used with TextFormat writer */ private static class BufferWriter extends Writer { private final Buffer buffer = Buffer.buffer(); @@ -55,16 +50,12 @@ Buffer getBuffer() { private CollectorRegistry registry; - /** - * Construct a MetricsHandler for the default registry. - */ + /** Construct a MetricsHandler for the default registry. */ public MetricsHandler() { this(CollectorRegistry.defaultRegistry); } - /** - * Construct a MetricsHandler for the given registry. - */ + /** Construct a MetricsHandler for the given registry. */ public MetricsHandler(CollectorRegistry registry) { this.registry = registry; } @@ -73,11 +64,14 @@ public MetricsHandler(CollectorRegistry registry) { public void handle(RoutingContext ctx) { try { final BufferWriter writer = new BufferWriter(); - TextFormat.write004(writer, registry.filteredMetricFamilySamples(parse(ctx.request()))); + String contentType = TextFormat.chooseContentType(ctx.request().headers().get("Accept")); + + TextFormat.writeFormat( + contentType, writer, registry.filteredMetricFamilySamples(parse(ctx.request()))); ctx.response() - .setStatusCode(200) - .putHeader("Content-Type", TextFormat.CONTENT_TYPE_004) - .end(writer.getBuffer()); + .setStatusCode(200) + .putHeader("Content-Type", contentType) + .end(writer.getBuffer()); } catch (IOException e) { ctx.fail(e); } diff --git a/simpleclient_vertx/src/test/java/io/prometheus/client/vertx/ExampleExporter.java b/simpleclient-archive/simpleclient_vertx/src/test/java/io/prometheus/client/vertx/ExampleExporter.java similarity index 95% rename from simpleclient_vertx/src/test/java/io/prometheus/client/vertx/ExampleExporter.java rename to simpleclient-archive/simpleclient_vertx/src/test/java/io/prometheus/client/vertx/ExampleExporter.java index c00c012b4..552322a94 100644 --- a/simpleclient_vertx/src/test/java/io/prometheus/client/vertx/ExampleExporter.java +++ b/simpleclient-archive/simpleclient_vertx/src/test/java/io/prometheus/client/vertx/ExampleExporter.java @@ -4,7 +4,6 @@ import io.prometheus.client.Gauge; import io.prometheus.client.Histogram; import io.prometheus.client.Summary; -import io.prometheus.client.vertx.MetricsHandler; import io.vertx.core.Vertx; import io.vertx.ext.web.Router; diff --git a/simpleclient_vertx/src/test/java/io/prometheus/client/vertx/MetricsHandlerTest.java b/simpleclient-archive/simpleclient_vertx/src/test/java/io/prometheus/client/vertx/MetricsHandlerTest.java similarity index 85% rename from simpleclient_vertx/src/test/java/io/prometheus/client/vertx/MetricsHandlerTest.java rename to simpleclient-archive/simpleclient_vertx/src/test/java/io/prometheus/client/vertx/MetricsHandlerTest.java index d4d51a5fc..32e3b12d8 100644 --- a/simpleclient_vertx/src/test/java/io/prometheus/client/vertx/MetricsHandlerTest.java +++ b/simpleclient-archive/simpleclient_vertx/src/test/java/io/prometheus/client/vertx/MetricsHandlerTest.java @@ -1,23 +1,22 @@ package io.prometheus.client.vertx; +import static org.assertj.core.api.Assertions.assertThat; + import io.prometheus.client.CollectorRegistry; import io.prometheus.client.Gauge; import io.vertx.core.Vertx; import io.vertx.ext.web.Router; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - import java.io.IOException; import java.net.ServerSocket; import java.net.URL; import java.util.Scanner; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; -import static org.assertj.core.api.Assertions.assertThat; - -public class MetricsHandlerTest { +class MetricsHandlerTest { private static Vertx vertx; private static Integer port; @@ -27,7 +26,6 @@ public class MetricsHandlerTest { public static void setUp() throws Throwable { Semaphore s = new Semaphore(1); - vertx = Vertx.vertx(); final Vertx vertx = Vertx.vertx(); final Router router = Router.router(vertx); @@ -35,18 +33,19 @@ public static void setUp() throws Throwable { registry = new CollectorRegistry(); router.route("/metrics").handler(new MetricsHandler(registry)); - router.route("/test").handler(routingContext -> { - routingContext.response().putHeader("content-type", "text").end("Hello World!"); - }); + router + .route("/test") + .handler( + routingContext -> { + routingContext.response().putHeader("content-type", "text").end("Hello World!"); + }); ServerSocket socket = new ServerSocket(0); port = socket.getLocalPort(); socket.close(); s.acquire(); - vertx.createHttpServer().requestHandler(router::accept).listen(port, - event -> s.release() - ); + vertx.createHttpServer().requestHandler(router::accept).listen(port, event -> s.release()); s.tryAcquire(10, TimeUnit.SECONDS); @@ -78,9 +77,9 @@ public void metricsRequest_shouldAllowFilteringMetrics() throws IOException { assertThat(out).contains("c 0.0"); } - private String makeRequest(String url) throws IOException { - Scanner scanner = new Scanner(new URL("http://localhost:" + port + url).openStream(), "UTF-8") + Scanner scanner = + new Scanner(new URL("http://localhost:" + port + url).openStream(), "UTF-8") .useDelimiter("\\A"); String out = scanner.next(); scanner.close(); diff --git a/simpleclient-archive/simpleclient_vertx/version-rules.xml b/simpleclient-archive/simpleclient_vertx/version-rules.xml new file mode 100644 index 000000000..fe1ce92e5 --- /dev/null +++ b/simpleclient-archive/simpleclient_vertx/version-rules.xml @@ -0,0 +1,12 @@ + + + + + + [^3].* + + + + diff --git a/simpleclient-archive/simpleclient_vertx4/pom.xml b/simpleclient-archive/simpleclient_vertx4/pom.xml new file mode 100644 index 000000000..0cc06340e --- /dev/null +++ b/simpleclient-archive/simpleclient_vertx4/pom.xml @@ -0,0 +1,42 @@ + + + 4.0.0 + + + io.prometheus + client_java + 1.0.0-beta-2-SNAPSHOT + + + simpleclient_vertx4 + bundle + + Prometheus Java Simpleclient Vert.x 4 + + Vert.x 4 Web Handler exporter for the simpleclient. + + + + UTF-8 + + + + + io.prometheus + simpleclient + ${project.version} + + + io.prometheus + simpleclient_common + ${project.version} + + + io.vertx + vertx-web + 4.3.1 + provided + + + diff --git a/simpleclient-archive/simpleclient_vertx4/src/main/java/io/prometheus/client/vertx/MetricsHandler.java b/simpleclient-archive/simpleclient_vertx4/src/main/java/io/prometheus/client/vertx/MetricsHandler.java new file mode 100644 index 000000000..c32579ae4 --- /dev/null +++ b/simpleclient-archive/simpleclient_vertx4/src/main/java/io/prometheus/client/vertx/MetricsHandler.java @@ -0,0 +1,83 @@ +package io.prometheus.client.vertx; + +import io.prometheus.client.CollectorRegistry; +import io.prometheus.client.exporter.common.TextFormat; +import io.vertx.core.Handler; +import io.vertx.core.buffer.Buffer; +import io.vertx.core.http.HttpServerRequest; +import io.vertx.ext.web.RoutingContext; +import java.io.IOException; +import java.io.Writer; +import java.util.HashSet; +import java.util.Set; + +/** + * Metrics Handler for Vert.x Web. + * + *

    This handler will allow the usage of Prometheus Client Java API with Vert.x applications and + * expose a API compatible handler for the collector. + * + *

    Usage: + * + *

    router.route("/metrics").handler(new MetricsHandler()); + */ +public class MetricsHandler implements Handler { + + /** Wrap a Vert.x Buffer as a Writer so it can be used with TextFormat writer */ + private static class BufferWriter extends Writer { + + private final Buffer buffer = Buffer.buffer(); + + @Override + public void write(char[] cbuf, int off, int len) throws IOException { + buffer.appendString(new String(cbuf, off, len)); + } + + @Override + public void flush() throws IOException { + // NO-OP + } + + @Override + public void close() throws IOException { + // NO-OP + } + + Buffer getBuffer() { + return buffer; + } + } + + private CollectorRegistry registry; + + /** Construct a MetricsHandler for the default registry. */ + public MetricsHandler() { + this(CollectorRegistry.defaultRegistry); + } + + /** Construct a MetricsHandler for the given registry. */ + public MetricsHandler(CollectorRegistry registry) { + this.registry = registry; + } + + @Override + public void handle(RoutingContext ctx) { + try { + final BufferWriter writer = new BufferWriter(); + String contentType = TextFormat.chooseContentType(ctx.request().headers().get("Accept")); + + TextFormat.writeFormat( + contentType, writer, registry.filteredMetricFamilySamples(parse(ctx.request()))); + ctx.response() + .setStatusCode(200) + .putHeader("Content-Type", contentType) + .end(writer.getBuffer()); + } catch (IOException e) { + ctx.fail(e); + } + } + + private Set parse(HttpServerRequest request) { + return new HashSet(request.params().getAll("name[]")); + } +} diff --git a/simpleclient-archive/simpleclient_vertx4/src/test/java/io/prometheus/client/vertx/ExampleExporter.java b/simpleclient-archive/simpleclient_vertx4/src/test/java/io/prometheus/client/vertx/ExampleExporter.java new file mode 100644 index 000000000..caeefb6ff --- /dev/null +++ b/simpleclient-archive/simpleclient_vertx4/src/test/java/io/prometheus/client/vertx/ExampleExporter.java @@ -0,0 +1,32 @@ +package io.prometheus.client.vertx; + +import io.prometheus.client.Counter; +import io.prometheus.client.Gauge; +import io.prometheus.client.Histogram; +import io.prometheus.client.Summary; +import io.vertx.core.Vertx; +import io.vertx.ext.web.Router; + +public class ExampleExporter { + + static final Gauge g = Gauge.build().name("gauge").help("blah").register(); + static final Counter c = Counter.build().name("counter").help("meh").register(); + static final Summary s = Summary.build().name("summary").help("meh").register(); + static final Histogram h = Histogram.build().name("histogram").help("meh").register(); + static final Gauge l = Gauge.build().name("labels").help("blah").labelNames("l").register(); + + public static void main(String[] args) throws Exception { + final Vertx vertx = Vertx.vertx(); + final Router router = Router.router(vertx); + + router.route("/metrics").handler(new MetricsHandler()); + + vertx.createHttpServer().requestHandler(router).listen(1234); + + g.set(1); + c.inc(2); + s.observe(3); + h.observe(4); + l.labels("foo").inc(5); + } +} diff --git a/simpleclient-archive/simpleclient_vertx4/src/test/java/io/prometheus/client/vertx/MetricsHandlerTest.java b/simpleclient-archive/simpleclient_vertx4/src/test/java/io/prometheus/client/vertx/MetricsHandlerTest.java new file mode 100644 index 000000000..b26d40ffe --- /dev/null +++ b/simpleclient-archive/simpleclient_vertx4/src/test/java/io/prometheus/client/vertx/MetricsHandlerTest.java @@ -0,0 +1,88 @@ +package io.prometheus.client.vertx; + +import static org.assertj.core.api.Assertions.assertThat; + +import io.prometheus.client.CollectorRegistry; +import io.prometheus.client.Gauge; +import io.vertx.core.Vertx; +import io.vertx.ext.web.Router; +import java.io.IOException; +import java.net.ServerSocket; +import java.net.URL; +import java.util.Scanner; +import java.util.concurrent.Semaphore; +import java.util.concurrent.TimeUnit; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +class MetricsHandlerTest { + + private static Vertx vertx; + private static Integer port; + private static CollectorRegistry registry; + + @BeforeClass + public static void setUp() throws Throwable { + Semaphore s = new Semaphore(1); + + vertx = Vertx.vertx(); + final Vertx vertx = Vertx.vertx(); + final Router router = Router.router(vertx); + + registry = new CollectorRegistry(); + router.route("/metrics").handler(new MetricsHandler(registry)); + + router + .route("/test") + .handler( + routingContext -> { + routingContext.response().putHeader("content-type", "text").end("Hello World!"); + }); + + ServerSocket socket = new ServerSocket(0); + port = socket.getLocalPort(); + socket.close(); + + s.acquire(); + vertx.createHttpServer().requestHandler(router).listen(port, event -> s.release()); + + s.tryAcquire(10, TimeUnit.SECONDS); + + Gauge.build("a", "a help").register(registry); + Gauge.build("b", "b help").register(registry); + Gauge.build("c", "c help").register(registry); + } + + @AfterClass + public static void tearDown() { + vertx.close(); + } + + @Test + public void metricsRequest_shouldReturnMetrics() throws IOException { + String out = makeRequest("/metrics"); + + assertThat(out).contains("a 0.0"); + assertThat(out).contains("b 0.0"); + assertThat(out).contains("c 0.0"); + } + + @Test + public void metricsRequest_shouldAllowFilteringMetrics() throws IOException { + String out = makeRequest("/metrics?name[]=b&name[]=c"); + + assertThat(out).doesNotContain("a 0.0"); + assertThat(out).contains("b 0.0"); + assertThat(out).contains("c 0.0"); + } + + private String makeRequest(String url) throws IOException { + Scanner scanner = + new Scanner(new URL("http://localhost:" + port + url).openStream(), "UTF-8") + .useDelimiter("\\A"); + String out = scanner.next(); + scanner.close(); + return out; + } +} diff --git a/simpleclient-archive/simpleclient_vertx4/version-rules.xml b/simpleclient-archive/simpleclient_vertx4/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/simpleclient-archive/simpleclient_vertx4/version-rules.xml @@ -0,0 +1,6 @@ + + + + diff --git a/simpleclient/pom.xml b/simpleclient/pom.xml deleted file mode 100644 index e102bb988..000000000 --- a/simpleclient/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - 4.0.0 - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient - bundle - - Prometheus Java Simpleclient - - Core instrumentation library for the simpleclient. - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - brian-brazil - Brian Brazil - brian.brazil@boxever.com - - - - - - - - - junit - junit - 4.11 - test - - - diff --git a/simpleclient/src/main/java/io/prometheus/client/CKMSQuantiles.java b/simpleclient/src/main/java/io/prometheus/client/CKMSQuantiles.java deleted file mode 100644 index 1ffb65382..000000000 --- a/simpleclient/src/main/java/io/prometheus/client/CKMSQuantiles.java +++ /dev/null @@ -1,293 +0,0 @@ -package io.prometheus.client; - -// Copied from https://raw.githubusercontent.com/Netflix/ocelli/master/ocelli-core/src/main/java/netflix/ocelli/stats/CKMSQuantiles.java -// Revision d0357b8bf5c17a173ce94d6b26823775b3f999f6 from Jan 21, 2015. -// -// This is the original code except for the following modifications: -// -// - Changed the type of the observed values from int to double. -// - Removed the Quantiles interface and corresponding @Override annotations. -// - Changed the package name. -// - Make get() return NaN when no sample was observed. -// - Make class package private - -/* - Copyright 2012 Andrew Wang (andrew@umbrant.com) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -import java.util.Arrays; -import java.util.LinkedList; -import java.util.ListIterator; - -/** - * Implementation of the Cormode, Korn, Muthukrishnan, and Srivastava algorithm - * for streaming calculation of targeted high-percentile epsilon-approximate - * quantiles. - * - * This is a generalization of the earlier work by Greenwald and Khanna (GK), - * which essentially allows different error bounds on the targeted quantiles, - * which allows for far more efficient calculation of high-percentiles. - * - * - * See: Cormode, Korn, Muthukrishnan, and Srivastava - * "Effective Computation of Biased Quantiles over Data Streams" in ICDE 2005 - * - * Greenwald and Khanna, - * "Space-efficient online computation of quantile summaries" in SIGMOD 2001 - * - */ -class CKMSQuantiles { - /** - * Total number of items in stream. - */ - private int count = 0; - - /** - * Used for tracking incremental compression. - */ - private int compressIdx = 0; - - /** - * Current list of sampled items, maintained in sorted order with error - * bounds. - */ - protected LinkedList sample; - - /** - * Buffers incoming items to be inserted in batch. - */ - private double[] buffer = new double[500]; - - private int bufferCount = 0; - - /** - * Array of Quantiles that we care about, along with desired error. - */ - private final Quantile quantiles[]; - - public CKMSQuantiles(Quantile[] quantiles) { - this.quantiles = quantiles; - this.sample = new LinkedList(); - } - - /** - * Add a new value from the stream. - * - * @param value - */ - public void insert(double value) { - buffer[bufferCount] = value; - bufferCount++; - - if (bufferCount == buffer.length) { - insertBatch(); - compress(); - } - } - - /** - * Get the estimated value at the specified quantile. - * - * @param q - * Queried quantile, e.g. 0.50 or 0.99. - * @return Estimated value at that quantile. - */ - public double get(double q) { - // clear the buffer - insertBatch(); - compress(); - - if (sample.size() == 0) { - return Double.NaN; - } - - int rankMin = 0; - int desired = (int) (q * count); - - ListIterator it = sample.listIterator(); - Item prev, cur; - cur = it.next(); - while (it.hasNext()) { - prev = cur; - cur = it.next(); - - rankMin += prev.g; - - if (rankMin + cur.g + cur.delta > desired - + (allowableError(desired) / 2)) { - return prev.value; - } - } - - // edge case of wanting max value - return sample.getLast().value; - } - - /** - * Specifies the allowable error for this rank, depending on which quantiles - * are being targeted. - * - * This is the f(r_i, n) function from the CKMS paper. It's basically how - * wide the range of this rank can be. - * - * @param rank - * the index in the list of samples - */ - private double allowableError(int rank) { - // NOTE: according to CKMS, this should be count, not size, but this - // leads - // to error larger than the error bounds. Leaving it like this is - // essentially a HACK, and blows up memory, but does "work". - // int size = count; - int size = sample.size(); - double minError = size + 1; - - for (Quantile q : quantiles) { - double error; - if (rank <= q.quantile * size) { - error = q.u * (size - rank); - } else { - error = q.v * rank; - } - if (error < minError) { - minError = error; - } - } - - return minError; - } - - private boolean insertBatch() { - if (bufferCount == 0) { - return false; - } - - Arrays.sort(buffer, 0, bufferCount); - - // Base case: no samples - int start = 0; - if (sample.size() == 0) { - Item newItem = new Item(buffer[0], 1, 0); - sample.add(newItem); - start++; - count++; - } - - ListIterator it = sample.listIterator(); - Item item = it.next(); - - for (int i = start; i < bufferCount; i++) { - double v = buffer[i]; - while (it.nextIndex() < sample.size() && item.value < v) { - item = it.next(); - } - - // If we found that bigger item, back up so we insert ourselves - // before it - if (item.value > v) { - it.previous(); - } - - // We use different indexes for the edge comparisons, because of the - // above - // if statement that adjusts the iterator - int delta; - if (it.previousIndex() == 0 || it.nextIndex() == sample.size()) { - delta = 0; - } - else { - delta = ((int) Math.floor(allowableError(it.nextIndex()))) - 1; - } - - Item newItem = new Item(v, 1, delta); - it.add(newItem); - count++; - item = newItem; - } - - bufferCount = 0; - return true; - } - - /** - * Try to remove extraneous items from the set of sampled items. This checks - * if an item is unnecessary based on the desired error bounds, and merges - * it with the adjacent item if it is. - */ - private void compress() { - if (sample.size() < 2) { - return; - } - - ListIterator it = sample.listIterator(); - int removed = 0; - - Item prev = null; - Item next = it.next(); - - while (it.hasNext()) { - prev = next; - next = it.next(); - - if (prev.g + next.g + next.delta <= allowableError(it.previousIndex())) { - next.g += prev.g; - // Remove prev. it.remove() kills the last thing returned. - it.previous(); - it.previous(); - it.remove(); - // it.next() is now equal to next, skip it back forward again - it.next(); - removed++; - } - } - } - - private class Item { - public final double value; - public int g; - public final int delta; - - public Item(double value, int lower_delta, int delta) { - this.value = value; - this.g = lower_delta; - this.delta = delta; - } - - @Override - public String toString() { - return String.format("I{val=%.3f, g=%d, del=%d}", value, g, delta); - } - } - - public static class Quantile { - public final double quantile; - public final double error; - public final double u; - public final double v; - - public Quantile(double quantile, double error) { - this.quantile = quantile; - this.error = error; - u = 2.0 * error / (1.0 - quantile); - v = 2.0 * error / quantile; - } - - @Override - public String toString() { - return String.format("Q{q=%.3f, eps=%.3f}", quantile, error); - } - } - -} diff --git a/simpleclient/src/main/java/io/prometheus/client/Collector.java b/simpleclient/src/main/java/io/prometheus/client/Collector.java deleted file mode 100644 index 2d90cc8cc..000000000 --- a/simpleclient/src/main/java/io/prometheus/client/Collector.java +++ /dev/null @@ -1,225 +0,0 @@ - -package io.prometheus.client; - -import java.util.List; -import java.util.regex.Pattern; - -/** - * A collector for a set of metrics. - *

    - * Normal users should use {@link Gauge}, {@link Counter}, {@link Summary} and {@link Histogram}. - *

    - * Subclasssing Collector is for advanced uses, such as proxying metrics from another monitoring system. - * It is it the responsibility of subclasses to ensure they produce valid metrics. - * @see Exposition formats. - */ -public abstract class Collector { - /** - * Return all of the metrics of this Collector. - */ - public abstract List collect(); - public enum Type { - COUNTER, - GAUGE, - SUMMARY, - HISTOGRAM, - UNTYPED, - } - - /** - * A metric, and all of its samples. - */ - static public class MetricFamilySamples { - public final String name; - public final Type type; - public final String help; - public final List samples; - - public MetricFamilySamples(String name, Type type, String help, List samples) { - this.name = name; - this.type = type; - this.help = help; - this.samples = samples; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof MetricFamilySamples)) { - return false; - } - MetricFamilySamples other = (MetricFamilySamples) obj; - - return other.name.equals(name) && other.type.equals(type) - && other.help.equals(help) && other.samples.equals(samples) ; - } - - @Override - public int hashCode() { - int hash = 1; - hash = 37 * hash + name.hashCode(); - hash = 37 * hash + type.hashCode(); - hash = 37 * hash + help.hashCode(); - hash = 37 * hash + samples.hashCode(); - return hash; - } - - @Override - public String toString() { - return "Name: " + name + " Type: " + type + " Help: " + help + - " Samples: " + samples; - } - - /** - * A single Sample, with a unique name and set of labels. - */ - public static class Sample { - public final String name; - public final List labelNames; - public final List labelValues; // Must have same length as labelNames. - public final double value; - public final Long timestampMs; // It's an epoch format with milliseconds value included (this field is subject to change). - - public Sample(String name, List labelNames, List labelValues, double value, Long timestampMs) { - this.name = name; - this.labelNames = labelNames; - this.labelValues = labelValues; - this.value = value; - this.timestampMs = timestampMs; - } - - public Sample(String name, List labelNames, List labelValues, double value) { - this(name, labelNames, labelValues, value, null); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof Sample)) { - return false; - } - Sample other = (Sample) obj; - - return other.name.equals(name) && other.labelNames.equals(labelNames) - && other.labelValues.equals(labelValues) && other.value == value - && ((timestampMs == null && other.timestampMs == null) || (other.timestampMs != null) && (other.timestampMs.equals(timestampMs))); - } - - @Override - public int hashCode() { - int hash = 1; - hash = 37 * hash + name.hashCode(); - hash = 37 * hash + labelNames.hashCode(); - hash = 37 * hash + labelValues.hashCode(); - long d = Double.doubleToLongBits(value); - hash = 37 * hash + (int)(d ^ (d >>> 32)); - if (timestampMs != null) { - hash = 37 * hash + timestampMs.hashCode(); - } - return hash; - } - - @Override - public String toString() { - return "Name: " + name + " LabelNames: " + labelNames + " labelValues: " + labelValues + - " Value: " + value + " TimestampMs: " + timestampMs; - } - } - } - - /** - * Register the Collector with the default registry. - */ - public T register() { - return register(CollectorRegistry.defaultRegistry); - } - - /** - * Register the Collector with the given registry. - */ - public T register(CollectorRegistry registry) { - registry.register(this); - return (T)this; - } - - public interface Describable { - /** - * Provide a list of metric families this Collector is expected to return. - * - * These should exclude the samples. This is used by the registry to - * detect collisions and duplicate registrations. - * - * Usually custom collectors do not have to implement Describable. If - * Describable is not implemented and the CollectorRegistry was created - * with auto describe enabled (which is the case for the default registry) - * then {@link collect} will be called at registration time instead of - * describe. If this could cause problems, either implement a proper - * describe, or if that's not practical have describe return an empty - * list. - */ - List describe(); - } - - - /* Various utility functions for implementing Collectors. */ - - /** - * Number of nanoseconds in a second. - */ - public static final double NANOSECONDS_PER_SECOND = 1E9; - /** - * Number of milliseconds in a second. - */ - public static final double MILLISECONDS_PER_SECOND = 1E3; - - private static final Pattern METRIC_NAME_RE = Pattern.compile("[a-zA-Z_:][a-zA-Z0-9_:]*"); - private static final Pattern METRIC_LABEL_NAME_RE = Pattern.compile("[a-zA-Z_][a-zA-Z0-9_]*"); - private static final Pattern RESERVED_METRIC_LABEL_NAME_RE = Pattern.compile("__.*"); - - /** - * Throw an exception if the metric name is invalid. - */ - protected static void checkMetricName(String name) { - if (!METRIC_NAME_RE.matcher(name).matches()) { - throw new IllegalArgumentException("Invalid metric name: " + name); - } - } - - private static final Pattern SANITIZE_PREFIX_PATTERN = Pattern.compile("^[^a-zA-Z_]"); - private static final Pattern SANITIZE_BODY_PATTERN = Pattern.compile("[^a-zA-Z0-9_]"); - - /** - * Sanitize metric name - */ - public static String sanitizeMetricName(String metricName) { - return SANITIZE_BODY_PATTERN.matcher( - SANITIZE_PREFIX_PATTERN.matcher(metricName).replaceFirst("_") - ).replaceAll("_"); - } - - /** - * Throw an exception if the metric label name is invalid. - */ - protected static void checkMetricLabelName(String name) { - if (!METRIC_LABEL_NAME_RE.matcher(name).matches()) { - throw new IllegalArgumentException("Invalid metric label name: " + name); - } - if (RESERVED_METRIC_LABEL_NAME_RE.matcher(name).matches()) { - throw new IllegalArgumentException("Invalid metric label name, reserved for internal use: " + name); - } - } - - /** - * Convert a double to its string representation in Go. - */ - public static String doubleToGoString(double d) { - if (d == Double.POSITIVE_INFINITY) { - return "+Inf"; - } - if (d == Double.NEGATIVE_INFINITY) { - return "-Inf"; - } - if (Double.isNaN(d)) { - return "NaN"; - } - return Double.toString(d); - } -} diff --git a/simpleclient/src/main/java/io/prometheus/client/CollectorRegistry.java b/simpleclient/src/main/java/io/prometheus/client/CollectorRegistry.java deleted file mode 100644 index d2a12c95c..000000000 --- a/simpleclient/src/main/java/io/prometheus/client/CollectorRegistry.java +++ /dev/null @@ -1,259 +0,0 @@ -package io.prometheus.client; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Set; - -/** - * A registry of Collectors. - *

    - * The majority of users should use the {@link #defaultRegistry}, rather than instantiating their own. - *

    - * Creating a registry other than the default is primarily useful for unittests, or - * pushing a subset of metrics to the Pushgateway - * from batch jobs. - */ -public class CollectorRegistry { - /** - * The default registry. - */ - public static final CollectorRegistry defaultRegistry = new CollectorRegistry(true); - - private final Object namesCollectorsLock = new Object(); - private final Map> collectorsToNames = new HashMap>(); - private final Map namesToCollectors = new HashMap(); - - private final boolean autoDescribe; - - public CollectorRegistry() { - this(false); - } - - public CollectorRegistry(boolean autoDescribe) { - this.autoDescribe = autoDescribe; - } - - /** - * Register a Collector. - *

    - * A collector can be registered to multiple CollectorRegistries. - */ - public void register(Collector m) { - List names = collectorNames(m); - synchronized (namesCollectorsLock) { - for (String name : names) { - if (namesToCollectors.containsKey(name)) { - throw new IllegalArgumentException("Collector already registered that provides name: " + name); - } - } - for (String name : names) { - namesToCollectors.put(name, m); - } - collectorsToNames.put(m, names); - } - } - - /** - * Unregister a Collector. - */ - public void unregister(Collector m) { - synchronized (namesCollectorsLock) { - List names = collectorsToNames.remove(m); - for (String name : names) { - namesToCollectors.remove(name); - } - } - } - - /** - * Unregister all Collectors. - */ - public void clear() { - synchronized (namesCollectorsLock) { - collectorsToNames.clear(); - namesToCollectors.clear(); - } - } - - /** - * A snapshot of the current collectors. - */ - private Set collectors() { - synchronized (namesCollectorsLock) { - return new HashSet(collectorsToNames.keySet()); - } - } - - private List collectorNames(Collector m) { - List mfs; - if (m instanceof Collector.Describable) { - mfs = ((Collector.Describable) m).describe(); - } else if (autoDescribe) { - mfs = m.collect(); - } else { - mfs = Collections.emptyList(); - } - - List names = new ArrayList(); - for (Collector.MetricFamilySamples family : mfs) { - switch (family.type) { - case SUMMARY: - names.add(family.name + "_count"); - names.add(family.name + "_sum"); - names.add(family.name); - break; - case HISTOGRAM: - names.add(family.name + "_count"); - names.add(family.name + "_sum"); - names.add(family.name + "_bucket"); - names.add(family.name); - break; - default: - names.add(family.name); - } - } - return names; - } - - /** - * Enumeration of metrics of all registered collectors. - */ - public Enumeration metricFamilySamples() { - return new MetricFamilySamplesEnumeration(); - } - - /** - * Enumeration of metrics matching the specified names. - *

    - * Note that the provided set of names will be matched against the time series - * name and not the metric name. For instance, to retrieve all samples from a - * histogram, you must include the '_count', '_sum' and '_bucket' names. - */ - public Enumeration filteredMetricFamilySamples(Set includedNames) { - return new MetricFamilySamplesEnumeration(includedNames); - } - - class MetricFamilySamplesEnumeration implements Enumeration { - - private final Iterator collectorIter; - private Iterator metricFamilySamples; - private Collector.MetricFamilySamples next; - private Set includedNames; - - MetricFamilySamplesEnumeration(Set includedNames) { - this.includedNames = includedNames; - collectorIter = includedCollectorIterator(includedNames); - findNextElement(); - } - - private Iterator includedCollectorIterator(Set includedNames) { - if (includedNames.isEmpty()) { - return collectors().iterator(); - } else { - HashSet collectors = new HashSet(); - synchronized (namesCollectorsLock) { - for (Map.Entry entry : namesToCollectors.entrySet()) { - if (includedNames.contains(entry.getKey())) { - collectors.add(entry.getValue()); - } - } - } - - return collectors.iterator(); - } - } - - MetricFamilySamplesEnumeration() { - this(Collections.emptySet()); - } - - private void findNextElement() { - next = null; - - while (metricFamilySamples != null && metricFamilySamples.hasNext()) { - next = filter(metricFamilySamples.next()); - if (next != null) { - return; - } - } - - if (next == null) { - while (collectorIter.hasNext()) { - metricFamilySamples = collectorIter.next().collect().iterator(); - while (metricFamilySamples.hasNext()) { - next = filter(metricFamilySamples.next()); - if (next != null) { - return; - } - } - } - } - } - - private Collector.MetricFamilySamples filter(Collector.MetricFamilySamples next) { - if (includedNames.isEmpty()) { - return next; - } else { - Iterator it = next.samples.iterator(); - while (it.hasNext()) { - if (!includedNames.contains(it.next().name)) { - it.remove(); - } - } - if (next.samples.size() == 0) { - return null; - } - return next; - } - } - - public Collector.MetricFamilySamples nextElement() { - Collector.MetricFamilySamples current = next; - if (current == null) { - throw new NoSuchElementException(); - } - findNextElement(); - return current; - } - - public boolean hasMoreElements() { - return next != null; - } - } - - /** - * Returns the given value, or null if it doesn't exist. - *

    - * This is inefficient, and intended only for use in unittests. - */ - public Double getSampleValue(String name) { - return getSampleValue(name, new String[]{}, new String[]{}); - } - - /** - * Returns the given value, or null if it doesn't exist. - *

    - * This is inefficient, and intended only for use in unittests. - */ - public Double getSampleValue(String name, String[] labelNames, String[] labelValues) { - for (Collector.MetricFamilySamples metricFamilySamples : Collections.list(metricFamilySamples())) { - for (Collector.MetricFamilySamples.Sample sample : metricFamilySamples.samples) { - if (sample.name.equals(name) - && Arrays.equals(sample.labelNames.toArray(), labelNames) - && Arrays.equals(sample.labelValues.toArray(), labelValues)) { - return sample.value; - } - } - } - return null; - } - -} diff --git a/simpleclient/src/main/java/io/prometheus/client/Counter.java b/simpleclient/src/main/java/io/prometheus/client/Counter.java deleted file mode 100644 index 180a8d5c9..000000000 --- a/simpleclient/src/main/java/io/prometheus/client/Counter.java +++ /dev/null @@ -1,170 +0,0 @@ -package io.prometheus.client; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -/** - * Counter metric, to track counts of events or running totals. - *

    - * Example of Counters include: - *

      - *
    • Number of requests processed
    • - *
    • Number of items that were inserted into a queue
    • - *
    • Total amount of data a system has processed
    • - *
    - * - * Counters can only go up (and be reset), if your use case can go down you should use a {@link Gauge} instead. - * Use the rate() function in Prometheus to calculate the rate of increase of a Counter. - * By convention, the names of Counters are suffixed by _total. - * - *

    - * An example Counter: - *

    - * {@code
    - *   class YourClass {
    - *     static final Counter requests = Counter.build()
    - *         .name("requests_total").help("Total requests.").register();
    - *     static final Counter failedRequests = Counter.build()
    - *         .name("requests_failed_total").help("Total failed requests.").register();
    - *
    - *     void processRequest() {
    - *        requests.inc();
    - *        try {
    - *          // Your code here.
    - *        } catch (Exception e) {
    - *          failedRequests.inc();
    - *          throw e;
    - *        }
    - *     }
    - *   }
    - * }
    - * 
    - * - *

    - * You can also use labels to track different types of metric: - *

    - * {@code
    - *   class YourClass {
    - *     static final Counter requests = Counter.build()
    - *         .name("requests_total").help("Total requests.")
    - *         .labelNames("method").register();
    - *
    - *     void processGetRequest() {
    - *        requests.labels("get").inc();
    - *        // Your code here.
    - *     }
    - *     void processPostRequest() {
    - *        requests.labels("post").inc();
    - *        // Your code here.
    - *     }
    - *   }
    - * }
    - * 
    - * These can be aggregated and processed together much more easily in the Prometheus - * server than individual metrics for each labelset. - */ -public class Counter extends SimpleCollector implements Collector.Describable { - - Counter(Builder b) { - super(b); - } - - public static class Builder extends SimpleCollector.Builder { - @Override - public Counter create() { - return new Counter(this); - } - } - - /** - * Return a Builder to allow configuration of a new Counter. Ensures required fields are provided. - * - * @param name The name of the metric - * @param help The help string of the metric - */ - public static Builder build(String name, String help) { - return new Builder().name(name).help(help); - } - - /** - * Return a Builder to allow configuration of a new Counter. - */ - public static Builder build() { - return new Builder(); - } - - @Override - protected Child newChild() { - return new Child(); - } - - /** - * The value of a single Counter. - *

    - * Warning: References to a Child become invalid after using - * {@link SimpleCollector#remove} or {@link SimpleCollector#clear}, - */ - public static class Child { - private final DoubleAdder value = new DoubleAdder(); - /** - * Increment the counter by 1. - */ - public void inc() { - inc(1); - } - /** - * Increment the counter by the given amount. - * @throws IllegalArgumentException If amt is negative. - */ - public void inc(double amt) { - if (amt < 0) { - throw new IllegalArgumentException("Amount to increment must be non-negative."); - } - value.add(amt); - } - /** - * Get the value of the counter. - */ - public double get() { - return value.sum(); - } - } - - // Convenience methods. - /** - * Increment the counter with no labels by 1. - */ - public void inc() { - inc(1); - } - /** - * Increment the counter with no labels by the given amount. - * @throws IllegalArgumentException If amt is negative. - */ - public void inc(double amt) { - noLabelsChild.inc(amt); - } - - /** - * Get the value of the counter. - */ - public double get() { - return noLabelsChild.get(); - } - - @Override - public List collect() { - List samples = new ArrayList(children.size()); - for(Map.Entry, Child> c: children.entrySet()) { - samples.add(new MetricFamilySamples.Sample(fullname, labelNames, c.getKey(), c.getValue().get())); - } - return familySamplesList(Type.COUNTER, samples); - } - - @Override - public List describe() { - return Collections.singletonList(new CounterMetricFamily(fullname, help, labelNames)); - } -} diff --git a/simpleclient/src/main/java/io/prometheus/client/CounterMetricFamily.java b/simpleclient/src/main/java/io/prometheus/client/CounterMetricFamily.java deleted file mode 100644 index c477bba1b..000000000 --- a/simpleclient/src/main/java/io/prometheus/client/CounterMetricFamily.java +++ /dev/null @@ -1,58 +0,0 @@ -package io.prometheus.client; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * Counter metric family, for custom collectors and exporters. - *

    - * Most users want a normal {@link Counter} instead. - * - * Example usage: - *

    - * {@code
    - *   class YourCustomCollector extends Collector {
    - *     List collect() {
    - *       List mfs = new ArrayList();
    - *       // With no labels.
    - *       mfs.add(new CounterMetricFamily("my_counter_total", "help", 42));
    - *       // With labels
    - *       CounterMetricFamily labeledCounter = new CounterMetricFamily("my_other_counter_total", "help", Arrays.asList("labelname"));
    - *       labeledCounter.addMetric(Arrays.asList("foo"), 4);
    - *       labeledCounter.addMetric(Arrays.asList("bar"), 5);
    - *       mfs.add(labeledCounter);
    - *       return mfs;
    - *     }
    - *   }
    - * }
    - * 
    - */ -public class CounterMetricFamily extends Collector.MetricFamilySamples { - - private final List labelNames; - - public CounterMetricFamily(String name, String help, double value) { - super(name, Collector.Type.COUNTER, help, new ArrayList()); - labelNames = Collections.emptyList(); - samples.add( - new Sample( - name, - labelNames, - Collections.emptyList(), - value)); - } - - public CounterMetricFamily(String name, String help, List labelNames) { - super(name, Collector.Type.COUNTER, help, new ArrayList()); - this.labelNames = labelNames; - } - - public CounterMetricFamily addMetric(List labelValues, double value) { - if (labelValues.size() != labelNames.size()) { - throw new IllegalArgumentException("Incorrect number of labels."); - } - samples.add(new Sample(name, labelNames, labelValues, value)); - return this; - } -} diff --git a/simpleclient/src/main/java/io/prometheus/client/DoubleAdder.java b/simpleclient/src/main/java/io/prometheus/client/DoubleAdder.java deleted file mode 100644 index cf24031ce..000000000 --- a/simpleclient/src/main/java/io/prometheus/client/DoubleAdder.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Written by Doug Lea with assistance from members of JCP JSR-166 - * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/publicdomain/zero/1.0/ - * - * Source: http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/jsr166e/DoubleAdder.java?revision=1.12 - */ - -package io.prometheus.client; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; - -/** - * One or more variables that together maintain an initially zero - * {@code double} sum. When updates (method {@link #add}) are - * contended across threads, the set of variables may grow dynamically - * to reduce contention. Method {@link #sum} (or, equivalently {@link - * #doubleValue}) returns the current total combined across the - * variables maintaining the sum. - * - *

    This class extends {@link Number}, but does not define - * methods such as {@code equals}, {@code hashCode} and {@code - * compareTo} because instances are expected to be mutated, and so are - * not useful as collection keys. - * - *

    jsr166e note: This class is targeted to be placed in - * java.util.concurrent.atomic. - * - * @since 1.8 - * @author Doug Lea - */ -public class DoubleAdder extends Striped64 implements Serializable { - private static final long serialVersionUID = 7249069246863182397L; - - /** - * Update function. Note that we must use "long" for underlying - * representations, because there is no compareAndSet for double, - * due to the fact that the bitwise equals used in any CAS - * implementation is not the same as double-precision equals. - * However, we use CAS only to detect and alleviate contention, - * for which bitwise equals works best anyway. In principle, the - * long/double conversions used here should be essentially free on - * most platforms since they just re-interpret bits. - * - * Similar conversions are used in other methods. - */ - final long fn(long v, long x) { - return Double.doubleToRawLongBits - (Double.longBitsToDouble(v) + - Double.longBitsToDouble(x)); - } - - /** - * Creates a new adder with initial sum of zero. - */ - public DoubleAdder() { - } - - /** - * Adds the given value. - * - * @param x the value to add - */ - public void add(double x) { - Cell[] as; long b, v; int[] hc; Cell a; int n; - if ((as = cells) != null || - !casBase(b = base, - Double.doubleToRawLongBits - (Double.longBitsToDouble(b) + x))) { - boolean uncontended = true; - if ((hc = threadHashCode.get()) == null || - as == null || (n = as.length) < 1 || - (a = as[(n - 1) & hc[0]]) == null || - !(uncontended = a.cas(v = a.value, - Double.doubleToRawLongBits - (Double.longBitsToDouble(v) + x)))) - retryUpdate(Double.doubleToRawLongBits(x), hc, uncontended); - } - } - - /** - * Returns the current sum. The returned value is NOT an - * atomic snapshot; invocation in the absence of concurrent - * updates returns an accurate result, but concurrent updates that - * occur while the sum is being calculated might not be - * incorporated. Also, because floating-point arithmetic is not - * strictly associative, the returned result need not be identical - * to the value that would be obtained in a sequential series of - * updates to a single variable. - * - * @return the sum - */ - public double sum() { - Cell[] as = cells; - double sum = Double.longBitsToDouble(base); - if (as != null) { - int n = as.length; - for (int i = 0; i < n; ++i) { - Cell a = as[i]; - if (a != null) - sum += Double.longBitsToDouble(a.value); - } - } - return sum; - } - - /** - * Resets variables maintaining the sum to zero. This method may - * be a useful alternative to creating a new adder, but is only - * effective if there are no concurrent updates. Because this - * method is intrinsically racy, it should only be used when it is - * known that no threads are concurrently updating. - */ - public void reset() { - internalReset(0L); - } - - /** - * Equivalent in effect to {@link #sum} followed by {@link - * #reset}. This method may apply for example during quiescent - * points between multithreaded computations. If there are - * updates concurrent with this method, the returned value is - * not guaranteed to be the final value occurring before - * the reset. - * - * @return the sum - */ - public double sumThenReset() { - Cell[] as = cells; - double sum = Double.longBitsToDouble(base); - base = 0L; - if (as != null) { - int n = as.length; - for (int i = 0; i < n; ++i) { - Cell a = as[i]; - if (a != null) { - long v = a.value; - a.value = 0L; - sum += Double.longBitsToDouble(v); - } - } - } - return sum; - } - - /** - * Returns the String representation of the {@link #sum}. - * @return the String representation of the {@link #sum} - */ - public String toString() { - return Double.toString(sum()); - } - - /** - * Equivalent to {@link #sum}. - * - * @return the sum - */ - public double doubleValue() { - return sum(); - } - - /** - * Returns the {@link #sum} as a {@code long} after a - * narrowing primitive conversion. - */ - public long longValue() { - return (long)sum(); - } - - /** - * Returns the {@link #sum} as an {@code int} after a - * narrowing primitive conversion. - */ - public int intValue() { - return (int)sum(); - } - - /** - * Returns the {@link #sum} as a {@code float} - * after a narrowing primitive conversion. - */ - public float floatValue() { - return (float)sum(); - } - - private void writeObject(ObjectOutputStream s) throws IOException { - s.defaultWriteObject(); - s.writeDouble(sum()); - } - - private void readObject(ObjectInputStream s) - throws IOException, ClassNotFoundException { - s.defaultReadObject(); - busy = 0; - cells = null; - base = Double.doubleToRawLongBits(s.readDouble()); - } - -} diff --git a/simpleclient/src/main/java/io/prometheus/client/Gauge.java b/simpleclient/src/main/java/io/prometheus/client/Gauge.java deleted file mode 100644 index dc1b0d568..000000000 --- a/simpleclient/src/main/java/io/prometheus/client/Gauge.java +++ /dev/null @@ -1,342 +0,0 @@ -package io.prometheus.client; - -import java.io.Closeable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.concurrent.Callable; - -/** - * Gauge metric, to report instantaneous values. - *

    - * Examples of Gauges include: - *

      - *
    • Inprogress requests
    • - *
    • Number of items in a queue
    • - *
    • Free memory
    • - *
    • Total memory
    • - *
    • Temperature
    • - *
    - * - * Gauges can go both up and down. - *

    - * An example Gauge: - *

    - * {@code
    - *   class YourClass {
    - *     static final Gauge inprogressRequests = Gauge.build()
    - *         .name("inprogress_requests").help("Inprogress requests.").register();
    - *
    - *     void processRequest() {
    - *        inprogressRequests.inc();
    - *        // Your code here.
    - *        inprogressRequests.dec();
    - *     }
    - *   }
    - * }
    - * 
    - * - *

    - * You can also use labels to track different types of metric: - *

    - * {@code
    - *   class YourClass {
    - *     static final Gauge inprogressRequests = Gauge.build()
    - *         .name("inprogress_requests").help("Inprogress requests.")
    - *         .labelNames("method").register();
    - *
    - *     void processGetRequest() {
    - *        inprogressRequests.labels("get").inc();
    - *        // Your code here.
    - *        inprogressRequests.labels("get").dec();
    - *     }
    - *     void processPostRequest() {
    - *        inprogressRequests.labels("post").inc();
    - *        // Your code here.
    - *        inprogressRequests.labels("post").dec();
    - *     }
    - *   }
    - * }
    - * 
    - *

    - * These can be aggregated and processed together much more easily in the Prometheus - * server than individual metrics for each labelset. - */ -public class Gauge extends SimpleCollector implements Collector.Describable { - - Gauge(Builder b) { - super(b); - } - - public static class Builder extends SimpleCollector.Builder { - @Override - public Gauge create() { - return new Gauge(this); - } - } - - /** - * Return a Builder to allow configuration of a new Gauge. Ensures required fields are provided. - * - * @param name The name of the metric - * @param help The help string of the metric - */ - public static Builder build(String name, String help) { - return new Builder().name(name).help(help); - } - - /** - * Return a Builder to allow configuration of a new Gauge. - */ - public static Builder build() { - return new Builder(); - } - - @Override - protected Child newChild() { - return new Child(); - } - - /** - * Represents an event being timed. - */ - public static class Timer implements Closeable { - private final Child child; - private final long start; - private Timer(Child child) { - this.child = child; - start = Child.timeProvider.nanoTime(); - } - /** - * Set the amount of time in seconds since {@link Child#startTimer} was called. - * @return Measured duration in seconds since {@link Child#startTimer} was called. - */ - public double setDuration() { - double elapsed = (Child.timeProvider.nanoTime() - start) / NANOSECONDS_PER_SECOND; - child.set(elapsed); - return elapsed; - } - - /** - * Equivalent to calling {@link #setDuration()}. - */ - @Override - public void close() { - setDuration(); - } - } - - /** - * The value of a single Gauge. - *

    - * Warning: References to a Child become invalid after using - * {@link SimpleCollector#remove} or {@link SimpleCollector#clear}, - */ - public static class Child { - private final DoubleAdder value = new DoubleAdder(); - - static TimeProvider timeProvider = new TimeProvider(); - - /** - * Increment the gauge by 1. - */ - public void inc() { - inc(1); - } - /** - * Increment the gauge by the given amount. - */ - public void inc(double amt) { - value.add(amt); - } - /** - * Decrement the gauge by 1. - */ - public void dec() { - dec(1); - } - /** - * Decrement the gauge by the given amount. - */ - public void dec(double amt) { - value.add(-amt); - } - /** - * Set the gauge to the given value. - */ - public void set(double val) { - synchronized(this) { - value.reset(); - // If get() were called here it'd see an invalid value, so use a lock. - // inc()/dec() don't need locks, as all the possible outcomes - // are still possible if set() were atomic so no new races are introduced. - value.add(val); - } - } - /** - * Set the gauge to the current unixtime. - */ - public void setToCurrentTime() { - set(timeProvider.currentTimeMillis() / MILLISECONDS_PER_SECOND); - } - /** - * Start a timer to track a duration. - *

    - * Call {@link Timer#setDuration} at the end of what you want to measure the duration of. - *

    - * This is primarily useful for tracking the durations of major steps of batch jobs, - * which are then pushed to a PushGateway. - * For tracking other durations/latencies you should usually use a {@link Summary}. - */ - public Timer startTimer() { - return new Timer(this); - } - - /** - * Executes runnable code (e.g. a Java 8 Lambda) and observes a duration of how long it took to run. - * - * @param timeable Code that is being timed - * @return Measured duration in seconds for timeable to complete. - */ - public double setToTime(Runnable timeable){ - Timer timer = startTimer(); - - double elapsed; - try { - timeable.run(); - } finally { - elapsed = timer.setDuration(); - } - - return elapsed; - } - - /** - * Executes callable code (e.g. a Java 8 Lambda) and observes a duration of how long it took to run. - * - * @param timeable Code that is being timed - * @return Result returned by callable. - */ - public E setToTime(Callable timeable){ - Timer timer = startTimer(); - - try { - return timeable.call(); - } catch (Exception e) { - throw new RuntimeException(e); - } finally { - timer.setDuration(); - } - } - - /** - * Get the value of the gauge. - */ - public double get() { - synchronized(this) { - return value.sum(); - } - } - } - - // Convenience methods. - /** - * Increment the gauge with no labels by 1. - */ - public void inc() { - inc(1); - } - /** - * Increment the gauge with no labels by the given amount. - */ - public void inc(double amt) { - noLabelsChild.inc(amt); - } - /** - * Decrement the gauge with no labels by 1. - */ - public void dec() { - dec(1); - } - /** - * Decrement the gauge with no labels by the given amount. - */ - public void dec(double amt) { - noLabelsChild.dec(amt); - } - /** - * Set the gauge with no labels to the given value. - */ - public void set(double val) { - noLabelsChild.set(val); - } - /** - * Set the gauge with no labels to the current unixtime. - */ - public void setToCurrentTime() { - noLabelsChild.setToCurrentTime(); - } - /** - * Start a timer to track a duration, for the gauge with no labels. - *

    - * This is primarily useful for tracking the durations of major steps of batch jobs, - * which are then pushed to a PushGateway. - * For tracking other durations/latencies you should usually use a {@link Summary}. - *

    - * Call {@link Timer#setDuration} at the end of what you want to measure the duration of. - */ - public Timer startTimer() { - return noLabelsChild.startTimer(); - } - - /** - * Executes runnable code (e.g. a Java 8 Lambda) and observes a duration of how long it took to run. - * - * @param timeable Code that is being timed - * @return Measured duration in seconds for timeable to complete. - */ - public double setToTime(Runnable timeable){ - return noLabelsChild.setToTime(timeable); - } - - /** - * Executes callable code (e.g. a Java 8 Lambda) and observes a duration of how long it took to run. - * - * @param timeable Code that is being timed - * @return Result returned by callable. - */ - public E setToTime(Callable timeable){ - return noLabelsChild.setToTime(timeable); - } - - /** - * Get the value of the gauge. - */ - public double get() { - return noLabelsChild.get(); - } - - @Override - public List collect() { - List samples = new ArrayList(children.size()); - for(Map.Entry, Child> c: children.entrySet()) { - samples.add(new MetricFamilySamples.Sample(fullname, labelNames, c.getKey(), c.getValue().get())); - } - return familySamplesList(Type.GAUGE, samples); - } - - @Override - public List describe() { - return Collections.singletonList(new GaugeMetricFamily(fullname, help, labelNames)); - } - - static class TimeProvider { - long currentTimeMillis() { - return System.currentTimeMillis(); - } - long nanoTime() { - return System.nanoTime(); - } - } -} diff --git a/simpleclient/src/main/java/io/prometheus/client/GaugeMetricFamily.java b/simpleclient/src/main/java/io/prometheus/client/GaugeMetricFamily.java deleted file mode 100644 index 101e5d320..000000000 --- a/simpleclient/src/main/java/io/prometheus/client/GaugeMetricFamily.java +++ /dev/null @@ -1,58 +0,0 @@ -package io.prometheus.client; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * Gauge metric family, for custom collectors and exporters. - *

    - * Most users want a normal {@link Gauge} instead. - * - * Example usage: - *

    - * {@code
    - *   class YourCustomCollector extends Collector {
    - *     List collect() {
    - *       List mfs = new ArrayList();
    - *       // With no labels.
    - *       mfs.add(new GaugeMetricFamily("my_gauge", "help", 42));
    - *       // With labels
    - *       GaugeMetricFamily labeledGauge = new GaugeMetricFamily("my_other_gauge", "help", Arrays.asList("labelname"));
    - *       labeledGauge.addMetric(Arrays.asList("foo"), 4);
    - *       labeledGauge.addMetric(Arrays.asList("bar"), 5);
    - *       mfs.add(labeledGauge);
    - *       return mfs;
    - *     }
    - *   }
    - * }
    - * 
    - */ -public class GaugeMetricFamily extends Collector.MetricFamilySamples { - - private final List labelNames; - - public GaugeMetricFamily(String name, String help, double value) { - super(name, Collector.Type.GAUGE, help, new ArrayList()); - labelNames = Collections.emptyList(); - samples.add( - new Sample( - name, - labelNames, - Collections.emptyList(), - value)); - } - - public GaugeMetricFamily(String name, String help, List labelNames) { - super(name, Collector.Type.GAUGE, help, new ArrayList()); - this.labelNames = labelNames; - } - - public GaugeMetricFamily addMetric(List labelValues, double value) { - if (labelValues.size() != labelNames.size()) { - throw new IllegalArgumentException("Incorrect number of labels."); - } - samples.add(new Sample(name, labelNames, labelValues, value)); - return this; - } -} diff --git a/simpleclient/src/main/java/io/prometheus/client/Histogram.java b/simpleclient/src/main/java/io/prometheus/client/Histogram.java deleted file mode 100644 index 2b289806a..000000000 --- a/simpleclient/src/main/java/io/prometheus/client/Histogram.java +++ /dev/null @@ -1,354 +0,0 @@ -package io.prometheus.client; - -import java.io.Closeable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.concurrent.Callable; - -/** - * Histogram metric, to track distributions of events. - *

    - * Example of uses for Histograms include: - *

      - *
    • Response latency
    • - *
    • Request size
    • - *
    - *

    - * Note: Each bucket is one timeseries. Many buckets and/or many dimensions with labels - * can produce large amount of time series, that may cause performance problems. - * - *

    - * The default buckets are intended to cover a typical web/rpc request from milliseconds to seconds. - *

    - * Example Histograms: - *

    - * {@code
    - *   class YourClass {
    - *     static final Histogram requestLatency = Histogram.build()
    - *         .name("requests_latency_seconds").help("Request latency in seconds.").register();
    - *
    - *     void processRequest(Request req) {
    - *        Histogram.Timer requestTimer = requestLatency.startTimer();
    - *        try {
    - *          // Your code here.
    - *        } finally {
    - *          requestTimer.observeDuration();
    - *        }
    - *     }
    - *
    - *     // Or if using Java 8 lambdas.
    - *     void processRequestLambda(Request req) {
    - *        requestLatency.time(() -> {
    - *          // Your code here.
    - *        });
    - *     }
    - *   }
    - * }
    - * 
    - *

    - * You can choose your own buckets: - *

    - * {@code
    - *     static final Histogram requestLatency = Histogram.build()
    - *         .buckets(.01, .02, .03, .04)
    - *         .name("requests_latency_seconds").help("Request latency in seconds.").register();
    - * }
    - * 
    - * {@link Histogram.Builder#linearBuckets(double, double, int) linearBuckets} and - * {@link Histogram.Builder#exponentialBuckets(double, double, int) exponentialBuckets} - * offer easy ways to set common bucket patterns. - */ -public class Histogram extends SimpleCollector implements Collector.Describable { - private final double[] buckets; - - Histogram(Builder b) { - super(b); - buckets = b.buckets; - initializeNoLabelsChild(); - } - - public static class Builder extends SimpleCollector.Builder { - private double[] buckets = new double[]{.005, .01, .025, .05, .075, .1, .25, .5, .75, 1, 2.5, 5, 7.5, 10}; - - @Override - public Histogram create() { - for (int i = 0; i < buckets.length - 1; i++) { - if (buckets[i] >= buckets[i + 1]) { - throw new IllegalStateException("Histogram buckets must be in increasing order: " - + buckets[i] + " >= " + buckets[i + 1]); - } - } - if (buckets.length == 0) { - throw new IllegalStateException("Histogram must have at least one bucket."); - } - for (String label: labelNames) { - if (label.equals("le")) { - throw new IllegalStateException("Histogram cannot have a label named 'le'."); - } - } - - // Append infinity bucket if it's not already there. - if (buckets[buckets.length - 1] != Double.POSITIVE_INFINITY) { - double[] tmp = new double[buckets.length + 1]; - System.arraycopy(buckets, 0, tmp, 0, buckets.length); - tmp[buckets.length] = Double.POSITIVE_INFINITY; - buckets = tmp; - } - dontInitializeNoLabelsChild = true; - return new Histogram(this); - } - - /** - * Set the upper bounds of buckets for the histogram. - */ - public Builder buckets(double... buckets) { - this.buckets = buckets; - return this; - } - - /** - * Set the upper bounds of buckets for the histogram with a linear sequence. - */ - public Builder linearBuckets(double start, double width, int count) { - buckets = new double[count]; - for (int i = 0; i < count; i++){ - buckets[i] = start + i*width; - } - return this; - } - /** - * Set the upper bounds of buckets for the histogram with an exponential sequence. - */ - public Builder exponentialBuckets(double start, double factor, int count) { - buckets = new double[count]; - for (int i = 0; i < count; i++) { - buckets[i] = start * Math.pow(factor, i); - } - return this; - } - - } - - /** - * Return a Builder to allow configuration of a new Histogram. Ensures required fields are provided. - * - * @param name The name of the metric - * @param help The help string of the metric - */ - public static Builder build(String name, String help) { - return new Builder().name(name).help(help); - } - - /** - * Return a Builder to allow configuration of a new Histogram. - */ - public static Builder build() { - return new Builder(); - } - - @Override - protected Child newChild() { - return new Child(buckets); - } - - /** - * Represents an event being timed. - */ - public static class Timer implements Closeable { - private final Child child; - private final long start; - private Timer(Child child, long start) { - this.child = child; - this.start = start; - } - /** - * Observe the amount of time in seconds since {@link Child#startTimer} was called. - * @return Measured duration in seconds since {@link Child#startTimer} was called. - */ - public double observeDuration() { - double elapsed = SimpleTimer.elapsedSecondsFromNanos(start, SimpleTimer.defaultTimeProvider.nanoTime()); - child.observe(elapsed); - return elapsed; - } - - /** - * Equivalent to calling {@link #observeDuration()}. - */ - @Override - public void close() { - observeDuration(); - } - } - - /** - * The value of a single Histogram. - *

    - * Warning: References to a Child become invalid after using - * {@link SimpleCollector#remove} or {@link SimpleCollector#clear}. - */ - public static class Child { - - /** - * Executes runnable code (e.g. a Java 8 Lambda) and observes a duration of how long it took to run. - * - * @param timeable Code that is being timed - * @return Measured duration in seconds for timeable to complete. - */ - public double time(Runnable timeable) { - Timer timer = startTimer(); - - double elapsed; - try { - timeable.run(); - } finally { - elapsed = timer.observeDuration(); - } - return elapsed; - } - - /** - * Executes callable code (e.g. a Java 8 Lambda) and observes a duration of how long it took to run. - * - * @param timeable Code that is being timed - * @return Result returned by callable. - */ - public E time(Callable timeable) { - Timer timer = startTimer(); - - try { - return timeable.call(); - } catch (Exception e) { - throw new RuntimeException(e); - } finally { - timer.observeDuration(); - } - } - - public static class Value { - public final double sum; - public final double[] buckets; - - public Value(double sum, double[] buckets) { - this.sum = sum; - this.buckets = buckets; - } - } - - private Child(double[] buckets) { - upperBounds = buckets; - cumulativeCounts = new DoubleAdder[buckets.length]; - for (int i = 0; i < buckets.length; ++i) { - cumulativeCounts[i] = new DoubleAdder(); - } - } - private final double[] upperBounds; - private final DoubleAdder[] cumulativeCounts; - private final DoubleAdder sum = new DoubleAdder(); - - - /** - * Observe the given amount. - */ - public void observe(double amt) { - for (int i = 0; i < upperBounds.length; ++i) { - // The last bucket is +Inf, so we always increment. - if (amt <= upperBounds[i]) { - cumulativeCounts[i].add(1); - break; - } - } - sum.add(amt); - } - /** - * Start a timer to track a duration. - *

    - * Call {@link Timer#observeDuration} at the end of what you want to measure the duration of. - */ - public Timer startTimer() { - return new Timer(this, SimpleTimer.defaultTimeProvider.nanoTime()); - } - /** - * Get the value of the Histogram. - *

    - * Warning: The definition of {@link Value} is subject to change. - */ - public Value get() { - double[] buckets = new double[cumulativeCounts.length]; - double acc = 0; - for (int i = 0; i < cumulativeCounts.length; ++i) { - acc += cumulativeCounts[i].sum(); - buckets[i] = acc; - } - return new Value(sum.sum(), buckets); - } - } - - // Convenience methods. - /** - * Observe the given amount on the histogram with no labels. - */ - public void observe(double amt) { - noLabelsChild.observe(amt); - } - /** - * Start a timer to track a duration on the histogram with no labels. - *

    - * Call {@link Timer#observeDuration} at the end of what you want to measure the duration of. - */ - public Timer startTimer() { - return noLabelsChild.startTimer(); - } - - /** - * Executes runnable code (e.g. a Java 8 Lambda) and observes a duration of how long it took to run. - * - * @param timeable Code that is being timed - * @return Measured duration in seconds for timeable to complete. - */ - public double time(Runnable timeable){ - return noLabelsChild.time(timeable); - } - - /** - * Executes callable code (e.g. a Java 8 Lambda) and observes a duration of how long it took to run. - * - * @param timeable Code that is being timed - * @return Result returned by callable. - */ - public E time(Callable timeable){ - return noLabelsChild.time(timeable); - } - - @Override - public List collect() { - List samples = new ArrayList(); - for(Map.Entry, Child> c: children.entrySet()) { - Child.Value v = c.getValue().get(); - List labelNamesWithLe = new ArrayList(labelNames); - labelNamesWithLe.add("le"); - for (int i = 0; i < v.buckets.length; ++i) { - List labelValuesWithLe = new ArrayList(c.getKey()); - labelValuesWithLe.add(doubleToGoString(buckets[i])); - samples.add(new MetricFamilySamples.Sample(fullname + "_bucket", labelNamesWithLe, labelValuesWithLe, v.buckets[i])); - } - samples.add(new MetricFamilySamples.Sample(fullname + "_count", labelNames, c.getKey(), v.buckets[buckets.length-1])); - samples.add(new MetricFamilySamples.Sample(fullname + "_sum", labelNames, c.getKey(), v.sum)); - } - - return familySamplesList(Type.HISTOGRAM, samples); - } - - @Override - public List describe() { - return Collections.singletonList( - new MetricFamilySamples(fullname, Type.HISTOGRAM, help, Collections.emptyList())); - } - - double[] getBuckets() { - return buckets; - } - - -} diff --git a/simpleclient/src/main/java/io/prometheus/client/SimpleCollector.java b/simpleclient/src/main/java/io/prometheus/client/SimpleCollector.java deleted file mode 100644 index ed8c5c8a0..000000000 --- a/simpleclient/src/main/java/io/prometheus/client/SimpleCollector.java +++ /dev/null @@ -1,250 +0,0 @@ -package io.prometheus.client; - -import java.util.ArrayList; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; -import java.util.Arrays; -import java.util.List; - -/** - * Common functionality for {@link Gauge}, {@link Counter}, {@link Summary} and {@link Histogram}. - *

    - * This class handles common initialization and label logic for the standard metrics. - * You should never subclass this class. - *

    - *

    Initialization

    - * After calling build() on a subclass, {@link Builder#name(String) name}, - * {@link SimpleCollector.Builder#help(String) help}, - * {@link SimpleCollector.Builder#labelNames(String...) labelNames}, - * {@link SimpleCollector.Builder#namespace(String) namespace} and - * {@link SimpleCollector.Builder#subsystem(String) subsystem} can be called to configure the Collector. - * These return this to allow calls to be chained. - * Once configured, call {@link SimpleCollector.Builder#create create} - * (which is also called by {@link SimpleCollector.Builder#register register}). - *

    - * The fullname of the metric is namespace_subsystem_name, but only name is required. - * - *

    Labels

    - * {@link SimpleCollector.Builder#labelNames labelNames} specifies which (if any) labels the metrics will have, and - * {@link #labels} returns the Child of the metric that represents that particular set of labels. - * {@link Gauge}, {@link Counter} and {@link Summary} all offer convenience methods to avoid needing to call - * {@link #labels} for metrics with no labels. - *

    - * {@link #remove} and {@link #clear} can be used to remove children. - *

    - * Warning #1: Metrics that don't always export something are difficult to monitor, if you know in advance - * what labels will be in use you should initialise them be calling {@link #labels}. - * This is done for you for metrics with no labels. - *

    - * Warning #2: While labels are very powerful, avoid overly granular metric labels. - * The combinatorial explosion of breaking out a metric in many dimensions can produce huge numbers - * of timeseries, which will then take longer and more resources to process. - *

    - * As a rule of thumb aim to keep the cardinality of metrics below ten, and limit where the - * cardinality exceeds that value. For example rather than breaking out latency - * by customer and endpoint in one metric, you might have two metrics with one breaking out - * by each. If the cardinality is in the hundreds, you may wish to consider removing the breakout - * by one of the dimensions altogether. - */ -public abstract class SimpleCollector extends Collector { - protected final String fullname; - protected final String help; - protected final List labelNames; - - protected final ConcurrentMap, Child> children = new ConcurrentHashMap, Child>(); - protected Child noLabelsChild; - - /** - * Return the Child with the given labels, creating it if needed. - *

    - * Must be passed the same number of labels are were passed to {@link #labelNames}. - */ - public Child labels(String... labelValues) { - if (labelValues.length != labelNames.size()) { - throw new IllegalArgumentException("Incorrect number of labels."); - } - for (String label: labelValues) { - if (label == null) { - throw new IllegalArgumentException("Label cannot be null."); - } - } - List key = Arrays.asList(labelValues); - Child c = children.get(key); - if (c != null) { - return c; - } - Child c2 = newChild(); - Child tmp = children.putIfAbsent(key, c2); - return tmp == null ? c2 : tmp; - } - - /** - * Remove the Child with the given labels. - *

    - * Any references to the Child are invalidated. - */ - public void remove(String... labelValues) { - children.remove(Arrays.asList(labelValues)); - initializeNoLabelsChild(); - } - - /** - * Remove all children. - *

    - * Any references to any children are invalidated. - */ - public void clear() { - children.clear(); - initializeNoLabelsChild(); - } - - /** - * Initialize the child with no labels. - */ - protected void initializeNoLabelsChild() { - // Initialize metric if it has no labels. - if (labelNames.size() == 0) { - noLabelsChild = labels(); - } - } - - /** - * Replace the Child with the given labels. - *

    - * This is intended for advanced uses, in particular proxying metrics - * from another monitoring system. This allows for callbacks for returning - * values for {@link Counter} and {@link Gauge} without having to implement - * a full {@link Collector}. - *

    - * An example with {@link Gauge}: - *

    -   * {@code
    -   *   Gauge.build().name("current_time").help("Current unixtime.").create()
    -   *       .setChild(new Gauge.Child() {
    -   *         public double get() {
    -   *           return System.currentTimeMillis() / MILLISECONDS_PER_SECOND;
    -   *         }
    -   *       }).register();
    -   * }
    -   * 
    - *

    - * Any references any previous Child with these labelValues are invalidated. - * A metric should be either all callbacks, or none. - */ - public T setChild(Child child, String... labelValues) { - if (labelValues.length != labelNames.size()) { - throw new IllegalArgumentException("Incorrect number of labels."); - } - children.put(Arrays.asList(labelValues), child); - return (T)this; - } - - /** - * Return a new child, workaround for Java generics limitations. - */ - protected abstract Child newChild(); - - protected List familySamplesList(Collector.Type type, List samples) { - MetricFamilySamples mfs = new MetricFamilySamples(fullname, type, help, samples); - List mfsList = new ArrayList(1); - mfsList.add(mfs); - return mfsList; - } - - protected SimpleCollector(Builder b) { - if (b.name.isEmpty()) throw new IllegalStateException("Name hasn't been set."); - String name = b.name; - if (!b.subsystem.isEmpty()) { - name = b.subsystem + '_' + name; - } - if (!b.namespace.isEmpty()) { - name = b.namespace + '_' + name; - } - fullname = name; - checkMetricName(fullname); - if (b.help.isEmpty()) throw new IllegalStateException("Help hasn't been set."); - help = b.help; - labelNames = Arrays.asList(b.labelNames); - - for (String n: labelNames) { - checkMetricLabelName(n); - } - - if (!b.dontInitializeNoLabelsChild) { - initializeNoLabelsChild(); - } - } - - /** - * Builders let you configure and then create collectors. - */ - public abstract static class Builder, C extends SimpleCollector> { - String namespace = ""; - String subsystem = ""; - String name = ""; - String fullname = ""; - String help = ""; - String[] labelNames = new String[]{}; - // Some metrics require additional setup before the initialization can be done. - boolean dontInitializeNoLabelsChild; - - /** - * Set the name of the metric. Required. - */ - public B name(String name) { - this.name = name; - return (B)this; - } - /** - * Set the subsystem of the metric. Optional. - */ - public B subsystem(String subsystem) { - this.subsystem = subsystem; - return (B)this; - } - /** - * Set the namespace of the metric. Optional. - */ - public B namespace(String namespace) { - this.namespace = namespace; - return (B)this; - } - /** - * Set the help string of the metric. Required. - */ - public B help(String help) { - this.help = help; - return (B)this; - } - /** - * Set the labelNames of the metric. Optional, defaults to no labels. - */ - public B labelNames(String... labelNames) { - this.labelNames = labelNames; - return (B)this; - } - - /** - * Return the constructed collector. - *

    - * Abstract due to generics limitations. - */ - public abstract C create(); - - /** - * Create and register the Collector with the default registry. - */ - public C register() { - return register(CollectorRegistry.defaultRegistry); - } - - /** - * Create and register the Collector with the given registry. - */ - public C register(CollectorRegistry registry) { - C sc = create(); - registry.register(sc); - return sc; - } - } -} diff --git a/simpleclient/src/main/java/io/prometheus/client/SimpleTimer.java b/simpleclient/src/main/java/io/prometheus/client/SimpleTimer.java deleted file mode 100644 index 4f908d720..000000000 --- a/simpleclient/src/main/java/io/prometheus/client/SimpleTimer.java +++ /dev/null @@ -1,69 +0,0 @@ -package io.prometheus.client; - -/** - * SimpleTimer, to measure elapsed duration in seconds as a double. - * - *

    - * This is a helper class intended to measure latencies and encapsulate the conversion to seconds without losing precision. - * - *

    - * Keep in mind that preferred approaches avoid using this mechanism if possible, since latency metrics broken out by - * outcome should be minimized; {@link Summary#startTimer()} and {@link Histogram#startTimer()} are preferred. - * Consider moving outcome labels to a separate metric like a counter. - * - *

    - * Example usage: - *

    - * {@code
    - *   class YourClass {
    - *     static final Summary requestLatency = Summary.build()
    - *         .name("requests_latency_seconds")
    - *         .help("Request latency in seconds.")
    - *         .labelNames("aLabel")
    - *         .register();
    - *
    - *     void processRequest(Request req) {
    - *        SimpleTimer requestTimer = new SimpleTimer();
    - *        try {
    - *          // Your code here.
    - *        } finally {
    - *          requestLatency.labels("aLabelValue").observe(requestTimer.elapsedSeconds());
    - *        }
    - *     }
    - *   }
    - * }
    - * 
    - * - */ -public class SimpleTimer { - private final long start; - static TimeProvider defaultTimeProvider = new TimeProvider(); - private final TimeProvider timeProvider; - - static class TimeProvider { - long nanoTime() { - return System.nanoTime(); - } - } - - // Visible for testing. - SimpleTimer(TimeProvider timeProvider) { - this.timeProvider = timeProvider; - start = timeProvider.nanoTime(); - } - - public SimpleTimer() { - this(defaultTimeProvider); - } - - /** - * @return Measured duration in seconds since {@link SimpleTimer} was constructed. - */ - public double elapsedSeconds() { - return elapsedSecondsFromNanos(start, timeProvider.nanoTime()); - } - - public static double elapsedSecondsFromNanos(long startNanos, long endNanos) { - return (endNanos - startNanos) / Collector.NANOSECONDS_PER_SECOND; - } -} diff --git a/simpleclient/src/main/java/io/prometheus/client/Striped64.java b/simpleclient/src/main/java/io/prometheus/client/Striped64.java deleted file mode 100644 index fa9054483..000000000 --- a/simpleclient/src/main/java/io/prometheus/client/Striped64.java +++ /dev/null @@ -1,336 +0,0 @@ -/* - * Written by Doug Lea with assistance from members of JCP JSR-166 - * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/publicdomain/zero/1.0/ - * - * Source: http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/jsr166e/Striped64.java?revision=1.10 - */ - -package io.prometheus.client; - -import java.util.Random; - -/** - * A package-local class holding common representation and mechanics - * for classes supporting dynamic striping on 64bit values. The class - * extends Number so that concrete subclasses must publicly do so. - */ -abstract class Striped64 extends Number { - /* - * This class maintains a lazily-initialized table of atomically - * updated variables, plus an extra "base" field. The table size - * is a power of two. Indexing uses masked per-thread hash codes. - * Nearly all declarations in this class are package-private, - * accessed directly by subclasses. - * - * Table entries are of class Cell; a variant of AtomicLong padded - * to reduce cache contention on most processors. Padding is - * overkill for most Atomics because they are usually irregularly - * scattered in memory and thus don't interfere much with each - * other. But Atomic objects residing in arrays will tend to be - * placed adjacent to each other, and so will most often share - * cache lines (with a huge negative performance impact) without - * this precaution. - * - * In part because Cells are relatively large, we avoid creating - * them until they are needed. When there is no contention, all - * updates are made to the base field. Upon first contention (a - * failed CAS on base update), the table is initialized to size 2. - * The table size is doubled upon further contention until - * reaching the nearest power of two greater than or equal to the - * number of CPUS. Table slots remain empty (null) until they are - * needed. - * - * A single spinlock ("busy") is used for initializing and - * resizing the table, as well as populating slots with new Cells. - * There is no need for a blocking lock; when the lock is not - * available, threads try other slots (or the base). During these - * retries, there is increased contention and reduced locality, - * which is still better than alternatives. - * - * Per-thread hash codes are initialized to random values. - * Contention and/or table collisions are indicated by failed - * CASes when performing an update operation (see method - * retryUpdate). Upon a collision, if the table size is less than - * the capacity, it is doubled in size unless some other thread - * holds the lock. If a hashed slot is empty, and lock is - * available, a new Cell is created. Otherwise, if the slot - * exists, a CAS is tried. Retries proceed by "double hashing", - * using a secondary hash (Marsaglia XorShift) to try to find a - * free slot. - * - * The table size is capped because, when there are more threads - * than CPUs, supposing that each thread were bound to a CPU, - * there would exist a perfect hash function mapping threads to - * slots that eliminates collisions. When we reach capacity, we - * search for this mapping by randomly varying the hash codes of - * colliding threads. Because search is random, and collisions - * only become known via CAS failures, convergence can be slow, - * and because threads are typically not bound to CPUS forever, - * may not occur at all. However, despite these limitations, - * observed contention rates are typically low in these cases. - * - * It is possible for a Cell to become unused when threads that - * once hashed to it terminate, as well as in the case where - * doubling the table causes no thread to hash to it under - * expanded mask. We do not try to detect or remove such cells, - * under the assumption that for long-running instances, observed - * contention levels will recur, so the cells will eventually be - * needed again; and for short-lived ones, it does not matter. - */ - - /** - * Padded variant of AtomicLong supporting only raw accesses plus CAS. - * The value field is placed between pads, hoping that the JVM doesn't - * reorder them. - * - * JVM intrinsics note: It would be possible to use a release-only - * form of CAS here, if it were provided. - */ - static final class Cell { - volatile long p0, p1, p2, p3, p4, p5, p6; - volatile long value; - volatile long q0, q1, q2, q3, q4, q5, q6; - Cell(long x) { value = x; } - - final boolean cas(long cmp, long val) { - return UNSAFE.compareAndSwapLong(this, valueOffset, cmp, val); - } - - // Unsafe mechanics - private static final sun.misc.Unsafe UNSAFE; - private static final long valueOffset; - static { - try { - UNSAFE = getUnsafe(); - Class ak = Cell.class; - valueOffset = UNSAFE.objectFieldOffset - (ak.getDeclaredField("value")); - } catch (Exception e) { - throw new Error(e); - } - } - - } - - /** - * ThreadLocal holding a single-slot int array holding hash code. - * Unlike the JDK8 version of this class, we use a suboptimal - * int[] representation to avoid introducing a new type that can - * impede class-unloading when ThreadLocals are not removed. - */ - static final ThreadLocal threadHashCode = new ThreadLocal(); - - /** - * Generator of new random hash codes - */ - static final Random rng = new Random(); - - /** Number of CPUS, to place bound on table size */ - static final int NCPU = Runtime.getRuntime().availableProcessors(); - - /** - * Table of cells. When non-null, size is a power of 2. - */ - transient volatile Cell[] cells; - - /** - * Base value, used mainly when there is no contention, but also as - * a fallback during table initialization races. Updated via CAS. - */ - transient volatile long base; - - /** - * Spinlock (locked via CAS) used when resizing and/or creating Cells. - */ - transient volatile int busy; - - /** - * Package-private default constructor - */ - Striped64() { - } - - /** - * CASes the base field. - */ - final boolean casBase(long cmp, long val) { - return UNSAFE.compareAndSwapLong(this, baseOffset, cmp, val); - } - - /** - * CASes the busy field from 0 to 1 to acquire lock. - */ - final boolean casBusy() { - return UNSAFE.compareAndSwapInt(this, busyOffset, 0, 1); - } - - /** - * Computes the function of current and new value. Subclasses - * should open-code this update function for most uses, but the - * virtualized form is needed within retryUpdate. - * - * @param currentValue the current value (of either base or a cell) - * @param newValue the argument from a user update call - * @return result of the update function - */ - abstract long fn(long currentValue, long newValue); - - /** - * Handles cases of updates involving initialization, resizing, - * creating new Cells, and/or contention. See above for - * explanation. This method suffers the usual non-modularity - * problems of optimistic retry code, relying on rechecked sets of - * reads. - * - * @param x the value - * @param hc the hash code holder - * @param wasUncontended false if CAS failed before call - */ - final void retryUpdate(long x, int[] hc, boolean wasUncontended) { - int h; - if (hc == null) { - threadHashCode.set(hc = new int[1]); // Initialize randomly - int r = rng.nextInt(); // Avoid zero to allow xorShift rehash - h = hc[0] = (r == 0) ? 1 : r; - } - else - h = hc[0]; - boolean collide = false; // True if last slot nonempty - for (;;) { - Cell[] as; Cell a; int n; long v; - if ((as = cells) != null && (n = as.length) > 0) { - if ((a = as[(n - 1) & h]) == null) { - if (busy == 0) { // Try to attach new Cell - Cell r = new Cell(x); // Optimistically create - if (busy == 0 && casBusy()) { - boolean created = false; - try { // Recheck under lock - Cell[] rs; int m, j; - if ((rs = cells) != null && - (m = rs.length) > 0 && - rs[j = (m - 1) & h] == null) { - rs[j] = r; - created = true; - } - } finally { - busy = 0; - } - if (created) - break; - continue; // Slot is now non-empty - } - } - collide = false; - } - else if (!wasUncontended) // CAS already known to fail - wasUncontended = true; // Continue after rehash - else if (a.cas(v = a.value, fn(v, x))) - break; - else if (n >= NCPU || cells != as) - collide = false; // At max size or stale - else if (!collide) - collide = true; - else if (busy == 0 && casBusy()) { - try { - if (cells == as) { // Expand table unless stale - Cell[] rs = new Cell[n << 1]; - for (int i = 0; i < n; ++i) - rs[i] = as[i]; - cells = rs; - } - } finally { - busy = 0; - } - collide = false; - continue; // Retry with expanded table - } - h ^= h << 13; // Rehash - h ^= h >>> 17; - h ^= h << 5; - hc[0] = h; // Record index for next time - } - else if (busy == 0 && cells == as && casBusy()) { - boolean init = false; - try { // Initialize table - if (cells == as) { - Cell[] rs = new Cell[2]; - rs[h & 1] = new Cell(x); - cells = rs; - init = true; - } - } finally { - busy = 0; - } - if (init) - break; - } - else if (casBase(v = base, fn(v, x))) - break; // Fall back on using base - } - } - - - /** - * Sets base and all cells to the given value. - */ - final void internalReset(long initialValue) { - Cell[] as = cells; - base = initialValue; - if (as != null) { - int n = as.length; - for (int i = 0; i < n; ++i) { - Cell a = as[i]; - if (a != null) - a.value = initialValue; - } - } - } - - // Unsafe mechanics - private static final sun.misc.Unsafe UNSAFE; - private static final long baseOffset; - private static final long busyOffset; - static { - try { - UNSAFE = getUnsafe(); - Class sk = Striped64.class; - baseOffset = UNSAFE.objectFieldOffset - (sk.getDeclaredField("base")); - busyOffset = UNSAFE.objectFieldOffset - (sk.getDeclaredField("busy")); - } catch (Exception e) { - throw new Error(e); - } - } - - /** - * Returns a sun.misc.Unsafe. Suitable for use in a 3rd party package. - * Replace with a simple call to Unsafe.getUnsafe when integrating - * into a jdk. - * - * @return a sun.misc.Unsafe - */ - private static sun.misc.Unsafe getUnsafe() { - try { - return sun.misc.Unsafe.getUnsafe(); - } catch (SecurityException tryReflectionInstead) {} - try { - return java.security.AccessController.doPrivileged - (new java.security.PrivilegedExceptionAction() { - public sun.misc.Unsafe run() throws Exception { - Class k = sun.misc.Unsafe.class; - for (java.lang.reflect.Field f : k.getDeclaredFields()) { - f.setAccessible(true); - Object x = f.get(null); - if (k.isInstance(x)) - return k.cast(x); - } - throw new NoSuchFieldError("the Unsafe"); - }}); - } catch (java.security.PrivilegedActionException e) { - throw new RuntimeException("Could not initialize intrinsics", - e.getCause()); - } - } -} diff --git a/simpleclient/src/main/java/io/prometheus/client/Summary.java b/simpleclient/src/main/java/io/prometheus/client/Summary.java deleted file mode 100644 index a341f2515..000000000 --- a/simpleclient/src/main/java/io/prometheus/client/Summary.java +++ /dev/null @@ -1,371 +0,0 @@ -package io.prometheus.client; - -import io.prometheus.client.CKMSQuantiles.Quantile; - -import java.io.Closeable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.SortedMap; -import java.util.TreeMap; -import java.util.concurrent.Callable; -import java.util.concurrent.TimeUnit; - -/** - * Summary metric, to track the size of events. - *

    - * Example of uses for Summaries include: - *

      - *
    • Response latency
    • - *
    • Request size
    • - *
    - * - *

    - * Example Summaries: - *

    - * {@code
    - *   class YourClass {
    - *     static final Summary receivedBytes = Summary.build()
    - *         .name("requests_size_bytes").help("Request size in bytes.").register();
    - *     static final Summary requestLatency = Summary.build()
    - *         .name("requests_latency_seconds").help("Request latency in seconds.").register();
    - *
    - *     void processRequest(Request req) {
    - *        Summary.Timer requestTimer = requestLatency.startTimer();
    - *        try {
    - *          // Your code here.
    - *        } finally {
    - *          receivedBytes.observe(req.size());
    - *          requestTimer.observeDuration();
    - *        }
    - *     }
    - *
    - *     // Or if using Java 8 and lambdas.
    - *     void processRequestLambda(Request req) {
    - *       receivedBytes.observe(req.size());
    - *       requestLatency.time(() -> {
    - *         // Your code here.
    - *       });
    - *     }
    - * }
    - * }
    - * 
    - * This would allow you to track request rate, average latency and average request size. - * - *

    - * How to add custom quantiles: - *

    - * {@code
    - *     static final Summary myMetric = Summary.build()
    - *             .quantile(0.5, 0.05)   // Add 50th percentile (= median) with 5% tolerated error
    - *             .quantile(0.9, 0.01)   // Add 90th percentile with 1% tolerated error
    - *             .quantile(0.99, 0.001) // Add 99th percentile with 0.1% tolerated error
    - *             .name("requests_size_bytes")
    - *             .help("Request size in bytes.")
    - *             .register();
    - * }
    - * 
    - * - * The quantiles are calculated over a sliding window of time. There are two options to configure this time window: - *
      - *
    • maxAgeSeconds(long): Set the duration of the time window is, i.e. how long observations are kept before they are discarded. - * Default is 10 minutes. - *
    • ageBuckets(int): Set the number of buckets used to implement the sliding time window. If your time window is 10 minutes, and you have ageBuckets=5, - * buckets will be switched every 2 minutes. The value is a trade-off between resources (memory and cpu for maintaining the bucket) - * and how smooth the time window is moved. Default value is 5. - *
    - * - * See https://prometheus.io/docs/practices/histograms/ for more info on quantiles. - */ -public class Summary extends SimpleCollector implements Counter.Describable { - - final List quantiles; // Can be empty, but can never be null. - final long maxAgeSeconds; - final int ageBuckets; - - Summary(Builder b) { - super(b); - quantiles = Collections.unmodifiableList(new ArrayList(b.quantiles)); - this.maxAgeSeconds = b.maxAgeSeconds; - this.ageBuckets = b.ageBuckets; - initializeNoLabelsChild(); - } - - public static class Builder extends SimpleCollector.Builder { - - private final List quantiles = new ArrayList(); - private long maxAgeSeconds = TimeUnit.MINUTES.toSeconds(10); - private int ageBuckets = 5; - - public Builder quantile(double quantile, double error) { - if (quantile < 0.0 || quantile > 1.0) { - throw new IllegalArgumentException("Quantile " + quantile + " invalid: Expected number between 0.0 and 1.0."); - } - if (error < 0.0 || error > 1.0) { - throw new IllegalArgumentException("Error " + error + " invalid: Expected number between 0.0 and 1.0."); - } - quantiles.add(new Quantile(quantile, error)); - return this; - } - - public Builder maxAgeSeconds(long maxAgeSeconds) { - if (maxAgeSeconds <= 0) { - throw new IllegalArgumentException("maxAgeSeconds cannot be " + maxAgeSeconds); - } - this.maxAgeSeconds = maxAgeSeconds; - return this; - } - - public Builder ageBuckets(int ageBuckets) { - if (ageBuckets <= 0) { - throw new IllegalArgumentException("ageBuckets cannot be " + ageBuckets); - } - this.ageBuckets = ageBuckets; - return this; - } - - @Override - public Summary create() { - for (String label : labelNames) { - if (label.equals("quantile")) { - throw new IllegalStateException("Summary cannot have a label named 'quantile'."); - } - } - dontInitializeNoLabelsChild = true; - return new Summary(this); - } - } - - /** - * Return a Builder to allow configuration of a new Summary. Ensures required fields are provided. - * - * @param name The name of the metric - * @param help The help string of the metric - */ - public static Builder build(String name, String help) { - return new Builder().name(name).help(help); - } - - /** - * Return a Builder to allow configuration of a new Summary. - */ - public static Builder build() { - return new Builder(); - } - - @Override - protected Child newChild() { - return new Child(quantiles, maxAgeSeconds, ageBuckets); - } - - - /** - * Represents an event being timed. - */ - public static class Timer implements Closeable { - private final Child child; - private final long start; - private Timer(Child child, long start) { - this.child = child; - this.start = start; - } - /** - * Observe the amount of time in seconds since {@link Child#startTimer} was called. - * @return Measured duration in seconds since {@link Child#startTimer} was called. - */ - public double observeDuration() { - double elapsed = SimpleTimer.elapsedSecondsFromNanos(start, SimpleTimer.defaultTimeProvider.nanoTime()); - child.observe(elapsed); - return elapsed; - } - - /** - * Equivalent to calling {@link #observeDuration()}. - */ - @Override - public void close() { - observeDuration(); - } - } - - /** - * The value of a single Summary. - *

    - * Warning: References to a Child become invalid after using - * {@link SimpleCollector#remove} or {@link SimpleCollector#clear}. - */ - public static class Child { - - /** - * Executes runnable code (e.g. a Java 8 Lambda) and observes a duration of how long it took to run. - * - * @param timeable Code that is being timed - * @return Measured duration in seconds for timeable to complete. - */ - public double time(Runnable timeable) { - Timer timer = startTimer(); - - double elapsed; - try { - timeable.run(); - } finally { - elapsed = timer.observeDuration(); - } - return elapsed; - } - - /** - * Executes callable code (e.g. a Java 8 Lambda) and observes a duration of how long it took to run. - * - * @param timeable Code that is being timed - * @return Result returned by callable. - */ - public E time(Callable timeable) { - Timer timer = startTimer(); - - try { - return timeable.call(); - } catch (Exception e) { - throw new RuntimeException(e); - } finally { - timer.observeDuration(); - } - } - - public static class Value { - public final double count; - public final double sum; - public final SortedMap quantiles; - - private Value(double count, double sum, List quantiles, TimeWindowQuantiles quantileValues) { - this.count = count; - this.sum = sum; - this.quantiles = Collections.unmodifiableSortedMap(snapshot(quantiles, quantileValues)); - } - - private SortedMap snapshot(List quantiles, TimeWindowQuantiles quantileValues) { - SortedMap result = new TreeMap(); - for (Quantile q : quantiles) { - result.put(q.quantile, quantileValues.get(q.quantile)); - } - return result; - } - } - - // Having these separate leaves us open to races, - // however Prometheus as whole has other races - // that mean adding atomicity here wouldn't be useful. - // This should be reevaluated in the future. - private final DoubleAdder count = new DoubleAdder(); - private final DoubleAdder sum = new DoubleAdder(); - private final List quantiles; - private final TimeWindowQuantiles quantileValues; - - private Child(List quantiles, long maxAgeSeconds, int ageBuckets) { - this.quantiles = quantiles; - if (quantiles.size() > 0) { - quantileValues = new TimeWindowQuantiles(quantiles.toArray(new Quantile[]{}), maxAgeSeconds, ageBuckets); - } else { - quantileValues = null; - } - } - - /** - * Observe the given amount. - */ - public void observe(double amt) { - count.add(1); - sum.add(amt); - if (quantileValues != null) { - quantileValues.insert(amt); - } - } - /** - * Start a timer to track a duration. - *

    - * Call {@link Timer#observeDuration} at the end of what you want to measure the duration of. - */ - public Timer startTimer() { - return new Timer(this, SimpleTimer.defaultTimeProvider.nanoTime()); - } - /** - * Get the value of the Summary. - *

    - * Warning: The definition of {@link Value} is subject to change. - */ - public Value get() { - return new Value(count.sum(), sum.sum(), quantiles, quantileValues); - } - } - - // Convenience methods. - /** - * Observe the given amount on the summary with no labels. - */ - public void observe(double amt) { - noLabelsChild.observe(amt); - } - /** - * Start a timer to track a duration on the summary with no labels. - *

    - * Call {@link Timer#observeDuration} at the end of what you want to measure the duration of. - */ - public Timer startTimer() { - return noLabelsChild.startTimer(); - } - - /** - * Executes runnable code (e.g. a Java 8 Lambda) and observes a duration of how long it took to run. - * - * @param timeable Code that is being timed - * @return Measured duration in seconds for timeable to complete. - */ - public double time(Runnable timeable){ - return noLabelsChild.time(timeable); - } - - /** - * Executes callable code (e.g. a Java 8 Lambda) and observes a duration of how long it took to run. - * - * @param timeable Code that is being timed - * @return Result returned by callable. - */ - public E time(Callable timeable){ - return noLabelsChild.time(timeable); - } - - /** - * Get the value of the Summary. - *

    - * Warning: The definition of {@link Child.Value} is subject to change. - */ - public Child.Value get() { - return noLabelsChild.get(); - } - - @Override - public List collect() { - List samples = new ArrayList(); - for(Map.Entry, Child> c: children.entrySet()) { - Child.Value v = c.getValue().get(); - List labelNamesWithQuantile = new ArrayList(labelNames); - labelNamesWithQuantile.add("quantile"); - for(Map.Entry q : v.quantiles.entrySet()) { - List labelValuesWithQuantile = new ArrayList(c.getKey()); - labelValuesWithQuantile.add(doubleToGoString(q.getKey())); - samples.add(new MetricFamilySamples.Sample(fullname, labelNamesWithQuantile, labelValuesWithQuantile, q.getValue())); - } - samples.add(new MetricFamilySamples.Sample(fullname + "_count", labelNames, c.getKey(), v.count)); - samples.add(new MetricFamilySamples.Sample(fullname + "_sum", labelNames, c.getKey(), v.sum)); - } - - return familySamplesList(Type.SUMMARY, samples); - } - - @Override - public List describe() { - return Collections.singletonList(new SummaryMetricFamily(fullname, help, labelNames)); - } - -} diff --git a/simpleclient/src/main/java/io/prometheus/client/SummaryMetricFamily.java b/simpleclient/src/main/java/io/prometheus/client/SummaryMetricFamily.java deleted file mode 100644 index e4204cc94..000000000 --- a/simpleclient/src/main/java/io/prometheus/client/SummaryMetricFamily.java +++ /dev/null @@ -1,73 +0,0 @@ -package io.prometheus.client; - -import java.util.ArrayList; -import java.util.List; -import java.util.Collections; - -/** - * Summary metric family, for custom collectors and exporters. - *

    - * Most users want a normal {@link Summary} instead. - * - * Example usage: - *

    - * {@code
    - *   class YourCustomCollector extends Collector {
    - *     List collect() {
    - *       List mfs = new ArrayList();
    - *       // With no labels.
    - *       mfs.add(new SummaryMetricFamily("my_summary", "help", 1, 42));
    - *       // With labels. Record 95th percentile as 3, and 99th percentile as 5.
    - *       SummaryMetricFamily labeledSummary = new SummaryMetricFamily("my_other_summary", "help", 
    - *           Arrays.asList("labelname"), Arrays.asList(.95, .99));
    - *       labeledSummary.addMetric(Arrays.asList("foo"), 2, 10, Arrays.asList(3.0, 5.0));
    - *       mfs.add(labeledSummary);
    - *       return mfs;
    - *     }
    - *   }
    - * }
    - * 
    - */ -public class SummaryMetricFamily extends Collector.MetricFamilySamples { - - private final List labelNames; - private final List quantiles; - - public SummaryMetricFamily(String name, String help, double count, double sum) { - super(name, Collector.Type.SUMMARY, help, new ArrayList()); - this.labelNames = Collections.emptyList(); - this.quantiles = Collections.emptyList(); - addMetric(Collections.emptyList(), count, sum); - } - - public SummaryMetricFamily(String name, String help, List labelNames) { - this(name, help, labelNames, Collections.emptyList()); - } - public SummaryMetricFamily(String name, String help, List labelNames, Listquantiles) { - super(name, Collector.Type.SUMMARY, help, new ArrayList()); - this.labelNames = labelNames; - this.quantiles = quantiles; - } - - public SummaryMetricFamily addMetric(List labelValues, double count, double sum) { - return addMetric(labelValues, count, sum, Collections.emptyList()); - } - public SummaryMetricFamily addMetric(List labelValues, double count, double sum, List quantiles) { - if (labelValues.size() != labelNames.size()) { - throw new IllegalArgumentException("Incorrect number of labels."); - } - if (this.quantiles.size() != quantiles.size()) { - throw new IllegalArgumentException("Incorrect number of quantiles."); - } - samples.add(new Sample(name + "_count", labelNames, labelValues, count)); - samples.add(new Sample(name + "_sum", labelNames, labelValues, sum)); - List labelNamesWithQuantile = new ArrayList(labelNames); - labelNamesWithQuantile.add("quantile"); - for (int i = 0; i < quantiles.size(); i++) { - List labelValuesWithQuantile = new ArrayList(labelValues); - labelValuesWithQuantile.add(Collector.doubleToGoString(this.quantiles.get(i))); - samples.add(new Sample(name, labelNamesWithQuantile, labelValuesWithQuantile, quantiles.get(i))); - } - return this; - } -} diff --git a/simpleclient/src/main/java/io/prometheus/client/TimeWindowQuantiles.java b/simpleclient/src/main/java/io/prometheus/client/TimeWindowQuantiles.java deleted file mode 100644 index cc60bc39b..000000000 --- a/simpleclient/src/main/java/io/prometheus/client/TimeWindowQuantiles.java +++ /dev/null @@ -1,54 +0,0 @@ -package io.prometheus.client; - -import io.prometheus.client.CKMSQuantiles.Quantile; -import java.util.concurrent.TimeUnit; - -/** - * Wrapper around CKMSQuantiles. - * - * Maintains a ring buffer of CKMSQuantiles to provide quantiles over a sliding windows of time. - */ -class TimeWindowQuantiles { - - private final Quantile[] quantiles; - private final CKMSQuantiles[] ringBuffer; - private int currentBucket; - private long lastRotateTimestampMillis; - private final long durationBetweenRotatesMillis; - - public TimeWindowQuantiles(Quantile[] quantiles, long maxAgeSeconds, int ageBuckets) { - this.quantiles = quantiles; - this.ringBuffer = new CKMSQuantiles[ageBuckets]; - for (int i = 0; i < ageBuckets; i++) { - this.ringBuffer[i] = new CKMSQuantiles(quantiles); - } - this.currentBucket = 0; - this.lastRotateTimestampMillis = System.currentTimeMillis(); - this.durationBetweenRotatesMillis = TimeUnit.SECONDS.toMillis(maxAgeSeconds) / ageBuckets; - } - - public synchronized double get(double q) { - CKMSQuantiles currentBucket = rotate(); - return currentBucket.get(q); - } - - public synchronized void insert(double value) { - rotate(); - for (CKMSQuantiles ckmsQuantiles : ringBuffer) { - ckmsQuantiles.insert(value); - } - } - - private CKMSQuantiles rotate() { - long timeSinceLastRotateMillis = System.currentTimeMillis() - lastRotateTimestampMillis; - while (timeSinceLastRotateMillis > durationBetweenRotatesMillis) { - ringBuffer[currentBucket] = new CKMSQuantiles(quantiles); - if (++currentBucket >= ringBuffer.length) { - currentBucket = 0; - } - timeSinceLastRotateMillis -= durationBetweenRotatesMillis; - lastRotateTimestampMillis += durationBetweenRotatesMillis; - } - return ringBuffer[currentBucket]; - } -} diff --git a/simpleclient/src/test/java/io/prometheus/client/CollectorRegistryTest.java b/simpleclient/src/test/java/io/prometheus/client/CollectorRegistryTest.java deleted file mode 100644 index 3f96dcbe3..000000000 --- a/simpleclient/src/test/java/io/prometheus/client/CollectorRegistryTest.java +++ /dev/null @@ -1,201 +0,0 @@ -package io.prometheus.client; - -import org.junit.Before; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; - - -public class CollectorRegistryTest { - - CollectorRegistry registry; - - @Before - public void setUp() { - registry = new CollectorRegistry(); - } - - @Test - public void testRegisteredCollectorsAreCollected() { - Collector g = Gauge.build().name("g").help("h").register(registry); - List mfs = Collections.list(registry.metricFamilySamples()); - assertEquals(1, mfs.size()); - assertEquals("g", mfs.get(0).name); - } - - @Test - public void testUnregister() { - Collector g = Gauge.build().name("g").help("h").register(registry); - Collector c = Counter.build().name("c").help("h").register(registry); - List mfs = Collections.list(registry.metricFamilySamples()); - assertEquals(2, mfs.size()); - registry.unregister(g); - mfs = Collections.list(registry.metricFamilySamples()); - assertEquals(1, mfs.size()); - assertEquals("c", mfs.get(0).name); - } - - @Test - public void testClear() { - Collector g = Gauge.build().name("g").help("h").register(registry); - Collector c = Counter.build().name("c").help("h").register(registry); - List mfs = Collections.list(registry.metricFamilySamples()); - assertEquals(2, mfs.size()); - registry.clear(); - mfs = Collections.list(registry.metricFamilySamples()); - assertEquals(0, mfs.size()); - } - - class EmptyCollector extends Collector { - public List collect() { - return new ArrayList(); - } - } - - @Test - public void testMetricFamilySamples() { - Collector g = Gauge.build().name("g").help("h").register(registry); - Collector c = Counter.build().name("c").help("h").register(registry); - Collector s = Summary.build().name("s").help("h").register(registry); - Collector ec = new EmptyCollector().register(registry); - HashSet names = new HashSet(); - for (Collector.MetricFamilySamples metricFamilySamples : Collections.list(registry.metricFamilySamples())) { - names.add(metricFamilySamples.name); - } - assertEquals(new HashSet(Arrays.asList("g", "c", "s")), names); - } - - @Test - public void testMetricFamilySamples_filterNames() { - Collector g = Gauge.build().name("g").help("h").register(registry); - Collector c = Counter.build().name("c").help("h").register(registry); - Collector s = Summary.build().name("s").help("h").register(registry); - Collector ec = new EmptyCollector().register(registry); - SkippedCollector sr = new SkippedCollector().register(registry); - PartiallyFilterCollector pfr = new PartiallyFilterCollector().register(registry); - HashSet metrics = new HashSet(); - HashSet series = new HashSet(); - for (Collector.MetricFamilySamples metricFamilySamples : Collections.list(registry.filteredMetricFamilySamples( - new HashSet(Arrays.asList("", "s_sum", "c", "part_filter_a", "part_filter_c"))))) { - metrics.add(metricFamilySamples.name); - for (Collector.MetricFamilySamples.Sample sample : metricFamilySamples.samples) { - series.add(sample.name); - } - } - - assertEquals(1, sr.collectCallCount); - assertEquals(2, pfr.collectCallCount); - assertEquals(new HashSet(Arrays.asList("s", "c", "part_filter_a", "part_filter_c")), metrics); - assertEquals(new HashSet(Arrays.asList("s_sum", "c", "part_filter_a", "part_filter_c")), series); - } - - @Test - public void testEmptyRegistryHasNoMoreElements() { - assertFalse(registry.metricFamilySamples().hasMoreElements()); - } - - @Test - public void testRegistryWithEmptyCollectorHasNoMoreElements() { - registry.register(new EmptyCollector()); - assertFalse(registry.metricFamilySamples().hasMoreElements()); - } - - @Test(expected = IllegalArgumentException.class) - public void testCounterAndGaugeWithSameNameThrows() { - Gauge.build().name("g").help("h").register(registry); - Counter.build().name("g").help("h").register(registry); - } - - @Test(expected = IllegalArgumentException.class) - public void testCounterAndSummaryWithSameNameThrows() { - Counter.build().name("s").help("h").register(registry); - Summary.build().name("s").help("h").register(registry); - } - - @Test(expected = IllegalArgumentException.class) - public void testCounterSumAndSummaryWithSameNameThrows() { - Counter.build().name("s_sum").help("h").register(registry); - Summary.build().name("s").help("h").register(registry); - } - - @Test(expected = IllegalArgumentException.class) - public void testHistogramAndSummaryWithSameNameThrows() { - Histogram.build().name("s").help("h").register(registry); - Summary.build().name("s").help("h").register(registry); - } - - @Test - public void testCanUnAndReregister() { - Histogram h = Histogram.build().name("s").help("h").create(); - registry.register(h); - registry.unregister(h); - registry.register(h); - } - - class MyCollector extends Collector { - public List collect() { - List mfs = new ArrayList(); - mfs.add(new GaugeMetricFamily("g", "help", 42)); - return mfs; - } - } - - @Test - public void testAutoDescribeDisabledByDefault() { - CollectorRegistry r = new CollectorRegistry(); - new MyCollector().register(r); - // This doesn't throw. - new MyCollector().register(r); - } - - @Test(expected = IllegalArgumentException.class) - public void testAutoDescribeThrowsOnReregisteringCustomCollector() { - CollectorRegistry r = new CollectorRegistry(true); - new MyCollector().register(r); - new MyCollector().register(r); - } - - private static class SkippedCollector extends Collector implements Collector.Describable { - public int collectCallCount = 0; - - @Override - public List collect() { - collectCallCount++; - List mfs = new ArrayList(); - mfs.add(new GaugeMetricFamily("slow_gauge", "help", 123)); - return mfs; - } - - @Override - public List describe() { - return collect(); - } - } - - private static class PartiallyFilterCollector extends Collector implements Collector.Describable { - public int collectCallCount = 0; - - @Override - public List collect() { - collectCallCount++; - List mfs = new ArrayList(); - mfs.add(new GaugeMetricFamily("part_filter_a", "help", 123)); - mfs.add(new GaugeMetricFamily("part_filter_b", "help", 123)); - mfs.add(new GaugeMetricFamily("part_filter_c", "help", 123)); - return mfs; - } - - @Override - public List describe() { - return collect(); - } - } - -} diff --git a/simpleclient/src/test/java/io/prometheus/client/CollectorTest.java b/simpleclient/src/test/java/io/prometheus/client/CollectorTest.java deleted file mode 100644 index 209e94ee5..000000000 --- a/simpleclient/src/test/java/io/prometheus/client/CollectorTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.prometheus.client; - -import org.junit.Test; - -import static org.junit.Assert.*; - -public class CollectorTest { - @Test - public void sanitizeMetricName() throws Exception { - assertEquals("_hoge", Collector.sanitizeMetricName("0hoge")); - assertEquals("foo_bar0", Collector.sanitizeMetricName("foo.bar0")); - } -} diff --git a/simpleclient/src/test/java/io/prometheus/client/CounterMetricFamilyTest.java b/simpleclient/src/test/java/io/prometheus/client/CounterMetricFamilyTest.java deleted file mode 100644 index f2b3e1b1a..000000000 --- a/simpleclient/src/test/java/io/prometheus/client/CounterMetricFamilyTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package io.prometheus.client; - -import static org.junit.Assert.assertEquals; - -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.junit.Before; -import org.junit.Test; - - -public class CounterMetricFamilyTest { - - CollectorRegistry registry; - - @Before - public void setUp() { - registry = new CollectorRegistry(); - } - - @Test - public void testJavadocExample() { - class YourCustomCollector extends Collector { - public List collect() { - List mfs = new ArrayList(); - // With no labels. - mfs.add(new CounterMetricFamily("my_counter", "help", 42)); - // With labels - CounterMetricFamily labeledCounter = new CounterMetricFamily("my_other_counter", "help", Arrays.asList("labelname")); - labeledCounter.addMetric(Arrays.asList("foo"), 4); - labeledCounter.addMetric(Arrays.asList("bar"), 5); - mfs.add(labeledCounter); - return mfs; - } - } - new YourCustomCollector().register(registry); - - assertEquals(42.0, registry.getSampleValue("my_counter").doubleValue(), .001); - assertEquals(null, registry.getSampleValue("my_other_counter")); - assertEquals(4.0, registry.getSampleValue("my_other_counter", new String[]{"labelname"}, new String[]{"foo"}).doubleValue(), .001); - assertEquals(5.0, registry.getSampleValue("my_other_counter", new String[]{"labelname"}, new String[]{"bar"}).doubleValue(), .001); - } - - @Test - public void testBuilderStyleUsage() { - class YourCustomCollector extends Collector { - public List collect() { - return Arrays.asList( - new CounterMetricFamily("my_metric", "help", Arrays.asList("name")) - .addMetric(Arrays.asList("value1"), 1.0) - .addMetric(Arrays.asList("value2"), 2.0) - ); - } - } - new YourCustomCollector().register(registry); - - assertEquals(1.0, - registry.getSampleValue("my_metric", new String[]{"name"}, new String[]{"value1"}) - .doubleValue(), .001); - assertEquals(2.0, - registry.getSampleValue("my_metric", new String[]{"name"}, new String[]{"value2"}) - .doubleValue(), .001); - } - -} diff --git a/simpleclient/src/test/java/io/prometheus/client/CounterTest.java b/simpleclient/src/test/java/io/prometheus/client/CounterTest.java deleted file mode 100644 index 16d025f73..000000000 --- a/simpleclient/src/test/java/io/prometheus/client/CounterTest.java +++ /dev/null @@ -1,85 +0,0 @@ -package io.prometheus.client; - -import static org.junit.Assert.assertEquals; - -import java.util.ArrayList; -import java.util.List; -import org.junit.Test; -import org.junit.Before; - - -public class CounterTest { - CollectorRegistry registry; - Counter noLabels, labels; - - @Before - public void setUp() { - registry = new CollectorRegistry(); - noLabels = Counter.build().name("nolabels").help("help").register(registry); - labels = Counter.build().name("labels").help("help").labelNames("l").register(registry); - } - - private double getValue() { - return registry.getSampleValue("nolabels").doubleValue(); - } - - @Test - public void testIncrement() { - noLabels.inc(); - assertEquals(1.0, getValue(), .001); - assertEquals(1.0, noLabels.get(), .001); - noLabels.inc(2); - assertEquals(3.0, getValue(), .001); - assertEquals(3.0, noLabels.get(), .001); - noLabels.labels().inc(4); - assertEquals(7.0, getValue(), .001); - assertEquals(7.0, noLabels.get(), .001); - noLabels.labels().inc(); - assertEquals(8.0, getValue(), .001); - assertEquals(8.0, noLabels.get(), .001); - } - - @Test(expected=IllegalArgumentException.class) - public void testNegativeIncrementFails() { - noLabels.inc(-1); - } - - @Test - public void noLabelsDefaultZeroValue() { - assertEquals(0.0, getValue(), .001); - } - - private Double getLabelsValue(String labelValue) { - return registry.getSampleValue("labels", new String[]{"l"}, new String[]{labelValue}); - } - - @Test - public void testLabels() { - assertEquals(null, getLabelsValue("a")); - assertEquals(null, getLabelsValue("b")); - labels.labels("a").inc(); - assertEquals(1.0, getLabelsValue("a").doubleValue(), .001); - assertEquals(null, getLabelsValue("b")); - labels.labels("b").inc(3); - assertEquals(1.0, getLabelsValue("a").doubleValue(), .001); - assertEquals(3.0, getLabelsValue("b").doubleValue(), .001); - } - - @Test - public void testCollect() { - labels.labels("a").inc(); - List mfs = labels.collect(); - - ArrayList samples = new ArrayList(); - ArrayList labelNames = new ArrayList(); - labelNames.add("l"); - ArrayList labelValues = new ArrayList(); - labelValues.add("a"); - samples.add(new Collector.MetricFamilySamples.Sample("labels", labelNames, labelValues, 1.0)); - Collector.MetricFamilySamples mfsFixture = new Collector.MetricFamilySamples("labels", Collector.Type.COUNTER, "help", samples); - - assertEquals(1, mfs.size()); - assertEquals(mfsFixture, mfs.get(0)); - } - -} diff --git a/simpleclient/src/test/java/io/prometheus/client/GaugeMetricFamilyTest.java b/simpleclient/src/test/java/io/prometheus/client/GaugeMetricFamilyTest.java deleted file mode 100644 index 06373dbd0..000000000 --- a/simpleclient/src/test/java/io/prometheus/client/GaugeMetricFamilyTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package io.prometheus.client; - -import static org.junit.Assert.assertEquals; - -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.junit.Before; -import org.junit.Test; - - -public class GaugeMetricFamilyTest { - - CollectorRegistry registry; - - @Before - public void setUp() { - registry = new CollectorRegistry(); - } - - @Test - public void testJavadocExample() { - class YourCustomCollector extends Collector { - public List collect() { - List mfs = new ArrayList(); - // With no labels. - mfs.add(new GaugeMetricFamily("my_gauge", "help", 42)); - // With labels - GaugeMetricFamily labeledGauge = new GaugeMetricFamily("my_other_gauge", "help", Arrays.asList("labelname")); - labeledGauge.addMetric(Arrays.asList("foo"), 4); - labeledGauge.addMetric(Arrays.asList("bar"), 5); - mfs.add(labeledGauge); - return mfs; - } - } - new YourCustomCollector().register(registry); - - assertEquals(42.0, registry.getSampleValue("my_gauge").doubleValue(), .001); - assertEquals(null, registry.getSampleValue("my_other_gauge")); - assertEquals(4.0, registry.getSampleValue("my_other_gauge", new String[]{"labelname"}, new String[]{"foo"}).doubleValue(), .001); - assertEquals(5.0, registry.getSampleValue("my_other_gauge", new String[]{"labelname"}, new String[]{"bar"}).doubleValue(), .001); - } - - @Test - public void testBuilderStyleUsage() { - class YourCustomCollector extends Collector { - public List collect() { - return Arrays.asList( - new GaugeMetricFamily("my_metric", "help", Arrays.asList("name")) - .addMetric(Arrays.asList("value1"), 1.0) - .addMetric(Arrays.asList("value2"), 2.0) - ); - } - } - new YourCustomCollector().register(registry); - - assertEquals(1.0, - registry.getSampleValue("my_metric", new String[]{"name"}, new String[]{"value1"}) - .doubleValue(), .001); - assertEquals(2.0, - registry.getSampleValue("my_metric", new String[]{"name"}, new String[]{"value2"}) - .doubleValue(), .001); - } - -} diff --git a/simpleclient/src/test/java/io/prometheus/client/GaugeTest.java b/simpleclient/src/test/java/io/prometheus/client/GaugeTest.java deleted file mode 100644 index 8058f5c90..000000000 --- a/simpleclient/src/test/java/io/prometheus/client/GaugeTest.java +++ /dev/null @@ -1,152 +0,0 @@ -package io.prometheus.client; - -import static org.junit.Assert.assertEquals; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.Callable; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - - -public class GaugeTest { - - CollectorRegistry registry; - Gauge noLabels, labels; - - @Before - public void setUp() { - registry = new CollectorRegistry(); - noLabels = Gauge.build().name("nolabels").help("help").register(registry); - labels = Gauge.build().name("labels").help("help").labelNames("l").register(registry); - } - - @After - public void tearDown() { - Gauge.Child.timeProvider = new Gauge.TimeProvider(); - } - - private double getValue() { - return registry.getSampleValue("nolabels").doubleValue(); - } - - @Test - public void testIncrement() { - noLabels.inc(); - assertEquals(1.0, getValue(), .001); - assertEquals(1.0, noLabels.get(), .001); - noLabels.inc(2); - assertEquals(3.0, getValue(), .001); - assertEquals(3.0, noLabels.get(), .001); - noLabels.labels().inc(4); - assertEquals(7.0, getValue(), .001); - assertEquals(7.0, noLabels.get(), .001); - noLabels.labels().inc(); - assertEquals(8.0, getValue(), .001); - assertEquals(8.0, noLabels.get(), .001); - } - - @Test - public void testDecrement() { - noLabels.dec(); - assertEquals(-1.0, getValue(), .001); - noLabels.dec(2); - assertEquals(-3.0, getValue(), .001); - noLabels.labels().dec(4); - assertEquals(-7.0, getValue(), .001); - noLabels.labels().dec(); - assertEquals(-8.0, getValue(), .001); - } - - @Test - public void testSet() { - noLabels.set(42); - assertEquals(42, getValue(), .001); - noLabels.labels().set(7); - assertEquals(7.0, getValue(), .001); - } - - @Test - public void testSetToCurrentTime() { - Gauge.Child.timeProvider = new Gauge.TimeProvider() { - long currentTimeMillis() { - return 42000; - } - }; - noLabels.setToCurrentTime(); - assertEquals(42, getValue(), .001); - } - - @Test - public void testTimer() { - Gauge.Child.timeProvider = new Gauge.TimeProvider() { - long value = (long)(30 * 1e9); - long nanoTime() { - value += (long)(10 * 1e9); - return value; - } - }; - - double elapsed = noLabels.setToTime(new Runnable() { - @Override - public void run() { - //no op - } - }); - assertEquals(10, getValue(), .001); - assertEquals(10, elapsed, .001); - - int result = noLabels.setToTime(new Callable() { - @Override - public Integer call() { - return 123; - } - }); - assertEquals(123, result); - assertEquals(10, getValue(), .001); - - Gauge.Timer timer = noLabels.startTimer(); - elapsed = timer.setDuration(); - assertEquals(10, getValue(), .001); - assertEquals(10, elapsed, .001); - } - - @Test - public void noLabelsDefaultZeroValue() { - assertEquals(0.0, getValue(), .001); - } - - private Double getLabelsValue(String labelValue) { - return registry.getSampleValue("labels", new String[]{"l"}, new String[]{labelValue}); - } - - @Test - public void testLabels() { - assertEquals(null, getLabelsValue("a")); - assertEquals(null, getLabelsValue("b")); - labels.labels("a").inc(); - assertEquals(1.0, getLabelsValue("a").doubleValue(), .001); - assertEquals(null, getLabelsValue("b")); - labels.labels("b").inc(3); - assertEquals(1.0, getLabelsValue("a").doubleValue(), .001); - assertEquals(3.0, getLabelsValue("b").doubleValue(), .001); - } - - @Test - public void testCollect() { - labels.labels("a").inc(); - List mfs = labels.collect(); - - ArrayList samples = new ArrayList(); - ArrayList labelNames = new ArrayList(); - labelNames.add("l"); - ArrayList labelValues = new ArrayList(); - labelValues.add("a"); - samples.add(new Collector.MetricFamilySamples.Sample("labels", labelNames, labelValues, 1.0)); - Collector.MetricFamilySamples mfsFixture = new Collector.MetricFamilySamples("labels", Collector.Type.GAUGE, "help", samples); - - assertEquals(1, mfs.size()); - assertEquals(mfsFixture, mfs.get(0)); - } -} diff --git a/simpleclient/src/test/java/io/prometheus/client/HistogramTest.java b/simpleclient/src/test/java/io/prometheus/client/HistogramTest.java deleted file mode 100644 index d5d44e3d4..000000000 --- a/simpleclient/src/test/java/io/prometheus/client/HistogramTest.java +++ /dev/null @@ -1,217 +0,0 @@ -package io.prometheus.client; - -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.Callable; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - - -public class HistogramTest { - - CollectorRegistry registry; - Histogram noLabels, labels; - - @Before - public void setUp() { - registry = new CollectorRegistry(); - noLabels = Histogram.build().name("nolabels").help("help").register(registry); - labels = Histogram.build().name("labels").help("help").labelNames("l").register(registry); - } - - @After - public void tearDown() { - SimpleTimer.defaultTimeProvider = new SimpleTimer.TimeProvider(); - } - - private double getCount() { - return registry.getSampleValue("nolabels_count").doubleValue(); - } - private double getSum() { - return registry.getSampleValue("nolabels_sum").doubleValue(); - } - private double getBucket(double b) { - return registry.getSampleValue("nolabels_bucket", - new String[]{"le"}, - new String[]{Collector.doubleToGoString(b)}).doubleValue(); - } - - @Test - public void testObserve() { - noLabels.observe(2); - assertEquals(1.0, getCount(), .001); - assertEquals(2.0, getSum(), .001); - assertEquals(0.0, getBucket(1), .001); - assertEquals(1.0, getBucket(2.5), .001); - noLabels.labels().observe(4); - assertEquals(2.0, getCount(), .001); - assertEquals(6.0, getSum(), .001); - assertEquals(0.0, getBucket(1), .001); - assertEquals(1.0, getBucket(2.5), .001); - assertEquals(2.0, getBucket(5), .001); - assertEquals(2.0, getBucket(7.5), .001); - assertEquals(2.0, getBucket(10), .001); - assertEquals(2.0, getBucket(Double.POSITIVE_INFINITY), .001); - } - - @Test - public void testBoundaryConditions() { - // Equal to a bucket. - noLabels.observe(2.5); - assertEquals(0.0, getBucket(1), .001); - assertEquals(1.0, getBucket(2.5), .001); - noLabels.labels().observe(Double.POSITIVE_INFINITY); - - // Infinity. - assertEquals(0.0, getBucket(1), .001); - assertEquals(1.0, getBucket(2.5), .001); - assertEquals(1.0, getBucket(5), .001); - assertEquals(1.0, getBucket(7.5), .001); - assertEquals(1.0, getBucket(10), .001); - assertEquals(2.0, getBucket(Double.POSITIVE_INFINITY), .001); - } - - @Test - public void testManualBuckets() { - Histogram h = Histogram.build().name("h").help("help").buckets(1, 2).create(); - assertArrayEquals(new double[]{1, 2, Double.POSITIVE_INFINITY}, h.getBuckets(), .001); - } - - @Test - public void testManualBucketsInfinityAlreadyIncluded() { - Histogram h = Histogram.build().buckets(1, 2, Double.POSITIVE_INFINITY).name("h").help("help").create(); - assertArrayEquals(new double[]{1, 2, Double.POSITIVE_INFINITY}, h.getBuckets(), .001); - } - - @Test - public void testLinearBuckets() { - Histogram h = Histogram.build().name("h").help("help").linearBuckets(1, 2, 3).create(); - assertArrayEquals(new double[]{1, 3, 5, Double.POSITIVE_INFINITY}, h.getBuckets(), .001); - } - - @Test - public void testExponentialBuckets() { - Histogram h = Histogram.build().name("h").help("help").exponentialBuckets(2, 2.5, 3).create(); - assertArrayEquals(new double[]{2, 5, 12.5, Double.POSITIVE_INFINITY}, h.getBuckets(), .001); - } - - @Test - public void testTimer() { - SimpleTimer.defaultTimeProvider = new SimpleTimer.TimeProvider() { - long value = (long)(30 * 1e9); - long nanoTime() { - value += (long)(10 * 1e9); - return value; - } - }; - - double elapsed = noLabels.time(new Runnable() { - @Override - public void run() { - //no op - } - }); - assertEquals(10, elapsed, .001); - - int result = noLabels.time(new Callable() { - @Override - public Integer call() { - return 123; - } - }); - assertEquals(123, result); - - Histogram.Timer timer = noLabels.startTimer(); - elapsed = timer.observeDuration(); - assertEquals(3, getCount(), .001); - assertEquals(30, getSum(), .001); - assertEquals(10, elapsed, .001); - } - - @Test - public void noLabelsDefaultZeroValue() { - assertEquals(0.0, getCount(), .001); - assertEquals(0.0, getSum(), .001); - } - - private Double getLabelsCount(String labelValue) { - return registry.getSampleValue("labels_count", new String[]{"l"}, new String[]{labelValue}); - } - private Double getLabelsSum(String labelValue) { - return registry.getSampleValue("labels_sum", new String[]{"l"}, new String[]{labelValue}); - } - - @Test - public void testLabels() { - assertEquals(null, getLabelsCount("a")); - assertEquals(null, getLabelsSum("a")); - assertEquals(null, getLabelsCount("b")); - assertEquals(null, getLabelsSum("b")); - labels.labels("a").observe(2); - assertEquals(1.0, getLabelsCount("a").doubleValue(), .001); - assertEquals(2.0, getLabelsSum("a").doubleValue(), .001); - assertEquals(null, getLabelsCount("b")); - assertEquals(null, getLabelsSum("b")); - labels.labels("b").observe(3); - assertEquals(1.0, getLabelsCount("a").doubleValue(), .001); - assertEquals(2.0, getLabelsSum("a").doubleValue(), .001); - assertEquals(1.0, getLabelsCount("b").doubleValue(), .001); - assertEquals(3.0, getLabelsSum("b").doubleValue(), .001); - } - - @Test(expected=IllegalStateException.class) - public void testLeLabelThrows() { - Histogram.build().name("labels").help("help").labelNames("le").create(); - } - - @Test - public void testCollect() { - labels.labels("a").observe(2); - List mfs = labels.collect(); - - ArrayList samples = new ArrayList(); - ArrayList labelNames = new ArrayList(); - labelNames.add("l"); - ArrayList labelValues = new ArrayList(); - labelValues.add("a"); - ArrayList labelNamesLe = new ArrayList(labelNames); - labelNamesLe.add("le"); - for (String bucket: new String[]{"0.005", "0.01", "0.025", "0.05", "0.075", "0.1", "0.25", "0.5", "0.75", "1.0"}) { - ArrayList labelValuesLe = new ArrayList(labelValues); - labelValuesLe.add(bucket); - samples.add(new Collector.MetricFamilySamples.Sample("labels_bucket", labelNamesLe, labelValuesLe, 0.0)); - } - for (String bucket: new String[]{"2.5", "5.0", "7.5", "10.0", "+Inf"}) { - ArrayList labelValuesLe = new ArrayList(labelValues); - labelValuesLe.add(bucket); - samples.add(new Collector.MetricFamilySamples.Sample("labels_bucket", labelNamesLe, labelValuesLe, 1.0)); - } - samples.add(new Collector.MetricFamilySamples.Sample("labels_count", labelNames, labelValues, 1.0)); - samples.add(new Collector.MetricFamilySamples.Sample("labels_sum", labelNames, labelValues, 2.0)); - Collector.MetricFamilySamples mfsFixture = new Collector.MetricFamilySamples("labels", Collector.Type.HISTOGRAM, "help", samples); - - assertEquals(1, mfs.size()); - assertEquals(mfsFixture, mfs.get(0)); - } - - @Test - public void testChildAndValuePublicApi() throws Exception { - assertTrue(Modifier.isPublic(Histogram.Child.class.getModifiers())); - - final Method getMethod = Histogram.Child.class.getMethod("get"); - assertTrue(Modifier.isPublic(getMethod.getModifiers())); - assertEquals(Histogram.Child.Value.class, getMethod.getReturnType()); - - assertTrue(Modifier.isPublic(Histogram.Child.Value.class.getModifiers())); - assertTrue(Modifier.isPublic(Histogram.Child.Value.class.getField("sum").getModifiers())); - assertTrue(Modifier.isPublic(Histogram.Child.Value.class.getField("buckets").getModifiers())); - } - -} diff --git a/simpleclient/src/test/java/io/prometheus/client/SimpleCollectorTest.java b/simpleclient/src/test/java/io/prometheus/client/SimpleCollectorTest.java deleted file mode 100644 index d5c7e3e32..000000000 --- a/simpleclient/src/test/java/io/prometheus/client/SimpleCollectorTest.java +++ /dev/null @@ -1,148 +0,0 @@ -package io.prometheus.client; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertNotNull; - -import org.junit.Test; -import org.junit.Before; - - -public class SimpleCollectorTest { - - CollectorRegistry registry; - Gauge metric; - Gauge noLabels; - - @Before - public void setUp() { - registry = new CollectorRegistry(); - metric = Gauge.build().name("labels").help("help").labelNames("l").register(registry); - noLabels = Gauge.build().name("nolabels").help("help").register(registry); - } - - private Double getValue(String labelValue) { - return registry.getSampleValue("labels", new String[]{"l"}, new String[]{labelValue}); - } - - private Double getValueNoLabels() { - return registry.getSampleValue("nolabels"); - } - - @Test(expected=IllegalArgumentException.class) - public void testTooFewLabelsThrows() { - metric.labels(); - } - - @Test(expected=IllegalArgumentException.class) - public void testNullLabelThrows() { - metric.labels(new String[]{null}); - } - - @Test(expected=IllegalArgumentException.class) - public void testTooManyLabelsThrows() { - metric.labels("a", "b"); - } - - @Test - public void testRemove() { - metric.labels("a"); - assertNotNull(getValue("a")); - assertNull(getValue("b")); - metric.labels("b").set(7); - assertNotNull(getValue("a")); - assertNotNull(getValue("b")); - metric.remove("b"); - assertNotNull(getValue("a")); - assertNull(getValue("b")); - - // Brand new Child. - metric.labels("b").inc(); - assertEquals(1.0, getValue("b").doubleValue(), .001); - } - - @Test - public void testNoLabelsWorkAfterRemove() { - noLabels.inc(1); - assertEquals(getValueNoLabels(), 1.0, .001); - noLabels.remove(); - noLabels.inc(2); - assertEquals(getValueNoLabels(), 2.0, .001); - } - - @Test - public void testClear() { - assertNull(getValue("a")); - metric.labels("a").set(7); - assertNotNull(getValue("a")); - metric.clear(); - assertNull(getValue("a")); - - // Brand new Child. - metric.labels("a").inc(); - assertEquals(1.0, getValue("a").doubleValue(), .001); - } - - @Test - public void testNoLabelsWorkAfterClear() { - noLabels.inc(1); - assertEquals(getValueNoLabels(), 1.0, .001); - noLabels.clear(); - noLabels.inc(2); - assertEquals(getValueNoLabels(), 2.0, .001); - } - - @Test - public void testNameIsConcatenated() { - assertEquals("a_b_c", Gauge.build().name("c").subsystem("b").namespace("a").help("h").create().fullname); - } - - @Test(expected=IllegalStateException.class) - public void testNameIsRequired() { - Gauge.build().help("h").create(); - } - - @Test(expected=IllegalStateException.class) - public void testHelpIsRequired() { - Gauge.build().name("c").create(); - } - - @Test(expected=IllegalArgumentException.class) - public void testInvalidNameThrows() { - Gauge.build().name("c'a").create(); - } - - @Test(expected=IllegalArgumentException.class) - public void testInvalidLabelNameThrows() { - Gauge.build().name("a").labelNames("c:d").help("h").create(); - } - - @Test(expected=IllegalArgumentException.class) - public void testReservedLabelNameThrows() { - Gauge.build().name("a").labelNames("__name__").help("h").create(); - } - - @Test - public void testSetChild() { - metric.setChild(new Gauge.Child(){ - public double get() { - return 42; - } - }, "a"); - assertEquals(42.0, getValue("a").doubleValue(), .001); - } - - @Test - public void testSetChildReturnsGauge() { - Gauge g = metric.setChild(new Gauge.Child(){ - public double get() { - return 42; - } - }, "a"); - } - - @Test - public void testCreateReturnsGauge() { - Gauge g = Gauge.build().name("labels").help("help").labelNames("l").create(); - } -} diff --git a/simpleclient/src/test/java/io/prometheus/client/SimpleTimerTest.java b/simpleclient/src/test/java/io/prometheus/client/SimpleTimerTest.java deleted file mode 100644 index d988ae703..000000000 --- a/simpleclient/src/test/java/io/prometheus/client/SimpleTimerTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package io.prometheus.client; - -import org.junit.Test; - -import static org.junit.Assert.assertEquals; - -public class SimpleTimerTest { - @Test - public void elapsedSeconds() throws Exception { - SimpleTimer.TimeProvider provider = new SimpleTimer.TimeProvider() { - long value = (long)(30 * 1e9); - long nanoTime() { - value += (long)(10 * 1e9); - return value; - } - }; - - SimpleTimer timer = new SimpleTimer(provider); - assertEquals(10, timer.elapsedSeconds(), .001); - - } - -} diff --git a/simpleclient/src/test/java/io/prometheus/client/SummaryMetricFamilyTest.java b/simpleclient/src/test/java/io/prometheus/client/SummaryMetricFamilyTest.java deleted file mode 100644 index 23dd488d6..000000000 --- a/simpleclient/src/test/java/io/prometheus/client/SummaryMetricFamilyTest.java +++ /dev/null @@ -1,68 +0,0 @@ -package io.prometheus.client; - -import static org.junit.Assert.assertEquals; - -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.junit.Before; -import org.junit.Test; - - -public class SummaryMetricFamilyTest { - - CollectorRegistry registry; - - @Before - public void setUp() { - registry = new CollectorRegistry(); - } - - @Test - public void testJavadocExample() { - class YourCustomCollector extends Collector { - public List collect() { - List mfs = new ArrayList(); - // With no labels. - mfs.add(new SummaryMetricFamily("my_summary", "help", 1, 42)); - // With labels. Record 95th percentile as 3, and 99th percentile as 5. - SummaryMetricFamily labeledSummary = new SummaryMetricFamily("my_other_summary", "help", - Arrays.asList("labelname"), Arrays.asList(.95, .99)); - labeledSummary.addMetric(Arrays.asList("foo"), 2, 10, Arrays.asList(3.0, 5.0)); - mfs.add(labeledSummary); - return mfs; - } - } - new YourCustomCollector().register(registry); - - assertEquals(1.0, registry.getSampleValue("my_summary_count").doubleValue(), .001); - assertEquals(42.0, registry.getSampleValue("my_summary_sum").doubleValue(), .001); - - assertEquals(2.0, registry.getSampleValue("my_other_summary_count", new String[]{"labelname"}, new String[]{"foo"}).doubleValue(), .001); - assertEquals(10.0, registry.getSampleValue("my_other_summary_sum", new String[]{"labelname"}, new String[]{"foo"}).doubleValue(), .001); - assertEquals(3.0, registry.getSampleValue("my_other_summary", new String[]{"labelname", "quantile"}, new String[]{"foo", "0.95"}).doubleValue(), .001); - assertEquals(5.0, registry.getSampleValue("my_other_summary", new String[]{"labelname", "quantile"}, new String[]{"foo", "0.99"}).doubleValue(), .001); - } - - @Test - public void testBuilderStyleUsage() { - class YourCustomCollector extends Collector { - public List collect() { - return Arrays.asList( - new SummaryMetricFamily("my_metric", "help", Arrays.asList("name")) - .addMetric(Arrays.asList("value1"), 1, 1.0) - .addMetric(Arrays.asList("value2"), 2, 2.0) - ); - } - } - new YourCustomCollector().register(registry); - - assertEquals(1.0, - registry.getSampleValue("my_metric_count", new String[]{"name"}, new String[]{"value1"}) - .doubleValue(), .001); - assertEquals(2.0, - registry.getSampleValue("my_metric_count", new String[]{"name"}, new String[]{"value2"}) - .doubleValue(), .001); - } - -} diff --git a/simpleclient/src/test/java/io/prometheus/client/SummaryTest.java b/simpleclient/src/test/java/io/prometheus/client/SummaryTest.java deleted file mode 100644 index 06e1f9d9b..000000000 --- a/simpleclient/src/test/java/io/prometheus/client/SummaryTest.java +++ /dev/null @@ -1,222 +0,0 @@ -package io.prometheus.client; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.Callable; - -import static java.util.Arrays.asList; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - - -public class SummaryTest { - - CollectorRegistry registry; - Summary noLabels, labels, labelsAndQuantiles, noLabelsAndQuantiles; - - @Before - public void setUp() { - registry = new CollectorRegistry(); - noLabels = Summary.build().name("nolabels").help("help").register(registry); - labels = Summary.build().name("labels").help("help").labelNames("l").register(registry); - noLabelsAndQuantiles = Summary.build() - .quantile(0.5, 0.05) - .quantile(0.9, 0.01) - .quantile(0.99, 0.001) - .name("no_labels_and_quantiles").help("help").register(registry); - labelsAndQuantiles = Summary.build() - .quantile(0.5, 0.05) - .quantile(0.9, 0.01) - .quantile(0.99, 0.001) - .labelNames("l") - .name("labels_and_quantiles").help("help").register(registry); - } - - @After - public void tearDown() { - SimpleTimer.defaultTimeProvider = new SimpleTimer.TimeProvider(); - } - - private double getCount() { - return registry.getSampleValue("nolabels_count").doubleValue(); - } - private double getSum() { - return registry.getSampleValue("nolabels_sum").doubleValue(); - } - private double getNoLabelQuantile(double q) { - return registry.getSampleValue("no_labels_and_quantiles", new String[]{"quantile"}, new String[]{Collector.doubleToGoString(q)}).doubleValue(); - } - private double getLabeledQuantile(String labelValue, double q) { - return registry.getSampleValue("labels_and_quantiles", new String[]{"l", "quantile"}, new String[]{labelValue, Collector.doubleToGoString(q)}).doubleValue(); - } - - @Test - public void testObserve() { - noLabels.observe(2); - assertEquals(1.0, getCount(), .001); - assertEquals(2.0, getSum(), .001); - assertEquals(1.0, noLabels.get().count, .001); - assertEquals(2.0, noLabels.get().sum, .001); - noLabels.labels().observe(4); - assertEquals(2.0, getCount(), .001); - assertEquals(6.0, getSum(), .001); - assertEquals(2.0, noLabels.get().count, .001); - assertEquals(6.0, noLabels.get().sum, .001); - } - - @Test - public void testQuantiles() { - int nSamples = 1000000; // simulate one million samples - - for (int i=1; i<=nSamples; i++) { - // In this test, we observe the numbers from 1 to nSamples, - // because that makes it easy to verify if the quantiles are correct. - labelsAndQuantiles.labels("a").observe(i); - noLabelsAndQuantiles.observe(i); - } - assertEquals(getNoLabelQuantile(0.5), 0.5 * nSamples, 0.05 * nSamples); - assertEquals(getNoLabelQuantile(0.9), 0.9 * nSamples, 0.01 * nSamples); - assertEquals(getNoLabelQuantile(0.99), 0.99 * nSamples, 0.001 * nSamples); - - assertEquals(getLabeledQuantile("a", 0.5), 0.5 * nSamples, 0.05 * nSamples); - assertEquals(getLabeledQuantile("a", 0.9), 0.9 * nSamples, 0.01 * nSamples); - assertEquals(getLabeledQuantile("a", 0.99), 0.99 * nSamples, 0.001 * nSamples); - } - - @Test - public void testMaxAge() throws InterruptedException { - Summary summary = Summary.build() - .quantile(0.99, 0.001) - .maxAgeSeconds(1) // After 1s, all observations will be discarded. - .ageBuckets(2) // We got 2 buckets, so we discard one bucket every 500ms. - .name("short_attention_span").help("help").register(registry); - summary.observe(8.0); - double val = registry.getSampleValue("short_attention_span", new String[]{"quantile"}, new String[]{Collector.doubleToGoString(0.99)}).doubleValue(); - assertEquals(8.0, val, 0.0); // From bucket 1. - Thread.sleep(600); - val = registry.getSampleValue("short_attention_span", new String[]{"quantile"}, new String[]{Collector.doubleToGoString(0.99)}).doubleValue(); - assertEquals(8.0, val, 0.0); // From bucket 2. - Thread.sleep(600); - val = registry.getSampleValue("short_attention_span", new String[]{"quantile"}, new String[]{Collector.doubleToGoString(0.99)}).doubleValue(); - assertEquals(Double.NaN, val, 0.0); // Bucket 1 again, now it is empty. - } - - @Test - public void testTimer() { - SimpleTimer.defaultTimeProvider = new SimpleTimer.TimeProvider() { - long value = (long)(30 * 1e9); - long nanoTime() { - value += (long)(10 * 1e9); - return value; - } - }; - - double elapsed = noLabels.time(new Runnable() { - @Override - public void run() { - //no op - } - }); - assertEquals(10, elapsed, .001); - - int result = noLabels.time(new Callable() { - @Override - public Integer call() { - return 123; - } - }); - assertEquals(123, result); - - Summary.Timer timer = noLabels.startTimer(); - elapsed = timer.observeDuration(); - assertEquals(3, getCount(), .001); - assertEquals(30, getSum(), .001); - assertEquals(10, elapsed, .001); - } - - @Test - public void noLabelsDefaultZeroValue() { - assertEquals(0.0, getCount(), .001); - assertEquals(0.0, getSum(), .001); - } - - private Double getLabelsCount(String labelValue) { - return registry.getSampleValue("labels_count", new String[]{"l"}, new String[]{labelValue}); - } - private Double getLabelsSum(String labelValue) { - return registry.getSampleValue("labels_sum", new String[]{"l"}, new String[]{labelValue}); - } - - @Test - public void testLabels() { - assertEquals(null, getLabelsCount("a")); - assertEquals(null, getLabelsSum("a")); - assertEquals(null, getLabelsCount("b")); - assertEquals(null, getLabelsSum("b")); - labels.labels("a").observe(2); - assertEquals(1.0, getLabelsCount("a").doubleValue(), .001); - assertEquals(2.0, getLabelsSum("a").doubleValue(), .001); - assertEquals(null, getLabelsCount("b")); - assertEquals(null, getLabelsSum("b")); - labels.labels("b").observe(3); - assertEquals(1.0, getLabelsCount("a").doubleValue(), .001); - assertEquals(2.0, getLabelsSum("a").doubleValue(), .001); - assertEquals(1.0, getLabelsCount("b").doubleValue(), .001); - assertEquals(3.0, getLabelsSum("b").doubleValue(), .001); - } - - @Test - public void testCollect() { - labels.labels("a").observe(2); - List mfs = labels.collect(); - - ArrayList samples = new ArrayList(); - ArrayList labelNames = new ArrayList(); - labelNames.add("l"); - ArrayList labelValues = new ArrayList(); - labelValues.add("a"); - samples.add(new Collector.MetricFamilySamples.Sample("labels_count", labelNames, labelValues, 1.0)); - samples.add(new Collector.MetricFamilySamples.Sample("labels_sum", labelNames, labelValues, 2.0)); - Collector.MetricFamilySamples mfsFixture = new Collector.MetricFamilySamples("labels", Collector.Type.SUMMARY, "help", samples); - - assertEquals(1, mfs.size()); - assertEquals(mfsFixture, mfs.get(0)); - } - - @Test - public void testCollectWithQuantiles() { - labelsAndQuantiles.labels("a").observe(2); - List mfs = labelsAndQuantiles.collect(); - - ArrayList samples = new ArrayList(); - samples.add(new Collector.MetricFamilySamples.Sample("labels_and_quantiles", asList("l", "quantile"), asList("a", "0.5"), 2.0)); - samples.add(new Collector.MetricFamilySamples.Sample("labels_and_quantiles", asList("l", "quantile"), asList("a", "0.9"), 2.0)); - samples.add(new Collector.MetricFamilySamples.Sample("labels_and_quantiles", asList("l", "quantile"), asList("a", "0.99"), 2.0)); - samples.add(new Collector.MetricFamilySamples.Sample("labels_and_quantiles_count", asList("l"), asList("a"), 1.0)); - samples.add(new Collector.MetricFamilySamples.Sample("labels_and_quantiles_sum", asList("l"), asList("a"), 2.0)); - Collector.MetricFamilySamples mfsFixture = new Collector.MetricFamilySamples("labels_and_quantiles", Collector.Type.SUMMARY, "help", samples); - - assertEquals(1, mfs.size()); - assertEquals(mfsFixture, mfs.get(0)); - } - - @Test - public void testChildAndValuePublicApi() throws Exception { - assertTrue(Modifier.isPublic(Summary.Child.class.getModifiers())); - - final Method getMethod = Summary.Child.class.getMethod("get"); - assertTrue(Modifier.isPublic(getMethod.getModifiers())); - assertEquals(Summary.Child.Value.class, getMethod.getReturnType()); - - assertTrue(Modifier.isPublic(Summary.Child.Value.class.getModifiers())); - assertTrue(Modifier.isPublic(Summary.Child.Value.class.getField("count").getModifiers())); - assertTrue(Modifier.isPublic(Summary.Child.Value.class.getField("sum").getModifiers())); - assertTrue(Modifier.isPublic(Summary.Child.Value.class.getField("quantiles").getModifiers())); - } -} diff --git a/simpleclient_caffeine/pom.xml b/simpleclient_caffeine/pom.xml deleted file mode 100644 index f882b57ba..000000000 --- a/simpleclient_caffeine/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - 4.0.0 - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_caffeine - bundle - - Prometheus Java Simpleclient Caffeine - - Metrics collector for caffeine based caches - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - checketts - Clint Checketts - checketts@gmail.com - - - - - - io.prometheus - simpleclient - 0.6.1-SNAPSHOT - - - com.github.ben-manes.caffeine - caffeine - 2.3.0 - - - - - junit - junit - 4.11 - test - - - - org.mockito - mockito-core - 1.9.5 - test - - - org.assertj - assertj-core - 2.6.0 - test - - - - diff --git a/simpleclient_caffeine/src/main/java/io/prometheus/client/cache/caffeine/CacheMetricsCollector.java b/simpleclient_caffeine/src/main/java/io/prometheus/client/cache/caffeine/CacheMetricsCollector.java deleted file mode 100644 index d32ddb44c..000000000 --- a/simpleclient_caffeine/src/main/java/io/prometheus/client/cache/caffeine/CacheMetricsCollector.java +++ /dev/null @@ -1,165 +0,0 @@ -package io.prometheus.client.cache.caffeine; - -import com.github.benmanes.caffeine.cache.AsyncLoadingCache; -import com.github.benmanes.caffeine.cache.Cache; -import com.github.benmanes.caffeine.cache.LoadingCache; -import com.github.benmanes.caffeine.cache.stats.CacheStats; -import io.prometheus.client.Collector; -import io.prometheus.client.CounterMetricFamily; -import io.prometheus.client.GaugeMetricFamily; -import io.prometheus.client.SummaryMetricFamily; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; - - -/** - * Collect metrics from Caffiene's com.github.benmanes.caffeine.cache.Cache. - *

    - *

    {@code
    - *
    - * // Note that `recordStats()` is required to gather non-zero statistics
    - * Cache cache = Caffeine.newBuilder().recordStats().build();
    - * CacheMetricsCollector cacheMetrics = new CacheMetricsCollector().register();
    - * cacheMetrics.addCache("mycache", cache);
    - *
    - * }
    - * - * Exposed metrics are labeled with the provided cache name. - * - * With the example above, sample metric names would be: - *
    - *     caffeine_cache_hit_total{cache="mycache"} 10.0
    - *     caffeine_cache_miss_total{cache="mycache"} 3.0
    - *     caffeine_cache_requests_total{cache="mycache"} 13.0
    - *     caffeine_cache_eviction_total{cache="mycache"} 1.0
    - *     caffeine_cache_estimated_size{cache="mycache"} 5.0
    - * 
    - * - * Additionally if the cache includes a loader, the following metrics would be provided: - *
    - *     caffeine_cache_load_failure_total{cache="mycache"} 2.0
    - *     caffeine_cache_loads_total{cache="mycache"} 7.0
    - *     caffeine_cache_load_duration_seconds_count{cache="mycache"} 7.0
    - *     caffeine_cache_load_duration_seconds_sum{cache="mycache"} 0.0034
    - * 
    - * - */ -public class CacheMetricsCollector extends Collector { - protected final ConcurrentMap children = new ConcurrentHashMap(); - - /** - * Add or replace the cache with the given name. - *

    - * Any references any previous cache with this name is invalidated. - * - * @param cacheName The name of the cache, will be the metrics label value - * @param cache The cache being monitored - */ - public void addCache(String cacheName, Cache cache) { - children.put(cacheName, cache); - } - - /** - * Add or replace the cache with the given name. - *

    - * Any references any previous cache with this name is invalidated. - * - * @param cacheName The name of the cache, will be the metrics label value - * @param cache The cache being monitored - */ - public void addCache(String cacheName, AsyncLoadingCache cache) { - children.put(cacheName, cache.synchronous()); - } - - /** - * Remove the cache with the given name. - *

    - * Any references to the cache are invalidated. - * - * @param cacheName cache to be removed - */ - public Cache removeCache(String cacheName) { - return children.remove(cacheName); - } - - /** - * Remove all caches. - *

    - * Any references to all caches are invalidated. - */ - public void clear(){ - children.clear(); - } - - @Override - public List collect() { - List mfs = new ArrayList(); - List labelNames = Arrays.asList("cache"); - - CounterMetricFamily cacheHitTotal = new CounterMetricFamily("caffeine_cache_hit_total", - "Cache hit totals", labelNames); - mfs.add(cacheHitTotal); - - CounterMetricFamily cacheMissTotal = new CounterMetricFamily("caffeine_cache_miss_total", - "Cache miss totals", labelNames); - mfs.add(cacheMissTotal); - - CounterMetricFamily cacheRequestsTotal = new CounterMetricFamily("caffeine_cache_requests_total", - "Cache request totals, hits + misses", labelNames); - mfs.add(cacheRequestsTotal); - - CounterMetricFamily cacheEvictionTotal = new CounterMetricFamily("caffeine_cache_eviction_total", - "Cache eviction totals, doesn't include manually removed entries", labelNames); - mfs.add(cacheEvictionTotal); - - GaugeMetricFamily cacheEvictionWeight = new GaugeMetricFamily("caffeine_cache_eviction_weight", - "Cache eviction weight", labelNames); - mfs.add(cacheEvictionWeight); - - CounterMetricFamily cacheLoadFailure = new CounterMetricFamily("caffeine_cache_load_failure_total", - "Cache load failures", labelNames); - mfs.add(cacheLoadFailure); - - CounterMetricFamily cacheLoadTotal = new CounterMetricFamily("caffeine_cache_loads_total", - "Cache loads: both success and failures", labelNames); - mfs.add(cacheLoadTotal); - - GaugeMetricFamily cacheSize = new GaugeMetricFamily("caffeine_cache_estimated_size", - "Estimated cache size", labelNames); - mfs.add(cacheSize); - - SummaryMetricFamily cacheLoadSummary = new SummaryMetricFamily("caffeine_cache_load_duration_seconds", - "Cache load duration: both success and failures", labelNames); - mfs.add(cacheLoadSummary); - - for(Map.Entry c: children.entrySet()) { - List cacheName = Arrays.asList(c.getKey()); - CacheStats stats = c.getValue().stats(); - - try{ - cacheEvictionWeight.addMetric(cacheName, stats.evictionWeight()); - } catch (Exception e) { - // EvictionWeight metric is unavailable, newer version of Caffeine is needed. - } - - cacheHitTotal.addMetric(cacheName, stats.hitCount()); - cacheMissTotal.addMetric(cacheName, stats.missCount()); - cacheRequestsTotal.addMetric(cacheName, stats.requestCount()); - cacheEvictionTotal.addMetric(cacheName, stats.evictionCount()); - cacheSize.addMetric(cacheName, c.getValue().estimatedSize()); - - if(c.getValue() instanceof LoadingCache) { - cacheLoadFailure.addMetric(cacheName, stats.loadFailureCount()); - cacheLoadTotal.addMetric(cacheName, stats.loadCount()); - - cacheLoadSummary.addMetric(cacheName, stats.loadCount(), stats.totalLoadTime() / Collector.NANOSECONDS_PER_SECOND); - } - } - return mfs; - } -} diff --git a/simpleclient_caffeine/src/test/java/io/prometheus/client/cache/caffeine/CacheMetricsCollectorTest.java b/simpleclient_caffeine/src/test/java/io/prometheus/client/cache/caffeine/CacheMetricsCollectorTest.java deleted file mode 100644 index 3bc034b17..000000000 --- a/simpleclient_caffeine/src/test/java/io/prometheus/client/cache/caffeine/CacheMetricsCollectorTest.java +++ /dev/null @@ -1,95 +0,0 @@ -package io.prometheus.client.cache.caffeine; - -import com.github.benmanes.caffeine.cache.AsyncLoadingCache; -import com.github.benmanes.caffeine.cache.Cache; -import com.github.benmanes.caffeine.cache.CacheLoader; -import com.github.benmanes.caffeine.cache.Caffeine; -import com.github.benmanes.caffeine.cache.LoadingCache; -import io.prometheus.client.CollectorRegistry; -import org.junit.Test; - -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Executor; - -import static org.assertj.core.api.Java6Assertions.assertThat; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class CacheMetricsCollectorTest { - - @Test - public void cacheExposesMetricsForHitMissAndEviction() throws Exception { - Cache cache = Caffeine.newBuilder().maximumSize(2).recordStats().executor(new Executor() { - @Override - public void execute(Runnable command) { - // Run cleanup in same thread, to remove async behavior with evictions - command.run(); - } - }).build(); - CollectorRegistry registry = new CollectorRegistry(); - - CacheMetricsCollector collector = new CacheMetricsCollector().register(registry); - collector.addCache("users", cache); - - cache.getIfPresent("user1"); - cache.getIfPresent("user1"); - cache.put("user1", "First User"); - cache.getIfPresent("user1"); - - // Add to cache to trigger eviction. - cache.put("user2", "Second User"); - cache.put("user3", "Third User"); - cache.put("user4", "Fourth User"); - - assertMetric(registry, "caffeine_cache_hit_total", "users", 1.0); - assertMetric(registry, "caffeine_cache_miss_total", "users", 2.0); - assertMetric(registry, "caffeine_cache_requests_total", "users", 3.0); - assertMetric(registry, "caffeine_cache_eviction_total", "users", 2.0); - } - - - @SuppressWarnings("unchecked") - @Test - public void loadingCacheExposesMetricsForLoadsAndExceptions() throws Exception { - CacheLoader loader = mock(CacheLoader.class); - when(loader.load(anyString())) - .thenReturn("First User") - .thenThrow(new RuntimeException("Seconds time fails")) - .thenReturn("Third User"); - - LoadingCache cache = Caffeine.newBuilder().recordStats().build(loader); - CollectorRegistry registry = new CollectorRegistry(); - CacheMetricsCollector collector = new CacheMetricsCollector().register(registry); - collector.addCache("loadingusers", cache); - - cache.get("user1"); - cache.get("user1"); - try { - cache.get("user2"); - } catch (Exception e) { - // ignoring. - } - cache.get("user3"); - - assertMetric(registry, "caffeine_cache_hit_total", "loadingusers", 1.0); - assertMetric(registry, "caffeine_cache_miss_total", "loadingusers", 3.0); - - assertMetric(registry, "caffeine_cache_load_failure_total", "loadingusers", 1.0); - assertMetric(registry, "caffeine_cache_loads_total", "loadingusers", 3.0); - - assertMetric(registry, "caffeine_cache_load_duration_seconds_count", "loadingusers", 3.0); - assertMetricGreatThan(registry, "caffeine_cache_load_duration_seconds_sum", "loadingusers", 0.0); - } - - private void assertMetric(CollectorRegistry registry, String name, String cacheName, double value) { - assertThat(registry.getSampleValue(name, new String[]{"cache"}, new String[]{cacheName})).isEqualTo(value); - } - - - private void assertMetricGreatThan(CollectorRegistry registry, String name, String cacheName, double value) { - assertThat(registry.getSampleValue(name, new String[]{"cache"}, new String[]{cacheName})).isGreaterThan(value); - } - - -} diff --git a/simpleclient_common/pom.xml b/simpleclient_common/pom.xml deleted file mode 100644 index 33c60ee9d..000000000 --- a/simpleclient_common/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - 4.0.0 - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_common - bundle - - Prometheus Java Simpleclient Common - - Common code used by various modules of the Simpleclient. - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - brian-brazil - Brian Brazil - brian.brazil@boxever.com - - - - - - io.prometheus - simpleclient - 0.6.1-SNAPSHOT - - - - junit - junit - 4.11 - test - - - diff --git a/simpleclient_common/src/main/java/io/prometheus/client/exporter/common/TextFormat.java b/simpleclient_common/src/main/java/io/prometheus/client/exporter/common/TextFormat.java deleted file mode 100644 index 954edfda8..000000000 --- a/simpleclient_common/src/main/java/io/prometheus/client/exporter/common/TextFormat.java +++ /dev/null @@ -1,107 +0,0 @@ -package io.prometheus.client.exporter.common; - -import java.io.IOException; -import java.io.Writer; -import java.util.Enumeration; - -import io.prometheus.client.Collector; - -public class TextFormat { - /** - * Content-type for text version 0.0.4. - */ - public final static String CONTENT_TYPE_004 = "text/plain; version=0.0.4; charset=utf-8"; - - /** - * Write out the text version 0.0.4 of the given MetricFamilySamples. - */ - public static void write004(Writer writer, Enumeration mfs) throws IOException { - /* See http://prometheus.io/docs/instrumenting/exposition_formats/ - * for the output format specification. */ - while(mfs.hasMoreElements()) { - Collector.MetricFamilySamples metricFamilySamples = mfs.nextElement(); - writer.write("# HELP "); - writer.write(metricFamilySamples.name); - writer.write(' '); - writeEscapedHelp(writer, metricFamilySamples.help); - writer.write('\n'); - - writer.write("# TYPE "); - writer.write(metricFamilySamples.name); - writer.write(' '); - writer.write(typeString(metricFamilySamples.type)); - writer.write('\n'); - - for (Collector.MetricFamilySamples.Sample sample: metricFamilySamples.samples) { - writer.write(sample.name); - if (sample.labelNames.size() > 0) { - writer.write('{'); - for (int i = 0; i < sample.labelNames.size(); ++i) { - writer.write(sample.labelNames.get(i)); - writer.write("=\""); - writeEscapedLabelValue(writer, sample.labelValues.get(i)); - writer.write("\","); - } - writer.write('}'); - } - writer.write(' '); - writer.write(Collector.doubleToGoString(sample.value)); - if (sample.timestampMs != null){ - writer.write(' '); - writer.write(sample.timestampMs.toString()); - } - writer.write('\n'); - } - } - } - - private static void writeEscapedHelp(Writer writer, String s) throws IOException { - for (int i = 0; i < s.length(); i++) { - char c = s.charAt(i); - switch (c) { - case '\\': - writer.append("\\\\"); - break; - case '\n': - writer.append("\\n"); - break; - default: - writer.append(c); - } - } - } - - private static void writeEscapedLabelValue(Writer writer, String s) throws IOException { - for (int i = 0; i < s.length(); i++) { - char c = s.charAt(i); - switch (c) { - case '\\': - writer.append("\\\\"); - break; - case '\"': - writer.append("\\\""); - break; - case '\n': - writer.append("\\n"); - break; - default: - writer.append(c); - } - } - } - - private static String typeString(Collector.Type t) { - switch (t) { - case GAUGE: - return "gauge"; - case COUNTER: - return "counter"; - case SUMMARY: - return "summary"; - case HISTOGRAM: - return "histogram"; - default: - return "untyped"; - } - } -} diff --git a/simpleclient_common/src/test/java/io/prometheus/client/exporter/common/TextFormatTest.java b/simpleclient_common/src/test/java/io/prometheus/client/exporter/common/TextFormatTest.java deleted file mode 100644 index 67a01b38e..000000000 --- a/simpleclient_common/src/test/java/io/prometheus/client/exporter/common/TextFormatTest.java +++ /dev/null @@ -1,140 +0,0 @@ -package io.prometheus.client.exporter.common; - -import static org.junit.Assert.assertEquals; - -import java.io.IOException; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.List; - -import org.junit.Before; -import org.junit.Test; - -import io.prometheus.client.Collector; -import io.prometheus.client.CollectorRegistry; -import io.prometheus.client.Counter; -import io.prometheus.client.Gauge; -import io.prometheus.client.Summary; - - -public class TextFormatTest { - CollectorRegistry registry; - StringWriter writer; - - @Before - public void setUp() { - registry = new CollectorRegistry(); - writer = new StringWriter(); - } - - @Test - public void testGaugeOutput() throws IOException { - Gauge noLabels = Gauge.build().name("nolabels").help("help").register(registry); - noLabels.inc(); - TextFormat.write004(writer, registry.metricFamilySamples()); - assertEquals("# HELP nolabels help\n" - + "# TYPE nolabels gauge\n" - + "nolabels 1.0\n", writer.toString()); - } - - @Test - public void testValueInfinity() throws IOException { - Gauge noLabels = Gauge.build().name("nolabels").help("help").register(registry); - noLabels.set(Double.POSITIVE_INFINITY); - TextFormat.write004(writer, registry.metricFamilySamples()); - assertEquals("# HELP nolabels help\n" - + "# TYPE nolabels gauge\n" - + "nolabels +Inf\n", writer.toString()); - } - - @Test - public void testCounterOutput() throws IOException { - Counter noLabels = Counter.build().name("nolabels").help("help").register(registry); - noLabels.inc(); - TextFormat.write004(writer, registry.metricFamilySamples()); - assertEquals("# HELP nolabels help\n" - + "# TYPE nolabels counter\n" - + "nolabels 1.0\n", writer.toString()); - } - - @Test - public void testMetricOutputWithTimestamp() throws IOException { - - class CustomCollector extends Collector { - public List collect() { - List mfs = new ArrayList(); - ArrayList labelNames = new ArrayList(); - ArrayList labelValues = new ArrayList(); - ArrayList samples = new ArrayList(); - MetricFamilySamples.Sample sample = new MetricFamilySamples.Sample("nolabels", labelNames, labelValues, 1.0, 1518123456L); - samples.add(sample); - mfs.add(new MetricFamilySamples("nolabels", Collector.Type.UNTYPED, "help", samples)); - return mfs; - } - } - - new CustomCollector().register(registry); - TextFormat.write004(writer, registry.metricFamilySamples()); - assertEquals("# HELP nolabels help\n" - + "# TYPE nolabels untyped\n" - + "nolabels 1.0 1518123456\n", writer.toString()); - } - - @Test - public void testSummaryOutput() throws IOException { - Summary noLabels = Summary.build().name("nolabels").help("help").register(registry); - noLabels.observe(2); - TextFormat.write004(writer, registry.metricFamilySamples()); - assertEquals("# HELP nolabels help\n" - + "# TYPE nolabels summary\n" - + "nolabels_count 1.0\n" - + "nolabels_sum 2.0\n", writer.toString()); - } - - @Test - public void testSummaryOutputWithQuantiles() throws IOException { - Summary labelsAndQuantiles = Summary.build() - .quantile(0.5, 0.05).quantile(0.9, 0.01).quantile(0.99, 0.001) - .labelNames("l").name("labelsAndQuantiles").help("help").register(registry); - labelsAndQuantiles.labels("a").observe(2); - writer = new StringWriter(); - TextFormat.write004(writer, registry.metricFamilySamples()); - assertEquals("# HELP labelsAndQuantiles help\n" - + "# TYPE labelsAndQuantiles summary\n" - + "labelsAndQuantiles{l=\"a\",quantile=\"0.5\",} 2.0\n" - + "labelsAndQuantiles{l=\"a\",quantile=\"0.9\",} 2.0\n" - + "labelsAndQuantiles{l=\"a\",quantile=\"0.99\",} 2.0\n" - + "labelsAndQuantiles_count{l=\"a\",} 1.0\n" - + "labelsAndQuantiles_sum{l=\"a\",} 2.0\n", writer.toString()); - } - - @Test - public void testLabelsOutput() throws IOException { - Gauge labels = Gauge.build().name("labels").help("help").labelNames("l").register(registry); - labels.labels("a").inc(); - TextFormat.write004(writer, registry.metricFamilySamples()); - assertEquals("# HELP labels help\n" - + "# TYPE labels gauge\n" - + "labels{l=\"a\",} 1.0\n", writer.toString()); - } - - @Test - public void testLabelValuesEscaped() throws IOException { - Gauge labels = Gauge.build().name("labels").help("help").labelNames("l").register(registry); - labels.labels("ąćčęntěd a\nb\\c\"d").inc(); - TextFormat.write004(writer, registry.metricFamilySamples()); - assertEquals("# HELP labels help\n" - + "# TYPE labels gauge\n" - + "labels{l=\"ąćčęntěd a\\nb\\\\c\\\"d\",} 1.0\n", writer.toString()); - } - - @Test - public void testHelpEscaped() throws IOException { - Gauge noLabels = Gauge.build().name("nolabels").help("ąćčęntěd h\"e\\l\np").register(registry); - noLabels.inc(); - TextFormat.write004(writer, registry.metricFamilySamples()); - assertEquals("# HELP nolabels ąćčęntěd h\"e\\\\l\\np\n" - + "# TYPE nolabels gauge\n" - + "nolabels 1.0\n", writer.toString()); - } -} diff --git a/simpleclient_dropwizard/pom.xml b/simpleclient_dropwizard/pom.xml deleted file mode 100644 index 23593cd5b..000000000 --- a/simpleclient_dropwizard/pom.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - 4.0.0 - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_dropwizard - bundle - - Prometheus Java Simpleclient Dropwizard - - Collector of data from Dropwizard metrics library. - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - francois-visconte - Francois Visconte - f.visconte@gmail.com - - - - - io.prometheus - simpleclient - 0.6.1-SNAPSHOT - - - io.dropwizard.metrics - metrics-core - 3.1.2 - - - - junit - junit - 4.11 - test - - - org.assertj - assertj-core - 2.9.1 - test - - - org.mockito - mockito-core - 2.10.0 - test - - - diff --git a/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/DropwizardExports.java b/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/DropwizardExports.java deleted file mode 100644 index e8011dd34..000000000 --- a/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/DropwizardExports.java +++ /dev/null @@ -1,167 +0,0 @@ -package io.prometheus.client.dropwizard; - -import com.codahale.metrics.*; -import io.prometheus.client.dropwizard.samplebuilder.SampleBuilder; -import io.prometheus.client.dropwizard.samplebuilder.DefaultSampleBuilder; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.SortedMap; -import java.util.concurrent.TimeUnit; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * Collect Dropwizard metrics from a MetricRegistry. - */ -public class DropwizardExports extends io.prometheus.client.Collector implements io.prometheus.client.Collector.Describable { - private static final Logger LOGGER = Logger.getLogger(DropwizardExports.class.getName()); - private MetricRegistry registry; - private SampleBuilder sampleBuilder; - - /** - * Creates a new DropwizardExports with a {@link DefaultSampleBuilder}. - * - * @param registry a metric registry to export in prometheus. - */ - public DropwizardExports(MetricRegistry registry) { - this.registry = registry; - this.sampleBuilder = new DefaultSampleBuilder(); - } - - /** - * @param registry a metric registry to export in prometheus. - * @param sampleBuilder sampleBuilder to use to create prometheus samples. - */ - public DropwizardExports(MetricRegistry registry, SampleBuilder sampleBuilder) { - this.registry = registry; - this.sampleBuilder = sampleBuilder; - } - - private static String getHelpMessage(String metricName, Metric metric) { - return String.format("Generated from Dropwizard metric import (metric=%s, type=%s)", - metricName, metric.getClass().getName()); - } - - /** - * Export counter as Prometheus Gauge. - */ - MetricFamilySamples fromCounter(String dropwizardName, Counter counter) { - MetricFamilySamples.Sample sample = sampleBuilder.createSample(dropwizardName, "", new ArrayList(), new ArrayList(), - new Long(counter.getCount()).doubleValue()); - return new MetricFamilySamples(sample.name, Type.GAUGE, getHelpMessage(dropwizardName, counter), Arrays.asList(sample)); - } - - /** - * Export gauge as a prometheus gauge. - */ - MetricFamilySamples fromGauge(String dropwizardName, Gauge gauge) { - Object obj = gauge.getValue(); - double value; - if (obj instanceof Number) { - value = ((Number) obj).doubleValue(); - } else if (obj instanceof Boolean) { - value = ((Boolean) obj) ? 1 : 0; - } else { - LOGGER.log(Level.FINE, String.format("Invalid type for Gauge %s: %s", sanitizeMetricName(dropwizardName), - obj == null ? "null" : obj.getClass().getName())); - return null; - } - MetricFamilySamples.Sample sample = sampleBuilder.createSample(dropwizardName, "", - new ArrayList(), new ArrayList(), value); - return new MetricFamilySamples(sample.name, Type.GAUGE, getHelpMessage(dropwizardName, gauge), Arrays.asList(sample)); - } - - /** - * Export a histogram snapshot as a prometheus SUMMARY. - * - * @param dropwizardName metric name. - * @param snapshot the histogram snapshot. - * @param count the total sample count for this snapshot. - * @param factor a factor to apply to histogram values. - */ - MetricFamilySamples fromSnapshotAndCount(String dropwizardName, Snapshot snapshot, long count, double factor, String helpMessage) { - List samples = Arrays.asList( - sampleBuilder.createSample(dropwizardName, "", Arrays.asList("quantile"), Arrays.asList("0.5"), snapshot.getMedian() * factor), - sampleBuilder.createSample(dropwizardName, "", Arrays.asList("quantile"), Arrays.asList("0.75"), snapshot.get75thPercentile() * factor), - sampleBuilder.createSample(dropwizardName, "", Arrays.asList("quantile"), Arrays.asList("0.95"), snapshot.get95thPercentile() * factor), - sampleBuilder.createSample(dropwizardName, "", Arrays.asList("quantile"), Arrays.asList("0.98"), snapshot.get98thPercentile() * factor), - sampleBuilder.createSample(dropwizardName, "", Arrays.asList("quantile"), Arrays.asList("0.99"), snapshot.get99thPercentile() * factor), - sampleBuilder.createSample(dropwizardName, "", Arrays.asList("quantile"), Arrays.asList("0.999"), snapshot.get999thPercentile() * factor), - sampleBuilder.createSample(dropwizardName, "_count", new ArrayList(), new ArrayList(), count) - ); - return new MetricFamilySamples(samples.get(0).name, Type.SUMMARY, helpMessage, samples); - } - - /** - * Convert histogram snapshot. - */ - MetricFamilySamples fromHistogram(String dropwizardName, Histogram histogram) { - return fromSnapshotAndCount(dropwizardName, histogram.getSnapshot(), histogram.getCount(), 1.0, - getHelpMessage(dropwizardName, histogram)); - } - - /** - * Export Dropwizard Timer as a histogram. Use TIME_UNIT as time unit. - */ - MetricFamilySamples fromTimer(String dropwizardName, Timer timer) { - return fromSnapshotAndCount(dropwizardName, timer.getSnapshot(), timer.getCount(), - 1.0D / TimeUnit.SECONDS.toNanos(1L), getHelpMessage(dropwizardName, timer)); - } - - /** - * Export a Meter as as prometheus COUNTER. - */ - MetricFamilySamples fromMeter(String dropwizardName, Meter meter) { - final MetricFamilySamples.Sample sample = sampleBuilder.createSample(dropwizardName, "_total", - new ArrayList(), - new ArrayList(), - meter.getCount()); - return new MetricFamilySamples(sample.name, Type.COUNTER, getHelpMessage(dropwizardName, meter), - Arrays.asList(sample)); - } - - @Override - public List collect() { - Map mfSamplesMap = new HashMap(); - - for (SortedMap.Entry entry : registry.getGauges().entrySet()) { - addToMap(mfSamplesMap, fromGauge(entry.getKey(), entry.getValue())); - } - for (SortedMap.Entry entry : registry.getCounters().entrySet()) { - addToMap(mfSamplesMap, fromCounter(entry.getKey(), entry.getValue())); - } - for (SortedMap.Entry entry : registry.getHistograms().entrySet()) { - addToMap(mfSamplesMap, fromHistogram(entry.getKey(), entry.getValue())); - } - for (SortedMap.Entry entry : registry.getTimers().entrySet()) { - addToMap(mfSamplesMap, fromTimer(entry.getKey(), entry.getValue())); - } - for (SortedMap.Entry entry : registry.getMeters().entrySet()) { - addToMap(mfSamplesMap, fromMeter(entry.getKey(), entry.getValue())); - } - return new ArrayList(mfSamplesMap.values()); - } - - private void addToMap(Map mfSamplesMap, MetricFamilySamples newMfSamples) - { - if (newMfSamples != null) { - MetricFamilySamples currentMfSamples = mfSamplesMap.get(newMfSamples.name); - if (currentMfSamples == null) { - mfSamplesMap.put(newMfSamples.name, newMfSamples); - } else { - List samples = new ArrayList(currentMfSamples.samples); - samples.addAll(newMfSamples.samples); - mfSamplesMap.put(newMfSamples.name, new MetricFamilySamples(newMfSamples.name, currentMfSamples.type, currentMfSamples.help, samples)); - } - } - } - - @Override - public List describe() { - return new ArrayList(); - } -} \ No newline at end of file diff --git a/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/samplebuilder/CustomMappingSampleBuilder.java b/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/samplebuilder/CustomMappingSampleBuilder.java deleted file mode 100644 index 30435b7ce..000000000 --- a/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/samplebuilder/CustomMappingSampleBuilder.java +++ /dev/null @@ -1,109 +0,0 @@ -package io.prometheus.client.dropwizard.samplebuilder; - -import io.prometheus.client.Collector; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -/** - * Custom {@link SampleBuilder} implementation to allow Dropwizard metrics to be translated to Prometheus metrics including custom labels and names. - * Prometheus metric name and labels are extracted from the Dropwizard name based on the provided list of {@link MapperConfig}s. - * The FIRST matching config will be used. - * If no config is matched, the {@link DefaultSampleBuilder} is used. - */ -public class CustomMappingSampleBuilder implements SampleBuilder { - private final List compiledMapperConfigs; - private final DefaultSampleBuilder defaultMetricSampleBuilder = new DefaultSampleBuilder(); - - public CustomMappingSampleBuilder(final List mapperConfigs) { - if (mapperConfigs == null || mapperConfigs.isEmpty()) { - throw new IllegalArgumentException("CustomMappingSampleBuilder needs some mapper configs!"); - } - - this.compiledMapperConfigs = new ArrayList(mapperConfigs.size()); - for (MapperConfig config : mapperConfigs) { - this.compiledMapperConfigs.add(new CompiledMapperConfig(config)); - } - } - - @Override - public Collector.MetricFamilySamples.Sample createSample(final String dropwizardName, final String nameSuffix, final List additionalLabelNames, final List additionalLabelValues, final double value) { - if (dropwizardName == null) { - throw new IllegalArgumentException("Dropwizard metric name cannot be null"); - } - - CompiledMapperConfig matchingConfig = null; - for (CompiledMapperConfig config : this.compiledMapperConfigs) { - if (config.pattern.matches(dropwizardName)) { - matchingConfig = config; - break; - } - } - - if (matchingConfig != null) { - final Map params = matchingConfig.pattern.extractParameters(dropwizardName); - final NameAndLabels nameAndLabels = getNameAndLabels(matchingConfig.mapperConfig, params); - nameAndLabels.labelNames.addAll(additionalLabelNames); - nameAndLabels.labelValues.addAll(additionalLabelValues); - return defaultMetricSampleBuilder.createSample( - nameAndLabels.name, nameSuffix, - nameAndLabels.labelNames, - nameAndLabels.labelValues, - value - ); - } - - - return defaultMetricSampleBuilder.createSample( - dropwizardName, nameSuffix, - additionalLabelNames, - additionalLabelValues, - value - ); - } - - protected NameAndLabels getNameAndLabels(final MapperConfig config, final Map parameters) { - final String metricName = formatTemplate(config.getName(), parameters); - final List labels = new ArrayList(config.getLabels().size()); - final List labelValues = new ArrayList(config.getLabels().size()); - for (Map.Entry entry : config.getLabels().entrySet()) { - labels.add(entry.getKey()); - labelValues.add(formatTemplate(entry.getValue(), parameters)); - } - - return new NameAndLabels(metricName, labels, labelValues); - } - - private String formatTemplate(final String template, final Map params) { - String result = template; - for (Map.Entry entry : params.entrySet()) { - result = result.replace(entry.getKey(), entry.getValue()); - } - - return result; - } - - static class CompiledMapperConfig { - final MapperConfig mapperConfig; - final GraphiteNamePattern pattern; - - CompiledMapperConfig(final MapperConfig mapperConfig) { - this.mapperConfig = mapperConfig; - this.pattern = new GraphiteNamePattern(mapperConfig.getMatch()); - } - } - - static class NameAndLabels { - final String name; - final List labelNames; - final List labelValues; - - NameAndLabels(final String name, final List labelNames, final List labelValues) { - this.name = name; - this.labelNames = labelNames; - this.labelValues = labelValues; - } - } -} diff --git a/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/samplebuilder/DefaultSampleBuilder.java b/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/samplebuilder/DefaultSampleBuilder.java deleted file mode 100644 index 230edb4a7..000000000 --- a/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/samplebuilder/DefaultSampleBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -package io.prometheus.client.dropwizard.samplebuilder; - -import io.prometheus.client.Collector; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - - -/** - * Default implementation of {@link SampleBuilder}. - * Sanitises the metric name if necessary. - * - * @see io.prometheus.client.Collector#sanitizeMetricName(String) - */ -public class DefaultSampleBuilder implements SampleBuilder { - @Override - public Collector.MetricFamilySamples.Sample createSample(final String dropwizardName, final String nameSuffix, final List additionalLabelNames, final List additionalLabelValues, final double value) { - final String suffix = nameSuffix == null ? "" : nameSuffix; - final List labelNames = additionalLabelNames == null ? Collections.emptyList() : additionalLabelNames; - final List labelValues = additionalLabelValues == null ? Collections.emptyList() : additionalLabelValues; - return new Collector.MetricFamilySamples.Sample( - Collector.sanitizeMetricName(dropwizardName + suffix), - new ArrayList(labelNames), - new ArrayList(labelValues), - value - ); - } -} diff --git a/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/samplebuilder/GraphiteNamePattern.java b/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/samplebuilder/GraphiteNamePattern.java deleted file mode 100644 index 45767e3fc..000000000 --- a/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/samplebuilder/GraphiteNamePattern.java +++ /dev/null @@ -1,94 +0,0 @@ -package io.prometheus.client.dropwizard.samplebuilder; - -import java.util.HashMap; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static io.prometheus.client.dropwizard.samplebuilder.MapperConfig.METRIC_GLOB_REGEX; - -/** - * GraphiteNamePattern is initialised with a simplified glob pattern that only allows '*' as special character. - * Examples of valid patterns: - *

      - *
    • org.test.controller.gather.status.400
    • - *
    • org.test.controller.gather.status.*
    • - *
    • org.test.controller.*.status.*
    • - *
    • *.test.controller.*.status.*
    • - *
    - *

    - * It contains logic to match a metric name and to extract named parameters from it. - */ -class GraphiteNamePattern { - private static final Pattern VALIDATION_PATTERN = Pattern.compile(METRIC_GLOB_REGEX); - - private Pattern pattern; - private String patternStr; - - /** - * Creates a new GraphiteNamePattern from the given simplified glob pattern. - * - * @param pattern The glob style pattern to be used. - */ - GraphiteNamePattern(final String pattern) throws IllegalArgumentException { - if (!VALIDATION_PATTERN.matcher(pattern).matches()) { - throw new IllegalArgumentException(String.format("Provided pattern [%s] does not matches [%s]", pattern, METRIC_GLOB_REGEX)); - } - initializePattern(pattern); - } - - /** - * Matches the metric name against the pattern. - * - * @param metricName The metric name to be tested. - * @return {@code true} if the name is matched, {@code false} otherwise. - */ - boolean matches(final String metricName) { - return metricName != null && pattern.matcher(metricName).matches(); - } - - /** - * Extracts parameters from the given metric name based on the pattern. - * The resulting map has keys named as '${n}' where n is the 0 based position in the pattern. - * E.g.: - * pattern: org.test.controller.*.status.* - * extractParameters("org.test.controller.gather.status.400") -> - * {${0} -> "gather", ${1} -> "400"} - * - * @param metricName The metric name to extract parameters from. - * @return A parameter map where keys are named '${n}' where n is 0 based parameter position in the pattern. - */ - Map extractParameters(final String metricName) { - final Matcher matcher = this.pattern.matcher(metricName); - final Map params = new HashMap(); - if (matcher.find()) { - for (int i = 1; i <= matcher.groupCount(); i++) { - params.put(String.format("${%d}", i - 1), matcher.group(i)); - } - } - - return params; - } - - /** - * Turns the GLOB pattern into a REGEX. - * - * @param pattern The pattern to use - */ - private void initializePattern(final String pattern) { - final String[] split = pattern.split(Pattern.quote("*"), -1); - final StringBuilder escapedPattern = new StringBuilder(Pattern.quote(split[0])); - for (int i = 1; i < split.length; i++) { - String quoted = Pattern.quote(split[i]); - escapedPattern.append("([^.]*)").append(quoted); - } - - final String regex = "^" + escapedPattern.toString() + "$"; - this.patternStr = regex; - this.pattern = Pattern.compile(regex); - } - - String getPatternString() { - return this.patternStr; - } -} diff --git a/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/samplebuilder/MapperConfig.java b/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/samplebuilder/MapperConfig.java deleted file mode 100644 index 887226635..000000000 --- a/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/samplebuilder/MapperConfig.java +++ /dev/null @@ -1,159 +0,0 @@ -package io.prometheus.client.dropwizard.samplebuilder; - -import java.util.HashMap; -import java.util.Map; -import java.util.regex.Pattern; - -/** - * POJO containing info on how to map a graphite metric to a prometheus one. - * Example mapping in yaml format: - *

    - * match: test.dispatcher.*.*.* - * name: dispatcher_events_total - * labels: - * action: ${1} - * outcome: ${2}_out - * processor: ${0} - * status: ${1}_${2} - *

    - * Dropwizard metrics that match the "match" pattern will be further processed to have a new name and new labels based on this config. - */ -public class MapperConfig { - // each part of the metric name between dots - private static final String METRIC_PART_REGEX = "[a-zA-Z_0-9](-?[a-zA-Z0-9_])+"; - // Simplified GLOB: we can have "*." at the beginning and "*" only at the end - static final String METRIC_GLOB_REGEX = "^(\\*\\.|" + METRIC_PART_REGEX + "\\.)+(\\*|" + METRIC_PART_REGEX + ")$"; - // Labels validation. - private static final String LABEL_REGEX = "^[a-zA-Z_][a-zA-Z0-9_]+$"; - private static final Pattern MATCH_EXPRESSION_PATTERN = Pattern.compile(METRIC_GLOB_REGEX); - private static final Pattern LABEL_PATTERN = Pattern.compile(LABEL_REGEX); - - /** - * Regex used to match incoming metric name. - * Uses a simplified glob syntax where only '*' are allowed. - * E.g: - * org.company.controller.*.status.* - * Will be used to match - * org.company.controller.controller1.status.200 - * and - * org.company.controller.controller2.status.400 - */ - private String match; - - /** - * New metric name. Can contain placeholders to be replaced with actual values from the incoming metric name. - * Placeholders are in the ${n} format where n is the zero based index of the group to extract from the original metric name. - * E.g.: - * match: test.dispatcher.*.*.* - * name: dispatcher_events_total_${1} - *

    - * A metric "test.dispatcher.old.test.yay" will be converted in a new metric with name "dispatcher_events_total_test" - */ - private String name; - - /** - * Labels to be extracted from the metric name. - * They should contain placeholders to be replaced with actual values from the incoming metric name. - * Placeholders are in the ${n} format where n is the zero based index of the group to extract from the original metric name. - * E.g.: - * match: test.dispatcher.*.* - * name: dispatcher_events_total_${0} - * labels: - * label1: ${1}_t - *

    - * A metric "test.dispatcher.sp1.yay" will be converted in a new metric with name "dispatcher_events_total_sp1" with label {label1: yay_t} - *

    - * Label names have to match the regex ^[a-zA-Z_][a-zA-Z0-9_]+$ - */ - - private Map labels = new HashMap(); - - public MapperConfig() { - // empty constructor - } - - // for tests - MapperConfig(final String match) { - validateMatch(match); - this.match = match; - } - - public MapperConfig(final String match, final String name, final Map labels) { - this.name = name; - validateMatch(match); - this.match = match; - validateLabels(labels); - this.labels = labels; - } - - @Override - public String toString() { - return String.format("MapperConfig{match=%s, name=%s, labels=%s}", match, name, labels); - } - - public String getMatch() { - return match; - } - - public void setMatch(final String match) { - validateMatch(match); - this.match = match; - } - - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - - } - - public Map getLabels() { - return labels; - } - - public void setLabels(final Map labels) { - validateLabels(labels); - this.labels = labels; - } - - private void validateMatch(final String match) - { - if (!MATCH_EXPRESSION_PATTERN.matcher(match).matches()) { - throw new IllegalArgumentException(String.format("Match expression [%s] does not match required pattern %s", match, MATCH_EXPRESSION_PATTERN)); - } - } - - private void validateLabels(final Map labels) - { - if (labels != null) { - for (final String key : labels.keySet()) { - if (!LABEL_PATTERN.matcher(key).matches()) { - throw new IllegalArgumentException(String.format("Label [%s] does not match required pattern %s", match, LABEL_PATTERN)); - } - } - - } - } - - @Override - public boolean equals(final Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - final MapperConfig that = (MapperConfig) o; - - if (match != null ? !match.equals(that.match) : that.match != null) return false; - if (name != null ? !name.equals(that.name) : that.name != null) return false; - return labels != null ? labels.equals(that.labels) : that.labels == null; - } - - @Override - public int hashCode() { - int result = match != null ? match.hashCode() : 0; - result = 31 * result + (name != null ? name.hashCode() : 0); - result = 31 * result + (labels != null ? labels.hashCode() : 0); - return result; - } -} diff --git a/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/samplebuilder/SampleBuilder.java b/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/samplebuilder/SampleBuilder.java deleted file mode 100644 index eb570fd6a..000000000 --- a/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/samplebuilder/SampleBuilder.java +++ /dev/null @@ -1,23 +0,0 @@ -package io.prometheus.client.dropwizard.samplebuilder; - -import io.prometheus.client.Collector; - -import java.util.List; - -/** - * SampleBuilder defines the action of creating a {@link io.prometheus.client.Collector.MetricFamilySamples.Sample} for the given parameters. - */ -public interface SampleBuilder { - - /** - * Creates a new {@link io.prometheus.client.Collector.MetricFamilySamples.Sample} for the given parameters. - * - * @param dropwizardName Metric name coming from Dropwizard. - * @param nameSuffix Optional suffix to add. - * @param additionalLabelNames Optional additional label names. Needs to have same size as additionalLabelValues. - * @param additionalLabelValues Optional additional label values. Needs to have same size as additionalLabelNames. - * @param value Metric value - * @return A new {@link io.prometheus.client.Collector.MetricFamilySamples.Sample}. - */ - Collector.MetricFamilySamples.Sample createSample(String dropwizardName, String nameSuffix, List additionalLabelNames, List additionalLabelValues, double value); -} diff --git a/simpleclient_dropwizard/src/test/java/io/prometheus/client/dropwizard/DropwizardExportsTest.java b/simpleclient_dropwizard/src/test/java/io/prometheus/client/dropwizard/DropwizardExportsTest.java deleted file mode 100644 index da721f75c..000000000 --- a/simpleclient_dropwizard/src/test/java/io/prometheus/client/dropwizard/DropwizardExportsTest.java +++ /dev/null @@ -1,352 +0,0 @@ -package io.prometheus.client.dropwizard; - -import com.codahale.metrics.*; -import com.codahale.metrics.Timer; -import io.prometheus.client.Collector; -import io.prometheus.client.CollectorRegistry; -import io.prometheus.client.dropwizard.samplebuilder.SampleBuilder; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; - -import java.io.IOException; -import java.util.Arrays; -import java.util.Collections; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Map; - -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; -import static org.mockito.ArgumentMatchers.anyDouble; -import static org.mockito.ArgumentMatchers.anyListOf; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.ArgumentMatchers.eq; - - -public class DropwizardExportsTest { - - private CollectorRegistry registry = new CollectorRegistry(); - private MetricRegistry metricRegistry; - - private SampleBuilder sampleBuilder; - - @Before - public void setUp() { - metricRegistry = new MetricRegistry(); - sampleBuilder = Mockito.mock(SampleBuilder.class); - new DropwizardExports(metricRegistry, sampleBuilder).register(registry); - } - - @Test - public void testCounter() { - Mockito.when(sampleBuilder.createSample("foo.bar", "", Collections.emptyList(), Collections.emptyList(), 1d)).thenReturn(new Collector.MetricFamilySamples.Sample("foo_bar", Collections.emptyList(), Collections.emptyList(), 1d)); - metricRegistry.counter("foo.bar").inc(); - assertEquals(new Double(1), - registry.getSampleValue("foo_bar") - ); - } - - @Test - public void testGauge() { - Gauge integerGauge = new Gauge() { - @Override - public Integer getValue() { - return 1234; - } - }; - Gauge doubleGauge = new Gauge() { - @Override - public Double getValue() { - return 1.234D; - } - }; - Gauge longGauge = new Gauge() { - @Override - public Long getValue() { - return 1234L; - } - }; - Gauge floatGauge = new Gauge() { - @Override - public Float getValue() { - return 0.1234F; - } - }; - Gauge booleanGauge = new Gauge() { - @Override - public Boolean getValue() { - return true; - } - }; - - Mockito.when(sampleBuilder.createSample("integer.gauge", "", Collections.emptyList(), Collections.emptyList(), 1234)).thenReturn(new Collector.MetricFamilySamples.Sample("integer_gauge", Collections.emptyList(), Collections.emptyList(), 1234)); - Mockito.when(sampleBuilder.createSample("long.gauge", "", Collections.emptyList(), Collections.emptyList(), 1234)).thenReturn(new Collector.MetricFamilySamples.Sample("long_gauge", Collections.emptyList(), Collections.emptyList(), 1234)); - Mockito.when(sampleBuilder.createSample("double.gauge", "", Collections.emptyList(), Collections.emptyList(), 1.234)).thenReturn(new Collector.MetricFamilySamples.Sample("double_gauge", Collections.emptyList(), Collections.emptyList(), 1.234)); - Mockito.when(sampleBuilder.createSample("float.gauge", "", Collections.emptyList(), Collections.emptyList(), 0.1234F)).thenReturn(new Collector.MetricFamilySamples.Sample("float_gauge", Collections.emptyList(), Collections.emptyList(), 0.1234F)); - Mockito.when(sampleBuilder.createSample("boolean.gauge", "", Collections.emptyList(), Collections.emptyList(), 1)).thenReturn(new Collector.MetricFamilySamples.Sample("boolean_gauge", Collections.emptyList(), Collections.emptyList(), 1)); - - metricRegistry.register("double.gauge", doubleGauge); - metricRegistry.register("long.gauge", longGauge); - metricRegistry.register("integer.gauge", integerGauge); - metricRegistry.register("float.gauge", floatGauge); - metricRegistry.register("boolean.gauge", booleanGauge); - - assertEquals(new Double(1234), - registry.getSampleValue("integer_gauge", new String[]{}, new String[]{})); - assertEquals(new Double(1234), - registry.getSampleValue("long_gauge", new String[]{}, new String[]{})); - assertEquals(new Double(1.234), - registry.getSampleValue("double_gauge", new String[]{}, new String[]{})); - assertEquals(new Double(0.1234F), - registry.getSampleValue("float_gauge", new String[]{}, new String[]{})); - assertEquals(new Double(1), - registry.getSampleValue("boolean_gauge", new String[]{}, new String[]{})); - } - - @Test - public void testInvalidGaugeType() { - Gauge invalidGauge = new Gauge() { - @Override - public String getValue() { - return "foobar"; - } - }; - - metricRegistry.register("invalid_gauge", invalidGauge); - assertEquals(null, registry.getSampleValue("invalid_gauge")); - Mockito.verifyZeroInteractions(sampleBuilder); - } - - @Test - public void testGaugeReturningNullValue() { - Gauge invalidGauge = new Gauge() { - @Override - public String getValue() { - return null; - } - }; - metricRegistry.register("invalid_gauge", invalidGauge); - assertEquals(null, registry.getSampleValue("invalid_gauge")); - Mockito.verifyZeroInteractions(sampleBuilder); - } - - void assertRegistryContainsMetrics(String... metrics) { - for (String metric : metrics) { - assertNotEquals(String.format("Metric %s should exist", metric), null, - registry.getSampleValue(metric, new String[]{}, new String[]{})); - } - } - - @Test - public void testHistogram() throws IOException { - // just test the standard mapper - final MetricRegistry metricRegistry = new MetricRegistry(); - final CollectorRegistry registry = new CollectorRegistry(); - new DropwizardExports(metricRegistry).register(registry); - Histogram hist = metricRegistry.histogram("hist"); - int i = 0; - while (i < 100) { - hist.update(i); - i += 1; - } - assertEquals(new Double(100), registry.getSampleValue("hist_count")); - for (Double d : Arrays.asList(0.75, 0.95, 0.98, 0.99)) { - assertEquals(new Double((d - 0.01) * 100), registry.getSampleValue("hist", - new String[]{"quantile"}, new String[]{d.toString()})); - } - assertEquals(new Double(99), registry.getSampleValue("hist", new String[]{"quantile"}, - new String[]{"0.999"})); - } - - @Test - public void testMeter() throws IOException, InterruptedException { - Mockito.when(sampleBuilder.createSample("meter", "_total", Collections.emptyList(), Collections.emptyList(), 2)).thenReturn(new Collector.MetricFamilySamples.Sample("meter_total", Collections.emptyList(), Collections.emptyList(), 2)); - Meter meter = metricRegistry.meter("meter"); - meter.mark(); - meter.mark(); - assertEquals(new Double(2), registry.getSampleValue("meter_total")); - } - - @Test - public void testTimer() throws IOException, InterruptedException { - // just test the standard mapper - final MetricRegistry metricRegistry = new MetricRegistry(); - final CollectorRegistry registry = new CollectorRegistry(); - new DropwizardExports(metricRegistry).register(registry); - - Timer t = metricRegistry.timer("timer"); - Timer.Context time = t.time(); - Thread.sleep(1L); - time.stop(); - // We slept for 1Ms so we ensure that all timers are above 1ms: - assertTrue(registry.getSampleValue("timer", new String[]{"quantile"}, new String[]{"0.99"}) > 0.001); - assertEquals(new Double(1.0D), registry.getSampleValue("timer_count")); - } - - @Test - public void testThatMetricHelpUsesOriginalDropwizardName() { - Mockito.when(sampleBuilder.createSample(eq("my.application.namedTimer1"), anyString(), anyListOf(String.class), anyListOf(String.class), anyDouble())) - .thenReturn(new Collector.MetricFamilySamples.Sample("my_application_namedTimer1", Collections.emptyList(), Collections.emptyList(), 1234)); - - Mockito.when(sampleBuilder.createSample(eq("my.application.namedCounter1"), anyString(), anyListOf(String.class), anyListOf(String.class), anyDouble())) - .thenReturn(new Collector.MetricFamilySamples.Sample("my_application_namedCounter1", Collections.emptyList(), Collections.emptyList(), 1234)); - - Mockito.when(sampleBuilder.createSample(eq("my.application.namedMeter1"), anyString(), anyListOf(String.class), anyListOf(String.class), anyDouble())) - .thenReturn(new Collector.MetricFamilySamples.Sample("my_application_namedMeter1_total", Collections.emptyList(), Collections.emptyList(), 1234)); - - Mockito.when(sampleBuilder.createSample(eq("my.application.namedHistogram1"), anyString(), anyListOf(String.class), anyListOf(String.class), anyDouble())) - .thenReturn(new Collector.MetricFamilySamples.Sample("my_application_namedHistogram1", Collections.emptyList(), Collections.emptyList(), 1234)); - - Mockito.when(sampleBuilder.createSample(eq("my.application.namedGauge1"), anyString(), anyListOf(String.class), anyListOf(String.class), anyDouble())) - .thenReturn(new Collector.MetricFamilySamples.Sample("my_application_namedGauge1", Collections.emptyList(), Collections.emptyList(), 1234)); - - metricRegistry.timer("my.application.namedTimer1"); - metricRegistry.counter("my.application.namedCounter1"); - metricRegistry.meter("my.application.namedMeter1"); - metricRegistry.histogram("my.application.namedHistogram1"); - metricRegistry.register("my.application.namedGauge1", new ExampleDoubleGauge()); - - Enumeration metricFamilySamples = registry.metricFamilySamples(); - - - Map elements = new HashMap(); - - while (metricFamilySamples.hasMoreElements()) { - Collector.MetricFamilySamples element = metricFamilySamples.nextElement(); - elements.put(element.name, element); - } - assertEquals(5, elements.size()); - - assertTrue(elements.keySet().contains("my_application_namedTimer1")); - assertTrue(elements.keySet().contains("my_application_namedCounter1")); - assertTrue(elements.keySet().contains("my_application_namedMeter1_total")); - assertTrue(elements.keySet().contains("my_application_namedHistogram1")); - assertTrue(elements.keySet().contains("my_application_namedGauge1")); - - assertThat(elements.get("my_application_namedTimer1").help, - is("Generated from Dropwizard metric import (metric=my.application.namedTimer1, type=com.codahale.metrics.Timer)")); - - assertThat(elements.get("my_application_namedCounter1").help, - is("Generated from Dropwizard metric import (metric=my.application.namedCounter1, type=com.codahale.metrics.Counter)")); - - assertThat(elements.get("my_application_namedMeter1_total").help, - is("Generated from Dropwizard metric import (metric=my.application.namedMeter1, type=com.codahale.metrics.Meter)")); - - assertThat(elements.get("my_application_namedHistogram1").help, - is("Generated from Dropwizard metric import (metric=my.application.namedHistogram1, type=com.codahale.metrics.Histogram)")); - - assertThat(elements.get("my_application_namedGauge1").help, - is("Generated from Dropwizard metric import (metric=my.application.namedGauge1, type=io.prometheus.client.dropwizard.DropwizardExportsTest$ExampleDoubleGauge)")); - - } - - @Test - public void testThatMetricsMappedToSameNameAreGroupedInSameFamily() { - final Collector.MetricFamilySamples.Sample namedTimerSample1 = new Collector.MetricFamilySamples.Sample("my_application_namedTimer", Collections.emptyList(), Collections.emptyList(), 1234); - Mockito.when(sampleBuilder.createSample(eq("my.application.namedTimer1"), anyString(), anyListOf(String.class), anyListOf(String.class), anyDouble())) - .thenReturn(namedTimerSample1); - - final Collector.MetricFamilySamples.Sample namedTimerSample2 = new Collector.MetricFamilySamples.Sample("my_application_namedTimer", Collections.emptyList(), Collections.emptyList(), 1235); - Mockito.when(sampleBuilder.createSample(eq("my.application.namedTimer2"), anyString(), anyListOf(String.class), anyListOf(String.class), anyDouble())) - .thenReturn(namedTimerSample2); - - final Collector.MetricFamilySamples.Sample namedCounter1 = new Collector.MetricFamilySamples.Sample("my_application_namedCounter", Collections.emptyList(), Collections.emptyList(), 1234); - Mockito.when(sampleBuilder.createSample(eq("my.application.namedCounter1"), anyString(), anyListOf(String.class), anyListOf(String.class), anyDouble())) - .thenReturn(namedCounter1); - - final Collector.MetricFamilySamples.Sample namedCounter2 = new Collector.MetricFamilySamples.Sample("my_application_namedCounter", Collections.emptyList(), Collections.emptyList(), 1235); - Mockito.when(sampleBuilder.createSample(eq("my.application.namedCounter2"), anyString(), anyListOf(String.class), anyListOf(String.class), anyDouble())) - .thenReturn(namedCounter2); - - final Collector.MetricFamilySamples.Sample namedMeter1 = new Collector.MetricFamilySamples.Sample("my_application_namedMeter_total", Collections.emptyList(), Collections.emptyList(), 1234); - Mockito.when(sampleBuilder.createSample(eq("my.application.namedMeter1"), anyString(), anyListOf(String.class), anyListOf(String.class), anyDouble())) - .thenReturn(namedMeter1); - - final Collector.MetricFamilySamples.Sample namedMeter2 = new Collector.MetricFamilySamples.Sample("my_application_namedMeter_total", Collections.emptyList(), Collections.emptyList(), 1235); - Mockito.when(sampleBuilder.createSample(eq("my.application.namedMeter2"), anyString(), anyListOf(String.class), anyListOf(String.class), anyDouble())) - .thenReturn(namedMeter2); - - final Collector.MetricFamilySamples.Sample namedHistogram1 = new Collector.MetricFamilySamples.Sample("my_application_namedHistogram", Collections.emptyList(), Collections.emptyList(), 1234); - Mockito.when(sampleBuilder.createSample(eq("my.application.namedHistogram1"), anyString(), anyListOf(String.class), anyListOf(String.class), anyDouble())) - .thenReturn(namedHistogram1); - - final Collector.MetricFamilySamples.Sample namedHistogram2 = new Collector.MetricFamilySamples.Sample("my_application_namedHistogram", Collections.emptyList(), Collections.emptyList(), 1235); - Mockito.when(sampleBuilder.createSample(eq("my.application.namedHistogram2"), anyString(), anyListOf(String.class), anyListOf(String.class), anyDouble())) - .thenReturn(namedHistogram2); - - final Collector.MetricFamilySamples.Sample namedGauge1 = new Collector.MetricFamilySamples.Sample("my_application_namedGauge", Collections.emptyList(), Collections.emptyList(), 1234); - Mockito.when(sampleBuilder.createSample(eq("my.application.namedGauge1"), anyString(), anyListOf(String.class), anyListOf(String.class), anyDouble())) - .thenReturn(namedGauge1); - - final Collector.MetricFamilySamples.Sample namedGauge2 = new Collector.MetricFamilySamples.Sample("my_application_namedGauge", Collections.emptyList(), Collections.emptyList(), 1235); - Mockito.when(sampleBuilder.createSample(eq("my.application.namedGauge2"), anyString(), anyListOf(String.class), anyListOf(String.class), anyDouble())) - .thenReturn(namedGauge2); - - metricRegistry.timer("my.application.namedTimer1"); - metricRegistry.timer("my.application.namedTimer2"); - metricRegistry.counter("my.application.namedCounter1"); - metricRegistry.counter("my.application.namedCounter2"); - metricRegistry.meter("my.application.namedMeter1"); - metricRegistry.meter("my.application.namedMeter2"); - metricRegistry.histogram("my.application.namedHistogram1"); - metricRegistry.histogram("my.application.namedHistogram2"); - metricRegistry.register("my.application.namedGauge1", new ExampleDoubleGauge()); - metricRegistry.register("my.application.namedGauge2", new ExampleDoubleGauge()); - - Enumeration metricFamilySamples = registry.metricFamilySamples(); - - - Map elements = new HashMap(); - - while (metricFamilySamples.hasMoreElements()) { - Collector.MetricFamilySamples element = metricFamilySamples.nextElement(); - elements.put(element.name, element); - } - assertEquals(5, elements.size()); - - final Collector.MetricFamilySamples namedTimer = elements.get("my_application_namedTimer"); - assertNotNull(namedTimer); - assertEquals(Collector.Type.SUMMARY, namedTimer.type); - assertEquals(14, namedTimer.samples.size()); - - final Collector.MetricFamilySamples namedCounter = elements.get("my_application_namedCounter"); - assertNotNull(namedCounter); - assertEquals(Collector.Type.GAUGE, namedCounter.type); - assertEquals(2, namedCounter.samples.size()); - assertTrue(namedCounter.samples.contains(namedCounter1)); - assertTrue(namedCounter.samples.contains(namedCounter2)); - - final Collector.MetricFamilySamples namedMeter = elements.get("my_application_namedMeter_total"); - assertNotNull(namedMeter); - assertEquals(Collector.Type.COUNTER, namedMeter.type); - assertEquals(2, namedMeter.samples.size()); - assertTrue(namedMeter.samples.contains(namedMeter1)); - assertTrue(namedMeter.samples.contains(namedMeter2)); - - final Collector.MetricFamilySamples namedHistogram = elements.get("my_application_namedHistogram"); - assertNotNull(namedHistogram); - assertEquals(Collector.Type.SUMMARY, namedHistogram.type); - assertEquals(Collector.Type.SUMMARY, namedHistogram.type); - assertEquals(14, namedHistogram.samples.size()); - - final Collector.MetricFamilySamples namedGauge = elements.get("my_application_namedGauge"); - assertNotNull(namedGauge); - assertEquals(Collector.Type.GAUGE, namedGauge.type); - assertEquals(2, namedGauge.samples.size()); - assertTrue(namedGauge.samples.contains(namedGauge1)); - assertTrue(namedGauge.samples.contains(namedGauge2)); - - } - - private static class ExampleDoubleGauge implements Gauge { - @Override - public Double getValue() { - return 0.0; - } - } -} \ No newline at end of file diff --git a/simpleclient_dropwizard/src/test/java/io/prometheus/client/dropwizard/samplebuilder/CustomMappingSampleBuilderTest.java b/simpleclient_dropwizard/src/test/java/io/prometheus/client/dropwizard/samplebuilder/CustomMappingSampleBuilderTest.java deleted file mode 100644 index b906fbbf6..000000000 --- a/simpleclient_dropwizard/src/test/java/io/prometheus/client/dropwizard/samplebuilder/CustomMappingSampleBuilderTest.java +++ /dev/null @@ -1,181 +0,0 @@ -package io.prometheus.client.dropwizard.samplebuilder; - -import io.prometheus.client.Collector; -import org.junit.Test; - -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static org.junit.Assert.assertEquals; - -public class CustomMappingSampleBuilderTest { - @Test(expected = IllegalArgumentException.class) - public void test_WHEN_EmptyConfig_THEN_Fail() { - final CustomMappingSampleBuilder converter = new CustomMappingSampleBuilder(Collections.emptyList()); - } - - @Test - public void test_WHEN_NoMatches_THEN_ShouldReturnDefaultSample() { - final List mapperConfigs = Arrays.asList( - new MapperConfig("client-nope.*.*.*"), - new MapperConfig("*.client-nope.*.*.*"), - new MapperConfig("not.even.this.*.*.*") - ); - final CustomMappingSampleBuilder converter = new CustomMappingSampleBuilder(mapperConfigs); - final Collector.MetricFamilySamples.Sample result = converter.createSample( - "app.okhttpclient.client.HttpClient.service.total", "", Collections.singletonList("quantile"), Collections.singletonList("0.99"), 0d); - - assertEquals(new Collector.MetricFamilySamples.Sample("app_okhttpclient_client_HttpClient_service_total", Collections.singletonList("quantile"), Collections.singletonList("0.99"), 0d), result); - } - - @Test - public void test_WHEN_OneMatch_THEN_ShouldReturnConverted() { - final Map labels = new HashMap(); - labels.put("service", "${0}"); - final MapperConfig mapperConfig = new MapperConfig( - "app.okhttpclient.client.HttpClient.*.total", - "app.okhttpclient.client.HttpClient.total", - labels - ); - final List mapperConfigs = Arrays.asList( - new MapperConfig("client-nope.*.*.*"), - mapperConfig, - new MapperConfig("not.even.this.*.*.*") - ); - final CustomMappingSampleBuilder converter = new CustomMappingSampleBuilder(mapperConfigs); - final Collector.MetricFamilySamples.Sample expectedResult = new Collector.MetricFamilySamples.Sample( - "app_okhttpclient_client_HttpClient_total", Collections.singletonList("service"), Collections.singletonList("greatService"), 1d); - - final Collector.MetricFamilySamples.Sample result = converter.createSample( - "app.okhttpclient.client.HttpClient.greatService.total", "", Collections.emptyList(), Collections.emptyList(), 1d); - - assertEquals(expectedResult, result); - } - - @Test - public void test_WHEN_MoreMatches_THEN_ShouldReturnFirstOne() { - final Map labels = new HashMap(); - labels.put("service", "${0}"); - final MapperConfig mapperConfig = new MapperConfig( - "app.okhttpclient.client.HttpClient.*.total", - "app.okhttpclient.client.HttpClient.total", - labels - ); - final List mapperConfigs = Arrays.asList( - new MapperConfig("client-nope.*.*.*"), - mapperConfig, - new MapperConfig("app.okhttpclient.client.HttpClient.*.*") // this matches as well - ); - final CustomMappingSampleBuilder converter = new CustomMappingSampleBuilder(mapperConfigs); - final Collector.MetricFamilySamples.Sample expectedResult = new Collector.MetricFamilySamples.Sample( - "app_okhttpclient_client_HttpClient_total", Collections.singletonList("service"), Collections.singletonList("greatService"), 1d); - - final Collector.MetricFamilySamples.Sample result = converter.createSample( - "app.okhttpclient.client.HttpClient.greatService.total", "", Collections.emptyList(), Collections.emptyList(), 1d); - - assertEquals(expectedResult, result); - } - - @Test - public void test_WHEN_MoreMatchesReverseOrder_THEN_ShouldReturnFirstOne() { - final Map labels = new HashMap(); - labels.put("service", "${0}"); - labels.put("status", "${1}"); - final MapperConfig mapperConfig = new MapperConfig( - "app.okhttpclient.client.HttpClient.*.*", - "app.okhttpclient.client.HttpClient", - labels - ); - final List mapperConfigs = Arrays.asList( - new MapperConfig("client-nope.*.*.*"), - mapperConfig, - new MapperConfig("app.okhttpclient.client.HttpClient.*.total") // this matches as well - ); - final CustomMappingSampleBuilder converter = new CustomMappingSampleBuilder(mapperConfigs); - final Collector.MetricFamilySamples.Sample expectedResult = new Collector.MetricFamilySamples.Sample( - "app_okhttpclient_client_HttpClient", Arrays.asList("service", "status"), Arrays.asList("greatService", "400"), 1d); - - final Collector.MetricFamilySamples.Sample result = converter.createSample( - "app.okhttpclient.client.HttpClient.greatService.400", "", Collections.emptyList(), Collections.emptyList(), 1d); - - assertEquals(expectedResult, result); - } - - @Test - public void test_WHEN_MoreToFormatInLabelsAndName_THEN_ShouldReturnCorrectSample() { - final Map labels = new HashMap(); - labels.put("service", "${0}_${1}"); - labels.put("status", "s_${1}"); - final MapperConfig mapperConfig = new MapperConfig( - "app.okhttpclient.client.HttpClient.*.*", - "app.okhttpclient.client.HttpClient.${0}", - labels - ); - final List mapperConfigs = Arrays.asList( - new MapperConfig("client-nope.*.*.*"), - mapperConfig, - new MapperConfig("app.okhttpclient.client.HttpClient.*.total") // this matches as well - ); - final CustomMappingSampleBuilder converter = new CustomMappingSampleBuilder(mapperConfigs); - final Collector.MetricFamilySamples.Sample expectedResult = new Collector.MetricFamilySamples.Sample( - "app_okhttpclient_client_HttpClient_greatService", Arrays.asList("service", "status"), Arrays.asList("greatService_400", "s_400"), 1d); - - final Collector.MetricFamilySamples.Sample result = converter.createSample( - "app.okhttpclient.client.HttpClient.greatService.400", "", Collections.emptyList(), Collections.emptyList(), 1d); - - assertEquals(expectedResult, result); - } - - @Test - public void test_WHEN_MetricNameSuffixRequested_THEN_ShouldReturnCorrectSample() { - final Map labels = new HashMap(); - labels.put("service", "${0}"); - labels.put("status", "s_${1}"); - final MapperConfig mapperConfig = new MapperConfig( - "app.okhttpclient.client.HttpClient.*.*", - "app.okhttpclient.client.HttpClient.${0}", - labels - ); - final List mapperConfigs = Arrays.asList( - new MapperConfig("client-nope.*.*.*"), - mapperConfig, - new MapperConfig("app.okhttpclient.client.HttpClient.*.total") // this matches as well - ); - final CustomMappingSampleBuilder converter = new CustomMappingSampleBuilder(mapperConfigs); - final Collector.MetricFamilySamples.Sample expectedResult = new Collector.MetricFamilySamples.Sample( - "app_okhttpclient_client_HttpClient_greatService_suffix", Arrays.asList("service", "status"), Arrays.asList("greatService", "s_400"), 1d); - - final Collector.MetricFamilySamples.Sample result = converter.createSample( - "app.okhttpclient.client.HttpClient.greatService.400", "_suffix", Collections.emptyList(), Collections.emptyList(), 1d); - - assertEquals(expectedResult, result); - } - - @Test - public void test_WHEN_AdditionalLabels_THEN_ShouldReturnCorrectSample() { - final Map labels = new HashMap(); - labels.put("service", "${0}"); - labels.put("status", "s_${1}"); - final MapperConfig mapperConfig = new MapperConfig( - "app.okhttpclient.client.HttpClient.*.*", - "app.okhttpclient.client.HttpClient.${0}", - labels - ); - final List mapperConfigs = Arrays.asList( - new MapperConfig("client-nope.*.*.*"), - mapperConfig, - new MapperConfig("app.okhttpclient.client.HttpClient.*.total") // this matches as well - ); - final CustomMappingSampleBuilder converter = new CustomMappingSampleBuilder(mapperConfigs); - final Collector.MetricFamilySamples.Sample expectedResult = new Collector.MetricFamilySamples.Sample( - "app_okhttpclient_client_HttpClient_greatService_suffix", Arrays.asList("service", "status", "another"), Arrays.asList("greatService", "s_400", "label"), 1d); - - final Collector.MetricFamilySamples.Sample result = converter.createSample( - "app.okhttpclient.client.HttpClient.greatService.400", "_suffix", Collections.singletonList("another"), Collections.singletonList("label"), 1d); - - assertEquals(expectedResult, result); - } -} diff --git a/simpleclient_dropwizard/src/test/java/io/prometheus/client/dropwizard/samplebuilder/DefaultSampleBuilderTest.java b/simpleclient_dropwizard/src/test/java/io/prometheus/client/dropwizard/samplebuilder/DefaultSampleBuilderTest.java deleted file mode 100644 index fa6c30288..000000000 --- a/simpleclient_dropwizard/src/test/java/io/prometheus/client/dropwizard/samplebuilder/DefaultSampleBuilderTest.java +++ /dev/null @@ -1,31 +0,0 @@ -package io.prometheus.client.dropwizard.samplebuilder; - -import io.prometheus.client.Collector; -import io.prometheus.client.dropwizard.samplebuilder.DefaultSampleBuilder; -import org.junit.Assert; -import org.junit.Test; - -import java.util.Arrays; -import java.util.Collections; - -public class DefaultSampleBuilderTest { - @Test - public void test_WHEN_NoSuffixAndExtraLabels_THEN_ShouldReturnCorrectSample() { - final DefaultSampleBuilder builder = new DefaultSampleBuilder(); - final Collector.MetricFamilySamples.Sample result = builder.createSample("org.github.name", null, null, null, 1d); - Assert.assertEquals( - new Collector.MetricFamilySamples.Sample("org_github_name", Collections.emptyList(), Collections.emptyList(), 1d) - , result); - } - - @Test - public void test_WHEN_SuffixAndExtraLabels_THEN_ShouldReturnCorrectSample() { - final DefaultSampleBuilder builder = new DefaultSampleBuilder(); - final Collector.MetricFamilySamples.Sample result = builder.createSample("org.github.name", "suffix.test", Collections.singletonList("another"), Arrays.asList("label"), 1d); - Assert.assertEquals( - new Collector.MetricFamilySamples.Sample("org_github_namesuffix_test", Collections.singletonList("another"), - Arrays.asList("label"), 1d), result); - - } - -} \ No newline at end of file diff --git a/simpleclient_dropwizard/src/test/java/io/prometheus/client/dropwizard/samplebuilder/GraphiteNamePatternTest.java b/simpleclient_dropwizard/src/test/java/io/prometheus/client/dropwizard/samplebuilder/GraphiteNamePatternTest.java deleted file mode 100644 index 8b95e8e3e..000000000 --- a/simpleclient_dropwizard/src/test/java/io/prometheus/client/dropwizard/samplebuilder/GraphiteNamePatternTest.java +++ /dev/null @@ -1,144 +0,0 @@ -package io.prometheus.client.dropwizard.samplebuilder; - -import org.assertj.core.api.Assertions; -import org.junit.Test; - -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class GraphiteNamePatternTest { - - @Test(expected = IllegalArgumentException.class) - public void createNew_WHEN_InvalidPattern_THEN_ShouldThrowException() { - final List invalidPatterns = Arrays.asList( - "", - "a", - "1org", - "1org.", - "org.", - "org.**", - "org.**", - "org.company-", - "org.company-.", - "org.company-*", - "org.company.**", - "org.company.**-", - "org.com*pany.*", - "org.test.contr.oller.gather.status..400", - "org.test.controller.gather.status..400" - ); - final GraphiteNamePattern graphiteNamePattern = new GraphiteNamePattern(""); - for (String pattern : invalidPatterns) { - try { - new GraphiteNamePattern(pattern); - - Assertions.failBecauseExceptionWasNotThrown(IllegalArgumentException.class); - } catch (IllegalArgumentException e) { - Assertions.assertThat(e).hasMessageContaining(pattern); - } - } - } - - @Test - public void createNew_WHEN_ValidPattern_THEN_ShouldCreateThePatternSuccessfully() { - final List validPatterns = Arrays.asList( - "org.test.controller.gather.status.400", - "org.test.controller.*.status.400", - "org.test.controller.*.status.*", - "*.test.controller.*.status.*", - "*.test.controller-1.*.status.*", - "*.amazing-test.controller-1.*.status.*" - - ); - for (String pattern : validPatterns) { - new GraphiteNamePattern(pattern); - } - } - - @Test - public void createNew_WHEN_ValidPattern_THEN_ShouldInitInternalPatternSuccessfully() { - final Map validPatterns = new HashMap(); - validPatterns.put("org.test.controller.gather.status.400", "^\\Qorg.test.controller.gather.status.400\\E$"); - validPatterns.put("org.test.controller.*.status.400", "^\\Qorg.test.controller.\\E([^.]*)\\Q.status.400\\E$"); - validPatterns.put("org.test.controller.*.status.*", "^\\Qorg.test.controller.\\E([^.]*)\\Q.status.\\E([^.]*)\\Q\\E$"); - validPatterns.put("*.test.controller.*.status.*", "^\\Q\\E([^.]*)\\Q.test.controller.\\E([^.]*)\\Q.status.\\E([^.]*)\\Q\\E$"); - - for (Map.Entry expected : validPatterns.entrySet()) { - final GraphiteNamePattern pattern = new GraphiteNamePattern(expected.getKey()); - Assertions.assertThat(pattern.getPatternString()).isEqualTo(expected.getValue()); - } - } - - @Test - public void match_WHEN_NotMatchingMetricNameProvided_THEN_ShouldNotMatch() { - final GraphiteNamePattern pattern = new GraphiteNamePattern("org.test.controller.*.status.*"); - final List notMatchingMetricNamed = Arrays.asList( - "org.test.controller.status.400", - "", - null - ); - - for (String metricName : notMatchingMetricNamed) { - Assertions.assertThat(pattern.matches(metricName)).as("Matching [%s] against [%s]", metricName, pattern.getPatternString()).isFalse(); - } - } - - @Test - public void match_WHEN_MatchingMetricNameProvided_THEN_ShouldMatch() { - final GraphiteNamePattern pattern = new GraphiteNamePattern("org.test.controller.*.status.*"); - final List matchingMetricNamed = Arrays.asList( - "org.test.controller.gather.status.400", - "org.test.controller.gather2.status.500", - "org.test.controller.gather1.status.", - "org.test.controller.*.status.*", - "org.test.controller..status.*" - ); - - for (String metricName : matchingMetricNamed) { - Assertions.assertThat(pattern.matches(metricName)).as("Matching [%s] against [%s]", metricName, pattern.getPatternString()).isTrue(); - } - } - - @Test - public void extractParameters() { - GraphiteNamePattern pattern; - Map expected = new HashMap(); - expected.put("${0}", "gather"); - expected.put("${1}", "400"); - pattern = new GraphiteNamePattern("org.test.controller.*.status.*"); - Assertions.assertThat(pattern.extractParameters("org.test.controller.gather.status.400")) - .isEqualTo(expected); - - expected = new HashMap(); - expected.put("${0}", "org"); - expected.put("${1}", "gather"); - expected.put("${2}", "400"); - pattern = new GraphiteNamePattern("*.test.controller.*.status.*"); - Assertions.assertThat(pattern.extractParameters("org.test.controller.gather.status.400")) - .isEqualTo(expected); - } - - @Test - public void extractParameters_WHEN_emptyStringInDottedMetricsName_THEN_ShouldReturnEmptyString() { - GraphiteNamePattern pattern; - Map expected = new HashMap(); - expected.put("${0}", ""); - expected.put("${1}", "400"); - pattern = new GraphiteNamePattern("org.test.controller.*.status.*"); - Assertions.assertThat(pattern.extractParameters("org.test.controller..status.400")) - .isEqualTo(expected); - - } - - @Test - public void extractParameters_WHEN_moreDots_THEN_ShouldReturnNoMatches() { - GraphiteNamePattern pattern; - pattern = new GraphiteNamePattern("org.test.controller.*.status.*"); - Assertions.assertThat(pattern.extractParameters("org.test.controller...status.400")) - .isEqualTo(Collections.emptyMap()); - - } -} \ No newline at end of file diff --git a/simpleclient_dropwizard/src/test/java/io/prometheus/client/dropwizard/samplebuilder/MapperConfigTest.java b/simpleclient_dropwizard/src/test/java/io/prometheus/client/dropwizard/samplebuilder/MapperConfigTest.java deleted file mode 100644 index e0ded6978..000000000 --- a/simpleclient_dropwizard/src/test/java/io/prometheus/client/dropwizard/samplebuilder/MapperConfigTest.java +++ /dev/null @@ -1,58 +0,0 @@ -package io.prometheus.client.dropwizard.samplebuilder; - -import io.prometheus.client.dropwizard.samplebuilder.MapperConfig; -import org.junit.Test; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import static org.junit.Assert.assertEquals; - -public class MapperConfigTest { - @Test - public void setMatch_WHEN_ExpressionMatchesPattern_AllGood() { - final MapperConfig mapperConfig = new MapperConfig(); - mapperConfig.setMatch("com.company.meter.*"); - assertEquals("com.company.meter.*", mapperConfig.getMatch()); - } - - @Test(expected = IllegalArgumentException.class) - public void setMatch_WHEN_ExpressionDoesnNotMatchPattern_ThrowException() { - final MapperConfig mapperConfig = new MapperConfig(); - mapperConfig.setMatch("com.company.meter.**.yay"); - } - - @Test - public void setLabels_WHEN_ExpressionMatchesPattern_AllGood() { - final MapperConfig mapperConfig = new MapperConfig(); - final Map labels = new HashMap(); - labels.put("valid", "${0}"); - mapperConfig.setLabels(labels); - assertEquals(labels, mapperConfig.getLabels()); - } - - @Test(expected = IllegalArgumentException.class) - public void setLabels_WHEN_ExpressionDoesnNotMatchPattern_ThrowException() { - final MapperConfig mapperConfig = new MapperConfig(); - final Map labels = new HashMap(); - labels.put("valid", "${0}"); - labels.put("not valid", "${0}"); - mapperConfig.setLabels(labels); - } - - @Test - public void toString_WHEN_EmptyConfig_AllGood() { - final MapperConfig mapperConfig = new MapperConfig(); - assertEquals("MapperConfig{match=null, name=null, labels={}}", mapperConfig.toString()); - } - - @Test - public void toString_WHEN_FullyConfigured_AllGood() { - final MapperConfig mapperConfig = new MapperConfig(); - mapperConfig.setMatch("com.company.meter.*.foo"); - mapperConfig.setName("foo"); - mapperConfig.setLabels(Collections.singletonMap("type", "${0}")); - assertEquals("MapperConfig{match=com.company.meter.*.foo, name=foo, labels={type=${0}}}", mapperConfig.toString()); - } -} diff --git a/simpleclient_graphite_bridge/pom.xml b/simpleclient_graphite_bridge/pom.xml deleted file mode 100644 index fd51174ff..000000000 --- a/simpleclient_graphite_bridge/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - 4.0.0 - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_graphite_bridge - bundle - - Prometheus Java Simpleclient Graphite Bridge - - Graphite bridge for the simpleclient. - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - brian-brazil - Brian Brazil - brian.brazil@robustperception.io - - - - - - - io.prometheus - simpleclient - 0.6.1-SNAPSHOT - - - - junit - junit - 4.11 - test - - - diff --git a/simpleclient_guava/pom.xml b/simpleclient_guava/pom.xml deleted file mode 100644 index 3fe4875e5..000000000 --- a/simpleclient_guava/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - 4.0.0 - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_guava - bundle - - Prometheus Java Simpleclient guava - - Metrics collector for guava based caches - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - checketts - Clint Checketts - checketts@gmail.com - - - - - - io.prometheus - simpleclient - 0.6.1-SNAPSHOT - - - com.google.guava - guava - 18.0 - - - - - junit - junit - 4.11 - test - - - - org.mockito - mockito-core - 1.9.5 - test - - - org.assertj - assertj-core - 2.6.0 - test - - - - diff --git a/simpleclient_guava/src/main/java/io/prometheus/client/guava/cache/CacheMetricsCollector.java b/simpleclient_guava/src/main/java/io/prometheus/client/guava/cache/CacheMetricsCollector.java deleted file mode 100644 index 5ed0276bb..000000000 --- a/simpleclient_guava/src/main/java/io/prometheus/client/guava/cache/CacheMetricsCollector.java +++ /dev/null @@ -1,142 +0,0 @@ -package io.prometheus.client.guava.cache; - -import com.google.common.cache.Cache; -import com.google.common.cache.CacheStats; -import com.google.common.cache.LoadingCache; -import io.prometheus.client.Collector; -import io.prometheus.client.CounterMetricFamily; -import io.prometheus.client.GaugeMetricFamily; -import io.prometheus.client.SummaryMetricFamily; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; - -/** - * Collect metrics from Guava's com.google.common.cache.Cache. - *

    - *

    {@code
    - *
    - * // Note that `recordStats()` is required to gather non-zero statistics
    - * Cache cache = CacheBuilder.newBuilder().recordStats().build();
    - * CacheMetricsCollector cacheMetrics = new CacheMetricsCollector().register();
    - * cacheMetrics.addCache("mycache", cache);
    - *
    - * }
    - * - * Exposed metrics are labeled with the provided cache name. - * - * With the example above, sample metric names would be: - *
    - *     guava_cache_hit_total{cache="mycache"} 10.0
    - *     guava_cache_miss_total{cache="mycache"} 3.0
    - *     guava_cache_requests_total{cache="mycache"} 13.0
    - *     guava_cache_eviction_total{cache="mycache"} 1.0
    - *     guava_cache_size{cache="mycache"} 5.0
    - * 
    - * - * Additionally if the cache includes a loader, the following metrics would be provided: - *
    - *     guava_cache_load_failure_total{cache="mycache"} 2.0
    - *     guava_cache_loads_total{cache="mycache"} 7.0
    - *     guava_cache_load_duration_seconds_count{cache="mycache"} 7.0
    - *     guava_cache_load_duration_seconds_sum{cache="mycache"} 0.0034
    - * 
    - * - */ -public class CacheMetricsCollector extends Collector { - - protected final ConcurrentMap children = new ConcurrentHashMap(); - - /** - * Add or replace the cache with the given name. - *

    - * Any references any previous cache with this name is invalidated. - * - * @param cacheName The name of the cache, will be the metrics label value - * @param cache The cache being monitored - */ - public void addCache(String cacheName, Cache cache) { - children.put(cacheName, cache); - } - - /** - * Remove the cache with the given name. - *

    - * Any references to the cache are invalidated. - * - * @param cacheName cache to be removed - */ - public Cache removeCache(String cacheName) { - return children.remove(cacheName); - } - - /** - * Remove all caches. - *

    - * Any references to all caches are invalidated. - */ - public void clear(){ - children.clear(); - } - - @Override - public List collect() { - List mfs = new ArrayList(); - List labelNames = Arrays.asList("cache"); - - CounterMetricFamily cacheHitTotal = new CounterMetricFamily("guava_cache_hit_total", - "Cache hit totals", labelNames); - mfs.add(cacheHitTotal); - - CounterMetricFamily cacheMissTotal = new CounterMetricFamily("guava_cache_miss_total", - "Cache miss totals", labelNames); - mfs.add(cacheMissTotal); - - CounterMetricFamily cacheRequestsTotal = new CounterMetricFamily("guava_cache_requests_total", - "Cache request totals, hits + misses", labelNames); - mfs.add(cacheRequestsTotal); - - CounterMetricFamily cacheEvictionTotal = new CounterMetricFamily("guava_cache_eviction_total", - "Cache eviction totals, doesn't include manually removed entries", labelNames); - mfs.add(cacheEvictionTotal); - - CounterMetricFamily cacheLoadFailure = new CounterMetricFamily("guava_cache_load_failure_total", - "Cache load failures", labelNames); - mfs.add(cacheLoadFailure); - - CounterMetricFamily cacheLoadTotal = new CounterMetricFamily("guava_cache_loads_total", - "Cache loads: both success and failures", labelNames); - mfs.add(cacheLoadTotal); - - GaugeMetricFamily cacheSize = new GaugeMetricFamily("guava_cache_size", - "Cache size", labelNames); - mfs.add(cacheSize); - - SummaryMetricFamily cacheLoadSummary = new SummaryMetricFamily("guava_cache_load_duration_seconds", - "Cache load duration: both success and failures", labelNames); - mfs.add(cacheLoadSummary); - - for(Map.Entry c: children.entrySet()) { - List cacheName = Arrays.asList(c.getKey()); - CacheStats stats = c.getValue().stats(); - - cacheHitTotal.addMetric(cacheName, stats.hitCount()); - cacheMissTotal.addMetric(cacheName, stats.missCount()); - cacheRequestsTotal.addMetric(cacheName, stats.requestCount()); - cacheEvictionTotal.addMetric(cacheName, stats.evictionCount()); - cacheSize.addMetric(cacheName, c.getValue().size()); - - if(c.getValue() instanceof LoadingCache) { - cacheLoadFailure.addMetric(cacheName, stats.loadExceptionCount()); - cacheLoadTotal.addMetric(cacheName, stats.loadCount()); - - cacheLoadSummary.addMetric(cacheName, stats.loadCount(), stats.totalLoadTime() / Collector.NANOSECONDS_PER_SECOND); - } - } - return mfs; - } -} diff --git a/simpleclient_guava/src/test/java/io/prometheus/client/guava/cache/CacheMetricsCollectorTest.java b/simpleclient_guava/src/test/java/io/prometheus/client/guava/cache/CacheMetricsCollectorTest.java deleted file mode 100644 index 2050c8975..000000000 --- a/simpleclient_guava/src/test/java/io/prometheus/client/guava/cache/CacheMetricsCollectorTest.java +++ /dev/null @@ -1,88 +0,0 @@ -package io.prometheus.client.guava.cache; - -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; -import io.prometheus.client.CollectorRegistry; -import org.junit.Test; - - -import java.util.Arrays; - -import static org.assertj.core.api.Java6Assertions.assertThat; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class CacheMetricsCollectorTest { - - @Test - public void cacheExposesMetricsForHitMissAndEviction() throws Exception { - Cache cache = CacheBuilder.newBuilder().maximumSize(2).recordStats().build(); - CollectorRegistry registry = new CollectorRegistry(); - - CacheMetricsCollector collector = new CacheMetricsCollector().register(registry); - collector.addCache("users", cache); - - cache.getIfPresent("user1"); - cache.getIfPresent("user1"); - cache.put("user1", "First User"); - cache.getIfPresent("user1"); - - // Add to cache to trigger eviction. - cache.put("user2", "Second User"); - cache.put("user3", "Third User"); - cache.put("user4", "Fourth User"); - - assertMetric(registry, "guava_cache_hit_total", "users", 1.0); - assertMetric(registry, "guava_cache_miss_total", "users", 2.0); - assertMetric(registry, "guava_cache_requests_total", "users", 3.0); - assertMetric(registry, "guava_cache_eviction_total", "users", 2.0); - } - - @SuppressWarnings("unchecked") - @Test - public void loadingCacheExposesMetricsForLoadsAndExceptions() throws Exception { - CacheLoader loader = mock(CacheLoader.class); - when(loader.load(anyString())) - .thenReturn("First User") - .thenThrow(new RuntimeException("Seconds time fails")) - .thenReturn("Third User"); - - LoadingCache cache = CacheBuilder.newBuilder().recordStats().build(loader); - CollectorRegistry registry = new CollectorRegistry(); - CacheMetricsCollector collector = new CacheMetricsCollector().register(registry); - collector.addCache("loadingusers", cache); - - cache.get("user1"); - cache.get("user1"); - try{ - cache.get("user2"); - } catch (Exception e) { - // ignoring. - } - cache.get("user3"); - - assertMetric(registry, "guava_cache_hit_total", "loadingusers", 1.0); - assertMetric(registry, "guava_cache_miss_total", "loadingusers", 3.0); - - assertMetric(registry, "guava_cache_load_failure_total", "loadingusers", 1.0); - assertMetric(registry, "guava_cache_loads_total", "loadingusers", 3.0); - - assertMetric(registry, "guava_cache_load_duration_seconds_count", "loadingusers", 3.0); - assertMetricGreatThan(registry, "guava_cache_load_duration_seconds_sum", "loadingusers", 0.0); - } - - - private void assertMetric(CollectorRegistry registry, String name, String cacheName, double value) { - assertThat(registry.getSampleValue(name, new String[]{"cache"}, new String[]{cacheName})).isEqualTo(value); - } - - - private void assertMetricGreatThan(CollectorRegistry registry, String name, String cacheName, double value) { - assertThat(registry.getSampleValue(name, new String[]{"cache"}, new String[]{cacheName})).isGreaterThan(value); - } - - -} diff --git a/simpleclient_hibernate/pom.xml b/simpleclient_hibernate/pom.xml deleted file mode 100644 index 0c9454e2a..000000000 --- a/simpleclient_hibernate/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - 4.0.0 - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_hibernate - bundle - - Prometheus Java Simpleclient Hibernate - - Collectors of data from Hibernate. - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - chkal - Christian Kaltepoth - christian@kaltepoth.de - - - - - - - io.prometheus - simpleclient - 0.6.1-SNAPSHOT - - - - - org.hibernate - hibernate-core - 5.2.0.Final - provided - - - - - junit - junit - 4.12 - test - - - org.mockito - mockito-core - 2.18.0 - test - - - - diff --git a/simpleclient_hotspot/pom.xml b/simpleclient_hotspot/pom.xml deleted file mode 100644 index 31b9c9882..000000000 --- a/simpleclient_hotspot/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - 4.0.0 - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_hotspot - bundle - - Prometheus Java Simpleclient Hotspot - - Collectors of data from Java Hotspot. - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - brian-brazil - Brian Brazil - brian.brazil@boxever.com - - - - - - io.prometheus - simpleclient - 0.6.1-SNAPSHOT - - - - - io.prometheus - simpleclient_servlet - 0.6.1-SNAPSHOT - test - - - junit - junit - 4.11 - test - - - org.mockito - mockito-core - 1.9.5 - test - - - - org.eclipse.jetty - jetty-servlet - 8.1.7.v20120910 - test - - - diff --git a/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/BufferPoolsExports.java b/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/BufferPoolsExports.java deleted file mode 100644 index d456b5e7b..000000000 --- a/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/BufferPoolsExports.java +++ /dev/null @@ -1,122 +0,0 @@ -package io.prometheus.client.hotspot; - -import io.prometheus.client.Collector; -import io.prometheus.client.GaugeMetricFamily; - -import java.lang.management.ManagementFactory; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.logging.Logger; - -/** - * Exports metrics about JVM buffers. - * - * Can be replaced with a simple access once JDK 1.7 compatibility is baseline. - * - */ -public class BufferPoolsExports extends Collector { - - private static final Logger LOGGER = Logger.getLogger(BufferPoolsExports.class.getName()); - - private final List bufferPoolMXBeans = new ArrayList(); - private Method getName; - private Method getMemoryUsed; - private Method getTotalCapacity; - private Method getCount; - - public BufferPoolsExports() { - try { - final Class bufferPoolMXBeanClass = Class.forName("java.lang.management.BufferPoolMXBean"); - bufferPoolMXBeans.addAll(accessBufferPoolMXBeans(bufferPoolMXBeanClass)); - - getName = bufferPoolMXBeanClass.getMethod("getName"); - getMemoryUsed = bufferPoolMXBeanClass.getMethod("getMemoryUsed"); - getTotalCapacity = bufferPoolMXBeanClass.getMethod("getTotalCapacity"); - getCount = bufferPoolMXBeanClass.getMethod("getCount"); - - } catch (ClassNotFoundException e) { - LOGGER.fine("BufferPoolMXBean not available, no metrics for buffer pools will be exported"); - } catch (NoSuchMethodException e) { - LOGGER.fine("Can not get necessary accessor from BufferPoolMXBean: " + e.getMessage()); - } - } - - private static List accessBufferPoolMXBeans(final Class bufferPoolMXBeanClass) { - try { - final Method getPlatformMXBeansMethod = ManagementFactory.class.getMethod("getPlatformMXBeans", Class.class); - final Object listOfBufferPoolMXBeanInstances = getPlatformMXBeansMethod.invoke(null, bufferPoolMXBeanClass); - - return (List) listOfBufferPoolMXBeanInstances; - - } catch (NoSuchMethodException e) { - LOGGER.fine("ManagementFactory.getPlatformMXBeans not available, no metrics for buffer pools will be exported"); - return Collections.emptyList(); - } catch (IllegalAccessException e) { - LOGGER.fine("ManagementFactory.getPlatformMXBeans not accessible, no metrics for buffer pools will be exported"); - return Collections.emptyList(); - } catch (InvocationTargetException e) { - LOGGER.warning("ManagementFactory.getPlatformMXBeans could not be invoked, no metrics for buffer pools will be exported"); - return Collections.emptyList(); - } - } - - @Override - public List collect() { - List mfs = new ArrayList(); - GaugeMetricFamily used = new GaugeMetricFamily( - "jvm_buffer_pool_used_bytes", - "Used bytes of a given JVM buffer pool.", - Collections.singletonList("pool")); - mfs.add(used); - GaugeMetricFamily capacity = new GaugeMetricFamily( - "jvm_buffer_pool_capacity_bytes", - "Bytes capacity of a given JVM buffer pool.", - Collections.singletonList("pool")); - mfs.add(capacity); - GaugeMetricFamily buffers = new GaugeMetricFamily( - "jvm_buffer_pool_used_buffers", - "Used buffers of a given JVM buffer pool.", - Collections.singletonList("pool")); - mfs.add(buffers); - for (final Object pool : bufferPoolMXBeans) { - used.addMetric( - Collections.singletonList(getName(pool)), - callLongMethond(getMemoryUsed,pool)); - capacity.addMetric( - Collections.singletonList(getName(pool)), - callLongMethond(getTotalCapacity,pool)); - buffers.addMetric( - Collections.singletonList(getName(pool)), - callLongMethond(getCount,pool)); - } - return mfs; - } - - private long callLongMethond(final Method method, final Object pool) { - try { - return (Long)method.invoke(pool); - } catch (IllegalAccessException e) { - LOGGER.fine("Couldn't call " + method.getName() + ": " + e.getMessage()); - } catch (InvocationTargetException e) { - LOGGER.fine("Couldn't call " + method.getName() + ": " + e.getMessage()); - } - return 0L; - } - - private String getName(final Object pool) { - try { - return (String)getName.invoke(pool); - } catch (IllegalAccessException e) { - LOGGER.fine("Couldn't call getName " + e.getMessage()); - } catch (InvocationTargetException e) { - LOGGER.fine("Couldn't call getName " + e.getMessage()); - } - return ""; - } - - - -} diff --git a/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/ClassLoadingExports.java b/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/ClassLoadingExports.java deleted file mode 100644 index 65f86cfba..000000000 --- a/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/ClassLoadingExports.java +++ /dev/null @@ -1,60 +0,0 @@ -package io.prometheus.client.hotspot; - -import io.prometheus.client.Collector; -import io.prometheus.client.CounterMetricFamily; -import io.prometheus.client.GaugeMetricFamily; - -import java.lang.management.ManagementFactory; -import java.lang.management.ClassLoadingMXBean; -import java.util.ArrayList; -import java.util.List; - -/** - * Exports metrics about JVM classloading. - *

    - * Example usage: - *

    - * {@code
    - *   new ClassLoadingExports().register();
    - * }
    - * 
    - * Example metrics being exported: - *
    - *   jvm_classes_loaded{} 1000
    - *   jvm_classes_loaded_total{} 2000
    - *   jvm_classes_unloaded_total{} 500
    - * 
    - */ -public class ClassLoadingExports extends Collector { - private final ClassLoadingMXBean clBean; - - public ClassLoadingExports() { - this(ManagementFactory.getClassLoadingMXBean()); - } - - public ClassLoadingExports(ClassLoadingMXBean clBean) { - this.clBean = clBean; - } - - void addClassLoadingMetrics(List sampleFamilies) { - sampleFamilies.add(new GaugeMetricFamily( - "jvm_classes_loaded", - "The number of classes that are currently loaded in the JVM", - clBean.getLoadedClassCount())); - sampleFamilies.add(new CounterMetricFamily( - "jvm_classes_loaded_total", - "The total number of classes that have been loaded since the JVM has started execution", - clBean.getTotalLoadedClassCount())); - sampleFamilies.add(new CounterMetricFamily( - "jvm_classes_unloaded_total", - "The total number of classes that have been unloaded since the JVM has started execution", - clBean.getUnloadedClassCount())); - } - - - public List collect() { - List mfs = new ArrayList(); - addClassLoadingMetrics(mfs); - return mfs; - } -} diff --git a/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/DefaultExports.java b/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/DefaultExports.java deleted file mode 100644 index 79cd6ed5e..000000000 --- a/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/DefaultExports.java +++ /dev/null @@ -1,47 +0,0 @@ -package io.prometheus.client.hotspot; - -import io.prometheus.client.CollectorRegistry; - -/** - * Registers the default Hotspot collectors. - *

    - * This is intended to avoid users having to add in new - * registrations every time a new exporter is added. - *

    - * Example usage: - *

    - * {@code
    - *   DefaultExports.initialize();
    - * }
    - * 
    - */ -public class DefaultExports { - private static boolean initialized = false; - - /** - * Register the default Hotspot collectors with the default - * registry. It is safe to call this method multiple times, as - * this will only register the collectors once. - */ - public static synchronized void initialize() { - if (!initialized) { - register(CollectorRegistry.defaultRegistry); - initialized = true; - } - } - - /** - * Register the default Hotspot collectors with the given registry. - */ - public static void register(CollectorRegistry registry) { - new StandardExports().register(registry); - new MemoryPoolsExports().register(registry); - new MemoryAllocationExports().register(registry); - new BufferPoolsExports().register(registry); - new GarbageCollectorExports().register(registry); - new ThreadExports().register(registry); - new ClassLoadingExports().register(registry); - new VersionInfoExports().register(registry); - } - -} diff --git a/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/GarbageCollectorExports.java b/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/GarbageCollectorExports.java deleted file mode 100644 index ad0b1f029..000000000 --- a/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/GarbageCollectorExports.java +++ /dev/null @@ -1,53 +0,0 @@ -package io.prometheus.client.hotspot; - -import io.prometheus.client.Collector; -import io.prometheus.client.SummaryMetricFamily; - -import java.lang.management.GarbageCollectorMXBean; -import java.lang.management.ManagementFactory; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * Exports metrics about JVM garbage collectors. - *

    - * Example usage: - *

    - * {@code
    - *   new GarbageCollectorExports().register();
    - * }
    - * 
    - * Example metrics being exported: - *
    - *   jvm_gc_collection_seconds_count{gc="PS1"} 200
    - *   jvm_gc_collection_seconds_sum{gc="PS1"} 6.7
    - * 
    - */ -public class GarbageCollectorExports extends Collector { - private final List garbageCollectors; - - public GarbageCollectorExports() { - this(ManagementFactory.getGarbageCollectorMXBeans()); - } - - GarbageCollectorExports(List garbageCollectors) { - this.garbageCollectors = garbageCollectors; - } - - public List collect() { - SummaryMetricFamily gcCollection = new SummaryMetricFamily( - "jvm_gc_collection_seconds", - "Time spent in a given JVM garbage collector in seconds.", - Collections.singletonList("gc")); - for (final GarbageCollectorMXBean gc : garbageCollectors) { - gcCollection.addMetric( - Collections.singletonList(gc.getName()), - gc.getCollectionCount(), - gc.getCollectionTime() / MILLISECONDS_PER_SECOND); - } - List mfs = new ArrayList(); - mfs.add(gcCollection); - return mfs; - } -} diff --git a/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/MemoryAllocationExports.java b/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/MemoryAllocationExports.java deleted file mode 100644 index afad2590f..000000000 --- a/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/MemoryAllocationExports.java +++ /dev/null @@ -1,100 +0,0 @@ -package io.prometheus.client.hotspot; - -import com.sun.management.GarbageCollectionNotificationInfo; -import com.sun.management.GcInfo; -import io.prometheus.client.Collector; -import io.prometheus.client.Counter; - -import javax.management.Notification; -import javax.management.NotificationEmitter; -import javax.management.NotificationListener; -import javax.management.openmbean.CompositeData; -import java.lang.management.GarbageCollectorMXBean; -import java.lang.management.ManagementFactory; -import java.lang.management.MemoryUsage; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class MemoryAllocationExports extends Collector { - private final Counter allocatedCounter = Counter.build() - .name("jvm_memory_pool_allocated_bytes_total") - .help("Total bytes allocated in a given JVM memory pool. Only updated after GC, not continuously.") - .labelNames("pool") - .create(); - - public MemoryAllocationExports() { - AllocationCountingNotificationListener listener = new AllocationCountingNotificationListener(allocatedCounter); - for (GarbageCollectorMXBean garbageCollectorMXBean : ManagementFactory.getGarbageCollectorMXBeans()) { - ((NotificationEmitter) garbageCollectorMXBean).addNotificationListener(listener, null, null); - } - } - - @Override - public List collect() { - return allocatedCounter.collect(); - } - - static class AllocationCountingNotificationListener implements NotificationListener { - private final Map lastMemoryUsage = new HashMap(); - private final Counter counter; - - AllocationCountingNotificationListener(Counter counter) { - this.counter = counter; - } - - @Override - public synchronized void handleNotification(Notification notification, Object handback) { - GarbageCollectionNotificationInfo info = GarbageCollectionNotificationInfo.from((CompositeData) notification.getUserData()); - GcInfo gcInfo = info.getGcInfo(); - Map memoryUsageBeforeGc = gcInfo.getMemoryUsageBeforeGc(); - Map memoryUsageAfterGc = gcInfo.getMemoryUsageAfterGc(); - for (Map.Entry entry : memoryUsageBeforeGc.entrySet()) { - String memoryPool = entry.getKey(); - long before = entry.getValue().getUsed(); - long after = memoryUsageAfterGc.get(memoryPool).getUsed(); - handleMemoryPool(memoryPool, before, after); - } - } - - // Visible for testing - void handleMemoryPool(String memoryPool, long before, long after) { - /* - * Calculate increase in the memory pool by comparing memory used - * after last GC, before this GC, and after this GC. - * See ascii illustration below. - * Make sure to count only increases and ignore decreases. - * (Typically a pool will only increase between GCs or during GCs, not both. - * E.g. eden pools between GCs. Survivor and old generation pools during GCs.) - * - * |<-- diff1 -->|<-- diff2 -->| - * Timeline: |-- last GC --| |---- GC -----| - * ___^__ ___^____ ___^___ - * Mem. usage vars: / last \ / before \ / after \ - */ - - // Get last memory usage after GC and remember memory used after for next time - long last = getAndSet(lastMemoryUsage, memoryPool, after); - // Difference since last GC - long diff1 = before - last; - // Difference during this GC - long diff2 = after - before; - // Make sure to only count increases - if (diff1 < 0) { - diff1 = 0; - } - if (diff2 < 0) { - diff2 = 0; - } - long increase = diff1 + diff2; - if (increase > 0) { - counter.labels(memoryPool).inc(increase); - } - } - - private static long getAndSet(Map map, String key, long value) { - Long last = map.put(key, value); - return last == null ? 0 : last; - } - } -} diff --git a/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/MemoryPoolsExports.java b/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/MemoryPoolsExports.java deleted file mode 100644 index 50f46fb4d..000000000 --- a/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/MemoryPoolsExports.java +++ /dev/null @@ -1,128 +0,0 @@ -package io.prometheus.client.hotspot; - -import io.prometheus.client.Collector; -import io.prometheus.client.GaugeMetricFamily; - -import java.lang.management.ManagementFactory; -import java.lang.management.MemoryMXBean; -import java.lang.management.MemoryPoolMXBean; -import java.lang.management.MemoryUsage; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * Exports metrics about JVM memory areas. - *

    - * Example usage: - *

    - * {@code
    - *   new MemoryPoolsExports().register();
    - * }
    - * 
    - * Example metrics being exported: - *
    - *   jvm_memory_bytes_used{area="heap"} 2000000
    - *   jvm_memory_bytes_committed{area="nonheap"} 200000
    - *   jvm_memory_bytes_max{area="nonheap"} 2000000
    - *   jvm_memory_pool_bytes_used{pool="PS Eden Space"} 2000
    - * 
    - */ -public class MemoryPoolsExports extends Collector { - private final MemoryMXBean memoryBean; - private final List poolBeans; - - public MemoryPoolsExports() { - this( - ManagementFactory.getMemoryMXBean(), - ManagementFactory.getMemoryPoolMXBeans()); - } - - public MemoryPoolsExports(MemoryMXBean memoryBean, - List poolBeans) { - this.memoryBean = memoryBean; - this.poolBeans = poolBeans; - } - - void addMemoryAreaMetrics(List sampleFamilies) { - MemoryUsage heapUsage = memoryBean.getHeapMemoryUsage(); - MemoryUsage nonHeapUsage = memoryBean.getNonHeapMemoryUsage(); - - GaugeMetricFamily used = new GaugeMetricFamily( - "jvm_memory_bytes_used", - "Used bytes of a given JVM memory area.", - Collections.singletonList("area")); - used.addMetric(Collections.singletonList("heap"), heapUsage.getUsed()); - used.addMetric(Collections.singletonList("nonheap"), nonHeapUsage.getUsed()); - sampleFamilies.add(used); - - GaugeMetricFamily committed = new GaugeMetricFamily( - "jvm_memory_bytes_committed", - "Committed (bytes) of a given JVM memory area.", - Collections.singletonList("area")); - committed.addMetric(Collections.singletonList("heap"), heapUsage.getCommitted()); - committed.addMetric(Collections.singletonList("nonheap"), nonHeapUsage.getCommitted()); - sampleFamilies.add(committed); - - GaugeMetricFamily max = new GaugeMetricFamily( - "jvm_memory_bytes_max", - "Max (bytes) of a given JVM memory area.", - Collections.singletonList("area")); - max.addMetric(Collections.singletonList("heap"), heapUsage.getMax()); - max.addMetric(Collections.singletonList("nonheap"), nonHeapUsage.getMax()); - sampleFamilies.add(max); - - GaugeMetricFamily init = new GaugeMetricFamily( - "jvm_memory_bytes_init", - "Initial bytes of a given JVM memory area.", - Collections.singletonList("area")); - init.addMetric(Collections.singletonList("heap"), heapUsage.getInit()); - init.addMetric(Collections.singletonList("nonheap"), nonHeapUsage.getInit()); - sampleFamilies.add(init); - } - - void addMemoryPoolMetrics(List sampleFamilies) { - GaugeMetricFamily used = new GaugeMetricFamily( - "jvm_memory_pool_bytes_used", - "Used bytes of a given JVM memory pool.", - Collections.singletonList("pool")); - sampleFamilies.add(used); - GaugeMetricFamily committed = new GaugeMetricFamily( - "jvm_memory_pool_bytes_committed", - "Committed bytes of a given JVM memory pool.", - Collections.singletonList("pool")); - sampleFamilies.add(committed); - GaugeMetricFamily max = new GaugeMetricFamily( - "jvm_memory_pool_bytes_max", - "Max bytes of a given JVM memory pool.", - Collections.singletonList("pool")); - sampleFamilies.add(max); - GaugeMetricFamily init = new GaugeMetricFamily( - "jvm_memory_pool_bytes_init", - "Initial bytes of a given JVM memory pool.", - Collections.singletonList("pool")); - sampleFamilies.add(init); - for (final MemoryPoolMXBean pool : poolBeans) { - MemoryUsage poolUsage = pool.getUsage(); - used.addMetric( - Collections.singletonList(pool.getName()), - poolUsage.getUsed()); - committed.addMetric( - Collections.singletonList(pool.getName()), - poolUsage.getCommitted()); - max.addMetric( - Collections.singletonList(pool.getName()), - poolUsage.getMax()); - init.addMetric( - Collections.singletonList(pool.getName()), - poolUsage.getInit()); - } - } - - public List collect() { - List mfs = new ArrayList(); - addMemoryAreaMetrics(mfs); - addMemoryPoolMetrics(mfs); - return mfs; - } -} diff --git a/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/StandardExports.java b/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/StandardExports.java deleted file mode 100644 index 2013bc142..000000000 --- a/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/StandardExports.java +++ /dev/null @@ -1,181 +0,0 @@ -package io.prometheus.client.hotspot; - -import io.prometheus.client.Collector; -import io.prometheus.client.CounterMetricFamily; -import io.prometheus.client.GaugeMetricFamily; - -import java.io.BufferedReader; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.lang.management.ManagementFactory; -import java.lang.management.OperatingSystemMXBean; -import java.lang.management.RuntimeMXBean; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * Exports the standard exports common across all prometheus clients. - *

    - * This includes stats like CPU time spent and memory usage. - *

    - * Example usage: - *

    - * {@code
    - *   new StandardExports().register();
    - * }
    - * 
    - */ -public class StandardExports extends Collector { - private static final Logger LOGGER = Logger.getLogger(StandardExports.class.getName()); - - private final StatusReader statusReader; - private final OperatingSystemMXBean osBean; - private final RuntimeMXBean runtimeBean; - private final boolean linux; - - public StandardExports() { - this(new StatusReader(), - ManagementFactory.getOperatingSystemMXBean(), - ManagementFactory.getRuntimeMXBean()); - } - - StandardExports(StatusReader statusReader, OperatingSystemMXBean osBean, RuntimeMXBean runtimeBean) { - this.statusReader = statusReader; - this.osBean = osBean; - this.runtimeBean = runtimeBean; - this.linux = (osBean.getName().indexOf("Linux") == 0); - } - - private final static double KB = 1024; - - @Override - public List collect() { - List mfs = new ArrayList(); - - try { - // There exist at least 2 similar but unrelated UnixOperatingSystemMXBean interfaces, in - // com.sun.management and com.ibm.lang.management. Hence use reflection and recursively go - // through implemented interfaces until the method can be made accessible and invoked. - Long processCpuTime = callLongGetter("getProcessCpuTime", osBean); - mfs.add(new CounterMetricFamily("process_cpu_seconds_total", "Total user and system CPU time spent in seconds.", - processCpuTime / NANOSECONDS_PER_SECOND)); - } - catch (Exception e) { - LOGGER.log(Level.FINE,"Could not access process cpu time", e); - } - - mfs.add(new GaugeMetricFamily("process_start_time_seconds", "Start time of the process since unix epoch in seconds.", - runtimeBean.getStartTime() / MILLISECONDS_PER_SECOND)); - - // There exist at least 2 similar but unrelated UnixOperatingSystemMXBean interfaces, in - // com.sun.management and com.ibm.lang.management. Hence use reflection and recursively go - // through implemented interfaces until the method can be made accessible and invoked. - try { - Long openFdCount = callLongGetter("getOpenFileDescriptorCount", osBean); - mfs.add(new GaugeMetricFamily( - "process_open_fds", "Number of open file descriptors.", openFdCount)); - Long maxFdCount = callLongGetter("getMaxFileDescriptorCount", osBean); - mfs.add(new GaugeMetricFamily( - "process_max_fds", "Maximum number of open file descriptors.", maxFdCount)); - } catch (Exception e) { - // Ignore, expected on non-Unix OSs. - } - - // There's no standard Java or POSIX way to get memory stats, - // so add support for just Linux for now. - if (linux) { - try { - collectMemoryMetricsLinux(mfs); - } catch (Exception e) { - // If the format changes, log a warning and return what we can. - LOGGER.warning(e.toString()); - } - } - return mfs; - } - - static Long callLongGetter(String getterName, Object obj) - throws NoSuchMethodException, InvocationTargetException { - return callLongGetter(obj.getClass().getMethod(getterName), obj); - } - - /** - * Attempts to call a method either directly or via one of the implemented interfaces. - *

    - * A Method object refers to a specific method declared in a specific class. The first invocation - * might happen with method == SomeConcreteClass.publicLongGetter() and will fail if - * SomeConcreteClass is not public. We then recurse over all interfaces implemented by - * SomeConcreteClass (or extended by those interfaces and so on) until we eventually invoke - * callMethod() with method == SomePublicInterface.publicLongGetter(), which will then succeed. - *

    - * There is a built-in assumption that the method will never return null (or, equivalently, that - * it returns the primitive data type, i.e. {@code long} rather than {@code Long}). If this - * assumption doesn't hold, the method might be called repeatedly and the returned value will be - * the one produced by the last call. - */ - static Long callLongGetter(Method method, Object obj) throws InvocationTargetException { - try { - return (Long) method.invoke(obj); - } catch (IllegalAccessException e) { - // Expected, the declaring class or interface might not be public. - } - - // Iterate over all implemented/extended interfaces and attempt invoking the method with the - // same name and parameters on each. - for (Class clazz : method.getDeclaringClass().getInterfaces()) { - try { - Method interfaceMethod = clazz.getMethod(method.getName(), method.getParameterTypes()); - Long result = callLongGetter(interfaceMethod, obj); - if (result != null) { - return result; - } - } catch (NoSuchMethodException e) { - // Expected, class might implement multiple, unrelated interfaces. - } - } - - return null; - } - - void collectMemoryMetricsLinux(List mfs) { - // statm/stat report in pages, and it's non-trivial to get pagesize from Java - // so we parse status instead. - BufferedReader br = null; - try { - br = statusReader.procSelfStatusReader(); - String line; - while ((line = br.readLine()) != null) { - if (line.startsWith("VmSize:")) { - mfs.add(new GaugeMetricFamily("process_virtual_memory_bytes", - "Virtual memory size in bytes.", - Float.parseFloat(line.split("\\s+")[1]) * KB)); - } else if (line.startsWith("VmRSS:")) { - mfs.add(new GaugeMetricFamily("process_resident_memory_bytes", - "Resident memory size in bytes.", - Float.parseFloat(line.split("\\s+")[1]) * KB)); - } - } - } catch (IOException e) { - LOGGER.fine(e.toString()); - } finally { - if (br != null) { - try { - br.close(); - } catch (IOException e) { - LOGGER.fine(e.toString()); - } - } - } - } - - static class StatusReader { - BufferedReader procSelfStatusReader() throws FileNotFoundException { - return new BufferedReader(new FileReader("/proc/self/status")); - } - } -} diff --git a/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/ThreadExports.java b/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/ThreadExports.java deleted file mode 100644 index 55c90a654..000000000 --- a/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/ThreadExports.java +++ /dev/null @@ -1,126 +0,0 @@ -package io.prometheus.client.hotspot; - -import io.prometheus.client.Collector; -import io.prometheus.client.CounterMetricFamily; -import io.prometheus.client.GaugeMetricFamily; - -import java.lang.management.ManagementFactory; -import java.lang.management.ThreadInfo; -import java.lang.management.ThreadMXBean; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Exports metrics about JVM thread areas. - *

    - * Example usage: - *

    - * {@code
    - *   new ThreadExports().register();
    - * }
    - * 
    - * Example metrics being exported: - *
    - *   jvm_threads_current{} 300
    - *   jvm_threads_daemon{} 200
    - *   jvm_threads_peak{} 410
    - *   jvm_threads_started_total{} 1200
    - * 
    - */ -public class ThreadExports extends Collector { - private final ThreadMXBean threadBean; - - public ThreadExports() { - this(ManagementFactory.getThreadMXBean()); - } - - public ThreadExports(ThreadMXBean threadBean) { - this.threadBean = threadBean; - } - - void addThreadMetrics(List sampleFamilies) { - sampleFamilies.add( - new GaugeMetricFamily( - "jvm_threads_current", - "Current thread count of a JVM", - threadBean.getThreadCount())); - - sampleFamilies.add( - new GaugeMetricFamily( - "jvm_threads_daemon", - "Daemon thread count of a JVM", - threadBean.getDaemonThreadCount())); - - sampleFamilies.add( - new GaugeMetricFamily( - "jvm_threads_peak", - "Peak thread count of a JVM", - threadBean.getPeakThreadCount())); - - sampleFamilies.add( - new CounterMetricFamily( - "jvm_threads_started_total", - "Started thread count of a JVM", - threadBean.getTotalStartedThreadCount())); - - sampleFamilies.add( - new GaugeMetricFamily( - "jvm_threads_deadlocked", - "Cycles of JVM-threads that are in deadlock waiting to acquire object monitors or ownable synchronizers", - nullSafeArrayLength(threadBean.findDeadlockedThreads()))); - - sampleFamilies.add( - new GaugeMetricFamily( - "jvm_threads_deadlocked_monitor", - "Cycles of JVM-threads that are in deadlock waiting to acquire object monitors", - nullSafeArrayLength(threadBean.findMonitorDeadlockedThreads()))); - - GaugeMetricFamily threadStateFamily = new GaugeMetricFamily( - "jvm_threads_state", - "Current count of threads by state", - Collections.singletonList("state")); - - Map threadStateCounts = getThreadStateCountMap(); - for (Map.Entry entry : threadStateCounts.entrySet()) { - threadStateFamily.addMetric( - Collections.singletonList(entry.getKey().toString()), - entry.getValue() - ); - } - sampleFamilies.add(threadStateFamily); - } - - private Map getThreadStateCountMap() { - // Get thread information without computing any stack traces - ThreadInfo[] allThreads = threadBean.getThreadInfo(threadBean.getAllThreadIds(), 0); - - // Initialize the map with all thread states - HashMap threadCounts = new HashMap(); - for (Thread.State state : Thread.State.values()) { - threadCounts.put(state, 0); - } - - // Collect the actual thread counts - for (ThreadInfo curThread : allThreads) { - if (curThread != null) { - Thread.State threadState = curThread.getThreadState(); - threadCounts.put(threadState, threadCounts.get(threadState) + 1); - } - } - - return threadCounts; - } - - private static double nullSafeArrayLength(long[] array) { - return null == array ? 0 : array.length; - } - - public List collect() { - List mfs = new ArrayList(); - addThreadMetrics(mfs); - return mfs; - } -} diff --git a/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/VersionInfoExports.java b/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/VersionInfoExports.java deleted file mode 100644 index f50d79f21..000000000 --- a/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/VersionInfoExports.java +++ /dev/null @@ -1,45 +0,0 @@ -package io.prometheus.client.hotspot; - -import io.prometheus.client.Collector; -import io.prometheus.client.GaugeMetricFamily; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * Exports JVM version info. - *

    - * Example usage: - *

    - * {@code
    - *   new VersionInfoExports().register();
    - * }
    - * 
    - * Metrics being exported: - *
    - *   jvm_info{version="1.8.0_151-b12",vendor="Oracle Corporation",runtime="OpenJDK Runtime Environment",} 1.0
    - * 
    - */ - -public class VersionInfoExports extends Collector { - - - public List collect() { - List mfs = new ArrayList(); - - GaugeMetricFamily jvmInfo = new GaugeMetricFamily( - "jvm_info", - "JVM version info", - Arrays.asList("version", "vendor", "runtime")); - jvmInfo.addMetric( - Arrays.asList( - System.getProperty("java.runtime.version", "unknown"), - System.getProperty("java.vm.vendor", "unknown"), - System.getProperty("java.runtime.name", "unknown")), - 1L); - mfs.add(jvmInfo); - - return mfs; - } -} diff --git a/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/ClassLoadingExportsTest.java b/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/ClassLoadingExportsTest.java deleted file mode 100644 index 62370dc67..000000000 --- a/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/ClassLoadingExportsTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package io.prometheus.client.hotspot; - -import io.prometheus.client.CollectorRegistry; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; - -import java.lang.management.ClassLoadingMXBean; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.when; - -public class ClassLoadingExportsTest { - - private ClassLoadingMXBean mockClassLoadingsBean = Mockito.mock(ClassLoadingMXBean.class); - private CollectorRegistry registry = new CollectorRegistry(); - private ClassLoadingExports collectorUnderTest; - - private static final String[] EMPTY_LABEL = new String[0]; - - @Before - public void setUp() { - when(mockClassLoadingsBean.getLoadedClassCount()).thenReturn(1000); - when(mockClassLoadingsBean.getTotalLoadedClassCount()).thenReturn(2000L); - when(mockClassLoadingsBean.getUnloadedClassCount()).thenReturn(500L); - collectorUnderTest = new ClassLoadingExports(mockClassLoadingsBean).register(registry); - } - - @Test - public void testClassLoading() { - assertEquals( - 1000, - registry.getSampleValue( - "jvm_classes_loaded", EMPTY_LABEL, EMPTY_LABEL), - .0000001); - assertEquals( - 2000L, - registry.getSampleValue( - "jvm_classes_loaded_total", EMPTY_LABEL, EMPTY_LABEL), - .0000001); - assertEquals( - 500L, - registry.getSampleValue( - "jvm_classes_unloaded_total", EMPTY_LABEL, EMPTY_LABEL), - .0000001); - } -} diff --git a/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/ExampleExporter.java b/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/ExampleExporter.java deleted file mode 100644 index 7c7212c8b..000000000 --- a/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/ExampleExporter.java +++ /dev/null @@ -1,23 +0,0 @@ -package io.prometheus.client.hotspot; - -import io.prometheus.client.exporter.MetricsServlet; -import io.prometheus.client.hotspot.StandardExports; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.servlet.ServletContextHandler; -import org.eclipse.jetty.servlet.ServletHolder; - - -public class ExampleExporter { - - public static void main(String[] args) throws Exception { - DefaultExports.initialize(); - Server server = new Server(1234); - ServletContextHandler context = new ServletContextHandler(); - context.setContextPath("/"); - server.setHandler(context); - context.addServlet(new ServletHolder(new MetricsServlet()), "/metrics"); - server.start(); - server.join(); - } - -} diff --git a/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/GarbageCollectorExportsTest.java b/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/GarbageCollectorExportsTest.java deleted file mode 100644 index 4481d170b..000000000 --- a/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/GarbageCollectorExportsTest.java +++ /dev/null @@ -1,67 +0,0 @@ -package io.prometheus.client.hotspot; - -import io.prometheus.client.CollectorRegistry; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; - -import java.lang.management.GarbageCollectorMXBean; -import java.util.Arrays; -import java.util.List; -import java.util.concurrent.TimeUnit; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.when; - - -public class GarbageCollectorExportsTest { - - private GarbageCollectorMXBean mockGcBean1 = Mockito.mock(GarbageCollectorMXBean.class); - private GarbageCollectorMXBean mockGcBean2 = Mockito.mock(GarbageCollectorMXBean.class); - private List mockList = Arrays.asList(mockGcBean1, mockGcBean2); - private CollectorRegistry registry = new CollectorRegistry(); - private GarbageCollectorExports collectorUnderTest; - - @Before - public void setUp() { - when(mockGcBean1.getName()).thenReturn("MyGC1"); - when(mockGcBean1.getCollectionCount()).thenReturn(100L); - when(mockGcBean1.getCollectionTime()).thenReturn(TimeUnit.SECONDS.toMillis(10)); - when(mockGcBean2.getName()).thenReturn("MyGC2"); - when(mockGcBean2.getCollectionCount()).thenReturn(200L); - when(mockGcBean2.getCollectionTime()).thenReturn(TimeUnit.SECONDS.toMillis(20)); - collectorUnderTest = new GarbageCollectorExports(mockList).register(registry); - } - - @Test - public void testGarbageCollectorExports() { - assertEquals( - 100L, - registry.getSampleValue( - "jvm_gc_collection_seconds_count", - new String[]{"gc"}, - new String[]{"MyGC1"}), - .0000001); - assertEquals( - 10d, - registry.getSampleValue( - "jvm_gc_collection_seconds_sum", - new String[]{"gc"}, - new String[]{"MyGC1"}), - .0000001); - assertEquals( - 200L, - registry.getSampleValue( - "jvm_gc_collection_seconds_count", - new String[]{"gc"}, - new String[]{"MyGC2"}), - .0000001); - assertEquals( - 20d, - registry.getSampleValue( - "jvm_gc_collection_seconds_sum", - new String[]{"gc"}, - new String[]{"MyGC2"}), - .0000001); - } -} diff --git a/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/MemoryAllocationExportsTest.java b/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/MemoryAllocationExportsTest.java deleted file mode 100644 index 0eb4d38c2..000000000 --- a/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/MemoryAllocationExportsTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package io.prometheus.client.hotspot; - -import io.prometheus.client.Counter; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; - -public class MemoryAllocationExportsTest { - - @Test - public void testListenerLogic() { - Counter counter = Counter.build("test", "test").labelNames("pool").create(); - MemoryAllocationExports.AllocationCountingNotificationListener listener = - new MemoryAllocationExports.AllocationCountingNotificationListener(counter); - - // Increase by 123 - listener.handleMemoryPool("TestPool", 0, 123); - Counter.Child child = counter.labels("TestPool"); - assertEquals(123, child.get(), 0.001); - - // No increase - listener.handleMemoryPool("TestPool", 123, 123); - assertEquals(123, child.get(), 0.001); - - // No increase, then decrease to 0 - listener.handleMemoryPool("TestPool", 123, 0); - assertEquals(123, child.get(), 0.001); - - // No increase, then increase by 7 - listener.handleMemoryPool("TestPool", 0, 7); - assertEquals(130, child.get(), 0.001); - - // Increase by 10, then decrease to 10 - listener.handleMemoryPool("TestPool", 17, 10); - assertEquals(140, child.get(), 0.001); - - // Increase by 7, then increase by 3 - listener.handleMemoryPool("TestPool", 17, 20); - assertEquals(150, child.get(), 0.001); - - // Decrease to 17, then increase by 3 - listener.handleMemoryPool("TestPool", 17, 20); - assertEquals(153, child.get(), 0.001); - } -} diff --git a/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/MemoryPoolsExportsTest.java b/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/MemoryPoolsExportsTest.java deleted file mode 100644 index 23467b1e7..000000000 --- a/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/MemoryPoolsExportsTest.java +++ /dev/null @@ -1,166 +0,0 @@ -package io.prometheus.client.hotspot; - -import io.prometheus.client.CollectorRegistry; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; - -import java.lang.management.MemoryMXBean; -import java.lang.management.MemoryPoolMXBean; -import java.lang.management.MemoryUsage; -import java.util.Arrays; -import java.util.List; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.when; - -public class MemoryPoolsExportsTest { - - private MemoryPoolMXBean mockPoolsBean1 = Mockito.mock(MemoryPoolMXBean.class); - private MemoryPoolMXBean mockPoolsBean2 = Mockito.mock(MemoryPoolMXBean.class); - private MemoryMXBean mockMemoryBean = Mockito.mock(MemoryMXBean.class); - private MemoryUsage mockUsage1 = Mockito.mock(MemoryUsage.class); - private MemoryUsage mockUsage2 = Mockito.mock(MemoryUsage.class); - private List mockList = Arrays.asList(mockPoolsBean1, mockPoolsBean2); - private CollectorRegistry registry = new CollectorRegistry(); - private MemoryPoolsExports collectorUnderTest; - - @Before - public void setUp() { - when(mockPoolsBean1.getName()).thenReturn("PS Eden Space"); - when(mockPoolsBean1.getUsage()).thenReturn(mockUsage1); - when(mockPoolsBean2.getName()).thenReturn("PS Old Gen"); - when(mockPoolsBean2.getUsage()).thenReturn(mockUsage2); - when(mockMemoryBean.getHeapMemoryUsage()).thenReturn(mockUsage1); - when(mockMemoryBean.getNonHeapMemoryUsage()).thenReturn(mockUsage2); - when(mockUsage1.getUsed()).thenReturn(500000L); - when(mockUsage1.getCommitted()).thenReturn(1000000L); - when(mockUsage1.getMax()).thenReturn(2000000L); - when(mockUsage1.getInit()).thenReturn(1000L); - when(mockUsage2.getUsed()).thenReturn(10000L); - when(mockUsage2.getCommitted()).thenReturn(20000L); - when(mockUsage2.getMax()).thenReturn(3000000L); - when(mockUsage2.getInit()).thenReturn(2000L); - collectorUnderTest = new MemoryPoolsExports(mockMemoryBean, mockList).register(registry); - } - - @Test - public void testMemoryPools() { - assertEquals( - 500000L, - registry.getSampleValue( - "jvm_memory_pool_bytes_used", - new String[]{"pool"}, - new String[]{"PS Eden Space"}), - .0000001); - assertEquals( - 1000000L, - registry.getSampleValue( - "jvm_memory_pool_bytes_committed", - new String[]{"pool"}, - new String[]{"PS Eden Space"}), - .0000001); - assertEquals( - 2000000L, - registry.getSampleValue( - "jvm_memory_pool_bytes_max", - new String[]{"pool"}, - new String[]{"PS Eden Space"}), - .0000001); - assertEquals( - 1000L, - registry.getSampleValue( - "jvm_memory_pool_bytes_init", - new String[]{"pool"}, - new String[]{"PS Eden Space"}), - .0000001); - assertEquals( - 10000L, - registry.getSampleValue( - "jvm_memory_pool_bytes_used", - new String[]{"pool"}, - new String[]{"PS Old Gen"}), - .0000001); - assertEquals( - 20000L, - registry.getSampleValue( - "jvm_memory_pool_bytes_committed", - new String[]{"pool"}, - new String[]{"PS Old Gen"}), - .0000001); - assertEquals( - 3000000L, - registry.getSampleValue( - "jvm_memory_pool_bytes_max", - new String[]{"pool"}, - new String[]{"PS Old Gen"}), - .0000001); - assertEquals( - 2000L, - registry.getSampleValue( - "jvm_memory_pool_bytes_init", - new String[]{"pool"}, - new String[]{"PS Old Gen"}), - .0000001); - } - - @Test - public void testMemoryAreas() { - assertEquals( - 500000L, - registry.getSampleValue( - "jvm_memory_bytes_used", - new String[]{"area"}, - new String[]{"heap"}), - .0000001); - assertEquals( - 1000000L, - registry.getSampleValue( - "jvm_memory_bytes_committed", - new String[]{"area"}, - new String[]{"heap"}), - .0000001); - assertEquals( - 2000000L, - registry.getSampleValue( - "jvm_memory_bytes_max", - new String[]{"area"}, - new String[]{"heap"}), - .0000001); - assertEquals( - 1000L, - registry.getSampleValue( - "jvm_memory_bytes_init", - new String[]{"area"}, - new String[]{"heap"}), - .0000001); - assertEquals( - 10000L, - registry.getSampleValue( - "jvm_memory_bytes_used", - new String[]{"area"}, - new String[]{"nonheap"}), - .0000001); - assertEquals( - 20000L, - registry.getSampleValue( - "jvm_memory_bytes_committed", - new String[]{"area"}, - new String[]{"nonheap"}), - .0000001); - assertEquals( - 3000000L, - registry.getSampleValue( - "jvm_memory_bytes_max", - new String[]{"area"}, - new String[]{"nonheap"}), - .0000001); - assertEquals( - 2000L, - registry.getSampleValue( - "jvm_memory_bytes_init", - new String[]{"area"}, - new String[]{"nonheap"}), - .0000001); - } -} diff --git a/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/StandardExportsTest.java b/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/StandardExportsTest.java deleted file mode 100644 index 21821ce96..000000000 --- a/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/StandardExportsTest.java +++ /dev/null @@ -1,109 +0,0 @@ -package io.prometheus.client.hotspot; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import java.io.BufferedReader; -import java.io.StringReader; -import java.io.FileNotFoundException; -import java.lang.management.OperatingSystemMXBean; -import java.lang.management.RuntimeMXBean; - -import io.prometheus.client.CollectorRegistry; -import org.junit.Before; -import org.junit.Test; - -public class StandardExportsTest { - - static class StatusReaderTest extends StandardExports.StatusReader { - BufferedReader procSelfStatusReader() throws FileNotFoundException { - return new BufferedReader(new StringReader("Name: cat\nVmSize:\t5900 kB\nVmRSS:\t 360 kB\n")); - } - } - - // Interface with a signature equivalent to com.sun.management.OperatingSystemMXBean and - // com.ibm.lang.management.OperatingSystemMXBean, without explicitly depending on either of - // these classes, used to test reflection. - interface GenericOperatingSystemMXBean extends OperatingSystemMXBean { - public long getCommittedVirtualMemorySize(); - public long getTotalSwapSpaceSize(); - public long getFreeSwapSpaceSize(); - public long getProcessCpuTime(); - public long getFreePhysicalMemorySize(); - public long getTotalPhysicalMemorySize(); - } - - // Interface with a signature equivalent to com.sun.management.UnixOperatingSystemMXBean and - // com.ibm.lang.management.UnixOperatingSystemMXBean, without explicitly depending on either of - // these classes, used to test reflection. - interface UnixOperatingSystemMXBean extends GenericOperatingSystemMXBean { - public long getOpenFileDescriptorCount(); - public long getMaxFileDescriptorCount(); - } - - UnixOperatingSystemMXBean osBean; - RuntimeMXBean runtimeBean; - - @Before - public void setUp() { - osBean = mock(UnixOperatingSystemMXBean.class); - when(osBean.getName()).thenReturn("Linux"); - when(osBean.getProcessCpuTime()).thenReturn(123L); - when(osBean.getOpenFileDescriptorCount()).thenReturn(10L); - when(osBean.getMaxFileDescriptorCount()).thenReturn(20L); - runtimeBean = mock(RuntimeMXBean.class); - when(runtimeBean.getStartTime()).thenReturn(456L); - } - - @Test - public void testStandardExports() { - CollectorRegistry registry = new CollectorRegistry(); - new StandardExports(new StatusReaderTest(), osBean, runtimeBean).register(registry); - - assertEquals(123 / 1.0E9, - registry.getSampleValue("process_cpu_seconds_total", new String[]{}, new String[]{}), .0000001); - assertEquals(10, - registry.getSampleValue("process_open_fds", new String[]{}, new String[]{}), .001); - assertEquals(20, - registry.getSampleValue("process_max_fds", new String[]{}, new String[]{}), .001); - assertEquals(456 / 1.0E3, - registry.getSampleValue("process_start_time_seconds", new String[]{}, new String[]{}), .0000001); - assertEquals(5900 * 1024, - registry.getSampleValue("process_virtual_memory_bytes", new String[]{}, new String[]{}), .001); - assertEquals(360 * 1024, - registry.getSampleValue("process_resident_memory_bytes", new String[]{}, new String[]{}), .001); - } - - @Test - public void testNonUnixStandardExports() { - GenericOperatingSystemMXBean genericOsBean = mock(GenericOperatingSystemMXBean.class); - when(genericOsBean.getName()).thenReturn("Windows"); - when(genericOsBean.getProcessCpuTime()).thenReturn(123L); - - CollectorRegistry registry = new CollectorRegistry(); - new StandardExports(new StatusReaderTest(), genericOsBean, runtimeBean).register(registry); - - assertEquals(123 / 1.0E9, - registry.getSampleValue("process_cpu_seconds_total", new String[]{}, new String[]{}), .0000001); - assertEquals(456 / 1.0E3, - registry.getSampleValue("process_start_time_seconds", new String[]{}, new String[]{}), .0000001); - } - - @Test - public void testBrokenProcStatusReturnsOtherStats() { - class StatusReaderBroken extends StandardExports.StatusReader { - BufferedReader procSelfStatusReader() throws FileNotFoundException { - return new BufferedReader(new StringReader("Name: cat\nVmSize:\n")); - } - } - - CollectorRegistry registry = new CollectorRegistry(); - new StandardExports(new StatusReaderBroken(), osBean, runtimeBean).register(registry); - - assertEquals(123 / 1.0E9, - registry.getSampleValue("process_cpu_seconds_total", new String[]{}, new String[]{}), .0000001); - assertNull(registry.getSampleValue("process_resident_memory_bytes", new String[]{}, new String[]{})); - } -} diff --git a/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/ThreadExportsTest.java b/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/ThreadExportsTest.java deleted file mode 100644 index 9bd6c7f45..000000000 --- a/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/ThreadExportsTest.java +++ /dev/null @@ -1,100 +0,0 @@ -package io.prometheus.client.hotspot; - -import io.prometheus.client.CollectorRegistry; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; - -import java.lang.management.ThreadInfo; -import java.lang.management.ThreadMXBean; -import java.util.Arrays; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.when; - -public class ThreadExportsTest { - - private ThreadMXBean mockThreadsBean = Mockito.mock(ThreadMXBean.class); - private CollectorRegistry registry = new CollectorRegistry(); - private ThreadExports collectorUnderTest; - private ThreadInfo mockThreadInfoBlocked = Mockito.mock(ThreadInfo.class); - private ThreadInfo mockThreadInfoRunnable1 = Mockito.mock(ThreadInfo.class); - private ThreadInfo mockThreadInfoRunnable2 = Mockito.mock(ThreadInfo.class); - - private static final String[] EMPTY_LABEL = new String[0]; - private static final String[] STATE_LABEL = {"state"}; - private static final String[] STATE_BLOCKED_LABEL = {Thread.State.BLOCKED.toString()}; - private static final String[] STATE_RUNNABLE_LABEL = {Thread.State.RUNNABLE.toString()}; - private static final String[] STATE_TERMINATED_LABEL = {Thread.State.TERMINATED.toString()}; - - - @Before - public void setUp() { - when(mockThreadsBean.getThreadCount()).thenReturn(300); - when(mockThreadsBean.getDaemonThreadCount()).thenReturn(200); - when(mockThreadsBean.getPeakThreadCount()).thenReturn(301); - when(mockThreadsBean.getTotalStartedThreadCount()).thenReturn(503L); - when(mockThreadsBean.findDeadlockedThreads()).thenReturn(new long[]{1L,2L,3L}); - when(mockThreadsBean.findMonitorDeadlockedThreads()).thenReturn(new long[]{2L,3L,4L}); - when(mockThreadsBean.getAllThreadIds()).thenReturn(new long[]{3L,4L,5L}); - when(mockThreadInfoBlocked.getThreadState()).thenReturn(Thread.State.BLOCKED); - when(mockThreadInfoRunnable1.getThreadState()).thenReturn(Thread.State.RUNNABLE); - when(mockThreadInfoRunnable2.getThreadState()).thenReturn(Thread.State.RUNNABLE); - when(mockThreadsBean.getThreadInfo(new long[]{3L, 4L, 5L}, 0)).thenReturn(new ThreadInfo[]{ - mockThreadInfoBlocked, mockThreadInfoRunnable1, mockThreadInfoRunnable2 - }); - collectorUnderTest = new ThreadExports(mockThreadsBean).register(registry); - } - - @Test - public void testThreadPools() { - assertEquals( - 300L, - registry.getSampleValue( - "jvm_threads_current", EMPTY_LABEL, EMPTY_LABEL), - .0000001); - assertEquals( - 200L, - registry.getSampleValue( - "jvm_threads_daemon", EMPTY_LABEL, EMPTY_LABEL), - .0000001); - assertEquals( - 301L, - registry.getSampleValue( - "jvm_threads_peak", EMPTY_LABEL, EMPTY_LABEL), - .0000001); - assertEquals( - 503L, - registry.getSampleValue( - "jvm_threads_started_total", EMPTY_LABEL, EMPTY_LABEL), - .0000001); - assertEquals( - 3L, - registry.getSampleValue( - "jvm_threads_deadlocked", EMPTY_LABEL, EMPTY_LABEL), - .0000001); - assertEquals( - 3L, - registry.getSampleValue( - "jvm_threads_deadlocked_monitor", EMPTY_LABEL, EMPTY_LABEL), - .0000001); - - assertEquals( - 1L, - registry.getSampleValue( - "jvm_threads_state", STATE_LABEL, STATE_BLOCKED_LABEL), - .0000001); - - assertEquals( - 2L, - registry.getSampleValue( - "jvm_threads_state", STATE_LABEL, STATE_RUNNABLE_LABEL), - .0000001); - - assertEquals( - 0L, - registry.getSampleValue( - "jvm_threads_state", STATE_LABEL, STATE_TERMINATED_LABEL), - .0000001); - } -} diff --git a/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/VersionInfoExportsTest.java b/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/VersionInfoExportsTest.java deleted file mode 100644 index 036105e05..000000000 --- a/simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/VersionInfoExportsTest.java +++ /dev/null @@ -1,27 +0,0 @@ -package io.prometheus.client.hotspot; - -import io.prometheus.client.CollectorRegistry; -import org.junit.Before; -import org.junit.Test; - - -import static org.junit.Assert.assertEquals; - -public class VersionInfoExportsTest { - - private CollectorRegistry registry = new CollectorRegistry(); - - @Before - public void setUp() { - new VersionInfoExports().register(registry); - } - - @Test - public void testVersionInfo() { - assertEquals( - 1L, - registry.getSampleValue( - "jvm_info", new String[]{"version", "vendor", "runtime"}, new String[]{System.getProperty("java.runtime.version", "unknown"), System.getProperty("java.vm.vendor", "unknown"), System.getProperty("java.runtime.name", "unknown")}), - .0000001); - } -} diff --git a/simpleclient_httpserver/pom.xml b/simpleclient_httpserver/pom.xml deleted file mode 100644 index 4be38ee34..000000000 --- a/simpleclient_httpserver/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - 4.0.0 - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_httpserver - bundle - - Prometheus Java Simpleclient Httpserver - - Httpserver exposition for the simpleclient. - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - brian-brazil - Brian Brazil - brian.brazil@robustperception.io - - - - - - io.prometheus - simpleclient - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_common - 0.6.1-SNAPSHOT - - - - junit - junit - 4.11 - test - - - org.assertj - assertj-core - 2.6.0 - test - - - diff --git a/simpleclient_httpserver/src/main/java/io/prometheus/client/exporter/HTTPServer.java b/simpleclient_httpserver/src/main/java/io/prometheus/client/exporter/HTTPServer.java deleted file mode 100644 index 85eb4e5cc..000000000 --- a/simpleclient_httpserver/src/main/java/io/prometheus/client/exporter/HTTPServer.java +++ /dev/null @@ -1,246 +0,0 @@ -package io.prometheus.client.exporter; - -import io.prometheus.client.CollectorRegistry; -import io.prometheus.client.exporter.common.TextFormat; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.net.HttpURLConnection; -import java.net.InetSocketAddress; -import java.net.URLDecoder; -import java.util.List; -import java.util.Set; -import java.util.HashSet; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Executors; -import java.util.concurrent.FutureTask; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.zip.GZIPOutputStream; - -import com.sun.net.httpserver.HttpHandler; -import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpExchange; - -/** - * Expose Prometheus metrics using a plain Java HttpServer. - *

    - * Example Usage: - *

    - * {@code
    - * HTTPServer server = new HTTPServer(1234);
    - * }
    - * 
    - * */ -public class HTTPServer { - private static class LocalByteArray extends ThreadLocal { - protected ByteArrayOutputStream initialValue() - { - return new ByteArrayOutputStream(1 << 20); - } - } - - static class HTTPMetricHandler implements HttpHandler { - private CollectorRegistry registry; - private final LocalByteArray response = new LocalByteArray(); - - HTTPMetricHandler(CollectorRegistry registry) { - this.registry = registry; - } - - - public void handle(HttpExchange t) throws IOException { - String query = t.getRequestURI().getRawQuery(); - - ByteArrayOutputStream response = this.response.get(); - response.reset(); - OutputStreamWriter osw = new OutputStreamWriter(response); - TextFormat.write004(osw, - registry.filteredMetricFamilySamples(parseQuery(query))); - osw.flush(); - osw.close(); - response.flush(); - response.close(); - - t.getResponseHeaders().set("Content-Type", - TextFormat.CONTENT_TYPE_004); - if (shouldUseCompression(t)) { - t.getResponseHeaders().set("Content-Encoding", "gzip"); - t.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0); - final GZIPOutputStream os = new GZIPOutputStream(t.getResponseBody()); - response.writeTo(os); - os.close(); - } else { - t.getResponseHeaders().set("Content-Length", - String.valueOf(response.size())); - t.sendResponseHeaders(HttpURLConnection.HTTP_OK, response.size()); - response.writeTo(t.getResponseBody()); - } - t.close(); - } - - } - - protected static boolean shouldUseCompression(HttpExchange exchange) { - List encodingHeaders = exchange.getRequestHeaders().get("Accept-Encoding"); - if (encodingHeaders == null) return false; - - for (String encodingHeader : encodingHeaders) { - String[] encodings = encodingHeader.split(","); - for (String encoding : encodings) { - if (encoding.trim().toLowerCase().equals("gzip")) { - return true; - } - } - } - return false; - } - - protected static Set parseQuery(String query) throws IOException { - Set names = new HashSet(); - if (query != null) { - String[] pairs = query.split("&"); - for (String pair : pairs) { - int idx = pair.indexOf("="); - if (idx != -1 && URLDecoder.decode(pair.substring(0, idx), "UTF-8").equals("name[]")) { - names.add(URLDecoder.decode(pair.substring(idx + 1), "UTF-8")); - } - } - } - return names; - } - - - static class NamedDaemonThreadFactory implements ThreadFactory { - private static final AtomicInteger POOL_NUMBER = new AtomicInteger(1); - - private final int poolNumber = POOL_NUMBER.getAndIncrement(); - private final AtomicInteger threadNumber = new AtomicInteger(1); - private final ThreadFactory delegate; - private final boolean daemon; - - NamedDaemonThreadFactory(ThreadFactory delegate, boolean daemon) { - this.delegate = delegate; - this.daemon = daemon; - } - - @Override - public Thread newThread(Runnable r) { - Thread t = delegate.newThread(r); - t.setName(String.format("prometheus-http-%d-%d", poolNumber, threadNumber.getAndIncrement())); - t.setDaemon(daemon); - return t; - } - - static ThreadFactory defaultThreadFactory(boolean daemon) { - return new NamedDaemonThreadFactory(Executors.defaultThreadFactory(), daemon); - } - } - - protected final HttpServer server; - protected final ExecutorService executorService; - - /** - * Start a HTTP server serving Prometheus metrics from the given registry using the given {@link HttpServer}. - * The {@code httpServer} is expected to already be bound to an address - */ - public HTTPServer(HttpServer httpServer, CollectorRegistry registry, boolean daemon) throws IOException { - if (httpServer.getAddress() == null) - throw new IllegalArgumentException("HttpServer hasn't been bound to an address"); - - server = httpServer; - HttpHandler mHandler = new HTTPMetricHandler(registry); - server.createContext("/", mHandler); - server.createContext("/metrics", mHandler); - executorService = Executors.newFixedThreadPool(5, NamedDaemonThreadFactory.defaultThreadFactory(daemon)); - server.setExecutor(executorService); - start(daemon); - } - - /** - * Start a HTTP server serving Prometheus metrics from the given registry. - */ - public HTTPServer(InetSocketAddress addr, CollectorRegistry registry, boolean daemon) throws IOException { - this(HttpServer.create(addr, 3), registry, daemon); - } - - /** - * Start a HTTP server serving Prometheus metrics from the given registry using non-daemon threads. - */ - public HTTPServer(InetSocketAddress addr, CollectorRegistry registry) throws IOException { - this(addr, registry, false); - } - - /** - * Start a HTTP server serving the default Prometheus registry. - */ - public HTTPServer(int port, boolean daemon) throws IOException { - this(new InetSocketAddress(port), CollectorRegistry.defaultRegistry, daemon); - } - - /** - * Start a HTTP server serving the default Prometheus registry using non-daemon threads. - */ - public HTTPServer(int port) throws IOException { - this(port, false); - } - - /** - * Start a HTTP server serving the default Prometheus registry. - */ - public HTTPServer(String host, int port, boolean daemon) throws IOException { - this(new InetSocketAddress(host, port), CollectorRegistry.defaultRegistry, daemon); - } - - /** - * Start a HTTP server serving the default Prometheus registry using non-daemon threads. - */ - public HTTPServer(String host, int port) throws IOException { - this(new InetSocketAddress(host, port), CollectorRegistry.defaultRegistry, false); - } - - /** - * Start a HTTP server by making sure that its background thread inherit proper daemon flag. - */ - private void start(boolean daemon) { - if (daemon == Thread.currentThread().isDaemon()) { - server.start(); - } else { - FutureTask startTask = new FutureTask(new Runnable() { - @Override - public void run() { - server.start(); - } - }, null); - NamedDaemonThreadFactory.defaultThreadFactory(daemon).newThread(startTask).start(); - try { - startTask.get(); - } catch (ExecutionException e) { - throw new RuntimeException("Unexpected exception on starting HTTPSever", e); - } catch (InterruptedException e) { - // This is possible only if the current tread has been interrupted, - // but in real use cases this should not happen. - // In any case, there is nothing to do, except to propagate interrupted flag. - Thread.currentThread().interrupt(); - } - } - } - - /** - * Stop the HTTP server. - */ - public void stop() { - server.stop(0); - executorService.shutdown(); // Free any (parked/idle) threads in pool - } - - /** - * Gets the port number. - */ - public int getPort() { - return server.getAddress().getPort(); - } -} - diff --git a/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/ExampleExporter.java b/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/ExampleExporter.java deleted file mode 100644 index 84c4d15f7..000000000 --- a/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/ExampleExporter.java +++ /dev/null @@ -1,24 +0,0 @@ -package io.prometheus.client.exporter; - -import io.prometheus.client.Counter; -import io.prometheus.client.Gauge; -import io.prometheus.client.Histogram; -import io.prometheus.client.Summary; - -public class ExampleExporter { - - static final Gauge g = Gauge.build().name("gauge").help("blah").register(); - static final Counter c = Counter.build().name("counter").help("meh").register(); - static final Summary s = Summary.build().name("summary").help("meh").register(); - static final Histogram h = Histogram.build().name("histogram").help("meh").register(); - static final Gauge l = Gauge.build().name("labels").help("blah").labelNames("l").register(); - - public static void main(String[] args) throws Exception { - new HTTPServer(1234); - g.set(1); - c.inc(2); - s.observe(3); - h.observe(4); - l.labels("foo").inc(5); - } -} diff --git a/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/TestDaemonFlags.java b/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/TestDaemonFlags.java deleted file mode 100644 index 80bca9d90..000000000 --- a/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/TestDaemonFlags.java +++ /dev/null @@ -1,43 +0,0 @@ -package io.prometheus.client.exporter; - -import org.junit.Test; - -import java.io.IOException; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.FutureTask; - -import static org.assertj.core.api.Assertions.assertThat; - -public class TestDaemonFlags { - - @Test - public void testDefaultIsNotDaemon() throws IOException, ExecutionException, InterruptedException { - assertThat(usesDaemonExecutor(new HTTPServer(0))).isFalse(); - } - - @Test - public void testDaemon() throws IOException, ExecutionException, InterruptedException { - assertThat(usesDaemonExecutor(new HTTPServer(0, true))).isTrue(); - } - - @Test - public void testNonDaemon() throws IOException, ExecutionException, InterruptedException { - assertThat(usesDaemonExecutor(new HTTPServer(0, false))).isFalse(); - } - - private boolean usesDaemonExecutor(HTTPServer httpServer) throws IOException, InterruptedException, ExecutionException { - try { - FutureTask task = new FutureTask(new Callable() { - @Override - public Boolean call() throws Exception { - return Thread.currentThread().isDaemon(); - } - }); - httpServer.server.getExecutor().execute(task); - return task.get(); - } finally { - httpServer.stop(); - } - } -} diff --git a/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/TestHTTPServer.java b/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/TestHTTPServer.java deleted file mode 100644 index f8ee97285..000000000 --- a/simpleclient_httpserver/src/test/java/io/prometheus/client/exporter/TestHTTPServer.java +++ /dev/null @@ -1,117 +0,0 @@ -package io.prometheus.client.exporter; - -import com.sun.net.httpserver.HttpServer; -import io.prometheus.client.Gauge; -import io.prometheus.client.CollectorRegistry; -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.URL; -import java.net.URLConnection; -import java.util.Scanner; -import java.util.zip.GZIPInputStream; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.fail; - -public class TestHTTPServer { - - HTTPServer s; - - @Before - public void init() throws IOException { - CollectorRegistry registry = new CollectorRegistry(); - Gauge.build("a", "a help").register(registry); - Gauge.build("b", "a help").register(registry); - Gauge.build("c", "a help").register(registry); - s = new HTTPServer(new InetSocketAddress(0), registry); - } - - @After - public void cleanup() { - s.stop(); - } - - String request(String suffix) throws IOException { - String url = "http://localhost:" + s.server.getAddress().getPort() + "/metrics" + suffix; - URLConnection connection = new URL(url).openConnection(); - connection.setDoOutput(true); - connection.connect(); - Scanner s = new Scanner(connection.getInputStream(), "UTF-8").useDelimiter("\\A"); - return s.hasNext() ? s.next() : ""; - } - - String requestWithCompression(String suffix) throws IOException { - String url = "http://localhost:" + s.server.getAddress().getPort() + "/metrics" + suffix; - URLConnection connection = new URL(url).openConnection(); - connection.setDoOutput(true); - connection.setDoInput(true); - connection.setRequestProperty("Accept-Encoding", "gzip, deflate"); - connection.connect(); - GZIPInputStream gzs = new GZIPInputStream(connection.getInputStream()); - Scanner s = new Scanner(gzs).useDelimiter("\\A"); - return s.hasNext() ? s.next() : ""; - } - - @Test - public void testUnbound() throws IOException { - CollectorRegistry registry = new CollectorRegistry(); - try { - HTTPServer s = new HTTPServer(HttpServer.create(), registry, true); - s.stop(); - fail("Should refuse to use an unbound HttpServer"); - } - catch (IllegalArgumentException expected) {} - } - - @Test - public void testSimpleRequest() throws IOException { - String response = request(""); - assertThat(response).contains("a 0.0"); - assertThat(response).contains("b 0.0"); - assertThat(response).contains("c 0.0"); - } - - @Test - public void testBadParams() throws IOException { - String response = request("?x"); - assertThat(response).contains("a 0.0"); - assertThat(response).contains("b 0.0"); - assertThat(response).contains("c 0.0"); - } - - @Test - public void testSingleName() throws IOException { - String response = request("?name[]=a"); - assertThat(response).contains("a 0.0"); - assertThat(response).doesNotContain("b 0.0"); - assertThat(response).doesNotContain("c 0.0"); - } - - @Test - public void testMultiName() throws IOException { - String response = request("?name[]=a&name[]=b"); - assertThat(response).contains("a 0.0"); - assertThat(response).contains("b 0.0"); - assertThat(response).doesNotContain("c 0.0"); - } - - @Test - public void testDecoding() throws IOException { - String response = request("?n%61me[]=%61"); - assertThat(response).contains("a 0.0"); - assertThat(response).doesNotContain("b 0.0"); - assertThat(response).doesNotContain("c 0.0"); - } - - @Test - public void testGzipCompression() throws IOException { - String response = requestWithCompression(""); - assertThat(response).contains("a 0.0"); - assertThat(response).contains("b 0.0"); - assertThat(response).contains("c 0.0"); - } -} diff --git a/simpleclient_jetty/pom.xml b/simpleclient_jetty/pom.xml deleted file mode 100644 index ca1f6ff1e..000000000 --- a/simpleclient_jetty/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - 4.0.0 - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_jetty - bundle - - Prometheus Java Simpleclient Jetty - - Collector of data from Jetty StatisticsHandler. - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - tokuhirom - Tokuhiro Matsuno - tokuhirom@gmail.com - - - - - io.prometheus - simpleclient - 0.6.1-SNAPSHOT - - - org.eclipse.jetty - jetty-server - 9.0.2.v20130417 - - - org.eclipse.jetty - jetty-servlet - 9.0.2.v20130417 - - - - junit - junit - 4.11 - test - - - org.hamcrest - hamcrest-all - 1.1 - test - - - diff --git a/simpleclient_jetty/src/main/java/io/prometheus/client/jetty/JettyStatisticsCollector.java b/simpleclient_jetty/src/main/java/io/prometheus/client/jetty/JettyStatisticsCollector.java deleted file mode 100644 index 8907ba151..000000000 --- a/simpleclient_jetty/src/main/java/io/prometheus/client/jetty/JettyStatisticsCollector.java +++ /dev/null @@ -1,105 +0,0 @@ -package io.prometheus.client.jetty; - -import io.prometheus.client.Collector; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import org.eclipse.jetty.server.handler.StatisticsHandler; - -/** - * Collect metrics from jetty's org.eclipse.jetty.server.handler.StatisticsHandler. - *

    - *

    {@code
    - * Server server = new Server(8080);
    - *
    - * ServletContextHandler context = new ServletContextHandler();
    - * context.setContextPath("/");
    - * server.setHandler(context);
    - *
    - * HandlerCollection handlers = new HandlerCollection();
    - *
    - * StatisticsHandler statisticsHandler = new StatisticsHandler();
    - * statisticsHandler.setServer(server);
    - * handlers.addHandler(statisticsHandler);
    - *
    - * // Register collector.
    - * new JettyStatisticsCollector(statisticsHandler).register();
    - *
    - * server.setHandler(handlers);
    - *
    - * server.start();
    - * }
    - */ -public class JettyStatisticsCollector extends Collector { - private final StatisticsHandler statisticsHandler; - private static final List EMPTY_LIST = new ArrayList(); - - public JettyStatisticsCollector(StatisticsHandler statisticsHandler) { - this.statisticsHandler = statisticsHandler; - } - - @Override - public List collect() { - return Arrays.asList( - buildCounter("jetty_requests_total", "Number of requests", statisticsHandler.getRequests()), - buildGauge("jetty_requests_active", "Number of requests currently active", statisticsHandler.getRequestsActive()), - buildGauge("jetty_requests_active_max", "Maximum number of requests that have been active at once", statisticsHandler.getRequestsActiveMax()), - buildGauge("jetty_request_time_max_seconds", "Maximum time spent handling requests", statisticsHandler.getRequestTimeMax() / 1000.0), - buildCounter("jetty_request_time_seconds_total", "Total time spent in all request handling", statisticsHandler.getRequestTimeTotal() / 1000.0), - buildCounter("jetty_dispatched_total", "Number of dispatches", statisticsHandler.getDispatched()), - buildGauge("jetty_dispatched_active", "Number of dispatches currently active", statisticsHandler.getDispatchedActive()), - buildGauge("jetty_dispatched_active_max", "Maximum number of active dispatches being handled", statisticsHandler.getDispatchedActiveMax()), - buildGauge("jetty_dispatched_time_max", "Maximum time spent in dispatch handling", statisticsHandler.getDispatchedTimeMax()), - buildCounter("jetty_dispatched_time_seconds_total", "Total time spent in dispatch handling", statisticsHandler.getDispatchedTimeTotal() / 1000.0), - buildCounter("jetty_async_requests_total", "Total number of async requests", statisticsHandler.getAsyncRequests()), - buildGauge("jetty_async_requests_waiting", "Currently waiting async requests", statisticsHandler.getAsyncRequestsWaiting()), - buildGauge("jetty_async_requests_waiting_max", "Maximum number of waiting async requests", statisticsHandler.getAsyncRequestsWaitingMax()), - buildCounter("jetty_async_dispatches_total", "Number of requested that have been asynchronously dispatched", statisticsHandler.getAsyncDispatches()), - buildCounter("jetty_expires_total", "Number of async requests requests that have expired", statisticsHandler.getExpires()), - buildStatusCounter(), - buildGauge("jetty_stats_seconds", "Time in seconds stats have been collected for", statisticsHandler.getStatsOnMs() / 1000.0), - buildCounter("jetty_responses_bytes_total", "Total number of bytes across all responses", statisticsHandler.getResponsesBytesTotal()) - ); - } - - private static MetricFamilySamples buildGauge(String name, String help, double value) { - return new MetricFamilySamples( - name, - Type.GAUGE, - help, - Collections.singletonList(new MetricFamilySamples.Sample(name, EMPTY_LIST, EMPTY_LIST, value))); - } - - private static MetricFamilySamples buildCounter(String name, String help, double value) { - return new MetricFamilySamples( - name, - Type.COUNTER, - help, - Collections.singletonList(new MetricFamilySamples.Sample(name, EMPTY_LIST, EMPTY_LIST, value))); - } - - private MetricFamilySamples buildStatusCounter() { - String name = "jetty_responses_total"; - return new MetricFamilySamples( - name, - Type.COUNTER, - "Number of requests with response status", - Arrays.asList( - buildStatusSample(name, "1xx", statisticsHandler.getResponses1xx()), - buildStatusSample(name, "2xx", statisticsHandler.getResponses2xx()), - buildStatusSample(name, "3xx", statisticsHandler.getResponses3xx()), - buildStatusSample(name, "4xx", statisticsHandler.getResponses4xx()), - buildStatusSample(name, "5xx", statisticsHandler.getResponses5xx()) - ) - ); - } - - private static MetricFamilySamples.Sample buildStatusSample(String name, String status, double value) { - return new MetricFamilySamples.Sample( - name, - Collections.singletonList("code"), - Collections.singletonList(status), - value); - } -} diff --git a/simpleclient_jetty_jdk8/pom.xml b/simpleclient_jetty_jdk8/pom.xml deleted file mode 100644 index de0325196..000000000 --- a/simpleclient_jetty_jdk8/pom.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - 4.0.0 - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_jetty_jdk8 - bundle - - Prometheus Java Simpleclient Jetty JDK 8 - - Collector of data from Jetty Statistics for Jetty versions which require JDK 8. - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.8 - 1.8 - - - - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - cenkakin - Cenk Akin - cenk.akin91@gmail.com - - - - - io.prometheus - simpleclient - 0.6.1-SNAPSHOT - - - org.eclipse.jetty - jetty-server - 9.4.4.v20170414 - - - org.eclipse.jetty - jetty-servlet - 9.4.4.v20170414 - - - - junit - junit - 4.11 - test - - - org.hamcrest - hamcrest-all - 1.1 - test - - - diff --git a/simpleclient_log4j/pom.xml b/simpleclient_log4j/pom.xml deleted file mode 100644 index ae9ffba9a..000000000 --- a/simpleclient_log4j/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - 4.0.0 - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_log4j - bundle - - Prometheus Java Simpleclient log4j - - Metrics collector for log4j appender logging - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - willfleury - Will Fleury - will.fleury@boxever.com - - - - - - io.prometheus - simpleclient - 0.6.1-SNAPSHOT - - - log4j - log4j - 1.2.17 - - - - - junit - junit - 4.11 - test - - - - org.mockito - mockito-core - 1.9.5 - test - - - diff --git a/simpleclient_log4j2/pom.xml b/simpleclient_log4j2/pom.xml deleted file mode 100644 index 9a58516af..000000000 --- a/simpleclient_log4j2/pom.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - 4.0.0 - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_log4j2 - bundle - - Prometheus Java Simpleclient log4j2 - - Metrics collector for log4j2 appender logging - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - yngveh - Yngve Hansen - yngveh@users.noreplay.github.com - - - - - - io.prometheus - simpleclient - 0.6.1-SNAPSHOT - - - org.apache.logging.log4j - log4j-core - 2.1 - - - - junit - junit - 4.11 - test - - - - org.mockito - mockito-core - 1.9.5 - test - - - diff --git a/simpleclient_log4j2/src/main/java/io/prometheus/client/log4j2/InstrumentedAppender.java b/simpleclient_log4j2/src/main/java/io/prometheus/client/log4j2/InstrumentedAppender.java deleted file mode 100644 index a47afdaa8..000000000 --- a/simpleclient_log4j2/src/main/java/io/prometheus/client/log4j2/InstrumentedAppender.java +++ /dev/null @@ -1,95 +0,0 @@ -package io.prometheus.client.log4j2; - -import io.prometheus.client.Counter; -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.core.appender.AbstractAppender; -import org.apache.logging.log4j.core.config.plugins.Plugin; -import org.apache.logging.log4j.core.config.plugins.PluginAttribute; -import org.apache.logging.log4j.core.config.plugins.PluginFactory; - -import static org.apache.logging.log4j.Level.*; - -/** - * Log4j2 log statements at various log levels - *

    - * Example log4j2 configuration: - *

    - *   <?xml version="1.0" encoding="UTF-8"?>
    - *   <Configuration packages="io.prometheus.client.log4j2">
    - *     <Appenders>
    - *       <Prometheus name="PROMETHEUS"/>
    - *     </Appenders>
    - *     <Loggers>
    - *       <Root level="trace">
    - *         <AppenderRef ref="PROMETHEUS"/>
    - *       </Root>
    - *     </Loggers>
    - *   </Configuration>
    - * 
    - * Example metrics being exported: - *
    - *   log4j_appender_total{level="trace",} 1.0
    - *   log4j_appender_total{level="debug",} 2.0
    - *   log4j_appender_total{level="info",} 3.0
    - *   log4j_appender_total{level="warn",} 4.0
    - *   log4j_appender_total{level="error",} 5.0
    - *   log4j_appender_total{level="fatal",} 6.0
    - * 
    - */ -@Plugin(name = "Prometheus", category = "Core", elementType = "appender") -public final class InstrumentedAppender extends AbstractAppender { - - public static final String COUNTER_NAME = "log4j2_appender_total"; - - private static final Counter COUNTER; - private static final Counter.Child TRACE_LABEL; - private static final Counter.Child DEBUG_LABEL; - private static final Counter.Child INFO_LABEL; - private static final Counter.Child WARN_LABEL; - private static final Counter.Child ERROR_LABEL; - private static final Counter.Child FATAL_LABEL; - - static { - COUNTER = Counter.build().name(COUNTER_NAME) - .help("Log4j2 log statements at various log levels") - .labelNames("level") - .register(); - - TRACE_LABEL = COUNTER.labels("trace"); - DEBUG_LABEL = COUNTER.labels("debug"); - INFO_LABEL = COUNTER.labels("info"); - WARN_LABEL = COUNTER.labels("warn"); - ERROR_LABEL = COUNTER.labels("error"); - FATAL_LABEL = COUNTER.labels("fatal"); - } - - /** - * Create a new instrumented appender using the default registry. - */ - protected InstrumentedAppender(String name) { - super(name, null, null); - } - - @Override - public void append(LogEvent event) { - Level level = event.getLevel(); - if (TRACE.equals(level)) TRACE_LABEL.inc(); - else if (DEBUG.equals(level)) DEBUG_LABEL.inc(); - else if (INFO.equals(level)) INFO_LABEL.inc(); - else if (WARN.equals(level)) WARN_LABEL.inc(); - else if (ERROR.equals(level)) ERROR_LABEL.inc(); - else if (FATAL.equals(level)) FATAL_LABEL.inc(); - } - - @PluginFactory - public static InstrumentedAppender createAppender( - @PluginAttribute("name") String name) { - if (name == null) { - LOGGER.error("No name provided for InstrumentedAppender"); - return null; - } - return new InstrumentedAppender(name); - } - -} diff --git a/simpleclient_log4j2/src/test/java/io/prometheus/client/log4j2/InstrumentedAppenderTest.java b/simpleclient_log4j2/src/test/java/io/prometheus/client/log4j2/InstrumentedAppenderTest.java deleted file mode 100644 index 08b91e6ce..000000000 --- a/simpleclient_log4j2/src/test/java/io/prometheus/client/log4j2/InstrumentedAppenderTest.java +++ /dev/null @@ -1,84 +0,0 @@ -package io.prometheus.client.log4j2; - -import static io.prometheus.client.log4j2.InstrumentedAppender.COUNTER_NAME; -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import io.prometheus.client.CollectorRegistry; -import org.apache.logging.log4j.core.LogEvent; -import org.junit.Before; -import org.junit.Test; - -import static org.apache.logging.log4j.Level.*; - -public class InstrumentedAppenderTest { - - private InstrumentedAppender appender; - private LogEvent event; - - @Before - public void setUp() throws Exception { - appender = InstrumentedAppender.createAppender("Prometheus-Appender"); - event = mock(LogEvent.class); - } - - @Test - public void metersTraceEvents() throws Exception { - when(event.getLevel()).thenReturn(TRACE); - - appender.append(event); - - assertEquals(1, getLogLevelCount("trace")); - } - - @Test - public void metersDebugEvents() throws Exception { - when(event.getLevel()).thenReturn(DEBUG); - - appender.append(event); - - assertEquals(1, getLogLevelCount("debug")); - } - - @Test - public void metersInfoEvents() throws Exception { - when(event.getLevel()).thenReturn(INFO); - - appender.append(event); - - assertEquals(1, getLogLevelCount("trace")); - } - - @Test - public void metersWarnEvents() throws Exception { - when(event.getLevel()).thenReturn(WARN); - - appender.append(event); - - assertEquals(1, getLogLevelCount("warn")); - } - - @Test - public void metersErrorEvents() throws Exception { - when(event.getLevel()).thenReturn(ERROR); - - appender.append(event); - - assertEquals(1, getLogLevelCount("error")); - } - - @Test - public void metersFatalEvents() throws Exception { - when(event.getLevel()).thenReturn(FATAL); - - appender.append(event); - - assertEquals(1, getLogLevelCount("fatal")); - } - - private int getLogLevelCount(String level) { - return CollectorRegistry.defaultRegistry.getSampleValue(COUNTER_NAME, - new String[]{"level"}, new String[]{level}).intValue(); - } -} diff --git a/simpleclient_logback/pom.xml b/simpleclient_logback/pom.xml deleted file mode 100644 index 786e8f734..000000000 --- a/simpleclient_logback/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - 4.0.0 - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_logback - bundle - - Prometheus Java Simpleclient logback - - Metrics collector for logback appender logging - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - willfleury - Will Fleury - will.fleury@boxever.com - - - - - - io.prometheus - simpleclient - 0.6.1-SNAPSHOT - - - ch.qos.logback - logback-classic - 1.1.2 - - - - - junit - junit - 4.11 - test - - - - org.mockito - mockito-core - 1.9.5 - test - - - diff --git a/simpleclient_logback/src/main/java/io/prometheus/client/logback/InstrumentedAppender.java b/simpleclient_logback/src/main/java/io/prometheus/client/logback/InstrumentedAppender.java deleted file mode 100644 index 2865bb471..000000000 --- a/simpleclient_logback/src/main/java/io/prometheus/client/logback/InstrumentedAppender.java +++ /dev/null @@ -1,66 +0,0 @@ -package io.prometheus.client.logback; - -import ch.qos.logback.classic.Level; -import ch.qos.logback.classic.spi.ILoggingEvent; -import ch.qos.logback.core.UnsynchronizedAppenderBase; -import io.prometheus.client.Counter; - -public class InstrumentedAppender extends UnsynchronizedAppenderBase { - - public static final String COUNTER_NAME = "logback_appender_total"; - - private static final Counter COUNTER; - private static final Counter.Child TRACE_LABEL; - private static final Counter.Child DEBUG_LABEL; - private static final Counter.Child INFO_LABEL; - private static final Counter.Child WARN_LABEL; - private static final Counter.Child ERROR_LABEL; - - static { - COUNTER = Counter.build().name(COUNTER_NAME) - .help("Logback log statements at various log levels") - .labelNames("level") - .register(); - - TRACE_LABEL = COUNTER.labels("trace"); - DEBUG_LABEL = COUNTER.labels("debug"); - INFO_LABEL = COUNTER.labels("info"); - WARN_LABEL = COUNTER.labels("warn"); - ERROR_LABEL = COUNTER.labels("error"); - } - - /** - * Create a new instrumented appender using the default registry. - */ - public InstrumentedAppender() { - } - - - @Override - public void start() { - super.start(); - } - - @Override - protected void append(ILoggingEvent event) { - switch (event.getLevel().toInt()) { - case Level.TRACE_INT: - TRACE_LABEL.inc(); - break; - case Level.DEBUG_INT: - DEBUG_LABEL.inc(); - break; - case Level.INFO_INT: - INFO_LABEL.inc(); - break; - case Level.WARN_INT: - WARN_LABEL.inc(); - break; - case Level.ERROR_INT: - ERROR_LABEL.inc(); - break; - default: - break; - } - } -} diff --git a/simpleclient_pushgateway/pom.xml b/simpleclient_pushgateway/pom.xml deleted file mode 100644 index 7c624b46a..000000000 --- a/simpleclient_pushgateway/pom.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - 4.0.0 - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_pushgateway - bundle - - Prometheus Java Simpleclient Pushgateway - - Pushgateway exporter for the simpleclient. - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - brian-brazil - Brian Brazil - brian.brazil@boxever.com - - - - - - - io.prometheus - simpleclient - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_common - 0.6.1-SNAPSHOT - - - - junit - junit - 4.11 - test - - - org.mock-server - mockserver-netty - 3.9.17 - test - - - diff --git a/simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/BasicAuthHttpConnectionFactory.java b/simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/BasicAuthHttpConnectionFactory.java deleted file mode 100644 index e903896c8..000000000 --- a/simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/BasicAuthHttpConnectionFactory.java +++ /dev/null @@ -1,37 +0,0 @@ -package io.prometheus.client.exporter; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.HttpURLConnection; -import javax.xml.bind.DatatypeConverter; - -public class BasicAuthHttpConnectionFactory implements HttpConnectionFactory { - private final HttpConnectionFactory originConnectionFactory; - private final String basicAuthHeader; - - public BasicAuthHttpConnectionFactory(HttpConnectionFactory connectionFactory, String user, String password) { - this.originConnectionFactory = connectionFactory; - this.basicAuthHeader = encode(user, password); - } - - public BasicAuthHttpConnectionFactory(String user, String password) { - this(new DefaultHttpConnectionFactory(), user, password); - } - - @Override - public HttpURLConnection create(String url) throws IOException { - HttpURLConnection connection = originConnectionFactory.create(url); - connection.setRequestProperty("Authorization", basicAuthHeader); - return connection; - } - - private String encode(String user, String password) { - try { - byte[] credentialsBytes = (user + ":" + password).getBytes("UTF-8"); - String encoded = DatatypeConverter.printBase64Binary(credentialsBytes); - return String.format("Basic %s", encoded); - } catch (UnsupportedEncodingException e) { - throw new IllegalArgumentException(e); - } - } -} diff --git a/simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/DefaultHttpConnectionFactory.java b/simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/DefaultHttpConnectionFactory.java deleted file mode 100644 index 2987dfafe..000000000 --- a/simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/DefaultHttpConnectionFactory.java +++ /dev/null @@ -1,12 +0,0 @@ -package io.prometheus.client.exporter; - -import java.io.IOException; -import java.net.HttpURLConnection; -import java.net.URL; - -public class DefaultHttpConnectionFactory implements HttpConnectionFactory { - @Override - public HttpURLConnection create(String url) throws IOException { - return (HttpURLConnection) new URL(url).openConnection(); - } -} diff --git a/simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/HttpConnectionFactory.java b/simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/HttpConnectionFactory.java deleted file mode 100644 index 0b4521afa..000000000 --- a/simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/HttpConnectionFactory.java +++ /dev/null @@ -1,8 +0,0 @@ -package io.prometheus.client.exporter; - -import java.io.IOException; -import java.net.HttpURLConnection; - -public interface HttpConnectionFactory { - HttpURLConnection create(String url) throws IOException; -} diff --git a/simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/PushGateway.java b/simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/PushGateway.java deleted file mode 100644 index 161871acf..000000000 --- a/simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/PushGateway.java +++ /dev/null @@ -1,362 +0,0 @@ -package io.prometheus.client.exporter; - -import java.io.BufferedWriter; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStreamWriter; -import java.io.UnsupportedEncodingException; -import java.net.HttpURLConnection; -import java.net.InetAddress; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; -import java.net.URLEncoder; -import java.net.UnknownHostException; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import javax.xml.bind.DatatypeConverter; - -import io.prometheus.client.Collector; -import io.prometheus.client.CollectorRegistry; -import io.prometheus.client.exporter.common.TextFormat; - -/** - * Export metrics via the Prometheus Pushgateway. - *

    - * The Prometheus Pushgateway exists to allow ephemeral and batch jobs to expose their metrics to Prometheus. - * Since these kinds of jobs may not exist long enough to be scraped, they can instead push their metrics - * to a Pushgateway. This class allows pushing the contents of a {@link CollectorRegistry} to - * a Pushgateway. - *

    - * Example usage: - *

    - * {@code
    - *   void executeBatchJob() throws Exception {
    - *     CollectorRegistry registry = new CollectorRegistry();
    - *     Gauge duration = Gauge.build()
    - *         .name("my_batch_job_duration_seconds").help("Duration of my batch job in seconds.").register(registry);
    - *     Gauge.Timer durationTimer = duration.startTimer();
    - *     try {
    - *       // Your code here.
    - *
    - *       // This is only added to the registry after success,
    - *       // so that a previous success in the Pushgateway isn't overwritten on failure.
    - *       Gauge lastSuccess = Gauge.build()
    - *           .name("my_batch_job_last_success").help("Last time my batch job succeeded, in unixtime.").register(registry);
    - *       lastSuccess.setToCurrentTime();
    - *     } finally {
    - *       durationTimer.setDuration();
    - *       PushGateway pg = new PushGateway("127.0.0.1:9091");
    - *       pg.pushAdd(registry, "my_batch_job");
    - *     }
    - *   }
    - * }
    - * 
    - *

    - * See https://github.com/prometheus/pushgateway - */ -public class PushGateway { - - private static final int MILLISECONDS_PER_SECOND = 1000; - - // Visible for testing. - protected final String gatewayBaseURL; - - private HttpConnectionFactory connectionFactory = new DefaultHttpConnectionFactory(); - - /** - * Construct a Pushgateway, with the given address. - *

    - * @param address host:port or ip:port of the Pushgateway. - */ - public PushGateway(String address) { - this(createURLSneakily("http://" + address)); - } - - /** - * Construct a Pushgateway, with the given URL. - *

    - * @param serverBaseURL the base URL and optional context path of the Pushgateway server. - */ - public PushGateway(URL serverBaseURL) { - this.gatewayBaseURL = URI.create(serverBaseURL.toString() + "/metrics/") - .normalize() - .toString(); - } - - public void setConnectionFactory(HttpConnectionFactory connectionFactory) { - this.connectionFactory = connectionFactory; - } - - /** - * Creates a URL instance from a String representation of a URL without throwing a checked exception. - * Required because you can't wrap a call to another constructor in a try statement. - * - * TODO: Remove this along with other deprecated methods before version 1.0 is released. - * - * @param urlString the String representation of the URL. - * @return The URL instance. - */ - private static URL createURLSneakily(final String urlString) { - try { - return new URL(urlString); - } catch (MalformedURLException e) { - throw new RuntimeException(e); - } - } - - /** - * Pushes all metrics in a registry, replacing all those with the same job and no grouping key. - *

    - * This uses the PUT HTTP method. - */ - public void push(CollectorRegistry registry, String job) throws IOException { - doRequest(registry, job, null, "PUT"); - } - - /** - * Pushes all metrics in a Collector, replacing all those with the same job and no grouping key. - *

    - * This is useful for pushing a single Gauge. - *

    - * This uses the PUT HTTP method. - */ - public void push(Collector collector, String job) throws IOException { - CollectorRegistry registry = new CollectorRegistry(); - collector.register(registry); - push(registry, job); - } - - /** - * Pushes all metrics in a registry, replacing all those with the same job and grouping key. - *

    - * This uses the PUT HTTP method. - */ - public void push(CollectorRegistry registry, String job, Map groupingKey) throws IOException { - doRequest(registry, job, groupingKey, "PUT"); - } - - /** - * Pushes all metrics in a Collector, replacing all those with the same job and grouping key. - *

    - * This is useful for pushing a single Gauge. - *

    - * This uses the PUT HTTP method. - */ - public void push(Collector collector, String job, Map groupingKey) throws IOException { - CollectorRegistry registry = new CollectorRegistry(); - collector.register(registry); - push(registry, job, groupingKey); - } - - /** - * Pushes all metrics in a registry, replacing only previously pushed metrics of the same name and job and no grouping key. - *

    - * This uses the POST HTTP method. - */ - public void pushAdd(CollectorRegistry registry, String job) throws IOException { - doRequest(registry, job, null, "POST"); - } - - /** - * Pushes all metrics in a Collector, replacing only previously pushed metrics of the same name and job and no grouping key. - *

    - * This is useful for pushing a single Gauge. - *

    - * This uses the POST HTTP method. - */ - public void pushAdd(Collector collector, String job) throws IOException { - CollectorRegistry registry = new CollectorRegistry(); - collector.register(registry); - pushAdd(registry, job); - } - - /** - * Pushes all metrics in a registry, replacing only previously pushed metrics of the same name, job and grouping key. - *

    - * This uses the POST HTTP method. - */ - public void pushAdd(CollectorRegistry registry, String job, Map groupingKey) throws IOException { - doRequest(registry, job, groupingKey, "POST"); - } - - /** - * Pushes all metrics in a Collector, replacing only previously pushed metrics of the same name, job and grouping key. - *

    - * This is useful for pushing a single Gauge. - *

    - * This uses the POST HTTP method. - */ - public void pushAdd(Collector collector, String job, Map groupingKey) throws IOException { - CollectorRegistry registry = new CollectorRegistry(); - collector.register(registry); - pushAdd(registry, job, groupingKey); - } - - - /** - * Deletes metrics from the Pushgateway. - *

    - * Deletes metrics with no grouping key and the provided job. - * This uses the DELETE HTTP method. - */ - public void delete(String job) throws IOException { - doRequest(null, job, null, "DELETE"); - } - - /** - * Deletes metrics from the Pushgateway. - *

    - * Deletes metrics with the provided job and grouping key. - * This uses the DELETE HTTP method. - */ - public void delete(String job, Map groupingKey) throws IOException { - doRequest(null, job, groupingKey, "DELETE"); - } - - - /** - * Pushes all metrics in a registry, replacing all those with the same job and instance. - *

    - * This uses the PUT HTTP method. - * @deprecated use {@link #push(CollectorRegistry, String, Map)} - */ - @Deprecated - public void push(CollectorRegistry registry, String job, String instance) throws IOException { - push(registry, job, Collections.singletonMap("instance", instance)); - } - - /** - * Pushes all metrics in a Collector, replacing all those with the same job and instance. - *

    - * This is useful for pushing a single Gauge. - *

    - * This uses the PUT HTTP method. - * @deprecated use {@link #push(Collector, String, Map)} - */ - @Deprecated - public void push(Collector collector, String job, String instance) throws IOException { - push(collector, job, Collections.singletonMap("instance", instance)); - } - - /** - * Pushes all metrics in a registry, replacing only previously pushed metrics of the same name. - *

    - * This uses the POST HTTP method. - * @deprecated use {@link #pushAdd(CollectorRegistry, String, Map)} - */ - @Deprecated - public void pushAdd(CollectorRegistry registry, String job, String instance) throws IOException { - pushAdd(registry, job, Collections.singletonMap("instance", instance)); - } - - /** - * Pushes all metrics in a Collector, replacing only previously pushed metrics of the same name. - *

    - * This is useful for pushing a single Gauge. - *

    - * This uses the POST HTTP method. - * @deprecated use {@link #pushAdd(Collector, String, Map)} - */ - @Deprecated - public void pushAdd(Collector collector, String job, String instance) throws IOException { - pushAdd(collector, job, Collections.singletonMap("instance", instance)); - } - - /** - * Deletes metrics from the Pushgateway. - *

    - * This uses the DELETE HTTP method. - * @deprecated use {@link #delete(String, Map)} - */ - @Deprecated - public void delete(String job, String instance) throws IOException { - delete(job, Collections.singletonMap("instance", instance)); - } - - void doRequest(CollectorRegistry registry, String job, Map groupingKey, String method) throws IOException { - String url = gatewayBaseURL; - if (job.contains("/")) { - url += "job@base64/" + base64url(job); - } else { - url += "job/" + URLEncoder.encode(job, "UTF-8"); - } - - if (groupingKey != null) { - for (Map.Entry entry: groupingKey.entrySet()) { - if (entry.getValue().contains("/")) { - url += "/" + entry.getKey() + "@base64/" + base64url(entry.getValue()); - } else { - url += "/" + entry.getKey() + "/" + URLEncoder.encode(entry.getValue(), "UTF-8"); - } - } - } - HttpURLConnection connection = connectionFactory.create(url); - connection.setRequestProperty("Content-Type", TextFormat.CONTENT_TYPE_004); - if (!method.equals("DELETE")) { - connection.setDoOutput(true); - } - connection.setRequestMethod(method); - - connection.setConnectTimeout(10 * MILLISECONDS_PER_SECOND); - connection.setReadTimeout(10 * MILLISECONDS_PER_SECOND); - connection.connect(); - - try { - if (!method.equals("DELETE")) { - BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(connection.getOutputStream(), "UTF-8")); - TextFormat.write004(writer, registry.metricFamilySamples()); - writer.flush(); - writer.close(); - } - - int response = connection.getResponseCode(); - if (response != HttpURLConnection.HTTP_ACCEPTED) { - String errorMessage; - InputStream errorStream = connection.getErrorStream(); - if(response >= 400 && errorStream != null) { - String errBody = readFromStream(errorStream); - errorMessage = "Response code from " + url + " was " + response + ", response body: " + errBody; - } else { - errorMessage = "Response code from " + url + " was " + response; - } - throw new IOException(errorMessage); - } - } finally { - connection.disconnect(); - } - } - - private static String base64url(String v) { - // Per RFC4648 table 2. We support Java 6, and java.util.Base64 was only added in Java 8, - try { - return DatatypeConverter.printBase64Binary(v.getBytes("UTF-8")).replace("+", "-").replace("/", "_"); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); // Unreachable. - } - } - - /** - * Returns a grouping key with the instance label set to the machine's IP address. - *

    - * This is a convenience function, and should only be used where you want to - * push per-instance metrics rather than cluster/job level metrics. - */ - public static Map instanceIPGroupingKey() throws UnknownHostException { - Map groupingKey = new HashMap(); - groupingKey.put("instance", InetAddress.getLocalHost().getHostAddress()); - return groupingKey; - } - - private static String readFromStream(InputStream is) throws IOException { - ByteArrayOutputStream result = new ByteArrayOutputStream(); - byte[] buffer = new byte[1024]; - int length; - while ((length = is.read(buffer)) != -1) { - result.write(buffer, 0, length); - } - return result.toString("UTF-8"); - } -} diff --git a/simpleclient_pushgateway/src/test/java/io/prometheus/client/exporter/BasicAuthPushGatewayTest.java b/simpleclient_pushgateway/src/test/java/io/prometheus/client/exporter/BasicAuthPushGatewayTest.java deleted file mode 100644 index 10f9188b5..000000000 --- a/simpleclient_pushgateway/src/test/java/io/prometheus/client/exporter/BasicAuthPushGatewayTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package io.prometheus.client.exporter; - - -import static org.mockserver.model.HttpRequest.request; -import static org.mockserver.model.HttpResponse.response; - -import java.io.IOException; - -import io.prometheus.client.CollectorRegistry; -import io.prometheus.client.Gauge; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.mockserver.client.server.MockServerClient; -import org.mockserver.junit.MockServerRule; - -public class BasicAuthPushGatewayTest { - - @Rule - public MockServerRule mockServerRule = new MockServerRule(this); - private MockServerClient mockServerClient; - - CollectorRegistry registry; - Gauge gauge; - PushGateway pushGateway; - - @Before - public void setUp() { - registry = new CollectorRegistry(); - gauge = Gauge.build().name("g").help("help").create(); - pushGateway = new PushGateway("localhost:" + mockServerRule.getHttpPort()); - pushGateway.setConnectionFactory(new BasicAuthHttpConnectionFactory("testUser", "testPwd")); - } - - @Test - public void testAuthorizedPush() throws IOException { - mockServerClient.when( - request() - .withMethod("PUT") - .withHeader("Authorization", "Basic dGVzdFVzZXI6dGVzdFB3ZA==") - .withPath("/metrics/job/j") - ).respond(response().withStatusCode(202)); - pushGateway.push(registry, "j"); - } -} diff --git a/simpleclient_pushgateway/src/test/java/io/prometheus/client/exporter/ExamplePushGateway.java b/simpleclient_pushgateway/src/test/java/io/prometheus/client/exporter/ExamplePushGateway.java deleted file mode 100644 index 917539445..000000000 --- a/simpleclient_pushgateway/src/test/java/io/prometheus/client/exporter/ExamplePushGateway.java +++ /dev/null @@ -1,20 +0,0 @@ -package io.prometheus.client.exporter; - -import io.prometheus.client.Gauge; -import io.prometheus.client.CollectorRegistry; - - -public class ExamplePushGateway { - static final CollectorRegistry pushRegistry = new CollectorRegistry(); - static final Gauge g = (Gauge) Gauge.build().name("gauge").help("blah").register(pushRegistry); - - /** - * Example of how to use the pushgateway, pass in the host:port of a pushgateway. - */ - public static void main(String[] args) throws Exception { - PushGateway pg = new PushGateway(args[0]); - g.set(42); - pg.push(pushRegistry, "job"); - } -} - diff --git a/simpleclient_pushgateway/src/test/java/io/prometheus/client/exporter/PushGatewayTest.java b/simpleclient_pushgateway/src/test/java/io/prometheus/client/exporter/PushGatewayTest.java deleted file mode 100644 index e3be4dde5..000000000 --- a/simpleclient_pushgateway/src/test/java/io/prometheus/client/exporter/PushGatewayTest.java +++ /dev/null @@ -1,272 +0,0 @@ -package io.prometheus.client.exporter; - - -import static org.mockserver.model.HttpRequest.request; -import static org.mockserver.model.HttpResponse.response; - -import io.prometheus.client.CollectorRegistry; -import io.prometheus.client.Gauge; -import java.io.IOException; -import java.util.TreeMap; -import java.util.Map; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.mockserver.junit.MockServerRule; -import org.mockserver.client.server.MockServerClient; - -public class PushGatewayTest { - - @Rule - public MockServerRule mockServerRule = new MockServerRule(this); - private MockServerClient mockServerClient; - - CollectorRegistry registry; - Gauge gauge; - PushGateway pg; - Map groupingKey; - - @Before - public void setUp() { - registry = new CollectorRegistry(); - gauge = (Gauge) Gauge.build().name("g").help("help").create(); - pg = new PushGateway("localhost:" + mockServerRule.getHttpPort()); - groupingKey = new TreeMap(); - groupingKey.put("l", "v"); - } - - @Test(expected = RuntimeException.class) - public void testInvalidURLThrowsRuntimeException() { - new PushGateway("::"); // ":" is interpreted as port number, so parsing fails - } - - @Test - public void testMultipleSlashesAreStrippedFromURL() { - final PushGateway pushGateway = new PushGateway("example.com:1234/context///path//"); - Assert.assertEquals( - "http://example.com:1234/context/path/metrics/", - pushGateway.gatewayBaseURL - ); - } - - @Test - public void testPush() throws IOException { - mockServerClient.when( - request() - .withMethod("PUT") - .withPath("/metrics/job/j") - ).respond(response().withStatusCode(202)); - pg.push(registry, "j"); - } - - @Test(expected=IOException.class) - public void testNon202ResponseThrows() throws IOException { - mockServerClient.when( - request() - .withMethod("PUT") - .withPath("/metrics/job/j") - ).respond(response().withStatusCode(500)); - pg.push(registry, "j"); - } - - @Test - public void testPushCollector() throws IOException { - mockServerClient.when( - request() - .withMethod("PUT") - .withPath("/metrics/job/j") - ).respond(response().withStatusCode(202)); - pg.push(gauge, "j"); - } - - @Test - public void testPushWithGroupingKey() throws IOException { - mockServerClient.when( - request() - .withMethod("PUT") - .withPath("/metrics/job/j/l/v") - ).respond(response().withStatusCode(202)); - pg.push(registry, "j", groupingKey); - } - - @Test - public void testPushWithMultiGroupingKey() throws IOException { - mockServerClient.when( - request() - .withMethod("PUT") - .withPath("/metrics/job/j/l/v/l2/v2") - ).respond(response().withStatusCode(202)); - groupingKey.put("l2", "v2"); - pg.push(registry, "j", groupingKey); - } - - @Test - public void testPushWithGroupingKeyWithSlashes() throws IOException { - mockServerClient.when( - request() - .withMethod("PUT") - .withPath("/metrics/job@base64/YS9i/l/v/l2@base64/75-_Lw==") - ).respond(response().withStatusCode(202)); - groupingKey.put("l2", "\uF7FF/"); - pg.push(registry, "a/b", groupingKey); - } - - @Test - public void testPushCollectorWithGroupingKey() throws IOException { - mockServerClient.when( - request() - .withMethod("PUT") - .withPath("/metrics/job/j/l/v") - ).respond(response().withStatusCode(202)); - pg.push(gauge, "j", groupingKey); - } - - @Test - public void testPushAdd() throws IOException { - mockServerClient.when( - request() - .withMethod("POST") - .withPath("/metrics/job/j") - ).respond(response().withStatusCode(202)); - pg.pushAdd(registry, "j"); - } - - @Test - public void testPushAddCollector() throws IOException { - mockServerClient.when( - request() - .withMethod("POST") - .withPath("/metrics/job/j") - ).respond(response().withStatusCode(202)); - pg.pushAdd(gauge, "j"); - } - - @Test - public void testPushAddWithGroupingKey() throws IOException { - mockServerClient.when( - request() - .withMethod("POST") - .withPath("/metrics/job/j/l/v") - ).respond(response().withStatusCode(202)); - pg.pushAdd(registry, "j", groupingKey); - } - - @Test - public void testPushAddCollectorWithGroupingKey() throws IOException { - mockServerClient.when( - request() - .withMethod("POST") - .withPath("/metrics/job/j/l/v") - ).respond(response().withStatusCode(202)); - pg.pushAdd(gauge, "j", groupingKey); - } - - @Test - public void testDelete() throws IOException { - mockServerClient.when( - request() - .withMethod("DELETE") - .withPath("/metrics/job/j") - ).respond(response().withStatusCode(202)); - pg.delete("j"); - } - - @Test - public void testDeleteWithGroupingKey() throws IOException { - mockServerClient.when( - request() - .withMethod("DELETE") - .withPath("/metrics/job/j/l/v") - ).respond(response().withStatusCode(202)); - pg.delete("j", groupingKey); - } - - - - @Test - public void testOldPushWithoutInstance() throws IOException { - mockServerClient.when( - request() - .withMethod("PUT") - .withPath("/metrics/job/j/instance/") - ).respond(response().withStatusCode(202)); - pg.push(registry, "j", ""); - } - - @Test - public void testOldPushWithInstance() throws IOException { - mockServerClient.when( - request() - .withMethod("PUT") - .withPath("/metrics/job/j/instance/i") - ).respond(response().withStatusCode(202)); - pg.push(registry, "j", "i"); - } - - @Test(expected=IOException.class) - public void testOldNon202ResponseThrows() throws IOException { - mockServerClient.when( - request() - .withMethod("PUT") - .withPath("/metrics/job/j/instance/i") - ).respond(response().withStatusCode(500)); - pg.push(registry,"j", "i"); - } - - @Test - public void testOldPushWithSlashes() throws IOException { - mockServerClient.when( - request() - .withMethod("PUT") - .withPath("/metrics/job@base64/YS9i/instance@base64/Yy9k") - ).respond(response().withStatusCode(202)); - pg.push(registry, "a/b", "c/d"); - } - - @Test - public void testOldPushCollector() throws IOException { - mockServerClient.when( - request() - .withMethod("PUT") - .withPath("/metrics/job/j/instance/i") - ).respond(response().withStatusCode(202)); - pg.push(gauge, "j", "i"); - } - - @Test - public void testOldPushAdd() throws IOException { - mockServerClient.when( - request() - .withMethod("POST") - .withPath("/metrics/job/j/instance/i") - ).respond(response().withStatusCode(202)); - pg.pushAdd(registry, "j", "i"); - } - - @Test - public void testOldPushAddCollector() throws IOException { - mockServerClient.when( - request() - .withMethod("POST") - .withPath("/metrics/job/j/instance/i") - ).respond(response().withStatusCode(202)); - pg.pushAdd(gauge, "j", "i"); - } - - @Test - public void testOldDelete() throws IOException { - mockServerClient.when( - request() - .withMethod("DELETE") - .withPath("/metrics/job/j/instance/i") - ).respond(response().withStatusCode(202)); - pg.delete("j", "i"); - } - - @Test - public void testInstanceIPGroupingKey() throws IOException { - groupingKey = PushGateway.instanceIPGroupingKey(); - Assert.assertTrue(!groupingKey.get("instance").equals("")); - } -} diff --git a/simpleclient_servlet/pom.xml b/simpleclient_servlet/pom.xml deleted file mode 100644 index 2d4925689..000000000 --- a/simpleclient_servlet/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - 4.0.0 - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_servlet - bundle - - Prometheus Java Simpleclient Servlet - - HTTP servlet exporter for the simpleclient. - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - brian-brazil - Brian Brazil - brian.brazil@boxever.com - - - - - UTF-8 - - - - - io.prometheus - simpleclient - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_common - 0.6.1-SNAPSHOT - - - javax.servlet - javax.servlet-api - 3.0.1 - provided - - - - junit - junit - 4.11 - test - - - org.assertj - assertj-core - 2.6.0 - test - - - org.eclipse.jetty - jetty-servlet - 8.1.7.v20120910 - test - - - org.mockito - mockito-core - 1.9.5 - test - - - diff --git a/simpleclient_servlet/src/main/java/io/prometheus/client/exporter/MetricsServlet.java b/simpleclient_servlet/src/main/java/io/prometheus/client/exporter/MetricsServlet.java deleted file mode 100644 index db579e424..000000000 --- a/simpleclient_servlet/src/main/java/io/prometheus/client/exporter/MetricsServlet.java +++ /dev/null @@ -1,70 +0,0 @@ -package io.prometheus.client.exporter; - -import io.prometheus.client.CollectorRegistry; -import io.prometheus.client.exporter.common.TextFormat; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.Writer; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -/** - * The MetricsServlet class exists to provide a simple way of exposing the metrics values. - * - */ -public class MetricsServlet extends HttpServlet { - - private CollectorRegistry registry; - - /** - * Construct a MetricsServlet for the default registry. - */ - public MetricsServlet() { - this(CollectorRegistry.defaultRegistry); - } - - /** - * Construct a MetricsServlet for the given registry. - * @param registry collector registry - */ - public MetricsServlet(CollectorRegistry registry) { - this.registry = registry; - } - - @Override - protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) - throws ServletException, IOException { - resp.setStatus(HttpServletResponse.SC_OK); - resp.setContentType(TextFormat.CONTENT_TYPE_004); - - Writer writer = resp.getWriter(); - try { - TextFormat.write004(writer, registry.filteredMetricFamilySamples(parse(req))); - writer.flush(); - } finally { - writer.close(); - } - } - - private Set parse(HttpServletRequest req) { - String[] includedParam = req.getParameterValues("name[]"); - if (includedParam == null) { - return Collections.emptySet(); - } else { - return new HashSet(Arrays.asList(includedParam)); - } - } - - @Override - protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) - throws ServletException, IOException { - doGet(req, resp); - } - -} diff --git a/simpleclient_servlet/src/main/java/io/prometheus/client/filter/MetricsFilter.java b/simpleclient_servlet/src/main/java/io/prometheus/client/filter/MetricsFilter.java deleted file mode 100644 index 742dcf5a1..000000000 --- a/simpleclient_servlet/src/main/java/io/prometheus/client/filter/MetricsFilter.java +++ /dev/null @@ -1,179 +0,0 @@ -package io.prometheus.client.filter; - -import io.prometheus.client.Histogram; - -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import java.io.IOException; - -/** - * The MetricsFilter class exists to provide a high-level filter that enables tunable collection of metrics for Servlet - * performance. - * - *

    The Histogram name itself is required, and configured with a {@code metric-name} init parameter. - * - *

    The help parameter, configured with the {@code help} init parameter, is not required but strongly recommended. - * - *

    By default, this filter will provide metrics that distinguish only 1 level deep for the request path - * (including servlet context path), but can be configured with the {@code path-components} init parameter. Any number - * provided that is less than 1 will provide the full path granularity (warning, this may affect performance). - * - *

    The Histogram buckets can be configured with a {@code buckets} init parameter whose value is a comma-separated list - * of valid {@code double} values. - * - *

    {@code
    - * 
    - *   prometheusFilter
    - *   io.prometheus.client.filter.MetricsFilter
    - *   
    - *      metric-name
    - *      webapp_metrics_filter
    - *   
    - *    
    - *      help
    - *      The time taken fulfilling servlet requests
    - *   
    - *   
    - *      buckets
    - *      0.005,0.01,0.025,0.05,0.075,0.1,0.25,0.5,0.75,1,2.5,5,7.5,10
    - *   
    - *   
    - *      path-components
    - *      0
    - *   
    - * 
    - * }
    - * - * @author Andrew Stuart <andrew.stuart2@gmail.com> - */ -public class MetricsFilter implements Filter { - static final String PATH_COMPONENT_PARAM = "path-components"; - static final String HELP_PARAM = "help"; - static final String METRIC_NAME_PARAM = "metric-name"; - static final String BUCKET_CONFIG_PARAM = "buckets"; - - private Histogram histogram = null; - - // Package-level for testing purposes. - int pathComponents = 1; - private String metricName = null; - private String help = "The time taken fulfilling servlet requests"; - private double[] buckets = null; - - public MetricsFilter() {} - - public MetricsFilter( - String metricName, - String help, - Integer pathComponents, - double[] buckets) { - this.metricName = metricName; - this.buckets = buckets; - if (help != null) { - this.help = help; - } - if (pathComponents != null) { - this.pathComponents = pathComponents; - } - } - - private boolean isEmpty(String s) { - return s == null || s.length() == 0; - } - - private String getComponents(String str) { - if (str == null || pathComponents < 1) { - return str; - } - int count = 0; - int i = -1; - do { - i = str.indexOf("/", i + 1); - if (i < 0) { - // Path is longer than specified pathComponents. - return str; - } - count++; - } while (count <= pathComponents); - - return str.substring(0, i); - } - - @Override - public void init(FilterConfig filterConfig) throws ServletException { - Histogram.Builder builder = Histogram.build() - .labelNames("path", "method"); - - if (filterConfig == null && isEmpty(metricName)) { - throw new ServletException("No configuration object provided, and no metricName passed via constructor"); - } - - if (filterConfig != null) { - if (isEmpty(metricName)) { - metricName = filterConfig.getInitParameter(METRIC_NAME_PARAM); - if (isEmpty(metricName)) { - throw new ServletException("Init parameter \"" + METRIC_NAME_PARAM + "\" is required; please supply a value"); - } - } - - if (!isEmpty(filterConfig.getInitParameter(HELP_PARAM))) { - help = filterConfig.getInitParameter(HELP_PARAM); - } - - // Allow overriding of the path "depth" to track - if (!isEmpty(filterConfig.getInitParameter(PATH_COMPONENT_PARAM))) { - pathComponents = Integer.valueOf(filterConfig.getInitParameter(PATH_COMPONENT_PARAM)); - } - - // Allow users to override the default bucket configuration - if (!isEmpty(filterConfig.getInitParameter(BUCKET_CONFIG_PARAM))) { - String[] bucketParams = filterConfig.getInitParameter(BUCKET_CONFIG_PARAM).split(","); - buckets = new double[bucketParams.length]; - - for (int i = 0; i < bucketParams.length; i++) { - buckets[i] = Double.parseDouble(bucketParams[i]); - } - } - } - - if (buckets != null) { - builder = builder.buckets(buckets); - } - - histogram = builder - .help(help) - .name(metricName) - .register(); - } - - @Override - public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { - if (!(servletRequest instanceof HttpServletRequest)) { - filterChain.doFilter(servletRequest, servletResponse); - return; - } - - HttpServletRequest request = (HttpServletRequest) servletRequest; - - String path = request.getRequestURI(); - - Histogram.Timer timer = histogram - .labels(getComponents(path), request.getMethod()) - .startTimer(); - - try { - filterChain.doFilter(servletRequest, servletResponse); - } finally { - timer.observeDuration(); - } - } - - @Override - public void destroy() { - } -} diff --git a/simpleclient_servlet/src/test/java/io/prometheus/client/exporter/MetricsServletTest.java b/simpleclient_servlet/src/test/java/io/prometheus/client/exporter/MetricsServletTest.java deleted file mode 100644 index 78e73e7fa..000000000 --- a/simpleclient_servlet/src/test/java/io/prometheus/client/exporter/MetricsServletTest.java +++ /dev/null @@ -1,77 +0,0 @@ -package io.prometheus.client.exporter; - -import io.prometheus.client.CollectorRegistry; -import io.prometheus.client.Gauge; -import org.junit.Test; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.PrintWriter; -import java.io.StringWriter; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.assertj.core.api.Assertions.fail; -import static org.mockito.Matchers.anyChar; -import static org.mockito.Mockito.doThrow; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -public class MetricsServletTest { - - @Test - public void testWriterFiltersBasedOnParameter() throws IOException, ServletException { - CollectorRegistry registry = new CollectorRegistry(); - Gauge.build("a", "a help").register(registry); - Gauge.build("b", "a help").register(registry); - Gauge.build("c", "a help").register(registry); - - HttpServletRequest req = mock(HttpServletRequest.class); - when(req.getParameterValues("name[]")).thenReturn(new String[]{"a", "b", "oneTheDoesntExist", ""}); - HttpServletResponse resp = mock(HttpServletResponse.class); - StringWriter stringWriter = new StringWriter(); - PrintWriter writer = new PrintWriter(stringWriter); - when(resp.getWriter()).thenReturn(writer); - - new MetricsServlet(registry).doGet(req, resp); - - assertThat(stringWriter.toString()).contains("a 0.0"); - assertThat(stringWriter.toString()).contains("b 0.0"); - assertThat(stringWriter.toString()).doesNotContain("c 0.0"); - } - - @Test - public void testWriterIsClosedNormally() throws IOException, ServletException { - HttpServletRequest req = mock(HttpServletRequest.class); - HttpServletResponse resp = mock(HttpServletResponse.class); - PrintWriter writer = mock(PrintWriter.class); - when(resp.getWriter()).thenReturn(writer); - CollectorRegistry registry = new CollectorRegistry(); - Gauge a = Gauge.build("a", "a help").register(registry); - - new MetricsServlet(registry).doGet(req, resp); - verify(writer).close(); - } - - @Test - public void testWriterIsClosedOnException() throws IOException, ServletException { - HttpServletRequest req = mock(HttpServletRequest.class); - HttpServletResponse resp = mock(HttpServletResponse.class); - PrintWriter writer = mock(PrintWriter.class); - when(resp.getWriter()).thenReturn(writer); - doThrow(new RuntimeException()).when(writer).write(anyChar()); - CollectorRegistry registry = new CollectorRegistry(); - Gauge a = Gauge.build("a", "a help").register(registry); - - try { - new MetricsServlet(registry).doGet(req, resp); - fail("Exception expected"); - } catch (Exception e) { - } - - verify(writer).close(); - } -} diff --git a/simpleclient_servlet/src/test/java/io/prometheus/client/filter/MetricsFilterTest.java b/simpleclient_servlet/src/test/java/io/prometheus/client/filter/MetricsFilterTest.java deleted file mode 100644 index 4c69f0b1f..000000000 --- a/simpleclient_servlet/src/test/java/io/prometheus/client/filter/MetricsFilterTest.java +++ /dev/null @@ -1,183 +0,0 @@ -package io.prometheus.client.filter; - -import io.prometheus.client.Collector; -import io.prometheus.client.CollectorRegistry; -import org.eclipse.jetty.http.HttpMethods; -import org.junit.After; -import org.junit.Test; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; - -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.Enumeration; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -public class MetricsFilterTest { - MetricsFilter f = new MetricsFilter(); - - @After - public void clear() { - CollectorRegistry.defaultRegistry.clear(); - } - - @Test - public void init() throws Exception { - FilterConfig cfg = mock(FilterConfig.class); - when(cfg.getInitParameter(anyString())).thenReturn(null); - - String metricName = "foo"; - - when(cfg.getInitParameter(MetricsFilter.METRIC_NAME_PARAM)).thenReturn(metricName); - when(cfg.getInitParameter(MetricsFilter.PATH_COMPONENT_PARAM)).thenReturn("4"); - - f.init(cfg); - - assertEquals(f.pathComponents, 4); - - HttpServletRequest req = mock(HttpServletRequest.class); - - when(req.getRequestURI()).thenReturn("/foo/bar/baz/bang/zilch/zip/nada"); - when(req.getMethod()).thenReturn(HttpMethods.GET); - - HttpServletResponse res = mock(HttpServletResponse.class); - FilterChain c = mock(FilterChain.class); - - f.doFilter(req, res, c); - - verify(c).doFilter(req, res); - - final Double sampleValue = CollectorRegistry.defaultRegistry.getSampleValue(metricName + "_count", new String[]{"path", "method"}, new String[]{"/foo/bar/baz/bang", HttpMethods.GET}); - assertNotNull(sampleValue); - assertEquals(1, sampleValue, 0.0001); - } - - @Test - public void doFilter() throws Exception { - HttpServletRequest req = mock(HttpServletRequest.class); - final String path = "/foo/bar/baz/bang/zilch/zip/nada"; - - when(req.getRequestURI()).thenReturn(path); - when(req.getMethod()).thenReturn(HttpMethods.GET); - - HttpServletResponse res = mock(HttpServletResponse.class); - FilterChain c = mock(FilterChain.class); - - String name = "foo"; - FilterConfig cfg = mock(FilterConfig.class); - when(cfg.getInitParameter(MetricsFilter.METRIC_NAME_PARAM)).thenReturn(name); - when(cfg.getInitParameter(MetricsFilter.PATH_COMPONENT_PARAM)).thenReturn("0"); - - f.init(cfg); - f.doFilter(req, res, c); - - verify(c).doFilter(req, res); - - - final Double sampleValue = CollectorRegistry.defaultRegistry.getSampleValue(name + "_count", new String[]{"path", "method"}, new String[]{path, HttpMethods.GET}); - assertNotNull(sampleValue); - assertEquals(1, sampleValue, 0.0001); - } - - @Test - public void testConstructor() throws Exception { - HttpServletRequest req = mock(HttpServletRequest.class); - final String path = "/foo/bar/baz/bang"; - when(req.getRequestURI()).thenReturn(path); - when(req.getMethod()).thenReturn(HttpMethods.POST); - - FilterChain c = mock(FilterChain.class); - doAnswer(new Answer() { - @Override - public Void answer(InvocationOnMock invocationOnMock) throws Throwable { - Thread.sleep(100); - return null; - } - }).when(c).doFilter(any(HttpServletRequest.class), any(HttpServletResponse.class)); - - MetricsFilter constructed = new MetricsFilter( - "foobar_baz_filter_duration_seconds", - "Help for my filter", - 0, - null - ); - constructed.init(mock(FilterConfig.class)); - - HttpServletResponse res = mock(HttpServletResponse.class); - constructed.doFilter(req, res, c); - - final Double sum = CollectorRegistry.defaultRegistry.getSampleValue("foobar_baz_filter_duration_seconds_sum", new String[]{"path", "method"}, new String[]{path, HttpMethods.POST}); - assertNotNull(sum); - assertEquals(0.1, sum, 0.01); - } - - @Test - public void testBucketsAndName() throws Exception { - HttpServletRequest req = mock(HttpServletRequest.class); - final String path = "/foo/bar/baz/bang"; - when(req.getRequestURI()).thenReturn(path); - when(req.getMethod()).thenReturn(HttpMethods.POST); - - FilterChain c = mock(FilterChain.class); - doAnswer(new Answer() { - @Override - public Void answer(InvocationOnMock invocationOnMock) throws Throwable { - Thread.sleep(100); - return null; - } - }).when(c).doFilter(any(HttpServletRequest.class), any(HttpServletResponse.class)); - - final String buckets = "0.01,0.05,0.1,0.15,0.25"; - FilterConfig cfg = mock(FilterConfig.class); - when(cfg.getInitParameter(MetricsFilter.BUCKET_CONFIG_PARAM)).thenReturn(buckets); - when(cfg.getInitParameter(MetricsFilter.METRIC_NAME_PARAM)).thenReturn("foo"); - - HttpServletResponse res = mock(HttpServletResponse.class); - - f.init(cfg); - - f.doFilter(req, res, c); - - final Double sum = CollectorRegistry.defaultRegistry.getSampleValue("foo_sum", new String[]{"path", "method"}, new String[]{"/foo", HttpMethods.POST}); - assertEquals(0.1, sum, 0.01); - - final Double le05 = CollectorRegistry.defaultRegistry.getSampleValue("foo_bucket", new String[]{"path", "method", "le"}, new String[]{"/foo", HttpMethods.POST, "0.05"}); - assertNotNull(le05); - assertEquals(0, le05, 0.01); - final Double le15 = CollectorRegistry.defaultRegistry.getSampleValue("foo_bucket", new String[]{"path", "method", "le"}, new String[]{"/foo", HttpMethods.POST, "0.15"}); - assertNotNull(le15); - assertEquals(1, le15, 0.01); - - - final Enumeration samples = CollectorRegistry.defaultRegistry.metricFamilySamples(); - Collector.MetricFamilySamples sample = null; - while(samples.hasMoreElements()) { - sample = samples.nextElement(); - if (sample.name.equals("foo")) { - break; - } - } - - assertNotNull(sample); - - int count = 0; - for (Collector.MetricFamilySamples.Sample s : sample.samples) { - if (s.name.equals("foo_bucket")) { - count++; - } - } - // +1 because of the final le=+infinity bucket - assertEquals(buckets.split(",").length+1, count); - } - -} diff --git a/simpleclient_spring_boot/pom.xml b/simpleclient_spring_boot/pom.xml deleted file mode 100644 index 362dc636b..000000000 --- a/simpleclient_spring_boot/pom.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - 4.0.0 - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_spring_boot - bundle - - Prometheus Java Simpleclient Spring Boot Metric - - Collect information from Spring Boot actuator. - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - tokuhirom - Tokuhiro Matsuno - tokuhirom@gmail.com - - - Marco Aust - github@marcoaust.de - private - https://github.com/maust - - - eliezio - Eliezio Oliveira - eliezio.oliveira@gmail.com - - - - - UTF-8 - - - - - io.prometheus - simpleclient - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_common - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_spring_web - 0.6.1-SNAPSHOT - - - org.springframework.boot - spring-boot-actuator - 1.5.4.RELEASE - - - org.springframework.boot - spring-boot-starter-aop - 1.5.4.RELEASE - - - org.apache.commons - commons-lang3 - 3.4 - - - - - junit - junit - 4.12 - test - - - org.cthul - cthul-matchers - 1.1.0 - test - - - org.springframework.boot - spring-boot-starter-test - 1.5.4.RELEASE - test - - - org.springframework.boot - spring-boot-starter-web - 1.5.4.RELEASE - test - - - diff --git a/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/EnablePrometheusEndpoint.java b/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/EnablePrometheusEndpoint.java deleted file mode 100644 index e799756e9..000000000 --- a/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/EnablePrometheusEndpoint.java +++ /dev/null @@ -1,44 +0,0 @@ -package io.prometheus.client.spring.boot; - -import org.springframework.context.annotation.Import; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Enable an endpoint that exposes Prometheus metrics from its default collector. - *

    - * Usage: - *
    Just add this annotation to the main class of your Spring Boot application, e.g.: - *

    
    - * {@literal @}SpringBootApplication
    - * {@literal @}EnablePrometheusEndpoint
    - *  public class Application {
    - *
    - *    public static void main(String[] args) {
    - *      SpringApplication.run(Application.class, args);
    - *    }
    - *  }
    - * 
    - *

    - * Configuration: - *
    You can customize this endpoint at runtime using the following spring properties: - *

      - *
    • {@code endpoints.prometheus.id} (default: "prometheus")
    • - *
    • {@code endpoints.prometheus.enabled} (default: {@code true})
    • - *
    • {@code endpoints.prometheus.sensitive} (default: {@code true})
    • - *
    - * - * @author Marco Aust - * @author Eliezio Oliveira - */ -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@Documented -@Import(PrometheusEndpointConfiguration.class) -public @interface EnablePrometheusEndpoint { - -} diff --git a/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/EnableSpringBootMetricsCollector.java b/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/EnableSpringBootMetricsCollector.java deleted file mode 100644 index ddd204a5b..000000000 --- a/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/EnableSpringBootMetricsCollector.java +++ /dev/null @@ -1,15 +0,0 @@ -package io.prometheus.client.spring.boot; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import org.springframework.context.annotation.Import; - - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@Documented -@Import(PrometheusMetricsConfiguration.class) -public @interface EnableSpringBootMetricsCollector {} diff --git a/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/PrometheusEndpoint.java b/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/PrometheusEndpoint.java deleted file mode 100644 index 66e604af4..000000000 --- a/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/PrometheusEndpoint.java +++ /dev/null @@ -1,39 +0,0 @@ -package io.prometheus.client.spring.boot; - -import io.prometheus.client.CollectorRegistry; -import io.prometheus.client.exporter.common.TextFormat; -import org.springframework.boot.actuate.endpoint.AbstractEndpoint; -import org.springframework.boot.context.properties.ConfigurationProperties; - -import java.io.IOException; -import java.io.StringWriter; -import java.io.Writer; -import java.util.Collections; -import java.util.Set; - -@ConfigurationProperties("endpoints.prometheus") -class PrometheusEndpoint extends AbstractEndpoint { - - private final CollectorRegistry collectorRegistry; - - PrometheusEndpoint(CollectorRegistry collectorRegistry) { - super("prometheus"); - this.collectorRegistry = collectorRegistry; - } - - @Override - public String invoke() { - return writeRegistry(Collections.emptySet()); - } - - public String writeRegistry(Set metricsToInclude) { - try { - Writer writer = new StringWriter(); - TextFormat.write004(writer, collectorRegistry.filteredMetricFamilySamples(metricsToInclude)); - return writer.toString(); - } catch (IOException e) { - // This actually never happens since StringWriter::write() doesn't throw any IOException - throw new RuntimeException("Writing metrics failed", e); - } - } -} diff --git a/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/PrometheusEndpointConfiguration.java b/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/PrometheusEndpointConfiguration.java deleted file mode 100644 index 5f561c050..000000000 --- a/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/PrometheusEndpointConfiguration.java +++ /dev/null @@ -1,23 +0,0 @@ -package io.prometheus.client.spring.boot; - -import io.prometheus.client.CollectorRegistry; -import org.springframework.boot.actuate.condition.ConditionalOnEnabledEndpoint; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -class PrometheusEndpointConfiguration { - - @Bean - public PrometheusEndpoint prometheusEndpoint() { - return new PrometheusEndpoint(CollectorRegistry.defaultRegistry); - } - - @Bean - @ConditionalOnBean(PrometheusEndpoint.class) - @ConditionalOnEnabledEndpoint("prometheus") - public PrometheusMvcEndpoint prometheusEndpointFix(PrometheusEndpoint prometheusEndpoint) { - return new PrometheusMvcEndpoint(prometheusEndpoint); - } -} diff --git a/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/PrometheusMetricsConfiguration.java b/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/PrometheusMetricsConfiguration.java deleted file mode 100644 index 9d72a1a3f..000000000 --- a/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/PrometheusMetricsConfiguration.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.prometheus.client.spring.boot; - -import java.util.Collection; -import org.springframework.boot.actuate.endpoint.PublicMetrics; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -class PrometheusMetricsConfiguration { - - @Bean - public SpringBootMetricsCollector springBootMetricsCollector(Collection publicMetrics) { - SpringBootMetricsCollector springBootMetricsCollector = new SpringBootMetricsCollector(publicMetrics); - springBootMetricsCollector.register(); - return springBootMetricsCollector; - } -} diff --git a/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/PrometheusMvcEndpoint.java b/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/PrometheusMvcEndpoint.java deleted file mode 100644 index 816fde7f3..000000000 --- a/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/PrometheusMvcEndpoint.java +++ /dev/null @@ -1,44 +0,0 @@ -package io.prometheus.client.spring.boot; - -import io.prometheus.client.exporter.common.TextFormat; -import org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; - -import java.util.Set; - -import static org.springframework.http.HttpHeaders.CONTENT_TYPE; - -@ConfigurationProperties("endpoints.prometheus") -public class PrometheusMvcEndpoint extends EndpointMvcAdapter { - - private final PrometheusEndpoint delgate; - - public PrometheusMvcEndpoint(PrometheusEndpoint delegate) { - super(delegate); - this.delgate = delegate; - } - - @RequestMapping( - method = {RequestMethod.GET}, - produces = { "*/*" } - ) - @ResponseBody - public ResponseEntity value( - @RequestParam(value = "name[]", required = false, defaultValue = "") Set name) { - if (!getDelegate().isEnabled()) { - // Shouldn't happen - MVC endpoint shouldn't be registered when delegate's - // disabled - return getDisabledResponse(); - } - - String result = delgate.writeRegistry(name); - return ResponseEntity.ok() - .header(CONTENT_TYPE, TextFormat.CONTENT_TYPE_004) - .body(result); - } -} diff --git a/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/SpringBootMetricsCollector.java b/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/SpringBootMetricsCollector.java deleted file mode 100644 index 2cf1f7d8b..000000000 --- a/simpleclient_spring_boot/src/main/java/io/prometheus/client/spring/boot/SpringBootMetricsCollector.java +++ /dev/null @@ -1,54 +0,0 @@ -package io.prometheus.client.spring.boot; - -import io.prometheus.client.Collector; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.actuate.endpoint.PublicMetrics; -import org.springframework.boot.actuate.metrics.Metric; -import org.springframework.stereotype.Component; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -/** - *

    Spring boot metrics integration for Prometheus exporter.

    - * - *
    {@literal @}Bean
    - * public SpringBootMetricsCollector springBootMetricsCollector(Collection{@literal <}PublicMetrics{@literal >} publicMetrics) {
    - *   SpringBootMetricsCollector springBootMetricsCollector = new SpringBootMetricsCollector(publicMetrics);
    - *   springBootMetricsCollector.register();
    - *   return springBootMetricsCollector;
    - * }
    - * 
    - */ -@Component -public class SpringBootMetricsCollector extends Collector implements Collector.Describable { - private final Collection publicMetrics; - - @Autowired - public SpringBootMetricsCollector(Collection publicMetrics) { - this.publicMetrics = publicMetrics; - } - - @Override - public List collect() { - ArrayList samples = new ArrayList(); - for (PublicMetrics publicMetrics : this.publicMetrics) { - for (Metric metric : publicMetrics.metrics()) { - String name = Collector.sanitizeMetricName(metric.getName()); - double value = metric.getValue().doubleValue(); - MetricFamilySamples metricFamilySamples = new MetricFamilySamples( - name, Type.GAUGE, name, Collections.singletonList( - new MetricFamilySamples.Sample(name, Collections.emptyList(), Collections.emptyList(), value))); - samples.add(metricFamilySamples); - } - } - return samples; - } - - @Override - public List describe() { - return new ArrayList(); - } -} diff --git a/simpleclient_spring_boot/src/test/java/io/prometheus/client/matchers/CustomMatchers.java b/simpleclient_spring_boot/src/test/java/io/prometheus/client/matchers/CustomMatchers.java deleted file mode 100644 index dddec7b61..000000000 --- a/simpleclient_spring_boot/src/test/java/io/prometheus/client/matchers/CustomMatchers.java +++ /dev/null @@ -1,45 +0,0 @@ -package io.prometheus.client.matchers; - -import org.hamcrest.Description; -import org.hamcrest.Matcher; -import org.hamcrest.core.IsCollectionContaining; - -/** - * @author BretC - * - * @see this StackOverflow answer - * - * Licensed under Creative Commons BY-SA 3.0 - */ -public final class CustomMatchers { - - private CustomMatchers() { - } - - public static Matcher> exactlyNItems(final int n, final Matcher elementMatcher) { - return new IsCollectionContaining(elementMatcher) { - @Override - protected boolean matchesSafely(Iterable collection, Description mismatchDescription) { - int count = 0; - boolean isPastFirst = false; - - for (Object item : collection) { - - if (elementMatcher.matches(item)) { - count++; - } - if (isPastFirst) { - mismatchDescription.appendText(", "); - } - elementMatcher.describeMismatch(item, mismatchDescription); - isPastFirst = true; - } - - if (count != n) { - mismatchDescription.appendText(". Expected exactly " + n + " but got " + count); - } - return count == n; - } - }; - } -} diff --git a/simpleclient_spring_boot/src/test/java/io/prometheus/client/spring/boot/DummyBootApplication.java b/simpleclient_spring_boot/src/test/java/io/prometheus/client/spring/boot/DummyBootApplication.java deleted file mode 100644 index a011d137d..000000000 --- a/simpleclient_spring_boot/src/test/java/io/prometheus/client/spring/boot/DummyBootApplication.java +++ /dev/null @@ -1,12 +0,0 @@ -package io.prometheus.client.spring.boot; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * Dummy class to satisfy Spring Boot Test requirement of a class annotated either with {code @SpringBootApplication} or - * {code @SpringBootConfiguration}. - */ -@SpringBootApplication -class DummyBootApplication { - -} diff --git a/simpleclient_spring_boot/src/test/java/io/prometheus/client/spring/boot/PrometheusEndpointTest.java b/simpleclient_spring_boot/src/test/java/io/prometheus/client/spring/boot/PrometheusEndpointTest.java deleted file mode 100644 index 377034964..000000000 --- a/simpleclient_spring_boot/src/test/java/io/prometheus/client/spring/boot/PrometheusEndpointTest.java +++ /dev/null @@ -1,72 +0,0 @@ -package io.prometheus.client.spring.boot; - -import io.prometheus.client.Counter; -import io.prometheus.client.exporter.common.TextFormat; -import io.prometheus.client.matchers.CustomMatchers; -import org.apache.commons.lang3.StringUtils; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import java.util.Arrays; -import java.util.List; - -import static org.cthul.matchers.CthulMatchers.matchesPattern; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertEquals; -import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; - -@RunWith(SpringRunner.class) -@EnablePrometheusEndpoint -@SpringBootTest(webEnvironment = RANDOM_PORT, classes = DummyBootApplication.class) -@TestPropertySource(properties = "management.security.enabled=false") -public class PrometheusEndpointTest { - - @Value("${local.server.port}") - int localServerPort; - - @Autowired - TestRestTemplate template; - - @Test - public void testMetricsExportedThroughPrometheusEndpoint() { - // given: - final Counter promCounter = Counter.build("foo_bar", "test counter") - .labelNames("label1", "label2") - .register(); - final Counter filteredCounter = Counter.build("filtered_foo_bar", "test counter") - .labelNames("label1", "label2") - .register(); - - // when: - promCounter.labels("val1", "val2").inc(3); - filteredCounter.labels("val1", "val2").inc(6); - - HttpHeaders headers = new HttpHeaders(); - headers.set("Accept", "text/plain"); - - ResponseEntity metricsResponse = template.exchange(getBaseUrl() + "/prometheus?name[]=foo_bar", HttpMethod.GET, new HttpEntity(headers), String.class); - - // then: - assertEquals(HttpStatus.OK, metricsResponse.getStatusCode()); - assertEquals(StringUtils.deleteWhitespace(TextFormat.CONTENT_TYPE_004), metricsResponse.getHeaders().getContentType().toString().toLowerCase()); - - List responseLines = Arrays.asList(metricsResponse.getBody().split("\n")); - assertThat(responseLines, CustomMatchers.exactlyNItems(1, - matchesPattern("foo_bar\\{label1=\"val1\",label2=\"val2\",?\\} 3.0"))); - } - - private String getBaseUrl() { - return "http://localhost:" + localServerPort; - } -} diff --git a/simpleclient_spring_boot/src/test/java/io/prometheus/client/spring/boot/PrometheusMvcEndpointTest.java b/simpleclient_spring_boot/src/test/java/io/prometheus/client/spring/boot/PrometheusMvcEndpointTest.java deleted file mode 100644 index e0b1567f4..000000000 --- a/simpleclient_spring_boot/src/test/java/io/prometheus/client/spring/boot/PrometheusMvcEndpointTest.java +++ /dev/null @@ -1,71 +0,0 @@ -package io.prometheus.client.spring.boot; - -import io.prometheus.client.exporter.common.TextFormat; -import org.apache.commons.lang3.StringUtils; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.junit4.SpringRunner; - -import static org.junit.Assert.assertEquals; -import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = RANDOM_PORT, classes = DummyBootApplication.class) -@TestPropertySource(properties = "management.security.enabled=false") -public class PrometheusMvcEndpointTest { - - @Value("${local.server.port}") - int localServerPort; - - @Autowired - TestRestTemplate template; - - @Test - public void testNameParamIsNull() throws Exception { - ResponseEntity metricsResponse = template.exchange(getBaseUrl() + "/prometheus", HttpMethod.GET, getEntity(), String.class); - - assertEquals(HttpStatus.OK, metricsResponse.getStatusCode()); - assertEquals(StringUtils.deleteWhitespace(TextFormat.CONTENT_TYPE_004), metricsResponse.getHeaders().getContentType().toString().toLowerCase()); - - } - - @Test - public void testAcceptPlainText() throws Exception { - - HttpHeaders headers = new HttpHeaders(); - headers.set("Accept", "text/plain"); - - ResponseEntity metricsResponse = template.exchange(getBaseUrl() + "/prometheus", HttpMethod.GET, new HttpEntity(headers), String.class); - - assertEquals(HttpStatus.OK, metricsResponse.getStatusCode()); - } - - @Test - public void testNameParamIsNotNull() { - ResponseEntity metricsResponse = template.exchange(getBaseUrl() + "/prometheus?name[]=foo_bar", HttpMethod.GET, getEntity(), String.class); - - assertEquals(HttpStatus.OK, metricsResponse.getStatusCode()); - assertEquals(StringUtils.deleteWhitespace(TextFormat.CONTENT_TYPE_004), metricsResponse.getHeaders().getContentType().toString().toLowerCase()); - - } - - public HttpEntity getEntity() { - HttpHeaders headers = new HttpHeaders(); - headers.set("Accept", "text/plain; version=0.0.4; charset=utf-8"); - return new HttpEntity(headers); - } - - private String getBaseUrl() { - return "http://localhost:" + localServerPort; - } -} \ No newline at end of file diff --git a/simpleclient_spring_boot/src/test/java/io/prometheus/client/spring/boot/SpringBootMetricsCollectorTest.java b/simpleclient_spring_boot/src/test/java/io/prometheus/client/spring/boot/SpringBootMetricsCollectorTest.java deleted file mode 100644 index a3f161bd9..000000000 --- a/simpleclient_spring_boot/src/test/java/io/prometheus/client/spring/boot/SpringBootMetricsCollectorTest.java +++ /dev/null @@ -1,57 +0,0 @@ -package io.prometheus.client.spring.boot; - -import io.prometheus.client.CollectorRegistry; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.actuate.endpoint.PublicMetrics; -import org.springframework.boot.actuate.metrics.CounterService; -import org.springframework.boot.actuate.metrics.GaugeService; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.Bean; -import org.springframework.test.context.junit4.SpringRunner; - -import java.util.Collection; - -import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertThat; - -@RunWith(SpringRunner.class) -@EnableAutoConfiguration -@SpringBootTest(classes = MetricsBootApplication.class) -public class SpringBootMetricsCollectorTest { - - @Autowired - private SpringBootMetricsCollector springBootMetricsCollector; - - @Autowired - private CounterService counterService; - - @Autowired - private GaugeService gaugeService; - - @Test - public void collect() throws Exception { - counterService.increment("foo"); - gaugeService.submit("bar", 3.14); - - CollectorRegistry defaultRegistry = CollectorRegistry.defaultRegistry; - assertThat(defaultRegistry.getSampleValue("counter_foo"), is(1.0)); - assertThat(defaultRegistry.getSampleValue("gauge_bar"), is(3.14)); - } -} - - -@SpringBootApplication -class MetricsBootApplication { - - @Bean - public SpringBootMetricsCollector springBootMetricsCollector(Collection publicMetrics) { - SpringBootMetricsCollector springBootMetricsCollector = new SpringBootMetricsCollector(publicMetrics); - springBootMetricsCollector.register(); - return springBootMetricsCollector; - } - -} \ No newline at end of file diff --git a/simpleclient_spring_web/pom.xml b/simpleclient_spring_web/pom.xml deleted file mode 100644 index 6cc592adb..000000000 --- a/simpleclient_spring_web/pom.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - 4.0.0 - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - simpleclient_spring_web - bundle - - Prometheus Java Simpleclient Spring Metrics - - Spring-specific metrics helpers - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - tokuhirom - Tokuhiro Matsuno - tokuhirom@gmail.com - - - Marco Aust - github@marcoaust.de - private - https://github.com/maust - - - eliezio - Eliezio Oliveira - eliezio.oliveira@gmail.com - - - - - UTF-8 - - - - - io.prometheus - simpleclient - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_common - 0.6.1-SNAPSHOT - - - org.springframework - spring-web - 4.3.9.RELEASE - - - org.springframework - spring-aop - 4.3.9.RELEASE - - - org.springframework - spring-context - 4.3.9.RELEASE - - - org.aspectj - aspectjweaver - 1.8.6 - - - org.apache.commons - commons-lang3 - 3.4 - - - - - junit - junit - 4.12 - test - - - org.springframework - spring-test - 4.2.3.RELEASE - test - - - diff --git a/simpleclient_spring_web/src/main/java/io/prometheus/client/spring/web/MethodTimer.java b/simpleclient_spring_web/src/main/java/io/prometheus/client/spring/web/MethodTimer.java deleted file mode 100644 index 08e5d8710..000000000 --- a/simpleclient_spring_web/src/main/java/io/prometheus/client/spring/web/MethodTimer.java +++ /dev/null @@ -1,120 +0,0 @@ -package io.prometheus.client.spring.web; - -import io.prometheus.client.Summary; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Pointcut; -import org.aspectj.lang.reflect.MethodSignature; -import org.springframework.context.annotation.Scope; -import org.springframework.core.annotation.AnnotationUtils; -import org.springframework.util.ReflectionUtils; -import org.springframework.web.bind.annotation.ControllerAdvice; - -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReadWriteLock; -import java.util.concurrent.locks.ReentrantReadWriteLock; - -/** - * This class automatically times (via aspectj) the execution of annotated methods, if it's been enabled via {@link EnablePrometheusTiming}, - * for methods annotated with {@link PrometheusTimeMethod} - * - * @author Andrew Stuart - */ -@Aspect("pertarget(io.prometheus.client.spring.web.MethodTimer.timeable())") -@Scope("prototype") -@ControllerAdvice -public class MethodTimer { - private final ReadWriteLock summaryLock = new ReentrantReadWriteLock(); - private final HashMap summaries = new HashMap(); - - @Pointcut("@annotation(io.prometheus.client.spring.web.PrometheusTimeMethod)") - public void annotatedMethod() {} - - @Pointcut("annotatedMethod()") - public void timeable() {} - - private PrometheusTimeMethod getAnnotation(ProceedingJoinPoint pjp) throws NoSuchMethodException { - assert(pjp.getSignature() instanceof MethodSignature); - MethodSignature signature = (MethodSignature) pjp.getSignature(); - - PrometheusTimeMethod annot = AnnotationUtils.findAnnotation(pjp.getTarget().getClass(), PrometheusTimeMethod.class); - if (annot != null) { - return annot; - } - - // When target is an AOP interface proxy but annotation is on class method (rather than Interface method). - final String name = signature.getName(); - final Class[] parameterTypes = signature.getParameterTypes(); - Method method = ReflectionUtils.findMethod(pjp.getTarget().getClass(), name, parameterTypes); - return AnnotationUtils.findAnnotation(method, PrometheusTimeMethod.class); - } - - private Summary ensureSummary(ProceedingJoinPoint pjp, String key) throws IllegalStateException { - PrometheusTimeMethod annot; - try { - annot = getAnnotation(pjp); - } catch (NoSuchMethodException e) { - throw new IllegalStateException("Annotation could not be found for pjp \"" + pjp.toShortString() +"\"", e); - } catch (NullPointerException e) { - throw new IllegalStateException("Annotation could not be found for pjp \"" + pjp.toShortString() +"\"", e); - } - - assert(annot != null); - - Summary summary; - - // We use a writeLock here to guarantee no concurrent reads. - final Lock writeLock = summaryLock.writeLock(); - writeLock.lock(); - try { - // Check one last time with full mutual exclusion in case multiple readers got null before creation. - summary = summaries.get(key); - if (summary != null) { - return summary; - } - - // Now we know for sure that we have never before registered. - summary = Summary.build() - .name(annot.name()) - .help(annot.help()) - .register(); - - // Even a rehash of the underlying table will not cause issues as we mutually exclude readers while we - // perform our updates. - summaries.put(key, summary); - - return summary; - } finally { - writeLock.unlock(); - } - } - - @Around("timeable()") - public Object timeMethod(ProceedingJoinPoint pjp) throws Throwable { - String key = pjp.getSignature().toLongString(); - - Summary summary; - final Lock r = summaryLock.readLock(); - r.lock(); - try { - summary = summaries.get(key); - } finally { - r.unlock(); - } - - if (summary == null) { - summary = ensureSummary(pjp, key); - } - - final Summary.Timer t = summary.startTimer(); - - try { - return pjp.proceed(); - } finally { - t.observeDuration(); - } - } -} diff --git a/simpleclient_spring_web/src/test/java/io/prometheus/client/spring/web/MethodTimerAppTest.java b/simpleclient_spring_web/src/test/java/io/prometheus/client/spring/web/MethodTimerAppTest.java deleted file mode 100644 index 5de999178..000000000 --- a/simpleclient_spring_web/src/test/java/io/prometheus/client/spring/web/MethodTimerAppTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package io.prometheus.client.spring.web; - -import org.springframework.stereotype.Controller; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.web.bind.annotation.RequestMapping; - -import static org.junit.Assert.*; - -@ContextConfiguration -@EnablePrometheusTiming -public class MethodTimerAppTest { - - @Controller - public static class MyController { - @RequestMapping("/") - @PrometheusTimeMethod(name = "prom_time_seconds", help = "time") - public void waitJustAGoshDarnSecond() throws Exception { - Thread.sleep(1000); - } - } - - - public static class MyConfig { - - } -} \ No newline at end of file diff --git a/simpleclient_spring_web/src/test/java/io/prometheus/client/spring/web/MethodTimerTest.java b/simpleclient_spring_web/src/test/java/io/prometheus/client/spring/web/MethodTimerTest.java deleted file mode 100644 index 2a1957f38..000000000 --- a/simpleclient_spring_web/src/test/java/io/prometheus/client/spring/web/MethodTimerTest.java +++ /dev/null @@ -1,243 +0,0 @@ -package io.prometheus.client.spring.web; - -import io.prometheus.client.Collector; -import io.prometheus.client.CollectorRegistry; -import org.junit.Assert; -import org.junit.Test; -import org.springframework.aop.aspectj.annotation.AspectJProxyFactory; - -import java.util.Enumeration; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -public class MethodTimerTest { - private interface Timeable { - void timeMe() throws Exception; - } - - private final class TestClass implements Timeable { - @PrometheusTimeMethod(name = "test_class", help = "help one") - public void timeMe() throws Exception { - Thread.sleep(20); - } - - } - - private class TestCglibClassParent implements Timeable{ - @PrometheusTimeMethod(name = "test_sub_class", help = "help one sub") - public void timeMe() throws Exception { - Thread.sleep(20); - } - } - - /** - * mock cglib proxy by subclass and in this class don't contain timMe() method - */ - private final class MockCglibProxyTestClass extends TestCglibClassParent { - - } - - private interface Time2 { - void timeMe() throws Exception; - void aSecondMethod() throws Exception; - } - - @Test - public void timeMethodInSubClassModel() throws Exception { - Timeable cprime = new MockCglibProxyTestClass(); - AspectJProxyFactory factory = new AspectJProxyFactory(cprime); - factory.addAspect(MethodTimer.class); - Timeable proxy = factory.getProxy(); - - proxy.timeMe(); - - final Double tot = CollectorRegistry.defaultRegistry.getSampleValue("test_sub_class_sum"); - Assert.assertNotNull(tot); - assertEquals(0.02, tot, 0.01); - } - - - @Test - public void timeMethod() throws Exception { - Timeable cprime = new TestClass(); - AspectJProxyFactory factory = new AspectJProxyFactory(cprime); - factory.addAspect(MethodTimer.class); - Timeable proxy = factory.getProxy(); - - proxy.timeMe(); - - final Double tot = CollectorRegistry.defaultRegistry.getSampleValue("test_class_sum"); - Assert.assertNotNull(tot); - assertEquals(0.02, tot, 0.01); - } - - T getProxy(T source){ - AspectJProxyFactory factory = new AspectJProxyFactory(source); - factory.addAspect(MethodTimer.class); - return factory.getProxy(); - } - - @Test - public void testValueParam() throws Exception { - final String name = "foobar"; - Time2 a = getProxy(new Time2() { - @PrometheusTimeMethod(name = name, help="help") - @Override - public void timeMe() throws Exception { - Thread.sleep(35); - } - - @Override - public void aSecondMethod() throws Exception { - - } - }); - - a.timeMe(); - - final Double tot = CollectorRegistry.defaultRegistry.getSampleValue(name + "_sum"); - assertEquals(0.035, tot,0.01); - - a.timeMe(); - a.timeMe(); - a.timeMe(); - final Double tot2 = CollectorRegistry.defaultRegistry.getSampleValue(name + "_sum"); - assertEquals(0.035*4, tot2, 0.1); - } - - @Test - public void testHelpParam() throws Exception { - final String name = "foo"; - final String help = "help"; - - Time2 a = getProxy(new Time2() { - @Override - @PrometheusTimeMethod(name = name, help = help) - public void timeMe() throws Exception { - Thread.sleep(100); - } - - @Override - public void aSecondMethod() throws Exception { - - } - }); - - a.timeMe(); - - final Enumeration samples = CollectorRegistry.defaultRegistry.metricFamilySamples(); - - Collector.MetricFamilySamples sample = null; - while (samples.hasMoreElements()) { - sample = samples.nextElement(); - if (name.equals(sample.name)) { - break; - } - } - Assert.assertNotNull(sample); - assertEquals(help, sample.help); - } - - private class MyException extends Exception { - public MyException(String msg) { - super(msg); - } - } - - @Test - public void testThrowWorks() { - Time2 p = getProxy(new Time2() { - @Override - @PrometheusTimeMethod(name="fooasdf", help="bar") - public void timeMe() throws Exception { - Thread.sleep(10); - throw new MyException("Yo this is an exception"); - } - - @Override - public void aSecondMethod() throws Exception { - } - }); - - MyException e = null; - - try { - p.timeMe(); - } catch (Exception e1) { - e = (MyException) e1; - } - - final Double tot = CollectorRegistry.defaultRegistry.getSampleValue("fooasdf_sum"); - assertEquals(0.01, tot, 0.01); - assert(e != null); - } - - @Test - public void testSecondMethod() throws Exception { - final int sleepTime = 90, misnamedSleepTime = 10; - - Time2 p = getProxy(new Time2() { - @Override - @PrometheusTimeMethod(name="fooasdf2", help="bar") - public void timeMe() throws Exception { - Thread.sleep(misnamedSleepTime); - } - - @Override - @PrometheusTimeMethod(name = "second_method_name_seconds", help = "help two") - public void aSecondMethod() throws Exception { - Thread.sleep(sleepTime); - } - }); - - p.timeMe(); - - int count = 5; - for (int i = 0; i < count; i++) { - p.aSecondMethod(); - } - - final Double misnamedTotal = CollectorRegistry.defaultRegistry.getSampleValue("fooasdf2_sum"); - final Double total = CollectorRegistry.defaultRegistry.getSampleValue("second_method_name_seconds_sum"); - - assertNotNull(total); - assertEquals(0.001*count*sleepTime, total, 0.1); - - assertNotNull(misnamedTotal); - assertEquals(0.001*misnamedSleepTime, misnamedTotal, 0.01); - } - - private interface SameMethodNameTest { - void doSomething() throws Exception; - void doSomething(String s) throws Exception; - } - - @Test - public void testOverloadedMethodName() throws Exception { - final int sleep1 = 100, sleep2 = 200; - - SameMethodNameTest r = getProxy(new SameMethodNameTest() { - @Override - @PrometheusTimeMethod(name="dosomething_one_test_seconds", help = "halp") - public void doSomething() throws Exception { - Thread.sleep(sleep1); - } - - @Override - @PrometheusTimeMethod(name = "dosomething_two_test_seconds", help = "also halp") - public void doSomething(String s) throws Exception { - Thread.sleep(sleep2); - } - }); - - r.doSomething(); - r.doSomething("foobar"); - - final Double tot1 = CollectorRegistry.defaultRegistry.getSampleValue("dosomething_one_test_seconds_sum"); - final Double tot2 = CollectorRegistry.defaultRegistry.getSampleValue("dosomething_two_test_seconds_sum"); - - assertEquals(.001*sleep2, tot2,.01); - assertEquals(.001*sleep1, tot1, .01); - } -} diff --git a/simpleclient_vertx/pom.xml b/simpleclient_vertx/pom.xml deleted file mode 100644 index 1c0dd1dcf..000000000 --- a/simpleclient_vertx/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - 4.0.0 - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.8 - 1.8 - - - - - - - io.prometheus - parent - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_vertx - bundle - - Prometheus Java Simpleclient Vert.x - - Vert.x Web Handler exporter for the simpleclient. - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - pmlopes - Paulo Lopes - paulo@mlopes.net - - - - - UTF-8 - - - - - io.prometheus - simpleclient - 0.6.1-SNAPSHOT - - - io.prometheus - simpleclient_common - 0.6.1-SNAPSHOT - - - io.vertx - vertx-web - 3.3.2 - provided - - - - junit - junit - 4.11 - test - - - org.assertj - assertj-core - 2.6.0 - test - - - diff --git a/version-rules.xml b/version-rules.xml new file mode 100644 index 000000000..dd2063cfd --- /dev/null +++ b/version-rules.xml @@ -0,0 +1,6 @@ + + + +